import { defineStore, mapState, mapStores } from "./chunk-EZG7MI55.js"; import { AnnotationService } from "./chunk-NO2C2JJZ.js"; import { $7, M7, V7, z7 } from "./chunk-LSNS3ABG.js"; import "./chunk-GQENOT3W.js"; import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createApp, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, h, inject, isRef, isVNode, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, unref, useAttrs, useSlots, vModelRadio, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "./chunk-HM42ZP2D.js"; import "./chunk-EWTE5DHJ.js"; // node_modules/@abi-software/scaffoldvuer/node_modules/@abi-software/svg-sprite/dist/svg-sprite.js var x = (n, t) => { const e = n.__vccOpts || n; for (const [i, s] of t) e[i] = s; return e; }; var nn = ["xlink:href"]; var en = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: true }, /** * The option to spin the icon. */ spin: { type: Boolean, default: false } }, setup(n) { return (t, e) => (openBlock(), createElementBlock("svg", { class: normalizeClass(["map-icon", { "map-icon-spin": n.spin }]) }, [ createBaseVNode("use", { "xlink:href": `#${n.icon}` }, null, 8, nn) ], 2)); } }; var wn = x(en, [["__scopeId", "data-v-e172d5ff"]]); var v = ` 2horpanel ? `; var w = ` 2vertpanel ? `; var F = ` 3panel ? `; var h2 = ` 4panel ? `; var y = ` 2horpanel ? `; var k = ` 2horpanel ? `; var f = ` 4panel ? `; var m = ` changeBckgd `; var u = ` close no bk `; var _ = ` close `; var C = ` closeFullScreen `; var L = ` Comment `; var b = ` Connection `; var G = ` dock `; var B = ` drawLine `; var T = ` drawPoint `; var q = ` drawPolygon `; var O = ` drawTrash `; var S = ` fitWindow `; var A = ` fullScreen `; var z = 'DataPortal-Icons'; var U = ` magnifyingGlass `; var M = `Created by Wahyu Prihantorofrom the Noun Project`; var $ = ` openMap `; var H = ` Artboard Copy 6 `; var V = ` permalink `; var R = ` play `; var P = ` resetZoom `; var Z = ` singlepanel ? `; var I = ` tooltips ? `; var j = ` undock `; var E = ` zoomIn `; var N = ` zoomOut `; var W = (n, t, e, i) => { const s = ["title", "desc", "defs", "style"], r = ["width", "height"], J = i || []; let o = document.createElement("div"); o.innerHTML = n, s.map((l) => { const c = o.querySelector(l); c && c.remove(); }), r.map((l) => { o.querySelector("svg").removeAttribute(l); }), i && J.map((l) => { Object.values(o.querySelectorAll(`[${l}]`)).map((Q) => { Q.removeAttribute(l); }); }); const K = o.innerHTML; return o = null, K; }; var D = (n) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((i, s) => "".replace.apply(i, s), n).trim(); var tn = true; var sn = true; var on = ["fill"]; var a = Object.assign({ "/assets/icons/2horpanel.svg": v, "/assets/icons/2vertpanel.svg": w, "/assets/icons/3panel.svg": F, "/assets/icons/4panel.svg": h2, "/assets/icons/5panel.svg": y, "/assets/icons/6panel.svg": k, "/assets/icons/6panelVertical.svg": f, "/assets/icons/changeBckgd.svg": m, "/assets/icons/close-no-bk.svg": u, "/assets/icons/close.svg": _, "/assets/icons/closeFullScreen.svg": C, "/assets/icons/comment.svg": L, "/assets/icons/connection.svg": b, "/assets/icons/dock.svg": G, "/assets/icons/drawLine.svg": B, "/assets/icons/drawPoint.svg": T, "/assets/icons/drawPolygon.svg": q, "/assets/icons/drawTrash.svg": O, "/assets/icons/fitWindow.svg": S, "/assets/icons/fullScreen.svg": A, "/assets/icons/help.svg": z, "/assets/icons/magnifyingGlass.svg": U, "/assets/icons/noun-filter.svg": M, "/assets/icons/openMap.svg": $, "/assets/icons/pause.svg": H, "/assets/icons/permalink.svg": V, "/assets/icons/play.svg": R, "/assets/icons/resetZoom.svg": P, "/assets/icons/singlepanel.svg": Z, "/assets/icons/tooltips.svg": I, "/assets/icons/undock.svg": j, "/assets/icons/zoomIn.svg": E, "/assets/icons/zoomOut.svg": N }); var ln = Object.keys(a).map((n) => { const t = W(a[n], tn, sn, on), e = n.replace(/^.+\/(\w+).svg$/, "$1"); return D(t).replace("", "symbol>"); }); var rn = { name: "MapSvgSprite", svgContext: a, svgSprite: ln.join(` `) // concatenate all symbols into $options.svgSprite }; var cn = ["innerHTML"]; function an(n, t, e, i, s, r) { return openBlock(), createElementBlock("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: n.$options.svgSprite }, null, 8, cn); } var Fn = x(rn, [["render", an]]); var g = Object.assign({ "/assets/icons/2horpanel.svg": v, "/assets/icons/2vertpanel.svg": w, "/assets/icons/3panel.svg": F, "/assets/icons/4panel.svg": h2, "/assets/icons/5panel.svg": y, "/assets/icons/6panel.svg": k, "/assets/icons/6panelVertical.svg": f, "/assets/icons/changeBckgd.svg": m, "/assets/icons/close-no-bk.svg": u, "/assets/icons/close.svg": _, "/assets/icons/closeFullScreen.svg": C, "/assets/icons/comment.svg": L, "/assets/icons/connection.svg": b, "/assets/icons/dock.svg": G, "/assets/icons/drawLine.svg": B, "/assets/icons/drawPoint.svg": T, "/assets/icons/drawPolygon.svg": q, "/assets/icons/drawTrash.svg": O, "/assets/icons/fitWindow.svg": S, "/assets/icons/fullScreen.svg": A, "/assets/icons/help.svg": z, "/assets/icons/magnifyingGlass.svg": U, "/assets/icons/noun-filter.svg": M, "/assets/icons/openMap.svg": $, "/assets/icons/pause.svg": H, "/assets/icons/permalink.svg": V, "/assets/icons/play.svg": R, "/assets/icons/resetZoom.svg": P, "/assets/icons/singlepanel.svg": Z, "/assets/icons/tooltips.svg": I, "/assets/icons/undock.svg": j, "/assets/icons/zoomIn.svg": E, "/assets/icons/zoomOut.svg": N }); var gn = Object.keys(g).map((n) => { const t = W(g[n]), e = n.replace(/^.+\/(\w+).svg$/, "$1"); return D(t).replace("", "symbol>"); }); var dn = { name: "MapSvgSpriteColor", svgContext: g, svgSprite: gn.join(` `) // concatenate all symbols into $options.svgSprite }; var pn = ["innerHTML"]; function xn(n, t, e, i, s, r) { return openBlock(), createElementBlock("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: n.$options.svgSprite }, null, 8, pn); } var hn = x(dn, [["render", xn]]); // node_modules/@abi-software/scaffoldvuer/dist/scaffoldvuer.js var Ji = (n, e, { checkForDefaultPrevented: t = true } = {}) => (r) => { const s = n == null ? void 0 : n(r); if (t === false || !s) return e == null ? void 0 : e(r); }; var lw = Object.defineProperty; var cw = Object.defineProperties; var uw = Object.getOwnPropertyDescriptors; var bp = Object.getOwnPropertySymbols; var hw = Object.prototype.hasOwnProperty; var dw = Object.prototype.propertyIsEnumerable; var xp = (n, e, t) => e in n ? lw(n, e, { enumerable: true, configurable: true, writable: true, value: t }) : n[e] = t; var fw = (n, e) => { for (var t in e || (e = {})) hw.call(e, t) && xp(n, t, e[t]); if (bp) for (var t of bp(e)) dw.call(e, t) && xp(n, t, e[t]); return n; }; var pw = (n, e) => cw(n, uw(e)); function Mp(n, e) { var t; const i = shallowRef(); return watchEffect(() => { i.value = n(); }, pw(fw({}, e), { flush: (t = void 0) != null ? t : "sync" })), readonly(i); } var wp; var en2 = typeof window < "u"; var mw = (n) => typeof n == "string"; var Hv = () => { }; var zh = en2 && ((wp = window == null ? void 0 : window.navigator) == null ? void 0 : wp.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function Wv(n) { return typeof n == "function" ? n() : unref(n); } function gw(n) { return n; } function Yc(n) { return getCurrentScope() ? (onScopeDispose(n), true) : false; } function vw(n, e = true) { getCurrentInstance() ? onMounted(n) : e ? n() : nextTick(n); } function er(n) { var e; const t = Wv(n); return (e = t == null ? void 0 : t.$el) != null ? e : t; } var tl = en2 ? window : void 0; var yw = en2 ? window.document : void 0; function un(...n) { let e, t, i, r; if (mw(n[0]) || Array.isArray(n[0]) ? ([t, i, r] = n, e = tl) : [e, t, i, r] = n, !e) return Hv; Array.isArray(t) || (t = [t]), Array.isArray(i) || (i = [i]); const s = [], o = () => { s.forEach((d) => d()), s.length = 0; }, a6 = (d, h6, f6, g6) => (d.addEventListener(h6, f6, g6), () => d.removeEventListener(h6, f6, g6)), c = watch(() => [er(e), Wv(r)], ([d, h6]) => { o(), d && s.push(...t.flatMap((f6) => i.map((g6) => a6(d, f6, g6, h6)))); }, { immediate: true, flush: "post" }), l = () => { c(), o(); }; return Yc(l), l; } var Ap = false; function bw(n, e, t = {}) { const { window: i = tl, ignore: r = [], capture: s = true, detectIframe: o = false } = t; if (!i) return; zh && !Ap && (Ap = true, Array.from(i.document.body.children).forEach((f6) => f6.addEventListener("click", Hv))); let a6 = true; const c = (f6) => r.some((g6) => { if (typeof g6 == "string") return Array.from(i.document.querySelectorAll(g6)).some((p) => p === f6.target || f6.composedPath().includes(p)); { const p = er(g6); return p && (f6.target === p || f6.composedPath().includes(p)); } }), d = [ un(i, "click", (f6) => { const g6 = er(n); if (!(!g6 || g6 === f6.target || f6.composedPath().includes(g6))) { if (f6.detail === 0 && (a6 = !c(f6)), !a6) { a6 = true; return; } e(f6); } }, { passive: true, capture: s }), un(i, "pointerdown", (f6) => { const g6 = er(n); g6 && (a6 = !f6.composedPath().includes(g6) && !c(f6)); }, { passive: true }), o && un(i, "blur", (f6) => { var g6; const p = er(n); ((g6 = i.document.activeElement) == null ? void 0 : g6.tagName) === "IFRAME" && !(p != null && p.contains(i.document.activeElement)) && e(f6); }) ].filter(Boolean); return () => d.forEach((f6) => f6()); } function jv(n, e = false) { const t = ref(), i = () => t.value = !!n(); return i(), vw(i, e), t; } var Sp = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; var _p = "__vueuse_ssr_handlers__"; Sp[_p] = Sp[_p] || {}; function xw({ document: n = yw } = {}) { if (!n) return ref("visible"); const e = ref(n.visibilityState); return un(n, "visibilitychange", () => { e.value = n.visibilityState; }), e; } var Tp = Object.getOwnPropertySymbols; var Mw = Object.prototype.hasOwnProperty; var ww = Object.prototype.propertyIsEnumerable; var Aw = (n, e) => { var t = {}; for (var i in n) Mw.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]); if (n != null && Tp) for (var i of Tp(n)) e.indexOf(i) < 0 && ww.call(n, i) && (t[i] = n[i]); return t; }; function Jn(n, e, t = {}) { const i = t, { window: r = tl } = i, s = Aw(i, ["window"]); let o; const a6 = jv(() => r && "ResizeObserver" in r), c = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => er(n), (h6) => { c(), a6.value && r && h6 && (o = new ResizeObserver(e), o.observe(h6, s)); }, { immediate: true, flush: "post" }), d = () => { c(), l(); }; return Yc(d), { isSupported: a6, stop: d }; } var Ep = Object.getOwnPropertySymbols; var Sw = Object.prototype.hasOwnProperty; var _w = Object.prototype.propertyIsEnumerable; var Tw = (n, e) => { var t = {}; for (var i in n) Sw.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]); if (n != null && Ep) for (var i of Ep(n)) e.indexOf(i) < 0 && _w.call(n, i) && (t[i] = n[i]); return t; }; function Ew(n, e, t = {}) { const i = t, { window: r = tl } = i, s = Tw(i, ["window"]); let o; const a6 = jv(() => r && "MutationObserver" in r), c = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => er(n), (h6) => { c(), a6.value && r && h6 && (o = new MutationObserver(e), o.observe(h6, s)); }, { immediate: true }), d = () => { c(), l(); }; return Yc(d), { isSupported: a6, stop: d }; } var Cp; (function(n) { n.UP = "UP", n.RIGHT = "RIGHT", n.DOWN = "DOWN", n.LEFT = "LEFT", n.NONE = "NONE"; })(Cp || (Cp = {})); var Cw = Object.defineProperty; var Lp = Object.getOwnPropertySymbols; var Lw = Object.prototype.hasOwnProperty; var Rw = Object.prototype.propertyIsEnumerable; var Rp = (n, e, t) => e in n ? Cw(n, e, { enumerable: true, configurable: true, writable: true, value: t }) : n[e] = t; var Fw = (n, e) => { for (var t in e || (e = {})) Lw.call(e, t) && Rp(n, t, e[t]); if (Lp) for (var t of Lp(e)) Rw.call(e, t) && Rp(n, t, e[t]); return n; }; var Pw = { easeInSine: [0.12, 0, 0.39, 0], easeOutSine: [0.61, 1, 0.88, 1], easeInOutSine: [0.37, 0, 0.63, 1], easeInQuad: [0.11, 0, 0.5, 0], easeOutQuad: [0.5, 1, 0.89, 1], easeInOutQuad: [0.45, 0, 0.55, 1], easeInCubic: [0.32, 0, 0.67, 0], easeOutCubic: [0.33, 1, 0.68, 1], easeInOutCubic: [0.65, 0, 0.35, 1], easeInQuart: [0.5, 0, 0.75, 0], easeOutQuart: [0.25, 1, 0.5, 1], easeInOutQuart: [0.76, 0, 0.24, 1], easeInQuint: [0.64, 0, 0.78, 0], easeOutQuint: [0.22, 1, 0.36, 1], easeInOutQuint: [0.83, 0, 0.17, 1], easeInExpo: [0.7, 0, 0.84, 0], easeOutExpo: [0.16, 1, 0.3, 1], easeInOutExpo: [0.87, 0, 0.13, 1], easeInCirc: [0.55, 0, 1, 0.45], easeOutCirc: [0, 0.55, 0.45, 1], easeInOutCirc: [0.85, 0, 0.15, 1], easeInBack: [0.36, 0, 0.66, -0.56], easeOutBack: [0.34, 1.56, 0.64, 1], easeInOutBack: [0.68, -0.6, 0.32, 1.6] }; Fw({ linear: gw }, Pw); function Iw({ window: n = tl } = {}) { if (!n) return ref(false); const e = ref(n.document.hasFocus()); return un(n, "blur", () => { e.value = false; }), un(n, "focus", () => { e.value = true; }), e; } var Ow = () => en2 && /firefox/i.test(window.navigator.userAgent); Object.freeze({}); Object.freeze([]); var Oa = () => { }; var Dw = Object.prototype.hasOwnProperty; var Fp = (n, e) => Dw.call(n, e); var Pn = Array.isArray; var Sn = (n) => typeof n == "function"; var vn = (n) => typeof n == "string"; var Tn = (n) => n !== null && typeof n == "object"; var Nw = Object.prototype.toString; var Bw = (n) => Nw.call(n); var Pu = (n) => Bw(n).slice(8, -1); var kd = (n) => { const e = /* @__PURE__ */ Object.create(null); return (t) => e[t] || (e[t] = n(t)); }; var Uw = /-(\w)/g; var zw = kd( (n) => n.replace(Uw, (e, t) => t ? t.toUpperCase() : "") ); var kw = /\B([A-Z])/g; var Vw = kd( (n) => n.replace(kw, "-$1").toLowerCase() ); var Gw = kd((n) => n.charAt(0).toUpperCase() + n.slice(1)); var $v = typeof global == "object" && global && global.Object === Object && global; var Hw = typeof self == "object" && self && self.Object === Object && self; var Bi = $v || Hw || Function("return this")(); var Pi = Bi.Symbol; var Zv = Object.prototype; var Ww = Zv.hasOwnProperty; var jw = Zv.toString; var la = Pi ? Pi.toStringTag : void 0; function $w(n) { var e = Ww.call(n, la), t = n[la]; try { n[la] = void 0; var i = true; } catch { } var r = jw.call(n); return i && (e ? n[la] = t : delete n[la]), r; } var Zw = Object.prototype; var Xw = Zw.toString; function Yw(n) { return Xw.call(n); } var Jw = "[object Null]"; var Kw = "[object Undefined]"; var Pp = Pi ? Pi.toStringTag : void 0; function Zo(n) { return n == null ? n === void 0 ? Kw : Jw : Pp && Pp in Object(n) ? $w(n) : Yw(n); } function Mo(n) { return n != null && typeof n == "object"; } var qw = "[object Symbol]"; function Jc(n) { return typeof n == "symbol" || Mo(n) && Zo(n) == qw; } function Qw(n, e) { for (var t = -1, i = n == null ? 0 : n.length, r = Array(i); ++t < i; ) r[t] = e(n[t], t, n); return r; } var pi = Array.isArray; var e1 = 1 / 0; var Ip = Pi ? Pi.prototype : void 0; var Op = Ip ? Ip.toString : void 0; function Xv(n) { if (typeof n == "string") return n; if (pi(n)) return Qw(n, Xv) + ""; if (Jc(n)) return Op ? Op.call(n) : ""; var e = n + ""; return e == "0" && 1 / n == -e1 ? "-0" : e; } var t1 = /\s/; function n1(n) { for (var e = n.length; e-- && t1.test(n.charAt(e)); ) ; return e; } var i1 = /^\s+/; function r1(n) { return n && n.slice(0, n1(n) + 1).replace(i1, ""); } function Ur(n) { var e = typeof n; return n != null && (e == "object" || e == "function"); } var Dp = NaN; var s1 = /^[-+]0x[0-9a-f]+$/i; var o1 = /^0b[01]+$/i; var a1 = /^0o[0-7]+$/i; var l1 = parseInt; function Np(n) { if (typeof n == "number") return n; if (Jc(n)) return Dp; if (Ur(n)) { var e = typeof n.valueOf == "function" ? n.valueOf() : n; n = Ur(e) ? e + "" : e; } if (typeof n != "string") return n === 0 ? n : +n; n = r1(n); var t = o1.test(n); return t || a1.test(n) ? l1(n.slice(2), t ? 2 : 8) : s1.test(n) ? Dp : +n; } function Yv(n) { return n; } var c1 = "[object AsyncFunction]"; var u1 = "[object Function]"; var h1 = "[object GeneratorFunction]"; var d1 = "[object Proxy]"; function Jv(n) { if (!Ur(n)) return false; var e = Zo(n); return e == u1 || e == h1 || e == c1 || e == d1; } var Iu = Bi["__core-js_shared__"]; var Bp = function() { var n = /[^.]+$/.exec(Iu && Iu.keys && Iu.keys.IE_PROTO || ""); return n ? "Symbol(src)_1." + n : ""; }(); function f1(n) { return !!Bp && Bp in n; } var p1 = Function.prototype; var m1 = p1.toString; function Os(n) { if (n != null) { try { return m1.call(n); } catch { } try { return n + ""; } catch { } } return ""; } var g1 = /[\\^$.*+?()[\]{}|]/g; var v1 = /^\[object .+?Constructor\]$/; var y1 = Function.prototype; var b1 = Object.prototype; var x1 = y1.toString; var M1 = b1.hasOwnProperty; var w1 = RegExp( "^" + x1.call(M1).replace(g1, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function A1(n) { if (!Ur(n) || f1(n)) return false; var e = Jv(n) ? w1 : v1; return e.test(Os(n)); } function S1(n, e) { return n == null ? void 0 : n[e]; } function Ds(n, e) { var t = S1(n, e); return A1(t) ? t : void 0; } var kh = Ds(Bi, "WeakMap"); function _1(n, e, t) { switch (t.length) { case 0: return n.call(e); case 1: return n.call(e, t[0]); case 2: return n.call(e, t[0], t[1]); case 3: return n.call(e, t[0], t[1], t[2]); } return n.apply(e, t); } var T1 = 800; var E1 = 16; var C1 = Date.now; function L1(n) { var e = 0, t = 0; return function() { var i = C1(), r = E1 - (i - t); if (t = i, r > 0) { if (++e >= T1) return arguments[0]; } else e = 0; return n.apply(void 0, arguments); }; } function R1(n) { return function() { return n; }; } var Fc = function() { try { var n = Ds(Object, "defineProperty"); return n({}, "", {}), n; } catch { } }(); var F1 = Fc ? function(n, e) { return Fc(n, "toString", { configurable: true, enumerable: false, value: R1(e), writable: true }); } : Yv; var P1 = L1(F1); function I1(n, e, t, i) { n.length; for (var r = t + 1; r--; ) if (e(n[r], r, n)) return r; return -1; } var O1 = 9007199254740991; var D1 = /^(?:0|[1-9]\d*)$/; function Vd(n, e) { var t = typeof n; return e = e ?? O1, !!e && (t == "number" || t != "symbol" && D1.test(n)) && n > -1 && n % 1 == 0 && n < e; } function N1(n, e, t) { e == "__proto__" && Fc ? Fc(n, e, { configurable: true, enumerable: true, value: t, writable: true }) : n[e] = t; } function Gd(n, e) { return n === e || n !== n && e !== e; } var B1 = Object.prototype; var U1 = B1.hasOwnProperty; function z1(n, e, t) { var i = n[e]; (!(U1.call(n, e) && Gd(i, t)) || t === void 0 && !(e in n)) && N1(n, e, t); } var Up = Math.max; function k1(n, e, t) { return e = Up(e === void 0 ? n.length - 1 : e, 0), function() { for (var i = arguments, r = -1, s = Up(i.length - e, 0), o = Array(s); ++r < s; ) o[r] = i[e + r]; r = -1; for (var a6 = Array(e + 1); ++r < e; ) a6[r] = i[r]; return a6[e] = t(o), _1(n, this, a6); }; } var V1 = 9007199254740991; function Hd(n) { return typeof n == "number" && n > -1 && n % 1 == 0 && n <= V1; } function G1(n) { return n != null && Hd(n.length) && !Jv(n); } var H1 = Object.prototype; function W1(n) { var e = n && n.constructor, t = typeof e == "function" && e.prototype || H1; return n === t; } function j1(n, e) { for (var t = -1, i = Array(n); ++t < n; ) i[t] = e(t); return i; } var $1 = "[object Arguments]"; function zp(n) { return Mo(n) && Zo(n) == $1; } var Kv = Object.prototype; var Z1 = Kv.hasOwnProperty; var X1 = Kv.propertyIsEnumerable; var Wd = zp(/* @__PURE__ */ function() { return arguments; }()) ? zp : function(n) { return Mo(n) && Z1.call(n, "callee") && !X1.call(n, "callee"); }; function Y1() { return false; } var qv = typeof exports == "object" && exports && !exports.nodeType && exports; var kp = qv && typeof module == "object" && module && !module.nodeType && module; var J1 = kp && kp.exports === qv; var Vp = J1 ? Bi.Buffer : void 0; var K1 = Vp ? Vp.isBuffer : void 0; var Vh = K1 || Y1; var q1 = "[object Arguments]"; var Q1 = "[object Array]"; var eA = "[object Boolean]"; var tA = "[object Date]"; var nA = "[object Error]"; var iA = "[object Function]"; var rA = "[object Map]"; var sA = "[object Number]"; var oA = "[object Object]"; var aA = "[object RegExp]"; var lA = "[object Set]"; var cA = "[object String]"; var uA = "[object WeakMap]"; var hA = "[object ArrayBuffer]"; var dA = "[object DataView]"; var fA = "[object Float32Array]"; var pA = "[object Float64Array]"; var mA = "[object Int8Array]"; var gA = "[object Int16Array]"; var vA = "[object Int32Array]"; var yA = "[object Uint8Array]"; var bA = "[object Uint8ClampedArray]"; var xA = "[object Uint16Array]"; var MA = "[object Uint32Array]"; var Et = {}; Et[fA] = Et[pA] = Et[mA] = Et[gA] = Et[vA] = Et[yA] = Et[bA] = Et[xA] = Et[MA] = true; Et[q1] = Et[Q1] = Et[hA] = Et[eA] = Et[dA] = Et[tA] = Et[nA] = Et[iA] = Et[rA] = Et[sA] = Et[oA] = Et[aA] = Et[lA] = Et[cA] = Et[uA] = false; function wA(n) { return Mo(n) && Hd(n.length) && !!Et[Zo(n)]; } function AA(n) { return function(e) { return n(e); }; } var Qv = typeof exports == "object" && exports && !exports.nodeType && exports; var Ea = Qv && typeof module == "object" && module && !module.nodeType && module; var SA = Ea && Ea.exports === Qv; var Ou = SA && $v.process; var Gp = function() { try { var n = Ea && Ea.require && Ea.require("util").types; return n || Ou && Ou.binding && Ou.binding("util"); } catch { } }(); var Hp = Gp && Gp.isTypedArray; var e0 = Hp ? AA(Hp) : wA; var _A = Object.prototype; var TA = _A.hasOwnProperty; function EA(n, e) { var t = pi(n), i = !t && Wd(n), r = !t && !i && Vh(n), s = !t && !i && !r && e0(n), o = t || i || r || s, a6 = o ? j1(n.length, String) : [], c = a6.length; for (var l in n) TA.call(n, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. r && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. s && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. Vd(l, c))) && a6.push(l); return a6; } function CA(n, e) { return function(t) { return n(e(t)); }; } var LA = CA(Object.keys, Object); var RA = Object.prototype; var FA = RA.hasOwnProperty; function PA(n) { if (!W1(n)) return LA(n); var e = []; for (var t in Object(n)) FA.call(n, t) && t != "constructor" && e.push(t); return e; } function t0(n) { return G1(n) ? EA(n) : PA(n); } var IA = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var OA = /^\w*$/; function jd(n, e) { if (pi(n)) return false; var t = typeof n; return t == "number" || t == "symbol" || t == "boolean" || n == null || Jc(n) ? true : OA.test(n) || !IA.test(n) || e != null && n in Object(e); } var Da = Ds(Object, "create"); function DA() { this.__data__ = Da ? Da(null) : {}, this.size = 0; } function NA(n) { var e = this.has(n) && delete this.__data__[n]; return this.size -= e ? 1 : 0, e; } var BA = "__lodash_hash_undefined__"; var UA = Object.prototype; var zA = UA.hasOwnProperty; function kA(n) { var e = this.__data__; if (Da) { var t = e[n]; return t === BA ? void 0 : t; } return zA.call(e, n) ? e[n] : void 0; } var VA = Object.prototype; var GA = VA.hasOwnProperty; function HA(n) { var e = this.__data__; return Da ? e[n] !== void 0 : GA.call(e, n); } var WA = "__lodash_hash_undefined__"; function jA(n, e) { var t = this.__data__; return this.size += this.has(n) ? 0 : 1, t[n] = Da && e === void 0 ? WA : e, this; } function _s(n) { var e = -1, t = n == null ? 0 : n.length; for (this.clear(); ++e < t; ) { var i = n[e]; this.set(i[0], i[1]); } } _s.prototype.clear = DA; _s.prototype.delete = NA; _s.prototype.get = kA; _s.prototype.has = HA; _s.prototype.set = jA; function $A() { this.__data__ = [], this.size = 0; } function Kc(n, e) { for (var t = n.length; t--; ) if (Gd(n[t][0], e)) return t; return -1; } var ZA = Array.prototype; var XA = ZA.splice; function YA(n) { var e = this.__data__, t = Kc(e, n); if (t < 0) return false; var i = e.length - 1; return t == i ? e.pop() : XA.call(e, t, 1), --this.size, true; } function JA(n) { var e = this.__data__, t = Kc(e, n); return t < 0 ? void 0 : e[t][1]; } function KA(n) { return Kc(this.__data__, n) > -1; } function qA(n, e) { var t = this.__data__, i = Kc(t, n); return i < 0 ? (++this.size, t.push([n, e])) : t[i][1] = e, this; } function cr(n) { var e = -1, t = n == null ? 0 : n.length; for (this.clear(); ++e < t; ) { var i = n[e]; this.set(i[0], i[1]); } } cr.prototype.clear = $A; cr.prototype.delete = YA; cr.prototype.get = JA; cr.prototype.has = KA; cr.prototype.set = qA; var Na = Ds(Bi, "Map"); function QA() { this.size = 0, this.__data__ = { hash: new _s(), map: new (Na || cr)(), string: new _s() }; } function eS(n) { var e = typeof n; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? n !== "__proto__" : n === null; } function qc(n, e) { var t = n.__data__; return eS(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map; } function tS(n) { var e = qc(this, n).delete(n); return this.size -= e ? 1 : 0, e; } function nS(n) { return qc(this, n).get(n); } function iS(n) { return qc(this, n).has(n); } function rS(n, e) { var t = qc(this, n), i = t.size; return t.set(n, e), this.size += t.size == i ? 0 : 1, this; } function ur(n) { var e = -1, t = n == null ? 0 : n.length; for (this.clear(); ++e < t; ) { var i = n[e]; this.set(i[0], i[1]); } } ur.prototype.clear = QA; ur.prototype.delete = tS; ur.prototype.get = nS; ur.prototype.has = iS; ur.prototype.set = rS; var sS = "Expected a function"; function $d(n, e) { if (typeof n != "function" || e != null && typeof e != "function") throw new TypeError(sS); var t = function() { var i = arguments, r = e ? e.apply(this, i) : i[0], s = t.cache; if (s.has(r)) return s.get(r); var o = n.apply(this, i); return t.cache = s.set(r, o) || s, o; }; return t.cache = new ($d.Cache || ur)(), t; } $d.Cache = ur; var oS = 500; function aS(n) { var e = $d(n, function(i) { return t.size === oS && t.clear(), i; }), t = e.cache; return e; } var lS = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var cS = /\\(\\)?/g; var uS = aS(function(n) { var e = []; return n.charCodeAt(0) === 46 && e.push(""), n.replace(lS, function(t, i, r, s) { e.push(r ? s.replace(cS, "$1") : i || t); }), e; }); function hS(n) { return n == null ? "" : Xv(n); } function Qc(n, e) { return pi(n) ? n : jd(n, e) ? [n] : uS(hS(n)); } var dS = 1 / 0; function nl(n) { if (typeof n == "string" || Jc(n)) return n; var e = n + ""; return e == "0" && 1 / n == -dS ? "-0" : e; } function Zd(n, e) { e = Qc(e, n); for (var t = 0, i = e.length; n != null && t < i; ) n = n[nl(e[t++])]; return t && t == i ? n : void 0; } function Ki(n, e, t) { var i = n == null ? void 0 : Zd(n, e); return i === void 0 ? t : i; } function n0(n, e) { for (var t = -1, i = e.length, r = n.length; ++t < i; ) n[r + t] = e[t]; return n; } var Wp = Pi ? Pi.isConcatSpreadable : void 0; function fS(n) { return pi(n) || Wd(n) || !!(Wp && n && n[Wp]); } function pS(n, e, t, i, r) { var s = -1, o = n.length; for (t || (t = fS), r || (r = []); ++s < o; ) { var a6 = n[s]; t(a6) ? n0(r, a6) : r[r.length] = a6; } return r; } function mS(n) { var e = n == null ? 0 : n.length; return e ? pS(n) : []; } function gS(n) { return P1(k1(n, void 0, mS), n + ""); } function Si() { if (!arguments.length) return []; var n = arguments[0]; return pi(n) ? n : [n]; } function vS() { this.__data__ = new cr(), this.size = 0; } function yS(n) { var e = this.__data__, t = e.delete(n); return this.size = e.size, t; } function bS(n) { return this.__data__.get(n); } function xS(n) { return this.__data__.has(n); } var MS = 200; function wS(n, e) { var t = this.__data__; if (t instanceof cr) { var i = t.__data__; if (!Na || i.length < MS - 1) return i.push([n, e]), this.size = ++t.size, this; t = this.__data__ = new ur(i); } return t.set(n, e), this.size = t.size, this; } function tr(n) { var e = this.__data__ = new cr(n); this.size = e.size; } tr.prototype.clear = vS; tr.prototype.delete = yS; tr.prototype.get = bS; tr.prototype.has = xS; tr.prototype.set = wS; function AS(n, e) { for (var t = -1, i = n == null ? 0 : n.length, r = 0, s = []; ++t < i; ) { var o = n[t]; e(o, t, n) && (s[r++] = o); } return s; } function SS() { return []; } var _S = Object.prototype; var TS = _S.propertyIsEnumerable; var jp = Object.getOwnPropertySymbols; var ES = jp ? function(n) { return n == null ? [] : (n = Object(n), AS(jp(n), function(e) { return TS.call(n, e); })); } : SS; function CS(n, e, t) { var i = e(n); return pi(n) ? i : n0(i, t(n)); } function $p(n) { return CS(n, t0, ES); } var Gh = Ds(Bi, "DataView"); var Hh = Ds(Bi, "Promise"); var Wh = Ds(Bi, "Set"); var Zp = "[object Map]"; var LS = "[object Object]"; var Xp = "[object Promise]"; var Yp = "[object Set]"; var Jp = "[object WeakMap]"; var Kp = "[object DataView]"; var RS = Os(Gh); var FS = Os(Na); var PS = Os(Hh); var IS = Os(Wh); var OS = Os(kh); var Cr = Zo; (Gh && Cr(new Gh(new ArrayBuffer(1))) != Kp || Na && Cr(new Na()) != Zp || Hh && Cr(Hh.resolve()) != Xp || Wh && Cr(new Wh()) != Yp || kh && Cr(new kh()) != Jp) && (Cr = function(n) { var e = Zo(n), t = e == LS ? n.constructor : void 0, i = t ? Os(t) : ""; if (i) switch (i) { case RS: return Kp; case FS: return Zp; case PS: return Xp; case IS: return Yp; case OS: return Jp; } return e; }); var qp = Bi.Uint8Array; var DS = "__lodash_hash_undefined__"; function NS(n) { return this.__data__.set(n, DS), this; } function BS(n) { return this.__data__.has(n); } function Pc(n) { var e = -1, t = n == null ? 0 : n.length; for (this.__data__ = new ur(); ++e < t; ) this.add(n[e]); } Pc.prototype.add = Pc.prototype.push = NS; Pc.prototype.has = BS; function US(n, e) { for (var t = -1, i = n == null ? 0 : n.length; ++t < i; ) if (e(n[t], t, n)) return true; return false; } function zS(n, e) { return n.has(e); } var kS = 1; var VS = 2; function i0(n, e, t, i, r, s) { var o = t & kS, a6 = n.length, c = e.length; if (a6 != c && !(o && c > a6)) return false; var l = s.get(n), d = s.get(e); if (l && d) return l == e && d == n; var h6 = -1, f6 = true, g6 = t & VS ? new Pc() : void 0; for (s.set(n, e), s.set(e, n); ++h6 < a6; ) { var p = n[h6], u6 = e[h6]; if (i) var y6 = o ? i(u6, p, h6, e, n, s) : i(p, u6, h6, n, e, s); if (y6 !== void 0) { if (y6) continue; f6 = false; break; } if (g6) { if (!US(e, function(v6, m6) { if (!zS(g6, m6) && (p === v6 || r(p, v6, t, i, s))) return g6.push(m6); })) { f6 = false; break; } } else if (!(p === u6 || r(p, u6, t, i, s))) { f6 = false; break; } } return s.delete(n), s.delete(e), f6; } function GS(n) { var e = -1, t = Array(n.size); return n.forEach(function(i, r) { t[++e] = [r, i]; }), t; } function HS(n) { var e = -1, t = Array(n.size); return n.forEach(function(i) { t[++e] = i; }), t; } var WS = 1; var jS = 2; var $S = "[object Boolean]"; var ZS = "[object Date]"; var XS = "[object Error]"; var YS = "[object Map]"; var JS = "[object Number]"; var KS = "[object RegExp]"; var qS = "[object Set]"; var QS = "[object String]"; var e_ = "[object Symbol]"; var t_ = "[object ArrayBuffer]"; var n_ = "[object DataView]"; var Qp = Pi ? Pi.prototype : void 0; var Du = Qp ? Qp.valueOf : void 0; function i_(n, e, t, i, r, s, o) { switch (t) { case n_: if (n.byteLength != e.byteLength || n.byteOffset != e.byteOffset) return false; n = n.buffer, e = e.buffer; case t_: return !(n.byteLength != e.byteLength || !s(new qp(n), new qp(e))); case $S: case ZS: case JS: return Gd(+n, +e); case XS: return n.name == e.name && n.message == e.message; case KS: case QS: return n == e + ""; case YS: var a6 = GS; case qS: var c = i & WS; if (a6 || (a6 = HS), n.size != e.size && !c) return false; var l = o.get(n); if (l) return l == e; i |= jS, o.set(n, e); var d = i0(a6(n), a6(e), i, r, s, o); return o.delete(n), d; case e_: if (Du) return Du.call(n) == Du.call(e); } return false; } var r_ = 1; var s_ = Object.prototype; var o_ = s_.hasOwnProperty; function a_(n, e, t, i, r, s) { var o = t & r_, a6 = $p(n), c = a6.length, l = $p(e), d = l.length; if (c != d && !o) return false; for (var h6 = c; h6--; ) { var f6 = a6[h6]; if (!(o ? f6 in e : o_.call(e, f6))) return false; } var g6 = s.get(n), p = s.get(e); if (g6 && p) return g6 == e && p == n; var u6 = true; s.set(n, e), s.set(e, n); for (var y6 = o; ++h6 < c; ) { f6 = a6[h6]; var v6 = n[f6], m6 = e[f6]; if (i) var x6 = o ? i(m6, v6, f6, e, n, s) : i(v6, m6, f6, n, e, s); if (!(x6 === void 0 ? v6 === m6 || r(v6, m6, t, i, s) : x6)) { u6 = false; break; } y6 || (y6 = f6 == "constructor"); } if (u6 && !y6) { var w6 = n.constructor, A6 = e.constructor; w6 != A6 && "constructor" in n && "constructor" in e && !(typeof w6 == "function" && w6 instanceof w6 && typeof A6 == "function" && A6 instanceof A6) && (u6 = false); } return s.delete(n), s.delete(e), u6; } var l_ = 1; var em = "[object Arguments]"; var tm = "[object Array]"; var _l = "[object Object]"; var c_ = Object.prototype; var nm = c_.hasOwnProperty; function u_(n, e, t, i, r, s) { var o = pi(n), a6 = pi(e), c = o ? tm : Cr(n), l = a6 ? tm : Cr(e); c = c == em ? _l : c, l = l == em ? _l : l; var d = c == _l, h6 = l == _l, f6 = c == l; if (f6 && Vh(n)) { if (!Vh(e)) return false; o = true, d = false; } if (f6 && !d) return s || (s = new tr()), o || e0(n) ? i0(n, e, t, i, r, s) : i_(n, e, c, t, i, r, s); if (!(t & l_)) { var g6 = d && nm.call(n, "__wrapped__"), p = h6 && nm.call(e, "__wrapped__"); if (g6 || p) { var u6 = g6 ? n.value() : n, y6 = p ? e.value() : e; return s || (s = new tr()), r(u6, y6, t, i, s); } } return f6 ? (s || (s = new tr()), a_(n, e, t, i, r, s)) : false; } function eu(n, e, t, i, r) { return n === e ? true : n == null || e == null || !Mo(n) && !Mo(e) ? n !== n && e !== e : u_(n, e, t, i, eu, r); } var h_ = 1; var d_ = 2; function f_(n, e, t, i) { var r = t.length, s = r; if (n == null) return !s; for (n = Object(n); r--; ) { var o = t[r]; if (o[2] ? o[1] !== n[o[0]] : !(o[0] in n)) return false; } for (; ++r < s; ) { o = t[r]; var a6 = o[0], c = n[a6], l = o[1]; if (o[2]) { if (c === void 0 && !(a6 in n)) return false; } else { var d = new tr(), h6; if (!(h6 === void 0 ? eu(l, c, h_ | d_, i, d) : h6)) return false; } } return true; } function r0(n) { return n === n && !Ur(n); } function p_(n) { for (var e = t0(n), t = e.length; t--; ) { var i = e[t], r = n[i]; e[t] = [i, r, r0(r)]; } return e; } function s0(n, e) { return function(t) { return t == null ? false : t[n] === e && (e !== void 0 || n in Object(t)); }; } function m_(n) { var e = p_(n); return e.length == 1 && e[0][2] ? s0(e[0][0], e[0][1]) : function(t) { return t === n || f_(t, n, e); }; } function g_(n, e) { return n != null && e in Object(n); } function v_(n, e, t) { e = Qc(e, n); for (var i = -1, r = e.length, s = false; ++i < r; ) { var o = nl(e[i]); if (!(s = n != null && t(n, o))) break; n = n[o]; } return s || ++i != r ? s : (r = n == null ? 0 : n.length, !!r && Hd(r) && Vd(o, r) && (pi(n) || Wd(n))); } function o0(n, e) { return n != null && v_(n, e, g_); } var y_ = 1; var b_ = 2; function x_(n, e) { return jd(n) && r0(e) ? s0(nl(n), e) : function(t) { var i = Ki(t, n); return i === void 0 && i === e ? o0(t, n) : eu(e, i, y_ | b_); }; } function M_(n) { return function(e) { return e == null ? void 0 : e[n]; }; } function w_(n) { return function(e) { return Zd(e, n); }; } function A_(n) { return jd(n) ? M_(nl(n)) : w_(n); } function S_(n) { return typeof n == "function" ? n : n == null ? Yv : typeof n == "object" ? pi(n) ? x_(n[0], n[1]) : m_(n) : A_(n); } var Nu = function() { return Bi.Date.now(); }; var __ = "Expected a function"; var T_ = Math.max; var E_ = Math.min; function jh(n, e, t) { var i, r, s, o, a6, c, l = 0, d = false, h6 = false, f6 = true; if (typeof n != "function") throw new TypeError(__); e = Np(e) || 0, Ur(t) && (d = !!t.leading, h6 = "maxWait" in t, s = h6 ? T_(Np(t.maxWait) || 0, e) : s, f6 = "trailing" in t ? !!t.trailing : f6); function g6(M6) { var R6 = i, L6 = r; return i = r = void 0, l = M6, o = n.apply(L6, R6), o; } function p(M6) { return l = M6, a6 = setTimeout(v6, e), d ? g6(M6) : o; } function u6(M6) { var R6 = M6 - c, L6 = M6 - l, T6 = e - R6; return h6 ? E_(T6, s - L6) : T6; } function y6(M6) { var R6 = M6 - c, L6 = M6 - l; return c === void 0 || R6 >= e || R6 < 0 || h6 && L6 >= s; } function v6() { var M6 = Nu(); if (y6(M6)) return m6(M6); a6 = setTimeout(v6, u6(M6)); } function m6(M6) { return a6 = void 0, f6 && i ? g6(M6) : (i = r = void 0, o); } function x6() { a6 !== void 0 && clearTimeout(a6), l = 0, i = c = r = a6 = void 0; } function w6() { return a6 === void 0 ? o : m6(Nu()); } function A6() { var M6 = Nu(), R6 = y6(M6); if (i = arguments, r = this, c = M6, R6) { if (a6 === void 0) return p(c); if (h6) return clearTimeout(a6), a6 = setTimeout(v6, e), g6(c); } return a6 === void 0 && (a6 = setTimeout(v6, e)), o; } return A6.cancel = x6, A6.flush = w6, A6; } function C_(n, e, t) { var i = n == null ? 0 : n.length; if (!i) return -1; var r = i - 1; return I1(n, S_(e), r); } function Ic(n) { for (var e = -1, t = n == null ? 0 : n.length, i = {}; ++e < t; ) { var r = n[e]; i[r[0]] = r[1]; } return i; } function $h(n, e) { return eu(n, e); } function Ci(n) { return n == null; } function L_(n) { return n === void 0; } function R_(n, e, t, i) { if (!Ur(n)) return n; e = Qc(e, n); for (var r = -1, s = e.length, o = s - 1, a6 = n; a6 != null && ++r < s; ) { var c = nl(e[r]), l = t; if (c === "__proto__" || c === "constructor" || c === "prototype") return n; if (r != o) { var d = a6[c]; l = void 0, l === void 0 && (l = Ur(d) ? d : Vd(e[r + 1]) ? [] : {}); } z1(a6, c, l), a6 = a6[c]; } return n; } function F_(n, e, t) { for (var i = -1, r = e.length, s = {}; ++i < r; ) { var o = e[i], a6 = Zd(n, o); t(a6, o) && R_(s, Qc(o, n), a6); } return s; } function P_(n, e) { return F_(n, e, function(t, i) { return o0(n, i); }); } var I_ = gS(function(n, e) { return n == null ? {} : P_(n, e); }); var di = (n) => n === void 0; var Ba = (n) => typeof n == "boolean"; var yt = (n) => typeof n == "number"; var ys = (n) => typeof Element > "u" ? false : n instanceof Element; var im = (n) => Ci(n); var O_ = (n) => vn(n) ? !Number.isNaN(Number(n)) : false; var D_ = (n = "") => n.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); var Rr = (n) => Gw(n); var rm = (n) => Object.keys(n); var a0 = class extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } }; function Xo(n, e) { throw new a0(`[${n}] ${e}`); } function kt(n, e) { if (true) { const t = vn(n) ? new a0(`[${n}] ${e}`) : n; console.warn(t); } } var N_ = "utils/dom/style"; var l0 = (n = "") => n.split(" ").filter((e) => !!e.trim()); var sm = (n, e) => { !n || !e.trim() || n.classList.add(...l0(e)); }; var Oc = (n, e) => { !n || !e.trim() || n.classList.remove(...l0(e)); }; var ca = (n, e) => { var t; if (!en2 || !n || !e) return ""; let i = zw(e); i === "float" && (i = "cssFloat"); try { const r = n.style[i]; if (r) return r; const s = (t = document.defaultView) == null ? void 0 : t.getComputedStyle(n, ""); return s ? s[i] : ""; } catch { return n.style[i]; } }; function Dc(n, e = "px") { if (!n) return ""; if (yt(n) || O_(n)) return `${n}${e}`; if (vn(n)) return n; kt(N_, "binding value must be a string or number"); } function B_(n, e) { if (!en2) return; if (!e) { n.scrollTop = 0; return; } const t = []; let i = e.offsetParent; for (; i !== null && n !== i && n.contains(i); ) t.push(i), i = i.offsetParent; const r = e.offsetTop + t.reduce((c, l) => c + l.offsetTop, 0), s = r + e.offsetHeight, o = n.scrollTop, a6 = o + n.clientHeight; r < o ? n.scrollTop = r : s > a6 && (n.scrollTop = s - n.clientHeight); } var U_ = defineComponent({ name: "ArrowDown", __name: "arrow-down", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }); var Xd = U_; var z_ = defineComponent({ name: "ArrowLeft", __name: "arrow-left", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z" }) ])); } }); var zr = z_; var k_ = defineComponent({ name: "ArrowRight", __name: "arrow-right", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z" }) ])); } }); var kr = k_; var V_ = defineComponent({ name: "ArrowUp", __name: "arrow-up", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }); var G_ = V_; var H_ = defineComponent({ name: "CircleCheck", __name: "circle-check", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }); var W_ = H_; var j_ = defineComponent({ name: "CircleClose", __name: "circle-close", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }); var Yd = j_; var $_ = defineComponent({ name: "Close", __name: "close", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }); var Zh = $_; var Z_ = defineComponent({ name: "Delete", __name: "delete", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }); var Nc = Z_; var X_ = defineComponent({ name: "Hide", __name: "hide", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" }), createBaseVNode("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" }) ])); } }); var Y_ = X_; var J_ = defineComponent({ name: "Loading", __name: "loading", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }); var c0 = J_; var K_ = defineComponent({ name: "Minus", __name: "minus", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64" }) ])); } }); var q_ = K_; var Q_ = defineComponent({ name: "Plus", __name: "plus", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z" }) ])); } }); var tu = Q_; var eT = defineComponent({ name: "View", __name: "view", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }); var tT = eT; var nT = defineComponent({ name: "WarningFilled", __name: "warning-filled", setup(n) { return (e, t) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4" }) ])); } }); var u0 = nT; var h0 = "__epPropKey"; var Je = (n) => n; var iT = (n) => Tn(n) && !!n[h0]; var nu = (n, e) => { if (!Tn(n) || iT(n)) return n; const { values: t, required: i, default: r, type: s, validator: o } = n, c = { type: s, required: !!i, validator: t || o ? (l) => { let d = false, h6 = []; if (t && (h6 = Array.from(t), Fp(n, "default") && h6.push(r), d || (d = h6.includes(l))), o && (d || (d = o(l))), !d && h6.length > 0) { const f6 = [...new Set(h6)].map((g6) => JSON.stringify(g6)).join(", "); warn(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${f6}], got value ${JSON.stringify(l)}.`); } return d; } : void 0, [h0]: true }; return Fp(n, "default") && (c.default = r), c; }; var at = (n) => Ic(Object.entries(n).map(([e, t]) => [ e, nu(t, e) ])); var Vr = Je([ String, Object, Function ]); var d0 = { validating: c0, success: W_, error: Yd }; var on2 = (n, e) => { if (n.install = (t) => { for (const i of [n, ...Object.values(e ?? {})]) t.component(i.name, i); }, e) for (const [t, i] of Object.entries(e)) n[t] = i; return n; }; var rT = (n, e) => (n.install = (t) => { t.directive(e, n); }, n); var vi = (n) => (n.install = Oa, n); var Li = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; var At = "update:modelValue"; var hr = "change"; var bs = "input"; var f0 = ["", "default", "small", "large"]; var Sc = (n) => { const e = Pn(n) ? n : [n], t = []; return e.forEach((i) => { var r; Pn(i) ? t.push(...Sc(i)) : isVNode(i) && Pn(i.children) ? t.push(...Sc(i.children)) : (t.push(i), isVNode(i) && ((r = i.component) != null && r.subTree) && t.push(...Sc(i.component.subTree))); }), t; }; var sT = (n) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n); var qi = (n) => n; var oT = ["class", "style"]; var aT = /^on[A-Z]/; var lT = (n = {}) => { const { excludeListeners: e = false, excludeKeys: t } = n, i = computed(() => ((t == null ? void 0 : t.value) || []).concat(oT)), r = getCurrentInstance(); return r ? computed(() => { var s; return Ic(Object.entries((s = r.proxy) == null ? void 0 : s.$attrs).filter(([o]) => !i.value.includes(o) && !(e && aT.test(o)))); }) : (kt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), computed(() => ({}))); }; var p0 = ({ from: n, replacement: e, scope: t, version: i, ref: r, type: s = "API" }, o) => { watch(() => unref(o), (a6) => { a6 && kt(t, `[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead. For more detail, please visit: ${r} `); }, { immediate: true }); }; var cT = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; var uT = (n) => (e, t) => hT(e, t, unref(n)); var hT = (n, e, t) => Ki(t, n, n).replace(/\{(\w+)\}/g, (i, r) => { var s; return `${(s = e == null ? void 0 : e[r]) != null ? s : `{${r}}`}`; }); var dT = (n) => { const e = computed(() => unref(n).name), t = isRef(n) ? n : ref(n); return { lang: e, locale: t, t: uT(n) }; }; var m0 = Symbol("localeContextKey"); var iu = (n) => { const e = n || inject(m0, ref()); return dT(computed(() => e.value || cT)); }; var _c = "el"; var fT = "is-"; var rs = (n, e, t, i, r) => { let s = `${n}-${e}`; return t && (s += `-${t}`), i && (s += `__${i}`), r && (s += `--${r}`), s; }; var g0 = Symbol("namespaceContextKey"); var Jd = (n) => { const e = n || (getCurrentInstance() ? inject(g0, ref(_c)) : ref(_c)); return computed(() => unref(e) || _c); }; var nt = (n, e) => { const t = Jd(e); return { namespace: t, b: (u6 = "") => rs(t.value, n, u6, "", ""), e: (u6) => u6 ? rs(t.value, n, "", u6, "") : "", m: (u6) => u6 ? rs(t.value, n, "", "", u6) : "", be: (u6, y6) => u6 && y6 ? rs(t.value, n, u6, y6, "") : "", em: (u6, y6) => u6 && y6 ? rs(t.value, n, "", u6, y6) : "", bm: (u6, y6) => u6 && y6 ? rs(t.value, n, u6, "", y6) : "", bem: (u6, y6, v6) => u6 && y6 && v6 ? rs(t.value, n, u6, y6, v6) : "", is: (u6, ...y6) => { const v6 = y6.length >= 1 ? y6[0] : true; return u6 && v6 ? `${fT}${u6}` : ""; }, cssVar: (u6) => { const y6 = {}; for (const v6 in u6) u6[v6] && (y6[`--${t.value}-${v6}`] = u6[v6]); return y6; }, cssVarName: (u6) => `--${t.value}-${u6}`, cssVarBlock: (u6) => { const y6 = {}; for (const v6 in u6) u6[v6] && (y6[`--${t.value}-${n}-${v6}`] = u6[v6]); return y6; }, cssVarBlockName: (u6) => `--${t.value}-${n}-${u6}` }; }; var pT = nu({ type: Je(Boolean), default: null }); var mT = nu({ type: Je(Function) }); var gT = (n) => { const e = `update:${n}`, t = `onUpdate:${n}`, i = [e], r = { [n]: pT, [t]: mT }; return { useModelToggle: ({ indicator: o, toggleReason: a6, shouldHideWhenRouteChanges: c, shouldProceed: l, onShow: d, onHide: h6 }) => { const f6 = getCurrentInstance(), { emit: g6 } = f6, p = f6.props, u6 = computed(() => Sn(p[t])), y6 = computed(() => p[n] === null), v6 = (R6) => { o.value !== true && (o.value = true, a6 && (a6.value = R6), Sn(d) && d(R6)); }, m6 = (R6) => { o.value !== false && (o.value = false, a6 && (a6.value = R6), Sn(h6) && h6(R6)); }, x6 = (R6) => { if (p.disabled === true || Sn(l) && !l()) return; const L6 = u6.value && en2; L6 && g6(e, true), (y6.value || !L6) && v6(R6); }, w6 = (R6) => { if (p.disabled === true || !en2) return; const L6 = u6.value && en2; L6 && g6(e, false), (y6.value || !L6) && m6(R6); }, A6 = (R6) => { Ba(R6) && (p.disabled && R6 ? u6.value && g6(e, false) : o.value !== R6 && (R6 ? v6() : m6())); }, M6 = () => { o.value ? w6() : x6(); }; return watch(() => p[n], A6), c && f6.appContext.config.globalProperties.$route !== void 0 && watch(() => ({ ...f6.proxy.$route }), () => { c.value && o.value && w6(); }), onMounted(() => { A6(p[n]); }), { hide: w6, show: x6, toggle: M6, hasUpdateHandler: u6 }; }, useModelToggleProps: r, useModelToggleEmits: i }; }; var v0 = (n) => { const e = getCurrentInstance(); return computed(() => { var t, i; return (i = (t = e == null ? void 0 : e.proxy) == null ? void 0 : t.$props) == null ? void 0 : i[n]; }); }; var On = "top"; var qn = "bottom"; var Qn = "right"; var Dn = "left"; var Kd = "auto"; var il = [On, qn, Qn, Dn]; var wo = "start"; var Ua = "end"; var vT = "clippingParents"; var y0 = "viewport"; var ua = "popper"; var yT = "reference"; var om = il.reduce(function(n, e) { return n.concat([e + "-" + wo, e + "-" + Ua]); }, []); var Yo = [].concat(il, [Kd]).reduce(function(n, e) { return n.concat([e, e + "-" + wo, e + "-" + Ua]); }, []); var bT = "beforeRead"; var xT = "read"; var MT = "afterRead"; var wT = "beforeMain"; var AT = "main"; var ST = "afterMain"; var _T = "beforeWrite"; var TT = "write"; var ET = "afterWrite"; var CT = [bT, xT, MT, wT, AT, ST, _T, TT, ET]; function Ii(n) { return n ? (n.nodeName || "").toLowerCase() : null; } function yi(n) { if (n == null) return window; if (n.toString() !== "[object Window]") { var e = n.ownerDocument; return e && e.defaultView || window; } return n; } function Ao(n) { var e = yi(n).Element; return n instanceof e || n instanceof Element; } function Kn(n) { var e = yi(n).HTMLElement; return n instanceof e || n instanceof HTMLElement; } function qd(n) { if (typeof ShadowRoot > "u") return false; var e = yi(n).ShadowRoot; return n instanceof e || n instanceof ShadowRoot; } function LT(n) { var e = n.state; Object.keys(e.elements).forEach(function(t) { var i = e.styles[t] || {}, r = e.attributes[t] || {}, s = e.elements[t]; !Kn(s) || !Ii(s) || (Object.assign(s.style, i), Object.keys(r).forEach(function(o) { var a6 = r[o]; a6 === false ? s.removeAttribute(o) : s.setAttribute(o, a6 === true ? "" : a6); })); }); } function RT(n) { var e = n.state, t = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, t.popper), e.styles = t, e.elements.arrow && Object.assign(e.elements.arrow.style, t.arrow), function() { Object.keys(e.elements).forEach(function(i) { var r = e.elements[i], s = e.attributes[i] || {}, o = Object.keys(e.styles.hasOwnProperty(i) ? e.styles[i] : t[i]), a6 = o.reduce(function(c, l) { return c[l] = "", c; }, {}); !Kn(r) || !Ii(r) || (Object.assign(r.style, a6), Object.keys(s).forEach(function(c) { r.removeAttribute(c); })); }); }; } var b0 = { name: "applyStyles", enabled: true, phase: "write", fn: LT, effect: RT, requires: ["computeStyles"] }; function Ri(n) { return n.split("-")[0]; } var xs = Math.max; var Bc = Math.min; var So = Math.round; function _o(n, e) { e === void 0 && (e = false); var t = n.getBoundingClientRect(), i = 1, r = 1; if (Kn(n) && e) { var s = n.offsetHeight, o = n.offsetWidth; o > 0 && (i = So(t.width) / o || 1), s > 0 && (r = So(t.height) / s || 1); } return { width: t.width / i, height: t.height / r, top: t.top / r, right: t.right / i, bottom: t.bottom / r, left: t.left / i, x: t.left / i, y: t.top / r }; } function Qd(n) { var e = _o(n), t = n.offsetWidth, i = n.offsetHeight; return Math.abs(e.width - t) <= 1 && (t = e.width), Math.abs(e.height - i) <= 1 && (i = e.height), { x: n.offsetLeft, y: n.offsetTop, width: t, height: i }; } function x0(n, e) { var t = e.getRootNode && e.getRootNode(); if (n.contains(e)) return true; if (t && qd(t)) { var i = e; do { if (i && n.isSameNode(i)) return true; i = i.parentNode || i.host; } while (i); } return false; } function sr(n) { return yi(n).getComputedStyle(n); } function FT(n) { return ["table", "td", "th"].indexOf(Ii(n)) >= 0; } function Xr(n) { return ((Ao(n) ? n.ownerDocument : n.document) || window.document).documentElement; } function ru(n) { return Ii(n) === "html" ? n : n.assignedSlot || n.parentNode || (qd(n) ? n.host : null) || Xr(n); } function am(n) { return !Kn(n) || sr(n).position === "fixed" ? null : n.offsetParent; } function PT(n) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, t = navigator.userAgent.indexOf("Trident") !== -1; if (t && Kn(n)) { var i = sr(n); if (i.position === "fixed") return null; } var r = ru(n); for (qd(r) && (r = r.host); Kn(r) && ["html", "body"].indexOf(Ii(r)) < 0; ) { var s = sr(r); if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || e && s.willChange === "filter" || e && s.filter && s.filter !== "none") return r; r = r.parentNode; } return null; } function rl(n) { for (var e = yi(n), t = am(n); t && FT(t) && sr(t).position === "static"; ) t = am(t); return t && (Ii(t) === "html" || Ii(t) === "body" && sr(t).position === "static") ? e : t || PT(n) || e; } function ef(n) { return ["top", "bottom"].indexOf(n) >= 0 ? "x" : "y"; } function Ca(n, e, t) { return xs(n, Bc(e, t)); } function IT(n, e, t) { var i = Ca(n, e, t); return i > t ? t : i; } function M0() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function w0(n) { return Object.assign({}, M0(), n); } function A0(n, e) { return e.reduce(function(t, i) { return t[i] = n, t; }, {}); } var OT = function(n, e) { return n = typeof n == "function" ? n(Object.assign({}, e.rects, { placement: e.placement })) : n, w0(typeof n != "number" ? n : A0(n, il)); }; function DT(n) { var e, t = n.state, i = n.name, r = n.options, s = t.elements.arrow, o = t.modifiersData.popperOffsets, a6 = Ri(t.placement), c = ef(a6), l = [Dn, Qn].indexOf(a6) >= 0, d = l ? "height" : "width"; if (!(!s || !o)) { var h6 = OT(r.padding, t), f6 = Qd(s), g6 = c === "y" ? On : Dn, p = c === "y" ? qn : Qn, u6 = t.rects.reference[d] + t.rects.reference[c] - o[c] - t.rects.popper[d], y6 = o[c] - t.rects.reference[c], v6 = rl(s), m6 = v6 ? c === "y" ? v6.clientHeight || 0 : v6.clientWidth || 0 : 0, x6 = u6 / 2 - y6 / 2, w6 = h6[g6], A6 = m6 - f6[d] - h6[p], M6 = m6 / 2 - f6[d] / 2 + x6, R6 = Ca(w6, M6, A6), L6 = c; t.modifiersData[i] = (e = {}, e[L6] = R6, e.centerOffset = R6 - M6, e); } } function NT(n) { var e = n.state, t = n.options, i = t.element, r = i === void 0 ? "[data-popper-arrow]" : i; r != null && (typeof r == "string" && (r = e.elements.popper.querySelector(r), !r) || !x0(e.elements.popper, r) || (e.elements.arrow = r)); } var BT = { name: "arrow", enabled: true, phase: "main", fn: DT, effect: NT, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function To(n) { return n.split("-")[1]; } var UT = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function zT(n) { var e = n.x, t = n.y, i = window, r = i.devicePixelRatio || 1; return { x: So(e * r) / r || 0, y: So(t * r) / r || 0 }; } function lm(n) { var e, t = n.popper, i = n.popperRect, r = n.placement, s = n.variation, o = n.offsets, a6 = n.position, c = n.gpuAcceleration, l = n.adaptive, d = n.roundOffsets, h6 = n.isFixed, f6 = o.x, g6 = f6 === void 0 ? 0 : f6, p = o.y, u6 = p === void 0 ? 0 : p, y6 = typeof d == "function" ? d({ x: g6, y: u6 }) : { x: g6, y: u6 }; g6 = y6.x, u6 = y6.y; var v6 = o.hasOwnProperty("x"), m6 = o.hasOwnProperty("y"), x6 = Dn, w6 = On, A6 = window; if (l) { var M6 = rl(t), R6 = "clientHeight", L6 = "clientWidth"; if (M6 === yi(t) && (M6 = Xr(t), sr(M6).position !== "static" && a6 === "absolute" && (R6 = "scrollHeight", L6 = "scrollWidth")), M6 = M6, r === On || (r === Dn || r === Qn) && s === Ua) { w6 = qn; var T6 = h6 && M6 === A6 && A6.visualViewport ? A6.visualViewport.height : M6[R6]; u6 -= T6 - i.height, u6 *= c ? 1 : -1; } if (r === Dn || (r === On || r === qn) && s === Ua) { x6 = Qn; var P6 = h6 && M6 === A6 && A6.visualViewport ? A6.visualViewport.width : M6[L6]; g6 -= P6 - i.width, g6 *= c ? 1 : -1; } } var _6 = Object.assign({ position: a6 }, l && UT), S6 = d === true ? zT({ x: g6, y: u6 }) : { x: g6, y: u6 }; if (g6 = S6.x, u6 = S6.y, c) { var E6; return Object.assign({}, _6, (E6 = {}, E6[w6] = m6 ? "0" : "", E6[x6] = v6 ? "0" : "", E6.transform = (A6.devicePixelRatio || 1) <= 1 ? "translate(" + g6 + "px, " + u6 + "px)" : "translate3d(" + g6 + "px, " + u6 + "px, 0)", E6)); } return Object.assign({}, _6, (e = {}, e[w6] = m6 ? u6 + "px" : "", e[x6] = v6 ? g6 + "px" : "", e.transform = "", e)); } function kT(n) { var e = n.state, t = n.options, i = t.gpuAcceleration, r = i === void 0 ? true : i, s = t.adaptive, o = s === void 0 ? true : s, a6 = t.roundOffsets, c = a6 === void 0 ? true : a6, l = { placement: Ri(e.placement), variation: To(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: r, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, lm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, lm(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var S0 = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: kT, data: {} }; var Tl = { passive: true }; function VT(n) { var e = n.state, t = n.instance, i = n.options, r = i.scroll, s = r === void 0 ? true : r, o = i.resize, a6 = o === void 0 ? true : o, c = yi(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return s && l.forEach(function(d) { d.addEventListener("scroll", t.update, Tl); }), a6 && c.addEventListener("resize", t.update, Tl), function() { s && l.forEach(function(d) { d.removeEventListener("scroll", t.update, Tl); }), a6 && c.removeEventListener("resize", t.update, Tl); }; } var _0 = { name: "eventListeners", enabled: true, phase: "write", fn: function() { }, effect: VT, data: {} }; var GT = { left: "right", right: "left", bottom: "top", top: "bottom" }; function Tc(n) { return n.replace(/left|right|bottom|top/g, function(e) { return GT[e]; }); } var HT = { start: "end", end: "start" }; function cm(n) { return n.replace(/start|end/g, function(e) { return HT[e]; }); } function tf(n) { var e = yi(n), t = e.pageXOffset, i = e.pageYOffset; return { scrollLeft: t, scrollTop: i }; } function nf(n) { return _o(Xr(n)).left + tf(n).scrollLeft; } function WT(n) { var e = yi(n), t = Xr(n), i = e.visualViewport, r = t.clientWidth, s = t.clientHeight, o = 0, a6 = 0; return i && (r = i.width, s = i.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = i.offsetLeft, a6 = i.offsetTop)), { width: r, height: s, x: o + nf(n), y: a6 }; } function jT(n) { var e, t = Xr(n), i = tf(n), r = (e = n.ownerDocument) == null ? void 0 : e.body, s = xs(t.scrollWidth, t.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0), o = xs(t.scrollHeight, t.clientHeight, r ? r.scrollHeight : 0, r ? r.clientHeight : 0), a6 = -i.scrollLeft + nf(n), c = -i.scrollTop; return sr(r || t).direction === "rtl" && (a6 += xs(t.clientWidth, r ? r.clientWidth : 0) - s), { width: s, height: o, x: a6, y: c }; } function rf(n) { var e = sr(n), t = e.overflow, i = e.overflowX, r = e.overflowY; return /auto|scroll|overlay|hidden/.test(t + r + i); } function T0(n) { return ["html", "body", "#document"].indexOf(Ii(n)) >= 0 ? n.ownerDocument.body : Kn(n) && rf(n) ? n : T0(ru(n)); } function La(n, e) { var t; e === void 0 && (e = []); var i = T0(n), r = i === ((t = n.ownerDocument) == null ? void 0 : t.body), s = yi(i), o = r ? [s].concat(s.visualViewport || [], rf(i) ? i : []) : i, a6 = e.concat(o); return r ? a6 : a6.concat(La(ru(o))); } function Xh(n) { return Object.assign({}, n, { left: n.x, top: n.y, right: n.x + n.width, bottom: n.y + n.height }); } function $T(n) { var e = _o(n); return e.top = e.top + n.clientTop, e.left = e.left + n.clientLeft, e.bottom = e.top + n.clientHeight, e.right = e.left + n.clientWidth, e.width = n.clientWidth, e.height = n.clientHeight, e.x = e.left, e.y = e.top, e; } function um(n, e) { return e === y0 ? Xh(WT(n)) : Ao(e) ? $T(e) : Xh(jT(Xr(n))); } function ZT(n) { var e = La(ru(n)), t = ["absolute", "fixed"].indexOf(sr(n).position) >= 0, i = t && Kn(n) ? rl(n) : n; return Ao(i) ? e.filter(function(r) { return Ao(r) && x0(r, i) && Ii(r) !== "body"; }) : []; } function XT(n, e, t) { var i = e === "clippingParents" ? ZT(n) : [].concat(e), r = [].concat(i, [t]), s = r[0], o = r.reduce(function(a6, c) { var l = um(n, c); return a6.top = xs(l.top, a6.top), a6.right = Bc(l.right, a6.right), a6.bottom = Bc(l.bottom, a6.bottom), a6.left = xs(l.left, a6.left), a6; }, um(n, s)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function E0(n) { var e = n.reference, t = n.element, i = n.placement, r = i ? Ri(i) : null, s = i ? To(i) : null, o = e.x + e.width / 2 - t.width / 2, a6 = e.y + e.height / 2 - t.height / 2, c; switch (r) { case On: c = { x: o, y: e.y - t.height }; break; case qn: c = { x: o, y: e.y + e.height }; break; case Qn: c = { x: e.x + e.width, y: a6 }; break; case Dn: c = { x: e.x - t.width, y: a6 }; break; default: c = { x: e.x, y: e.y }; } var l = r ? ef(r) : null; if (l != null) { var d = l === "y" ? "height" : "width"; switch (s) { case wo: c[l] = c[l] - (e[d] / 2 - t[d] / 2); break; case Ua: c[l] = c[l] + (e[d] / 2 - t[d] / 2); break; } } return c; } function za(n, e) { e === void 0 && (e = {}); var t = e, i = t.placement, r = i === void 0 ? n.placement : i, s = t.boundary, o = s === void 0 ? vT : s, a6 = t.rootBoundary, c = a6 === void 0 ? y0 : a6, l = t.elementContext, d = l === void 0 ? ua : l, h6 = t.altBoundary, f6 = h6 === void 0 ? false : h6, g6 = t.padding, p = g6 === void 0 ? 0 : g6, u6 = w0(typeof p != "number" ? p : A0(p, il)), y6 = d === ua ? yT : ua, v6 = n.rects.popper, m6 = n.elements[f6 ? y6 : d], x6 = XT(Ao(m6) ? m6 : m6.contextElement || Xr(n.elements.popper), o, c), w6 = _o(n.elements.reference), A6 = E0({ reference: w6, element: v6, strategy: "absolute", placement: r }), M6 = Xh(Object.assign({}, v6, A6)), R6 = d === ua ? M6 : w6, L6 = { top: x6.top - R6.top + u6.top, bottom: R6.bottom - x6.bottom + u6.bottom, left: x6.left - R6.left + u6.left, right: R6.right - x6.right + u6.right }, T6 = n.modifiersData.offset; if (d === ua && T6) { var P6 = T6[r]; Object.keys(L6).forEach(function(_6) { var S6 = [Qn, qn].indexOf(_6) >= 0 ? 1 : -1, E6 = [On, qn].indexOf(_6) >= 0 ? "y" : "x"; L6[_6] += P6[E6] * S6; }); } return L6; } function YT(n, e) { e === void 0 && (e = {}); var t = e, i = t.placement, r = t.boundary, s = t.rootBoundary, o = t.padding, a6 = t.flipVariations, c = t.allowedAutoPlacements, l = c === void 0 ? Yo : c, d = To(i), h6 = d ? a6 ? om : om.filter(function(p) { return To(p) === d; }) : il, f6 = h6.filter(function(p) { return l.indexOf(p) >= 0; }); f6.length === 0 && (f6 = h6); var g6 = f6.reduce(function(p, u6) { return p[u6] = za(n, { placement: u6, boundary: r, rootBoundary: s, padding: o })[Ri(u6)], p; }, {}); return Object.keys(g6).sort(function(p, u6) { return g6[p] - g6[u6]; }); } function JT(n) { if (Ri(n) === Kd) return []; var e = Tc(n); return [cm(n), e, cm(e)]; } function KT(n) { var e = n.state, t = n.options, i = n.name; if (!e.modifiersData[i]._skip) { for (var r = t.mainAxis, s = r === void 0 ? true : r, o = t.altAxis, a6 = o === void 0 ? true : o, c = t.fallbackPlacements, l = t.padding, d = t.boundary, h6 = t.rootBoundary, f6 = t.altBoundary, g6 = t.flipVariations, p = g6 === void 0 ? true : g6, u6 = t.allowedAutoPlacements, y6 = e.options.placement, v6 = Ri(y6), m6 = v6 === y6, x6 = c || (m6 || !p ? [Tc(y6)] : JT(y6)), w6 = [y6].concat(x6).reduce(function(te, ae) { return te.concat(Ri(ae) === Kd ? YT(e, { placement: ae, boundary: d, rootBoundary: h6, padding: l, flipVariations: p, allowedAutoPlacements: u6 }) : ae); }, []), A6 = e.rects.reference, M6 = e.rects.popper, R6 = /* @__PURE__ */ new Map(), L6 = true, T6 = w6[0], P6 = 0; P6 < w6.length; P6++) { var _6 = w6[P6], S6 = Ri(_6), E6 = To(_6) === wo, C6 = [On, qn].indexOf(S6) >= 0, I6 = C6 ? "width" : "height", b6 = za(e, { placement: _6, boundary: d, rootBoundary: h6, altBoundary: f6, padding: l }), F6 = C6 ? E6 ? Qn : Dn : E6 ? qn : On; A6[I6] > M6[I6] && (F6 = Tc(F6)); var D6 = Tc(F6), N6 = []; if (s && N6.push(b6[S6] <= 0), a6 && N6.push(b6[F6] <= 0, b6[D6] <= 0), N6.every(function(te) { return te; })) { T6 = _6, L6 = false; break; } R6.set(_6, N6); } if (L6) for (var B6 = p ? 3 : 1, U6 = function(te) { var ae = w6.find(function(ie) { var le = R6.get(ie); if (le) return le.slice(0, te).every(function(W6) { return W6; }); }); if (ae) return T6 = ae, "break"; }, G6 = B6; G6 > 0; G6--) { var Y = U6(G6); if (Y === "break") break; } e.placement !== T6 && (e.modifiersData[i]._skip = true, e.placement = T6, e.reset = true); } } var qT = { name: "flip", enabled: true, phase: "main", fn: KT, requiresIfExists: ["offset"], data: { _skip: false } }; function hm(n, e, t) { return t === void 0 && (t = { x: 0, y: 0 }), { top: n.top - e.height - t.y, right: n.right - e.width + t.x, bottom: n.bottom - e.height + t.y, left: n.left - e.width - t.x }; } function dm(n) { return [On, Qn, qn, Dn].some(function(e) { return n[e] >= 0; }); } function QT(n) { var e = n.state, t = n.name, i = e.rects.reference, r = e.rects.popper, s = e.modifiersData.preventOverflow, o = za(e, { elementContext: "reference" }), a6 = za(e, { altBoundary: true }), c = hm(o, i), l = hm(a6, r, s), d = dm(c), h6 = dm(l); e.modifiersData[t] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: d, hasPopperEscaped: h6 }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": d, "data-popper-escaped": h6 }); } var eE = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: QT }; function tE(n, e, t) { var i = Ri(n), r = [Dn, On].indexOf(i) >= 0 ? -1 : 1, s = typeof t == "function" ? t(Object.assign({}, e, { placement: n })) : t, o = s[0], a6 = s[1]; return o = o || 0, a6 = (a6 || 0) * r, [Dn, Qn].indexOf(i) >= 0 ? { x: a6, y: o } : { x: o, y: a6 }; } function nE(n) { var e = n.state, t = n.options, i = n.name, r = t.offset, s = r === void 0 ? [0, 0] : r, o = Yo.reduce(function(d, h6) { return d[h6] = tE(h6, e.rects, s), d; }, {}), a6 = o[e.placement], c = a6.x, l = a6.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[i] = o; } var iE = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: nE }; function rE(n) { var e = n.state, t = n.name; e.modifiersData[t] = E0({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var C0 = { name: "popperOffsets", enabled: true, phase: "read", fn: rE, data: {} }; function sE(n) { return n === "x" ? "y" : "x"; } function oE(n) { var e = n.state, t = n.options, i = n.name, r = t.mainAxis, s = r === void 0 ? true : r, o = t.altAxis, a6 = o === void 0 ? false : o, c = t.boundary, l = t.rootBoundary, d = t.altBoundary, h6 = t.padding, f6 = t.tether, g6 = f6 === void 0 ? true : f6, p = t.tetherOffset, u6 = p === void 0 ? 0 : p, y6 = za(e, { boundary: c, rootBoundary: l, padding: h6, altBoundary: d }), v6 = Ri(e.placement), m6 = To(e.placement), x6 = !m6, w6 = ef(v6), A6 = sE(w6), M6 = e.modifiersData.popperOffsets, R6 = e.rects.reference, L6 = e.rects.popper, T6 = typeof u6 == "function" ? u6(Object.assign({}, e.rects, { placement: e.placement })) : u6, P6 = typeof T6 == "number" ? { mainAxis: T6, altAxis: T6 } : Object.assign({ mainAxis: 0, altAxis: 0 }, T6), _6 = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S6 = { x: 0, y: 0 }; if (M6) { if (s) { var E6, C6 = w6 === "y" ? On : Dn, I6 = w6 === "y" ? qn : Qn, b6 = w6 === "y" ? "height" : "width", F6 = M6[w6], D6 = F6 + y6[C6], N6 = F6 - y6[I6], B6 = g6 ? -L6[b6] / 2 : 0, U6 = m6 === wo ? R6[b6] : L6[b6], G6 = m6 === wo ? -L6[b6] : -R6[b6], Y = e.elements.arrow, te = g6 && Y ? Qd(Y) : { width: 0, height: 0 }, ae = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : M0(), ie = ae[C6], le = ae[I6], W6 = Ca(0, R6[b6], te[b6]), $6 = x6 ? R6[b6] / 2 - B6 - W6 - ie - P6.mainAxis : U6 - W6 - ie - P6.mainAxis, j6 = x6 ? -R6[b6] / 2 + B6 + W6 + le + P6.mainAxis : G6 + W6 + le + P6.mainAxis, re = e.elements.arrow && rl(e.elements.arrow), k6 = re ? w6 === "y" ? re.clientTop || 0 : re.clientLeft || 0 : 0, H6 = (E6 = _6 == null ? void 0 : _6[w6]) != null ? E6 : 0, K = F6 + $6 - H6 - k6, ce = F6 + j6 - H6, se = Ca(g6 ? Bc(D6, K) : D6, F6, g6 ? xs(N6, ce) : N6); M6[w6] = se, S6[w6] = se - F6; } if (a6) { var V6, O6 = w6 === "x" ? On : Dn, Z6 = w6 === "x" ? qn : Qn, X = M6[A6], ee = A6 === "y" ? "height" : "width", fe = X + y6[O6], be = X - y6[Z6], Ae = [On, Dn].indexOf(v6) !== -1, he = (V6 = _6 == null ? void 0 : _6[A6]) != null ? V6 : 0, xe = Ae ? fe : X - R6[ee] - L6[ee] - he + P6.altAxis, ne = Ae ? X + R6[ee] + L6[ee] - he - P6.altAxis : be, me = g6 && Ae ? IT(xe, X, ne) : Ca(g6 ? xe : fe, X, g6 ? ne : be); M6[A6] = me, S6[A6] = me - X; } e.modifiersData[i] = S6; } } var aE = { name: "preventOverflow", enabled: true, phase: "main", fn: oE, requiresIfExists: ["offset"] }; function lE(n) { return { scrollLeft: n.scrollLeft, scrollTop: n.scrollTop }; } function cE(n) { return n === yi(n) || !Kn(n) ? tf(n) : lE(n); } function uE(n) { var e = n.getBoundingClientRect(), t = So(e.width) / n.offsetWidth || 1, i = So(e.height) / n.offsetHeight || 1; return t !== 1 || i !== 1; } function hE(n, e, t) { t === void 0 && (t = false); var i = Kn(e), r = Kn(e) && uE(e), s = Xr(e), o = _o(n, r), a6 = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (i || !i && !t) && ((Ii(e) !== "body" || rf(s)) && (a6 = cE(e)), Kn(e) ? (c = _o(e, true), c.x += e.clientLeft, c.y += e.clientTop) : s && (c.x = nf(s))), { x: o.left + a6.scrollLeft - c.x, y: o.top + a6.scrollTop - c.y, width: o.width, height: o.height }; } function dE(n) { var e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), i = []; n.forEach(function(s) { e.set(s.name, s); }); function r(s) { t.add(s.name); var o = [].concat(s.requires || [], s.requiresIfExists || []); o.forEach(function(a6) { if (!t.has(a6)) { var c = e.get(a6); c && r(c); } }), i.push(s); } return n.forEach(function(s) { t.has(s.name) || r(s); }), i; } function fE(n) { var e = dE(n); return CT.reduce(function(t, i) { return t.concat(e.filter(function(r) { return r.phase === i; })); }, []); } function pE(n) { var e; return function() { return e || (e = new Promise(function(t) { Promise.resolve().then(function() { e = void 0, t(n()); }); })), e; }; } function mE(n) { var e = n.reduce(function(t, i) { var r = t[i.name]; return t[i.name] = r ? Object.assign({}, r, i, { options: Object.assign({}, r.options, i.options), data: Object.assign({}, r.data, i.data) }) : i, t; }, {}); return Object.keys(e).map(function(t) { return e[t]; }); } var fm = { placement: "bottom", modifiers: [], strategy: "absolute" }; function pm() { for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++) e[t] = arguments[t]; return !e.some(function(i) { return !(i && typeof i.getBoundingClientRect == "function"); }); } function sf(n) { n === void 0 && (n = {}); var e = n, t = e.defaultModifiers, i = t === void 0 ? [] : t, r = e.defaultOptions, s = r === void 0 ? fm : r; return function(o, a6, c) { c === void 0 && (c = s); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, fm, s), modifiersData: {}, elements: { reference: o, popper: a6 }, attributes: {}, styles: {} }, d = [], h6 = false, f6 = { state: l, setOptions: function(u6) { var y6 = typeof u6 == "function" ? u6(l.options) : u6; p(), l.options = Object.assign({}, s, l.options, y6), l.scrollParents = { reference: Ao(o) ? La(o) : o.contextElement ? La(o.contextElement) : [], popper: La(a6) }; var v6 = fE(mE([].concat(i, l.options.modifiers))); return l.orderedModifiers = v6.filter(function(m6) { return m6.enabled; }), g6(), f6.update(); }, forceUpdate: function() { if (!h6) { var u6 = l.elements, y6 = u6.reference, v6 = u6.popper; if (pm(y6, v6)) { l.rects = { reference: hE(y6, rl(v6), l.options.strategy === "fixed"), popper: Qd(v6) }, l.reset = false, l.placement = l.options.placement, l.orderedModifiers.forEach(function(L6) { return l.modifiersData[L6.name] = Object.assign({}, L6.data); }); for (var m6 = 0; m6 < l.orderedModifiers.length; m6++) { if (l.reset === true) { l.reset = false, m6 = -1; continue; } var x6 = l.orderedModifiers[m6], w6 = x6.fn, A6 = x6.options, M6 = A6 === void 0 ? {} : A6, R6 = x6.name; typeof w6 == "function" && (l = w6({ state: l, options: M6, name: R6, instance: f6 }) || l); } } } }, update: pE(function() { return new Promise(function(u6) { f6.forceUpdate(), u6(l); }); }), destroy: function() { p(), h6 = true; } }; if (!pm(o, a6)) return f6; f6.setOptions(c).then(function(u6) { !h6 && c.onFirstUpdate && c.onFirstUpdate(u6); }); function g6() { l.orderedModifiers.forEach(function(u6) { var y6 = u6.name, v6 = u6.options, m6 = v6 === void 0 ? {} : v6, x6 = u6.effect; if (typeof x6 == "function") { var w6 = x6({ state: l, name: y6, instance: f6, options: m6 }), A6 = function() { }; d.push(w6 || A6); } }); } function p() { d.forEach(function(u6) { return u6(); }), d = []; } return f6; }; } sf(); var gE = [_0, C0, S0, b0]; sf({ defaultModifiers: gE }); var vE = [_0, C0, S0, b0, iE, qT, aE, BT, eE]; var yE = sf({ defaultModifiers: vE }); var bE = (n, e, t = {}) => { const i = { name: "updateState", enabled: true, phase: "write", fn: ({ state: c }) => { const l = xE(c); Object.assign(o.value, l); }, requires: ["computeStyles"] }, r = computed(() => { const { onFirstUpdate: c, placement: l, strategy: d, modifiers: h6 } = unref(t); return { onFirstUpdate: c, placement: l || "bottom", strategy: d || "absolute", modifiers: [ ...h6 || [], i, { name: "applyStyles", enabled: false } ] }; }), s = shallowRef(), o = ref({ styles: { popper: { position: unref(r).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), a6 = () => { s.value && (s.value.destroy(), s.value = void 0); }; return watch(r, (c) => { const l = unref(s); l && l.setOptions(c); }, { deep: true }), watch([n, e], ([c, l]) => { a6(), !(!c || !l) && (s.value = yE(c, l, unref(r))); }), onBeforeUnmount(() => { a6(); }), { state: computed(() => { var c; return { ...((c = unref(s)) == null ? void 0 : c.state) || {} }; }), styles: computed(() => unref(o).styles), attributes: computed(() => unref(o).attributes), update: () => { var c; return (c = unref(s)) == null ? void 0 : c.update(); }, forceUpdate: () => { var c; return (c = unref(s)) == null ? void 0 : c.forceUpdate(); }, instanceRef: computed(() => unref(s)) }; }; function xE(n) { const e = Object.keys(n.elements), t = Ic(e.map((r) => [r, n.styles[r] || {}])), i = Ic(e.map((r) => [r, n.attributes[r]])); return { styles: t, attributes: i }; } function mm() { let n; const e = (i, r) => { t(), n = window.setTimeout(i, r); }, t = () => window.clearTimeout(n); return Yc(() => t()), { registerTimeout: e, cancelTimeout: t }; } var Yh = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; var ME = Symbol("elIdInjection"); var of = () => getCurrentInstance() ? inject(ME, Yh) : Yh; var sl = (n) => { const e = of(); !en2 && e === Yh && kt("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const t = Jd(); return computed(() => unref(n) || `${t.value}-id-${e.prefix}-${e.current++}`); }; var fo = []; var gm = (n) => { const e = n; e.key === Li.esc && fo.forEach((t) => t(e)); }; var wE = (n) => { onMounted(() => { fo.length === 0 && document.addEventListener("keydown", gm), en2 && fo.push(n); }), onBeforeUnmount(() => { fo = fo.filter((e) => e !== n), fo.length === 0 && en2 && document.removeEventListener("keydown", gm); }); }; var vm; var L0 = () => { const n = Jd(), e = of(), t = computed(() => `${n.value}-popper-container-${e.prefix}`), i = computed(() => `#${t.value}`); return { id: t, selector: i }; }; var AE = (n) => { const e = document.createElement("div"); return e.id = n, document.body.appendChild(e), e; }; var SE = () => { const { id: n, selector: e } = L0(); return onBeforeMount(() => { en2 && (!vm || !document.body.querySelector(e.value)) && (vm = AE(n.value)); }), { id: n, selector: e }; }; var _E = at({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); var TE = ({ showAfter: n, hideAfter: e, autoClose: t, open: i, close: r }) => { const { registerTimeout: s } = mm(), { registerTimeout: o, cancelTimeout: a6 } = mm(); return { onOpen: (d) => { s(() => { i(d); const h6 = unref(t); yt(h6) && h6 > 0 && o(() => { r(d); }, h6); }, unref(n)); }, onClose: (d) => { a6(), s(() => { r(d); }, unref(e)); } }; }; var R0 = Symbol("elForwardRef"); var EE = (n) => { provide(R0, { setForwardRef: (t) => { n.value = t; } }); }; var CE = (n) => ({ mounted(e) { n(e); }, updated(e) { n(e); }, unmounted() { n(null); } }); var ym = { current: 0 }; var bm = ref(0); var F0 = 2e3; var xm = Symbol("elZIndexContextKey"); var P0 = Symbol("zIndexContextKey"); var I0 = (n) => { const e = getCurrentInstance() ? inject(xm, ym) : ym, t = n || (getCurrentInstance() ? inject(P0, void 0) : void 0), i = computed(() => { const o = unref(t); return yt(o) ? o : F0; }), r = computed(() => i.value + bm.value), s = () => (e.current++, bm.value = e.current, r.value); return !en2 && !inject(xm) && kt("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: i, currentZIndex: r, nextZIndex: s }; }; function LE(n) { let e; function t() { if (n.value == null) return; const { selectionStart: r, selectionEnd: s, value: o } = n.value; if (r == null || s == null) return; const a6 = o.slice(0, Math.max(0, r)), c = o.slice(Math.max(0, s)); e = { selectionStart: r, selectionEnd: s, value: o, beforeTxt: a6, afterTxt: c }; } function i() { if (n.value == null || e == null) return; const { value: r } = n.value, { beforeTxt: s, afterTxt: o, selectionStart: a6 } = e; if (s == null || o == null || a6 == null) return; let c = r.length; if (r.endsWith(o)) c = r.length - o.length; else if (r.startsWith(s)) c = s.length; else { const l = s[a6 - 1], d = r.indexOf(l, a6 - 1); d !== -1 && (c = d + 1); } n.value.setSelectionRange(c, c); } return [t, i]; } var RE = (n, e, t) => Sc(n.subTree).filter((s) => { var o; return isVNode(s) && ((o = s.type) == null ? void 0 : o.name) === e && !!s.component; }).map((s) => s.component.uid).map((s) => t[s]).filter((s) => !!s); var FE = (n, e) => { const t = {}, i = shallowRef([]); return { children: i, addChild: (o) => { t[o.uid] = o, i.value = RE(n, e, t); }, removeChild: (o) => { delete t[o], i.value = i.value.filter((a6) => a6.uid !== o); } }; }; var Gr = nu({ type: String, values: f0, required: false }); var O0 = Symbol("size"); var PE = () => { const n = inject(O0, {}); return computed(() => unref(n.size) || ""); }; function D0(n, { beforeFocus: e, afterFocus: t, beforeBlur: i, afterBlur: r } = {}) { const s = getCurrentInstance(), { emit: o } = s, a6 = shallowRef(), c = ref(false), l = (f6) => { Sn(e) && e(f6) || c.value || (c.value = true, o("focus", f6), t == null || t()); }, d = (f6) => { var g6; Sn(i) && i(f6) || f6.relatedTarget && ((g6 = a6.value) != null && g6.contains(f6.relatedTarget)) || (c.value = false, o("blur", f6), r == null || r()); }, h6 = () => { var f6, g6; (f6 = a6.value) != null && f6.contains(document.activeElement) && a6.value !== document.activeElement || (g6 = n.value) == null || g6.focus(); }; return watch(a6, (f6) => { f6 && f6.setAttribute("tabindex", "-1"); }), un(a6, "focus", l, true), un(a6, "blur", d, true), un(a6, "click", h6, true), false, { isFocused: c, wrapperRef: a6, handleFocus: l, handleBlur: d }; } function N0({ afterComposition: n, emit: e }) { const t = ref(false), i = (a6) => { e == null || e("compositionstart", a6), t.value = true; }, r = (a6) => { var c; e == null || e("compositionupdate", a6); const l = (c = a6.target) == null ? void 0 : c.value, d = l[l.length - 1] || ""; t.value = !sT(d); }, s = (a6) => { e == null || e("compositionend", a6), t.value && (t.value = false, nextTick(() => n(a6))); }; return { isComposing: t, handleComposition: (a6) => { a6.type === "compositionend" ? s(a6) : r(a6); }, handleCompositionStart: i, handleCompositionUpdate: r, handleCompositionEnd: s }; } var B0 = Symbol("emptyValuesContextKey"); var IE = "use-empty-values"; var OE = ["", void 0, null]; var DE = void 0; var NE = at({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (n) => Sn(n) ? !n() : !n } }); var BE = (n, e) => { const t = getCurrentInstance() ? inject(B0, ref({})) : ref({}), i = computed(() => n.emptyValues || t.value.emptyValues || OE), r = computed(() => Sn(n.valueOnClear) ? n.valueOnClear() : n.valueOnClear !== void 0 ? n.valueOnClear : Sn(t.value.valueOnClear) ? t.value.valueOnClear() : t.value.valueOnClear !== void 0 ? t.value.valueOnClear : DE), s = (o) => i.value.includes(o); return i.value.includes(r.value) || kt(IE, "value-on-clear should be a value of empty-values"), { emptyValues: i, valueOnClear: r, isEmptyValue: s }; }; var UE = at({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }); var Yr = (n) => I_(UE, n); var U0 = Symbol(); var Uc = ref(); function af(n, e = void 0) { const t = getCurrentInstance() ? inject(U0, Uc) : Uc; return n ? computed(() => { var i, r; return (r = (i = t.value) == null ? void 0 : i[n]) != null ? r : e; }) : t; } function zE(n, e) { const t = af(), i = nt(n, computed(() => { var a6; return ((a6 = t.value) == null ? void 0 : a6.namespace) || _c; })), r = iu(computed(() => { var a6; return (a6 = t.value) == null ? void 0 : a6.locale; })), s = I0(computed(() => { var a6; return ((a6 = t.value) == null ? void 0 : a6.zIndex) || F0; })), o = computed(() => { var a6; return unref(e) || ((a6 = t.value) == null ? void 0 : a6.size) || ""; }); return kE(computed(() => unref(t) || {})), { ns: i, locale: r, zIndex: s, size: o }; } var kE = (n, e, t = false) => { var i; const r = !!getCurrentInstance(), s = r ? af() : void 0, o = (i = void 0) != null ? i : r ? provide : void 0; if (!o) { kt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const a6 = computed(() => { const c = unref(n); return s != null && s.value ? VE(s.value, c) : c; }); return o(U0, a6), o(m0, computed(() => a6.value.locale)), o(g0, computed(() => a6.value.namespace)), o(P0, computed(() => a6.value.zIndex)), o(O0, { size: computed(() => a6.value.size || "") }), o(B0, computed(() => ({ emptyValues: a6.value.emptyValues, valueOnClear: a6.value.valueOnClear }))), (t || !Uc.value) && (Uc.value = a6.value), a6; }; var VE = (n, e) => { const t = [.../* @__PURE__ */ new Set([...rm(n), ...rm(e)])], i = {}; for (const r of t) i[r] = e[r] !== void 0 ? e[r] : n[r]; return i; }; var st = (n, e) => { const t = n.__vccOpts || n; for (const [i, r] of e) t[i] = r; return t; }; var GE = at({ size: { type: Je([Number, String]) }, color: { type: String } }); var HE = defineComponent({ name: "ElIcon", inheritAttrs: false }); var WE = defineComponent({ ...HE, props: GE, setup(n) { const e = n, t = nt("icon"), i = computed(() => { const { size: r, color: s } = e; return !r && !s ? {} : { fontSize: di(r) ? void 0 : Dc(r), "--color": s }; }); return (r, s) => (openBlock(), createElementBlock("i", mergeProps({ class: unref(t).b(), style: unref(i) }, r.$attrs), [ renderSlot(r.$slots, "default") ], 16)); } }); var jE = st(WE, [["__file", "icon.vue"]]); var It = on2(jE); var lf = Symbol("formContextKey"); var zc = Symbol("formItemContextKey"); var Ns = (n, e = {}) => { const t = ref(void 0), i = e.prop ? t : v0("size"), r = e.global ? t : PE(), s = e.form ? { size: void 0 } : inject(lf, void 0), o = e.formItem ? { size: void 0 } : inject(zc, void 0); return computed(() => i.value || unref(n) || (o == null ? void 0 : o.size) || (s == null ? void 0 : s.size) || r.value || ""); }; var ol = (n) => { const e = v0("disabled"), t = inject(lf, void 0); return computed(() => e.value || unref(n) || (t == null ? void 0 : t.disabled) || false); }; var Jo = () => { const n = inject(lf, void 0), e = inject(zc, void 0); return { form: n, formItem: e }; }; var su = (n, { formItemContext: e, disableIdGeneration: t, disableIdManagement: i }) => { t || (t = ref(false)), i || (i = ref(false)); const r = ref(); let s; const o = computed(() => { var a6; return !!(!(n.label || n.ariaLabel) && e && e.inputIds && ((a6 = e.inputIds) == null ? void 0 : a6.length) <= 1); }); return onMounted(() => { s = watch([toRef(n, "id"), t], ([a6, c]) => { const l = a6 ?? (c ? void 0 : sl().value); l !== r.value && (e != null && e.removeInputId && (r.value && e.removeInputId(r.value), !(i != null && i.value) && !c && l && e.addInputId(l)), r.value = l); }, { immediate: true }); }), onUnmounted(() => { s && s(), e != null && e.removeInputId && r.value && e.removeInputId(r.value); }), { isLabeledByFormItem: o, inputId: r }; }; var ii; var $E = ` height:0 !important; visibility:hidden !important; ${Ow() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `; var ZE = [ "letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing" ]; function XE(n) { const e = window.getComputedStyle(n), t = e.getPropertyValue("box-sizing"), i = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), r = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: ZE.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: i, borderSize: r, boxSizing: t }; } function Mm(n, e = 1, t) { var i; ii || (ii = document.createElement("textarea"), document.body.appendChild(ii)); const { paddingSize: r, borderSize: s, boxSizing: o, contextStyle: a6 } = XE(n); ii.setAttribute("style", `${a6};${$E}`), ii.value = n.value || n.placeholder || ""; let c = ii.scrollHeight; const l = {}; o === "border-box" ? c = c + s : o === "content-box" && (c = c - r), ii.value = ""; const d = ii.scrollHeight - r; if (yt(e)) { let h6 = d * e; o === "border-box" && (h6 = h6 + r + s), c = Math.max(h6, c), l.minHeight = `${h6}px`; } if (yt(t)) { let h6 = d * t; o === "border-box" && (h6 = h6 + r + s), c = Math.min(h6, c); } return l.height = `${c}px`, (i = ii.parentNode) == null || i.removeChild(ii), ii = void 0, l; } var YE = at({ id: { type: String, default: void 0 }, size: Gr, disabled: Boolean, modelValue: { type: Je([ String, Number, Object ]), default: "" }, maxlength: { type: [String, Number] }, minlength: { type: [String, Number] }, type: { type: String, default: "text" }, resize: { type: String, values: ["none", "both", "horizontal", "vertical"] }, autosize: { type: Je([Boolean, Object]), default: false }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: Vr }, prefixIcon: { type: Vr }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: true }, inputStyle: { type: Je([Object, Array, String]), default: () => qi({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Yr(["ariaLabel"]) }); var JE = { [At]: (n) => vn(n), input: (n) => vn(n), change: (n) => vn(n), focus: (n) => n instanceof FocusEvent, blur: (n) => n instanceof FocusEvent, clear: () => true, mouseleave: (n) => n instanceof MouseEvent, mouseenter: (n) => n instanceof MouseEvent, keydown: (n) => n instanceof Event, compositionstart: (n) => n instanceof CompositionEvent, compositionupdate: (n) => n instanceof CompositionEvent, compositionend: (n) => n instanceof CompositionEvent }; var KE = defineComponent({ name: "ElInput", inheritAttrs: false }); var qE = defineComponent({ ...KE, props: YE, emits: JE, setup(n, { expose: e, emit: t }) { const i = n, r = useAttrs(), s = useSlots(), o = computed(() => { const he = {}; return i.containerRole === "combobox" && (he["aria-haspopup"] = r["aria-haspopup"], he["aria-owns"] = r["aria-owns"], he["aria-expanded"] = r["aria-expanded"]), he; }), a6 = computed(() => [ i.type === "textarea" ? y6.b() : u6.b(), u6.m(g6.value), u6.is("disabled", p.value), u6.is("exceed", Y.value), { [u6.b("group")]: s.prepend || s.append, [u6.m("prefix")]: s.prefix || i.prefixIcon, [u6.m("suffix")]: s.suffix || i.suffixIcon || i.clearable || i.showPassword, [u6.bm("suffix", "password-clear")]: N6.value && B6.value, [u6.b("hidden")]: i.type === "hidden" }, r.class ]), c = computed(() => [ u6.e("wrapper"), u6.is("focus", T6.value) ]), l = lT({ excludeKeys: computed(() => Object.keys(o.value)) }), { form: d, formItem: h6 } = Jo(), { inputId: f6 } = su(i, { formItemContext: h6 }), g6 = Ns(), p = ol(), u6 = nt("input"), y6 = nt("textarea"), v6 = shallowRef(), m6 = shallowRef(), x6 = ref(false), w6 = ref(false), A6 = ref(), M6 = shallowRef(i.inputStyle), R6 = computed(() => v6.value || m6.value), { wrapperRef: L6, isFocused: T6, handleFocus: P6, handleBlur: _6 } = D0(R6, { beforeFocus() { return p.value; }, afterBlur() { var he; i.validateEvent && ((he = h6 == null ? void 0 : h6.validate) == null || he.call(h6, "blur").catch((xe) => kt(xe))); } }), S6 = computed(() => { var he; return (he = d == null ? void 0 : d.statusIcon) != null ? he : false; }), E6 = computed(() => (h6 == null ? void 0 : h6.validateState) || ""), C6 = computed(() => E6.value && d0[E6.value]), I6 = computed(() => w6.value ? tT : Y_), b6 = computed(() => [ r.style ]), F6 = computed(() => [ i.inputStyle, M6.value, { resize: i.resize } ]), D6 = computed(() => Ci(i.modelValue) ? "" : String(i.modelValue)), N6 = computed(() => i.clearable && !p.value && !i.readonly && !!D6.value && (T6.value || x6.value)), B6 = computed(() => i.showPassword && !p.value && !i.readonly && !!D6.value && (!!D6.value || T6.value)), U6 = computed(() => i.showWordLimit && !!i.maxlength && (i.type === "text" || i.type === "textarea") && !p.value && !i.readonly && !i.showPassword), G6 = computed(() => D6.value.length), Y = computed(() => !!U6.value && G6.value > Number(i.maxlength)), te = computed(() => !!s.suffix || !!i.suffixIcon || N6.value || i.showPassword || U6.value || !!E6.value && S6.value), [ae, ie] = LE(v6); Jn(m6, (he) => { if ($6(), !U6.value || i.resize !== "both") return; const xe = he[0], { width: ne } = xe.contentRect; A6.value = { right: `calc(100% - ${ne + 15 + 6}px)` }; }); const le = () => { const { type: he, autosize: xe } = i; if (!(!en2 || he !== "textarea" || !m6.value)) if (xe) { const ne = Tn(xe) ? xe.minRows : void 0, me = Tn(xe) ? xe.maxRows : void 0, Me = Mm(m6.value, ne, me); M6.value = { overflowY: "hidden", ...Me }, nextTick(() => { m6.value.offsetHeight, M6.value = Me; }); } else M6.value = { minHeight: Mm(m6.value).minHeight }; }, $6 = /* @__PURE__ */ ((he) => { let xe = false; return () => { var ne; if (xe || !i.autosize) return; ((ne = m6.value) == null ? void 0 : ne.offsetParent) === null || (he(), xe = true); }; })(le), j6 = () => { const he = R6.value, xe = i.formatter ? i.formatter(D6.value) : D6.value; !he || he.value === xe || (he.value = xe); }, re = async (he) => { ae(); let { value: xe } = he.target; if (i.formatter && (xe = i.parser ? i.parser(xe) : xe), !H6.value) { if (xe === D6.value) { j6(); return; } t(At, xe), t("input", xe), await nextTick(), j6(), ie(); } }, k6 = (he) => { t("change", he.target.value); }, { isComposing: H6, handleCompositionStart: K, handleCompositionUpdate: ce, handleCompositionEnd: se } = N0({ emit: t, afterComposition: re }), V6 = () => { w6.value = !w6.value, O6(); }, O6 = async () => { var he; await nextTick(), (he = R6.value) == null || he.focus(); }, Z6 = () => { var he; return (he = R6.value) == null ? void 0 : he.blur(); }, X = (he) => { x6.value = false, t("mouseleave", he); }, ee = (he) => { x6.value = true, t("mouseenter", he); }, fe = (he) => { t("keydown", he); }, be = () => { var he; (he = R6.value) == null || he.select(); }, Ae = () => { t(At, ""), t("change", ""), t("clear"), t("input", ""); }; return watch(() => i.modelValue, () => { var he; nextTick(() => le()), i.validateEvent && ((he = h6 == null ? void 0 : h6.validate) == null || he.call(h6, "change").catch((xe) => kt(xe))); }), watch(D6, () => j6()), watch(() => i.type, async () => { await nextTick(), j6(), le(); }), onMounted(() => { !i.formatter && i.parser && kt("ElInput", "If you set the parser, you also need to set the formatter."), j6(), nextTick(le); }), e({ input: v6, textarea: m6, ref: R6, textareaStyle: F6, autosize: toRef(i, "autosize"), isComposing: H6, focus: O6, blur: Z6, select: be, clear: Ae, resizeTextarea: le }), (he, xe) => (openBlock(), createElementBlock("div", mergeProps(unref(o), { class: [ unref(a6), { [unref(u6).bm("group", "append")]: he.$slots.append, [unref(u6).bm("group", "prepend")]: he.$slots.prepend } ], style: unref(b6), role: he.containerRole, onMouseenter: ee, onMouseleave: X }), [ createCommentVNode(" input "), he.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createCommentVNode(" prepend slot "), he.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(u6).be("group", "prepend")) }, [ renderSlot(he.$slots, "prepend") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "wrapperRef", ref: L6, class: normalizeClass(unref(c)) }, [ createCommentVNode(" prefix slot "), he.$slots.prefix || he.prefixIcon ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(u6).e("prefix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(u6).e("prefix-inner")) }, [ renderSlot(he.$slots, "prefix"), he.prefixIcon ? (openBlock(), createBlock(unref(It), { key: 0, class: normalizeClass(unref(u6).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(he.prefixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("input", mergeProps({ id: unref(f6), ref_key: "input", ref: v6, class: unref(u6).e("inner") }, unref(l), { minlength: he.minlength, maxlength: he.maxlength, type: he.showPassword ? w6.value ? "text" : "password" : he.type, disabled: unref(p), readonly: he.readonly, autocomplete: he.autocomplete, tabindex: he.tabindex, "aria-label": he.ariaLabel, placeholder: he.placeholder, style: he.inputStyle, form: he.form, autofocus: he.autofocus, onCompositionstart: unref(K), onCompositionupdate: unref(ce), onCompositionend: unref(se), onInput: re, onChange: k6, onKeydown: fe }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), createCommentVNode(" suffix slot "), unref(te) ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(u6).e("suffix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(u6).e("suffix-inner")) }, [ !unref(N6) || !unref(B6) || !unref(U6) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ renderSlot(he.$slots, "suffix"), he.suffixIcon ? (openBlock(), createBlock(unref(It), { key: 0, class: normalizeClass(unref(u6).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(he.suffixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 64)) : createCommentVNode("v-if", true), unref(N6) ? (openBlock(), createBlock(unref(It), { key: 1, class: normalizeClass([unref(u6).e("icon"), unref(u6).e("clear")]), onMousedown: withModifiers(unref(Oa), ["prevent"]), onClick: Ae }, { default: withCtx(() => [ createVNode(unref(Yd)) ]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), unref(B6) ? (openBlock(), createBlock(unref(It), { key: 2, class: normalizeClass([unref(u6).e("icon"), unref(u6).e("password")]), onClick: V6 }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(I6)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), unref(U6) ? (openBlock(), createElementBlock("span", { key: 3, class: normalizeClass(unref(u6).e("count")) }, [ createBaseVNode("span", { class: normalizeClass(unref(u6).e("count-inner")) }, toDisplayString(unref(G6)) + " / " + toDisplayString(he.maxlength), 3) ], 2)) : createCommentVNode("v-if", true), unref(E6) && unref(C6) && unref(S6) ? (openBlock(), createBlock(unref(It), { key: 4, class: normalizeClass([ unref(u6).e("icon"), unref(u6).e("validateIcon"), unref(u6).is("loading", unref(E6) === "validating") ]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(C6)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true) ], 2), createCommentVNode(" append slot "), he.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(u6).be("group", "append")) }, [ renderSlot(he.$slots, "append") ], 2)) : createCommentVNode("v-if", true) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createCommentVNode(" textarea "), createBaseVNode("textarea", mergeProps({ id: unref(f6), ref_key: "textarea", ref: m6, class: [unref(y6).e("inner"), unref(u6).is("focus", unref(T6))] }, unref(l), { minlength: he.minlength, maxlength: he.maxlength, tabindex: he.tabindex, disabled: unref(p), readonly: he.readonly, autocomplete: he.autocomplete, style: unref(F6), "aria-label": he.ariaLabel, placeholder: he.placeholder, form: he.form, autofocus: he.autofocus, rows: he.rows, onCompositionstart: unref(K), onCompositionupdate: unref(ce), onCompositionend: unref(se), onInput: re, onFocus: unref(P6), onBlur: unref(_6), onChange: k6, onKeydown: fe }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), unref(U6) ? (openBlock(), createElementBlock("span", { key: 0, style: normalizeStyle(A6.value), class: normalizeClass(unref(u6).e("count")) }, toDisplayString(unref(G6)) + " / " + toDisplayString(he.maxlength), 7)) : createCommentVNode("v-if", true) ], 64)) ], 16, ["role"])); } }); var QE = st(qE, [["__file", "input.vue"]]); var e2 = on2(QE); var Hs = 4; var t2 = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; var n2 = ({ move: n, size: e, bar: t }) => ({ [t.size]: e, transform: `translate${t.axis}(${n}%)` }); var cf = Symbol("scrollbarContextKey"); var i2 = at({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); var r2 = "Thumb"; var s2 = defineComponent({ __name: "thumb", props: i2, setup(n) { const e = n, t = inject(cf), i = nt("scrollbar"); t || Xo(r2, "can not inject scrollbar context"); const r = ref(), s = ref(), o = ref({}), a6 = ref(false); let c = false, l = false, d = en2 ? document.onselectstart : null; const h6 = computed(() => t2[e.vertical ? "vertical" : "horizontal"]), f6 = computed(() => n2({ size: e.size, move: e.move, bar: h6.value })), g6 = computed(() => r.value[h6.value.offset] ** 2 / t.wrapElement[h6.value.scrollSize] / e.ratio / s.value[h6.value.offset]), p = (M6) => { var R6; if (M6.stopPropagation(), M6.ctrlKey || [1, 2].includes(M6.button)) return; (R6 = window.getSelection()) == null || R6.removeAllRanges(), y6(M6); const L6 = M6.currentTarget; L6 && (o.value[h6.value.axis] = L6[h6.value.offset] - (M6[h6.value.client] - L6.getBoundingClientRect()[h6.value.direction])); }, u6 = (M6) => { if (!s.value || !r.value || !t.wrapElement) return; const R6 = Math.abs(M6.target.getBoundingClientRect()[h6.value.direction] - M6[h6.value.client]), L6 = s.value[h6.value.offset] / 2, T6 = (R6 - L6) * 100 * g6.value / r.value[h6.value.offset]; t.wrapElement[h6.value.scroll] = T6 * t.wrapElement[h6.value.scrollSize] / 100; }, y6 = (M6) => { M6.stopImmediatePropagation(), c = true, document.addEventListener("mousemove", v6), document.addEventListener("mouseup", m6), d = document.onselectstart, document.onselectstart = () => false; }, v6 = (M6) => { if (!r.value || !s.value || c === false) return; const R6 = o.value[h6.value.axis]; if (!R6) return; const L6 = (r.value.getBoundingClientRect()[h6.value.direction] - M6[h6.value.client]) * -1, T6 = s.value[h6.value.offset] - R6, P6 = (L6 - T6) * 100 * g6.value / r.value[h6.value.offset]; t.wrapElement[h6.value.scroll] = P6 * t.wrapElement[h6.value.scrollSize] / 100; }, m6 = () => { c = false, o.value[h6.value.axis] = 0, document.removeEventListener("mousemove", v6), document.removeEventListener("mouseup", m6), A6(), l && (a6.value = false); }, x6 = () => { l = false, a6.value = !!e.size; }, w6 = () => { l = true, a6.value = c; }; onBeforeUnmount(() => { A6(), document.removeEventListener("mouseup", m6); }); const A6 = () => { document.onselectstart !== d && (document.onselectstart = d); }; return un(toRef(t, "scrollbarElement"), "mousemove", x6), un(toRef(t, "scrollbarElement"), "mouseleave", w6), (M6, R6) => (openBlock(), createBlock(Transition, { name: unref(i).b("fade"), persisted: "" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { ref_key: "instance", ref: r, class: normalizeClass([unref(i).e("bar"), unref(i).is(unref(h6).key)]), onMousedown: u6 }, [ createBaseVNode("div", { ref_key: "thumb", ref: s, class: normalizeClass(unref(i).e("thumb")), style: normalizeStyle(unref(f6)), onMousedown: p }, null, 38) ], 34), [ [vShow, M6.always || a6.value] ]) ]), _: 1 }, 8, ["name"])); } }); var wm = st(s2, [["__file", "thumb.vue"]]); var o2 = at({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); var a2 = defineComponent({ __name: "bar", props: o2, setup(n, { expose: e }) { const t = n, i = inject(cf), r = ref(0), s = ref(0), o = ref(""), a6 = ref(""), c = ref(1), l = ref(1); return e({ handleScroll: (f6) => { if (f6) { const g6 = f6.offsetHeight - Hs, p = f6.offsetWidth - Hs; s.value = f6.scrollTop * 100 / g6 * c.value, r.value = f6.scrollLeft * 100 / p * l.value; } }, update: () => { const f6 = i == null ? void 0 : i.wrapElement; if (!f6) return; const g6 = f6.offsetHeight - Hs, p = f6.offsetWidth - Hs, u6 = g6 ** 2 / f6.scrollHeight, y6 = p ** 2 / f6.scrollWidth, v6 = Math.max(u6, t.minSize), m6 = Math.max(y6, t.minSize); c.value = u6 / (g6 - u6) / (v6 / (g6 - v6)), l.value = y6 / (p - y6) / (m6 / (p - m6)), a6.value = v6 + Hs < g6 ? `${v6}px` : "", o.value = m6 + Hs < p ? `${m6}px` : ""; } }), (f6, g6) => (openBlock(), createElementBlock(Fragment, null, [ createVNode(wm, { move: r.value, ratio: l.value, size: o.value, always: f6.always }, null, 8, ["move", "ratio", "size", "always"]), createVNode(wm, { move: s.value, ratio: c.value, size: a6.value, vertical: "", always: f6.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var l2 = st(a2, [["__file", "bar.vue"]]); var c2 = at({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: false }, wrapStyle: { type: Je([String, Object, Array]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [String, Array, Object], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...Yr(["ariaLabel", "ariaOrientation"]) }); var u2 = { scroll: ({ scrollTop: n, scrollLeft: e }) => [n, e].every(yt) }; var Jh = "ElScrollbar"; var h22 = defineComponent({ name: Jh }); var d2 = defineComponent({ ...h22, props: c2, emits: u2, setup(n, { expose: e, emit: t }) { const i = n, r = nt("scrollbar"); let s, o, a6 = 0, c = 0; const l = ref(), d = ref(), h6 = ref(), f6 = ref(), g6 = computed(() => { const A6 = {}; return i.height && (A6.height = Dc(i.height)), i.maxHeight && (A6.maxHeight = Dc(i.maxHeight)), [i.wrapStyle, A6]; }), p = computed(() => [ i.wrapClass, r.e("wrap"), { [r.em("wrap", "hidden-default")]: !i.native } ]), u6 = computed(() => [r.e("view"), i.viewClass]), y6 = () => { var A6; d.value && ((A6 = f6.value) == null || A6.handleScroll(d.value), a6 = d.value.scrollTop, c = d.value.scrollLeft, t("scroll", { scrollTop: d.value.scrollTop, scrollLeft: d.value.scrollLeft })); }; function v6(A6, M6) { Tn(A6) ? d.value.scrollTo(A6) : yt(A6) && yt(M6) && d.value.scrollTo(A6, M6); } const m6 = (A6) => { if (!yt(A6)) { kt(Jh, "value must be a number"); return; } d.value.scrollTop = A6; }, x6 = (A6) => { if (!yt(A6)) { kt(Jh, "value must be a number"); return; } d.value.scrollLeft = A6; }, w6 = () => { var A6; (A6 = f6.value) == null || A6.update(); }; return watch(() => i.noresize, (A6) => { A6 ? (s == null || s(), o == null || o()) : ({ stop: s } = Jn(h6, w6), o = un("resize", w6)); }, { immediate: true }), watch(() => [i.maxHeight, i.height], () => { i.native || nextTick(() => { var A6; w6(), d.value && ((A6 = f6.value) == null || A6.handleScroll(d.value)); }); }), provide(cf, reactive({ scrollbarElement: l, wrapElement: d })), onActivated(() => { d.value && (d.value.scrollTop = a6, d.value.scrollLeft = c); }), onMounted(() => { i.native || nextTick(() => { w6(); }); }), onUpdated(() => w6()), e({ wrapRef: d, update: w6, scrollTo: v6, setScrollTop: m6, setScrollLeft: x6, handleScroll: y6 }), (A6, M6) => (openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: l, class: normalizeClass(unref(r).b()) }, [ createBaseVNode("div", { ref_key: "wrapRef", ref: d, class: normalizeClass(unref(p)), style: normalizeStyle(unref(g6)), tabindex: A6.tabindex, onScroll: y6 }, [ (openBlock(), createBlock(resolveDynamicComponent(A6.tag), { id: A6.id, ref_key: "resizeRef", ref: h6, class: normalizeClass(unref(u6)), style: normalizeStyle(A6.viewStyle), role: A6.role, "aria-label": A6.ariaLabel, "aria-orientation": A6.ariaOrientation }, { default: withCtx(() => [ renderSlot(A6.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), A6.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(l2, { key: 0, ref_key: "barRef", ref: f6, always: A6.always, "min-size": A6.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var f2 = st(d2, [["__file", "scrollbar.vue"]]); var p2 = on2(f2); var uf = Symbol("popper"); var z0 = Symbol("popperContent"); var m2 = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; var k0 = at({ role: { type: String, values: m2, default: "tooltip" } }); var g2 = defineComponent({ name: "ElPopper", inheritAttrs: false }); var v2 = defineComponent({ ...g2, props: k0, setup(n, { expose: e }) { const t = n, i = ref(), r = ref(), s = ref(), o = ref(), a6 = computed(() => t.role), c = { triggerRef: i, popperInstanceRef: r, contentRef: s, referenceRef: o, role: a6 }; return e(c), provide(uf, c), (l, d) => renderSlot(l.$slots, "default"); } }); var y2 = st(v2, [["__file", "popper.vue"]]); var V0 = at({ arrowOffset: { type: Number, default: 5 } }); var b2 = defineComponent({ name: "ElPopperArrow", inheritAttrs: false }); var x2 = defineComponent({ ...b2, props: V0, setup(n, { expose: e }) { const t = n, i = nt("popper"), { arrowOffset: r, arrowRef: s, arrowStyle: o } = inject(z0, void 0); return watch(() => t.arrowOffset, (a6) => { r.value = a6; }), onBeforeUnmount(() => { s.value = void 0; }), e({ arrowRef: s }), (a6, c) => (openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: s, class: normalizeClass(unref(i).e("arrow")), style: normalizeStyle(unref(o)), "data-popper-arrow": "" }, null, 6)); } }); var M2 = st(x2, [["__file", "arrow.vue"]]); var Bu = "ElOnlyChild"; var w2 = defineComponent({ name: Bu, setup(n, { slots: e, attrs: t }) { var i; const r = inject(R0), s = CE((i = r == null ? void 0 : r.setForwardRef) != null ? i : Oa); return () => { var o; const a6 = (o = e.default) == null ? void 0 : o.call(e, t); if (!a6) return null; if (a6.length > 1) return kt(Bu, "requires exact only one valid child."), null; const c = G0(a6); return c ? withDirectives(cloneVNode(c, t), [[s]]) : (kt(Bu, "no valid child node found"), null); }; } }); function G0(n) { if (!n) return null; const e = n; for (const t of e) { if (Tn(t)) switch (t.type) { case Comment: continue; case Text: case "svg": return Am(t); case Fragment: return G0(t.children); default: return t; } return Am(t); } return null; } function Am(n) { const e = nt("only-child"); return createVNode("span", { class: e.e("content") }, [n]); } var H0 = at({ virtualRef: { type: Je(Object) }, virtualTriggering: Boolean, onMouseenter: { type: Je(Function) }, onMouseleave: { type: Je(Function) }, onClick: { type: Je(Function) }, onKeydown: { type: Je(Function) }, onFocus: { type: Je(Function) }, onBlur: { type: Je(Function) }, onContextmenu: { type: Je(Function) }, id: String, open: Boolean }); var A2 = defineComponent({ name: "ElPopperTrigger", inheritAttrs: false }); var S2 = defineComponent({ ...A2, props: H0, setup(n, { expose: e }) { const t = n, { role: i, triggerRef: r } = inject(uf, void 0); EE(r); const s = computed(() => a6.value ? t.id : void 0), o = computed(() => { if (i && i.value === "tooltip") return t.open && t.id ? t.id : void 0; }), a6 = computed(() => { if (i && i.value !== "tooltip") return i.value; }), c = computed(() => a6.value ? `${t.open}` : void 0); let l; const d = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return onMounted(() => { watch(() => t.virtualRef, (h6) => { h6 && (r.value = er(h6)); }, { immediate: true }), watch(r, (h6, f6) => { l == null || l(), l = void 0, ys(h6) && (d.forEach((g6) => { var p; const u6 = t[g6]; u6 && (h6.addEventListener(g6.slice(2).toLowerCase(), u6), (p = f6 == null ? void 0 : f6.removeEventListener) == null || p.call(f6, g6.slice(2).toLowerCase(), u6)); }), l = watch([s, o, a6, c], (g6) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((p, u6) => { Ci(g6[u6]) ? h6.removeAttribute(p) : h6.setAttribute(p, g6[u6]); }); }, { immediate: true })), ys(f6) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((g6) => f6.removeAttribute(g6)); }, { immediate: true }); }), onBeforeUnmount(() => { if (l == null || l(), l = void 0, r.value && ys(r.value)) { const h6 = r.value; d.forEach((f6) => { const g6 = t[f6]; g6 && h6.removeEventListener(f6.slice(2).toLowerCase(), g6); }), r.value = void 0; } }), e({ triggerRef: r }), (h6, f6) => h6.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref(w2), mergeProps({ key: 0 }, h6.$attrs, { "aria-controls": unref(s), "aria-describedby": unref(o), "aria-expanded": unref(c), "aria-haspopup": unref(a6) }), { default: withCtx(() => [ renderSlot(h6.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var _2 = st(S2, [["__file", "trigger.vue"]]); var Uu = "focus-trap.focus-after-trapped"; var zu = "focus-trap.focus-after-released"; var T2 = "focus-trap.focusout-prevented"; var Sm = { cancelable: true, bubbles: false }; var E2 = { cancelable: true, bubbles: false }; var _m = "focusAfterTrapped"; var Tm = "focusAfterReleased"; var C2 = Symbol("elFocusTrap"); var hf = ref(); var ou = ref(0); var df = ref(0); var El = 0; var W0 = (n) => { const e = [], t = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, { acceptNode: (i) => { const r = i.tagName === "INPUT" && i.type === "hidden"; return i.disabled || i.hidden || r ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 || i === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; t.nextNode(); ) e.push(t.currentNode); return e; }; var Em = (n, e) => { for (const t of n) if (!L2(t, e)) return t; }; var L2 = (n, e) => { if (false) return false; if (getComputedStyle(n).visibility === "hidden") return true; for (; n; ) { if (e && n === e) return false; if (getComputedStyle(n).display === "none") return true; n = n.parentElement; } return false; }; var R2 = (n) => { const e = W0(n), t = Em(e, n), i = Em(e.reverse(), n); return [t, i]; }; var F2 = (n) => n instanceof HTMLInputElement && "select" in n; var Tr = (n, e) => { if (n && n.focus) { const t = document.activeElement; n.focus({ preventScroll: true }), df.value = window.performance.now(), n !== t && F2(n) && e && n.select(); } }; function Cm(n, e) { const t = [...n], i = n.indexOf(e); return i !== -1 && t.splice(i, 1), t; } var P2 = () => { let n = []; return { push: (i) => { const r = n[0]; r && i !== r && r.pause(), n = Cm(n, i), n.unshift(i); }, remove: (i) => { var r, s; n = Cm(n, i), (s = (r = n[0]) == null ? void 0 : r.resume) == null || s.call(r); } }; }; var I2 = (n, e = false) => { const t = document.activeElement; for (const i of n) if (Tr(i, e), document.activeElement !== t) return; }; var Lm = P2(); var O2 = () => ou.value > df.value; var Cl = () => { hf.value = "pointer", ou.value = window.performance.now(); }; var Rm = () => { hf.value = "keyboard", ou.value = window.performance.now(); }; var D2 = () => (onMounted(() => { El === 0 && (document.addEventListener("mousedown", Cl), document.addEventListener("touchstart", Cl), document.addEventListener("keydown", Rm)), El++; }), onBeforeUnmount(() => { El--, El <= 0 && (document.removeEventListener("mousedown", Cl), document.removeEventListener("touchstart", Cl), document.removeEventListener("keydown", Rm)); }), { focusReason: hf, lastUserFocusTimestamp: ou, lastAutomatedFocusTimestamp: df }); var Ll = (n) => new CustomEvent(T2, { ...E2, detail: n }); var N2 = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ _m, Tm, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(n, { emit: e }) { const t = ref(); let i, r; const { focusReason: s } = D2(); wE((p) => { n.trapped && !o.paused && e("release-requested", p); }); const o = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }, a6 = (p) => { if (!n.loop && !n.trapped || o.paused) return; const { key: u6, altKey: y6, ctrlKey: v6, metaKey: m6, currentTarget: x6, shiftKey: w6 } = p, { loop: A6 } = n, M6 = u6 === Li.tab && !y6 && !v6 && !m6, R6 = document.activeElement; if (M6 && R6) { const L6 = x6, [T6, P6] = R2(L6); if (T6 && P6) { if (!w6 && R6 === P6) { const S6 = Ll({ focusReason: s.value }); e("focusout-prevented", S6), S6.defaultPrevented || (p.preventDefault(), A6 && Tr(T6, true)); } else if (w6 && [T6, L6].includes(R6)) { const S6 = Ll({ focusReason: s.value }); e("focusout-prevented", S6), S6.defaultPrevented || (p.preventDefault(), A6 && Tr(P6, true)); } } else if (R6 === L6) { const S6 = Ll({ focusReason: s.value }); e("focusout-prevented", S6), S6.defaultPrevented || p.preventDefault(); } } }; provide(C2, { focusTrapRef: t, onKeydown: a6 }), watch(() => n.focusTrapEl, (p) => { p && (t.value = p); }, { immediate: true }), watch([t], ([p], [u6]) => { p && (p.addEventListener("keydown", a6), p.addEventListener("focusin", d), p.addEventListener("focusout", h6)), u6 && (u6.removeEventListener("keydown", a6), u6.removeEventListener("focusin", d), u6.removeEventListener("focusout", h6)); }); const c = (p) => { e(_m, p); }, l = (p) => e(Tm, p), d = (p) => { const u6 = unref(t); if (!u6) return; const y6 = p.target, v6 = p.relatedTarget, m6 = y6 && u6.contains(y6); n.trapped || v6 && u6.contains(v6) || (i = v6), m6 && e("focusin", p), !o.paused && n.trapped && (m6 ? r = y6 : Tr(r, true)); }, h6 = (p) => { const u6 = unref(t); if (!(o.paused || !u6)) if (n.trapped) { const y6 = p.relatedTarget; !Ci(y6) && !u6.contains(y6) && setTimeout(() => { if (!o.paused && n.trapped) { const v6 = Ll({ focusReason: s.value }); e("focusout-prevented", v6), v6.defaultPrevented || Tr(r, true); } }, 0); } else { const y6 = p.target; y6 && u6.contains(y6) || e("focusout", p); } }; async function f6() { await nextTick(); const p = unref(t); if (p) { Lm.push(o); const u6 = p.contains(document.activeElement) ? i : document.activeElement; if (i = u6, !p.contains(u6)) { const v6 = new Event(Uu, Sm); p.addEventListener(Uu, c), p.dispatchEvent(v6), v6.defaultPrevented || nextTick(() => { let m6 = n.focusStartEl; vn(m6) || (Tr(m6), document.activeElement !== m6 && (m6 = "first")), m6 === "first" && I2(W0(p), true), (document.activeElement === u6 || m6 === "container") && Tr(p); }); } } } function g6() { const p = unref(t); if (p) { p.removeEventListener(Uu, c); const u6 = new CustomEvent(zu, { ...Sm, detail: { focusReason: s.value } }); p.addEventListener(zu, l), p.dispatchEvent(u6), !u6.defaultPrevented && (s.value == "keyboard" || !O2() || p.contains(document.activeElement)) && Tr(i ?? document.body), p.removeEventListener(zu, l), Lm.remove(o); } } return onMounted(() => { n.trapped && f6(), watch(() => n.trapped, (p) => { p ? f6() : g6(); }); }), onBeforeUnmount(() => { n.trapped && g6(), t.value && (t.value.removeEventListener("keydown", a6), t.value.removeEventListener("focusin", d), t.value.removeEventListener("focusout", h6), t.value = void 0); }), { onKeydown: a6 }; } }); function B2(n, e, t, i, r, s) { return renderSlot(n.$slots, "default", { handleKeydown: n.onKeydown }); } var U2 = st(N2, [["render", B2], ["__file", "focus-trap.vue"]]); var z2 = ["fixed", "absolute"]; var k2 = at({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: Je(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: Yo, default: "bottom" }, popperOptions: { type: Je(Object), default: () => ({}) }, strategy: { type: String, values: z2, default: "absolute" } }); var j0 = at({ ...k2, id: String, style: { type: Je([String, Array, Object]) }, className: { type: Je([String, Array, Object]) }, effect: { type: Je(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: { type: Boolean, default: false }, trapping: { type: Boolean, default: false }, popperClass: { type: Je([String, Array, Object]) }, popperStyle: { type: Je([String, Array, Object]) }, referenceEl: { type: Je(Object) }, triggerTargetEl: { type: Je(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...Yr(["ariaLabel"]) }); var V2 = { mouseenter: (n) => n instanceof MouseEvent, mouseleave: (n) => n instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; var G2 = (n, e = []) => { const { placement: t, strategy: i, popperOptions: r } = n, s = { placement: t, strategy: i, ...r, modifiers: [...W2(n), ...e] }; return j2(s, r == null ? void 0 : r.modifiers), s; }; var H2 = (n) => { if (en2) return er(n); }; function W2(n) { const { offset: e, gpuAcceleration: t, fallbackPlacements: i } = n; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: i } }, { name: "computeStyles", options: { gpuAcceleration: t } } ]; } function j2(n, e) { e && (n.modifiers = [...n.modifiers, ...e ?? []]); } var $2 = 0; var Z2 = (n) => { const { popperInstanceRef: e, contentRef: t, triggerRef: i, role: r } = inject(uf, void 0), s = ref(), o = ref(), a6 = computed(() => ({ name: "eventListeners", enabled: !!n.visible })), c = computed(() => { var v6; const m6 = unref(s), x6 = (v6 = unref(o)) != null ? v6 : $2; return { name: "arrow", enabled: !L_(m6), options: { element: m6, padding: x6 } }; }), l = computed(() => ({ onFirstUpdate: () => { p(); }, ...G2(n, [ unref(c), unref(a6) ]) })), d = computed(() => H2(n.referenceEl) || unref(i)), { attributes: h6, state: f6, styles: g6, update: p, forceUpdate: u6, instanceRef: y6 } = bE(d, t, l); return watch(y6, (v6) => e.value = v6), onMounted(() => { watch(() => { var v6; return (v6 = unref(d)) == null ? void 0 : v6.getBoundingClientRect(); }, () => { p(); }); }), { attributes: h6, arrowRef: s, contentRef: t, instanceRef: y6, state: f6, styles: g6, role: r, forceUpdate: u6, update: p }; }; var X2 = (n, { attributes: e, styles: t, role: i }) => { const { nextZIndex: r } = I0(), s = nt("popper"), o = computed(() => unref(e).popper), a6 = ref(yt(n.zIndex) ? n.zIndex : r()), c = computed(() => [ s.b(), s.is("pure", n.pure), s.is(n.effect), n.popperClass ]), l = computed(() => [ { zIndex: unref(a6) }, unref(t).popper, n.popperStyle || {} ]), d = computed(() => i.value === "dialog" ? "false" : void 0), h6 = computed(() => unref(t).arrow || {}); return { ariaModal: d, arrowStyle: h6, contentAttrs: o, contentClass: c, contentStyle: l, contentZIndex: a6, updateZIndex: () => { a6.value = yt(n.zIndex) ? n.zIndex : r(); } }; }; var Y2 = (n, e) => { const t = ref(false), i = ref(); return { focusStartRef: i, trapped: t, onFocusAfterReleased: (l) => { var d; ((d = l.detail) == null ? void 0 : d.focusReason) !== "pointer" && (i.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (l) => { n.visible && !t.value && (l.target && (i.value = l.target), t.value = true); }, onFocusoutPrevented: (l) => { n.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), t.value = false); }, onReleaseRequested: () => { t.value = false, e("close"); } }; }; var J2 = defineComponent({ name: "ElPopperContent" }); var K2 = defineComponent({ ...J2, props: j0, emits: V2, setup(n, { expose: e, emit: t }) { const i = n, { focusStartRef: r, trapped: s, onFocusAfterReleased: o, onFocusAfterTrapped: a6, onFocusInTrap: c, onFocusoutPrevented: l, onReleaseRequested: d } = Y2(i, t), { attributes: h6, arrowRef: f6, contentRef: g6, styles: p, instanceRef: u6, role: y6, update: v6 } = Z2(i), { ariaModal: m6, arrowStyle: x6, contentAttrs: w6, contentClass: A6, contentStyle: M6, updateZIndex: R6 } = X2(i, { styles: p, attributes: h6, role: y6 }), L6 = inject(zc, void 0), T6 = ref(); provide(z0, { arrowStyle: x6, arrowRef: f6, arrowOffset: T6 }), L6 && provide(zc, { ...L6, addInputId: Oa, removeInputId: Oa }); let P6; const _6 = (E6 = true) => { v6(), E6 && R6(); }, S6 = () => { _6(false), i.visible && i.focusOnShow ? s.value = true : i.visible === false && (s.value = false); }; return onMounted(() => { watch(() => i.triggerTargetEl, (E6, C6) => { P6 == null || P6(), P6 = void 0; const I6 = unref(E6 || g6.value), b6 = unref(C6 || g6.value); ys(I6) && (P6 = watch([y6, () => i.ariaLabel, m6, () => i.id], (F6) => { ["role", "aria-label", "aria-modal", "id"].forEach((D6, N6) => { Ci(F6[N6]) ? I6.removeAttribute(D6) : I6.setAttribute(D6, F6[N6]); }); }, { immediate: true })), b6 !== I6 && ys(b6) && ["role", "aria-label", "aria-modal", "id"].forEach((F6) => { b6.removeAttribute(F6); }); }, { immediate: true }), watch(() => i.visible, S6, { immediate: true }); }), onBeforeUnmount(() => { P6 == null || P6(), P6 = void 0; }), e({ popperContentRef: g6, popperInstanceRef: u6, updatePopper: _6, contentStyle: M6 }), (E6, C6) => (openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: g6 }, unref(w6), { style: unref(M6), class: unref(A6), tabindex: "-1", onMouseenter: (I6) => E6.$emit("mouseenter", I6), onMouseleave: (I6) => E6.$emit("mouseleave", I6) }), [ createVNode(unref(U2), { trapped: unref(s), "trap-on-focus-in": true, "focus-trap-el": unref(g6), "focus-start-el": unref(r), onFocusAfterTrapped: unref(a6), onFocusAfterReleased: unref(o), onFocusin: unref(c), onFocusoutPrevented: unref(l), onReleaseRequested: unref(d) }, { default: withCtx(() => [ renderSlot(E6.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var q2 = st(K2, [["__file", "content.vue"]]); var Q2 = on2(y2); var ff = Symbol("elTooltip"); var kn = at({ ..._E, ...j0, appendTo: { type: Je([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: Je(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...Yr(["ariaLabel"]) }); var ka = at({ ...H0, disabled: Boolean, trigger: { type: Je([String, Array]), default: "hover" }, triggerKeys: { type: Je(Array), default: () => [Li.enter, Li.space] } }); var { useModelToggleProps: eC, useModelToggleEmits: tC, useModelToggle: nC } = gT("visible"); var iC = at({ ...k0, ...eC, ...kn, ...ka, ...V0, showArrow: { type: Boolean, default: true } }); var rC = [ ...tC, "before-show", "before-hide", "show", "hide", "open", "close" ]; var sC = (n, e) => Pn(n) ? n.includes(e) : n === e; var Ws = (n, e, t) => (i) => { sC(unref(n), e) && t(i); }; var oC = defineComponent({ name: "ElTooltipTrigger" }); var aC = defineComponent({ ...oC, props: ka, setup(n, { expose: e }) { const t = n, i = nt("tooltip"), { controlled: r, id: s, open: o, onOpen: a6, onClose: c, onToggle: l } = inject(ff, void 0), d = ref(null), h6 = () => { if (unref(r) || t.disabled) return true; }, f6 = toRef(t, "trigger"), g6 = Ji(h6, Ws(f6, "hover", a6)), p = Ji(h6, Ws(f6, "hover", c)), u6 = Ji(h6, Ws(f6, "click", (w6) => { w6.button === 0 && l(w6); })), y6 = Ji(h6, Ws(f6, "focus", a6)), v6 = Ji(h6, Ws(f6, "focus", c)), m6 = Ji(h6, Ws(f6, "contextmenu", (w6) => { w6.preventDefault(), l(w6); })), x6 = Ji(h6, (w6) => { const { code: A6 } = w6; t.triggerKeys.includes(A6) && (w6.preventDefault(), l(w6)); }); return e({ triggerRef: d }), (w6, A6) => (openBlock(), createBlock(unref(_2), { id: unref(s), "virtual-ref": w6.virtualRef, open: unref(o), "virtual-triggering": w6.virtualTriggering, class: normalizeClass(unref(i).e("trigger")), onBlur: unref(v6), onClick: unref(u6), onContextmenu: unref(m6), onFocus: unref(y6), onMouseenter: unref(g6), onMouseleave: unref(p), onKeydown: unref(x6) }, { default: withCtx(() => [ renderSlot(w6.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var lC = st(aC, [["__file", "trigger.vue"]]); var cC = at({ to: { type: Je([String, Object]), required: true }, disabled: Boolean }); var uC = defineComponent({ __name: "teleport", props: cC, setup(n) { return (e, t) => e.disabled ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: e.to }, [ renderSlot(e.$slots, "default") ], 8, ["to"])); } }); var hC = st(uC, [["__file", "teleport.vue"]]); var dC = on2(hC); var fC = defineComponent({ name: "ElTooltipContent", inheritAttrs: false }); var pC = defineComponent({ ...fC, props: kn, setup(n, { expose: e }) { const t = n, { selector: i } = L0(), r = nt("tooltip"), s = ref(null); let o; const { controlled: a6, id: c, open: l, trigger: d, onClose: h6, onOpen: f6, onShow: g6, onHide: p, onBeforeShow: u6, onBeforeHide: y6 } = inject(ff, void 0), v6 = computed(() => t.transition || `${r.namespace.value}-fade-in-linear`), m6 = computed(() => false ? true : t.persistent); onBeforeUnmount(() => { o == null || o(); }); const x6 = computed(() => unref(m6) ? true : unref(l)), w6 = computed(() => t.disabled ? false : unref(l)), A6 = computed(() => t.appendTo || i.value), M6 = computed(() => { var b6; return (b6 = t.style) != null ? b6 : {}; }), R6 = ref(true), L6 = () => { p(), R6.value = true; }, T6 = () => { if (unref(a6)) return true; }, P6 = Ji(T6, () => { t.enterable && unref(d) === "hover" && f6(); }), _6 = Ji(T6, () => { unref(d) === "hover" && h6(); }), S6 = () => { var b6, F6; (F6 = (b6 = s.value) == null ? void 0 : b6.updatePopper) == null || F6.call(b6), u6 == null || u6(); }, E6 = () => { y6 == null || y6(); }, C6 = () => { g6(), o = bw(computed(() => { var b6; return (b6 = s.value) == null ? void 0 : b6.popperContentRef; }), () => { if (unref(a6)) return; unref(d) !== "hover" && h6(); }); }, I6 = () => { t.virtualTriggering || h6(); }; return watch(() => unref(l), (b6) => { b6 ? R6.value = false : o == null || o(); }, { flush: "post" }), watch(() => t.content, () => { var b6, F6; (F6 = (b6 = s.value) == null ? void 0 : b6.updatePopper) == null || F6.call(b6); }), e({ contentRef: s }), (b6, F6) => (openBlock(), createBlock(unref(dC), { disabled: !b6.teleported, to: unref(A6) }, { default: withCtx(() => [ createVNode(Transition, { name: unref(v6), onAfterLeave: L6, onBeforeEnter: S6, onAfterEnter: C6, onBeforeLeave: E6 }, { default: withCtx(() => [ unref(x6) ? withDirectives((openBlock(), createBlock(unref(q2), mergeProps({ key: 0, id: unref(c), ref_key: "contentRef", ref: s }, b6.$attrs, { "aria-label": b6.ariaLabel, "aria-hidden": R6.value, "boundaries-padding": b6.boundariesPadding, "fallback-placements": b6.fallbackPlacements, "gpu-acceleration": b6.gpuAcceleration, offset: b6.offset, placement: b6.placement, "popper-options": b6.popperOptions, strategy: b6.strategy, effect: b6.effect, enterable: b6.enterable, pure: b6.pure, "popper-class": b6.popperClass, "popper-style": [b6.popperStyle, unref(M6)], "reference-el": b6.referenceEl, "trigger-target-el": b6.triggerTargetEl, visible: unref(w6), "z-index": b6.zIndex, onMouseenter: unref(P6), onMouseleave: unref(_6), onBlur: I6, onClose: unref(h6) }), { default: withCtx(() => [ renderSlot(b6.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [vShow, unref(w6)] ]) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var mC = st(pC, [["__file", "content.vue"]]); var gC = defineComponent({ name: "ElTooltip" }); var vC = defineComponent({ ...gC, props: iC, emits: rC, setup(n, { expose: e, emit: t }) { const i = n; SE(); const r = sl(), s = ref(), o = ref(), a6 = () => { var v6; const m6 = unref(s); m6 && ((v6 = m6.popperInstanceRef) == null || v6.update()); }, c = ref(false), l = ref(), { show: d, hide: h6, hasUpdateHandler: f6 } = nC({ indicator: c, toggleReason: l }), { onOpen: g6, onClose: p } = TE({ showAfter: toRef(i, "showAfter"), hideAfter: toRef(i, "hideAfter"), autoClose: toRef(i, "autoClose"), open: d, close: h6 }), u6 = computed(() => Ba(i.visible) && !f6.value); provide(ff, { controlled: u6, id: r, open: readonly(c), trigger: toRef(i, "trigger"), onOpen: (v6) => { g6(v6); }, onClose: (v6) => { p(v6); }, onToggle: (v6) => { unref(c) ? p(v6) : g6(v6); }, onShow: () => { t("show", l.value); }, onHide: () => { t("hide", l.value); }, onBeforeShow: () => { t("before-show", l.value); }, onBeforeHide: () => { t("before-hide", l.value); }, updatePopper: a6 }), watch(() => i.disabled, (v6) => { v6 && c.value && (c.value = false); }); const y6 = (v6) => { var m6, x6; const w6 = (x6 = (m6 = o.value) == null ? void 0 : m6.contentRef) == null ? void 0 : x6.popperContentRef, A6 = (v6 == null ? void 0 : v6.relatedTarget) || document.activeElement; return w6 && w6.contains(A6); }; return onDeactivated(() => c.value && h6()), e({ popperRef: s, contentRef: o, isFocusInsideContent: y6, updatePopper: a6, onOpen: g6, onClose: p, hide: h6 }), (v6, m6) => (openBlock(), createBlock(unref(Q2), { ref_key: "popperRef", ref: s, role: v6.role }, { default: withCtx(() => [ createVNode(lC, { disabled: v6.disabled, trigger: v6.trigger, "trigger-keys": v6.triggerKeys, "virtual-ref": v6.virtualRef, "virtual-triggering": v6.virtualTriggering }, { default: withCtx(() => [ v6.$slots.default ? renderSlot(v6.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), createVNode(mC, { ref_key: "contentRef", ref: o, "aria-label": v6.ariaLabel, "boundaries-padding": v6.boundariesPadding, content: v6.content, disabled: v6.disabled, effect: v6.effect, enterable: v6.enterable, "fallback-placements": v6.fallbackPlacements, "hide-after": v6.hideAfter, "gpu-acceleration": v6.gpuAcceleration, offset: v6.offset, persistent: v6.persistent, "popper-class": v6.popperClass, "popper-style": v6.popperStyle, placement: v6.placement, "popper-options": v6.popperOptions, pure: v6.pure, "raw-content": v6.rawContent, "reference-el": v6.referenceEl, "trigger-target-el": v6.triggerTargetEl, "show-after": v6.showAfter, strategy: v6.strategy, teleported: v6.teleported, transition: v6.transition, "virtual-triggering": v6.virtualTriggering, "z-index": v6.zIndex, "append-to": v6.appendTo }, { default: withCtx(() => [ renderSlot(v6.$slots, "content", {}, () => [ v6.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: v6.content }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(v6.content), 1)) ]), v6.showArrow ? (openBlock(), createBlock(unref(M2), { key: 0, "arrow-offset": v6.arrowOffset }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var yC = st(vC, [["__file", "tooltip.vue"]]); var pf = on2(yC); var $0 = Symbol("buttonGroupContextKey"); var bC = (n, e) => { p0({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => n.type === "text")); const t = inject($0, void 0), i = af("button"), { form: r } = Jo(), s = Ns(computed(() => t == null ? void 0 : t.size)), o = ol(), a6 = ref(), c = useSlots(), l = computed(() => n.type || (t == null ? void 0 : t.type) || ""), d = computed(() => { var p, u6, y6; return (y6 = (u6 = n.autoInsertSpace) != null ? u6 : (p = i.value) == null ? void 0 : p.autoInsertSpace) != null ? y6 : false; }), h6 = computed(() => n.tag === "button" ? { ariaDisabled: o.value || n.loading, disabled: o.value || n.loading, autofocus: n.autofocus, type: n.nativeType } : {}), f6 = computed(() => { var p; const u6 = (p = c.default) == null ? void 0 : p.call(c); if (d.value && (u6 == null ? void 0 : u6.length) === 1) { const y6 = u6[0]; if ((y6 == null ? void 0 : y6.type) === Text) { const v6 = y6.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(v6.trim()); } } return false; }); return { _disabled: o, _size: s, _type: l, _ref: a6, _props: h6, shouldAddSpace: f6, handleClick: (p) => { if (o.value || n.loading) { p.stopPropagation(); return; } n.nativeType === "reset" && (r == null || r.resetFields()), e("click", p); } }; }; var xC = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; var MC = ["button", "submit", "reset"]; var Kh = at({ size: Gr, disabled: Boolean, type: { type: String, values: xC, default: "" }, icon: { type: Vr }, nativeType: { type: String, values: MC, default: "button" }, loading: Boolean, loadingIcon: { type: Vr, default: () => c0 }, plain: Boolean, text: Boolean, link: Boolean, bg: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: Je([String, Object]), default: "button" } }); var wC = { click: (n) => n instanceof MouseEvent }; function yn(n, e) { AC(n) && (n = "100%"); var t = SC(n); return n = e === 360 ? n : Math.min(e, Math.max(0, parseFloat(n))), t && (n = parseInt(String(n * e), 10) / 100), Math.abs(n - e) < 1e-6 ? 1 : (e === 360 ? n = (n < 0 ? n % e + e : n % e) / parseFloat(String(e)) : n = n % e / parseFloat(String(e)), n); } function Rl(n) { return Math.min(1, Math.max(0, n)); } function AC(n) { return typeof n == "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1; } function SC(n) { return typeof n == "string" && n.indexOf("%") !== -1; } function Z0(n) { return n = parseFloat(n), (isNaN(n) || n < 0 || n > 1) && (n = 1), n; } function Fl(n) { return n <= 1 ? "".concat(Number(n) * 100, "%") : n; } function ms(n) { return n.length === 1 ? "0" + n : String(n); } function _C(n, e, t) { return { r: yn(n, 255) * 255, g: yn(e, 255) * 255, b: yn(t, 255) * 255 }; } function Fm(n, e, t) { n = yn(n, 255), e = yn(e, 255), t = yn(t, 255); var i = Math.max(n, e, t), r = Math.min(n, e, t), s = 0, o = 0, a6 = (i + r) / 2; if (i === r) o = 0, s = 0; else { var c = i - r; switch (o = a6 > 0.5 ? c / (2 - i - r) : c / (i + r), i) { case n: s = (e - t) / c + (e < t ? 6 : 0); break; case e: s = (t - n) / c + 2; break; case t: s = (n - e) / c + 4; break; } s /= 6; } return { h: s, s: o, l: a6 }; } function ku(n, e, t) { return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * (2 / 3 - t) * 6 : n; } function TC(n, e, t) { var i, r, s; if (n = yn(n, 360), e = yn(e, 100), t = yn(t, 100), e === 0) r = t, s = t, i = t; else { var o = t < 0.5 ? t * (1 + e) : t + e - t * e, a6 = 2 * t - o; i = ku(a6, o, n + 1 / 3), r = ku(a6, o, n), s = ku(a6, o, n - 1 / 3); } return { r: i * 255, g: r * 255, b: s * 255 }; } function Pm(n, e, t) { n = yn(n, 255), e = yn(e, 255), t = yn(t, 255); var i = Math.max(n, e, t), r = Math.min(n, e, t), s = 0, o = i, a6 = i - r, c = i === 0 ? 0 : a6 / i; if (i === r) s = 0; else { switch (i) { case n: s = (e - t) / a6 + (e < t ? 6 : 0); break; case e: s = (t - n) / a6 + 2; break; case t: s = (n - e) / a6 + 4; break; } s /= 6; } return { h: s, s: c, v: o }; } function EC(n, e, t) { n = yn(n, 360) * 6, e = yn(e, 100), t = yn(t, 100); var i = Math.floor(n), r = n - i, s = t * (1 - e), o = t * (1 - r * e), a6 = t * (1 - (1 - r) * e), c = i % 6, l = [t, o, s, s, a6, t][c], d = [a6, t, t, o, s, s][c], h6 = [s, s, a6, t, t, o][c]; return { r: l * 255, g: d * 255, b: h6 * 255 }; } function Im(n, e, t, i) { var r = [ ms(Math.round(n).toString(16)), ms(Math.round(e).toString(16)), ms(Math.round(t).toString(16)) ]; return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join(""); } function CC(n, e, t, i, r) { var s = [ ms(Math.round(n).toString(16)), ms(Math.round(e).toString(16)), ms(Math.round(t).toString(16)), ms(LC(i)) ]; return r && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) && s[3].startsWith(s[3].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0) : s.join(""); } function LC(n) { return Math.round(parseFloat(n) * 255).toString(16); } function Om(n) { return zn(n) / 255; } function zn(n) { return parseInt(n, 16); } function RC(n) { return { r: n >> 16, g: (n & 65280) >> 8, b: n & 255 }; } var qh = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function FC(n) { var e = { r: 0, g: 0, b: 0 }, t = 1, i = null, r = null, s = null, o = false, a6 = false; return typeof n == "string" && (n = OC(n)), typeof n == "object" && (Hi(n.r) && Hi(n.g) && Hi(n.b) ? (e = _C(n.r, n.g, n.b), o = true, a6 = String(n.r).substr(-1) === "%" ? "prgb" : "rgb") : Hi(n.h) && Hi(n.s) && Hi(n.v) ? (i = Fl(n.s), r = Fl(n.v), e = EC(n.h, i, r), o = true, a6 = "hsv") : Hi(n.h) && Hi(n.s) && Hi(n.l) && (i = Fl(n.s), s = Fl(n.l), e = TC(n.h, i, s), o = true, a6 = "hsl"), Object.prototype.hasOwnProperty.call(n, "a") && (t = n.a)), t = Z0(t), { ok: o, format: n.format || a6, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: t }; } var PC = "[-\\+]?\\d+%?"; var IC = "[-\\+]?\\d*\\.\\d+%?"; var Fr = "(?:".concat(IC, ")|(?:").concat(PC, ")"); var Vu = "[\\s|\\(]+(".concat(Fr, ")[,|\\s]+(").concat(Fr, ")[,|\\s]+(").concat(Fr, ")\\s*\\)?"); var Gu = "[\\s|\\(]+(".concat(Fr, ")[,|\\s]+(").concat(Fr, ")[,|\\s]+(").concat(Fr, ")[,|\\s]+(").concat(Fr, ")\\s*\\)?"); var li = { CSS_UNIT: new RegExp(Fr), rgb: new RegExp("rgb" + Vu), rgba: new RegExp("rgba" + Gu), hsl: new RegExp("hsl" + Vu), hsla: new RegExp("hsla" + Gu), hsv: new RegExp("hsv" + Vu), hsva: new RegExp("hsva" + Gu), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function OC(n) { if (n = n.trim().toLowerCase(), n.length === 0) return false; var e = false; if (qh[n]) n = qh[n], e = true; else if (n === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var t = li.rgb.exec(n); return t ? { r: t[1], g: t[2], b: t[3] } : (t = li.rgba.exec(n), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = li.hsl.exec(n), t ? { h: t[1], s: t[2], l: t[3] } : (t = li.hsla.exec(n), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = li.hsv.exec(n), t ? { h: t[1], s: t[2], v: t[3] } : (t = li.hsva.exec(n), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = li.hex8.exec(n), t ? { r: zn(t[1]), g: zn(t[2]), b: zn(t[3]), a: Om(t[4]), format: e ? "name" : "hex8" } : (t = li.hex6.exec(n), t ? { r: zn(t[1]), g: zn(t[2]), b: zn(t[3]), format: e ? "name" : "hex" } : (t = li.hex4.exec(n), t ? { r: zn(t[1] + t[1]), g: zn(t[2] + t[2]), b: zn(t[3] + t[3]), a: Om(t[4] + t[4]), format: e ? "name" : "hex8" } : (t = li.hex3.exec(n), t ? { r: zn(t[1] + t[1]), g: zn(t[2] + t[2]), b: zn(t[3] + t[3]), format: e ? "name" : "hex" } : false))))))))); } function Hi(n) { return !!li.CSS_UNIT.exec(String(n)); } var DC = ( /** @class */ function() { function n(e, t) { e === void 0 && (e = ""), t === void 0 && (t = {}); var i; if (e instanceof n) return e; typeof e == "number" && (e = RC(e)), this.originalInput = e; var r = FC(e); this.originalInput = e, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = t.format) !== null && i !== void 0 ? i : r.format, this.gradientType = t.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok; } return n.prototype.isDark = function() { return this.getBrightness() < 128; }, n.prototype.isLight = function() { return !this.isDark(); }, n.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, n.prototype.getLuminance = function() { var e = this.toRgb(), t, i, r, s = e.r / 255, o = e.g / 255, a6 = e.b / 255; return s <= 0.03928 ? t = s / 12.92 : t = Math.pow((s + 0.055) / 1.055, 2.4), o <= 0.03928 ? i = o / 12.92 : i = Math.pow((o + 0.055) / 1.055, 2.4), a6 <= 0.03928 ? r = a6 / 12.92 : r = Math.pow((a6 + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * i + 0.0722 * r; }, n.prototype.getAlpha = function() { return this.a; }, n.prototype.setAlpha = function(e) { return this.a = Z0(e), this.roundA = Math.round(100 * this.a) / 100, this; }, n.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, n.prototype.toHsv = function() { var e = Pm(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, n.prototype.toHsvString = function() { var e = Pm(this.r, this.g, this.b), t = Math.round(e.h * 360), i = Math.round(e.s * 100), r = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(t, ", ").concat(i, "%, ").concat(r, "%)") : "hsva(".concat(t, ", ").concat(i, "%, ").concat(r, "%, ").concat(this.roundA, ")"); }, n.prototype.toHsl = function() { var e = Fm(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, n.prototype.toHslString = function() { var e = Fm(this.r, this.g, this.b), t = Math.round(e.h * 360), i = Math.round(e.s * 100), r = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(t, ", ").concat(i, "%, ").concat(r, "%)") : "hsla(".concat(t, ", ").concat(i, "%, ").concat(r, "%, ").concat(this.roundA, ")"); }, n.prototype.toHex = function(e) { return e === void 0 && (e = false), Im(this.r, this.g, this.b, e); }, n.prototype.toHexString = function(e) { return e === void 0 && (e = false), "#" + this.toHex(e); }, n.prototype.toHex8 = function(e) { return e === void 0 && (e = false), CC(this.r, this.g, this.b, this.a, e); }, n.prototype.toHex8String = function(e) { return e === void 0 && (e = false), "#" + this.toHex8(e); }, n.prototype.toHexShortString = function(e) { return e === void 0 && (e = false), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, n.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, n.prototype.toRgbString = function() { var e = Math.round(this.r), t = Math.round(this.g), i = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(t, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(t, ", ").concat(i, ", ").concat(this.roundA, ")"); }, n.prototype.toPercentageRgb = function() { var e = function(t) { return "".concat(Math.round(yn(t, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, n.prototype.toPercentageRgbString = function() { var e = function(t) { return Math.round(yn(t, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, n.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return false; for (var e = "#" + Im(this.r, this.g, this.b, false), t = 0, i = Object.entries(qh); t < i.length; t++) { var r = i[t], s = r[0], o = r[1]; if (e === o) return s; } return false; }, n.prototype.toString = function(e) { var t = !!e; e = e ?? this.format; var i = false, r = this.a < 1 && this.a >= 0, s = !t && r && (e.startsWith("hex") || e === "name"); return s ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(true)), e === "hex4" && (i = this.toHex8String(true)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString()); }, n.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, n.prototype.clone = function() { return new n(this.toString()); }, n.prototype.lighten = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.l += e / 100, t.l = Rl(t.l), new n(t); }, n.prototype.brighten = function(e) { e === void 0 && (e = 10); var t = this.toRgb(); return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), new n(t); }, n.prototype.darken = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.l -= e / 100, t.l = Rl(t.l), new n(t); }, n.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, n.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, n.prototype.desaturate = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.s -= e / 100, t.s = Rl(t.s), new n(t); }, n.prototype.saturate = function(e) { e === void 0 && (e = 10); var t = this.toHsl(); return t.s += e / 100, t.s = Rl(t.s), new n(t); }, n.prototype.greyscale = function() { return this.desaturate(100); }, n.prototype.spin = function(e) { var t = this.toHsl(), i = (t.h + e) % 360; return t.h = i < 0 ? 360 + i : i, new n(t); }, n.prototype.mix = function(e, t) { t === void 0 && (t = 50); var i = this.toRgb(), r = new n(e).toRgb(), s = t / 100, o = { r: (r.r - i.r) * s + i.r, g: (r.g - i.g) * s + i.g, b: (r.b - i.b) * s + i.b, a: (r.a - i.a) * s + i.a }; return new n(o); }, n.prototype.analogous = function(e, t) { e === void 0 && (e = 6), t === void 0 && (t = 30); var i = this.toHsl(), r = 360 / t, s = [this]; for (i.h = (i.h - (r * e >> 1) + 720) % 360; --e; ) i.h = (i.h + r) % 360, s.push(new n(i)); return s; }, n.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new n(e); }, n.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var t = this.toHsv(), i = t.h, r = t.s, s = t.v, o = [], a6 = 1 / e; e--; ) o.push(new n({ h: i, s: r, v: s })), s = (s + a6) % 1; return o; }, n.prototype.splitcomplement = function() { var e = this.toHsl(), t = e.h; return [ this, new n({ h: (t + 72) % 360, s: e.s, l: e.l }), new n({ h: (t + 216) % 360, s: e.s, l: e.l }) ]; }, n.prototype.onBackground = function(e) { var t = this.toRgb(), i = new n(e).toRgb(), r = t.a + i.a * (1 - t.a); return new n({ r: (t.r * t.a + i.r * i.a * (1 - t.a)) / r, g: (t.g * t.a + i.g * i.a * (1 - t.a)) / r, b: (t.b * t.a + i.b * i.a * (1 - t.a)) / r, a: r }); }, n.prototype.triad = function() { return this.polyad(3); }, n.prototype.tetrad = function() { return this.polyad(4); }, n.prototype.polyad = function(e) { for (var t = this.toHsl(), i = t.h, r = [this], s = 360 / e, o = 1; o < e; o++) r.push(new n({ h: (i + o * s) % 360, s: t.s, l: t.l })); return r; }, n.prototype.equals = function(e) { return this.toRgbString() === new n(e).toRgbString(); }, n; }() ); function gr(n, e = 20) { return n.mix("#141414", e).toString(); } function NC(n) { const e = ol(), t = nt("button"); return computed(() => { let i = {}, r = n.color; if (r) { const s = r.match(/var\((.*?)\)/); s && (r = window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1])); const o = new DC(r), a6 = n.dark ? o.tint(20).toString() : gr(o, 20); if (n.plain) i = t.cssVarBlock({ "bg-color": n.dark ? gr(o, 90) : o.tint(90).toString(), "text-color": r, "border-color": n.dark ? gr(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${t.cssVarName("color-white")})`, "hover-bg-color": r, "hover-border-color": r, "active-bg-color": a6, "active-text-color": `var(${t.cssVarName("color-white")})`, "active-border-color": a6 }), e.value && (i[t.cssVarBlockName("disabled-bg-color")] = n.dark ? gr(o, 90) : o.tint(90).toString(), i[t.cssVarBlockName("disabled-text-color")] = n.dark ? gr(o, 50) : o.tint(50).toString(), i[t.cssVarBlockName("disabled-border-color")] = n.dark ? gr(o, 80) : o.tint(80).toString()); else { const c = n.dark ? gr(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${t.cssVarName("color-white")})` : `var(${t.cssVarName("color-black")})`; if (i = t.cssVarBlock({ "bg-color": r, "text-color": l, "border-color": r, "hover-bg-color": c, "hover-text-color": l, "hover-border-color": c, "active-bg-color": a6, "active-border-color": a6 }), e.value) { const d = n.dark ? gr(o, 50) : o.tint(50).toString(); i[t.cssVarBlockName("disabled-bg-color")] = d, i[t.cssVarBlockName("disabled-text-color")] = n.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t.cssVarName("color-white")})`, i[t.cssVarBlockName("disabled-border-color")] = d; } } } return i; }); } var BC = defineComponent({ name: "ElButton" }); var UC = defineComponent({ ...BC, props: Kh, emits: wC, setup(n, { expose: e, emit: t }) { const i = n, r = NC(i), s = nt("button"), { _ref: o, _size: a6, _type: c, _disabled: l, _props: d, shouldAddSpace: h6, handleClick: f6 } = bC(i, t), g6 = computed(() => [ s.b(), s.m(c.value), s.m(a6.value), s.is("disabled", l.value), s.is("loading", i.loading), s.is("plain", i.plain), s.is("round", i.round), s.is("circle", i.circle), s.is("text", i.text), s.is("link", i.link), s.is("has-bg", i.bg) ]); return e({ ref: o, size: a6, type: c, disabled: l, shouldAddSpace: h6 }), (p, u6) => (openBlock(), createBlock(resolveDynamicComponent(p.tag), mergeProps({ ref_key: "_ref", ref: o }, unref(d), { class: unref(g6), style: unref(r), onClick: unref(f6) }), { default: withCtx(() => [ p.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ p.$slots.loading ? renderSlot(p.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(It), { key: 1, class: normalizeClass(unref(s).is("loading")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(p.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : p.icon || p.$slots.icon ? (openBlock(), createBlock(unref(It), { key: 1 }, { default: withCtx(() => [ p.icon ? (openBlock(), createBlock(resolveDynamicComponent(p.icon), { key: 0 })) : renderSlot(p.$slots, "icon", { key: 1 }) ]), _: 3 })) : createCommentVNode("v-if", true), p.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(s).em("text", "expand")]: unref(h6) }) }, [ renderSlot(p.$slots, "default") ], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var zC = st(UC, [["__file", "button.vue"]]); var kC = { size: Kh.size, type: Kh.type }; var VC = defineComponent({ name: "ElButtonGroup" }); var GC = defineComponent({ ...VC, props: kC, setup(n) { const e = n; provide($0, reactive({ size: toRef(e, "size"), type: toRef(e, "type") })); const t = nt("button"); return (i, r) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(t).b("group")) }, [ renderSlot(i.$slots, "default") ], 2)); } }); var X0 = st(GC, [["__file", "button-group.vue"]]); var Ko = on2(zC, { ButtonGroup: X0 }); vi(X0); var Lr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function HC(n) { return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n; } function au(n) { if (n.__esModule) return n; var e = n.default; if (typeof e == "function") { var t = function i() { return this instanceof i ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; t.prototype = e.prototype; } else t = {}; return Object.defineProperty(t, "__esModule", { value: true }), Object.keys(n).forEach(function(i) { var r = Object.getOwnPropertyDescriptor(n, i); Object.defineProperty(t, i, r.get ? r : { enumerable: true, get: function() { return n[i]; } }); }), t; } var Er = /* @__PURE__ */ new Map(); if (en2) { let n; document.addEventListener("mousedown", (e) => n = e), document.addEventListener("mouseup", (e) => { if (n) { for (const t of Er.values()) for (const { documentHandler: i } of t) i(e, n); n = void 0; } }); } function Dm(n, e) { let t = []; return Array.isArray(e.arg) ? t = e.arg : ys(e.arg) && t.push(e.arg), function(i, r) { const s = e.instance.popperRef, o = i.target, a6 = r == null ? void 0 : r.target, c = !e || !e.instance, l = !o || !a6, d = n.contains(o) || n.contains(a6), h6 = n === o, f6 = t.length && t.some((p) => p == null ? void 0 : p.contains(o)) || t.length && t.includes(a6), g6 = s && (s.contains(o) || s.contains(a6)); c || l || d || h6 || f6 || g6 || e.value(i, r); }; } var WC = { beforeMount(n, e) { Er.has(n) || Er.set(n, []), Er.get(n).push({ documentHandler: Dm(n, e), bindingFn: e.value }); }, updated(n, e) { Er.has(n) || Er.set(n, []); const t = Er.get(n), i = t.findIndex((s) => s.bindingFn === e.oldValue), r = { documentHandler: Dm(n, e), bindingFn: e.value }; i >= 0 ? t.splice(i, 1, r) : t.push(r); }, unmounted(n) { Er.delete(n); } }; var jC = 100; var $C = 600; var Nm = { beforeMount(n, e) { const t = e.value, { interval: i = jC, delay: r = $C } = Sn(t) ? {} : t; let s, o; const a6 = () => Sn(t) ? t() : t.handler(), c = () => { o && (clearTimeout(o), o = void 0), s && (clearInterval(s), s = void 0); }; n.addEventListener("mousedown", (l) => { l.button === 0 && (c(), a6(), document.addEventListener("mouseup", () => c(), { once: true }), o = setTimeout(() => { s = setInterval(() => { a6(); }, i); }, r)); }); } }; var Y0 = at({ modelValue: { type: [String, Number, Boolean], default: void 0 }, size: Gr, disabled: Boolean, label: { type: [String, Number, Boolean], default: void 0 }, value: { type: [String, Number, Boolean], default: void 0 }, name: { type: String, default: void 0 } }); var ZC = at({ ...Y0, border: Boolean }); var J0 = { [At]: (n) => vn(n) || yt(n) || Ba(n), [hr]: (n) => vn(n) || yt(n) || Ba(n) }; var K0 = Symbol("radioGroupKey"); var q0 = (n, e) => { const t = ref(), i = inject(K0, void 0), r = computed(() => !!i), s = computed(() => im(n.value) ? n.label : n.value), o = computed({ get() { return r.value ? i.modelValue : n.modelValue; }, set(h6) { r.value ? i.changeEvent(h6) : e && e(At, h6), t.value.checked = n.modelValue === s.value; } }), a6 = Ns(computed(() => i == null ? void 0 : i.size)), c = ol(computed(() => i == null ? void 0 : i.disabled)), l = ref(false), d = computed(() => c.value || r.value && o.value !== s.value ? -1 : 0); return p0({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-radio", ref: "https://element-plus.org/en-US/component/radio.html" }, computed(() => r.value && im(n.value))), { radioRef: t, isGroup: r, radioGroup: i, focus: l, size: a6, disabled: c, tabIndex: d, modelValue: o, actualValue: s }; }; var XC = defineComponent({ name: "ElRadio" }); var YC = defineComponent({ ...XC, props: ZC, emits: J0, setup(n, { emit: e }) { const t = n, i = nt("radio"), { radioRef: r, radioGroup: s, focus: o, size: a6, disabled: c, modelValue: l, actualValue: d } = q0(t, e); function h6() { nextTick(() => e("change", l.value)); } return (f6, g6) => { var p; return openBlock(), createElementBlock("label", { class: normalizeClass([ unref(i).b(), unref(i).is("disabled", unref(c)), unref(i).is("focus", unref(o)), unref(i).is("bordered", f6.border), unref(i).is("checked", unref(l) === unref(d)), unref(i).m(unref(a6)) ]) }, [ createBaseVNode("span", { class: normalizeClass([ unref(i).e("input"), unref(i).is("disabled", unref(c)), unref(i).is("checked", unref(l) === unref(d)) ]) }, [ withDirectives(createBaseVNode("input", { ref_key: "radioRef", ref: r, "onUpdate:modelValue": (u6) => isRef(l) ? l.value = u6 : null, class: normalizeClass(unref(i).e("original")), value: unref(d), name: f6.name || ((p = unref(s)) == null ? void 0 : p.name), disabled: unref(c), checked: unref(l) === unref(d), type: "radio", onFocus: (u6) => o.value = true, onBlur: (u6) => o.value = false, onChange: h6, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "checked", "onFocus", "onBlur", "onClick"]), [ [vModelRadio, unref(l)] ]), createBaseVNode("span", { class: normalizeClass(unref(i).e("inner")) }, null, 2) ], 2), createBaseVNode("span", { class: normalizeClass(unref(i).e("label")), onKeydown: withModifiers(() => { }, ["stop"]) }, [ renderSlot(f6.$slots, "default", {}, () => [ createTextVNode(toDisplayString(f6.label), 1) ]) ], 42, ["onKeydown"]) ], 2); }; } }); var JC = st(YC, [["__file", "radio.vue"]]); var KC = at({ ...Y0 }); var qC = defineComponent({ name: "ElRadioButton" }); var QC = defineComponent({ ...qC, props: KC, setup(n) { const e = n, t = nt("radio"), { radioRef: i, focus: r, size: s, disabled: o, modelValue: a6, radioGroup: c, actualValue: l } = q0(e), d = computed(() => ({ backgroundColor: (c == null ? void 0 : c.fill) || "", borderColor: (c == null ? void 0 : c.fill) || "", boxShadow: c != null && c.fill ? `-1px 0 0 0 ${c.fill}` : "", color: (c == null ? void 0 : c.textColor) || "" })); return (h6, f6) => { var g6; return openBlock(), createElementBlock("label", { class: normalizeClass([ unref(t).b("button"), unref(t).is("active", unref(a6) === unref(l)), unref(t).is("disabled", unref(o)), unref(t).is("focus", unref(r)), unref(t).bm("button", unref(s)) ]) }, [ withDirectives(createBaseVNode("input", { ref_key: "radioRef", ref: i, "onUpdate:modelValue": (p) => isRef(a6) ? a6.value = p : null, class: normalizeClass(unref(t).be("button", "original-radio")), value: unref(l), type: "radio", name: h6.name || ((g6 = unref(c)) == null ? void 0 : g6.name), disabled: unref(o), onFocus: (p) => r.value = true, onBlur: (p) => r.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "onFocus", "onBlur", "onClick"]), [ [vModelRadio, unref(a6)] ]), createBaseVNode("span", { class: normalizeClass(unref(t).be("button", "inner")), style: normalizeStyle(unref(a6) === unref(l) ? unref(d) : {}), onKeydown: withModifiers(() => { }, ["stop"]) }, [ renderSlot(h6.$slots, "default", {}, () => [ createTextVNode(toDisplayString(h6.label), 1) ]) ], 46, ["onKeydown"]) ], 2); }; } }); var Q0 = st(QC, [["__file", "radio-button.vue"]]); var eL = at({ id: { type: String, default: void 0 }, size: Gr, disabled: Boolean, modelValue: { type: [String, Number, Boolean], default: void 0 }, fill: { type: String, default: "" }, textColor: { type: String, default: "" }, name: { type: String, default: void 0 }, validateEvent: { type: Boolean, default: true }, ...Yr(["ariaLabel"]) }); var tL = J0; var nL = defineComponent({ name: "ElRadioGroup" }); var iL = defineComponent({ ...nL, props: eL, emits: tL, setup(n, { emit: e }) { const t = n, i = nt("radio"), r = sl(), s = ref(), { formItem: o } = Jo(), { inputId: a6, isLabeledByFormItem: c } = su(t, { formItemContext: o }), l = (h6) => { e(At, h6), nextTick(() => e("change", h6)); }; onMounted(() => { const h6 = s.value.querySelectorAll("[type=radio]"), f6 = h6[0]; !Array.from(h6).some((g6) => g6.checked) && f6 && (f6.tabIndex = 0); }); const d = computed(() => t.name || r.value); return provide(K0, reactive({ ...toRefs(t), changeEvent: l, name: d })), watch(() => t.modelValue, () => { t.validateEvent && (o == null || o.validate("change").catch((h6) => kt(h6))); }), (h6, f6) => (openBlock(), createElementBlock("div", { id: unref(a6), ref_key: "radioGroupRef", ref: s, class: normalizeClass(unref(i).b("group")), role: "radiogroup", "aria-label": unref(c) ? void 0 : h6.ariaLabel || "radio-group", "aria-labelledby": unref(c) ? unref(o).labelId : void 0 }, [ renderSlot(h6.$slots, "default") ], 10, ["id", "aria-label", "aria-labelledby"])); } }); var ey = st(iL, [["__file", "radio-group.vue"]]); var ty = on2(JC, { RadioButton: Q0, RadioGroup: ey }); var ny = vi(ey); vi(Q0); var Qh = at({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: f0 }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }); var rL = { close: (n) => n instanceof MouseEvent, click: (n) => n instanceof MouseEvent }; var sL = defineComponent({ name: "ElTag" }); var oL = defineComponent({ ...sL, props: Qh, emits: rL, setup(n, { emit: e }) { const t = n, i = Ns(), r = nt("tag"), s = computed(() => { const { type: l, hit: d, effect: h6, closable: f6, round: g6 } = t; return [ r.b(), r.is("closable", f6), r.m(l || "primary"), r.m(i.value), r.m(h6), r.is("hit", d), r.is("round", g6) ]; }), o = (l) => { e("close", l); }, a6 = (l) => { e("click", l); }, c = (l) => { l.component.subTree.component.bum = null; }; return (l, d) => l.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(s)), style: normalizeStyle({ backgroundColor: l.color }), onClick: a6 }, [ createBaseVNode("span", { class: normalizeClass(unref(r).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(It), { key: 0, class: normalizeClass(unref(r).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(Zh)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(r).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: c }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(unref(s)), style: normalizeStyle({ backgroundColor: l.color }), onClick: a6 }, [ createBaseVNode("span", { class: normalizeClass(unref(r).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(It), { key: 0, class: normalizeClass(unref(r).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(Zh)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6) ]), _: 3 }, 8, ["name"])); } }); var aL = st(oL, [["__file", "tag.vue"]]); var lL = on2(aL); var iy = Symbol("rowContextKey"); var cL = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ]; var uL = ["top", "middle", "bottom"]; var hL = at({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: cL, default: "start" }, align: { type: String, values: uL } }); var dL = defineComponent({ name: "ElRow" }); var fL = defineComponent({ ...dL, props: hL, setup(n) { const e = n, t = nt("row"), i = computed(() => e.gutter); provide(iy, { gutter: i }); const r = computed(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), s = computed(() => [ t.b(), t.is(`justify-${e.justify}`, e.justify !== "start"), t.is(`align-${e.align}`, !!e.align) ]); return (o, a6) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(s)), style: normalizeStyle(unref(r)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var pL = st(fL, [["__file", "row.vue"]]); var Ui = on2(pL); var mL = at({ tag: { type: String, default: "div" }, span: { type: Number, default: 24 }, offset: { type: Number, default: 0 }, pull: { type: Number, default: 0 }, push: { type: Number, default: 0 }, xs: { type: Je([Number, Object]), default: () => qi({}) }, sm: { type: Je([Number, Object]), default: () => qi({}) }, md: { type: Je([Number, Object]), default: () => qi({}) }, lg: { type: Je([Number, Object]), default: () => qi({}) }, xl: { type: Je([Number, Object]), default: () => qi({}) } }); var gL = defineComponent({ name: "ElCol" }); var vL = defineComponent({ ...gL, props: mL, setup(n) { const e = n, { gutter: t } = inject(iy, { gutter: computed(() => 0) }), i = nt("col"), r = computed(() => { const o = {}; return t.value && (o.paddingLeft = o.paddingRight = `${t.value / 2}px`), o; }), s = computed(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((l) => { const d = e[l]; yt(d) && (l === "span" ? o.push(i.b(`${e[l]}`)) : d > 0 && o.push(i.b(`${l}-${e[l]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((l) => { yt(e[l]) ? o.push(i.b(`${l}-${e[l]}`)) : Tn(e[l]) && Object.entries(e[l]).forEach(([d, h6]) => { o.push(d !== "span" ? i.b(`${l}-${d}-${h6}`) : i.b(`${l}-${h6}`)); }); }), t.value && o.push(i.is("guttered")), [i.b(), o]; }); return (o, a6) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(s)), style: normalizeStyle(unref(r)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var yL = st(vL, [["__file", "col.vue"]]); var bi = on2(yL); var Bm = (n) => yt(n) || vn(n) || Pn(n); var bL = at({ accordion: Boolean, modelValue: { type: Je([Array, String, Number]), default: () => qi([]) } }); var xL = { [At]: Bm, [hr]: Bm }; var ry = Symbol("collapseContextKey"); var ML = (n, e) => { const t = ref(Si(n.modelValue)), i = (s) => { t.value = s; const o = n.accordion ? t.value[0] : t.value; e(At, o), e(hr, o); }, r = (s) => { if (n.accordion) i([t.value[0] === s ? "" : s]); else { const o = [...t.value], a6 = o.indexOf(s); a6 > -1 ? o.splice(a6, 1) : o.push(s), i(o); } }; return watch(() => n.modelValue, () => t.value = Si(n.modelValue), { deep: true }), provide(ry, { activeNames: t, handleItemClick: r }), { activeNames: t, setActiveNames: i }; }; var wL = () => { const n = nt("collapse"); return { rootKls: computed(() => n.b()) }; }; var AL = defineComponent({ name: "ElCollapse" }); var SL = defineComponent({ ...AL, props: bL, emits: xL, setup(n, { expose: e, emit: t }) { const i = n, { activeNames: r, setActiveNames: s } = ML(i, t), { rootKls: o } = wL(); return e({ activeNames: r, setActiveNames: s }), (a6, c) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(o)) }, [ renderSlot(a6.$slots, "default") ], 2)); } }); var _L = st(SL, [["__file", "collapse.vue"]]); var TL = defineComponent({ name: "ElCollapseTransition" }); var EL = defineComponent({ ...TL, setup(n) { const e = nt("collapse-transition"), t = (r) => { r.style.maxHeight = "", r.style.overflow = r.dataset.oldOverflow, r.style.paddingTop = r.dataset.oldPaddingTop, r.style.paddingBottom = r.dataset.oldPaddingBottom; }, i = { beforeEnter(r) { r.dataset || (r.dataset = {}), r.dataset.oldPaddingTop = r.style.paddingTop, r.dataset.oldPaddingBottom = r.style.paddingBottom, r.style.height && (r.dataset.elExistsHeight = r.style.height), r.style.maxHeight = 0, r.style.paddingTop = 0, r.style.paddingBottom = 0; }, enter(r) { requestAnimationFrame(() => { r.dataset.oldOverflow = r.style.overflow, r.dataset.elExistsHeight ? r.style.maxHeight = r.dataset.elExistsHeight : r.scrollHeight !== 0 ? r.style.maxHeight = `${r.scrollHeight}px` : r.style.maxHeight = 0, r.style.paddingTop = r.dataset.oldPaddingTop, r.style.paddingBottom = r.dataset.oldPaddingBottom, r.style.overflow = "hidden"; }); }, afterEnter(r) { r.style.maxHeight = "", r.style.overflow = r.dataset.oldOverflow; }, enterCancelled(r) { t(r); }, beforeLeave(r) { r.dataset || (r.dataset = {}), r.dataset.oldPaddingTop = r.style.paddingTop, r.dataset.oldPaddingBottom = r.style.paddingBottom, r.dataset.oldOverflow = r.style.overflow, r.style.maxHeight = `${r.scrollHeight}px`, r.style.overflow = "hidden"; }, leave(r) { r.scrollHeight !== 0 && (r.style.maxHeight = 0, r.style.paddingTop = 0, r.style.paddingBottom = 0); }, afterLeave(r) { t(r); }, leaveCancelled(r) { t(r); } }; return (r, s) => (openBlock(), createBlock(Transition, mergeProps({ name: unref(e).b() }, toHandlers(i)), { default: withCtx(() => [ renderSlot(r.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var CL = st(EL, [["__file", "collapse-transition.vue"]]); var LL = on2(CL); var RL = at({ title: { type: String, default: "" }, name: { type: Je([String, Number]), default: void 0 }, icon: { type: Vr, default: kr }, disabled: Boolean }); var FL = (n) => { const e = inject(ry), { namespace: t } = nt("collapse"), i = ref(false), r = ref(false), s = of(), o = computed(() => s.current++), a6 = computed(() => { var f6; return (f6 = n.name) != null ? f6 : `${t.value}-id-${s.prefix}-${unref(o)}`; }), c = computed(() => e == null ? void 0 : e.activeNames.value.includes(unref(a6))); return { focusing: i, id: o, isActive: c, handleFocus: () => { setTimeout(() => { r.value ? r.value = false : i.value = true; }, 50); }, handleHeaderClick: () => { n.disabled || (e == null || e.handleItemClick(unref(a6)), i.value = false, r.value = true); }, handleEnterClick: () => { e == null || e.handleItemClick(unref(a6)); } }; }; var PL = (n, { focusing: e, isActive: t, id: i }) => { const r = nt("collapse"), s = computed(() => [ r.b("item"), r.is("active", unref(t)), r.is("disabled", n.disabled) ]), o = computed(() => [ r.be("item", "header"), r.is("active", unref(t)), { focusing: unref(e) && !n.disabled } ]), a6 = computed(() => [ r.be("item", "arrow"), r.is("active", unref(t)) ]), c = computed(() => r.be("item", "wrap")), l = computed(() => r.be("item", "content")), d = computed(() => r.b(`content-${unref(i)}`)), h6 = computed(() => r.b(`head-${unref(i)}`)); return { arrowKls: a6, headKls: o, rootKls: s, itemWrapperKls: c, itemContentKls: l, scopedContentId: d, scopedHeadId: h6 }; }; var IL = defineComponent({ name: "ElCollapseItem" }); var OL = defineComponent({ ...IL, props: RL, setup(n, { expose: e }) { const t = n, { focusing: i, id: r, isActive: s, handleFocus: o, handleHeaderClick: a6, handleEnterClick: c } = FL(t), { arrowKls: l, headKls: d, rootKls: h6, itemWrapperKls: f6, itemContentKls: g6, scopedContentId: p, scopedHeadId: u6 } = PL(t, { focusing: i, isActive: s, id: r }); return e({ isActive: s }), (y6, v6) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(h6)) }, [ createBaseVNode("button", { id: unref(u6), class: normalizeClass(unref(d)), "aria-expanded": unref(s), "aria-controls": unref(p), "aria-describedby": unref(p), tabindex: y6.disabled ? -1 : 0, type: "button", onClick: unref(a6), onKeydown: withKeys(withModifiers(unref(c), ["stop", "prevent"]), ["space", "enter"]), onFocus: unref(o), onBlur: (m6) => i.value = false }, [ renderSlot(y6.$slots, "title", {}, () => [ createTextVNode(toDisplayString(y6.title), 1) ]), renderSlot(y6.$slots, "icon", { isActive: unref(s) }, () => [ createVNode(unref(It), { class: normalizeClass(unref(l)) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(y6.icon))) ]), _: 1 }, 8, ["class"]) ]) ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]), createVNode(unref(LL), null, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { id: unref(p), role: "region", class: normalizeClass(unref(f6)), "aria-hidden": !unref(s), "aria-labelledby": unref(u6) }, [ createBaseVNode("div", { class: normalizeClass(unref(g6)) }, [ renderSlot(y6.$slots, "default") ], 2) ], 10, ["id", "aria-hidden", "aria-labelledby"]), [ [vShow, unref(s)] ]) ]), _: 3 }) ], 2)); } }); var sy = st(OL, [["__file", "collapse-item.vue"]]); var oy = on2(_L, { CollapseItem: sy }); var ay = vi(sy); var DL = defineComponent({ name: "ElContainer" }); var NL = defineComponent({ ...DL, props: { direction: { type: String } }, setup(n) { const e = n, t = useSlots(), i = nt("container"), r = computed(() => e.direction === "vertical" ? true : e.direction === "horizontal" ? false : t && t.default ? t.default().some((o) => { const a6 = o.type.name; return a6 === "ElHeader" || a6 === "ElFooter"; }) : false); return (s, o) => (openBlock(), createElementBlock("section", { class: normalizeClass([unref(i).b(), unref(i).is("vertical", unref(r))]) }, [ renderSlot(s.$slots, "default") ], 2)); } }); var BL = st(NL, [["__file", "container.vue"]]); var UL = defineComponent({ name: "ElAside" }); var zL = defineComponent({ ...UL, props: { width: { type: String, default: null } }, setup(n) { const e = n, t = nt("aside"), i = computed(() => e.width ? t.cssVarBlock({ width: e.width }) : {}); return (r, s) => (openBlock(), createElementBlock("aside", { class: normalizeClass(unref(t).b()), style: normalizeStyle(unref(i)) }, [ renderSlot(r.$slots, "default") ], 6)); } }); var ly = st(zL, [["__file", "aside.vue"]]); var kL = defineComponent({ name: "ElFooter" }); var VL = defineComponent({ ...kL, props: { height: { type: String, default: null } }, setup(n) { const e = n, t = nt("footer"), i = computed(() => e.height ? t.cssVarBlock({ height: e.height }) : {}); return (r, s) => (openBlock(), createElementBlock("footer", { class: normalizeClass(unref(t).b()), style: normalizeStyle(unref(i)) }, [ renderSlot(r.$slots, "default") ], 6)); } }); var cy = st(VL, [["__file", "footer.vue"]]); var GL = defineComponent({ name: "ElHeader" }); var HL = defineComponent({ ...GL, props: { height: { type: String, default: null } }, setup(n) { const e = n, t = nt("header"), i = computed(() => e.height ? t.cssVarBlock({ height: e.height }) : {}); return (r, s) => (openBlock(), createElementBlock("header", { class: normalizeClass(unref(t).b()), style: normalizeStyle(unref(i)) }, [ renderSlot(r.$slots, "default") ], 6)); } }); var uy = st(HL, [["__file", "header.vue"]]); var WL = defineComponent({ name: "ElMain" }); var jL = defineComponent({ ...WL, setup(n) { const e = nt("main"); return (t, i) => (openBlock(), createElementBlock("main", { class: normalizeClass(unref(e).b()) }, [ renderSlot(t.$slots, "default") ], 2)); } }); var hy = st(jL, [["__file", "main.vue"]]); var zi = on2(BL, { Aside: ly, Footer: cy, Header: uy, Main: hy }); vi(ly); var dy = vi(cy); var $L = vi(uy); var dr = vi(hy); var ZL = defineComponent({ inheritAttrs: false }); function XL(n, e, t, i, r, s) { return renderSlot(n.$slots, "default"); } var YL = st(ZL, [["render", XL], ["__file", "collection.vue"]]); var JL = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function KL(n, e, t, i, r, s) { return renderSlot(n.$slots, "default"); } var qL = st(JL, [["render", KL], ["__file", "collection-item.vue"]]); var QL = "data-el-collection-item"; var eR = (n) => { const e = `El${n}Collection`, t = `${e}Item`, i = Symbol(e), r = Symbol(t), s = { ...YL, name: e, setup() { const a6 = ref(null), c = /* @__PURE__ */ new Map(); provide(i, { itemMap: c, getItems: () => { const d = unref(a6); if (!d) return []; const h6 = Array.from(d.querySelectorAll(`[${QL}]`)); return [...c.values()].sort((g6, p) => h6.indexOf(g6.ref) - h6.indexOf(p.ref)); }, collectionRef: a6 }); } }, o = { ...qL, name: t, setup(a6, { attrs: c }) { const l = ref(null), d = inject(i, void 0); provide(r, { collectionItemRef: l }), onMounted(() => { const h6 = unref(l); h6 && d.itemMap.set(h6, { ref: h6, ...c }); }), onBeforeUnmount(() => { const h6 = unref(l); d.itemMap.delete(h6); }); } }; return { COLLECTION_INJECTION_KEY: i, COLLECTION_ITEM_INJECTION_KEY: r, ElCollection: s, ElCollectionItem: o }; }; var Hu = at({ trigger: ka.trigger, effect: { ...kn.effect, default: "light" }, type: { type: Je(String) }, placement: { type: Je(String), default: "bottom" }, popperOptions: { type: Je(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: Je([Number, String]), default: 0 }, maxHeight: { type: Je([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: Je(Object) }, teleported: kn.teleported }); at({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Vr } }); at({ onKeydown: { type: Je(Function) } }); eR("Dropdown"); var tR = at({ id: { type: String, default: void 0 }, step: { type: Number, default: 1 }, stepStrictly: Boolean, max: { type: Number, default: Number.POSITIVE_INFINITY }, min: { type: Number, default: Number.NEGATIVE_INFINITY }, modelValue: Number, readonly: Boolean, disabled: Boolean, size: Gr, controls: { type: Boolean, default: true }, controlsPosition: { type: String, default: "", values: ["", "right"] }, valueOnClear: { type: [String, Number, null], validator: (n) => n === null || yt(n) || ["min", "max"].includes(n), default: null }, name: String, placeholder: String, precision: { type: Number, validator: (n) => n >= 0 && n === Number.parseInt(`${n}`, 10) }, validateEvent: { type: Boolean, default: true }, ...Yr(["ariaLabel"]) }); var nR = { [hr]: (n, e) => e !== n, blur: (n) => n instanceof FocusEvent, focus: (n) => n instanceof FocusEvent, [bs]: (n) => yt(n) || Ci(n), [At]: (n) => yt(n) || Ci(n) }; var iR = defineComponent({ name: "ElInputNumber" }); var rR = defineComponent({ ...iR, props: tR, emits: nR, setup(n, { expose: e, emit: t }) { const i = n, { t: r } = iu(), s = nt("input-number"), o = ref(), a6 = reactive({ currentValue: i.modelValue, userInput: null }), { formItem: c } = Jo(), l = computed(() => yt(i.modelValue) && i.modelValue <= i.min), d = computed(() => yt(i.modelValue) && i.modelValue >= i.max), h6 = computed(() => { const I6 = v6(i.step); return di(i.precision) ? Math.max(v6(i.modelValue), I6) : (I6 > i.precision && kt("InputNumber", "precision should not be less than the decimal places of step"), i.precision); }), f6 = computed(() => i.controls && i.controlsPosition === "right"), g6 = Ns(), p = ol(), u6 = computed(() => { if (a6.userInput !== null) return a6.userInput; let I6 = a6.currentValue; if (Ci(I6)) return ""; if (yt(I6)) { if (Number.isNaN(I6)) return ""; di(i.precision) || (I6 = I6.toFixed(i.precision)); } return I6; }), y6 = (I6, b6) => { if (di(b6) && (b6 = h6.value), b6 === 0) return Math.round(I6); let F6 = String(I6); const D6 = F6.indexOf("."); if (D6 === -1 || !F6.replace(".", "").split("")[D6 + b6]) return I6; const U6 = F6.length; return F6.charAt(U6 - 1) === "5" && (F6 = `${F6.slice(0, Math.max(0, U6 - 1))}6`), Number.parseFloat(Number(F6).toFixed(b6)); }, v6 = (I6) => { if (Ci(I6)) return 0; const b6 = I6.toString(), F6 = b6.indexOf("."); let D6 = 0; return F6 !== -1 && (D6 = b6.length - F6 - 1), D6; }, m6 = (I6, b6 = 1) => yt(I6) ? y6(I6 + i.step * b6) : a6.currentValue, x6 = () => { if (i.readonly || p.value || d.value) return; const I6 = Number(u6.value) || 0, b6 = m6(I6); M6(b6), t(bs, a6.currentValue), E6(); }, w6 = () => { if (i.readonly || p.value || l.value) return; const I6 = Number(u6.value) || 0, b6 = m6(I6, -1); M6(b6), t(bs, a6.currentValue), E6(); }, A6 = (I6, b6) => { const { max: F6, min: D6, step: N6, precision: B6, stepStrictly: U6, valueOnClear: G6 } = i; F6 < D6 && Xo("InputNumber", "min should not be greater than max."); let Y = Number(I6); if (Ci(I6) || Number.isNaN(Y)) return null; if (I6 === "") { if (G6 === null) return null; Y = vn(G6) ? { min: D6, max: F6 }[G6] : G6; } return U6 && (Y = y6(Math.round(Y / N6) * N6, B6), Y !== I6 && b6 && t(At, Y)), di(B6) || (Y = y6(Y, B6)), (Y > F6 || Y < D6) && (Y = Y > F6 ? F6 : D6, b6 && t(At, Y)), Y; }, M6 = (I6, b6 = true) => { var F6; const D6 = a6.currentValue, N6 = A6(I6); if (!b6) { t(At, N6); return; } D6 === N6 && I6 || (a6.userInput = null, t(At, N6), D6 !== N6 && t(hr, N6, D6), i.validateEvent && ((F6 = c == null ? void 0 : c.validate) == null || F6.call(c, "change").catch((B6) => kt(B6))), a6.currentValue = N6); }, R6 = (I6) => { a6.userInput = I6; const b6 = I6 === "" ? null : Number(I6); t(bs, b6), M6(b6, false); }, L6 = (I6) => { const b6 = I6 !== "" ? Number(I6) : ""; (yt(b6) && !Number.isNaN(b6) || I6 === "") && M6(b6), E6(), a6.userInput = null; }, T6 = () => { var I6, b6; (b6 = (I6 = o.value) == null ? void 0 : I6.focus) == null || b6.call(I6); }, P6 = () => { var I6, b6; (b6 = (I6 = o.value) == null ? void 0 : I6.blur) == null || b6.call(I6); }, _6 = (I6) => { t("focus", I6); }, S6 = (I6) => { var b6; a6.userInput = null, t("blur", I6), i.validateEvent && ((b6 = c == null ? void 0 : c.validate) == null || b6.call(c, "blur").catch((F6) => kt(F6))); }, E6 = () => { a6.currentValue !== i.modelValue && (a6.currentValue = i.modelValue); }, C6 = (I6) => { document.activeElement === I6.target && I6.preventDefault(); }; return watch(() => i.modelValue, (I6, b6) => { const F6 = A6(I6, true); a6.userInput === null && F6 !== b6 && (a6.currentValue = F6); }, { immediate: true }), onMounted(() => { var I6; const { min: b6, max: F6, modelValue: D6 } = i, N6 = (I6 = o.value) == null ? void 0 : I6.input; if (N6.setAttribute("role", "spinbutton"), Number.isFinite(F6) ? N6.setAttribute("aria-valuemax", String(F6)) : N6.removeAttribute("aria-valuemax"), Number.isFinite(b6) ? N6.setAttribute("aria-valuemin", String(b6)) : N6.removeAttribute("aria-valuemin"), N6.setAttribute("aria-valuenow", a6.currentValue || a6.currentValue === 0 ? String(a6.currentValue) : ""), N6.setAttribute("aria-disabled", String(p.value)), !yt(D6) && D6 != null) { let B6 = Number(D6); Number.isNaN(B6) && (B6 = null), t(At, B6); } N6.addEventListener("wheel", C6, { passive: false }); }), onUpdated(() => { var I6, b6; const F6 = (I6 = o.value) == null ? void 0 : I6.input; F6 == null || F6.setAttribute("aria-valuenow", `${(b6 = a6.currentValue) != null ? b6 : ""}`); }), e({ focus: T6, blur: P6 }), (I6, b6) => (openBlock(), createElementBlock("div", { class: normalizeClass([ unref(s).b(), unref(s).m(unref(g6)), unref(s).is("disabled", unref(p)), unref(s).is("without-controls", !I6.controls), unref(s).is("controls-right", unref(f6)) ]), onDragstart: withModifiers(() => { }, ["prevent"]) }, [ I6.controls ? withDirectives((openBlock(), createElementBlock("span", { key: 0, role: "button", "aria-label": unref(r)("el.inputNumber.decrease"), class: normalizeClass([unref(s).e("decrease"), unref(s).is("disabled", unref(l))]), onKeydown: withKeys(w6, ["enter"]) }, [ renderSlot(I6.$slots, "decrease-icon", {}, () => [ createVNode(unref(It), null, { default: withCtx(() => [ unref(f6) ? (openBlock(), createBlock(unref(Xd), { key: 0 })) : (openBlock(), createBlock(unref(q_), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [unref(Nm), w6] ]) : createCommentVNode("v-if", true), I6.controls ? withDirectives((openBlock(), createElementBlock("span", { key: 1, role: "button", "aria-label": unref(r)("el.inputNumber.increase"), class: normalizeClass([unref(s).e("increase"), unref(s).is("disabled", unref(d))]), onKeydown: withKeys(x6, ["enter"]) }, [ renderSlot(I6.$slots, "increase-icon", {}, () => [ createVNode(unref(It), null, { default: withCtx(() => [ unref(f6) ? (openBlock(), createBlock(unref(G_), { key: 0 })) : (openBlock(), createBlock(unref(tu), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [unref(Nm), x6] ]) : createCommentVNode("v-if", true), createVNode(unref(e2), { id: I6.id, ref_key: "input", ref: o, type: "number", step: I6.step, "model-value": unref(u6), placeholder: I6.placeholder, readonly: I6.readonly, disabled: unref(p), size: unref(g6), max: I6.max, min: I6.min, name: I6.name, "aria-label": I6.ariaLabel, "validate-event": false, onKeydown: [ withKeys(withModifiers(x6, ["prevent"]), ["up"]), withKeys(withModifiers(w6, ["prevent"]), ["down"]) ], onBlur: S6, onFocus: _6, onInput: R6, onChange: L6 }, createSlots({ _: 2 }, [ I6.$slots.prefix ? { name: "prefix", fn: withCtx(() => [ renderSlot(I6.$slots, "prefix") ]) } : void 0, I6.$slots.suffix ? { name: "suffix", fn: withCtx(() => [ renderSlot(I6.$slots, "suffix") ]) } : void 0 ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"]) ], 42, ["onDragstart"])); } }); var sR = st(rR, [["__file", "input-number.vue"]]); var fr = on2(sR); var fy = Symbol("ElSelectGroup"); var lu = Symbol("ElSelect"); function oR(n, e) { const t = inject(lu), i = inject(fy, { disabled: false }), r = computed(() => d(Si(t.props.modelValue), n.value)), s = computed(() => { var g6; if (t.props.multiple) { const p = Si((g6 = t.props.modelValue) != null ? g6 : []); return !r.value && p.length >= t.props.multipleLimit && t.props.multipleLimit > 0; } else return false; }), o = computed(() => n.label || (Tn(n.value) ? "" : n.value)), a6 = computed(() => n.value || n.label || ""), c = computed(() => n.disabled || e.groupDisabled || s.value), l = getCurrentInstance(), d = (g6 = [], p) => { if (Tn(n.value)) { const u6 = t.props.valueKey; return g6 && g6.some((y6) => toRaw(Ki(y6, u6)) === Ki(p, u6)); } else return g6 && g6.includes(p); }, h6 = () => { !n.disabled && !i.disabled && (t.states.hoveringIndex = t.optionsArray.indexOf(l.proxy)); }, f6 = (g6) => { const p = new RegExp(D_(g6), "i"); e.visible = p.test(o.value) || n.created; }; return watch(() => o.value, () => { !n.created && !t.props.remote && t.setSelected(); }), watch(() => n.value, (g6, p) => { const { remote: u6, valueKey: y6 } = t.props; if (g6 !== p && (t.onOptionDestroy(p, l.proxy), t.onOptionCreate(l.proxy)), !n.created && !u6) { if (y6 && Tn(g6) && Tn(p) && g6[y6] === p[y6]) return; t.setSelected(); } }), watch(() => i.disabled, () => { e.groupDisabled = i.disabled; }, { immediate: true }), { select: t, currentLabel: o, currentValue: a6, itemSelected: r, isDisabled: c, hoverItem: h6, updateOption: f6 }; } var aR = defineComponent({ name: "ElOption", componentName: "ElOption", props: { value: { required: true, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(n) { const e = nt("select"), t = sl(), i = computed(() => [ e.be("dropdown", "item"), e.is("disabled", unref(a6)), e.is("selected", unref(o)), e.is("hovering", unref(f6)) ]), r = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }), { currentLabel: s, itemSelected: o, isDisabled: a6, select: c, hoverItem: l, updateOption: d } = oR(n, r), { visible: h6, hover: f6 } = toRefs(r), g6 = getCurrentInstance().proxy; c.onOptionCreate(g6), onBeforeUnmount(() => { const u6 = g6.value, { selected: y6 } = c.states, m6 = (c.props.multiple ? y6 : [y6]).some((x6) => x6.value === g6.value); nextTick(() => { c.states.cachedOptions.get(u6) === g6 && !m6 && c.states.cachedOptions.delete(u6); }), c.onOptionDestroy(u6, g6); }); function p() { a6.value || c.handleOptionSelect(g6); } return { ns: e, id: t, containerKls: i, currentLabel: s, itemSelected: o, isDisabled: a6, select: c, hoverItem: l, updateOption: d, visible: h6, hover: f6, selectOptionClick: p, states: r }; } }); function lR(n, e, t, i, r, s) { return withDirectives((openBlock(), createElementBlock("li", { id: n.id, class: normalizeClass(n.containerKls), role: "option", "aria-disabled": n.isDisabled || void 0, "aria-selected": n.itemSelected, onMouseenter: n.hoverItem, onClick: withModifiers(n.selectOptionClick, ["stop"]) }, [ renderSlot(n.$slots, "default", {}, () => [ createBaseVNode("span", null, toDisplayString(n.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [vShow, n.visible] ]); } var mf = st(aR, [["render", lR], ["__file", "option.vue"]]); var cR = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const n = inject(lu), e = nt("select"), t = computed(() => n.props.popperClass), i = computed(() => n.props.multiple), r = computed(() => n.props.fitInputWidth), s = ref(""); function o() { var a6; s.value = `${(a6 = n.selectRef) == null ? void 0 : a6.offsetWidth}px`; } return onMounted(() => { o(), Jn(n.selectRef, o); }), { ns: e, minWidth: s, popperClass: t, isMultiple: i, isFitInputWidth: r }; } }); function uR(n, e, t, i, r, s) { return openBlock(), createElementBlock("div", { class: normalizeClass([n.ns.b("dropdown"), n.ns.is("multiple", n.isMultiple), n.popperClass]), style: normalizeStyle({ [n.isFitInputWidth ? "width" : "minWidth"]: n.minWidth }) }, [ n.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(n.ns.be("dropdown", "header")) }, [ renderSlot(n.$slots, "header") ], 2)) : createCommentVNode("v-if", true), renderSlot(n.$slots, "default"), n.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(n.ns.be("dropdown", "footer")) }, [ renderSlot(n.$slots, "footer") ], 2)) : createCommentVNode("v-if", true) ], 6); } var hR = st(cR, [["render", uR], ["__file", "select-dropdown.vue"]]); var dR = 11; var fR = (n, e) => { const { t } = iu(), i = sl(), r = nt("select"), s = nt("input"), o = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }), a6 = ref(null), c = ref(null), l = ref(null), d = ref(null), h6 = ref(null), f6 = ref(null), g6 = ref(null), p = ref(null), u6 = ref(null), y6 = ref(null), v6 = ref(null), m6 = ref(null), { isComposing: x6, handleCompositionStart: w6, handleCompositionUpdate: A6, handleCompositionEnd: M6 } = N0({ afterComposition: (ge) => ne(ge) }), { wrapperRef: R6, isFocused: L6 } = D0(h6, { beforeFocus() { return b6.value; }, afterFocus() { n.automaticDropdown && !T6.value && (T6.value = true, o.menuVisibleOnFocus = true); }, beforeBlur(ge) { var Se, Fe; return ((Se = l.value) == null ? void 0 : Se.isFocusInsideContent(ge)) || ((Fe = d.value) == null ? void 0 : Fe.isFocusInsideContent(ge)); }, afterBlur() { T6.value = false, o.menuVisibleOnFocus = false; } }), T6 = ref(false), P6 = ref(), { form: _6, formItem: S6 } = Jo(), { inputId: E6 } = su(n, { formItemContext: S6 }), { valueOnClear: C6, isEmptyValue: I6 } = BE(n), b6 = computed(() => n.disabled || (_6 == null ? void 0 : _6.disabled)), F6 = computed(() => Pn(n.modelValue) ? n.modelValue.length > 0 : !I6(n.modelValue)), D6 = computed(() => n.clearable && !b6.value && o.inputHovering && F6.value), N6 = computed(() => n.remote && n.filterable && !n.remoteShowSuffix ? "" : n.suffixIcon), B6 = computed(() => r.is("reverse", N6.value && T6.value)), U6 = computed(() => (S6 == null ? void 0 : S6.validateState) || ""), G6 = computed(() => d0[U6.value]), Y = computed(() => n.remote ? 300 : 0), te = computed(() => n.loading ? n.loadingText || t("el.select.loading") : n.remote && !o.inputValue && o.options.size === 0 ? false : n.filterable && o.inputValue && o.options.size > 0 && ae.value === 0 ? n.noMatchText || t("el.select.noMatch") : o.options.size === 0 ? n.noDataText || t("el.select.noData") : null), ae = computed(() => ie.value.filter((ge) => ge.visible).length), ie = computed(() => { const ge = Array.from(o.options.values()), Se = []; return o.optionValues.forEach((Fe) => { const Ge = ge.findIndex((je) => je.value === Fe); Ge > -1 && Se.push(ge[Ge]); }), Se.length >= ge.length ? Se : ge; }), le = computed(() => Array.from(o.cachedOptions.values())), W6 = computed(() => { const ge = ie.value.filter((Se) => !Se.created).some((Se) => Se.currentLabel === o.inputValue); return n.filterable && n.allowCreate && o.inputValue !== "" && !ge; }), $6 = () => { n.filterable && Sn(n.filterMethod) || n.filterable && n.remote && Sn(n.remoteMethod) || ie.value.forEach((ge) => { var Se; (Se = ge.updateOption) == null || Se.call(ge, o.inputValue); }); }, j6 = Ns(), re = computed(() => ["small"].includes(j6.value) ? "small" : "default"), k6 = computed({ get() { return T6.value && te.value !== false; }, set(ge) { T6.value = ge; } }), H6 = computed(() => { if (n.multiple && !di(n.modelValue)) return Si(n.modelValue).length === 0 && !o.inputValue; const ge = Pn(n.modelValue) ? n.modelValue[0] : n.modelValue; return n.filterable || di(ge) ? !o.inputValue : true; }), K = computed(() => { var ge; const Se = (ge = n.placeholder) != null ? ge : t("el.select.placeholder"); return n.multiple || !F6.value ? Se : o.selectedLabel; }), ce = computed(() => zh ? null : "mouseenter"); watch(() => n.modelValue, (ge, Se) => { n.multiple && n.filterable && !n.reserveKeyword && (o.inputValue = "", se("")), O6(), !$h(ge, Se) && n.validateEvent && (S6 == null || S6.validate("change").catch((Fe) => kt(Fe))); }, { flush: "post", deep: true }), watch(() => T6.value, (ge) => { ge ? se(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), e("visible-change", ge); }), watch(() => o.options.entries(), () => { var ge; if (!en2) return; const Se = ((ge = a6.value) == null ? void 0 : ge.querySelectorAll("input")) || []; (!n.filterable && !n.defaultFirstOption && !di(n.modelValue) || !Array.from(Se).includes(document.activeElement)) && O6(), n.defaultFirstOption && (n.filterable || n.remote) && ae.value && V6(); }, { flush: "post" }), watch(() => o.hoveringIndex, (ge) => { yt(ge) && ge > -1 ? P6.value = ie.value[ge] || {} : P6.value = {}, ie.value.forEach((Se) => { Se.hover = P6.value === Se; }); }), watchEffect(() => { o.isBeforeHide || $6(); }); const se = (ge) => { o.previousQuery === ge || x6.value || (o.previousQuery = ge, n.filterable && Sn(n.filterMethod) ? n.filterMethod(ge) : n.filterable && n.remote && Sn(n.remoteMethod) && n.remoteMethod(ge), n.defaultFirstOption && (n.filterable || n.remote) && ae.value ? nextTick(V6) : nextTick(X)); }, V6 = () => { const ge = ie.value.filter((Ge) => Ge.visible && !Ge.disabled && !Ge.states.groupDisabled), Se = ge.find((Ge) => Ge.created), Fe = ge[0]; o.hoveringIndex = Mt(ie.value, Se || Fe); }, O6 = () => { if (n.multiple) o.selectedLabel = ""; else { const Se = Pn(n.modelValue) ? n.modelValue[0] : n.modelValue, Fe = Z6(Se); o.selectedLabel = Fe.currentLabel, o.selected = [Fe]; return; } const ge = []; di(n.modelValue) || Si(n.modelValue).forEach((Se) => { ge.push(Z6(Se)); }), o.selected = ge; }, Z6 = (ge) => { let Se; const Fe = Pu(ge).toLowerCase() === "object", Ge = Pu(ge).toLowerCase() === "null", je = Pu(ge).toLowerCase() === "undefined"; for (let ft = o.cachedOptions.size - 1; ft >= 0; ft--) { const Vt = le.value[ft]; if (Fe ? Ki(Vt.value, n.valueKey) === Ki(ge, n.valueKey) : Vt.value === ge) { Se = { value: ge, currentLabel: Vt.currentLabel, get isDisabled() { return Vt.isDisabled; } }; break; } } if (Se) return Se; const et = Fe ? ge.label : !Ge && !je ? ge : ""; return { value: ge, currentLabel: et }; }, X = () => { o.hoveringIndex = ie.value.findIndex((ge) => o.selected.some((Se) => _e(Se) === _e(ge))); }, ee = () => { o.selectionWidth = c.value.getBoundingClientRect().width; }, fe = () => { o.calculatorWidth = f6.value.getBoundingClientRect().width; }, be = () => { o.collapseItemWidth = v6.value.getBoundingClientRect().width; }, Ae = () => { var ge, Se; (Se = (ge = l.value) == null ? void 0 : ge.updatePopper) == null || Se.call(ge); }, he = () => { var ge, Se; (Se = (ge = d.value) == null ? void 0 : ge.updatePopper) == null || Se.call(ge); }, xe = () => { o.inputValue.length > 0 && !T6.value && (T6.value = true), se(o.inputValue); }, ne = (ge) => { if (o.inputValue = ge.target.value, n.remote) me(); else return xe(); }, me = jh(() => { xe(); }, Y.value), Me = (ge) => { $h(n.modelValue, ge) || e(hr, ge); }, De = (ge) => C_(ge, (Se) => !o.disabledOptions.has(Se)), Ie = (ge) => { if (n.multiple && ge.code !== Li.delete && ge.target.value.length <= 0) { const Se = Si(n.modelValue).slice(), Fe = De(Se); if (Fe < 0) return; const Ge = Se[Fe]; Se.splice(Fe, 1), e(At, Se), Me(Se), e("remove-tag", Ge); } }, $e = (ge, Se) => { const Fe = o.selected.indexOf(Se); if (Fe > -1 && !b6.value) { const Ge = Si(n.modelValue).slice(); Ge.splice(Fe, 1), e(At, Ge), Me(Ge), e("remove-tag", Se.value); } ge.stopPropagation(), Pt(); }, lt = (ge) => { ge.stopPropagation(); const Se = n.multiple ? [] : C6.value; if (n.multiple) for (const Fe of o.selected) Fe.isDisabled && Se.push(Fe.value); e(At, Se), Me(Se), o.hoveringIndex = -1, T6.value = false, e("clear"), Pt(); }, qe = (ge) => { var Se; if (n.multiple) { const Fe = Si((Se = n.modelValue) != null ? Se : []).slice(), Ge = Mt(Fe, ge.value); Ge > -1 ? Fe.splice(Ge, 1) : (n.multipleLimit <= 0 || Fe.length < n.multipleLimit) && Fe.push(ge.value), e(At, Fe), Me(Fe), ge.created && se(""), n.filterable && !n.reserveKeyword && (o.inputValue = ""); } else e(At, ge.value), Me(ge.value), T6.value = false; Pt(), !T6.value && nextTick(() => { Be(ge); }); }, Mt = (ge = [], Se) => { if (!Tn(Se)) return ge.indexOf(Se); const Fe = n.valueKey; let Ge = -1; return ge.some((je, et) => toRaw(Ki(je, Fe)) === Ki(Se, Fe) ? (Ge = et, true) : false), Ge; }, Be = (ge) => { var Se, Fe, Ge, je, et; const Ye = Pn(ge) ? ge[0] : ge; let ft = null; if (Ye != null && Ye.value) { const Vt = ie.value.filter((ln2) => ln2.value === Ye.value); Vt.length > 0 && (ft = Vt[0].$el); } if (l.value && ft) { const Vt = (je = (Ge = (Fe = (Se = l.value) == null ? void 0 : Se.popperRef) == null ? void 0 : Fe.contentRef) == null ? void 0 : Ge.querySelector) == null ? void 0 : je.call(Ge, `.${r.be("dropdown", "wrap")}`); Vt && B_(Vt, ft); } (et = m6.value) == null || et.handleScroll(); }, it = (ge) => { o.options.set(ge.value, ge), o.cachedOptions.set(ge.value, ge), ge.disabled && o.disabledOptions.set(ge.value, ge); }, tt = (ge, Se) => { o.options.get(ge) === Se && o.options.delete(ge); }, qt = computed(() => { var ge, Se; return (Se = (ge = l.value) == null ? void 0 : ge.popperRef) == null ? void 0 : Se.contentRef; }), Qt = () => { o.isBeforeHide = false, nextTick(() => Be(o.selected)); }, Pt = () => { var ge; (ge = h6.value) == null || ge.focus(); }, Nt = () => { var ge; (ge = h6.value) == null || ge.blur(); }, Vi = (ge) => { lt(ge); }, Gi = () => { T6.value = false, L6.value && Nt(); }, ni = () => { o.inputValue.length > 0 ? o.inputValue = "" : T6.value = false; }, ts = () => { b6.value || (zh && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : T6.value = !T6.value); }, Q = () => { T6.value ? ie.value[o.hoveringIndex] && qe(ie.value[o.hoveringIndex]) : ts(); }, _e = (ge) => Tn(ge.value) ? Ki(ge.value, n.valueKey) : ge.value, Oe = computed(() => ie.value.filter((ge) => ge.visible).every((ge) => ge.disabled)), Ze = computed(() => n.multiple ? n.collapseTags ? o.selected.slice(0, n.maxCollapseTags) : o.selected : []), ht = computed(() => n.multiple ? n.collapseTags ? o.selected.slice(n.maxCollapseTags) : [] : []), J = (ge) => { if (!T6.value) { T6.value = true; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || x6.value) && !Oe.value) { ge === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : ge === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const Se = ie.value[o.hoveringIndex]; (Se.disabled === true || Se.states.groupDisabled === true || !Se.visible) && J(ge), nextTick(() => Be(P6.value)); } }, ye = () => { if (!c.value) return 0; const ge = window.getComputedStyle(c.value); return Number.parseFloat(ge.gap || "6px"); }, pe = computed(() => { const ge = ye(); return { maxWidth: `${v6.value && n.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - ge : o.selectionWidth}px` }; }), we = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), Le = computed(() => ({ width: `${Math.max(o.calculatorWidth, dR)}px` })); return Jn(c, ee), Jn(f6, fe), Jn(u6, Ae), Jn(R6, Ae), Jn(y6, he), Jn(v6, be), onMounted(() => { O6(); }), { inputId: E6, contentId: i, nsSelect: r, nsInput: s, states: o, isFocused: L6, expanded: T6, optionsArray: ie, hoverOption: P6, selectSize: j6, filteredOptionsCount: ae, resetCalculatorWidth: fe, updateTooltip: Ae, updateTagTooltip: he, debouncedOnInputChange: me, onInput: ne, deletePrevTag: Ie, deleteTag: $e, deleteSelected: lt, handleOptionSelect: qe, scrollToOption: Be, hasModelValue: F6, shouldShowPlaceholder: H6, currentPlaceholder: K, mouseEnterEventName: ce, showClose: D6, iconComponent: N6, iconReverse: B6, validateState: U6, validateIcon: G6, showNewOption: W6, updateOptions: $6, collapseTagSize: re, setSelected: O6, selectDisabled: b6, emptyText: te, handleCompositionStart: w6, handleCompositionUpdate: A6, handleCompositionEnd: M6, onOptionCreate: it, onOptionDestroy: tt, handleMenuEnter: Qt, focus: Pt, blur: Nt, handleClearClick: Vi, handleClickOutside: Gi, handleEsc: ni, toggleMenu: ts, selectOption: Q, getValueKey: _e, navigateOptions: J, dropdownMenuVisible: k6, showTagList: Ze, collapseTagList: ht, tagStyle: pe, collapseTagStyle: we, inputStyle: Le, popperRef: qt, inputRef: h6, tooltipRef: l, tagTooltipRef: d, calculatorRef: f6, prefixRef: g6, suffixRef: p, selectRef: a6, wrapperRef: R6, selectionRef: c, scrollbarRef: m6, menuRef: u6, tagMenuRef: y6, collapseItemRef: v6 }; }; var pR = defineComponent({ name: "ElOptions", setup(n, { slots: e }) { const t = inject(lu); let i = []; return () => { var r, s; const o = (r = e.default) == null ? void 0 : r.call(e), a6 = []; function c(l) { Pn(l) && l.forEach((d) => { var h6, f6, g6, p; const u6 = (h6 = (d == null ? void 0 : d.type) || {}) == null ? void 0 : h6.name; u6 === "ElOptionGroup" ? c(!vn(d.children) && !Pn(d.children) && Sn((f6 = d.children) == null ? void 0 : f6.default) ? (g6 = d.children) == null ? void 0 : g6.default() : d.children) : u6 === "ElOption" ? a6.push((p = d.props) == null ? void 0 : p.value) : Pn(d.children) && c(d.children); }); } return o.length && c((s = o[0]) == null ? void 0 : s.children), $h(a6, i) || (i = a6, t && (t.states.optionValues = a6)), o; }; } }); var mR = at({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: Gr, effect: { type: Je(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: Je(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: kn.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: Vr, default: Yd }, fitInputWidth: Boolean, suffixIcon: { type: Vr, default: Xd }, tagType: { ...Qh.type, default: "info" }, tagEffect: { ...Qh.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, placement: { type: Je(String), values: Yo, default: "bottom-start" }, fallbackPlacements: { type: Je(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...NE, ...Yr(["ariaLabel"]) }); var Um = "ElSelect"; var gR = defineComponent({ name: Um, componentName: Um, components: { ElSelectMenu: hR, ElOption: mf, ElOptions: pR, ElTag: lL, ElScrollbar: p2, ElTooltip: pf, ElIcon: It }, directives: { ClickOutside: WC }, props: mR, emits: [ At, hr, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(n, { emit: e }) { const t = computed(() => { const { modelValue: s, multiple: o } = n, a6 = o ? [] : void 0; return Pn(s) ? o ? s : a6 : o ? a6 : s; }), i = reactive({ ...toRefs(n), modelValue: t }), r = fR(i, e); return provide(lu, reactive({ props: i, states: r.states, optionsArray: r.optionsArray, handleOptionSelect: r.handleOptionSelect, onOptionCreate: r.onOptionCreate, onOptionDestroy: r.onOptionDestroy, selectRef: r.selectRef, setSelected: r.setSelected })), { ...r, modelValue: t }; } }); function vR(n, e, t, i, r, s) { const o = resolveComponent("el-tag"), a6 = resolveComponent("el-tooltip"), c = resolveComponent("el-icon"), l = resolveComponent("el-option"), d = resolveComponent("el-options"), h6 = resolveComponent("el-scrollbar"), f6 = resolveComponent("el-select-menu"), g6 = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([n.nsSelect.b(), n.nsSelect.m(n.selectSize)]), [toHandlerKey(n.mouseEnterEventName)]: (p) => n.states.inputHovering = true, onMouseleave: (p) => n.states.inputHovering = false }, [ createVNode(a6, { ref: "tooltipRef", visible: n.dropdownMenuVisible, placement: n.placement, teleported: n.teleported, "popper-class": [n.nsSelect.e("popper"), n.popperClass], "popper-options": n.popperOptions, "fallback-placements": n.fallbackPlacements, effect: n.effect, pure: "", trigger: "click", transition: `${n.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: n.persistent, "append-to": n.appendTo, onBeforeShow: n.handleMenuEnter, onHide: (p) => n.states.isBeforeHide = false }, { default: withCtx(() => { var p; return [ createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ n.nsSelect.e("wrapper"), n.nsSelect.is("focused", n.isFocused), n.nsSelect.is("hovering", n.states.inputHovering), n.nsSelect.is("filterable", n.filterable), n.nsSelect.is("disabled", n.selectDisabled) ]), onClick: withModifiers(n.toggleMenu, ["prevent"]) }, [ n.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(n.nsSelect.e("prefix")) }, [ renderSlot(n.$slots, "prefix") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([ n.nsSelect.e("selection"), n.nsSelect.is("near", n.multiple && !n.$slots.prefix && !!n.states.selected.length) ]) }, [ n.multiple ? renderSlot(n.$slots, "tag", { key: 0 }, () => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.showTagList, (u6) => (openBlock(), createElementBlock("div", { key: n.getValueKey(u6), class: normalizeClass(n.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: !n.selectDisabled && !u6.isDisabled, size: n.collapseTagSize, type: n.tagType, effect: n.tagEffect, "disable-transitions": "", style: normalizeStyle(n.tagStyle), onClose: (y6) => n.deleteTag(y6, u6) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(n.nsSelect.e("tags-text")) }, [ renderSlot(n.$slots, "label", { label: u6.currentLabel, value: u6.value }, () => [ createTextVNode(toDisplayString(u6.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), n.collapseTags && n.states.selected.length > n.maxCollapseTags ? (openBlock(), createBlock(a6, { key: 0, ref: "tagTooltipRef", disabled: n.dropdownMenuVisible || !n.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: n.effect, placement: "bottom", teleported: n.teleported }, { default: withCtx(() => [ createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(n.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: false, size: n.collapseTagSize, type: n.tagType, effect: n.tagEffect, "disable-transitions": "", style: normalizeStyle(n.collapseTagStyle) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(n.nsSelect.e("tags-text")) }, " + " + toDisplayString(n.states.selected.length - n.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: withCtx(() => [ createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(n.nsSelect.e("selection")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.collapseTagList, (u6) => (openBlock(), createElementBlock("div", { key: n.getValueKey(u6), class: normalizeClass(n.nsSelect.e("selected-item")) }, [ createVNode(o, { class: "in-tooltip", closable: !n.selectDisabled && !u6.isDisabled, size: n.collapseTagSize, type: n.tagType, effect: n.tagEffect, "disable-transitions": "", onClose: (y6) => n.deleteTag(y6, u6) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(n.nsSelect.e("tags-text")) }, [ renderSlot(n.$slots, "label", { label: u6.currentLabel, value: u6.value }, () => [ createTextVNode(toDisplayString(u6.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true) ]) : createCommentVNode("v-if", true), n.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ n.nsSelect.e("selected-item"), n.nsSelect.e("input-wrapper"), n.nsSelect.is("hidden", !n.filterable) ]) }, [ withDirectives(createBaseVNode("input", { id: n.inputId, ref: "inputRef", "onUpdate:modelValue": (u6) => n.states.inputValue = u6, type: "text", name: n.name, class: normalizeClass([n.nsSelect.e("input"), n.nsSelect.is(n.selectSize)]), disabled: n.selectDisabled, autocomplete: n.autocomplete, style: normalizeStyle(n.inputStyle), role: "combobox", readonly: !n.filterable, spellcheck: "false", "aria-activedescendant": ((p = n.hoverOption) == null ? void 0 : p.id) || "", "aria-controls": n.contentId, "aria-expanded": n.dropdownMenuVisible, "aria-label": n.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ withKeys(withModifiers((u6) => n.navigateOptions("next"), ["stop", "prevent"]), ["down"]), withKeys(withModifiers((u6) => n.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), withKeys(withModifiers(n.handleEsc, ["stop", "prevent"]), ["esc"]), withKeys(withModifiers(n.selectOption, ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(n.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: n.handleCompositionStart, onCompositionupdate: n.handleCompositionUpdate, onCompositionend: n.handleCompositionEnd, onInput: n.onInput, onClick: withModifiers(n.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [vModelText, n.states.inputValue] ]), n.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(n.nsSelect.e("input-calculator")), textContent: toDisplayString(n.states.inputValue) }, null, 10, ["textContent"])) : createCommentVNode("v-if", true) ], 2)), n.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([ n.nsSelect.e("selected-item"), n.nsSelect.e("placeholder"), n.nsSelect.is("transparent", !n.hasModelValue || n.expanded && !n.states.inputValue) ]) }, [ n.hasModelValue ? renderSlot(n.$slots, "label", { key: 0, label: n.currentPlaceholder, value: n.modelValue }, () => [ createBaseVNode("span", null, toDisplayString(n.currentPlaceholder), 1) ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(n.currentPlaceholder), 1)) ], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(n.nsSelect.e("suffix")) }, [ n.iconComponent && !n.showClose ? (openBlock(), createBlock(c, { key: 0, class: normalizeClass([n.nsSelect.e("caret"), n.nsSelect.e("icon"), n.iconReverse]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(n.iconComponent))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), n.showClose && n.clearIcon ? (openBlock(), createBlock(c, { key: 1, class: normalizeClass([ n.nsSelect.e("caret"), n.nsSelect.e("icon"), n.nsSelect.e("clear") ]), onClick: n.handleClearClick }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(n.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), n.validateState && n.validateIcon ? (openBlock(), createBlock(c, { key: 2, class: normalizeClass([n.nsInput.e("icon"), n.nsInput.e("validateIcon")]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(n.validateIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 10, ["onClick"]) ]; }), content: withCtx(() => [ createVNode(f6, { ref: "menuRef" }, { default: withCtx(() => [ n.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(n.nsSelect.be("dropdown", "header")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(n.$slots, "header") ], 10, ["onClick"])) : createCommentVNode("v-if", true), withDirectives(createVNode(h6, { id: n.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": n.nsSelect.be("dropdown", "wrap"), "view-class": n.nsSelect.be("dropdown", "list"), class: normalizeClass([n.nsSelect.is("empty", n.filteredOptionsCount === 0)]), role: "listbox", "aria-label": n.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [ n.showNewOption ? (openBlock(), createBlock(l, { key: 0, value: n.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(d, null, { default: withCtx(() => [ renderSlot(n.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [vShow, n.states.options.size > 0 && !n.loading] ]), n.$slots.loading && n.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(n.nsSelect.be("dropdown", "loading")) }, [ renderSlot(n.$slots, "loading") ], 2)) : n.loading || n.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(n.nsSelect.be("dropdown", "empty")) }, [ renderSlot(n.$slots, "empty", {}, () => [ createBaseVNode("span", null, toDisplayString(n.emptyText), 1) ]) ], 2)) : createCommentVNode("v-if", true), n.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(n.nsSelect.be("dropdown", "footer")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(n.$slots, "footer") ], 10, ["onClick"])) : createCommentVNode("v-if", true) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [g6, n.handleClickOutside, n.popperRef] ]); } var yR = st(gR, [["render", vR], ["__file", "select.vue"]]); var bR = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(n) { const e = nt("select"), t = ref(null), i = getCurrentInstance(), r = ref([]); provide(fy, reactive({ ...toRefs(n) })); const s = computed(() => r.value.some((l) => l.visible === true)), o = (l) => { var d, h6; return ((d = l.type) == null ? void 0 : d.name) === "ElOption" && !!((h6 = l.component) != null && h6.proxy); }, a6 = (l) => { const d = Si(l), h6 = []; return d.forEach((f6) => { var g6, p; o(f6) ? h6.push(f6.component.proxy) : (g6 = f6.children) != null && g6.length ? h6.push(...a6(f6.children)) : (p = f6.component) != null && p.subTree && h6.push(...a6(f6.component.subTree)); }), h6; }, c = () => { r.value = a6(i.subTree); }; return onMounted(() => { c(); }), Ew(t, c, { attributes: true, subtree: true, childList: true }), { groupRef: t, visible: s, ns: e }; } }); function xR(n, e, t, i, r, s) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(n.ns.be("group", "wrap")) }, [ createBaseVNode("li", { class: normalizeClass(n.ns.be("group", "title")) }, toDisplayString(n.label), 3), createBaseVNode("li", null, [ createBaseVNode("ul", { class: normalizeClass(n.ns.b("group")) }, [ renderSlot(n.$slots, "default") ], 2) ]) ], 2)), [ [vShow, n.visible] ]); } var py = st(bR, [["render", xR], ["__file", "option-group.vue"]]); var qo = on2(yR, { Option: mf, OptionGroup: py }); var Qo = vi(mf); vi(py); var MR = at({ trigger: ka.trigger, placement: Hu.placement, disabled: ka.disabled, visible: kn.visible, transition: kn.transition, popperOptions: Hu.popperOptions, tabindex: Hu.tabindex, content: kn.content, popperStyle: kn.popperStyle, popperClass: kn.popperClass, enterable: { ...kn.enterable, default: true }, effect: { ...kn.effect, default: "light" }, teleported: kn.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); var wR = { "update:visible": (n) => Ba(n), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; var AR = "onUpdate:visible"; var SR = defineComponent({ name: "ElPopover" }); var _R = defineComponent({ ...SR, props: MR, emits: wR, setup(n, { expose: e, emit: t }) { const i = n, r = computed(() => i[AR]), s = nt("popover"), o = ref(), a6 = computed(() => { var y6; return (y6 = unref(o)) == null ? void 0 : y6.popperRef; }), c = computed(() => [ { width: Dc(i.width) }, i.popperStyle ]), l = computed(() => [s.b(), i.popperClass, { [s.m("plain")]: !!i.content }]), d = computed(() => i.transition === `${s.namespace.value}-fade-in-linear`), h6 = () => { var y6; (y6 = o.value) == null || y6.hide(); }, f6 = () => { t("before-enter"); }, g6 = () => { t("before-leave"); }, p = () => { t("after-enter"); }, u6 = () => { t("update:visible", false), t("after-leave"); }; return e({ popperRef: a6, hide: h6 }), (y6, v6) => (openBlock(), createBlock(unref(pf), mergeProps({ ref_key: "tooltipRef", ref: o }, y6.$attrs, { trigger: y6.trigger, placement: y6.placement, disabled: y6.disabled, visible: y6.visible, transition: y6.transition, "popper-options": y6.popperOptions, tabindex: y6.tabindex, content: y6.content, offset: y6.offset, "show-after": y6.showAfter, "hide-after": y6.hideAfter, "auto-close": y6.autoClose, "show-arrow": y6.showArrow, "aria-label": y6.title, effect: y6.effect, enterable: y6.enterable, "popper-class": unref(l), "popper-style": unref(c), teleported: y6.teleported, persistent: y6.persistent, "gpu-acceleration": unref(d), "onUpdate:visible": unref(r), onBeforeShow: f6, onBeforeHide: g6, onShow: p, onHide: u6 }), { content: withCtx(() => [ y6.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(s).e("title")), role: "title" }, toDisplayString(y6.title), 3)) : createCommentVNode("v-if", true), renderSlot(y6.$slots, "default", {}, () => [ createTextVNode(toDisplayString(y6.content), 1) ]) ]), default: withCtx(() => [ y6.$slots.reference ? renderSlot(y6.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var TR = st(_R, [["__file", "popover.vue"]]); var zm = (n, e) => { const t = e.arg || e.value, i = t == null ? void 0 : t.popperRef; i && (i.triggerRef = n); }; var ER = { mounted(n, e) { zm(n, e); }, updated(n, e) { zm(n, e); } }; var CR = "popover"; var LR = rT(ER, CR); var cu = on2(TR, { directive: LR }); var my = Symbol("sliderContextKey"); var RR = at({ modelValue: { type: Je([Number, Array]), default: 0 }, id: { type: String, default: void 0 }, min: { type: Number, default: 0 }, max: { type: Number, default: 100 }, step: { type: Number, default: 1 }, showInput: Boolean, showInputControls: { type: Boolean, default: true }, size: Gr, inputSize: Gr, showStops: Boolean, showTooltip: { type: Boolean, default: true }, formatTooltip: { type: Je(Function), default: void 0 }, disabled: Boolean, range: Boolean, vertical: Boolean, height: String, debounce: { type: Number, default: 300 }, rangeStartLabel: { type: String, default: void 0 }, rangeEndLabel: { type: String, default: void 0 }, formatValueText: { type: Je(Function), default: void 0 }, tooltipClass: { type: String, default: void 0 }, placement: { type: String, values: Yo, default: "top" }, marks: { type: Je(Object) }, validateEvent: { type: Boolean, default: true }, ...Yr(["ariaLabel"]) }); var Wu = (n) => yt(n) || Pn(n) && n.every(yt); var FR = { [At]: Wu, [bs]: Wu, [hr]: Wu }; var PR = (n, e, t) => { const i = ref(); return onMounted(async () => { n.range ? (Array.isArray(n.modelValue) ? (e.firstValue = Math.max(n.min, n.modelValue[0]), e.secondValue = Math.min(n.max, n.modelValue[1])) : (e.firstValue = n.min, e.secondValue = n.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof n.modelValue != "number" || Number.isNaN(n.modelValue) ? e.firstValue = n.min : e.firstValue = Math.min(n.max, Math.max(n.min, n.modelValue)), e.oldValue = e.firstValue), un(window, "resize", t), await nextTick(), t(); }), { sliderWrapper: i }; }; var IR = (n) => computed(() => n.marks ? Object.keys(n.marks).map(Number.parseFloat).sort((t, i) => t - i).filter((t) => t <= n.max && t >= n.min).map((t) => ({ point: t, position: (t - n.min) * 100 / (n.max - n.min), mark: n.marks[t] })) : []); var OR = (n, e, t) => { const { form: i, formItem: r } = Jo(), s = shallowRef(), o = ref(), a6 = ref(), c = { firstButton: o, secondButton: a6 }, l = computed(() => n.disabled || (i == null ? void 0 : i.disabled) || false), d = computed(() => Math.min(e.firstValue, e.secondValue)), h6 = computed(() => Math.max(e.firstValue, e.secondValue)), f6 = computed(() => n.range ? `${100 * (h6.value - d.value) / (n.max - n.min)}%` : `${100 * (e.firstValue - n.min) / (n.max - n.min)}%`), g6 = computed(() => n.range ? `${100 * (d.value - n.min) / (n.max - n.min)}%` : "0%"), p = computed(() => n.vertical ? { height: n.height } : {}), u6 = computed(() => n.vertical ? { height: f6.value, bottom: g6.value } : { width: f6.value, left: g6.value }), y6 = () => { s.value && (e.sliderSize = s.value[`client${n.vertical ? "Height" : "Width"}`]); }, v6 = (S6) => { const E6 = n.min + S6 * (n.max - n.min) / 100; if (!n.range) return o; let C6; return Math.abs(d.value - E6) < Math.abs(h6.value - E6) ? C6 = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : C6 = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[C6]; }, m6 = (S6) => { const E6 = v6(S6); return E6.value.setPosition(S6), E6; }, x6 = (S6) => { e.firstValue = S6 ?? n.min, A6(n.range ? [d.value, h6.value] : S6 ?? n.min); }, w6 = (S6) => { e.secondValue = S6, n.range && A6([d.value, h6.value]); }, A6 = (S6) => { t(At, S6), t(bs, S6); }, M6 = async () => { await nextTick(), t(hr, n.range ? [d.value, h6.value] : n.modelValue); }, R6 = (S6) => { var E6, C6, I6, b6, F6, D6; if (l.value || e.dragging) return; y6(); let N6 = 0; if (n.vertical) { const B6 = (I6 = (C6 = (E6 = S6.touches) == null ? void 0 : E6.item(0)) == null ? void 0 : C6.clientY) != null ? I6 : S6.clientY; N6 = (s.value.getBoundingClientRect().bottom - B6) / e.sliderSize * 100; } else { const B6 = (D6 = (F6 = (b6 = S6.touches) == null ? void 0 : b6.item(0)) == null ? void 0 : F6.clientX) != null ? D6 : S6.clientX, U6 = s.value.getBoundingClientRect().left; N6 = (B6 - U6) / e.sliderSize * 100; } if (!(N6 < 0 || N6 > 100)) return m6(N6); }; return { elFormItem: r, slider: s, firstButton: o, secondButton: a6, sliderDisabled: l, minValue: d, maxValue: h6, runwayStyle: p, barStyle: u6, resetSize: y6, setPosition: m6, emitChange: M6, onSliderWrapperPrevent: (S6) => { var E6, C6; ((E6 = c.firstButton.value) != null && E6.dragging || (C6 = c.secondButton.value) != null && C6.dragging) && S6.preventDefault(); }, onSliderClick: (S6) => { R6(S6) && M6(); }, onSliderDown: async (S6) => { const E6 = R6(S6); E6 && (await nextTick(), E6.value.onButtonDown(S6)); }, onSliderMarkerDown: (S6) => { l.value || e.dragging || m6(S6); }, setFirstValue: x6, setSecondValue: w6 }; }; var { left: DR, down: NR, right: BR, up: UR, home: zR, end: kR, pageUp: VR, pageDown: GR } = Li; var HR = (n, e, t) => { const i = ref(), r = ref(false), s = computed(() => e.value instanceof Function), o = computed(() => s.value && e.value(n.modelValue) || n.modelValue), a6 = jh(() => { t.value && (r.value = true); }, 50), c = jh(() => { t.value && (r.value = false); }, 50); return { tooltip: i, tooltipVisible: r, formatValue: o, displayTooltip: a6, hideTooltip: c }; }; var WR = (n, e, t) => { const { disabled: i, min: r, max: s, step: o, showTooltip: a6, precision: c, sliderSize: l, formatTooltip: d, emitChange: h6, resetSize: f6, updateDragging: g6 } = inject(my), { tooltip: p, tooltipVisible: u6, formatValue: y6, displayTooltip: v6, hideTooltip: m6 } = HR(n, d, a6), x6 = ref(), w6 = computed(() => `${(n.modelValue - r.value) / (s.value - r.value) * 100}%`), A6 = computed(() => n.vertical ? { bottom: w6.value } : { left: w6.value }), M6 = () => { e.hovering = true, v6(); }, R6 = () => { e.hovering = false, e.dragging || m6(); }, L6 = (G6) => { i.value || (G6.preventDefault(), D6(G6), window.addEventListener("mousemove", N6), window.addEventListener("touchmove", N6), window.addEventListener("mouseup", B6), window.addEventListener("touchend", B6), window.addEventListener("contextmenu", B6), x6.value.focus()); }, T6 = (G6) => { i.value || (e.newPosition = Number.parseFloat(w6.value) + G6 / (s.value - r.value) * 100, U6(e.newPosition), h6()); }, P6 = () => { T6(-o.value); }, _6 = () => { T6(o.value); }, S6 = () => { T6(-o.value * 4); }, E6 = () => { T6(o.value * 4); }, C6 = () => { i.value || (U6(0), h6()); }, I6 = () => { i.value || (U6(100), h6()); }, b6 = (G6) => { let Y = true; [DR, NR].includes(G6.key) ? P6() : [BR, UR].includes(G6.key) ? _6() : G6.key === zR ? C6() : G6.key === kR ? I6() : G6.key === GR ? S6() : G6.key === VR ? E6() : Y = false, Y && G6.preventDefault(); }, F6 = (G6) => { let Y, te; return G6.type.startsWith("touch") ? (te = G6.touches[0].clientY, Y = G6.touches[0].clientX) : (te = G6.clientY, Y = G6.clientX), { clientX: Y, clientY: te }; }, D6 = (G6) => { e.dragging = true, e.isClick = true; const { clientX: Y, clientY: te } = F6(G6); n.vertical ? e.startY = te : e.startX = Y, e.startPosition = Number.parseFloat(w6.value), e.newPosition = e.startPosition; }, N6 = (G6) => { if (e.dragging) { e.isClick = false, v6(), f6(); let Y; const { clientX: te, clientY: ae } = F6(G6); n.vertical ? (e.currentY = ae, Y = (e.startY - e.currentY) / l.value * 100) : (e.currentX = te, Y = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + Y, U6(e.newPosition); } }, B6 = () => { e.dragging && (setTimeout(() => { e.dragging = false, e.hovering || m6(), e.isClick || U6(e.newPosition), h6(); }, 0), window.removeEventListener("mousemove", N6), window.removeEventListener("touchmove", N6), window.removeEventListener("mouseup", B6), window.removeEventListener("touchend", B6), window.removeEventListener("contextmenu", B6)); }, U6 = async (G6) => { if (G6 === null || Number.isNaN(+G6)) return; G6 < 0 ? G6 = 0 : G6 > 100 && (G6 = 100); const Y = 100 / ((s.value - r.value) / o.value); let ae = Math.round(G6 / Y) * Y * (s.value - r.value) * 0.01 + r.value; ae = Number.parseFloat(ae.toFixed(c.value)), ae !== n.modelValue && t(At, ae), !e.dragging && n.modelValue !== e.oldValue && (e.oldValue = n.modelValue), await nextTick(), e.dragging && v6(), p.value.updatePopper(); }; return watch(() => e.dragging, (G6) => { g6(G6); }), un(x6, "touchstart", L6, { passive: false }), { disabled: i, button: x6, tooltip: p, tooltipVisible: u6, showTooltip: a6, wrapperStyle: A6, formatValue: y6, handleMouseEnter: M6, handleMouseLeave: R6, onButtonDown: L6, onKeyDown: b6, setPosition: U6 }; }; var jR = (n, e, t, i) => ({ stops: computed(() => { if (!n.showStops || n.min > n.max) return []; if (n.step === 0) return kt("ElSlider", "step should not be 0."), []; const o = (n.max - n.min) / n.step, a6 = 100 * n.step / (n.max - n.min), c = Array.from({ length: o - 1 }).map((l, d) => (d + 1) * a6); return n.range ? c.filter((l) => l < 100 * (t.value - n.min) / (n.max - n.min) || l > 100 * (i.value - n.min) / (n.max - n.min)) : c.filter((l) => l > 100 * (e.firstValue - n.min) / (n.max - n.min)); }), getStopStyle: (o) => n.vertical ? { bottom: `${o}%` } : { left: `${o}%` } }); var $R = (n, e, t, i, r, s) => { const o = (l) => { r(At, l), r(bs, l); }, a6 = () => n.range ? ![t.value, i.value].every((l, d) => l === e.oldValue[d]) : n.modelValue !== e.oldValue, c = () => { var l, d; n.min > n.max && Xo("Slider", "min should not be greater than max."); const h6 = n.modelValue; n.range && Array.isArray(h6) ? h6[1] < n.min ? o([n.min, n.min]) : h6[0] > n.max ? o([n.max, n.max]) : h6[0] < n.min ? o([n.min, h6[1]]) : h6[1] > n.max ? o([h6[0], n.max]) : (e.firstValue = h6[0], e.secondValue = h6[1], a6() && (n.validateEvent && ((l = s == null ? void 0 : s.validate) == null || l.call(s, "change").catch((f6) => kt(f6))), e.oldValue = h6.slice())) : !n.range && typeof h6 == "number" && !Number.isNaN(h6) && (h6 < n.min ? o(n.min) : h6 > n.max ? o(n.max) : (e.firstValue = h6, a6() && (n.validateEvent && ((d = s == null ? void 0 : s.validate) == null || d.call(s, "change").catch((f6) => kt(f6))), e.oldValue = h6))); }; c(), watch(() => e.dragging, (l) => { l || c(); }), watch(() => n.modelValue, (l, d) => { e.dragging || Array.isArray(l) && Array.isArray(d) && l.every((h6, f6) => h6 === d[f6]) && e.firstValue === l[0] && e.secondValue === l[1] || c(); }, { deep: true }), watch(() => [n.min, n.max], () => { c(); }); }; var ZR = at({ modelValue: { type: Number, default: 0 }, vertical: Boolean, tooltipClass: String, placement: { type: String, values: Yo, default: "top" } }); var XR = { [At]: (n) => yt(n) }; var YR = defineComponent({ name: "ElSliderButton" }); var JR = defineComponent({ ...YR, props: ZR, emits: XR, setup(n, { expose: e, emit: t }) { const i = n, r = nt("slider"), s = reactive({ hovering: false, dragging: false, isClick: false, startX: 0, currentX: 0, startY: 0, currentY: 0, startPosition: 0, newPosition: 0, oldValue: i.modelValue }), { disabled: o, button: a6, tooltip: c, showTooltip: l, tooltipVisible: d, wrapperStyle: h6, formatValue: f6, handleMouseEnter: g6, handleMouseLeave: p, onButtonDown: u6, onKeyDown: y6, setPosition: v6 } = WR(i, s, t), { hovering: m6, dragging: x6 } = toRefs(s); return e({ onButtonDown: u6, onKeyDown: y6, setPosition: v6, hovering: m6, dragging: x6 }), (w6, A6) => (openBlock(), createElementBlock("div", { ref_key: "button", ref: a6, class: normalizeClass([unref(r).e("button-wrapper"), { hover: unref(m6), dragging: unref(x6) }]), style: normalizeStyle(unref(h6)), tabindex: unref(o) ? -1 : 0, onMouseenter: unref(g6), onMouseleave: unref(p), onMousedown: unref(u6), onFocus: unref(g6), onBlur: unref(p), onKeydown: unref(y6) }, [ createVNode(unref(pf), { ref_key: "tooltip", ref: c, visible: unref(d), placement: w6.placement, "fallback-placements": ["top", "bottom", "right", "left"], "stop-popper-mouse-event": false, "popper-class": w6.tooltipClass, disabled: !unref(l), persistent: "" }, { content: withCtx(() => [ createBaseVNode("span", null, toDisplayString(unref(f6)), 1) ]), default: withCtx(() => [ createBaseVNode("div", { class: normalizeClass([unref(r).e("button"), { hover: unref(m6), dragging: unref(x6) }]) }, null, 2) ]), _: 1 }, 8, ["visible", "placement", "popper-class", "disabled"]) ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"])); } }); var km = st(JR, [["__file", "button.vue"]]); var KR = at({ mark: { type: Je([String, Object]), default: void 0 } }); var qR = defineComponent({ name: "ElSliderMarker", props: KR, setup(n) { const e = nt("slider"), t = computed(() => vn(n.mark) ? n.mark : n.mark.label), i = computed(() => vn(n.mark) ? void 0 : n.mark.style); return () => h("div", { class: e.e("marks-text"), style: i.value }, t.value); } }); var QR = defineComponent({ name: "ElSlider" }); var e3 = defineComponent({ ...QR, props: RR, emits: FR, setup(n, { expose: e, emit: t }) { const i = n, r = nt("slider"), { t: s } = iu(), o = reactive({ firstValue: 0, secondValue: 0, oldValue: 0, dragging: false, sliderSize: 1 }), { elFormItem: a6, slider: c, firstButton: l, secondButton: d, sliderDisabled: h6, minValue: f6, maxValue: g6, runwayStyle: p, barStyle: u6, resetSize: y6, emitChange: v6, onSliderWrapperPrevent: m6, onSliderClick: x6, onSliderDown: w6, onSliderMarkerDown: A6, setFirstValue: M6, setSecondValue: R6 } = OR(i, o, t), { stops: L6, getStopStyle: T6 } = jR(i, o, f6, g6), { inputId: P6, isLabeledByFormItem: _6 } = su(i, { formItemContext: a6 }), S6 = Ns(), E6 = computed(() => i.inputSize || S6.value), C6 = computed(() => i.ariaLabel || s("el.slider.defaultLabel", { min: i.min, max: i.max })), I6 = computed(() => i.range ? i.rangeStartLabel || s("el.slider.defaultRangeStartLabel") : C6.value), b6 = computed(() => i.formatValueText ? i.formatValueText(Y.value) : `${Y.value}`), F6 = computed(() => i.rangeEndLabel || s("el.slider.defaultRangeEndLabel")), D6 = computed(() => i.formatValueText ? i.formatValueText(te.value) : `${te.value}`), N6 = computed(() => [ r.b(), r.m(S6.value), r.is("vertical", i.vertical), { [r.m("with-input")]: i.showInput } ]), B6 = IR(i); $R(i, o, f6, g6, t, a6); const U6 = computed(() => { const le = [i.min, i.max, i.step].map((W6) => { const $6 = `${W6}`.split(".")[1]; return $6 ? $6.length : 0; }); return Math.max.apply(null, le); }), { sliderWrapper: G6 } = PR(i, o, y6), { firstValue: Y, secondValue: te, sliderSize: ae } = toRefs(o), ie = (le) => { o.dragging = le; }; return un(G6, "touchstart", m6, { passive: false }), un(G6, "touchmove", m6, { passive: false }), provide(my, { ...toRefs(i), sliderSize: ae, disabled: h6, precision: U6, emitChange: v6, resetSize: y6, updateDragging: ie }), e({ onSliderClick: x6 }), (le, W6) => { var $6, j6; return openBlock(), createElementBlock("div", { id: le.range ? unref(P6) : void 0, ref_key: "sliderWrapper", ref: G6, class: normalizeClass(unref(N6)), role: le.range ? "group" : void 0, "aria-label": le.range && !unref(_6) ? unref(C6) : void 0, "aria-labelledby": le.range && unref(_6) ? ($6 = unref(a6)) == null ? void 0 : $6.labelId : void 0 }, [ createBaseVNode("div", { ref_key: "slider", ref: c, class: normalizeClass([ unref(r).e("runway"), { "show-input": le.showInput && !le.range }, unref(r).is("disabled", unref(h6)) ]), style: normalizeStyle(unref(p)), onMousedown: unref(w6), onTouchstartPassive: unref(w6) }, [ createBaseVNode("div", { class: normalizeClass(unref(r).e("bar")), style: normalizeStyle(unref(u6)) }, null, 6), createVNode(km, { id: le.range ? void 0 : unref(P6), ref_key: "firstButton", ref: l, "model-value": unref(Y), vertical: le.vertical, "tooltip-class": le.tooltipClass, placement: le.placement, role: "slider", "aria-label": le.range || !unref(_6) ? unref(I6) : void 0, "aria-labelledby": !le.range && unref(_6) ? (j6 = unref(a6)) == null ? void 0 : j6.labelId : void 0, "aria-valuemin": le.min, "aria-valuemax": le.range ? unref(te) : le.max, "aria-valuenow": unref(Y), "aria-valuetext": unref(b6), "aria-orientation": le.vertical ? "vertical" : "horizontal", "aria-disabled": unref(h6), "onUpdate:modelValue": unref(M6) }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]), le.range ? (openBlock(), createBlock(km, { key: 0, ref_key: "secondButton", ref: d, "model-value": unref(te), vertical: le.vertical, "tooltip-class": le.tooltipClass, placement: le.placement, role: "slider", "aria-label": unref(F6), "aria-valuemin": unref(Y), "aria-valuemax": le.max, "aria-valuenow": unref(te), "aria-valuetext": unref(D6), "aria-orientation": le.vertical ? "vertical" : "horizontal", "aria-disabled": unref(h6), "onUpdate:modelValue": unref(R6) }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : createCommentVNode("v-if", true), le.showStops ? (openBlock(), createElementBlock("div", { key: 1 }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(L6), (re, k6) => (openBlock(), createElementBlock("div", { key: k6, class: normalizeClass(unref(r).e("stop")), style: normalizeStyle(unref(T6)(re)) }, null, 6))), 128)) ])) : createCommentVNode("v-if", true), unref(B6).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [ createBaseVNode("div", null, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(B6), (re, k6) => (openBlock(), createElementBlock("div", { key: k6, style: normalizeStyle(unref(T6)(re.position)), class: normalizeClass([unref(r).e("stop"), unref(r).e("marks-stop")]) }, null, 6))), 128)) ]), createBaseVNode("div", { class: normalizeClass(unref(r).e("marks")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(B6), (re, k6) => (openBlock(), createBlock(unref(qR), { key: k6, mark: re.mark, style: normalizeStyle(unref(T6)(re.position)), onMousedown: withModifiers((H6) => unref(A6)(re.position), ["stop"]) }, null, 8, ["mark", "style", "onMousedown"]))), 128)) ], 2) ], 64)) : createCommentVNode("v-if", true) ], 46, ["onMousedown", "onTouchstartPassive"]), le.showInput && !le.range ? (openBlock(), createBlock(unref(fr), { key: 0, ref: "input", "model-value": unref(Y), class: normalizeClass(unref(r).e("input")), step: le.step, disabled: unref(h6), controls: le.showInputControls, min: le.min, max: le.max, precision: unref(U6), debounce: le.debounce, size: unref(E6), "onUpdate:modelValue": unref(M6), onChange: unref(v6) }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : createCommentVNode("v-if", true) ], 10, ["id", "role", "aria-label", "aria-labelledby"]); }; } }); var t3 = st(e3, [["__file", "slider.vue"]]); var ti = on2(t3); var uu = Symbol("tabsRootContextKey"); var n3 = at({ tabs: { type: Je(Array), default: () => qi([]) } }); var gy = "ElTabBar"; var i3 = defineComponent({ name: gy }); var r3 = defineComponent({ ...i3, props: n3, setup(n, { expose: e }) { const t = n, i = getCurrentInstance(), r = inject(uu); r || Xo(gy, ""); const s = nt("tabs"), o = ref(), a6 = ref(), c = () => { let g6 = 0, p = 0; const u6 = ["top", "bottom"].includes(r.props.tabPosition) ? "width" : "height", y6 = u6 === "width" ? "x" : "y", v6 = y6 === "x" ? "left" : "top"; return t.tabs.every((m6) => { var x6, w6; const A6 = (w6 = (x6 = i.parent) == null ? void 0 : x6.refs) == null ? void 0 : w6[`tab-${m6.uid}`]; if (!A6) return false; if (!m6.active) return true; g6 = A6[`offset${Rr(v6)}`], p = A6[`client${Rr(u6)}`]; const M6 = window.getComputedStyle(A6); return u6 === "width" && (p -= Number.parseFloat(M6.paddingLeft) + Number.parseFloat(M6.paddingRight), g6 += Number.parseFloat(M6.paddingLeft)), false; }), { [u6]: `${p}px`, transform: `translate${Rr(y6)}(${g6}px)` }; }, l = () => a6.value = c(), d = [], h6 = () => { var g6; d.forEach((u6) => u6.stop()), d.length = 0; const p = (g6 = i.parent) == null ? void 0 : g6.refs; if (p) { for (const u6 in p) if (u6.startsWith("tab-")) { const y6 = p[u6]; y6 && d.push(Jn(y6, l)); } } }; watch(() => t.tabs, async () => { await nextTick(), l(), h6(); }, { immediate: true }); const f6 = Jn(o, () => l()); return onBeforeUnmount(() => { d.forEach((g6) => g6.stop()), d.length = 0, f6.stop(); }), e({ ref: o, update: l }), (g6, p) => (openBlock(), createElementBlock("div", { ref_key: "barRef", ref: o, class: normalizeClass([unref(s).e("active-bar"), unref(s).is(unref(r).props.tabPosition)]), style: normalizeStyle(a6.value) }, null, 6)); } }); var s3 = st(r3, [["__file", "tab-bar.vue"]]); var o3 = at({ panes: { type: Je(Array), default: () => qi([]) }, currentName: { type: [String, Number], default: "" }, editable: Boolean, type: { type: String, values: ["card", "border-card", ""], default: "" }, stretch: Boolean }); var a3 = { tabClick: (n, e, t) => t instanceof Event, tabRemove: (n, e) => e instanceof Event }; var Vm = "ElTabNav"; var l3 = defineComponent({ name: Vm, props: o3, emits: a3, setup(n, { expose: e, emit: t }) { const i = inject(uu); i || Xo(Vm, ""); const r = nt("tabs"), s = xw(), o = Iw(), a6 = ref(), c = ref(), l = ref(), d = ref(), h6 = ref(false), f6 = ref(0), g6 = ref(false), p = ref(true), u6 = computed(() => ["top", "bottom"].includes(i.props.tabPosition) ? "width" : "height"), y6 = computed(() => ({ transform: `translate${u6.value === "width" ? "X" : "Y"}(-${f6.value}px)` })), v6 = () => { if (!a6.value) return; const L6 = a6.value[`offset${Rr(u6.value)}`], T6 = f6.value; if (!T6) return; const P6 = T6 > L6 ? T6 - L6 : 0; f6.value = P6; }, m6 = () => { if (!a6.value || !c.value) return; const L6 = c.value[`offset${Rr(u6.value)}`], T6 = a6.value[`offset${Rr(u6.value)}`], P6 = f6.value; if (L6 - P6 <= T6) return; const _6 = L6 - P6 > T6 * 2 ? P6 + T6 : L6 - T6; f6.value = _6; }, x6 = async () => { const L6 = c.value; if (!h6.value || !l.value || !a6.value || !L6) return; await nextTick(); const T6 = l.value.querySelector(".is-active"); if (!T6) return; const P6 = a6.value, _6 = ["top", "bottom"].includes(i.props.tabPosition), S6 = T6.getBoundingClientRect(), E6 = P6.getBoundingClientRect(), C6 = _6 ? L6.offsetWidth - E6.width : L6.offsetHeight - E6.height, I6 = f6.value; let b6 = I6; _6 ? (S6.left < E6.left && (b6 = I6 - (E6.left - S6.left)), S6.right > E6.right && (b6 = I6 + S6.right - E6.right)) : (S6.top < E6.top && (b6 = I6 - (E6.top - S6.top)), S6.bottom > E6.bottom && (b6 = I6 + (S6.bottom - E6.bottom))), b6 = Math.max(b6, 0), f6.value = Math.min(b6, C6); }, w6 = () => { var L6; if (!c.value || !a6.value) return; n.stretch && ((L6 = d.value) == null || L6.update()); const T6 = c.value[`offset${Rr(u6.value)}`], P6 = a6.value[`offset${Rr(u6.value)}`], _6 = f6.value; P6 < T6 ? (h6.value = h6.value || {}, h6.value.prev = _6, h6.value.next = _6 + P6 < T6, T6 - _6 < P6 && (f6.value = T6 - P6)) : (h6.value = false, _6 > 0 && (f6.value = 0)); }, A6 = (L6) => { const T6 = L6.code, { up: P6, down: _6, left: S6, right: E6 } = Li; if (![P6, _6, S6, E6].includes(T6)) return; const C6 = Array.from(L6.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), I6 = C6.indexOf(L6.target); let b6; T6 === S6 || T6 === P6 ? I6 === 0 ? b6 = C6.length - 1 : b6 = I6 - 1 : I6 < C6.length - 1 ? b6 = I6 + 1 : b6 = 0, C6[b6].focus({ preventScroll: true }), C6[b6].click(), M6(); }, M6 = () => { p.value && (g6.value = true); }, R6 = () => g6.value = false; return watch(s, (L6) => { L6 === "hidden" ? p.value = false : L6 === "visible" && setTimeout(() => p.value = true, 50); }), watch(o, (L6) => { L6 ? setTimeout(() => p.value = true, 50) : p.value = false; }), Jn(l, w6), onMounted(() => setTimeout(() => x6(), 0)), onUpdated(() => w6()), e({ scrollToActiveTab: x6, removeFocus: R6 }), () => { const L6 = h6.value ? [createVNode("span", { class: [r.e("nav-prev"), r.is("disabled", !h6.value.prev)], onClick: v6 }, [createVNode(It, null, { default: () => [createVNode(zr, null, null)] })]), createVNode("span", { class: [r.e("nav-next"), r.is("disabled", !h6.value.next)], onClick: m6 }, [createVNode(It, null, { default: () => [createVNode(kr, null, null)] })])] : null, T6 = n.panes.map((P6, _6) => { var S6, E6, C6, I6; const b6 = P6.uid, F6 = P6.props.disabled, D6 = (E6 = (S6 = P6.props.name) != null ? S6 : P6.index) != null ? E6 : `${_6}`, N6 = !F6 && (P6.isClosable || n.editable); P6.index = `${_6}`; const B6 = N6 ? createVNode(It, { class: "is-icon-close", onClick: (Y) => t("tabRemove", P6, Y) }, { default: () => [createVNode(Zh, null, null)] }) : null, U6 = ((I6 = (C6 = P6.slots).label) == null ? void 0 : I6.call(C6)) || P6.props.label, G6 = !F6 && P6.active ? 0 : -1; return createVNode("div", { ref: `tab-${b6}`, class: [r.e("item"), r.is(i.props.tabPosition), r.is("active", P6.active), r.is("disabled", F6), r.is("closable", N6), r.is("focus", g6.value)], id: `tab-${D6}`, key: `tab-${b6}`, "aria-controls": `pane-${D6}`, role: "tab", "aria-selected": P6.active, tabindex: G6, onFocus: () => M6(), onBlur: () => R6(), onClick: (Y) => { R6(), t("tabClick", P6, D6, Y); }, onKeydown: (Y) => { N6 && (Y.code === Li.delete || Y.code === Li.backspace) && t("tabRemove", P6, Y); } }, [U6, B6]); }); return createVNode("div", { ref: l, class: [r.e("nav-wrap"), r.is("scrollable", !!h6.value), r.is(i.props.tabPosition)] }, [L6, createVNode("div", { class: r.e("nav-scroll"), ref: a6 }, [createVNode("div", { class: [r.e("nav"), r.is(i.props.tabPosition), r.is("stretch", n.stretch && ["top", "bottom"].includes(i.props.tabPosition))], ref: c, style: y6.value, role: "tablist", onKeydown: A6 }, [n.type ? null : createVNode(s3, { ref: d, tabs: [...n.panes] }, null), T6])])]); }; } }); var c3 = at({ type: { type: String, values: ["card", "border-card", ""], default: "" }, closable: Boolean, addable: Boolean, modelValue: { type: [String, Number] }, editable: Boolean, tabPosition: { type: String, values: ["top", "right", "bottom", "left"], default: "top" }, beforeLeave: { type: Je(Function), default: () => true }, stretch: Boolean }); var ju = (n) => vn(n) || yt(n); var u3 = { [At]: (n) => ju(n), tabClick: (n, e) => e instanceof Event, tabChange: (n) => ju(n), edit: (n, e) => ["remove", "add"].includes(e), tabRemove: (n) => ju(n), tabAdd: () => true }; var h3 = defineComponent({ name: "ElTabs", props: c3, emits: u3, setup(n, { emit: e, slots: t, expose: i }) { var r; const s = nt("tabs"), o = computed(() => ["left", "right"].includes(n.tabPosition)), { children: a6, addChild: c, removeChild: l } = FE(getCurrentInstance(), "ElTabPane"), d = ref(), h6 = ref((r = n.modelValue) != null ? r : "0"), f6 = async (v6, m6 = false) => { var x6, w6, A6; if (!(h6.value === v6 || di(v6))) try { await ((x6 = n.beforeLeave) == null ? void 0 : x6.call(n, v6, h6.value)) !== false && (h6.value = v6, m6 && (e(At, v6), e("tabChange", v6)), (A6 = (w6 = d.value) == null ? void 0 : w6.removeFocus) == null || A6.call(w6)); } catch { } }, g6 = (v6, m6, x6) => { v6.props.disabled || (f6(m6, true), e("tabClick", v6, x6)); }, p = (v6, m6) => { v6.props.disabled || di(v6.props.name) || (m6.stopPropagation(), e("edit", v6.props.name, "remove"), e("tabRemove", v6.props.name)); }, u6 = () => { e("edit", void 0, "add"), e("tabAdd"); }; watch(() => n.modelValue, (v6) => f6(v6)), watch(h6, async () => { var v6; await nextTick(), (v6 = d.value) == null || v6.scrollToActiveTab(); }), provide(uu, { props: n, currentName: h6, registerPane: (v6) => { a6.value.push(v6); }, sortPane: c, unregisterPane: l }), i({ currentName: h6 }); const y6 = ({ render: v6 }) => v6(); return () => { const v6 = t["add-icon"], m6 = n.editable || n.addable ? createVNode("div", { class: [s.e("new-tab"), o.value && s.e("new-tab-vertical")], tabindex: "0", onClick: u6, onKeydown: (A6) => { A6.code === Li.enter && u6(); } }, [v6 ? renderSlot(t, "add-icon") : createVNode(It, { class: s.is("icon-plus") }, { default: () => [createVNode(tu, null, null)] })]) : null, x6 = createVNode("div", { class: [s.e("header"), o.value && s.e("header-vertical"), s.is(n.tabPosition)] }, [createVNode(y6, { render: () => { const A6 = a6.value.some((M6) => M6.slots.label); return createVNode(l3, { ref: d, currentName: h6.value, editable: n.editable, type: n.type, panes: a6.value, stretch: n.stretch, onTabClick: g6, onTabRemove: p }, { $stable: !A6 }); } }, null), m6]), w6 = createVNode("div", { class: s.e("content") }, [renderSlot(t, "default")]); return createVNode("div", { class: [s.b(), s.m(n.tabPosition), { [s.m("card")]: n.type === "card", [s.m("border-card")]: n.type === "border-card" }] }, [w6, x6]); }; } }); var d3 = at({ label: { type: String, default: "" }, name: { type: [String, Number] }, closable: Boolean, disabled: Boolean, lazy: Boolean }); var vy = "ElTabPane"; var f3 = defineComponent({ name: vy }); var p3 = defineComponent({ ...f3, props: d3, setup(n) { const e = n, t = getCurrentInstance(), i = useSlots(), r = inject(uu); r || Xo(vy, "usage: "); const s = nt("tab-pane"), o = ref(), a6 = computed(() => e.closable || r.props.closable), c = Mp(() => { var g6; return r.currentName.value === ((g6 = e.name) != null ? g6 : o.value); }), l = ref(c.value), d = computed(() => { var g6; return (g6 = e.name) != null ? g6 : o.value; }), h6 = Mp(() => !e.lazy || l.value || c.value); watch(c, (g6) => { g6 && (l.value = true); }); const f6 = reactive({ uid: t.uid, slots: i, props: e, paneName: d, active: c, index: o, isClosable: a6 }); return r.registerPane(f6), onMounted(() => { r.sortPane(f6); }), onUnmounted(() => { r.unregisterPane(f6.uid); }), (g6, p) => unref(h6) ? withDirectives((openBlock(), createElementBlock("div", { key: 0, id: `pane-${unref(d)}`, class: normalizeClass(unref(s).b()), role: "tabpanel", "aria-hidden": !unref(c), "aria-labelledby": `tab-${unref(d)}` }, [ renderSlot(g6.$slots, "default") ], 10, ["id", "aria-hidden", "aria-labelledby"])), [ [vShow, unref(c)] ]) : createCommentVNode("v-if", true); } }); var yy = st(p3, [["__file", "tab-pane.vue"]]); var by = on2(h3, { TabPane: yy }); var xy = vi(yy); function m3(n) { let e; const t = ref(false), i = reactive({ ...n, originalPosition: "", originalOverflow: "", visible: false }); function r(f6) { i.text = f6; } function s() { const f6 = i.parent, g6 = h6.ns; if (!f6.vLoadingAddClassList) { let p = f6.getAttribute("loading-number"); p = Number.parseInt(p) - 1, p ? f6.setAttribute("loading-number", p.toString()) : (Oc(f6, g6.bm("parent", "relative")), f6.removeAttribute("loading-number")), Oc(f6, g6.bm("parent", "hidden")); } o(), d.unmount(); } function o() { var f6, g6; (g6 = (f6 = h6.$el) == null ? void 0 : f6.parentNode) == null || g6.removeChild(h6.$el); } function a6() { var f6; n.beforeClose && !n.beforeClose() || (t.value = true, clearTimeout(e), e = setTimeout(c, 400), i.visible = false, (f6 = n.closed) == null || f6.call(n)); } function c() { if (!t.value) return; const f6 = i.parent; t.value = false, f6.vLoadingAddClassList = void 0, s(); } const l = defineComponent({ name: "ElLoading", setup(f6, { expose: g6 }) { const { ns: p, zIndex: u6 } = zE("loading"); return g6({ ns: p, zIndex: u6 }), () => { const y6 = i.spinner || i.svg, v6 = h("svg", { class: "circular", viewBox: i.svgViewBox ? i.svgViewBox : "0 0 50 50", ...y6 ? { innerHTML: y6 } : {} }, [ h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), m6 = i.text ? h("p", { class: p.b("text") }, [i.text]) : void 0; return h(Transition, { name: p.b("fade"), onAfterLeave: c }, { default: withCtx(() => [ withDirectives(createVNode("div", { style: { backgroundColor: i.background || "" }, class: [ p.b("mask"), i.customClass, i.fullscreen ? "is-fullscreen" : "" ] }, [ h("div", { class: p.b("spinner") }, [v6, m6]) ]), [[vShow, i.visible]]) ]) }); }; } }), d = createApp(l), h6 = d.mount(document.createElement("div")); return { ...toRefs(i), setText: r, removeElLoadingChild: o, close: a6, handleAfterLeave: c, vm: h6, get $el() { return h6.$el; } }; } var Pl; var ed = function(n = {}) { if (!en2) return; const e = g3(n); if (e.fullscreen && Pl) return Pl; const t = m3({ ...e, closed: () => { var r; (r = e.closed) == null || r.call(e), e.fullscreen && (Pl = void 0); } }); v3(e, e.parent, t), Gm(e, e.parent, t), e.parent.vLoadingAddClassList = () => Gm(e, e.parent, t); let i = e.parent.getAttribute("loading-number"); return i ? i = `${Number.parseInt(i) + 1}` : i = "1", e.parent.setAttribute("loading-number", i), e.parent.appendChild(t.$el), nextTick(() => t.visible.value = e.visible), e.fullscreen && (Pl = t), t; }; var g3 = (n) => { var e, t, i, r; let s; return vn(n.target) ? s = (e = document.querySelector(n.target)) != null ? e : document.body : s = n.target || document.body, { parent: s === document.body || n.body ? document.body : s, background: n.background || "", svg: n.svg || "", svgViewBox: n.svgViewBox || "", spinner: n.spinner || false, text: n.text || "", fullscreen: s === document.body && ((t = n.fullscreen) != null ? t : true), lock: (i = n.lock) != null ? i : false, customClass: n.customClass || "", visible: (r = n.visible) != null ? r : true, beforeClose: n.beforeClose, closed: n.closed, target: s }; }; var v3 = async (n, e, t) => { const { nextZIndex: i } = t.vm.zIndex || t.vm._.exposed.zIndex, r = {}; if (n.fullscreen) t.originalPosition.value = ca(document.body, "position"), t.originalOverflow.value = ca(document.body, "overflow"), r.zIndex = i(); else if (n.parent === document.body) { t.originalPosition.value = ca(document.body, "position"), await nextTick(); for (const s of ["top", "left"]) { const o = s === "top" ? "scrollTop" : "scrollLeft"; r[s] = `${n.target.getBoundingClientRect()[s] + document.body[o] + document.documentElement[o] - Number.parseInt(ca(document.body, `margin-${s}`), 10)}px`; } for (const s of ["height", "width"]) r[s] = `${n.target.getBoundingClientRect()[s]}px`; } else t.originalPosition.value = ca(e, "position"); for (const [s, o] of Object.entries(r)) t.$el.style[s] = o; }; var Gm = (n, e, t) => { const i = t.vm.ns || t.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(t.originalPosition.value) ? Oc(e, i.bm("parent", "relative")) : sm(e, i.bm("parent", "relative")), n.fullscreen && n.lock ? sm(e, i.bm("parent", "hidden")) : Oc(e, i.bm("parent", "hidden")); }; var Ec = Symbol("ElLoading"); var Hm = (n, e) => { var t, i, r, s; const o = e.instance, a6 = (f6) => Tn(e.value) ? e.value[f6] : void 0, c = (f6) => { const g6 = vn(f6) && (o == null ? void 0 : o[f6]) || f6; return g6 && ref(g6); }, l = (f6) => c(a6(f6) || n.getAttribute(`element-loading-${Vw(f6)}`)), d = (t = a6("fullscreen")) != null ? t : e.modifiers.fullscreen, h6 = { text: l("text"), svg: l("svg"), svgViewBox: l("svgViewBox"), spinner: l("spinner"), background: l("background"), customClass: l("customClass"), fullscreen: d, target: (i = a6("target")) != null ? i : d ? void 0 : n, body: (r = a6("body")) != null ? r : e.modifiers.body, lock: (s = a6("lock")) != null ? s : e.modifiers.lock }; n[Ec] = { options: h6, instance: ed(h6) }; }; var y3 = (n, e) => { for (const t of Object.keys(e)) isRef(e[t]) && (e[t].value = n[t]); }; var td = { mounted(n, e) { e.value && Hm(n, e); }, updated(n, e) { const t = n[Ec]; e.oldValue !== e.value && (e.value && !e.oldValue ? Hm(n, e) : e.value && e.oldValue ? Tn(e.value) && y3(e.value, t.options) : t == null || t.instance.close()); }, unmounted(n) { var e; (e = n[Ec]) == null || e.instance.close(), n[Ec] = null; } }; var b3 = { install(n) { n.directive("loading", td), n.config.globalProperties.$loading = ed; }, directive: td, service: ed }; var ki = (n, e) => { const t = n.__vccOpts || n; for (const [i, r] of e) t[i] = r; return t; }; var x3 = [ { position: "top", mode: "vertical", text: "Begin interaction here to rotate on the x-axis" }, { position: "bottom", mode: "vertical", text: "Begin interaction here to rotate on the x-axis" }, { position: "left", mode: "horizontal", text: "Begin interaction here to rotate on the y-axis" }, { position: "right", mode: "horizontal", text: "Begin interaction here to rotate on the y-axis" } ]; var M3 = { name: "ScaffoldOverlay", data: function() { return { lockRotationMode: false, touchActive: false, rotationOverlays: x3 }; }, props: { /** * Experimental feature to restrict rotation at * one-axis based on position of the initial click */ positionalRotation: { type: Boolean, default: false } }, methods: { contentMouseActive: function(n, e) { if (this.positionalRotation) { const t = this.$refs.topLayer; t && (e ? (this.lockRotationMode = true, t.style.pointerEvents = "none", n.type === "touchstart" && (this.touchActive = true)) : (this.lockRotationMode = false, this.setRotationMode(void 0, "free"), t.style.pointerEvents = "auto", n.type === "touchend" && (this.touchActive = false))); } }, setRotationMode: function(n, e) { this.lockRotationMode || this.$emit("onRotationModeChange", e), n && (n.preventDefault(), n.stopPropagation()); }, skipWhenInBound: function(n) { if (this.positionalRotation) { const e = this.$refs.topLayer, t = this.$refs.contentLayer; if (e && t) { const i = e.style.pointerEvents; e.style.pointerEvents = "none"; const r = document.elementFromPoint(n.clientX, n.clientY); e.style.pointerEvents = i, t.contains(r) && n.stopPropagation(); } } }, forwardEvent: function(n) { const e = this.$refs.topLayer; if (!e) return; const t = e.style.pointerEvents; e.style.pointerEvents = "none"; const i = document.elementFromPoint(n.clientX, n.clientY); if (e.style.pointerEvents = t, i) { const r = new MouseEvent( n.type, { bubbles: n.bubbles, cancelable: n.cancelable, view: n.view, clientX: n.clientX, clientY: n.clientY, button: n.button } ); i.dispatchEvent(r), n.stopPropagation(); } n.preventDefault(); }, forwardTouchEvent: function(n) { const e = this.$refs.topLayer; if (!e) return; const t = e.style.pointerEvents; e.style.pointerEvents = "none"; const i = n.changedTouches[0], r = i.clientX, s = i.clientY, o = document.elementFromPoint(r, s); if (e.style.pointerEvents = t, o) { const a6 = new Touch({ identifier: i.identifier, target: o, clientX: i.clientX, clientY: i.clientY, pageX: i.pageX, pageY: i.pageY, screenX: i.screenX, screenY: i.screenY, radiusX: i.radiusX, radiusY: i.radiusY, rotationAngle: i.rotationAngle, force: i.force }), c = new TouchEvent( n.type, { bubbles: n.bubbles, cancelable: n.cancelable, composed: true, view: n.view, touches: [a6], targetTouches: [a6], changedTouches: [a6] } ); o.dispatchEvent(c), n.stopPropagation(); } n.preventDefault(); } } }; var w3 = { ref: "overlay" }; var A3 = ["onMousedown", "onTouchstart"]; function S3(n, e, t, i, r, s) { return openBlock(), createElementBlock("div", w3, [ createBaseVNode("div", { class: "content-layer", ref: "contentLayer", onMouseleaveCapture: e[0] || (e[0] = (...o) => s.skipWhenInBound && s.skipWhenInBound(...o)), onMousedownCapture: e[1] || (e[1] = (o) => s.contentMouseActive(o, true)), onMouseupCapture: e[2] || (e[2] = (o) => s.contentMouseActive(o, false)), onTouchstartCapture: e[3] || (e[3] = (o) => s.contentMouseActive(o, true)), onTouchendCapture: e[4] || (e[4] = (o) => s.contentMouseActive(o, false)) }, [ renderSlot(n.$slots, "default", {}, void 0, true) ], 544), t.positionalRotation ? (openBlock(), createElementBlock("div", { key: 0, ref: "topLayer", onMousemoveCapture: e[7] || (e[7] = (...o) => s.forwardEvent && s.forwardEvent(...o)), onMouseoverCapture: e[8] || (e[8] = (...o) => s.forwardEvent && s.forwardEvent(...o)), onTouchmoveCapture: e[9] || (e[9] = (...o) => s.forwardTouchEvent && s.forwardTouchEvent(...o)), onClickCapture: e[10] || (e[10] = (...o) => s.forwardEvent && s.forwardEvent(...o)) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.rotationOverlays, (o) => (openBlock(), createElementBlock("div", { key: o.position, class: normalizeClass(["rotation-overlay", o.position, n.touchActive ? "touch-active" : ""]), onMousedown: (a6) => { s.setRotationMode(a6, o.mode), s.forwardEvent(a6); }, onMouseup: e[5] || (e[5] = (...a6) => s.forwardEvent && s.forwardEvent(...a6)), onTouchstart: (a6) => { s.setRotationMode(a6, o.mode), s.forwardTouchEvent(a6); }, onTouchend: e[6] || (e[6] = (...a6) => s.forwardTouchEvent && s.forwardTouchEvent(...a6)) }, [ createBaseVNode("span", null, toDisplayString(o.text), 1) ], 42, A3))), 128)) ], 544)) : createCommentVNode("", true) ], 512); } var My = ki(M3, [["render", S3], ["__scopeId", "data-v-24f88254"]]); var wy = { exports: {} }; var Wm = {}; var jm; function _3() { return jm || (jm = 1, function(n) { var e = function() { try { return !!Symbol.iterator; } catch { return false; } }, t = e(), i = function(l) { var d = { next: function() { var h6 = l.shift(); return { done: h6 === void 0, value: h6 }; } }; return t && (d[Symbol.iterator] = function() { return d; }), d; }, r = function(l) { return encodeURIComponent(l).replace(/%20/g, "+"); }, s = function(l) { return decodeURIComponent(String(l).replace(/\+/g, " ")); }, o = function() { var l = function(h6) { Object.defineProperty(this, "_entries", { writable: true, value: {} }); var f6 = typeof h6; if (f6 !== "undefined") if (f6 === "string") h6 !== "" && this._fromString(h6); else if (h6 instanceof l) { var g6 = this; h6.forEach(function(v6, m6) { g6.append(m6, v6); }); } else if (h6 !== null && f6 === "object") if (Object.prototype.toString.call(h6) === "[object Array]") for (var p = 0; p < h6.length; p++) { var u6 = h6[p]; if (Object.prototype.toString.call(u6) === "[object Array]" || u6.length !== 2) this.append(u6[0], u6[1]); else throw new TypeError("Expected [string, any] as entry at index " + p + " of URLSearchParams's input"); } else for (var y6 in h6) h6.hasOwnProperty(y6) && this.append(y6, h6[y6]); else throw new TypeError("Unsupported input's type for URLSearchParams"); }, d = l.prototype; d.append = function(h6, f6) { h6 in this._entries ? this._entries[h6].push(String(f6)) : this._entries[h6] = [String(f6)]; }, d.delete = function(h6) { delete this._entries[h6]; }, d.get = function(h6) { return h6 in this._entries ? this._entries[h6][0] : null; }, d.getAll = function(h6) { return h6 in this._entries ? this._entries[h6].slice(0) : []; }, d.has = function(h6) { return h6 in this._entries; }, d.set = function(h6, f6) { this._entries[h6] = [String(f6)]; }, d.forEach = function(h6, f6) { var g6; for (var p in this._entries) if (this._entries.hasOwnProperty(p)) { g6 = this._entries[p]; for (var u6 = 0; u6 < g6.length; u6++) h6.call(f6, g6[u6], p, this); } }, d.keys = function() { var h6 = []; return this.forEach(function(f6, g6) { h6.push(g6); }), i(h6); }, d.values = function() { var h6 = []; return this.forEach(function(f6) { h6.push(f6); }), i(h6); }, d.entries = function() { var h6 = []; return this.forEach(function(f6, g6) { h6.push([g6, f6]); }), i(h6); }, t && (d[Symbol.iterator] = d.entries), d.toString = function() { var h6 = []; return this.forEach(function(f6, g6) { h6.push(r(g6) + "=" + r(f6)); }), h6.join("&"); }, n.URLSearchParams = l; }, a6 = function() { try { var l = n.URLSearchParams; return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function"; } catch { return false; } }; a6() || o(); var c = n.URLSearchParams.prototype; typeof c.sort != "function" && (c.sort = function() { var l = this, d = []; this.forEach(function(f6, g6) { d.push([g6, f6]), l._entries || l.delete(g6); }), d.sort(function(f6, g6) { return f6[0] < g6[0] ? -1 : f6[0] > g6[0] ? 1 : 0; }), l._entries && (l._entries = {}); for (var h6 = 0; h6 < d.length; h6++) this.append(d[h6][0], d[h6][1]); }), typeof c._fromString != "function" && Object.defineProperty(c, "_fromString", { enumerable: false, configurable: false, writable: false, value: function(l) { if (this._entries) this._entries = {}; else { var d = []; this.forEach(function(p, u6) { d.push(u6); }); for (var h6 = 0; h6 < d.length; h6++) this.delete(d[h6]); } l = l.replace(/^\?/, ""); for (var f6 = l.split("&"), g6, h6 = 0; h6 < f6.length; h6++) g6 = f6[h6].split("="), this.append( s(g6[0]), g6.length > 1 ? s(g6[1]) : "" ); } }); }( typeof Lr < "u" ? Lr : typeof window < "u" ? window : typeof self < "u" ? self : Lr ), function(n) { var e = function() { try { var r = new n.URL("b", "http://a"); return r.pathname = "c d", r.href === "http://a/c%20d" && r.searchParams; } catch { return false; } }, t = function() { var r = n.URL, s = function(c, l) { typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l)); var d = document, h6; if (l && (n.location === void 0 || l !== n.location.href)) { l = l.toLowerCase(), d = document.implementation.createHTMLDocument(""), h6 = d.createElement("base"), h6.href = l, d.head.appendChild(h6); try { if (h6.href.indexOf(l) !== 0) throw new Error(h6.href); } catch (x6) { throw new Error("URL unable to set base " + l + " due to " + x6); } } var f6 = d.createElement("a"); f6.href = c, h6 && (d.body.appendChild(f6), f6.href = f6.href); var g6 = d.createElement("input"); if (g6.type = "url", g6.value = c, f6.protocol === ":" || !/:/.test(f6.href) || !g6.checkValidity() && !l) throw new TypeError("Invalid URL"); Object.defineProperty(this, "_anchorElement", { value: f6 }); var p = new n.URLSearchParams(this.search), u6 = true, y6 = true, v6 = this; ["append", "delete", "set"].forEach(function(x6) { var w6 = p[x6]; p[x6] = function() { w6.apply(p, arguments), u6 && (y6 = false, v6.search = p.toString(), y6 = true); }; }), Object.defineProperty(this, "searchParams", { value: p, enumerable: true }); var m6 = void 0; Object.defineProperty(this, "_updateSearchParams", { enumerable: false, configurable: false, writable: false, value: function() { this.search !== m6 && (m6 = this.search, y6 && (u6 = false, this.searchParams._fromString(this.search), u6 = true)); } }); }, o = s.prototype, a6 = function(c) { Object.defineProperty(o, c, { get: function() { return this._anchorElement[c]; }, set: function(l) { this._anchorElement[c] = l; }, enumerable: true }); }; ["hash", "host", "hostname", "port", "protocol"].forEach(function(c) { a6(c); }), Object.defineProperty(o, "search", { get: function() { return this._anchorElement.search; }, set: function(c) { this._anchorElement.search = c, this._updateSearchParams(); }, enumerable: true }), Object.defineProperties(o, { toString: { get: function() { var c = this; return function() { return c.href; }; } }, href: { get: function() { return this._anchorElement.href.replace(/\?$/, ""); }, set: function(c) { this._anchorElement.href = c, this._updateSearchParams(); }, enumerable: true }, pathname: { get: function() { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function(c) { this._anchorElement.pathname = c; }, enumerable: true }, origin: { get: function() { var c = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol], l = this._anchorElement.port != c && this._anchorElement.port !== ""; return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (l ? ":" + this._anchorElement.port : ""); }, enumerable: true }, password: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: true }, username: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: true } }), s.createObjectURL = function(c) { return r.createObjectURL.apply(r, arguments); }, s.revokeObjectURL = function(c) { return r.revokeObjectURL.apply(r, arguments); }, n.URL = s; }; if (e() || t(), n.location !== void 0 && !("origin" in n.location)) { var i = function() { return n.location.protocol + "//" + n.location.hostname + (n.location.port ? ":" + n.location.port : ""); }; try { Object.defineProperty(n.location, "origin", { get: i, enumerable: true }); } catch { setInterval(function() { n.location.origin = i(); }, 100); } } }( typeof Lr < "u" ? Lr : typeof window < "u" ? window : typeof self < "u" ? self : Lr )), Wm; } var gf = "130"; var T3 = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; var E3 = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; var Ay = 0; var nd = 1; var Sy = 2; var C3 = 3; var L3 = 0; var vf = 1; var _y = 2; var po = 3; var Hr = 0; var jt = 1; var Wr = 2; var yf = 1; var R3 = 2; var nr = 0; var vo = 1; var id = 2; var rd = 3; var sd = 4; var Ty = 5; var ps = 100; var Ey = 101; var Cy = 102; var od = 103; var ad = 104; var Ly = 200; var Ry = 201; var Fy = 202; var Py = 203; var bf = 204; var xf = 205; var Iy = 206; var Oy = 207; var Dy = 208; var Ny = 209; var By = 210; var Uy = 0; var zy = 1; var ky = 2; var kc = 3; var Vy = 4; var Gy = 5; var Hy = 6; var Wy = 7; var al = 0; var jy = 1; var $y = 2; var Ir = 0; var Zy = 1; var Xy = 2; var Yy = 3; var Jy = 4; var Ky = 5; var hu = 300; var ll = 301; var cl = 302; var Vc = 303; var Gc = 304; var ea = 306; var ul = 307; var jr = 1e3; var hn2 = 1001; var Eo = 1002; var $t = 1003; var Va = 1004; var F3 = 1004; var Ga = 1005; var P3 = 1005; var zt = 1006; var du = 1007; var I3 = 1007; var pr = 1008; var O3 = 1008; var Ts = 1009; var qy = 1010; var Qy = 1011; var Ha = 1012; var eb = 1013; var Ra = 1014; var Qi = 1015; var Ms = 1016; var tb = 1017; var nb = 1018; var ib = 1019; var yo = 1020; var rb = 1021; var ir = 1022; var Hn = 1023; var sb = 1024; var ob = 1025; var ab = Hn; var ws = 1026; var Co = 1027; var lb = 1028; var cb = 1029; var ub = 1030; var hb = 1031; var db = 1032; var fb = 1033; var ld = 33776; var cd = 33777; var ud = 33778; var hd = 33779; var dd = 35840; var fd = 35841; var pd = 35842; var md = 35843; var pb = 36196; var gd = 37492; var vd = 37496; var mb = 37808; var gb = 37809; var vb = 37810; var yb = 37811; var bb = 37812; var xb = 37813; var Mb = 37814; var wb = 37815; var Ab = 37816; var Sb = 37817; var _b = 37818; var Tb = 37819; var Eb = 37820; var Cb = 37821; var Lb = 36492; var Rb = 37840; var Fb = 37841; var Pb = 37842; var Ib = 37843; var Ob = 37844; var Db = 37845; var Nb = 37846; var Bb = 37847; var Ub = 37848; var zb = 37849; var kb = 37850; var Vb = 37851; var Gb = 37852; var Hb = 37853; var Wb = 2200; var jb = 2201; var $b = 2202; var Lo = 2300; var Es = 2301; var Cc = 2302; var gs = 2400; var vs = 2401; var Wa = 2402; var fu = 2500; var Mf = 2501; var Zb = 0; var Xb = 1; var wf = 2; var Cn = 3e3; var Cs = 3001; var pu = 3007; var mu = 3002; var Yb = 3003; var Af = 3004; var Sf = 3005; var _f = 3006; var Jb = 3200; var Kb = 3201; var Jr = 0; var qb = 1; var D3 = 0; var Lc = 7680; var N3 = 7681; var B3 = 7682; var U3 = 7683; var z3 = 34055; var k3 = 34056; var V3 = 5386; var G3 = 512; var H3 = 513; var W3 = 514; var j3 = 515; var $3 = 516; var Z3 = 517; var X3 = 518; var Qb = 519; var Ro = 35044; var Fo = 35048; var Y3 = 35040; var J3 = 35045; var K3 = 35049; var q3 = 35041; var Q3 = 35046; var eF = 35050; var tF = 35042; var nF = "100"; var yd = "300 es"; var Kr = class { addEventListener(e, t) { this._listeners === void 0 && (this._listeners = {}); const i = this._listeners; i[e] === void 0 && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t); } hasEventListener(e, t) { if (this._listeners === void 0) return false; const i = this._listeners; return i[e] !== void 0 && i[e].indexOf(t) !== -1; } removeEventListener(e, t) { if (this._listeners === void 0) return; const r = this._listeners[e]; if (r !== void 0) { const s = r.indexOf(t); s !== -1 && r.splice(s, 1); } } dispatchEvent(e) { if (this._listeners === void 0) return; const i = this._listeners[e.type]; if (i !== void 0) { e.target = this; const r = i.slice(0); for (let s = 0, o = r.length; s < o; s++) r[s].call(this, e); e.target = null; } } }; var fn = []; for (let n = 0; n < 256; n++) fn[n] = (n < 16 ? "0" : "") + n.toString(16); var Il = 1234567; var As = Math.PI / 180; var ja = 180 / Math.PI; function Wn() { const n = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, i = Math.random() * 4294967295 | 0; return (fn[n & 255] + fn[n >> 8 & 255] + fn[n >> 16 & 255] + fn[n >> 24 & 255] + "-" + fn[e & 255] + fn[e >> 8 & 255] + "-" + fn[e >> 16 & 15 | 64] + fn[e >> 24 & 255] + "-" + fn[t & 63 | 128] + fn[t >> 8 & 255] + "-" + fn[t >> 16 & 255] + fn[t >> 24 & 255] + fn[i & 255] + fn[i >> 8 & 255] + fn[i >> 16 & 255] + fn[i >> 24 & 255]).toUpperCase(); } function gn2(n, e, t) { return Math.max(e, Math.min(t, n)); } function Tf(n, e) { return (n % e + e) % e; } function iF(n, e, t, i, r) { return i + (n - e) * (r - i) / (t - e); } function rF(n, e, t) { return n !== e ? (t - n) / (e - n) : 0; } function Fa(n, e, t) { return (1 - t) * n + t * e; } function sF(n, e, t, i) { return Fa(n, e, 1 - Math.exp(-t * i)); } function oF(n, e = 1) { return e - Math.abs(Tf(n, e * 2) - e); } function aF(n, e, t) { return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * (3 - 2 * n)); } function lF(n, e, t) { return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * n * (n * (n * 6 - 15) + 10)); } function cF(n, e) { return n + Math.floor(Math.random() * (e - n + 1)); } function uF(n, e) { return n + Math.random() * (e - n); } function hF(n) { return n * (0.5 - Math.random()); } function dF(n) { return n !== void 0 && (Il = n % 2147483647), Il = Il * 16807 % 2147483647, (Il - 1) / 2147483646; } function fF(n) { return n * As; } function pF(n) { return n * ja; } function bd(n) { return (n & n - 1) === 0 && n !== 0; } function ex(n) { return Math.pow(2, Math.ceil(Math.log(n) / Math.LN2)); } function tx(n) { return Math.pow(2, Math.floor(Math.log(n) / Math.LN2)); } function mF(n, e, t, i, r) { const s = Math.cos, o = Math.sin, a6 = s(t / 2), c = o(t / 2), l = s((e + i) / 2), d = o((e + i) / 2), h6 = s((e - i) / 2), f6 = o((e - i) / 2), g6 = s((i - e) / 2), p = o((i - e) / 2); switch (r) { case "XYX": n.set(a6 * d, c * h6, c * f6, a6 * l); break; case "YZY": n.set(c * f6, a6 * d, c * h6, a6 * l); break; case "ZXZ": n.set(c * h6, c * f6, a6 * d, a6 * l); break; case "XZX": n.set(a6 * d, c * p, c * g6, a6 * l); break; case "YXY": n.set(c * g6, a6 * d, c * p, a6 * l); break; case "ZYZ": n.set(c * p, c * g6, a6 * d, a6 * l); break; default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + r); } } var xd = Object.freeze({ __proto__: null, DEG2RAD: As, RAD2DEG: ja, generateUUID: Wn, clamp: gn2, euclideanModulo: Tf, mapLinear: iF, inverseLerp: rF, lerp: Fa, damp: sF, pingpong: oF, smoothstep: aF, smootherstep: lF, randInt: cF, randFloat: uF, randFloatSpread: hF, seededRandom: dF, degToRad: fF, radToDeg: pF, isPowerOfTwo: bd, ceilPowerOfTwo: ex, floorPowerOfTwo: tx, setQuaternionFromProperEuler: mF }); var Re = class { constructor(e = 0, t = 0) { this.x = e, this.y = t; } get width() { return this.x; } set width(e) { this.x = e; } get height() { return this.y; } set height(e) { this.y = e; } set(e, t) { return this.x = e, this.y = t, this; } setScalar(e) { return this.x = e, this.y = e, this; } setX(e) { return this.x = e, this; } setY(e) { return this.y = e, this; } setComponent(e, t) { switch (e) { case 0: this.x = t; break; case 1: this.y = t; break; default: throw new Error("index is out of range: " + e); } return this; } getComponent(e) { switch (e) { case 0: return this.x; case 1: return this.y; default: throw new Error("index is out of range: " + e); } } clone() { return new this.constructor(this.x, this.y); } copy(e) { return this.x = e.x, this.y = e.y, this; } add(e, t) { return t !== void 0 ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this); } addScalar(e) { return this.x += e, this.y += e, this; } addVectors(e, t) { return this.x = e.x + t.x, this.y = e.y + t.y, this; } addScaledVector(e, t) { return this.x += e.x * t, this.y += e.y * t, this; } sub(e, t) { return t !== void 0 ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this); } subScalar(e) { return this.x -= e, this.y -= e, this; } subVectors(e, t) { return this.x = e.x - t.x, this.y = e.y - t.y, this; } multiply(e) { return this.x *= e.x, this.y *= e.y, this; } multiplyScalar(e) { return this.x *= e, this.y *= e, this; } divide(e) { return this.x /= e.x, this.y /= e.y, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } applyMatrix3(e) { const t = this.x, i = this.y, r = e.elements; return this.x = r[0] * t + r[3] * i + r[6], this.y = r[1] * t + r[4] * i + r[7], this; } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this; } max(e) { return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this; } clamp(e, t) { return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this; } clampScalar(e, t) { return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this; } clampLength(e, t) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i))); } floor() { return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this; } ceil() { return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this; } round() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this; } roundToZero() { return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this; } negate() { return this.x = -this.x, this.y = -this.y, this; } dot(e) { return this.x * e.x + this.y * e.y; } cross(e) { return this.x * e.y - this.y * e.x; } lengthSq() { return this.x * this.x + this.y * this.y; } length() { return Math.sqrt(this.x * this.x + this.y * this.y); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y); } normalize() { return this.divideScalar(this.length() || 1); } angle() { return Math.atan2(-this.y, -this.x) + Math.PI; } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const t = this.x - e.x, i = this.y - e.y; return t * t + i * i; } manhattanDistanceTo(e) { return Math.abs(this.x - e.x) + Math.abs(this.y - e.y); } setLength(e) { return this.normalize().multiplyScalar(e); } lerp(e, t) { return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this; } lerpVectors(e, t, i) { return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this; } equals(e) { return e.x === this.x && e.y === this.y; } fromArray(e, t = 0) { return this.x = e[t], this.y = e[t + 1], this; } toArray(e = [], t = 0) { return e[t] = this.x, e[t + 1] = this.y, e; } fromBufferAttribute(e, t, i) { return i !== void 0 && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this; } rotateAround(e, t) { const i = Math.cos(t), r = Math.sin(t), s = this.x - e.x, o = this.y - e.y; return this.x = s * i - o * r + e.x, this.y = s * r + o * i + e.y, this; } random() { return this.x = Math.random(), this.y = Math.random(), this; } }; Re.prototype.isVector2 = true; var rn2 = class { constructor() { this.elements = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ], arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead."); } set(e, t, i, r, s, o, a6, c, l) { const d = this.elements; return d[0] = e, d[1] = r, d[2] = a6, d[3] = t, d[4] = s, d[5] = c, d[6] = i, d[7] = o, d[8] = l, this; } identity() { return this.set( 1, 0, 0, 0, 1, 0, 0, 0, 1 ), this; } copy(e) { const t = this.elements, i = e.elements; return t[0] = i[0], t[1] = i[1], t[2] = i[2], t[3] = i[3], t[4] = i[4], t[5] = i[5], t[6] = i[6], t[7] = i[7], t[8] = i[8], this; } extractBasis(e, t, i) { return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), i.setFromMatrix3Column(this, 2), this; } setFromMatrix4(e) { const t = e.elements; return this.set( t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10] ), this; } multiply(e) { return this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t) { const i = e.elements, r = t.elements, s = this.elements, o = i[0], a6 = i[3], c = i[6], l = i[1], d = i[4], h6 = i[7], f6 = i[2], g6 = i[5], p = i[8], u6 = r[0], y6 = r[3], v6 = r[6], m6 = r[1], x6 = r[4], w6 = r[7], A6 = r[2], M6 = r[5], R6 = r[8]; return s[0] = o * u6 + a6 * m6 + c * A6, s[3] = o * y6 + a6 * x6 + c * M6, s[6] = o * v6 + a6 * w6 + c * R6, s[1] = l * u6 + d * m6 + h6 * A6, s[4] = l * y6 + d * x6 + h6 * M6, s[7] = l * v6 + d * w6 + h6 * R6, s[2] = f6 * u6 + g6 * m6 + p * A6, s[5] = f6 * y6 + g6 * x6 + p * M6, s[8] = f6 * v6 + g6 * w6 + p * R6, this; } multiplyScalar(e) { const t = this.elements; return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this; } determinant() { const e = this.elements, t = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a6 = e[5], c = e[6], l = e[7], d = e[8]; return t * o * d - t * a6 * l - i * s * d + i * a6 * c + r * s * l - r * o * c; } invert() { const e = this.elements, t = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a6 = e[5], c = e[6], l = e[7], d = e[8], h6 = d * o - a6 * l, f6 = a6 * c - d * s, g6 = l * s - o * c, p = t * h6 + i * f6 + r * g6; if (p === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); const u6 = 1 / p; return e[0] = h6 * u6, e[1] = (r * l - d * i) * u6, e[2] = (a6 * i - r * o) * u6, e[3] = f6 * u6, e[4] = (d * t - r * c) * u6, e[5] = (r * s - a6 * t) * u6, e[6] = g6 * u6, e[7] = (i * c - l * t) * u6, e[8] = (o * t - i * s) * u6, this; } transpose() { let e; const t = this.elements; return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this; } getNormalMatrix(e) { return this.setFromMatrix4(e).invert().transpose(); } transposeIntoArray(e) { const t = this.elements; return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this; } setUvTransform(e, t, i, r, s, o, a6) { const c = Math.cos(s), l = Math.sin(s); return this.set( i * c, i * l, -i * (c * o + l * a6) + o + e, -r * l, r * c, -r * (-l * o + c * a6) + a6 + t, 0, 0, 1 ), this; } scale(e, t) { const i = this.elements; return i[0] *= e, i[3] *= e, i[6] *= e, i[1] *= t, i[4] *= t, i[7] *= t, this; } rotate(e) { const t = Math.cos(e), i = Math.sin(e), r = this.elements, s = r[0], o = r[3], a6 = r[6], c = r[1], l = r[4], d = r[7]; return r[0] = t * s + i * c, r[3] = t * o + i * l, r[6] = t * a6 + i * d, r[1] = -i * s + t * c, r[4] = -i * o + t * l, r[7] = -i * a6 + t * d, this; } translate(e, t) { const i = this.elements; return i[0] += e * i[2], i[3] += e * i[5], i[6] += e * i[8], i[1] += t * i[2], i[4] += t * i[5], i[7] += t * i[8], this; } equals(e) { const t = this.elements, i = e.elements; for (let r = 0; r < 9; r++) if (t[r] !== i[r]) return false; return true; } fromArray(e, t = 0) { for (let i = 0; i < 9; i++) this.elements[i] = e[i + t]; return this; } toArray(e = [], t = 0) { const i = this.elements; return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e; } clone() { return new this.constructor().fromArray(this.elements); } }; rn2.prototype.isMatrix3 = true; var js; var Bs = class { static getDataURL(e) { if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u") return e.src; let t; if (e instanceof HTMLCanvasElement) t = e; else { js === void 0 && (js = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), js.width = e.width, js.height = e.height; const i = js.getContext("2d"); e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height), t = js; } return t.width > 2048 || t.height > 2048 ? (console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", e), t.toDataURL("image/jpeg", 0.6)) : t.toDataURL("image/png"); } }; var gF = 0; var Yt = class _Yt extends Kr { constructor(e = _Yt.DEFAULT_IMAGE, t = _Yt.DEFAULT_MAPPING, i = hn2, r = hn2, s = zt, o = pr, a6 = Hn, c = Ts, l = 1, d = Cn) { super(), Object.defineProperty(this, "id", { value: gF++ }), this.uuid = Wn(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = t, this.wrapS = i, this.wrapT = r, this.magFilter = s, this.minFilter = o, this.anisotropy = l, this.format = a6, this.internalFormat = null, this.type = c, this.offset = new Re(0, 0), this.repeat = new Re(1, 1), this.center = new Re(0, 0), this.rotation = 0, this.matrixAutoUpdate = true, this.matrix = new rn2(), this.generateMipmaps = true, this.premultiplyAlpha = false, this.flipY = true, this.unpackAlignment = 4, this.encoding = d, this.version = 0, this.onUpdate = null; } updateMatrix() { this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y); } clone() { return new this.constructor().copy(this); } copy(e) { return this.name = e.name, this.image = e.image, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, this.wrapS = e.wrapS, this.wrapT = e.wrapT, this.magFilter = e.magFilter, this.minFilter = e.minFilter, this.anisotropy = e.anisotropy, this.format = e.format, this.internalFormat = e.internalFormat, this.type = e.type, this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.center.copy(e.center), this.rotation = e.rotation, this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrix.copy(e.matrix), this.generateMipmaps = e.generateMipmaps, this.premultiplyAlpha = e.premultiplyAlpha, this.flipY = e.flipY, this.unpackAlignment = e.unpackAlignment, this.encoding = e.encoding, this; } toJSON(e) { const t = e === void 0 || typeof e == "string"; if (!t && e.textures[this.uuid] !== void 0) return e.textures[this.uuid]; const i = { metadata: { version: 4.5, type: "Texture", generator: "Texture.toJSON" }, uuid: this.uuid, name: this.name, mapping: this.mapping, repeat: [this.repeat.x, this.repeat.y], offset: [this.offset.x, this.offset.y], center: [this.center.x, this.center.y], rotation: this.rotation, wrap: [this.wrapS, this.wrapT], format: this.format, type: this.type, encoding: this.encoding, minFilter: this.minFilter, magFilter: this.magFilter, anisotropy: this.anisotropy, flipY: this.flipY, premultiplyAlpha: this.premultiplyAlpha, unpackAlignment: this.unpackAlignment }; if (this.image !== void 0) { const r = this.image; if (r.uuid === void 0 && (r.uuid = Wn()), !t && e.images[r.uuid] === void 0) { let s; if (Array.isArray(r)) { s = []; for (let o = 0, a6 = r.length; o < a6; o++) r[o].isDataTexture ? s.push($u(r[o].image)) : s.push($u(r[o])); } else s = $u(r); e.images[r.uuid] = { uuid: r.uuid, url: s }; } i.image = r.uuid; } return t || (e.textures[this.uuid] = i), i; } dispose() { this.dispatchEvent({ type: "dispose" }); } transformUv(e) { if (this.mapping !== hu) return e; if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) { case jr: e.x = e.x - Math.floor(e.x); break; case hn2: e.x = e.x < 0 ? 0 : 1; break; case Eo: Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x); break; } if (e.y < 0 || e.y > 1) switch (this.wrapT) { case jr: e.y = e.y - Math.floor(e.y); break; case hn2: e.y = e.y < 0 ? 0 : 1; break; case Eo: Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y); break; } return this.flipY && (e.y = 1 - e.y), e; } set needsUpdate(e) { e === true && this.version++; } }; Yt.DEFAULT_IMAGE = void 0; Yt.DEFAULT_MAPPING = hu; Yt.prototype.isTexture = true; function $u(n) { return typeof HTMLImageElement < "u" && n instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && n instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && n instanceof ImageBitmap ? Bs.getDataURL(n) : n.data ? { data: Array.prototype.slice.call(n.data), width: n.width, height: n.height, type: n.data.constructor.name } : (console.warn("THREE.Texture: Unable to serialize Texture."), {}); } var xt = class { constructor(e = 0, t = 0, i = 0, r = 1) { this.x = e, this.y = t, this.z = i, this.w = r; } get width() { return this.z; } set width(e) { this.z = e; } get height() { return this.w; } set height(e) { this.w = e; } set(e, t, i, r) { return this.x = e, this.y = t, this.z = i, this.w = r, this; } setScalar(e) { return this.x = e, this.y = e, this.z = e, this.w = e, this; } setX(e) { return this.x = e, this; } setY(e) { return this.y = e, this; } setZ(e) { return this.z = e, this; } setW(e) { return this.w = e, this; } setComponent(e, t) { switch (e) { case 0: this.x = t; break; case 1: this.y = t; break; case 2: this.z = t; break; case 3: this.w = t; break; default: throw new Error("index is out of range: " + e); } return this; } getComponent(e) { switch (e) { case 0: return this.x; case 1: return this.y; case 2: return this.z; case 3: return this.w; default: throw new Error("index is out of range: " + e); } } clone() { return new this.constructor(this.x, this.y, this.z, this.w); } copy(e) { return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w !== void 0 ? e.w : 1, this; } add(e, t) { return t !== void 0 ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this); } addScalar(e) { return this.x += e, this.y += e, this.z += e, this.w += e, this; } addVectors(e, t) { return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this; } addScaledVector(e, t) { return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this; } sub(e, t) { return t !== void 0 ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this); } subScalar(e) { return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this; } subVectors(e, t) { return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this; } multiply(e) { return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this; } multiplyScalar(e) { return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this; } applyMatrix4(e) { const t = this.x, i = this.y, r = this.z, s = this.w, o = e.elements; return this.x = o[0] * t + o[4] * i + o[8] * r + o[12] * s, this.y = o[1] * t + o[5] * i + o[9] * r + o[13] * s, this.z = o[2] * t + o[6] * i + o[10] * r + o[14] * s, this.w = o[3] * t + o[7] * i + o[11] * r + o[15] * s, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } setAxisAngleFromQuaternion(e) { this.w = 2 * Math.acos(e.w); const t = Math.sqrt(1 - e.w * e.w); return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this; } setAxisAngleFromRotationMatrix(e) { let t, i, r, s; const c = e.elements, l = c[0], d = c[4], h6 = c[8], f6 = c[1], g6 = c[5], p = c[9], u6 = c[2], y6 = c[6], v6 = c[10]; if (Math.abs(d - f6) < 0.01 && Math.abs(h6 - u6) < 0.01 && Math.abs(p - y6) < 0.01) { if (Math.abs(d + f6) < 0.1 && Math.abs(h6 + u6) < 0.1 && Math.abs(p + y6) < 0.1 && Math.abs(l + g6 + v6 - 3) < 0.1) return this.set(1, 0, 0, 0), this; t = Math.PI; const x6 = (l + 1) / 2, w6 = (g6 + 1) / 2, A6 = (v6 + 1) / 2, M6 = (d + f6) / 4, R6 = (h6 + u6) / 4, L6 = (p + y6) / 4; return x6 > w6 && x6 > A6 ? x6 < 0.01 ? (i = 0, r = 0.707106781, s = 0.707106781) : (i = Math.sqrt(x6), r = M6 / i, s = R6 / i) : w6 > A6 ? w6 < 0.01 ? (i = 0.707106781, r = 0, s = 0.707106781) : (r = Math.sqrt(w6), i = M6 / r, s = L6 / r) : A6 < 0.01 ? (i = 0.707106781, r = 0.707106781, s = 0) : (s = Math.sqrt(A6), i = R6 / s, r = L6 / s), this.set(i, r, s, t), this; } let m6 = Math.sqrt((y6 - p) * (y6 - p) + (h6 - u6) * (h6 - u6) + (f6 - d) * (f6 - d)); return Math.abs(m6) < 1e-3 && (m6 = 1), this.x = (y6 - p) / m6, this.y = (h6 - u6) / m6, this.z = (f6 - d) / m6, this.w = Math.acos((l + g6 + v6 - 1) / 2), this; } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this; } max(e) { return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this; } clamp(e, t) { return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this.w = Math.max(e.w, Math.min(t.w, this.w)), this; } clampScalar(e, t) { return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this.w = Math.max(e, Math.min(t, this.w)), this; } clampLength(e, t) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i))); } floor() { return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this; } ceil() { return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this; } round() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this; } roundToZero() { return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this; } negate() { return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this; } dot(e) { return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w; } lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w); } normalize() { return this.divideScalar(this.length() || 1); } setLength(e) { return this.normalize().multiplyScalar(e); } lerp(e, t) { return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this; } lerpVectors(e, t, i) { return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this.z = e.z + (t.z - e.z) * i, this.w = e.w + (t.w - e.w) * i, this; } equals(e) { return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w; } fromArray(e, t = 0) { return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this; } toArray(e = [], t = 0) { return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e; } fromBufferAttribute(e, t, i) { return i !== void 0 && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this; } random() { return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this; } }; xt.prototype.isVector4 = true; var fi = class extends Kr { constructor(e, t, i = {}) { super(), this.width = e, this.height = t, this.depth = 1, this.scissor = new xt(0, 0, e, t), this.scissorTest = false, this.viewport = new xt(0, 0, e, t), this.texture = new Yt(void 0, i.mapping, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy, i.encoding), this.texture.image = { width: e, height: t, depth: 1 }, this.texture.generateMipmaps = i.generateMipmaps !== void 0 ? i.generateMipmaps : false, this.texture.minFilter = i.minFilter !== void 0 ? i.minFilter : zt, this.depthBuffer = i.depthBuffer !== void 0 ? i.depthBuffer : true, this.stencilBuffer = i.stencilBuffer !== void 0 ? i.stencilBuffer : false, this.depthTexture = i.depthTexture !== void 0 ? i.depthTexture : null; } setTexture(e) { e.image = { width: this.width, height: this.height, depth: this.depth }, this.texture = e; } setSize(e, t, i = 1) { (this.width !== e || this.height !== t || this.depth !== i) && (this.width = e, this.height = t, this.depth = i, this.texture.image.width = e, this.texture.image.height = t, this.texture.image.depth = i, this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t); } clone() { return new this.constructor().copy(this); } copy(e) { return this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.copy(e.viewport), this.texture = e.texture.clone(), this.texture.image = { ...this.texture.image }, this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this; } dispose() { this.dispatchEvent({ type: "dispose" }); } }; fi.prototype.isWebGLRenderTarget = true; var nx = class extends fi { constructor(e, t, i) { super(e, t); const r = this.texture; this.texture = []; for (let s = 0; s < i; s++) this.texture[s] = r.clone(); } setSize(e, t, i = 1) { if (this.width !== e || this.height !== t || this.depth !== i) { this.width = e, this.height = t, this.depth = i; for (let r = 0, s = this.texture.length; r < s; r++) this.texture[r].image.width = e, this.texture[r].image.height = t, this.texture[r].image.depth = i; this.dispose(); } return this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t), this; } copy(e) { this.dispose(), this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.set(0, 0, this.width, this.height), this.scissor.set(0, 0, this.width, this.height), this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this.texture.length = 0; for (let t = 0, i = e.texture.length; t < i; t++) this.texture[t] = e.texture[t].clone(); return this; } }; nx.prototype.isWebGLMultipleRenderTargets = true; var Ef = class extends fi { constructor(e, t, i) { super(e, t, i), this.samples = 4; } copy(e) { return super.copy.call(this, e), this.samples = e.samples, this; } }; Ef.prototype.isWebGLMultisampleRenderTarget = true; var bn = class { constructor(e = 0, t = 0, i = 0, r = 1) { this._x = e, this._y = t, this._z = i, this._w = r; } static slerp(e, t, i, r) { return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), i.slerpQuaternions(e, t, r); } static slerpFlat(e, t, i, r, s, o, a6) { let c = i[r + 0], l = i[r + 1], d = i[r + 2], h6 = i[r + 3]; const f6 = s[o + 0], g6 = s[o + 1], p = s[o + 2], u6 = s[o + 3]; if (a6 === 0) { e[t + 0] = c, e[t + 1] = l, e[t + 2] = d, e[t + 3] = h6; return; } if (a6 === 1) { e[t + 0] = f6, e[t + 1] = g6, e[t + 2] = p, e[t + 3] = u6; return; } if (h6 !== u6 || c !== f6 || l !== g6 || d !== p) { let y6 = 1 - a6; const v6 = c * f6 + l * g6 + d * p + h6 * u6, m6 = v6 >= 0 ? 1 : -1, x6 = 1 - v6 * v6; if (x6 > Number.EPSILON) { const A6 = Math.sqrt(x6), M6 = Math.atan2(A6, v6 * m6); y6 = Math.sin(y6 * M6) / A6, a6 = Math.sin(a6 * M6) / A6; } const w6 = a6 * m6; if (c = c * y6 + f6 * w6, l = l * y6 + g6 * w6, d = d * y6 + p * w6, h6 = h6 * y6 + u6 * w6, y6 === 1 - a6) { const A6 = 1 / Math.sqrt(c * c + l * l + d * d + h6 * h6); c *= A6, l *= A6, d *= A6, h6 *= A6; } } e[t] = c, e[t + 1] = l, e[t + 2] = d, e[t + 3] = h6; } static multiplyQuaternionsFlat(e, t, i, r, s, o) { const a6 = i[r], c = i[r + 1], l = i[r + 2], d = i[r + 3], h6 = s[o], f6 = s[o + 1], g6 = s[o + 2], p = s[o + 3]; return e[t] = a6 * p + d * h6 + c * g6 - l * f6, e[t + 1] = c * p + d * f6 + l * h6 - a6 * g6, e[t + 2] = l * p + d * g6 + a6 * f6 - c * h6, e[t + 3] = d * p - a6 * h6 - c * f6 - l * g6, e; } get x() { return this._x; } set x(e) { this._x = e, this._onChangeCallback(); } get y() { return this._y; } set y(e) { this._y = e, this._onChangeCallback(); } get z() { return this._z; } set z(e) { this._z = e, this._onChangeCallback(); } get w() { return this._w; } set w(e) { this._w = e, this._onChangeCallback(); } set(e, t, i, r) { return this._x = e, this._y = t, this._z = i, this._w = r, this._onChangeCallback(), this; } clone() { return new this.constructor(this._x, this._y, this._z, this._w); } copy(e) { return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this; } setFromEuler(e, t) { if (!(e && e.isEuler)) throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order."); const i = e._x, r = e._y, s = e._z, o = e._order, a6 = Math.cos, c = Math.sin, l = a6(i / 2), d = a6(r / 2), h6 = a6(s / 2), f6 = c(i / 2), g6 = c(r / 2), p = c(s / 2); switch (o) { case "XYZ": this._x = f6 * d * h6 + l * g6 * p, this._y = l * g6 * h6 - f6 * d * p, this._z = l * d * p + f6 * g6 * h6, this._w = l * d * h6 - f6 * g6 * p; break; case "YXZ": this._x = f6 * d * h6 + l * g6 * p, this._y = l * g6 * h6 - f6 * d * p, this._z = l * d * p - f6 * g6 * h6, this._w = l * d * h6 + f6 * g6 * p; break; case "ZXY": this._x = f6 * d * h6 - l * g6 * p, this._y = l * g6 * h6 + f6 * d * p, this._z = l * d * p + f6 * g6 * h6, this._w = l * d * h6 - f6 * g6 * p; break; case "ZYX": this._x = f6 * d * h6 - l * g6 * p, this._y = l * g6 * h6 + f6 * d * p, this._z = l * d * p - f6 * g6 * h6, this._w = l * d * h6 + f6 * g6 * p; break; case "YZX": this._x = f6 * d * h6 + l * g6 * p, this._y = l * g6 * h6 + f6 * d * p, this._z = l * d * p - f6 * g6 * h6, this._w = l * d * h6 - f6 * g6 * p; break; case "XZY": this._x = f6 * d * h6 - l * g6 * p, this._y = l * g6 * h6 - f6 * d * p, this._z = l * d * p + f6 * g6 * h6, this._w = l * d * h6 + f6 * g6 * p; break; default: console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + o); } return t !== false && this._onChangeCallback(), this; } setFromAxisAngle(e, t) { const i = t / 2, r = Math.sin(i); return this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(i), this._onChangeCallback(), this; } setFromRotationMatrix(e) { const t = e.elements, i = t[0], r = t[4], s = t[8], o = t[1], a6 = t[5], c = t[9], l = t[2], d = t[6], h6 = t[10], f6 = i + a6 + h6; if (f6 > 0) { const g6 = 0.5 / Math.sqrt(f6 + 1); this._w = 0.25 / g6, this._x = (d - c) * g6, this._y = (s - l) * g6, this._z = (o - r) * g6; } else if (i > a6 && i > h6) { const g6 = 2 * Math.sqrt(1 + i - a6 - h6); this._w = (d - c) / g6, this._x = 0.25 * g6, this._y = (r + o) / g6, this._z = (s + l) / g6; } else if (a6 > h6) { const g6 = 2 * Math.sqrt(1 + a6 - i - h6); this._w = (s - l) / g6, this._x = (r + o) / g6, this._y = 0.25 * g6, this._z = (c + d) / g6; } else { const g6 = 2 * Math.sqrt(1 + h6 - i - a6); this._w = (o - r) / g6, this._x = (s + l) / g6, this._y = (c + d) / g6, this._z = 0.25 * g6; } return this._onChangeCallback(), this; } setFromUnitVectors(e, t) { let i = e.dot(t) + 1; return i < Number.EPSILON ? (i = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = i) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = i)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = i), this.normalize(); } angleTo(e) { return 2 * Math.acos(Math.abs(gn2(this.dot(e), -1, 1))); } rotateTowards(e, t) { const i = this.angleTo(e); if (i === 0) return this; const r = Math.min(1, t / i); return this.slerp(e, r), this; } identity() { return this.set(0, 0, 0, 1); } invert() { return this.conjugate(); } conjugate() { return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this; } dot(e) { return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w; } lengthSq() { return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; } length() { return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w); } normalize() { let e = this.length(); return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this; } multiply(e, t) { return t !== void 0 ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e); } premultiply(e) { return this.multiplyQuaternions(e, this); } multiplyQuaternions(e, t) { const i = e._x, r = e._y, s = e._z, o = e._w, a6 = t._x, c = t._y, l = t._z, d = t._w; return this._x = i * d + o * a6 + r * l - s * c, this._y = r * d + o * c + s * a6 - i * l, this._z = s * d + o * l + i * c - r * a6, this._w = o * d - i * a6 - r * c - s * l, this._onChangeCallback(), this; } slerp(e, t) { if (t === 0) return this; if (t === 1) return this.copy(e); const i = this._x, r = this._y, s = this._z, o = this._w; let a6 = o * e._w + i * e._x + r * e._y + s * e._z; if (a6 < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, a6 = -a6) : this.copy(e), a6 >= 1) return this._w = o, this._x = i, this._y = r, this._z = s, this; const c = 1 - a6 * a6; if (c <= Number.EPSILON) { const g6 = 1 - t; return this._w = g6 * o + t * this._w, this._x = g6 * i + t * this._x, this._y = g6 * r + t * this._y, this._z = g6 * s + t * this._z, this.normalize(), this._onChangeCallback(), this; } const l = Math.sqrt(c), d = Math.atan2(l, a6), h6 = Math.sin((1 - t) * d) / l, f6 = Math.sin(t * d) / l; return this._w = o * h6 + this._w * f6, this._x = i * h6 + this._x * f6, this._y = r * h6 + this._y * f6, this._z = s * h6 + this._z * f6, this._onChangeCallback(), this; } slerpQuaternions(e, t, i) { this.copy(e).slerp(t, i); } equals(e) { return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w; } fromArray(e, t = 0) { return this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this; } toArray(e = [], t = 0) { return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e; } fromBufferAttribute(e, t) { return this._x = e.getX(t), this._y = e.getY(t), this._z = e.getZ(t), this._w = e.getW(t), this; } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } }; bn.prototype.isQuaternion = true; var q4 = class { constructor(e = 0, t = 0, i = 0) { this.x = e, this.y = t, this.z = i; } set(e, t, i) { return i === void 0 && (i = this.z), this.x = e, this.y = t, this.z = i, this; } setScalar(e) { return this.x = e, this.y = e, this.z = e, this; } setX(e) { return this.x = e, this; } setY(e) { return this.y = e, this; } setZ(e) { return this.z = e, this; } setComponent(e, t) { switch (e) { case 0: this.x = t; break; case 1: this.y = t; break; case 2: this.z = t; break; default: throw new Error("index is out of range: " + e); } return this; } getComponent(e) { switch (e) { case 0: return this.x; case 1: return this.y; case 2: return this.z; default: throw new Error("index is out of range: " + e); } } clone() { return new this.constructor(this.x, this.y, this.z); } copy(e) { return this.x = e.x, this.y = e.y, this.z = e.z, this; } add(e, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this); } addScalar(e) { return this.x += e, this.y += e, this.z += e, this; } addVectors(e, t) { return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this; } addScaledVector(e, t) { return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this; } sub(e, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this); } subScalar(e) { return this.x -= e, this.y -= e, this.z -= e, this; } subVectors(e, t) { return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this; } multiply(e, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (this.x *= e.x, this.y *= e.y, this.z *= e.z, this); } multiplyScalar(e) { return this.x *= e, this.y *= e, this.z *= e, this; } multiplyVectors(e, t) { return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this; } applyEuler(e) { return e && e.isEuler || console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), this.applyQuaternion($m.setFromEuler(e)); } applyAxisAngle(e, t) { return this.applyQuaternion($m.setFromAxisAngle(e, t)); } applyMatrix3(e) { const t = this.x, i = this.y, r = this.z, s = e.elements; return this.x = s[0] * t + s[3] * i + s[6] * r, this.y = s[1] * t + s[4] * i + s[7] * r, this.z = s[2] * t + s[5] * i + s[8] * r, this; } applyNormalMatrix(e) { return this.applyMatrix3(e).normalize(); } applyMatrix4(e) { const t = this.x, i = this.y, r = this.z, s = e.elements, o = 1 / (s[3] * t + s[7] * i + s[11] * r + s[15]); return this.x = (s[0] * t + s[4] * i + s[8] * r + s[12]) * o, this.y = (s[1] * t + s[5] * i + s[9] * r + s[13]) * o, this.z = (s[2] * t + s[6] * i + s[10] * r + s[14]) * o, this; } applyQuaternion(e) { const t = this.x, i = this.y, r = this.z, s = e.x, o = e.y, a6 = e.z, c = e.w, l = c * t + o * r - a6 * i, d = c * i + a6 * t - s * r, h6 = c * r + s * i - o * t, f6 = -s * t - o * i - a6 * r; return this.x = l * c + f6 * -s + d * -a6 - h6 * -o, this.y = d * c + f6 * -o + h6 * -s - l * -a6, this.z = h6 * c + f6 * -a6 + l * -o - d * -s, this; } project(e) { return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix); } unproject(e) { return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld); } transformDirection(e) { const t = this.x, i = this.y, r = this.z, s = e.elements; return this.x = s[0] * t + s[4] * i + s[8] * r, this.y = s[1] * t + s[5] * i + s[9] * r, this.z = s[2] * t + s[6] * i + s[10] * r, this.normalize(); } divide(e) { return this.x /= e.x, this.y /= e.y, this.z /= e.z, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this; } max(e) { return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this; } clamp(e, t) { return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this; } clampScalar(e, t) { return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this; } clampLength(e, t) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i))); } floor() { return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this; } ceil() { return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this; } round() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this; } roundToZero() { return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this; } negate() { return this.x = -this.x, this.y = -this.y, this.z = -this.z, this; } dot(e) { return this.x * e.x + this.y * e.y + this.z * e.z; } // TODO lengthSquared? lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z); } normalize() { return this.divideScalar(this.length() || 1); } setLength(e) { return this.normalize().multiplyScalar(e); } lerp(e, t) { return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this; } lerpVectors(e, t, i) { return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this.z = e.z + (t.z - e.z) * i, this; } cross(e, t) { return t !== void 0 ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t)) : this.crossVectors(this, e); } crossVectors(e, t) { const i = e.x, r = e.y, s = e.z, o = t.x, a6 = t.y, c = t.z; return this.x = r * c - s * a6, this.y = s * o - i * c, this.z = i * a6 - r * o, this; } projectOnVector(e) { const t = e.lengthSq(); if (t === 0) return this.set(0, 0, 0); const i = e.dot(this) / t; return this.copy(e).multiplyScalar(i); } projectOnPlane(e) { return Zu.copy(this).projectOnVector(e), this.sub(Zu); } reflect(e) { return this.sub(Zu.copy(e).multiplyScalar(2 * this.dot(e))); } angleTo(e) { const t = Math.sqrt(this.lengthSq() * e.lengthSq()); if (t === 0) return Math.PI / 2; const i = this.dot(e) / t; return Math.acos(gn2(i, -1, 1)); } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const t = this.x - e.x, i = this.y - e.y, r = this.z - e.z; return t * t + i * i + r * r; } manhattanDistanceTo(e) { return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z); } setFromSpherical(e) { return this.setFromSphericalCoords(e.radius, e.phi, e.theta); } setFromSphericalCoords(e, t, i) { const r = Math.sin(t) * e; return this.x = r * Math.sin(i), this.y = Math.cos(t) * e, this.z = r * Math.cos(i), this; } setFromCylindrical(e) { return this.setFromCylindricalCoords(e.radius, e.theta, e.y); } setFromCylindricalCoords(e, t, i) { return this.x = e * Math.sin(t), this.y = i, this.z = e * Math.cos(t), this; } setFromMatrixPosition(e) { const t = e.elements; return this.x = t[12], this.y = t[13], this.z = t[14], this; } setFromMatrixScale(e) { const t = this.setFromMatrixColumn(e, 0).length(), i = this.setFromMatrixColumn(e, 1).length(), r = this.setFromMatrixColumn(e, 2).length(); return this.x = t, this.y = i, this.z = r, this; } setFromMatrixColumn(e, t) { return this.fromArray(e.elements, t * 4); } setFromMatrix3Column(e, t) { return this.fromArray(e.elements, t * 3); } equals(e) { return e.x === this.x && e.y === this.y && e.z === this.z; } fromArray(e, t = 0) { return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this; } toArray(e = [], t = 0) { return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e; } fromBufferAttribute(e, t, i) { return i !== void 0 && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this; } random() { return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this; } }; q4.prototype.isVector3 = true; var Zu = new q4(); var $m = new bn(); var Nn = class { constructor(e = new q4(1 / 0, 1 / 0, 1 / 0), t = new q4(-1 / 0, -1 / 0, -1 / 0)) { this.min = e, this.max = t; } set(e, t) { return this.min.copy(e), this.max.copy(t), this; } setFromArray(e) { let t = 1 / 0, i = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0, a6 = -1 / 0; for (let c = 0, l = e.length; c < l; c += 3) { const d = e[c], h6 = e[c + 1], f6 = e[c + 2]; d < t && (t = d), h6 < i && (i = h6), f6 < r && (r = f6), d > s && (s = d), h6 > o && (o = h6), f6 > a6 && (a6 = f6); } return this.min.set(t, i, r), this.max.set(s, o, a6), this; } setFromBufferAttribute(e) { let t = 1 / 0, i = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0, a6 = -1 / 0; for (let c = 0, l = e.count; c < l; c++) { const d = e.getX(c), h6 = e.getY(c), f6 = e.getZ(c); d < t && (t = d), h6 < i && (i = h6), f6 < r && (r = f6), d > s && (s = d), h6 > o && (o = h6), f6 > a6 && (a6 = f6); } return this.min.set(t, i, r), this.max.set(s, o, a6), this; } setFromPoints(e) { this.makeEmpty(); for (let t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]); return this; } setFromCenterAndSize(e, t) { const i = ha.copy(t).multiplyScalar(0.5); return this.min.copy(e).sub(i), this.max.copy(e).add(i), this; } setFromObject(e) { return this.makeEmpty(), this.expandByObject(e); } clone() { return new this.constructor().copy(this); } copy(e) { return this.min.copy(e.min), this.max.copy(e.max), this; } makeEmpty() { return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this; } isEmpty() { return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z; } getCenter(e) { return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5); } getSize(e) { return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min); } expandByPoint(e) { return this.min.min(e), this.max.max(e), this; } expandByVector(e) { return this.min.sub(e), this.max.add(e), this; } expandByScalar(e) { return this.min.addScalar(-e), this.max.addScalar(e), this; } expandByObject(e) { e.updateWorldMatrix(false, false); const t = e.geometry; t !== void 0 && (t.boundingBox === null && t.computeBoundingBox(), Xu.copy(t.boundingBox), Xu.applyMatrix4(e.matrixWorld), this.union(Xu)); const i = e.children; for (let r = 0, s = i.length; r < s; r++) this.expandByObject(i[r]); return this; } containsPoint(e) { return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z); } containsBox(e) { return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z; } getParameter(e, t) { return t.set( (e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z) ); } intersectsBox(e) { return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z); } intersectsSphere(e) { return this.clampPoint(e.center, ha), ha.distanceToSquared(e.center) <= e.radius * e.radius; } intersectsPlane(e) { let t, i; return e.normal.x > 0 ? (t = e.normal.x * this.min.x, i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, i = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, i += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, i += e.normal.z * this.min.z), t <= -e.constant && i >= -e.constant; } intersectsTriangle(e) { if (this.isEmpty()) return false; this.getCenter(da), Ol.subVectors(this.max, da), $s.subVectors(e.a, da), Zs.subVectors(e.b, da), Xs.subVectors(e.c, da), vr.subVectors(Zs, $s), yr.subVectors(Xs, Zs), ss.subVectors($s, Xs); let t = [ 0, -vr.z, vr.y, 0, -yr.z, yr.y, 0, -ss.z, ss.y, vr.z, 0, -vr.x, yr.z, 0, -yr.x, ss.z, 0, -ss.x, -vr.y, vr.x, 0, -yr.y, yr.x, 0, -ss.y, ss.x, 0 ]; return !Yu(t, $s, Zs, Xs, Ol) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Yu(t, $s, Zs, Xs, Ol)) ? false : (Dl.crossVectors(vr, yr), t = [Dl.x, Dl.y, Dl.z], Yu(t, $s, Zs, Xs, Ol)); } clampPoint(e, t) { return t.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return ha.copy(e).clamp(this.min, this.max).sub(e).length(); } getBoundingSphere(e) { return this.getCenter(e.center), e.radius = this.getSize(ha).length() * 0.5, e; } intersect(e) { return this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this; } union(e) { return this.min.min(e.min), this.max.max(e.max), this; } applyMatrix4(e) { return this.isEmpty() ? this : (Wi[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Wi[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Wi[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Wi[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Wi[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Wi[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Wi[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Wi[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Wi), this); } translate(e) { return this.min.add(e), this.max.add(e), this; } equals(e) { return e.min.equals(this.min) && e.max.equals(this.max); } }; Nn.prototype.isBox3 = true; var Wi = [ new q4(), new q4(), new q4(), new q4(), new q4(), new q4(), new q4(), new q4() ]; var ha = new q4(); var Xu = new Nn(); var $s = new q4(); var Zs = new q4(); var Xs = new q4(); var vr = new q4(); var yr = new q4(); var ss = new q4(); var da = new q4(); var Ol = new q4(); var Dl = new q4(); var os = new q4(); function Yu(n, e, t, i, r) { for (let s = 0, o = n.length - 3; s <= o; s += 3) { os.fromArray(n, s); const a6 = r.x * Math.abs(os.x) + r.y * Math.abs(os.y) + r.z * Math.abs(os.z), c = e.dot(os), l = t.dot(os), d = i.dot(os); if (Math.max(-Math.max(c, l, d), Math.min(c, l, d)) > a6) return false; } return true; } var vF = new Nn(); var Zm = new q4(); var Ju = new q4(); var Ku = new q4(); var mr = class { constructor(e = new q4(), t = -1) { this.center = e, this.radius = t; } set(e, t) { return this.center.copy(e), this.radius = t, this; } setFromPoints(e, t) { const i = this.center; t !== void 0 ? i.copy(t) : vF.setFromPoints(e).getCenter(i); let r = 0; for (let s = 0, o = e.length; s < o; s++) r = Math.max(r, i.distanceToSquared(e[s])); return this.radius = Math.sqrt(r), this; } copy(e) { return this.center.copy(e.center), this.radius = e.radius, this; } isEmpty() { return this.radius < 0; } makeEmpty() { return this.center.set(0, 0, 0), this.radius = -1, this; } containsPoint(e) { return e.distanceToSquared(this.center) <= this.radius * this.radius; } distanceToPoint(e) { return e.distanceTo(this.center) - this.radius; } intersectsSphere(e) { const t = this.radius + e.radius; return e.center.distanceToSquared(this.center) <= t * t; } intersectsBox(e) { return e.intersectsSphere(this); } intersectsPlane(e) { return Math.abs(e.distanceToPoint(this.center)) <= this.radius; } clampPoint(e, t) { const i = this.center.distanceToSquared(e); return t.copy(e), i > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t; } getBoundingBox(e) { return this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e); } applyMatrix4(e) { return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this; } translate(e) { return this.center.add(e), this; } expandByPoint(e) { Ku.subVectors(e, this.center); const t = Ku.lengthSq(); if (t > this.radius * this.radius) { const i = Math.sqrt(t), r = (i - this.radius) * 0.5; this.center.add(Ku.multiplyScalar(r / i)), this.radius += r; } return this; } union(e) { return Ju.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(Zm.copy(e.center).add(Ju)), this.expandByPoint(Zm.copy(e.center).sub(Ju)), this; } equals(e) { return e.center.equals(this.center) && e.radius === this.radius; } clone() { return new this.constructor().copy(this); } }; var ji = new q4(); var qu = new q4(); var Nl = new q4(); var br = new q4(); var Qu = new q4(); var Bl = new q4(); var eh = new q4(); var qr = class { constructor(e = new q4(), t = new q4(0, 0, -1)) { this.origin = e, this.direction = t; } set(e, t) { return this.origin.copy(e), this.direction.copy(t), this; } copy(e) { return this.origin.copy(e.origin), this.direction.copy(e.direction), this; } at(e, t) { return t.copy(this.direction).multiplyScalar(e).add(this.origin); } lookAt(e) { return this.direction.copy(e).sub(this.origin).normalize(), this; } recast(e) { return this.origin.copy(this.at(e, ji)), this; } closestPointToPoint(e, t) { t.subVectors(e, this.origin); const i = t.dot(this.direction); return i < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(i).add(this.origin); } distanceToPoint(e) { return Math.sqrt(this.distanceSqToPoint(e)); } distanceSqToPoint(e) { const t = ji.subVectors(e, this.origin).dot(this.direction); return t < 0 ? this.origin.distanceToSquared(e) : (ji.copy(this.direction).multiplyScalar(t).add(this.origin), ji.distanceToSquared(e)); } distanceSqToSegment(e, t, i, r) { qu.copy(e).add(t).multiplyScalar(0.5), Nl.copy(t).sub(e).normalize(), br.copy(this.origin).sub(qu); const s = e.distanceTo(t) * 0.5, o = -this.direction.dot(Nl), a6 = br.dot(this.direction), c = -br.dot(Nl), l = br.lengthSq(), d = Math.abs(1 - o * o); let h6, f6, g6, p; if (d > 0) if (h6 = o * c - a6, f6 = o * a6 - c, p = s * d, h6 >= 0) if (f6 >= -p) if (f6 <= p) { const u6 = 1 / d; h6 *= u6, f6 *= u6, g6 = h6 * (h6 + o * f6 + 2 * a6) + f6 * (o * h6 + f6 + 2 * c) + l; } else f6 = s, h6 = Math.max(0, -(o * f6 + a6)), g6 = -h6 * h6 + f6 * (f6 + 2 * c) + l; else f6 = -s, h6 = Math.max(0, -(o * f6 + a6)), g6 = -h6 * h6 + f6 * (f6 + 2 * c) + l; else f6 <= -p ? (h6 = Math.max(0, -(-o * s + a6)), f6 = h6 > 0 ? -s : Math.min(Math.max(-s, -c), s), g6 = -h6 * h6 + f6 * (f6 + 2 * c) + l) : f6 <= p ? (h6 = 0, f6 = Math.min(Math.max(-s, -c), s), g6 = f6 * (f6 + 2 * c) + l) : (h6 = Math.max(0, -(o * s + a6)), f6 = h6 > 0 ? s : Math.min(Math.max(-s, -c), s), g6 = -h6 * h6 + f6 * (f6 + 2 * c) + l); else f6 = o > 0 ? -s : s, h6 = Math.max(0, -(o * f6 + a6)), g6 = -h6 * h6 + f6 * (f6 + 2 * c) + l; return i && i.copy(this.direction).multiplyScalar(h6).add(this.origin), r && r.copy(Nl).multiplyScalar(f6).add(qu), g6; } intersectSphere(e, t) { ji.subVectors(e.center, this.origin); const i = ji.dot(this.direction), r = ji.dot(ji) - i * i, s = e.radius * e.radius; if (r > s) return null; const o = Math.sqrt(s - r), a6 = i - o, c = i + o; return a6 < 0 && c < 0 ? null : a6 < 0 ? this.at(c, t) : this.at(a6, t); } intersectsSphere(e) { return this.distanceSqToPoint(e.center) <= e.radius * e.radius; } distanceToPlane(e) { const t = e.normal.dot(this.direction); if (t === 0) return e.distanceToPoint(this.origin) === 0 ? 0 : null; const i = -(this.origin.dot(e.normal) + e.constant) / t; return i >= 0 ? i : null; } intersectPlane(e, t) { const i = this.distanceToPlane(e); return i === null ? null : this.at(i, t); } intersectsPlane(e) { const t = e.distanceToPoint(this.origin); return t === 0 || e.normal.dot(this.direction) * t < 0; } intersectBox(e, t) { let i, r, s, o, a6, c; const l = 1 / this.direction.x, d = 1 / this.direction.y, h6 = 1 / this.direction.z, f6 = this.origin; return l >= 0 ? (i = (e.min.x - f6.x) * l, r = (e.max.x - f6.x) * l) : (i = (e.max.x - f6.x) * l, r = (e.min.x - f6.x) * l), d >= 0 ? (s = (e.min.y - f6.y) * d, o = (e.max.y - f6.y) * d) : (s = (e.max.y - f6.y) * d, o = (e.min.y - f6.y) * d), i > o || s > r || ((s > i || i !== i) && (i = s), (o < r || r !== r) && (r = o), h6 >= 0 ? (a6 = (e.min.z - f6.z) * h6, c = (e.max.z - f6.z) * h6) : (a6 = (e.max.z - f6.z) * h6, c = (e.min.z - f6.z) * h6), i > c || a6 > r) || ((a6 > i || i !== i) && (i = a6), (c < r || r !== r) && (r = c), r < 0) ? null : this.at(i >= 0 ? i : r, t); } intersectsBox(e) { return this.intersectBox(e, ji) !== null; } intersectTriangle(e, t, i, r, s) { Qu.subVectors(t, e), Bl.subVectors(i, e), eh.crossVectors(Qu, Bl); let o = this.direction.dot(eh), a6; if (o > 0) { if (r) return null; a6 = 1; } else if (o < 0) a6 = -1, o = -o; else return null; br.subVectors(this.origin, e); const c = a6 * this.direction.dot(Bl.crossVectors(br, Bl)); if (c < 0) return null; const l = a6 * this.direction.dot(Qu.cross(br)); if (l < 0 || c + l > o) return null; const d = -a6 * br.dot(eh); return d < 0 ? null : this.at(d / o, s); } applyMatrix4(e) { return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this; } equals(e) { return e.origin.equals(this.origin) && e.direction.equals(this.direction); } clone() { return new this.constructor().copy(this); } }; var Xe = class _Xe { constructor() { this.elements = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead."); } set(e, t, i, r, s, o, a6, c, l, d, h6, f6, g6, p, u6, y6) { const v6 = this.elements; return v6[0] = e, v6[4] = t, v6[8] = i, v6[12] = r, v6[1] = s, v6[5] = o, v6[9] = a6, v6[13] = c, v6[2] = l, v6[6] = d, v6[10] = h6, v6[14] = f6, v6[3] = g6, v6[7] = p, v6[11] = u6, v6[15] = y6, this; } identity() { return this.set( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ), this; } clone() { return new _Xe().fromArray(this.elements); } copy(e) { const t = this.elements, i = e.elements; return t[0] = i[0], t[1] = i[1], t[2] = i[2], t[3] = i[3], t[4] = i[4], t[5] = i[5], t[6] = i[6], t[7] = i[7], t[8] = i[8], t[9] = i[9], t[10] = i[10], t[11] = i[11], t[12] = i[12], t[13] = i[13], t[14] = i[14], t[15] = i[15], this; } copyPosition(e) { const t = this.elements, i = e.elements; return t[12] = i[12], t[13] = i[13], t[14] = i[14], this; } setFromMatrix3(e) { const t = e.elements; return this.set( t[0], t[3], t[6], 0, t[1], t[4], t[7], 0, t[2], t[5], t[8], 0, 0, 0, 0, 1 ), this; } extractBasis(e, t, i) { return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this; } makeBasis(e, t, i) { return this.set( e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1 ), this; } extractRotation(e) { const t = this.elements, i = e.elements, r = 1 / Ys.setFromMatrixColumn(e, 0).length(), s = 1 / Ys.setFromMatrixColumn(e, 1).length(), o = 1 / Ys.setFromMatrixColumn(e, 2).length(); return t[0] = i[0] * r, t[1] = i[1] * r, t[2] = i[2] * r, t[3] = 0, t[4] = i[4] * s, t[5] = i[5] * s, t[6] = i[6] * s, t[7] = 0, t[8] = i[8] * o, t[9] = i[9] * o, t[10] = i[10] * o, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this; } makeRotationFromEuler(e) { e && e.isEuler || console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."); const t = this.elements, i = e.x, r = e.y, s = e.z, o = Math.cos(i), a6 = Math.sin(i), c = Math.cos(r), l = Math.sin(r), d = Math.cos(s), h6 = Math.sin(s); if (e.order === "XYZ") { const f6 = o * d, g6 = o * h6, p = a6 * d, u6 = a6 * h6; t[0] = c * d, t[4] = -c * h6, t[8] = l, t[1] = g6 + p * l, t[5] = f6 - u6 * l, t[9] = -a6 * c, t[2] = u6 - f6 * l, t[6] = p + g6 * l, t[10] = o * c; } else if (e.order === "YXZ") { const f6 = c * d, g6 = c * h6, p = l * d, u6 = l * h6; t[0] = f6 + u6 * a6, t[4] = p * a6 - g6, t[8] = o * l, t[1] = o * h6, t[5] = o * d, t[9] = -a6, t[2] = g6 * a6 - p, t[6] = u6 + f6 * a6, t[10] = o * c; } else if (e.order === "ZXY") { const f6 = c * d, g6 = c * h6, p = l * d, u6 = l * h6; t[0] = f6 - u6 * a6, t[4] = -o * h6, t[8] = p + g6 * a6, t[1] = g6 + p * a6, t[5] = o * d, t[9] = u6 - f6 * a6, t[2] = -o * l, t[6] = a6, t[10] = o * c; } else if (e.order === "ZYX") { const f6 = o * d, g6 = o * h6, p = a6 * d, u6 = a6 * h6; t[0] = c * d, t[4] = p * l - g6, t[8] = f6 * l + u6, t[1] = c * h6, t[5] = u6 * l + f6, t[9] = g6 * l - p, t[2] = -l, t[6] = a6 * c, t[10] = o * c; } else if (e.order === "YZX") { const f6 = o * c, g6 = o * l, p = a6 * c, u6 = a6 * l; t[0] = c * d, t[4] = u6 - f6 * h6, t[8] = p * h6 + g6, t[1] = h6, t[5] = o * d, t[9] = -a6 * d, t[2] = -l * d, t[6] = g6 * h6 + p, t[10] = f6 - u6 * h6; } else if (e.order === "XZY") { const f6 = o * c, g6 = o * l, p = a6 * c, u6 = a6 * l; t[0] = c * d, t[4] = -h6, t[8] = l * d, t[1] = f6 * h6 + u6, t[5] = o * d, t[9] = g6 * h6 - p, t[2] = p * h6 - g6, t[6] = a6 * d, t[10] = u6 * h6 + f6; } return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this; } makeRotationFromQuaternion(e) { return this.compose(yF, e, bF); } lookAt(e, t, i) { const r = this.elements; return Bn.subVectors(e, t), Bn.lengthSq() === 0 && (Bn.z = 1), Bn.normalize(), xr.crossVectors(i, Bn), xr.lengthSq() === 0 && (Math.abs(i.z) === 1 ? Bn.x += 1e-4 : Bn.z += 1e-4, Bn.normalize(), xr.crossVectors(i, Bn)), xr.normalize(), Ul.crossVectors(Bn, xr), r[0] = xr.x, r[4] = Ul.x, r[8] = Bn.x, r[1] = xr.y, r[5] = Ul.y, r[9] = Bn.y, r[2] = xr.z, r[6] = Ul.z, r[10] = Bn.z, this; } multiply(e, t) { return t !== void 0 ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t) { const i = e.elements, r = t.elements, s = this.elements, o = i[0], a6 = i[4], c = i[8], l = i[12], d = i[1], h6 = i[5], f6 = i[9], g6 = i[13], p = i[2], u6 = i[6], y6 = i[10], v6 = i[14], m6 = i[3], x6 = i[7], w6 = i[11], A6 = i[15], M6 = r[0], R6 = r[4], L6 = r[8], T6 = r[12], P6 = r[1], _6 = r[5], S6 = r[9], E6 = r[13], C6 = r[2], I6 = r[6], b6 = r[10], F6 = r[14], D6 = r[3], N6 = r[7], B6 = r[11], U6 = r[15]; return s[0] = o * M6 + a6 * P6 + c * C6 + l * D6, s[4] = o * R6 + a6 * _6 + c * I6 + l * N6, s[8] = o * L6 + a6 * S6 + c * b6 + l * B6, s[12] = o * T6 + a6 * E6 + c * F6 + l * U6, s[1] = d * M6 + h6 * P6 + f6 * C6 + g6 * D6, s[5] = d * R6 + h6 * _6 + f6 * I6 + g6 * N6, s[9] = d * L6 + h6 * S6 + f6 * b6 + g6 * B6, s[13] = d * T6 + h6 * E6 + f6 * F6 + g6 * U6, s[2] = p * M6 + u6 * P6 + y6 * C6 + v6 * D6, s[6] = p * R6 + u6 * _6 + y6 * I6 + v6 * N6, s[10] = p * L6 + u6 * S6 + y6 * b6 + v6 * B6, s[14] = p * T6 + u6 * E6 + y6 * F6 + v6 * U6, s[3] = m6 * M6 + x6 * P6 + w6 * C6 + A6 * D6, s[7] = m6 * R6 + x6 * _6 + w6 * I6 + A6 * N6, s[11] = m6 * L6 + x6 * S6 + w6 * b6 + A6 * B6, s[15] = m6 * T6 + x6 * E6 + w6 * F6 + A6 * U6, this; } multiplyScalar(e) { const t = this.elements; return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this; } determinant() { const e = this.elements, t = e[0], i = e[4], r = e[8], s = e[12], o = e[1], a6 = e[5], c = e[9], l = e[13], d = e[2], h6 = e[6], f6 = e[10], g6 = e[14], p = e[3], u6 = e[7], y6 = e[11], v6 = e[15]; return p * (+s * c * h6 - r * l * h6 - s * a6 * f6 + i * l * f6 + r * a6 * g6 - i * c * g6) + u6 * (+t * c * g6 - t * l * f6 + s * o * f6 - r * o * g6 + r * l * d - s * c * d) + y6 * (+t * l * h6 - t * a6 * g6 - s * o * h6 + i * o * g6 + s * a6 * d - i * l * d) + v6 * (-r * a6 * d - t * c * h6 + t * a6 * f6 + r * o * h6 - i * o * f6 + i * c * d); } transpose() { const e = this.elements; let t; return t = e[1], e[1] = e[4], e[4] = t, t = e[2], e[2] = e[8], e[8] = t, t = e[6], e[6] = e[9], e[9] = t, t = e[3], e[3] = e[12], e[12] = t, t = e[7], e[7] = e[13], e[13] = t, t = e[11], e[11] = e[14], e[14] = t, this; } setPosition(e, t, i) { const r = this.elements; return e.isVector3 ? (r[12] = e.x, r[13] = e.y, r[14] = e.z) : (r[12] = e, r[13] = t, r[14] = i), this; } invert() { const e = this.elements, t = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a6 = e[5], c = e[6], l = e[7], d = e[8], h6 = e[9], f6 = e[10], g6 = e[11], p = e[12], u6 = e[13], y6 = e[14], v6 = e[15], m6 = h6 * y6 * l - u6 * f6 * l + u6 * c * g6 - a6 * y6 * g6 - h6 * c * v6 + a6 * f6 * v6, x6 = p * f6 * l - d * y6 * l - p * c * g6 + o * y6 * g6 + d * c * v6 - o * f6 * v6, w6 = d * u6 * l - p * h6 * l + p * a6 * g6 - o * u6 * g6 - d * a6 * v6 + o * h6 * v6, A6 = p * h6 * c - d * u6 * c - p * a6 * f6 + o * u6 * f6 + d * a6 * y6 - o * h6 * y6, M6 = t * m6 + i * x6 + r * w6 + s * A6; if (M6 === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const R6 = 1 / M6; return e[0] = m6 * R6, e[1] = (u6 * f6 * s - h6 * y6 * s - u6 * r * g6 + i * y6 * g6 + h6 * r * v6 - i * f6 * v6) * R6, e[2] = (a6 * y6 * s - u6 * c * s + u6 * r * l - i * y6 * l - a6 * r * v6 + i * c * v6) * R6, e[3] = (h6 * c * s - a6 * f6 * s - h6 * r * l + i * f6 * l + a6 * r * g6 - i * c * g6) * R6, e[4] = x6 * R6, e[5] = (d * y6 * s - p * f6 * s + p * r * g6 - t * y6 * g6 - d * r * v6 + t * f6 * v6) * R6, e[6] = (p * c * s - o * y6 * s - p * r * l + t * y6 * l + o * r * v6 - t * c * v6) * R6, e[7] = (o * f6 * s - d * c * s + d * r * l - t * f6 * l - o * r * g6 + t * c * g6) * R6, e[8] = w6 * R6, e[9] = (p * h6 * s - d * u6 * s - p * i * g6 + t * u6 * g6 + d * i * v6 - t * h6 * v6) * R6, e[10] = (o * u6 * s - p * a6 * s + p * i * l - t * u6 * l - o * i * v6 + t * a6 * v6) * R6, e[11] = (d * a6 * s - o * h6 * s - d * i * l + t * h6 * l + o * i * g6 - t * a6 * g6) * R6, e[12] = A6 * R6, e[13] = (d * u6 * r - p * h6 * r + p * i * f6 - t * u6 * f6 - d * i * y6 + t * h6 * y6) * R6, e[14] = (p * a6 * r - o * u6 * r - p * i * c + t * u6 * c + o * i * y6 - t * a6 * y6) * R6, e[15] = (o * h6 * r - d * a6 * r + d * i * c - t * h6 * c - o * i * f6 + t * a6 * f6) * R6, this; } scale(e) { const t = this.elements, i = e.x, r = e.y, s = e.z; return t[0] *= i, t[4] *= r, t[8] *= s, t[1] *= i, t[5] *= r, t[9] *= s, t[2] *= i, t[6] *= r, t[10] *= s, t[3] *= i, t[7] *= r, t[11] *= s, this; } getMaxScaleOnAxis() { const e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]; return Math.sqrt(Math.max(t, i, r)); } makeTranslation(e, t, i) { return this.set( 1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1 ), this; } makeRotationX(e) { const t = Math.cos(e), i = Math.sin(e); return this.set( 1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1 ), this; } makeRotationY(e) { const t = Math.cos(e), i = Math.sin(e); return this.set( t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1 ), this; } makeRotationZ(e) { const t = Math.cos(e), i = Math.sin(e); return this.set( t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ), this; } makeRotationAxis(e, t) { const i = Math.cos(t), r = Math.sin(t), s = 1 - i, o = e.x, a6 = e.y, c = e.z, l = s * o, d = s * a6; return this.set( l * o + i, l * a6 - r * c, l * c + r * a6, 0, l * a6 + r * c, d * a6 + i, d * c - r * o, 0, l * c - r * a6, d * c + r * o, s * c * c + i, 0, 0, 0, 0, 1 ), this; } makeScale(e, t, i) { return this.set( e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1 ), this; } makeShear(e, t, i, r, s, o) { return this.set( 1, i, s, 0, e, 1, o, 0, t, r, 1, 0, 0, 0, 0, 1 ), this; } compose(e, t, i) { const r = this.elements, s = t._x, o = t._y, a6 = t._z, c = t._w, l = s + s, d = o + o, h6 = a6 + a6, f6 = s * l, g6 = s * d, p = s * h6, u6 = o * d, y6 = o * h6, v6 = a6 * h6, m6 = c * l, x6 = c * d, w6 = c * h6, A6 = i.x, M6 = i.y, R6 = i.z; return r[0] = (1 - (u6 + v6)) * A6, r[1] = (g6 + w6) * A6, r[2] = (p - x6) * A6, r[3] = 0, r[4] = (g6 - w6) * M6, r[5] = (1 - (f6 + v6)) * M6, r[6] = (y6 + m6) * M6, r[7] = 0, r[8] = (p + x6) * R6, r[9] = (y6 - m6) * R6, r[10] = (1 - (f6 + u6)) * R6, r[11] = 0, r[12] = e.x, r[13] = e.y, r[14] = e.z, r[15] = 1, this; } decompose(e, t, i) { const r = this.elements; let s = Ys.set(r[0], r[1], r[2]).length(); const o = Ys.set(r[4], r[5], r[6]).length(), a6 = Ys.set(r[8], r[9], r[10]).length(); this.determinant() < 0 && (s = -s), e.x = r[12], e.y = r[13], e.z = r[14], ri.copy(this); const l = 1 / s, d = 1 / o, h6 = 1 / a6; return ri.elements[0] *= l, ri.elements[1] *= l, ri.elements[2] *= l, ri.elements[4] *= d, ri.elements[5] *= d, ri.elements[6] *= d, ri.elements[8] *= h6, ri.elements[9] *= h6, ri.elements[10] *= h6, t.setFromRotationMatrix(ri), i.x = s, i.y = o, i.z = a6, this; } makePerspective(e, t, i, r, s, o) { o === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); const a6 = this.elements, c = 2 * s / (t - e), l = 2 * s / (i - r), d = (t + e) / (t - e), h6 = (i + r) / (i - r), f6 = -(o + s) / (o - s), g6 = -2 * o * s / (o - s); return a6[0] = c, a6[4] = 0, a6[8] = d, a6[12] = 0, a6[1] = 0, a6[5] = l, a6[9] = h6, a6[13] = 0, a6[2] = 0, a6[6] = 0, a6[10] = f6, a6[14] = g6, a6[3] = 0, a6[7] = 0, a6[11] = -1, a6[15] = 0, this; } makeOrthographic(e, t, i, r, s, o) { const a6 = this.elements, c = 1 / (t - e), l = 1 / (i - r), d = 1 / (o - s), h6 = (t + e) * c, f6 = (i + r) * l, g6 = (o + s) * d; return a6[0] = 2 * c, a6[4] = 0, a6[8] = 0, a6[12] = -h6, a6[1] = 0, a6[5] = 2 * l, a6[9] = 0, a6[13] = -f6, a6[2] = 0, a6[6] = 0, a6[10] = -2 * d, a6[14] = -g6, a6[3] = 0, a6[7] = 0, a6[11] = 0, a6[15] = 1, this; } equals(e) { const t = this.elements, i = e.elements; for (let r = 0; r < 16; r++) if (t[r] !== i[r]) return false; return true; } fromArray(e, t = 0) { for (let i = 0; i < 16; i++) this.elements[i] = e[i + t]; return this; } toArray(e = [], t = 0) { const i = this.elements; return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e[t + 9] = i[9], e[t + 10] = i[10], e[t + 11] = i[11], e[t + 12] = i[12], e[t + 13] = i[13], e[t + 14] = i[14], e[t + 15] = i[15], e; } }; Xe.prototype.isMatrix4 = true; var Ys = new q4(); var ri = new Xe(); var yF = new q4(0, 0, 0); var bF = new q4(1, 1, 1); var xr = new q4(); var Ul = new q4(); var Bn = new q4(); var Xm = new Xe(); var Ym = new bn(); var Us = class _Us { constructor(e = 0, t = 0, i = 0, r = _Us.DefaultOrder) { this._x = e, this._y = t, this._z = i, this._order = r; } get x() { return this._x; } set x(e) { this._x = e, this._onChangeCallback(); } get y() { return this._y; } set y(e) { this._y = e, this._onChangeCallback(); } get z() { return this._z; } set z(e) { this._z = e, this._onChangeCallback(); } get order() { return this._order; } set order(e) { this._order = e, this._onChangeCallback(); } set(e, t, i, r = this._order) { return this._x = e, this._y = t, this._z = i, this._order = r, this._onChangeCallback(), this; } clone() { return new this.constructor(this._x, this._y, this._z, this._order); } copy(e) { return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this; } setFromRotationMatrix(e, t = this._order, i = true) { const r = e.elements, s = r[0], o = r[4], a6 = r[8], c = r[1], l = r[5], d = r[9], h6 = r[2], f6 = r[6], g6 = r[10]; switch (t) { case "XYZ": this._y = Math.asin(gn2(a6, -1, 1)), Math.abs(a6) < 0.9999999 ? (this._x = Math.atan2(-d, g6), this._z = Math.atan2(-o, s)) : (this._x = Math.atan2(f6, l), this._z = 0); break; case "YXZ": this._x = Math.asin(-gn2(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(a6, g6), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-h6, s), this._z = 0); break; case "ZXY": this._x = Math.asin(gn2(f6, -1, 1)), Math.abs(f6) < 0.9999999 ? (this._y = Math.atan2(-h6, g6), this._z = Math.atan2(-o, l)) : (this._y = 0, this._z = Math.atan2(c, s)); break; case "ZYX": this._y = Math.asin(-gn2(h6, -1, 1)), Math.abs(h6) < 0.9999999 ? (this._x = Math.atan2(f6, g6), this._z = Math.atan2(c, s)) : (this._x = 0, this._z = Math.atan2(-o, l)); break; case "YZX": this._z = Math.asin(gn2(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-d, l), this._y = Math.atan2(-h6, s)) : (this._x = 0, this._y = Math.atan2(a6, g6)); break; case "XZY": this._z = Math.asin(-gn2(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(f6, l), this._y = Math.atan2(a6, s)) : (this._x = Math.atan2(-d, g6), this._y = 0); break; default: console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t); } return this._order = t, i === true && this._onChangeCallback(), this; } setFromQuaternion(e, t, i) { return Xm.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Xm, t, i); } setFromVector3(e, t = this._order) { return this.set(e.x, e.y, e.z, t); } reorder(e) { return Ym.setFromEuler(this), this.setFromQuaternion(Ym, e); } equals(e) { return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order; } fromArray(e) { return this._x = e[0], this._y = e[1], this._z = e[2], e[3] !== void 0 && (this._order = e[3]), this._onChangeCallback(), this; } toArray(e = [], t = 0) { return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e; } toVector3(e) { return e ? e.set(this._x, this._y, this._z) : new q4(this._x, this._y, this._z); } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } }; Us.prototype.isEuler = true; Us.DefaultOrder = "XYZ"; Us.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]; var Cf = class { constructor() { this.mask = 1; } set(e) { this.mask = 1 << e | 0; } enable(e) { this.mask |= 1 << e | 0; } enableAll() { this.mask = -1; } toggle(e) { this.mask ^= 1 << e | 0; } disable(e) { this.mask &= ~(1 << e | 0); } disableAll() { this.mask = 0; } test(e) { return (this.mask & e.mask) !== 0; } }; var xF = 0; var Jm = new q4(); var Js = new bn(); var $i = new Xe(); var zl = new q4(); var fa = new q4(); var MF = new q4(); var wF = new bn(); var Km = new q4(1, 0, 0); var qm = new q4(0, 1, 0); var Qm = new q4(0, 0, 1); var AF = { type: "added" }; var eg = { type: "removed" }; var ut = class _ut extends Kr { constructor() { super(), Object.defineProperty(this, "id", { value: xF++ }), this.uuid = Wn(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = _ut.DefaultUp.clone(); const e = new q4(), t = new Us(), i = new bn(), r = new q4(1, 1, 1); function s() { i.setFromEuler(t, false); } function o() { t.setFromQuaternion(i, void 0, false); } t._onChange(s), i._onChange(o), Object.defineProperties(this, { position: { configurable: true, enumerable: true, value: e }, rotation: { configurable: true, enumerable: true, value: t }, quaternion: { configurable: true, enumerable: true, value: i }, scale: { configurable: true, enumerable: true, value: r }, modelViewMatrix: { value: new Xe() }, normalMatrix: { value: new rn2() } }), this.matrix = new Xe(), this.matrixWorld = new Xe(), this.matrixAutoUpdate = _ut.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = false, this.layers = new Cf(), this.visible = true, this.castShadow = false, this.receiveShadow = false, this.frustumCulled = true, this.renderOrder = 0, this.animations = [], this.userData = {}; } onBeforeRender() { } onAfterRender() { } applyMatrix4(e) { this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale); } applyQuaternion(e) { return this.quaternion.premultiply(e), this; } setRotationFromAxisAngle(e, t) { this.quaternion.setFromAxisAngle(e, t); } setRotationFromEuler(e) { this.quaternion.setFromEuler(e, true); } setRotationFromMatrix(e) { this.quaternion.setFromRotationMatrix(e); } setRotationFromQuaternion(e) { this.quaternion.copy(e); } rotateOnAxis(e, t) { return Js.setFromAxisAngle(e, t), this.quaternion.multiply(Js), this; } rotateOnWorldAxis(e, t) { return Js.setFromAxisAngle(e, t), this.quaternion.premultiply(Js), this; } rotateX(e) { return this.rotateOnAxis(Km, e); } rotateY(e) { return this.rotateOnAxis(qm, e); } rotateZ(e) { return this.rotateOnAxis(Qm, e); } translateOnAxis(e, t) { return Jm.copy(e).applyQuaternion(this.quaternion), this.position.add(Jm.multiplyScalar(t)), this; } translateX(e) { return this.translateOnAxis(Km, e); } translateY(e) { return this.translateOnAxis(qm, e); } translateZ(e) { return this.translateOnAxis(Qm, e); } localToWorld(e) { return e.applyMatrix4(this.matrixWorld); } worldToLocal(e) { return e.applyMatrix4($i.copy(this.matrixWorld).invert()); } lookAt(e, t, i) { e.isVector3 ? zl.copy(e) : zl.set(e, t, i); const r = this.parent; this.updateWorldMatrix(true, false), fa.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? $i.lookAt(fa, zl, this.up) : $i.lookAt(zl, fa, this.up), this.quaternion.setFromRotationMatrix($i), r && ($i.extractRotation(r.matrixWorld), Js.setFromRotationMatrix($i), this.quaternion.premultiply(Js.invert())); } add(e) { if (arguments.length > 1) { for (let t = 0; t < arguments.length; t++) this.add(arguments[t]); return this; } return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.parent !== null && e.parent.remove(e), e.parent = this, this.children.push(e), e.dispatchEvent(AF)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this); } remove(e) { if (arguments.length > 1) { for (let i = 0; i < arguments.length; i++) this.remove(arguments[i]); return this; } const t = this.children.indexOf(e); return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(eg)), this; } removeFromParent() { const e = this.parent; return e !== null && e.remove(this), this; } clear() { for (let e = 0; e < this.children.length; e++) { const t = this.children[e]; t.parent = null, t.dispatchEvent(eg); } return this.children.length = 0, this; } attach(e) { return this.updateWorldMatrix(true, false), $i.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(true, false), $i.multiply(e.parent.matrixWorld)), e.applyMatrix4($i), this.add(e), e.updateWorldMatrix(false, true), this; } getObjectById(e) { return this.getObjectByProperty("id", e); } getObjectByName(e) { return this.getObjectByProperty("name", e); } getObjectByProperty(e, t) { if (this[e] === t) return this; for (let i = 0, r = this.children.length; i < r; i++) { const o = this.children[i].getObjectByProperty(e, t); if (o !== void 0) return o; } } getWorldPosition(e) { return this.updateWorldMatrix(true, false), e.setFromMatrixPosition(this.matrixWorld); } getWorldQuaternion(e) { return this.updateWorldMatrix(true, false), this.matrixWorld.decompose(fa, e, MF), e; } getWorldScale(e) { return this.updateWorldMatrix(true, false), this.matrixWorld.decompose(fa, wF, e), e; } getWorldDirection(e) { this.updateWorldMatrix(true, false); const t = this.matrixWorld.elements; return e.set(t[8], t[9], t[10]).normalize(); } raycast() { } traverse(e) { e(this); const t = this.children; for (let i = 0, r = t.length; i < r; i++) t[i].traverse(e); } traverseVisible(e) { if (this.visible === false) return; e(this); const t = this.children; for (let i = 0, r = t.length; i < r; i++) t[i].traverseVisible(e); } traverseAncestors(e) { const t = this.parent; t !== null && (e(t), t.traverseAncestors(e)); } updateMatrix() { this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = true; } updateMatrixWorld(e) { this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = false, e = true); const t = this.children; for (let i = 0, r = t.length; i < r; i++) t[i].updateMatrixWorld(e); } updateWorldMatrix(e, t) { const i = this.parent; if (e === true && i !== null && i.updateWorldMatrix(true, false), this.matrixAutoUpdate && this.updateMatrix(), this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), t === true) { const r = this.children; for (let s = 0, o = r.length; s < o; s++) r[s].updateWorldMatrix(false, true); } } toJSON(e) { const t = e === void 0 || typeof e == "string", i = {}; t && (e = { geometries: {}, materials: {}, textures: {}, images: {}, shapes: {}, skeletons: {}, animations: {} }, i.metadata = { version: 4.5, type: "Object", generator: "Object3D.toJSON" }); const r = {}; r.uuid = this.uuid, r.type = this.type, this.name !== "" && (r.name = this.name), this.castShadow === true && (r.castShadow = true), this.receiveShadow === true && (r.receiveShadow = true), this.visible === false && (r.visible = false), this.frustumCulled === false && (r.frustumCulled = false), this.renderOrder !== 0 && (r.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (r.userData = this.userData), r.layers = this.layers.mask, r.matrix = this.matrix.toArray(), this.matrixAutoUpdate === false && (r.matrixAutoUpdate = false), this.isInstancedMesh && (r.type = "InstancedMesh", r.count = this.count, r.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (r.instanceColor = this.instanceColor.toJSON())); function s(a6, c) { return a6[c.uuid] === void 0 && (a6[c.uuid] = c.toJSON(e)), c.uuid; } if (this.isScene) this.background && (this.background.isColor ? r.background = this.background.toJSON() : this.background.isTexture && (r.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (r.environment = this.environment.toJSON(e).uuid); else if (this.isMesh || this.isLine || this.isPoints) { r.geometry = s(e.geometries, this.geometry); const a6 = this.geometry.parameters; if (a6 !== void 0 && a6.shapes !== void 0) { const c = a6.shapes; if (Array.isArray(c)) for (let l = 0, d = c.length; l < d; l++) { const h6 = c[l]; s(e.shapes, h6); } else s(e.shapes, c); } } if (this.isSkinnedMesh && (r.bindMode = this.bindMode, r.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (s(e.skeletons, this.skeleton), r.skeleton = this.skeleton.uuid)), this.material !== void 0) if (Array.isArray(this.material)) { const a6 = []; for (let c = 0, l = this.material.length; c < l; c++) a6.push(s(e.materials, this.material[c])); r.material = a6; } else r.material = s(e.materials, this.material); if (this.children.length > 0) { r.children = []; for (let a6 = 0; a6 < this.children.length; a6++) r.children.push(this.children[a6].toJSON(e).object); } if (this.animations.length > 0) { r.animations = []; for (let a6 = 0; a6 < this.animations.length; a6++) { const c = this.animations[a6]; r.animations.push(s(e.animations, c)); } } if (t) { const a6 = o(e.geometries), c = o(e.materials), l = o(e.textures), d = o(e.images), h6 = o(e.shapes), f6 = o(e.skeletons), g6 = o(e.animations); a6.length > 0 && (i.geometries = a6), c.length > 0 && (i.materials = c), l.length > 0 && (i.textures = l), d.length > 0 && (i.images = d), h6.length > 0 && (i.shapes = h6), f6.length > 0 && (i.skeletons = f6), g6.length > 0 && (i.animations = g6); } return i.object = r, i; function o(a6) { const c = []; for (const l in a6) { const d = a6[l]; delete d.metadata, c.push(d); } return c; } } clone(e) { return new this.constructor().copy(this, e); } copy(e, t = true) { if (this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.rotation.order = e.rotation.order, this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.layers.mask = e.layers.mask, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.userData = JSON.parse(JSON.stringify(e.userData)), t === true) for (let i = 0; i < e.children.length; i++) { const r = e.children[i]; this.add(r.clone()); } return this; } }; ut.DefaultUp = new q4(0, 1, 0); ut.DefaultMatrixAutoUpdate = true; ut.prototype.isObject3D = true; var si = new q4(); var Zi = new q4(); var th = new q4(); var Xi = new q4(); var Ks = new q4(); var qs = new q4(); var tg = new q4(); var nh = new q4(); var ih = new q4(); var rh = new q4(); var Zt = class _Zt { constructor(e = new q4(), t = new q4(), i = new q4()) { this.a = e, this.b = t, this.c = i; } static getNormal(e, t, i, r) { r.subVectors(i, t), si.subVectors(e, t), r.cross(si); const s = r.lengthSq(); return s > 0 ? r.multiplyScalar(1 / Math.sqrt(s)) : r.set(0, 0, 0); } // static/instance method to calculate barycentric coordinates // based on: http://www.blackpawn.com/texts/pointinpoly/default.html static getBarycoord(e, t, i, r, s) { si.subVectors(r, t), Zi.subVectors(i, t), th.subVectors(e, t); const o = si.dot(si), a6 = si.dot(Zi), c = si.dot(th), l = Zi.dot(Zi), d = Zi.dot(th), h6 = o * l - a6 * a6; if (h6 === 0) return s.set(-2, -1, -1); const f6 = 1 / h6, g6 = (l * c - a6 * d) * f6, p = (o * d - a6 * c) * f6; return s.set(1 - g6 - p, p, g6); } static containsPoint(e, t, i, r) { return this.getBarycoord(e, t, i, r, Xi), Xi.x >= 0 && Xi.y >= 0 && Xi.x + Xi.y <= 1; } static getUV(e, t, i, r, s, o, a6, c) { return this.getBarycoord(e, t, i, r, Xi), c.set(0, 0), c.addScaledVector(s, Xi.x), c.addScaledVector(o, Xi.y), c.addScaledVector(a6, Xi.z), c; } static isFrontFacing(e, t, i, r) { return si.subVectors(i, t), Zi.subVectors(e, t), si.cross(Zi).dot(r) < 0; } set(e, t, i) { return this.a.copy(e), this.b.copy(t), this.c.copy(i), this; } setFromPointsAndIndices(e, t, i, r) { return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[r]), this; } clone() { return new this.constructor().copy(this); } copy(e) { return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this; } getArea() { return si.subVectors(this.c, this.b), Zi.subVectors(this.a, this.b), si.cross(Zi).length() * 0.5; } getMidpoint(e) { return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3); } getNormal(e) { return _Zt.getNormal(this.a, this.b, this.c, e); } getPlane(e) { return e.setFromCoplanarPoints(this.a, this.b, this.c); } getBarycoord(e, t) { return _Zt.getBarycoord(e, this.a, this.b, this.c, t); } getUV(e, t, i, r, s) { return _Zt.getUV(e, this.a, this.b, this.c, t, i, r, s); } containsPoint(e) { return _Zt.containsPoint(e, this.a, this.b, this.c); } isFrontFacing(e) { return _Zt.isFrontFacing(this.a, this.b, this.c, e); } intersectsBox(e) { return e.intersectsTriangle(this); } closestPointToPoint(e, t) { const i = this.a, r = this.b, s = this.c; let o, a6; Ks.subVectors(r, i), qs.subVectors(s, i), nh.subVectors(e, i); const c = Ks.dot(nh), l = qs.dot(nh); if (c <= 0 && l <= 0) return t.copy(i); ih.subVectors(e, r); const d = Ks.dot(ih), h6 = qs.dot(ih); if (d >= 0 && h6 <= d) return t.copy(r); const f6 = c * h6 - d * l; if (f6 <= 0 && c >= 0 && d <= 0) return o = c / (c - d), t.copy(i).addScaledVector(Ks, o); rh.subVectors(e, s); const g6 = Ks.dot(rh), p = qs.dot(rh); if (p >= 0 && g6 <= p) return t.copy(s); const u6 = g6 * l - c * p; if (u6 <= 0 && l >= 0 && p <= 0) return a6 = l / (l - p), t.copy(i).addScaledVector(qs, a6); const y6 = d * p - g6 * h6; if (y6 <= 0 && h6 - d >= 0 && g6 - p >= 0) return tg.subVectors(s, r), a6 = (h6 - d) / (h6 - d + (g6 - p)), t.copy(r).addScaledVector(tg, a6); const v6 = 1 / (y6 + u6 + f6); return o = u6 * v6, a6 = f6 * v6, t.copy(i).addScaledVector(Ks, o).addScaledVector(qs, a6); } equals(e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c); } }; var SF = 0; var tn2 = class extends Kr { constructor() { super(), Object.defineProperty(this, "id", { value: SF++ }), this.uuid = Wn(), this.name = "", this.type = "Material", this.fog = true, this.blending = vo, this.side = Hr, this.vertexColors = false, this.opacity = 1, this.transparent = false, this.blendSrc = bf, this.blendDst = xf, this.blendEquation = ps, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = kc, this.depthTest = true, this.depthWrite = true, this.stencilWriteMask = 255, this.stencilFunc = Qb, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Lc, this.stencilZFail = Lc, this.stencilZPass = Lc, this.stencilWrite = false, this.clippingPlanes = null, this.clipIntersection = false, this.clipShadows = false, this.shadowSide = null, this.colorWrite = true, this.precision = null, this.polygonOffset = false, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = false, this.alphaTest = 0, this.alphaToCoverage = false, this.premultipliedAlpha = false, this.visible = true, this.toneMapped = true, this.userData = {}, this.version = 0; } onBuild() { } onBeforeCompile() { } customProgramCacheKey() { return this.onBeforeCompile.toString(); } setValues(e) { if (e !== void 0) for (const t in e) { const i = e[t]; if (i === void 0) { console.warn("THREE.Material: '" + t + "' parameter is undefined."); continue; } if (t === "shading") { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = i === yf; continue; } const r = this[t]; if (r === void 0) { console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material."); continue; } r && r.isColor ? r.set(i) : r && r.isVector3 && i && i.isVector3 ? r.copy(i) : this[t] = i; } } toJSON(e) { const t = e === void 0 || typeof e == "string"; t && (e = { textures: {}, images: {} }); const i = { metadata: { version: 4.5, type: "Material", generator: "Material.toJSON" } }; i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen && this.sheen.isColor && (i.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== vo && (i.blending = this.blending), this.side !== Hr && (i.side = this.side), this.vertexColors && (i.vertexColors = true), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === true && (i.transparent = this.transparent), i.depthFunc = this.depthFunc, i.depthTest = this.depthTest, i.depthWrite = this.depthWrite, i.colorWrite = this.colorWrite, i.stencilWrite = this.stencilWrite, i.stencilWriteMask = this.stencilWriteMask, i.stencilFunc = this.stencilFunc, i.stencilRef = this.stencilRef, i.stencilFuncMask = this.stencilFuncMask, i.stencilFail = this.stencilFail, i.stencilZFail = this.stencilZFail, i.stencilZPass = this.stencilZPass, this.rotation && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === true && (i.polygonOffset = true), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === true && (i.dithering = true), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaToCoverage === true && (i.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === true && (i.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === true && (i.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.morphTargets === true && (i.morphTargets = true), this.morphNormals === true && (i.morphNormals = true), this.flatShading === true && (i.flatShading = this.flatShading), this.visible === false && (i.visible = false), this.toneMapped === false && (i.toneMapped = false), JSON.stringify(this.userData) !== "{}" && (i.userData = this.userData); function r(s) { const o = []; for (const a6 in s) { const c = s[a6]; delete c.metadata, o.push(c); } return o; } if (t) { const s = r(e.textures), o = r(e.images); s.length > 0 && (i.textures = s), o.length > 0 && (i.images = o); } return i; } clone() { return new this.constructor().copy(this); } copy(e) { this.name = e.name, this.fog = e.fog, this.blending = e.blending, this.side = e.side, this.vertexColors = e.vertexColors, this.opacity = e.opacity, this.transparent = e.transparent, this.blendSrc = e.blendSrc, this.blendDst = e.blendDst, this.blendEquation = e.blendEquation, this.blendSrcAlpha = e.blendSrcAlpha, this.blendDstAlpha = e.blendDstAlpha, this.blendEquationAlpha = e.blendEquationAlpha, this.depthFunc = e.depthFunc, this.depthTest = e.depthTest, this.depthWrite = e.depthWrite, this.stencilWriteMask = e.stencilWriteMask, this.stencilFunc = e.stencilFunc, this.stencilRef = e.stencilRef, this.stencilFuncMask = e.stencilFuncMask, this.stencilFail = e.stencilFail, this.stencilZFail = e.stencilZFail, this.stencilZPass = e.stencilZPass, this.stencilWrite = e.stencilWrite; const t = e.clippingPlanes; let i = null; if (t !== null) { const r = t.length; i = new Array(r); for (let s = 0; s !== r; ++s) i[s] = t[s].clone(); } return this.clippingPlanes = i, this.clipIntersection = e.clipIntersection, this.clipShadows = e.clipShadows, this.shadowSide = e.shadowSide, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this; } dispose() { this.dispatchEvent({ type: "dispose" }); } set needsUpdate(e) { e === true && this.version++; } }; tn2.prototype.isMaterial = true; var ix = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }; var oi = { h: 0, s: 0, l: 0 }; var kl = { h: 0, s: 0, l: 0 }; function sh(n, e, t) { return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * 6 * (2 / 3 - t) : n; } function oh(n) { return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4); } function ah(n) { return n < 31308e-7 ? n * 12.92 : 1.055 * Math.pow(n, 0.41666) - 0.055; } var Ue = class { constructor(e, t, i) { return t === void 0 && i === void 0 ? this.set(e) : this.setRGB(e, t, i); } set(e) { return e && e.isColor ? this.copy(e) : typeof e == "number" ? this.setHex(e) : typeof e == "string" && this.setStyle(e), this; } setScalar(e) { return this.r = e, this.g = e, this.b = e, this; } setHex(e) { return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, this; } setRGB(e, t, i) { return this.r = e, this.g = t, this.b = i, this; } setHSL(e, t, i) { if (e = Tf(e, 1), t = gn2(t, 0, 1), i = gn2(i, 0, 1), t === 0) this.r = this.g = this.b = i; else { const r = i <= 0.5 ? i * (1 + t) : i + t - i * t, s = 2 * i - r; this.r = sh(s, r, e + 1 / 3), this.g = sh(s, r, e), this.b = sh(s, r, e - 1 / 3); } return this; } setStyle(e) { function t(r) { r !== void 0 && parseFloat(r) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored."); } let i; if (i = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) { let r; const s = i[1], o = i[2]; switch (s) { case "rgb": case "rgba": if (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) return this.r = Math.min(255, parseInt(r[1], 10)) / 255, this.g = Math.min(255, parseInt(r[2], 10)) / 255, this.b = Math.min(255, parseInt(r[3], 10)) / 255, t(r[4]), this; if (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) return this.r = Math.min(100, parseInt(r[1], 10)) / 100, this.g = Math.min(100, parseInt(r[2], 10)) / 100, this.b = Math.min(100, parseInt(r[3], 10)) / 100, t(r[4]), this; break; case "hsl": case "hsla": if (r = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) { const a6 = parseFloat(r[1]) / 360, c = parseInt(r[2], 10) / 100, l = parseInt(r[3], 10) / 100; return t(r[4]), this.setHSL(a6, c, l); } break; } } else if (i = /^\#([A-Fa-f\d]+)$/.exec(e)) { const r = i[1], s = r.length; if (s === 3) return this.r = parseInt(r.charAt(0) + r.charAt(0), 16) / 255, this.g = parseInt(r.charAt(1) + r.charAt(1), 16) / 255, this.b = parseInt(r.charAt(2) + r.charAt(2), 16) / 255, this; if (s === 6) return this.r = parseInt(r.charAt(0) + r.charAt(1), 16) / 255, this.g = parseInt(r.charAt(2) + r.charAt(3), 16) / 255, this.b = parseInt(r.charAt(4) + r.charAt(5), 16) / 255, this; } return e && e.length > 0 ? this.setColorName(e) : this; } setColorName(e) { const t = ix[e.toLowerCase()]; return t !== void 0 ? this.setHex(t) : console.warn("THREE.Color: Unknown color " + e), this; } clone() { return new this.constructor(this.r, this.g, this.b); } copy(e) { return this.r = e.r, this.g = e.g, this.b = e.b, this; } copyGammaToLinear(e, t = 2) { return this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this; } copyLinearToGamma(e, t = 2) { const i = t > 0 ? 1 / t : 1; return this.r = Math.pow(e.r, i), this.g = Math.pow(e.g, i), this.b = Math.pow(e.b, i), this; } convertGammaToLinear(e) { return this.copyGammaToLinear(this, e), this; } convertLinearToGamma(e) { return this.copyLinearToGamma(this, e), this; } copySRGBToLinear(e) { return this.r = oh(e.r), this.g = oh(e.g), this.b = oh(e.b), this; } copyLinearToSRGB(e) { return this.r = ah(e.r), this.g = ah(e.g), this.b = ah(e.b), this; } convertSRGBToLinear() { return this.copySRGBToLinear(this), this; } convertLinearToSRGB() { return this.copyLinearToSRGB(this), this; } getHex() { return this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0; } getHexString() { return ("000000" + this.getHex().toString(16)).slice(-6); } getHSL(e) { const t = this.r, i = this.g, r = this.b, s = Math.max(t, i, r), o = Math.min(t, i, r); let a6, c; const l = (o + s) / 2; if (o === s) a6 = 0, c = 0; else { const d = s - o; switch (c = l <= 0.5 ? d / (s + o) : d / (2 - s - o), s) { case t: a6 = (i - r) / d + (i < r ? 6 : 0); break; case i: a6 = (r - t) / d + 2; break; case r: a6 = (t - i) / d + 4; break; } a6 /= 6; } return e.h = a6, e.s = c, e.l = l, e; } getStyle() { return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")"; } offsetHSL(e, t, i) { return this.getHSL(oi), oi.h += e, oi.s += t, oi.l += i, this.setHSL(oi.h, oi.s, oi.l), this; } add(e) { return this.r += e.r, this.g += e.g, this.b += e.b, this; } addColors(e, t) { return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this; } addScalar(e) { return this.r += e, this.g += e, this.b += e, this; } sub(e) { return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this; } multiply(e) { return this.r *= e.r, this.g *= e.g, this.b *= e.b, this; } multiplyScalar(e) { return this.r *= e, this.g *= e, this.b *= e, this; } lerp(e, t) { return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this; } lerpColors(e, t, i) { return this.r = e.r + (t.r - e.r) * i, this.g = e.g + (t.g - e.g) * i, this.b = e.b + (t.b - e.b) * i, this; } lerpHSL(e, t) { this.getHSL(oi), e.getHSL(kl); const i = Fa(oi.h, kl.h, t), r = Fa(oi.s, kl.s, t), s = Fa(oi.l, kl.l, t); return this.setHSL(i, r, s), this; } equals(e) { return e.r === this.r && e.g === this.g && e.b === this.b; } fromArray(e, t = 0) { return this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this; } toArray(e = [], t = 0) { return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e; } fromBufferAttribute(e, t) { return this.r = e.getX(t), this.g = e.getY(t), this.b = e.getZ(t), e.normalized === true && (this.r /= 255, this.g /= 255, this.b /= 255), this; } toJSON() { return this.getHex(); } }; Ue.NAMES = ix; Ue.prototype.isColor = true; Ue.prototype.r = 1; Ue.prototype.g = 1; Ue.prototype.b = 1; var In = class extends tn2 { constructor(e) { super(), this.type = "MeshBasicMaterial", this.color = new Ue(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = al, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this; } }; In.prototype.isMeshBasicMaterial = true; var St = new q4(); var Vl = new Re(); var ot = class { constructor(e, t, i) { if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = i === true, this.usage = Ro, this.updateRange = { offset: 0, count: -1 }, this.version = 0; } onUploadCallback() { } set needsUpdate(e) { e === true && this.version++; } setUsage(e) { return this.usage = e, this; } copy(e) { return this.name = e.name, this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.count = e.count, this.normalized = e.normalized, this.usage = e.usage, this; } copyAt(e, t, i) { e *= this.itemSize, i *= t.itemSize; for (let r = 0, s = this.itemSize; r < s; r++) this.array[e + r] = t.array[i + r]; return this; } copyArray(e) { return this.array.set(e), this; } copyColorsArray(e) { const t = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r), o = new Ue()), t[i++] = o.r, t[i++] = o.g, t[i++] = o.b; } return this; } copyVector2sArray(e) { const t = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r), o = new Re()), t[i++] = o.x, t[i++] = o.y; } return this; } copyVector3sArray(e) { const t = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r), o = new q4()), t[i++] = o.x, t[i++] = o.y, t[i++] = o.z; } return this; } copyVector4sArray(e) { const t = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r), o = new xt()), t[i++] = o.x, t[i++] = o.y, t[i++] = o.z, t[i++] = o.w; } return this; } applyMatrix3(e) { if (this.itemSize === 2) for (let t = 0, i = this.count; t < i; t++) Vl.fromBufferAttribute(this, t), Vl.applyMatrix3(e), this.setXY(t, Vl.x, Vl.y); else if (this.itemSize === 3) for (let t = 0, i = this.count; t < i; t++) St.fromBufferAttribute(this, t), St.applyMatrix3(e), this.setXYZ(t, St.x, St.y, St.z); return this; } applyMatrix4(e) { for (let t = 0, i = this.count; t < i; t++) St.x = this.getX(t), St.y = this.getY(t), St.z = this.getZ(t), St.applyMatrix4(e), this.setXYZ(t, St.x, St.y, St.z); return this; } applyNormalMatrix(e) { for (let t = 0, i = this.count; t < i; t++) St.x = this.getX(t), St.y = this.getY(t), St.z = this.getZ(t), St.applyNormalMatrix(e), this.setXYZ(t, St.x, St.y, St.z); return this; } transformDirection(e) { for (let t = 0, i = this.count; t < i; t++) St.x = this.getX(t), St.y = this.getY(t), St.z = this.getZ(t), St.transformDirection(e), this.setXYZ(t, St.x, St.y, St.z); return this; } set(e, t = 0) { return this.array.set(e, t), this; } getX(e) { return this.array[e * this.itemSize]; } setX(e, t) { return this.array[e * this.itemSize] = t, this; } getY(e) { return this.array[e * this.itemSize + 1]; } setY(e, t) { return this.array[e * this.itemSize + 1] = t, this; } getZ(e) { return this.array[e * this.itemSize + 2]; } setZ(e, t) { return this.array[e * this.itemSize + 2] = t, this; } getW(e) { return this.array[e * this.itemSize + 3]; } setW(e, t) { return this.array[e * this.itemSize + 3] = t, this; } setXY(e, t, i) { return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this; } setXYZ(e, t, i, r) { return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = r, this; } setXYZW(e, t, i, r, s) { return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = r, this.array[e + 3] = s, this; } onUpload(e) { return this.onUploadCallback = e, this; } clone() { return new this.constructor(this.array, this.itemSize).copy(this); } toJSON() { const e = { itemSize: this.itemSize, type: this.array.constructor.name, array: Array.prototype.slice.call(this.array), normalized: this.normalized }; return this.name !== "" && (e.name = this.name), this.usage !== Ro && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e; } }; ot.prototype.isBufferAttribute = true; var rx = class extends ot { constructor(e, t, i) { super(new Int8Array(e), t, i); } }; var sx = class extends ot { constructor(e, t, i) { super(new Uint8Array(e), t, i); } }; var ox = class extends ot { constructor(e, t, i) { super(new Uint8ClampedArray(e), t, i); } }; var ax = class extends ot { constructor(e, t, i) { super(new Int16Array(e), t, i); } }; var gu = class extends ot { constructor(e, t, i) { super(new Uint16Array(e), t, i); } }; var lx = class extends ot { constructor(e, t, i) { super(new Int32Array(e), t, i); } }; var vu = class extends ot { constructor(e, t, i) { super(new Uint32Array(e), t, i); } }; var cx = class extends ot { constructor(e, t, i) { super(new Uint16Array(e), t, i); } }; cx.prototype.isFloat16BufferAttribute = true; var We = class extends ot { constructor(e, t, i) { super(new Float32Array(e), t, i); } }; var ux = class extends ot { constructor(e, t, i) { super(new Float64Array(e), t, i); } }; function hx(n) { if (n.length === 0) return -1 / 0; let e = n[0]; for (let t = 1, i = n.length; t < i; ++t) n[t] > e && (e = n[t]); return e; } var _F = { Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array }; function mo(n, e) { return new _F[n](e); } var TF = 0; var Yn = new Xe(); var lh = new ut(); var Qs = new q4(); var Un = new Nn(); var pa = new Nn(); var cn2 = new q4(); var Ke = class _Ke extends Kr { constructor() { super(), Object.defineProperty(this, "id", { value: TF++ }), this.uuid = Wn(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = false, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {}; } getIndex() { return this.index; } setIndex(e) { return Array.isArray(e) ? this.index = new (hx(e) > 65535 ? vu : gu)(e, 1) : this.index = e, this; } getAttribute(e) { return this.attributes[e]; } setAttribute(e, t) { return this.attributes[e] = t, this; } deleteAttribute(e) { return delete this.attributes[e], this; } hasAttribute(e) { return this.attributes[e] !== void 0; } addGroup(e, t, i = 0) { this.groups.push({ start: e, count: t, materialIndex: i }); } clearGroups() { this.groups = []; } setDrawRange(e, t) { this.drawRange.start = e, this.drawRange.count = t; } applyMatrix4(e) { const t = this.attributes.position; t !== void 0 && (t.applyMatrix4(e), t.needsUpdate = true); const i = this.attributes.normal; if (i !== void 0) { const s = new rn2().getNormalMatrix(e); i.applyNormalMatrix(s), i.needsUpdate = true; } const r = this.attributes.tangent; return r !== void 0 && (r.transformDirection(e), r.needsUpdate = true), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } applyQuaternion(e) { return Yn.makeRotationFromQuaternion(e), this.applyMatrix4(Yn), this; } rotateX(e) { return Yn.makeRotationX(e), this.applyMatrix4(Yn), this; } rotateY(e) { return Yn.makeRotationY(e), this.applyMatrix4(Yn), this; } rotateZ(e) { return Yn.makeRotationZ(e), this.applyMatrix4(Yn), this; } translate(e, t, i) { return Yn.makeTranslation(e, t, i), this.applyMatrix4(Yn), this; } scale(e, t, i) { return Yn.makeScale(e, t, i), this.applyMatrix4(Yn), this; } lookAt(e) { return lh.lookAt(e), lh.updateMatrix(), this.applyMatrix4(lh.matrix), this; } center() { return this.computeBoundingBox(), this.boundingBox.getCenter(Qs).negate(), this.translate(Qs.x, Qs.y, Qs.z), this; } setFromPoints(e) { const t = []; for (let i = 0, r = e.length; i < r; i++) { const s = e[i]; t.push(s.x, s.y, s.z || 0); } return this.setAttribute("position", new We(t, 3)), this; } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new Nn()); const e = this.attributes.position, t = this.morphAttributes.position; if (e && e.isGLBufferAttribute) { console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingBox.set( new q4(-1 / 0, -1 / 0, -1 / 0), new q4(1 / 0, 1 / 0, 1 / 0) ); return; } if (e !== void 0) { if (this.boundingBox.setFromBufferAttribute(e), t) for (let i = 0, r = t.length; i < r; i++) { const s = t[i]; Un.setFromBufferAttribute(s), this.morphTargetsRelative ? (cn2.addVectors(this.boundingBox.min, Un.min), this.boundingBox.expandByPoint(cn2), cn2.addVectors(this.boundingBox.max, Un.max), this.boundingBox.expandByPoint(cn2)) : (this.boundingBox.expandByPoint(Un.min), this.boundingBox.expandByPoint(Un.max)); } } else this.boundingBox.makeEmpty(); (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this); } computeBoundingSphere() { this.boundingSphere === null && (this.boundingSphere = new mr()); const e = this.attributes.position, t = this.morphAttributes.position; if (e && e.isGLBufferAttribute) { console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingSphere.set(new q4(), 1 / 0); return; } if (e) { const i = this.boundingSphere.center; if (Un.setFromBufferAttribute(e), t) for (let s = 0, o = t.length; s < o; s++) { const a6 = t[s]; pa.setFromBufferAttribute(a6), this.morphTargetsRelative ? (cn2.addVectors(Un.min, pa.min), Un.expandByPoint(cn2), cn2.addVectors(Un.max, pa.max), Un.expandByPoint(cn2)) : (Un.expandByPoint(pa.min), Un.expandByPoint(pa.max)); } Un.getCenter(i); let r = 0; for (let s = 0, o = e.count; s < o; s++) cn2.fromBufferAttribute(e, s), r = Math.max(r, i.distanceToSquared(cn2)); if (t) for (let s = 0, o = t.length; s < o; s++) { const a6 = t[s], c = this.morphTargetsRelative; for (let l = 0, d = a6.count; l < d; l++) cn2.fromBufferAttribute(a6, l), c && (Qs.fromBufferAttribute(e, l), cn2.add(Qs)), r = Math.max(r, i.distanceToSquared(cn2)); } this.boundingSphere.radius = Math.sqrt(r), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this); } } computeFaceNormals() { } computeTangents() { const e = this.index, t = this.attributes; if (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) { console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)"); return; } const i = e.array, r = t.position.array, s = t.normal.array, o = t.uv.array, a6 = r.length / 3; t.tangent === void 0 && this.setAttribute("tangent", new ot(new Float32Array(4 * a6), 4)); const c = t.tangent.array, l = [], d = []; for (let P6 = 0; P6 < a6; P6++) l[P6] = new q4(), d[P6] = new q4(); const h6 = new q4(), f6 = new q4(), g6 = new q4(), p = new Re(), u6 = new Re(), y6 = new Re(), v6 = new q4(), m6 = new q4(); function x6(P6, _6, S6) { h6.fromArray(r, P6 * 3), f6.fromArray(r, _6 * 3), g6.fromArray(r, S6 * 3), p.fromArray(o, P6 * 2), u6.fromArray(o, _6 * 2), y6.fromArray(o, S6 * 2), f6.sub(h6), g6.sub(h6), u6.sub(p), y6.sub(p); const E6 = 1 / (u6.x * y6.y - y6.x * u6.y); isFinite(E6) && (v6.copy(f6).multiplyScalar(y6.y).addScaledVector(g6, -u6.y).multiplyScalar(E6), m6.copy(g6).multiplyScalar(u6.x).addScaledVector(f6, -y6.x).multiplyScalar(E6), l[P6].add(v6), l[_6].add(v6), l[S6].add(v6), d[P6].add(m6), d[_6].add(m6), d[S6].add(m6)); } let w6 = this.groups; w6.length === 0 && (w6 = [{ start: 0, count: i.length }]); for (let P6 = 0, _6 = w6.length; P6 < _6; ++P6) { const S6 = w6[P6], E6 = S6.start, C6 = S6.count; for (let I6 = E6, b6 = E6 + C6; I6 < b6; I6 += 3) x6( i[I6 + 0], i[I6 + 1], i[I6 + 2] ); } const A6 = new q4(), M6 = new q4(), R6 = new q4(), L6 = new q4(); function T6(P6) { R6.fromArray(s, P6 * 3), L6.copy(R6); const _6 = l[P6]; A6.copy(_6), A6.sub(R6.multiplyScalar(R6.dot(_6))).normalize(), M6.crossVectors(L6, _6); const E6 = M6.dot(d[P6]) < 0 ? -1 : 1; c[P6 * 4] = A6.x, c[P6 * 4 + 1] = A6.y, c[P6 * 4 + 2] = A6.z, c[P6 * 4 + 3] = E6; } for (let P6 = 0, _6 = w6.length; P6 < _6; ++P6) { const S6 = w6[P6], E6 = S6.start, C6 = S6.count; for (let I6 = E6, b6 = E6 + C6; I6 < b6; I6 += 3) T6(i[I6 + 0]), T6(i[I6 + 1]), T6(i[I6 + 2]); } } computeVertexNormals() { const e = this.index, t = this.getAttribute("position"); if (t !== void 0) { let i = this.getAttribute("normal"); if (i === void 0) i = new ot(new Float32Array(t.count * 3), 3), this.setAttribute("normal", i); else for (let f6 = 0, g6 = i.count; f6 < g6; f6++) i.setXYZ(f6, 0, 0, 0); const r = new q4(), s = new q4(), o = new q4(), a6 = new q4(), c = new q4(), l = new q4(), d = new q4(), h6 = new q4(); if (e) for (let f6 = 0, g6 = e.count; f6 < g6; f6 += 3) { const p = e.getX(f6 + 0), u6 = e.getX(f6 + 1), y6 = e.getX(f6 + 2); r.fromBufferAttribute(t, p), s.fromBufferAttribute(t, u6), o.fromBufferAttribute(t, y6), d.subVectors(o, s), h6.subVectors(r, s), d.cross(h6), a6.fromBufferAttribute(i, p), c.fromBufferAttribute(i, u6), l.fromBufferAttribute(i, y6), a6.add(d), c.add(d), l.add(d), i.setXYZ(p, a6.x, a6.y, a6.z), i.setXYZ(u6, c.x, c.y, c.z), i.setXYZ(y6, l.x, l.y, l.z); } else for (let f6 = 0, g6 = t.count; f6 < g6; f6 += 3) r.fromBufferAttribute(t, f6 + 0), s.fromBufferAttribute(t, f6 + 1), o.fromBufferAttribute(t, f6 + 2), d.subVectors(o, s), h6.subVectors(r, s), d.cross(h6), i.setXYZ(f6 + 0, d.x, d.y, d.z), i.setXYZ(f6 + 1, d.x, d.y, d.z), i.setXYZ(f6 + 2, d.x, d.y, d.z); this.normalizeNormals(), i.needsUpdate = true; } } merge(e, t) { if (!(e && e.isBufferGeometry)) { console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e); return; } t === void 0 && (t = 0, console.warn( "THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge." )); const i = this.attributes; for (const r in i) { if (e.attributes[r] === void 0) continue; const o = i[r].array, a6 = e.attributes[r], c = a6.array, l = a6.itemSize * t, d = Math.min(c.length, o.length - l); for (let h6 = 0, f6 = l; h6 < d; h6++, f6++) o[f6] = c[h6]; } return this; } normalizeNormals() { const e = this.attributes.normal; for (let t = 0, i = e.count; t < i; t++) cn2.fromBufferAttribute(e, t), cn2.normalize(), e.setXYZ(t, cn2.x, cn2.y, cn2.z); } toNonIndexed() { function e(a6, c) { const l = a6.array, d = a6.itemSize, h6 = a6.normalized, f6 = new l.constructor(c.length * d); let g6 = 0, p = 0; for (let u6 = 0, y6 = c.length; u6 < y6; u6++) { a6.isInterleavedBufferAttribute ? g6 = c[u6] * a6.data.stride + a6.offset : g6 = c[u6] * d; for (let v6 = 0; v6 < d; v6++) f6[p++] = l[g6++]; } return new ot(f6, d, h6); } if (this.index === null) return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this; const t = new _Ke(), i = this.index.array, r = this.attributes; for (const a6 in r) { const c = r[a6], l = e(c, i); t.setAttribute(a6, l); } const s = this.morphAttributes; for (const a6 in s) { const c = [], l = s[a6]; for (let d = 0, h6 = l.length; d < h6; d++) { const f6 = l[d], g6 = e(f6, i); c.push(g6); } t.morphAttributes[a6] = c; } t.morphTargetsRelative = this.morphTargetsRelative; const o = this.groups; for (let a6 = 0, c = o.length; a6 < c; a6++) { const l = o[a6]; t.addGroup(l.start, l.count, l.materialIndex); } return t; } toJSON() { const e = { metadata: { version: 4.5, type: "BufferGeometry", generator: "BufferGeometry.toJSON" } }; if (e.uuid = this.uuid, e.type = this.type, this.name !== "" && (e.name = this.name), Object.keys(this.userData).length > 0 && (e.userData = this.userData), this.parameters !== void 0) { const c = this.parameters; for (const l in c) c[l] !== void 0 && (e[l] = c[l]); return e; } e.data = { attributes: {} }; const t = this.index; t !== null && (e.data.index = { type: t.array.constructor.name, array: Array.prototype.slice.call(t.array) }); const i = this.attributes; for (const c in i) { const l = i[c]; e.data.attributes[c] = l.toJSON(e.data); } const r = {}; let s = false; for (const c in this.morphAttributes) { const l = this.morphAttributes[c], d = []; for (let h6 = 0, f6 = l.length; h6 < f6; h6++) { const g6 = l[h6]; d.push(g6.toJSON(e.data)); } d.length > 0 && (r[c] = d, s = true); } s && (e.data.morphAttributes = r, e.data.morphTargetsRelative = this.morphTargetsRelative); const o = this.groups; o.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(o))); const a6 = this.boundingSphere; return a6 !== null && (e.data.boundingSphere = { center: a6.center.toArray(), radius: a6.radius }), e; } clone() { return new _Ke().copy(this); } copy(e) { this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null; const t = {}; this.name = e.name; const i = e.index; i !== null && this.setIndex(i.clone(t)); const r = e.attributes; for (const l in r) { const d = r[l]; this.setAttribute(l, d.clone(t)); } const s = e.morphAttributes; for (const l in s) { const d = [], h6 = s[l]; for (let f6 = 0, g6 = h6.length; f6 < g6; f6++) d.push(h6[f6].clone(t)); this.morphAttributes[l] = d; } this.morphTargetsRelative = e.morphTargetsRelative; const o = e.groups; for (let l = 0, d = o.length; l < d; l++) { const h6 = o[l]; this.addGroup(h6.start, h6.count, h6.materialIndex); } const a6 = e.boundingBox; a6 !== null && (this.boundingBox = a6.clone()); const c = e.boundingSphere; return c !== null && (this.boundingSphere = c.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this; } dispose() { this.dispatchEvent({ type: "dispose" }); } }; Ke.prototype.isBufferGeometry = true; var ng = new Xe(); var eo = new qr(); var ch = new mr(); var Mr = new q4(); var wr = new q4(); var Ar = new q4(); var uh = new q4(); var hh = new q4(); var dh = new q4(); var Gl = new q4(); var Hl = new q4(); var Wl = new q4(); var jl = new Re(); var $l = new Re(); var Zl = new Re(); var fh = new q4(); var Xl = new q4(); var Xt = class extends ut { constructor(e = new Ke(), t = new In()) { super(), this.type = "Mesh", this.geometry = e, this.material = t, this.updateMorphTargets(); } copy(e) { return super.copy(e), e.morphTargetInfluences !== void 0 && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), e.morphTargetDictionary !== void 0 && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), this.material = e.material, this.geometry = e.geometry, this; } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const t = e.morphAttributes, i = Object.keys(t); if (i.length > 0) { const r = t[i[0]]; if (r !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let s = 0, o = r.length; s < o; s++) { const a6 = r[s].name || String(s); this.morphTargetInfluences.push(0), this.morphTargetDictionary[a6] = s; } } } } else { const t = e.morphTargets; t !== void 0 && t.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } raycast(e, t) { const i = this.geometry, r = this.material, s = this.matrixWorld; if (r === void 0 || (i.boundingSphere === null && i.computeBoundingSphere(), ch.copy(i.boundingSphere), ch.applyMatrix4(s), e.ray.intersectsSphere(ch) === false) || (ng.copy(s).invert(), eo.copy(e.ray).applyMatrix4(ng), i.boundingBox !== null && eo.intersectsBox(i.boundingBox) === false)) return; let o; if (i.isBufferGeometry) { const a6 = i.index, c = i.attributes.position, l = i.morphAttributes.position, d = i.morphTargetsRelative, h6 = i.attributes.uv, f6 = i.attributes.uv2, g6 = i.groups, p = i.drawRange; if (a6 !== null) if (Array.isArray(r)) for (let u6 = 0, y6 = g6.length; u6 < y6; u6++) { const v6 = g6[u6], m6 = r[v6.materialIndex], x6 = Math.max(v6.start, p.start), w6 = Math.min(v6.start + v6.count, p.start + p.count); for (let A6 = x6, M6 = w6; A6 < M6; A6 += 3) { const R6 = a6.getX(A6), L6 = a6.getX(A6 + 1), T6 = a6.getX(A6 + 2); o = Yl(this, m6, e, eo, c, l, d, h6, f6, R6, L6, T6), o && (o.faceIndex = Math.floor(A6 / 3), o.face.materialIndex = v6.materialIndex, t.push(o)); } } else { const u6 = Math.max(0, p.start), y6 = Math.min(a6.count, p.start + p.count); for (let v6 = u6, m6 = y6; v6 < m6; v6 += 3) { const x6 = a6.getX(v6), w6 = a6.getX(v6 + 1), A6 = a6.getX(v6 + 2); o = Yl(this, r, e, eo, c, l, d, h6, f6, x6, w6, A6), o && (o.faceIndex = Math.floor(v6 / 3), t.push(o)); } } else if (c !== void 0) if (Array.isArray(r)) for (let u6 = 0, y6 = g6.length; u6 < y6; u6++) { const v6 = g6[u6], m6 = r[v6.materialIndex], x6 = Math.max(v6.start, p.start), w6 = Math.min(v6.start + v6.count, p.start + p.count); for (let A6 = x6, M6 = w6; A6 < M6; A6 += 3) { const R6 = A6, L6 = A6 + 1, T6 = A6 + 2; o = Yl(this, m6, e, eo, c, l, d, h6, f6, R6, L6, T6), o && (o.faceIndex = Math.floor(A6 / 3), o.face.materialIndex = v6.materialIndex, t.push(o)); } } else { const u6 = Math.max(0, p.start), y6 = Math.min(c.count, p.start + p.count); for (let v6 = u6, m6 = y6; v6 < m6; v6 += 3) { const x6 = v6, w6 = v6 + 1, A6 = v6 + 2; o = Yl(this, r, e, eo, c, l, d, h6, f6, x6, w6, A6), o && (o.faceIndex = Math.floor(v6 / 3), t.push(o)); } } } else i.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } }; Xt.prototype.isMesh = true; function EF(n, e, t, i, r, s, o, a6) { let c; if (e.side === jt ? c = i.intersectTriangle(o, s, r, true, a6) : c = i.intersectTriangle(r, s, o, e.side !== Wr, a6), c === null) return null; Xl.copy(a6), Xl.applyMatrix4(n.matrixWorld); const l = t.ray.origin.distanceTo(Xl); return l < t.near || l > t.far ? null : { distance: l, point: Xl.clone(), object: n }; } function Yl(n, e, t, i, r, s, o, a6, c, l, d, h6) { Mr.fromBufferAttribute(r, l), wr.fromBufferAttribute(r, d), Ar.fromBufferAttribute(r, h6); const f6 = n.morphTargetInfluences; if (e.morphTargets && s && f6) { Gl.set(0, 0, 0), Hl.set(0, 0, 0), Wl.set(0, 0, 0); for (let p = 0, u6 = s.length; p < u6; p++) { const y6 = f6[p], v6 = s[p]; y6 !== 0 && (uh.fromBufferAttribute(v6, l), hh.fromBufferAttribute(v6, d), dh.fromBufferAttribute(v6, h6), o ? (Gl.addScaledVector(uh, y6), Hl.addScaledVector(hh, y6), Wl.addScaledVector(dh, y6)) : (Gl.addScaledVector(uh.sub(Mr), y6), Hl.addScaledVector(hh.sub(wr), y6), Wl.addScaledVector(dh.sub(Ar), y6))); } Mr.add(Gl), wr.add(Hl), Ar.add(Wl); } n.isSkinnedMesh && (n.boneTransform(l, Mr), n.boneTransform(d, wr), n.boneTransform(h6, Ar)); const g6 = EF(n, e, t, i, Mr, wr, Ar, fh); if (g6) { a6 && (jl.fromBufferAttribute(a6, l), $l.fromBufferAttribute(a6, d), Zl.fromBufferAttribute(a6, h6), g6.uv = Zt.getUV(fh, Mr, wr, Ar, jl, $l, Zl, new Re())), c && (jl.fromBufferAttribute(c, l), $l.fromBufferAttribute(c, d), Zl.fromBufferAttribute(c, h6), g6.uv2 = Zt.getUV(fh, Mr, wr, Ar, jl, $l, Zl, new Re())); const p = { a: l, b: d, c: h6, normal: new q4(), materialIndex: 0 }; Zt.getNormal(Mr, wr, Ar, p.normal), g6.face = p; } return g6; } var or = class _or extends Ke { constructor(e = 1, t = 1, i = 1, r = 1, s = 1, o = 1) { super(), this.type = "BoxGeometry", this.parameters = { width: e, height: t, depth: i, widthSegments: r, heightSegments: s, depthSegments: o }; const a6 = this; r = Math.floor(r), s = Math.floor(s), o = Math.floor(o); const c = [], l = [], d = [], h6 = []; let f6 = 0, g6 = 0; p("z", "y", "x", -1, -1, i, t, e, o, s, 0), p("z", "y", "x", 1, -1, i, t, -e, o, s, 1), p("x", "z", "y", 1, 1, e, i, t, r, o, 2), p("x", "z", "y", 1, -1, e, i, -t, r, o, 3), p("x", "y", "z", 1, -1, e, t, i, r, s, 4), p("x", "y", "z", -1, -1, e, t, -i, r, s, 5), this.setIndex(c), this.setAttribute("position", new We(l, 3)), this.setAttribute("normal", new We(d, 3)), this.setAttribute("uv", new We(h6, 2)); function p(u6, y6, v6, m6, x6, w6, A6, M6, R6, L6, T6) { const P6 = w6 / R6, _6 = A6 / L6, S6 = w6 / 2, E6 = A6 / 2, C6 = M6 / 2, I6 = R6 + 1, b6 = L6 + 1; let F6 = 0, D6 = 0; const N6 = new q4(); for (let B6 = 0; B6 < b6; B6++) { const U6 = B6 * _6 - E6; for (let G6 = 0; G6 < I6; G6++) { const Y = G6 * P6 - S6; N6[u6] = Y * m6, N6[y6] = U6 * x6, N6[v6] = C6, l.push(N6.x, N6.y, N6.z), N6[u6] = 0, N6[y6] = 0, N6[v6] = M6 > 0 ? 1 : -1, d.push(N6.x, N6.y, N6.z), h6.push(G6 / R6), h6.push(1 - B6 / L6), F6 += 1; } } for (let B6 = 0; B6 < L6; B6++) for (let U6 = 0; U6 < R6; U6++) { const G6 = f6 + U6 + I6 * B6, Y = f6 + U6 + I6 * (B6 + 1), te = f6 + (U6 + 1) + I6 * (B6 + 1), ae = f6 + (U6 + 1) + I6 * B6; c.push(G6, Y, ae), c.push(Y, te, ae), D6 += 6; } a6.addGroup(g6, D6, T6), g6 += D6, f6 += F6; } } static fromJSON(e) { return new _or(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments); } }; function Po(n) { const e = {}; for (const t in n) { e[t] = {}; for (const i in n[t]) { const r = n[t][i]; r && (r.isColor || r.isMatrix3 || r.isMatrix4 || r.isVector2 || r.isVector3 || r.isVector4 || r.isTexture || r.isQuaternion) ? e[t][i] = r.clone() : Array.isArray(r) ? e[t][i] = r.slice() : e[t][i] = r; } } return e; } function wn2(n) { const e = {}; for (let t = 0; t < n.length; t++) { const i = Po(n[t]); for (const r in i) e[r] = i[r]; } return e; } var dx = { clone: Po, merge: wn2 }; var CF = `void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`; var LF = `void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }`; var ar = class extends tn2 { constructor(e) { super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = CF, this.fragmentShader = LF, this.linewidth = 1, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, this.lights = false, this.clipping = false, this.morphTargets = false, this.morphNormals = false, this.extensions = { derivatives: false, // set to use derivatives fragDepth: false, // set to use fragment depth values drawBuffers: false, // set to use draw buffers shaderTextureLOD: false // set to use shader texture LOD }, this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv2: [0, 0] }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = false, this.glslVersion = null, e !== void 0 && (e.attributes !== void 0 && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(e)); } copy(e) { return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Po(e.uniforms), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.lights = e.lights, this.clipping = e.clipping, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this; } toJSON(e) { const t = super.toJSON(e); t.glslVersion = this.glslVersion, t.uniforms = {}; for (const r in this.uniforms) { const o = this.uniforms[r].value; o && o.isTexture ? t.uniforms[r] = { type: "t", value: o.toJSON(e).uuid } : o && o.isColor ? t.uniforms[r] = { type: "c", value: o.getHex() } : o && o.isVector2 ? t.uniforms[r] = { type: "v2", value: o.toArray() } : o && o.isVector3 ? t.uniforms[r] = { type: "v3", value: o.toArray() } : o && o.isVector4 ? t.uniforms[r] = { type: "v4", value: o.toArray() } : o && o.isMatrix3 ? t.uniforms[r] = { type: "m3", value: o.toArray() } : o && o.isMatrix4 ? t.uniforms[r] = { type: "m4", value: o.toArray() } : t.uniforms[r] = { value: o }; } Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader; const i = {}; for (const r in this.extensions) this.extensions[r] === true && (i[r] = true); return Object.keys(i).length > 0 && (t.extensions = i), t; } }; ar.prototype.isShaderMaterial = true; var hl = class extends ut { constructor() { super(), this.type = "Camera", this.matrixWorldInverse = new Xe(), this.projectionMatrix = new Xe(), this.projectionMatrixInverse = new Xe(); } copy(e, t) { return super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this; } getWorldDirection(e) { this.updateWorldMatrix(true, false); const t = this.matrixWorld.elements; return e.set(-t[8], -t[9], -t[10]).normalize(); } updateMatrixWorld(e) { super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert(); } updateWorldMatrix(e, t) { super.updateWorldMatrix(e, t), this.matrixWorldInverse.copy(this.matrixWorld).invert(); } clone() { return new this.constructor().copy(this); } }; hl.prototype.isCamera = true; var nn2 = class extends hl { constructor(e = 50, t = 1, i = 0.1, r = 2e3) { super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = i, this.far = r, this.focus = 10, this.aspect = t, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix(); } copy(e, t) { return super.copy(e, t), this.fov = e.fov, this.zoom = e.zoom, this.near = e.near, this.far = e.far, this.focus = e.focus, this.aspect = e.aspect, this.view = e.view === null ? null : Object.assign({}, e.view), this.filmGauge = e.filmGauge, this.filmOffset = e.filmOffset, this; } /** * Sets the FOV by focal length in respect to the current .filmGauge. * * The default film gauge is 35, so that the focal length can be specified for * a 35mm (full frame) camera. * * Values for focal length and film gauge must have the same unit. */ setFocalLength(e) { const t = 0.5 * this.getFilmHeight() / e; this.fov = ja * 2 * Math.atan(t), this.updateProjectionMatrix(); } /** * Calculates the focal length from the current .fov and .filmGauge. */ getFocalLength() { const e = Math.tan(As * 0.5 * this.fov); return 0.5 * this.getFilmHeight() / e; } getEffectiveFOV() { return ja * 2 * Math.atan( Math.tan(As * 0.5 * this.fov) / this.zoom ); } getFilmWidth() { return this.filmGauge * Math.min(this.aspect, 1); } getFilmHeight() { return this.filmGauge / Math.max(this.aspect, 1); } /** * Sets an offset in a larger frustum. This is useful for multi-window or * multi-monitor/multi-machine setups. * * For example, if you have 3x2 monitors and each monitor is 1920x1080 and * the monitors are in grid like this * * +---+---+---+ * | A | B | C | * +---+---+---+ * | D | E | F | * +---+---+---+ * * then for each monitor you would call it like this * * const w = 1920; * const h = 1080; * const fullWidth = w * 3; * const fullHeight = h * 2; * * --A-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); * --B-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); * --C-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); * --D-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); * --E-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); * --F-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); * * Note there is no reason monitors have to be the same size or in a grid. */ setViewOffset(e, t, i, r, s, o) { this.aspect = e / t, this.view === null && (this.view = { enabled: true, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1 }), this.view.enabled = true, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = i, this.view.offsetY = r, this.view.width = s, this.view.height = o, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = false), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = this.near; let t = e * Math.tan(As * 0.5 * this.fov) / this.zoom, i = 2 * t, r = this.aspect * i, s = -0.5 * r; const o = this.view; if (this.view !== null && this.view.enabled) { const c = o.fullWidth, l = o.fullHeight; s += o.offsetX * r / c, t -= o.offsetY * i / l, r *= o.width / c, i *= o.height / l; } const a6 = this.filmOffset; a6 !== 0 && (s += e * a6 / this.getFilmWidth()), this.projectionMatrix.makePerspective(s, s + r, t, t - i, e, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); } toJSON(e) { const t = super.toJSON(e); return t.object.fov = this.fov, t.object.zoom = this.zoom, t.object.near = this.near, t.object.far = this.far, t.object.focus = this.focus, t.object.aspect = this.aspect, this.view !== null && (t.object.view = Object.assign({}, this.view)), t.object.filmGauge = this.filmGauge, t.object.filmOffset = this.filmOffset, t; } }; nn2.prototype.isPerspectiveCamera = true; var to = 90; var no = 1; var yu = class extends ut { constructor(e, t, i) { if (super(), this.type = "CubeCamera", i.isWebGLCubeRenderTarget !== true) { console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."); return; } this.renderTarget = i; const r = new nn2(to, no, e, t); r.layers = this.layers, r.up.set(0, -1, 0), r.lookAt(new q4(1, 0, 0)), this.add(r); const s = new nn2(to, no, e, t); s.layers = this.layers, s.up.set(0, -1, 0), s.lookAt(new q4(-1, 0, 0)), this.add(s); const o = new nn2(to, no, e, t); o.layers = this.layers, o.up.set(0, 0, 1), o.lookAt(new q4(0, 1, 0)), this.add(o); const a6 = new nn2(to, no, e, t); a6.layers = this.layers, a6.up.set(0, 0, -1), a6.lookAt(new q4(0, -1, 0)), this.add(a6); const c = new nn2(to, no, e, t); c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new q4(0, 0, 1)), this.add(c); const l = new nn2(to, no, e, t); l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new q4(0, 0, -1)), this.add(l); } update(e, t) { this.parent === null && this.updateMatrixWorld(); const i = this.renderTarget, [r, s, o, a6, c, l] = this.children, d = e.xr.enabled, h6 = e.getRenderTarget(); e.xr.enabled = false; const f6 = i.texture.generateMipmaps; i.texture.generateMipmaps = false, e.setRenderTarget(i, 0), e.render(t, r), e.setRenderTarget(i, 1), e.render(t, s), e.setRenderTarget(i, 2), e.render(t, o), e.setRenderTarget(i, 3), e.render(t, a6), e.setRenderTarget(i, 4), e.render(t, c), i.texture.generateMipmaps = f6, e.setRenderTarget(i, 5), e.render(t, l), e.setRenderTarget(h6), e.xr.enabled = d; } }; var ta = class extends Yt { constructor(e, t, i, r, s, o, a6, c, l, d) { e = e !== void 0 ? e : [], t = t !== void 0 ? t : ll, a6 = a6 !== void 0 ? a6 : ir, super(e, t, i, r, s, o, a6, c, l, d), this._needsFlipEnvMap = true, this.flipY = false; } get images() { return this.image; } set images(e) { this.image = e; } }; ta.prototype.isCubeTexture = true; var bu = class extends fi { constructor(e, t, i) { Number.isInteger(t) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), t = i), super(e, e, t), t = t || {}, this.texture = new ta(void 0, t.mapping, t.wrapS, t.wrapT, t.magFilter, t.minFilter, t.format, t.type, t.anisotropy, t.encoding), this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : false, this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : zt, this.texture._needsFlipEnvMap = false; } fromEquirectangularTexture(e, t) { this.texture.type = t.type, this.texture.format = Hn, this.texture.encoding = t.encoding, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter; const i = { uniforms: { tEquirect: { value: null } }, vertexShader: ( /* glsl */ ` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } ` ), fragmentShader: ( /* glsl */ ` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } ` ) }, r = new or(5, 5, 5), s = new ar({ name: "CubemapFromEquirect", uniforms: Po(i.uniforms), vertexShader: i.vertexShader, fragmentShader: i.fragmentShader, side: jt, blending: nr }); s.uniforms.tEquirect.value = t; const o = new Xt(r, s), a6 = t.minFilter; return t.minFilter === pr && (t.minFilter = zt), new yu(1, 10, this).update(e, o), t.minFilter = a6, o.geometry.dispose(), o.material.dispose(), this; } clear(e, t, i, r) { const s = e.getRenderTarget(); for (let o = 0; o < 6; o++) e.setRenderTarget(this, o), e.clear(t, i, r); e.setRenderTarget(s); } }; bu.prototype.isWebGLCubeRenderTarget = true; var ph = new q4(); var RF = new q4(); var FF = new rn2(); var wi = class { constructor(e = new q4(1, 0, 0), t = 0) { this.normal = e, this.constant = t; } set(e, t) { return this.normal.copy(e), this.constant = t, this; } setComponents(e, t, i, r) { return this.normal.set(e, t, i), this.constant = r, this; } setFromNormalAndCoplanarPoint(e, t) { return this.normal.copy(e), this.constant = -t.dot(this.normal), this; } setFromCoplanarPoints(e, t, i) { const r = ph.subVectors(i, t).cross(RF.subVectors(e, t)).normalize(); return this.setFromNormalAndCoplanarPoint(r, e), this; } copy(e) { return this.normal.copy(e.normal), this.constant = e.constant, this; } normalize() { const e = 1 / this.normal.length(); return this.normal.multiplyScalar(e), this.constant *= e, this; } negate() { return this.constant *= -1, this.normal.negate(), this; } distanceToPoint(e) { return this.normal.dot(e) + this.constant; } distanceToSphere(e) { return this.distanceToPoint(e.center) - e.radius; } projectPoint(e, t) { return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e); } intersectLine(e, t) { const i = e.delta(ph), r = this.normal.dot(i); if (r === 0) return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null; const s = -(e.start.dot(this.normal) + this.constant) / r; return s < 0 || s > 1 ? null : t.copy(i).multiplyScalar(s).add(e.start); } intersectsLine(e) { const t = this.distanceToPoint(e.start), i = this.distanceToPoint(e.end); return t < 0 && i > 0 || i < 0 && t > 0; } intersectsBox(e) { return e.intersectsPlane(this); } intersectsSphere(e) { return e.intersectsPlane(this); } coplanarPoint(e) { return e.copy(this.normal).multiplyScalar(-this.constant); } applyMatrix4(e, t) { const i = t || FF.getNormalMatrix(e), r = this.coplanarPoint(ph).applyMatrix4(e), s = this.normal.applyMatrix3(i).normalize(); return this.constant = -r.dot(s), this; } translate(e) { return this.constant -= e.dot(this.normal), this; } equals(e) { return e.normal.equals(this.normal) && e.constant === this.constant; } clone() { return new this.constructor().copy(this); } }; wi.prototype.isPlane = true; var io = new mr(); var Jl = new q4(); var dl = class { constructor(e = new wi(), t = new wi(), i = new wi(), r = new wi(), s = new wi(), o = new wi()) { this.planes = [e, t, i, r, s, o]; } set(e, t, i, r, s, o) { const a6 = this.planes; return a6[0].copy(e), a6[1].copy(t), a6[2].copy(i), a6[3].copy(r), a6[4].copy(s), a6[5].copy(o), this; } copy(e) { const t = this.planes; for (let i = 0; i < 6; i++) t[i].copy(e.planes[i]); return this; } setFromProjectionMatrix(e) { const t = this.planes, i = e.elements, r = i[0], s = i[1], o = i[2], a6 = i[3], c = i[4], l = i[5], d = i[6], h6 = i[7], f6 = i[8], g6 = i[9], p = i[10], u6 = i[11], y6 = i[12], v6 = i[13], m6 = i[14], x6 = i[15]; return t[0].setComponents(a6 - r, h6 - c, u6 - f6, x6 - y6).normalize(), t[1].setComponents(a6 + r, h6 + c, u6 + f6, x6 + y6).normalize(), t[2].setComponents(a6 + s, h6 + l, u6 + g6, x6 + v6).normalize(), t[3].setComponents(a6 - s, h6 - l, u6 - g6, x6 - v6).normalize(), t[4].setComponents(a6 - o, h6 - d, u6 - p, x6 - m6).normalize(), t[5].setComponents(a6 + o, h6 + d, u6 + p, x6 + m6).normalize(), this; } intersectsObject(e) { const t = e.geometry; return t.boundingSphere === null && t.computeBoundingSphere(), io.copy(t.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(io); } intersectsSprite(e) { return io.center.set(0, 0, 0), io.radius = 0.7071067811865476, io.applyMatrix4(e.matrixWorld), this.intersectsSphere(io); } intersectsSphere(e) { const t = this.planes, i = e.center, r = -e.radius; for (let s = 0; s < 6; s++) if (t[s].distanceToPoint(i) < r) return false; return true; } intersectsBox(e) { const t = this.planes; for (let i = 0; i < 6; i++) { const r = t[i]; if (Jl.x = r.normal.x > 0 ? e.max.x : e.min.x, Jl.y = r.normal.y > 0 ? e.max.y : e.min.y, Jl.z = r.normal.z > 0 ? e.max.z : e.min.z, r.distanceToPoint(Jl) < 0) return false; } return true; } containsPoint(e) { const t = this.planes; for (let i = 0; i < 6; i++) if (t[i].distanceToPoint(e) < 0) return false; return true; } clone() { return new this.constructor().copy(this); } }; function fx() { let n = null, e = false, t = null, i = null; function r(s, o) { t(s, o), i = n.requestAnimationFrame(r); } return { start: function() { e !== true && t !== null && (i = n.requestAnimationFrame(r), e = true); }, stop: function() { n.cancelAnimationFrame(i), e = false; }, setAnimationLoop: function(s) { t = s; }, setContext: function(s) { n = s; } }; } function PF(n, e) { const t = e.isWebGL2, i = /* @__PURE__ */ new WeakMap(); function r(l, d) { const h6 = l.array, f6 = l.usage, g6 = n.createBuffer(); n.bindBuffer(d, g6), n.bufferData(d, h6, f6), l.onUploadCallback(); let p = 5126; return h6 instanceof Float32Array ? p = 5126 : h6 instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : h6 instanceof Uint16Array ? l.isFloat16BufferAttribute ? t ? p = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : p = 5123 : h6 instanceof Int16Array ? p = 5122 : h6 instanceof Uint32Array ? p = 5125 : h6 instanceof Int32Array ? p = 5124 : h6 instanceof Int8Array ? p = 5120 : (h6 instanceof Uint8Array || h6 instanceof Uint8ClampedArray) && (p = 5121), { buffer: g6, type: p, bytesPerElement: h6.BYTES_PER_ELEMENT, version: l.version }; } function s(l, d, h6) { const f6 = d.array, g6 = d.updateRange; n.bindBuffer(h6, l), g6.count === -1 ? n.bufferSubData(h6, 0, f6) : (t ? n.bufferSubData( h6, g6.offset * f6.BYTES_PER_ELEMENT, f6, g6.offset, g6.count ) : n.bufferSubData( h6, g6.offset * f6.BYTES_PER_ELEMENT, f6.subarray(g6.offset, g6.offset + g6.count) ), g6.count = -1); } function o(l) { return l.isInterleavedBufferAttribute && (l = l.data), i.get(l); } function a6(l) { l.isInterleavedBufferAttribute && (l = l.data); const d = i.get(l); d && (n.deleteBuffer(d.buffer), i.delete(l)); } function c(l, d) { if (l.isGLBufferAttribute) { const f6 = i.get(l); (!f6 || f6.version < l.version) && i.set(l, { buffer: l.buffer, type: l.type, bytesPerElement: l.elementSize, version: l.version }); return; } l.isInterleavedBufferAttribute && (l = l.data); const h6 = i.get(l); h6 === void 0 ? i.set(l, r(l, d)) : h6.version < l.version && (s(h6.buffer, l, d), h6.version = l.version); } return { get: o, remove: a6, update: c }; } var Ls = class _Ls extends Ke { constructor(e = 1, t = 1, i = 1, r = 1) { super(), this.type = "PlaneGeometry", this.parameters = { width: e, height: t, widthSegments: i, heightSegments: r }; const s = e / 2, o = t / 2, a6 = Math.floor(i), c = Math.floor(r), l = a6 + 1, d = c + 1, h6 = e / a6, f6 = t / c, g6 = [], p = [], u6 = [], y6 = []; for (let v6 = 0; v6 < d; v6++) { const m6 = v6 * f6 - o; for (let x6 = 0; x6 < l; x6++) { const w6 = x6 * h6 - s; p.push(w6, -m6, 0), u6.push(0, 0, 1), y6.push(x6 / a6), y6.push(1 - v6 / c); } } for (let v6 = 0; v6 < c; v6++) for (let m6 = 0; m6 < a6; m6++) { const x6 = m6 + l * v6, w6 = m6 + l * (v6 + 1), A6 = m6 + 1 + l * (v6 + 1), M6 = m6 + 1 + l * v6; g6.push(x6, w6, M6), g6.push(w6, A6, M6); } this.setIndex(g6), this.setAttribute("position", new We(p, 3)), this.setAttribute("normal", new We(u6, 3)), this.setAttribute("uv", new We(y6, 2)); } static fromJSON(e) { return new _Ls(e.width, e.height, e.widthSegments, e.heightSegments); } }; var IF = `#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vUv ).g; #endif`; var OF = `#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`; var DF = `#ifdef ALPHATEST if ( diffuseColor.a < ALPHATEST ) discard; #endif`; var NF = `#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_ENVMAP ) && defined( STANDARD ) float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness ); #endif #endif`; var BF = `#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; #endif`; var UF = "vec3 transformed = vec3( position );"; var zF = `vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif`; var kF = `vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) { const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; return vec2( -1.04, 1.04 ) * a004 + r.zw; } float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { #if defined ( PHYSICALLY_CORRECT_LIGHTS ) float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #else if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #endif } vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) { float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); return ( 1.0 - specularColor ) * fresnel + specularColor; } vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; return Fr * fresnel + F0; } float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); return 1.0 / ( gl * gv ); } float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float alpha = pow2( roughness ); vec3 halfDir = normalize( incidentLight.direction + viewDir ); float dotNL = saturate( dot( normal, incidentLight.direction ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( G * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); return specularColor * brdf.x + brdf.y; } void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); vec3 FssEss = F * brdf.x + brdf.y; float Ess = brdf.x + brdf.y; float Ems = 1.0 - Ess; vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); } vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); float dotNH = saturate( dot( geometry.normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); } float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); } float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); } #if defined( USE_SHEEN ) float D_Charlie(float roughness, float NoH) { float invAlpha = 1.0 / roughness; float cos2h = NoH * NoH; float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); } float V_Neubelt(float NoV, float NoL) { return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); } vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { vec3 N = geometry.normal; vec3 V = geometry.viewDir; vec3 H = normalize( V + L ); float dotNH = saturate( dot( N, H ) ); return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); } #endif`; var VF = `#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { vec2 dSTdx = dFdx( vUv ); vec2 dSTdy = dFdy( vUv ); float Hll = bumpScale * texture2D( bumpMap, vUv ).x; float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; return vec2( dBx, dBy ); } vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); vec3 vN = surf_norm; vec3 R1 = cross( vSigmaY, vN ); vec3 R2 = cross( vN, vSigmaX ); float fDet = dot( vSigmaX, R1 ) * faceDirection; vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif`; var GF = `#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif`; var HF = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`; var WF = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`; var jF = `#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`; var $F = `#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`; var ZF = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`; var XF = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`; var YF = `#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`; var JF = `#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement(a) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract(sin(sn) * c); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; struct GeometricContext { vec3 position; vec3 normal; vec3 viewDir; #ifdef CLEARCOAT vec3 clearcoatNormal; #endif }; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { float distance = dot( planeNormal, point - pointOnPlane ); return - distance * planeNormal + point; } float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { return sign( dot( point - pointOnPlane, planeNormal ) ); } vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float linearToRelativeLuminance( const in vec3 color ) { vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); return dot( weights, color.rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); }`; var KF = `#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_maxMipLevel 8.0 #define cubeUV_minMipLevel 4.0 #define cubeUV_maxTileSize 256.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); vec2 f = fract( uv ); uv += 0.5 - f; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; if ( mipInt < cubeUV_maxMipLevel ) { uv.y += 2.0 * cubeUV_maxTileSize; } uv.y += filterInt * 2.0 * cubeUV_minTileSize; uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); uv *= texelSize; vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x += texelSize; vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.y += texelSize; vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x -= texelSize; vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); return mix( tm, bm, f.y ); } #define r0 1.0 #define v0 0.339 #define m0 - 2.0 #define r1 0.8 #define v1 0.276 #define m1 - 1.0 #define r4 0.4 #define v4 0.046 #define m4 2.0 #define r5 0.305 #define v5 0.016 #define m5 3.0 #define r6 0.21 #define v6 0.0038 #define m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= r1 ) { mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; } else if ( roughness >= r4 ) { mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; } else if ( roughness >= r5 ) { mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; } else if ( roughness >= r6 ) { mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`; var qF = `vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); transformedNormal = m * transformedNormal; #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`; var QF = `#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`; var eP = `#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`; var tP = `#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif`; var nP = `#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`; var iP = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; var rP = ` vec4 LinearToLinear( in vec4 value ) { return value; } vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); } vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); } vec4 sRGBToLinear( in vec4 value ) { return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } vec4 RGBEToLinear( in vec4 value ) { return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); } vec4 LinearToRGBE( in vec4 value ) { float maxComponent = max( max( value.r, value.g ), value.b ); float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); } vec4 RGBMToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * value.a * maxRange, 1.0 ); } vec4 LinearToRGBM( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); M = ceil( M * 255.0 ) / 255.0; return vec4( value.rgb / ( M * maxRange ), M ); } vec4 RGBDToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); } vec4 LinearToRGBD( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float D = max( maxRange / maxRGB, 1.0 ); D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); } const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); vec4 LinearToLogLuv( in vec4 value ) { vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); vec4 vResult; vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; vResult.w = fract( Le ); vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; return vResult; } const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); vec4 LogLuvToLinear( in vec4 value ) { float Le = value.z * 255.0 + value.w; vec3 Xp_Y_XYZp; Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; return vec4( max( vRGB, 0.0 ), 1.0 ); }`; var sP = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); #else vec4 envColor = vec4( 0.0 ); #endif #ifndef ENVMAP_TYPE_CUBE_UV envColor = envMapTexelToLinear( envColor ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`; var oP = `#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform int maxMipLevel; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`; var aP = `#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`; var lP = `#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`; var cP = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`; var uP = `#ifdef USE_FOG fogDepth = - mvPosition.z; #endif`; var hP = `#ifdef USE_FOG varying float fogDepth; #endif`; var dP = `#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`; var fP = `#ifdef USE_FOG uniform vec3 fogColor; varying float fogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`; var pP = `#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return texture2D( gradientMap, coord ).rgb; #else return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); #endif }`; var mP = `#ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #endif`; var gP = `#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`; var vP = `vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); GeometricContext backGeometry; backGeometry.position = geometry.position; backGeometry.normal = -geometry.normal; backGeometry.viewDir = geometry.viewDir; vLightFront = vec3( 0.0 ); vIndirectFront = vec3( 0.0 ); #ifdef DOUBLE_SIDED vLightBack = vec3( 0.0 ); vIndirectBack = vec3( 0.0 ); #endif IncidentLight directLight; float dotNL; vec3 directLightColor_Diffuse; vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); #endif #if NUM_POINT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_DIR_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_HEMI_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); #endif } #pragma unroll_loop_end #endif`; var yP = `uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { directLight.color = directionalLight.color; directLight.direction = directionalLight.direction; directLight.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = pointLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); directLight.color = pointLight.color; directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); directLight.visible = ( directLight.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = spotLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); float angleCos = dot( directLight.direction, spotLight.direction ); if ( angleCos > spotLight.coneCos ) { float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); directLight.color = spotLight.color; directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); directLight.visible = true; } else { directLight.color = vec3( 0.0 ); directLight.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { float dotNL = dot( geometry.normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #endif`; var bP = `#if defined( USE_ENVMAP ) #ifdef ENVMAP_MODE_REFRACTION uniform float refractionRatio; #endif vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); #ifdef ENVMAP_TYPE_CUBE vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); #else vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); #else vec4 envMapColor = vec4( 0.0 ); #endif return PI * envMapColor.rgb * envMapIntensity; } float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { float maxMIPLevelScalar = float( maxMIPLevel ); float sigma = PI * roughness * roughness / ( 1.0 + roughness ); float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); } vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( -viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); #else vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); #endif reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); #ifdef ENVMAP_TYPE_CUBE vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); #else vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); #endif return envMapColor.rgb * envMapIntensity; } #endif`; var xP = `ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`; var MP = `varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon #define Material_LightProbeLOD( material ) (0)`; var wP = `BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`; var AP = `varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0)`; var SP = `PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; material.specularRoughness = min( material.specularRoughness, 1.0 ); #ifdef REFLECTIVITY material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); #endif #ifdef CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_SHEEN material.sheenColor = sheen; #endif`; var _P = `struct PhysicalMaterial { vec3 diffuseColor; float specularRoughness; vec3 specularColor; #ifdef CLEARCOAT float clearcoat; float clearcoatRoughness; #endif #ifdef USE_SHEEN vec3 sheenColor; #endif }; #define MAXIMUM_SPECULAR_COEFFICIENT 0.16 #define DEFAULT_SPECULAR_COEFFICIENT 0.04 float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometry.normal; vec3 viewDir = geometry.viewDir; vec3 position = geometry.position; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.specularRoughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif #ifdef CLEARCOAT float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = ccDotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS ccIrradiance *= PI; #endif float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); #else float clearcoatDHR = 0.0; #endif #ifdef USE_SHEEN reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( material.specularRoughness, directLight.direction, geometry, material.sheenColor ); #else reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness); #endif reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef CLEARCOAT float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); float ccDotNL = ccDotNV; float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); #else float clearcoatDHR = 0.0; #endif float clearcoatInv = 1.0 - clearcoatDHR; vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`; var TP = ` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); #ifdef CLEARCOAT geometry.clearcoatNormal = clearcoatNormal; #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointDirectLightIrradiance( pointLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotDirectLightIrradiance( spotLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); irradiance += getLightProbeIrradiance( lightProbe, geometry ); #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`; var EP = `#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #ifndef PHYSICALLY_CORRECT_LIGHTS lightMapIrradiance *= PI; #endif irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); #ifdef CLEARCOAT clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); #endif #endif`; var CP = `#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`; var LP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`; var RP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`; var FP = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`; var PP = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`; var IP = `#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif`; var OP = `#ifdef USE_MAP uniform sampler2D map; #endif`; var DP = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP vec4 mapTexel = texture2D( map, uv ); diffuseColor *= mapTexelToLinear( mapTexel ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`; var NP = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`; var BP = `float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`; var UP = `#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`; var zP = `#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif`; var kP = `#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif`; var VP = `#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif`; var GP = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif #ifdef USE_TANGENT vec3 tangent = normalize( vTangent ); vec3 bitangent = normalize( vBitangent ); #ifdef DOUBLE_SIDED tangent = tangent * faceDirection; bitangent = bitangent * faceDirection; #endif #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) mat3 vTBN = mat3( tangent, bitangent, normal ); #endif #endif #endif vec3 geometryNormal = normal;`; var HP = `#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( TANGENTSPACE_NORMALMAP ) vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; #ifdef USE_TANGENT normal = normalize( vTBN * mapN ); #else normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`; var WP = `#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef OBJECTSPACE_NORMALMAP uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); vec2 st0 = dFdx( vUv.st ); vec2 st1 = dFdy( vUv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } #endif`; var jP = `#ifdef CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`; var $P = `#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT clearcoatNormal = normalize( vTBN * clearcoatMapN ); #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif #endif`; var ZP = `#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif`; var XP = `vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); }`; var YP = `#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`; var JP = `vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`; var KP = `#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`; var qP = `#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`; var QP = `float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`; var eI = `#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`; var tI = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); bool inFrustum = all( inFrustumVec ); bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); bool frustumTest = all( frustumTestVec ); if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`; var nI = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`; var iI = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif`; var rI = `float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`; var sI = `#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`; var oI = `#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE uniform highp sampler2D boneTexture; uniform int boneTextureSize; mat4 getBoneMatrix( const in float i ) { float j = i * 4.0; float x = mod( j, float( boneTextureSize ) ); float y = floor( j / float( boneTextureSize ) ); float dx = 1.0 / float( boneTextureSize ); float dy = 1.0 / float( boneTextureSize ); y = dy * ( y + 0.5 ); vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } #else uniform mat4 boneMatrices[ MAX_BONES ]; mat4 getBoneMatrix( const in float i ) { mat4 bone = boneMatrices[ int(i) ]; return bone; } #endif #endif`; var aI = `#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`; var lI = `#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`; var cI = `float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`; var uI = `#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`; var hI = `#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`; var dI = `#ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return toneMappingExposure * color; } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } vec3 CustomToneMapping( vec3 color ) { return color; }`; var fI = `#ifdef USE_TRANSMISSION float transmissionFactor = transmission; float thicknessFactor = thickness; #ifdef USE_TRANSMISSIONMAP transmissionFactor *= texture2D( transmissionMap, vUv ).r; #endif #ifdef USE_THICKNESSNMAP thicknessFactor *= texture2D( thicknessMap, vUv ).g; #endif vec3 pos = vWorldPosition.xyz / vWorldPosition.w; vec3 v = normalize( cameraPosition - pos ); float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); vec3 transmission = transmissionFactor * getIBLVolumeRefraction( normal, v, roughnessFactor, material.diffuseColor, totalSpecular, pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, attenuationColor, attenuationDistance ); totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); #endif`; var pI = `#ifdef USE_TRANSMISSION #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec4 vWorldPosition; vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); vec3 modelScale; modelScale.x = length(vec3(modelMatrix[0].xyz)); modelScale.y = length(vec3(modelMatrix[1].xyz)); modelScale.z = length(vec3(modelMatrix[2].xyz)); return normalize(refractionVector) * thickness * modelScale; } float applyIorToRoughness(float roughness, float ior) { return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); } vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; } vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { if (attenuationDistance == 0.0) { return radiance; } else { vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; } } vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec3 attenuationColor, float attenuationDistance) { vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); return (1.0 - specularColor) * attenuatedColor * baseColor; } #endif`; var mI = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`; var gI = `#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`; var vI = `#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`; var yI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`; var bI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`; var xI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`; var MI = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`; var wI = `uniform sampler2D t2D; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`; var AI = `varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`; var SI = `#include uniform float opacity; varying vec3 vWorldDirection; #include void main() { vec3 vReflect = vWorldDirection; #include gl_FragColor = envColor; gl_FragColor.a *= opacity; #include #include }`; var _I = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`; var TI = `#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include vec4 diffuseColor = vec4( 1.0 ); #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`; var EI = `#include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`; var CI = `#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include void main () { #include vec4 diffuseColor = vec4( 1.0 ); #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`; var LI = `#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`; var RI = `uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); vec4 texColor = texture2D( tEquirect, sampleUV ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`; var FI = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`; var PI = `uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include void main() { #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`; var II = `uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include }`; var OI = `uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`; var DI = `#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_ENVMAP #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`; var NI = `uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #ifdef DOUBLE_SIDED reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; #else reflectedLight.indirectDiffuse += vIndirectFront; #endif #include reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); #ifdef DOUBLE_SIDED reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; #else reflectedLight.directDiffuse = vLightFront; #endif reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`; var BI = `#define LAMBERT varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`; var UI = `#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); matcapColor = matcapTexelToLinear( matcapColor ); #else vec4 matcapColor = vec4( 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`; var zI = `#define MATCAP varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`; var kI = `#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`; var VI = `#define TOON varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`; var GI = `#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`; var HI = `#define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`; var WI = `#define STANDARD #ifdef PHYSICAL #define REFLECTIVITY #define CLEARCOAT #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform vec3 attenuationColor; uniform float attenuationDistance; #endif #ifdef REFLECTIVITY uniform float reflectivity; #endif #ifdef CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_SHEEN uniform vec3 sheen; #endif varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`; var jI = `#define STANDARD varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #ifdef USE_TRANSMISSION varying vec4 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition; #endif }`; var $I = `#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include void main() { #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); }`; var ZI = `#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif }`; var XI = `uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`; var YI = `uniform float size; uniform float scale; #include #include #include #include #include #include void main() { #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`; var JI = `uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include void main() { gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`; var KI = `#include #include #include void main() { #include #include #include #include #include #include #include #include #include #include }`; var qI = `uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include }`; var QI = `uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`; var dt = { alphamap_fragment: IF, alphamap_pars_fragment: OF, alphatest_fragment: DF, aomap_fragment: NF, aomap_pars_fragment: BF, begin_vertex: UF, beginnormal_vertex: zF, bsdfs: kF, bumpmap_pars_fragment: VF, clipping_planes_fragment: GF, clipping_planes_pars_fragment: HF, clipping_planes_pars_vertex: WF, clipping_planes_vertex: jF, color_fragment: $F, color_pars_fragment: ZF, color_pars_vertex: XF, color_vertex: YF, common: JF, cube_uv_reflection_fragment: KF, defaultnormal_vertex: qF, displacementmap_pars_vertex: QF, displacementmap_vertex: eP, emissivemap_fragment: tP, emissivemap_pars_fragment: nP, encodings_fragment: iP, encodings_pars_fragment: rP, envmap_fragment: sP, envmap_common_pars_fragment: oP, envmap_pars_fragment: aP, envmap_pars_vertex: lP, envmap_physical_pars_fragment: bP, envmap_vertex: cP, fog_vertex: uP, fog_pars_vertex: hP, fog_fragment: dP, fog_pars_fragment: fP, gradientmap_pars_fragment: pP, lightmap_fragment: mP, lightmap_pars_fragment: gP, lights_lambert_vertex: vP, lights_pars_begin: yP, lights_toon_fragment: xP, lights_toon_pars_fragment: MP, lights_phong_fragment: wP, lights_phong_pars_fragment: AP, lights_physical_fragment: SP, lights_physical_pars_fragment: _P, lights_fragment_begin: TP, lights_fragment_maps: EP, lights_fragment_end: CP, logdepthbuf_fragment: LP, logdepthbuf_pars_fragment: RP, logdepthbuf_pars_vertex: FP, logdepthbuf_vertex: PP, map_fragment: IP, map_pars_fragment: OP, map_particle_fragment: DP, map_particle_pars_fragment: NP, metalnessmap_fragment: BP, metalnessmap_pars_fragment: UP, morphnormal_vertex: zP, morphtarget_pars_vertex: kP, morphtarget_vertex: VP, normal_fragment_begin: GP, normal_fragment_maps: HP, normalmap_pars_fragment: WP, clearcoat_normal_fragment_begin: jP, clearcoat_normal_fragment_maps: $P, clearcoat_pars_fragment: ZP, packing: XP, premultiplied_alpha_fragment: YP, project_vertex: JP, dithering_fragment: KP, dithering_pars_fragment: qP, roughnessmap_fragment: QP, roughnessmap_pars_fragment: eI, shadowmap_pars_fragment: tI, shadowmap_pars_vertex: nI, shadowmap_vertex: iI, shadowmask_pars_fragment: rI, skinbase_vertex: sI, skinning_pars_vertex: oI, skinning_vertex: aI, skinnormal_vertex: lI, specularmap_fragment: cI, specularmap_pars_fragment: uI, tonemapping_fragment: hI, tonemapping_pars_fragment: dI, transmission_fragment: fI, transmission_pars_fragment: pI, uv_pars_fragment: mI, uv_pars_vertex: gI, uv_vertex: vI, uv2_pars_fragment: yI, uv2_pars_vertex: bI, uv2_vertex: xI, worldpos_vertex: MI, background_frag: wI, background_vert: AI, cube_frag: SI, cube_vert: _I, depth_frag: TI, depth_vert: EI, distanceRGBA_frag: CI, distanceRGBA_vert: LI, equirect_frag: RI, equirect_vert: FI, linedashed_frag: PI, linedashed_vert: II, meshbasic_frag: OI, meshbasic_vert: DI, meshlambert_frag: NI, meshlambert_vert: BI, meshmatcap_frag: UI, meshmatcap_vert: zI, meshtoon_frag: kI, meshtoon_vert: VI, meshphong_frag: GI, meshphong_vert: HI, meshphysical_frag: WI, meshphysical_vert: jI, normal_frag: $I, normal_vert: ZI, points_frag: XI, points_vert: YI, shadow_frag: JI, shadow_vert: KI, sprite_frag: qI, sprite_vert: QI }; var ze = { common: { diffuse: { value: new Ue(16777215) }, opacity: { value: 1 }, map: { value: null }, uvTransform: { value: new rn2() }, uv2Transform: { value: new rn2() }, alphaMap: { value: null } }, specularmap: { specularMap: { value: null } }, envmap: { envMap: { value: null }, flipEnvMap: { value: -1 }, reflectivity: { value: 1 }, refractionRatio: { value: 0.98 }, maxMipLevel: { value: 0 } }, aomap: { aoMap: { value: null }, aoMapIntensity: { value: 1 } }, lightmap: { lightMap: { value: null }, lightMapIntensity: { value: 1 } }, emissivemap: { emissiveMap: { value: null } }, bumpmap: { bumpMap: { value: null }, bumpScale: { value: 1 } }, normalmap: { normalMap: { value: null }, normalScale: { value: new Re(1, 1) } }, displacementmap: { displacementMap: { value: null }, displacementScale: { value: 1 }, displacementBias: { value: 0 } }, roughnessmap: { roughnessMap: { value: null } }, metalnessmap: { metalnessMap: { value: null } }, gradientmap: { gradientMap: { value: null } }, fog: { fogDensity: { value: 25e-5 }, fogNear: { value: 1 }, fogFar: { value: 2e3 }, fogColor: { value: new Ue(16777215) } }, lights: { ambientLightColor: { value: [] }, lightProbe: { value: [] }, directionalLights: { value: [], properties: { direction: {}, color: {} } }, directionalLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {} } }, directionalShadowMap: { value: [] }, directionalShadowMatrix: { value: [] }, spotLights: { value: [], properties: { color: {}, position: {}, direction: {}, distance: {}, coneCos: {}, penumbraCos: {}, decay: {} } }, spotLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {} } }, spotShadowMap: { value: [] }, spotShadowMatrix: { value: [] }, pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {} } }, pointLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, shadowCameraNear: {}, shadowCameraFar: {} } }, pointShadowMap: { value: [] }, pointShadowMatrix: { value: [] }, hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} } }, // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src rectAreaLights: { value: [], properties: { color: {}, position: {}, width: {}, height: {} } }, ltc_1: { value: null }, ltc_2: { value: null } }, points: { diffuse: { value: new Ue(16777215) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new rn2() } }, sprite: { diffuse: { value: new Ue(16777215) }, opacity: { value: 1 }, center: { value: new Re(0.5, 0.5) }, rotation: { value: 0 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new rn2() } } }; var ci = { basic: { uniforms: wn2([ ze.common, ze.specularmap, ze.envmap, ze.aomap, ze.lightmap, ze.fog ]), vertexShader: dt.meshbasic_vert, fragmentShader: dt.meshbasic_frag }, lambert: { uniforms: wn2([ ze.common, ze.specularmap, ze.envmap, ze.aomap, ze.lightmap, ze.emissivemap, ze.fog, ze.lights, { emissive: { value: new Ue(0) } } ]), vertexShader: dt.meshlambert_vert, fragmentShader: dt.meshlambert_frag }, phong: { uniforms: wn2([ ze.common, ze.specularmap, ze.envmap, ze.aomap, ze.lightmap, ze.emissivemap, ze.bumpmap, ze.normalmap, ze.displacementmap, ze.fog, ze.lights, { emissive: { value: new Ue(0) }, specular: { value: new Ue(1118481) }, shininess: { value: 30 } } ]), vertexShader: dt.meshphong_vert, fragmentShader: dt.meshphong_frag }, standard: { uniforms: wn2([ ze.common, ze.envmap, ze.aomap, ze.lightmap, ze.emissivemap, ze.bumpmap, ze.normalmap, ze.displacementmap, ze.roughnessmap, ze.metalnessmap, ze.fog, ze.lights, { emissive: { value: new Ue(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 } // temporary } ]), vertexShader: dt.meshphysical_vert, fragmentShader: dt.meshphysical_frag }, toon: { uniforms: wn2([ ze.common, ze.aomap, ze.lightmap, ze.emissivemap, ze.bumpmap, ze.normalmap, ze.displacementmap, ze.gradientmap, ze.fog, ze.lights, { emissive: { value: new Ue(0) } } ]), vertexShader: dt.meshtoon_vert, fragmentShader: dt.meshtoon_frag }, matcap: { uniforms: wn2([ ze.common, ze.bumpmap, ze.normalmap, ze.displacementmap, ze.fog, { matcap: { value: null } } ]), vertexShader: dt.meshmatcap_vert, fragmentShader: dt.meshmatcap_frag }, points: { uniforms: wn2([ ze.points, ze.fog ]), vertexShader: dt.points_vert, fragmentShader: dt.points_frag }, dashed: { uniforms: wn2([ ze.common, ze.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } } ]), vertexShader: dt.linedashed_vert, fragmentShader: dt.linedashed_frag }, depth: { uniforms: wn2([ ze.common, ze.displacementmap ]), vertexShader: dt.depth_vert, fragmentShader: dt.depth_frag }, normal: { uniforms: wn2([ ze.common, ze.bumpmap, ze.normalmap, ze.displacementmap, { opacity: { value: 1 } } ]), vertexShader: dt.normal_vert, fragmentShader: dt.normal_frag }, sprite: { uniforms: wn2([ ze.sprite, ze.fog ]), vertexShader: dt.sprite_vert, fragmentShader: dt.sprite_frag }, background: { uniforms: { uvTransform: { value: new rn2() }, t2D: { value: null } }, vertexShader: dt.background_vert, fragmentShader: dt.background_frag }, /* ------------------------------------------------------------------------- // Cube map shader ------------------------------------------------------------------------- */ cube: { uniforms: wn2([ ze.envmap, { opacity: { value: 1 } } ]), vertexShader: dt.cube_vert, fragmentShader: dt.cube_frag }, equirect: { uniforms: { tEquirect: { value: null } }, vertexShader: dt.equirect_vert, fragmentShader: dt.equirect_frag }, distanceRGBA: { uniforms: wn2([ ze.common, ze.displacementmap, { referencePosition: { value: new q4() }, nearDistance: { value: 1 }, farDistance: { value: 1e3 } } ]), vertexShader: dt.distanceRGBA_vert, fragmentShader: dt.distanceRGBA_frag }, shadow: { uniforms: wn2([ ze.lights, ze.fog, { color: { value: new Ue(0) }, opacity: { value: 1 } } ]), vertexShader: dt.shadow_vert, fragmentShader: dt.shadow_frag } }; ci.physical = { uniforms: wn2([ ci.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatNormalScale: { value: new Re(1, 1) }, clearcoatNormalMap: { value: null }, sheen: { value: new Ue(0) }, transmission: { value: 0 }, transmissionMap: { value: null }, transmissionSamplerSize: { value: new Re() }, transmissionSamplerMap: { value: null }, thickness: { value: 0 }, thicknessMap: { value: null }, attenuationDistance: { value: 0 }, attenuationColor: { value: new Ue(0) } } ]), vertexShader: dt.meshphysical_vert, fragmentShader: dt.meshphysical_frag }; function eO(n, e, t, i, r) { const s = new Ue(0); let o = 0, a6, c, l = null, d = 0, h6 = null; function f6(p, u6) { let y6 = false, v6 = u6.isScene === true ? u6.background : null; v6 && v6.isTexture && (v6 = e.get(v6)); const m6 = n.xr, x6 = m6.getSession && m6.getSession(); x6 && x6.environmentBlendMode === "additive" && (v6 = null), v6 === null ? g6(s, o) : v6 && v6.isColor && (g6(v6, 1), y6 = true), (n.autoClear || y6) && n.clear(n.autoClearColor, n.autoClearDepth, n.autoClearStencil), v6 && (v6.isCubeTexture || v6.mapping === ea) ? (c === void 0 && (c = new Xt( new or(1, 1, 1), new ar({ name: "BackgroundCubeMaterial", uniforms: Po(ci.cube.uniforms), vertexShader: ci.cube.vertexShader, fragmentShader: ci.cube.fragmentShader, side: jt, depthTest: false, depthWrite: false, fog: false }) ), c.geometry.deleteAttribute("normal"), c.geometry.deleteAttribute("uv"), c.onBeforeRender = function(w6, A6, M6) { this.matrixWorld.copyPosition(M6.matrixWorld); }, Object.defineProperty(c.material, "envMap", { get: function() { return this.uniforms.envMap.value; } }), i.update(c)), c.material.uniforms.envMap.value = v6, c.material.uniforms.flipEnvMap.value = v6.isCubeTexture && v6._needsFlipEnvMap ? -1 : 1, (l !== v6 || d !== v6.version || h6 !== n.toneMapping) && (c.material.needsUpdate = true, l = v6, d = v6.version, h6 = n.toneMapping), p.unshift(c, c.geometry, c.material, 0, 0, null)) : v6 && v6.isTexture && (a6 === void 0 && (a6 = new Xt( new Ls(2, 2), new ar({ name: "BackgroundMaterial", uniforms: Po(ci.background.uniforms), vertexShader: ci.background.vertexShader, fragmentShader: ci.background.fragmentShader, side: Hr, depthTest: false, depthWrite: false, fog: false }) ), a6.geometry.deleteAttribute("normal"), Object.defineProperty(a6.material, "map", { get: function() { return this.uniforms.t2D.value; } }), i.update(a6)), a6.material.uniforms.t2D.value = v6, v6.matrixAutoUpdate === true && v6.updateMatrix(), a6.material.uniforms.uvTransform.value.copy(v6.matrix), (l !== v6 || d !== v6.version || h6 !== n.toneMapping) && (a6.material.needsUpdate = true, l = v6, d = v6.version, h6 = n.toneMapping), p.unshift(a6, a6.geometry, a6.material, 0, 0, null)); } function g6(p, u6) { t.buffers.color.setClear(p.r, p.g, p.b, u6, r); } return { getClearColor: function() { return s; }, setClearColor: function(p, u6 = 1) { s.set(p), o = u6, g6(s, o); }, getClearAlpha: function() { return o; }, setClearAlpha: function(p) { o = p, g6(s, o); }, render: f6 }; } function tO(n, e, t, i) { const r = n.getParameter(34921), s = i.isWebGL2 ? null : e.get("OES_vertex_array_object"), o = i.isWebGL2 || s !== null, a6 = {}, c = u6(null); let l = c; function d(E6, C6, I6, b6, F6) { let D6 = false; if (o) { const N6 = p(b6, I6, C6); l !== N6 && (l = N6, f6(l.object)), D6 = y6(b6, F6), D6 && v6(b6, F6); } else { const N6 = C6.wireframe === true; (l.geometry !== b6.id || l.program !== I6.id || l.wireframe !== N6) && (l.geometry = b6.id, l.program = I6.id, l.wireframe = N6, D6 = true); } E6.isInstancedMesh === true && (D6 = true), F6 !== null && t.update(F6, 34963), D6 && (R6(E6, C6, I6, b6), F6 !== null && n.bindBuffer(34963, t.get(F6).buffer)); } function h6() { return i.isWebGL2 ? n.createVertexArray() : s.createVertexArrayOES(); } function f6(E6) { return i.isWebGL2 ? n.bindVertexArray(E6) : s.bindVertexArrayOES(E6); } function g6(E6) { return i.isWebGL2 ? n.deleteVertexArray(E6) : s.deleteVertexArrayOES(E6); } function p(E6, C6, I6) { const b6 = I6.wireframe === true; let F6 = a6[E6.id]; F6 === void 0 && (F6 = {}, a6[E6.id] = F6); let D6 = F6[C6.id]; D6 === void 0 && (D6 = {}, F6[C6.id] = D6); let N6 = D6[b6]; return N6 === void 0 && (N6 = u6(h6()), D6[b6] = N6), N6; } function u6(E6) { const C6 = [], I6 = [], b6 = []; for (let F6 = 0; F6 < r; F6++) C6[F6] = 0, I6[F6] = 0, b6[F6] = 0; return { // for backward compatibility on non-VAO support browser geometry: null, program: null, wireframe: false, newAttributes: C6, enabledAttributes: I6, attributeDivisors: b6, object: E6, attributes: {}, index: null }; } function y6(E6, C6) { const I6 = l.attributes, b6 = E6.attributes; let F6 = 0; for (const D6 in b6) { const N6 = I6[D6], B6 = b6[D6]; if (N6 === void 0 || N6.attribute !== B6 || N6.data !== B6.data) return true; F6++; } return l.attributesNum !== F6 || l.index !== C6; } function v6(E6, C6) { const I6 = {}, b6 = E6.attributes; let F6 = 0; for (const D6 in b6) { const N6 = b6[D6], B6 = {}; B6.attribute = N6, N6.data && (B6.data = N6.data), I6[D6] = B6, F6++; } l.attributes = I6, l.attributesNum = F6, l.index = C6; } function m6() { const E6 = l.newAttributes; for (let C6 = 0, I6 = E6.length; C6 < I6; C6++) E6[C6] = 0; } function x6(E6) { w6(E6, 0); } function w6(E6, C6) { const I6 = l.newAttributes, b6 = l.enabledAttributes, F6 = l.attributeDivisors; I6[E6] = 1, b6[E6] === 0 && (n.enableVertexAttribArray(E6), b6[E6] = 1), F6[E6] !== C6 && ((i.isWebGL2 ? n : e.get("ANGLE_instanced_arrays"))[i.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](E6, C6), F6[E6] = C6); } function A6() { const E6 = l.newAttributes, C6 = l.enabledAttributes; for (let I6 = 0, b6 = C6.length; I6 < b6; I6++) C6[I6] !== E6[I6] && (n.disableVertexAttribArray(I6), C6[I6] = 0); } function M6(E6, C6, I6, b6, F6, D6) { i.isWebGL2 === true && (I6 === 5124 || I6 === 5125) ? n.vertexAttribIPointer(E6, C6, I6, F6, D6) : n.vertexAttribPointer(E6, C6, I6, b6, F6, D6); } function R6(E6, C6, I6, b6) { if (i.isWebGL2 === false && (E6.isInstancedMesh || b6.isInstancedBufferGeometry) && e.get("ANGLE_instanced_arrays") === null) return; m6(); const F6 = b6.attributes, D6 = I6.getAttributes(), N6 = C6.defaultAttributeValues; for (const B6 in D6) { const U6 = D6[B6]; if (U6 >= 0) { const G6 = F6[B6]; if (G6 !== void 0) { const Y = G6.normalized, te = G6.itemSize, ae = t.get(G6); if (ae === void 0) continue; const ie = ae.buffer, le = ae.type, W6 = ae.bytesPerElement; if (G6.isInterleavedBufferAttribute) { const $6 = G6.data, j6 = $6.stride, re = G6.offset; $6 && $6.isInstancedInterleavedBuffer ? (w6(U6, $6.meshPerAttribute), b6._maxInstanceCount === void 0 && (b6._maxInstanceCount = $6.meshPerAttribute * $6.count)) : x6(U6), n.bindBuffer(34962, ie), M6(U6, te, le, Y, j6 * W6, re * W6); } else G6.isInstancedBufferAttribute ? (w6(U6, G6.meshPerAttribute), b6._maxInstanceCount === void 0 && (b6._maxInstanceCount = G6.meshPerAttribute * G6.count)) : x6(U6), n.bindBuffer(34962, ie), M6(U6, te, le, Y, 0, 0); } else if (B6 === "instanceMatrix") { const Y = t.get(E6.instanceMatrix); if (Y === void 0) continue; const te = Y.buffer, ae = Y.type; w6(U6 + 0, 1), w6(U6 + 1, 1), w6(U6 + 2, 1), w6(U6 + 3, 1), n.bindBuffer(34962, te), n.vertexAttribPointer(U6 + 0, 4, ae, false, 64, 0), n.vertexAttribPointer(U6 + 1, 4, ae, false, 64, 16), n.vertexAttribPointer(U6 + 2, 4, ae, false, 64, 32), n.vertexAttribPointer(U6 + 3, 4, ae, false, 64, 48); } else if (B6 === "instanceColor") { const Y = t.get(E6.instanceColor); if (Y === void 0) continue; const te = Y.buffer, ae = Y.type; w6(U6, 1), n.bindBuffer(34962, te), n.vertexAttribPointer(U6, 3, ae, false, 12, 0); } else if (N6 !== void 0) { const Y = N6[B6]; if (Y !== void 0) switch (Y.length) { case 2: n.vertexAttrib2fv(U6, Y); break; case 3: n.vertexAttrib3fv(U6, Y); break; case 4: n.vertexAttrib4fv(U6, Y); break; default: n.vertexAttrib1fv(U6, Y); } } } } A6(); } function L6() { _6(); for (const E6 in a6) { const C6 = a6[E6]; for (const I6 in C6) { const b6 = C6[I6]; for (const F6 in b6) g6(b6[F6].object), delete b6[F6]; delete C6[I6]; } delete a6[E6]; } } function T6(E6) { if (a6[E6.id] === void 0) return; const C6 = a6[E6.id]; for (const I6 in C6) { const b6 = C6[I6]; for (const F6 in b6) g6(b6[F6].object), delete b6[F6]; delete C6[I6]; } delete a6[E6.id]; } function P6(E6) { for (const C6 in a6) { const I6 = a6[C6]; if (I6[E6.id] === void 0) continue; const b6 = I6[E6.id]; for (const F6 in b6) g6(b6[F6].object), delete b6[F6]; delete I6[E6.id]; } } function _6() { S6(), l !== c && (l = c, f6(l.object)); } function S6() { c.geometry = null, c.program = null, c.wireframe = false; } return { setup: d, reset: _6, resetDefaultState: S6, dispose: L6, releaseStatesOfGeometry: T6, releaseStatesOfProgram: P6, initAttributes: m6, enableAttribute: x6, disableUnusedAttributes: A6 }; } function nO(n, e, t, i) { const r = i.isWebGL2; let s; function o(l) { s = l; } function a6(l, d) { n.drawArrays(s, l, d), t.update(d, s, 1); } function c(l, d, h6) { if (h6 === 0) return; let f6, g6; if (r) f6 = n, g6 = "drawArraysInstanced"; else if (f6 = e.get("ANGLE_instanced_arrays"), g6 = "drawArraysInstancedANGLE", f6 === null) { console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } f6[g6](s, l, d, h6), t.update(d, s, h6); } this.setMode = o, this.render = a6, this.renderInstances = c; } function iO(n, e, t) { let i; function r() { if (i !== void 0) return i; if (e.has("EXT_texture_filter_anisotropic") === true) { const R6 = e.get("EXT_texture_filter_anisotropic"); i = n.getParameter(R6.MAX_TEXTURE_MAX_ANISOTROPY_EXT); } else i = 0; return i; } function s(R6) { if (R6 === "highp") { if (n.getShaderPrecisionFormat(35633, 36338).precision > 0 && n.getShaderPrecisionFormat(35632, 36338).precision > 0) return "highp"; R6 = "mediump"; } return R6 === "mediump" && n.getShaderPrecisionFormat(35633, 36337).precision > 0 && n.getShaderPrecisionFormat(35632, 36337).precision > 0 ? "mediump" : "lowp"; } const o = typeof WebGL2RenderingContext < "u" && n instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext < "u" && n instanceof WebGL2ComputeRenderingContext; let a6 = t.precision !== void 0 ? t.precision : "highp"; const c = s(a6); c !== a6 && (console.warn("THREE.WebGLRenderer:", a6, "not supported, using", c, "instead."), a6 = c); const l = o || e.has("WEBGL_draw_buffers"), d = t.logarithmicDepthBuffer === true, h6 = n.getParameter(34930), f6 = n.getParameter(35660), g6 = n.getParameter(3379), p = n.getParameter(34076), u6 = n.getParameter(34921), y6 = n.getParameter(36347), v6 = n.getParameter(36348), m6 = n.getParameter(36349), x6 = f6 > 0, w6 = o || e.has("OES_texture_float"), A6 = x6 && w6, M6 = o ? n.getParameter(36183) : 0; return { isWebGL2: o, drawBuffers: l, getMaxAnisotropy: r, getMaxPrecision: s, precision: a6, logarithmicDepthBuffer: d, maxTextures: h6, maxVertexTextures: f6, maxTextureSize: g6, maxCubemapSize: p, maxAttributes: u6, maxVertexUniforms: y6, maxVaryings: v6, maxFragmentUniforms: m6, vertexTextures: x6, floatFragmentTextures: w6, floatVertexTextures: A6, maxSamples: M6 }; } function rO(n) { const e = this; let t = null, i = 0, r = false, s = false; const o = new wi(), a6 = new rn2(), c = { value: null, needsUpdate: false }; this.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(h6, f6, g6) { const p = h6.length !== 0 || f6 || // enable state of previous frame - the clipping code has to // run another frame in order to reset the state: i !== 0 || r; return r = f6, t = d(h6, g6, 0), i = h6.length, p; }, this.beginShadows = function() { s = true, d(null); }, this.endShadows = function() { s = false, l(); }, this.setState = function(h6, f6, g6) { const p = h6.clippingPlanes, u6 = h6.clipIntersection, y6 = h6.clipShadows, v6 = n.get(h6); if (!r || p === null || p.length === 0 || s && !y6) s ? d(null) : l(); else { const m6 = s ? 0 : i, x6 = m6 * 4; let w6 = v6.clippingState || null; c.value = w6, w6 = d(p, f6, x6, g6); for (let A6 = 0; A6 !== x6; ++A6) w6[A6] = t[A6]; v6.clippingState = w6, this.numIntersection = u6 ? this.numPlanes : 0, this.numPlanes += m6; } }; function l() { c.value !== t && (c.value = t, c.needsUpdate = i > 0), e.numPlanes = i, e.numIntersection = 0; } function d(h6, f6, g6, p) { const u6 = h6 !== null ? h6.length : 0; let y6 = null; if (u6 !== 0) { if (y6 = c.value, p !== true || y6 === null) { const v6 = g6 + u6 * 4, m6 = f6.matrixWorldInverse; a6.getNormalMatrix(m6), (y6 === null || y6.length < v6) && (y6 = new Float32Array(v6)); for (let x6 = 0, w6 = g6; x6 !== u6; ++x6, w6 += 4) o.copy(h6[x6]).applyMatrix4(m6, a6), o.normal.toArray(y6, w6), y6[w6 + 3] = o.constant; } c.value = y6, c.needsUpdate = true; } return e.numPlanes = u6, e.numIntersection = 0, y6; } } function sO(n) { let e = /* @__PURE__ */ new WeakMap(); function t(o, a6) { return a6 === Vc ? o.mapping = ll : a6 === Gc && (o.mapping = cl), o; } function i(o) { if (o && o.isTexture) { const a6 = o.mapping; if (a6 === Vc || a6 === Gc) if (e.has(o)) { const c = e.get(o).texture; return t(c, o.mapping); } else { const c = o.image; if (c && c.height > 0) { const l = n.getRenderTarget(), d = new bu(c.height / 2); return d.fromEquirectangularTexture(n, o), e.set(o, d), n.setRenderTarget(l), o.addEventListener("dispose", r), t(d.texture, o.mapping); } else return null; } } return o; } function r(o) { const a6 = o.target; a6.removeEventListener("dispose", r); const c = e.get(a6); c !== void 0 && (e.delete(a6), c.dispose()); } function s() { e = /* @__PURE__ */ new WeakMap(); } return { get: i, dispose: s }; } function oO(n) { const e = {}; function t(i) { if (e[i] !== void 0) return e[i]; let r; switch (i) { case "WEBGL_depth_texture": r = n.getExtension("WEBGL_depth_texture") || n.getExtension("MOZ_WEBGL_depth_texture") || n.getExtension("WEBKIT_WEBGL_depth_texture"); break; case "EXT_texture_filter_anisotropic": r = n.getExtension("EXT_texture_filter_anisotropic") || n.getExtension("MOZ_EXT_texture_filter_anisotropic") || n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); break; case "WEBGL_compressed_texture_s3tc": r = n.getExtension("WEBGL_compressed_texture_s3tc") || n.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); break; case "WEBGL_compressed_texture_pvrtc": r = n.getExtension("WEBGL_compressed_texture_pvrtc") || n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); break; default: r = n.getExtension(i); } return e[i] = r, r; } return { has: function(i) { return t(i) !== null; }, init: function(i) { i.isWebGL2 ? t("EXT_color_buffer_float") : (t("WEBGL_depth_texture"), t("OES_texture_float"), t("OES_texture_half_float"), t("OES_texture_half_float_linear"), t("OES_standard_derivatives"), t("OES_element_index_uint"), t("OES_vertex_array_object"), t("ANGLE_instanced_arrays")), t("OES_texture_float_linear"), t("EXT_color_buffer_half_float"); }, get: function(i) { const r = t(i); return r === null && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."), r; } }; } function aO(n, e, t, i) { const r = {}, s = /* @__PURE__ */ new WeakMap(); function o(h6) { const f6 = h6.target; f6.index !== null && e.remove(f6.index); for (const p in f6.attributes) e.remove(f6.attributes[p]); f6.removeEventListener("dispose", o), delete r[f6.id]; const g6 = s.get(f6); g6 && (e.remove(g6), s.delete(f6)), i.releaseStatesOfGeometry(f6), f6.isInstancedBufferGeometry === true && delete f6._maxInstanceCount, t.memory.geometries--; } function a6(h6, f6) { return r[f6.id] === true || (f6.addEventListener("dispose", o), r[f6.id] = true, t.memory.geometries++), f6; } function c(h6) { const f6 = h6.attributes; for (const p in f6) e.update(f6[p], 34962); const g6 = h6.morphAttributes; for (const p in g6) { const u6 = g6[p]; for (let y6 = 0, v6 = u6.length; y6 < v6; y6++) e.update(u6[y6], 34962); } } function l(h6) { const f6 = [], g6 = h6.index, p = h6.attributes.position; let u6 = 0; if (g6 !== null) { const m6 = g6.array; u6 = g6.version; for (let x6 = 0, w6 = m6.length; x6 < w6; x6 += 3) { const A6 = m6[x6 + 0], M6 = m6[x6 + 1], R6 = m6[x6 + 2]; f6.push(A6, M6, M6, R6, R6, A6); } } else { const m6 = p.array; u6 = p.version; for (let x6 = 0, w6 = m6.length / 3 - 1; x6 < w6; x6 += 3) { const A6 = x6 + 0, M6 = x6 + 1, R6 = x6 + 2; f6.push(A6, M6, M6, R6, R6, A6); } } const y6 = new (hx(f6) > 65535 ? vu : gu)(f6, 1); y6.version = u6; const v6 = s.get(h6); v6 && e.remove(v6), s.set(h6, y6); } function d(h6) { const f6 = s.get(h6); if (f6) { const g6 = h6.index; g6 !== null && f6.version < g6.version && l(h6); } else l(h6); return s.get(h6); } return { get: a6, update: c, getWireframeAttribute: d }; } function lO(n, e, t, i) { const r = i.isWebGL2; let s; function o(f6) { s = f6; } let a6, c; function l(f6) { a6 = f6.type, c = f6.bytesPerElement; } function d(f6, g6) { n.drawElements(s, g6, a6, f6 * c), t.update(g6, s, 1); } function h6(f6, g6, p) { if (p === 0) return; let u6, y6; if (r) u6 = n, y6 = "drawElementsInstanced"; else if (u6 = e.get("ANGLE_instanced_arrays"), y6 = "drawElementsInstancedANGLE", u6 === null) { console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } u6[y6](s, g6, a6, f6 * c, p), t.update(g6, s, p); } this.setMode = o, this.setIndex = l, this.render = d, this.renderInstances = h6; } function cO(n) { const e = { geometries: 0, textures: 0 }, t = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 }; function i(s, o, a6) { switch (t.calls++, o) { case 4: t.triangles += a6 * (s / 3); break; case 1: t.lines += a6 * (s / 2); break; case 3: t.lines += a6 * (s - 1); break; case 2: t.lines += a6 * s; break; case 0: t.points += a6 * s; break; default: console.error("THREE.WebGLInfo: Unknown draw mode:", o); break; } } function r() { t.frame++, t.calls = 0, t.triangles = 0, t.points = 0, t.lines = 0; } return { memory: e, render: t, programs: null, autoReset: true, reset: r, update: i }; } function uO(n, e) { return n[0] - e[0]; } function hO(n, e) { return Math.abs(e[1]) - Math.abs(n[1]); } function dO(n) { const e = {}, t = new Float32Array(8), i = []; for (let s = 0; s < 8; s++) i[s] = [s, 0]; function r(s, o, a6, c) { const l = s.morphTargetInfluences, d = l === void 0 ? 0 : l.length; let h6 = e[o.id]; if (h6 === void 0 || h6.length !== d) { h6 = []; for (let y6 = 0; y6 < d; y6++) h6[y6] = [y6, 0]; e[o.id] = h6; } for (let y6 = 0; y6 < d; y6++) { const v6 = h6[y6]; v6[0] = y6, v6[1] = l[y6]; } h6.sort(hO); for (let y6 = 0; y6 < 8; y6++) y6 < d && h6[y6][1] ? (i[y6][0] = h6[y6][0], i[y6][1] = h6[y6][1]) : (i[y6][0] = Number.MAX_SAFE_INTEGER, i[y6][1] = 0); i.sort(uO); const f6 = a6.morphTargets && o.morphAttributes.position, g6 = a6.morphNormals && o.morphAttributes.normal; let p = 0; for (let y6 = 0; y6 < 8; y6++) { const v6 = i[y6], m6 = v6[0], x6 = v6[1]; m6 !== Number.MAX_SAFE_INTEGER && x6 ? (f6 && o.getAttribute("morphTarget" + y6) !== f6[m6] && o.setAttribute("morphTarget" + y6, f6[m6]), g6 && o.getAttribute("morphNormal" + y6) !== g6[m6] && o.setAttribute("morphNormal" + y6, g6[m6]), t[y6] = x6, p += x6) : (f6 && o.hasAttribute("morphTarget" + y6) === true && o.deleteAttribute("morphTarget" + y6), g6 && o.hasAttribute("morphNormal" + y6) === true && o.deleteAttribute("morphNormal" + y6), t[y6] = 0); } const u6 = o.morphTargetsRelative ? 1 : 1 - p; c.getUniforms().setValue(n, "morphTargetBaseInfluence", u6), c.getUniforms().setValue(n, "morphTargetInfluences", t); } return { update: r }; } function fO(n, e, t, i) { let r = /* @__PURE__ */ new WeakMap(); function s(c) { const l = i.render.frame, d = c.geometry, h6 = e.get(c, d); return r.get(h6) !== l && (e.update(h6), r.set(h6, l)), c.isInstancedMesh && (c.hasEventListener("dispose", a6) === false && c.addEventListener("dispose", a6), t.update(c.instanceMatrix, 34962), c.instanceColor !== null && t.update(c.instanceColor, 34962)), h6; } function o() { r = /* @__PURE__ */ new WeakMap(); } function a6(c) { const l = c.target; l.removeEventListener("dispose", a6), t.remove(l.instanceMatrix), l.instanceColor !== null && t.remove(l.instanceColor); } return { update: s, dispose: o }; } var Lf = class extends Yt { constructor(e = null, t = 1, i = 1, r = 1) { super(null), this.image = { data: e, width: t, height: i, depth: r }, this.magFilter = $t, this.minFilter = $t, this.wrapR = hn2, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.needsUpdate = true; } }; Lf.prototype.isDataTexture2DArray = true; var Rf = class extends Yt { constructor(e = null, t = 1, i = 1, r = 1) { super(null), this.image = { data: e, width: t, height: i, depth: r }, this.magFilter = $t, this.minFilter = $t, this.wrapR = hn2, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.needsUpdate = true; } }; Rf.prototype.isDataTexture3D = true; var px = new Yt(); var pO = new Lf(); var mO = new Rf(); var mx = new ta(); var ig = []; var rg = []; var sg = new Float32Array(16); var og = new Float32Array(9); var ag = new Float32Array(4); function na(n, e, t) { const i = n[0]; if (i <= 0 || i > 0) return n; const r = e * t; let s = ig[r]; if (s === void 0 && (s = new Float32Array(r), ig[r] = s), e !== 0) { i.toArray(s, 0); for (let o = 1, a6 = 0; o !== e; ++o) a6 += t, n[o].toArray(s, a6); } return s; } function Ln(n, e) { if (n.length !== e.length) return false; for (let t = 0, i = n.length; t < i; t++) if (n[t] !== e[t]) return false; return true; } function _n(n, e) { for (let t = 0, i = e.length; t < i; t++) n[t] = e[t]; } function gx(n, e) { let t = rg[e]; t === void 0 && (t = new Int32Array(e), rg[e] = t); for (let i = 0; i !== e; ++i) t[i] = n.allocateTextureUnit(); return t; } function gO(n, e) { const t = this.cache; t[0] !== e && (n.uniform1f(this.addr, e), t[0] = e); } function vO(n, e) { const t = this.cache; if (e.x !== void 0) (t[0] !== e.x || t[1] !== e.y) && (n.uniform2f(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y); else { if (Ln(t, e)) return; n.uniform2fv(this.addr, e), _n(t, e); } } function yO(n, e) { const t = this.cache; if (e.x !== void 0) (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (n.uniform3f(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z); else if (e.r !== void 0) (t[0] !== e.r || t[1] !== e.g || t[2] !== e.b) && (n.uniform3f(this.addr, e.r, e.g, e.b), t[0] = e.r, t[1] = e.g, t[2] = e.b); else { if (Ln(t, e)) return; n.uniform3fv(this.addr, e), _n(t, e); } } function bO(n, e) { const t = this.cache; if (e.x !== void 0) (t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (n.uniform4f(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w); else { if (Ln(t, e)) return; n.uniform4fv(this.addr, e), _n(t, e); } } function xO(n, e) { const t = this.cache, i = e.elements; if (i === void 0) { if (Ln(t, e)) return; n.uniformMatrix2fv(this.addr, false, e), _n(t, e); } else { if (Ln(t, i)) return; ag.set(i), n.uniformMatrix2fv(this.addr, false, ag), _n(t, i); } } function MO(n, e) { const t = this.cache, i = e.elements; if (i === void 0) { if (Ln(t, e)) return; n.uniformMatrix3fv(this.addr, false, e), _n(t, e); } else { if (Ln(t, i)) return; og.set(i), n.uniformMatrix3fv(this.addr, false, og), _n(t, i); } } function wO(n, e) { const t = this.cache, i = e.elements; if (i === void 0) { if (Ln(t, e)) return; n.uniformMatrix4fv(this.addr, false, e), _n(t, e); } else { if (Ln(t, i)) return; sg.set(i), n.uniformMatrix4fv(this.addr, false, sg), _n(t, i); } } function AO(n, e) { const t = this.cache; t[0] !== e && (n.uniform1i(this.addr, e), t[0] = e); } function SO(n, e) { const t = this.cache; Ln(t, e) || (n.uniform2iv(this.addr, e), _n(t, e)); } function _O(n, e) { const t = this.cache; Ln(t, e) || (n.uniform3iv(this.addr, e), _n(t, e)); } function TO(n, e) { const t = this.cache; Ln(t, e) || (n.uniform4iv(this.addr, e), _n(t, e)); } function EO(n, e) { const t = this.cache; t[0] !== e && (n.uniform1ui(this.addr, e), t[0] = e); } function CO(n, e) { const t = this.cache; Ln(t, e) || (n.uniform2uiv(this.addr, e), _n(t, e)); } function LO(n, e) { const t = this.cache; Ln(t, e) || (n.uniform3uiv(this.addr, e), _n(t, e)); } function RO(n, e) { const t = this.cache; Ln(t, e) || (n.uniform4uiv(this.addr, e), _n(t, e)); } function FO(n, e, t) { const i = this.cache, r = t.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t.safeSetTexture2D(e || px, r); } function PO(n, e, t) { const i = this.cache, r = t.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t.setTexture3D(e || mO, r); } function IO(n, e, t) { const i = this.cache, r = t.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t.safeSetTextureCube(e || mx, r); } function OO(n, e, t) { const i = this.cache, r = t.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t.setTexture2DArray(e || pO, r); } function DO(n) { switch (n) { case 5126: return gO; case 35664: return vO; case 35665: return yO; case 35666: return bO; case 35674: return xO; case 35675: return MO; case 35676: return wO; case 5124: case 35670: return AO; case 35667: case 35671: return SO; case 35668: case 35672: return _O; case 35669: case 35673: return TO; case 5125: return EO; case 36294: return CO; case 36295: return LO; case 36296: return RO; case 35678: case 36198: case 36298: case 36306: case 35682: return FO; case 35679: case 36299: case 36307: return PO; case 35680: case 36300: case 36308: case 36293: return IO; case 36289: case 36303: case 36311: case 36292: return OO; } } function NO(n, e) { n.uniform1fv(this.addr, e); } function BO(n, e) { const t = na(e, this.size, 2); n.uniform2fv(this.addr, t); } function UO(n, e) { const t = na(e, this.size, 3); n.uniform3fv(this.addr, t); } function zO(n, e) { const t = na(e, this.size, 4); n.uniform4fv(this.addr, t); } function kO(n, e) { const t = na(e, this.size, 4); n.uniformMatrix2fv(this.addr, false, t); } function VO(n, e) { const t = na(e, this.size, 9); n.uniformMatrix3fv(this.addr, false, t); } function GO(n, e) { const t = na(e, this.size, 16); n.uniformMatrix4fv(this.addr, false, t); } function HO(n, e) { n.uniform1iv(this.addr, e); } function WO(n, e) { n.uniform2iv(this.addr, e); } function jO(n, e) { n.uniform3iv(this.addr, e); } function $O(n, e) { n.uniform4iv(this.addr, e); } function ZO(n, e) { n.uniform1uiv(this.addr, e); } function XO(n, e) { n.uniform2uiv(this.addr, e); } function YO(n, e) { n.uniform3uiv(this.addr, e); } function JO(n, e) { n.uniform4uiv(this.addr, e); } function KO(n, e, t) { const i = e.length, r = gx(t, i); n.uniform1iv(this.addr, r); for (let s = 0; s !== i; ++s) t.safeSetTexture2D(e[s] || px, r[s]); } function qO(n, e, t) { const i = e.length, r = gx(t, i); n.uniform1iv(this.addr, r); for (let s = 0; s !== i; ++s) t.safeSetTextureCube(e[s] || mx, r[s]); } function QO(n) { switch (n) { case 5126: return NO; case 35664: return BO; case 35665: return UO; case 35666: return zO; case 35674: return kO; case 35675: return VO; case 35676: return GO; case 5124: case 35670: return HO; case 35667: case 35671: return WO; case 35668: case 35672: return jO; case 35669: case 35673: return $O; case 5125: return ZO; case 36294: return XO; case 36295: return YO; case 36296: return JO; case 35678: case 36198: case 36298: case 36306: case 35682: return KO; case 35680: case 36300: case 36308: case 36293: return qO; } } function eD(n, e, t) { this.id = n, this.addr = t, this.cache = [], this.setValue = DO(e.type); } function vx(n, e, t) { this.id = n, this.addr = t, this.cache = [], this.size = e.size, this.setValue = QO(e.type); } vx.prototype.updateCache = function(n) { const e = this.cache; n instanceof Float32Array && e.length !== n.length && (this.cache = new Float32Array(n.length)), _n(e, n); }; function yx(n) { this.id = n, this.seq = [], this.map = {}; } yx.prototype.setValue = function(n, e, t) { const i = this.seq; for (let r = 0, s = i.length; r !== s; ++r) { const o = i[r]; o.setValue(n, e[o.id], t); } }; var mh = /(\w+)(\])?(\[|\.)?/g; function lg(n, e) { n.seq.push(e), n.map[e.id] = e; } function tD(n, e, t) { const i = n.name, r = i.length; for (mh.lastIndex = 0; ; ) { const s = mh.exec(i), o = mh.lastIndex; let a6 = s[1]; const c = s[2] === "]", l = s[3]; if (c && (a6 = a6 | 0), l === void 0 || l === "[" && o + 2 === r) { lg(t, l === void 0 ? new eD(a6, n, e) : new vx(a6, n, e)); break; } else { let h6 = t.map[a6]; h6 === void 0 && (h6 = new yx(a6), lg(t, h6)), t = h6; } } } function Or(n, e) { this.seq = [], this.map = {}; const t = n.getProgramParameter(e, 35718); for (let i = 0; i < t; ++i) { const r = n.getActiveUniform(e, i), s = n.getUniformLocation(e, r.name); tD(r, s, this); } } Or.prototype.setValue = function(n, e, t, i) { const r = this.map[e]; r !== void 0 && r.setValue(n, t, i); }; Or.prototype.setOptional = function(n, e, t) { const i = e[t]; i !== void 0 && this.setValue(n, t, i); }; Or.upload = function(n, e, t, i) { for (let r = 0, s = e.length; r !== s; ++r) { const o = e[r], a6 = t[o.id]; a6.needsUpdate !== false && o.setValue(n, a6.value, i); } }; Or.seqWithValue = function(n, e) { const t = []; for (let i = 0, r = n.length; i !== r; ++i) { const s = n[i]; s.id in e && t.push(s); } return t; }; function cg(n, e, t) { const i = n.createShader(e); return n.shaderSource(i, t), n.compileShader(i), i; } var nD = 0; function iD(n) { const e = n.split(` `); for (let t = 0; t < e.length; t++) e[t] = t + 1 + ": " + e[t]; return e.join(` `); } function bx(n) { switch (n) { case Cn: return ["Linear", "( value )"]; case Cs: return ["sRGB", "( value )"]; case mu: return ["RGBE", "( value )"]; case Af: return ["RGBM", "( value, 7.0 )"]; case Sf: return ["RGBM", "( value, 16.0 )"]; case _f: return ["RGBD", "( value, 256.0 )"]; case pu: return ["Gamma", "( value, float( GAMMA_FACTOR ) )"]; case Yb: return ["LogLuv", "( value )"]; default: return console.warn("THREE.WebGLProgram: Unsupported encoding:", n), ["Linear", "( value )"]; } } function ug(n, e, t) { const i = n.getShaderParameter(e, 35713), r = n.getShaderInfoLog(e).trim(); if (i && r === "") return ""; const s = n.getShaderSource(e); return "THREE.WebGLShader: gl.getShaderInfoLog() " + t + ` ` + r + iD(s); } function ma(n, e) { const t = bx(e); return "vec4 " + n + "( vec4 value ) { return " + t[0] + "ToLinear" + t[1] + "; }"; } function rD(n, e) { const t = bx(e); return "vec4 " + n + "( vec4 value ) { return LinearTo" + t[0] + t[1] + "; }"; } function sD(n, e) { let t; switch (e) { case Zy: t = "Linear"; break; case Xy: t = "Reinhard"; break; case Yy: t = "OptimizedCineon"; break; case Jy: t = "ACESFilmic"; break; case Ky: t = "Custom"; break; default: console.warn("THREE.WebGLProgram: Unsupported toneMapping:", e), t = "Linear"; } return "vec3 " + n + "( vec3 color ) { return " + t + "ToneMapping( color ); }"; } function oD(n) { return [ n.extensionDerivatives || n.envMapCubeUV || n.bumpMap || n.tangentSpaceNormalMap || n.clearcoatNormalMap || n.flatShading || n.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "", (n.extensionFragDepth || n.logarithmicDepthBuffer) && n.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "", n.extensionDrawBuffers && n.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "", (n.extensionShaderTextureLOD || n.envMap || n.transmission > 0) && n.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : "" ].filter(Ta).join(` `); } function aD(n) { const e = []; for (const t in n) { const i = n[t]; i !== false && e.push("#define " + t + " " + i); } return e.join(` `); } function lD(n, e) { const t = {}, i = n.getProgramParameter(e, 35721); for (let r = 0; r < i; r++) { const o = n.getActiveAttrib(e, r).name; t[o] = n.getAttribLocation(e, o); } return t; } function Ta(n) { return n !== ""; } function hg(n, e) { return n.replace(/NUM_DIR_LIGHTS/g, e.numDirLights).replace(/NUM_SPOT_LIGHTS/g, e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, e.numPointLights).replace(/NUM_HEMI_LIGHTS/g, e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, e.numPointLightShadows); } function dg(n, e) { return n.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection); } var cD = /^[ \t]*#include +<([\w\d./]+)>/gm; function Md(n) { return n.replace(cD, uD); } function uD(n, e) { const t = dt[e]; if (t === void 0) throw new Error("Can not resolve #include <" + e + ">"); return Md(t); } var hD = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; var dD = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g; function fg(n) { return n.replace(dD, xx).replace(hD, fD); } function fD(n, e, t, i) { return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."), xx(n, e, t, i); } function xx(n, e, t, i) { let r = ""; for (let s = parseInt(e); s < parseInt(t); s++) r += i.replace(/\[\s*i\s*\]/g, "[ " + s + " ]").replace(/UNROLLED_LOOP_INDEX/g, s); return r; } function pg(n) { let e = "precision " + n.precision + ` float; precision ` + n.precision + " int;"; return n.precision === "highp" ? e += ` #define HIGH_PRECISION` : n.precision === "mediump" ? e += ` #define MEDIUM_PRECISION` : n.precision === "lowp" && (e += ` #define LOW_PRECISION`), e; } function pD(n) { let e = "SHADOWMAP_TYPE_BASIC"; return n.shadowMapType === vf ? e = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === _y ? e = "SHADOWMAP_TYPE_PCF_SOFT" : n.shadowMapType === po && (e = "SHADOWMAP_TYPE_VSM"), e; } function mD(n) { let e = "ENVMAP_TYPE_CUBE"; if (n.envMap) switch (n.envMapMode) { case ll: case cl: e = "ENVMAP_TYPE_CUBE"; break; case ea: case ul: e = "ENVMAP_TYPE_CUBE_UV"; break; } return e; } function gD(n) { let e = "ENVMAP_MODE_REFLECTION"; if (n.envMap) switch (n.envMapMode) { case cl: case ul: e = "ENVMAP_MODE_REFRACTION"; break; } return e; } function vD(n) { let e = "ENVMAP_BLENDING_NONE"; if (n.envMap) switch (n.combine) { case al: e = "ENVMAP_BLENDING_MULTIPLY"; break; case jy: e = "ENVMAP_BLENDING_MIX"; break; case $y: e = "ENVMAP_BLENDING_ADD"; break; } return e; } function yD(n, e, t, i) { const r = n.getContext(), s = t.defines; let o = t.vertexShader, a6 = t.fragmentShader; const c = pD(t), l = mD(t), d = gD(t), h6 = vD(t), f6 = n.gammaFactor > 0 ? n.gammaFactor : 1, g6 = t.isWebGL2 ? "" : oD(t), p = aD(s), u6 = r.createProgram(); let y6, v6, m6 = t.glslVersion ? "#version " + t.glslVersion + ` ` : ""; t.isRawShaderMaterial ? (y6 = [ p ].filter(Ta).join(` `), y6.length > 0 && (y6 += ` `), v6 = [ g6, p ].filter(Ta).join(` `), v6.length > 0 && (v6 += ` `)) : (y6 = [ pg(t), "#define SHADER_NAME " + t.shaderName, p, t.instancing ? "#define USE_INSTANCING" : "", t.instancingColor ? "#define USE_INSTANCING_COLOR" : "", t.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + f6, "#define MAX_BONES " + t.maxBones, t.useFog && t.fog ? "#define USE_FOG" : "", t.useFog && t.fogExp2 ? "#define FOG_EXP2" : "", t.map ? "#define USE_MAP" : "", t.envMap ? "#define USE_ENVMAP" : "", t.envMap ? "#define " + d : "", t.lightMap ? "#define USE_LIGHTMAP" : "", t.aoMap ? "#define USE_AOMAP" : "", t.emissiveMap ? "#define USE_EMISSIVEMAP" : "", t.bumpMap ? "#define USE_BUMPMAP" : "", t.normalMap ? "#define USE_NORMALMAP" : "", t.normalMap && t.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", t.normalMap && t.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", t.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", t.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", t.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", t.displacementMap && t.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", t.specularMap ? "#define USE_SPECULARMAP" : "", t.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", t.metalnessMap ? "#define USE_METALNESSMAP" : "", t.alphaMap ? "#define USE_ALPHAMAP" : "", t.transmission ? "#define USE_TRANSMISSION" : "", t.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", t.thicknessMap ? "#define USE_THICKNESSMAP" : "", t.vertexTangents ? "#define USE_TANGENT" : "", t.vertexColors ? "#define USE_COLOR" : "", t.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", t.vertexUvs ? "#define USE_UV" : "", t.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", t.flatShading ? "#define FLAT_SHADED" : "", t.skinning ? "#define USE_SKINNING" : "", t.useVertexTexture ? "#define BONE_TEXTURE" : "", t.morphTargets ? "#define USE_MORPHTARGETS" : "", t.morphNormals && t.flatShading === false ? "#define USE_MORPHNORMALS" : "", t.doubleSided ? "#define DOUBLE_SIDED" : "", t.flipSided ? "#define FLIP_SIDED" : "", t.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", t.shadowMapEnabled ? "#define " + c : "", t.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", t.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", t.logarithmicDepthBuffer && t.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", "#ifdef USE_INSTANCING", " attribute mat4 instanceMatrix;", "#endif", "#ifdef USE_INSTANCING_COLOR", " attribute vec3 instanceColor;", "#endif", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_TANGENT", " attribute vec4 tangent;", "#endif", "#if defined( USE_COLOR_ALPHA )", " attribute vec4 color;", "#elif defined( USE_COLOR )", " attribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", " attribute vec3 morphTarget0;", " attribute vec3 morphTarget1;", " attribute vec3 morphTarget2;", " attribute vec3 morphTarget3;", " #ifdef USE_MORPHNORMALS", " attribute vec3 morphNormal0;", " attribute vec3 morphNormal1;", " attribute vec3 morphNormal2;", " attribute vec3 morphNormal3;", " #else", " attribute vec3 morphTarget4;", " attribute vec3 morphTarget5;", " attribute vec3 morphTarget6;", " attribute vec3 morphTarget7;", " #endif", "#endif", "#ifdef USE_SKINNING", " attribute vec4 skinIndex;", " attribute vec4 skinWeight;", "#endif", ` ` ].filter(Ta).join(` `), v6 = [ g6, pg(t), "#define SHADER_NAME " + t.shaderName, p, t.alphaTest ? "#define ALPHATEST " + t.alphaTest + (t.alphaTest % 1 ? "" : ".0") : "", // add '.0' if integer "#define GAMMA_FACTOR " + f6, t.useFog && t.fog ? "#define USE_FOG" : "", t.useFog && t.fogExp2 ? "#define FOG_EXP2" : "", t.map ? "#define USE_MAP" : "", t.matcap ? "#define USE_MATCAP" : "", t.envMap ? "#define USE_ENVMAP" : "", t.envMap ? "#define " + l : "", t.envMap ? "#define " + d : "", t.envMap ? "#define " + h6 : "", t.lightMap ? "#define USE_LIGHTMAP" : "", t.aoMap ? "#define USE_AOMAP" : "", t.emissiveMap ? "#define USE_EMISSIVEMAP" : "", t.bumpMap ? "#define USE_BUMPMAP" : "", t.normalMap ? "#define USE_NORMALMAP" : "", t.normalMap && t.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", t.normalMap && t.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", t.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", t.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", t.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", t.specularMap ? "#define USE_SPECULARMAP" : "", t.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", t.metalnessMap ? "#define USE_METALNESSMAP" : "", t.alphaMap ? "#define USE_ALPHAMAP" : "", t.sheen ? "#define USE_SHEEN" : "", t.transmission ? "#define USE_TRANSMISSION" : "", t.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", t.thicknessMap ? "#define USE_THICKNESSMAP" : "", t.vertexTangents ? "#define USE_TANGENT" : "", t.vertexColors || t.instancingColor ? "#define USE_COLOR" : "", t.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", t.vertexUvs ? "#define USE_UV" : "", t.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", t.gradientMap ? "#define USE_GRADIENTMAP" : "", t.flatShading ? "#define FLAT_SHADED" : "", t.doubleSided ? "#define DOUBLE_SIDED" : "", t.flipSided ? "#define FLIP_SIDED" : "", t.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", t.shadowMapEnabled ? "#define " + c : "", t.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", t.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", t.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", t.logarithmicDepthBuffer && t.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", (t.extensionShaderTextureLOD || t.envMap) && t.rendererExtensionShaderTextureLod ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", t.toneMapping !== Ir ? "#define TONE_MAPPING" : "", t.toneMapping !== Ir ? dt.tonemapping_pars_fragment : "", // this code is required here because it is used by the toneMapping() function defined below t.toneMapping !== Ir ? sD("toneMapping", t.toneMapping) : "", t.dithering ? "#define DITHERING" : "", dt.encodings_pars_fragment, // this code is required here because it is used by the various encoding/decoding function defined below t.map ? ma("mapTexelToLinear", t.mapEncoding) : "", t.matcap ? ma("matcapTexelToLinear", t.matcapEncoding) : "", t.envMap ? ma("envMapTexelToLinear", t.envMapEncoding) : "", t.emissiveMap ? ma("emissiveMapTexelToLinear", t.emissiveMapEncoding) : "", t.lightMap ? ma("lightMapTexelToLinear", t.lightMapEncoding) : "", rD("linearToOutputTexel", t.outputEncoding), t.depthPacking ? "#define DEPTH_PACKING " + t.depthPacking : "", ` ` ].filter(Ta).join(` `)), o = Md(o), o = hg(o, t), o = dg(o, t), a6 = Md(a6), a6 = hg(a6, t), a6 = dg(a6, t), o = fg(o), a6 = fg(a6), t.isWebGL2 && t.isRawShaderMaterial !== true && (m6 = `#version 300 es `, y6 = [ "#define attribute in", "#define varying out", "#define texture2D texture" ].join(` `) + ` ` + y6, v6 = [ "#define varying in", t.glslVersion === yd ? "" : "out highp vec4 pc_fragColor;", t.glslVersion === yd ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", "#define texture2DProj textureProj", "#define texture2DLodEXT textureLod", "#define texture2DProjLodEXT textureProjLod", "#define textureCubeLodEXT textureLod", "#define texture2DGradEXT textureGrad", "#define texture2DProjGradEXT textureProjGrad", "#define textureCubeGradEXT textureGrad" ].join(` `) + ` ` + v6); const x6 = m6 + y6 + o, w6 = m6 + v6 + a6, A6 = cg(r, 35633, x6), M6 = cg(r, 35632, w6); if (r.attachShader(u6, A6), r.attachShader(u6, M6), t.index0AttributeName !== void 0 ? r.bindAttribLocation(u6, 0, t.index0AttributeName) : t.morphTargets === true && r.bindAttribLocation(u6, 0, "position"), r.linkProgram(u6), n.debug.checkShaderErrors) { const T6 = r.getProgramInfoLog(u6).trim(), P6 = r.getShaderInfoLog(A6).trim(), _6 = r.getShaderInfoLog(M6).trim(); let S6 = true, E6 = true; if (r.getProgramParameter(u6, 35714) === false) { S6 = false; const C6 = ug(r, A6, "vertex"), I6 = ug(r, M6, "fragment"); console.error("THREE.WebGLProgram: shader error: ", r.getError(), "35715", r.getProgramParameter(u6, 35715), "gl.getProgramInfoLog", T6, C6, I6); } else T6 !== "" ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", T6) : (P6 === "" || _6 === "") && (E6 = false); E6 && (this.diagnostics = { runnable: S6, programLog: T6, vertexShader: { log: P6, prefix: y6 }, fragmentShader: { log: _6, prefix: v6 } }); } r.deleteShader(A6), r.deleteShader(M6); let R6; this.getUniforms = function() { return R6 === void 0 && (R6 = new Or(r, u6)), R6; }; let L6; return this.getAttributes = function() { return L6 === void 0 && (L6 = lD(r, u6)), L6; }, this.destroy = function() { i.releaseStatesOfProgram(this), r.deleteProgram(u6), this.program = void 0; }, this.name = t.shaderName, this.id = nD++, this.cacheKey = e, this.usedTimes = 1, this.program = u6, this.vertexShader = A6, this.fragmentShader = M6, this; } function bD(n, e, t, i, r, s) { const o = [], a6 = i.isWebGL2, c = i.logarithmicDepthBuffer, l = i.floatVertexTextures, d = i.maxVertexUniforms, h6 = i.vertexTextures; let f6 = i.precision; const g6 = { MeshDepthMaterial: "depth", MeshDistanceMaterial: "distanceRGBA", MeshNormalMaterial: "normal", MeshBasicMaterial: "basic", MeshLambertMaterial: "lambert", MeshPhongMaterial: "phong", MeshToonMaterial: "toon", MeshStandardMaterial: "physical", MeshPhysicalMaterial: "physical", MeshMatcapMaterial: "matcap", LineBasicMaterial: "basic", LineDashedMaterial: "dashed", PointsMaterial: "points", ShadowMaterial: "shadow", SpriteMaterial: "sprite" }, p = [ "precision", "isWebGL2", "supportsVertexTextures", "outputEncoding", "instancing", "instancingColor", "map", "mapEncoding", "matcap", "matcapEncoding", "envMap", "envMapMode", "envMapEncoding", "envMapCubeUV", "lightMap", "lightMapEncoding", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "gradientMap", "alphaMap", "combine", "vertexColors", "vertexAlphas", "vertexTangents", "vertexUvs", "uvsVertexOnly", "fog", "useFog", "fogExp2", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "numRectAreaLights", "numDirLightShadows", "numPointLightShadows", "numSpotLightShadows", "shadowMapEnabled", "shadowMapType", "toneMapping", "physicallyCorrectLights", "alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking", "dithering", "sheen", "transmission", "transmissionMap", "thicknessMap" ]; function u6(M6) { const L6 = M6.skeleton.bones; if (l) return 1024; { const P6 = Math.floor((d - 20) / 4), _6 = Math.min(P6, L6.length); return _6 < L6.length ? (console.warn("THREE.WebGLRenderer: Skeleton has " + L6.length + " bones. This GPU supports " + _6 + "."), 0) : _6; } } function y6(M6) { let R6; return M6 && M6.isTexture ? R6 = M6.encoding : M6 && M6.isWebGLRenderTarget ? (console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."), R6 = M6.texture.encoding) : R6 = Cn, R6; } function v6(M6, R6, L6, T6, P6) { const _6 = T6.fog, S6 = M6.isMeshStandardMaterial ? T6.environment : null, E6 = e.get(M6.envMap || S6), C6 = g6[M6.type], I6 = P6.isSkinnedMesh ? u6(P6) : 0; M6.precision !== null && (f6 = i.getMaxPrecision(M6.precision), f6 !== M6.precision && console.warn("THREE.WebGLProgram.getParameters:", M6.precision, "not supported, using", f6, "instead.")); let b6, F6; if (C6) { const B6 = ci[C6]; b6 = B6.vertexShader, F6 = B6.fragmentShader; } else b6 = M6.vertexShader, F6 = M6.fragmentShader; const D6 = n.getRenderTarget(); return { isWebGL2: a6, shaderID: C6, shaderName: M6.type, vertexShader: b6, fragmentShader: F6, defines: M6.defines, isRawShaderMaterial: M6.isRawShaderMaterial === true, glslVersion: M6.glslVersion, precision: f6, instancing: P6.isInstancedMesh === true, instancingColor: P6.isInstancedMesh === true && P6.instanceColor !== null, supportsVertexTextures: h6, outputEncoding: D6 !== null ? y6(D6.texture) : n.outputEncoding, map: !!M6.map, mapEncoding: y6(M6.map), matcap: !!M6.matcap, matcapEncoding: y6(M6.matcap), envMap: !!E6, envMapMode: E6 && E6.mapping, envMapEncoding: y6(E6), envMapCubeUV: !!E6 && (E6.mapping === ea || E6.mapping === ul), lightMap: !!M6.lightMap, lightMapEncoding: y6(M6.lightMap), aoMap: !!M6.aoMap, emissiveMap: !!M6.emissiveMap, emissiveMapEncoding: y6(M6.emissiveMap), bumpMap: !!M6.bumpMap, normalMap: !!M6.normalMap, objectSpaceNormalMap: M6.normalMapType === qb, tangentSpaceNormalMap: M6.normalMapType === Jr, clearcoatMap: !!M6.clearcoatMap, clearcoatRoughnessMap: !!M6.clearcoatRoughnessMap, clearcoatNormalMap: !!M6.clearcoatNormalMap, displacementMap: !!M6.displacementMap, roughnessMap: !!M6.roughnessMap, metalnessMap: !!M6.metalnessMap, specularMap: !!M6.specularMap, alphaMap: !!M6.alphaMap, gradientMap: !!M6.gradientMap, sheen: !!M6.sheen, transmission: !!M6.transmission, transmissionMap: !!M6.transmissionMap, thicknessMap: !!M6.thicknessMap, combine: M6.combine, vertexTangents: M6.normalMap && M6.vertexTangents, vertexColors: M6.vertexColors, vertexAlphas: M6.vertexColors === true && P6.geometry && P6.geometry.attributes.color && P6.geometry.attributes.color.itemSize === 4, vertexUvs: !!M6.map || !!M6.bumpMap || !!M6.normalMap || !!M6.specularMap || !!M6.alphaMap || !!M6.emissiveMap || !!M6.roughnessMap || !!M6.metalnessMap || !!M6.clearcoatMap || !!M6.clearcoatRoughnessMap || !!M6.clearcoatNormalMap || !!M6.displacementMap || !!M6.transmissionMap || !!M6.thicknessMap, uvsVertexOnly: !(M6.map || M6.bumpMap || M6.normalMap || M6.specularMap || M6.alphaMap || M6.emissiveMap || M6.roughnessMap || M6.metalnessMap || M6.clearcoatNormalMap || M6.transmission || M6.transmissionMap || M6.thicknessMap) && !!M6.displacementMap, fog: !!_6, useFog: M6.fog, fogExp2: _6 && _6.isFogExp2, flatShading: !!M6.flatShading, sizeAttenuation: M6.sizeAttenuation, logarithmicDepthBuffer: c, skinning: P6.isSkinnedMesh === true && I6 > 0, maxBones: I6, useVertexTexture: l, morphTargets: M6.morphTargets, morphNormals: M6.morphNormals, numDirLights: R6.directional.length, numPointLights: R6.point.length, numSpotLights: R6.spot.length, numRectAreaLights: R6.rectArea.length, numHemiLights: R6.hemi.length, numDirLightShadows: R6.directionalShadowMap.length, numPointLightShadows: R6.pointShadowMap.length, numSpotLightShadows: R6.spotShadowMap.length, numClippingPlanes: s.numPlanes, numClipIntersection: s.numIntersection, dithering: M6.dithering, shadowMapEnabled: n.shadowMap.enabled && L6.length > 0, shadowMapType: n.shadowMap.type, toneMapping: M6.toneMapped ? n.toneMapping : Ir, physicallyCorrectLights: n.physicallyCorrectLights, premultipliedAlpha: M6.premultipliedAlpha, alphaTest: M6.alphaTest, doubleSided: M6.side === Wr, flipSided: M6.side === jt, depthPacking: M6.depthPacking !== void 0 ? M6.depthPacking : false, index0AttributeName: M6.index0AttributeName, extensionDerivatives: M6.extensions && M6.extensions.derivatives, extensionFragDepth: M6.extensions && M6.extensions.fragDepth, extensionDrawBuffers: M6.extensions && M6.extensions.drawBuffers, extensionShaderTextureLOD: M6.extensions && M6.extensions.shaderTextureLOD, rendererExtensionFragDepth: a6 || t.has("EXT_frag_depth"), rendererExtensionDrawBuffers: a6 || t.has("WEBGL_draw_buffers"), rendererExtensionShaderTextureLod: a6 || t.has("EXT_shader_texture_lod"), customProgramCacheKey: M6.customProgramCacheKey() }; } function m6(M6) { const R6 = []; if (M6.shaderID ? R6.push(M6.shaderID) : (R6.push(M6.fragmentShader), R6.push(M6.vertexShader)), M6.defines !== void 0) for (const L6 in M6.defines) R6.push(L6), R6.push(M6.defines[L6]); if (M6.isRawShaderMaterial === false) { for (let L6 = 0; L6 < p.length; L6++) R6.push(M6[p[L6]]); R6.push(n.outputEncoding), R6.push(n.gammaFactor); } return R6.push(M6.customProgramCacheKey), R6.join(); } function x6(M6) { const R6 = g6[M6.type]; let L6; if (R6) { const T6 = ci[R6]; L6 = dx.clone(T6.uniforms); } else L6 = M6.uniforms; return L6; } function w6(M6, R6) { let L6; for (let T6 = 0, P6 = o.length; T6 < P6; T6++) { const _6 = o[T6]; if (_6.cacheKey === R6) { L6 = _6, ++L6.usedTimes; break; } } return L6 === void 0 && (L6 = new yD(n, R6, M6, r), o.push(L6)), L6; } function A6(M6) { if (--M6.usedTimes === 0) { const R6 = o.indexOf(M6); o[R6] = o[o.length - 1], o.pop(), M6.destroy(); } } return { getParameters: v6, getProgramCacheKey: m6, getUniforms: x6, acquireProgram: w6, releaseProgram: A6, // Exposed for resource monitoring & error feedback via renderer.info: programs: o }; } function xD() { let n = /* @__PURE__ */ new WeakMap(); function e(s) { let o = n.get(s); return o === void 0 && (o = {}, n.set(s, o)), o; } function t(s) { n.delete(s); } function i(s, o, a6) { n.get(s)[o] = a6; } function r() { n = /* @__PURE__ */ new WeakMap(); } return { get: e, remove: t, update: i, dispose: r }; } function MD(n, e) { return n.groupOrder !== e.groupOrder ? n.groupOrder - e.groupOrder : n.renderOrder !== e.renderOrder ? n.renderOrder - e.renderOrder : n.program !== e.program ? n.program.id - e.program.id : n.material.id !== e.material.id ? n.material.id - e.material.id : n.z !== e.z ? n.z - e.z : n.id - e.id; } function mg(n, e) { return n.groupOrder !== e.groupOrder ? n.groupOrder - e.groupOrder : n.renderOrder !== e.renderOrder ? n.renderOrder - e.renderOrder : n.z !== e.z ? e.z - n.z : n.id - e.id; } function gg(n) { const e = []; let t = 0; const i = [], r = [], s = [], o = { id: -1 }; function a6() { t = 0, i.length = 0, r.length = 0, s.length = 0; } function c(g6, p, u6, y6, v6, m6) { let x6 = e[t]; const w6 = n.get(u6); return x6 === void 0 ? (x6 = { id: g6.id, object: g6, geometry: p, material: u6, program: w6.program || o, groupOrder: y6, renderOrder: g6.renderOrder, z: v6, group: m6 }, e[t] = x6) : (x6.id = g6.id, x6.object = g6, x6.geometry = p, x6.material = u6, x6.program = w6.program || o, x6.groupOrder = y6, x6.renderOrder = g6.renderOrder, x6.z = v6, x6.group = m6), t++, x6; } function l(g6, p, u6, y6, v6, m6) { const x6 = c(g6, p, u6, y6, v6, m6); u6.transmission > 0 ? r.push(x6) : u6.transparent === true ? s.push(x6) : i.push(x6); } function d(g6, p, u6, y6, v6, m6) { const x6 = c(g6, p, u6, y6, v6, m6); u6.transmission > 0 ? r.unshift(x6) : u6.transparent === true ? s.unshift(x6) : i.unshift(x6); } function h6(g6, p) { i.length > 1 && i.sort(g6 || MD), r.length > 1 && r.sort(p || mg), s.length > 1 && s.sort(p || mg); } function f6() { for (let g6 = t, p = e.length; g6 < p; g6++) { const u6 = e[g6]; if (u6.id === null) break; u6.id = null, u6.object = null, u6.geometry = null, u6.material = null, u6.program = null, u6.group = null; } } return { opaque: i, transmissive: r, transparent: s, init: a6, push: l, unshift: d, finish: f6, sort: h6 }; } function wD(n) { let e = /* @__PURE__ */ new WeakMap(); function t(r, s) { let o; return e.has(r) === false ? (o = new gg(n), e.set(r, [o])) : s >= e.get(r).length ? (o = new gg(n), e.get(r).push(o)) : o = e.get(r)[s], o; } function i() { e = /* @__PURE__ */ new WeakMap(); } return { get: t, dispose: i }; } function AD() { const n = {}; return { get: function(e) { if (n[e.id] !== void 0) return n[e.id]; let t; switch (e.type) { case "DirectionalLight": t = { direction: new q4(), color: new Ue() }; break; case "SpotLight": t = { position: new q4(), direction: new q4(), color: new Ue(), distance: 0, coneCos: 0, penumbraCos: 0, decay: 0 }; break; case "PointLight": t = { position: new q4(), color: new Ue(), distance: 0, decay: 0 }; break; case "HemisphereLight": t = { direction: new q4(), skyColor: new Ue(), groundColor: new Ue() }; break; case "RectAreaLight": t = { color: new Ue(), position: new q4(), halfWidth: new q4(), halfHeight: new q4() }; break; } return n[e.id] = t, t; } }; } function SD() { const n = {}; return { get: function(e) { if (n[e.id] !== void 0) return n[e.id]; let t; switch (e.type) { case "DirectionalLight": t = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Re() }; break; case "SpotLight": t = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Re() }; break; case "PointLight": t = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Re(), shadowCameraNear: 1, shadowCameraFar: 1e3 }; break; } return n[e.id] = t, t; } }; } var _D = 0; function TD(n, e) { return (e.castShadow ? 1 : 0) - (n.castShadow ? 1 : 0); } function ED(n, e) { const t = new AD(), i = SD(), r = { version: 0, hash: { directionalLength: -1, pointLength: -1, spotLength: -1, rectAreaLength: -1, hemiLength: -1, numDirectionalShadows: -1, numPointShadows: -1, numSpotShadows: -1 }, ambient: [0, 0, 0], probe: [], directional: [], directionalShadow: [], directionalShadowMap: [], directionalShadowMatrix: [], spot: [], spotShadow: [], spotShadowMap: [], spotShadowMatrix: [], rectArea: [], rectAreaLTC1: null, rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], pointShadowMatrix: [], hemi: [] }; for (let d = 0; d < 9; d++) r.probe.push(new q4()); const s = new q4(), o = new Xe(), a6 = new Xe(); function c(d) { let h6 = 0, f6 = 0, g6 = 0; for (let R6 = 0; R6 < 9; R6++) r.probe[R6].set(0, 0, 0); let p = 0, u6 = 0, y6 = 0, v6 = 0, m6 = 0, x6 = 0, w6 = 0, A6 = 0; d.sort(TD); for (let R6 = 0, L6 = d.length; R6 < L6; R6++) { const T6 = d[R6], P6 = T6.color, _6 = T6.intensity, S6 = T6.distance, E6 = T6.shadow && T6.shadow.map ? T6.shadow.map.texture : null; if (T6.isAmbientLight) h6 += P6.r * _6, f6 += P6.g * _6, g6 += P6.b * _6; else if (T6.isLightProbe) for (let C6 = 0; C6 < 9; C6++) r.probe[C6].addScaledVector(T6.sh.coefficients[C6], _6); else if (T6.isDirectionalLight) { const C6 = t.get(T6); if (C6.color.copy(T6.color).multiplyScalar(T6.intensity), T6.castShadow) { const I6 = T6.shadow, b6 = i.get(T6); b6.shadowBias = I6.bias, b6.shadowNormalBias = I6.normalBias, b6.shadowRadius = I6.radius, b6.shadowMapSize = I6.mapSize, r.directionalShadow[p] = b6, r.directionalShadowMap[p] = E6, r.directionalShadowMatrix[p] = T6.shadow.matrix, x6++; } r.directional[p] = C6, p++; } else if (T6.isSpotLight) { const C6 = t.get(T6); if (C6.position.setFromMatrixPosition(T6.matrixWorld), C6.color.copy(P6).multiplyScalar(_6), C6.distance = S6, C6.coneCos = Math.cos(T6.angle), C6.penumbraCos = Math.cos(T6.angle * (1 - T6.penumbra)), C6.decay = T6.decay, T6.castShadow) { const I6 = T6.shadow, b6 = i.get(T6); b6.shadowBias = I6.bias, b6.shadowNormalBias = I6.normalBias, b6.shadowRadius = I6.radius, b6.shadowMapSize = I6.mapSize, r.spotShadow[y6] = b6, r.spotShadowMap[y6] = E6, r.spotShadowMatrix[y6] = T6.shadow.matrix, A6++; } r.spot[y6] = C6, y6++; } else if (T6.isRectAreaLight) { const C6 = t.get(T6); C6.color.copy(P6).multiplyScalar(_6), C6.halfWidth.set(T6.width * 0.5, 0, 0), C6.halfHeight.set(0, T6.height * 0.5, 0), r.rectArea[v6] = C6, v6++; } else if (T6.isPointLight) { const C6 = t.get(T6); if (C6.color.copy(T6.color).multiplyScalar(T6.intensity), C6.distance = T6.distance, C6.decay = T6.decay, T6.castShadow) { const I6 = T6.shadow, b6 = i.get(T6); b6.shadowBias = I6.bias, b6.shadowNormalBias = I6.normalBias, b6.shadowRadius = I6.radius, b6.shadowMapSize = I6.mapSize, b6.shadowCameraNear = I6.camera.near, b6.shadowCameraFar = I6.camera.far, r.pointShadow[u6] = b6, r.pointShadowMap[u6] = E6, r.pointShadowMatrix[u6] = T6.shadow.matrix, w6++; } r.point[u6] = C6, u6++; } else if (T6.isHemisphereLight) { const C6 = t.get(T6); C6.skyColor.copy(T6.color).multiplyScalar(_6), C6.groundColor.copy(T6.groundColor).multiplyScalar(_6), r.hemi[m6] = C6, m6++; } } v6 > 0 && (e.isWebGL2 || n.has("OES_texture_float_linear") === true ? (r.rectAreaLTC1 = ze.LTC_FLOAT_1, r.rectAreaLTC2 = ze.LTC_FLOAT_2) : n.has("OES_texture_half_float_linear") === true ? (r.rectAreaLTC1 = ze.LTC_HALF_1, r.rectAreaLTC2 = ze.LTC_HALF_2) : console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")), r.ambient[0] = h6, r.ambient[1] = f6, r.ambient[2] = g6; const M6 = r.hash; (M6.directionalLength !== p || M6.pointLength !== u6 || M6.spotLength !== y6 || M6.rectAreaLength !== v6 || M6.hemiLength !== m6 || M6.numDirectionalShadows !== x6 || M6.numPointShadows !== w6 || M6.numSpotShadows !== A6) && (r.directional.length = p, r.spot.length = y6, r.rectArea.length = v6, r.point.length = u6, r.hemi.length = m6, r.directionalShadow.length = x6, r.directionalShadowMap.length = x6, r.pointShadow.length = w6, r.pointShadowMap.length = w6, r.spotShadow.length = A6, r.spotShadowMap.length = A6, r.directionalShadowMatrix.length = x6, r.pointShadowMatrix.length = w6, r.spotShadowMatrix.length = A6, M6.directionalLength = p, M6.pointLength = u6, M6.spotLength = y6, M6.rectAreaLength = v6, M6.hemiLength = m6, M6.numDirectionalShadows = x6, M6.numPointShadows = w6, M6.numSpotShadows = A6, r.version = _D++); } function l(d, h6) { let f6 = 0, g6 = 0, p = 0, u6 = 0, y6 = 0; const v6 = h6.matrixWorldInverse; for (let m6 = 0, x6 = d.length; m6 < x6; m6++) { const w6 = d[m6]; if (w6.isDirectionalLight) { const A6 = r.directional[f6]; A6.direction.setFromMatrixPosition(w6.matrixWorld), s.setFromMatrixPosition(w6.target.matrixWorld), A6.direction.sub(s), A6.direction.transformDirection(v6), f6++; } else if (w6.isSpotLight) { const A6 = r.spot[p]; A6.position.setFromMatrixPosition(w6.matrixWorld), A6.position.applyMatrix4(v6), A6.direction.setFromMatrixPosition(w6.matrixWorld), s.setFromMatrixPosition(w6.target.matrixWorld), A6.direction.sub(s), A6.direction.transformDirection(v6), p++; } else if (w6.isRectAreaLight) { const A6 = r.rectArea[u6]; A6.position.setFromMatrixPosition(w6.matrixWorld), A6.position.applyMatrix4(v6), a6.identity(), o.copy(w6.matrixWorld), o.premultiply(v6), a6.extractRotation(o), A6.halfWidth.set(w6.width * 0.5, 0, 0), A6.halfHeight.set(0, w6.height * 0.5, 0), A6.halfWidth.applyMatrix4(a6), A6.halfHeight.applyMatrix4(a6), u6++; } else if (w6.isPointLight) { const A6 = r.point[g6]; A6.position.setFromMatrixPosition(w6.matrixWorld), A6.position.applyMatrix4(v6), g6++; } else if (w6.isHemisphereLight) { const A6 = r.hemi[y6]; A6.direction.setFromMatrixPosition(w6.matrixWorld), A6.direction.transformDirection(v6), A6.direction.normalize(), y6++; } } } return { setup: c, setupView: l, state: r }; } function vg(n, e) { const t = new ED(n, e), i = [], r = []; function s() { i.length = 0, r.length = 0; } function o(h6) { i.push(h6); } function a6(h6) { r.push(h6); } function c() { t.setup(i); } function l(h6) { t.setupView(i, h6); } return { init: s, state: { lightsArray: i, shadowsArray: r, lights: t }, setupLights: c, setupLightsView: l, pushLight: o, pushShadow: a6 }; } function CD(n, e) { let t = /* @__PURE__ */ new WeakMap(); function i(s, o = 0) { let a6; return t.has(s) === false ? (a6 = new vg(n, e), t.set(s, [a6])) : o >= t.get(s).length ? (a6 = new vg(n, e), t.get(s).push(a6)) : a6 = t.get(s)[o], a6; } function r() { t = /* @__PURE__ */ new WeakMap(); } return { get: i, dispose: r }; } var xu = class extends tn2 { constructor(e) { super(), this.type = "MeshDepthMaterial", this.depthPacking = Jb, this.morphTargets = false, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, this.setValues(e); } copy(e) { return super.copy(e), this.depthPacking = e.depthPacking, this.morphTargets = e.morphTargets, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this; } }; xu.prototype.isMeshDepthMaterial = true; var Mu = class extends tn2 { constructor(e) { super(), this.type = "MeshDistanceMaterial", this.referencePosition = new q4(), this.nearDistance = 1, this.farDistance = 1e3, this.morphTargets = false, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.fog = false, this.setValues(e); } copy(e) { return super.copy(e), this.referencePosition.copy(e.referencePosition), this.nearDistance = e.nearDistance, this.farDistance = e.farDistance, this.morphTargets = e.morphTargets, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this; } }; Mu.prototype.isMeshDistanceMaterial = true; var LD = `uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { float mean = 0.0; float squared_mean = 0.0; float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean * HALF_SAMPLE_RATE; squared_mean = squared_mean * HALF_SAMPLE_RATE; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`; var RD = `void main() { gl_Position = vec4( position, 1.0 ); }`; function Mx(n, e, t) { let i = new dl(); const r = new Re(), s = new Re(), o = new xt(), a6 = [], c = [], l = {}, d = t.maxTextureSize, h6 = { 0: jt, 1: Hr, 2: Wr }, f6 = new ar({ defines: { SAMPLE_RATE: 2 / 8, HALF_SAMPLE_RATE: 1 / 8 }, uniforms: { shadow_pass: { value: null }, resolution: { value: new Re() }, radius: { value: 4 } }, vertexShader: RD, fragmentShader: LD }), g6 = f6.clone(); g6.defines.HORIZONTAL_PASS = 1; const p = new Ke(); p.setAttribute( "position", new ot( new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3 ) ); const u6 = new Xt(p, f6), y6 = this; this.enabled = false, this.autoUpdate = true, this.needsUpdate = false, this.type = vf, this.render = function(M6, R6, L6) { if (y6.enabled === false || y6.autoUpdate === false && y6.needsUpdate === false || M6.length === 0) return; const T6 = n.getRenderTarget(), P6 = n.getActiveCubeFace(), _6 = n.getActiveMipmapLevel(), S6 = n.state; S6.setBlending(nr), S6.buffers.color.setClear(1, 1, 1, 1), S6.buffers.depth.setTest(true), S6.setScissorTest(false); for (let E6 = 0, C6 = M6.length; E6 < C6; E6++) { const I6 = M6[E6], b6 = I6.shadow; if (b6 === void 0) { console.warn("THREE.WebGLShadowMap:", I6, "has no shadow."); continue; } if (b6.autoUpdate === false && b6.needsUpdate === false) continue; r.copy(b6.mapSize); const F6 = b6.getFrameExtents(); if (r.multiply(F6), s.copy(b6.mapSize), (r.x > d || r.y > d) && (r.x > d && (s.x = Math.floor(d / F6.x), r.x = s.x * F6.x, b6.mapSize.x = s.x), r.y > d && (s.y = Math.floor(d / F6.y), r.y = s.y * F6.y, b6.mapSize.y = s.y)), b6.map === null && !b6.isPointLightShadow && this.type === po) { const N6 = { minFilter: zt, magFilter: zt, format: Hn }; b6.map = new fi(r.x, r.y, N6), b6.map.texture.name = I6.name + ".shadowMap", b6.mapPass = new fi(r.x, r.y, N6), b6.camera.updateProjectionMatrix(); } if (b6.map === null) { const N6 = { minFilter: $t, magFilter: $t, format: Hn }; b6.map = new fi(r.x, r.y, N6), b6.map.texture.name = I6.name + ".shadowMap", b6.camera.updateProjectionMatrix(); } n.setRenderTarget(b6.map), n.clear(); const D6 = b6.getViewportCount(); for (let N6 = 0; N6 < D6; N6++) { const B6 = b6.getViewport(N6); o.set( s.x * B6.x, s.y * B6.y, s.x * B6.z, s.y * B6.w ), S6.viewport(o), b6.updateMatrices(I6, N6), i = b6.getFrustum(), A6(R6, L6, b6.camera, I6, this.type); } !b6.isPointLightShadow && this.type === po && v6(b6, L6), b6.needsUpdate = false; } y6.needsUpdate = false, n.setRenderTarget(T6, P6, _6); }; function v6(M6, R6) { const L6 = e.update(u6); f6.uniforms.shadow_pass.value = M6.map.texture, f6.uniforms.resolution.value = M6.mapSize, f6.uniforms.radius.value = M6.radius, n.setRenderTarget(M6.mapPass), n.clear(), n.renderBufferDirect(R6, null, L6, f6, u6, null), g6.uniforms.shadow_pass.value = M6.mapPass.texture, g6.uniforms.resolution.value = M6.mapSize, g6.uniforms.radius.value = M6.radius, n.setRenderTarget(M6.map), n.clear(), n.renderBufferDirect(R6, null, L6, g6, u6, null); } function m6(M6) { const R6 = M6 << 0; let L6 = a6[R6]; return L6 === void 0 && (L6 = new xu({ depthPacking: Kb, morphTargets: M6 }), a6[R6] = L6), L6; } function x6(M6) { const R6 = M6 << 0; let L6 = c[R6]; return L6 === void 0 && (L6 = new Mu({ morphTargets: M6 }), c[R6] = L6), L6; } function w6(M6, R6, L6, T6, P6, _6, S6) { let E6 = null, C6 = m6, I6 = M6.customDepthMaterial; if (T6.isPointLight === true && (C6 = x6, I6 = M6.customDistanceMaterial), I6 === void 0) { let b6 = false; L6.morphTargets === true && (b6 = R6.morphAttributes && R6.morphAttributes.position && R6.morphAttributes.position.length > 0), E6 = C6(b6); } else E6 = I6; if (n.localClippingEnabled && L6.clipShadows === true && L6.clippingPlanes.length !== 0) { const b6 = E6.uuid, F6 = L6.uuid; let D6 = l[b6]; D6 === void 0 && (D6 = {}, l[b6] = D6); let N6 = D6[F6]; N6 === void 0 && (N6 = E6.clone(), D6[F6] = N6), E6 = N6; } return E6.visible = L6.visible, E6.wireframe = L6.wireframe, S6 === po ? E6.side = L6.shadowSide !== null ? L6.shadowSide : L6.side : E6.side = L6.shadowSide !== null ? L6.shadowSide : h6[L6.side], E6.clipShadows = L6.clipShadows, E6.clippingPlanes = L6.clippingPlanes, E6.clipIntersection = L6.clipIntersection, E6.wireframeLinewidth = L6.wireframeLinewidth, E6.linewidth = L6.linewidth, T6.isPointLight === true && E6.isMeshDistanceMaterial === true && (E6.referencePosition.setFromMatrixPosition(T6.matrixWorld), E6.nearDistance = P6, E6.farDistance = _6), E6; } function A6(M6, R6, L6, T6, P6) { if (M6.visible === false) return; if (M6.layers.test(R6.layers) && (M6.isMesh || M6.isLine || M6.isPoints) && (M6.castShadow || M6.receiveShadow && P6 === po) && (!M6.frustumCulled || i.intersectsObject(M6))) { M6.modelViewMatrix.multiplyMatrices(L6.matrixWorldInverse, M6.matrixWorld); const E6 = e.update(M6), C6 = M6.material; if (Array.isArray(C6)) { const I6 = E6.groups; for (let b6 = 0, F6 = I6.length; b6 < F6; b6++) { const D6 = I6[b6], N6 = C6[D6.materialIndex]; if (N6 && N6.visible) { const B6 = w6(M6, E6, N6, T6, L6.near, L6.far, P6); n.renderBufferDirect(L6, null, E6, B6, M6, D6); } } } else if (C6.visible) { const I6 = w6(M6, E6, C6, T6, L6.near, L6.far, P6); n.renderBufferDirect(L6, null, E6, I6, M6, null); } } const S6 = M6.children; for (let E6 = 0, C6 = S6.length; E6 < C6; E6++) A6(S6[E6], R6, L6, T6, P6); } } function FD(n, e, t) { const i = t.isWebGL2; function r() { let ne = false; const me = new xt(); let Me = null; const De = new xt(0, 0, 0, 0); return { setMask: function(Ie) { Me !== Ie && !ne && (n.colorMask(Ie, Ie, Ie, Ie), Me = Ie); }, setLocked: function(Ie) { ne = Ie; }, setClear: function(Ie, $e, lt, qe, Mt) { Mt === true && (Ie *= qe, $e *= qe, lt *= qe), me.set(Ie, $e, lt, qe), De.equals(me) === false && (n.clearColor(Ie, $e, lt, qe), De.copy(me)); }, reset: function() { ne = false, Me = null, De.set(-1, 0, 0, 0); } }; } function s() { let ne = false, me = null, Me = null, De = null; return { setTest: function(Ie) { Ie ? te(2929) : ae(2929); }, setMask: function(Ie) { me !== Ie && !ne && (n.depthMask(Ie), me = Ie); }, setFunc: function(Ie) { if (Me !== Ie) { if (Ie) switch (Ie) { case Uy: n.depthFunc(512); break; case zy: n.depthFunc(519); break; case ky: n.depthFunc(513); break; case kc: n.depthFunc(515); break; case Vy: n.depthFunc(514); break; case Gy: n.depthFunc(518); break; case Hy: n.depthFunc(516); break; case Wy: n.depthFunc(517); break; default: n.depthFunc(515); } else n.depthFunc(515); Me = Ie; } }, setLocked: function(Ie) { ne = Ie; }, setClear: function(Ie) { De !== Ie && (n.clearDepth(Ie), De = Ie); }, reset: function() { ne = false, me = null, Me = null, De = null; } }; } function o() { let ne = false, me = null, Me = null, De = null, Ie = null, $e = null, lt = null, qe = null, Mt = null; return { setTest: function(Be) { ne || (Be ? te(2960) : ae(2960)); }, setMask: function(Be) { me !== Be && !ne && (n.stencilMask(Be), me = Be); }, setFunc: function(Be, it, tt) { (Me !== Be || De !== it || Ie !== tt) && (n.stencilFunc(Be, it, tt), Me = Be, De = it, Ie = tt); }, setOp: function(Be, it, tt) { ($e !== Be || lt !== it || qe !== tt) && (n.stencilOp(Be, it, tt), $e = Be, lt = it, qe = tt); }, setLocked: function(Be) { ne = Be; }, setClear: function(Be) { Mt !== Be && (n.clearStencil(Be), Mt = Be); }, reset: function() { ne = false, me = null, Me = null, De = null, Ie = null, $e = null, lt = null, qe = null, Mt = null; } }; } const a6 = new r(), c = new s(), l = new o(); let d = {}, h6 = null, f6 = {}, g6 = null, p = false, u6 = null, y6 = null, v6 = null, m6 = null, x6 = null, w6 = null, A6 = null, M6 = false, R6 = null, L6 = null, T6 = null, P6 = null, _6 = null; const S6 = n.getParameter(35661); let E6 = false, C6 = 0; const I6 = n.getParameter(7938); I6.indexOf("WebGL") !== -1 ? (C6 = parseFloat(/^WebGL (\d)/.exec(I6)[1]), E6 = C6 >= 1) : I6.indexOf("OpenGL ES") !== -1 && (C6 = parseFloat(/^OpenGL ES (\d)/.exec(I6)[1]), E6 = C6 >= 2); let b6 = null, F6 = {}; const D6 = n.getParameter(3088), N6 = n.getParameter(2978), B6 = new xt().fromArray(D6), U6 = new xt().fromArray(N6); function G6(ne, me, Me) { const De = new Uint8Array(4), Ie = n.createTexture(); n.bindTexture(ne, Ie), n.texParameteri(ne, 10241, 9728), n.texParameteri(ne, 10240, 9728); for (let $e = 0; $e < Me; $e++) n.texImage2D(me + $e, 0, 6408, 1, 1, 0, 6408, 5121, De); return Ie; } const Y = {}; Y[3553] = G6(3553, 3553, 1), Y[34067] = G6(34067, 34069, 6), a6.setClear(0, 0, 0, 1), c.setClear(1), l.setClear(0), te(2929), c.setFunc(kc), H6(false), K(nd), te(2884), re(nr); function te(ne) { d[ne] !== true && (n.enable(ne), d[ne] = true); } function ae(ne) { d[ne] !== false && (n.disable(ne), d[ne] = false); } function ie(ne) { ne !== h6 && (n.bindFramebuffer(36160, ne), h6 = ne); } function le(ne, me) { return me === null && h6 !== null && (me = h6), f6[ne] !== me ? (n.bindFramebuffer(ne, me), f6[ne] = me, i && (ne === 36009 && (f6[36160] = me), ne === 36160 && (f6[36009] = me)), true) : false; } function W6(ne) { return g6 !== ne ? (n.useProgram(ne), g6 = ne, true) : false; } const $6 = { [ps]: 32774, [Ey]: 32778, [Cy]: 32779 }; if (i) $6[od] = 32775, $6[ad] = 32776; else { const ne = e.get("EXT_blend_minmax"); ne !== null && ($6[od] = ne.MIN_EXT, $6[ad] = ne.MAX_EXT); } const j6 = { [Ly]: 0, [Ry]: 1, [Fy]: 768, [bf]: 770, [By]: 776, [Dy]: 774, [Iy]: 772, [Py]: 769, [xf]: 771, [Ny]: 775, [Oy]: 773 }; function re(ne, me, Me, De, Ie, $e, lt, qe) { if (ne === nr) { p === true && (ae(3042), p = false); return; } if (p === false && (te(3042), p = true), ne !== Ty) { if (ne !== u6 || qe !== M6) { if ((y6 !== ps || x6 !== ps) && (n.blendEquation(32774), y6 = ps, x6 = ps), qe) switch (ne) { case vo: n.blendFuncSeparate(1, 771, 1, 771); break; case id: n.blendFunc(1, 1); break; case rd: n.blendFuncSeparate(0, 0, 769, 771); break; case sd: n.blendFuncSeparate(0, 768, 0, 770); break; default: console.error("THREE.WebGLState: Invalid blending: ", ne); break; } else switch (ne) { case vo: n.blendFuncSeparate(770, 771, 1, 771); break; case id: n.blendFunc(770, 1); break; case rd: n.blendFunc(0, 769); break; case sd: n.blendFunc(0, 768); break; default: console.error("THREE.WebGLState: Invalid blending: ", ne); break; } v6 = null, m6 = null, w6 = null, A6 = null, u6 = ne, M6 = qe; } return; } Ie = Ie || me, $e = $e || Me, lt = lt || De, (me !== y6 || Ie !== x6) && (n.blendEquationSeparate($6[me], $6[Ie]), y6 = me, x6 = Ie), (Me !== v6 || De !== m6 || $e !== w6 || lt !== A6) && (n.blendFuncSeparate(j6[Me], j6[De], j6[$e], j6[lt]), v6 = Me, m6 = De, w6 = $e, A6 = lt), u6 = ne, M6 = null; } function k6(ne, me) { ne.side === Wr ? ae(2884) : te(2884); let Me = ne.side === jt; me && (Me = !Me), H6(Me), ne.blending === vo && ne.transparent === false ? re(nr) : re(ne.blending, ne.blendEquation, ne.blendSrc, ne.blendDst, ne.blendEquationAlpha, ne.blendSrcAlpha, ne.blendDstAlpha, ne.premultipliedAlpha), c.setFunc(ne.depthFunc), c.setTest(ne.depthTest), c.setMask(ne.depthWrite), a6.setMask(ne.colorWrite); const De = ne.stencilWrite; l.setTest(De), De && (l.setMask(ne.stencilWriteMask), l.setFunc(ne.stencilFunc, ne.stencilRef, ne.stencilFuncMask), l.setOp(ne.stencilFail, ne.stencilZFail, ne.stencilZPass)), se(ne.polygonOffset, ne.polygonOffsetFactor, ne.polygonOffsetUnits), ne.alphaToCoverage === true ? te(32926) : ae(32926); } function H6(ne) { R6 !== ne && (ne ? n.frontFace(2304) : n.frontFace(2305), R6 = ne); } function K(ne) { ne !== Ay ? (te(2884), ne !== L6 && (ne === nd ? n.cullFace(1029) : ne === Sy ? n.cullFace(1028) : n.cullFace(1032))) : ae(2884), L6 = ne; } function ce(ne) { ne !== T6 && (E6 && n.lineWidth(ne), T6 = ne); } function se(ne, me, Me) { ne ? (te(32823), (P6 !== me || _6 !== Me) && (n.polygonOffset(me, Me), P6 = me, _6 = Me)) : ae(32823); } function V6(ne) { ne ? te(3089) : ae(3089); } function O6(ne) { ne === void 0 && (ne = 33984 + S6 - 1), b6 !== ne && (n.activeTexture(ne), b6 = ne); } function Z6(ne, me) { b6 === null && O6(); let Me = F6[b6]; Me === void 0 && (Me = { type: void 0, texture: void 0 }, F6[b6] = Me), (Me.type !== ne || Me.texture !== me) && (n.bindTexture(ne, me || Y[ne]), Me.type = ne, Me.texture = me); } function X() { const ne = F6[b6]; ne !== void 0 && ne.type !== void 0 && (n.bindTexture(ne.type, null), ne.type = void 0, ne.texture = void 0); } function ee() { try { n.compressedTexImage2D.apply(n, arguments); } catch (ne) { console.error("THREE.WebGLState:", ne); } } function fe() { try { n.texImage2D.apply(n, arguments); } catch (ne) { console.error("THREE.WebGLState:", ne); } } function be() { try { n.texImage3D.apply(n, arguments); } catch (ne) { console.error("THREE.WebGLState:", ne); } } function Ae(ne) { B6.equals(ne) === false && (n.scissor(ne.x, ne.y, ne.z, ne.w), B6.copy(ne)); } function he(ne) { U6.equals(ne) === false && (n.viewport(ne.x, ne.y, ne.z, ne.w), U6.copy(ne)); } function xe() { n.disable(3042), n.disable(2884), n.disable(2929), n.disable(32823), n.disable(3089), n.disable(2960), n.disable(32926), n.blendEquation(32774), n.blendFunc(1, 0), n.blendFuncSeparate(1, 0, 1, 0), n.colorMask(true, true, true, true), n.clearColor(0, 0, 0, 0), n.depthMask(true), n.depthFunc(513), n.clearDepth(1), n.stencilMask(4294967295), n.stencilFunc(519, 0, 4294967295), n.stencilOp(7680, 7680, 7680), n.clearStencil(0), n.cullFace(1029), n.frontFace(2305), n.polygonOffset(0, 0), n.activeTexture(33984), n.bindFramebuffer(36160, null), i === true && (n.bindFramebuffer(36009, null), n.bindFramebuffer(36008, null)), n.useProgram(null), n.lineWidth(1), n.scissor(0, 0, n.canvas.width, n.canvas.height), n.viewport(0, 0, n.canvas.width, n.canvas.height), d = {}, b6 = null, F6 = {}, h6 = null, f6 = {}, g6 = null, p = false, u6 = null, y6 = null, v6 = null, m6 = null, x6 = null, w6 = null, A6 = null, M6 = false, R6 = null, L6 = null, T6 = null, P6 = null, _6 = null, B6.set(0, 0, n.canvas.width, n.canvas.height), U6.set(0, 0, n.canvas.width, n.canvas.height), a6.reset(), c.reset(), l.reset(); } return { buffers: { color: a6, depth: c, stencil: l }, enable: te, disable: ae, bindFramebuffer: le, bindXRFramebuffer: ie, useProgram: W6, setBlending: re, setMaterial: k6, setFlipSided: H6, setCullFace: K, setLineWidth: ce, setPolygonOffset: se, setScissorTest: V6, activeTexture: O6, bindTexture: Z6, unbindTexture: X, compressedTexImage2D: ee, texImage2D: fe, texImage3D: be, scissor: Ae, viewport: he, reset: xe }; } function PD(n, e, t, i, r, s, o) { const a6 = r.isWebGL2, c = r.maxTextures, l = r.maxCubemapSize, d = r.maxTextureSize, h6 = r.maxSamples, f6 = /* @__PURE__ */ new WeakMap(); let g6, p = false; try { p = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null; } catch { } function u6(V6, O6) { return p ? new OffscreenCanvas(V6, O6) : document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); } function y6(V6, O6, Z6, X) { let ee = 1; if ((V6.width > X || V6.height > X) && (ee = X / Math.max(V6.width, V6.height)), ee < 1 || O6 === true) if (typeof HTMLImageElement < "u" && V6 instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && V6 instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && V6 instanceof ImageBitmap) { const fe = O6 ? tx : Math.floor, be = fe(ee * V6.width), Ae = fe(ee * V6.height); g6 === void 0 && (g6 = u6(be, Ae)); const he = Z6 ? u6(be, Ae) : g6; return he.width = be, he.height = Ae, he.getContext("2d").drawImage(V6, 0, 0, be, Ae), console.warn("THREE.WebGLRenderer: Texture has been resized from (" + V6.width + "x" + V6.height + ") to (" + be + "x" + Ae + ")."), he; } else return "data" in V6 && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + V6.width + "x" + V6.height + ")."), V6; return V6; } function v6(V6) { return bd(V6.width) && bd(V6.height); } function m6(V6) { return a6 ? false : V6.wrapS !== hn2 || V6.wrapT !== hn2 || V6.minFilter !== $t && V6.minFilter !== zt; } function x6(V6, O6) { return V6.generateMipmaps && O6 && V6.minFilter !== $t && V6.minFilter !== zt; } function w6(V6, O6, Z6, X, ee = 1) { n.generateMipmap(V6); const fe = i.get(O6); fe.__maxMipLevel = Math.log2(Math.max(Z6, X, ee)); } function A6(V6, O6, Z6) { if (a6 === false) return O6; if (V6 !== null) { if (n[V6] !== void 0) return n[V6]; console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + V6 + "'"); } let X = O6; return O6 === 6403 && (Z6 === 5126 && (X = 33326), Z6 === 5131 && (X = 33325), Z6 === 5121 && (X = 33321)), O6 === 6407 && (Z6 === 5126 && (X = 34837), Z6 === 5131 && (X = 34843), Z6 === 5121 && (X = 32849)), O6 === 6408 && (Z6 === 5126 && (X = 34836), Z6 === 5131 && (X = 34842), Z6 === 5121 && (X = 32856)), (X === 33325 || X === 33326 || X === 34842 || X === 34836) && e.get("EXT_color_buffer_float"), X; } function M6(V6) { return V6 === $t || V6 === Va || V6 === Ga ? 9728 : 9729; } function R6(V6) { const O6 = V6.target; O6.removeEventListener("dispose", R6), T6(O6), O6.isVideoTexture && f6.delete(O6), o.memory.textures--; } function L6(V6) { const O6 = V6.target; O6.removeEventListener("dispose", L6), P6(O6); } function T6(V6) { const O6 = i.get(V6); O6.__webglInit !== void 0 && (n.deleteTexture(O6.__webglTexture), i.remove(V6)); } function P6(V6) { const O6 = V6.texture, Z6 = i.get(V6), X = i.get(O6); if (V6) { if (X.__webglTexture !== void 0 && (n.deleteTexture(X.__webglTexture), o.memory.textures--), V6.depthTexture && V6.depthTexture.dispose(), V6.isWebGLCubeRenderTarget) for (let ee = 0; ee < 6; ee++) n.deleteFramebuffer(Z6.__webglFramebuffer[ee]), Z6.__webglDepthbuffer && n.deleteRenderbuffer(Z6.__webglDepthbuffer[ee]); else n.deleteFramebuffer(Z6.__webglFramebuffer), Z6.__webglDepthbuffer && n.deleteRenderbuffer(Z6.__webglDepthbuffer), Z6.__webglMultisampledFramebuffer && n.deleteFramebuffer(Z6.__webglMultisampledFramebuffer), Z6.__webglColorRenderbuffer && n.deleteRenderbuffer(Z6.__webglColorRenderbuffer), Z6.__webglDepthRenderbuffer && n.deleteRenderbuffer(Z6.__webglDepthRenderbuffer); if (V6.isWebGLMultipleRenderTargets) for (let ee = 0, fe = O6.length; ee < fe; ee++) { const be = i.get(O6[ee]); be.__webglTexture && (n.deleteTexture(be.__webglTexture), o.memory.textures--), i.remove(O6[ee]); } i.remove(O6), i.remove(V6); } } let _6 = 0; function S6() { _6 = 0; } function E6() { const V6 = _6; return V6 >= c && console.warn("THREE.WebGLTextures: Trying to use " + V6 + " texture units while this GPU supports only " + c), _6 += 1, V6; } function C6(V6, O6) { const Z6 = i.get(V6); if (V6.isVideoTexture && k6(V6), V6.version > 0 && Z6.__version !== V6.version) { const X = V6.image; if (X === void 0) console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined"); else if (X.complete === false) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete"); else { G6(Z6, V6, O6); return; } } t.activeTexture(33984 + O6), t.bindTexture(3553, Z6.__webglTexture); } function I6(V6, O6) { const Z6 = i.get(V6); if (V6.version > 0 && Z6.__version !== V6.version) { G6(Z6, V6, O6); return; } t.activeTexture(33984 + O6), t.bindTexture(35866, Z6.__webglTexture); } function b6(V6, O6) { const Z6 = i.get(V6); if (V6.version > 0 && Z6.__version !== V6.version) { G6(Z6, V6, O6); return; } t.activeTexture(33984 + O6), t.bindTexture(32879, Z6.__webglTexture); } function F6(V6, O6) { const Z6 = i.get(V6); if (V6.version > 0 && Z6.__version !== V6.version) { Y(Z6, V6, O6); return; } t.activeTexture(33984 + O6), t.bindTexture(34067, Z6.__webglTexture); } const D6 = { [jr]: 10497, [hn2]: 33071, [Eo]: 33648 }, N6 = { [$t]: 9728, [Va]: 9984, [Ga]: 9986, [zt]: 9729, [du]: 9985, [pr]: 9987 }; function B6(V6, O6, Z6) { if (Z6 ? (n.texParameteri(V6, 10242, D6[O6.wrapS]), n.texParameteri(V6, 10243, D6[O6.wrapT]), (V6 === 32879 || V6 === 35866) && n.texParameteri(V6, 32882, D6[O6.wrapR]), n.texParameteri(V6, 10240, N6[O6.magFilter]), n.texParameteri(V6, 10241, N6[O6.minFilter])) : (n.texParameteri(V6, 10242, 33071), n.texParameteri(V6, 10243, 33071), (V6 === 32879 || V6 === 35866) && n.texParameteri(V6, 32882, 33071), (O6.wrapS !== hn2 || O6.wrapT !== hn2) && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."), n.texParameteri(V6, 10240, M6(O6.magFilter)), n.texParameteri(V6, 10241, M6(O6.minFilter)), O6.minFilter !== $t && O6.minFilter !== zt && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")), e.has("EXT_texture_filter_anisotropic") === true) { const X = e.get("EXT_texture_filter_anisotropic"); if (O6.type === Qi && e.has("OES_texture_float_linear") === false || a6 === false && O6.type === Ms && e.has("OES_texture_half_float_linear") === false) return; (O6.anisotropy > 1 || i.get(O6).__currentAnisotropy) && (n.texParameterf(V6, X.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(O6.anisotropy, r.getMaxAnisotropy())), i.get(O6).__currentAnisotropy = O6.anisotropy); } } function U6(V6, O6) { V6.__webglInit === void 0 && (V6.__webglInit = true, O6.addEventListener("dispose", R6), V6.__webglTexture = n.createTexture(), o.memory.textures++); } function G6(V6, O6, Z6) { let X = 3553; O6.isDataTexture2DArray && (X = 35866), O6.isDataTexture3D && (X = 32879), U6(V6, O6), t.activeTexture(33984 + Z6), t.bindTexture(X, V6.__webglTexture), n.pixelStorei(37440, O6.flipY), n.pixelStorei(37441, O6.premultiplyAlpha), n.pixelStorei(3317, O6.unpackAlignment), n.pixelStorei(37443, 0); const ee = m6(O6) && v6(O6.image) === false, fe = y6(O6.image, ee, false, d), be = v6(fe) || a6, Ae = s.convert(O6.format); let he = s.convert(O6.type), xe = A6(O6.internalFormat, Ae, he); B6(X, O6, be); let ne; const me = O6.mipmaps; if (O6.isDepthTexture) xe = 6402, a6 ? O6.type === Qi ? xe = 36012 : O6.type === Ra ? xe = 33190 : O6.type === yo ? xe = 35056 : xe = 33189 : O6.type === Qi && console.error("WebGLRenderer: Floating point depth texture requires WebGL2."), O6.format === ws && xe === 6402 && O6.type !== Ha && O6.type !== Ra && (console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."), O6.type = Ha, he = s.convert(O6.type)), O6.format === Co && xe === 6402 && (xe = 34041, O6.type !== yo && (console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."), O6.type = yo, he = s.convert(O6.type))), t.texImage2D(3553, 0, xe, fe.width, fe.height, 0, Ae, he, null); else if (O6.isDataTexture) if (me.length > 0 && be) { for (let Me = 0, De = me.length; Me < De; Me++) ne = me[Me], t.texImage2D(3553, Me, xe, ne.width, ne.height, 0, Ae, he, ne.data); O6.generateMipmaps = false, V6.__maxMipLevel = me.length - 1; } else t.texImage2D(3553, 0, xe, fe.width, fe.height, 0, Ae, he, fe.data), V6.__maxMipLevel = 0; else if (O6.isCompressedTexture) { for (let Me = 0, De = me.length; Me < De; Me++) ne = me[Me], O6.format !== Hn && O6.format !== ir ? Ae !== null ? t.compressedTexImage2D(3553, Me, xe, ne.width, ne.height, 0, ne.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : t.texImage2D(3553, Me, xe, ne.width, ne.height, 0, Ae, he, ne.data); V6.__maxMipLevel = me.length - 1; } else if (O6.isDataTexture2DArray) t.texImage3D(35866, 0, xe, fe.width, fe.height, fe.depth, 0, Ae, he, fe.data), V6.__maxMipLevel = 0; else if (O6.isDataTexture3D) t.texImage3D(32879, 0, xe, fe.width, fe.height, fe.depth, 0, Ae, he, fe.data), V6.__maxMipLevel = 0; else if (me.length > 0 && be) { for (let Me = 0, De = me.length; Me < De; Me++) ne = me[Me], t.texImage2D(3553, Me, xe, Ae, he, ne); O6.generateMipmaps = false, V6.__maxMipLevel = me.length - 1; } else t.texImage2D(3553, 0, xe, Ae, he, fe), V6.__maxMipLevel = 0; x6(O6, be) && w6(X, O6, fe.width, fe.height), V6.__version = O6.version, O6.onUpdate && O6.onUpdate(O6); } function Y(V6, O6, Z6) { if (O6.image.length !== 6) return; U6(V6, O6), t.activeTexture(33984 + Z6), t.bindTexture(34067, V6.__webglTexture), n.pixelStorei(37440, O6.flipY), n.pixelStorei(37441, O6.premultiplyAlpha), n.pixelStorei(3317, O6.unpackAlignment), n.pixelStorei(37443, 0); const X = O6 && (O6.isCompressedTexture || O6.image[0].isCompressedTexture), ee = O6.image[0] && O6.image[0].isDataTexture, fe = []; for (let Me = 0; Me < 6; Me++) !X && !ee ? fe[Me] = y6(O6.image[Me], false, true, l) : fe[Me] = ee ? O6.image[Me].image : O6.image[Me]; const be = fe[0], Ae = v6(be) || a6, he = s.convert(O6.format), xe = s.convert(O6.type), ne = A6(O6.internalFormat, he, xe); B6(34067, O6, Ae); let me; if (X) { for (let Me = 0; Me < 6; Me++) { me = fe[Me].mipmaps; for (let De = 0; De < me.length; De++) { const Ie = me[De]; O6.format !== Hn && O6.format !== ir ? he !== null ? t.compressedTexImage2D(34069 + Me, De, ne, Ie.width, Ie.height, 0, Ie.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : t.texImage2D(34069 + Me, De, ne, Ie.width, Ie.height, 0, he, xe, Ie.data); } } V6.__maxMipLevel = me.length - 1; } else { me = O6.mipmaps; for (let Me = 0; Me < 6; Me++) if (ee) { t.texImage2D(34069 + Me, 0, ne, fe[Me].width, fe[Me].height, 0, he, xe, fe[Me].data); for (let De = 0; De < me.length; De++) { const $e = me[De].image[Me].image; t.texImage2D(34069 + Me, De + 1, ne, $e.width, $e.height, 0, he, xe, $e.data); } } else { t.texImage2D(34069 + Me, 0, ne, he, xe, fe[Me]); for (let De = 0; De < me.length; De++) { const Ie = me[De]; t.texImage2D(34069 + Me, De + 1, ne, he, xe, Ie.image[Me]); } } V6.__maxMipLevel = me.length; } x6(O6, Ae) && w6(34067, O6, be.width, be.height), V6.__version = O6.version, O6.onUpdate && O6.onUpdate(O6); } function te(V6, O6, Z6, X, ee) { const fe = s.convert(Z6.format), be = s.convert(Z6.type), Ae = A6(Z6.internalFormat, fe, be); ee === 32879 || ee === 35866 ? t.texImage3D(ee, 0, Ae, O6.width, O6.height, O6.depth, 0, fe, be, null) : t.texImage2D(ee, 0, Ae, O6.width, O6.height, 0, fe, be, null), t.bindFramebuffer(36160, V6), n.framebufferTexture2D(36160, X, ee, i.get(Z6).__webglTexture, 0), t.bindFramebuffer(36160, null); } function ae(V6, O6, Z6) { if (n.bindRenderbuffer(36161, V6), O6.depthBuffer && !O6.stencilBuffer) { let X = 33189; if (Z6) { const ee = O6.depthTexture; ee && ee.isDepthTexture && (ee.type === Qi ? X = 36012 : ee.type === Ra && (X = 33190)); const fe = re(O6); n.renderbufferStorageMultisample(36161, fe, X, O6.width, O6.height); } else n.renderbufferStorage(36161, X, O6.width, O6.height); n.framebufferRenderbuffer(36160, 36096, 36161, V6); } else if (O6.depthBuffer && O6.stencilBuffer) { if (Z6) { const X = re(O6); n.renderbufferStorageMultisample(36161, X, 35056, O6.width, O6.height); } else n.renderbufferStorage(36161, 34041, O6.width, O6.height); n.framebufferRenderbuffer(36160, 33306, 36161, V6); } else { const X = O6.isWebGLMultipleRenderTargets === true ? O6.texture[0] : O6.texture, ee = s.convert(X.format), fe = s.convert(X.type), be = A6(X.internalFormat, ee, fe); if (Z6) { const Ae = re(O6); n.renderbufferStorageMultisample(36161, Ae, be, O6.width, O6.height); } else n.renderbufferStorage(36161, be, O6.width, O6.height); } n.bindRenderbuffer(36161, null); } function ie(V6, O6) { if (O6 && O6.isWebGLCubeRenderTarget) throw new Error("Depth Texture with cube render targets is not supported"); if (t.bindFramebuffer(36160, V6), !(O6.depthTexture && O6.depthTexture.isDepthTexture)) throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); (!i.get(O6.depthTexture).__webglTexture || O6.depthTexture.image.width !== O6.width || O6.depthTexture.image.height !== O6.height) && (O6.depthTexture.image.width = O6.width, O6.depthTexture.image.height = O6.height, O6.depthTexture.needsUpdate = true), C6(O6.depthTexture, 0); const X = i.get(O6.depthTexture).__webglTexture; if (O6.depthTexture.format === ws) n.framebufferTexture2D(36160, 36096, 3553, X, 0); else if (O6.depthTexture.format === Co) n.framebufferTexture2D(36160, 33306, 3553, X, 0); else throw new Error("Unknown depthTexture format"); } function le(V6) { const O6 = i.get(V6), Z6 = V6.isWebGLCubeRenderTarget === true; if (V6.depthTexture) { if (Z6) throw new Error("target.depthTexture not supported in Cube render targets"); ie(O6.__webglFramebuffer, V6); } else if (Z6) { O6.__webglDepthbuffer = []; for (let X = 0; X < 6; X++) t.bindFramebuffer(36160, O6.__webglFramebuffer[X]), O6.__webglDepthbuffer[X] = n.createRenderbuffer(), ae(O6.__webglDepthbuffer[X], V6, false); } else t.bindFramebuffer(36160, O6.__webglFramebuffer), O6.__webglDepthbuffer = n.createRenderbuffer(), ae(O6.__webglDepthbuffer, V6, false); t.bindFramebuffer(36160, null); } function W6(V6) { const O6 = V6.texture, Z6 = i.get(V6), X = i.get(O6); V6.addEventListener("dispose", L6), V6.isWebGLMultipleRenderTargets !== true && (X.__webglTexture = n.createTexture(), X.__version = O6.version, o.memory.textures++); const ee = V6.isWebGLCubeRenderTarget === true, fe = V6.isWebGLMultipleRenderTargets === true, be = V6.isWebGLMultisampleRenderTarget === true, Ae = O6.isDataTexture3D || O6.isDataTexture2DArray, he = v6(V6) || a6; if (a6 && O6.format === ir && (O6.type === Qi || O6.type === Ms) && (O6.format = Hn, console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")), ee) { Z6.__webglFramebuffer = []; for (let xe = 0; xe < 6; xe++) Z6.__webglFramebuffer[xe] = n.createFramebuffer(); } else if (Z6.__webglFramebuffer = n.createFramebuffer(), fe) if (r.drawBuffers) { const xe = V6.texture; for (let ne = 0, me = xe.length; ne < me; ne++) { const Me = i.get(xe[ne]); Me.__webglTexture === void 0 && (Me.__webglTexture = n.createTexture(), o.memory.textures++); } } else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension."); else if (be) if (a6) { Z6.__webglMultisampledFramebuffer = n.createFramebuffer(), Z6.__webglColorRenderbuffer = n.createRenderbuffer(), n.bindRenderbuffer(36161, Z6.__webglColorRenderbuffer); const xe = s.convert(O6.format), ne = s.convert(O6.type), me = A6(O6.internalFormat, xe, ne), Me = re(V6); n.renderbufferStorageMultisample(36161, Me, me, V6.width, V6.height), t.bindFramebuffer(36160, Z6.__webglMultisampledFramebuffer), n.framebufferRenderbuffer(36160, 36064, 36161, Z6.__webglColorRenderbuffer), n.bindRenderbuffer(36161, null), V6.depthBuffer && (Z6.__webglDepthRenderbuffer = n.createRenderbuffer(), ae(Z6.__webglDepthRenderbuffer, V6, true)), t.bindFramebuffer(36160, null); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); if (ee) { t.bindTexture(34067, X.__webglTexture), B6(34067, O6, he); for (let xe = 0; xe < 6; xe++) te(Z6.__webglFramebuffer[xe], V6, O6, 36064, 34069 + xe); x6(O6, he) && w6(34067, O6, V6.width, V6.height), t.bindTexture(34067, null); } else if (fe) { const xe = V6.texture; for (let ne = 0, me = xe.length; ne < me; ne++) { const Me = xe[ne], De = i.get(Me); t.bindTexture(3553, De.__webglTexture), B6(3553, Me, he), te(Z6.__webglFramebuffer, V6, Me, 36064 + ne, 3553), x6(Me, he) && w6(3553, Me, V6.width, V6.height); } t.bindTexture(3553, null); } else { let xe = 3553; Ae && (a6 ? xe = O6.isDataTexture3D ? 32879 : 35866 : console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")), t.bindTexture(xe, X.__webglTexture), B6(xe, O6, he), te(Z6.__webglFramebuffer, V6, O6, 36064, xe), x6(O6, he) && w6(xe, O6, V6.width, V6.height, V6.depth), t.bindTexture(xe, null); } V6.depthBuffer && le(V6); } function $6(V6) { const O6 = v6(V6) || a6, Z6 = V6.isWebGLMultipleRenderTargets === true ? V6.texture : [V6.texture]; for (let X = 0, ee = Z6.length; X < ee; X++) { const fe = Z6[X]; if (x6(fe, O6)) { const be = V6.isWebGLCubeRenderTarget ? 34067 : 3553, Ae = i.get(fe).__webglTexture; t.bindTexture(be, Ae), w6(be, fe, V6.width, V6.height), t.bindTexture(be, null); } } } function j6(V6) { if (V6.isWebGLMultisampleRenderTarget) if (a6) { const O6 = V6.width, Z6 = V6.height; let X = 16384; V6.depthBuffer && (X |= 256), V6.stencilBuffer && (X |= 1024); const ee = i.get(V6); t.bindFramebuffer(36008, ee.__webglMultisampledFramebuffer), t.bindFramebuffer(36009, ee.__webglFramebuffer), n.blitFramebuffer(0, 0, O6, Z6, 0, 0, O6, Z6, X, 9728), t.bindFramebuffer(36008, null), t.bindFramebuffer(36009, ee.__webglMultisampledFramebuffer); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); } function re(V6) { return a6 && V6.isWebGLMultisampleRenderTarget ? Math.min(h6, V6.samples) : 0; } function k6(V6) { const O6 = o.render.frame; f6.get(V6) !== O6 && (f6.set(V6, O6), V6.update()); } let H6 = false, K = false; function ce(V6, O6) { V6 && V6.isWebGLRenderTarget && (H6 === false && (console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), H6 = true), V6 = V6.texture), C6(V6, O6); } function se(V6, O6) { V6 && V6.isWebGLCubeRenderTarget && (K === false && (console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), K = true), V6 = V6.texture), F6(V6, O6); } this.allocateTextureUnit = E6, this.resetTextureUnits = S6, this.setTexture2D = C6, this.setTexture2DArray = I6, this.setTexture3D = b6, this.setTextureCube = F6, this.setupRenderTarget = W6, this.updateRenderTargetMipmap = $6, this.updateMultisampleRenderTarget = j6, this.safeSetTexture2D = ce, this.safeSetTextureCube = se; } function wx(n, e, t) { const i = t.isWebGL2; function r(s) { let o; if (s === Ts) return 5121; if (s === tb) return 32819; if (s === nb) return 32820; if (s === ib) return 33635; if (s === qy) return 5120; if (s === Qy) return 5122; if (s === Ha) return 5123; if (s === eb) return 5124; if (s === Ra) return 5125; if (s === Qi) return 5126; if (s === Ms) return i ? 5131 : (o = e.get("OES_texture_half_float"), o !== null ? o.HALF_FLOAT_OES : null); if (s === rb) return 6406; if (s === ir) return 6407; if (s === Hn) return 6408; if (s === sb) return 6409; if (s === ob) return 6410; if (s === ws) return 6402; if (s === Co) return 34041; if (s === lb) return 6403; if (s === cb) return 36244; if (s === ub) return 33319; if (s === hb) return 33320; if (s === db) return 36248; if (s === fb) return 36249; if (s === ld || s === cd || s === ud || s === hd) if (o = e.get("WEBGL_compressed_texture_s3tc"), o !== null) { if (s === ld) return o.COMPRESSED_RGB_S3TC_DXT1_EXT; if (s === cd) return o.COMPRESSED_RGBA_S3TC_DXT1_EXT; if (s === ud) return o.COMPRESSED_RGBA_S3TC_DXT3_EXT; if (s === hd) return o.COMPRESSED_RGBA_S3TC_DXT5_EXT; } else return null; if (s === dd || s === fd || s === pd || s === md) if (o = e.get("WEBGL_compressed_texture_pvrtc"), o !== null) { if (s === dd) return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; if (s === fd) return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; if (s === pd) return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; if (s === md) return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; } else return null; if (s === pb) return o = e.get("WEBGL_compressed_texture_etc1"), o !== null ? o.COMPRESSED_RGB_ETC1_WEBGL : null; if ((s === gd || s === vd) && (o = e.get("WEBGL_compressed_texture_etc"), o !== null)) { if (s === gd) return o.COMPRESSED_RGB8_ETC2; if (s === vd) return o.COMPRESSED_RGBA8_ETC2_EAC; } if (s === mb || s === gb || s === vb || s === yb || s === bb || s === xb || s === Mb || s === wb || s === Ab || s === Sb || s === _b || s === Tb || s === Eb || s === Cb || s === Rb || s === Fb || s === Pb || s === Ib || s === Ob || s === Db || s === Nb || s === Bb || s === Ub || s === zb || s === kb || s === Vb || s === Gb || s === Hb) return o = e.get("WEBGL_compressed_texture_astc"), o !== null ? s : null; if (s === Lb) return o = e.get("EXT_texture_compression_bptc"), o !== null ? s : null; if (s === yo) return i ? 34042 : (o = e.get("WEBGL_depth_texture"), o !== null ? o.UNSIGNED_INT_24_8_WEBGL : null); } return { convert: r }; } var Ff = class extends nn2 { constructor(e = []) { super(), this.cameras = e; } }; Ff.prototype.isArrayCamera = true; var _i = class extends ut { constructor() { super(), this.type = "Group"; } }; _i.prototype.isGroup = true; var ID = { type: "move" }; var gh = class { constructor() { this._targetRay = null, this._grip = null, this._hand = null; } getHandSpace() { return this._hand === null && (this._hand = new _i(), this._hand.matrixAutoUpdate = false, this._hand.visible = false, this._hand.joints = {}, this._hand.inputState = { pinching: false }), this._hand; } getTargetRaySpace() { return this._targetRay === null && (this._targetRay = new _i(), this._targetRay.matrixAutoUpdate = false, this._targetRay.visible = false, this._targetRay.hasLinearVelocity = false, this._targetRay.linearVelocity = new q4(), this._targetRay.hasAngularVelocity = false, this._targetRay.angularVelocity = new q4()), this._targetRay; } getGripSpace() { return this._grip === null && (this._grip = new _i(), this._grip.matrixAutoUpdate = false, this._grip.visible = false, this._grip.hasLinearVelocity = false, this._grip.linearVelocity = new q4(), this._grip.hasAngularVelocity = false, this._grip.angularVelocity = new q4()), this._grip; } dispatchEvent(e) { return this._targetRay !== null && this._targetRay.dispatchEvent(e), this._grip !== null && this._grip.dispatchEvent(e), this._hand !== null && this._hand.dispatchEvent(e), this; } disconnect(e) { return this.dispatchEvent({ type: "disconnected", data: e }), this._targetRay !== null && (this._targetRay.visible = false), this._grip !== null && (this._grip.visible = false), this._hand !== null && (this._hand.visible = false), this; } update(e, t, i) { let r = null, s = null, o = null; const a6 = this._targetRay, c = this._grip, l = this._hand; if (e && t.session.visibilityState !== "visible-blurred") if (a6 !== null && (r = t.getPose(e.targetRaySpace, i), r !== null && (a6.matrix.fromArray(r.transform.matrix), a6.matrix.decompose(a6.position, a6.rotation, a6.scale), r.linearVelocity ? (a6.hasLinearVelocity = true, a6.linearVelocity.copy(r.linearVelocity)) : a6.hasLinearVelocity = false, r.angularVelocity ? (a6.hasAngularVelocity = true, a6.angularVelocity.copy(r.angularVelocity)) : a6.hasAngularVelocity = false, this.dispatchEvent(ID))), l && e.hand) { o = true; for (const u6 of e.hand.values()) { const y6 = t.getJointPose(u6, i); if (l.joints[u6.jointName] === void 0) { const m6 = new _i(); m6.matrixAutoUpdate = false, m6.visible = false, l.joints[u6.jointName] = m6, l.add(m6); } const v6 = l.joints[u6.jointName]; y6 !== null && (v6.matrix.fromArray(y6.transform.matrix), v6.matrix.decompose(v6.position, v6.rotation, v6.scale), v6.jointRadius = y6.radius), v6.visible = y6 !== null; } const d = l.joints["index-finger-tip"], h6 = l.joints["thumb-tip"], f6 = d.position.distanceTo(h6.position), g6 = 0.02, p = 5e-3; l.inputState.pinching && f6 > g6 + p ? (l.inputState.pinching = false, this.dispatchEvent({ type: "pinchend", handedness: e.handedness, target: this })) : !l.inputState.pinching && f6 <= g6 - p && (l.inputState.pinching = true, this.dispatchEvent({ type: "pinchstart", handedness: e.handedness, target: this })); } else c !== null && e.gripSpace && (s = t.getPose(e.gripSpace, i), s !== null && (c.matrix.fromArray(s.transform.matrix), c.matrix.decompose(c.position, c.rotation, c.scale), s.linearVelocity ? (c.hasLinearVelocity = true, c.linearVelocity.copy(s.linearVelocity)) : c.hasLinearVelocity = false, s.angularVelocity ? (c.hasAngularVelocity = true, c.angularVelocity.copy(s.angularVelocity)) : c.hasAngularVelocity = false)); return a6 !== null && (a6.visible = r !== null), c !== null && (c.visible = s !== null), l !== null && (l.visible = o !== null), this; } }; var OD = class extends Kr { constructor(e, t) { super(); const i = this, r = e.state; let s = null, o = 1, a6 = null, c = "local-floor", l = null, d = null, h6 = null, f6 = null; const g6 = [], p = /* @__PURE__ */ new Map(), u6 = new nn2(); u6.layers.enable(1), u6.viewport = new xt(); const y6 = new nn2(); y6.layers.enable(2), y6.viewport = new xt(); const v6 = [u6, y6], m6 = new Ff(); m6.layers.enable(1), m6.layers.enable(2); let x6 = null, w6 = null; this.cameraAutoUpdate = true, this.enabled = false, this.isPresenting = false, this.getController = function(I6) { let b6 = g6[I6]; return b6 === void 0 && (b6 = new gh(), g6[I6] = b6), b6.getTargetRaySpace(); }, this.getControllerGrip = function(I6) { let b6 = g6[I6]; return b6 === void 0 && (b6 = new gh(), g6[I6] = b6), b6.getGripSpace(); }, this.getHand = function(I6) { let b6 = g6[I6]; return b6 === void 0 && (b6 = new gh(), g6[I6] = b6), b6.getHandSpace(); }; function A6(I6) { const b6 = p.get(I6.inputSource); b6 && b6.dispatchEvent({ type: I6.type, data: I6.inputSource }); } function M6() { p.forEach(function(I6, b6) { I6.disconnect(b6); }), p.clear(), x6 = null, w6 = null, r.bindXRFramebuffer(null), e.setRenderTarget(e.getRenderTarget()), C6.stop(), i.isPresenting = false, i.dispatchEvent({ type: "sessionend" }); } this.setFramebufferScaleFactor = function(I6) { o = I6, i.isPresenting === true && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); }, this.setReferenceSpaceType = function(I6) { c = I6, i.isPresenting === true && console.warn("THREE.WebXRManager: Cannot change reference space type while presenting."); }, this.getReferenceSpace = function() { return a6; }, this.getSession = function() { return s; }, this.setSession = async function(I6) { if (s = I6, s !== null) { s.addEventListener("select", A6), s.addEventListener("selectstart", A6), s.addEventListener("selectend", A6), s.addEventListener("squeeze", A6), s.addEventListener("squeezestart", A6), s.addEventListener("squeezeend", A6), s.addEventListener("end", M6), s.addEventListener("inputsourceschange", R6); const b6 = t.getContextAttributes(); if (b6.xrCompatible !== true && await t.makeXRCompatible(), s.renderState.layers === void 0) { const F6 = { antialias: b6.antialias, alpha: b6.alpha, depth: b6.depth, stencil: b6.stencil, framebufferScaleFactor: o }, D6 = new XRWebGLLayer(s, t, F6); s.updateRenderState({ baseLayer: D6 }); } else { let F6 = 0; b6.depth && (F6 = b6.stencil ? 34041 : 6402); const D6 = { colorFormat: b6.alpha ? 6408 : 6407, depthFormat: F6, scaleFactor: o }; d = new XRWebGLBinding(s, t), f6 = d.createProjectionLayer(D6), h6 = t.createFramebuffer(), s.updateRenderState({ layers: [f6] }); } a6 = await s.requestReferenceSpace(c), C6.setContext(s), C6.start(), i.isPresenting = true, i.dispatchEvent({ type: "sessionstart" }); } }; function R6(I6) { const b6 = s.inputSources; for (let F6 = 0; F6 < g6.length; F6++) p.set(b6[F6], g6[F6]); for (let F6 = 0; F6 < I6.removed.length; F6++) { const D6 = I6.removed[F6], N6 = p.get(D6); N6 && (N6.dispatchEvent({ type: "disconnected", data: D6 }), p.delete(D6)); } for (let F6 = 0; F6 < I6.added.length; F6++) { const D6 = I6.added[F6], N6 = p.get(D6); N6 && N6.dispatchEvent({ type: "connected", data: D6 }); } } const L6 = new q4(), T6 = new q4(); function P6(I6, b6, F6) { L6.setFromMatrixPosition(b6.matrixWorld), T6.setFromMatrixPosition(F6.matrixWorld); const D6 = L6.distanceTo(T6), N6 = b6.projectionMatrix.elements, B6 = F6.projectionMatrix.elements, U6 = N6[14] / (N6[10] - 1), G6 = N6[14] / (N6[10] + 1), Y = (N6[9] + 1) / N6[5], te = (N6[9] - 1) / N6[5], ae = (N6[8] - 1) / N6[0], ie = (B6[8] + 1) / B6[0], le = U6 * ae, W6 = U6 * ie, $6 = D6 / (-ae + ie), j6 = $6 * -ae; b6.matrixWorld.decompose(I6.position, I6.quaternion, I6.scale), I6.translateX(j6), I6.translateZ($6), I6.matrixWorld.compose(I6.position, I6.quaternion, I6.scale), I6.matrixWorldInverse.copy(I6.matrixWorld).invert(); const re = U6 + $6, k6 = G6 + $6, H6 = le - j6, K = W6 + (D6 - j6), ce = Y * G6 / k6 * re, se = te * G6 / k6 * re; I6.projectionMatrix.makePerspective(H6, K, ce, se, re, k6); } function _6(I6, b6) { b6 === null ? I6.matrixWorld.copy(I6.matrix) : I6.matrixWorld.multiplyMatrices(b6.matrixWorld, I6.matrix), I6.matrixWorldInverse.copy(I6.matrixWorld).invert(); } this.updateCamera = function(I6) { if (s === null) return; m6.near = y6.near = u6.near = I6.near, m6.far = y6.far = u6.far = I6.far, (x6 !== m6.near || w6 !== m6.far) && (s.updateRenderState({ depthNear: m6.near, depthFar: m6.far }), x6 = m6.near, w6 = m6.far); const b6 = I6.parent, F6 = m6.cameras; _6(m6, b6); for (let N6 = 0; N6 < F6.length; N6++) _6(F6[N6], b6); m6.matrixWorld.decompose(m6.position, m6.quaternion, m6.scale), I6.position.copy(m6.position), I6.quaternion.copy(m6.quaternion), I6.scale.copy(m6.scale), I6.matrix.copy(m6.matrix), I6.matrixWorld.copy(m6.matrixWorld); const D6 = I6.children; for (let N6 = 0, B6 = D6.length; N6 < B6; N6++) D6[N6].updateMatrixWorld(true); F6.length === 2 ? P6(m6, u6, y6) : m6.projectionMatrix.copy(u6.projectionMatrix); }, this.getCamera = function() { return m6; }; let S6 = null; function E6(I6, b6) { if (l = b6.getViewerPose(a6), l !== null) { const D6 = l.views, N6 = s.renderState.baseLayer; s.renderState.layers === void 0 && r.bindXRFramebuffer(N6.framebuffer); let B6 = false; D6.length !== m6.cameras.length && (m6.cameras.length = 0, B6 = true); for (let U6 = 0; U6 < D6.length; U6++) { const G6 = D6[U6]; let Y = null; if (s.renderState.layers === void 0) Y = N6.getViewport(G6); else { const ae = d.getViewSubImage(f6, G6); r.bindXRFramebuffer(h6), t.framebufferTexture2D(36160, 36064, 3553, ae.colorTexture, 0), ae.depthStencilTexture !== void 0 && t.framebufferTexture2D(36160, 36096, 3553, ae.depthStencilTexture, 0), Y = ae.viewport; } const te = v6[U6]; te.matrix.fromArray(G6.transform.matrix), te.projectionMatrix.fromArray(G6.projectionMatrix), te.viewport.set(Y.x, Y.y, Y.width, Y.height), U6 === 0 && m6.matrix.copy(te.matrix), B6 === true && m6.cameras.push(te); } } const F6 = s.inputSources; for (let D6 = 0; D6 < g6.length; D6++) { const N6 = g6[D6], B6 = F6[D6]; N6.update(B6, b6, a6); } S6 && S6(I6, b6); } const C6 = new fx(); C6.setAnimationLoop(E6), this.setAnimationLoop = function(I6) { S6 = I6; }, this.dispose = function() { }; } }; function DD(n) { function e(v6, m6) { v6.fogColor.value.copy(m6.color), m6.isFog ? (v6.fogNear.value = m6.near, v6.fogFar.value = m6.far) : m6.isFogExp2 && (v6.fogDensity.value = m6.density); } function t(v6, m6, x6, w6, A6) { m6.isMeshBasicMaterial ? i(v6, m6) : m6.isMeshLambertMaterial ? (i(v6, m6), c(v6, m6)) : m6.isMeshToonMaterial ? (i(v6, m6), d(v6, m6)) : m6.isMeshPhongMaterial ? (i(v6, m6), l(v6, m6)) : m6.isMeshStandardMaterial ? (i(v6, m6), m6.isMeshPhysicalMaterial ? f6(v6, m6, A6) : h6(v6, m6)) : m6.isMeshMatcapMaterial ? (i(v6, m6), g6(v6, m6)) : m6.isMeshDepthMaterial ? (i(v6, m6), p(v6, m6)) : m6.isMeshDistanceMaterial ? (i(v6, m6), u6(v6, m6)) : m6.isMeshNormalMaterial ? (i(v6, m6), y6(v6, m6)) : m6.isLineBasicMaterial ? (r(v6, m6), m6.isLineDashedMaterial && s(v6, m6)) : m6.isPointsMaterial ? o(v6, m6, x6, w6) : m6.isSpriteMaterial ? a6(v6, m6) : m6.isShadowMaterial ? (v6.color.value.copy(m6.color), v6.opacity.value = m6.opacity) : m6.isShaderMaterial && (m6.uniformsNeedUpdate = false); } function i(v6, m6) { v6.opacity.value = m6.opacity, m6.color && v6.diffuse.value.copy(m6.color), m6.emissive && v6.emissive.value.copy(m6.emissive).multiplyScalar(m6.emissiveIntensity), m6.map && (v6.map.value = m6.map), m6.alphaMap && (v6.alphaMap.value = m6.alphaMap), m6.specularMap && (v6.specularMap.value = m6.specularMap); const x6 = n.get(m6).envMap; if (x6) { v6.envMap.value = x6, v6.flipEnvMap.value = x6.isCubeTexture && x6._needsFlipEnvMap ? -1 : 1, v6.reflectivity.value = m6.reflectivity, v6.refractionRatio.value = m6.refractionRatio; const M6 = n.get(x6).__maxMipLevel; M6 !== void 0 && (v6.maxMipLevel.value = M6); } m6.lightMap && (v6.lightMap.value = m6.lightMap, v6.lightMapIntensity.value = m6.lightMapIntensity), m6.aoMap && (v6.aoMap.value = m6.aoMap, v6.aoMapIntensity.value = m6.aoMapIntensity); let w6; m6.map ? w6 = m6.map : m6.specularMap ? w6 = m6.specularMap : m6.displacementMap ? w6 = m6.displacementMap : m6.normalMap ? w6 = m6.normalMap : m6.bumpMap ? w6 = m6.bumpMap : m6.roughnessMap ? w6 = m6.roughnessMap : m6.metalnessMap ? w6 = m6.metalnessMap : m6.alphaMap ? w6 = m6.alphaMap : m6.emissiveMap ? w6 = m6.emissiveMap : m6.clearcoatMap ? w6 = m6.clearcoatMap : m6.clearcoatNormalMap ? w6 = m6.clearcoatNormalMap : m6.clearcoatRoughnessMap && (w6 = m6.clearcoatRoughnessMap), w6 !== void 0 && (w6.isWebGLRenderTarget && (w6 = w6.texture), w6.matrixAutoUpdate === true && w6.updateMatrix(), v6.uvTransform.value.copy(w6.matrix)); let A6; m6.aoMap ? A6 = m6.aoMap : m6.lightMap && (A6 = m6.lightMap), A6 !== void 0 && (A6.isWebGLRenderTarget && (A6 = A6.texture), A6.matrixAutoUpdate === true && A6.updateMatrix(), v6.uv2Transform.value.copy(A6.matrix)); } function r(v6, m6) { v6.diffuse.value.copy(m6.color), v6.opacity.value = m6.opacity; } function s(v6, m6) { v6.dashSize.value = m6.dashSize, v6.totalSize.value = m6.dashSize + m6.gapSize, v6.scale.value = m6.scale; } function o(v6, m6, x6, w6) { v6.diffuse.value.copy(m6.color), v6.opacity.value = m6.opacity, v6.size.value = m6.size * x6, v6.scale.value = w6 * 0.5, m6.map && (v6.map.value = m6.map), m6.alphaMap && (v6.alphaMap.value = m6.alphaMap); let A6; m6.map ? A6 = m6.map : m6.alphaMap && (A6 = m6.alphaMap), A6 !== void 0 && (A6.matrixAutoUpdate === true && A6.updateMatrix(), v6.uvTransform.value.copy(A6.matrix)); } function a6(v6, m6) { v6.diffuse.value.copy(m6.color), v6.opacity.value = m6.opacity, v6.rotation.value = m6.rotation, m6.map && (v6.map.value = m6.map), m6.alphaMap && (v6.alphaMap.value = m6.alphaMap); let x6; m6.map ? x6 = m6.map : m6.alphaMap && (x6 = m6.alphaMap), x6 !== void 0 && (x6.matrixAutoUpdate === true && x6.updateMatrix(), v6.uvTransform.value.copy(x6.matrix)); } function c(v6, m6) { m6.emissiveMap && (v6.emissiveMap.value = m6.emissiveMap); } function l(v6, m6) { v6.specular.value.copy(m6.specular), v6.shininess.value = Math.max(m6.shininess, 1e-4), m6.emissiveMap && (v6.emissiveMap.value = m6.emissiveMap), m6.bumpMap && (v6.bumpMap.value = m6.bumpMap, v6.bumpScale.value = m6.bumpScale, m6.side === jt && (v6.bumpScale.value *= -1)), m6.normalMap && (v6.normalMap.value = m6.normalMap, v6.normalScale.value.copy(m6.normalScale), m6.side === jt && v6.normalScale.value.negate()), m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias); } function d(v6, m6) { m6.gradientMap && (v6.gradientMap.value = m6.gradientMap), m6.emissiveMap && (v6.emissiveMap.value = m6.emissiveMap), m6.bumpMap && (v6.bumpMap.value = m6.bumpMap, v6.bumpScale.value = m6.bumpScale, m6.side === jt && (v6.bumpScale.value *= -1)), m6.normalMap && (v6.normalMap.value = m6.normalMap, v6.normalScale.value.copy(m6.normalScale), m6.side === jt && v6.normalScale.value.negate()), m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias); } function h6(v6, m6) { v6.roughness.value = m6.roughness, v6.metalness.value = m6.metalness, m6.roughnessMap && (v6.roughnessMap.value = m6.roughnessMap), m6.metalnessMap && (v6.metalnessMap.value = m6.metalnessMap), m6.emissiveMap && (v6.emissiveMap.value = m6.emissiveMap), m6.bumpMap && (v6.bumpMap.value = m6.bumpMap, v6.bumpScale.value = m6.bumpScale, m6.side === jt && (v6.bumpScale.value *= -1)), m6.normalMap && (v6.normalMap.value = m6.normalMap, v6.normalScale.value.copy(m6.normalScale), m6.side === jt && v6.normalScale.value.negate()), m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias), n.get(m6).envMap && (v6.envMapIntensity.value = m6.envMapIntensity); } function f6(v6, m6, x6) { h6(v6, m6), v6.reflectivity.value = m6.reflectivity, v6.clearcoat.value = m6.clearcoat, v6.clearcoatRoughness.value = m6.clearcoatRoughness, m6.sheen && v6.sheen.value.copy(m6.sheen), m6.clearcoatMap && (v6.clearcoatMap.value = m6.clearcoatMap), m6.clearcoatRoughnessMap && (v6.clearcoatRoughnessMap.value = m6.clearcoatRoughnessMap), m6.clearcoatNormalMap && (v6.clearcoatNormalScale.value.copy(m6.clearcoatNormalScale), v6.clearcoatNormalMap.value = m6.clearcoatNormalMap, m6.side === jt && v6.clearcoatNormalScale.value.negate()), v6.transmission.value = m6.transmission, m6.transmissionMap && (v6.transmissionMap.value = m6.transmissionMap), m6.transmission > 0 && (v6.transmissionSamplerMap.value = x6.texture, v6.transmissionSamplerSize.value.set(x6.width, x6.height)), v6.thickness.value = m6.thickness, m6.thicknessMap && (v6.thicknessMap.value = m6.thicknessMap), v6.attenuationDistance.value = m6.attenuationDistance, v6.attenuationColor.value.copy(m6.attenuationColor); } function g6(v6, m6) { m6.matcap && (v6.matcap.value = m6.matcap), m6.bumpMap && (v6.bumpMap.value = m6.bumpMap, v6.bumpScale.value = m6.bumpScale, m6.side === jt && (v6.bumpScale.value *= -1)), m6.normalMap && (v6.normalMap.value = m6.normalMap, v6.normalScale.value.copy(m6.normalScale), m6.side === jt && v6.normalScale.value.negate()), m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias); } function p(v6, m6) { m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias); } function u6(v6, m6) { m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias), v6.referencePosition.value.copy(m6.referencePosition), v6.nearDistance.value = m6.nearDistance, v6.farDistance.value = m6.farDistance; } function y6(v6, m6) { m6.bumpMap && (v6.bumpMap.value = m6.bumpMap, v6.bumpScale.value = m6.bumpScale, m6.side === jt && (v6.bumpScale.value *= -1)), m6.normalMap && (v6.normalMap.value = m6.normalMap, v6.normalScale.value.copy(m6.normalScale), m6.side === jt && v6.normalScale.value.negate()), m6.displacementMap && (v6.displacementMap.value = m6.displacementMap, v6.displacementScale.value = m6.displacementScale, v6.displacementBias.value = m6.displacementBias); } return { refreshFogUniforms: e, refreshMaterialUniforms: t }; } function ND() { const n = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); return n.style.display = "block", n; } function wt(n = {}) { const e = n.canvas !== void 0 ? n.canvas : ND(), t = n.context !== void 0 ? n.context : null, i = n.alpha !== void 0 ? n.alpha : false, r = n.depth !== void 0 ? n.depth : true, s = n.stencil !== void 0 ? n.stencil : true, o = n.antialias !== void 0 ? n.antialias : false, a6 = n.premultipliedAlpha !== void 0 ? n.premultipliedAlpha : true, c = n.preserveDrawingBuffer !== void 0 ? n.preserveDrawingBuffer : false, l = n.powerPreference !== void 0 ? n.powerPreference : "default", d = n.failIfMajorPerformanceCaveat !== void 0 ? n.failIfMajorPerformanceCaveat : false; let h6 = null, f6 = null; const g6 = [], p = []; this.domElement = e, this.debug = { /** * Enables error checking and reporting when shader programs are being compiled * @type {boolean} */ checkShaderErrors: true }, this.autoClear = true, this.autoClearColor = true, this.autoClearDepth = true, this.autoClearStencil = true, this.sortObjects = true, this.clippingPlanes = [], this.localClippingEnabled = false, this.gammaFactor = 2, this.outputEncoding = Cn, this.physicallyCorrectLights = false, this.toneMapping = Ir, this.toneMappingExposure = 1; const u6 = this; let y6 = false, v6 = 0, m6 = 0, x6 = null, w6 = -1, A6 = null; const M6 = new xt(), R6 = new xt(); let L6 = null, T6 = e.width, P6 = e.height, _6 = 1, S6 = null, E6 = null; const C6 = new xt(0, 0, T6, P6), I6 = new xt(0, 0, T6, P6); let b6 = false; const F6 = [], D6 = new dl(); let N6 = false, B6 = false, U6 = null; const G6 = new Xe(), Y = new q4(), te = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true }; function ae() { return x6 === null ? _6 : 1; } let ie = t; function le(J, ye) { for (let pe = 0; pe < J.length; pe++) { const we = J[pe], Le = e.getContext(we, ye); if (Le !== null) return Le; } return null; } try { const J = { alpha: i, depth: r, stencil: s, antialias: o, premultipliedAlpha: a6, preserveDrawingBuffer: c, powerPreference: l, failIfMajorPerformanceCaveat: d }; if (e.addEventListener("webglcontextlost", $e, false), e.addEventListener("webglcontextrestored", lt, false), ie === null) { const ye = ["webgl2", "webgl", "experimental-webgl"]; if (u6.isWebGL1Renderer === true && ye.shift(), ie = le(ye, J), ie === null) throw le(ye) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context."); } ie.getShaderPrecisionFormat === void 0 && (ie.getShaderPrecisionFormat = function() { return { rangeMin: 1, rangeMax: 1, precision: 1 }; }); } catch (J) { throw console.error("THREE.WebGLRenderer: " + J.message), J; } let W6, $6, j6, re, k6, H6, K, ce, se, V6, O6, Z6, X, ee, fe, be, Ae, he, xe, ne, me, Me; function De() { W6 = new oO(ie), $6 = new iO(ie, W6, n), W6.init($6), me = new wx(ie, W6, $6), j6 = new FD(ie, W6, $6), F6[0] = 1029, re = new cO(), k6 = new xD(), H6 = new PD(ie, W6, j6, k6, $6, me, re), K = new sO(u6), ce = new PF(ie, $6), Me = new tO(ie, W6, ce, $6), se = new aO(ie, ce, re, Me), V6 = new fO(ie, se, ce, re), he = new dO(ie), fe = new rO(k6), O6 = new bD(u6, K, W6, $6, Me, fe), Z6 = new DD(k6), X = new wD(k6), ee = new CD(W6, $6), Ae = new eO(u6, K, j6, V6, a6), be = new Mx(u6, V6, $6), xe = new nO(ie, W6, re, $6), ne = new lO(ie, W6, re, $6), re.programs = O6.programs, u6.capabilities = $6, u6.extensions = W6, u6.properties = k6, u6.renderLists = X, u6.shadowMap = be, u6.state = j6, u6.info = re; } De(); const Ie = new OD(u6, ie); this.xr = Ie, this.getContext = function() { return ie; }, this.getContextAttributes = function() { return ie.getContextAttributes(); }, this.forceContextLoss = function() { const J = W6.get("WEBGL_lose_context"); J && J.loseContext(); }, this.forceContextRestore = function() { const J = W6.get("WEBGL_lose_context"); J && J.restoreContext(); }, this.getPixelRatio = function() { return _6; }, this.setPixelRatio = function(J) { J !== void 0 && (_6 = J, this.setSize(T6, P6, false)); }, this.getSize = function(J) { return J.set(T6, P6); }, this.setSize = function(J, ye, pe) { if (Ie.isPresenting) { console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."); return; } T6 = J, P6 = ye, e.width = Math.floor(J * _6), e.height = Math.floor(ye * _6), pe !== false && (e.style.width = J + "px", e.style.height = ye + "px"), this.setViewport(0, 0, J, ye); }, this.getDrawingBufferSize = function(J) { return J.set(T6 * _6, P6 * _6).floor(); }, this.setDrawingBufferSize = function(J, ye, pe) { T6 = J, P6 = ye, _6 = pe, e.width = Math.floor(J * pe), e.height = Math.floor(ye * pe), this.setViewport(0, 0, J, ye); }, this.getCurrentViewport = function(J) { return J.copy(M6); }, this.getViewport = function(J) { return J.copy(C6); }, this.setViewport = function(J, ye, pe, we) { J.isVector4 ? C6.set(J.x, J.y, J.z, J.w) : C6.set(J, ye, pe, we), j6.viewport(M6.copy(C6).multiplyScalar(_6).floor()); }, this.getScissor = function(J) { return J.copy(I6); }, this.setScissor = function(J, ye, pe, we) { J.isVector4 ? I6.set(J.x, J.y, J.z, J.w) : I6.set(J, ye, pe, we), j6.scissor(R6.copy(I6).multiplyScalar(_6).floor()); }, this.getScissorTest = function() { return b6; }, this.setScissorTest = function(J) { j6.setScissorTest(b6 = J); }, this.setOpaqueSort = function(J) { S6 = J; }, this.setTransparentSort = function(J) { E6 = J; }, this.getClearColor = function(J) { return J.copy(Ae.getClearColor()); }, this.setClearColor = function() { Ae.setClearColor.apply(Ae, arguments); }, this.getClearAlpha = function() { return Ae.getClearAlpha(); }, this.setClearAlpha = function() { Ae.setClearAlpha.apply(Ae, arguments); }, this.clear = function(J, ye, pe) { let we = 0; (J === void 0 || J) && (we |= 16384), (ye === void 0 || ye) && (we |= 256), (pe === void 0 || pe) && (we |= 1024), ie.clear(we); }, this.clearColor = function() { this.clear(true, false, false); }, this.clearDepth = function() { this.clear(false, true, false); }, this.clearStencil = function() { this.clear(false, false, true); }, this.dispose = function() { e.removeEventListener("webglcontextlost", $e, false), e.removeEventListener("webglcontextrestored", lt, false), X.dispose(), ee.dispose(), k6.dispose(), K.dispose(), V6.dispose(), Me.dispose(), Ie.dispose(), Ie.removeEventListener("sessionstart", Qt), Ie.removeEventListener("sessionend", Pt), U6 && (U6.dispose(), U6 = null), Nt.stop(); }; function $e(J) { J.preventDefault(), console.log("THREE.WebGLRenderer: Context Lost."), y6 = true; } function lt() { console.log("THREE.WebGLRenderer: Context Restored."), y6 = false; const J = re.autoReset, ye = be.enabled, pe = be.autoUpdate, we = be.needsUpdate, Le = be.type; De(), re.autoReset = J, be.enabled = ye, be.autoUpdate = pe, be.needsUpdate = we, be.type = Le; } function qe(J) { const ye = J.target; ye.removeEventListener("dispose", qe), Mt(ye); } function Mt(J) { Be(J), k6.remove(J); } function Be(J) { const ye = k6.get(J).programs; ye !== void 0 && ye.forEach(function(pe) { O6.releaseProgram(pe); }); } function it(J, ye) { J.render(function(pe) { u6.renderBufferImmediate(pe, ye); }); } this.renderBufferImmediate = function(J, ye) { Me.initAttributes(); const pe = k6.get(J); J.hasPositions && !pe.position && (pe.position = ie.createBuffer()), J.hasNormals && !pe.normal && (pe.normal = ie.createBuffer()), J.hasUvs && !pe.uv && (pe.uv = ie.createBuffer()), J.hasColors && !pe.color && (pe.color = ie.createBuffer()); const we = ye.getAttributes(); J.hasPositions && (ie.bindBuffer(34962, pe.position), ie.bufferData(34962, J.positionArray, 35048), Me.enableAttribute(we.position), ie.vertexAttribPointer(we.position, 3, 5126, false, 0, 0)), J.hasNormals && (ie.bindBuffer(34962, pe.normal), ie.bufferData(34962, J.normalArray, 35048), Me.enableAttribute(we.normal), ie.vertexAttribPointer(we.normal, 3, 5126, false, 0, 0)), J.hasUvs && (ie.bindBuffer(34962, pe.uv), ie.bufferData(34962, J.uvArray, 35048), Me.enableAttribute(we.uv), ie.vertexAttribPointer(we.uv, 2, 5126, false, 0, 0)), J.hasColors && (ie.bindBuffer(34962, pe.color), ie.bufferData(34962, J.colorArray, 35048), Me.enableAttribute(we.color), ie.vertexAttribPointer(we.color, 3, 5126, false, 0, 0)), Me.disableUnusedAttributes(), ie.drawArrays(4, 0, J.count), J.count = 0; }, this.renderBufferDirect = function(J, ye, pe, we, Le, ge) { ye === null && (ye = te); const Se = Le.isMesh && Le.matrixWorld.determinant() < 0, Fe = Oe(J, ye, we, Le); j6.setMaterial(we, Se); let Ge = pe.index; const je = pe.attributes.position; if (Ge === null) { if (je === void 0 || je.count === 0) return; } else if (Ge.count === 0) return; let et = 1; we.wireframe === true && (Ge = se.getWireframeAttribute(pe), et = 2), (we.morphTargets || we.morphNormals) && he.update(Le, pe, we, Fe), Me.setup(Le, we, Fe, pe, Ge); let Ye, ft = xe; Ge !== null && (Ye = ce.get(Ge), ft = ne, ft.setIndex(Ye)); const Vt = Ge !== null ? Ge.count : je.count, ln2 = pe.drawRange.start * et, ns = pe.drawRange.count * et, Tt = ge !== null ? ge.start * et : 0, is = ge !== null ? ge.count * et : 1 / 0, Mn = Math.max(ln2, Tt), NM = Math.min(Vt, ln2 + ns, Tt + is) - 1, Sl = Math.max(0, NM - Mn + 1); if (Sl !== 0) { if (Le.isMesh) we.wireframe === true ? (j6.setLineWidth(we.wireframeLinewidth * ae()), ft.setMode(1)) : ft.setMode(4); else if (Le.isLine) { let aa = we.linewidth; aa === void 0 && (aa = 1), j6.setLineWidth(aa * ae()), Le.isLineSegments ? ft.setMode(1) : Le.isLineLoop ? ft.setMode(2) : ft.setMode(3); } else Le.isPoints ? ft.setMode(0) : Le.isSprite && ft.setMode(4); if (Le.isInstancedMesh) ft.renderInstances(Mn, Sl, Le.count); else if (pe.isInstancedBufferGeometry) { const aa = Math.min(pe.instanceCount, pe._maxInstanceCount); ft.renderInstances(Mn, Sl, aa); } else ft.render(Mn, Sl); } }, this.compile = function(J, ye) { f6 = ee.get(J), f6.init(), J.traverseVisible(function(pe) { pe.isLight && pe.layers.test(ye.layers) && (f6.pushLight(pe), pe.castShadow && f6.pushShadow(pe)); }), f6.setupLights(), J.traverse(function(pe) { const we = pe.material; if (we) if (Array.isArray(we)) for (let Le = 0; Le < we.length; Le++) { const ge = we[Le]; Q(ge, J, pe); } else Q(we, J, pe); }); }; let tt = null; function qt(J) { tt && tt(J); } function Qt() { Nt.stop(); } function Pt() { Nt.start(); } const Nt = new fx(); Nt.setAnimationLoop(qt), typeof window < "u" && Nt.setContext(window), this.setAnimationLoop = function(J) { tt = J, Ie.setAnimationLoop(J), J === null ? Nt.stop() : Nt.start(); }, Ie.addEventListener("sessionstart", Qt), Ie.addEventListener("sessionend", Pt), this.render = function(J, ye) { if (ye !== void 0 && ye.isCamera !== true) { console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); return; } if (y6 === true) return; J.autoUpdate === true && J.updateMatrixWorld(), ye.parent === null && ye.updateMatrixWorld(), Ie.enabled === true && Ie.isPresenting === true && (Ie.cameraAutoUpdate === true && Ie.updateCamera(ye), ye = Ie.getCamera()), J.isScene === true && J.onBeforeRender(u6, J, ye, x6), f6 = ee.get(J, p.length), f6.init(), p.push(f6), G6.multiplyMatrices(ye.projectionMatrix, ye.matrixWorldInverse), D6.setFromProjectionMatrix(G6), B6 = this.localClippingEnabled, N6 = fe.init(this.clippingPlanes, B6, ye), h6 = X.get(J, g6.length), h6.init(), g6.push(h6), Vi(J, ye, 0, u6.sortObjects), h6.finish(), u6.sortObjects === true && h6.sort(S6, E6), N6 === true && fe.beginShadows(); const pe = f6.state.shadowsArray; be.render(pe, J, ye), f6.setupLights(), f6.setupLightsView(ye), N6 === true && fe.endShadows(), this.info.autoReset === true && this.info.reset(), Ae.render(h6, J); const we = h6.opaque, Le = h6.transmissive, ge = h6.transparent; we.length > 0 && ni(we, J, ye), Le.length > 0 && Gi(we, Le, J, ye), ge.length > 0 && ni(ge, J, ye), x6 !== null && (H6.updateMultisampleRenderTarget(x6), H6.updateRenderTargetMipmap(x6)), J.isScene === true && J.onAfterRender(u6, J, ye), j6.buffers.depth.setTest(true), j6.buffers.depth.setMask(true), j6.buffers.color.setMask(true), j6.setPolygonOffset(false), Me.resetDefaultState(), w6 = -1, A6 = null, p.pop(), p.length > 0 ? f6 = p[p.length - 1] : f6 = null, g6.pop(), g6.length > 0 ? h6 = g6[g6.length - 1] : h6 = null; }; function Vi(J, ye, pe, we) { if (J.visible === false) return; if (J.layers.test(ye.layers)) { if (J.isGroup) pe = J.renderOrder; else if (J.isLOD) J.autoUpdate === true && J.update(ye); else if (J.isLight) f6.pushLight(J), J.castShadow && f6.pushShadow(J); else if (J.isSprite) { if (!J.frustumCulled || D6.intersectsSprite(J)) { we && Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G6); const Se = V6.update(J), Fe = J.material; Fe.visible && h6.push(J, Se, Fe, pe, Y.z, null); } } else if (J.isImmediateRenderObject) we && Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G6), h6.push(J, null, J.material, pe, Y.z, null); else if ((J.isMesh || J.isLine || J.isPoints) && (J.isSkinnedMesh && J.skeleton.frame !== re.render.frame && (J.skeleton.update(), J.skeleton.frame = re.render.frame), !J.frustumCulled || D6.intersectsObject(J))) { we && Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G6); const Se = V6.update(J), Fe = J.material; if (Array.isArray(Fe)) { const Ge = Se.groups; for (let je = 0, et = Ge.length; je < et; je++) { const Ye = Ge[je], ft = Fe[Ye.materialIndex]; ft && ft.visible && h6.push(J, Se, ft, pe, Y.z, Ye); } } else Fe.visible && h6.push(J, Se, Fe, pe, Y.z, null); } } const ge = J.children; for (let Se = 0, Fe = ge.length; Se < Fe; Se++) Vi(ge[Se], ye, pe, we); } function Gi(J, ye, pe, we) { if (U6 === null) { const Fe = o === true && $6.isWebGL2 === true ? Ef : fi; U6 = new Fe(1024, 1024, { generateMipmaps: true, type: me.convert(Ms) !== null ? Ms : Ts, minFilter: pr, magFilter: $t, wrapS: hn2, wrapT: hn2 }); } const Le = u6.getRenderTarget(); u6.setRenderTarget(U6), u6.clear(); const ge = u6.toneMapping; u6.toneMapping = Ir, ni(J, pe, we), u6.toneMapping = ge, H6.updateMultisampleRenderTarget(U6), H6.updateRenderTargetMipmap(U6), u6.setRenderTarget(Le), ni(ye, pe, we); } function ni(J, ye, pe) { const we = ye.isScene === true ? ye.overrideMaterial : null; for (let Le = 0, ge = J.length; Le < ge; Le++) { const Se = J[Le], Fe = Se.object, Ge = Se.geometry, je = we === null ? Se.material : we, et = Se.group; if (pe.isArrayCamera) { const Ye = pe.cameras; for (let ft = 0, Vt = Ye.length; ft < Vt; ft++) { const ln2 = Ye[ft]; Fe.layers.test(ln2.layers) && (j6.viewport(M6.copy(ln2.viewport)), f6.setupLightsView(ln2), ts(Fe, ye, ln2, Ge, je, et)); } } else ts(Fe, ye, pe, Ge, je, et); } } function ts(J, ye, pe, we, Le, ge) { if (J.onBeforeRender(u6, ye, pe, we, Le, ge), J.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse, J.matrixWorld), J.normalMatrix.getNormalMatrix(J.modelViewMatrix), J.isImmediateRenderObject) { const Se = Oe(pe, ye, Le, J); j6.setMaterial(Le), Me.reset(), it(J, Se); } else Le.transparent === true && Le.side === Wr ? (Le.side = jt, Le.needsUpdate = true, u6.renderBufferDirect(pe, ye, we, Le, J, ge), Le.side = Hr, Le.needsUpdate = true, u6.renderBufferDirect(pe, ye, we, Le, J, ge), Le.side = Wr) : u6.renderBufferDirect(pe, ye, we, Le, J, ge); J.onAfterRender(u6, ye, pe, we, Le, ge); } function Q(J, ye, pe) { ye.isScene !== true && (ye = te); const we = k6.get(J), Le = f6.state.lights, ge = f6.state.shadowsArray, Se = Le.state.version, Fe = O6.getParameters(J, Le.state, ge, ye, pe), Ge = O6.getProgramCacheKey(Fe); let je = we.programs; we.environment = J.isMeshStandardMaterial ? ye.environment : null, we.fog = ye.fog, we.envMap = K.get(J.envMap || we.environment), je === void 0 && (J.addEventListener("dispose", qe), je = /* @__PURE__ */ new Map(), we.programs = je); let et = je.get(Ge); if (et !== void 0) { if (we.currentProgram === et && we.lightsStateVersion === Se) return _e(J, Fe), et; } else Fe.uniforms = O6.getUniforms(J), J.onBuild(Fe, u6), J.onBeforeCompile(Fe, u6), et = O6.acquireProgram(Fe, Ge), je.set(Ge, et), we.uniforms = Fe.uniforms; const Ye = we.uniforms; (!J.isShaderMaterial && !J.isRawShaderMaterial || J.clipping === true) && (Ye.clippingPlanes = fe.uniform), _e(J, Fe), we.needsLights = ht(J), we.lightsStateVersion = Se, we.needsLights && (Ye.ambientLightColor.value = Le.state.ambient, Ye.lightProbe.value = Le.state.probe, Ye.directionalLights.value = Le.state.directional, Ye.directionalLightShadows.value = Le.state.directionalShadow, Ye.spotLights.value = Le.state.spot, Ye.spotLightShadows.value = Le.state.spotShadow, Ye.rectAreaLights.value = Le.state.rectArea, Ye.ltc_1.value = Le.state.rectAreaLTC1, Ye.ltc_2.value = Le.state.rectAreaLTC2, Ye.pointLights.value = Le.state.point, Ye.pointLightShadows.value = Le.state.pointShadow, Ye.hemisphereLights.value = Le.state.hemi, Ye.directionalShadowMap.value = Le.state.directionalShadowMap, Ye.directionalShadowMatrix.value = Le.state.directionalShadowMatrix, Ye.spotShadowMap.value = Le.state.spotShadowMap, Ye.spotShadowMatrix.value = Le.state.spotShadowMatrix, Ye.pointShadowMap.value = Le.state.pointShadowMap, Ye.pointShadowMatrix.value = Le.state.pointShadowMatrix); const ft = et.getUniforms(), Vt = Or.seqWithValue(ft.seq, Ye); return we.currentProgram = et, we.uniformsList = Vt, et; } function _e(J, ye) { const pe = k6.get(J); pe.outputEncoding = ye.outputEncoding, pe.instancing = ye.instancing, pe.skinning = ye.skinning, pe.numClippingPlanes = ye.numClippingPlanes, pe.numIntersection = ye.numClipIntersection, pe.vertexAlphas = ye.vertexAlphas; } function Oe(J, ye, pe, we) { ye.isScene !== true && (ye = te), H6.resetTextureUnits(); const Le = ye.fog, ge = pe.isMeshStandardMaterial ? ye.environment : null, Se = x6 === null ? u6.outputEncoding : x6.texture.encoding, Fe = K.get(pe.envMap || ge), Ge = pe.vertexColors === true && we.geometry && we.geometry.attributes.color && we.geometry.attributes.color.itemSize === 4, je = k6.get(pe), et = f6.state.lights; if (N6 === true && (B6 === true || J !== A6)) { const Mn = J === A6 && pe.id === w6; fe.setState(pe, J, Mn); } let Ye = false; pe.version === je.__version ? (je.needsLights && je.lightsStateVersion !== et.state.version || je.outputEncoding !== Se || we.isInstancedMesh && je.instancing === false || !we.isInstancedMesh && je.instancing === true || we.isSkinnedMesh && je.skinning === false || !we.isSkinnedMesh && je.skinning === true || je.envMap !== Fe || pe.fog && je.fog !== Le || je.numClippingPlanes !== void 0 && (je.numClippingPlanes !== fe.numPlanes || je.numIntersection !== fe.numIntersection) || je.vertexAlphas !== Ge) && (Ye = true) : (Ye = true, je.__version = pe.version); let ft = je.currentProgram; Ye === true && (ft = Q(pe, ye, we)); let Vt = false, ln2 = false, ns = false; const Tt = ft.getUniforms(), is = je.uniforms; if (j6.useProgram(ft.program) && (Vt = true, ln2 = true, ns = true), pe.id !== w6 && (w6 = pe.id, ln2 = true), Vt || A6 !== J) { if (Tt.setValue(ie, "projectionMatrix", J.projectionMatrix), $6.logarithmicDepthBuffer && Tt.setValue( ie, "logDepthBufFC", 2 / (Math.log(J.far + 1) / Math.LN2) ), A6 !== J && (A6 = J, ln2 = true, ns = true), pe.isShaderMaterial || pe.isMeshPhongMaterial || pe.isMeshToonMaterial || pe.isMeshStandardMaterial || pe.envMap) { const Mn = Tt.map.cameraPosition; Mn !== void 0 && Mn.setValue( ie, Y.setFromMatrixPosition(J.matrixWorld) ); } (pe.isMeshPhongMaterial || pe.isMeshToonMaterial || pe.isMeshLambertMaterial || pe.isMeshBasicMaterial || pe.isMeshStandardMaterial || pe.isShaderMaterial) && Tt.setValue(ie, "isOrthographic", J.isOrthographicCamera === true), (pe.isMeshPhongMaterial || pe.isMeshToonMaterial || pe.isMeshLambertMaterial || pe.isMeshBasicMaterial || pe.isMeshStandardMaterial || pe.isShaderMaterial || pe.isShadowMaterial || we.isSkinnedMesh) && Tt.setValue(ie, "viewMatrix", J.matrixWorldInverse); } if (we.isSkinnedMesh) { Tt.setOptional(ie, we, "bindMatrix"), Tt.setOptional(ie, we, "bindMatrixInverse"); const Mn = we.skeleton; Mn && ($6.floatVertexTextures ? (Mn.boneTexture === null && Mn.computeBoneTexture(), Tt.setValue(ie, "boneTexture", Mn.boneTexture, H6), Tt.setValue(ie, "boneTextureSize", Mn.boneTextureSize)) : Tt.setOptional(ie, Mn, "boneMatrices")); } return (ln2 || je.receiveShadow !== we.receiveShadow) && (je.receiveShadow = we.receiveShadow, Tt.setValue(ie, "receiveShadow", we.receiveShadow)), ln2 && (Tt.setValue(ie, "toneMappingExposure", u6.toneMappingExposure), je.needsLights && Ze(is, ns), Le && pe.fog && Z6.refreshFogUniforms(is, Le), Z6.refreshMaterialUniforms(is, pe, _6, P6, U6), Or.upload(ie, je.uniformsList, is, H6)), pe.isShaderMaterial && pe.uniformsNeedUpdate === true && (Or.upload(ie, je.uniformsList, is, H6), pe.uniformsNeedUpdate = false), pe.isSpriteMaterial && Tt.setValue(ie, "center", we.center), Tt.setValue(ie, "modelViewMatrix", we.modelViewMatrix), Tt.setValue(ie, "normalMatrix", we.normalMatrix), Tt.setValue(ie, "modelMatrix", we.matrixWorld), ft; } function Ze(J, ye) { J.ambientLightColor.needsUpdate = ye, J.lightProbe.needsUpdate = ye, J.directionalLights.needsUpdate = ye, J.directionalLightShadows.needsUpdate = ye, J.pointLights.needsUpdate = ye, J.pointLightShadows.needsUpdate = ye, J.spotLights.needsUpdate = ye, J.spotLightShadows.needsUpdate = ye, J.rectAreaLights.needsUpdate = ye, J.hemisphereLights.needsUpdate = ye; } function ht(J) { return J.isMeshLambertMaterial || J.isMeshToonMaterial || J.isMeshPhongMaterial || J.isMeshStandardMaterial || J.isShadowMaterial || J.isShaderMaterial && J.lights === true; } this.getActiveCubeFace = function() { return v6; }, this.getActiveMipmapLevel = function() { return m6; }, this.getRenderTarget = function() { return x6; }, this.setRenderTarget = function(J, ye = 0, pe = 0) { x6 = J, v6 = ye, m6 = pe, J && k6.get(J).__webglFramebuffer === void 0 && H6.setupRenderTarget(J); let we = null, Le = false, ge = false; if (J) { const Fe = J.texture; (Fe.isDataTexture3D || Fe.isDataTexture2DArray) && (ge = true); const Ge = k6.get(J).__webglFramebuffer; J.isWebGLCubeRenderTarget ? (we = Ge[ye], Le = true) : J.isWebGLMultisampleRenderTarget ? we = k6.get(J).__webglMultisampledFramebuffer : we = Ge, M6.copy(J.viewport), R6.copy(J.scissor), L6 = J.scissorTest; } else M6.copy(C6).multiplyScalar(_6).floor(), R6.copy(I6).multiplyScalar(_6).floor(), L6 = b6; if (j6.bindFramebuffer(36160, we) && $6.drawBuffers) { let Fe = false; if (J) if (J.isWebGLMultipleRenderTargets) { const Ge = J.texture; if (F6.length !== Ge.length || F6[0] !== 36064) { for (let je = 0, et = Ge.length; je < et; je++) F6[je] = 36064 + je; F6.length = Ge.length, Fe = true; } } else (F6.length !== 1 || F6[0] !== 36064) && (F6[0] = 36064, F6.length = 1, Fe = true); else (F6.length !== 1 || F6[0] !== 1029) && (F6[0] = 1029, F6.length = 1, Fe = true); Fe && ($6.isWebGL2 ? ie.drawBuffers(F6) : W6.get("WEBGL_draw_buffers").drawBuffersWEBGL(F6)); } if (j6.viewport(M6), j6.scissor(R6), j6.setScissorTest(L6), Le) { const Fe = k6.get(J.texture); ie.framebufferTexture2D(36160, 36064, 34069 + ye, Fe.__webglTexture, pe); } else if (ge) { const Fe = k6.get(J.texture), Ge = ye || 0; ie.framebufferTextureLayer(36160, 36064, Fe.__webglTexture, pe || 0, Ge); } }, this.readRenderTargetPixels = function(J, ye, pe, we, Le, ge, Se) { if (!(J && J.isWebGLRenderTarget)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); return; } let Fe = k6.get(J).__webglFramebuffer; if (J.isWebGLCubeRenderTarget && Se !== void 0 && (Fe = Fe[Se]), Fe) { j6.bindFramebuffer(36160, Fe); try { const Ge = J.texture, je = Ge.format, et = Ge.type; if (je !== Hn && me.convert(je) !== ie.getParameter(35739)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); return; } const Ye = et === Ms && (W6.has("EXT_color_buffer_half_float") || $6.isWebGL2 && W6.has("EXT_color_buffer_float")); if (et !== Ts && me.convert(et) !== ie.getParameter(35738) && // Edge and Chrome Mac < 52 (#9513) !(et === Qi && ($6.isWebGL2 || W6.has("OES_texture_float") || W6.has("WEBGL_color_buffer_float"))) && // Chrome Mac >= 52 and Firefox !Ye) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); return; } ie.checkFramebufferStatus(36160) === 36053 ? ye >= 0 && ye <= J.width - we && pe >= 0 && pe <= J.height - Le && ie.readPixels(ye, pe, we, Le, me.convert(je), me.convert(et), ge) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."); } finally { const Ge = x6 !== null ? k6.get(x6).__webglFramebuffer : null; j6.bindFramebuffer(36160, Ge); } } }, this.copyFramebufferToTexture = function(J, ye, pe = 0) { const we = Math.pow(2, -pe), Le = Math.floor(ye.image.width * we), ge = Math.floor(ye.image.height * we); let Se = me.convert(ye.format); $6.isWebGL2 && (Se === 6407 && (Se = 32849), Se === 6408 && (Se = 32856)), H6.setTexture2D(ye, 0), ie.copyTexImage2D(3553, pe, Se, J.x, J.y, Le, ge, 0), j6.unbindTexture(); }, this.copyTextureToTexture = function(J, ye, pe, we = 0) { const Le = ye.image.width, ge = ye.image.height, Se = me.convert(pe.format), Fe = me.convert(pe.type); H6.setTexture2D(pe, 0), ie.pixelStorei(37440, pe.flipY), ie.pixelStorei(37441, pe.premultiplyAlpha), ie.pixelStorei(3317, pe.unpackAlignment), ye.isDataTexture ? ie.texSubImage2D(3553, we, J.x, J.y, Le, ge, Se, Fe, ye.image.data) : ye.isCompressedTexture ? ie.compressedTexSubImage2D(3553, we, J.x, J.y, ye.mipmaps[0].width, ye.mipmaps[0].height, Se, ye.mipmaps[0].data) : ie.texSubImage2D(3553, we, J.x, J.y, Se, Fe, ye.image), we === 0 && pe.generateMipmaps && ie.generateMipmap(3553), j6.unbindTexture(); }, this.copyTextureToTexture3D = function(J, ye, pe, we, Le = 0) { if (u6.isWebGL1Renderer) { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2."); return; } const ge = J.max.x - J.min.x + 1, Se = J.max.y - J.min.y + 1, Fe = J.max.z - J.min.z + 1, Ge = me.convert(we.format), je = me.convert(we.type); let et; if (we.isDataTexture3D) H6.setTexture3D(we, 0), et = 32879; else if (we.isDataTexture2DArray) H6.setTexture2DArray(we, 0), et = 35866; else { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray."); return; } ie.pixelStorei(37440, we.flipY), ie.pixelStorei(37441, we.premultiplyAlpha), ie.pixelStorei(3317, we.unpackAlignment); const Ye = ie.getParameter(3314), ft = ie.getParameter(32878), Vt = ie.getParameter(3316), ln2 = ie.getParameter(3315), ns = ie.getParameter(32877), Tt = pe.isCompressedTexture ? pe.mipmaps[0] : pe.image; ie.pixelStorei(3314, Tt.width), ie.pixelStorei(32878, Tt.height), ie.pixelStorei(3316, J.min.x), ie.pixelStorei(3315, J.min.y), ie.pixelStorei(32877, J.min.z), pe.isDataTexture || pe.isDataTexture3D ? ie.texSubImage3D(et, Le, ye.x, ye.y, ye.z, ge, Se, Fe, Ge, je, Tt.data) : pe.isCompressedTexture ? (console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."), ie.compressedTexSubImage3D(et, Le, ye.x, ye.y, ye.z, ge, Se, Fe, Ge, Tt.data)) : ie.texSubImage3D(et, Le, ye.x, ye.y, ye.z, ge, Se, Fe, Ge, je, Tt), ie.pixelStorei(3314, Ye), ie.pixelStorei(32878, ft), ie.pixelStorei(3316, Vt), ie.pixelStorei(3315, ln2), ie.pixelStorei(32877, ns), Le === 0 && we.generateMipmaps && ie.generateMipmap(et), j6.unbindTexture(); }, this.initTexture = function(J) { H6.setTexture2D(J, 0), j6.unbindTexture(); }, this.resetState = function() { v6 = 0, m6 = 0, x6 = null, j6.reset(), Me.reset(); }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } var Ax = class extends wt { }; Ax.prototype.isWebGL1Renderer = true; var fl = class _fl { constructor(e, t = 25e-5) { this.name = "", this.color = new Ue(e), this.density = t; } clone() { return new _fl(this.color, this.density); } toJSON() { return { type: "FogExp2", color: this.color.getHex(), density: this.density }; } }; fl.prototype.isFogExp2 = true; var pl = class _pl { constructor(e, t = 1, i = 1e3) { this.name = "", this.color = new Ue(e), this.near = t, this.far = i; } clone() { return new _pl(this.color, this.near, this.far); } toJSON() { return { type: "Fog", color: this.color.getHex(), near: this.near, far: this.far }; } }; pl.prototype.isFog = true; var wu = class extends ut { constructor() { super(), this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.overrideMaterial = null, this.autoUpdate = true, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } copy(e, t) { return super.copy(e, t), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.autoUpdate = e.autoUpdate, this.matrixAutoUpdate = e.matrixAutoUpdate, this; } toJSON(e) { const t = super.toJSON(e); return this.fog !== null && (t.object.fog = this.fog.toJSON()), t; } }; wu.prototype.isScene = true; var Qr = class { constructor(e, t) { this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = Ro, this.updateRange = { offset: 0, count: -1 }, this.version = 0, this.uuid = Wn(); } onUploadCallback() { } set needsUpdate(e) { e === true && this.version++; } setUsage(e) { return this.usage = e, this; } copy(e) { return this.array = new e.array.constructor(e.array), this.count = e.count, this.stride = e.stride, this.usage = e.usage, this; } copyAt(e, t, i) { e *= this.stride, i *= t.stride; for (let r = 0, s = this.stride; r < s; r++) this.array[e + r] = t.array[i + r]; return this; } set(e, t = 0) { return this.array.set(e, t), this; } clone(e) { e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = Wn()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer); const t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), i = new this.constructor(t, this.stride); return i.setUsage(this.usage), i; } onUpload(e) { return this.onUploadCallback = e, this; } toJSON(e) { return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = Wn()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call(new Uint32Array(this.array.buffer))), { uuid: this.uuid, buffer: this.array.buffer._uuid, type: this.array.constructor.name, stride: this.stride }; } }; Qr.prototype.isInterleavedBuffer = true; var Gt = new q4(); var lr = class _lr { constructor(e, t, i, r = false) { this.name = "", this.data = e, this.itemSize = t, this.offset = i, this.normalized = r === true; } get count() { return this.data.count; } get array() { return this.data.array; } set needsUpdate(e) { this.data.needsUpdate = e; } applyMatrix4(e) { for (let t = 0, i = this.data.count; t < i; t++) Gt.x = this.getX(t), Gt.y = this.getY(t), Gt.z = this.getZ(t), Gt.applyMatrix4(e), this.setXYZ(t, Gt.x, Gt.y, Gt.z); return this; } applyNormalMatrix(e) { for (let t = 0, i = this.count; t < i; t++) Gt.x = this.getX(t), Gt.y = this.getY(t), Gt.z = this.getZ(t), Gt.applyNormalMatrix(e), this.setXYZ(t, Gt.x, Gt.y, Gt.z); return this; } transformDirection(e) { for (let t = 0, i = this.count; t < i; t++) Gt.x = this.getX(t), Gt.y = this.getY(t), Gt.z = this.getZ(t), Gt.transformDirection(e), this.setXYZ(t, Gt.x, Gt.y, Gt.z); return this; } setX(e, t) { return this.data.array[e * this.data.stride + this.offset] = t, this; } setY(e, t) { return this.data.array[e * this.data.stride + this.offset + 1] = t, this; } setZ(e, t) { return this.data.array[e * this.data.stride + this.offset + 2] = t, this; } setW(e, t) { return this.data.array[e * this.data.stride + this.offset + 3] = t, this; } getX(e) { return this.data.array[e * this.data.stride + this.offset]; } getY(e) { return this.data.array[e * this.data.stride + this.offset + 1]; } getZ(e) { return this.data.array[e * this.data.stride + this.offset + 2]; } getW(e) { return this.data.array[e * this.data.stride + this.offset + 3]; } setXY(e, t, i) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = i, this; } setXYZ(e, t, i, r) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = r, this; } setXYZW(e, t, i, r, s) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = r, this.data.array[e + 3] = s, this; } clone(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data."); const t = []; for (let i = 0; i < this.count; i++) { const r = i * this.data.stride + this.offset; for (let s = 0; s < this.itemSize; s++) t.push(this.data.array[r + s]); } return new ot(new this.array.constructor(t), this.itemSize, this.normalized); } else return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)), new _lr(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized); } toJSON(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data."); const t = []; for (let i = 0; i < this.count; i++) { const r = i * this.data.stride + this.offset; for (let s = 0; s < this.itemSize; s++) t.push(this.data.array[r + s]); } return { itemSize: this.itemSize, type: this.array.constructor.name, array: t, normalized: this.normalized }; } else return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)), { isInterleavedBufferAttribute: true, itemSize: this.itemSize, data: this.data.uuid, offset: this.offset, normalized: this.normalized }; } }; lr.prototype.isInterleavedBufferAttribute = true; var ml = class extends tn2 { constructor(e) { super(), this.type = "SpriteMaterial", this.color = new Ue(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = true, this.transparent = true, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.rotation = e.rotation, this.sizeAttenuation = e.sizeAttenuation, this; } }; ml.prototype.isSpriteMaterial = true; var ro; var ga = new q4(); var so = new q4(); var oo = new q4(); var ao = new Re(); var va = new Re(); var Sx = new Xe(); var Kl = new q4(); var ya = new q4(); var ql = new q4(); var yg = new Re(); var vh = new Re(); var bg = new Re(); var gl = class extends ut { constructor(e) { if (super(), this.type = "Sprite", ro === void 0) { ro = new Ke(); const t = new Float32Array([ -0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1 ]), i = new Qr(t, 5); ro.setIndex([0, 1, 2, 0, 2, 3]), ro.setAttribute("position", new lr(i, 3, 0, false)), ro.setAttribute("uv", new lr(i, 2, 3, false)); } this.geometry = ro, this.material = e !== void 0 ? e : new ml(), this.center = new Re(0.5, 0.5); } raycast(e, t) { e.camera === null && console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'), so.setFromMatrixScale(this.matrixWorld), Sx.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), oo.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === false && so.multiplyScalar(-oo.z); const i = this.material.rotation; let r, s; i !== 0 && (s = Math.cos(i), r = Math.sin(i)); const o = this.center; Ql(Kl.set(-0.5, -0.5, 0), oo, o, so, r, s), Ql(ya.set(0.5, -0.5, 0), oo, o, so, r, s), Ql(ql.set(0.5, 0.5, 0), oo, o, so, r, s), yg.set(0, 0), vh.set(1, 0), bg.set(1, 1); let a6 = e.ray.intersectTriangle(Kl, ya, ql, false, ga); if (a6 === null && (Ql(ya.set(-0.5, 0.5, 0), oo, o, so, r, s), vh.set(0, 1), a6 = e.ray.intersectTriangle(Kl, ql, ya, false, ga), a6 === null)) return; const c = e.ray.origin.distanceTo(ga); c < e.near || c > e.far || t.push({ distance: c, point: ga.clone(), uv: Zt.getUV(ga, Kl, ya, ql, yg, vh, bg, new Re()), face: null, object: this }); } copy(e) { return super.copy(e), e.center !== void 0 && this.center.copy(e.center), this.material = e.material, this; } }; gl.prototype.isSprite = true; function Ql(n, e, t, i, r, s) { ao.subVectors(n, t).addScalar(0.5).multiply(i), r !== void 0 ? (va.x = s * ao.x - r * ao.y, va.y = r * ao.x + s * ao.y) : va.copy(ao), n.copy(e), n.x += va.x, n.y += va.y, n.applyMatrix4(Sx); } var ec = new q4(); var xg = new q4(); var _x = class extends ut { constructor() { super(), this._currentLevel = 0, this.type = "LOD", Object.defineProperties(this, { levels: { enumerable: true, value: [] }, isLOD: { value: true } }), this.autoUpdate = true; } copy(e) { super.copy(e, false); const t = e.levels; for (let i = 0, r = t.length; i < r; i++) { const s = t[i]; this.addLevel(s.object.clone(), s.distance); } return this.autoUpdate = e.autoUpdate, this; } addLevel(e, t = 0) { t = Math.abs(t); const i = this.levels; let r; for (r = 0; r < i.length && !(t < i[r].distance); r++) ; return i.splice(r, 0, { distance: t, object: e }), this.add(e), this; } getCurrentLevel() { return this._currentLevel; } getObjectForDistance(e) { const t = this.levels; if (t.length > 0) { let i, r; for (i = 1, r = t.length; i < r && !(e < t[i].distance); i++) ; return t[i - 1].object; } return null; } raycast(e, t) { if (this.levels.length > 0) { ec.setFromMatrixPosition(this.matrixWorld); const r = e.ray.origin.distanceTo(ec); this.getObjectForDistance(r).raycast(e, t); } } update(e) { const t = this.levels; if (t.length > 1) { ec.setFromMatrixPosition(e.matrixWorld), xg.setFromMatrixPosition(this.matrixWorld); const i = ec.distanceTo(xg) / e.zoom; t[0].object.visible = true; let r, s; for (r = 1, s = t.length; r < s && i >= t[r].distance; r++) t[r - 1].object.visible = false, t[r].object.visible = true; for (this._currentLevel = r - 1; r < s; r++) t[r].object.visible = false; } } toJSON(e) { const t = super.toJSON(e); this.autoUpdate === false && (t.object.autoUpdate = false), t.object.levels = []; const i = this.levels; for (let r = 0, s = i.length; r < s; r++) { const o = i[r]; t.object.levels.push({ object: o.object.uuid, distance: o.distance }); } return t; } }; var Mg = new q4(); var wg = new xt(); var Ag = new xt(); var BD = new q4(); var Sg = new Xe(); var vl = class extends Xt { constructor(e, t) { super(e, t), this.type = "SkinnedMesh", this.bindMode = "attached", this.bindMatrix = new Xe(), this.bindMatrixInverse = new Xe(); } copy(e) { return super.copy(e), this.bindMode = e.bindMode, this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), this.skeleton = e.skeleton, this; } bind(e, t) { this.skeleton = e, t === void 0 && (this.updateMatrixWorld(true), this.skeleton.calculateInverses(), t = this.matrixWorld), this.bindMatrix.copy(t), this.bindMatrixInverse.copy(t).invert(); } pose() { this.skeleton.pose(); } normalizeSkinWeights() { const e = new xt(), t = this.geometry.attributes.skinWeight; for (let i = 0, r = t.count; i < r; i++) { e.x = t.getX(i), e.y = t.getY(i), e.z = t.getZ(i), e.w = t.getW(i); const s = 1 / e.manhattanLength(); s !== 1 / 0 ? e.multiplyScalar(s) : e.set(1, 0, 0, 0), t.setXYZW(i, e.x, e.y, e.z, e.w); } } updateMatrixWorld(e) { super.updateMatrixWorld(e), this.bindMode === "attached" ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === "detached" ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode); } boneTransform(e, t) { const i = this.skeleton, r = this.geometry; wg.fromBufferAttribute(r.attributes.skinIndex, e), Ag.fromBufferAttribute(r.attributes.skinWeight, e), Mg.fromBufferAttribute(r.attributes.position, e).applyMatrix4(this.bindMatrix), t.set(0, 0, 0); for (let s = 0; s < 4; s++) { const o = Ag.getComponent(s); if (o !== 0) { const a6 = wg.getComponent(s); Sg.multiplyMatrices(i.bones[a6].matrixWorld, i.boneInverses[a6]), t.addScaledVector(BD.copy(Mg).applyMatrix4(Sg), o); } } return t.applyMatrix4(this.bindMatrixInverse); } }; vl.prototype.isSkinnedMesh = true; var yl = class extends ut { constructor() { super(), this.type = "Bone"; } }; yl.prototype.isBone = true; var Ss = class extends Yt { constructor(e = null, t = 1, i = 1, r, s, o, a6, c, l = $t, d = $t, h6, f6) { super(null, o, a6, c, l, d, r, s, h6, f6), this.image = { data: e, width: t, height: i }, this.magFilter = l, this.minFilter = d, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.needsUpdate = true; } }; Ss.prototype.isDataTexture = true; var _g = new Xe(); var UD = new Xe(); var bl = class _bl { constructor(e = [], t = []) { this.uuid = Wn(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.boneTextureSize = 0, this.frame = -1, this.init(); } init() { const e = this.bones, t = this.boneInverses; if (this.boneMatrices = new Float32Array(e.length * 16), t.length === 0) this.calculateInverses(); else if (e.length !== t.length) { console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."), this.boneInverses = []; for (let i = 0, r = this.bones.length; i < r; i++) this.boneInverses.push(new Xe()); } } calculateInverses() { this.boneInverses.length = 0; for (let e = 0, t = this.bones.length; e < t; e++) { const i = new Xe(); this.bones[e] && i.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(i); } } pose() { for (let e = 0, t = this.bones.length; e < t; e++) { const i = this.bones[e]; i && i.matrixWorld.copy(this.boneInverses[e]).invert(); } for (let e = 0, t = this.bones.length; e < t; e++) { const i = this.bones[e]; i && (i.parent && i.parent.isBone ? (i.matrix.copy(i.parent.matrixWorld).invert(), i.matrix.multiply(i.matrixWorld)) : i.matrix.copy(i.matrixWorld), i.matrix.decompose(i.position, i.quaternion, i.scale)); } } update() { const e = this.bones, t = this.boneInverses, i = this.boneMatrices, r = this.boneTexture; for (let s = 0, o = e.length; s < o; s++) { const a6 = e[s] ? e[s].matrixWorld : UD; _g.multiplyMatrices(a6, t[s]), _g.toArray(i, s * 16); } r !== null && (r.needsUpdate = true); } clone() { return new _bl(this.bones, this.boneInverses); } computeBoneTexture() { let e = Math.sqrt(this.bones.length * 4); e = ex(e), e = Math.max(e, 4); const t = new Float32Array(e * e * 4); t.set(this.boneMatrices); const i = new Ss(t, e, e, Hn, Qi); return this.boneMatrices = t, this.boneTexture = i, this.boneTextureSize = e, this; } getBoneByName(e) { for (let t = 0, i = this.bones.length; t < i; t++) { const r = this.bones[t]; if (r.name === e) return r; } } dispose() { this.boneTexture !== null && (this.boneTexture.dispose(), this.boneTexture = null); } fromJSON(e, t) { this.uuid = e.uuid; for (let i = 0, r = e.bones.length; i < r; i++) { const s = e.bones[i]; let o = t[s]; o === void 0 && (console.warn("THREE.Skeleton: No bone found with UUID:", s), o = new yl()), this.bones.push(o), this.boneInverses.push(new Xe().fromArray(e.boneInverses[i])); } return this.init(), this; } toJSON() { const e = { metadata: { version: 4.5, type: "Skeleton", generator: "Skeleton.toJSON" }, bones: [], boneInverses: [] }; e.uuid = this.uuid; const t = this.bones, i = this.boneInverses; for (let r = 0, s = t.length; r < s; r++) { const o = t[r]; e.bones.push(o.uuid); const a6 = i[r]; e.boneInverses.push(a6.toArray()); } return e; } }; var Tg = new Xe(); var Eg = new Xe(); var tc = []; var ba = new Xt(); var Pf = class extends Xt { constructor(e, t, i) { super(e, t), this.instanceMatrix = new ot(new Float32Array(i * 16), 16), this.instanceColor = null, this.count = i, this.frustumCulled = false; } copy(e) { return super.copy(e), this.instanceMatrix.copy(e.instanceMatrix), e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()), this.count = e.count, this; } getColorAt(e, t) { t.fromArray(this.instanceColor.array, e * 3); } getMatrixAt(e, t) { t.fromArray(this.instanceMatrix.array, e * 16); } raycast(e, t) { const i = this.matrixWorld, r = this.count; if (ba.geometry = this.geometry, ba.material = this.material, ba.material !== void 0) for (let s = 0; s < r; s++) { this.getMatrixAt(s, Tg), Eg.multiplyMatrices(i, Tg), ba.matrixWorld = Eg, ba.raycast(e, tc); for (let o = 0, a6 = tc.length; o < a6; o++) { const c = tc[o]; c.instanceId = s, c.object = this, t.push(c); } tc.length = 0; } } setColorAt(e, t) { this.instanceColor === null && (this.instanceColor = new ot(new Float32Array(this.count * 3), 3)), t.toArray(this.instanceColor.array, e * 3); } setMatrixAt(e, t) { t.toArray(this.instanceMatrix.array, e * 16); } updateMorphTargets() { } dispose() { this.dispatchEvent({ type: "dispose" }); } }; Pf.prototype.isInstancedMesh = true; var an2 = class extends tn2 { constructor(e) { super(), this.type = "LineBasicMaterial", this.color = new Ue(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.morphTargets = false, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.morphTargets = e.morphTargets, this; } }; an2.prototype.isLineBasicMaterial = true; var Cg = new q4(); var Lg = new q4(); var Rg = new Xe(); var yh = new qr(); var nc = new mr(); var Oi = class extends ut { constructor(e = new Ke(), t = new an2()) { super(), this.type = "Line", this.geometry = e, this.material = t, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const t = e.attributes.position, i = [0]; for (let r = 1, s = t.count; r < s; r++) Cg.fromBufferAttribute(t, r - 1), Lg.fromBufferAttribute(t, r), i[r] = i[r - 1], i[r] += Cg.distanceTo(Lg); e.setAttribute("lineDistance", new We(i, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else e.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return this; } raycast(e, t) { const i = this.geometry, r = this.matrixWorld, s = e.params.Line.threshold, o = i.drawRange; if (i.boundingSphere === null && i.computeBoundingSphere(), nc.copy(i.boundingSphere), nc.applyMatrix4(r), nc.radius += s, e.ray.intersectsSphere(nc) === false) return; Rg.copy(r).invert(), yh.copy(e.ray).applyMatrix4(Rg); const a6 = s / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = a6 * a6, l = new q4(), d = new q4(), h6 = new q4(), f6 = new q4(), g6 = this.isLineSegments ? 2 : 1; if (i.isBufferGeometry) { const p = i.index, y6 = i.attributes.position; if (p !== null) { const v6 = Math.max(0, o.start), m6 = Math.min(p.count, o.start + o.count); for (let x6 = v6, w6 = m6 - 1; x6 < w6; x6 += g6) { const A6 = p.getX(x6), M6 = p.getX(x6 + 1); if (l.fromBufferAttribute(y6, A6), d.fromBufferAttribute(y6, M6), yh.distanceSqToSegment(l, d, f6, h6) > c) continue; f6.applyMatrix4(this.matrixWorld); const L6 = e.ray.origin.distanceTo(f6); L6 < e.near || L6 > e.far || t.push({ distance: L6, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: h6.clone().applyMatrix4(this.matrixWorld), index: x6, face: null, faceIndex: null, object: this }); } } else { const v6 = Math.max(0, o.start), m6 = Math.min(y6.count, o.start + o.count); for (let x6 = v6, w6 = m6 - 1; x6 < w6; x6 += g6) { if (l.fromBufferAttribute(y6, x6), d.fromBufferAttribute(y6, x6 + 1), yh.distanceSqToSegment(l, d, f6, h6) > c) continue; f6.applyMatrix4(this.matrixWorld); const M6 = e.ray.origin.distanceTo(f6); M6 < e.near || M6 > e.far || t.push({ distance: M6, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: h6.clone().applyMatrix4(this.matrixWorld), index: x6, face: null, faceIndex: null, object: this }); } } } else i.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const t = e.morphAttributes, i = Object.keys(t); if (i.length > 0) { const r = t[i[0]]; if (r !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let s = 0, o = r.length; s < o; s++) { const a6 = r[s].name || String(s); this.morphTargetInfluences.push(0), this.morphTargetDictionary[a6] = s; } } } } else { const t = e.morphTargets; t !== void 0 && t.length > 0 && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } }; Oi.prototype.isLine = true; var Fg = new q4(); var Pg = new q4(); var Rn = class extends Oi { constructor(e, t) { super(e, t), this.type = "LineSegments"; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const t = e.attributes.position, i = []; for (let r = 0, s = t.count; r < s; r += 2) Fg.fromBufferAttribute(t, r), Pg.fromBufferAttribute(t, r + 1), i[r] = r === 0 ? 0 : i[r - 1], i[r + 1] = i[r] + Fg.distanceTo(Pg); e.setAttribute("lineDistance", new We(i, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else e.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return this; } }; Rn.prototype.isLineSegments = true; var Au = class extends Oi { constructor(e, t) { super(e, t), this.type = "LineLoop"; } }; Au.prototype.isLineLoop = true; var es = class extends tn2 { constructor(e) { super(), this.type = "PointsMaterial", this.color = new Ue(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = true, this.morphTargets = false, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.size = e.size, this.sizeAttenuation = e.sizeAttenuation, this.morphTargets = e.morphTargets, this; } }; es.prototype.isPointsMaterial = true; var Ig = new Xe(); var wd = new qr(); var ic = new mr(); var rc = new q4(); var ia = class extends ut { constructor(e = new Ke(), t = new es()) { super(), this.type = "Points", this.geometry = e, this.material = t, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } raycast(e, t) { const i = this.geometry, r = this.matrixWorld, s = e.params.Points.threshold, o = i.drawRange; if (i.boundingSphere === null && i.computeBoundingSphere(), ic.copy(i.boundingSphere), ic.applyMatrix4(r), ic.radius += s, e.ray.intersectsSphere(ic) === false) return; Ig.copy(r).invert(), wd.copy(e.ray).applyMatrix4(Ig); const a6 = s / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = a6 * a6; if (i.isBufferGeometry) { const l = i.index, h6 = i.attributes.position; if (l !== null) { const f6 = Math.max(0, o.start), g6 = Math.min(l.count, o.start + o.count); for (let p = f6, u6 = g6; p < u6; p++) { const y6 = l.getX(p); rc.fromBufferAttribute(h6, y6), Og(rc, y6, c, r, e, t, this); } } else { const f6 = Math.max(0, o.start), g6 = Math.min(h6.count, o.start + o.count); for (let p = f6, u6 = g6; p < u6; p++) rc.fromBufferAttribute(h6, p), Og(rc, p, c, r, e, t, this); } } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const t = e.morphAttributes, i = Object.keys(t); if (i.length > 0) { const r = t[i[0]]; if (r !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let s = 0, o = r.length; s < o; s++) { const a6 = r[s].name || String(s); this.morphTargetInfluences.push(0), this.morphTargetDictionary[a6] = s; } } } } else { const t = e.morphTargets; t !== void 0 && t.length > 0 && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } }; ia.prototype.isPoints = true; function Og(n, e, t, i, r, s, o) { const a6 = wd.distanceSqToPoint(n); if (a6 < t) { const c = new q4(); wd.closestPointToPoint(n, c), c.applyMatrix4(i); const l = r.ray.origin.distanceTo(c); if (l < r.near || l > r.far) return; s.push({ distance: l, distanceToRay: Math.sqrt(a6), point: c, index: e, face: null, object: o }); } } var Tx = class extends Yt { constructor(e, t, i, r, s, o, a6, c, l) { super(e, t, i, r, s, o, a6, c, l), this.format = a6 !== void 0 ? a6 : ir, this.minFilter = o !== void 0 ? o : zt, this.magFilter = s !== void 0 ? s : zt, this.generateMipmaps = false; const d = this; function h6() { d.needsUpdate = true, e.requestVideoFrameCallback(h6); } "requestVideoFrameCallback" in e && e.requestVideoFrameCallback(h6); } clone() { return new this.constructor(this.image).copy(this); } update() { const e = this.image; "requestVideoFrameCallback" in e === false && e.readyState >= e.HAVE_CURRENT_DATA && (this.needsUpdate = true); } }; Tx.prototype.isVideoTexture = true; var If = class extends Yt { constructor(e, t, i, r, s, o, a6, c, l, d, h6, f6) { super(null, o, a6, c, l, d, r, s, h6, f6), this.image = { width: t, height: i }, this.mipmaps = e, this.flipY = false, this.generateMipmaps = false; } }; If.prototype.isCompressedTexture = true; var Ex = class extends Yt { constructor(e, t, i, r, s, o, a6, c, l) { super(e, t, i, r, s, o, a6, c, l), this.needsUpdate = true; } }; Ex.prototype.isCanvasTexture = true; var Cx = class extends Yt { constructor(e, t, i, r, s, o, a6, c, l, d) { if (d = d !== void 0 ? d : ws, d !== ws && d !== Co) throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); i === void 0 && d === ws && (i = Ha), i === void 0 && d === Co && (i = yo), super(null, r, s, o, a6, c, d, i, l), this.image = { width: e, height: t }, this.magFilter = a6 !== void 0 ? a6 : $t, this.minFilter = c !== void 0 ? c : $t, this.flipY = false, this.generateMipmaps = false; } }; Cx.prototype.isDepthTexture = true; var Io = class _Io extends Ke { constructor(e = 1, t = 8, i = 0, r = Math.PI * 2) { super(), this.type = "CircleGeometry", this.parameters = { radius: e, segments: t, thetaStart: i, thetaLength: r }, t = Math.max(3, t); const s = [], o = [], a6 = [], c = [], l = new q4(), d = new Re(); o.push(0, 0, 0), a6.push(0, 0, 1), c.push(0.5, 0.5); for (let h6 = 0, f6 = 3; h6 <= t; h6++, f6 += 3) { const g6 = i + h6 / t * r; l.x = e * Math.cos(g6), l.y = e * Math.sin(g6), o.push(l.x, l.y, l.z), a6.push(0, 0, 1), d.x = (o[f6] / e + 1) / 2, d.y = (o[f6 + 1] / e + 1) / 2, c.push(d.x, d.y); } for (let h6 = 1; h6 <= t; h6++) s.push(h6, h6 + 1, 0); this.setIndex(s), this.setAttribute("position", new We(o, 3)), this.setAttribute("normal", new We(a6, 3)), this.setAttribute("uv", new We(c, 2)); } static fromJSON(e) { return new _Io(e.radius, e.segments, e.thetaStart, e.thetaLength); } }; var $r = class _$r extends Ke { constructor(e = 1, t = 1, i = 1, r = 8, s = 1, o = false, a6 = 0, c = Math.PI * 2) { super(), this.type = "CylinderGeometry", this.parameters = { radiusTop: e, radiusBottom: t, height: i, radialSegments: r, heightSegments: s, openEnded: o, thetaStart: a6, thetaLength: c }; const l = this; r = Math.floor(r), s = Math.floor(s); const d = [], h6 = [], f6 = [], g6 = []; let p = 0; const u6 = [], y6 = i / 2; let v6 = 0; m6(), o === false && (e > 0 && x6(true), t > 0 && x6(false)), this.setIndex(d), this.setAttribute("position", new We(h6, 3)), this.setAttribute("normal", new We(f6, 3)), this.setAttribute("uv", new We(g6, 2)); function m6() { const w6 = new q4(), A6 = new q4(); let M6 = 0; const R6 = (t - e) / i; for (let L6 = 0; L6 <= s; L6++) { const T6 = [], P6 = L6 / s, _6 = P6 * (t - e) + e; for (let S6 = 0; S6 <= r; S6++) { const E6 = S6 / r, C6 = E6 * c + a6, I6 = Math.sin(C6), b6 = Math.cos(C6); A6.x = _6 * I6, A6.y = -P6 * i + y6, A6.z = _6 * b6, h6.push(A6.x, A6.y, A6.z), w6.set(I6, R6, b6).normalize(), f6.push(w6.x, w6.y, w6.z), g6.push(E6, 1 - P6), T6.push(p++); } u6.push(T6); } for (let L6 = 0; L6 < r; L6++) for (let T6 = 0; T6 < s; T6++) { const P6 = u6[T6][L6], _6 = u6[T6 + 1][L6], S6 = u6[T6 + 1][L6 + 1], E6 = u6[T6][L6 + 1]; d.push(P6, _6, E6), d.push(_6, S6, E6), M6 += 6; } l.addGroup(v6, M6, 0), v6 += M6; } function x6(w6) { const A6 = p, M6 = new Re(), R6 = new q4(); let L6 = 0; const T6 = w6 === true ? e : t, P6 = w6 === true ? 1 : -1; for (let S6 = 1; S6 <= r; S6++) h6.push(0, y6 * P6, 0), f6.push(0, P6, 0), g6.push(0.5, 0.5), p++; const _6 = p; for (let S6 = 0; S6 <= r; S6++) { const C6 = S6 / r * c + a6, I6 = Math.cos(C6), b6 = Math.sin(C6); R6.x = T6 * b6, R6.y = y6 * P6, R6.z = T6 * I6, h6.push(R6.x, R6.y, R6.z), f6.push(0, P6, 0), M6.x = I6 * 0.5 + 0.5, M6.y = b6 * 0.5 * P6 + 0.5, g6.push(M6.x, M6.y), p++; } for (let S6 = 0; S6 < r; S6++) { const E6 = A6 + S6, C6 = _6 + S6; w6 === true ? d.push(C6, C6 + 1, E6) : d.push(C6 + 1, C6, E6), L6 += 3; } l.addGroup(v6, L6, w6 === true ? 1 : 2), v6 += L6; } } static fromJSON(e) { return new _$r(e.radiusTop, e.radiusBottom, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } }; var Oo = class _Oo extends $r { constructor(e = 1, t = 1, i = 8, r = 1, s = false, o = 0, a6 = Math.PI * 2) { super(0, e, t, i, r, s, o, a6), this.type = "ConeGeometry", this.parameters = { radius: e, height: t, radialSegments: i, heightSegments: r, openEnded: s, thetaStart: o, thetaLength: a6 }; } static fromJSON(e) { return new _Oo(e.radius, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } }; var Di = class _Di extends Ke { constructor(e, t, i = 1, r = 0) { super(), this.type = "PolyhedronGeometry", this.parameters = { vertices: e, indices: t, radius: i, detail: r }; const s = [], o = []; a6(r), l(i), d(), this.setAttribute("position", new We(s, 3)), this.setAttribute("normal", new We(s.slice(), 3)), this.setAttribute("uv", new We(o, 2)), r === 0 ? this.computeVertexNormals() : this.normalizeNormals(); function a6(m6) { const x6 = new q4(), w6 = new q4(), A6 = new q4(); for (let M6 = 0; M6 < t.length; M6 += 3) g6(t[M6 + 0], x6), g6(t[M6 + 1], w6), g6(t[M6 + 2], A6), c(x6, w6, A6, m6); } function c(m6, x6, w6, A6) { const M6 = A6 + 1, R6 = []; for (let L6 = 0; L6 <= M6; L6++) { R6[L6] = []; const T6 = m6.clone().lerp(w6, L6 / M6), P6 = x6.clone().lerp(w6, L6 / M6), _6 = M6 - L6; for (let S6 = 0; S6 <= _6; S6++) S6 === 0 && L6 === M6 ? R6[L6][S6] = T6 : R6[L6][S6] = T6.clone().lerp(P6, S6 / _6); } for (let L6 = 0; L6 < M6; L6++) for (let T6 = 0; T6 < 2 * (M6 - L6) - 1; T6++) { const P6 = Math.floor(T6 / 2); T6 % 2 === 0 ? (f6(R6[L6][P6 + 1]), f6(R6[L6 + 1][P6]), f6(R6[L6][P6])) : (f6(R6[L6][P6 + 1]), f6(R6[L6 + 1][P6 + 1]), f6(R6[L6 + 1][P6])); } } function l(m6) { const x6 = new q4(); for (let w6 = 0; w6 < s.length; w6 += 3) x6.x = s[w6 + 0], x6.y = s[w6 + 1], x6.z = s[w6 + 2], x6.normalize().multiplyScalar(m6), s[w6 + 0] = x6.x, s[w6 + 1] = x6.y, s[w6 + 2] = x6.z; } function d() { const m6 = new q4(); for (let x6 = 0; x6 < s.length; x6 += 3) { m6.x = s[x6 + 0], m6.y = s[x6 + 1], m6.z = s[x6 + 2]; const w6 = y6(m6) / 2 / Math.PI + 0.5, A6 = v6(m6) / Math.PI + 0.5; o.push(w6, 1 - A6); } p(), h6(); } function h6() { for (let m6 = 0; m6 < o.length; m6 += 6) { const x6 = o[m6 + 0], w6 = o[m6 + 2], A6 = o[m6 + 4], M6 = Math.max(x6, w6, A6), R6 = Math.min(x6, w6, A6); M6 > 0.9 && R6 < 0.1 && (x6 < 0.2 && (o[m6 + 0] += 1), w6 < 0.2 && (o[m6 + 2] += 1), A6 < 0.2 && (o[m6 + 4] += 1)); } } function f6(m6) { s.push(m6.x, m6.y, m6.z); } function g6(m6, x6) { const w6 = m6 * 3; x6.x = e[w6 + 0], x6.y = e[w6 + 1], x6.z = e[w6 + 2]; } function p() { const m6 = new q4(), x6 = new q4(), w6 = new q4(), A6 = new q4(), M6 = new Re(), R6 = new Re(), L6 = new Re(); for (let T6 = 0, P6 = 0; T6 < s.length; T6 += 9, P6 += 6) { m6.set(s[T6 + 0], s[T6 + 1], s[T6 + 2]), x6.set(s[T6 + 3], s[T6 + 4], s[T6 + 5]), w6.set(s[T6 + 6], s[T6 + 7], s[T6 + 8]), M6.set(o[P6 + 0], o[P6 + 1]), R6.set(o[P6 + 2], o[P6 + 3]), L6.set(o[P6 + 4], o[P6 + 5]), A6.copy(m6).add(x6).add(w6).divideScalar(3); const _6 = y6(A6); u6(M6, P6 + 0, m6, _6), u6(R6, P6 + 2, x6, _6), u6(L6, P6 + 4, w6, _6); } } function u6(m6, x6, w6, A6) { A6 < 0 && m6.x === 1 && (o[x6] = m6.x - 1), w6.x === 0 && w6.z === 0 && (o[x6] = A6 / 2 / Math.PI + 0.5); } function y6(m6) { return Math.atan2(m6.z, -m6.x); } function v6(m6) { return Math.atan2(-m6.y, Math.sqrt(m6.x * m6.x + m6.z * m6.z)); } } static fromJSON(e) { return new _Di(e.vertices, e.indices, e.radius, e.details); } }; var Do = class _Do extends Di { constructor(e = 1, t = 0) { const i = (1 + Math.sqrt(5)) / 2, r = 1 / i, s = [ // (±1, ±1, ±1) -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, // (0, ±1/φ, ±φ) 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, // (±1/φ, ±φ, 0) -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, // (±φ, 0, ±1/φ) -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r ], o = [ 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9 ]; super(s, o, e, t), this.type = "DodecahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new _Do(e.radius, e.detail); } }; var sc = new q4(); var oc = new q4(); var bh = new q4(); var ac = new Zt(); var Of = class extends Ke { constructor(e, t) { if (super(), this.type = "EdgesGeometry", this.parameters = { thresholdAngle: t }, t = t !== void 0 ? t : 1, e.isGeometry === true) { console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const r = Math.pow(10, 4), s = Math.cos(As * t), o = e.getIndex(), a6 = e.getAttribute("position"), c = o ? o.count : a6.count, l = [0, 0, 0], d = ["a", "b", "c"], h6 = new Array(3), f6 = {}, g6 = []; for (let p = 0; p < c; p += 3) { o ? (l[0] = o.getX(p), l[1] = o.getX(p + 1), l[2] = o.getX(p + 2)) : (l[0] = p, l[1] = p + 1, l[2] = p + 2); const { a: u6, b: y6, c: v6 } = ac; if (u6.fromBufferAttribute(a6, l[0]), y6.fromBufferAttribute(a6, l[1]), v6.fromBufferAttribute(a6, l[2]), ac.getNormal(bh), h6[0] = `${Math.round(u6.x * r)},${Math.round(u6.y * r)},${Math.round(u6.z * r)}`, h6[1] = `${Math.round(y6.x * r)},${Math.round(y6.y * r)},${Math.round(y6.z * r)}`, h6[2] = `${Math.round(v6.x * r)},${Math.round(v6.y * r)},${Math.round(v6.z * r)}`, !(h6[0] === h6[1] || h6[1] === h6[2] || h6[2] === h6[0])) for (let m6 = 0; m6 < 3; m6++) { const x6 = (m6 + 1) % 3, w6 = h6[m6], A6 = h6[x6], M6 = ac[d[m6]], R6 = ac[d[x6]], L6 = `${w6}_${A6}`, T6 = `${A6}_${w6}`; T6 in f6 && f6[T6] ? (bh.dot(f6[T6].normal) <= s && (g6.push(M6.x, M6.y, M6.z), g6.push(R6.x, R6.y, R6.z)), f6[T6] = null) : L6 in f6 || (f6[L6] = { index0: l[m6], index1: l[x6], normal: bh.clone() }); } } for (const p in f6) if (f6[p]) { const { index0: u6, index1: y6 } = f6[p]; sc.fromBufferAttribute(a6, u6), oc.fromBufferAttribute(a6, y6), g6.push(sc.x, sc.y, sc.z), g6.push(oc.x, oc.y, oc.z); } this.setAttribute("position", new We(g6, 3)); } }; var $n = class { constructor() { this.type = "Curve", this.arcLengthDivisions = 200; } // Virtual base class method to overwrite and implement in subclasses // - t [0 .. 1] getPoint() { return console.warn("THREE.Curve: .getPoint() not implemented."), null; } // Get point at relative position in curve according to arc length // - u [0 .. 1] getPointAt(e, t) { const i = this.getUtoTmapping(e); return this.getPoint(i, t); } // Get sequence of points using getPoint( t ) getPoints(e = 5) { const t = []; for (let i = 0; i <= e; i++) t.push(this.getPoint(i / e)); return t; } // Get sequence of points using getPointAt( u ) getSpacedPoints(e = 5) { const t = []; for (let i = 0; i <= e; i++) t.push(this.getPointAt(i / e)); return t; } // Get total curve arc length getLength() { const e = this.getLengths(); return e[e.length - 1]; } // Get list of cumulative segment lengths getLengths(e = this.arcLengthDivisions) { if (this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate) return this.cacheArcLengths; this.needsUpdate = false; const t = []; let i, r = this.getPoint(0), s = 0; t.push(0); for (let o = 1; o <= e; o++) i = this.getPoint(o / e), s += i.distanceTo(r), t.push(s), r = i; return this.cacheArcLengths = t, t; } updateArcLengths() { this.needsUpdate = true, this.getLengths(); } // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant getUtoTmapping(e, t) { const i = this.getLengths(); let r = 0; const s = i.length; let o; t ? o = t : o = e * i[s - 1]; let a6 = 0, c = s - 1, l; for (; a6 <= c; ) if (r = Math.floor(a6 + (c - a6) / 2), l = i[r] - o, l < 0) a6 = r + 1; else if (l > 0) c = r - 1; else { c = r; break; } if (r = c, i[r] === o) return r / (s - 1); const d = i[r], f6 = i[r + 1] - d, g6 = (o - d) / f6; return (r + g6) / (s - 1); } // Returns a unit vector tangent at t // In case any sub curve does not implement its tangent derivation, // 2 points a small delta apart will be used to find its gradient // which seems to give a reasonable approximation getTangent(e, t) { let r = e - 1e-4, s = e + 1e-4; r < 0 && (r = 0), s > 1 && (s = 1); const o = this.getPoint(r), a6 = this.getPoint(s), c = t || (o.isVector2 ? new Re() : new q4()); return c.copy(a6).sub(o).normalize(), c; } getTangentAt(e, t) { const i = this.getUtoTmapping(e); return this.getTangent(i, t); } computeFrenetFrames(e, t) { const i = new q4(), r = [], s = [], o = [], a6 = new q4(), c = new Xe(); for (let g6 = 0; g6 <= e; g6++) { const p = g6 / e; r[g6] = this.getTangentAt(p, new q4()), r[g6].normalize(); } s[0] = new q4(), o[0] = new q4(); let l = Number.MAX_VALUE; const d = Math.abs(r[0].x), h6 = Math.abs(r[0].y), f6 = Math.abs(r[0].z); d <= l && (l = d, i.set(1, 0, 0)), h6 <= l && (l = h6, i.set(0, 1, 0)), f6 <= l && i.set(0, 0, 1), a6.crossVectors(r[0], i).normalize(), s[0].crossVectors(r[0], a6), o[0].crossVectors(r[0], s[0]); for (let g6 = 1; g6 <= e; g6++) { if (s[g6] = s[g6 - 1].clone(), o[g6] = o[g6 - 1].clone(), a6.crossVectors(r[g6 - 1], r[g6]), a6.length() > Number.EPSILON) { a6.normalize(); const p = Math.acos(gn2(r[g6 - 1].dot(r[g6]), -1, 1)); s[g6].applyMatrix4(c.makeRotationAxis(a6, p)); } o[g6].crossVectors(r[g6], s[g6]); } if (t === true) { let g6 = Math.acos(gn2(s[0].dot(s[e]), -1, 1)); g6 /= e, r[0].dot(a6.crossVectors(s[0], s[e])) > 0 && (g6 = -g6); for (let p = 1; p <= e; p++) s[p].applyMatrix4(c.makeRotationAxis(r[p], g6 * p)), o[p].crossVectors(r[p], s[p]); } return { tangents: r, normals: s, binormals: o }; } clone() { return new this.constructor().copy(this); } copy(e) { return this.arcLengthDivisions = e.arcLengthDivisions, this; } toJSON() { const e = { metadata: { version: 4.5, type: "Curve", generator: "Curve.toJSON" } }; return e.arcLengthDivisions = this.arcLengthDivisions, e.type = this.type, e; } fromJSON(e) { return this.arcLengthDivisions = e.arcLengthDivisions, this; } }; var xl = class extends $n { constructor(e = 0, t = 0, i = 1, r = 1, s = 0, o = Math.PI * 2, a6 = false, c = 0) { super(), this.type = "EllipseCurve", this.aX = e, this.aY = t, this.xRadius = i, this.yRadius = r, this.aStartAngle = s, this.aEndAngle = o, this.aClockwise = a6, this.aRotation = c; } getPoint(e, t) { const i = t || new Re(), r = Math.PI * 2; let s = this.aEndAngle - this.aStartAngle; const o = Math.abs(s) < Number.EPSILON; for (; s < 0; ) s += r; for (; s > r; ) s -= r; s < Number.EPSILON && (o ? s = 0 : s = r), this.aClockwise === true && !o && (s === r ? s = -r : s = s - r); const a6 = this.aStartAngle + e * s; let c = this.aX + this.xRadius * Math.cos(a6), l = this.aY + this.yRadius * Math.sin(a6); if (this.aRotation !== 0) { const d = Math.cos(this.aRotation), h6 = Math.sin(this.aRotation), f6 = c - this.aX, g6 = l - this.aY; c = f6 * d - g6 * h6 + this.aX, l = f6 * h6 + g6 * d + this.aY; } return i.set(c, l); } copy(e) { return super.copy(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this; } toJSON() { const e = super.toJSON(); return e.aX = this.aX, e.aY = this.aY, e.xRadius = this.xRadius, e.yRadius = this.yRadius, e.aStartAngle = this.aStartAngle, e.aEndAngle = this.aEndAngle, e.aClockwise = this.aClockwise, e.aRotation = this.aRotation, e; } fromJSON(e) { return super.fromJSON(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this; } }; xl.prototype.isEllipseCurve = true; var Df = class extends xl { constructor(e, t, i, r, s, o) { super(e, t, i, i, r, s, o), this.type = "ArcCurve"; } }; Df.prototype.isArcCurve = true; function Nf() { let n = 0, e = 0, t = 0, i = 0; function r(s, o, a6, c) { n = s, e = a6, t = -3 * s + 3 * o - 2 * a6 - c, i = 2 * s - 2 * o + a6 + c; } return { initCatmullRom: function(s, o, a6, c, l) { r(o, a6, l * (a6 - s), l * (c - o)); }, initNonuniformCatmullRom: function(s, o, a6, c, l, d, h6) { let f6 = (o - s) / l - (a6 - s) / (l + d) + (a6 - o) / d, g6 = (a6 - o) / d - (c - o) / (d + h6) + (c - a6) / h6; f6 *= d, g6 *= d, r(o, a6, f6, g6); }, calc: function(s) { const o = s * s, a6 = o * s; return n + e * s + t * o + i * a6; } }; } var lc = new q4(); var xh = new Nf(); var Mh = new Nf(); var wh = new Nf(); var Bf = class extends $n { constructor(e = [], t = false, i = "centripetal", r = 0.5) { super(), this.type = "CatmullRomCurve3", this.points = e, this.closed = t, this.curveType = i, this.tension = r; } getPoint(e, t = new q4()) { const i = t, r = this.points, s = r.length, o = (s - (this.closed ? 0 : 1)) * e; let a6 = Math.floor(o), c = o - a6; this.closed ? a6 += a6 > 0 ? 0 : (Math.floor(Math.abs(a6) / s) + 1) * s : c === 0 && a6 === s - 1 && (a6 = s - 2, c = 1); let l, d; this.closed || a6 > 0 ? l = r[(a6 - 1) % s] : (lc.subVectors(r[0], r[1]).add(r[0]), l = lc); const h6 = r[a6 % s], f6 = r[(a6 + 1) % s]; if (this.closed || a6 + 2 < s ? d = r[(a6 + 2) % s] : (lc.subVectors(r[s - 1], r[s - 2]).add(r[s - 1]), d = lc), this.curveType === "centripetal" || this.curveType === "chordal") { const g6 = this.curveType === "chordal" ? 0.5 : 0.25; let p = Math.pow(l.distanceToSquared(h6), g6), u6 = Math.pow(h6.distanceToSquared(f6), g6), y6 = Math.pow(f6.distanceToSquared(d), g6); u6 < 1e-4 && (u6 = 1), p < 1e-4 && (p = u6), y6 < 1e-4 && (y6 = u6), xh.initNonuniformCatmullRom(l.x, h6.x, f6.x, d.x, p, u6, y6), Mh.initNonuniformCatmullRom(l.y, h6.y, f6.y, d.y, p, u6, y6), wh.initNonuniformCatmullRom(l.z, h6.z, f6.z, d.z, p, u6, y6); } else this.curveType === "catmullrom" && (xh.initCatmullRom(l.x, h6.x, f6.x, d.x, this.tension), Mh.initCatmullRom(l.y, h6.y, f6.y, d.y, this.tension), wh.initCatmullRom(l.z, h6.z, f6.z, d.z, this.tension)); return i.set( xh.calc(c), Mh.calc(c), wh.calc(c) ), i; } copy(e) { super.copy(e), this.points = []; for (let t = 0, i = e.points.length; t < i; t++) { const r = e.points[t]; this.points.push(r.clone()); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } toJSON() { const e = super.toJSON(); e.points = []; for (let t = 0, i = this.points.length; t < i; t++) { const r = this.points[t]; e.points.push(r.toArray()); } return e.closed = this.closed, e.curveType = this.curveType, e.tension = this.tension, e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let t = 0, i = e.points.length; t < i; t++) { const r = e.points[t]; this.points.push(new q4().fromArray(r)); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } }; Bf.prototype.isCatmullRomCurve3 = true; function Dg(n, e, t, i, r) { const s = (i - e) * 0.5, o = (r - t) * 0.5, a6 = n * n, c = n * a6; return (2 * t - 2 * i + s + o) * c + (-3 * t + 3 * i - 2 * s - o) * a6 + s * n + t; } function zD(n, e) { const t = 1 - n; return t * t * e; } function kD(n, e) { return 2 * (1 - n) * n * e; } function VD(n, e) { return n * n * e; } function Pa(n, e, t, i) { return zD(n, e) + kD(n, t) + VD(n, i); } function GD(n, e) { const t = 1 - n; return t * t * t * e; } function HD(n, e) { const t = 1 - n; return 3 * t * t * n * e; } function WD(n, e) { return 3 * (1 - n) * n * n * e; } function jD(n, e) { return n * n * n * e; } function Ia(n, e, t, i, r) { return GD(n, e) + HD(n, t) + WD(n, i) + jD(n, r); } var Su = class extends $n { constructor(e = new Re(), t = new Re(), i = new Re(), r = new Re()) { super(), this.type = "CubicBezierCurve", this.v0 = e, this.v1 = t, this.v2 = i, this.v3 = r; } getPoint(e, t = new Re()) { const i = t, r = this.v0, s = this.v1, o = this.v2, a6 = this.v3; return i.set( Ia(e, r.x, s.x, o.x, a6.x), Ia(e, r.y, s.y, o.y, a6.y) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e.v3 = this.v3.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this; } }; Su.prototype.isCubicBezierCurve = true; var Uf = class extends $n { constructor(e = new q4(), t = new q4(), i = new q4(), r = new q4()) { super(), this.type = "CubicBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = i, this.v3 = r; } getPoint(e, t = new q4()) { const i = t, r = this.v0, s = this.v1, o = this.v2, a6 = this.v3; return i.set( Ia(e, r.x, s.x, o.x, a6.x), Ia(e, r.y, s.y, o.y, a6.y), Ia(e, r.z, s.z, o.z, a6.z) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e.v3 = this.v3.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this; } }; Uf.prototype.isCubicBezierCurve3 = true; var Ml = class extends $n { constructor(e = new Re(), t = new Re()) { super(), this.type = "LineCurve", this.v1 = e, this.v2 = t; } getPoint(e, t = new Re()) { const i = t; return e === 1 ? i.copy(this.v2) : (i.copy(this.v2).sub(this.v1), i.multiplyScalar(e).add(this.v1)), i; } // Line curve is linear, so we can overwrite default getPointAt getPointAt(e, t) { return this.getPoint(e, t); } getTangent(e, t) { const i = t || new Re(); return i.copy(this.v2).sub(this.v1).normalize(), i; } copy(e) { return super.copy(e), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } }; Ml.prototype.isLineCurve = true; var Lx = class extends $n { constructor(e = new q4(), t = new q4()) { super(), this.type = "LineCurve3", this.isLineCurve3 = true, this.v1 = e, this.v2 = t; } getPoint(e, t = new q4()) { const i = t; return e === 1 ? i.copy(this.v2) : (i.copy(this.v2).sub(this.v1), i.multiplyScalar(e).add(this.v1)), i; } // Line curve is linear, so we can overwrite default getPointAt getPointAt(e, t) { return this.getPoint(e, t); } copy(e) { return super.copy(e), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } }; var _u = class extends $n { constructor(e = new Re(), t = new Re(), i = new Re()) { super(), this.type = "QuadraticBezierCurve", this.v0 = e, this.v1 = t, this.v2 = i; } getPoint(e, t = new Re()) { const i = t, r = this.v0, s = this.v1, o = this.v2; return i.set( Pa(e, r.x, s.x, o.x), Pa(e, r.y, s.y, o.y) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } }; _u.prototype.isQuadraticBezierCurve = true; var zf = class extends $n { constructor(e = new q4(), t = new q4(), i = new q4()) { super(), this.type = "QuadraticBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = i; } getPoint(e, t = new q4()) { const i = t, r = this.v0, s = this.v1, o = this.v2; return i.set( Pa(e, r.x, s.x, o.x), Pa(e, r.y, s.y, o.y), Pa(e, r.z, s.z, o.z) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } }; zf.prototype.isQuadraticBezierCurve3 = true; var Tu = class extends $n { constructor(e = []) { super(), this.type = "SplineCurve", this.points = e; } getPoint(e, t = new Re()) { const i = t, r = this.points, s = (r.length - 1) * e, o = Math.floor(s), a6 = s - o, c = r[o === 0 ? o : o - 1], l = r[o], d = r[o > r.length - 2 ? r.length - 1 : o + 1], h6 = r[o > r.length - 3 ? r.length - 1 : o + 2]; return i.set( Dg(a6, c.x, l.x, d.x, h6.x), Dg(a6, c.y, l.y, d.y, h6.y) ), i; } copy(e) { super.copy(e), this.points = []; for (let t = 0, i = e.points.length; t < i; t++) { const r = e.points[t]; this.points.push(r.clone()); } return this; } toJSON() { const e = super.toJSON(); e.points = []; for (let t = 0, i = this.points.length; t < i; t++) { const r = this.points[t]; e.points.push(r.toArray()); } return e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let t = 0, i = e.points.length; t < i; t++) { const r = e.points[t]; this.points.push(new Re().fromArray(r)); } return this; } }; Tu.prototype.isSplineCurve = true; var kf = Object.freeze({ __proto__: null, ArcCurve: Df, CatmullRomCurve3: Bf, CubicBezierCurve: Su, CubicBezierCurve3: Uf, EllipseCurve: xl, LineCurve: Ml, LineCurve3: Lx, QuadraticBezierCurve: _u, QuadraticBezierCurve3: zf, SplineCurve: Tu }); var $D = { triangulate: function(n, e, t = 2) { const i = e && e.length, r = i ? e[0] * t : n.length; let s = Rx(n, 0, r, t, true); const o = []; if (!s || s.next === s.prev) return o; let a6, c, l, d, h6, f6, g6; if (i && (s = KD(n, e, s, t)), n.length > 80 * t) { a6 = l = n[0], c = d = n[1]; for (let p = t; p < r; p += t) h6 = n[p], f6 = n[p + 1], h6 < a6 && (a6 = h6), f6 < c && (c = f6), h6 > l && (l = h6), f6 > d && (d = f6); g6 = Math.max(l - a6, d - c), g6 = g6 !== 0 ? 1 / g6 : 0; } return $a(s, o, t, a6, c, g6), o; } }; function Rx(n, e, t, i, r) { let s, o; if (r === lN(n, e, t, i) > 0) for (s = e; s < t; s += i) o = Ng(s, n[s], n[s + 1], o); else for (s = t - i; s >= e; s -= i) o = Ng(s, n[s], n[s + 1], o); return o && Eu(o, o.next) && (Xa(o), o = o.next), o; } function Zr(n, e) { if (!n) return n; e || (e = n); let t = n, i; do if (i = false, !t.steiner && (Eu(t, t.next) || Ot(t.prev, t, t.next) === 0)) { if (Xa(t), t = e = t.prev, t === t.next) break; i = true; } else t = t.next; while (i || t !== e); return e; } function $a(n, e, t, i, r, s, o) { if (!n) return; !o && s && nN(n, i, r, s); let a6 = n, c, l; for (; n.prev !== n.next; ) { if (c = n.prev, l = n.next, s ? XD(n, i, r, s) : ZD(n)) { e.push(c.i / t), e.push(n.i / t), e.push(l.i / t), Xa(n), n = l.next, a6 = l.next; continue; } if (n = l, n === a6) { o ? o === 1 ? (n = YD(Zr(n), e, t), $a(n, e, t, i, r, s, 2)) : o === 2 && JD(n, e, t, i, r, s) : $a(Zr(n), e, t, i, r, s, 1); break; } } } function ZD(n) { const e = n.prev, t = n, i = n.next; if (Ot(e, t, i) >= 0) return false; let r = n.next.next; for (; r !== n.prev; ) { if (go(e.x, e.y, t.x, t.y, i.x, i.y, r.x, r.y) && Ot(r.prev, r, r.next) >= 0) return false; r = r.next; } return true; } function XD(n, e, t, i) { const r = n.prev, s = n, o = n.next; if (Ot(r, s, o) >= 0) return false; const a6 = r.x < s.x ? r.x < o.x ? r.x : o.x : s.x < o.x ? s.x : o.x, c = r.y < s.y ? r.y < o.y ? r.y : o.y : s.y < o.y ? s.y : o.y, l = r.x > s.x ? r.x > o.x ? r.x : o.x : s.x > o.x ? s.x : o.x, d = r.y > s.y ? r.y > o.y ? r.y : o.y : s.y > o.y ? s.y : o.y, h6 = Ad(a6, c, e, t, i), f6 = Ad(l, d, e, t, i); let g6 = n.prevZ, p = n.nextZ; for (; g6 && g6.z >= h6 && p && p.z <= f6; ) { if (g6 !== n.prev && g6 !== n.next && go(r.x, r.y, s.x, s.y, o.x, o.y, g6.x, g6.y) && Ot(g6.prev, g6, g6.next) >= 0 || (g6 = g6.prevZ, p !== n.prev && p !== n.next && go(r.x, r.y, s.x, s.y, o.x, o.y, p.x, p.y) && Ot(p.prev, p, p.next) >= 0)) return false; p = p.nextZ; } for (; g6 && g6.z >= h6; ) { if (g6 !== n.prev && g6 !== n.next && go(r.x, r.y, s.x, s.y, o.x, o.y, g6.x, g6.y) && Ot(g6.prev, g6, g6.next) >= 0) return false; g6 = g6.prevZ; } for (; p && p.z <= f6; ) { if (p !== n.prev && p !== n.next && go(r.x, r.y, s.x, s.y, o.x, o.y, p.x, p.y) && Ot(p.prev, p, p.next) >= 0) return false; p = p.nextZ; } return true; } function YD(n, e, t) { let i = n; do { const r = i.prev, s = i.next.next; !Eu(r, s) && Fx(r, i, i.next, s) && Za(r, s) && Za(s, r) && (e.push(r.i / t), e.push(i.i / t), e.push(s.i / t), Xa(i), Xa(i.next), i = n = s), i = i.next; } while (i !== n); return Zr(i); } function JD(n, e, t, i, r, s) { let o = n; do { let a6 = o.next.next; for (; a6 !== o.prev; ) { if (o.i !== a6.i && sN(o, a6)) { let c = Px(o, a6); o = Zr(o, o.next), c = Zr(c, c.next), $a(o, e, t, i, r, s), $a(c, e, t, i, r, s); return; } a6 = a6.next; } o = o.next; } while (o !== n); } function KD(n, e, t, i) { const r = []; let s, o, a6, c, l; for (s = 0, o = e.length; s < o; s++) a6 = e[s] * i, c = s < o - 1 ? e[s + 1] * i : n.length, l = Rx(n, a6, c, i, false), l === l.next && (l.steiner = true), r.push(rN(l)); for (r.sort(qD), s = 0; s < r.length; s++) QD(r[s], t), t = Zr(t, t.next); return t; } function qD(n, e) { return n.x - e.x; } function QD(n, e) { if (e = eN(n, e), e) { const t = Px(e, n); Zr(e, e.next), Zr(t, t.next); } } function eN(n, e) { let t = e; const i = n.x, r = n.y; let s = -1 / 0, o; do { if (r <= t.y && r >= t.next.y && t.next.y !== t.y) { const f6 = t.x + (r - t.y) * (t.next.x - t.x) / (t.next.y - t.y); if (f6 <= i && f6 > s) { if (s = f6, f6 === i) { if (r === t.y) return t; if (r === t.next.y) return t.next; } o = t.x < t.next.x ? t : t.next; } } t = t.next; } while (t !== e); if (!o) return null; if (i === s) return o; const a6 = o, c = o.x, l = o.y; let d = 1 / 0, h6; t = o; do i >= t.x && t.x >= c && i !== t.x && go(r < l ? i : s, r, c, l, r < l ? s : i, r, t.x, t.y) && (h6 = Math.abs(r - t.y) / (i - t.x), Za(t, n) && (h6 < d || h6 === d && (t.x > o.x || t.x === o.x && tN(o, t))) && (o = t, d = h6)), t = t.next; while (t !== a6); return o; } function tN(n, e) { return Ot(n.prev, n, e.prev) < 0 && Ot(e.next, n, n.next) < 0; } function nN(n, e, t, i) { let r = n; do r.z === null && (r.z = Ad(r.x, r.y, e, t, i)), r.prevZ = r.prev, r.nextZ = r.next, r = r.next; while (r !== n); r.prevZ.nextZ = null, r.prevZ = null, iN(r); } function iN(n) { let e, t, i, r, s, o, a6, c, l = 1; do { for (t = n, n = null, s = null, o = 0; t; ) { for (o++, i = t, a6 = 0, e = 0; e < l && (a6++, i = i.nextZ, !!i); e++) ; for (c = l; a6 > 0 || c > 0 && i; ) a6 !== 0 && (c === 0 || !i || t.z <= i.z) ? (r = t, t = t.nextZ, a6--) : (r = i, i = i.nextZ, c--), s ? s.nextZ = r : n = r, r.prevZ = s, s = r; t = i; } s.nextZ = null, l *= 2; } while (o > 1); return n; } function Ad(n, e, t, i, r) { return n = 32767 * (n - t) * r, e = 32767 * (e - i) * r, n = (n | n << 8) & 16711935, n = (n | n << 4) & 252645135, n = (n | n << 2) & 858993459, n = (n | n << 1) & 1431655765, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, n | e << 1; } function rN(n) { let e = n, t = n; do (e.x < t.x || e.x === t.x && e.y < t.y) && (t = e), e = e.next; while (e !== n); return t; } function go(n, e, t, i, r, s, o, a6) { return (r - o) * (e - a6) - (n - o) * (s - a6) >= 0 && (n - o) * (i - a6) - (t - o) * (e - a6) >= 0 && (t - o) * (s - a6) - (r - o) * (i - a6) >= 0; } function sN(n, e) { return n.next.i !== e.i && n.prev.i !== e.i && !oN(n, e) && // dones't intersect other edges (Za(n, e) && Za(e, n) && aN(n, e) && // locally visible (Ot(n.prev, n, e.prev) || Ot(n, e.prev, e)) || // does not create opposite-facing sectors Eu(n, e) && Ot(n.prev, n, n.next) > 0 && Ot(e.prev, e, e.next) > 0); } function Ot(n, e, t) { return (e.y - n.y) * (t.x - e.x) - (e.x - n.x) * (t.y - e.y); } function Eu(n, e) { return n.x === e.x && n.y === e.y; } function Fx(n, e, t, i) { const r = uc(Ot(n, e, t)), s = uc(Ot(n, e, i)), o = uc(Ot(t, i, n)), a6 = uc(Ot(t, i, e)); return !!(r !== s && o !== a6 || r === 0 && cc(n, t, e) || s === 0 && cc(n, i, e) || o === 0 && cc(t, n, i) || a6 === 0 && cc(t, e, i)); } function cc(n, e, t) { return e.x <= Math.max(n.x, t.x) && e.x >= Math.min(n.x, t.x) && e.y <= Math.max(n.y, t.y) && e.y >= Math.min(n.y, t.y); } function uc(n) { return n > 0 ? 1 : n < 0 ? -1 : 0; } function oN(n, e) { let t = n; do { if (t.i !== n.i && t.next.i !== n.i && t.i !== e.i && t.next.i !== e.i && Fx(t, t.next, n, e)) return true; t = t.next; } while (t !== n); return false; } function Za(n, e) { return Ot(n.prev, n, n.next) < 0 ? Ot(n, e, n.next) >= 0 && Ot(n, n.prev, e) >= 0 : Ot(n, e, n.prev) < 0 || Ot(n, n.next, e) < 0; } function aN(n, e) { let t = n, i = false; const r = (n.x + e.x) / 2, s = (n.y + e.y) / 2; do t.y > s != t.next.y > s && t.next.y !== t.y && r < (t.next.x - t.x) * (s - t.y) / (t.next.y - t.y) + t.x && (i = !i), t = t.next; while (t !== n); return i; } function Px(n, e) { const t = new Sd(n.i, n.x, n.y), i = new Sd(e.i, e.x, e.y), r = n.next, s = e.prev; return n.next = e, e.prev = n, t.next = r, r.prev = t, i.next = t, t.prev = i, s.next = i, i.prev = s, i; } function Ng(n, e, t, i) { const r = new Sd(n, e, t); return i ? (r.next = i.next, r.prev = i, i.next.prev = r, i.next = r) : (r.prev = r, r.next = r), r; } function Xa(n) { n.next.prev = n.prev, n.prev.next = n.next, n.prevZ && (n.prevZ.nextZ = n.nextZ), n.nextZ && (n.nextZ.prevZ = n.prevZ); } function Sd(n, e, t) { this.i = n, this.x = e, this.y = t, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = false; } function lN(n, e, t, i) { let r = 0; for (let s = e, o = t - i; s < t; s += i) r += (n[o] - n[s]) * (n[s + 1] + n[o + 1]), o = s; return r; } var Fi = class _Fi { // calculate area of the contour polygon static area(e) { const t = e.length; let i = 0; for (let r = t - 1, s = 0; s < t; r = s++) i += e[r].x * e[s].y - e[s].x * e[r].y; return i * 0.5; } static isClockWise(e) { return _Fi.area(e) < 0; } static triangulateShape(e, t) { const i = [], r = [], s = []; Bg(e), Ug(i, e); let o = e.length; t.forEach(Bg); for (let c = 0; c < t.length; c++) r.push(o), o += t[c].length, Ug(i, t[c]); const a6 = $D.triangulate(i, r); for (let c = 0; c < a6.length; c += 3) s.push(a6.slice(c, c + 3)); return s; } }; function Bg(n) { const e = n.length; e > 2 && n[e - 1].equals(n[0]) && n.pop(); } function Ug(n, e) { for (let t = 0; t < e.length; t++) n.push(e[t].x), n.push(e[t].y); } var mi = class _mi extends Ke { constructor(e, t) { super(), this.type = "ExtrudeGeometry", this.parameters = { shapes: e, options: t }, e = Array.isArray(e) ? e : [e]; const i = this, r = [], s = []; for (let a6 = 0, c = e.length; a6 < c; a6++) { const l = e[a6]; o(l); } this.setAttribute("position", new We(r, 3)), this.setAttribute("uv", new We(s, 2)), this.computeVertexNormals(); function o(a6) { const c = [], l = t.curveSegments !== void 0 ? t.curveSegments : 12, d = t.steps !== void 0 ? t.steps : 1; let h6 = t.depth !== void 0 ? t.depth : 100, f6 = t.bevelEnabled !== void 0 ? t.bevelEnabled : true, g6 = t.bevelThickness !== void 0 ? t.bevelThickness : 6, p = t.bevelSize !== void 0 ? t.bevelSize : g6 - 2, u6 = t.bevelOffset !== void 0 ? t.bevelOffset : 0, y6 = t.bevelSegments !== void 0 ? t.bevelSegments : 3; const v6 = t.extrudePath, m6 = t.UVGenerator !== void 0 ? t.UVGenerator : cN; t.amount !== void 0 && (console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."), h6 = t.amount); let x6, w6 = false, A6, M6, R6, L6; v6 && (x6 = v6.getSpacedPoints(d), w6 = true, f6 = false, A6 = v6.computeFrenetFrames(d, false), M6 = new q4(), R6 = new q4(), L6 = new q4()), f6 || (y6 = 0, g6 = 0, p = 0, u6 = 0); const T6 = a6.extractPoints(l); let P6 = T6.shape; const _6 = T6.holes; if (!Fi.isClockWise(P6)) { P6 = P6.reverse(); for (let k6 = 0, H6 = _6.length; k6 < H6; k6++) { const K = _6[k6]; Fi.isClockWise(K) && (_6[k6] = K.reverse()); } } const E6 = Fi.triangulateShape(P6, _6), C6 = P6; for (let k6 = 0, H6 = _6.length; k6 < H6; k6++) { const K = _6[k6]; P6 = P6.concat(K); } function I6(k6, H6, K) { return H6 || console.error("THREE.ExtrudeGeometry: vec does not exist"), H6.clone().multiplyScalar(K).add(k6); } const b6 = P6.length, F6 = E6.length; function D6(k6, H6, K) { let ce, se, V6; const O6 = k6.x - H6.x, Z6 = k6.y - H6.y, X = K.x - k6.x, ee = K.y - k6.y, fe = O6 * O6 + Z6 * Z6, be = O6 * ee - Z6 * X; if (Math.abs(be) > Number.EPSILON) { const Ae = Math.sqrt(fe), he = Math.sqrt(X * X + ee * ee), xe = H6.x - Z6 / Ae, ne = H6.y + O6 / Ae, me = K.x - ee / he, Me = K.y + X / he, De = ((me - xe) * ee - (Me - ne) * X) / (O6 * ee - Z6 * X); ce = xe + O6 * De - k6.x, se = ne + Z6 * De - k6.y; const Ie = ce * ce + se * se; if (Ie <= 2) return new Re(ce, se); V6 = Math.sqrt(Ie / 2); } else { let Ae = false; O6 > Number.EPSILON ? X > Number.EPSILON && (Ae = true) : O6 < -Number.EPSILON ? X < -Number.EPSILON && (Ae = true) : Math.sign(Z6) === Math.sign(ee) && (Ae = true), Ae ? (ce = -Z6, se = O6, V6 = Math.sqrt(fe)) : (ce = O6, se = Z6, V6 = Math.sqrt(fe / 2)); } return new Re(ce / V6, se / V6); } const N6 = []; for (let k6 = 0, H6 = C6.length, K = H6 - 1, ce = k6 + 1; k6 < H6; k6++, K++, ce++) K === H6 && (K = 0), ce === H6 && (ce = 0), N6[k6] = D6(C6[k6], C6[K], C6[ce]); const B6 = []; let U6, G6 = N6.concat(); for (let k6 = 0, H6 = _6.length; k6 < H6; k6++) { const K = _6[k6]; U6 = []; for (let ce = 0, se = K.length, V6 = se - 1, O6 = ce + 1; ce < se; ce++, V6++, O6++) V6 === se && (V6 = 0), O6 === se && (O6 = 0), U6[ce] = D6(K[ce], K[V6], K[O6]); B6.push(U6), G6 = G6.concat(U6); } for (let k6 = 0; k6 < y6; k6++) { const H6 = k6 / y6, K = g6 * Math.cos(H6 * Math.PI / 2), ce = p * Math.sin(H6 * Math.PI / 2) + u6; for (let se = 0, V6 = C6.length; se < V6; se++) { const O6 = I6(C6[se], N6[se], ce); le(O6.x, O6.y, -K); } for (let se = 0, V6 = _6.length; se < V6; se++) { const O6 = _6[se]; U6 = B6[se]; for (let Z6 = 0, X = O6.length; Z6 < X; Z6++) { const ee = I6(O6[Z6], U6[Z6], ce); le(ee.x, ee.y, -K); } } } const Y = p + u6; for (let k6 = 0; k6 < b6; k6++) { const H6 = f6 ? I6(P6[k6], G6[k6], Y) : P6[k6]; w6 ? (R6.copy(A6.normals[0]).multiplyScalar(H6.x), M6.copy(A6.binormals[0]).multiplyScalar(H6.y), L6.copy(x6[0]).add(R6).add(M6), le(L6.x, L6.y, L6.z)) : le(H6.x, H6.y, 0); } for (let k6 = 1; k6 <= d; k6++) for (let H6 = 0; H6 < b6; H6++) { const K = f6 ? I6(P6[H6], G6[H6], Y) : P6[H6]; w6 ? (R6.copy(A6.normals[k6]).multiplyScalar(K.x), M6.copy(A6.binormals[k6]).multiplyScalar(K.y), L6.copy(x6[k6]).add(R6).add(M6), le(L6.x, L6.y, L6.z)) : le(K.x, K.y, h6 / d * k6); } for (let k6 = y6 - 1; k6 >= 0; k6--) { const H6 = k6 / y6, K = g6 * Math.cos(H6 * Math.PI / 2), ce = p * Math.sin(H6 * Math.PI / 2) + u6; for (let se = 0, V6 = C6.length; se < V6; se++) { const O6 = I6(C6[se], N6[se], ce); le(O6.x, O6.y, h6 + K); } for (let se = 0, V6 = _6.length; se < V6; se++) { const O6 = _6[se]; U6 = B6[se]; for (let Z6 = 0, X = O6.length; Z6 < X; Z6++) { const ee = I6(O6[Z6], U6[Z6], ce); w6 ? le(ee.x, ee.y + x6[d - 1].y, x6[d - 1].x + K) : le(ee.x, ee.y, h6 + K); } } } te(), ae(); function te() { const k6 = r.length / 3; if (f6) { let H6 = 0, K = b6 * H6; for (let ce = 0; ce < F6; ce++) { const se = E6[ce]; W6(se[2] + K, se[1] + K, se[0] + K); } H6 = d + y6 * 2, K = b6 * H6; for (let ce = 0; ce < F6; ce++) { const se = E6[ce]; W6(se[0] + K, se[1] + K, se[2] + K); } } else { for (let H6 = 0; H6 < F6; H6++) { const K = E6[H6]; W6(K[2], K[1], K[0]); } for (let H6 = 0; H6 < F6; H6++) { const K = E6[H6]; W6(K[0] + b6 * d, K[1] + b6 * d, K[2] + b6 * d); } } i.addGroup(k6, r.length / 3 - k6, 0); } function ae() { const k6 = r.length / 3; let H6 = 0; ie(C6, H6), H6 += C6.length; for (let K = 0, ce = _6.length; K < ce; K++) { const se = _6[K]; ie(se, H6), H6 += se.length; } i.addGroup(k6, r.length / 3 - k6, 1); } function ie(k6, H6) { let K = k6.length; for (; --K >= 0; ) { const ce = K; let se = K - 1; se < 0 && (se = k6.length - 1); for (let V6 = 0, O6 = d + y6 * 2; V6 < O6; V6++) { const Z6 = b6 * V6, X = b6 * (V6 + 1), ee = H6 + ce + Z6, fe = H6 + se + Z6, be = H6 + se + X, Ae = H6 + ce + X; $6(ee, fe, be, Ae); } } } function le(k6, H6, K) { c.push(k6), c.push(H6), c.push(K); } function W6(k6, H6, K) { j6(k6), j6(H6), j6(K); const ce = r.length / 3, se = m6.generateTopUV(i, r, ce - 3, ce - 2, ce - 1); re(se[0]), re(se[1]), re(se[2]); } function $6(k6, H6, K, ce) { j6(k6), j6(H6), j6(ce), j6(H6), j6(K), j6(ce); const se = r.length / 3, V6 = m6.generateSideWallUV(i, r, se - 6, se - 3, se - 2, se - 1); re(V6[0]), re(V6[1]), re(V6[3]), re(V6[1]), re(V6[2]), re(V6[3]); } function j6(k6) { r.push(c[k6 * 3 + 0]), r.push(c[k6 * 3 + 1]), r.push(c[k6 * 3 + 2]); } function re(k6) { s.push(k6.x), s.push(k6.y); } } } toJSON() { const e = super.toJSON(), t = this.parameters.shapes, i = this.parameters.options; return uN(t, i, e); } static fromJSON(e, t) { const i = []; for (let s = 0, o = e.shapes.length; s < o; s++) { const a6 = t[e.shapes[s]]; i.push(a6); } const r = e.options.extrudePath; return r !== void 0 && (e.options.extrudePath = new kf[r.type]().fromJSON(r)), new _mi(i, e.options); } }; var cN = { generateTopUV: function(n, e, t, i, r) { const s = e[t * 3], o = e[t * 3 + 1], a6 = e[i * 3], c = e[i * 3 + 1], l = e[r * 3], d = e[r * 3 + 1]; return [ new Re(s, o), new Re(a6, c), new Re(l, d) ]; }, generateSideWallUV: function(n, e, t, i, r, s) { const o = e[t * 3], a6 = e[t * 3 + 1], c = e[t * 3 + 2], l = e[i * 3], d = e[i * 3 + 1], h6 = e[i * 3 + 2], f6 = e[r * 3], g6 = e[r * 3 + 1], p = e[r * 3 + 2], u6 = e[s * 3], y6 = e[s * 3 + 1], v6 = e[s * 3 + 2]; return Math.abs(a6 - d) < Math.abs(o - l) ? [ new Re(o, 1 - c), new Re(l, 1 - h6), new Re(f6, 1 - p), new Re(u6, 1 - v6) ] : [ new Re(a6, 1 - c), new Re(d, 1 - h6), new Re(g6, 1 - p), new Re(y6, 1 - v6) ]; } }; function uN(n, e, t) { if (t.shapes = [], Array.isArray(n)) for (let i = 0, r = n.length; i < r; i++) { const s = n[i]; t.shapes.push(s.uuid); } else t.shapes.push(n.uuid); return e.extrudePath !== void 0 && (t.options.extrudePath = e.extrudePath.toJSON()), t; } var No = class _No extends Di { constructor(e = 1, t = 0) { const i = (1 + Math.sqrt(5)) / 2, r = [ -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1 ], s = [ 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 ]; super(r, s, e, t), this.type = "IcosahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new _No(e.radius, e.detail); } }; var Bo = class _Bo extends Ke { constructor(e, t = 12, i = 0, r = Math.PI * 2) { super(), this.type = "LatheGeometry", this.parameters = { points: e, segments: t, phiStart: i, phiLength: r }, t = Math.floor(t), r = gn2(r, 0, Math.PI * 2); const s = [], o = [], a6 = [], c = 1 / t, l = new q4(), d = new Re(); for (let h6 = 0; h6 <= t; h6++) { const f6 = i + h6 * c * r, g6 = Math.sin(f6), p = Math.cos(f6); for (let u6 = 0; u6 <= e.length - 1; u6++) l.x = e[u6].x * g6, l.y = e[u6].y, l.z = e[u6].x * p, o.push(l.x, l.y, l.z), d.x = h6 / t, d.y = u6 / (e.length - 1), a6.push(d.x, d.y); } for (let h6 = 0; h6 < t; h6++) for (let f6 = 0; f6 < e.length - 1; f6++) { const g6 = f6 + h6 * e.length, p = g6, u6 = g6 + e.length, y6 = g6 + e.length + 1, v6 = g6 + 1; s.push(p, u6, v6), s.push(u6, y6, v6); } if (this.setIndex(s), this.setAttribute("position", new We(o, 3)), this.setAttribute("uv", new We(a6, 2)), this.computeVertexNormals(), r === Math.PI * 2) { const h6 = this.attributes.normal.array, f6 = new q4(), g6 = new q4(), p = new q4(), u6 = t * e.length * 3; for (let y6 = 0, v6 = 0; y6 < e.length; y6++, v6 += 3) f6.x = h6[v6 + 0], f6.y = h6[v6 + 1], f6.z = h6[v6 + 2], g6.x = h6[u6 + v6 + 0], g6.y = h6[u6 + v6 + 1], g6.z = h6[u6 + v6 + 2], p.addVectors(f6, g6).normalize(), h6[v6 + 0] = h6[u6 + v6 + 0] = p.x, h6[v6 + 1] = h6[u6 + v6 + 1] = p.y, h6[v6 + 2] = h6[u6 + v6 + 2] = p.z; } } static fromJSON(e) { return new _Bo(e.points, e.segments, e.phiStart, e.phiLength); } }; var Rs = class _Rs extends Di { constructor(e = 1, t = 0) { const i = [ 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1 ], r = [ 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2 ]; super(i, r, e, t), this.type = "OctahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new _Rs(e.radius, e.detail); } }; var Hc = class extends Ke { constructor(e, t, i) { super(), this.type = "ParametricGeometry", this.parameters = { func: e, slices: t, stacks: i }; const r = [], s = [], o = [], a6 = [], c = 1e-5, l = new q4(), d = new q4(), h6 = new q4(), f6 = new q4(), g6 = new q4(); e.length < 3 && console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."); const p = t + 1; for (let u6 = 0; u6 <= i; u6++) { const y6 = u6 / i; for (let v6 = 0; v6 <= t; v6++) { const m6 = v6 / t; e(m6, y6, d), s.push(d.x, d.y, d.z), m6 - c >= 0 ? (e(m6 - c, y6, h6), f6.subVectors(d, h6)) : (e(m6 + c, y6, h6), f6.subVectors(h6, d)), y6 - c >= 0 ? (e(m6, y6 - c, h6), g6.subVectors(d, h6)) : (e(m6, y6 + c, h6), g6.subVectors(h6, d)), l.crossVectors(f6, g6).normalize(), o.push(l.x, l.y, l.z), a6.push(m6, y6); } } for (let u6 = 0; u6 < i; u6++) for (let y6 = 0; y6 < t; y6++) { const v6 = u6 * p + y6, m6 = u6 * p + y6 + 1, x6 = (u6 + 1) * p + y6 + 1, w6 = (u6 + 1) * p + y6; r.push(v6, m6, w6), r.push(m6, x6, w6); } this.setIndex(r), this.setAttribute("position", new We(s, 3)), this.setAttribute("normal", new We(o, 3)), this.setAttribute("uv", new We(a6, 2)); } }; var Uo = class _Uo extends Ke { constructor(e = 0.5, t = 1, i = 8, r = 1, s = 0, o = Math.PI * 2) { super(), this.type = "RingGeometry", this.parameters = { innerRadius: e, outerRadius: t, thetaSegments: i, phiSegments: r, thetaStart: s, thetaLength: o }, i = Math.max(3, i), r = Math.max(1, r); const a6 = [], c = [], l = [], d = []; let h6 = e; const f6 = (t - e) / r, g6 = new q4(), p = new Re(); for (let u6 = 0; u6 <= r; u6++) { for (let y6 = 0; y6 <= i; y6++) { const v6 = s + y6 / i * o; g6.x = h6 * Math.cos(v6), g6.y = h6 * Math.sin(v6), c.push(g6.x, g6.y, g6.z), l.push(0, 0, 1), p.x = (g6.x / t + 1) / 2, p.y = (g6.y / t + 1) / 2, d.push(p.x, p.y); } h6 += f6; } for (let u6 = 0; u6 < r; u6++) { const y6 = u6 * (i + 1); for (let v6 = 0; v6 < i; v6++) { const m6 = v6 + y6, x6 = m6, w6 = m6 + i + 1, A6 = m6 + i + 2, M6 = m6 + 1; a6.push(x6, w6, M6), a6.push(w6, A6, M6); } } this.setIndex(a6), this.setAttribute("position", new We(c, 3)), this.setAttribute("normal", new We(l, 3)), this.setAttribute("uv", new We(d, 2)); } static fromJSON(e) { return new _Uo(e.innerRadius, e.outerRadius, e.thetaSegments, e.phiSegments, e.thetaStart, e.thetaLength); } }; var Fs = class _Fs extends Ke { constructor(e, t = 12) { super(), this.type = "ShapeGeometry", this.parameters = { shapes: e, curveSegments: t }; const i = [], r = [], s = [], o = []; let a6 = 0, c = 0; if (Array.isArray(e) === false) l(e); else for (let d = 0; d < e.length; d++) l(e[d]), this.addGroup(a6, c, d), a6 += c, c = 0; this.setIndex(i), this.setAttribute("position", new We(r, 3)), this.setAttribute("normal", new We(s, 3)), this.setAttribute("uv", new We(o, 2)); function l(d) { const h6 = r.length / 3, f6 = d.extractPoints(t); let g6 = f6.shape; const p = f6.holes; Fi.isClockWise(g6) === false && (g6 = g6.reverse()); for (let y6 = 0, v6 = p.length; y6 < v6; y6++) { const m6 = p[y6]; Fi.isClockWise(m6) === true && (p[y6] = m6.reverse()); } const u6 = Fi.triangulateShape(g6, p); for (let y6 = 0, v6 = p.length; y6 < v6; y6++) { const m6 = p[y6]; g6 = g6.concat(m6); } for (let y6 = 0, v6 = g6.length; y6 < v6; y6++) { const m6 = g6[y6]; r.push(m6.x, m6.y, 0), s.push(0, 0, 1), o.push(m6.x, m6.y); } for (let y6 = 0, v6 = u6.length; y6 < v6; y6++) { const m6 = u6[y6], x6 = m6[0] + h6, w6 = m6[1] + h6, A6 = m6[2] + h6; i.push(x6, w6, A6), c += 3; } } } toJSON() { const e = super.toJSON(), t = this.parameters.shapes; return hN(t, e); } static fromJSON(e, t) { const i = []; for (let r = 0, s = e.shapes.length; r < s; r++) { const o = t[e.shapes[r]]; i.push(o); } return new _Fs(i, e.curveSegments); } }; function hN(n, e) { if (e.shapes = [], Array.isArray(n)) for (let t = 0, i = n.length; t < i; t++) { const r = n[t]; e.shapes.push(r.uuid); } else e.shapes.push(n.uuid); return e; } var Ps = class _Ps extends Ke { constructor(e = 1, t = 8, i = 6, r = 0, s = Math.PI * 2, o = 0, a6 = Math.PI) { super(), this.type = "SphereGeometry", this.parameters = { radius: e, widthSegments: t, heightSegments: i, phiStart: r, phiLength: s, thetaStart: o, thetaLength: a6 }, t = Math.max(3, Math.floor(t)), i = Math.max(2, Math.floor(i)); const c = Math.min(o + a6, Math.PI); let l = 0; const d = [], h6 = new q4(), f6 = new q4(), g6 = [], p = [], u6 = [], y6 = []; for (let v6 = 0; v6 <= i; v6++) { const m6 = [], x6 = v6 / i; let w6 = 0; v6 == 0 && o == 0 ? w6 = 0.5 / t : v6 == i && c == Math.PI && (w6 = -0.5 / t); for (let A6 = 0; A6 <= t; A6++) { const M6 = A6 / t; h6.x = -e * Math.cos(r + M6 * s) * Math.sin(o + x6 * a6), h6.y = e * Math.cos(o + x6 * a6), h6.z = e * Math.sin(r + M6 * s) * Math.sin(o + x6 * a6), p.push(h6.x, h6.y, h6.z), f6.copy(h6).normalize(), u6.push(f6.x, f6.y, f6.z), y6.push(M6 + w6, 1 - x6), m6.push(l++); } d.push(m6); } for (let v6 = 0; v6 < i; v6++) for (let m6 = 0; m6 < t; m6++) { const x6 = d[v6][m6 + 1], w6 = d[v6][m6], A6 = d[v6 + 1][m6], M6 = d[v6 + 1][m6 + 1]; (v6 !== 0 || o > 0) && g6.push(x6, w6, M6), (v6 !== i - 1 || c < Math.PI) && g6.push(w6, A6, M6); } this.setIndex(g6), this.setAttribute("position", new We(p, 3)), this.setAttribute("normal", new We(u6, 3)), this.setAttribute("uv", new We(y6, 2)); } static fromJSON(e) { return new _Ps(e.radius, e.widthSegments, e.heightSegments, e.phiStart, e.phiLength, e.thetaStart, e.thetaLength); } }; var zo = class _zo extends Di { constructor(e = 1, t = 0) { const i = [ 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1 ], r = [ 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 ]; super(i, r, e, t), this.type = "TetrahedronGeometry", this.parameters = { radius: e, detail: t }; } static fromJSON(e) { return new _zo(e.radius, e.detail); } }; var Wc = class extends mi { constructor(e, t = {}) { const i = t.font; if (!(i && i.isFont)) return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."), new Ke(); const r = i.generateShapes(e, t.size); t.depth = t.height !== void 0 ? t.height : 50, t.bevelThickness === void 0 && (t.bevelThickness = 10), t.bevelSize === void 0 && (t.bevelSize = 8), t.bevelEnabled === void 0 && (t.bevelEnabled = false), super(r, t), this.type = "TextGeometry"; } }; var ko = class _ko extends Ke { constructor(e = 1, t = 0.4, i = 8, r = 6, s = Math.PI * 2) { super(), this.type = "TorusGeometry", this.parameters = { radius: e, tube: t, radialSegments: i, tubularSegments: r, arc: s }, i = Math.floor(i), r = Math.floor(r); const o = [], a6 = [], c = [], l = [], d = new q4(), h6 = new q4(), f6 = new q4(); for (let g6 = 0; g6 <= i; g6++) for (let p = 0; p <= r; p++) { const u6 = p / r * s, y6 = g6 / i * Math.PI * 2; h6.x = (e + t * Math.cos(y6)) * Math.cos(u6), h6.y = (e + t * Math.cos(y6)) * Math.sin(u6), h6.z = t * Math.sin(y6), a6.push(h6.x, h6.y, h6.z), d.x = e * Math.cos(u6), d.y = e * Math.sin(u6), f6.subVectors(h6, d).normalize(), c.push(f6.x, f6.y, f6.z), l.push(p / r), l.push(g6 / i); } for (let g6 = 1; g6 <= i; g6++) for (let p = 1; p <= r; p++) { const u6 = (r + 1) * g6 + p - 1, y6 = (r + 1) * (g6 - 1) + p - 1, v6 = (r + 1) * (g6 - 1) + p, m6 = (r + 1) * g6 + p; o.push(u6, y6, m6), o.push(y6, v6, m6); } this.setIndex(o), this.setAttribute("position", new We(a6, 3)), this.setAttribute("normal", new We(c, 3)), this.setAttribute("uv", new We(l, 2)); } static fromJSON(e) { return new _ko(e.radius, e.tube, e.radialSegments, e.tubularSegments, e.arc); } }; var Vo = class _Vo extends Ke { constructor(e = 1, t = 0.4, i = 64, r = 8, s = 2, o = 3) { super(), this.type = "TorusKnotGeometry", this.parameters = { radius: e, tube: t, tubularSegments: i, radialSegments: r, p: s, q: o }, i = Math.floor(i), r = Math.floor(r); const a6 = [], c = [], l = [], d = [], h6 = new q4(), f6 = new q4(), g6 = new q4(), p = new q4(), u6 = new q4(), y6 = new q4(), v6 = new q4(); for (let x6 = 0; x6 <= i; ++x6) { const w6 = x6 / i * s * Math.PI * 2; m6(w6, s, o, e, g6), m6(w6 + 0.01, s, o, e, p), y6.subVectors(p, g6), v6.addVectors(p, g6), u6.crossVectors(y6, v6), v6.crossVectors(u6, y6), u6.normalize(), v6.normalize(); for (let A6 = 0; A6 <= r; ++A6) { const M6 = A6 / r * Math.PI * 2, R6 = -t * Math.cos(M6), L6 = t * Math.sin(M6); h6.x = g6.x + (R6 * v6.x + L6 * u6.x), h6.y = g6.y + (R6 * v6.y + L6 * u6.y), h6.z = g6.z + (R6 * v6.z + L6 * u6.z), c.push(h6.x, h6.y, h6.z), f6.subVectors(h6, g6).normalize(), l.push(f6.x, f6.y, f6.z), d.push(x6 / i), d.push(A6 / r); } } for (let x6 = 1; x6 <= i; x6++) for (let w6 = 1; w6 <= r; w6++) { const A6 = (r + 1) * (x6 - 1) + (w6 - 1), M6 = (r + 1) * x6 + (w6 - 1), R6 = (r + 1) * x6 + w6, L6 = (r + 1) * (x6 - 1) + w6; a6.push(A6, M6, L6), a6.push(M6, R6, L6); } this.setIndex(a6), this.setAttribute("position", new We(c, 3)), this.setAttribute("normal", new We(l, 3)), this.setAttribute("uv", new We(d, 2)); function m6(x6, w6, A6, M6, R6) { const L6 = Math.cos(x6), T6 = Math.sin(x6), P6 = A6 / w6 * x6, _6 = Math.cos(P6); R6.x = M6 * (2 + _6) * 0.5 * L6, R6.y = M6 * (2 + _6) * T6 * 0.5, R6.z = M6 * Math.sin(P6) * 0.5; } } static fromJSON(e) { return new _Vo(e.radius, e.tube, e.tubularSegments, e.radialSegments, e.p, e.q); } }; var Go = class _Go extends Ke { constructor(e, t = 64, i = 1, r = 8, s = false) { super(), this.type = "TubeGeometry", this.parameters = { path: e, tubularSegments: t, radius: i, radialSegments: r, closed: s }; const o = e.computeFrenetFrames(t, s); this.tangents = o.tangents, this.normals = o.normals, this.binormals = o.binormals; const a6 = new q4(), c = new q4(), l = new Re(); let d = new q4(); const h6 = [], f6 = [], g6 = [], p = []; u6(), this.setIndex(p), this.setAttribute("position", new We(h6, 3)), this.setAttribute("normal", new We(f6, 3)), this.setAttribute("uv", new We(g6, 2)); function u6() { for (let x6 = 0; x6 < t; x6++) y6(x6); y6(s === false ? t : 0), m6(), v6(); } function y6(x6) { d = e.getPointAt(x6 / t, d); const w6 = o.normals[x6], A6 = o.binormals[x6]; for (let M6 = 0; M6 <= r; M6++) { const R6 = M6 / r * Math.PI * 2, L6 = Math.sin(R6), T6 = -Math.cos(R6); c.x = T6 * w6.x + L6 * A6.x, c.y = T6 * w6.y + L6 * A6.y, c.z = T6 * w6.z + L6 * A6.z, c.normalize(), f6.push(c.x, c.y, c.z), a6.x = d.x + i * c.x, a6.y = d.y + i * c.y, a6.z = d.z + i * c.z, h6.push(a6.x, a6.y, a6.z); } } function v6() { for (let x6 = 1; x6 <= t; x6++) for (let w6 = 1; w6 <= r; w6++) { const A6 = (r + 1) * (x6 - 1) + (w6 - 1), M6 = (r + 1) * x6 + (w6 - 1), R6 = (r + 1) * x6 + w6, L6 = (r + 1) * (x6 - 1) + w6; p.push(A6, M6, L6), p.push(M6, R6, L6); } } function m6() { for (let x6 = 0; x6 <= t; x6++) for (let w6 = 0; w6 <= r; w6++) l.x = x6 / t, l.y = w6 / r, g6.push(l.x, l.y); } } toJSON() { const e = super.toJSON(); return e.path = this.parameters.path.toJSON(), e; } static fromJSON(e) { return new _Go( new kf[e.path.type]().fromJSON(e.path), e.tubularSegments, e.radius, e.radialSegments, e.closed ); } }; var Vf = class extends Ke { constructor(e) { if (super(), this.type = "WireframeGeometry", e.isGeometry === true) { console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const t = [], i = [0, 0], r = {}, s = new q4(); if (e.index !== null) { const o = e.attributes.position, a6 = e.index; let c = e.groups; c.length === 0 && (c = [{ start: 0, count: a6.count, materialIndex: 0 }]); for (let l = 0, d = c.length; l < d; ++l) { const h6 = c[l], f6 = h6.start, g6 = h6.count; for (let p = f6, u6 = f6 + g6; p < u6; p += 3) for (let y6 = 0; y6 < 3; y6++) { const v6 = a6.getX(p + y6), m6 = a6.getX(p + (y6 + 1) % 3); i[0] = Math.min(v6, m6), i[1] = Math.max(v6, m6); const x6 = i[0] + "," + i[1]; r[x6] === void 0 && (r[x6] = { index1: i[0], index2: i[1] }); } } for (const l in r) { const d = r[l]; s.fromBufferAttribute(o, d.index1), t.push(s.x, s.y, s.z), s.fromBufferAttribute(o, d.index2), t.push(s.x, s.y, s.z); } } else { const o = e.attributes.position; for (let a6 = 0, c = o.count / 3; a6 < c; a6++) for (let l = 0; l < 3; l++) { const d = 3 * a6 + l; s.fromBufferAttribute(o, d), t.push(s.x, s.y, s.z); const h6 = 3 * a6 + (l + 1) % 3; s.fromBufferAttribute(o, h6), t.push(s.x, s.y, s.z); } } this.setAttribute("position", new We(t, 3)); } }; var zg = Object.freeze({ __proto__: null, BoxGeometry: or, BoxBufferGeometry: or, CircleGeometry: Io, CircleBufferGeometry: Io, ConeGeometry: Oo, ConeBufferGeometry: Oo, CylinderGeometry: $r, CylinderBufferGeometry: $r, DodecahedronGeometry: Do, DodecahedronBufferGeometry: Do, EdgesGeometry: Of, ExtrudeGeometry: mi, ExtrudeBufferGeometry: mi, IcosahedronGeometry: No, IcosahedronBufferGeometry: No, LatheGeometry: Bo, LatheBufferGeometry: Bo, OctahedronGeometry: Rs, OctahedronBufferGeometry: Rs, ParametricGeometry: Hc, ParametricBufferGeometry: Hc, PlaneGeometry: Ls, PlaneBufferGeometry: Ls, PolyhedronGeometry: Di, PolyhedronBufferGeometry: Di, RingGeometry: Uo, RingBufferGeometry: Uo, ShapeGeometry: Fs, ShapeBufferGeometry: Fs, SphereGeometry: Ps, SphereBufferGeometry: Ps, TetrahedronGeometry: zo, TetrahedronBufferGeometry: zo, TextGeometry: Wc, TextBufferGeometry: Wc, TorusGeometry: ko, TorusBufferGeometry: ko, TorusKnotGeometry: Vo, TorusKnotBufferGeometry: Vo, TubeGeometry: Go, TubeBufferGeometry: Go, WireframeGeometry: Vf }); var Gf = class extends tn2 { constructor(e) { super(), this.type = "ShadowMaterial", this.color = new Ue(0), this.transparent = true, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this; } }; Gf.prototype.isShadowMaterial = true; var ra = class extends ar { constructor(e) { super(e), this.type = "RawShaderMaterial"; } }; ra.prototype.isRawShaderMaterial = true; var zs = class extends tn2 { constructor(e) { super(), this.defines = { STANDARD: "" }, this.type = "MeshStandardMaterial", this.color = new Ue(16777215), this.roughness = 1, this.metalness = 0, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ue(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Jr, this.normalScale = new Re(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapIntensity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, this.flatShading = false, this.vertexTangents = false, this.setValues(e); } copy(e) { return super.copy(e), this.defines = { STANDARD: "" }, this.color.copy(e.color), this.roughness = e.roughness, this.metalness = e.metalness, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.roughnessMap = e.roughnessMap, this.metalnessMap = e.metalnessMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapIntensity = e.envMapIntensity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this.vertexTangents = e.vertexTangents, this; } }; zs.prototype.isMeshStandardMaterial = true; var wl = class extends zs { constructor(e) { super(), this.defines = { STANDARD: "", PHYSICAL: "" }, this.type = "MeshPhysicalMaterial", this.clearcoat = 0, this.clearcoatMap = null, this.clearcoatRoughness = 0, this.clearcoatRoughnessMap = null, this.clearcoatNormalScale = new Re(1, 1), this.clearcoatNormalMap = null, this.reflectivity = 0.5, Object.defineProperty(this, "ior", { get: function() { return (1 + 0.4 * this.reflectivity) / (1 - 0.4 * this.reflectivity); }, set: function(t) { this.reflectivity = gn2(2.5 * (t - 1) / (t + 1), 0, 1); } }), this.sheen = null, this.transmission = 0, this.transmissionMap = null, this.thickness = 0.01, this.thicknessMap = null, this.attenuationDistance = 0, this.attenuationColor = new Ue(1, 1, 1), this.setValues(e); } copy(e) { return super.copy(e), this.defines = { STANDARD: "", PHYSICAL: "" }, this.clearcoat = e.clearcoat, this.clearcoatMap = e.clearcoatMap, this.clearcoatRoughness = e.clearcoatRoughness, this.clearcoatRoughnessMap = e.clearcoatRoughnessMap, this.clearcoatNormalMap = e.clearcoatNormalMap, this.clearcoatNormalScale.copy(e.clearcoatNormalScale), this.reflectivity = e.reflectivity, e.sheen ? this.sheen = (this.sheen || new Ue()).copy(e.sheen) : this.sheen = null, this.transmission = e.transmission, this.transmissionMap = e.transmissionMap, this.thickness = e.thickness, this.thicknessMap = e.thicknessMap, this.attenuationDistance = e.attenuationDistance, this.attenuationColor.copy(e.attenuationColor), this; } }; wl.prototype.isMeshPhysicalMaterial = true; var Hf = class extends tn2 { constructor(e) { super(), this.type = "MeshPhongMaterial", this.color = new Ue(16777215), this.specular = new Ue(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ue(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Jr, this.normalScale = new Re(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = al, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, this.flatShading = false, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.specular.copy(e.specular), this.shininess = e.shininess, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } }; Hf.prototype.isMeshPhongMaterial = true; var Wf = class extends tn2 { constructor(e) { super(), this.defines = { TOON: "" }, this.type = "MeshToonMaterial", this.color = new Ue(16777215), this.map = null, this.gradientMap = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ue(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Jr, this.normalScale = new Re(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.gradientMap = e.gradientMap, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.alphaMap = e.alphaMap, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this; } }; Wf.prototype.isMeshToonMaterial = true; var jf = class extends tn2 { constructor(e) { super(), this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Jr, this.normalScale = new Re(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, this.morphTargets = false, this.morphNormals = false, this.flatShading = false, this.setValues(e); } copy(e) { return super.copy(e), this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } }; jf.prototype.isMeshNormalMaterial = true; var $f = class extends tn2 { constructor(e) { super(), this.type = "MeshLambertMaterial", this.color = new Ue(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ue(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = al, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this; } }; $f.prototype.isMeshLambertMaterial = true; var Zf = class extends tn2 { constructor(e) { super(), this.defines = { MATCAP: "" }, this.type = "MeshMatcapMaterial", this.color = new Ue(16777215), this.matcap = null, this.map = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Jr, this.normalScale = new Re(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.morphTargets = false, this.morphNormals = false, this.flatShading = false, this.setValues(e); } copy(e) { return super.copy(e), this.defines = { MATCAP: "" }, this.color.copy(e.color), this.matcap = e.matcap, this.map = e.map, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.alphaMap = e.alphaMap, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } }; Zf.prototype.isMeshMatcapMaterial = true; var Xf = class extends an2 { constructor(e) { super(), this.type = "LineDashedMaterial", this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.setValues(e); } copy(e) { return super.copy(e), this.scale = e.scale, this.dashSize = e.dashSize, this.gapSize = e.gapSize, this; } }; Xf.prototype.isLineDashedMaterial = true; var dN = Object.freeze({ __proto__: null, ShadowMaterial: Gf, SpriteMaterial: ml, RawShaderMaterial: ra, ShaderMaterial: ar, PointsMaterial: es, MeshPhysicalMaterial: wl, MeshStandardMaterial: zs, MeshPhongMaterial: Hf, MeshToonMaterial: Wf, MeshNormalMaterial: jf, MeshLambertMaterial: $f, MeshDepthMaterial: xu, MeshDistanceMaterial: Mu, MeshBasicMaterial: In, MeshMatcapMaterial: Zf, LineDashedMaterial: Xf, LineBasicMaterial: an2, Material: tn2 }); var Ct = { // same as Array.prototype.slice, but also works on typed arrays arraySlice: function(n, e, t) { return Ct.isTypedArray(n) ? new n.constructor(n.subarray(e, t !== void 0 ? t : n.length)) : n.slice(e, t); }, // converts an array to a specific type convertArray: function(n, e, t) { return !n || // let 'undefined' and 'null' pass !t && n.constructor === e ? n : typeof e.BYTES_PER_ELEMENT == "number" ? new e(n) : Array.prototype.slice.call(n); }, isTypedArray: function(n) { return ArrayBuffer.isView(n) && !(n instanceof DataView); }, // returns an array by which times and values can be sorted getKeyframeOrder: function(n) { function e(r, s) { return n[r] - n[s]; } const t = n.length, i = new Array(t); for (let r = 0; r !== t; ++r) i[r] = r; return i.sort(e), i; }, // uses the array previously returned by 'getKeyframeOrder' to sort data sortedArray: function(n, e, t) { const i = n.length, r = new n.constructor(i); for (let s = 0, o = 0; o !== i; ++s) { const a6 = t[s] * e; for (let c = 0; c !== e; ++c) r[o++] = n[a6 + c]; } return r; }, // function for parsing AOS keyframe formats flattenJSON: function(n, e, t, i) { let r = 1, s = n[0]; for (; s !== void 0 && s[i] === void 0; ) s = n[r++]; if (s === void 0) return; let o = s[i]; if (o !== void 0) if (Array.isArray(o)) do o = s[i], o !== void 0 && (e.push(s.time), t.push.apply(t, o)), s = n[r++]; while (s !== void 0); else if (o.toArray !== void 0) do o = s[i], o !== void 0 && (e.push(s.time), o.toArray(t, t.length)), s = n[r++]; while (s !== void 0); else do o = s[i], o !== void 0 && (e.push(s.time), t.push(o)), s = n[r++]; while (s !== void 0); }, subclip: function(n, e, t, i, r = 30) { const s = n.clone(); s.name = e; const o = []; for (let c = 0; c < s.tracks.length; ++c) { const l = s.tracks[c], d = l.getValueSize(), h6 = [], f6 = []; for (let g6 = 0; g6 < l.times.length; ++g6) { const p = l.times[g6] * r; if (!(p < t || p >= i)) { h6.push(l.times[g6]); for (let u6 = 0; u6 < d; ++u6) f6.push(l.values[g6 * d + u6]); } } h6.length !== 0 && (l.times = Ct.convertArray(h6, l.times.constructor), l.values = Ct.convertArray(f6, l.values.constructor), o.push(l)); } s.tracks = o; let a6 = 1 / 0; for (let c = 0; c < s.tracks.length; ++c) a6 > s.tracks[c].times[0] && (a6 = s.tracks[c].times[0]); for (let c = 0; c < s.tracks.length; ++c) s.tracks[c].shift(-1 * a6); return s.resetDuration(), s; }, makeClipAdditive: function(n, e = 0, t = n, i = 30) { i <= 0 && (i = 30); const r = t.tracks.length, s = e / i; for (let o = 0; o < r; ++o) { const a6 = t.tracks[o], c = a6.ValueTypeName; if (c === "bool" || c === "string") continue; const l = n.tracks.find(function(v6) { return v6.name === a6.name && v6.ValueTypeName === c; }); if (l === void 0) continue; let d = 0; const h6 = a6.getValueSize(); a6.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (d = h6 / 3); let f6 = 0; const g6 = l.getValueSize(); l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (f6 = g6 / 3); const p = a6.times.length - 1; let u6; if (s <= a6.times[0]) { const v6 = d, m6 = h6 - d; u6 = Ct.arraySlice(a6.values, v6, m6); } else if (s >= a6.times[p]) { const v6 = p * h6 + d, m6 = v6 + h6 - d; u6 = Ct.arraySlice(a6.values, v6, m6); } else { const v6 = a6.createInterpolant(), m6 = d, x6 = h6 - d; v6.evaluate(s), u6 = Ct.arraySlice(v6.resultBuffer, m6, x6); } c === "quaternion" && new bn().fromArray(u6).normalize().conjugate().toArray(u6); const y6 = l.times.length; for (let v6 = 0; v6 < y6; ++v6) { const m6 = v6 * g6 + f6; if (c === "quaternion") bn.multiplyQuaternionsFlat( l.values, m6, u6, 0, l.values, m6 ); else { const x6 = g6 - f6 * 2; for (let w6 = 0; w6 < x6; ++w6) l.values[m6 + w6] -= u6[w6]; } } } return n.blendMode = Mf, n; } }; var Ni = class { constructor(e, t, i, r) { this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = r !== void 0 ? r : new t.constructor(i), this.sampleValues = t, this.valueSize = i, this.settings = null, this.DefaultSettings_ = {}; } evaluate(e) { const t = this.parameterPositions; let i = this._cachedIndex, r = t[i], s = t[i - 1]; e: { t: { let o; n: { i: if (!(e < r)) { for (let a6 = i + 2; ; ) { if (r === void 0) { if (e < s) break i; return i = t.length, this._cachedIndex = i, this.afterEnd_(i - 1, e, s); } if (i === a6) break; if (s = r, r = t[++i], e < r) break t; } o = t.length; break n; } if (!(e >= s)) { const a6 = t[1]; e < a6 && (i = 2, s = a6); for (let c = i - 2; ; ) { if (s === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, r); if (i === c) break; if (r = s, s = t[--i - 1], e >= s) break t; } o = i, i = 0; break n; } break e; } for (; i < o; ) { const a6 = i + o >>> 1; e < t[a6] ? o = a6 : i = a6 + 1; } if (r = t[i], s = t[i - 1], s === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, r); if (r === void 0) return i = t.length, this._cachedIndex = i, this.afterEnd_(i - 1, s, e); } this._cachedIndex = i, this.intervalChanged_(i, s, r); } return this.interpolate_(i, s, e, r); } getSettings_() { return this.settings || this.DefaultSettings_; } copySampleValue_(e) { const t = this.resultBuffer, i = this.sampleValues, r = this.valueSize, s = e * r; for (let o = 0; o !== r; ++o) t[o] = i[s + o]; return t; } // Template methods for derived classes: interpolate_() { throw new Error("call to abstract method"); } intervalChanged_() { } }; Ni.prototype.beforeStart_ = Ni.prototype.copySampleValue_; Ni.prototype.afterEnd_ = Ni.prototype.copySampleValue_; var Ix = class extends Ni { constructor(e, t, i, r) { super(e, t, i, r), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = { endingStart: gs, endingEnd: gs }; } intervalChanged_(e, t, i) { const r = this.parameterPositions; let s = e - 2, o = e + 1, a6 = r[s], c = r[o]; if (a6 === void 0) switch (this.getSettings_().endingStart) { case vs: s = e, a6 = 2 * t - i; break; case Wa: s = r.length - 2, a6 = t + r[s] - r[s + 1]; break; default: s = e, a6 = i; } if (c === void 0) switch (this.getSettings_().endingEnd) { case vs: o = e, c = 2 * i - t; break; case Wa: o = 1, c = i + r[1] - r[0]; break; default: o = e - 1, c = t; } const l = (i - t) * 0.5, d = this.valueSize; this._weightPrev = l / (t - a6), this._weightNext = l / (c - i), this._offsetPrev = s * d, this._offsetNext = o * d; } interpolate_(e, t, i, r) { const s = this.resultBuffer, o = this.sampleValues, a6 = this.valueSize, c = e * a6, l = c - a6, d = this._offsetPrev, h6 = this._offsetNext, f6 = this._weightPrev, g6 = this._weightNext, p = (i - t) / (r - t), u6 = p * p, y6 = u6 * p, v6 = -f6 * y6 + 2 * f6 * u6 - f6 * p, m6 = (1 + f6) * y6 + (-1.5 - 2 * f6) * u6 + (-0.5 + f6) * p + 1, x6 = (-1 - g6) * y6 + (1.5 + g6) * u6 + 0.5 * p, w6 = g6 * y6 - g6 * u6; for (let A6 = 0; A6 !== a6; ++A6) s[A6] = v6 * o[d + A6] + m6 * o[l + A6] + x6 * o[c + A6] + w6 * o[h6 + A6]; return s; } }; var Yf = class extends Ni { constructor(e, t, i, r) { super(e, t, i, r); } interpolate_(e, t, i, r) { const s = this.resultBuffer, o = this.sampleValues, a6 = this.valueSize, c = e * a6, l = c - a6, d = (i - t) / (r - t), h6 = 1 - d; for (let f6 = 0; f6 !== a6; ++f6) s[f6] = o[l + f6] * h6 + o[c + f6] * d; return s; } }; var Ox = class extends Ni { constructor(e, t, i, r) { super(e, t, i, r); } interpolate_(e) { return this.copySampleValue_(e - 1); } }; var xi = class { constructor(e, t, i, r) { if (e === void 0) throw new Error("THREE.KeyframeTrack: track name is undefined"); if (t === void 0 || t.length === 0) throw new Error("THREE.KeyframeTrack: no keyframes in track named " + e); this.name = e, this.times = Ct.convertArray(t, this.TimeBufferType), this.values = Ct.convertArray(i, this.ValueBufferType), this.setInterpolation(r || this.DefaultInterpolation); } // Serialization (in static context, because of constructor invocation // and automatic invocation of .toJSON): static toJSON(e) { const t = e.constructor; let i; if (t.toJSON !== this.toJSON) i = t.toJSON(e); else { i = { name: e.name, times: Ct.convertArray(e.times, Array), values: Ct.convertArray(e.values, Array) }; const r = e.getInterpolation(); r !== e.DefaultInterpolation && (i.interpolation = r); } return i.type = e.ValueTypeName, i; } InterpolantFactoryMethodDiscrete(e) { return new Ox(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodLinear(e) { return new Yf(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodSmooth(e) { return new Ix(this.times, this.values, this.getValueSize(), e); } setInterpolation(e) { let t; switch (e) { case Lo: t = this.InterpolantFactoryMethodDiscrete; break; case Es: t = this.InterpolantFactoryMethodLinear; break; case Cc: t = this.InterpolantFactoryMethodSmooth; break; } if (t === void 0) { const i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name; if (this.createInterpolant === void 0) if (e !== this.DefaultInterpolation) this.setInterpolation(this.DefaultInterpolation); else throw new Error(i); return console.warn("THREE.KeyframeTrack:", i), this; } return this.createInterpolant = t, this; } getInterpolation() { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: return Lo; case this.InterpolantFactoryMethodLinear: return Es; case this.InterpolantFactoryMethodSmooth: return Cc; } } getValueSize() { return this.values.length / this.times.length; } // move all keyframes either forwards or backwards in time shift(e) { if (e !== 0) { const t = this.times; for (let i = 0, r = t.length; i !== r; ++i) t[i] += e; } return this; } // scale all keyframe times by a factor (useful for frame <-> seconds conversions) scale(e) { if (e !== 1) { const t = this.times; for (let i = 0, r = t.length; i !== r; ++i) t[i] *= e; } return this; } // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values trim(e, t) { const i = this.times, r = i.length; let s = 0, o = r - 1; for (; s !== r && i[s] < e; ) ++s; for (; o !== -1 && i[o] > t; ) --o; if (++o, s !== 0 || o !== r) { s >= o && (o = Math.max(o, 1), s = o - 1); const a6 = this.getValueSize(); this.times = Ct.arraySlice(i, s, o), this.values = Ct.arraySlice(this.values, s * a6, o * a6); } return this; } // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable validate() { let e = true; const t = this.getValueSize(); t - Math.floor(t) !== 0 && (console.error("THREE.KeyframeTrack: Invalid value size in track.", this), e = false); const i = this.times, r = this.values, s = i.length; s === 0 && (console.error("THREE.KeyframeTrack: Track is empty.", this), e = false); let o = null; for (let a6 = 0; a6 !== s; a6++) { const c = i[a6]; if (typeof c == "number" && isNaN(c)) { console.error("THREE.KeyframeTrack: Time is not a valid number.", this, a6, c), e = false; break; } if (o !== null && o > c) { console.error("THREE.KeyframeTrack: Out of order keys.", this, a6, c, o), e = false; break; } o = c; } if (r !== void 0 && Ct.isTypedArray(r)) for (let a6 = 0, c = r.length; a6 !== c; ++a6) { const l = r[a6]; if (isNaN(l)) { console.error("THREE.KeyframeTrack: Value is not a valid number.", this, a6, l), e = false; break; } } return e; } // removes equivalent sequential keys as common in morph target sequences // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) optimize() { const e = Ct.arraySlice(this.times), t = Ct.arraySlice(this.values), i = this.getValueSize(), r = this.getInterpolation() === Cc, s = e.length - 1; let o = 1; for (let a6 = 1; a6 < s; ++a6) { let c = false; const l = e[a6], d = e[a6 + 1]; if (l !== d && (a6 !== 1 || l !== e[0])) if (r) c = true; else { const h6 = a6 * i, f6 = h6 - i, g6 = h6 + i; for (let p = 0; p !== i; ++p) { const u6 = t[h6 + p]; if (u6 !== t[f6 + p] || u6 !== t[g6 + p]) { c = true; break; } } } if (c) { if (a6 !== o) { e[o] = e[a6]; const h6 = a6 * i, f6 = o * i; for (let g6 = 0; g6 !== i; ++g6) t[f6 + g6] = t[h6 + g6]; } ++o; } } if (s > 0) { e[o] = e[s]; for (let a6 = s * i, c = o * i, l = 0; l !== i; ++l) t[c + l] = t[a6 + l]; ++o; } return o !== e.length ? (this.times = Ct.arraySlice(e, 0, o), this.values = Ct.arraySlice(t, 0, o * i)) : (this.times = e, this.values = t), this; } clone() { const e = Ct.arraySlice(this.times, 0), t = Ct.arraySlice(this.values, 0), i = this.constructor, r = new i(this.name, e, t); return r.createInterpolant = this.createInterpolant, r; } }; xi.prototype.TimeBufferType = Float32Array; xi.prototype.ValueBufferType = Float32Array; xi.prototype.DefaultInterpolation = Es; var ks = class extends xi { }; ks.prototype.ValueTypeName = "bool"; ks.prototype.ValueBufferType = Array; ks.prototype.DefaultInterpolation = Lo; ks.prototype.InterpolantFactoryMethodLinear = void 0; ks.prototype.InterpolantFactoryMethodSmooth = void 0; var Jf = class extends xi { }; Jf.prototype.ValueTypeName = "color"; var Ho = class extends xi { }; Ho.prototype.ValueTypeName = "number"; var Dx = class extends Ni { constructor(e, t, i, r) { super(e, t, i, r); } interpolate_(e, t, i, r) { const s = this.resultBuffer, o = this.sampleValues, a6 = this.valueSize, c = (i - t) / (r - t); let l = e * a6; for (let d = l + a6; l !== d; l += 4) bn.slerpFlat(s, 0, o, l - a6, o, l, c); return s; } }; var Vs = class extends xi { InterpolantFactoryMethodLinear(e) { return new Dx(this.times, this.values, this.getValueSize(), e); } }; Vs.prototype.ValueTypeName = "quaternion"; Vs.prototype.DefaultInterpolation = Es; Vs.prototype.InterpolantFactoryMethodSmooth = void 0; var Gs = class extends xi { }; Gs.prototype.ValueTypeName = "string"; Gs.prototype.ValueBufferType = Array; Gs.prototype.DefaultInterpolation = Lo; Gs.prototype.InterpolantFactoryMethodLinear = void 0; Gs.prototype.InterpolantFactoryMethodSmooth = void 0; var Wo = class extends xi { }; Wo.prototype.ValueTypeName = "vector"; var jo = class { constructor(e, t = -1, i, r = fu) { this.name = e, this.tracks = i, this.duration = t, this.blendMode = r, this.uuid = Wn(), this.duration < 0 && this.resetDuration(); } static parse(e) { const t = [], i = e.tracks, r = 1 / (e.fps || 1); for (let o = 0, a6 = i.length; o !== a6; ++o) t.push(pN(i[o]).scale(r)); const s = new this(e.name, e.duration, t, e.blendMode); return s.uuid = e.uuid, s; } static toJSON(e) { const t = [], i = e.tracks, r = { name: e.name, duration: e.duration, tracks: t, uuid: e.uuid, blendMode: e.blendMode }; for (let s = 0, o = i.length; s !== o; ++s) t.push(xi.toJSON(i[s])); return r; } static CreateFromMorphTargetSequence(e, t, i, r) { const s = t.length, o = []; for (let a6 = 0; a6 < s; a6++) { let c = [], l = []; c.push( (a6 + s - 1) % s, a6, (a6 + 1) % s ), l.push(0, 1, 0); const d = Ct.getKeyframeOrder(c); c = Ct.sortedArray(c, 1, d), l = Ct.sortedArray(l, 1, d), !r && c[0] === 0 && (c.push(s), l.push(l[0])), o.push( new Ho( ".morphTargetInfluences[" + t[a6].name + "]", c, l ).scale(1 / i) ); } return new this(e, -1, o); } static findByName(e, t) { let i = e; if (!Array.isArray(e)) { const r = e; i = r.geometry && r.geometry.animations || r.animations; } for (let r = 0; r < i.length; r++) if (i[r].name === t) return i[r]; return null; } static CreateClipsFromMorphTargetSequences(e, t, i) { const r = {}, s = /^([\w-]*?)([\d]+)$/; for (let a6 = 0, c = e.length; a6 < c; a6++) { const l = e[a6], d = l.name.match(s); if (d && d.length > 1) { const h6 = d[1]; let f6 = r[h6]; f6 || (r[h6] = f6 = []), f6.push(l); } } const o = []; for (const a6 in r) o.push(this.CreateFromMorphTargetSequence(a6, r[a6], t, i)); return o; } // parse the animation.hierarchy format static parseAnimation(e, t) { if (!e) return console.error("THREE.AnimationClip: No animation in JSONLoader data."), null; const i = function(h6, f6, g6, p, u6) { if (g6.length !== 0) { const y6 = [], v6 = []; Ct.flattenJSON(g6, y6, v6, p), y6.length !== 0 && u6.push(new h6(f6, y6, v6)); } }, r = [], s = e.name || "default", o = e.fps || 30, a6 = e.blendMode; let c = e.length || -1; const l = e.hierarchy || []; for (let h6 = 0; h6 < l.length; h6++) { const f6 = l[h6].keys; if (!(!f6 || f6.length === 0)) if (f6[0].morphTargets) { const g6 = {}; let p; for (p = 0; p < f6.length; p++) if (f6[p].morphTargets) for (let u6 = 0; u6 < f6[p].morphTargets.length; u6++) g6[f6[p].morphTargets[u6]] = -1; for (const u6 in g6) { const y6 = [], v6 = []; for (let m6 = 0; m6 !== f6[p].morphTargets.length; ++m6) { const x6 = f6[p]; y6.push(x6.time), v6.push(x6.morphTarget === u6 ? 1 : 0); } r.push(new Ho(".morphTargetInfluence[" + u6 + "]", y6, v6)); } c = g6.length * (o || 1); } else { const g6 = ".bones[" + t[h6].name + "]"; i( Wo, g6 + ".position", f6, "pos", r ), i( Vs, g6 + ".quaternion", f6, "rot", r ), i( Wo, g6 + ".scale", f6, "scl", r ); } } return r.length === 0 ? null : new this(s, c, r, a6); } resetDuration() { const e = this.tracks; let t = 0; for (let i = 0, r = e.length; i !== r; ++i) { const s = this.tracks[i]; t = Math.max(t, s.times[s.times.length - 1]); } return this.duration = t, this; } trim() { for (let e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration); return this; } validate() { let e = true; for (let t = 0; t < this.tracks.length; t++) e = e && this.tracks[t].validate(); return e; } optimize() { for (let e = 0; e < this.tracks.length; e++) this.tracks[e].optimize(); return this; } clone() { const e = []; for (let t = 0; t < this.tracks.length; t++) e.push(this.tracks[t].clone()); return new this.constructor(this.name, this.duration, e, this.blendMode); } toJSON() { return this.constructor.toJSON(this); } }; function fN(n) { switch (n.toLowerCase()) { case "scalar": case "double": case "float": case "number": case "integer": return Ho; case "vector": case "vector2": case "vector3": case "vector4": return Wo; case "color": return Jf; case "quaternion": return Vs; case "bool": case "boolean": return ks; case "string": return Gs; } throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + n); } function pN(n) { if (n.type === void 0) throw new Error("THREE.KeyframeTrack: track type undefined, can not parse"); const e = fN(n.type); if (n.times === void 0) { const t = [], i = []; Ct.flattenJSON(n.keys, t, i, "value"), n.times = t, n.values = i; } return e.parse !== void 0 ? e.parse(n) : new e(n.name, n.times, n.values, n.interpolation); } var Is = { enabled: false, files: {}, add: function(n, e) { this.enabled !== false && (this.files[n] = e); }, get: function(n) { if (this.enabled !== false) return this.files[n]; }, remove: function(n) { delete this.files[n]; }, clear: function() { this.files = {}; } }; var Kf = class { constructor(e, t, i) { const r = this; let s = false, o = 0, a6 = 0, c; const l = []; this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = i, this.itemStart = function(d) { a6++, s === false && r.onStart !== void 0 && r.onStart(d, o, a6), s = true; }, this.itemEnd = function(d) { o++, r.onProgress !== void 0 && r.onProgress(d, o, a6), o === a6 && (s = false, r.onLoad !== void 0 && r.onLoad()); }, this.itemError = function(d) { r.onError !== void 0 && r.onError(d); }, this.resolveURL = function(d) { return c ? c(d) : d; }, this.setURLModifier = function(d) { return c = d, this; }, this.addHandler = function(d, h6) { return l.push(d, h6), this; }, this.removeHandler = function(d) { const h6 = l.indexOf(d); return h6 !== -1 && l.splice(h6, 2), this; }, this.getHandler = function(d) { for (let h6 = 0, f6 = l.length; h6 < f6; h6 += 2) { const g6 = l[h6], p = l[h6 + 1]; if (g6.global && (g6.lastIndex = 0), g6.test(d)) return p; } return null; }; } }; var Nx = new Kf(); var xn2 = class { constructor(e) { this.manager = e !== void 0 ? e : Nx, this.crossOrigin = "anonymous", this.withCredentials = false, this.path = "", this.resourcePath = "", this.requestHeader = {}; } load() { } loadAsync(e, t) { const i = this; return new Promise(function(r, s) { i.load(e, r, t, s); }); } parse() { } setCrossOrigin(e) { return this.crossOrigin = e, this; } setWithCredentials(e) { return this.withCredentials = e, this; } setPath(e) { return this.path = e, this; } setResourcePath(e) { return this.resourcePath = e, this; } setRequestHeader(e) { return this.requestHeader = e, this; } }; var ai = {}; var Zn = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const s = this, o = Is.get(e); if (o !== void 0) return s.manager.itemStart(e), setTimeout(function() { t && t(o), s.manager.itemEnd(e); }, 0), o; if (ai[e] !== void 0) { ai[e].push({ onLoad: t, onProgress: i, onError: r }); return; } const a6 = /^data:(.*?)(;base64)?,(.*)$/, c = e.match(a6); let l; if (c) { const d = c[1], h6 = !!c[2]; let f6 = c[3]; f6 = decodeURIComponent(f6), h6 && (f6 = atob(f6)); try { let g6; const p = (this.responseType || "").toLowerCase(); switch (p) { case "arraybuffer": case "blob": const u6 = new Uint8Array(f6.length); for (let v6 = 0; v6 < f6.length; v6++) u6[v6] = f6.charCodeAt(v6); p === "blob" ? g6 = new Blob([u6.buffer], { type: d }) : g6 = u6.buffer; break; case "document": g6 = new DOMParser().parseFromString(f6, d); break; case "json": g6 = JSON.parse(f6); break; default: g6 = f6; break; } setTimeout(function() { t && t(g6), s.manager.itemEnd(e); }, 0); } catch (g6) { setTimeout(function() { r && r(g6), s.manager.itemError(e), s.manager.itemEnd(e); }, 0); } } else { ai[e] = [], ai[e].push({ onLoad: t, onProgress: i, onError: r }), l = new XMLHttpRequest(), l.open("GET", e, true), l.addEventListener("load", function(d) { const h6 = this.response, f6 = ai[e]; if (delete ai[e], this.status === 200 || this.status === 0) { this.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), Is.add(e, h6); for (let g6 = 0, p = f6.length; g6 < p; g6++) { const u6 = f6[g6]; u6.onLoad && u6.onLoad(h6); } s.manager.itemEnd(e); } else { for (let g6 = 0, p = f6.length; g6 < p; g6++) { const u6 = f6[g6]; u6.onError && u6.onError(d); } s.manager.itemError(e), s.manager.itemEnd(e); } }, false), l.addEventListener("progress", function(d) { const h6 = ai[e]; for (let f6 = 0, g6 = h6.length; f6 < g6; f6++) { const p = h6[f6]; p.onProgress && p.onProgress(d); } }, false), l.addEventListener("error", function(d) { const h6 = ai[e]; delete ai[e]; for (let f6 = 0, g6 = h6.length; f6 < g6; f6++) { const p = h6[f6]; p.onError && p.onError(d); } s.manager.itemError(e), s.manager.itemEnd(e); }, false), l.addEventListener("abort", function(d) { const h6 = ai[e]; delete ai[e]; for (let f6 = 0, g6 = h6.length; f6 < g6; f6++) { const p = h6[f6]; p.onError && p.onError(d); } s.manager.itemError(e), s.manager.itemEnd(e); }, false), this.responseType !== void 0 && (l.responseType = this.responseType), this.withCredentials !== void 0 && (l.withCredentials = this.withCredentials), l.overrideMimeType && l.overrideMimeType(this.mimeType !== void 0 ? this.mimeType : "text/plain"); for (const d in this.requestHeader) l.setRequestHeader(d, this.requestHeader[d]); l.send(null); } return s.manager.itemStart(e), l; } setResponseType(e) { return this.responseType = e, this; } setMimeType(e) { return this.mimeType = e, this; } }; var mN = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = new Zn(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a6) { try { t(s.parse(JSON.parse(a6))); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } parse(e) { const t = []; for (let i = 0; i < e.length; i++) { const r = jo.parse(e[i]); t.push(r); } return t; } }; var gN = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = [], a6 = new If(), c = new Zn(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(s.withCredentials); let l = 0; function d(h6) { c.load(e[h6], function(f6) { const g6 = s.parse(f6, true); o[h6] = { width: g6.width, height: g6.height, format: g6.format, mipmaps: g6.mipmaps }, l += 1, l === 6 && (g6.mipmapCount === 1 && (a6.minFilter = zt), a6.image = o, a6.format = g6.format, a6.needsUpdate = true, t && t(a6)); }, i, r); } if (Array.isArray(e)) for (let h6 = 0, f6 = e.length; h6 < f6; ++h6) d(h6); else c.load(e, function(h6) { const f6 = s.parse(h6, true); if (f6.isCubemap) { const g6 = f6.mipmaps.length / f6.mipmapCount; for (let p = 0; p < g6; p++) { o[p] = { mipmaps: [] }; for (let u6 = 0; u6 < f6.mipmapCount; u6++) o[p].mipmaps.push(f6.mipmaps[p * f6.mipmapCount + u6]), o[p].format = f6.format, o[p].width = f6.width, o[p].height = f6.height; } a6.image = o; } else a6.image.width = f6.width, a6.image.height = f6.height, a6.mipmaps = f6.mipmaps; f6.mipmapCount === 1 && (a6.minFilter = zt), a6.format = f6.format, a6.needsUpdate = true, t && t(a6); }, i, r); return a6; } }; var Ya = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const s = this, o = Is.get(e); if (o !== void 0) return s.manager.itemStart(e), setTimeout(function() { t && t(o), s.manager.itemEnd(e); }, 0), o; const a6 = document.createElementNS("http://www.w3.org/1999/xhtml", "img"); function c() { a6.removeEventListener("load", c, false), a6.removeEventListener("error", l, false), Is.add(e, this), t && t(this), s.manager.itemEnd(e); } function l(d) { a6.removeEventListener("load", c, false), a6.removeEventListener("error", l, false), r && r(d), s.manager.itemError(e), s.manager.itemEnd(e); } return a6.addEventListener("load", c, false), a6.addEventListener("error", l, false), e.substr(0, 5) !== "data:" && this.crossOrigin !== void 0 && (a6.crossOrigin = this.crossOrigin), s.manager.itemStart(e), a6.src = e, a6; } }; var Bx = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = new ta(), o = new Ya(this.manager); o.setCrossOrigin(this.crossOrigin), o.setPath(this.path); let a6 = 0; function c(l) { o.load(e[l], function(d) { s.images[l] = d, a6++, a6 === 6 && (s.needsUpdate = true, t && t(s)); }, void 0, r); } for (let l = 0; l < e.length; ++l) c(l); return s; } }; var Ux = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = new Ss(), a6 = new Zn(this.manager); return a6.setResponseType("arraybuffer"), a6.setRequestHeader(this.requestHeader), a6.setPath(this.path), a6.setWithCredentials(s.withCredentials), a6.load(e, function(c) { const l = s.parse(c); l && (l.image !== void 0 ? o.image = l.image : l.data !== void 0 && (o.image.width = l.width, o.image.height = l.height, o.image.data = l.data), o.wrapS = l.wrapS !== void 0 ? l.wrapS : hn2, o.wrapT = l.wrapT !== void 0 ? l.wrapT : hn2, o.magFilter = l.magFilter !== void 0 ? l.magFilter : zt, o.minFilter = l.minFilter !== void 0 ? l.minFilter : zt, o.anisotropy = l.anisotropy !== void 0 ? l.anisotropy : 1, l.encoding !== void 0 && (o.encoding = l.encoding), l.flipY !== void 0 && (o.flipY = l.flipY), l.format !== void 0 && (o.format = l.format), l.type !== void 0 && (o.type = l.type), l.mipmaps !== void 0 && (o.mipmaps = l.mipmaps, o.minFilter = pr), l.mipmapCount === 1 && (o.minFilter = zt), l.generateMipmaps !== void 0 && (o.generateMipmaps = l.generateMipmaps), o.needsUpdate = true, t && t(o, l)); }, i, r), o; } }; var qf = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = new Yt(), o = new Ya(this.manager); return o.setCrossOrigin(this.crossOrigin), o.setPath(this.path), o.load(e, function(a6) { s.image = a6; const c = e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0; s.format = c ? ir : Hn, s.needsUpdate = true, t !== void 0 && t(s); }, i, r), s; } }; var zx = class extends $n { constructor() { super(), this.type = "CurvePath", this.curves = [], this.autoClose = false; } add(e) { this.curves.push(e); } closePath() { const e = this.curves[0].getPoint(0), t = this.curves[this.curves.length - 1].getPoint(1); e.equals(t) || this.curves.push(new Ml(t, e)); } // To get accurate point with reference to // entire path distance at time t, // following has to be done: // 1. Length of each sub path have to be known // 2. Locate and identify type of curve // 3. Get t for the curve // 4. Return curve.getPointAt(t') getPoint(e) { const t = e * this.getLength(), i = this.getCurveLengths(); let r = 0; for (; r < i.length; ) { if (i[r] >= t) { const s = i[r] - t, o = this.curves[r], a6 = o.getLength(), c = a6 === 0 ? 0 : 1 - s / a6; return o.getPointAt(c); } r++; } return null; } // We cannot use the default THREE.Curve getPoint() with getLength() because in // THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath // getPoint() depends on getLength getLength() { const e = this.getCurveLengths(); return e[e.length - 1]; } // cacheLengths must be recalculated. updateArcLengths() { this.needsUpdate = true, this.cacheLengths = null, this.getCurveLengths(); } // Compute lengths and cache them // We cannot overwrite getLengths() because UtoT mapping uses it. getCurveLengths() { if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths; const e = []; let t = 0; for (let i = 0, r = this.curves.length; i < r; i++) t += this.curves[i].getLength(), e.push(t); return this.cacheLengths = e, e; } getSpacedPoints(e = 40) { const t = []; for (let i = 0; i <= e; i++) t.push(this.getPoint(i / e)); return this.autoClose && t.push(t[0]), t; } getPoints(e = 12) { const t = []; let i; for (let r = 0, s = this.curves; r < s.length; r++) { const o = s[r], a6 = o && o.isEllipseCurve ? e * 2 : o && (o.isLineCurve || o.isLineCurve3) ? 1 : o && o.isSplineCurve ? e * o.points.length : e, c = o.getPoints(a6); for (let l = 0; l < c.length; l++) { const d = c[l]; i && i.equals(d) || (t.push(d), i = d); } } return this.autoClose && t.length > 1 && !t[t.length - 1].equals(t[0]) && t.push(t[0]), t; } copy(e) { super.copy(e), this.curves = []; for (let t = 0, i = e.curves.length; t < i; t++) { const r = e.curves[t]; this.curves.push(r.clone()); } return this.autoClose = e.autoClose, this; } toJSON() { const e = super.toJSON(); e.autoClose = this.autoClose, e.curves = []; for (let t = 0, i = this.curves.length; t < i; t++) { const r = this.curves[t]; e.curves.push(r.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.autoClose = e.autoClose, this.curves = []; for (let t = 0, i = e.curves.length; t < i; t++) { const r = e.curves[t]; this.curves.push(new kf[r.type]().fromJSON(r)); } return this; } }; var Ja = class extends zx { constructor(e) { super(), this.type = "Path", this.currentPoint = new Re(), e && this.setFromPoints(e); } setFromPoints(e) { this.moveTo(e[0].x, e[0].y); for (let t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y); return this; } moveTo(e, t) { return this.currentPoint.set(e, t), this; } lineTo(e, t) { const i = new Ml(this.currentPoint.clone(), new Re(e, t)); return this.curves.push(i), this.currentPoint.set(e, t), this; } quadraticCurveTo(e, t, i, r) { const s = new _u( this.currentPoint.clone(), new Re(e, t), new Re(i, r) ); return this.curves.push(s), this.currentPoint.set(i, r), this; } bezierCurveTo(e, t, i, r, s, o) { const a6 = new Su( this.currentPoint.clone(), new Re(e, t), new Re(i, r), new Re(s, o) ); return this.curves.push(a6), this.currentPoint.set(s, o), this; } splineThru(e) { const t = [this.currentPoint.clone()].concat(e), i = new Tu(t); return this.curves.push(i), this.currentPoint.copy(e[e.length - 1]), this; } arc(e, t, i, r, s, o) { const a6 = this.currentPoint.x, c = this.currentPoint.y; return this.absarc( e + a6, t + c, i, r, s, o ), this; } absarc(e, t, i, r, s, o) { return this.absellipse(e, t, i, i, r, s, o), this; } ellipse(e, t, i, r, s, o, a6, c) { const l = this.currentPoint.x, d = this.currentPoint.y; return this.absellipse(e + l, t + d, i, r, s, o, a6, c), this; } absellipse(e, t, i, r, s, o, a6, c) { const l = new xl(e, t, i, r, s, o, a6, c); if (this.curves.length > 0) { const h6 = l.getPoint(0); h6.equals(this.currentPoint) || this.lineTo(h6.x, h6.y); } this.curves.push(l); const d = l.getPoint(1); return this.currentPoint.copy(d), this; } copy(e) { return super.copy(e), this.currentPoint.copy(e.currentPoint), this; } toJSON() { const e = super.toJSON(); return e.currentPoint = this.currentPoint.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.currentPoint.fromArray(e.currentPoint), this; } }; var Dr = class extends Ja { constructor(e) { super(e), this.uuid = Wn(), this.type = "Shape", this.holes = []; } getPointsHoles(e) { const t = []; for (let i = 0, r = this.holes.length; i < r; i++) t[i] = this.holes[i].getPoints(e); return t; } // get points of shape and holes (keypoints based on segments parameter) extractPoints(e) { return { shape: this.getPoints(e), holes: this.getPointsHoles(e) }; } copy(e) { super.copy(e), this.holes = []; for (let t = 0, i = e.holes.length; t < i; t++) { const r = e.holes[t]; this.holes.push(r.clone()); } return this; } toJSON() { const e = super.toJSON(); e.uuid = this.uuid, e.holes = []; for (let t = 0, i = this.holes.length; t < i; t++) { const r = this.holes[t]; e.holes.push(r.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.uuid = e.uuid, this.holes = []; for (let t = 0, i = e.holes.length; t < i; t++) { const r = e.holes[t]; this.holes.push(new Ja().fromJSON(r)); } return this; } }; var gi = class extends ut { constructor(e, t = 1) { super(), this.type = "Light", this.color = new Ue(e), this.intensity = t; } dispose() { } copy(e) { return super.copy(e), this.color.copy(e.color), this.intensity = e.intensity, this; } toJSON(e) { const t = super.toJSON(e); return t.object.color = this.color.getHex(), t.object.intensity = this.intensity, this.groundColor !== void 0 && (t.object.groundColor = this.groundColor.getHex()), this.distance !== void 0 && (t.object.distance = this.distance), this.angle !== void 0 && (t.object.angle = this.angle), this.decay !== void 0 && (t.object.decay = this.decay), this.penumbra !== void 0 && (t.object.penumbra = this.penumbra), this.shadow !== void 0 && (t.object.shadow = this.shadow.toJSON()), t; } }; gi.prototype.isLight = true; var Qf = class extends gi { constructor(e, t, i) { super(e, i), this.type = "HemisphereLight", this.position.copy(ut.DefaultUp), this.updateMatrix(), this.groundColor = new Ue(t); } copy(e) { return gi.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this; } }; Qf.prototype.isHemisphereLight = true; var kg = new Xe(); var Vg = new q4(); var Gg = new q4(); var ep = class { constructor(e) { this.camera = e, this.bias = 0, this.normalBias = 0, this.radius = 1, this.mapSize = new Re(512, 512), this.map = null, this.mapPass = null, this.matrix = new Xe(), this.autoUpdate = true, this.needsUpdate = false, this._frustum = new dl(), this._frameExtents = new Re(1, 1), this._viewportCount = 1, this._viewports = [ new xt(0, 0, 1, 1) ]; } getViewportCount() { return this._viewportCount; } getFrustum() { return this._frustum; } updateMatrices(e) { const t = this.camera, i = this.matrix; Vg.setFromMatrixPosition(e.matrixWorld), t.position.copy(Vg), Gg.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(Gg), t.updateMatrixWorld(), kg.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(kg), i.set( 0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1 ), i.multiply(t.projectionMatrix), i.multiply(t.matrixWorldInverse); } getViewport(e) { return this._viewports[e]; } getFrameExtents() { return this._frameExtents; } dispose() { this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose(); } copy(e) { return this.camera = e.camera.clone(), this.bias = e.bias, this.radius = e.radius, this.mapSize.copy(e.mapSize), this; } clone() { return new this.constructor().copy(this); } toJSON() { const e = {}; return this.bias !== 0 && (e.bias = this.bias), this.normalBias !== 0 && (e.normalBias = this.normalBias), this.radius !== 1 && (e.radius = this.radius), (this.mapSize.x !== 512 || this.mapSize.y !== 512) && (e.mapSize = this.mapSize.toArray()), e.camera = this.camera.toJSON(false).object, delete e.camera.matrix, e; } }; var kx = class extends ep { constructor() { super(new nn2(50, 1, 0.5, 500)), this.focus = 1; } updateMatrices(e) { const t = this.camera, i = ja * 2 * e.angle * this.focus, r = this.mapSize.width / this.mapSize.height, s = e.distance || t.far; (i !== t.fov || r !== t.aspect || s !== t.far) && (t.fov = i, t.aspect = r, t.far = s, t.updateProjectionMatrix()), super.updateMatrices(e); } copy(e) { return super.copy(e), this.focus = e.focus, this; } }; kx.prototype.isSpotLightShadow = true; var Cu = class extends gi { constructor(e, t, i = 0, r = Math.PI / 3, s = 0, o = 1) { super(e, t), this.type = "SpotLight", this.position.copy(ut.DefaultUp), this.updateMatrix(), this.target = new ut(), this.distance = i, this.angle = r, this.penumbra = s, this.decay = o, this.shadow = new kx(); } get power() { return this.intensity * Math.PI; } set power(e) { this.intensity = e / Math.PI; } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.distance = e.distance, this.angle = e.angle, this.penumbra = e.penumbra, this.decay = e.decay, this.target = e.target.clone(), this.shadow = e.shadow.clone(), this; } }; Cu.prototype.isSpotLight = true; var Hg = new Xe(); var xa = new q4(); var Ah = new q4(); var Vx = class extends ep { constructor() { super(new nn2(90, 1, 0.5, 500)), this._frameExtents = new Re(4, 2), this._viewportCount = 6, this._viewports = [ // These viewports map a cube-map onto a 2D texture with the // following orientation: // // xzXZ // y Y // // X - Positive x direction // x - Negative x direction // Y - Positive y direction // y - Negative y direction // Z - Positive z direction // z - Negative z direction // positive X new xt(2, 1, 1, 1), // negative X new xt(0, 1, 1, 1), // positive Z new xt(3, 1, 1, 1), // negative Z new xt(1, 1, 1, 1), // positive Y new xt(3, 0, 1, 1), // negative Y new xt(1, 0, 1, 1) ], this._cubeDirections = [ new q4(1, 0, 0), new q4(-1, 0, 0), new q4(0, 0, 1), new q4(0, 0, -1), new q4(0, 1, 0), new q4(0, -1, 0) ], this._cubeUps = [ new q4(0, 1, 0), new q4(0, 1, 0), new q4(0, 1, 0), new q4(0, 1, 0), new q4(0, 0, 1), new q4(0, 0, -1) ]; } updateMatrices(e, t = 0) { const i = this.camera, r = this.matrix, s = e.distance || i.far; s !== i.far && (i.far = s, i.updateProjectionMatrix()), xa.setFromMatrixPosition(e.matrixWorld), i.position.copy(xa), Ah.copy(i.position), Ah.add(this._cubeDirections[t]), i.up.copy(this._cubeUps[t]), i.lookAt(Ah), i.updateMatrixWorld(), r.makeTranslation(-xa.x, -xa.y, -xa.z), Hg.multiplyMatrices(i.projectionMatrix, i.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Hg); } }; Vx.prototype.isPointLightShadow = true; var Lu = class extends gi { constructor(e, t, i = 0, r = 1) { super(e, t), this.type = "PointLight", this.distance = i, this.decay = r, this.shadow = new Vx(); } get power() { return this.intensity * 4 * Math.PI; } set power(e) { this.intensity = e / (4 * Math.PI); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this; } }; Lu.prototype.isPointLight = true; var sa = class extends hl { constructor(e = -1, t = 1, i = 1, r = -1, s = 0.1, o = 2e3) { super(), this.type = "OrthographicCamera", this.zoom = 1, this.view = null, this.left = e, this.right = t, this.top = i, this.bottom = r, this.near = s, this.far = o, this.updateProjectionMatrix(); } copy(e, t) { return super.copy(e, t), this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.near = e.near, this.far = e.far, this.zoom = e.zoom, this.view = e.view === null ? null : Object.assign({}, e.view), this; } setViewOffset(e, t, i, r, s, o) { this.view === null && (this.view = { enabled: true, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1 }), this.view.enabled = true, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = i, this.view.offsetY = r, this.view.width = s, this.view.height = o, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = false), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = (this.right - this.left) / (2 * this.zoom), t = (this.top - this.bottom) / (2 * this.zoom), i = (this.right + this.left) / 2, r = (this.top + this.bottom) / 2; let s = i - e, o = i + e, a6 = r + t, c = r - t; if (this.view !== null && this.view.enabled) { const l = (this.right - this.left) / this.view.fullWidth / this.zoom, d = (this.top - this.bottom) / this.view.fullHeight / this.zoom; s += l * this.view.offsetX, o = s + l * this.view.width, a6 -= d * this.view.offsetY, c = a6 - d * this.view.height; } this.projectionMatrix.makeOrthographic(s, o, a6, c, this.near, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); } toJSON(e) { const t = super.toJSON(e); return t.object.zoom = this.zoom, t.object.left = this.left, t.object.right = this.right, t.object.top = this.top, t.object.bottom = this.bottom, t.object.near = this.near, t.object.far = this.far, this.view !== null && (t.object.view = Object.assign({}, this.view)), t; } }; sa.prototype.isOrthographicCamera = true; var Gx = class extends ep { constructor() { super(new sa(-5, 5, 5, -5, 0.5, 500)); } }; Gx.prototype.isDirectionalLightShadow = true; var Ru = class extends gi { constructor(e, t) { super(e, t), this.type = "DirectionalLight", this.position.copy(ut.DefaultUp), this.updateMatrix(), this.target = new ut(), this.shadow = new Gx(); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this; } }; Ru.prototype.isDirectionalLight = true; var tp = class extends gi { constructor(e, t) { super(e, t), this.type = "AmbientLight"; } }; tp.prototype.isAmbientLight = true; var np = class extends gi { constructor(e, t, i = 10, r = 10) { super(e, t), this.type = "RectAreaLight", this.width = i, this.height = r; } copy(e) { return super.copy(e), this.width = e.width, this.height = e.height, this; } toJSON(e) { const t = super.toJSON(e); return t.object.width = this.width, t.object.height = this.height, t; } }; np.prototype.isRectAreaLight = true; var ip = class { constructor() { this.coefficients = []; for (let e = 0; e < 9; e++) this.coefficients.push(new q4()); } set(e) { for (let t = 0; t < 9; t++) this.coefficients[t].copy(e[t]); return this; } zero() { for (let e = 0; e < 9; e++) this.coefficients[e].set(0, 0, 0); return this; } // get the radiance in the direction of the normal // target is a Vector3 getAt(e, t) { const i = e.x, r = e.y, s = e.z, o = this.coefficients; return t.copy(o[0]).multiplyScalar(0.282095), t.addScaledVector(o[1], 0.488603 * r), t.addScaledVector(o[2], 0.488603 * s), t.addScaledVector(o[3], 0.488603 * i), t.addScaledVector(o[4], 1.092548 * (i * r)), t.addScaledVector(o[5], 1.092548 * (r * s)), t.addScaledVector(o[6], 0.315392 * (3 * s * s - 1)), t.addScaledVector(o[7], 1.092548 * (i * s)), t.addScaledVector(o[8], 0.546274 * (i * i - r * r)), t; } // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal // target is a Vector3 // https://graphics.stanford.edu/papers/envmap/envmap.pdf getIrradianceAt(e, t) { const i = e.x, r = e.y, s = e.z, o = this.coefficients; return t.copy(o[0]).multiplyScalar(0.886227), t.addScaledVector(o[1], 2 * 0.511664 * r), t.addScaledVector(o[2], 2 * 0.511664 * s), t.addScaledVector(o[3], 2 * 0.511664 * i), t.addScaledVector(o[4], 2 * 0.429043 * i * r), t.addScaledVector(o[5], 2 * 0.429043 * r * s), t.addScaledVector(o[6], 0.743125 * s * s - 0.247708), t.addScaledVector(o[7], 2 * 0.429043 * i * s), t.addScaledVector(o[8], 0.429043 * (i * i - r * r)), t; } add(e) { for (let t = 0; t < 9; t++) this.coefficients[t].add(e.coefficients[t]); return this; } addScaledSH(e, t) { for (let i = 0; i < 9; i++) this.coefficients[i].addScaledVector(e.coefficients[i], t); return this; } scale(e) { for (let t = 0; t < 9; t++) this.coefficients[t].multiplyScalar(e); return this; } lerp(e, t) { for (let i = 0; i < 9; i++) this.coefficients[i].lerp(e.coefficients[i], t); return this; } equals(e) { for (let t = 0; t < 9; t++) if (!this.coefficients[t].equals(e.coefficients[t])) return false; return true; } copy(e) { return this.set(e.coefficients); } clone() { return new this.constructor().copy(this); } fromArray(e, t = 0) { const i = this.coefficients; for (let r = 0; r < 9; r++) i[r].fromArray(e, t + r * 3); return this; } toArray(e = [], t = 0) { const i = this.coefficients; for (let r = 0; r < 9; r++) i[r].toArray(e, t + r * 3); return e; } // evaluate the basis functions // shBasis is an Array[ 9 ] static getBasisAt(e, t) { const i = e.x, r = e.y, s = e.z; t[0] = 0.282095, t[1] = 0.488603 * r, t[2] = 0.488603 * s, t[3] = 0.488603 * i, t[4] = 1.092548 * i * r, t[5] = 1.092548 * r * s, t[6] = 0.315392 * (3 * s * s - 1), t[7] = 1.092548 * i * s, t[8] = 0.546274 * (i * i - r * r); } }; ip.prototype.isSphericalHarmonics3 = true; var Al = class extends gi { constructor(e = new ip(), t = 1) { super(void 0, t), this.sh = e; } copy(e) { return super.copy(e), this.sh.copy(e.sh), this; } fromJSON(e) { return this.intensity = e.intensity, this.sh.fromArray(e.sh), this; } toJSON(e) { const t = super.toJSON(e); return t.object.sh = this.sh.toArray(), t; } }; Al.prototype.isLightProbe = true; var Hx = class extends xn2 { constructor(e) { super(e), this.textures = {}; } load(e, t, i, r) { const s = this, o = new Zn(s.manager); o.setPath(s.path), o.setRequestHeader(s.requestHeader), o.setWithCredentials(s.withCredentials), o.load(e, function(a6) { try { t(s.parse(JSON.parse(a6))); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } parse(e) { const t = this.textures; function i(s) { return t[s] === void 0 && console.warn("THREE.MaterialLoader: Undefined texture", s), t[s]; } const r = new dN[e.type](); if (e.uuid !== void 0 && (r.uuid = e.uuid), e.name !== void 0 && (r.name = e.name), e.color !== void 0 && r.color !== void 0 && r.color.setHex(e.color), e.roughness !== void 0 && (r.roughness = e.roughness), e.metalness !== void 0 && (r.metalness = e.metalness), e.sheen !== void 0 && (r.sheen = new Ue().setHex(e.sheen)), e.emissive !== void 0 && r.emissive !== void 0 && r.emissive.setHex(e.emissive), e.specular !== void 0 && r.specular !== void 0 && r.specular.setHex(e.specular), e.shininess !== void 0 && (r.shininess = e.shininess), e.clearcoat !== void 0 && (r.clearcoat = e.clearcoat), e.clearcoatRoughness !== void 0 && (r.clearcoatRoughness = e.clearcoatRoughness), e.transmission !== void 0 && (r.transmission = e.transmission), e.thickness !== void 0 && (r.thickness = e.thickness), e.attenuationDistance !== void 0 && (r.attenuationDistance = e.attenuationDistance), e.attenuationColor !== void 0 && r.attenuationColor !== void 0 && r.attenuationColor.setHex(e.attenuationColor), e.fog !== void 0 && (r.fog = e.fog), e.flatShading !== void 0 && (r.flatShading = e.flatShading), e.blending !== void 0 && (r.blending = e.blending), e.combine !== void 0 && (r.combine = e.combine), e.side !== void 0 && (r.side = e.side), e.shadowSide !== void 0 && (r.shadowSide = e.shadowSide), e.opacity !== void 0 && (r.opacity = e.opacity), e.transparent !== void 0 && (r.transparent = e.transparent), e.alphaTest !== void 0 && (r.alphaTest = e.alphaTest), e.depthTest !== void 0 && (r.depthTest = e.depthTest), e.depthWrite !== void 0 && (r.depthWrite = e.depthWrite), e.colorWrite !== void 0 && (r.colorWrite = e.colorWrite), e.stencilWrite !== void 0 && (r.stencilWrite = e.stencilWrite), e.stencilWriteMask !== void 0 && (r.stencilWriteMask = e.stencilWriteMask), e.stencilFunc !== void 0 && (r.stencilFunc = e.stencilFunc), e.stencilRef !== void 0 && (r.stencilRef = e.stencilRef), e.stencilFuncMask !== void 0 && (r.stencilFuncMask = e.stencilFuncMask), e.stencilFail !== void 0 && (r.stencilFail = e.stencilFail), e.stencilZFail !== void 0 && (r.stencilZFail = e.stencilZFail), e.stencilZPass !== void 0 && (r.stencilZPass = e.stencilZPass), e.wireframe !== void 0 && (r.wireframe = e.wireframe), e.wireframeLinewidth !== void 0 && (r.wireframeLinewidth = e.wireframeLinewidth), e.wireframeLinecap !== void 0 && (r.wireframeLinecap = e.wireframeLinecap), e.wireframeLinejoin !== void 0 && (r.wireframeLinejoin = e.wireframeLinejoin), e.rotation !== void 0 && (r.rotation = e.rotation), e.linewidth !== 1 && (r.linewidth = e.linewidth), e.dashSize !== void 0 && (r.dashSize = e.dashSize), e.gapSize !== void 0 && (r.gapSize = e.gapSize), e.scale !== void 0 && (r.scale = e.scale), e.polygonOffset !== void 0 && (r.polygonOffset = e.polygonOffset), e.polygonOffsetFactor !== void 0 && (r.polygonOffsetFactor = e.polygonOffsetFactor), e.polygonOffsetUnits !== void 0 && (r.polygonOffsetUnits = e.polygonOffsetUnits), e.morphTargets !== void 0 && (r.morphTargets = e.morphTargets), e.morphNormals !== void 0 && (r.morphNormals = e.morphNormals), e.dithering !== void 0 && (r.dithering = e.dithering), e.alphaToCoverage !== void 0 && (r.alphaToCoverage = e.alphaToCoverage), e.premultipliedAlpha !== void 0 && (r.premultipliedAlpha = e.premultipliedAlpha), e.vertexTangents !== void 0 && (r.vertexTangents = e.vertexTangents), e.visible !== void 0 && (r.visible = e.visible), e.toneMapped !== void 0 && (r.toneMapped = e.toneMapped), e.userData !== void 0 && (r.userData = e.userData), e.vertexColors !== void 0 && (typeof e.vertexColors == "number" ? r.vertexColors = e.vertexColors > 0 : r.vertexColors = e.vertexColors), e.uniforms !== void 0) for (const s in e.uniforms) { const o = e.uniforms[s]; switch (r.uniforms[s] = {}, o.type) { case "t": r.uniforms[s].value = i(o.value); break; case "c": r.uniforms[s].value = new Ue().setHex(o.value); break; case "v2": r.uniforms[s].value = new Re().fromArray(o.value); break; case "v3": r.uniforms[s].value = new q4().fromArray(o.value); break; case "v4": r.uniforms[s].value = new xt().fromArray(o.value); break; case "m3": r.uniforms[s].value = new rn2().fromArray(o.value); break; case "m4": r.uniforms[s].value = new Xe().fromArray(o.value); break; default: r.uniforms[s].value = o.value; } } if (e.defines !== void 0 && (r.defines = e.defines), e.vertexShader !== void 0 && (r.vertexShader = e.vertexShader), e.fragmentShader !== void 0 && (r.fragmentShader = e.fragmentShader), e.extensions !== void 0) for (const s in e.extensions) r.extensions[s] = e.extensions[s]; if (e.shading !== void 0 && (r.flatShading = e.shading === 1), e.size !== void 0 && (r.size = e.size), e.sizeAttenuation !== void 0 && (r.sizeAttenuation = e.sizeAttenuation), e.map !== void 0 && (r.map = i(e.map)), e.matcap !== void 0 && (r.matcap = i(e.matcap)), e.alphaMap !== void 0 && (r.alphaMap = i(e.alphaMap)), e.bumpMap !== void 0 && (r.bumpMap = i(e.bumpMap)), e.bumpScale !== void 0 && (r.bumpScale = e.bumpScale), e.normalMap !== void 0 && (r.normalMap = i(e.normalMap)), e.normalMapType !== void 0 && (r.normalMapType = e.normalMapType), e.normalScale !== void 0) { let s = e.normalScale; Array.isArray(s) === false && (s = [s, s]), r.normalScale = new Re().fromArray(s); } return e.displacementMap !== void 0 && (r.displacementMap = i(e.displacementMap)), e.displacementScale !== void 0 && (r.displacementScale = e.displacementScale), e.displacementBias !== void 0 && (r.displacementBias = e.displacementBias), e.roughnessMap !== void 0 && (r.roughnessMap = i(e.roughnessMap)), e.metalnessMap !== void 0 && (r.metalnessMap = i(e.metalnessMap)), e.emissiveMap !== void 0 && (r.emissiveMap = i(e.emissiveMap)), e.emissiveIntensity !== void 0 && (r.emissiveIntensity = e.emissiveIntensity), e.specularMap !== void 0 && (r.specularMap = i(e.specularMap)), e.envMap !== void 0 && (r.envMap = i(e.envMap)), e.envMapIntensity !== void 0 && (r.envMapIntensity = e.envMapIntensity), e.reflectivity !== void 0 && (r.reflectivity = e.reflectivity), e.refractionRatio !== void 0 && (r.refractionRatio = e.refractionRatio), e.lightMap !== void 0 && (r.lightMap = i(e.lightMap)), e.lightMapIntensity !== void 0 && (r.lightMapIntensity = e.lightMapIntensity), e.aoMap !== void 0 && (r.aoMap = i(e.aoMap)), e.aoMapIntensity !== void 0 && (r.aoMapIntensity = e.aoMapIntensity), e.gradientMap !== void 0 && (r.gradientMap = i(e.gradientMap)), e.clearcoatMap !== void 0 && (r.clearcoatMap = i(e.clearcoatMap)), e.clearcoatRoughnessMap !== void 0 && (r.clearcoatRoughnessMap = i(e.clearcoatRoughnessMap)), e.clearcoatNormalMap !== void 0 && (r.clearcoatNormalMap = i(e.clearcoatNormalMap)), e.clearcoatNormalScale !== void 0 && (r.clearcoatNormalScale = new Re().fromArray(e.clearcoatNormalScale)), e.transmissionMap !== void 0 && (r.transmissionMap = i(e.transmissionMap)), e.thicknessMap !== void 0 && (r.thicknessMap = i(e.thicknessMap)), r; } setTextures(e) { return this.textures = e, this; } }; var rr = class { static decodeText(e) { if (typeof TextDecoder < "u") return new TextDecoder().decode(e); let t = ""; for (let i = 0, r = e.length; i < r; i++) t += String.fromCharCode(e[i]); try { return decodeURIComponent(escape(t)); } catch { return t; } } static extractUrlBase(e) { const t = e.lastIndexOf("/"); return t === -1 ? "./" : e.substr(0, t + 1); } }; var rp = class extends Ke { constructor() { super(), this.type = "InstancedBufferGeometry", this.instanceCount = 1 / 0; } copy(e) { return super.copy(e), this.instanceCount = e.instanceCount, this; } clone() { return new this.constructor().copy(this); } toJSON() { const e = super.toJSON(this); return e.instanceCount = this.instanceCount, e.isInstancedBufferGeometry = true, e; } }; rp.prototype.isInstancedBufferGeometry = true; var sp = class extends ot { constructor(e, t, i, r = 1) { typeof i == "number" && (r = i, i = false, console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")), super(e, t, i), this.meshPerAttribute = r; } copy(e) { return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this; } toJSON() { const e = super.toJSON(); return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = true, e; } }; sp.prototype.isInstancedBufferAttribute = true; var Wx = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = new Zn(s.manager); o.setPath(s.path), o.setRequestHeader(s.requestHeader), o.setWithCredentials(s.withCredentials), o.load(e, function(a6) { try { t(s.parse(JSON.parse(a6))); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } parse(e) { const t = {}, i = {}; function r(g6, p) { if (t[p] !== void 0) return t[p]; const y6 = g6.interleavedBuffers[p], v6 = s(g6, y6.buffer), m6 = mo(y6.type, v6), x6 = new Qr(m6, y6.stride); return x6.uuid = y6.uuid, t[p] = x6, x6; } function s(g6, p) { if (i[p] !== void 0) return i[p]; const y6 = g6.arrayBuffers[p], v6 = new Uint32Array(y6).buffer; return i[p] = v6, v6; } const o = e.isInstancedBufferGeometry ? new rp() : new Ke(), a6 = e.data.index; if (a6 !== void 0) { const g6 = mo(a6.type, a6.array); o.setIndex(new ot(g6, 1)); } const c = e.data.attributes; for (const g6 in c) { const p = c[g6]; let u6; if (p.isInterleavedBufferAttribute) { const y6 = r(e.data, p.data); u6 = new lr(y6, p.itemSize, p.offset, p.normalized); } else { const y6 = mo(p.type, p.array), v6 = p.isInstancedBufferAttribute ? sp : ot; u6 = new v6(y6, p.itemSize, p.normalized); } p.name !== void 0 && (u6.name = p.name), p.usage !== void 0 && u6.setUsage(p.usage), p.updateRange !== void 0 && (u6.updateRange.offset = p.updateRange.offset, u6.updateRange.count = p.updateRange.count), o.setAttribute(g6, u6); } const l = e.data.morphAttributes; if (l) for (const g6 in l) { const p = l[g6], u6 = []; for (let y6 = 0, v6 = p.length; y6 < v6; y6++) { const m6 = p[y6]; let x6; if (m6.isInterleavedBufferAttribute) { const w6 = r(e.data, m6.data); x6 = new lr(w6, m6.itemSize, m6.offset, m6.normalized); } else { const w6 = mo(m6.type, m6.array); x6 = new ot(w6, m6.itemSize, m6.normalized); } m6.name !== void 0 && (x6.name = m6.name), u6.push(x6); } o.morphAttributes[g6] = u6; } e.data.morphTargetsRelative && (o.morphTargetsRelative = true); const h6 = e.data.groups || e.data.drawcalls || e.data.offsets; if (h6 !== void 0) for (let g6 = 0, p = h6.length; g6 !== p; ++g6) { const u6 = h6[g6]; o.addGroup(u6.start, u6.count, u6.materialIndex); } const f6 = e.data.boundingSphere; if (f6 !== void 0) { const g6 = new q4(); f6.center !== void 0 && g6.fromArray(f6.center), o.boundingSphere = new mr(g6, f6.radius); } return e.name && (o.name = e.name), e.userData && (o.userData = e.userData), o; } }; var vN = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = this.path === "" ? rr.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || o; const a6 = new Zn(this.manager); a6.setPath(this.path), a6.setRequestHeader(this.requestHeader), a6.setWithCredentials(this.withCredentials), a6.load(e, function(c) { let l = null; try { l = JSON.parse(c); } catch (h6) { r !== void 0 && r(h6), console.error("THREE:ObjectLoader: Can't parse " + e + ".", h6.message); return; } const d = l.metadata; if (d === void 0 || d.type === void 0 || d.type.toLowerCase() === "geometry") { console.error("THREE.ObjectLoader: Can't load " + e); return; } s.parse(l, t); }, i, r); } async loadAsync(e, t) { const i = this, r = this.path === "" ? rr.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || r; const s = new Zn(this.manager); s.setPath(this.path), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials); const o = await s.loadAsync(e, t), a6 = JSON.parse(o), c = a6.metadata; if (c === void 0 || c.type === void 0 || c.type.toLowerCase() === "geometry") throw new Error("THREE.ObjectLoader: Can't load " + e); return await i.parseAsync(a6); } parse(e, t) { const i = this.parseAnimations(e.animations), r = this.parseShapes(e.shapes), s = this.parseGeometries(e.geometries, r), o = this.parseImages(e.images, function() { t !== void 0 && t(l); }), a6 = this.parseTextures(e.textures, o), c = this.parseMaterials(e.materials, a6), l = this.parseObject(e.object, s, c, a6, i), d = this.parseSkeletons(e.skeletons, l); if (this.bindSkeletons(l, d), t !== void 0) { let h6 = false; for (const f6 in o) if (o[f6] instanceof HTMLImageElement) { h6 = true; break; } h6 === false && t(l); } return l; } async parseAsync(e) { const t = this.parseAnimations(e.animations), i = this.parseShapes(e.shapes), r = this.parseGeometries(e.geometries, i), s = await this.parseImagesAsync(e.images), o = this.parseTextures(e.textures, s), a6 = this.parseMaterials(e.materials, o), c = this.parseObject(e.object, r, a6, o, t), l = this.parseSkeletons(e.skeletons, c); return this.bindSkeletons(c, l), c; } parseShapes(e) { const t = {}; if (e !== void 0) for (let i = 0, r = e.length; i < r; i++) { const s = new Dr().fromJSON(e[i]); t[s.uuid] = s; } return t; } parseSkeletons(e, t) { const i = {}, r = {}; if (t.traverse(function(s) { s.isBone && (r[s.uuid] = s); }), e !== void 0) for (let s = 0, o = e.length; s < o; s++) { const a6 = new bl().fromJSON(e[s], r); i[a6.uuid] = a6; } return i; } parseGeometries(e, t) { const i = {}; if (e !== void 0) { const r = new Wx(); for (let s = 0, o = e.length; s < o; s++) { let a6; const c = e[s]; switch (c.type) { case "BufferGeometry": case "InstancedBufferGeometry": a6 = r.parse(c); break; case "Geometry": console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported."); break; default: c.type in zg ? a6 = zg[c.type].fromJSON(c, t) : console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`); } a6.uuid = c.uuid, c.name !== void 0 && (a6.name = c.name), a6.isBufferGeometry === true && c.userData !== void 0 && (a6.userData = c.userData), i[c.uuid] = a6; } } return i; } parseMaterials(e, t) { const i = {}, r = {}; if (e !== void 0) { const s = new Hx(); s.setTextures(t); for (let o = 0, a6 = e.length; o < a6; o++) { const c = e[o]; if (c.type === "MultiMaterial") { const l = []; for (let d = 0; d < c.materials.length; d++) { const h6 = c.materials[d]; i[h6.uuid] === void 0 && (i[h6.uuid] = s.parse(h6)), l.push(i[h6.uuid]); } r[c.uuid] = l; } else i[c.uuid] === void 0 && (i[c.uuid] = s.parse(c)), r[c.uuid] = i[c.uuid]; } } return r; } parseAnimations(e) { const t = {}; if (e !== void 0) for (let i = 0; i < e.length; i++) { const r = e[i], s = jo.parse(r); t[s.uuid] = s; } return t; } parseImages(e, t) { const i = this, r = {}; let s; function o(c) { return i.manager.itemStart(c), s.load(c, function() { i.manager.itemEnd(c); }, void 0, function() { i.manager.itemError(c), i.manager.itemEnd(c); }); } function a6(c) { if (typeof c == "string") { const l = c, d = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(l) ? l : i.resourcePath + l; return o(d); } else return c.data ? { data: mo(c.type, c.data), width: c.width, height: c.height } : null; } if (e !== void 0 && e.length > 0) { const c = new Kf(t); s = new Ya(c), s.setCrossOrigin(this.crossOrigin); for (let l = 0, d = e.length; l < d; l++) { const h6 = e[l], f6 = h6.url; if (Array.isArray(f6)) { r[h6.uuid] = []; for (let g6 = 0, p = f6.length; g6 < p; g6++) { const u6 = f6[g6], y6 = a6(u6); y6 !== null && (y6 instanceof HTMLImageElement ? r[h6.uuid].push(y6) : r[h6.uuid].push(new Ss(y6.data, y6.width, y6.height))); } } else { const g6 = a6(h6.url); g6 !== null && (r[h6.uuid] = g6); } } } return r; } async parseImagesAsync(e) { const t = this, i = {}; let r; async function s(o) { if (typeof o == "string") { const a6 = o, c = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(a6) ? a6 : t.resourcePath + a6; return await r.loadAsync(c); } else return o.data ? { data: mo(o.type, o.data), width: o.width, height: o.height } : null; } if (e !== void 0 && e.length > 0) { r = new Ya(this.manager), r.setCrossOrigin(this.crossOrigin); for (let o = 0, a6 = e.length; o < a6; o++) { const c = e[o], l = c.url; if (Array.isArray(l)) { i[c.uuid] = []; for (let d = 0, h6 = l.length; d < h6; d++) { const f6 = l[d], g6 = await s(f6); g6 !== null && (g6 instanceof HTMLImageElement ? i[c.uuid].push(g6) : i[c.uuid].push(new Ss(g6.data, g6.width, g6.height))); } } else { const d = await s(c.url); d !== null && (i[c.uuid] = d); } } } return i; } parseTextures(e, t) { function i(s, o) { return typeof s == "number" ? s : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", s), o[s]); } const r = {}; if (e !== void 0) for (let s = 0, o = e.length; s < o; s++) { const a6 = e[s]; a6.image === void 0 && console.warn('THREE.ObjectLoader: No "image" specified for', a6.uuid), t[a6.image] === void 0 && console.warn("THREE.ObjectLoader: Undefined image", a6.image); let c; const l = t[a6.image]; Array.isArray(l) ? (c = new ta(l), l.length === 6 && (c.needsUpdate = true)) : (l && l.data ? c = new Ss(l.data, l.width, l.height) : c = new Yt(l), l && (c.needsUpdate = true)), c.uuid = a6.uuid, a6.name !== void 0 && (c.name = a6.name), a6.mapping !== void 0 && (c.mapping = i(a6.mapping, yN)), a6.offset !== void 0 && c.offset.fromArray(a6.offset), a6.repeat !== void 0 && c.repeat.fromArray(a6.repeat), a6.center !== void 0 && c.center.fromArray(a6.center), a6.rotation !== void 0 && (c.rotation = a6.rotation), a6.wrap !== void 0 && (c.wrapS = i(a6.wrap[0], Wg), c.wrapT = i(a6.wrap[1], Wg)), a6.format !== void 0 && (c.format = a6.format), a6.type !== void 0 && (c.type = a6.type), a6.encoding !== void 0 && (c.encoding = a6.encoding), a6.minFilter !== void 0 && (c.minFilter = i(a6.minFilter, jg)), a6.magFilter !== void 0 && (c.magFilter = i(a6.magFilter, jg)), a6.anisotropy !== void 0 && (c.anisotropy = a6.anisotropy), a6.flipY !== void 0 && (c.flipY = a6.flipY), a6.premultiplyAlpha !== void 0 && (c.premultiplyAlpha = a6.premultiplyAlpha), a6.unpackAlignment !== void 0 && (c.unpackAlignment = a6.unpackAlignment), r[a6.uuid] = c; } return r; } parseObject(e, t, i, r, s) { let o; function a6(f6) { return t[f6] === void 0 && console.warn("THREE.ObjectLoader: Undefined geometry", f6), t[f6]; } function c(f6) { if (f6 !== void 0) { if (Array.isArray(f6)) { const g6 = []; for (let p = 0, u6 = f6.length; p < u6; p++) { const y6 = f6[p]; i[y6] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", y6), g6.push(i[y6]); } return g6; } return i[f6] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", f6), i[f6]; } } function l(f6) { return r[f6] === void 0 && console.warn("THREE.ObjectLoader: Undefined texture", f6), r[f6]; } let d, h6; switch (e.type) { case "Scene": o = new wu(), e.background !== void 0 && (Number.isInteger(e.background) ? o.background = new Ue(e.background) : o.background = l(e.background)), e.environment !== void 0 && (o.environment = l(e.environment)), e.fog !== void 0 && (e.fog.type === "Fog" ? o.fog = new pl(e.fog.color, e.fog.near, e.fog.far) : e.fog.type === "FogExp2" && (o.fog = new fl(e.fog.color, e.fog.density))); break; case "PerspectiveCamera": o = new nn2(e.fov, e.aspect, e.near, e.far), e.focus !== void 0 && (o.focus = e.focus), e.zoom !== void 0 && (o.zoom = e.zoom), e.filmGauge !== void 0 && (o.filmGauge = e.filmGauge), e.filmOffset !== void 0 && (o.filmOffset = e.filmOffset), e.view !== void 0 && (o.view = Object.assign({}, e.view)); break; case "OrthographicCamera": o = new sa(e.left, e.right, e.top, e.bottom, e.near, e.far), e.zoom !== void 0 && (o.zoom = e.zoom), e.view !== void 0 && (o.view = Object.assign({}, e.view)); break; case "AmbientLight": o = new tp(e.color, e.intensity); break; case "DirectionalLight": o = new Ru(e.color, e.intensity); break; case "PointLight": o = new Lu(e.color, e.intensity, e.distance, e.decay); break; case "RectAreaLight": o = new np(e.color, e.intensity, e.width, e.height); break; case "SpotLight": o = new Cu(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay); break; case "HemisphereLight": o = new Qf(e.color, e.groundColor, e.intensity); break; case "LightProbe": o = new Al().fromJSON(e); break; case "SkinnedMesh": d = a6(e.geometry), h6 = c(e.material), o = new vl(d, h6), e.bindMode !== void 0 && (o.bindMode = e.bindMode), e.bindMatrix !== void 0 && o.bindMatrix.fromArray(e.bindMatrix), e.skeleton !== void 0 && (o.skeleton = e.skeleton); break; case "Mesh": d = a6(e.geometry), h6 = c(e.material), o = new Xt(d, h6); break; case "InstancedMesh": d = a6(e.geometry), h6 = c(e.material); const f6 = e.count, g6 = e.instanceMatrix, p = e.instanceColor; o = new Pf(d, h6, f6), o.instanceMatrix = new ot(new Float32Array(g6.array), 16), p !== void 0 && (o.instanceColor = new ot(new Float32Array(p.array), p.itemSize)); break; case "LOD": o = new _x(); break; case "Line": o = new Oi(a6(e.geometry), c(e.material)); break; case "LineLoop": o = new Au(a6(e.geometry), c(e.material)); break; case "LineSegments": o = new Rn(a6(e.geometry), c(e.material)); break; case "PointCloud": case "Points": o = new ia(a6(e.geometry), c(e.material)); break; case "Sprite": o = new gl(c(e.material)); break; case "Group": o = new _i(); break; case "Bone": o = new yl(); break; default: o = new ut(); } if (o.uuid = e.uuid, e.name !== void 0 && (o.name = e.name), e.matrix !== void 0 ? (o.matrix.fromArray(e.matrix), e.matrixAutoUpdate !== void 0 && (o.matrixAutoUpdate = e.matrixAutoUpdate), o.matrixAutoUpdate && o.matrix.decompose(o.position, o.quaternion, o.scale)) : (e.position !== void 0 && o.position.fromArray(e.position), e.rotation !== void 0 && o.rotation.fromArray(e.rotation), e.quaternion !== void 0 && o.quaternion.fromArray(e.quaternion), e.scale !== void 0 && o.scale.fromArray(e.scale)), e.castShadow !== void 0 && (o.castShadow = e.castShadow), e.receiveShadow !== void 0 && (o.receiveShadow = e.receiveShadow), e.shadow && (e.shadow.bias !== void 0 && (o.shadow.bias = e.shadow.bias), e.shadow.normalBias !== void 0 && (o.shadow.normalBias = e.shadow.normalBias), e.shadow.radius !== void 0 && (o.shadow.radius = e.shadow.radius), e.shadow.mapSize !== void 0 && o.shadow.mapSize.fromArray(e.shadow.mapSize), e.shadow.camera !== void 0 && (o.shadow.camera = this.parseObject(e.shadow.camera))), e.visible !== void 0 && (o.visible = e.visible), e.frustumCulled !== void 0 && (o.frustumCulled = e.frustumCulled), e.renderOrder !== void 0 && (o.renderOrder = e.renderOrder), e.userData !== void 0 && (o.userData = e.userData), e.layers !== void 0 && (o.layers.mask = e.layers), e.children !== void 0) { const f6 = e.children; for (let g6 = 0; g6 < f6.length; g6++) o.add(this.parseObject(f6[g6], t, i, r, s)); } if (e.animations !== void 0) { const f6 = e.animations; for (let g6 = 0; g6 < f6.length; g6++) { const p = f6[g6]; o.animations.push(s[p]); } } if (e.type === "LOD") { e.autoUpdate !== void 0 && (o.autoUpdate = e.autoUpdate); const f6 = e.levels; for (let g6 = 0; g6 < f6.length; g6++) { const p = f6[g6], u6 = o.getObjectByProperty("uuid", p.object); u6 !== void 0 && o.addLevel(u6, p.distance); } } return o; } bindSkeletons(e, t) { Object.keys(t).length !== 0 && e.traverse(function(i) { if (i.isSkinnedMesh === true && i.skeleton !== void 0) { const r = t[i.skeleton]; r === void 0 ? console.warn("THREE.ObjectLoader: No skeleton found with UUID:", i.skeleton) : i.bind(r, i.bindMatrix); } }); } /* DEPRECATED */ setTexturePath(e) { return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."), this.setResourcePath(e); } }; var yN = { UVMapping: hu, CubeReflectionMapping: ll, CubeRefractionMapping: cl, EquirectangularReflectionMapping: Vc, EquirectangularRefractionMapping: Gc, CubeUVReflectionMapping: ea, CubeUVRefractionMapping: ul }; var Wg = { RepeatWrapping: jr, ClampToEdgeWrapping: hn2, MirroredRepeatWrapping: Eo }; var jg = { NearestFilter: $t, NearestMipmapNearestFilter: Va, NearestMipmapLinearFilter: Ga, LinearFilter: zt, LinearMipmapNearestFilter: du, LinearMipmapLinearFilter: pr }; var op = class extends xn2 { constructor(e) { super(e), typeof createImageBitmap > "u" && console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."), typeof fetch > "u" && console.warn("THREE.ImageBitmapLoader: fetch() not supported."), this.options = { premultiplyAlpha: "none" }; } setOptions(e) { return this.options = e, this; } load(e, t, i, r) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const s = this, o = Is.get(e); if (o !== void 0) return s.manager.itemStart(e), setTimeout(function() { t && t(o), s.manager.itemEnd(e); }, 0), o; const a6 = {}; a6.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include", a6.headers = this.requestHeader, fetch(e, a6).then(function(c) { return c.blob(); }).then(function(c) { return createImageBitmap(c, Object.assign(s.options, { colorSpaceConversion: "none" })); }).then(function(c) { Is.add(e, c), t && t(c), s.manager.itemEnd(e); }).catch(function(c) { r && r(c), s.manager.itemError(e), s.manager.itemEnd(e); }), s.manager.itemStart(e); } }; op.prototype.isImageBitmapLoader = true; var jx = class { constructor() { this.type = "ShapePath", this.color = new Ue(), this.subPaths = [], this.currentPath = null; } moveTo(e, t) { return this.currentPath = new Ja(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(e, t), this; } lineTo(e, t) { return this.currentPath.lineTo(e, t), this; } quadraticCurveTo(e, t, i, r) { return this.currentPath.quadraticCurveTo(e, t, i, r), this; } bezierCurveTo(e, t, i, r, s, o) { return this.currentPath.bezierCurveTo(e, t, i, r, s, o), this; } splineThru(e) { return this.currentPath.splineThru(e), this; } toShapes(e, t) { function i(m6) { const x6 = []; for (let w6 = 0, A6 = m6.length; w6 < A6; w6++) { const M6 = m6[w6], R6 = new Dr(); R6.curves = M6.curves, x6.push(R6); } return x6; } function r(m6, x6) { const w6 = x6.length; let A6 = false; for (let M6 = w6 - 1, R6 = 0; R6 < w6; M6 = R6++) { let L6 = x6[M6], T6 = x6[R6], P6 = T6.x - L6.x, _6 = T6.y - L6.y; if (Math.abs(_6) > Number.EPSILON) { if (_6 < 0 && (L6 = x6[R6], P6 = -P6, T6 = x6[M6], _6 = -_6), m6.y < L6.y || m6.y > T6.y) continue; if (m6.y === L6.y) { if (m6.x === L6.x) return true; } else { const S6 = _6 * (m6.x - L6.x) - P6 * (m6.y - L6.y); if (S6 === 0) return true; if (S6 < 0) continue; A6 = !A6; } } else { if (m6.y !== L6.y) continue; if (T6.x <= m6.x && m6.x <= L6.x || L6.x <= m6.x && m6.x <= T6.x) return true; } } return A6; } const s = Fi.isClockWise, o = this.subPaths; if (o.length === 0) return []; if (t === true) return i(o); let a6, c, l; const d = []; if (o.length === 1) return c = o[0], l = new Dr(), l.curves = c.curves, d.push(l), d; let h6 = !s(o[0].getPoints()); h6 = e ? !h6 : h6; const f6 = [], g6 = []; let p = [], u6 = 0, y6; g6[u6] = void 0, p[u6] = []; for (let m6 = 0, x6 = o.length; m6 < x6; m6++) c = o[m6], y6 = c.getPoints(), a6 = s(y6), a6 = e ? !a6 : a6, a6 ? (!h6 && g6[u6] && u6++, g6[u6] = { s: new Dr(), p: y6 }, g6[u6].s.curves = c.curves, h6 && u6++, p[u6] = []) : p[u6].push({ h: c, p: y6[0] }); if (!g6[0]) return i(o); if (g6.length > 1) { let m6 = false; const x6 = []; for (let w6 = 0, A6 = g6.length; w6 < A6; w6++) f6[w6] = []; for (let w6 = 0, A6 = g6.length; w6 < A6; w6++) { const M6 = p[w6]; for (let R6 = 0; R6 < M6.length; R6++) { const L6 = M6[R6]; let T6 = true; for (let P6 = 0; P6 < g6.length; P6++) r(L6.p, g6[P6].p) && (w6 !== P6 && x6.push({ froms: w6, tos: P6, hole: R6 }), T6 ? (T6 = false, f6[P6].push(L6)) : m6 = true); T6 && f6[w6].push(L6); } } x6.length > 0 && (m6 || (p = f6)); } let v6; for (let m6 = 0, x6 = g6.length; m6 < x6; m6++) { l = g6[m6].s, d.push(l), v6 = p[m6]; for (let w6 = 0, A6 = v6.length; w6 < A6; w6++) l.holes.push(v6[w6].h); } return d; } }; var ap = class { constructor(e) { this.type = "Font", this.data = e; } generateShapes(e, t = 100) { const i = [], r = bN(e, t, this.data); for (let s = 0, o = r.length; s < o; s++) Array.prototype.push.apply(i, r[s].toShapes()); return i; } }; function bN(n, e, t) { const i = Array.from(n), r = e / t.resolution, s = (t.boundingBox.yMax - t.boundingBox.yMin + t.underlineThickness) * r, o = []; let a6 = 0, c = 0; for (let l = 0; l < i.length; l++) { const d = i[l]; if (d === ` `) a6 = 0, c -= s; else { const h6 = xN(d, r, a6, c, t); a6 += h6.offsetX, o.push(h6.path); } } return o; } function xN(n, e, t, i, r) { const s = r.glyphs[n] || r.glyphs["?"]; if (!s) { console.error('THREE.Font: character "' + n + '" does not exists in font family ' + r.familyName + "."); return; } const o = new jx(); let a6, c, l, d, h6, f6, g6, p; if (s.o) { const u6 = s._cachedOutline || (s._cachedOutline = s.o.split(" ")); for (let y6 = 0, v6 = u6.length; y6 < v6; ) switch (u6[y6++]) { case "m": a6 = u6[y6++] * e + t, c = u6[y6++] * e + i, o.moveTo(a6, c); break; case "l": a6 = u6[y6++] * e + t, c = u6[y6++] * e + i, o.lineTo(a6, c); break; case "q": l = u6[y6++] * e + t, d = u6[y6++] * e + i, h6 = u6[y6++] * e + t, f6 = u6[y6++] * e + i, o.quadraticCurveTo(h6, f6, l, d); break; case "b": l = u6[y6++] * e + t, d = u6[y6++] * e + i, h6 = u6[y6++] * e + t, f6 = u6[y6++] * e + i, g6 = u6[y6++] * e + t, p = u6[y6++] * e + i, o.bezierCurveTo(h6, f6, g6, p, l, d); break; } } return { offsetX: s.ha * e, path: o }; } ap.prototype.isFont = true; var MN = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = new Zn(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(s.withCredentials), o.load(e, function(a6) { let c; try { c = JSON.parse(a6); } catch { console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."), c = JSON.parse(a6.substring(65, a6.length - 2)); } const l = s.parse(c); t && t(l); }, i, r); } parse(e) { return new ap(e); } }; var hc; var lp = { getContext: function() { return hc === void 0 && (hc = new (window.AudioContext || window.webkitAudioContext)()), hc; }, setContext: function(n) { hc = n; } }; var $x = class extends xn2 { constructor(e) { super(e); } load(e, t, i, r) { const s = this, o = new Zn(this.manager); o.setResponseType("arraybuffer"), o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a6) { try { const c = a6.slice(0); lp.getContext().decodeAudioData(c, function(d) { t(d); }); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } }; var Zx = class extends Al { constructor(e, t, i = 1) { super(void 0, i); const r = new Ue().set(e), s = new Ue().set(t), o = new q4(r.r, r.g, r.b), a6 = new q4(s.r, s.g, s.b), c = Math.sqrt(Math.PI), l = c * Math.sqrt(0.75); this.sh.coefficients[0].copy(o).add(a6).multiplyScalar(c), this.sh.coefficients[1].copy(o).sub(a6).multiplyScalar(l); } }; Zx.prototype.isHemisphereLightProbe = true; var Xx = class extends Al { constructor(e, t = 1) { super(void 0, t); const i = new Ue().set(e); this.sh.coefficients[0].set(i.r, i.g, i.b).multiplyScalar(2 * Math.sqrt(Math.PI)); } }; Xx.prototype.isAmbientLightProbe = true; var $g = new Xe(); var Zg = new Xe(); var wN = class { constructor() { this.type = "StereoCamera", this.aspect = 1, this.eyeSep = 0.064, this.cameraL = new nn2(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = false, this.cameraR = new nn2(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = false, this._cache = { focus: null, fov: null, aspect: null, near: null, far: null, zoom: null, eyeSep: null }; } update(e) { const t = this._cache; if (t.focus !== e.focus || t.fov !== e.fov || t.aspect !== e.aspect * this.aspect || t.near !== e.near || t.far !== e.far || t.zoom !== e.zoom || t.eyeSep !== this.eyeSep) { t.focus = e.focus, t.fov = e.fov, t.aspect = e.aspect * this.aspect, t.near = e.near, t.far = e.far, t.zoom = e.zoom, t.eyeSep = this.eyeSep; const r = e.projectionMatrix.clone(), s = t.eyeSep / 2, o = s * t.near / t.focus, a6 = t.near * Math.tan(As * t.fov * 0.5) / t.zoom; let c, l; Zg.elements[12] = -s, $g.elements[12] = s, c = -a6 * t.aspect + o, l = a6 * t.aspect + o, r.elements[0] = 2 * t.near / (l - c), r.elements[8] = (l + c) / (l - c), this.cameraL.projectionMatrix.copy(r), c = -a6 * t.aspect - o, l = a6 * t.aspect - o, r.elements[0] = 2 * t.near / (l - c), r.elements[8] = (l + c) / (l - c), this.cameraR.projectionMatrix.copy(r); } this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Zg), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply($g); } }; var Yx = class { constructor(e = true) { this.autoStart = e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = false; } start() { this.startTime = Xg(), this.oldTime = this.startTime, this.elapsedTime = 0, this.running = true; } stop() { this.getElapsedTime(), this.running = false, this.autoStart = false; } getElapsedTime() { return this.getDelta(), this.elapsedTime; } getDelta() { let e = 0; if (this.autoStart && !this.running) return this.start(), 0; if (this.running) { const t = Xg(); e = (t - this.oldTime) / 1e3, this.oldTime = t, this.elapsedTime += e; } return e; } }; function Xg() { return (typeof performance > "u" ? Date : performance).now(); } var as = new q4(); var Yg = new bn(); var AN = new q4(); var ls = new q4(); var SN = class extends ut { constructor() { super(), this.type = "AudioListener", this.context = lp.getContext(), this.gain = this.context.createGain(), this.gain.connect(this.context.destination), this.filter = null, this.timeDelta = 0, this._clock = new Yx(); } getInput() { return this.gain; } removeFilter() { return this.filter !== null && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), this.filter = null), this; } getFilter() { return this.filter; } setFilter(e) { return this.filter !== null ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination), this.filter = e, this.gain.connect(this.filter), this.filter.connect(this.context.destination), this; } getMasterVolume() { return this.gain.gain.value; } setMasterVolume(e) { return this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this; } updateMatrixWorld(e) { super.updateMatrixWorld(e); const t = this.context.listener, i = this.up; if (this.timeDelta = this._clock.getDelta(), this.matrixWorld.decompose(as, Yg, AN), ls.set(0, 0, -1).applyQuaternion(Yg), t.positionX) { const r = this.context.currentTime + this.timeDelta; t.positionX.linearRampToValueAtTime(as.x, r), t.positionY.linearRampToValueAtTime(as.y, r), t.positionZ.linearRampToValueAtTime(as.z, r), t.forwardX.linearRampToValueAtTime(ls.x, r), t.forwardY.linearRampToValueAtTime(ls.y, r), t.forwardZ.linearRampToValueAtTime(ls.z, r), t.upX.linearRampToValueAtTime(i.x, r), t.upY.linearRampToValueAtTime(i.y, r), t.upZ.linearRampToValueAtTime(i.z, r); } else t.setPosition(as.x, as.y, as.z), t.setOrientation(ls.x, ls.y, ls.z, i.x, i.y, i.z); } }; var cp = class extends ut { constructor(e) { super(), this.type = "Audio", this.listener = e, this.context = e.context, this.gain = this.context.createGain(), this.gain.connect(e.getInput()), this.autoplay = false, this.buffer = null, this.detune = 0, this.loop = false, this.loopStart = 0, this.loopEnd = 0, this.offset = 0, this.duration = void 0, this.playbackRate = 1, this.isPlaying = false, this.hasPlaybackControl = true, this.source = null, this.sourceType = "empty", this._startedAt = 0, this._progress = 0, this._connected = false, this.filters = []; } getOutput() { return this.gain; } setNodeSource(e) { return this.hasPlaybackControl = false, this.sourceType = "audioNode", this.source = e, this.connect(), this; } setMediaElementSource(e) { return this.hasPlaybackControl = false, this.sourceType = "mediaNode", this.source = this.context.createMediaElementSource(e), this.connect(), this; } setMediaStreamSource(e) { return this.hasPlaybackControl = false, this.sourceType = "mediaStreamNode", this.source = this.context.createMediaStreamSource(e), this.connect(), this; } setBuffer(e) { return this.buffer = e, this.sourceType = "buffer", this.autoplay && this.play(), this; } play(e = 0) { if (this.isPlaying === true) { console.warn("THREE.Audio: Audio is already playing."); return; } if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } this._startedAt = this.context.currentTime + e; const t = this.context.createBufferSource(); return t.buffer = this.buffer, t.loop = this.loop, t.loopStart = this.loopStart, t.loopEnd = this.loopEnd, t.onended = this.onEnded.bind(this), t.start(this._startedAt, this._progress + this.offset, this.duration), this.isPlaying = true, this.source = t, this.setDetune(this.detune), this.setPlaybackRate(this.playbackRate), this.connect(); } pause() { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.isPlaying === true && (this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate, this.loop === true && (this._progress = this._progress % (this.duration || this.buffer.duration)), this.source.stop(), this.source.onended = null, this.isPlaying = false), this; } stop() { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this._progress = 0, this.source.stop(), this.source.onended = null, this.isPlaying = false, this; } connect() { if (this.filters.length > 0) { this.source.connect(this.filters[0]); for (let e = 1, t = this.filters.length; e < t; e++) this.filters[e - 1].connect(this.filters[e]); this.filters[this.filters.length - 1].connect(this.getOutput()); } else this.source.connect(this.getOutput()); return this._connected = true, this; } disconnect() { if (this.filters.length > 0) { this.source.disconnect(this.filters[0]); for (let e = 1, t = this.filters.length; e < t; e++) this.filters[e - 1].disconnect(this.filters[e]); this.filters[this.filters.length - 1].disconnect(this.getOutput()); } else this.source.disconnect(this.getOutput()); return this._connected = false, this; } getFilters() { return this.filters; } setFilters(e) { return e || (e = []), this._connected === true ? (this.disconnect(), this.filters = e.slice(), this.connect()) : this.filters = e.slice(), this; } setDetune(e) { if (this.detune = e, this.source.detune !== void 0) return this.isPlaying === true && this.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01), this; } getDetune() { return this.detune; } getFilter() { return this.getFilters()[0]; } setFilter(e) { return this.setFilters(e ? [e] : []); } setPlaybackRate(e) { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.playbackRate = e, this.isPlaying === true && this.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01), this; } getPlaybackRate() { return this.playbackRate; } onEnded() { this.isPlaying = false; } getLoop() { return this.hasPlaybackControl === false ? (console.warn("THREE.Audio: this Audio has no playback control."), false) : this.loop; } setLoop(e) { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.loop = e, this.isPlaying === true && (this.source.loop = this.loop), this; } setLoopStart(e) { return this.loopStart = e, this; } setLoopEnd(e) { return this.loopEnd = e, this; } getVolume() { return this.gain.gain.value; } setVolume(e) { return this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this; } }; var cs = new q4(); var Jg = new bn(); var _N = new q4(); var us = new q4(); var TN = class extends cp { constructor(e) { super(e), this.panner = this.context.createPanner(), this.panner.panningModel = "HRTF", this.panner.connect(this.gain); } getOutput() { return this.panner; } getRefDistance() { return this.panner.refDistance; } setRefDistance(e) { return this.panner.refDistance = e, this; } getRolloffFactor() { return this.panner.rolloffFactor; } setRolloffFactor(e) { return this.panner.rolloffFactor = e, this; } getDistanceModel() { return this.panner.distanceModel; } setDistanceModel(e) { return this.panner.distanceModel = e, this; } getMaxDistance() { return this.panner.maxDistance; } setMaxDistance(e) { return this.panner.maxDistance = e, this; } setDirectionalCone(e, t, i) { return this.panner.coneInnerAngle = e, this.panner.coneOuterAngle = t, this.panner.coneOuterGain = i, this; } updateMatrixWorld(e) { if (super.updateMatrixWorld(e), this.hasPlaybackControl === true && this.isPlaying === false) return; this.matrixWorld.decompose(cs, Jg, _N), us.set(0, 0, 1).applyQuaternion(Jg); const t = this.panner; if (t.positionX) { const i = this.context.currentTime + this.listener.timeDelta; t.positionX.linearRampToValueAtTime(cs.x, i), t.positionY.linearRampToValueAtTime(cs.y, i), t.positionZ.linearRampToValueAtTime(cs.z, i), t.orientationX.linearRampToValueAtTime(us.x, i), t.orientationY.linearRampToValueAtTime(us.y, i), t.orientationZ.linearRampToValueAtTime(us.z, i); } else t.setPosition(cs.x, cs.y, cs.z), t.setOrientation(us.x, us.y, us.z); } }; var Jx = class { constructor(e, t = 2048) { this.analyser = e.context.createAnalyser(), this.analyser.fftSize = t, this.data = new Uint8Array(this.analyser.frequencyBinCount), e.getOutput().connect(this.analyser); } getFrequencyData() { return this.analyser.getByteFrequencyData(this.data), this.data; } getAverageFrequency() { let e = 0; const t = this.getFrequencyData(); for (let i = 0; i < t.length; i++) e += t[i]; return e / t.length; } }; var Kx = class { constructor(e, t, i) { this.binding = e, this.valueSize = i; let r, s, o; switch (t) { case "quaternion": r = this._slerp, s = this._slerpAdditive, o = this._setAdditiveIdentityQuaternion, this.buffer = new Float64Array(i * 6), this._workIndex = 5; break; case "string": case "bool": r = this._select, s = this._select, o = this._setAdditiveIdentityOther, this.buffer = new Array(i * 5); break; default: r = this._lerp, s = this._lerpAdditive, o = this._setAdditiveIdentityNumeric, this.buffer = new Float64Array(i * 5); } this._mixBufferRegion = r, this._mixBufferRegionAdditive = s, this._setIdentity = o, this._origIndex = 3, this._addIndex = 4, this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, this.useCount = 0, this.referenceCount = 0; } // accumulate data in the 'incoming' region into 'accu' accumulate(e, t) { const i = this.buffer, r = this.valueSize, s = e * r + r; let o = this.cumulativeWeight; if (o === 0) { for (let a6 = 0; a6 !== r; ++a6) i[s + a6] = i[a6]; o = t; } else { o += t; const a6 = t / o; this._mixBufferRegion(i, s, 0, a6, r); } this.cumulativeWeight = o; } // accumulate data in the 'incoming' region into 'add' accumulateAdditive(e) { const t = this.buffer, i = this.valueSize, r = i * this._addIndex; this.cumulativeWeightAdditive === 0 && this._setIdentity(), this._mixBufferRegionAdditive(t, r, 0, e, i), this.cumulativeWeightAdditive += e; } // apply the state of 'accu' to the binding when accus differ apply(e) { const t = this.valueSize, i = this.buffer, r = e * t + t, s = this.cumulativeWeight, o = this.cumulativeWeightAdditive, a6 = this.binding; if (this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, s < 1) { const c = t * this._origIndex; this._mixBufferRegion( i, r, c, 1 - s, t ); } o > 0 && this._mixBufferRegionAdditive(i, r, this._addIndex * t, 1, t); for (let c = t, l = t + t; c !== l; ++c) if (i[c] !== i[c + t]) { a6.setValue(i, r); break; } } // remember the state of the bound property and copy it to both accus saveOriginalState() { const e = this.binding, t = this.buffer, i = this.valueSize, r = i * this._origIndex; e.getValue(t, r); for (let s = i, o = r; s !== o; ++s) t[s] = t[r + s % i]; this._setIdentity(), this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0; } // apply the state previously taken via 'saveOriginalState' to the binding restoreOriginalState() { const e = this.valueSize * 3; this.binding.setValue(this.buffer, e); } _setAdditiveIdentityNumeric() { const e = this._addIndex * this.valueSize, t = e + this.valueSize; for (let i = e; i < t; i++) this.buffer[i] = 0; } _setAdditiveIdentityQuaternion() { this._setAdditiveIdentityNumeric(), this.buffer[this._addIndex * this.valueSize + 3] = 1; } _setAdditiveIdentityOther() { const e = this._origIndex * this.valueSize, t = this._addIndex * this.valueSize; for (let i = 0; i < this.valueSize; i++) this.buffer[t + i] = this.buffer[e + i]; } // mix functions _select(e, t, i, r, s) { if (r >= 0.5) for (let o = 0; o !== s; ++o) e[t + o] = e[i + o]; } _slerp(e, t, i, r) { bn.slerpFlat(e, t, e, t, e, i, r); } _slerpAdditive(e, t, i, r, s) { const o = this._workIndex * s; bn.multiplyQuaternionsFlat(e, o, e, t, e, i), bn.slerpFlat(e, t, e, t, e, o, r); } _lerp(e, t, i, r, s) { const o = 1 - r; for (let a6 = 0; a6 !== s; ++a6) { const c = t + a6; e[c] = e[c] * o + e[i + a6] * r; } } _lerpAdditive(e, t, i, r, s) { for (let o = 0; o !== s; ++o) { const a6 = t + o; e[a6] = e[a6] + e[i + o] * r; } } }; var up = "\\[\\]\\.:\\/"; var EN = new RegExp("[" + up + "]", "g"); var hp = "[^" + up + "]"; var CN = "[^" + up.replace("\\.", "") + "]"; var LN = /((?:WC+[\/:])*)/.source.replace("WC", hp); var RN = /(WCOD+)?/.source.replace("WCOD", CN); var FN = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", hp); var PN = /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", hp); var IN = new RegExp( "^" + LN + RN + FN + PN + "$" ); var ON = ["material", "materials", "bones"]; var DN = class { constructor(e, t, i) { const r = i || mt.parseTrackName(t); this._targetGroup = e, this._bindings = e.subscribe_(t, r); } getValue(e, t) { this.bind(); const i = this._targetGroup.nCachedObjects_, r = this._bindings[i]; r !== void 0 && r.getValue(e, t); } setValue(e, t) { const i = this._bindings; for (let r = this._targetGroup.nCachedObjects_, s = i.length; r !== s; ++r) i[r].setValue(e, t); } bind() { const e = this._bindings; for (let t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind(); } unbind() { const e = this._bindings; for (let t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind(); } }; var mt = class _mt { constructor(e, t, i) { this.path = t, this.parsedPath = i || _mt.parseTrackName(t), this.node = _mt.findNode(e, this.parsedPath.nodeName) || e, this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } static create(e, t, i) { return e && e.isAnimationObjectGroup ? new _mt.Composite(e, t, i) : new _mt(e, t, i); } /** * Replaces spaces with underscores and removes unsupported characters from * node names, to ensure compatibility with parseTrackName(). * * @param {string} name Node name to be sanitized. * @return {string} */ static sanitizeNodeName(e) { return e.replace(/\s/g, "_").replace(EN, ""); } static parseTrackName(e) { const t = IN.exec(e); if (!t) throw new Error("PropertyBinding: Cannot parse trackName: " + e); const i = { // directoryName: matches[ 1 ], // (tschw) currently unused nodeName: t[2], objectName: t[3], objectIndex: t[4], propertyName: t[5], // required propertyIndex: t[6] }, r = i.nodeName && i.nodeName.lastIndexOf("."); if (r !== void 0 && r !== -1) { const s = i.nodeName.substring(r + 1); ON.indexOf(s) !== -1 && (i.nodeName = i.nodeName.substring(0, r), i.objectName = s); } if (i.propertyName === null || i.propertyName.length === 0) throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e); return i; } static findNode(e, t) { if (!t || t === "" || t === "." || t === -1 || t === e.name || t === e.uuid) return e; if (e.skeleton) { const i = e.skeleton.getBoneByName(t); if (i !== void 0) return i; } if (e.children) { const i = function(s) { for (let o = 0; o < s.length; o++) { const a6 = s[o]; if (a6.name === t || a6.uuid === t) return a6; const c = i(a6.children); if (c) return c; } return null; }, r = i(e.children); if (r) return r; } return null; } // these are used to "bind" a nonexistent property _getValue_unavailable() { } _setValue_unavailable() { } // Getters _getValue_direct(e, t) { e[t] = this.node[this.propertyName]; } _getValue_array(e, t) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) e[t++] = i[r]; } _getValue_arrayElement(e, t) { e[t] = this.resolvedProperty[this.propertyIndex]; } _getValue_toArray(e, t) { this.resolvedProperty.toArray(e, t); } // Direct _setValue_direct(e, t) { this.targetObject[this.propertyName] = e[t]; } _setValue_direct_setNeedsUpdate(e, t) { this.targetObject[this.propertyName] = e[t], this.targetObject.needsUpdate = true; } _setValue_direct_setMatrixWorldNeedsUpdate(e, t) { this.targetObject[this.propertyName] = e[t], this.targetObject.matrixWorldNeedsUpdate = true; } // EntireArray _setValue_array(e, t) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t++]; } _setValue_array_setNeedsUpdate(e, t) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t++]; this.targetObject.needsUpdate = true; } _setValue_array_setMatrixWorldNeedsUpdate(e, t) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t++]; this.targetObject.matrixWorldNeedsUpdate = true; } // ArrayElement _setValue_arrayElement(e, t) { this.resolvedProperty[this.propertyIndex] = e[t]; } _setValue_arrayElement_setNeedsUpdate(e, t) { this.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.needsUpdate = true; } _setValue_arrayElement_setMatrixWorldNeedsUpdate(e, t) { this.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.matrixWorldNeedsUpdate = true; } // HasToFromArray _setValue_fromArray(e, t) { this.resolvedProperty.fromArray(e, t); } _setValue_fromArray_setNeedsUpdate(e, t) { this.resolvedProperty.fromArray(e, t), this.targetObject.needsUpdate = true; } _setValue_fromArray_setMatrixWorldNeedsUpdate(e, t) { this.resolvedProperty.fromArray(e, t), this.targetObject.matrixWorldNeedsUpdate = true; } _getValue_unbound(e, t) { this.bind(), this.getValue(e, t); } _setValue_unbound(e, t) { this.bind(), this.setValue(e, t); } // create getter / setter pair for a property in the scene graph bind() { let e = this.node; const t = this.parsedPath, i = t.objectName, r = t.propertyName; let s = t.propertyIndex; if (e || (e = _mt.findNode(this.rootNode, t.nodeName) || this.rootNode, this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) { console.error("THREE.PropertyBinding: Trying to update node for track: " + this.path + " but it wasn't found."); return; } if (i) { let l = t.objectIndex; switch (i) { case "materials": if (!e.material) { console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this); return; } if (!e.material.materials) { console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.", this); return; } e = e.material.materials; break; case "bones": if (!e.skeleton) { console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this); return; } e = e.skeleton.bones; for (let d = 0; d < e.length; d++) if (e[d].name === l) { l = d; break; } break; default: if (e[i] === void 0) { console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this); return; } e = e[i]; } if (l !== void 0) { if (e[l] === void 0) { console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, e); return; } e = e[l]; } } const o = e[r]; if (o === void 0) { const l = t.nodeName; console.error("THREE.PropertyBinding: Trying to update property for track: " + l + "." + r + " but it wasn't found.", e); return; } let a6 = this.Versioning.None; this.targetObject = e, e.needsUpdate !== void 0 ? a6 = this.Versioning.NeedsUpdate : e.matrixWorldNeedsUpdate !== void 0 && (a6 = this.Versioning.MatrixWorldNeedsUpdate); let c = this.BindingType.Direct; if (s !== void 0) { if (r === "morphTargetInfluences") { if (!e.geometry) { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this); return; } if (e.geometry.isBufferGeometry) { if (!e.geometry.morphAttributes) { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this); return; } e.morphTargetDictionary[s] !== void 0 && (s = e.morphTargetDictionary[s]); } else { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.", this); return; } } c = this.BindingType.ArrayElement, this.resolvedProperty = o, this.propertyIndex = s; } else o.fromArray !== void 0 && o.toArray !== void 0 ? (c = this.BindingType.HasFromToArray, this.resolvedProperty = o) : Array.isArray(o) ? (c = this.BindingType.EntireArray, this.resolvedProperty = o) : this.propertyName = r; this.getValue = this.GetterByBindingType[c], this.setValue = this.SetterByBindingTypeAndVersioning[c][a6]; } unbind() { this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } }; mt.Composite = DN; mt.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }; mt.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }; mt.prototype.GetterByBindingType = [ mt.prototype._getValue_direct, mt.prototype._getValue_array, mt.prototype._getValue_arrayElement, mt.prototype._getValue_toArray ]; mt.prototype.SetterByBindingTypeAndVersioning = [ [ // Direct mt.prototype._setValue_direct, mt.prototype._setValue_direct_setNeedsUpdate, mt.prototype._setValue_direct_setMatrixWorldNeedsUpdate ], [ // EntireArray mt.prototype._setValue_array, mt.prototype._setValue_array_setNeedsUpdate, mt.prototype._setValue_array_setMatrixWorldNeedsUpdate ], [ // ArrayElement mt.prototype._setValue_arrayElement, mt.prototype._setValue_arrayElement_setNeedsUpdate, mt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate ], [ // HasToFromArray mt.prototype._setValue_fromArray, mt.prototype._setValue_fromArray_setNeedsUpdate, mt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate ] ]; var qx = class { constructor() { this.uuid = Wn(), this._objects = Array.prototype.slice.call(arguments), this.nCachedObjects_ = 0; const e = {}; this._indicesByUUID = e; for (let i = 0, r = arguments.length; i !== r; ++i) e[arguments[i].uuid] = i; this._paths = [], this._parsedPaths = [], this._bindings = [], this._bindingsIndicesByPath = {}; const t = this; this.stats = { objects: { get total() { return t._objects.length; }, get inUse() { return this.total - t.nCachedObjects_; } }, get bindingsPerObject() { return t._bindings.length; } }; } add() { const e = this._objects, t = this._indicesByUUID, i = this._paths, r = this._parsedPaths, s = this._bindings, o = s.length; let a6, c = e.length, l = this.nCachedObjects_; for (let d = 0, h6 = arguments.length; d !== h6; ++d) { const f6 = arguments[d], g6 = f6.uuid; let p = t[g6]; if (p === void 0) { p = c++, t[g6] = p, e.push(f6); for (let u6 = 0, y6 = o; u6 !== y6; ++u6) s[u6].push(new mt(f6, i[u6], r[u6])); } else if (p < l) { a6 = e[p]; const u6 = --l, y6 = e[u6]; t[y6.uuid] = p, e[p] = y6, t[g6] = u6, e[u6] = f6; for (let v6 = 0, m6 = o; v6 !== m6; ++v6) { const x6 = s[v6], w6 = x6[u6]; let A6 = x6[p]; x6[p] = w6, A6 === void 0 && (A6 = new mt(f6, i[v6], r[v6])), x6[u6] = A6; } } else e[p] !== a6 && console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes."); } this.nCachedObjects_ = l; } remove() { const e = this._objects, t = this._indicesByUUID, i = this._bindings, r = i.length; let s = this.nCachedObjects_; for (let o = 0, a6 = arguments.length; o !== a6; ++o) { const c = arguments[o], l = c.uuid, d = t[l]; if (d !== void 0 && d >= s) { const h6 = s++, f6 = e[h6]; t[f6.uuid] = d, e[d] = f6, t[l] = h6, e[h6] = c; for (let g6 = 0, p = r; g6 !== p; ++g6) { const u6 = i[g6], y6 = u6[h6], v6 = u6[d]; u6[d] = y6, u6[h6] = v6; } } } this.nCachedObjects_ = s; } // remove & forget uncache() { const e = this._objects, t = this._indicesByUUID, i = this._bindings, r = i.length; let s = this.nCachedObjects_, o = e.length; for (let a6 = 0, c = arguments.length; a6 !== c; ++a6) { const l = arguments[a6], d = l.uuid, h6 = t[d]; if (h6 !== void 0) if (delete t[d], h6 < s) { const f6 = --s, g6 = e[f6], p = --o, u6 = e[p]; t[g6.uuid] = h6, e[h6] = g6, t[u6.uuid] = f6, e[f6] = u6, e.pop(); for (let y6 = 0, v6 = r; y6 !== v6; ++y6) { const m6 = i[y6], x6 = m6[f6], w6 = m6[p]; m6[h6] = x6, m6[f6] = w6, m6.pop(); } } else { const f6 = --o, g6 = e[f6]; f6 > 0 && (t[g6.uuid] = h6), e[h6] = g6, e.pop(); for (let p = 0, u6 = r; p !== u6; ++p) { const y6 = i[p]; y6[h6] = y6[f6], y6.pop(); } } } this.nCachedObjects_ = s; } // Internal interface used by befriended PropertyBinding.Composite: subscribe_(e, t) { const i = this._bindingsIndicesByPath; let r = i[e]; const s = this._bindings; if (r !== void 0) return s[r]; const o = this._paths, a6 = this._parsedPaths, c = this._objects, l = c.length, d = this.nCachedObjects_, h6 = new Array(l); r = s.length, i[e] = r, o.push(e), a6.push(t), s.push(h6); for (let f6 = d, g6 = c.length; f6 !== g6; ++f6) { const p = c[f6]; h6[f6] = new mt(p, e, t); } return h6; } unsubscribe_(e) { const t = this._bindingsIndicesByPath, i = t[e]; if (i !== void 0) { const r = this._paths, s = this._parsedPaths, o = this._bindings, a6 = o.length - 1, c = o[a6], l = e[a6]; t[l] = i, o[i] = c, o.pop(), s[i] = s[a6], s.pop(), r[i] = r[a6], r.pop(); } } }; qx.prototype.isAnimationObjectGroup = true; var NN = class { constructor(e, t, i = null, r = t.blendMode) { this._mixer = e, this._clip = t, this._localRoot = i, this.blendMode = r; const s = t.tracks, o = s.length, a6 = new Array(o), c = { endingStart: gs, endingEnd: gs }; for (let l = 0; l !== o; ++l) { const d = s[l].createInterpolant(null); a6[l] = d, d.settings = c; } this._interpolantSettings = c, this._interpolants = a6, this._propertyBindings = new Array(o), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = jb, this._loopCount = -1, this._startTime = null, this.time = 0, this.timeScale = 1, this._effectiveTimeScale = 1, this.weight = 1, this._effectiveWeight = 1, this.repetitions = 1 / 0, this.paused = false, this.enabled = true, this.clampWhenFinished = false, this.zeroSlopeAtStart = true, this.zeroSlopeAtEnd = true; } // State & Scheduling play() { return this._mixer._activateAction(this), this; } stop() { return this._mixer._deactivateAction(this), this.reset(); } reset() { return this.paused = false, this.enabled = true, this.time = 0, this._loopCount = -1, this._startTime = null, this.stopFading().stopWarping(); } isRunning() { return this.enabled && !this.paused && this.timeScale !== 0 && this._startTime === null && this._mixer._isActiveAction(this); } // return true when play has been called isScheduled() { return this._mixer._isActiveAction(this); } startAt(e) { return this._startTime = e, this; } setLoop(e, t) { return this.loop = e, this.repetitions = t, this; } // Weight // set the weight stopping any scheduled fading // although .enabled = false yields an effective weight of zero, this // method does *not* change .enabled, because it would be confusing setEffectiveWeight(e) { return this.weight = e, this._effectiveWeight = this.enabled ? e : 0, this.stopFading(); } // return the weight considering fading and .enabled getEffectiveWeight() { return this._effectiveWeight; } fadeIn(e) { return this._scheduleFading(e, 0, 1); } fadeOut(e) { return this._scheduleFading(e, 1, 0); } crossFadeFrom(e, t, i) { if (e.fadeOut(t), this.fadeIn(t), i) { const r = this._clip.duration, s = e._clip.duration, o = s / r, a6 = r / s; e.warp(1, o, t), this.warp(a6, 1, t); } return this; } crossFadeTo(e, t, i) { return e.crossFadeFrom(this, t, i); } stopFading() { const e = this._weightInterpolant; return e !== null && (this._weightInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this; } // Time Scale Control // set the time scale stopping any scheduled warping // although .paused = true yields an effective time scale of zero, this // method does *not* change .paused, because it would be confusing setEffectiveTimeScale(e) { return this.timeScale = e, this._effectiveTimeScale = this.paused ? 0 : e, this.stopWarping(); } // return the time scale considering warping and .paused getEffectiveTimeScale() { return this._effectiveTimeScale; } setDuration(e) { return this.timeScale = this._clip.duration / e, this.stopWarping(); } syncWith(e) { return this.time = e.time, this.timeScale = e.timeScale, this.stopWarping(); } halt(e) { return this.warp(this._effectiveTimeScale, 0, e); } warp(e, t, i) { const r = this._mixer, s = r.time, o = this.timeScale; let a6 = this._timeScaleInterpolant; a6 === null && (a6 = r._lendControlInterpolant(), this._timeScaleInterpolant = a6); const c = a6.parameterPositions, l = a6.sampleValues; return c[0] = s, c[1] = s + i, l[0] = e / o, l[1] = t / o, this; } stopWarping() { const e = this._timeScaleInterpolant; return e !== null && (this._timeScaleInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this; } // Object Accessors getMixer() { return this._mixer; } getClip() { return this._clip; } getRoot() { return this._localRoot || this._mixer._root; } // Interna _update(e, t, i, r) { if (!this.enabled) { this._updateWeight(e); return; } const s = this._startTime; if (s !== null) { const c = (e - s) * i; if (c < 0 || i === 0) return; this._startTime = null, t = i * c; } t *= this._updateTimeScale(e); const o = this._updateTime(t), a6 = this._updateWeight(e); if (a6 > 0) { const c = this._interpolants, l = this._propertyBindings; switch (this.blendMode) { case Mf: for (let d = 0, h6 = c.length; d !== h6; ++d) c[d].evaluate(o), l[d].accumulateAdditive(a6); break; case fu: default: for (let d = 0, h6 = c.length; d !== h6; ++d) c[d].evaluate(o), l[d].accumulate(r, a6); } } } _updateWeight(e) { let t = 0; if (this.enabled) { t = this.weight; const i = this._weightInterpolant; if (i !== null) { const r = i.evaluate(e)[0]; t *= r, e > i.parameterPositions[1] && (this.stopFading(), r === 0 && (this.enabled = false)); } } return this._effectiveWeight = t, t; } _updateTimeScale(e) { let t = 0; if (!this.paused) { t = this.timeScale; const i = this._timeScaleInterpolant; if (i !== null) { const r = i.evaluate(e)[0]; t *= r, e > i.parameterPositions[1] && (this.stopWarping(), t === 0 ? this.paused = true : this.timeScale = t); } } return this._effectiveTimeScale = t, t; } _updateTime(e) { const t = this._clip.duration, i = this.loop; let r = this.time + e, s = this._loopCount; const o = i === $b; if (e === 0) return s === -1 ? r : o && (s & 1) === 1 ? t - r : r; if (i === Wb) { s === -1 && (this._loopCount = 0, this._setEndings(true, true, false)); e: { if (r >= t) r = t; else if (r < 0) r = 0; else { this.time = r; break e; } this.clampWhenFinished ? this.paused = true : this.enabled = false, this.time = r, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e < 0 ? -1 : 1 }); } } else { if (s === -1 && (e >= 0 ? (s = 0, this._setEndings(true, this.repetitions === 0, o)) : this._setEndings(this.repetitions === 0, true, o)), r >= t || r < 0) { const a6 = Math.floor(r / t); r -= t * a6, s += Math.abs(a6); const c = this.repetitions - s; if (c <= 0) this.clampWhenFinished ? this.paused = true : this.enabled = false, r = e > 0 ? t : 0, this.time = r, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e > 0 ? 1 : -1 }); else { if (c === 1) { const l = e < 0; this._setEndings(l, !l, o); } else this._setEndings(false, false, o); this._loopCount = s, this.time = r, this._mixer.dispatchEvent({ type: "loop", action: this, loopDelta: a6 }); } } else this.time = r; if (o && (s & 1) === 1) return t - r; } return r; } _setEndings(e, t, i) { const r = this._interpolantSettings; i ? (r.endingStart = vs, r.endingEnd = vs) : (e ? r.endingStart = this.zeroSlopeAtStart ? vs : gs : r.endingStart = Wa, t ? r.endingEnd = this.zeroSlopeAtEnd ? vs : gs : r.endingEnd = Wa); } _scheduleFading(e, t, i) { const r = this._mixer, s = r.time; let o = this._weightInterpolant; o === null && (o = r._lendControlInterpolant(), this._weightInterpolant = o); const a6 = o.parameterPositions, c = o.sampleValues; return a6[0] = s, c[0] = t, a6[1] = s + e, c[1] = i, this; } }; var Qx = class extends Kr { constructor(e) { super(), this._root = e, this._initMemoryManager(), this._accuIndex = 0, this.time = 0, this.timeScale = 1; } _bindAction(e, t) { const i = e._localRoot || this._root, r = e._clip.tracks, s = r.length, o = e._propertyBindings, a6 = e._interpolants, c = i.uuid, l = this._bindingsByRootAndName; let d = l[c]; d === void 0 && (d = {}, l[c] = d); for (let h6 = 0; h6 !== s; ++h6) { const f6 = r[h6], g6 = f6.name; let p = d[g6]; if (p !== void 0) o[h6] = p; else { if (p = o[h6], p !== void 0) { p._cacheIndex === null && (++p.referenceCount, this._addInactiveBinding(p, c, g6)); continue; } const u6 = t && t._propertyBindings[h6].binding.parsedPath; p = new Kx( mt.create(i, g6, u6), f6.ValueTypeName, f6.getValueSize() ), ++p.referenceCount, this._addInactiveBinding(p, c, g6), o[h6] = p; } a6[h6].resultBuffer = p.buffer; } } _activateAction(e) { if (!this._isActiveAction(e)) { if (e._cacheIndex === null) { const i = (e._localRoot || this._root).uuid, r = e._clip.uuid, s = this._actionsByClip[r]; this._bindAction( e, s && s.knownActions[0] ), this._addInactiveAction(e, r, i); } const t = e._propertyBindings; for (let i = 0, r = t.length; i !== r; ++i) { const s = t[i]; s.useCount++ === 0 && (this._lendBinding(s), s.saveOriginalState()); } this._lendAction(e); } } _deactivateAction(e) { if (this._isActiveAction(e)) { const t = e._propertyBindings; for (let i = 0, r = t.length; i !== r; ++i) { const s = t[i]; --s.useCount === 0 && (s.restoreOriginalState(), this._takeBackBinding(s)); } this._takeBackAction(e); } } // Memory manager _initMemoryManager() { this._actions = [], this._nActiveActions = 0, this._actionsByClip = {}, this._bindings = [], this._nActiveBindings = 0, this._bindingsByRootAndName = {}, this._controlInterpolants = [], this._nActiveControlInterpolants = 0; const e = this; this.stats = { actions: { get total() { return e._actions.length; }, get inUse() { return e._nActiveActions; } }, bindings: { get total() { return e._bindings.length; }, get inUse() { return e._nActiveBindings; } }, controlInterpolants: { get total() { return e._controlInterpolants.length; }, get inUse() { return e._nActiveControlInterpolants; } } }; } // Memory management for AnimationAction objects _isActiveAction(e) { const t = e._cacheIndex; return t !== null && t < this._nActiveActions; } _addInactiveAction(e, t, i) { const r = this._actions, s = this._actionsByClip; let o = s[t]; if (o === void 0) o = { knownActions: [e], actionByRoot: {} }, e._byClipCacheIndex = 0, s[t] = o; else { const a6 = o.knownActions; e._byClipCacheIndex = a6.length, a6.push(e); } e._cacheIndex = r.length, r.push(e), o.actionByRoot[i] = e; } _removeInactiveAction(e) { const t = this._actions, i = t[t.length - 1], r = e._cacheIndex; i._cacheIndex = r, t[r] = i, t.pop(), e._cacheIndex = null; const s = e._clip.uuid, o = this._actionsByClip, a6 = o[s], c = a6.knownActions, l = c[c.length - 1], d = e._byClipCacheIndex; l._byClipCacheIndex = d, c[d] = l, c.pop(), e._byClipCacheIndex = null; const h6 = a6.actionByRoot, f6 = (e._localRoot || this._root).uuid; delete h6[f6], c.length === 0 && delete o[s], this._removeInactiveBindingsForAction(e); } _removeInactiveBindingsForAction(e) { const t = e._propertyBindings; for (let i = 0, r = t.length; i !== r; ++i) { const s = t[i]; --s.referenceCount === 0 && this._removeInactiveBinding(s); } } _lendAction(e) { const t = this._actions, i = e._cacheIndex, r = this._nActiveActions++, s = t[r]; e._cacheIndex = r, t[r] = e, s._cacheIndex = i, t[i] = s; } _takeBackAction(e) { const t = this._actions, i = e._cacheIndex, r = --this._nActiveActions, s = t[r]; e._cacheIndex = r, t[r] = e, s._cacheIndex = i, t[i] = s; } // Memory management for PropertyMixer objects _addInactiveBinding(e, t, i) { const r = this._bindingsByRootAndName, s = this._bindings; let o = r[t]; o === void 0 && (o = {}, r[t] = o), o[i] = e, e._cacheIndex = s.length, s.push(e); } _removeInactiveBinding(e) { const t = this._bindings, i = e.binding, r = i.rootNode.uuid, s = i.path, o = this._bindingsByRootAndName, a6 = o[r], c = t[t.length - 1], l = e._cacheIndex; c._cacheIndex = l, t[l] = c, t.pop(), delete a6[s], Object.keys(a6).length === 0 && delete o[r]; } _lendBinding(e) { const t = this._bindings, i = e._cacheIndex, r = this._nActiveBindings++, s = t[r]; e._cacheIndex = r, t[r] = e, s._cacheIndex = i, t[i] = s; } _takeBackBinding(e) { const t = this._bindings, i = e._cacheIndex, r = --this._nActiveBindings, s = t[r]; e._cacheIndex = r, t[r] = e, s._cacheIndex = i, t[i] = s; } // Memory management of Interpolants for weight and time scale _lendControlInterpolant() { const e = this._controlInterpolants, t = this._nActiveControlInterpolants++; let i = e[t]; return i === void 0 && (i = new Yf( new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer ), i.__cacheIndex = t, e[t] = i), i; } _takeBackControlInterpolant(e) { const t = this._controlInterpolants, i = e.__cacheIndex, r = --this._nActiveControlInterpolants, s = t[r]; e.__cacheIndex = r, t[r] = e, s.__cacheIndex = i, t[i] = s; } // return an action for a clip optionally using a custom root target // object (this method allocates a lot of dynamic memory in case a // previously unknown clip/root combination is specified) clipAction(e, t, i) { const r = t || this._root, s = r.uuid; let o = typeof e == "string" ? jo.findByName(r, e) : e; const a6 = o !== null ? o.uuid : e, c = this._actionsByClip[a6]; let l = null; if (i === void 0 && (o !== null ? i = o.blendMode : i = fu), c !== void 0) { const h6 = c.actionByRoot[s]; if (h6 !== void 0 && h6.blendMode === i) return h6; l = c.knownActions[0], o === null && (o = l._clip); } if (o === null) return null; const d = new NN(this, o, t, i); return this._bindAction(d, l), this._addInactiveAction(d, a6, s), d; } // get an existing action existingAction(e, t) { const i = t || this._root, r = i.uuid, s = typeof e == "string" ? jo.findByName(i, e) : e, o = s ? s.uuid : e, a6 = this._actionsByClip[o]; return a6 !== void 0 && a6.actionByRoot[r] || null; } // deactivates all previously scheduled actions stopAllAction() { const e = this._actions, t = this._nActiveActions; for (let i = t - 1; i >= 0; --i) e[i].stop(); return this; } // advance the time and update apply the animation update(e) { e *= this.timeScale; const t = this._actions, i = this._nActiveActions, r = this.time += e, s = Math.sign(e), o = this._accuIndex ^= 1; for (let l = 0; l !== i; ++l) t[l]._update(r, e, s, o); const a6 = this._bindings, c = this._nActiveBindings; for (let l = 0; l !== c; ++l) a6[l].apply(o); return this; } // Allows you to seek to a specific time in an animation. setTime(e) { this.time = 0; for (let t = 0; t < this._actions.length; t++) this._actions[t].time = 0; return this.update(e); } // return this mixer's root target object getRoot() { return this._root; } // free all resources specific to a particular clip uncacheClip(e) { const t = this._actions, i = e.uuid, r = this._actionsByClip, s = r[i]; if (s !== void 0) { const o = s.knownActions; for (let a6 = 0, c = o.length; a6 !== c; ++a6) { const l = o[a6]; this._deactivateAction(l); const d = l._cacheIndex, h6 = t[t.length - 1]; l._cacheIndex = null, l._byClipCacheIndex = null, h6._cacheIndex = d, t[d] = h6, t.pop(), this._removeInactiveBindingsForAction(l); } delete r[i]; } } // free all resources specific to a particular root target object uncacheRoot(e) { const t = e.uuid, i = this._actionsByClip; for (const o in i) { const a6 = i[o].actionByRoot, c = a6[t]; c !== void 0 && (this._deactivateAction(c), this._removeInactiveAction(c)); } const r = this._bindingsByRootAndName, s = r[t]; if (s !== void 0) for (const o in s) { const a6 = s[o]; a6.restoreOriginalState(), this._removeInactiveBinding(a6); } } // remove a targeted clip from the cache uncacheAction(e, t) { const i = this.existingAction(e, t); i !== null && (this._deactivateAction(i), this._removeInactiveAction(i)); } }; Qx.prototype._controlInterpolantsResultBuffer = new Float32Array(1); var Fu = class _Fu { constructor(e) { typeof e == "string" && (console.warn("THREE.Uniform: Type parameter is no longer needed."), e = arguments[1]), this.value = e; } clone() { return new _Fu(this.value.clone === void 0 ? this.value : this.value.clone()); } }; var eM = class extends Qr { constructor(e, t, i = 1) { super(e, t), this.meshPerAttribute = i; } copy(e) { return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this; } clone(e) { const t = super.clone(e); return t.meshPerAttribute = this.meshPerAttribute, t; } toJSON(e) { const t = super.toJSON(e); return t.isInstancedInterleavedBuffer = true, t.meshPerAttribute = this.meshPerAttribute, t; } }; eM.prototype.isInstancedInterleavedBuffer = true; var tM = class { constructor(e, t, i, r, s) { this.buffer = e, this.type = t, this.itemSize = i, this.elementSize = r, this.count = s, this.version = 0; } set needsUpdate(e) { e === true && this.version++; } setBuffer(e) { return this.buffer = e, this; } setType(e, t) { return this.type = e, this.elementSize = t, this; } setItemSize(e) { return this.itemSize = e, this; } setCount(e) { return this.count = e, this; } }; tM.prototype.isGLBufferAttribute = true; var BN = class { constructor(e, t, i = 0, r = 1 / 0) { this.ray = new qr(e, t), this.near = i, this.far = r, this.camera = null, this.layers = new Cf(), this.params = { Mesh: {}, Line: { threshold: 1 }, LOD: {}, Points: { threshold: 1 }, Sprite: {} }; } set(e, t) { this.ray.set(e, t); } setFromCamera(e, t) { t && t.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(t).sub(this.ray.origin).normalize(), this.camera = t) : t && t.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld), this.camera = t) : console.error("THREE.Raycaster: Unsupported camera type: " + t.type); } intersectObject(e, t = false, i = []) { return _d(e, this, i, t), i.sort(Kg), i; } intersectObjects(e, t = false, i = []) { for (let r = 0, s = e.length; r < s; r++) _d(e[r], this, i, t); return i.sort(Kg), i; } }; function Kg(n, e) { return n.distance - e.distance; } function _d(n, e, t, i) { if (n.layers.test(e.layers) && n.raycast(e, t), i === true) { const r = n.children; for (let s = 0, o = r.length; s < o; s++) _d(r[s], e, t, true); } } var UN = class { constructor(e = 1, t = 0, i = 0) { return this.radius = e, this.phi = t, this.theta = i, this; } set(e, t, i) { return this.radius = e, this.phi = t, this.theta = i, this; } copy(e) { return this.radius = e.radius, this.phi = e.phi, this.theta = e.theta, this; } // restrict phi to be betwee EPS and PI-EPS makeSafe() { return this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi)), this; } setFromVector3(e) { return this.setFromCartesianCoords(e.x, e.y, e.z); } setFromCartesianCoords(e, t, i) { return this.radius = Math.sqrt(e * e + t * t + i * i), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, i), this.phi = Math.acos(gn2(t / this.radius, -1, 1))), this; } clone() { return new this.constructor().copy(this); } }; var zN = class { constructor(e = 1, t = 0, i = 0) { return this.radius = e, this.theta = t, this.y = i, this; } set(e, t, i) { return this.radius = e, this.theta = t, this.y = i, this; } copy(e) { return this.radius = e.radius, this.theta = e.theta, this.y = e.y, this; } setFromVector3(e) { return this.setFromCartesianCoords(e.x, e.y, e.z); } setFromCartesianCoords(e, t, i) { return this.radius = Math.sqrt(e * e + i * i), this.theta = Math.atan2(e, i), this.y = t, this; } clone() { return new this.constructor().copy(this); } }; var qg = new Re(); var oa = class { constructor(e = new Re(1 / 0, 1 / 0), t = new Re(-1 / 0, -1 / 0)) { this.min = e, this.max = t; } set(e, t) { return this.min.copy(e), this.max.copy(t), this; } setFromPoints(e) { this.makeEmpty(); for (let t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]); return this; } setFromCenterAndSize(e, t) { const i = qg.copy(t).multiplyScalar(0.5); return this.min.copy(e).sub(i), this.max.copy(e).add(i), this; } clone() { return new this.constructor().copy(this); } copy(e) { return this.min.copy(e.min), this.max.copy(e.max), this; } makeEmpty() { return this.min.x = this.min.y = 1 / 0, this.max.x = this.max.y = -1 / 0, this; } isEmpty() { return this.max.x < this.min.x || this.max.y < this.min.y; } getCenter(e) { return this.isEmpty() ? e.set(0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5); } getSize(e) { return this.isEmpty() ? e.set(0, 0) : e.subVectors(this.max, this.min); } expandByPoint(e) { return this.min.min(e), this.max.max(e), this; } expandByVector(e) { return this.min.sub(e), this.max.add(e), this; } expandByScalar(e) { return this.min.addScalar(-e), this.max.addScalar(e), this; } containsPoint(e) { return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y); } containsBox(e) { return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y; } getParameter(e, t) { return t.set( (e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y) ); } intersectsBox(e) { return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y); } clampPoint(e, t) { return t.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return qg.copy(e).clamp(this.min, this.max).sub(e).length(); } intersect(e) { return this.min.max(e.min), this.max.min(e.max), this; } union(e) { return this.min.min(e.min), this.max.max(e.max), this; } translate(e) { return this.min.add(e), this.max.add(e), this; } equals(e) { return e.min.equals(this.min) && e.max.equals(this.max); } }; oa.prototype.isBox2 = true; var Qg = new q4(); var dc = new q4(); var nM = class { constructor(e = new q4(), t = new q4()) { this.start = e, this.end = t; } set(e, t) { return this.start.copy(e), this.end.copy(t), this; } copy(e) { return this.start.copy(e.start), this.end.copy(e.end), this; } getCenter(e) { return e.addVectors(this.start, this.end).multiplyScalar(0.5); } delta(e) { return e.subVectors(this.end, this.start); } distanceSq() { return this.start.distanceToSquared(this.end); } distance() { return this.start.distanceTo(this.end); } at(e, t) { return this.delta(t).multiplyScalar(e).add(this.start); } closestPointToPointParameter(e, t) { Qg.subVectors(e, this.start), dc.subVectors(this.end, this.start); const i = dc.dot(dc); let s = dc.dot(Qg) / i; return t && (s = gn2(s, 0, 1)), s; } closestPointToPoint(e, t, i) { const r = this.closestPointToPointParameter(e, t); return this.delta(i).multiplyScalar(r).add(this.start); } applyMatrix4(e) { return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this; } equals(e) { return e.start.equals(this.start) && e.end.equals(this.end); } clone() { return new this.constructor().copy(this); } }; var iM = class extends ut { constructor(e) { super(), this.material = e, this.render = function() { }, this.hasPositions = false, this.hasNormals = false, this.hasColors = false, this.hasUvs = false, this.positionArray = null, this.normalArray = null, this.colorArray = null, this.uvArray = null, this.count = 0; } }; iM.prototype.isImmediateRenderObject = true; var ev = new q4(); var kN = class extends ut { constructor(e, t) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.color = t; const i = new Ke(), r = [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1 ]; for (let o = 0, a6 = 1, c = 32; o < c; o++, a6++) { const l = o / c * Math.PI * 2, d = a6 / c * Math.PI * 2; r.push( Math.cos(l), Math.sin(l), 1, Math.cos(d), Math.sin(d), 1 ); } i.setAttribute("position", new We(r, 3)); const s = new an2({ fog: false, toneMapped: false }); this.cone = new Rn(i, s), this.add(this.cone), this.update(); } dispose() { this.cone.geometry.dispose(), this.cone.material.dispose(); } update() { this.light.updateMatrixWorld(); const e = this.light.distance ? this.light.distance : 1e3, t = e * Math.tan(this.light.angle); this.cone.scale.set(t, t, e), ev.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(ev), this.color !== void 0 ? this.cone.material.color.set(this.color) : this.cone.material.color.copy(this.light.color); } }; var Sr = new q4(); var fc = new Xe(); var Sh = new Xe(); var rM = class extends Rn { constructor(e) { const t = sM(e), i = new Ke(), r = [], s = [], o = new Ue(0, 0, 1), a6 = new Ue(0, 1, 0); for (let l = 0; l < t.length; l++) { const d = t[l]; d.parent && d.parent.isBone && (r.push(0, 0, 0), r.push(0, 0, 0), s.push(o.r, o.g, o.b), s.push(a6.r, a6.g, a6.b)); } i.setAttribute("position", new We(r, 3)), i.setAttribute("color", new We(s, 3)); const c = new an2({ vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true }); super(i, c), this.type = "SkeletonHelper", this.isSkeletonHelper = true, this.root = e, this.bones = t, this.matrix = e.matrixWorld, this.matrixAutoUpdate = false; } updateMatrixWorld(e) { const t = this.bones, i = this.geometry, r = i.getAttribute("position"); Sh.copy(this.root.matrixWorld).invert(); for (let s = 0, o = 0; s < t.length; s++) { const a6 = t[s]; a6.parent && a6.parent.isBone && (fc.multiplyMatrices(Sh, a6.matrixWorld), Sr.setFromMatrixPosition(fc), r.setXYZ(o, Sr.x, Sr.y, Sr.z), fc.multiplyMatrices(Sh, a6.parent.matrixWorld), Sr.setFromMatrixPosition(fc), r.setXYZ(o + 1, Sr.x, Sr.y, Sr.z), o += 2); } i.getAttribute("position").needsUpdate = true, super.updateMatrixWorld(e); } }; function sM(n) { const e = []; n && n.isBone && e.push(n); for (let t = 0; t < n.children.length; t++) e.push.apply(e, sM(n.children[t])); return e; } var VN = class extends Xt { constructor(e, t, i) { const r = new Ps(t, 4, 2), s = new In({ wireframe: true, fog: false, toneMapped: false }); super(r, s), this.light = e, this.light.updateMatrixWorld(), this.color = i, this.type = "PointLightHelper", this.matrix = this.light.matrixWorld, this.matrixAutoUpdate = false, this.update(); } dispose() { this.geometry.dispose(), this.material.dispose(); } update() { this.color !== void 0 ? this.material.color.set(this.color) : this.material.color.copy(this.light.color); } }; var GN = new q4(); var tv = new Ue(); var nv = new Ue(); var HN = class extends ut { constructor(e, t, i) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.color = i; const r = new Rs(t); r.rotateY(Math.PI * 0.5), this.material = new In({ wireframe: true, fog: false, toneMapped: false }), this.color === void 0 && (this.material.vertexColors = true); const s = r.getAttribute("position"), o = new Float32Array(s.count * 3); r.setAttribute("color", new ot(o, 3)), this.add(new Xt(r, this.material)), this.update(); } dispose() { this.children[0].geometry.dispose(), this.children[0].material.dispose(); } update() { const e = this.children[0]; if (this.color !== void 0) this.material.color.set(this.color); else { const t = e.geometry.getAttribute("color"); tv.copy(this.light.color), nv.copy(this.light.groundColor); for (let i = 0, r = t.count; i < r; i++) { const s = i < r / 2 ? tv : nv; t.setXYZ(i, s.r, s.g, s.b); } t.needsUpdate = true; } e.lookAt(GN.setFromMatrixPosition(this.light.matrixWorld).negate()); } }; var oM = class extends Rn { constructor(e = 10, t = 10, i = 4473924, r = 8947848) { i = new Ue(i), r = new Ue(r); const s = t / 2, o = e / t, a6 = e / 2, c = [], l = []; for (let f6 = 0, g6 = 0, p = -a6; f6 <= t; f6++, p += o) { c.push(-a6, 0, p, a6, 0, p), c.push(p, 0, -a6, p, 0, a6); const u6 = f6 === s ? i : r; u6.toArray(l, g6), g6 += 3, u6.toArray(l, g6), g6 += 3, u6.toArray(l, g6), g6 += 3, u6.toArray(l, g6), g6 += 3; } const d = new Ke(); d.setAttribute("position", new We(c, 3)), d.setAttribute("color", new We(l, 3)); const h6 = new an2({ vertexColors: true, toneMapped: false }); super(d, h6), this.type = "GridHelper"; } }; var WN = class extends Rn { constructor(e = 10, t = 16, i = 8, r = 64, s = 4473924, o = 8947848) { s = new Ue(s), o = new Ue(o); const a6 = [], c = []; for (let h6 = 0; h6 <= t; h6++) { const f6 = h6 / t * (Math.PI * 2), g6 = Math.sin(f6) * e, p = Math.cos(f6) * e; a6.push(0, 0, 0), a6.push(g6, 0, p); const u6 = h6 & 1 ? s : o; c.push(u6.r, u6.g, u6.b), c.push(u6.r, u6.g, u6.b); } for (let h6 = 0; h6 <= i; h6++) { const f6 = h6 & 1 ? s : o, g6 = e - e / i * h6; for (let p = 0; p < r; p++) { let u6 = p / r * (Math.PI * 2), y6 = Math.sin(u6) * g6, v6 = Math.cos(u6) * g6; a6.push(y6, 0, v6), c.push(f6.r, f6.g, f6.b), u6 = (p + 1) / r * (Math.PI * 2), y6 = Math.sin(u6) * g6, v6 = Math.cos(u6) * g6, a6.push(y6, 0, v6), c.push(f6.r, f6.g, f6.b); } } const l = new Ke(); l.setAttribute("position", new We(a6, 3)), l.setAttribute("color", new We(c, 3)); const d = new an2({ vertexColors: true, toneMapped: false }); super(l, d), this.type = "PolarGridHelper"; } }; var iv = new q4(); var pc = new q4(); var rv = new q4(); var jN = class extends ut { constructor(e, t, i) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.color = i, t === void 0 && (t = 1); let r = new Ke(); r.setAttribute("position", new We([ -t, t, 0, t, t, 0, t, -t, 0, -t, -t, 0, -t, t, 0 ], 3)); const s = new an2({ fog: false, toneMapped: false }); this.lightPlane = new Oi(r, s), this.add(this.lightPlane), r = new Ke(), r.setAttribute("position", new We([0, 0, 0, 0, 0, 1], 3)), this.targetLine = new Oi(r, s), this.add(this.targetLine), this.update(); } dispose() { this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose(); } update() { iv.setFromMatrixPosition(this.light.matrixWorld), pc.setFromMatrixPosition(this.light.target.matrixWorld), rv.subVectors(pc, iv), this.lightPlane.lookAt(pc), this.color !== void 0 ? (this.lightPlane.material.color.set(this.color), this.targetLine.material.color.set(this.color)) : (this.lightPlane.material.color.copy(this.light.color), this.targetLine.material.color.copy(this.light.color)), this.targetLine.lookAt(pc), this.targetLine.scale.z = rv.length(); } }; var mc = new q4(); var Bt = new hl(); var $N = class extends Rn { constructor(e) { const t = new Ke(), i = new an2({ color: 16777215, vertexColors: true, toneMapped: false }), r = [], s = [], o = {}, a6 = new Ue(16755200), c = new Ue(16711680), l = new Ue(43775), d = new Ue(16777215), h6 = new Ue(3355443); f6("n1", "n2", a6), f6("n2", "n4", a6), f6("n4", "n3", a6), f6("n3", "n1", a6), f6("f1", "f2", a6), f6("f2", "f4", a6), f6("f4", "f3", a6), f6("f3", "f1", a6), f6("n1", "f1", a6), f6("n2", "f2", a6), f6("n3", "f3", a6), f6("n4", "f4", a6), f6("p", "n1", c), f6("p", "n2", c), f6("p", "n3", c), f6("p", "n4", c), f6("u1", "u2", l), f6("u2", "u3", l), f6("u3", "u1", l), f6("c", "t", d), f6("p", "c", h6), f6("cn1", "cn2", h6), f6("cn3", "cn4", h6), f6("cf1", "cf2", h6), f6("cf3", "cf4", h6); function f6(p, u6, y6) { g6(p, y6), g6(u6, y6); } function g6(p, u6) { r.push(0, 0, 0), s.push(u6.r, u6.g, u6.b), o[p] === void 0 && (o[p] = []), o[p].push(r.length / 3 - 1); } t.setAttribute("position", new We(r, 3)), t.setAttribute("color", new We(s, 3)), super(t, i), this.type = "CameraHelper", this.camera = e, this.camera.updateProjectionMatrix && this.camera.updateProjectionMatrix(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.pointMap = o, this.update(); } update() { const e = this.geometry, t = this.pointMap, i = 1, r = 1; Bt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), Ht("c", t, e, Bt, 0, 0, -1), Ht("t", t, e, Bt, 0, 0, 1), Ht("n1", t, e, Bt, -i, -r, -1), Ht("n2", t, e, Bt, i, -r, -1), Ht("n3", t, e, Bt, -i, r, -1), Ht("n4", t, e, Bt, i, r, -1), Ht("f1", t, e, Bt, -i, -r, 1), Ht("f2", t, e, Bt, i, -r, 1), Ht("f3", t, e, Bt, -i, r, 1), Ht("f4", t, e, Bt, i, r, 1), Ht("u1", t, e, Bt, i * 0.7, r * 1.1, -1), Ht("u2", t, e, Bt, -i * 0.7, r * 1.1, -1), Ht("u3", t, e, Bt, 0, r * 2, -1), Ht("cf1", t, e, Bt, -i, 0, 1), Ht("cf2", t, e, Bt, i, 0, 1), Ht("cf3", t, e, Bt, 0, -r, 1), Ht("cf4", t, e, Bt, 0, r, 1), Ht("cn1", t, e, Bt, -i, 0, -1), Ht("cn2", t, e, Bt, i, 0, -1), Ht("cn3", t, e, Bt, 0, -r, -1), Ht("cn4", t, e, Bt, 0, r, -1), e.getAttribute("position").needsUpdate = true; } dispose() { this.geometry.dispose(), this.material.dispose(); } }; function Ht(n, e, t, i, r, s, o) { mc.set(r, s, o).unproject(i); const a6 = e[n]; if (a6 !== void 0) { const c = t.getAttribute("position"); for (let l = 0, d = a6.length; l < d; l++) c.setXYZ(a6[l], mc.x, mc.y, mc.z); } } var gc = new Nn(); var aM = class extends Rn { constructor(e, t = 16776960) { const i = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), r = new Float32Array(8 * 3), s = new Ke(); s.setIndex(new ot(i, 1)), s.setAttribute("position", new ot(r, 3)), super(s, new an2({ color: t, toneMapped: false })), this.object = e, this.type = "BoxHelper", this.matrixAutoUpdate = false, this.update(); } update(e) { if (e !== void 0 && console.warn("THREE.BoxHelper: .update() has no longer arguments."), this.object !== void 0 && gc.setFromObject(this.object), gc.isEmpty()) return; const t = gc.min, i = gc.max, r = this.geometry.attributes.position, s = r.array; s[0] = i.x, s[1] = i.y, s[2] = i.z, s[3] = t.x, s[4] = i.y, s[5] = i.z, s[6] = t.x, s[7] = t.y, s[8] = i.z, s[9] = i.x, s[10] = t.y, s[11] = i.z, s[12] = i.x, s[13] = i.y, s[14] = t.z, s[15] = t.x, s[16] = i.y, s[17] = t.z, s[18] = t.x, s[19] = t.y, s[20] = t.z, s[21] = i.x, s[22] = t.y, s[23] = t.z, r.needsUpdate = true, this.geometry.computeBoundingSphere(); } setFromObject(e) { return this.object = e, this.update(), this; } copy(e) { return Rn.prototype.copy.call(this, e), this.object = e.object, this; } }; var ZN = class extends Rn { constructor(e, t = 16776960) { const i = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), r = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1], s = new Ke(); s.setIndex(new ot(i, 1)), s.setAttribute("position", new We(r, 3)), super(s, new an2({ color: t, toneMapped: false })), this.box = e, this.type = "Box3Helper", this.geometry.computeBoundingSphere(); } updateMatrixWorld(e) { const t = this.box; t.isEmpty() || (t.getCenter(this.position), t.getSize(this.scale), this.scale.multiplyScalar(0.5), super.updateMatrixWorld(e)); } }; var XN = class extends Oi { constructor(e, t = 1, i = 16776960) { const r = i, s = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0], o = new Ke(); o.setAttribute("position", new We(s, 3)), o.computeBoundingSphere(), super(o, new an2({ color: r, toneMapped: false })), this.type = "PlaneHelper", this.plane = e, this.size = t; const a6 = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1], c = new Ke(); c.setAttribute("position", new We(a6, 3)), c.computeBoundingSphere(), this.add(new Xt(c, new In({ color: r, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false }))); } updateMatrixWorld(e) { let t = -this.plane.constant; Math.abs(t) < 1e-8 && (t = 1e-8), this.scale.set(0.5 * this.size, 0.5 * this.size, t), this.children[0].material.side = t < 0 ? jt : Hr, this.lookAt(this.plane.normal), super.updateMatrixWorld(e); } }; var sv = new q4(); var vc; var _h; var YN = class extends ut { // dir is assumed to be normalized constructor(e = new q4(0, 0, 1), t = new q4(0, 0, 0), i = 1, r = 16776960, s = i * 0.2, o = s * 0.2) { super(), this.type = "ArrowHelper", vc === void 0 && (vc = new Ke(), vc.setAttribute("position", new We([0, 0, 0, 0, 1, 0], 3)), _h = new $r(0, 0.5, 1, 5, 1), _h.translate(0, -0.5, 0)), this.position.copy(t), this.line = new Oi(vc, new an2({ color: r, toneMapped: false })), this.line.matrixAutoUpdate = false, this.add(this.line), this.cone = new Xt(_h, new In({ color: r, toneMapped: false })), this.cone.matrixAutoUpdate = false, this.add(this.cone), this.setDirection(e), this.setLength(i, s, o); } setDirection(e) { if (e.y > 0.99999) this.quaternion.set(0, 0, 0, 1); else if (e.y < -0.99999) this.quaternion.set(1, 0, 0, 0); else { sv.set(e.z, 0, -e.x).normalize(); const t = Math.acos(e.y); this.quaternion.setFromAxisAngle(sv, t); } } setLength(e, t = e * 0.2, i = t * 0.2) { this.line.scale.set(1, Math.max(1e-4, e - t), 1), this.line.updateMatrix(), this.cone.scale.set(i, t, i), this.cone.position.y = e, this.cone.updateMatrix(); } setColor(e) { this.line.material.color.set(e), this.cone.material.color.set(e); } copy(e) { return super.copy(e, false), this.line.copy(e.line), this.cone.copy(e.cone), this; } }; var lM = class extends Rn { constructor(e = 1) { const t = [ 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e ], i = [ 1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1 ], r = new Ke(); r.setAttribute("position", new We(t, 3)), r.setAttribute("color", new We(i, 3)); const s = new an2({ vertexColors: true, toneMapped: false }); super(r, s), this.type = "AxesHelper"; } setColors(e, t, i) { const r = new Ue(), s = this.geometry.attributes.color.array; return r.set(e), r.toArray(s, 0), r.toArray(s, 3), r.set(t), r.toArray(s, 6), r.toArray(s, 9), r.set(i), r.toArray(s, 12), r.toArray(s, 15), this.geometry.attributes.color.needsUpdate = true, this; } dispose() { this.geometry.dispose(), this.material.dispose(); } }; var cM = new Float32Array(1); var JN = new Int32Array(cM.buffer); var KN = class { // Converts float32 to float16 (stored as uint16 value). static toHalfFloat(e) { cM[0] = e; const t = JN[0]; let i = t >> 16 & 32768, r = t >> 12 & 2047; const s = t >> 23 & 255; return s < 103 ? i : s > 142 ? (i |= 31744, i |= (s == 255 ? 0 : 1) && t & 8388607, i) : s < 113 ? (r |= 2048, i |= (r >> 114 - s) + (r >> 113 - s & 1), i) : (i |= s - 112 << 10 | r >> 1, i += r & 1, i); } }; var bo = 4; var Nr = 8; var Mi = Math.pow(2, Nr); var uM = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582]; var hM = Nr - bo + 1 + uM.length; var lo = 20; var Ti = { [Cn]: 0, [Cs]: 1, [mu]: 2, [Af]: 3, [Sf]: 4, [_f]: 5, [pu]: 6 }; var hs = new In({ side: jt, depthWrite: false, depthTest: false }); var qN = new Xt(new or(), hs); var Th = new sa(); var { _lodPlanes: Ma, _sizeLods: ov, _sigmas: yc } = tB(); var av = new Ue(); var Eh = null; var ds = (1 + Math.sqrt(5)) / 2; var co = 1 / ds; var lv = [ new q4(1, 1, 1), new q4(-1, 1, 1), new q4(1, 1, -1), new q4(-1, 1, -1), new q4(0, ds, co), new q4(0, ds, -co), new q4(co, 0, ds), new q4(-co, 0, ds), new q4(ds, co, 0), new q4(-ds, co, 0) ]; function cv(n) { const e = Math.max(n.r, n.g, n.b), t = Math.min(Math.max(Math.ceil(Math.log2(e)), -128), 127); return n.multiplyScalar(Math.pow(2, -t)), (t + 128) / 255; } var QN = class { constructor(e) { this._renderer = e, this._pingPongRenderTarget = null, this._blurMaterial = nB(lo), this._equirectShader = null, this._cubemapShader = null, this._compileMaterial(this._blurMaterial); } /** * Generates a PMREM from a supplied Scene, which can be faster than using an * image if networking bandwidth is low. Optional sigma specifies a blur radius * in radians to be applied to the scene before PMREM generation. Optional near * and far planes ensure the scene is rendered in its entirety (the cubeCamera * is placed at the origin). */ fromScene(e, t = 0, i = 0.1, r = 100) { Eh = this._renderer.getRenderTarget(); const s = this._allocateTargets(); return this._sceneToCubeUV(e, i, r, s), t > 0 && this._blur(s, 0, 0, t), this._applyPMREM(s), this._cleanup(s), s; } /** * Generates a PMREM from an equirectangular texture, which can be either LDR * (RGBFormat) or HDR (RGBEFormat). The ideal input image size is 1k (1024 x 512), * as this matches best with the 256 x 256 cubemap output. */ fromEquirectangular(e) { return this._fromTexture(e); } /** * Generates a PMREM from an cubemap texture, which can be either LDR * (RGBFormat) or HDR (RGBEFormat). The ideal input cube size is 256 x 256, * as this matches best with the 256 x 256 cubemap output. */ fromCubemap(e) { return this._fromTexture(e); } /** * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */ compileCubemapShader() { this._cubemapShader === null && (this._cubemapShader = dv(), this._compileMaterial(this._cubemapShader)); } /** * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */ compileEquirectangularShader() { this._equirectShader === null && (this._equirectShader = hv(), this._compileMaterial(this._equirectShader)); } /** * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on * one of them will cause any others to also become unusable. */ dispose() { this._blurMaterial.dispose(), this._cubemapShader !== null && this._cubemapShader.dispose(), this._equirectShader !== null && this._equirectShader.dispose(); for (let e = 0; e < Ma.length; e++) Ma[e].dispose(); } // private interface _cleanup(e) { this._pingPongRenderTarget.dispose(), this._renderer.setRenderTarget(Eh), e.scissorTest = false, bc(e, 0, 0, e.width, e.height); } _fromTexture(e) { Eh = this._renderer.getRenderTarget(); const t = this._allocateTargets(e); return this._textureToCubeUV(e, t), this._applyPMREM(t), this._cleanup(t), t; } _allocateTargets(e) { const t = { magFilter: $t, minFilter: $t, generateMipmaps: false, type: Ts, format: ab, encoding: eB(e) ? e.encoding : mu, depthBuffer: false }, i = uv(t); return i.depthBuffer = !e, this._pingPongRenderTarget = uv(t), i; } _compileMaterial(e) { const t = new Xt(Ma[0], e); this._renderer.compile(t, Th); } _sceneToCubeUV(e, t, i, r) { const a6 = new nn2(90, 1, t, i), c = [1, -1, 1, 1, 1, 1], l = [1, 1, 1, -1, -1, -1], d = this._renderer, h6 = d.autoClear, f6 = d.outputEncoding, g6 = d.toneMapping; d.getClearColor(av), d.toneMapping = Ir, d.outputEncoding = Cn, d.autoClear = false; let p = false; const u6 = e.background; if (u6) { if (u6.isColor) { hs.color.copy(u6).convertSRGBToLinear(), e.background = null; const y6 = cv(hs.color); hs.opacity = y6, p = true; } } else { hs.color.copy(av).convertSRGBToLinear(); const y6 = cv(hs.color); hs.opacity = y6, p = true; } for (let y6 = 0; y6 < 6; y6++) { const v6 = y6 % 3; v6 == 0 ? (a6.up.set(0, c[y6], 0), a6.lookAt(l[y6], 0, 0)) : v6 == 1 ? (a6.up.set(0, 0, c[y6]), a6.lookAt(0, l[y6], 0)) : (a6.up.set(0, c[y6], 0), a6.lookAt(0, 0, l[y6])), bc( r, v6 * Mi, y6 > 2 ? Mi : 0, Mi, Mi ), d.setRenderTarget(r), p && d.render(qN, a6), d.render(e, a6); } d.toneMapping = g6, d.outputEncoding = f6, d.autoClear = h6; } _textureToCubeUV(e, t) { const i = this._renderer; e.isCubeTexture ? this._cubemapShader == null && (this._cubemapShader = dv()) : this._equirectShader == null && (this._equirectShader = hv()); const r = e.isCubeTexture ? this._cubemapShader : this._equirectShader, s = new Xt(Ma[0], r), o = r.uniforms; o.envMap.value = e, e.isCubeTexture || o.texelSize.value.set(1 / e.image.width, 1 / e.image.height), o.inputEncoding.value = Ti[e.encoding], o.outputEncoding.value = Ti[t.texture.encoding], bc(t, 0, 0, 3 * Mi, 2 * Mi), i.setRenderTarget(t), i.render(s, Th); } _applyPMREM(e) { const t = this._renderer, i = t.autoClear; t.autoClear = false; for (let r = 1; r < hM; r++) { const s = Math.sqrt(yc[r] * yc[r] - yc[r - 1] * yc[r - 1]), o = lv[(r - 1) % lv.length]; this._blur(e, r - 1, r, s, o); } t.autoClear = i; } /** * This is a two-pass Gaussian blur for a cubemap. Normally this is done * vertically and horizontally, but this breaks down on a cube. Here we apply * the blur latitudinally (around the poles), and then longitudinally (towards * the poles) to approximate the orthogonally-separable blur. It is least * accurate at the poles, but still does a decent job. */ _blur(e, t, i, r, s) { const o = this._pingPongRenderTarget; this._halfBlur( e, o, t, i, r, "latitudinal", s ), this._halfBlur( o, e, i, i, r, "longitudinal", s ); } _halfBlur(e, t, i, r, s, o, a6) { const c = this._renderer, l = this._blurMaterial; o !== "latitudinal" && o !== "longitudinal" && console.error( "blur direction must be either latitudinal or longitudinal!" ); const d = 3, h6 = new Xt(Ma[r], l), f6 = l.uniforms, g6 = ov[i] - 1, p = isFinite(s) ? Math.PI / (2 * g6) : 2 * Math.PI / (2 * lo - 1), u6 = s / p, y6 = isFinite(s) ? 1 + Math.floor(d * u6) : lo; y6 > lo && console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y6} samples when the maximum is set to ${lo}`); const v6 = []; let m6 = 0; for (let M6 = 0; M6 < lo; ++M6) { const R6 = M6 / u6, L6 = Math.exp(-R6 * R6 / 2); v6.push(L6), M6 == 0 ? m6 += L6 : M6 < y6 && (m6 += 2 * L6); } for (let M6 = 0; M6 < v6.length; M6++) v6[M6] = v6[M6] / m6; f6.envMap.value = e.texture, f6.samples.value = y6, f6.weights.value = v6, f6.latitudinal.value = o === "latitudinal", a6 && (f6.poleAxis.value = a6), f6.dTheta.value = p, f6.mipInt.value = Nr - i, f6.inputEncoding.value = Ti[e.texture.encoding], f6.outputEncoding.value = Ti[e.texture.encoding]; const x6 = ov[r], w6 = 3 * Math.max(0, Mi - 2 * x6), A6 = (r === 0 ? 0 : 2 * Mi) + 2 * x6 * (r > Nr - bo ? r - Nr + bo : 0); bc(t, w6, A6, 3 * x6, 2 * x6), c.setRenderTarget(t), c.render(h6, Th); } }; function eB(n) { return n === void 0 || n.type !== Ts ? false : n.encoding === Cn || n.encoding === Cs || n.encoding === pu; } function tB() { const n = [], e = [], t = []; let i = Nr; for (let r = 0; r < hM; r++) { const s = Math.pow(2, i); e.push(s); let o = 1 / s; r > Nr - bo ? o = uM[r - Nr + bo - 1] : r == 0 && (o = 0), t.push(o); const a6 = 1 / (s - 1), c = -a6 / 2, l = 1 + a6 / 2, d = [c, c, l, c, l, l, c, c, l, l, c, l], h6 = 6, f6 = 6, g6 = 3, p = 2, u6 = 1, y6 = new Float32Array(g6 * f6 * h6), v6 = new Float32Array(p * f6 * h6), m6 = new Float32Array(u6 * f6 * h6); for (let w6 = 0; w6 < h6; w6++) { const A6 = w6 % 3 * 2 / 3 - 1, M6 = w6 > 2 ? 0 : -1, R6 = [ A6, M6, 0, A6 + 2 / 3, M6, 0, A6 + 2 / 3, M6 + 1, 0, A6, M6, 0, A6 + 2 / 3, M6 + 1, 0, A6, M6 + 1, 0 ]; y6.set(R6, g6 * f6 * w6), v6.set(d, p * f6 * w6); const L6 = [w6, w6, w6, w6, w6, w6]; m6.set(L6, u6 * f6 * w6); } const x6 = new Ke(); x6.setAttribute("position", new ot(y6, g6)), x6.setAttribute("uv", new ot(v6, p)), x6.setAttribute("faceIndex", new ot(m6, u6)), n.push(x6), i > bo && i--; } return { _lodPlanes: n, _sizeLods: e, _sigmas: t }; } function uv(n) { const e = new fi(3 * Mi, 3 * Mi, n); return e.texture.mapping = ea, e.texture.name = "PMREM.cubeUv", e.scissorTest = true, e; } function bc(n, e, t, i, r) { n.viewport.set(e, t, i, r), n.scissor.set(e, t, i, r); } function nB(n) { const e = new Float32Array(n), t = new q4(0, 1, 0); return new ra({ name: "SphericalGaussianBlur", defines: { n }, uniforms: { envMap: { value: null }, samples: { value: 1 }, weights: { value: e }, latitudinal: { value: false }, dTheta: { value: 0 }, mipInt: { value: 0 }, poleAxis: { value: t }, inputEncoding: { value: Ti[Cn] }, outputEncoding: { value: Ti[Cn] } }, vertexShader: dp(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; ${fp()} #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: nr, depthTest: false, depthWrite: false }); } function hv() { const n = new Re(1, 1); return new ra({ name: "EquirectangularToCubeUV", uniforms: { envMap: { value: null }, texelSize: { value: n }, inputEncoding: { value: Ti[Cn] }, outputEncoding: { value: Ti[Cn] } }, vertexShader: dp(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform vec2 texelSize; ${fp()} #include void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); vec2 f = fract( uv / texelSize - 0.5 ); uv -= f * texelSize; vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x += texelSize.x; vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.y += texelSize.y; vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x -= texelSize.x; vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); gl_FragColor.rgb = mix( tm, bm, f.y ); gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: nr, depthTest: false, depthWrite: false }); } function dv() { return new ra({ name: "CubemapToCubeUV", uniforms: { envMap: { value: null }, inputEncoding: { value: Ti[Cn] }, outputEncoding: { value: Ti[Cn] } }, vertexShader: dp(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform samplerCube envMap; ${fp()} void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: nr, depthTest: false, depthWrite: false }); } function dp() { return ( /* glsl */ ` precision mediump float; precision mediump int; attribute vec3 position; attribute vec2 uv; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } ` ); } function fp() { return ( /* glsl */ ` uniform int inputEncoding; uniform int outputEncoding; #include vec4 inputTexelToLinear( vec4 value ) { if ( inputEncoding == 0 ) { return value; } else if ( inputEncoding == 1 ) { return sRGBToLinear( value ); } else if ( inputEncoding == 2 ) { return RGBEToLinear( value ); } else if ( inputEncoding == 3 ) { return RGBMToLinear( value, 7.0 ); } else if ( inputEncoding == 4 ) { return RGBMToLinear( value, 16.0 ); } else if ( inputEncoding == 5 ) { return RGBDToLinear( value, 256.0 ); } else { return GammaToLinear( value, 2.2 ); } } vec4 linearToOutputTexel( vec4 value ) { if ( outputEncoding == 0 ) { return value; } else if ( outputEncoding == 1 ) { return LinearTosRGB( value ); } else if ( outputEncoding == 2 ) { return LinearToRGBE( value ); } else if ( outputEncoding == 3 ) { return LinearToRGBM( value, 7.0 ); } else if ( outputEncoding == 4 ) { return LinearToRGBM( value, 16.0 ); } else if ( outputEncoding == 5 ) { return LinearToRGBD( value, 256.0 ); } else { return LinearToGamma( value, 2.2 ); } } vec4 envMapTexelToLinear( vec4 color ) { return inputTexelToLinear( color ); } ` ); } var iB = 0; var rB = 1; var sB = 0; var oB = 1; var aB = 2; function lB(n) { return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."), n; } function cB(n = []) { return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."), n.isMultiMaterial = true, n.materials = n, n.clone = function() { return n.slice(); }, n; } function uB(n, e) { return console.warn("THREE.PointCloud has been renamed to THREE.Points."), new ia(n, e); } function hB(n) { return console.warn("THREE.Particle has been renamed to THREE.Sprite."), new gl(n); } function dB(n, e) { return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."), new ia(n, e); } function fB(n) { return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."), new es(n); } function pB(n) { return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."), new es(n); } function mB(n) { return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."), new es(n); } function gB(n, e, t) { return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."), new q4(n, e, t); } function vB(n, e) { return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."), new ot(n, e).setUsage(Fo); } function yB(n, e) { return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."), new rx(n, e); } function bB(n, e) { return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."), new sx(n, e); } function xB(n, e) { return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."), new ox(n, e); } function MB(n, e) { return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."), new ax(n, e); } function wB(n, e) { return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."), new gu(n, e); } function AB(n, e) { return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."), new lx(n, e); } function SB(n, e) { return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."), new vu(n, e); } function _B(n, e) { return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."), new We(n, e); } function TB(n, e) { return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."), new ux(n, e); } $n.create = function(n, e) { return console.log("THREE.Curve.create() has been deprecated"), n.prototype = Object.create($n.prototype), n.prototype.constructor = n, n.prototype.getPoint = e, n; }; Ja.prototype.fromPoints = function(n) { return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."), this.setFromPoints(n); }; function EB(n) { return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."), new lM(n); } function CB(n, e) { return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."), new aM(n, e); } function LB(n, e) { return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."), new Rn(new Of(n.geometry), new an2({ color: e !== void 0 ? e : 16777215 })); } oM.prototype.setColors = function() { console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead."); }; rM.prototype.update = function() { console.error("THREE.SkeletonHelper: update() no longer needs to be called."); }; function RB(n, e) { return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."), new Rn(new Vf(n.geometry), new an2({ color: e !== void 0 ? e : 16777215 })); } xn2.prototype.extractUrlBase = function(n) { return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."), rr.extractUrlBase(n); }; xn2.Handlers = { add: function() { console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead."); }, get: function() { console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead."); } }; function FB(n) { return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."), new Zn(n); } function PB(n) { return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."), new Ux(n); } oa.prototype.center = function(n) { return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."), this.getCenter(n); }; oa.prototype.empty = function() { return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; oa.prototype.isIntersectionBox = function(n) { return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(n); }; oa.prototype.size = function(n) { return console.warn("THREE.Box2: .size() has been renamed to .getSize()."), this.getSize(n); }; Nn.prototype.center = function(n) { return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."), this.getCenter(n); }; Nn.prototype.empty = function() { return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; Nn.prototype.isIntersectionBox = function(n) { return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(n); }; Nn.prototype.isIntersectionSphere = function(n) { return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(n); }; Nn.prototype.size = function(n) { return console.warn("THREE.Box3: .size() has been renamed to .getSize()."), this.getSize(n); }; mr.prototype.empty = function() { return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; dl.prototype.setFromMatrix = function(n) { return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."), this.setFromProjectionMatrix(n); }; nM.prototype.center = function(n) { return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."), this.getCenter(n); }; rn2.prototype.flattenToArrayOffset = function(n, e) { return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(n, e); }; rn2.prototype.multiplyVector3 = function(n) { return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."), n.applyMatrix3(this); }; rn2.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix3: .multiplyVector3Array() has been removed."); }; rn2.prototype.applyToBufferAttribute = function(n) { return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."), n.applyMatrix3(this); }; rn2.prototype.applyToVector3Array = function() { console.error("THREE.Matrix3: .applyToVector3Array() has been removed."); }; rn2.prototype.getInverse = function(n) { return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(n).invert(); }; Xe.prototype.extractPosition = function(n) { return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(n); }; Xe.prototype.flattenToArrayOffset = function(n, e) { return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(n, e); }; Xe.prototype.getPosition = function() { return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."), new q4().setFromMatrixColumn(this, 3); }; Xe.prototype.setRotationFromQuaternion = function(n) { return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."), this.makeRotationFromQuaternion(n); }; Xe.prototype.multiplyToArray = function() { console.warn("THREE.Matrix4: .multiplyToArray() has been removed."); }; Xe.prototype.multiplyVector3 = function(n) { return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; Xe.prototype.multiplyVector4 = function(n) { return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; Xe.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix4: .multiplyVector3Array() has been removed."); }; Xe.prototype.rotateAxis = function(n) { console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."), n.transformDirection(this); }; Xe.prototype.crossVector = function(n) { return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; Xe.prototype.translate = function() { console.error("THREE.Matrix4: .translate() has been removed."); }; Xe.prototype.rotateX = function() { console.error("THREE.Matrix4: .rotateX() has been removed."); }; Xe.prototype.rotateY = function() { console.error("THREE.Matrix4: .rotateY() has been removed."); }; Xe.prototype.rotateZ = function() { console.error("THREE.Matrix4: .rotateZ() has been removed."); }; Xe.prototype.rotateByAxis = function() { console.error("THREE.Matrix4: .rotateByAxis() has been removed."); }; Xe.prototype.applyToBufferAttribute = function(n) { return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; Xe.prototype.applyToVector3Array = function() { console.error("THREE.Matrix4: .applyToVector3Array() has been removed."); }; Xe.prototype.makeFrustum = function(n, e, t, i, r, s) { return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."), this.makePerspective(n, e, i, t, r, s); }; Xe.prototype.getInverse = function(n) { return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(n).invert(); }; wi.prototype.isIntersectionLine = function(n) { return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."), this.intersectsLine(n); }; bn.prototype.multiplyVector3 = function(n) { return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."), n.applyQuaternion(this); }; bn.prototype.inverse = function() { return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."), this.invert(); }; qr.prototype.isIntersectionBox = function(n) { return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(n); }; qr.prototype.isIntersectionPlane = function(n) { return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."), this.intersectsPlane(n); }; qr.prototype.isIntersectionSphere = function(n) { return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(n); }; Zt.prototype.area = function() { return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."), this.getArea(); }; Zt.prototype.barycoordFromPoint = function(n, e) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), this.getBarycoord(n, e); }; Zt.prototype.midpoint = function(n) { return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."), this.getMidpoint(n); }; Zt.prototypenormal = function(n) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), this.getNormal(n); }; Zt.prototype.plane = function(n) { return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."), this.getPlane(n); }; Zt.barycoordFromPoint = function(n, e, t, i, r) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), Zt.getBarycoord(n, e, t, i, r); }; Zt.normal = function(n, e, t, i) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), Zt.getNormal(n, e, t, i); }; Dr.prototype.extractAllPoints = function(n) { return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."), this.extractPoints(n); }; Dr.prototype.extrude = function(n) { return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."), new mi(this, n); }; Dr.prototype.makeGeometry = function(n) { return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."), new Fs(this, n); }; Re.prototype.fromAttribute = function(n, e, t) { return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(n, e, t); }; Re.prototype.distanceToManhattan = function(n) { return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(n); }; Re.prototype.lengthManhattan = function() { return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; q4.prototype.setEulerFromRotationMatrix = function() { console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead."); }; q4.prototype.setEulerFromQuaternion = function() { console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead."); }; q4.prototype.getPositionFromMatrix = function(n) { return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."), this.setFromMatrixPosition(n); }; q4.prototype.getScaleFromMatrix = function(n) { return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."), this.setFromMatrixScale(n); }; q4.prototype.getColumnFromMatrix = function(n, e) { return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."), this.setFromMatrixColumn(e, n); }; q4.prototype.applyProjection = function(n) { return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."), this.applyMatrix4(n); }; q4.prototype.fromAttribute = function(n, e, t) { return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(n, e, t); }; q4.prototype.distanceToManhattan = function(n) { return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(n); }; q4.prototype.lengthManhattan = function() { return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; xt.prototype.fromAttribute = function(n, e, t) { return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(n, e, t); }; xt.prototype.lengthManhattan = function() { return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; ut.prototype.getChildByName = function(n) { return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."), this.getObjectByName(n); }; ut.prototype.renderDepth = function() { console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead."); }; ut.prototype.translate = function(n, e) { return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."), this.translateOnAxis(e, n); }; ut.prototype.getWorldRotation = function() { console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead."); }; ut.prototype.applyMatrix = function(n) { return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(n); }; Object.defineProperties(ut.prototype, { eulerOrder: { get: function() { return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order; }, set: function(n) { console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order = n; } }, useQuaternion: { get: function() { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."); }, set: function() { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."); } } }); Xt.prototype.setDrawMode = function() { console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary."); }; Object.defineProperties(Xt.prototype, { drawMode: { get: function() { return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."), Zb; }, set: function() { console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary."); } } }); vl.prototype.initBones = function() { console.error("THREE.SkinnedMesh: initBones() has been removed."); }; nn2.prototype.setLens = function(n, e) { console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."), e !== void 0 && (this.filmGauge = e), this.setFocalLength(n); }; Object.defineProperties(gi.prototype, { onlyShadow: { set: function() { console.warn("THREE.Light: .onlyShadow has been removed."); } }, shadowCameraFov: { set: function(n) { console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."), this.shadow.camera.fov = n; } }, shadowCameraLeft: { set: function(n) { console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."), this.shadow.camera.left = n; } }, shadowCameraRight: { set: function(n) { console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."), this.shadow.camera.right = n; } }, shadowCameraTop: { set: function(n) { console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."), this.shadow.camera.top = n; } }, shadowCameraBottom: { set: function(n) { console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."), this.shadow.camera.bottom = n; } }, shadowCameraNear: { set: function(n) { console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."), this.shadow.camera.near = n; } }, shadowCameraFar: { set: function(n) { console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."), this.shadow.camera.far = n; } }, shadowCameraVisible: { set: function() { console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead."); } }, shadowBias: { set: function(n) { console.warn("THREE.Light: .shadowBias is now .shadow.bias."), this.shadow.bias = n; } }, shadowDarkness: { set: function() { console.warn("THREE.Light: .shadowDarkness has been removed."); } }, shadowMapWidth: { set: function(n) { console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."), this.shadow.mapSize.width = n; } }, shadowMapHeight: { set: function(n) { console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."), this.shadow.mapSize.height = n; } } }); Object.defineProperties(ot.prototype, { length: { get: function() { return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."), this.array.length; } }, dynamic: { get: function() { return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.usage === Fo; }, set: function() { console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.setUsage(Fo); } } }); ot.prototype.setDynamic = function(n) { return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(n === true ? Fo : Ro), this; }; ot.prototype.copyIndicesArray = function() { console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed."); }, ot.prototype.setArray = function() { console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; Ke.prototype.addIndex = function(n) { console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."), this.setIndex(n); }; Ke.prototype.addAttribute = function(n, e) { return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."), !(e && e.isBufferAttribute) && !(e && e.isInterleavedBufferAttribute) ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), this.setAttribute(n, new ot(arguments[1], arguments[2]))) : n === "index" ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), this.setIndex(e), this) : this.setAttribute(n, e); }; Ke.prototype.addDrawCall = function(n, e, t) { t !== void 0 && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."), console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."), this.addGroup(n, e); }; Ke.prototype.clearDrawCalls = function() { console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."), this.clearGroups(); }; Ke.prototype.computeOffsets = function() { console.warn("THREE.BufferGeometry: .computeOffsets() has been removed."); }; Ke.prototype.removeAttribute = function(n) { return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."), this.deleteAttribute(n); }; Ke.prototype.applyMatrix = function(n) { return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(n); }; Object.defineProperties(Ke.prototype, { drawcalls: { get: function() { return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."), this.groups; } }, offsets: { get: function() { return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."), this.groups; } } }); Qr.prototype.setDynamic = function(n) { return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(n === true ? Fo : Ro), this; }; Qr.prototype.setArray = function() { console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; mi.prototype.getArrays = function() { console.error("THREE.ExtrudeGeometry: .getArrays() has been removed."); }; mi.prototype.addShapeList = function() { console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed."); }; mi.prototype.addShape = function() { console.error("THREE.ExtrudeGeometry: .addShape() has been removed."); }; wu.prototype.dispose = function() { console.error("THREE.Scene: .dispose() has been removed."); }; Fu.prototype.onUpdate = function() { return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."), this; }; Object.defineProperties(tn2.prototype, { wrapAround: { get: function() { console.warn("THREE.Material: .wrapAround has been removed."); }, set: function() { console.warn("THREE.Material: .wrapAround has been removed."); } }, overdraw: { get: function() { console.warn("THREE.Material: .overdraw has been removed."); }, set: function() { console.warn("THREE.Material: .overdraw has been removed."); } }, wrapRGB: { get: function() { return console.warn("THREE.Material: .wrapRGB has been removed."), new Ue(); } }, shading: { get: function() { console.error("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."); }, set: function(n) { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = n === yf; } }, stencilMask: { get: function() { return console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask; }, set: function(n) { console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask = n; } } }); Object.defineProperties(ar.prototype, { derivatives: { get: function() { return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives; }, set: function(n) { console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives = n; } } }); wt.prototype.clearTarget = function(n, e, t, i) { console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."), this.setRenderTarget(n), this.clear(e, t, i); }; wt.prototype.animate = function(n) { console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."), this.setAnimationLoop(n); }; wt.prototype.getCurrentRenderTarget = function() { return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."), this.getRenderTarget(); }; wt.prototype.getMaxAnisotropy = function() { return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."), this.capabilities.getMaxAnisotropy(); }; wt.prototype.getPrecision = function() { return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."), this.capabilities.precision; }; wt.prototype.resetGLState = function() { return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."), this.state.reset(); }; wt.prototype.supportsFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get("OES_texture_float"); }; wt.prototype.supportsHalfFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get("OES_texture_half_float"); }; wt.prototype.supportsStandardDerivatives = function() { return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get("OES_standard_derivatives"); }; wt.prototype.supportsCompressedTextureS3TC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get("WEBGL_compressed_texture_s3tc"); }; wt.prototype.supportsCompressedTexturePVRTC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."), this.extensions.get("WEBGL_compressed_texture_pvrtc"); }; wt.prototype.supportsBlendMinMax = function() { return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get("EXT_blend_minmax"); }; wt.prototype.supportsVertexTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."), this.capabilities.vertexTextures; }; wt.prototype.supportsInstancedArrays = function() { return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get("ANGLE_instanced_arrays"); }; wt.prototype.enableScissorTest = function(n) { console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."), this.setScissorTest(n); }; wt.prototype.initMaterial = function() { console.warn("THREE.WebGLRenderer: .initMaterial() has been removed."); }; wt.prototype.addPrePlugin = function() { console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed."); }; wt.prototype.addPostPlugin = function() { console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed."); }; wt.prototype.updateShadowMap = function() { console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed."); }; wt.prototype.setFaceCulling = function() { console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed."); }; wt.prototype.allocTextureUnit = function() { console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed."); }; wt.prototype.setTexture = function() { console.warn("THREE.WebGLRenderer: .setTexture() has been removed."); }; wt.prototype.setTexture2D = function() { console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed."); }; wt.prototype.setTextureCube = function() { console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed."); }; wt.prototype.getActiveMipMapLevel = function() { return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."), this.getActiveMipmapLevel(); }; Object.defineProperties(wt.prototype, { shadowMapEnabled: { get: function() { return this.shadowMap.enabled; }, set: function(n) { console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."), this.shadowMap.enabled = n; } }, shadowMapType: { get: function() { return this.shadowMap.type; }, set: function(n) { console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."), this.shadowMap.type = n; } }, shadowMapCullFace: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead."); } }, context: { get: function() { return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."), this.getContext(); } }, vr: { get: function() { return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"), this.xr; } }, gammaInput: { get: function() { return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."), false; }, set: function() { console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."); } }, gammaOutput: { get: function() { return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), false; }, set: function(n) { console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), this.outputEncoding = n === true ? Cs : Cn; } }, toneMappingWhitePoint: { get: function() { return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."), 1; }, set: function() { console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."); } } }); Object.defineProperties(Mx.prototype, { cullFace: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead."); } }, renderReverseSided: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead."); } }, renderSingleSided: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead."); } } }); function IB(n, e, t) { return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."), new bu(n, t); } Object.defineProperties(fi.prototype, { wrapS: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS = n; } }, wrapT: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT = n; } }, magFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter = n; } }, minFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter = n; } }, anisotropy: { get: function() { return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy = n; } }, offset: { get: function() { return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset = n; } }, repeat: { get: function() { return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat = n; } }, format: { get: function() { return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format = n; } }, type: { get: function() { return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type = n; } }, generateMipmaps: { get: function() { return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps = n; } } }); cp.prototype.load = function(n) { console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead."); const e = this; return new $x().load(n, function(i) { e.setBuffer(i); }), this; }; Jx.prototype.getData = function() { return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."), this.getFrequencyData(); }; yu.prototype.updateCubeMap = function(n, e) { return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."), this.update(n, e); }; yu.prototype.clear = function(n, e, t, i) { return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."), this.renderTarget.clear(n, e, t, i); }; Bs.crossOrigin = void 0; Bs.loadTexture = function(n, e, t, i) { console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."); const r = new qf(); r.setCrossOrigin(this.crossOrigin); const s = r.load(n, t, void 0, i); return e && (s.mapping = e), s; }; Bs.loadTextureCube = function(n, e, t, i) { console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."); const r = new Bx(); r.setCrossOrigin(this.crossOrigin); const s = r.load(n, t, void 0, i); return e && (s.mapping = e), s; }; Bs.loadCompressedTexture = function() { console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead."); }; Bs.loadCompressedTextureCube = function() { console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead."); }; function OB() { console.error("THREE.CanvasRenderer has been removed"); } function DB() { console.error("THREE.JSONLoader has been removed."); } var NB = { createMultiMaterialObject: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); }, detach: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); }, attach: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); } }; function BB() { console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js"); } typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: gf } })); typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = gf); var UB = Object.freeze(Object.defineProperty({ __proto__: null, ACESFilmicToneMapping: Jy, AddEquation: ps, AddOperation: $y, AdditiveAnimationBlendMode: Mf, AdditiveBlending: id, AlphaFormat: rb, AlwaysDepth: zy, AlwaysStencilFunc: Qb, AmbientLight: tp, AmbientLightProbe: Xx, AnimationClip: jo, AnimationLoader: mN, AnimationMixer: Qx, AnimationObjectGroup: qx, AnimationUtils: Ct, ArcCurve: Df, ArrayCamera: Ff, ArrowHelper: YN, Audio: cp, AudioAnalyser: Jx, AudioContext: lp, AudioListener: SN, AudioLoader: $x, AxesHelper: lM, AxisHelper: EB, BackSide: jt, BasicDepthPacking: Jb, BasicShadowMap: L3, BinaryTextureLoader: PB, Bone: yl, BooleanKeyframeTrack: ks, BoundingBoxHelper: CB, Box2: oa, Box3: Nn, Box3Helper: ZN, BoxBufferGeometry: or, BoxGeometry: or, BoxHelper: aM, BufferAttribute: ot, BufferGeometry: Ke, BufferGeometryLoader: Wx, ByteType: qy, Cache: Is, Camera: hl, CameraHelper: $N, CanvasRenderer: OB, CanvasTexture: Ex, CatmullRomCurve3: Bf, CineonToneMapping: Yy, CircleBufferGeometry: Io, CircleGeometry: Io, ClampToEdgeWrapping: hn2, Clock: Yx, Color: Ue, ColorKeyframeTrack: Jf, CompressedTexture: If, CompressedTextureLoader: gN, ConeBufferGeometry: Oo, ConeGeometry: Oo, CubeCamera: yu, CubeReflectionMapping: ll, CubeRefractionMapping: cl, CubeTexture: ta, CubeTextureLoader: Bx, CubeUVReflectionMapping: ea, CubeUVRefractionMapping: ul, CubicBezierCurve: Su, CubicBezierCurve3: Uf, CubicInterpolant: Ix, CullFaceBack: nd, CullFaceFront: Sy, CullFaceFrontBack: C3, CullFaceNone: Ay, Curve: $n, CurvePath: zx, CustomBlending: Ty, CustomToneMapping: Ky, CylinderBufferGeometry: $r, CylinderGeometry: $r, Cylindrical: zN, DataTexture: Ss, DataTexture2DArray: Lf, DataTexture3D: Rf, DataTextureLoader: Ux, DataUtils: KN, DecrementStencilOp: U3, DecrementWrapStencilOp: k3, DefaultLoadingManager: Nx, DepthFormat: ws, DepthStencilFormat: Co, DepthTexture: Cx, DirectionalLight: Ru, DirectionalLightHelper: jN, DiscreteInterpolant: Ox, DodecahedronBufferGeometry: Do, DodecahedronGeometry: Do, DoubleSide: Wr, DstAlphaFactor: Iy, DstColorFactor: Dy, DynamicBufferAttribute: vB, DynamicCopyUsage: eF, DynamicDrawUsage: Fo, DynamicReadUsage: K3, EdgesGeometry: Of, EdgesHelper: LB, EllipseCurve: xl, EqualDepth: Vy, EqualStencilFunc: W3, EquirectangularReflectionMapping: Vc, EquirectangularRefractionMapping: Gc, Euler: Us, EventDispatcher: Kr, ExtrudeBufferGeometry: mi, ExtrudeGeometry: mi, FaceColors: oB, FileLoader: Zn, FlatShading: yf, Float16BufferAttribute: cx, Float32Attribute: _B, Float32BufferAttribute: We, Float64Attribute: TB, Float64BufferAttribute: ux, FloatType: Qi, Fog: pl, FogExp2: fl, Font: ap, FontLoader: MN, FrontSide: Hr, Frustum: dl, GLBufferAttribute: tM, GLSL1: nF, GLSL3: yd, GammaEncoding: pu, GreaterDepth: Hy, GreaterEqualDepth: Gy, GreaterEqualStencilFunc: X3, GreaterStencilFunc: $3, GridHelper: oM, Group: _i, HalfFloatType: Ms, HemisphereLight: Qf, HemisphereLightHelper: HN, HemisphereLightProbe: Zx, IcosahedronBufferGeometry: No, IcosahedronGeometry: No, ImageBitmapLoader: op, ImageLoader: Ya, ImageUtils: Bs, ImmediateRenderObject: iM, IncrementStencilOp: B3, IncrementWrapStencilOp: z3, InstancedBufferAttribute: sp, InstancedBufferGeometry: rp, InstancedInterleavedBuffer: eM, InstancedMesh: Pf, Int16Attribute: MB, Int16BufferAttribute: ax, Int32Attribute: AB, Int32BufferAttribute: lx, Int8Attribute: yB, Int8BufferAttribute: rx, IntType: eb, InterleavedBuffer: Qr, InterleavedBufferAttribute: lr, Interpolant: Ni, InterpolateDiscrete: Lo, InterpolateLinear: Es, InterpolateSmooth: Cc, InvertStencilOp: V3, JSONLoader: DB, KeepStencilOp: Lc, KeyframeTrack: xi, LOD: _x, LatheBufferGeometry: Bo, LatheGeometry: Bo, Layers: Cf, LensFlare: BB, LessDepth: ky, LessEqualDepth: kc, LessEqualStencilFunc: j3, LessStencilFunc: H3, Light: gi, LightProbe: Al, Line: Oi, Line3: nM, LineBasicMaterial: an2, LineCurve: Ml, LineCurve3: Lx, LineDashedMaterial: Xf, LineLoop: Au, LinePieces: rB, LineSegments: Rn, LineStrip: iB, LinearEncoding: Cn, LinearFilter: zt, LinearInterpolant: Yf, LinearMipMapLinearFilter: O3, LinearMipMapNearestFilter: I3, LinearMipmapLinearFilter: pr, LinearMipmapNearestFilter: du, LinearToneMapping: Zy, Loader: xn2, LoaderUtils: rr, LoadingManager: Kf, LogLuvEncoding: Yb, LoopOnce: Wb, LoopPingPong: $b, LoopRepeat: jb, LuminanceAlphaFormat: ob, LuminanceFormat: sb, MOUSE: T3, Material: tn2, MaterialLoader: Hx, Math: xd, MathUtils: xd, Matrix3: rn2, Matrix4: Xe, MaxEquation: ad, Mesh: Xt, MeshBasicMaterial: In, MeshDepthMaterial: xu, MeshDistanceMaterial: Mu, MeshFaceMaterial: lB, MeshLambertMaterial: $f, MeshMatcapMaterial: Zf, MeshNormalMaterial: jf, MeshPhongMaterial: Hf, MeshPhysicalMaterial: wl, MeshStandardMaterial: zs, MeshToonMaterial: Wf, MinEquation: od, MirroredRepeatWrapping: Eo, MixOperation: jy, MultiMaterial: cB, MultiplyBlending: sd, MultiplyOperation: al, NearestFilter: $t, NearestMipMapLinearFilter: P3, NearestMipMapNearestFilter: F3, NearestMipmapLinearFilter: Ga, NearestMipmapNearestFilter: Va, NeverDepth: Uy, NeverStencilFunc: G3, NoBlending: nr, NoColors: sB, NoToneMapping: Ir, NormalAnimationBlendMode: fu, NormalBlending: vo, NotEqualDepth: Wy, NotEqualStencilFunc: Z3, NumberKeyframeTrack: Ho, Object3D: ut, ObjectLoader: vN, ObjectSpaceNormalMap: qb, OctahedronBufferGeometry: Rs, OctahedronGeometry: Rs, OneFactor: Ry, OneMinusDstAlphaFactor: Oy, OneMinusDstColorFactor: Ny, OneMinusSrcAlphaFactor: xf, OneMinusSrcColorFactor: Py, OrthographicCamera: sa, PCFShadowMap: vf, PCFSoftShadowMap: _y, PMREMGenerator: QN, ParametricBufferGeometry: Hc, ParametricGeometry: Hc, Particle: hB, ParticleBasicMaterial: pB, ParticleSystem: dB, ParticleSystemMaterial: mB, Path: Ja, PerspectiveCamera: nn2, Plane: wi, PlaneBufferGeometry: Ls, PlaneGeometry: Ls, PlaneHelper: XN, PointCloud: uB, PointCloudMaterial: fB, PointLight: Lu, PointLightHelper: VN, Points: ia, PointsMaterial: es, PolarGridHelper: WN, PolyhedronBufferGeometry: Di, PolyhedronGeometry: Di, PositionalAudio: TN, PropertyBinding: mt, PropertyMixer: Kx, QuadraticBezierCurve: _u, QuadraticBezierCurve3: zf, Quaternion: bn, QuaternionKeyframeTrack: Vs, QuaternionLinearInterpolant: Dx, REVISION: gf, RGBADepthPacking: Kb, RGBAFormat: Hn, RGBAIntegerFormat: fb, RGBA_ASTC_10x10_Format: Tb, RGBA_ASTC_10x5_Format: Ab, RGBA_ASTC_10x6_Format: Sb, RGBA_ASTC_10x8_Format: _b, RGBA_ASTC_12x10_Format: Eb, RGBA_ASTC_12x12_Format: Cb, RGBA_ASTC_4x4_Format: mb, RGBA_ASTC_5x4_Format: gb, RGBA_ASTC_5x5_Format: vb, RGBA_ASTC_6x5_Format: yb, RGBA_ASTC_6x6_Format: bb, RGBA_ASTC_8x5_Format: xb, RGBA_ASTC_8x6_Format: Mb, RGBA_ASTC_8x8_Format: wb, RGBA_BPTC_Format: Lb, RGBA_ETC2_EAC_Format: vd, RGBA_PVRTC_2BPPV1_Format: md, RGBA_PVRTC_4BPPV1_Format: pd, RGBA_S3TC_DXT1_Format: cd, RGBA_S3TC_DXT3_Format: ud, RGBA_S3TC_DXT5_Format: hd, RGBDEncoding: _f, RGBEEncoding: mu, RGBEFormat: ab, RGBFormat: ir, RGBIntegerFormat: db, RGBM16Encoding: Sf, RGBM7Encoding: Af, RGB_ETC1_Format: pb, RGB_ETC2_Format: gd, RGB_PVRTC_2BPPV1_Format: fd, RGB_PVRTC_4BPPV1_Format: dd, RGB_S3TC_DXT1_Format: ld, RGFormat: ub, RGIntegerFormat: hb, RawShaderMaterial: ra, Ray: qr, Raycaster: BN, RectAreaLight: np, RedFormat: lb, RedIntegerFormat: cb, ReinhardToneMapping: Xy, RepeatWrapping: jr, ReplaceStencilOp: N3, ReverseSubtractEquation: Cy, RingBufferGeometry: Uo, RingGeometry: Uo, SRGB8_ALPHA8_ASTC_10x10_Format: Vb, SRGB8_ALPHA8_ASTC_10x5_Format: Ub, SRGB8_ALPHA8_ASTC_10x6_Format: zb, SRGB8_ALPHA8_ASTC_10x8_Format: kb, SRGB8_ALPHA8_ASTC_12x10_Format: Gb, SRGB8_ALPHA8_ASTC_12x12_Format: Hb, SRGB8_ALPHA8_ASTC_4x4_Format: Rb, SRGB8_ALPHA8_ASTC_5x4_Format: Fb, SRGB8_ALPHA8_ASTC_5x5_Format: Pb, SRGB8_ALPHA8_ASTC_6x5_Format: Ib, SRGB8_ALPHA8_ASTC_6x6_Format: Ob, SRGB8_ALPHA8_ASTC_8x5_Format: Db, SRGB8_ALPHA8_ASTC_8x6_Format: Nb, SRGB8_ALPHA8_ASTC_8x8_Format: Bb, Scene: wu, SceneUtils: NB, ShaderChunk: dt, ShaderLib: ci, ShaderMaterial: ar, ShadowMaterial: Gf, Shape: Dr, ShapeBufferGeometry: Fs, ShapeGeometry: Fs, ShapePath: jx, ShapeUtils: Fi, ShortType: Qy, Skeleton: bl, SkeletonHelper: rM, SkinnedMesh: vl, SmoothShading: R3, Sphere: mr, SphereBufferGeometry: Ps, SphereGeometry: Ps, Spherical: UN, SphericalHarmonics3: ip, SplineCurve: Tu, SpotLight: Cu, SpotLightHelper: kN, Sprite: gl, SpriteMaterial: ml, SrcAlphaFactor: bf, SrcAlphaSaturateFactor: By, SrcColorFactor: Fy, StaticCopyUsage: Q3, StaticDrawUsage: Ro, StaticReadUsage: J3, StereoCamera: wN, StreamCopyUsage: tF, StreamDrawUsage: Y3, StreamReadUsage: q3, StringKeyframeTrack: Gs, SubtractEquation: Ey, SubtractiveBlending: rd, TOUCH: E3, TangentSpaceNormalMap: Jr, TetrahedronBufferGeometry: zo, TetrahedronGeometry: zo, TextBufferGeometry: Wc, TextGeometry: Wc, Texture: Yt, TextureLoader: qf, TorusBufferGeometry: ko, TorusGeometry: ko, TorusKnotBufferGeometry: Vo, TorusKnotGeometry: Vo, Triangle: Zt, TriangleFanDrawMode: wf, TriangleStripDrawMode: Xb, TrianglesDrawMode: Zb, TubeBufferGeometry: Go, TubeGeometry: Go, UVMapping: hu, Uint16Attribute: wB, Uint16BufferAttribute: gu, Uint32Attribute: SB, Uint32BufferAttribute: vu, Uint8Attribute: bB, Uint8BufferAttribute: sx, Uint8ClampedAttribute: xB, Uint8ClampedBufferAttribute: ox, Uniform: Fu, UniformsLib: ze, UniformsUtils: dx, UnsignedByteType: Ts, UnsignedInt248Type: yo, UnsignedIntType: Ra, UnsignedShort4444Type: tb, UnsignedShort5551Type: nb, UnsignedShort565Type: ib, UnsignedShortType: Ha, VSMShadowMap: po, Vector2: Re, Vector3: q4, Vector4: xt, VectorKeyframeTrack: Wo, Vertex: gB, VertexColors: aB, VideoTexture: Tx, WebGL1Renderer: Ax, WebGLCubeRenderTarget: bu, WebGLMultipleRenderTargets: nx, WebGLMultisampleRenderTarget: Ef, WebGLRenderTarget: fi, WebGLRenderTargetCube: IB, WebGLRenderer: wt, WebGLUtils: wx, WireframeGeometry: Vf, WireframeHelper: RB, WrapAroundEnding: Wa, XHRLoader: FB, ZeroCurvatureEnding: gs, ZeroFactor: Ly, ZeroSlopeEnding: vs, ZeroStencilOp: D3, sRGBEncoding: Cs }, Symbol.toStringTag, { value: "Module" })); var zB = au(UB); function kB(n, e) { if (!(n instanceof e)) throw new TypeError("Cannot call a class as a function"); } function VB(n, e) { for (var t = 0; t < e.length; t++) { var i = e[t]; i.enumerable = i.enumerable || false, i.configurable = true, "value" in i && (i.writable = true), Object.defineProperty(n, i.key, i); } } function GB(n, e, t) { return e && VB(n.prototype, e), n; } function HB(n, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function"); n.prototype = Object.create(e && e.prototype, { constructor: { value: n, writable: true, configurable: true } }), e && Td(n, e); } function jc(n) { return jc = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) { return t.__proto__ || Object.getPrototypeOf(t); }, jc(n); } function Td(n, e) { return Td = Object.setPrototypeOf || function(i, r) { return i.__proto__ = r, i; }, Td(n, e); } function WB() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false; if (typeof Proxy == "function") return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch { return false; } } function jB(n) { if (n === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return n; } function $B(n, e) { return e && (typeof e == "object" || typeof e == "function") ? e : jB(n); } function ZB(n) { var e = WB(); return function() { var i = jc(n), r; if (e) { var s = jc(this).constructor; r = Reflect.construct(i, arguments, s); } else r = i.apply(this, arguments); return $B(this, r); }; } function fv(n, e) { return YB(n) || KB(n, e) || dM(n, e) || QB(); } function xc(n) { return XB(n) || JB(n) || dM(n) || qB(); } function XB(n) { if (Array.isArray(n)) return Ed(n); } function YB(n) { if (Array.isArray(n)) return n; } function JB(n) { if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n); } function KB(n, e) { var t = n && (typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"]); if (t != null) { var i = [], r = true, s = false, o, a6; try { for (t = t.call(n); !(r = (o = t.next()).done) && (i.push(o.value), !(e && i.length === e)); r = true) ; } catch (c) { s = true, a6 = c; } finally { try { !r && t.return != null && t.return(); } finally { if (s) throw a6; } } return i; } } function dM(n, e) { if (n) { if (typeof n == "string") return Ed(n, e); var t = Object.prototype.toString.call(n).slice(8, -1); if (t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set") return Array.from(n); if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Ed(n, e); } } function Ed(n, e) { (e == null || e > n.length) && (e = n.length); for (var t = 0, i = new Array(e); t < e; t++) i[t] = n[t]; return i; } function qB() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function QB() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var wa = typeof window < "u" && window.THREE ? window.THREE : { LinearFilter: zt, Sprite: gl, SpriteMaterial: ml, Texture: Yt }; var e4 = function(n) { HB(t, n); var e = ZB(t); function t() { var i, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "rgba(255, 255, 255, 1)"; return kB(this, t), i = e.call(this, new wa.SpriteMaterial({ map: new wa.Texture() })), i._text = "".concat(r), i._textHeight = s, i._color = o, i._backgroundColor = false, i._padding = 0, i._borderWidth = 0, i._borderRadius = 0, i._borderColor = "white", i._strokeWidth = 0, i._strokeColor = "white", i._fontFace = "Arial", i._fontSize = 90, i._fontWeight = "normal", i._canvas = document.createElement("canvas"), i._texture = i.material.map, i._texture.minFilter = wa.LinearFilter, i._genCanvas(), i; } return GB(t, [{ key: "text", get: function() { return this._text; }, set: function(r) { this._text = r, this._genCanvas(); } }, { key: "textHeight", get: function() { return this._textHeight; }, set: function(r) { this._textHeight = r, this._genCanvas(); } }, { key: "color", get: function() { return this._color; }, set: function(r) { this._color = r, this._genCanvas(); } }, { key: "backgroundColor", get: function() { return this._backgroundColor; }, set: function(r) { this._backgroundColor = r, this._genCanvas(); } }, { key: "padding", get: function() { return this._padding; }, set: function(r) { this._padding = r, this._genCanvas(); } }, { key: "borderWidth", get: function() { return this._borderWidth; }, set: function(r) { this._borderWidth = r, this._genCanvas(); } }, { key: "borderRadius", get: function() { return this._borderRadius; }, set: function(r) { this._borderRadius = r, this._genCanvas(); } }, { key: "borderColor", get: function() { return this._borderColor; }, set: function(r) { this._borderColor = r, this._genCanvas(); } }, { key: "fontFace", get: function() { return this._fontFace; }, set: function(r) { this._fontFace = r, this._genCanvas(); } }, { key: "fontSize", get: function() { return this._fontSize; }, set: function(r) { this._fontSize = r, this._genCanvas(); } }, { key: "fontWeight", get: function() { return this._fontWeight; }, set: function(r) { this._fontWeight = r, this._genCanvas(); } }, { key: "strokeWidth", get: function() { return this._strokeWidth; }, set: function(r) { this._strokeWidth = r, this._genCanvas(); } }, { key: "strokeColor", get: function() { return this._strokeColor; }, set: function(r) { this._strokeColor = r, this._genCanvas(); } }, { key: "_genCanvas", value: function() { var r = this, s = this._canvas, o = s.getContext("2d"), a6 = Array.isArray(this.borderWidth) ? this.borderWidth : [this.borderWidth, this.borderWidth], c = a6.map(function(R6) { return R6 * r.fontSize * 0.1; }), l = Array.isArray(this.borderRadius) ? this.borderRadius : [this.borderRadius, this.borderRadius, this.borderRadius, this.borderRadius], d = l.map(function(R6) { return R6 * r.fontSize * 0.1; }), h6 = Array.isArray(this.padding) ? this.padding : [this.padding, this.padding], f6 = h6.map(function(R6) { return R6 * r.fontSize * 0.1; }), g6 = this.text.split(` `), p = "".concat(this.fontWeight, " ").concat(this.fontSize, "px ").concat(this.fontFace); o.font = p; var u6 = Math.max.apply(Math, xc(g6.map(function(R6) { return o.measureText(R6).width; }))), y6 = this.fontSize * g6.length; if (s.width = u6 + c[0] * 2 + f6[0] * 2, s.height = y6 + c[1] * 2 + f6[1] * 2, this.borderWidth) { if (o.strokeStyle = this.borderColor, c[0]) { var v6 = c[0] / 2; o.lineWidth = c[0], o.beginPath(), o.moveTo(v6, d[0]), o.lineTo(v6, s.height - d[3]), o.moveTo(s.width - v6, d[1]), o.lineTo(s.width - v6, s.height - d[2]), o.stroke(); } if (c[1]) { var m6 = c[1] / 2; o.lineWidth = c[1], o.beginPath(), o.moveTo(Math.max(c[0], d[0]), m6), o.lineTo(s.width - Math.max(c[0], d[1]), m6), o.moveTo(Math.max(c[0], d[3]), s.height - m6), o.lineTo(s.width - Math.max(c[0], d[2]), s.height - m6), o.stroke(); } if (this.borderRadius) { var x6 = Math.max.apply(Math, xc(c)), w6 = x6 / 2; o.lineWidth = x6, o.beginPath(), [!!d[0] && [d[0], w6, w6, d[0]], !!d[1] && [s.width - d[1], s.width - w6, w6, d[1]], !!d[2] && [s.width - d[2], s.width - w6, s.height - w6, s.height - d[2]], !!d[3] && [d[3], w6, s.height - w6, s.height - d[3]]].filter(function(R6) { return R6; }).forEach(function(R6) { var L6 = fv(R6, 4), T6 = L6[0], P6 = L6[1], _6 = L6[2], S6 = L6[3]; o.moveTo(T6, _6), o.quadraticCurveTo(P6, _6, P6, S6); }), o.stroke(); } } this.backgroundColor && (o.fillStyle = this.backgroundColor, this.borderRadius ? (o.beginPath(), o.moveTo(c[0], d[0]), [ [c[0], d[0], s.width - d[1], c[1], c[1], c[1]], // t [s.width - c[0], s.width - c[0], s.width - c[0], c[1], d[1], s.height - d[2]], // r [s.width - c[0], s.width - d[2], d[3], s.height - c[1], s.height - c[1], s.height - c[1]], // b [c[0], c[0], c[0], s.height - c[1], s.height - d[3], d[0]] // t ].forEach(function(R6) { var L6 = fv(R6, 6), T6 = L6[0], P6 = L6[1], _6 = L6[2], S6 = L6[3], E6 = L6[4], C6 = L6[5]; o.quadraticCurveTo(T6, S6, P6, E6), o.lineTo(_6, C6); }), o.closePath(), o.fill()) : o.fillRect(c[0], c[1], s.width - c[0] * 2, s.height - c[1] * 2)), o.translate.apply(o, xc(c)), o.translate.apply(o, xc(f6)), o.font = p, o.fillStyle = this.color, o.textBaseline = "bottom"; var A6 = this.strokeWidth > 0; A6 && (o.lineWidth = this.strokeWidth * this.fontSize / 10, o.strokeStyle = this.strokeColor), g6.forEach(function(R6, L6) { var T6 = (u6 - o.measureText(R6).width) / 2, P6 = (L6 + 1) * r.fontSize; A6 && o.strokeText(R6, T6, P6), o.fillText(R6, T6, P6); }), this._texture.image = s, this._texture.needsUpdate = true; var M6 = this.textHeight * g6.length + a6[1] * 2 + h6[1] * 2; this.scale.set(M6 * s.width / s.height, M6, 0); } }, { key: "clone", value: function() { return new this.constructor(this.text, this.textHeight, this.color).copy(this); } }, { key: "copy", value: function(r) { return wa.Sprite.prototype.copy.call(this, r), this.color = r.color, this.backgroundColor = r.backgroundColor, this.padding = r.padding, this.borderWidth = r.borderWidth, this.borderColor = r.borderColor, this.fontFace = r.fontFace, this.fontSize = r.fontSize, this.fontWeight = r.fontWeight, this.strokeWidth = r.strokeWidth, this.strokeColor = r.strokeColor, this; } }]), t; }(wa.Sprite); var t4 = Object.freeze(Object.defineProperty({ __proto__: null, default: e4 }, Symbol.toStringTag, { value: "Module" })); var n4 = au(t4); var Ch = { exports: {} }; var pv; function i4() { return pv || (pv = 1, function(n, e) { (function(t, i) { n.exports = i(); })(typeof window < "u" ? window : Lr, function() { if (typeof window > "u") return null; var t = typeof window < "u" && window.Math == Math ? window : typeof self < "u" && self.Math == Math ? self : Function("return this")(), i = t.requestAnimationFrame || t.mozRequestAnimationFrame || t.webkitRequestAnimationFrame || function(d) { return t.setTimeout(d, 20); }, r = t.cancelAnimationFrame || t.mozCancelAnimationFrame || t.webkitCancelAnimationFrame || function(d) { t.clearTimeout(d); }; function s(d, h6) { var f6 = Object.prototype.toString.call(d), g6 = f6 === "[object Array]" || f6 === "[object NodeList]" || f6 === "[object HTMLCollection]" || f6 === "[object Object]" || typeof jQuery < "u" && d instanceof jQuery || typeof Elements < "u" && d instanceof Elements, p = 0, u6 = d.length; if (g6) for (; p < u6; p++) h6(d[p]); else h6(d); } function o(d) { if (!d.getBoundingClientRect) return { width: d.offsetWidth, height: d.offsetHeight }; var h6 = d.getBoundingClientRect(); return { width: Math.round(h6.width), height: Math.round(h6.height) }; } function a6(d, h6) { Object.keys(h6).forEach(function(f6) { d.style[f6] = h6[f6]; }); } var c = function(d, h6) { var f6 = 0; function g6() { var u6 = []; this.add = function(m6) { u6.push(m6); }; var y6, v6; this.call = function(m6) { for (y6 = 0, v6 = u6.length; y6 < v6; y6++) u6[y6].call(this, m6); }, this.remove = function(m6) { var x6 = []; for (y6 = 0, v6 = u6.length; y6 < v6; y6++) u6[y6] !== m6 && x6.push(u6[y6]); u6 = x6; }, this.length = function() { return u6.length; }; } function p(u6, y6) { if (u6) { if (u6.resizedAttached) { u6.resizedAttached.add(y6); return; } u6.resizedAttached = new g6(), u6.resizedAttached.add(y6), u6.resizeSensor = document.createElement("div"), u6.resizeSensor.dir = "ltr", u6.resizeSensor.className = "resize-sensor"; var v6 = { pointerEvents: "none", position: "absolute", left: "0px", top: "0px", right: "0px", bottom: "0px", overflow: "hidden", zIndex: "-1", visibility: "hidden", maxWidth: "100%" }, m6 = { position: "absolute", left: "0px", top: "0px", transition: "0s" }; a6(u6.resizeSensor, v6); var x6 = document.createElement("div"); x6.className = "resize-sensor-expand", a6(x6, v6); var w6 = document.createElement("div"); a6(w6, m6), x6.appendChild(w6); var A6 = document.createElement("div"); A6.className = "resize-sensor-shrink", a6(A6, v6); var M6 = document.createElement("div"); a6(M6, m6), a6(M6, { width: "200%", height: "200%" }), A6.appendChild(M6), u6.resizeSensor.appendChild(x6), u6.resizeSensor.appendChild(A6), u6.appendChild(u6.resizeSensor); var R6 = window.getComputedStyle(u6), L6 = R6 ? R6.getPropertyValue("position") : null; L6 !== "absolute" && L6 !== "relative" && L6 !== "fixed" && L6 !== "sticky" && (u6.style.position = "relative"); var T6 = false, P6 = 0, _6 = o(u6), S6 = 0, E6 = 0, C6 = true; f6 = 0; var I6 = function() { var B6 = u6.offsetWidth, U6 = u6.offsetHeight; w6.style.width = B6 + 10 + "px", w6.style.height = U6 + 10 + "px", x6.scrollLeft = B6 + 10, x6.scrollTop = U6 + 10, A6.scrollLeft = B6 + 10, A6.scrollTop = U6 + 10; }, b6 = function() { if (C6) { var B6 = u6.offsetWidth === 0 && u6.offsetHeight === 0; if (B6) { f6 || (f6 = i(function() { f6 = 0, b6(); })); return; } else C6 = false; } I6(); }; u6.resizeSensor.resetSensor = b6; var F6 = function() { P6 = 0, T6 && (S6 = _6.width, E6 = _6.height, u6.resizedAttached && u6.resizedAttached.call(_6)); }, D6 = function() { _6 = o(u6), T6 = _6.width !== S6 || _6.height !== E6, T6 && !P6 && (P6 = i(F6)), b6(); }, N6 = function(B6, U6, G6) { B6.attachEvent ? B6.attachEvent("on" + U6, G6) : B6.addEventListener(U6, G6); }; N6(x6, "scroll", D6), N6(A6, "scroll", D6), f6 = i(function() { f6 = 0, b6(); }); } } s(d, function(u6) { p(u6, h6); }), this.detach = function(u6) { f6 || (r(f6), f6 = 0), c.detach(d, u6); }, this.reset = function() { d.resizeSensor.resetSensor(); }; }; if (c.reset = function(d) { s(d, function(h6) { h6.resizeSensor.resetSensor(); }); }, c.detach = function(d, h6) { s(d, function(f6) { f6 && (f6.resizedAttached && typeof h6 == "function" && (f6.resizedAttached.remove(h6), f6.resizedAttached.length()) || f6.resizeSensor && (f6.contains(f6.resizeSensor) && f6.removeChild(f6.resizeSensor), delete f6.resizeSensor, delete f6.resizedAttached)); }); }, typeof MutationObserver < "u") { var l = new MutationObserver(function(d) { for (var h6 in d) if (d.hasOwnProperty(h6)) for (var f6 = d[h6].addedNodes, g6 = 0; g6 < f6.length; g6++) f6[g6].resizeSensor && c.reset(f6[g6]); }); document.addEventListener("DOMContentLoaded", function(d) { l.observe(document.body, { childList: true, subtree: true }); }); } return c; }); }(Ch)), Ch.exports; } var r4 = class extends xn2 { constructor(e) { super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) { return new l4(t); }), this.register(function(t) { return new u4(t); }), this.register(function(t) { return new h4(t); }), this.register(function(t) { return new c4(t); }), this.register(function(t) { return new o4(t); }), this.register(function(t) { return new d4(t); }); } load(e, t, i, r) { const s = this; let o; this.resourcePath !== "" ? o = this.resourcePath : this.path !== "" ? o = this.path : o = rr.extractUrlBase(e), this.manager.itemStart(e); const a6 = function(l) { r ? r(l) : console.error(l), s.manager.itemError(e), s.manager.itemEnd(e); }, c = new Zn(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) { try { s.parse(l, o, function(d) { t(d), s.manager.itemEnd(e); }, a6); } catch (d) { a6(d); } }, i, a6); } setDRACOLoader(e) { return this.dracoLoader = e, this; } setDDSLoader() { throw new Error( 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' ); } setKTX2Loader(e) { return this.ktx2Loader = e, this; } setMeshoptDecoder(e) { return this.meshoptDecoder = e, this; } register(e) { return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this; } unregister(e) { return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this; } parse(e, t, i, r) { let s; const o = {}, a6 = {}; if (typeof e == "string") s = e; else if (rr.decodeText(new Uint8Array(e, 0, 4)) === fM) { try { o[vt.KHR_BINARY_GLTF] = new f4(e); } catch (h6) { r && r(h6); return; } s = o[vt.KHR_BINARY_GLTF].content; } else s = rr.decodeText(new Uint8Array(e)); const c = JSON.parse(s); if (c.asset === void 0 || c.asset.version[0] < 2) { r && r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")); return; } const l = new A4(c, { path: t || this.resourcePath || "", crossOrigin: this.crossOrigin, requestHeader: this.requestHeader, manager: this.manager, ktx2Loader: this.ktx2Loader, meshoptDecoder: this.meshoptDecoder }); l.fileLoader.setRequestHeader(this.requestHeader); for (let d = 0; d < this.pluginCallbacks.length; d++) { const h6 = this.pluginCallbacks[d](l); a6[h6.name] = h6, o[h6.name] = true; } if (c.extensionsUsed) for (let d = 0; d < c.extensionsUsed.length; ++d) { const h6 = c.extensionsUsed[d], f6 = c.extensionsRequired || []; switch (h6) { case vt.KHR_MATERIALS_UNLIT: o[h6] = new a4(); break; case vt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: o[h6] = new g4(); break; case vt.KHR_DRACO_MESH_COMPRESSION: o[h6] = new p4(c, this.dracoLoader); break; case vt.KHR_TEXTURE_TRANSFORM: o[h6] = new m4(); break; case vt.KHR_MESH_QUANTIZATION: o[h6] = new v4(); break; default: f6.indexOf(h6) >= 0 && a6[h6] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h6 + '".'); } } l.setExtensions(o), l.setPlugins(a6), l.parse(i, r); } }; function s4() { let n = {}; return { get: function(e) { return n[e]; }, add: function(e, t) { n[e] = t; }, remove: function(e) { delete n[e]; }, removeAll: function() { n = {}; } }; } var vt = { KHR_BINARY_GLTF: "KHR_binary_glTF", KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression", KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual", KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat", KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: "KHR_materials_pbrSpecularGlossiness", KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission", KHR_MATERIALS_UNLIT: "KHR_materials_unlit", KHR_TEXTURE_BASISU: "KHR_texture_basisu", KHR_TEXTURE_TRANSFORM: "KHR_texture_transform", KHR_MESH_QUANTIZATION: "KHR_mesh_quantization", EXT_TEXTURE_WEBP: "EXT_texture_webp", EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression" }; var o4 = class { constructor(e) { this.parser = e, this.name = vt.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} }; } _markDefs() { const e = this.parser, t = this.parser.json.nodes || []; for (let i = 0, r = t.length; i < r; i++) { const s = t[i]; s.extensions && s.extensions[this.name] && s.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, s.extensions[this.name].light); } } _loadLight(e) { const t = this.parser, i = "light:" + e; let r = t.cache.get(i); if (r) return r; const s = t.json, c = ((s.extensions && s.extensions[this.name] || {}).lights || [])[e]; let l; const d = new Ue(16777215); c.color !== void 0 && d.fromArray(c.color); const h6 = c.range !== void 0 ? c.range : 0; switch (c.type) { case "directional": l = new Ru(d), l.target.position.set(0, 0, -1), l.add(l.target); break; case "point": l = new Lu(d), l.distance = h6; break; case "spot": l = new Cu(d), l.distance = h6, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, l.angle = c.spot.outerConeAngle, l.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target); break; default: throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type); } return l.position.set(0, 0, 0), l.decay = 2, c.intensity !== void 0 && (l.intensity = c.intensity), l.name = t.createUniqueName(c.name || "light_" + e), r = Promise.resolve(l), t.cache.add(i, r), r; } createNodeAttachment(e) { const t = this, i = this.parser, s = i.json.nodes[e], a6 = (s.extensions && s.extensions[this.name] || {}).light; return a6 === void 0 ? null : this._loadLight(a6).then(function(c) { return i._getNodeRef(t.cache, a6, c); }); } }; var a4 = class { constructor() { this.name = vt.KHR_MATERIALS_UNLIT; } getMaterialType() { return In; } extendParams(e, t, i) { const r = []; e.color = new Ue(1, 1, 1), e.opacity = 1; const s = t.pbrMetallicRoughness; if (s) { if (Array.isArray(s.baseColorFactor)) { const o = s.baseColorFactor; e.color.fromArray(o), e.opacity = o[3]; } s.baseColorTexture !== void 0 && r.push(i.assignTexture(e, "map", s.baseColorTexture)); } return Promise.all(r); } }; var l4 = class { constructor(e) { this.parser = e, this.name = vt.KHR_MATERIALS_CLEARCOAT; } getMaterialType(e) { const i = this.parser.json.materials[e]; return !i.extensions || !i.extensions[this.name] ? null : wl; } extendMaterialParams(e, t) { const i = this.parser, r = i.json.materials[e]; if (!r.extensions || !r.extensions[this.name]) return Promise.resolve(); const s = [], o = r.extensions[this.name]; if (o.clearcoatFactor !== void 0 && (t.clearcoat = o.clearcoatFactor), o.clearcoatTexture !== void 0 && s.push(i.assignTexture(t, "clearcoatMap", o.clearcoatTexture)), o.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = o.clearcoatRoughnessFactor), o.clearcoatRoughnessTexture !== void 0 && s.push(i.assignTexture(t, "clearcoatRoughnessMap", o.clearcoatRoughnessTexture)), o.clearcoatNormalTexture !== void 0 && (s.push(i.assignTexture(t, "clearcoatNormalMap", o.clearcoatNormalTexture)), o.clearcoatNormalTexture.scale !== void 0)) { const a6 = o.clearcoatNormalTexture.scale; t.clearcoatNormalScale = new Re(a6, -a6); } return Promise.all(s); } }; var c4 = class { constructor(e) { this.parser = e, this.name = vt.KHR_MATERIALS_TRANSMISSION; } getMaterialType(e) { const i = this.parser.json.materials[e]; return !i.extensions || !i.extensions[this.name] ? null : wl; } extendMaterialParams(e, t) { const i = this.parser, r = i.json.materials[e]; if (!r.extensions || !r.extensions[this.name]) return Promise.resolve(); const s = [], o = r.extensions[this.name]; return o.transmissionFactor !== void 0 && (t.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && s.push(i.assignTexture(t, "transmissionMap", o.transmissionTexture)), Promise.all(s); } }; var u4 = class { constructor(e) { this.parser = e, this.name = vt.KHR_TEXTURE_BASISU; } loadTexture(e) { const t = this.parser, i = t.json, r = i.textures[e]; if (!r.extensions || !r.extensions[this.name]) return null; const s = r.extensions[this.name], o = i.images[s.source], a6 = t.options.ktx2Loader; if (!a6) { if (i.extensionsRequired && i.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures"); return null; } return t.loadTextureImage(e, o, a6); } }; var h4 = class { constructor(e) { this.parser = e, this.name = vt.EXT_TEXTURE_WEBP, this.isSupported = null; } loadTexture(e) { const t = this.name, i = this.parser, r = i.json, s = r.textures[e]; if (!s.extensions || !s.extensions[t]) return null; const o = s.extensions[t], a6 = r.images[o.source]; let c = i.textureLoader; if (a6.uri) { const l = i.options.manager.getHandler(a6.uri); l !== null && (c = l); } return this.detectSupport().then(function(l) { if (l) return i.loadTextureImage(e, a6, c); if (r.extensionsRequired && r.extensionsRequired.indexOf(t) >= 0) throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported."); return i.loadTexture(e); }); } detectSupport() { return this.isSupported || (this.isSupported = new Promise(function(e) { const t = new Image(); t.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", t.onload = t.onerror = function() { e(t.height === 1); }; })), this.isSupported; } }; var d4 = class { constructor(e) { this.name = vt.EXT_MESHOPT_COMPRESSION, this.parser = e; } loadBufferView(e) { const t = this.parser.json, i = t.bufferViews[e]; if (i.extensions && i.extensions[this.name]) { const r = i.extensions[this.name], s = this.parser.getDependency("buffer", r.buffer), o = this.parser.options.meshoptDecoder; if (!o || !o.supported) { if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files"); return null; } return Promise.all([s, o.ready]).then(function(a6) { const c = r.byteOffset || 0, l = r.byteLength || 0, d = r.count, h6 = r.byteStride, f6 = new ArrayBuffer(d * h6), g6 = new Uint8Array(a6[0], c, l); return o.decodeGltfBuffer(new Uint8Array(f6), d, h6, g6, r.mode, r.filter), f6; }); } else return null; } }; var fM = "glTF"; var Aa = 12; var mv = { JSON: 1313821514, BIN: 5130562 }; var f4 = class { constructor(e) { this.name = vt.KHR_BINARY_GLTF, this.content = null, this.body = null; const t = new DataView(e, 0, Aa); if (this.header = { magic: rr.decodeText(new Uint8Array(e.slice(0, 4))), version: t.getUint32(4, true), length: t.getUint32(8, true) }, this.header.magic !== fM) throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header."); if (this.header.version < 2) throw new Error("THREE.GLTFLoader: Legacy binary file detected."); const i = this.header.length - Aa, r = new DataView(e, Aa); let s = 0; for (; s < i; ) { const o = r.getUint32(s, true); s += 4; const a6 = r.getUint32(s, true); if (s += 4, a6 === mv.JSON) { const c = new Uint8Array(e, Aa + s, o); this.content = rr.decodeText(c); } else if (a6 === mv.BIN) { const c = Aa + s; this.body = e.slice(c, c + o); } s += o; } if (this.content === null) throw new Error("THREE.GLTFLoader: JSON content not found."); } }; var p4 = class { constructor(e, t) { if (!t) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided."); this.name = vt.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload(); } decodePrimitive(e, t) { const i = this.json, r = this.dracoLoader, s = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a6 = {}, c = {}, l = {}; for (const d in o) { const h6 = Ld[d] || d.toLowerCase(); a6[h6] = o[d]; } for (const d in e.attributes) { const h6 = Ld[d] || d.toLowerCase(); if (o[d] !== void 0) { const f6 = i.accessors[e.attributes[d]], g6 = Ka[f6.componentType]; l[h6] = g6, c[h6] = f6.normalized === true; } } return t.getDependency("bufferView", s).then(function(d) { return new Promise(function(h6) { r.decodeDracoFile(d, function(f6) { for (const g6 in f6.attributes) { const p = f6.attributes[g6], u6 = c[g6]; u6 !== void 0 && (p.normalized = u6); } h6(f6); }, a6, l); }); }); } }; var m4 = class { constructor() { this.name = vt.KHR_TEXTURE_TRANSFORM; } extendTexture(e, t) { return t.texCoord !== void 0 && console.warn('THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.'), t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = true), e; } }; var Cd = class extends zs { constructor(e) { super(), this.isGLTFSpecularGlossinessMaterial = true; const t = [ "#ifdef USE_SPECULARMAP", " uniform sampler2D specularMap;", "#endif" ].join(` `), i = [ "#ifdef USE_GLOSSINESSMAP", " uniform sampler2D glossinessMap;", "#endif" ].join(` `), r = [ "vec3 specularFactor = specular;", "#ifdef USE_SPECULARMAP", " vec4 texelSpecular = texture2D( specularMap, vUv );", " texelSpecular = sRGBToLinear( texelSpecular );", " // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture", " specularFactor *= texelSpecular.rgb;", "#endif" ].join(` `), s = [ "float glossinessFactor = glossiness;", "#ifdef USE_GLOSSINESSMAP", " vec4 texelGlossiness = texture2D( glossinessMap, vUv );", " // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture", " glossinessFactor *= texelGlossiness.a;", "#endif" ].join(` `), o = [ "PhysicalMaterial material;", "material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );", "vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );", "float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );", "material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.", "material.specularRoughness += geometryRoughness;", "material.specularRoughness = min( material.specularRoughness, 1.0 );", "material.specularColor = specularFactor;" ].join(` `), a6 = { specular: { value: new Ue().setHex(16777215) }, glossiness: { value: 1 }, specularMap: { value: null }, glossinessMap: { value: null } }; this._extraUniforms = a6, this.onBeforeCompile = function(c) { for (const l in a6) c.uniforms[l] = a6[l]; c.fragmentShader = c.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;").replace("uniform float metalness;", "uniform float glossiness;").replace("#include ", t).replace("#include ", i).replace("#include ", r).replace("#include ", s).replace("#include ", o); }, Object.defineProperties(this, { specular: { get: function() { return a6.specular.value; }, set: function(c) { a6.specular.value = c; } }, specularMap: { get: function() { return a6.specularMap.value; }, set: function(c) { a6.specularMap.value = c, c ? this.defines.USE_SPECULARMAP = "" : delete this.defines.USE_SPECULARMAP; } }, glossiness: { get: function() { return a6.glossiness.value; }, set: function(c) { a6.glossiness.value = c; } }, glossinessMap: { get: function() { return a6.glossinessMap.value; }, set: function(c) { a6.glossinessMap.value = c, c ? (this.defines.USE_GLOSSINESSMAP = "", this.defines.USE_UV = "") : (delete this.defines.USE_GLOSSINESSMAP, delete this.defines.USE_UV); } } }), delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this.setValues(e); } copy(e) { return super.copy(e), this.specularMap = e.specularMap, this.specular.copy(e.specular), this.glossinessMap = e.glossinessMap, this.glossiness = e.glossiness, delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this; } }; var g4 = class { constructor() { this.name = vt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS, this.specularGlossinessParams = [ "color", "map", "lightMap", "lightMapIntensity", "aoMap", "aoMapIntensity", "emissive", "emissiveIntensity", "emissiveMap", "bumpMap", "bumpScale", "normalMap", "normalMapType", "displacementMap", "displacementScale", "displacementBias", "specularMap", "specular", "glossinessMap", "glossiness", "alphaMap", "envMap", "envMapIntensity", "refractionRatio" ]; } getMaterialType() { return Cd; } extendParams(e, t, i) { const r = t.extensions[this.name]; e.color = new Ue(1, 1, 1), e.opacity = 1; const s = []; if (Array.isArray(r.diffuseFactor)) { const o = r.diffuseFactor; e.color.fromArray(o), e.opacity = o[3]; } if (r.diffuseTexture !== void 0 && s.push(i.assignTexture(e, "map", r.diffuseTexture)), e.emissive = new Ue(0, 0, 0), e.glossiness = r.glossinessFactor !== void 0 ? r.glossinessFactor : 1, e.specular = new Ue(1, 1, 1), Array.isArray(r.specularFactor) && e.specular.fromArray(r.specularFactor), r.specularGlossinessTexture !== void 0) { const o = r.specularGlossinessTexture; s.push(i.assignTexture(e, "glossinessMap", o)), s.push(i.assignTexture(e, "specularMap", o)); } return Promise.all(s); } createMaterial(e) { const t = new Cd(e); return t.fog = true, t.color = e.color, t.map = e.map === void 0 ? null : e.map, t.lightMap = null, t.lightMapIntensity = 1, t.aoMap = e.aoMap === void 0 ? null : e.aoMap, t.aoMapIntensity = 1, t.emissive = e.emissive, t.emissiveIntensity = 1, t.emissiveMap = e.emissiveMap === void 0 ? null : e.emissiveMap, t.bumpMap = e.bumpMap === void 0 ? null : e.bumpMap, t.bumpScale = 1, t.normalMap = e.normalMap === void 0 ? null : e.normalMap, t.normalMapType = Jr, e.normalScale && (t.normalScale = e.normalScale), t.displacementMap = null, t.displacementScale = 1, t.displacementBias = 0, t.specularMap = e.specularMap === void 0 ? null : e.specularMap, t.specular = e.specular, t.glossinessMap = e.glossinessMap === void 0 ? null : e.glossinessMap, t.glossiness = e.glossiness, t.alphaMap = null, t.envMap = e.envMap === void 0 ? null : e.envMap, t.envMapIntensity = 1, t.refractionRatio = 0.98, t; } }; var v4 = class { constructor() { this.name = vt.KHR_MESH_QUANTIZATION; } }; var $o = class extends Ni { constructor(e, t, i, r) { super(e, t, i, r); } copySampleValue_(e) { const t = this.resultBuffer, i = this.sampleValues, r = this.valueSize, s = e * r * 3 + r; for (let o = 0; o !== r; o++) t[o] = i[s + o]; return t; } }; $o.prototype.beforeStart_ = $o.prototype.copySampleValue_; $o.prototype.afterEnd_ = $o.prototype.copySampleValue_; $o.prototype.interpolate_ = function(n, e, t, i) { const r = this.resultBuffer, s = this.sampleValues, o = this.valueSize, a6 = o * 2, c = o * 3, l = i - e, d = (t - e) / l, h6 = d * d, f6 = h6 * d, g6 = n * c, p = g6 - c, u6 = -2 * f6 + 3 * h6, y6 = f6 - h6, v6 = 1 - u6, m6 = y6 - h6 + d; for (let x6 = 0; x6 !== o; x6++) { const w6 = s[p + x6 + o], A6 = s[p + x6 + a6] * l, M6 = s[g6 + x6 + o], R6 = s[g6 + x6] * l; r[x6] = v6 * w6 + m6 * A6 + u6 * M6 + y6 * R6; } return r; }; var Yi = { FLOAT: 5126, //FLOAT_MAT2: 35674, FLOAT_MAT3: 35675, FLOAT_MAT4: 35676, FLOAT_VEC2: 35664, FLOAT_VEC3: 35665, FLOAT_VEC4: 35666, LINEAR: 9729, REPEAT: 10497, SAMPLER_2D: 35678, POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123 }; var Ka = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }; var gv = { 9728: $t, 9729: zt, 9984: Va, 9985: du, 9986: Ga, 9987: pr }; var vv = { 33071: hn2, 33648: Eo, 10497: jr }; var yv = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }; var Ld = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv2", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }; var _r = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }; var y4 = { CUBICSPLINE: void 0, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each // keyframe track will be initialized with a default interpolation type, then modified. LINEAR: Es, STEP: Lo }; var Lh = { OPAQUE: "OPAQUE", MASK: "MASK", BLEND: "BLEND" }; function bv(n, e) { return typeof n != "string" || n === "" ? "" : (/^https?:\/\//i.test(e) && /^\//.test(n) && (e = e.replace(/(^https?:\/\/[^\/]+).*/i, "$1")), /^(https?:)?\/\//i.test(n) || /^data:.*,.*$/i.test(n) || /^blob:.*$/i.test(n) ? n : e + n); } function b4(n) { return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new zs({ color: 16777215, emissive: 0, metalness: 1, roughness: 1, transparent: false, depthTest: true, side: Hr })), n.DefaultMaterial; } function Sa(n, e, t) { for (const i in t.extensions) n[i] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[i] = t.extensions[i]); } function fs(n, e) { e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(n.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras)); } function x4(n, e, t) { let i = false, r = false; for (let a6 = 0, c = e.length; a6 < c; a6++) { const l = e[a6]; if (l.POSITION !== void 0 && (i = true), l.NORMAL !== void 0 && (r = true), i && r) break; } if (!i && !r) return Promise.resolve(n); const s = [], o = []; for (let a6 = 0, c = e.length; a6 < c; a6++) { const l = e[a6]; if (i) { const d = l.POSITION !== void 0 ? t.getDependency("accessor", l.POSITION) : n.attributes.position; s.push(d); } if (r) { const d = l.NORMAL !== void 0 ? t.getDependency("accessor", l.NORMAL) : n.attributes.normal; o.push(d); } } return Promise.all([ Promise.all(s), Promise.all(o) ]).then(function(a6) { const c = a6[0], l = a6[1]; return i && (n.morphAttributes.position = c), r && (n.morphAttributes.normal = l), n.morphTargetsRelative = true, n; }); } function M4(n, e) { if (n.updateMorphTargets(), e.weights !== void 0) for (let t = 0, i = e.weights.length; t < i; t++) n.morphTargetInfluences[t] = e.weights[t]; if (e.extras && Array.isArray(e.extras.targetNames)) { const t = e.extras.targetNames; if (n.morphTargetInfluences.length === t.length) { n.morphTargetDictionary = {}; for (let i = 0, r = t.length; i < r; i++) n.morphTargetDictionary[t[i]] = i; } else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names."); } } function w4(n) { const e = n.extensions && n.extensions[vt.KHR_DRACO_MESH_COMPRESSION]; let t; return e ? t = "draco:" + e.bufferView + ":" + e.indices + ":" + xv(e.attributes) : t = n.indices + ":" + xv(n.attributes) + ":" + n.mode, t; } function xv(n) { let e = ""; const t = Object.keys(n).sort(); for (let i = 0, r = t.length; i < r; i++) e += t[i] + ":" + n[t[i]] + ";"; return e; } function Rd(n) { switch (n) { case Int8Array: return 1 / 127; case Uint8Array: return 1 / 255; case Int16Array: return 1 / 32767; case Uint16Array: return 1 / 65535; default: throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type."); } } var A4 = class { constructor(e = {}, t = {}) { this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new s4(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.textureCache = {}, this.nodeNamesUsed = {}, typeof createImageBitmap < "u" && /Firefox/.test(navigator.userAgent) === false ? this.textureLoader = new op(this.options.manager) : this.textureLoader = new qf(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Zn(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(true); } setExtensions(e) { this.extensions = e; } setPlugins(e) { this.plugins = e; } parse(e, t) { const i = this, r = this.json, s = this.extensions; this.cache.removeAll(), this._invokeAll(function(o) { return o._markDefs && o._markDefs(); }), Promise.all(this._invokeAll(function(o) { return o.beforeRoot && o.beforeRoot(); })).then(function() { return Promise.all([ i.getDependencies("scene"), i.getDependencies("animation"), i.getDependencies("camera") ]); }).then(function(o) { const a6 = { scene: o[0][r.scene || 0], scenes: o[0], animations: o[1], cameras: o[2], asset: r.asset, parser: i, userData: {} }; Sa(s, a6, r), fs(a6, r), Promise.all(i._invokeAll(function(c) { return c.afterRoot && c.afterRoot(a6); })).then(function() { e(a6); }); }).catch(t); } /** * Marks the special nodes/meshes in json for efficient parse. */ _markDefs() { const e = this.json.nodes || [], t = this.json.skins || [], i = this.json.meshes || []; for (let r = 0, s = t.length; r < s; r++) { const o = t[r].joints; for (let a6 = 0, c = o.length; a6 < c; a6++) e[o[a6]].isBone = true; } for (let r = 0, s = e.length; r < s; r++) { const o = e[r]; o.mesh !== void 0 && (this._addNodeRef(this.meshCache, o.mesh), o.skin !== void 0 && (i[o.mesh].isSkinnedMesh = true)), o.camera !== void 0 && this._addNodeRef(this.cameraCache, o.camera); } } /** * Counts references to shared node / Object3D resources. These resources * can be reused, or "instantiated", at multiple nodes in the scene * hierarchy. Mesh, Camera, and Light instances are instantiated and must * be marked. Non-scenegraph resources (like Materials, Geometries, and * Textures) can be reused directly and are not marked here. * * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. */ _addNodeRef(e, t) { t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++); } /** Returns a reference to a shared resource, cloning it if necessary. */ _getNodeRef(e, t, i) { if (e.refs[t] <= 1) return i; const r = i.clone(); return r.name += "_instance_" + e.uses[t]++, r; } _invokeOne(e) { const t = Object.values(this.plugins); t.push(this); for (let i = 0; i < t.length; i++) { const r = e(t[i]); if (r) return r; } return null; } _invokeAll(e) { const t = Object.values(this.plugins); t.unshift(this); const i = []; for (let r = 0; r < t.length; r++) { const s = e(t[r]); s && i.push(s); } return i; } /** * Requests the specified dependency asynchronously, with caching. * @param {string} type * @param {number} index * @return {Promise} */ getDependency(e, t) { const i = e + ":" + t; let r = this.cache.get(i); if (!r) { switch (e) { case "scene": r = this.loadScene(t); break; case "node": r = this.loadNode(t); break; case "mesh": r = this._invokeOne(function(s) { return s.loadMesh && s.loadMesh(t); }); break; case "accessor": r = this.loadAccessor(t); break; case "bufferView": r = this._invokeOne(function(s) { return s.loadBufferView && s.loadBufferView(t); }); break; case "buffer": r = this.loadBuffer(t); break; case "material": r = this._invokeOne(function(s) { return s.loadMaterial && s.loadMaterial(t); }); break; case "texture": r = this._invokeOne(function(s) { return s.loadTexture && s.loadTexture(t); }); break; case "skin": r = this.loadSkin(t); break; case "animation": r = this.loadAnimation(t); break; case "camera": r = this.loadCamera(t); break; default: throw new Error("Unknown type: " + e); } this.cache.add(i, r); } return r; } /** * Requests all dependencies of the specified type asynchronously, with caching. * @param {string} type * @return {Promise>} */ getDependencies(e) { let t = this.cache.get(e); if (!t) { const i = this, r = this.json[e + (e === "mesh" ? "es" : "s")] || []; t = Promise.all(r.map(function(s, o) { return i.getDependency(e, o); })), this.cache.add(e, t); } return t; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferIndex * @return {Promise} */ loadBuffer(e) { const t = this.json.buffers[e], i = this.fileLoader; if (t.type && t.type !== "arraybuffer") throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported."); if (t.uri === void 0 && e === 0) return Promise.resolve(this.extensions[vt.KHR_BINARY_GLTF].body); const r = this.options; return new Promise(function(s, o) { i.load(bv(t.uri, r.path), s, void 0, function() { o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".')); }); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferViewIndex * @return {Promise} */ loadBufferView(e) { const t = this.json.bufferViews[e]; return this.getDependency("buffer", t.buffer).then(function(i) { const r = t.byteLength || 0, s = t.byteOffset || 0; return i.slice(s, s + r); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors * @param {number} accessorIndex * @return {Promise} */ loadAccessor(e) { const t = this, i = this.json, r = this.json.accessors[e]; if (r.bufferView === void 0 && r.sparse === void 0) return Promise.resolve(null); const s = []; return r.bufferView !== void 0 ? s.push(this.getDependency("bufferView", r.bufferView)) : s.push(null), r.sparse !== void 0 && (s.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), s.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(s).then(function(o) { const a6 = o[0], c = yv[r.type], l = Ka[r.componentType], d = l.BYTES_PER_ELEMENT, h6 = d * c, f6 = r.byteOffset || 0, g6 = r.bufferView !== void 0 ? i.bufferViews[r.bufferView].byteStride : void 0, p = r.normalized === true; let u6, y6; if (g6 && g6 !== h6) { const v6 = Math.floor(f6 / g6), m6 = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + v6 + ":" + r.count; let x6 = t.cache.get(m6); x6 || (u6 = new l(a6, v6 * g6, r.count * g6 / d), x6 = new Qr(u6, g6 / d), t.cache.add(m6, x6)), y6 = new lr(x6, c, f6 % g6 / d, p); } else a6 === null ? u6 = new l(r.count * c) : u6 = new l(a6, f6, r.count * c), y6 = new ot(u6, c, p); if (r.sparse !== void 0) { const v6 = yv.SCALAR, m6 = Ka[r.sparse.indices.componentType], x6 = r.sparse.indices.byteOffset || 0, w6 = r.sparse.values.byteOffset || 0, A6 = new m6(o[1], x6, r.sparse.count * v6), M6 = new l(o[2], w6, r.sparse.count * c); a6 !== null && (y6 = new ot(y6.array.slice(), y6.itemSize, y6.normalized)); for (let R6 = 0, L6 = A6.length; R6 < L6; R6++) { const T6 = A6[R6]; if (y6.setX(T6, M6[R6 * c]), c >= 2 && y6.setY(T6, M6[R6 * c + 1]), c >= 3 && y6.setZ(T6, M6[R6 * c + 2]), c >= 4 && y6.setW(T6, M6[R6 * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute."); } } return y6; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures * @param {number} textureIndex * @return {Promise} */ loadTexture(e) { const t = this.json, i = this.options, r = t.textures[e], s = t.images[r.source]; let o = this.textureLoader; if (s.uri) { const a6 = i.manager.getHandler(s.uri); a6 !== null && (o = a6); } return this.loadTextureImage(e, s, o); } loadTextureImage(e, t, i) { const r = this, s = this.json, o = this.options, a6 = s.textures[e], c = (t.uri || t.bufferView) + ":" + a6.sampler; if (this.textureCache[c]) return this.textureCache[c]; const l = self.URL || self.webkitURL; let d = t.uri || "", h6 = false, f6 = true; const g6 = d.search(/\.jpe?g($|\?)/i) > 0 || d.search(/^data\:image\/jpeg/) === 0; if ((t.mimeType === "image/jpeg" || g6) && (f6 = false), t.bufferView !== void 0) d = r.getDependency("bufferView", t.bufferView).then(function(u6) { if (t.mimeType === "image/png") { const v6 = new DataView(u6, 25, 1).getUint8(0, false); f6 = v6 === 6 || v6 === 4 || v6 === 3; } h6 = true; const y6 = new Blob([u6], { type: t.mimeType }); return d = l.createObjectURL(y6), d; }); else if (t.uri === void 0) throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView"); const p = Promise.resolve(d).then(function(u6) { return new Promise(function(y6, v6) { let m6 = y6; i.isImageBitmapLoader === true && (m6 = function(x6) { const w6 = new Yt(x6); w6.needsUpdate = true, y6(w6); }), i.load(bv(u6, o.path), m6, void 0, v6); }); }).then(function(u6) { h6 === true && l.revokeObjectURL(d), u6.flipY = false, a6.name && (u6.name = a6.name), f6 || (u6.format = ir); const v6 = (s.samplers || {})[a6.sampler] || {}; return u6.magFilter = gv[v6.magFilter] || zt, u6.minFilter = gv[v6.minFilter] || pr, u6.wrapS = vv[v6.wrapS] || jr, u6.wrapT = vv[v6.wrapT] || jr, r.associations.set(u6, { type: "textures", index: e }), u6; }).catch(function() { return console.error("THREE.GLTFLoader: Couldn't load texture", d), null; }); return this.textureCache[c] = p, p; } /** * Asynchronously assigns a texture to the given material parameters. * @param {Object} materialParams * @param {string} mapName * @param {Object} mapDef * @return {Promise} */ assignTexture(e, t, i) { const r = this; return this.getDependency("texture", i.index).then(function(s) { if (i.texCoord !== void 0 && i.texCoord != 0 && !(t === "aoMap" && i.texCoord == 1) && console.warn("THREE.GLTFLoader: Custom UV set " + i.texCoord + " for texture " + t + " not yet supported."), r.extensions[vt.KHR_TEXTURE_TRANSFORM]) { const o = i.extensions !== void 0 ? i.extensions[vt.KHR_TEXTURE_TRANSFORM] : void 0; if (o) { const a6 = r.associations.get(s); s = r.extensions[vt.KHR_TEXTURE_TRANSFORM].extendTexture(s, o), r.associations.set(s, a6); } } e[t] = s; }); } /** * Assigns final material to a Mesh, Line, or Points instance. The instance * already has a material (generated from the glTF material options alone) * but reuse of the same glTF material may require multiple threejs materials * to accommodate different primitive types, defines, etc. New materials will * be created if necessary, and reused from a cache. * @param {Object3D} mesh Mesh, Line, or Points instance. */ assignFinalMaterial(e) { const t = e.geometry; let i = e.material; const r = t.attributes.tangent !== void 0, s = t.attributes.color !== void 0, o = t.attributes.normal === void 0, a6 = Object.keys(t.morphAttributes).length > 0, c = a6 && t.morphAttributes.normal !== void 0; if (e.isPoints) { const l = "PointsMaterial:" + i.uuid; let d = this.cache.get(l); d || (d = new es(), tn2.prototype.copy.call(d, i), d.color.copy(i.color), d.map = i.map, d.sizeAttenuation = false, this.cache.add(l, d)), i = d; } else if (e.isLine) { const l = "LineBasicMaterial:" + i.uuid; let d = this.cache.get(l); d || (d = new an2(), tn2.prototype.copy.call(d, i), d.color.copy(i.color), this.cache.add(l, d)), i = d; } if (r || s || o || a6) { let l = "ClonedMaterial:" + i.uuid + ":"; i.isGLTFSpecularGlossinessMaterial && (l += "specular-glossiness:"), r && (l += "vertex-tangents:"), s && (l += "vertex-colors:"), o && (l += "flat-shading:"), a6 && (l += "morph-targets:"), c && (l += "morph-normals:"); let d = this.cache.get(l); d || (d = i.clone(), s && (d.vertexColors = true), o && (d.flatShading = true), a6 && (d.morphTargets = true), c && (d.morphNormals = true), r && (d.vertexTangents = true, d.normalScale && (d.normalScale.y *= -1), d.clearcoatNormalScale && (d.clearcoatNormalScale.y *= -1)), this.cache.add(l, d), this.associations.set(d, this.associations.get(i))), i = d; } i.aoMap && t.attributes.uv2 === void 0 && t.attributes.uv !== void 0 && t.setAttribute("uv2", t.attributes.uv), e.material = i; } getMaterialType() { return zs; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials * @param {number} materialIndex * @return {Promise} */ loadMaterial(e) { const t = this, i = this.json, r = this.extensions, s = i.materials[e]; let o; const a6 = {}, c = s.extensions || {}, l = []; if (c[vt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) { const h6 = r[vt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]; o = h6.getMaterialType(), l.push(h6.extendParams(a6, s, t)); } else if (c[vt.KHR_MATERIALS_UNLIT]) { const h6 = r[vt.KHR_MATERIALS_UNLIT]; o = h6.getMaterialType(), l.push(h6.extendParams(a6, s, t)); } else { const h6 = s.pbrMetallicRoughness || {}; if (a6.color = new Ue(1, 1, 1), a6.opacity = 1, Array.isArray(h6.baseColorFactor)) { const f6 = h6.baseColorFactor; a6.color.fromArray(f6), a6.opacity = f6[3]; } h6.baseColorTexture !== void 0 && l.push(t.assignTexture(a6, "map", h6.baseColorTexture)), a6.metalness = h6.metallicFactor !== void 0 ? h6.metallicFactor : 1, a6.roughness = h6.roughnessFactor !== void 0 ? h6.roughnessFactor : 1, h6.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(a6, "metalnessMap", h6.metallicRoughnessTexture)), l.push(t.assignTexture(a6, "roughnessMap", h6.metallicRoughnessTexture))), o = this._invokeOne(function(f6) { return f6.getMaterialType && f6.getMaterialType(e); }), l.push(Promise.all(this._invokeAll(function(f6) { return f6.extendMaterialParams && f6.extendMaterialParams(e, a6); }))); } s.doubleSided === true && (a6.side = Wr); const d = s.alphaMode || Lh.OPAQUE; return d === Lh.BLEND ? (a6.transparent = true, a6.depthWrite = false) : (a6.transparent = false, d === Lh.MASK && (a6.alphaTest = s.alphaCutoff !== void 0 ? s.alphaCutoff : 0.5)), s.normalTexture !== void 0 && o !== In && (l.push(t.assignTexture(a6, "normalMap", s.normalTexture)), a6.normalScale = new Re(1, -1), s.normalTexture.scale !== void 0 && a6.normalScale.set(s.normalTexture.scale, -s.normalTexture.scale)), s.occlusionTexture !== void 0 && o !== In && (l.push(t.assignTexture(a6, "aoMap", s.occlusionTexture)), s.occlusionTexture.strength !== void 0 && (a6.aoMapIntensity = s.occlusionTexture.strength)), s.emissiveFactor !== void 0 && o !== In && (a6.emissive = new Ue().fromArray(s.emissiveFactor)), s.emissiveTexture !== void 0 && o !== In && l.push(t.assignTexture(a6, "emissiveMap", s.emissiveTexture)), Promise.all(l).then(function() { let h6; return o === Cd ? h6 = r[vt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a6) : h6 = new o(a6), s.name && (h6.name = s.name), h6.map && (h6.map.encoding = Cs), h6.emissiveMap && (h6.emissiveMap.encoding = Cs), fs(h6, s), t.associations.set(h6, { type: "materials", index: e }), s.extensions && Sa(r, h6, s), h6; }); } /** When Object3D instances are targeted by animation, they need unique names. */ createUniqueName(e) { const t = mt.sanitizeNodeName(e || ""); let i = t; for (let r = 1; this.nodeNamesUsed[i]; ++r) i = t + "_" + r; return this.nodeNamesUsed[i] = true, i; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry * * Creates BufferGeometries from primitives. * * @param {Array} primitives * @return {Promise>} */ loadGeometries(e) { const t = this, i = this.extensions, r = this.primitiveCache; function s(a6) { return i[vt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a6, t).then(function(c) { return Mv(c, a6, t); }); } const o = []; for (let a6 = 0, c = e.length; a6 < c; a6++) { const l = e[a6], d = w4(l), h6 = r[d]; if (h6) o.push(h6.promise); else { let f6; l.extensions && l.extensions[vt.KHR_DRACO_MESH_COMPRESSION] ? f6 = s(l) : f6 = Mv(new Ke(), l, t), r[d] = { primitive: l, promise: f6 }, o.push(f6); } } return Promise.all(o); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes * @param {number} meshIndex * @return {Promise} */ loadMesh(e) { const t = this, i = this.json, r = this.extensions, s = i.meshes[e], o = s.primitives, a6 = []; for (let c = 0, l = o.length; c < l; c++) { const d = o[c].material === void 0 ? b4(this.cache) : this.getDependency("material", o[c].material); a6.push(d); } return a6.push(t.loadGeometries(o)), Promise.all(a6).then(function(c) { const l = c.slice(0, c.length - 1), d = c[c.length - 1], h6 = []; for (let g6 = 0, p = d.length; g6 < p; g6++) { const u6 = d[g6], y6 = o[g6]; let v6; const m6 = l[g6]; if (y6.mode === Yi.TRIANGLES || y6.mode === Yi.TRIANGLE_STRIP || y6.mode === Yi.TRIANGLE_FAN || y6.mode === void 0) v6 = s.isSkinnedMesh === true ? new vl(u6, m6) : new Xt(u6, m6), v6.isSkinnedMesh === true && !v6.geometry.attributes.skinWeight.normalized && v6.normalizeSkinWeights(), y6.mode === Yi.TRIANGLE_STRIP ? v6.geometry = wv(v6.geometry, Xb) : y6.mode === Yi.TRIANGLE_FAN && (v6.geometry = wv(v6.geometry, wf)); else if (y6.mode === Yi.LINES) v6 = new Rn(u6, m6); else if (y6.mode === Yi.LINE_STRIP) v6 = new Oi(u6, m6); else if (y6.mode === Yi.LINE_LOOP) v6 = new Au(u6, m6); else if (y6.mode === Yi.POINTS) v6 = new ia(u6, m6); else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y6.mode); Object.keys(v6.geometry.morphAttributes).length > 0 && M4(v6, s), v6.name = t.createUniqueName(s.name || "mesh_" + e), fs(v6, s), y6.extensions && Sa(r, v6, y6), t.assignFinalMaterial(v6), h6.push(v6); } if (h6.length === 1) return h6[0]; const f6 = new _i(); for (let g6 = 0, p = h6.length; g6 < p; g6++) f6.add(h6[g6]); return f6; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras * @param {number} cameraIndex * @return {Promise} */ loadCamera(e) { let t; const i = this.json.cameras[e], r = i[i.type]; if (!r) { console.warn("THREE.GLTFLoader: Missing camera parameters."); return; } return i.type === "perspective" ? t = new nn2(xd.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : i.type === "orthographic" && (t = new sa(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), i.name && (t.name = this.createUniqueName(i.name)), fs(t, i), Promise.resolve(t); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins * @param {number} skinIndex * @return {Promise} */ loadSkin(e) { const t = this.json.skins[e], i = { joints: t.joints }; return t.inverseBindMatrices === void 0 ? Promise.resolve(i) : this.getDependency("accessor", t.inverseBindMatrices).then(function(r) { return i.inverseBindMatrices = r, i; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations * @param {number} animationIndex * @return {Promise} */ loadAnimation(e) { const i = this.json.animations[e], r = [], s = [], o = [], a6 = [], c = []; for (let l = 0, d = i.channels.length; l < d; l++) { const h6 = i.channels[l], f6 = i.samplers[h6.sampler], g6 = h6.target, p = g6.node !== void 0 ? g6.node : g6.id, u6 = i.parameters !== void 0 ? i.parameters[f6.input] : f6.input, y6 = i.parameters !== void 0 ? i.parameters[f6.output] : f6.output; r.push(this.getDependency("node", p)), s.push(this.getDependency("accessor", u6)), o.push(this.getDependency("accessor", y6)), a6.push(f6), c.push(g6); } return Promise.all([ Promise.all(r), Promise.all(s), Promise.all(o), Promise.all(a6), Promise.all(c) ]).then(function(l) { const d = l[0], h6 = l[1], f6 = l[2], g6 = l[3], p = l[4], u6 = []; for (let v6 = 0, m6 = d.length; v6 < m6; v6++) { const x6 = d[v6], w6 = h6[v6], A6 = f6[v6], M6 = g6[v6], R6 = p[v6]; if (x6 === void 0) continue; x6.updateMatrix(), x6.matrixAutoUpdate = true; let L6; switch (_r[R6.path]) { case _r.weights: L6 = Ho; break; case _r.rotation: L6 = Vs; break; case _r.position: case _r.scale: default: L6 = Wo; break; } const T6 = x6.name ? x6.name : x6.uuid, P6 = M6.interpolation !== void 0 ? y4[M6.interpolation] : Es, _6 = []; _r[R6.path] === _r.weights ? x6.traverse(function(E6) { E6.isMesh === true && E6.morphTargetInfluences && _6.push(E6.name ? E6.name : E6.uuid); }) : _6.push(T6); let S6 = A6.array; if (A6.normalized) { const E6 = Rd(S6.constructor), C6 = new Float32Array(S6.length); for (let I6 = 0, b6 = S6.length; I6 < b6; I6++) C6[I6] = S6[I6] * E6; S6 = C6; } for (let E6 = 0, C6 = _6.length; E6 < C6; E6++) { const I6 = new L6( _6[E6] + "." + _r[R6.path], w6.array, S6, P6 ); M6.interpolation === "CUBICSPLINE" && (I6.createInterpolant = function(F6) { return new $o(this.times, this.values, this.getValueSize() / 3, F6); }, I6.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true), u6.push(I6); } } const y6 = i.name ? i.name : "animation_" + e; return new jo(y6, void 0, u6); }); } createNodeMesh(e) { const t = this.json, i = this, r = t.nodes[e]; return r.mesh === void 0 ? null : i.getDependency("mesh", r.mesh).then(function(s) { const o = i._getNodeRef(i.meshCache, r.mesh, s); return r.weights !== void 0 && o.traverse(function(a6) { if (a6.isMesh) for (let c = 0, l = r.weights.length; c < l; c++) a6.morphTargetInfluences[c] = r.weights[c]; }), o; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy * @param {number} nodeIndex * @return {Promise} */ loadNode(e) { const t = this.json, i = this.extensions, r = this, s = t.nodes[e], o = s.name ? r.createUniqueName(s.name) : ""; return function() { const a6 = [], c = r._invokeOne(function(l) { return l.createNodeMesh && l.createNodeMesh(e); }); return c && a6.push(c), s.camera !== void 0 && a6.push(r.getDependency("camera", s.camera).then(function(l) { return r._getNodeRef(r.cameraCache, s.camera, l); })), r._invokeAll(function(l) { return l.createNodeAttachment && l.createNodeAttachment(e); }).forEach(function(l) { a6.push(l); }), Promise.all(a6); }().then(function(a6) { let c; if (s.isBone === true ? c = new yl() : a6.length > 1 ? c = new _i() : a6.length === 1 ? c = a6[0] : c = new ut(), c !== a6[0]) for (let l = 0, d = a6.length; l < d; l++) c.add(a6[l]); if (s.name && (c.userData.name = s.name, c.name = o), fs(c, s), s.extensions && Sa(i, c, s), s.matrix !== void 0) { const l = new Xe(); l.fromArray(s.matrix), c.applyMatrix4(l); } else s.translation !== void 0 && c.position.fromArray(s.translation), s.rotation !== void 0 && c.quaternion.fromArray(s.rotation), s.scale !== void 0 && c.scale.fromArray(s.scale); return r.associations.set(c, { type: "nodes", index: e }), c; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes * @param {number} sceneIndex * @return {Promise} */ loadScene(e) { const t = this.json, i = this.extensions, r = this.json.scenes[e], s = this, o = new _i(); r.name && (o.name = s.createUniqueName(r.name)), fs(o, r), r.extensions && Sa(i, o, r); const a6 = r.nodes || [], c = []; for (let l = 0, d = a6.length; l < d; l++) c.push(pM(a6[l], o, t, s)); return Promise.all(c).then(function() { return o; }); } }; function pM(n, e, t, i) { const r = t.nodes[n]; return i.getDependency("node", n).then(function(s) { if (r.skin === void 0) return s; let o; return i.getDependency("skin", r.skin).then(function(a6) { o = a6; const c = []; for (let l = 0, d = o.joints.length; l < d; l++) c.push(i.getDependency("node", o.joints[l])); return Promise.all(c); }).then(function(a6) { return s.traverse(function(c) { if (!c.isMesh) return; const l = [], d = []; for (let h6 = 0, f6 = a6.length; h6 < f6; h6++) { const g6 = a6[h6]; if (g6) { l.push(g6); const p = new Xe(); o.inverseBindMatrices !== void 0 && p.fromArray(o.inverseBindMatrices.array, h6 * 16), d.push(p); } else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', o.joints[h6]); } c.bind(new bl(l, d), c.matrixWorld); }), s; }); }).then(function(s) { e.add(s); const o = []; if (r.children) { const a6 = r.children; for (let c = 0, l = a6.length; c < l; c++) { const d = a6[c]; o.push(pM(d, s, t, i)); } } return Promise.all(o); }); } function S4(n, e, t) { const i = e.attributes, r = new Nn(); if (i.POSITION !== void 0) { const a6 = t.json.accessors[i.POSITION], c = a6.min, l = a6.max; if (c !== void 0 && l !== void 0) { if (r.set( new q4(c[0], c[1], c[2]), new q4(l[0], l[1], l[2]) ), a6.normalized) { const d = Rd(Ka[a6.componentType]); r.min.multiplyScalar(d), r.max.multiplyScalar(d); } } else { console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); return; } } else return; const s = e.targets; if (s !== void 0) { const a6 = new q4(), c = new q4(); for (let l = 0, d = s.length; l < d; l++) { const h6 = s[l]; if (h6.POSITION !== void 0) { const f6 = t.json.accessors[h6.POSITION], g6 = f6.min, p = f6.max; if (g6 !== void 0 && p !== void 0) { if (c.setX(Math.max(Math.abs(g6[0]), Math.abs(p[0]))), c.setY(Math.max(Math.abs(g6[1]), Math.abs(p[1]))), c.setZ(Math.max(Math.abs(g6[2]), Math.abs(p[2]))), f6.normalized) { const u6 = Rd(Ka[f6.componentType]); c.multiplyScalar(u6); } a6.max(c); } else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); } } r.expandByVector(a6); } n.boundingBox = r; const o = new mr(); r.getCenter(o.center), o.radius = r.min.distanceTo(r.max) / 2, n.boundingSphere = o; } function Mv(n, e, t) { const i = e.attributes, r = []; function s(o, a6) { return t.getDependency("accessor", o).then(function(c) { n.setAttribute(a6, c); }); } for (const o in i) { const a6 = Ld[o] || o.toLowerCase(); a6 in n.attributes || r.push(s(i[o], a6)); } if (e.indices !== void 0 && !n.index) { const o = t.getDependency("accessor", e.indices).then(function(a6) { n.setIndex(a6); }); r.push(o); } return fs(n, e), S4(n, e, t), Promise.all(r).then(function() { return e.targets !== void 0 ? x4(n, e.targets, t) : n; }); } function wv(n, e) { let t = n.getIndex(); if (t === null) { const o = [], a6 = n.getAttribute("position"); if (a6 !== void 0) { for (let c = 0; c < a6.count; c++) o.push(c); n.setIndex(o), t = n.getIndex(); } else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), n; } const i = t.count - 2, r = []; if (e === wf) for (let o = 1; o <= i; o++) r.push(t.getX(0)), r.push(t.getX(o)), r.push(t.getX(o + 1)); else for (let o = 0; o < i; o++) o % 2 === 0 ? (r.push(t.getX(o)), r.push(t.getX(o + 1)), r.push(t.getX(o + 2))) : (r.push(t.getX(o + 2)), r.push(t.getX(o + 1)), r.push(t.getX(o))); r.length / 3 !== i && console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles."); const s = n.clone(); return s.setIndex(r), s; } var _4 = Object.freeze(Object.defineProperty({ __proto__: null, GLTFLoader: r4 }, Symbol.toStringTag, { value: "Module" })); var T4 = au(_4); var Rh = { exports: {} }; var Av; function E4() { return Av || (Av = 1, function(n) { function e(l) { var d = {}; function h6(g6) { if (d[g6]) return d[g6].exports; var p = d[g6] = { /******/ i: g6, /******/ l: false, /******/ exports: {} /******/ }; return l[g6].call(p.exports, p, p.exports, h6), p.l = true, p.exports; } h6.m = l, h6.c = d, h6.i = function(g6) { return g6; }, h6.d = function(g6, p, u6) { h6.o(g6, p) || Object.defineProperty(g6, p, { /******/ configurable: false, /******/ enumerable: true, /******/ get: u6 /******/ }); }, h6.r = function(g6) { Object.defineProperty(g6, "__esModule", { value: true }); }, h6.n = function(g6) { var p = g6 && g6.__esModule ? ( /******/ function() { return g6.default; } ) : ( /******/ function() { return g6; } ); return h6.d(p, "a", p), p; }, h6.o = function(g6, p) { return Object.prototype.hasOwnProperty.call(g6, p); }, h6.p = "/", h6.oe = function(g6) { throw console.error(g6), g6; }; var f6 = h6(h6.s = ENTRY_MODULE); return f6.default || f6; } var t = "[\\.|\\-|\\+|\\w|/|@]+", i = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + t + ").*?\\)"; function r(l) { return (l + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); } function s(l) { return !isNaN(1 * l); } function o(l, d, h6) { var f6 = {}; f6[h6] = []; var g6 = d.toString(), p = g6.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/); if (!p) return f6; for (var u6 = p[1], y6 = new RegExp("(\\\\n|\\W)" + r(u6) + i, "g"), v6; v6 = y6.exec(g6); ) v6[3] !== "dll-reference" && f6[h6].push(v6[3]); for (y6 = new RegExp("\\(" + r(u6) + '\\("(dll-reference\\s(' + t + '))"\\)\\)' + i, "g"); v6 = y6.exec(g6); ) l[v6[2]] || (f6[h6].push(v6[1]), l[v6[2]] = __webpack_require__(v6[1]).m), f6[v6[2]] = f6[v6[2]] || [], f6[v6[2]].push(v6[4]); for (var m6 = Object.keys(f6), x6 = 0; x6 < m6.length; x6++) for (var w6 = 0; w6 < f6[m6[x6]].length; w6++) s(f6[m6[x6]][w6]) && (f6[m6[x6]][w6] = 1 * f6[m6[x6]][w6]); return f6; } function a6(l) { var d = Object.keys(l); return d.reduce(function(h6, f6) { return h6 || l[f6].length > 0; }, false); } function c(l, d) { for (var h6 = { main: [d] }, f6 = { main: [] }, g6 = { main: {} }; a6(h6); ) for (var p = Object.keys(h6), u6 = 0; u6 < p.length; u6++) { var y6 = p[u6], v6 = h6[y6], m6 = v6.pop(); if (g6[y6] = g6[y6] || {}, !(g6[y6][m6] || !l[y6][m6])) { g6[y6][m6] = true, f6[y6] = f6[y6] || [], f6[y6].push(m6); for (var x6 = o(l, l[y6][m6], y6), w6 = Object.keys(x6), A6 = 0; A6 < w6.length; A6++) h6[w6[A6]] = h6[w6[A6]] || [], h6[w6[A6]] = h6[w6[A6]].concat(x6[w6[A6]]); } } return f6; } n.exports = function(l, d) { d = d || {}; var h6 = { main: __webpack_modules__ }, f6 = d.all ? { main: Object.keys(h6.main) } : c(h6, l), g6 = ""; Object.keys(f6).filter(function(m6) { return m6 !== "main"; }).forEach(function(m6) { for (var x6 = 0; f6[m6][x6]; ) x6++; f6[m6].push(x6), h6[m6][x6] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", g6 = g6 + "var " + m6 + " = (" + e.toString().replace("ENTRY_MODULE", JSON.stringify(x6)) + ")({" + f6[m6].map(function(w6) { return "" + JSON.stringify(w6) + ": " + h6[m6][w6].toString(); }).join(",") + `}); `; }), g6 = g6 + "new ((" + e.toString().replace("ENTRY_MODULE", JSON.stringify(l)) + ")({" + f6.main.map(function(m6) { return "" + JSON.stringify(m6) + ": " + h6.main[m6].toString(); }).join(",") + "}))(self);"; var p = new window.Blob([g6], { type: "text/javascript" }); if (d.bare) return p; var u6 = window.URL || window.webkitURL || window.mozURL || window.msURL, y6 = u6.createObjectURL(p), v6 = new window.Worker(y6); return v6.objectURL = y6, v6; }; }(Rh)), Rh.exports; } function C4(n) { var e = this.constructor; return this.then( function(t) { return e.resolve(n()).then(function() { return t; }); }, function(t) { return e.resolve(n()).then(function() { return e.reject(t); }); } ); } function L4(n) { var e = this; return new e(function(t, i) { if (!(n && typeof n.length < "u")) return i( new TypeError( typeof n + " " + n + " is not iterable(cannot read property Symbol(Symbol.iterator))" ) ); var r = Array.prototype.slice.call(n); if (r.length === 0) return t([]); var s = r.length; function o(c, l) { if (l && (typeof l == "object" || typeof l == "function")) { var d = l.then; if (typeof d == "function") { d.call( l, function(h6) { o(c, h6); }, function(h6) { r[c] = { status: "rejected", reason: h6 }, --s === 0 && t(r); } ); return; } } r[c] = { status: "fulfilled", value: l }, --s === 0 && t(r); } for (var a6 = 0; a6 < r.length; a6++) o(a6, r[a6]); }); } function mM(n, e) { this.name = "AggregateError", this.errors = n, this.message = e || ""; } mM.prototype = Error.prototype; function R4(n) { var e = this; return new e(function(t, i) { if (!(n && typeof n.length < "u")) return i(new TypeError("Promise.any accepts an array")); var r = Array.prototype.slice.call(n); if (r.length === 0) return i(); for (var s = [], o = 0; o < r.length; o++) try { e.resolve(r[o]).then(t).catch(function(a6) { s.push(a6), s.length === r.length && i( new mM( s, "All promises were rejected" ) ); }); } catch (a6) { i(a6); } }); } var F4 = setTimeout; function gM(n) { return !!(n && typeof n.length < "u"); } function P4() { } function I4(n, e) { return function() { n.apply(e, arguments); }; } function Dt(n) { if (!(this instanceof Dt)) throw new TypeError("Promises must be constructed via new"); if (typeof n != "function") throw new TypeError("not a function"); this._state = 0, this._handled = false, this._value = void 0, this._deferreds = [], yM(n, this); } function vM(n, e) { for (; n._state === 3; ) n = n._value; if (n._state === 0) { n._deferreds.push(e); return; } n._handled = true, Dt._immediateFn(function() { var t = n._state === 1 ? e.onFulfilled : e.onRejected; if (t === null) { (n._state === 1 ? Fd : qa)(e.promise, n._value); return; } var i; try { i = t(n._value); } catch (r) { qa(e.promise, r); return; } Fd(e.promise, i); }); } function Fd(n, e) { try { if (e === n) throw new TypeError("A promise cannot be resolved with itself."); if (e && (typeof e == "object" || typeof e == "function")) { var t = e.then; if (e instanceof Dt) { n._state = 3, n._value = e, Pd(n); return; } else if (typeof t == "function") { yM(I4(t, e), n); return; } } n._state = 1, n._value = e, Pd(n); } catch (i) { qa(n, i); } } function qa(n, e) { n._state = 2, n._value = e, Pd(n); } function Pd(n) { n._state === 2 && n._deferreds.length === 0 && Dt._immediateFn(function() { n._handled || Dt._unhandledRejectionFn(n._value); }); for (var e = 0, t = n._deferreds.length; e < t; e++) vM(n, n._deferreds[e]); n._deferreds = null; } function O4(n, e, t) { this.onFulfilled = typeof n == "function" ? n : null, this.onRejected = typeof e == "function" ? e : null, this.promise = t; } function yM(n, e) { var t = false; try { n( function(i) { t || (t = true, Fd(e, i)); }, function(i) { t || (t = true, qa(e, i)); } ); } catch (i) { if (t) return; t = true, qa(e, i); } } Dt.prototype.catch = function(n) { return this.then(null, n); }; Dt.prototype.then = function(n, e) { var t = new this.constructor(P4); return vM(this, new O4(n, e, t)), t; }; Dt.prototype.finally = C4; Dt.all = function(n) { return new Dt(function(e, t) { if (!gM(n)) return t(new TypeError("Promise.all accepts an array")); var i = Array.prototype.slice.call(n); if (i.length === 0) return e([]); var r = i.length; function s(a6, c) { try { if (c && (typeof c == "object" || typeof c == "function")) { var l = c.then; if (typeof l == "function") { l.call( c, function(d) { s(a6, d); }, t ); return; } } i[a6] = c, --r === 0 && e(i); } catch (d) { t(d); } } for (var o = 0; o < i.length; o++) s(o, i[o]); }); }; Dt.any = R4; Dt.allSettled = L4; Dt.resolve = function(n) { return n && typeof n == "object" && n.constructor === Dt ? n : new Dt(function(e) { e(n); }); }; Dt.reject = function(n) { return new Dt(function(e, t) { t(n); }); }; Dt.race = function(n) { return new Dt(function(e, t) { if (!gM(n)) return t(new TypeError("Promise.race accepts an array")); for (var i = 0, r = n.length; i < r; i++) Dt.resolve(n[i]).then(e, t); }); }; Dt._immediateFn = // @ts-ignore typeof setImmediate == "function" && function(n) { setImmediate(n); } || function(n) { F4(n, 0); }; Dt._unhandledRejectionFn = function(e) { typeof console < "u" && console && console.warn("Possible Unhandled Promise Rejection:", e); }; var D4 = Object.freeze(Object.defineProperty({ __proto__: null, default: Dt }, Symbol.toStringTag, { value: "Module" })); var N4 = au(D4); (function(n, e) { (function(i, r) { n.exports = r(); })(Lr, () => ( /******/ (() => { var t = [ /* 0 */ /***/ (o, a6, c) => { c(1); var l = c(2), d = l.version, h6 = function() { this.Revision = d, this.defaultMaterialColor = 16777215, this.defaultOpacity = 1, this.modelPrefix = void 0, this.Geometry = c(3).Geometry, this.Glyph = c(16).Glyph, this.Glyphset = c(18).Glyphset, this.Pointset = c(22).Pointset, this.Label = c(17).Label, this.Lines = c(24).Lines, this.TextureArray = c(25).TextureArray, this.TextureSlides = c(27).TextureSlides, this.Renderer = c(30).Renderer, this.Scene = c(32).Scene, this.GeometryCSG = c(51).GeometryCSG, this.GlyphsetCSG = c(57).GlyphsetCSG, this.Viewport = c(44).Viewport, this.CameraControls = c(44).CameraControls, this.SmoothCameraTransition = c(44).SmoothCameraTransition, this.RayCaster = c(44).RayCaster, this.CameraAutoTumble = c(44).CameraAutoTumble, this.StereoEffect = c(44).StereoEffect, this.loadExternalFile = c(5).loadExternalFile, this.loadExternalFiles = c(5).loadExternalFiles, this.THREE = c(4); }; o.exports = new h6(); }, /* 1 */ /***/ (o) => { o.exports = _3(); }, /* 2 */ /***/ (o) => { o.exports = JSON.parse('{"name":"zincjs","version":"1.15.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu ","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}'); }, /* 3 */ /***/ function(o, a6, c) { var l = c(4), d = c(5).toBufferGeometry, h6 = (g6, p, u6) => { var y6 = d(g6, u6), v6 = false; 1 > u6.opacity && (v6 = true); var m6; if (y6._video === void 0) { var x6 = u6.localTimeEnabled || u6.localMorphColour; p ? (m6 = p, m6.morphTargets = x6, m6.morphNormals = u6.localTimeEnabled) : y6 instanceof l.BufferGeometry && y6.attributes.color === void 0 ? m6 = new l.MeshPhongMaterial({ color: u6.colour, morphTargets: x6, morphNormals: u6.localTimeEnabled, transparent: v6, opacity: u6.opacity, side: l.DoubleSide }) : m6 = new l.MeshPhongMaterial({ color: u6.colour, morphTargets: x6, morphNormals: u6.localTimeEnabled, vertexColors: l.VertexColors, transparent: v6, opacity: u6.opacity, side: l.DoubleSide }), u6.localMorphColour && y6.morphAttributes.color && (m6.onBeforeCompile = c(9).augmentMorphColor()); } else { var w6 = y6._video.createCanvasVideoTexture(); m6 = new l.MeshBasicMaterial({ morphTargets: u6.localTimeEnabled, color: new l.Color(1, 1, 1), transparent: v6, opacity: u6.opacity, map: w6, side: l.DoubleSide }), this.videoHandler = y6._video; } return new l.Mesh(y6, m6); }, f6 = function() { c(10).ZincObject.call(this), this.videoHandler = void 0, this.isGeometry = true, this.createMesh = (g6, p, u6) => { if (!(this.morph && this.morph.geometry && g6 != null)) { var y6 = h6(g6, p, u6); this.setMesh(y6, u6.localTimeEnabled, u6.localMorphColour); } }, this.calculateUVs = () => { this.geometry.computeBoundingBox(); var g6 = this.geometry.boundingBox.max, p = this.geometry.boundingBox.min, u6 = new l.Vector2(0 - p.x, 0 - p.y), y6 = new l.Vector2(g6.x - p.x, g6.y - p.y); this.geometry.faceVertexUvs[0] = []; for (var v6 = 0; v6 < this.geometry.faces.length; v6++) { var m6 = this.geometry.vertices[this.geometry.faces[v6].a], x6 = this.geometry.vertices[this.geometry.faces[v6].b], w6 = this.geometry.vertices[this.geometry.faces[v6].c]; geometry.faceVertexUvs[0].push([new l.Vector2((m6.x + u6.x) / y6.x, (m6.y + u6.y) / y6.y), new l.Vector2((x6.x + u6.x) / y6.x, (x6.y + u6.y) / y6.y), new l.Vector2((w6.x + u6.x) / y6.x, (w6.y + u6.y) / y6.y)]); } geometry.uvsNeedUpdate = true; }, this.checkTransparentMesh = function() { this._lod.checkTransparentMesh(); }, this.setWireframe = (g6) => { this.morph.material.wireframe = g6; }, this.editVertices = function(g6, p) { if (g6 && g6.length) { var u6 = this.getMorph(), y6 = u6.geometry.getAttribute("position"); if (!u6 || 0 > p) return; var v6 = 3 * p; g6.forEach((m6) => { y6.array[v6++] = m6[0], y6.array[v6++] = m6[1], y6.array[v6++] = m6[2]; }), y6.needsUpdate = true, u6.geometry.computeBoundingBox(), u6.geometry.computeBoundingSphere(), this.boundingBoxUpdateRequired = true; } }; }; f6.prototype = Object.create(c(10).ZincObject.prototype), a6.Geometry = f6; }, /* 4 */ /***/ (o) => { o.exports = zB; }, /* 5 */ /***/ (o, a6, c) => { function l(T6) { throw new TypeError('"' + T6 + '" is read-only'); } var d = c(4), h6 = c(6).Geometry, f6 = c(7).default; function g6(T6) { var P6 = T6, _6 = c(0).modelPrefix; return _6 && (_6[_6.length - 1] != "/" && l("prefix"), /^(?:[a-z]+:)?\/\//i.test(T6) || (P6 = _6 + T6)), P6; } function p(T6, P6) { var _6 = (E6, C6) => { try { var I6 = new URL(E6, C6).href; if (E6 && 2 > E6.split("?").length) { var b6 = C6.split("?"); b6.length === 2 && (I6 = I6 + "?" + b6[1]); } return I6; } catch { console.error("There is an issue creating the url link with: ".concat(E6, ".")); } }; if (!Array.isArray(T6)) return _6(T6, P6); var S6 = []; return T6.forEach((E6) => { S6.push(_6(E6, P6)); }), S6; } function u6(T6, P6, _6, S6, E6) { var C6 = T6.morphTargetInfluences, I6 = void 0; T6.geometry && (I6 = T6.geometry.morphAttributes); var b6 = false; if (C6 && I6 && I6.position) { S6.set(0, 0, 0), E6.set(0, 0, 0); for (var F6 = 0; F6 < C6.length; F6++) 0 < C6[F6] && (b6 = true, _6.setFromArray(I6.position[F6].array), S6.add(_6.min.multiplyScalar(C6[F6])), E6.add(_6.max.multiplyScalar(C6[F6]))); b6 && P6.set(S6, E6); } b6 || P6.setFromBufferAttribute(T6.geometry.attributes.position), T6.updateWorldMatrix(true, true), P6.applyMatrix4(T6.matrixWorld); } function y6(T6, P6, _6, S6) { var E6 = new XMLHttpRequest(); E6.open("GET", g6(T6), true), E6.onreadystatechange = () => { E6.readyState == 4 && (E6.status == 200 ? _6(E6.responseText, P6) : S6(T6)); }, E6.send(null); } function v6(T6, P6, _6) { function S6(F6, D6) { I6[D6] = F6, C6++, C6 == E6 && P6(I6); } for (var E6 = T6.length, C6 = 0, I6 = [], b6 = 0; b6 < E6; b6++) y6(T6[b6], b6, S6, _6); } a6.getColorsRGB = (T6, P6) => { var _6 = Math.floor(P6 / 3), S6 = P6 % 3, E6 = 0; S6 == 0 ? E6 = T6[_6].r : S6 == 1 ? E6 = T6[_6].g : S6 == 2 && (E6 = T6[_6].b); var C6 = new d.Color(E6); return [C6.r, C6.g, C6.b]; }, a6.updateMorphColorAttribute = function(T6, P6) { if (P6 && T6 && T6.morphAttributes && T6.morphAttributes.color) { var _6 = T6.morphAttributes.color, S6 = P6.morphTargetInfluences, E6 = S6.length; T6.deleteAttribute("morphColor0"), T6.deleteAttribute("morphColor1"); for (var C6 = 0, I6 = [], b6 = 0; 1 > C6 || b6 < E6; b6++) 0 < S6[b6] && (C6++, I6.push([b6, S6[b6]])); I6.length == 2 ? (T6.setAttribute("morphColor0", _6[I6[0][0]]), T6.setAttribute("morphColor1", _6[I6[1][0]])) : I6.length == 1 && (T6.setAttribute("morphColor0", _6[I6[0][0]]), T6.setAttribute("morphColor1", _6[I6[0][0]])); } }, a6.toBufferGeometry = (T6, P6) => { var _6; return T6 instanceof h6 ? (P6.localTimeEnabled && !T6.morphNormalsReady && (T6.morphNormals == null || T6.morphNormals.length == 0) && T6.computeMorphNormals(), _6 = T6.toIndexedBufferGeometry(), P6.localMorphColour && m6(T6, _6)) : T6 instanceof d.BufferGeometry && (_6 = T6.clone()), _6.colorsNeedUpdate = true, _6.computeBoundingBox(), _6.computeBoundingSphere(), T6._video && (_6._video = T6._video), _6; }, a6.copyMorphColorsToBufferGeometry = (T6, P6) => { if (T6 && T6.morphColors && 0 < T6.morphColors.length) { for (var _6 = [], S6 = T6.morphColors, E6 = c(5).getColorsRGB, C6 = 0, I6 = S6.length; C6 < I6; C6++) { for (var b6 = S6[C6], F6 = [], D6 = 0; D6 < T6.faces.length; D6++) { var N6 = T6.faces[D6], B6 = E6(b6.colors, N6.a); F6.push(B6[0], B6[1], B6[2]), B6 = E6(b6.colors, N6.b), F6.push(B6[0], B6[1], B6[2]), B6 = E6(b6.colors, N6.c), F6.push(B6[0], B6[1], B6[2]); } var U6 = new d.Float32BufferAttribute(3 * (3 * T6.faces.length), 3); U6.name = b6.name, _6.push(U6.copyArray(F6)); } P6.morphAttributes.color = _6; } }; var m6 = (T6, P6) => { if (T6 && T6.morphColors && 0 < T6.morphColors.length) { for (var _6 = [], S6 = T6.morphColors, E6 = c(5).getColorsRGB, C6 = 0, I6 = S6.length; C6 < I6; C6++) { for (var b6, F6 = S6[C6], D6 = [], N6 = 0; N6 < 3 * F6.colors.length; N6++) b6 = E6(F6.colors, N6), D6.push(b6[0], b6[1], b6[2]); var B6 = new d.Float32BufferAttribute(D6, 3); B6.name = F6.name, _6.push(B6); } P6.morphAttributes.color = _6; } }; function x6(T6) { for (var P6, _6, S6, E6, C6 = -1, I6 = 0, b6 = 0; b6 < T6.length; ++b6) { if (E6 = T6[b6], P6 === void 0 && (P6 = E6.array.constructor), P6 !== E6.array.constructor) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."), null; if (_6 === void 0 && (_6 = E6.itemSize), _6 !== E6.itemSize) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."), null; if (S6 === void 0 && (S6 = E6.normalized), S6 !== E6.normalized) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."), null; if (C6 === -1 && (C6 = E6.gpuType), C6 !== E6.gpuType) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null; I6 += E6.count * _6; } for (var F6, D6 = new P6(I6), N6 = new d.BufferAttribute(D6, _6, S6), B6 = 0, U6 = 0; U6 < T6.length; ++U6) { if (F6 = T6[U6], F6.isInterleavedBufferAttribute) for (var G6 = B6 / _6, Y = 0, te = F6.count; Y < te; Y++) for (var ae, ie = 0; ie < _6; ie++) ae = F6.getComponent(Y, ie), N6.setComponent(Y + G6, ie, ae); else D6.set(F6.array, B6); B6 += F6.count * _6; } return C6 !== void 0 && (N6.gpuType = C6), N6; } a6.mergeGeometries = function(T6) { for (var P6 = 1 < arguments.length && arguments[1] !== void 0 && arguments[1], _6 = T6[0].index !== null, S6 = new Set(Object.keys(T6[0].attributes)), E6 = new Set(Object.keys(T6[0].morphAttributes)), C6 = {}, I6 = {}, b6 = T6[0].morphTargetsRelative, F6 = new d.BufferGeometry(), D6 = 0, N6 = 0; N6 < T6.length; ++N6) { var B6 = T6[N6], U6 = 0; if (_6 !== (B6.index !== null)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + N6 + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."), null; for (var G6 in B6.attributes) { if (!S6.has(G6)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + N6 + '. All geometries must have compatible attributes; make sure "' + G6 + '" attribute exists among all geometries, or in none of them.'), null; C6[G6] === void 0 && (C6[G6] = []), C6[G6].push(B6.attributes[G6]), U6++; } if (U6 !== S6.size) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + N6 + ". Make sure all geometries have the same number of attributes."), null; if (b6 !== B6.morphTargetsRelative) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + N6 + ". .morphTargetsRelative must be consistent throughout all geometries."), null; for (var Y in B6.morphAttributes) { if (!E6.has(Y)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + N6 + ". .morphAttributes must be consistent throughout all geometries."), null; I6[Y] === void 0 && (I6[Y] = []), I6[Y].push(B6.morphAttributes[Y]); } if (P6) { var te = void 0; if (_6) te = B6.index.count; else if (B6.attributes.position !== void 0) te = B6.attributes.position.count; else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + N6 + ". The geometry must have either an index or a position attribute"), null; F6.addGroup(D6, te, N6), D6 += te; } } if (_6) { for (var ae, ie = 0, le = [], W6 = 0; W6 < T6.length; ++W6) { ae = T6[W6].index; for (var $6 = 0; $6 < ae.count; ++$6) le.push(ae.getX($6) + ie); ie += T6[W6].attributes.position.count; } F6.setIndex(le); } for (var j6 in C6) { var re = x6(C6[j6]); if (!re) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + j6 + " attribute."), null; F6.setAttribute(j6, re); } for (var k6 in I6) { var H6 = I6[k6][0].length; if (H6 === 0) break; F6.morphAttributes = F6.morphAttributes || {}, F6.morphAttributes[k6] = []; for (var K, ce = 0; ce < H6; ++ce) { K = []; for (var se = 0; se < I6[k6].length; ++se) K.push(I6[k6][se][ce]); var V6 = x6(K); if (!V6) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + k6 + " morphAttribute."), null; F6.morphAttributes[k6].push(V6); } } return F6; }, a6.mergeVertices = function(T6) { var P6 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 1e-4; P6 = Math.max(P6, Number.EPSILON); for (var _6, S6 = {}, E6 = T6.getIndex(), C6 = T6.getAttribute("position"), I6 = E6 ? E6.count : C6.count, b6 = 0, F6 = Object.keys(T6.attributes), D6 = {}, N6 = {}, be = [], B6 = ["getX", "getY", "getZ", "getW"], U6 = 0, G6 = F6.length; U6 < G6; U6++) { _6 = F6[U6], D6[_6] = []; var Y = T6.morphAttributes[_6]; Y && (N6[_6] = Array(Y.length).fill().map(() => [])); } for (var te = Math.log10(1 / P6), ae = Math.pow(10, te), U6 = 0; U6 < I6; U6++) { for (var ie = E6 ? E6.getX(U6) : U6, le = "", W6 = 0, G6 = F6.length; W6 < G6; W6++) for (var _6 = F6[W6], $6 = T6.getAttribute(_6), j6 = $6.itemSize, re = 0; re < j6; re++) le += "".concat(~~($6[B6[re]](ie) * ae), ","); if (le in S6) be.push(S6[le]); else { for (var W6 = 0, G6 = F6.length; W6 < G6; W6++) for (var k6, _6 = F6[W6], $6 = T6.getAttribute(_6), Y = T6.morphAttributes[_6], j6 = $6.itemSize, H6 = D6[_6], K = N6[_6], re = 0; re < j6; re++) if (k6 = B6[re], H6.push($6[k6](ie)), Y) for (var ce = 0, se = Y.length; ce < se; ce++) K[ce].push(Y[ce][k6](ie)); S6[le] = b6, be.push(b6), b6++; } } for (var V6 = T6.clone(), U6 = 0, G6 = F6.length; U6 < G6; U6++) { var $6, _6 = F6[U6], O6 = T6.getAttribute(_6), Z6 = new O6.array.constructor(D6[_6]); if (O6.isInterleavedBufferAttribute ? $6 = new d.BufferAttribute(Z6, O6.itemSize, O6.itemSize) : ($6 = T6.getAttribute(_6).clone(), $6.setArray(Z6)), V6.setAttribute(_6, $6), _6 in N6) for (var X, W6 = 0; W6 < N6[_6].length; W6++) X = T6.morphAttributes[_6][W6].clone(), X.setArray(new X.array.constructor(N6[_6][W6])), V6.morphAttributes[_6][W6] = X; } var ee = Uint8Array; be.length >= Math.pow(2, 8) && (ee = Uint16Array), be.length >= Math.pow(2, 16) && (ee = Uint32Array); var fe = new ee(be), be = null; return E6 === null ? be = new d.BufferAttribute(fe, 1) : (be = T6.getIndex().clone(), be.setArray(fe)), V6.setIndex(be), V6; }; function w6(T6) { if (T6.isMeshPhongMaterial) { var P6 = new d.MeshToonMaterial({ color: T6.color.clone(), morphTargets: T6.morphTargets, morphNormals: T6.morphNormals, vertexColors: T6.vertexColors, transparent: T6.transparent, opacity: T6.opacity, side: T6.side }); return T6.map && (P6.map = T6.map), P6; } return T6; } function A6(T6, P6) { if (P6 && T6 >= P6.length) { var _6 = new d.BufferGeometry(), S6 = new Float32Array(3 * T6), E6 = 0; return P6.forEach((C6) => { S6[E6++] = C6[0], S6[E6++] = C6[1], S6[E6++] = C6[2]; }), _6.setAttribute("position", new d.BufferAttribute(S6, 3)), _6.setDrawRange(0, P6.length), _6; } } function M6() { var T6 = new Image(); T6.src = c(8); var P6 = new d.Texture(); return P6.image = T6, P6.needsUpdate = true, P6; } function R6(T6, P6, _6, S6, E6, C6) { var I6 = new f6(T6, P6, _6, S6, E6, C6); return I6.fontFace = S6, I6.fontSize = E6, I6.fontWeight = C6, I6.material.map.generateMipmaps = false, I6.material.map.anisotropy = 4, I6.material.sizeAttenuation = false, I6.material.alphaTest = 0.5, I6.material.transparent = true, I6.material.depthWrite = false, I6.material.depthTest = false, I6.center.set(0.5, -1.2), I6.renderOrder = 1e4, I6; } function L6(T6, P6, _6) { if (_6) { var S6 = T6 || "", E6 = P6 || "", C6 = _6.lastIndexOf("/"); if (-1 < C6) { var I6 = void 0, b6 = void 0; if (I6 = _6.substring(0, C6), b6 = _6.substring(C6 + 1), (I6 === "*" || I6 === "**" || I6.toLowerCase() === S6.toLowerCase()) && (b6 === "*" || b6 === "**" || b6.toLowerCase() === E6.toLowerCase())) return true; } else if (S6.toLowerCase() === _6.toLowerCase() || E6.toLowerCase() === _6.toLowerCase()) return true; } return false; } a6.getBoundingBox = u6, a6.createNewURL = p, a6.createBufferGeometry = A6, a6.getCircularTexture = M6, a6.resolveURL = g6, a6.loadExternalFile = y6, a6.loadExternalFiles = v6, a6.PhongToToon = w6, a6.createNewSpriteText = R6, a6.isRegionGroup = L6; }, /* 6 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ Face3: () => ( /* binding */ y6 ), /* harmony export */ Geometry: () => ( /* binding */ p ) /* harmony export */ }); var l = c(4), d = new l.Matrix4(), h6 = new l.Object3D(), f6 = new l.Vector3(), g6 = new l.Vector3(); function p() { this.uuid = l.MathUtils.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [[]], this.normals = [], this.uvs = [], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.elementsNeedUpdate = false, this.verticesNeedUpdate = false, this.uvsNeedUpdate = false, this.normalsNeedUpdate = false, this.colorsNeedUpdate = false, this.lineDistancesNeedUpdate = false, this.groupsNeedUpdate = false, this.morphNormalsReady = false; } p.prototype = Object.assign(Object.create(l.EventDispatcher.prototype), { constructor: p, isGeometry: true, applyMatrix4: function(m6) { for (var x6, w6 = new l.Matrix3().getNormalMatrix(m6), A6 = 0, M6 = this.vertices.length; A6 < M6; A6++) x6 = this.vertices[A6], x6.applyMatrix4(m6); for (var R6, L6 = 0, T6 = this.faces.length; L6 < T6; L6++) { R6 = this.faces[L6], R6.normal.applyMatrix3(w6).normalize(); for (var P6 = 0, _6 = R6.vertexNormals.length; P6 < _6; P6++) R6.vertexNormals[P6].applyMatrix3(w6).normalize(); } return this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this.verticesNeedUpdate = true, this.normalsNeedUpdate = true, this; }, rotateX: function(m6) { return d.makeRotationX(m6), this.applyMatrix4(d), this; }, rotateY: function(m6) { return d.makeRotationY(m6), this.applyMatrix4(d), this; }, rotateZ: function(m6) { return d.makeRotationZ(m6), this.applyMatrix4(d), this; }, translate: function(m6, x6, w6) { return d.makeTranslation(m6, x6, w6), this.applyMatrix4(d), this; }, scale: function(m6, x6, w6) { return d.makeScale(m6, x6, w6), this.applyMatrix4(d), this; }, lookAt: function(m6) { return h6.lookAt(m6), h6.updateMatrix(), this.applyMatrix4(h6.matrix), this; }, fromBufferGeometry: function(m6) { function x6(G6, Y, te, ae) { var ie = T6 === void 0 ? [] : [w6.colors[G6].clone(), w6.colors[Y].clone(), w6.colors[te].clone()], le = L6 === void 0 ? [] : [new l.Vector3().fromBufferAttribute(L6, G6), new l.Vector3().fromBufferAttribute(L6, Y), new l.Vector3().fromBufferAttribute(L6, te)], W6 = new y6(G6, Y, te, le, ie, ae); w6.faces.push(W6), P6 !== void 0 && w6.faceVertexUvs[0].push([new l.Vector2().fromBufferAttribute(P6, G6), new l.Vector2().fromBufferAttribute(P6, Y), new l.Vector2().fromBufferAttribute(P6, te)]), _6 !== void 0 && w6.faceVertexUvs[1].push([new l.Vector2().fromBufferAttribute(_6, G6), new l.Vector2().fromBufferAttribute(_6, Y), new l.Vector2().fromBufferAttribute(_6, te)]); } var w6 = this, A6 = m6.index === null ? void 0 : m6.index, M6 = m6.attributes; if (M6.position === void 0) return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."), this; var R6 = M6.position, L6 = M6.normal, T6 = M6.color, P6 = M6.uv, _6 = M6.uv2; _6 !== void 0 && (this.faceVertexUvs[1] = []); for (var S6 = 0; S6 < R6.count; S6++) w6.vertices.push(new l.Vector3().fromBufferAttribute(R6, S6)), T6 !== void 0 && w6.colors.push(new l.Color().fromBufferAttribute(T6, S6)); var E6 = m6.groups; if (0 < E6.length) for (var C6 = 0; C6 < E6.length; C6++) for (var I6 = E6[C6], b6 = I6.start, F6 = I6.count, D6 = b6, N6 = b6 + F6; D6 < N6; D6 += 3) A6 === void 0 ? x6(D6, D6 + 1, D6 + 2, I6.materialIndex) : x6(A6.getX(D6), A6.getX(D6 + 1), A6.getX(D6 + 2), I6.materialIndex); else if (A6 !== void 0) for (var B6 = 0; B6 < A6.count; B6 += 3) x6(A6.getX(B6), A6.getX(B6 + 1), A6.getX(B6 + 2)); else for (var U6 = 0; U6 < R6.count; U6 += 3) x6(U6, U6 + 1, U6 + 2); return this.computeFaceNormals(), m6.boundingBox !== null && (this.boundingBox = m6.boundingBox.clone()), m6.boundingSphere !== null && (this.boundingSphere = m6.boundingSphere.clone()), this; }, center: function() { return this.computeBoundingBox(), this.boundingBox.getCenter(f6).negate(), this.translate(f6.x, f6.y, f6.z), this; }, normalize: function() { this.computeBoundingSphere(); var m6 = this.boundingSphere.center, x6 = this.boundingSphere.radius, w6 = x6 === 0 ? 1 : 1 / x6, A6 = new l.Matrix4(); return A6.set(w6, 0, 0, -w6 * m6.x, 0, w6, 0, -w6 * m6.y, 0, 0, w6, -w6 * m6.z, 0, 0, 0, 1), this.applyMatrix4(A6), this; }, computeFaceNormals: function() { for (var m6 = new l.Vector3(), x6 = new l.Vector3(), w6 = 0, A6 = this.faces.length; w6 < A6; w6++) { var M6 = this.faces[w6], R6 = this.vertices[M6.a], L6 = this.vertices[M6.b], T6 = this.vertices[M6.c]; m6.subVectors(T6, L6), x6.subVectors(R6, L6), m6.cross(x6), m6.normalize(), M6.normal.copy(m6); } }, computeVertexNormals: function() { for (var m6 = !(0 < arguments.length && arguments[0] !== void 0) || arguments[0], x6 = Array(this.vertices.length), w6 = 0, A6 = this.vertices.length; w6 < A6; w6++) x6[w6] = new l.Vector3(); if (m6) for (var M6 = new l.Vector3(), R6 = new l.Vector3(), L6 = 0, T6 = this.faces.length; L6 < T6; L6++) { var P6 = this.faces[L6], _6 = this.vertices[P6.a], S6 = this.vertices[P6.b], E6 = this.vertices[P6.c]; M6.subVectors(E6, S6), R6.subVectors(_6, S6), M6.cross(R6), x6[P6.a].add(M6), x6[P6.b].add(M6), x6[P6.c].add(M6); } else { this.computeFaceNormals(); for (var C6, I6 = 0, b6 = this.faces.length; I6 < b6; I6++) C6 = this.faces[I6], x6[C6.a].add(C6.normal), x6[C6.b].add(C6.normal), x6[C6.c].add(C6.normal); } for (var F6 = 0, D6 = this.vertices.length; F6 < D6; F6++) x6[F6].normalize(); for (var N6 = 0, B6 = this.faces.length; N6 < B6; N6++) { var U6 = this.faces[N6], G6 = U6.vertexNormals; G6.length === 3 ? (G6[0].copy(x6[U6.a]), G6[1].copy(x6[U6.b]), G6[2].copy(x6[U6.c])) : (G6[0] = x6[U6.a].clone(), G6[1] = x6[U6.b].clone(), G6[2] = x6[U6.c].clone()); } return 0 < this.faces.length && (this.normalsNeedUpdate = true), x6; }, computeFlatVertexNormals: function() { this.computeFaceNormals(); for (var m6 = 0, x6 = this.faces.length; m6 < x6; m6++) { var w6 = this.faces[m6], A6 = w6.vertexNormals; A6.length === 3 ? (A6[0].copy(w6.normal), A6[1].copy(w6.normal), A6[2].copy(w6.normal)) : (A6[0] = w6.normal.clone(), A6[1] = w6.normal.clone(), A6[2] = w6.normal.clone()); } 0 < this.faces.length && (this.normalsNeedUpdate = true); }, computeMorphNormals: function() { for (var m6, x6 = 0, w6 = this.faces.length; x6 < w6; x6++) { m6 = this.faces[x6], m6.__originalFaceNormal ? m6.__originalFaceNormal.copy(m6.normal) : m6.__originalFaceNormal = m6.normal.clone(), m6.__originalVertexNormals || (m6.__originalVertexNormals = []); for (var A6 = 0, M6 = m6.vertexNormals.length; A6 < M6; A6++) m6.__originalVertexNormals[A6] ? m6.__originalVertexNormals[A6].copy(m6.vertexNormals[A6]) : m6.__originalVertexNormals[A6] = m6.vertexNormals[A6].clone(); } var R6 = new p(); R6.faces = this.faces; for (var L6 = 0, T6 = this.morphTargets.length; L6 < T6; L6++) { if (!this.morphNormals[L6]) { this.morphNormals[L6] = {}, this.morphNormals[L6].faceNormals = [], this.morphNormals[L6].vertexNormals = []; for (var P6 = this.morphNormals[L6].faceNormals, _6 = this.morphNormals[L6].vertexNormals, S6 = 0, E6 = this.faces.length; S6 < E6; S6++) { var C6 = new l.Vector3(), I6 = { a: new l.Vector3(), b: new l.Vector3(), c: new l.Vector3() }; P6.push(C6), _6.push(I6); } } var b6 = this.morphNormals[L6]; R6.vertices = this.morphTargets[L6].vertices, R6.computeFaceNormals(); var F6 = R6.computeVertexNormals(); if (F6 && 0 < F6.length) { this.morphTargets[L6].normals = Array(this.vertices.length); for (var D6 = 0; D6 < F6.length; D6++) this.morphTargets[L6].normals[D6] = F6[D6].clone(); } for (var N6 = 0, B6 = this.faces.length; N6 < B6; N6++) { var U6 = this.faces[N6], G6 = b6.faceNormals[N6], Y = b6.vertexNormals[N6]; G6.copy(U6.normal), Y.a.copy(U6.vertexNormals[0]), Y.b.copy(U6.vertexNormals[1]), Y.c.copy(U6.vertexNormals[2]); } } for (var te, ae = 0, ie = this.faces.length; ae < ie; ae++) te = this.faces[ae], te.normal = te.__originalFaceNormal, te.vertexNormals = te.__originalVertexNormals; this.morphNormalsReady = true; }, computeBoundingBox: function() { this.boundingBox === null && (this.boundingBox = new l.Box3()), this.boundingBox.setFromPoints(this.vertices); }, computeBoundingSphere: function() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingSphere.setFromPoints(this.vertices); }, mergeMorph: function(m6, x6) { var w6 = this.morphTargets.length, A6 = this.morphTargets, M6 = m6.morphTargets, R6 = this.morphColors.length, L6 = this.morphColors, T6 = m6.morphColors; if (0 < w6 && w6 == M6.length) for (var P6 = 0, _6 = A6.length; P6 < _6; P6++) { for (var S6 = A6[P6], E6 = M6[P6], C6 = 0, I6 = E6.vertices.length; C6 < I6; C6++) { var b6 = E6.vertices[C6], F6 = b6.clone(); x6 !== void 0 && F6.applyMatrix4(x6), S6.vertices.push(F6); } if (S6.normals && E6.normals) for (var D6 = 0; D6 < E6.normals.length; D6 += 3) g6.set(E6.normals2[D6], E6.normals2[D6 + 1], E6.normals2[D6 + 2]), x6 !== void 0 && g6.applyMatrix4(x6), S6.normals.push(g6.x, g6.y, g6.z); } if (0 < R6 && R6 == T6.length) for (var N6 = 0, B6 = L6.length; N6 < B6; N6++) for (var U6 = L6[N6], G6 = T6[N6], Y = 0, te = G6.colors; Y < te; Y++) U6.colors.push(G6.colors[Y].clone()); }, merge: function(m6, x6) { var w6 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0; if (!(m6 && m6.isGeometry)) return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", m6); var A6, M6 = this.vertices.length, R6 = this.vertices, L6 = m6.vertices, T6 = m6.normals, P6 = this.faces, _6 = m6.faces, S6 = this.colors, E6 = m6.colors; x6 !== void 0 && (A6 = new l.Matrix3().getNormalMatrix(x6)); for (var C6 = 0, I6 = L6.length; C6 < I6; C6++) { var b6 = L6[C6], F6 = b6.clone(); x6 !== void 0 && F6.applyMatrix4(x6), R6.push(F6); } for (var D6 = 0; D6 < T6.length; D6 += 3) g6.set(T6[D6], T6[D6 + 1], T6[D6 + 2]), x6 !== void 0 && g6.applyMatrix4(x6), this.normals.push(g6.x, g6.y, g6.z); for (var N6 = 0, B6 = E6.length; N6 < B6; N6++) typeof E6[N6] == "number" ? S6.push(E6[N6]) : S6.push(E6[N6].clone()); for (var U6 = 0, G6 = _6.length; U6 < G6; U6++) { var Y = _6[U6], te = void 0, ae = void 0, ie = Y.vertexNormals, le = Y.vertexColors, W6 = new y6(Y.a + M6, Y.b + M6, Y.c + M6); W6.normal.copy(Y.normal), A6 !== void 0 && W6.normal.applyMatrix3(A6).normalize(); for (var $6 = 0, j6 = ie.length; $6 < j6; $6++) te = ie[$6].clone(), A6 !== void 0 && te.applyMatrix3(A6).normalize(), W6.vertexNormals.push(te); W6.color.copy(Y.color); for (var re = 0, k6 = le.length; re < k6; re++) ae = le[re], W6.vertexColors.push(ae.clone()); W6.materialIndex = Y.materialIndex + w6, P6.push(W6); } for (var H6, K = 0, ce = m6.faceVertexUvs.length; K < ce; K++) { H6 = m6.faceVertexUvs[K], this.faceVertexUvs[K] === void 0 && (this.faceVertexUvs[K] = []); for (var se = 0, V6 = H6.length; se < V6; se++) { for (var O6 = H6[se], Z6 = [], X = 0, ee = O6.length; X < ee; X++) Z6.push(O6[X].clone()); this.faceVertexUvs[K].push(Z6); } } this.mergeMorph(m6, x6); }, mergeMesh: function(m6) { return m6 && m6.isMesh ? (m6.matrixAutoUpdate && m6.updateMatrix(), void this.merge(m6.geometry, m6.matrix)) : void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", m6); }, /* * Checks for duplicate vertices with hashmap. * Duplicated vertices are removed * and faces' vertices are updated. */ mergeVertices: function() { for (var m6 = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 4, x6 = {}, w6 = [], A6 = [], M6 = Math.pow(10, m6), R6 = 0, L6 = this.vertices.length; R6 < L6; R6++) { var T6 = this.vertices[R6], P6 = Math.round(T6.x * M6) + "_" + Math.round(T6.y * M6) + "_" + Math.round(T6.z * M6); x6[P6] === void 0 ? (x6[P6] = R6, w6.push(this.vertices[R6]), A6[R6] = w6.length - 1) : A6[R6] = A6[x6[P6]]; } for (var _6, S6 = [], E6 = 0, C6 = this.faces.length; E6 < C6; E6++) { _6 = this.faces[E6], _6.a = A6[_6.a], _6.b = A6[_6.b], _6.c = A6[_6.c]; for (var I6 = [_6.a, _6.b, _6.c], b6 = 0; 3 > b6; b6++) if (I6[b6] === I6[(b6 + 1) % 3]) { S6.push(E6); break; } } for (var F6, D6 = S6.length - 1; 0 <= D6; D6--) { F6 = S6[D6], this.faces.splice(F6, 1); for (var N6 = 0, B6 = this.faceVertexUvs.length; N6 < B6; N6++) this.faceVertexUvs[N6].splice(F6, 1); } var U6 = this.vertices.length - w6.length; return this.vertices = w6, U6; }, setFromPoints: function(m6) { this.vertices = []; for (var x6, w6 = 0, A6 = m6.length; w6 < A6; w6++) x6 = m6[w6], this.vertices.push(new l.Vector3(x6.x, x6.y, x6.z || 0)); return this; }, sortFacesByMaterialIndex: function() { for (var m6 = this.faces, x6 = m6.length, w6 = 0; w6 < x6; w6++) m6[w6]._id = w6; m6.sort(function(_6, S6) { return _6.materialIndex - S6.materialIndex; }); var A6, M6, R6 = this.faceVertexUvs[0], L6 = this.faceVertexUvs[1]; R6 && R6.length === x6 && (A6 = []), L6 && L6.length === x6 && (M6 = []); for (var T6, P6 = 0; P6 < x6; P6++) T6 = m6[P6]._id, A6 && A6.push(R6[T6]), M6 && M6.push(L6[T6]); A6 && (this.faceVertexUvs[0] = A6), M6 && (this.faceVertexUvs[1] = M6); }, toJSON: function() { function m6(k6, H6, K) { return K ? k6 | 1 << H6 : k6 & ~(1 << H6); } function x6(k6) { var H6 = k6.x.toString() + k6.y.toString() + k6.z.toString(); return C6[H6] === void 0 && (C6[H6] = E6.length / 3, E6.push(k6.x, k6.y, k6.z)), C6[H6]; } function w6(k6) { var H6 = k6.r.toString() + k6.g.toString() + k6.b.toString(); return b6[H6] === void 0 && (b6[H6] = I6.length, I6.push(k6.getHex())), b6[H6]; } function A6(k6) { var H6 = k6.x.toString() + k6.y.toString(); return D6[H6] === void 0 && (D6[H6] = F6.length / 2, F6.push(k6.x, k6.y)), D6[H6]; } var M6 = { metadata: { version: 4.5, type: "Geometry", generator: "Geometry.toJSON" } }; if (M6.uuid = this.uuid, M6.type = this.type, this.name !== "" && (M6.name = this.name), this.parameters !== void 0) { var R6 = this.parameters; for (var L6 in R6) R6[L6] !== void 0 && (M6[L6] = R6[L6]); return M6; } for (var T6, P6 = [], _6 = 0; _6 < this.vertices.length; _6++) T6 = this.vertices[_6], P6.push(T6.x, T6.y, T6.z); for (var S6 = [], E6 = [], C6 = {}, I6 = [], b6 = {}, F6 = [], D6 = {}, N6 = 0; N6 < this.faces.length; N6++) { var B6 = this.faces[N6], U6 = true, G6 = false, Y = this.faceVertexUvs[0][N6] !== void 0, te = 0 < B6.normal.length(), ae = 0 < B6.vertexNormals.length, ie = B6.color.r !== 1 || B6.color.g !== 1 || B6.color.b !== 1, le = 0 < B6.vertexColors.length, W6 = 0; if (W6 = m6(W6, 0, 0), W6 = m6(W6, 1, U6), W6 = m6(W6, 2, G6), W6 = m6(W6, 3, Y), W6 = m6(W6, 4, te), W6 = m6(W6, 5, ae), W6 = m6(W6, 6, ie), W6 = m6(W6, 7, le), S6.push(W6), S6.push(B6.a, B6.b, B6.c), S6.push(B6.materialIndex), Y) { var $6 = this.faceVertexUvs[0][N6]; S6.push(A6($6[0]), A6($6[1]), A6($6[2])); } if (te && S6.push(x6(B6.normal)), ae) { var j6 = B6.vertexNormals; S6.push(x6(j6[0]), x6(j6[1]), x6(j6[2])); } if (ie && S6.push(w6(B6.color)), le) { var re = B6.vertexColors; S6.push(w6(re[0]), w6(re[1]), w6(re[2])); } } return M6.data = {}, M6.data.vertices = P6, M6.data.normals = E6, 0 < I6.length && (M6.data.colors = I6), 0 < F6.length && (M6.data.uvs = [F6]), M6.data.faces = S6, M6; }, clone: function() { return new p().copy(this); }, copy: function(m6) { this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [[]], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.name = m6.name; for (var x6 = m6.vertices, w6 = 0, A6 = x6.length; w6 < A6; w6++) this.vertices.push(x6[w6].clone()); for (var M6 = m6.colors, R6 = 0, L6 = M6.length; R6 < L6; R6++) this.colors.push(M6[R6].clone()); for (var T6 = m6.faces, P6 = 0, _6 = T6.length; P6 < _6; P6++) this.faces.push(T6[P6].clone()); for (var S6, E6 = 0, C6 = m6.faceVertexUvs.length; E6 < C6; E6++) { S6 = m6.faceVertexUvs[E6], this.faceVertexUvs[E6] === void 0 && (this.faceVertexUvs[E6] = []); for (var I6 = 0, b6 = S6.length; I6 < b6; I6++) { for (var F6, D6 = S6[I6], N6 = [], B6 = 0, U6 = D6.length; B6 < U6; B6++) F6 = D6[B6], N6.push(F6.clone()); this.faceVertexUvs[E6].push(N6); } } for (var G6, Y = m6.morphTargets, te = 0, ae = Y.length; te < ae; te++) { if (G6 = {}, G6.name = Y[te].name, Y[te].vertices !== void 0) { G6.vertices = []; for (var ie = 0, le = Y[te].vertices.length; ie < le; ie++) G6.vertices.push(Y[te].vertices[ie].clone()); } if (Y[te].normals !== void 0) { G6.normals = []; for (var W6 = 0, $6 = Y[te].normals.length; W6 < $6; W6++) G6.normals.push(Y[te].normals[W6].clone()); } this.morphTargets.push(G6); } for (var j6, re = m6.morphNormals, k6 = 0, H6 = re.length; k6 < H6; k6++) { if (j6 = {}, re[k6].vertexNormals !== void 0) { j6.vertexNormals = []; for (var K = 0, ce = re[k6].vertexNormals.length; K < ce; K++) { var se = re[k6].vertexNormals[K], V6 = {}; V6.a = se.a.clone(), V6.b = se.b.clone(), V6.c = se.c.clone(), j6.vertexNormals.push(V6); } } if (re[k6].faceNormals !== void 0) { j6.faceNormals = []; for (var O6 = 0, Z6 = re[k6].faceNormals.length; O6 < Z6; O6++) j6.faceNormals.push(re[k6].faceNormals[O6].clone()); } this.morphNormals.push(j6); } for (var X = m6.skinWeights, ee = 0, fe = X.length; ee < fe; ee++) this.skinWeights.push(X[ee].clone()); for (var be = m6.skinIndices, Ae = 0, he = be.length; Ae < he; Ae++) this.skinIndices.push(be[Ae].clone()); for (var xe = m6.lineDistances, ne = 0, me = xe.length; ne < me; ne++) this.lineDistances.push(xe[ne]); var Me = m6.boundingBox; Me !== null && (this.boundingBox = Me.clone()); var De = m6.boundingSphere; return De !== null && (this.boundingSphere = De.clone()), this.elementsNeedUpdate = m6.elementsNeedUpdate, this.verticesNeedUpdate = m6.verticesNeedUpdate, this.uvsNeedUpdate = m6.uvsNeedUpdate, this.normalsNeedUpdate = m6.normalsNeedUpdate, this.colorsNeedUpdate = m6.colorsNeedUpdate, this.lineDistancesNeedUpdate = m6.lineDistancesNeedUpdate, this.groupsNeedUpdate = m6.groupsNeedUpdate, this; }, computeGroups() { var v6, m6, x6 = [], w6 = void 0, A6 = this.faces; for (m6 = 0; m6 < A6.length; m6++) { var M6 = A6[m6]; M6.materialIndex !== w6 && (w6 = M6.materialIndex, v6 !== void 0 && (v6.count = 3 * m6 - v6.start, x6.push(v6)), v6 = { start: 3 * m6, materialIndex: w6 }); } return v6 !== void 0 && (v6.count = 3 * m6 - v6.start, x6.push(v6)), x6; }, toBufferGeometry: function() { var m6 = new u6().fromGeometry(this), x6 = new l.BufferGeometry(), w6 = new Float32Array(3 * m6.vertices.length); if (x6.setAttribute("position", new l.BufferAttribute(w6, 3).copyVector3sArray(m6.vertices)), 0 < m6.normals.length) { var A6 = new Float32Array(3 * m6.normals.length); x6.setAttribute("normal", new l.BufferAttribute(A6, 3).copyVector3sArray(m6.normals)); } if (0 < m6.colors.length) { var M6 = new Float32Array(3 * m6.colors.length); x6.setAttribute("color", new l.BufferAttribute(M6, 3).copyColorsArray(m6.colors)); } if (0 < m6.uvs.length) { var R6 = new Float32Array(2 * m6.uvs.length); x6.setAttribute("uv", new l.BufferAttribute(R6, 2).copyVector2sArray(m6.uvs)); } if (0 < m6.uvs2.length) { var L6 = new Float32Array(2 * m6.uvs2.length); x6.setAttribute("uv2", new l.BufferAttribute(L6, 2).copyVector2sArray(m6.uvs2)); } for (var T6 in x6.groups = m6.groups, m6.morphTargets) { for (var P6 = [], _6 = m6.morphTargets[T6], S6 = 0, E6 = _6.length; S6 < E6; S6++) { var C6 = _6[S6], I6 = new l.Float32BufferAttribute(3 * C6.data.length, 3); I6.name = C6.name, P6.push(I6.copyVector3sArray(C6.data)); } x6.morphAttributes[T6] = P6; } if (0 < m6.skinIndices.length) { var b6 = new l.Float32BufferAttribute(4 * m6.skinIndices.length, 4); x6.setAttribute("skinIndex", b6.copyVector4sArray(m6.skinIndices)); } if (0 < m6.skinWeights.length) { var F6 = new l.Float32BufferAttribute(4 * m6.skinWeights.length, 4); x6.setAttribute("skinWeight", F6.copyVector4sArray(m6.skinWeights)); } return m6.boundingSphere !== null && (x6.boundingSphere = m6.boundingSphere.clone()), m6.boundingBox !== null && (x6.boundingBox = m6.boundingBox.clone()), x6; }, toIndexedBufferGeometry: function() { var m6 = new l.BufferGeometry(), x6 = new Float32Array(3 * this.vertices.length); if (m6.setAttribute("position", new l.BufferAttribute(x6, 3).copyVector3sArray(this.vertices)), 0 < this.normals.length) { var w6 = new Float32Array(this.normals.length), A6 = new l.BufferAttribute(w6, 3).copyArray(this.normals); m6.setAttribute("normal", A6); } if (0 < this.uvs.length && 0 < this.uvs[0].length) { var M6 = new Float32Array(2 * this.uvs[0].length); m6.setAttribute("uv", new l.BufferAttribute(M6, 2).copyArray(this.uvs[0])); } if (1 < this.uvs.length && 0 < this.uvs[1].length) { var R6 = new Float32Array(2 * this.uvs[1].length); m6.setAttribute("uv2", new l.BufferAttribute(R6, 2).copyArray(this.uvs[1])); } if (0 < this.colors.length) { for (var L6 = [], T6 = 0; T6 < this.colors.length; T6++) L6.push(new l.Color(this.colors[T6])); var P6 = new Float32Array(3 * L6.length); m6.setAttribute("color", new l.BufferAttribute(P6, 3).copyColorsArray(L6)); } else { for (var _6 = new Float32Array(3 * this.vertices.length), S6 = 0; S6 < 3 * this.vertices.length; S6++) _6[S6] = 1; m6.setAttribute("color", new l.BufferAttribute(_6, 3)); } if (0 < this.faces.length) { for (var E6 = [], C6 = [], I6 = 0; I6 < this.faces.length; I6++) { C6.push(this.faces[I6].a, this.faces[I6].b, this.faces[I6].c); var b6 = this.faces[I6].vertexColors; if (b6.length === 3) E6.push(b6[0], b6[1], b6[2]); else { var F6 = this.faces[I6].color; E6.push(F6, F6, F6); } } m6.setIndex(C6), m6.groups = this.computeGroups(); } if (0 < this.morphTargets.length) { for (var D6 = [], N6 = [], B6 = 0, U6 = this.morphTargets.length; B6 < U6; B6++) { var G6 = this.morphTargets[B6], Y = new l.Float32BufferAttribute(3 * G6.vertices.length, 3); if (Y.name = G6.name, D6.push(Y.copyVector3sArray(G6.vertices)), G6.normals) { var te = new l.Float32BufferAttribute(3 * G6.normals.length, 3); te.name = G6.name, N6.push(te.copyVector3sArray(G6.normals)); } } m6.morphAttributes.position = D6, m6.morphAttributes.normal = N6; } if (0 < this.skinIndices.length) { var ae = new l.Float32BufferAttribute(4 * this.skinIndices.length, 4); m6.setAttribute("skinIndex", ae.copyVector4sArray(this.skinIndices)); } if (0 < this.skinWeights.length) { var ie = new l.Float32BufferAttribute(4 * this.skinWeights.length, 4); m6.setAttribute("skinWeight", ie.copyVector4sArray(this.skinWeights)); } return this.boundingSphere !== null && (m6.boundingSphere = this.boundingSphere.clone()), this.boundingBox !== null && (m6.boundingBox = this.boundingBox.clone()), m6; }, computeTangents: function() { console.error("THREE.Geometry: .computeTangents() has been removed."); }, computeLineDistances: function() { console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead."); }, applyMatrix: function(m6) { return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(m6); }, dispose: function() { this.dispatchEvent({ type: "dispose" }); } }), p.createBufferGeometryFromObject = function(v6) { var m6 = new l.BufferGeometry(), x6 = v6.geometry; if (v6.isPoints || v6.isLine) { var w6 = new l.Float32BufferAttribute(3 * x6.vertices.length, 3), A6 = new l.Float32BufferAttribute(3 * x6.colors.length, 3); if (m6.setAttribute("position", w6.copyVector3sArray(x6.vertices)), m6.setAttribute("color", A6.copyColorsArray(x6.colors)), x6.lineDistances && x6.lineDistances.length === x6.vertices.length) { var M6 = new l.Float32BufferAttribute(x6.lineDistances.length, 1); m6.setAttribute("lineDistance", M6.copyArray(x6.lineDistances)); } x6.boundingSphere !== null && (m6.boundingSphere = x6.boundingSphere.clone()), x6.boundingBox !== null && (m6.boundingBox = x6.boundingBox.clone()); } else v6.isMesh && (m6 = x6.toBufferGeometry()); return m6; }; class u6 { constructor() { this.vertices = [], this.normals = [], this.colors = [], this.uvs = [], this.uvs2 = [], this.groups = [], this.morphTargets = {}, this.skinWeights = [], this.skinIndices = [], this.boundingBox = null, this.boundingSphere = null, this.verticesNeedUpdate = false, this.normalsNeedUpdate = false, this.colorsNeedUpdate = false, this.uvsNeedUpdate = false, this.groupsNeedUpdate = false; } computeGroups(m6) { var x6, w6, A6 = [], M6 = void 0, R6 = m6.faces; for (w6 = 0; w6 < R6.length; w6++) { var L6 = R6[w6]; L6.materialIndex !== M6 && (M6 = L6.materialIndex, x6 !== void 0 && (x6.count = 3 * w6 - x6.start, A6.push(x6)), x6 = { start: 3 * w6, materialIndex: M6 }); } x6 !== void 0 && (x6.count = 3 * w6 - x6.start, A6.push(x6)), this.groups = A6; } fromGeometry(m6) { var x6, w6 = m6.faces, A6 = m6.vertices, M6 = m6.faceVertexUvs, R6 = M6[0] && 0 < M6[0].length, L6 = M6[1] && 0 < M6[1].length, T6 = m6.morphTargets, P6 = T6.length; if (0 < P6) { x6 = []; for (var _6 = 0; _6 < P6; _6++) x6[_6] = { name: T6[_6].name, data: [] }; this.morphTargets.position = x6; } var S6, E6 = m6.morphNormals, C6 = E6.length; if (0 < C6) { S6 = []; for (var I6 = 0; I6 < C6; I6++) S6[I6] = { name: E6[I6].name, data: [] }; this.morphTargets.normal = S6; } var b6 = m6.skinIndices, F6 = m6.skinWeights, D6 = b6.length === A6.length, N6 = F6.length === A6.length; 0 < A6.length && w6.length === 0 && console.error("THREE.DirectGeometry: Faceless geometries are not supported."); for (var B6, U6 = 0; U6 < w6.length; U6++) { B6 = w6[U6], this.vertices.push(A6[B6.a], A6[B6.b], A6[B6.c]); var G6 = B6.vertexNormals; if (G6.length === 3) this.normals.push(G6[0], G6[1], G6[2]); else { var Y = B6.normal; this.normals.push(Y, Y, Y); } var te = B6.vertexColors; if (te.length === 3) this.colors.push(te[0], te[1], te[2]); else { var ae = B6.color; this.colors.push(ae, ae, ae); } if (R6 === true) { var ie = M6[0][U6]; ie === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", U6), this.uvs.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs.push(ie[0], ie[1], ie[2]); } if (L6 === true) { var le = M6[1][U6]; le === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", U6), this.uvs2.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs2.push(le[0], le[1], le[2]); } for (var W6, $6 = 0; $6 < P6; $6++) W6 = T6[$6].vertices, x6[$6].data.push(W6[B6.a], W6[B6.b], W6[B6.c]); for (var j6, re = 0; re < C6; re++) j6 = E6[re].vertexNormals[U6], S6[re].data.push(j6.a, j6.b, j6.c); D6 && this.skinIndices.push(b6[B6.a], b6[B6.b], b6[B6.c]), N6 && this.skinWeights.push(F6[B6.a], F6[B6.b], F6[B6.c]); } return this.computeGroups(m6), this.verticesNeedUpdate = m6.verticesNeedUpdate, this.normalsNeedUpdate = m6.normalsNeedUpdate, this.colorsNeedUpdate = m6.colorsNeedUpdate, this.uvsNeedUpdate = m6.uvsNeedUpdate, this.groupsNeedUpdate = m6.groupsNeedUpdate, m6.boundingSphere !== null && (this.boundingSphere = m6.boundingSphere.clone()), m6.boundingBox !== null && (this.boundingBox = m6.boundingBox.clone()), this; } } class y6 { constructor(m6, x6, w6, A6, M6) { var R6 = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : 0; this.a = m6, this.b = x6, this.c = w6, this.normal = A6 && A6.isVector3 ? A6 : new l.Vector3(), this.vertexNormals = Array.isArray(A6) ? A6 : [], this.color = M6 && M6.isColor ? M6 : new l.Color(), this.vertexColors = Array.isArray(M6) ? M6 : [], this.materialIndex = R6; } clone() { return new this.constructor().copy(this); } copy(m6) { this.a = m6.a, this.b = m6.b, this.c = m6.c, this.normal.copy(m6.normal), this.color.copy(m6.color), this.materialIndex = m6.materialIndex; for (var x6 = 0, w6 = m6.vertexNormals.length; x6 < w6; x6++) this.vertexNormals[x6] = m6.vertexNormals[x6].clone(); for (var A6 = 0, M6 = m6.vertexColors.length; A6 < M6; A6++) this.vertexColors[A6] = m6.vertexColors[A6].clone(); return this; } } }, /* 7 */ /***/ (o) => { o.exports = n4; }, /* 8 */ /***/ (o) => { o.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="; }, /* 9 */ /***/ (o, a6) => { a6.augmentMorphColor = function() { return function(c) { c.vertexShader = c.vertexShader.replace("#include ", ["varying vec3 vColor;", "attribute vec3 morphColor0;", "attribute vec3 morphColor1;"].join(` `)), c.vertexShader = c.vertexShader.replace("#include ", ["vColor.xyz = color.xyz;", "#ifdef USE_MORPHTARGETS", "vColor = morphColor0 * morphTargetInfluences[ 0 ];", "vColor += morphColor1 * morphTargetInfluences[ 1 ];", "#endif"].join(` `)); }; }; }, /* 10 */ /***/ (o, a6, c) => { var l = c(4), d = c(5).createBufferGeometry, h6 = c(5).resolveURL, f6 = 0, g6 = function() { return "pr" + f6++; }, p = function() { this.isZincObject = true, this.geometry = void 0, this.morph = void 0, this.group = new l.Group(), this._lod = new (c(11)).LOD(this), this.groupName = void 0, this.timeEnabled = false, this.morphColour = false, this.inbuildTime = 0, this.mixer = void 0, this.animationGroup = void 0, this.duration = 6e3, this.clipAction = void 0, this.userData = {}, this.videoHandler = void 0, this.marker = void 0, this.markerNumber = void 0, this.markerUpdateRequired = true, this.closestVertexIndex = -1, this.boundingBoxUpdateRequired = true, this.cachedBoundingBox = new l.Box3(), this.anatomicalId = void 0, this.region = void 0, this.animationClip = void 0, this.markerMode = "inherited", this.uuid = g6(), this._v1 = new l.Vector3(), this._v2 = new l.Vector3(), this._b1 = new l.Box3(), this.center = new l.Vector3(), this.radius = 0, this.visible = true, this.drawRange = -1, this.origColour = void 0, this.origVertexColors = false, this.isPickable = true; }; p.prototype.setDuration = function(u6) { this.duration = u6, this.clipAction && this.clipAction.setDuration(this.duration); }, p.prototype.getDuration = function() { return this.duration; }, p.prototype.setRegion = function(u6) { this.region = u6; }, p.prototype.getRegion = function() { return this.region; }, p.prototype.getMorph = function() { var u6 = this._lod.getCurrentMorph(); return u6 || this.morph; }, p.prototype.getGroup = function() { return this.group; }, p.prototype.setMorph = function(u6) { this.morph = u6, this.group.add(this.morph); var y6 = this._lod.calculateDistance("far"); this._lod.addLevel(u6, y6), this._lod.setMaterial(u6.material); }, p.prototype.checkTransparentMesh = function() { }, p.prototype.setMesh = function(u6, y6, v6) { this.animationGroup = new l.AnimationObjectGroup(u6), this.mixer = new l.AnimationMixer(this.animationGroup); var m6 = u6.geometry; if (this.geometry = u6.geometry, this.clipAction = void 0, m6 && m6.morphAttributes) { var x6 = m6.morphAttributes.position; x6 || (x6 = m6.morphAttributes.color ? m6.morphAttributes.color : m6.morphAttributes.normal), x6 && (this.animationClip = l.AnimationClip.CreateClipsFromMorphTargetSequences(x6, 10, true), this.animationClip && this.animationClip[0] != null && (this.clipAction = this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration), this.clipAction.loop = l.loopOnce, this.clipAction.clampWhenFinished = true, this.clipAction.play())); } this.timeEnabled = y6, this.morphColour = v6, u6.userData = this, u6.matrixAutoUpdate = false, this.setMorph(u6), this.checkTransparentMesh(), this.timeEnabled ? this.setFrustumCulled(false) : this.morphColour && (m6.setAttribute("morphTarget0", m6.getAttribute("position")), m6.setAttribute("morphTarget1", m6.getAttribute("position"))), this.boundingBoxUpdateRequired = true; }, p.prototype.setIsPickable = function(u6) { this.isPickable !== u6 && (this.isPickable = u6, this.region && (this.region.pickableUpdateRequired = true)); }, p.prototype.setAnatomicalId = function(u6) { this.anatomicalId = u6; }, p.prototype.setName = function(u6) { this.groupName = u6, this._lod.setName(u6); }, p.prototype.getCurrentTime = function() { if (this.clipAction) { var u6 = this.clipAction.time / this.clipAction._clip.duration; return this.duration * u6; } return this.inbuildTime; }, p.prototype.setMorphTime = function(u6) { var y6 = false; if (this.clipAction) { var v6 = u6 / this.duration, m6 = this.clipAction._clip.duration, x6 = v6 * m6; x6 != this.clipAction.time && (this.clipAction.time = x6, y6 = true), y6 && this.isTimeVarying() && this.mixer.update(0); } else { var w6 = u6; w6 = u6 > this.duration ? this.duration : 0 > u6 ? 0 : u6, w6 != this.inbuildTime && (this.inbuildTime = w6, y6 = true); } y6 && (this.boundingBoxUpdateRequired = true, this._lod.updateMorphColorAttribute(true), this.timeEnabled && (this.markerUpdateRequired = true)); }, p.prototype.isTimeVarying = function() { return !!(this.timeEnabled || this.morphColour); }, p.prototype.getVisibility = function() { return this.visible; }, p.prototype.setVisibility = function(u6) { u6 !== this.visible && (this.visible = u6, this.group.visible = u6, this.region && (this.region.pickableUpdateRequired = true)); }, p.prototype.setAlpha = function(u6) { var y6 = this._lod._material, v6 = false; 1 > u6 && (v6 = true), y6.opacity = u6, y6.transparent = v6, this.checkTransparentMesh(); }, p.prototype.setFrustumCulled = function(u6) { this._lod.setFrustumCulled(u6); }, p.prototype.setVertexColors = function(u6) { this._lod.setVertexColors(u6); }, p.prototype.getColour = function() { return this._lod._material ? this._lod._material.color : void 0; }, p.prototype.setColour = function(u6) { this._lod.setColour(u6); }, p.prototype.setGreyScale = function(u6) { if (u6) { if (!this.origColour && this._lod._material) return this.origColour = this._lod._material.color, this.origVertexColors = this._lod._material.vertexColors, this._lod.setVertexColors(false), this._lod.setColour(new l.Color().setHex(12303291)), true; } else if (this.origColour) return this._lod.setColour(this.origColour), this._lod.setVertexColors(this.origVertexColors), this.origColour = void 0, true; return false; }, p.prototype.getColourHex = function() { return !this.morphColour && this._lod._material && this._lod._material.color ? this._lod._material.color.getHexString() : void 0; }, p.prototype.setColourHex = function(u6) { this._lod._material.color.setHex(u6), this._lod._secondaryMaterial && this._lod._secondaryMaterial.color.setHex(u6); }, p.prototype.setEmissiveRGB = function(u6) { this._lod._material && this._lod._material.emissive && this._lod._material.emissive.setRGB(...u6), this._lod._secondaryMaterial && this._lod._secondaryMaterial.emissive.setRGB(...u6); }, p.prototype.setMaterial = function(u6) { this._lod.setMaterial(u6); }, p.prototype.getClosestVertexIndex = function() { var u6 = -1, y6 = this.getMorph(); if (y6 && y6.geoemtry) { var v6 = y6.geometry.attributes.position; if (this._b1.setFromBufferAttribute(v6), this._b1.getCenter(this._v1), v6) for (var m6 = -1, x6 = 0, w6 = 0; w6 < v6.count; w6++) this._v2.fromArray(v6.array, 3 * w6), x6 = this._v2.distanceTo(this._v1), m6 == -1 ? m6 = x6 : m6 > x6 && (m6 = x6, u6 = w6); } return u6; }, p.prototype.getClosestVertex = function(u6) { var y6 = new l.Vector3(); this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()); var v6 = this.getMorph(); if (v6 && v6.geometry && 0 <= this.closestVertexIndex) { var m6 = v6.morphTargetInfluences, x6 = v6.geometry.morphAttributes; if (m6 && x6 && x6.position) { for (var w6 = false, A6 = 0; A6 < m6.length; A6++) 0 < m6[A6] && (w6 = true, this._v1.fromArray(x6.position[A6].array, 3 * this.closestVertexIndex), y6.add(this._v1.multiplyScalar(m6[A6]))); if (w6) return u6 ? y6.applyMatrix4(v6.matrixWorld) : y6; } else return y6.fromArray(v6.geometry.attributes.position.array, 3 * this.closestVertexIndex), u6 ? y6.applyMatrix4(v6.matrixWorld) : y6; } return this.getBoundingBox(), y6.copy(this.center), u6 ? y6.applyMatrix4(this.morph.matrixWorld) : y6; }, p.prototype.getBoundingBox = function() { if (this.visible) { var u6 = this._lod.getCurrentMorph(); if (u6 && u6.visible) return this.boundingBoxUpdateRequired && (c(5).getBoundingBox(u6, this.cachedBoundingBox, this._b1, this._v1, this._v2), this.cachedBoundingBox.getCenter(this.center), this.radius = this.center.distanceTo(this.cachedBoundingBox.max), this.boundingBoxUpdateRequired = false), this.cachedBoundingBox; } }, p.prototype.dispose = function() { this._lod.dispose(), this.animationGroup = void 0, this.mixer = void 0, this.morph = void 0, this.group = void 0, this.clipAction = void 0, this.groupName = void 0; }, p.prototype.markerIsRequired = function(u6) { return !!(this.visible && (this.markerMode === "on" || u6 && u6.displayMarkers && this.markerMode === "inherited")); }, p.prototype.updateMarker = function(u6, y6) { if (u6 == false && this.markerIsRequired(y6)) { var v6 = y6.ndcToBeUpdated; if (this.groupName) { if (this.marker || (this.marker = new (c(14)).Marker(this), this.markerUpdateRequired = true), this.markerUpdateRequired) { var m6 = this.getClosestVertex(false); m6 && (this.marker.setPosition(m6.x, m6.y, m6.z), this.markerUpdateRequired = false); } this.marker.isEnabled() || (y6.markersList && !(this.marker.uuid in y6.markersList) && (v6 = true, y6.markersList[this.marker.uuid] = this.marker), this.marker.enable(), this.group.add(this.marker.morph)), this.marker.setNumber(this.markerNumber), this.markerImgURL ? this.marker.loadUserSprite(this.markerImgURL) : this.marker.setDefaultSprite(), y6 && y6.camera && (v6 || y6.markerCluster.markerUpdateRequired) && (this.marker.updateNDC(y6.camera.cameraObject), y6.markerCluster.markerUpdateRequired = true); } } else this.marker && this.marker.isEnabled() && (this.marker.disable(), this.group.remove(this.marker.morph), y6.markersList && this.marker.uuid in y6.markersList && (y6.markerCluster.markerUpdateRequired = true, delete y6.markersList[this.marker.uuid])), this.markerUpdateRequired = true; }, p.prototype.processMarkerVisual = function(u6, y6) { this.marker && this.marker.isEnabled() && this.marker.updateVisual(u6, y6); }, p.prototype.initiateMorphColor = function() { this.morphColour == 1 && this._lod.updateMorphColorAttribute(false); }, p.prototype.setRenderOrder = function(u6) { this._lod.setRenderOrder(u6); }, p.prototype.getClosestVertexDOMElementCoords = function(u6) { if (u6 && u6.camera) { var y6 = true, v6 = this.getClosestVertex(true); return v6.project(u6.camera), v6.z = Math.min(Math.max(v6.z, 0), 1), (1 < v6.x || -1 > v6.x || 1 < v6.y || -1 > v6.y) && (y6 = false), u6.getZincCameraControls().getRelativeCoordsFromNDC(v6.x, v6.y, v6), { position: v6, inView: y6 }; } }, p.prototype.setMarkerMode = function(u6, y6) { u6 !== this.markerMode && (this.markerMode = u6 === "on" || u6 === "off" ? u6 : "inherited", this.region && (this.region.pickableUpdateRequired = true)), y6 && (this.markerNumber = y6.number, this.markerImgURL = y6.imgURL); }, p.prototype.render = function(u6, y6, v6, m6) { if (this.visible && !(this.timeEnabled && y6) && this._lod.update(v6, this.center), y6 == true) { if (this.clipAction && this.isTimeVarying()) this.mixer.update(u6); else { var x6 = this.inbuildTime + u6; x6 > this.duration && (x6 -= this.duration), this.inbuildTime = x6; } this.visible && u6 != 0 && (this.boundingBoxUpdateRequired = true, this.morphColour == 1 && this._lod.updateMorphColorAttribute(true)); } this.updateMarker(y6, m6); }, p.prototype.addLOD = function(u6, y6, v6, m6, x6) { this._lod.addLevelFromURL(u6, y6, v6, m6, x6); }, p.prototype.addVertices = function(u6) { var y6 = this.getMorph(), v6 = void 0; if (!y6) v6 = d(500, u6), this.drawRange = u6.length; else if (-1 < this.drawRange) { var m6 = y6.geometry.getAttribute("position"); u6.forEach((x6) => { m6.setXYZ(this.drawRange, x6[0], x6[1], x6[2]), ++this.drawRange; }), m6.needsUpdate = true, y6.geometry.setDrawRange(0, this.drawRange), y6.geometry.computeBoundingBox(), y6.geometry.computeBoundingSphere(), v6 = y6.geoemtry, this.boundingBoxUpdateRequired = true; } return v6; }, p.prototype.setPosition = function(u6, y6, v6) { var m6 = this.getGroup(); m6 && (m6.position.set(u6, y6, v6), m6.updateMatrix(), this.boundingBoxUpdateRequired = true); }, p.prototype.loadAdditionalSources = function(u6) { u6.load(h6(filename), meshloader(region, colour, opacity, localTimeEnabled, localMorphColour, void 0, void 0, void 0, void 0, finishCallback), this.onProgress(filename), this.onError(finishCallback)); }, p.prototype.setScaleAll = function(u6) { var y6 = this.getGroup(); y6 && (y6.scale.set(u6, u6, u6), y6.updateMatrix(), this.boundingBoxUpdateRequired = true); }, a6.ZincObject = p; }, /* 11 */ /***/ (o, a6, c) => { var l = c(4), d = c(5).updateMorphColorAttribute, h6 = c(5).toBufferGeometry, f6 = function(g6) { this.levels = [], this._currentLevel = 0, this._renderOrder = 1, this._material = void 0, this._secondaryMaterial = void 0, this._loader = void 0, this._parent = g6, this.addLevel = (u6, y6) => { if (u6) { var v6, m6 = Math.abs(y6); for (v6 = 0; v6 < this.levels.length && !(m6 < this.levels[v6].distance); v6++) ; this.levels.splice(v6, 0, { distance: m6, morph: u6, loaded: true, loading: false, url: "" }), u6.renderOrder = this._renderOrder; } }, this.levelLoaded = (u6, y6) => { if (u6) { for (var v6 = Math.abs(y6), m6 = 0; m6 < this.levels.length; m6++) if (v6 === this.levels[m6].distance) { this._parent.group.add(u6), this.levels[m6].morph = u6, this.levels[m6].loaded = true, this.levels[m6].loading = false; break; } this.checkTransparentMesh(); } }, this.addLevelFromURL = (u6, y6, v6, m6, x6) => { this._loader = u6; var w6, A6 = this.calculateDistance(y6); for (w6 = 0; w6 < this.levels.length && !(A6 < this.levels[w6].distance); w6++) ; this.levels.splice(w6, 0, { distance: A6, morph: void 0, loaded: false, loading: false, url: v6, index: m6 }), x6 && this.loadLevel(w6); }, this.loadLevel = (u6) => { var y6 = this.levels[u6]; return y6.morph || y6.loaded || y6.loading || (y6.loading = true, this._loader.load(y6.url, this.lodLoader(y6.distance), void 0, void 0, { index: y6.index })), y6.morph === void 0; }, this.calculateDistance = function(u6) { this._parent.getBoundingBox(); var y6 = this._parent.radius, v6 = 0; return u6 === "far" ? v6 = 4.5 * y6 : u6 === "medium" ? v6 = 2.5 * y6 : u6 == "close" && (v6 = 0), v6; }, this.containsLevels = () => !!(this.levels && 1 < this.levels.length), this.checkTransparentMesh = () => { var u6 = this.levels[this._currentLevel]; this._material && (this._material.transparent ? (!this._secondaryMaterial && (this._secondaryMaterial = this._material.clone(), this._secondaryMaterial.side = l.FrontSide), this._secondaryMaterial.opacity = this._material.opacity, this._secondaryMaterial.emissive && this._secondaryMaterial.emissive.copy(this._material.emissive), this._secondaryMaterial.needsUpdate = true, !u6.secondaryMesh && (u6.secondaryMesh = new l.Mesh(u6.morph.geometry, this._secondaryMaterial), u6.secondaryMesh.renderOrder = u6.morph.renderOrder + 1, u6.secondaryMesh.userData = u6.morph.userData, u6.secondaryMesh.name = u6.morph.name), this._material.side = l.BackSide, this._material.needsUpdate = true, !u6.secondaryMesh.parent && (u6.morph.add(u6.secondaryMesh), this._parent.animationGroup && this._parent.animationGroup.add(u6.secondaryMesh))) : (u6.secondaryMesh && (u6.morph.remove(u6.secondaryMesh), this._parent.animationGroup && (this._parent.animationGroup.uncache(u6.secondaryMesh), this._parent.animationGroup.remove(u6.secondaryMesh))), this._material.side = l.DoubleSide, this._material.needsUpdate = true)); }, this.dispose = () => { this.levels.forEach((u6) => { u6.morph && u6.morph.geometry && u6.morph.geometry.dispose(); }), this._material && this._material.dispose(), this._secondaryMaterial && this._secondaryMaterial.dispose(); }, this.getCurrentLevel = () => this._currentLevel, this.getCurrentMorph = () => { var u6 = this.levels[this._currentLevel]; return u6 && u6.morph ? u6.morph : this._parent.morph; }, this.lodLoader = function(u6) { return (y6) => { var v6 = this._material, m6 = { localTimeEnabled: this._parent.timeEnabled, localMorphColour: this._parent.morphColour }, x6 = h6(y6, m6), w6 = void 0; this._parent.isGeometry ? w6 = new l.Mesh(x6, v6) : this._parent.isLines && (w6 = new (c(12)).LineSegments(x6, v6)), w6.userData = this._parent, w6.renderOrder = this._renderOrder, y6.dispose(), this.levelLoaded(w6, u6); }; }, this.updateMorphColorAttribute = (u6) => { if (this._material && (this._material.vertexColors == l.VertexColors || this._material.vertexColors == true)) if (u6) { var y6 = this.getCurrentMorph(); d(y6.geometry, y6); } else this.levels.forEach((v6) => { v6.morph && v6.morph.geometry && d(v6.morph.geometry, v6.morph); }); }, this.setColour = (u6) => { this._material.color = u6, this._secondaryMaterial && (this._secondaryMaterial.color = u6), p(); }, this.setFrustumCulled = (u6) => { this.levels.forEach((y6) => { y6.morph && (y6.morph.frustumCulled = u6), y6.secondaryMesh && (y6.secondaryMesh.frustumCulled = u6); }); }, this.setMaterial = (u6) => { u6 && (!this._material || this._material.id !== u6.id) && (this._material = u6, this._secondaryMaterial && this._secondaryMaterial.dispose(), this._secondaryMaterial = u6.clone(), this._secondaryMaterial.side = l.FrontSide, this._secondaryMaterial.transparent = true, this.levels.forEach((y6) => { y6.morph && (y6.morph.material = this._material, y6.morph.geometry && (y6.morph.geometry.colorsNeedUpdate = true)), y6.secondaryMesh && (y6.secondaryMesh.material = this._secondaryMaterial); })); }, this.setName = (u6) => { this.levels.forEach((y6) => { y6.morph && (y6.morph.name = u6), y6.secondaryMesh && (y6.secondaryMesh.name = u6); }); }, this.setRenderOrder = (u6) => { this._renderOrder = u6, this.levels.forEach((y6) => { y6.morph && (y6.morph.renderOrder = u6), y6.secondaryMesh && (y6.secondaryMesh.renderOrder = u6); }); }, this.setVertexColors = (u6) => { this._material.vertexColors = u6, p(), this._secondaryMaterial && (this._secondaryMaterial.vertexColors = u6); }, this.update = (u6, y6) => { var v6 = this.levels; if (1 < v6.length) { var m6, x6, w6 = u6.cameraObject.position.distanceTo(y6), A6 = -1, M6 = -1; for (m6 = 0, x6 = v6.length; m6 < x6 && w6 >= v6[m6].distance; m6++) v6[m6].morph ? (-1 < A6 && v6[A6].morph && (v6[A6].morph.visible = false), A6 = m6, v6[m6].morph.visible = true, M6 = -1) : M6 = m6; for (-1 < M6 && this.loadLevel(M6); m6 < x6; m6++) v6[m6].morph && (-1 < A6 ? v6[m6].morph.visible = false : (v6[m6].morph.visible = true, A6 = m6)); this._currentLevel != A6 && (this._currentLevel = A6, this.checkTransparentMesh()); } }, this.toggleMarker = (u6, y6) => { this.levels.forEach((v6) => { v6.morph && (y6 ? v6.morph.add(u6) : v6.morph.remove(u6)); }); }; var p = () => { this.levels.forEach((u6) => { u6.morph && u6.morph.geometry && (u6.morph.geometry.colorsNeedUpdate = true); }); }; }; a6.LOD = f6; }, /* 12 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ LineSegments: () => ( /* binding */ g6 ) /* harmony export */ }); var l = c(13), d = c(4), h6 = new d.Vector3(), f6 = new d.Vector3(); class g6 extends l.Line { constructor(u6, y6) { super(u6, y6), this.type = "LineSegments"; } computeLineDistances() { var u6 = this.geometry; if (!u6.isBufferGeometry) u6.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (u6.index === null) { for (var y6 = u6.attributes.position, v6 = [], m6 = 0, x6 = y6.count; m6 < x6; m6 += 2) h6.fromBufferAttribute(y6, m6), f6.fromBufferAttribute(y6, m6 + 1), v6[m6] = m6 == 0 ? 0 : v6[m6 - 1], v6[m6 + 1] = v6[m6] + h6.distanceTo(f6); u6.setAttribute("lineDistance", new d.Float32BufferAttribute(v6, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } } g6.prototype.isLineSegments = true; }, /* 13 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ Line: () => ( /* binding */ x6 ) /* harmony export */ }); var l = c(4), d = new l.Vector3(), h6 = new l.Vector3(), f6 = new l.Matrix4(), g6 = new l.Ray(), p = new l.Sphere(), u6 = new l.Vector3(), y6 = new l.Vector3(), v6 = new l.Vector3(), m6 = new l.Vector3(); class x6 extends l.Object3D { constructor() { var M6 = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), R6 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.LineBasicMaterial(); super(), this.type = "Line", this.geometry = M6, this.material = R6, this.updateMorphTargets(); } copy(M6) { return super.copy(M6), this.material = M6.material, this.geometry = M6.geometry, this; } computeLineDistances() { var M6 = this.geometry; if (!M6.isBufferGeometry) M6.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (M6.index === null) { for (var R6 = M6.attributes.position, L6 = [0], T6 = 1, P6 = R6.count; T6 < P6; T6++) d.fromBufferAttribute(R6, T6 - 1), h6.fromBufferAttribute(R6, T6), L6[T6] = L6[T6 - 1], L6[T6] += d.distanceTo(h6); M6.setAttribute("lineDistance", new l.Float32BufferAttribute(L6, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } raycast(M6, R6) { var L6 = this.geometry, T6 = this.matrixWorld, P6 = M6.params.Line.threshold, _6 = L6.drawRange, S6 = L6.morphAttributes.position; if (L6.boundingSphere === null && L6.computeBoundingSphere(), p.copy(L6.boundingSphere), p.applyMatrix4(T6), p.radius += P6, M6.ray.intersectsSphere(p) !== false) { f6.copy(T6).invert(), g6.copy(M6.ray).applyMatrix4(f6); var E6 = P6 / ((this.scale.x + this.scale.y + this.scale.z) / 3), C6 = E6 * E6, I6 = new l.Vector3(), b6 = new l.Vector3(), F6 = new l.Vector3(), D6 = new l.Vector3(), N6 = this.isLineSegments ? 2 : 1; if (L6.isBufferGeometry) { var B6 = L6.index, U6 = L6.attributes, G6 = U6.position; if (B6 !== null) for (var Y = Math.max(0, _6.start), te = Math.min(B6.count, _6.start + _6.count), ae = Y; ae < te - 1; ae += N6) { var ie = B6.getX(ae), le = B6.getX(ae + 1); w6(I6, b6, this, G6, S6, ie, le); var W6 = g6.distanceSqToSegment(I6, b6, D6, F6); if (!(W6 > C6)) { D6.applyMatrix4(this.matrixWorld); var $6 = M6.ray.origin.distanceTo(D6); $6 < M6.near || $6 > M6.far || R6.push({ distance: $6, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: F6.clone().applyMatrix4(this.matrixWorld), index: ae, face: null, faceIndex: null, object: this }); } } else for (var j6 = Math.max(0, _6.start), re = Math.min(G6.count, _6.start + _6.count), k6 = j6; k6 < re - 1; k6 += N6) { w6(I6, b6, this, G6, S6, k6, k6 + 1); var H6 = g6.distanceSqToSegment(I6, b6, D6, F6); if (!(H6 > C6)) { D6.applyMatrix4(this.matrixWorld); var K = M6.ray.origin.distanceTo(D6); K < M6.near || K > M6.far || R6.push({ distance: K, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: F6.clone().applyMatrix4(this.matrixWorld), index: k6, face: null, faceIndex: null, object: this }); } } } else L6.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var M6 = this.geometry; if (M6.isBufferGeometry) { var R6 = M6.morphAttributes, L6 = Object.keys(R6); if (0 < L6.length) { var T6 = R6[L6[0]]; if (T6 !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var P6, _6 = 0, S6 = T6.length; _6 < S6; _6++) P6 = T6[_6].name || _6 + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[P6] = _6; } } } else { var E6 = M6.morphTargets; E6 !== void 0 && 0 < E6.length && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } function w6(A6, M6, R6, L6, T6, P6, _6) { A6.fromBufferAttribute(L6, P6), M6.fromBufferAttribute(L6, _6); var S6 = R6.morphTargetInfluences; if (R6.material.morphTargets && T6 && S6) { u6.set(0, 0, 0), y6.set(0, 0, 0); for (var E6 = 0, C6 = T6.length; E6 < C6; E6++) { var I6 = S6[E6], b6 = T6[E6]; I6 !== 0 && (v6.fromBufferAttribute(b6, P6), m6.fromBufferAttribute(b6, _6), u6.addScaledVector(v6.sub(A6), I6), y6.addScaledVector(m6.sub(M6), I6)); } A6.add(u6), M6.add(y6); } } x6.prototype.isLine = true; }, /* 14 */ /***/ (o, a6, c) => { var l = c(4), d = new Image(128, 128); d.src = c(15); var h6 = new l.Texture(); h6.image = d, h6.needsUpdate = true; var f6 = [0.02, 0.03, 1], g6 = new l.SpriteMaterial({ map: h6, alphaTest: 0.5, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false }), p = c(5).createNewSpriteText, u6 = function(y6) { c(10).ZincObject.call(this), this.texture = h6; var v6 = void 0, m6 = void 0, x6 = void 0, w6 = void 0, A6 = void 0, M6 = true; this.morph = new l.Group(), this.group = this.morph, this.parent = y6, this.isMarker = true; var R6 = false; this.ndc = new l.Vector3(); var L6 = void 0, T6 = void 0, P6 = () => { v6 = new l.Sprite(g6), v6.center.set(0.5, 0), this.morph.add(v6), this.morph.position.set(0, 0, 0), this.morph.renderOrder = 1e4, v6.scale.set(f6[0], f6[1], f6[2]), v6.userData = this; }; this.updateVisual = (_6, S6) => { var E6 = 1, C6 = 0; _6 !== S6 && (C6 = 1 - (this.ndc.z - _6) / (S6 - _6), E6 = 0.6 + 0.4 * C6), this.setSpriteSize(E6); }, this.updateNDC = (_6) => (this.ndc.copy(this.morph.position), this.ndc.project(_6), this.ndc.z = Math.min(Math.max(this.ndc.z, 0), 1), this.ndc), this.setPosition = (_6, S6, E6) => { this.morph.position.set(_6, S6, E6); }, this.setSpriteSize = (_6) => { v6.scale.set(0.015, 0.02, 1), v6.scale.multiplyScalar(_6); }, this.setUserSprite = () => { w6 && (this.morph.add(w6), M6 && (this.morph.remove(v6), T6 && this.morph.remove(T6), M6 = false)); }, this.setImageForUserSprite = (_6, S6) => { w6 && (this.morph.remove(w6), w6 = void 0), m6 && m6.dispose(), x6 && x6.dispose(), m6 = new l.Texture(), m6.image = _6, m6.needsUpdate = true, x6 = new l.SpriteMaterial({ map: m6, alphaTest: 0.5, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false }), S6 || (S6 = [0.05, 0.05, 1]), w6 = new l.Sprite(x6), w6.center.set(0.5, 0), w6.scale.set(S6[0], S6[1], S6[2]), w6.userData = this, this.setUserSprite(); }, this.setDefaultSprite = () => { M6 || (M6 = true, this.morph.add(v6), w6 && this.morph.remove(w6), T6 && this.morph.add(T6)); }, this.loadUserSprite = (_6, S6) => { if (_6) if (_6 !== A6) { A6 = _6; var E6 = new Image(128, 128); E6.crossOrigin = "anonymous", E6.onload = () => { this.setImageForUserSprite(E6, S6); }, E6.src = _6; } else this.setUserSprite(); }, this.dispose = () => { this.morph && this.morph.clear(), v6 && (v6.clear(), v6 = void 0), T6 && (T6.material.map.dispose(), T6.material.dispose(), T6 = void 0); }, this.isEnabled = () => R6, this.setNumber = (_6) => { (!_6 || L6 != _6) && T6 && (this.morph.remove(T6), T6.material.map.dispose(), T6.material.dispose(), T6 = void 0), !T6 && _6 && (T6 = p(_6, 0.012, "black", "Asap", 120, 700), this.morph.add(T6)), L6 = _6; }, this.getNumber = () => L6 || 1, this.setVisibility = function(_6) { _6 !== this.visible && (this.visible = _6, this.group.visible = _6, this.parent.region && (this.parent.region.pickableUpdateRequired = true)); }, this.enable = () => { R6 = true, this.morph.visible = true, this.visible = true; }, this.disable = () => { R6 = false, this.morph.visible = false, this.visible = false; }, P6(); }; u6.prototype = Object.create(c(10).ZincObject.prototype), a6.Marker = u6; }, /* 15 */ /***/ (o) => { o.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="; }, /* 16 */ /***/ (o, a6, c) => { var l = c(4), d = function(h6, f6, g6, p) { c(10).ZincObject.call(this); var u6; f6 && (u6 = f6.clone(), u6.vertexColors = l.FaceColors), this.id = g6; var y6 = void 0, v6 = void 0; this.isGlyph = true; var m6 = [0, 0, 0]; this.fromMesh = (x6) => !!(x6 && x6.isMesh) && (this.morph = x6.clone(), this.morph.userData = this, this.group.add(this.morph), true), h6 && u6 && this.fromMesh(new l.Mesh(h6, u6)), this.getGlyphset = function() { return p; }, this.setLabel = (x6) => { x6 && (typeof x6 == "string" || x6 instanceof String) && (v6 = x6, this.morph && (this.morph.name = x6)); }, this.showLabel = (x6) => { y6 && (m6 = y6.getPosition(), this.group.remove(y6.getSprite()), y6.dispose(), y6 = void 0), v6 && (typeof v6 == "string" || v6 instanceof String) && (y6 = new (c(17)).Label(v6, x6), y6.setPosition(m6[0], m6[1], m6[2]), this.group.add(y6.getSprite())); }, this.hideLabel = () => { y6 && (m6 = y6.getPosition(), this.group.remove(y6.getSprite()), y6.dispose(), y6 = void 0); }, this.getLabel = () => v6, this.getMesh = () => this.morph, this.setTransformation = (x6, w6, A6, M6) => { this.morph && (this.morph.matrix.elements[0] = w6[0], this.morph.matrix.elements[1] = w6[1], this.morph.matrix.elements[2] = w6[2], this.morph.matrix.elements[3] = 0, this.morph.matrix.elements[4] = A6[0], this.morph.matrix.elements[5] = A6[1], this.morph.matrix.elements[6] = A6[2], this.morph.matrix.elements[7] = 0, this.morph.matrix.elements[8] = M6[0], this.morph.matrix.elements[9] = M6[1], this.morph.matrix.elements[10] = M6[2], this.morph.matrix.elements[11] = 0, this.morph.matrix.elements[12] = x6[0], this.morph.matrix.elements[13] = x6[1], this.morph.matrix.elements[14] = x6[2], this.morph.matrix.elements[15] = 1, this.morph.matrixAutoUpdate = false), m6 = [...x6], y6 && y6.setPosition(x6[0], x6[1], x6[2]); }, this.setColour = (x6) => { y6 && y6.setColour(x6), this.secondaryMesh && this.secondaryMesh.material && (this.secondaryMesh.material.color = colour), this.geometry && (this.geometry.colorsNeedUpdate = true); }, this.dispose = () => { this.material && this.material.dispose(), this.morph = void 0; }; }; d.prototype = Object.create(c(10).ZincObject.prototype), a6.Glyph = d; }, /* 17 */ /***/ (o, a6, c) => { var l = c(7).default; a6.Label = function(d, h6) { var f6 = d, g6 = void 0; g6 = h6 ? new l(f6, 0.015, h6.getStyle()) : new l(f6, 0.015), g6.fontFace = "Asap", g6.fontWeight = 700, g6.material.map.generateMipmaps = false, g6.material.sizeAttenuation = false, g6.center.x = -0.05, g6.center.y = 0, this.getPosition = () => g6 ? [g6.position.x, g6.position.y, g6.position.z] : [0, 0, 0], this.setPosition = (p, u6, y6) => { g6 && g6.position.set(p, u6, y6); }, this.setColour = (p) => { g6.color = p.getStyle(); }, this.setScale = (p) => { g6 && 0 < p && g6.scale.set(p, p, 1); }, this.dispose = () => { }, this.getSprite = () => g6, this.getString = () => f6; }; }, /* 18 */ /***/ (o, a6, c) => { var l = c(4), d = c(19).JSONLoader, h6 = function() { c(10).ZincObject.call(this); var f6 = [], g6 = void 0, p = void 0, u6 = void 0, y6 = void 0, v6 = void 0, m6 = void 0, x6 = void 0, w6 = 0, A6 = 0, M6 = [0, 0, 0], R6 = [0, 0, 0], L6 = [0, 0, 0], T6 = "NONE"; this.ready = false; var P6 = false, _6 = false; this.isGlyphset = true; var S6 = new l.Matrix4(), E6 = new l.Color(), C6 = new l.Color(), I6 = new l.Box3(), b6 = new l.Box3(), F6 = new l.Box3(), D6 = [], N6 = [], B6 = [], U6 = [], G6 = [], Y = [], te = []; this.globalScale = 1; for (var ae = 0; 8 > ae; ae++) new l.Vector3(); this.load = (k6, H6, K, ce, se) => { g6 = k6.axis1, p = k6.axis2, u6 = k6.axis3, y6 = k6.positions, v6 = k6.scale, m6 = k6.colors, x6 = k6.label, P6 = k6.metadata.MorphColours, _6 = k6.metadata.MorphVertices, w6 = k6.metadata.number_of_time_steps, T6 = k6.metadata.repeat_mode, A6 = k6.metadata.number_of_vertices, T6 == "AXES_2D" || T6 == "MIRROR" ? A6 *= 2 : T6 == "AXES_3D" && (A6 *= 3), M6 = k6.metadata.base_size, R6 = k6.metadata.offset, L6 = k6.metadata.scale_factors; var V6 = new d(); this.geometry = new l.BufferGeometry(); var O6 = new l.InstancedMesh(this.geometry, void 0, A6); if (this.setMorph(O6), ce) { var Z6 = V6.parse(H6); re(K, se)(Z6.geometry, Z6.materials), Z6.geometry.dispose(); } else V6.crossOrigin = "Anonymous", V6.load(H6, re(K, se)); }; var ie = (k6, H6, K, ce, se, V6) => { if (T6 == "NONE" || T6 == "MIRROR") { for (var O6, Z6 = [0, 0, 0], X = [0, 0, 0], ee = [0, 0, 0], fe = [0, 0, 0], be = [0, 0, 0], Ae = [0, 0, 0], he = [0, 0, 0], xe = [0, 0, 0], ne = [0, 0, 0], me = 0; 3 > me; me++) O6 = 0 > se[me] ? -1 : 1, Z6[me] = (O6 * M6[me] + se[me] * L6[me]) * this.globalScale; for (var me = 0; 3 > me; me++) X[me] = H6[me] * Z6[0], ee[me] = K[me] * Z6[1], fe[me] = ce[me] * Z6[2], be[me] = k6[me] + R6[0] * X[me] + R6[1] * ee[me] + R6[2] * fe[me], T6 == "MIRROR" && (Ae[me] = -X[me], he[me] = -ee[me], xe[me] = -fe[me], ne[me] = be[me], 0 > se[0] && (be[me] -= X[me], ne[me] -= Ae[me])); 0 > fe[0] * (X[1] * ee[2] - X[2] * ee[1]) + fe[1] * (X[2] * ee[0] - X[0] * ee[2]) + fe[2] * (X[0] * ee[1] - X[1] * ee[0]) && (fe[0] = -fe[0], fe[1] = -fe[1], fe[2] = -fe[2]), V6[0] = [be, X, ee, fe], T6 == "MIRROR" && (0 > xe[0] * (Ae[1] * he[2] - Ae[2] * he[1]) + xe[1] * (Ae[2] * he[0] - Ae[0] * he[2]) + xe[2] * (Ae[0] * he[1] - Ae[1] * he[0]) && (xe[0] = -xe[0], xe[1] = -xe[1], xe[2] = -xe[2]), V6[1] = [ne, Ae, he, xe]); } else if (T6 == "AXES_2D" || T6 == "AXES_3D") { for (var O6, Me = [0, 0, 0], De = [0, 0, 0], me = 0; 3 > me; me++) O6 = 0 > se[me] ? -1 : 1, Me[me] = (O6 * M6[0] + se[me] * L6[0]) * this.globalScale; for (var me = 0; 3 > me; me++) De[me] = k6[me] + R6[0] * Me[0] * H6[me] + R6[1] * Me[1] * K[me] + R6[2] * Me[2] * ce[me]; for (var Ie = glyph_repeat_mode == "AXES_2D" ? 2 : 3, $e = 0; $e < Ie; $e++) { var lt = void 0, qe = void 0, Mt = se[$e], Be = [0, 0, 0], it = [0, 0, 0], tt = [0, 0, 0]; $e == 0 ? (lt = H6, qe = K) : $e == 1 ? (lt = K, qe = glyph_repeat_mode == "AXES_2D" ? H6 : ce) : (lt = ce, qe = H6); var qt = (M6[0] + Mt * L6[0]) * this.globalScale; Be[0] = lt[0] * qt, Be[1] = lt[1] * qt, Be[2] = lt[2] * qt, tt[0] = Be[1] * qe[2] - qe[1] * Be[2], tt[1] = Be[2] * qe[0] - qe[2] * Be[0], tt[2] = Be[0] * qe[1] - Be[1] * qe[0]; var Qt = Math.sqrt(tt[0] * tt[0] + tt[1] * tt[1] + tt[2] * tt[2]); if (0 < Qt) { var Pt = (M6[2] + Mt * L6[2]) * this.globalScale / Qt; T6 == "AXES_2D" && 0 < $e && (Pt *= -1), tt[0] *= Pt, tt[1] *= Pt, tt[2] *= Pt; } if (it[0] = tt[1] * Be[2] - Be[1] * tt[2], it[1] = tt[2] * Be[0] - Be[2] * tt[0], it[2] = tt[0] * Be[1] - tt[1] * Be[0], Qt = Math.sqrt(it[0] * it[0] + it[1] * it[1] + it[2] * it[2]), 0 < Qt) { var Nt = (M6[1] + Mt * L6[1]) * this.globalScale / Qt; it[0] *= Nt, it[1] *= Nt, it[2] *= Nt; } V6[$e] = [De, Be, it, tt]; } } return V6; }, le = (k6, H6, K, ce, se) => { var V6 = 1; T6 == "AXES_2D" || T6 == "MIRROR" ? V6 = 2 : T6 == "AXES_3D" && (V6 = 3); var O6 = k6.length / 3, Z6 = 0; te.length = V6; for (var X = 0; X < O6; X++) { var ee = 3 * X, fe = [k6[ee], k6[ee + 1], k6[ee + 2]], be = [H6[ee], H6[ee + 1], H6[ee + 2]], Ae = [K[ee], K[ee + 1], K[ee + 2]], he = [ce[ee], ce[ee + 1], ce[ee + 2]], xe = [se[ee], se[ee + 1], se[ee + 2]], ne = ie(fe, be, Ae, he, xe, te); if (ne.length == V6) for (var me = 0; me < V6; me++) { S6.elements[0] = ne[me][1][0], S6.elements[1] = ne[me][1][1], S6.elements[2] = ne[me][1][2], S6.elements[3] = 0, S6.elements[4] = ne[me][2][0], S6.elements[5] = ne[me][2][1], S6.elements[6] = ne[me][2][2], S6.elements[7] = 0, S6.elements[8] = ne[me][3][0], S6.elements[9] = ne[me][3][1], S6.elements[10] = ne[me][3][2], S6.elements[11] = 0, S6.elements[12] = ne[me][0][0], S6.elements[13] = ne[me][0][1], S6.elements[14] = ne[me][0][2], S6.elements[15] = 1, this.morph.setMatrixAt(Z6, S6); var Me = f6[Z6]; Me && Me.setTransformation(ne[me][0], ne[me][1], ne[me][2], ne[me][3]), Z6++; } } this.morph.instanceMatrix.needsUpdate = true; }, W6 = (k6) => { var H6 = 1; T6 == "AXES_2D" || T6 == "MIRROR" ? H6 = 2 : T6 == "AXES_3D" && (H6 = 3); for (var K, ce = k6.length, se = 0, V6 = 0; V6 < ce; V6++) { K = k6[V6]; for (var O6 = 0; O6 < H6; O6++) { E6.setHex(K), this.morph.setColorAt(se, E6); var Z6 = f6[se]; Z6 && Z6.setColour(E6), se++; } } this.morph.instanceColor.needsUpdate = true; }, $6 = () => { var k6 = D6, H6 = N6, K = B6, ce = U6, se = G6, V6 = Y, O6 = this.inbuildTime / this.duration * (w6 - 1), Z6 = Math.floor(O6), X = 1 - (O6 - Z6), ee = Math.ceil(O6); if (_6) { var fe = y6[Z6.toString()], be = y6[ee.toString()], Ae = g6[Z6.toString()], he = g6[ee.toString()], xe = p[Z6.toString()], ne = p[ee.toString()], me = u6[Z6.toString()], Me = u6[ee.toString()], De = v6[Z6.toString()], Ie = v6[ee.toString()]; D6.length = fe.length, N6.length = fe.length, B6.length = fe.length, U6.length = fe.length, G6.length = fe.length; for (var $e = 0; $e < fe.length; $e++) k6[$e] = X * fe[$e] + (1 - X) * be[$e], H6[$e] = X * Ae[$e] + (1 - X) * he[$e], K[$e] = X * xe[$e] + (1 - X) * ne[$e], ce[$e] = X * me[$e] + (1 - X) * Me[$e], se[$e] = X * De[$e] + (1 - X) * Ie[$e]; } else k6 = y6[0], H6 = g6[0], K = p[0], ce = u6[0], se = v6[0]; if (le(k6, H6, K, ce, se), this.boundingBoxUpdateRequired = true, m6 != null) { if (P6) { var lt = m6[Z6.toString()], qe = m6[ee.toString()]; V6.length = lt.length; for (var Mt = 0; Mt < lt.length; Mt++) E6.setHex(lt[Mt]), C6.setHex(qe[Mt]), E6.setRGB(E6.r * X + C6.r * (1 - X), E6.g * X + C6.g * (1 - X), E6.b * X + C6.b * (1 - X)), V6[Mt] = E6.getHex(); } else V6 = m6[0]; W6(V6); } }; this.showLabel = () => { for (var k6 = 0; k6 < f6.length; k6++) f6[k6].showLabel(this.morph.material ? this.morph.material.color : void 0); }, this.hideLabel = () => { for (var k6 = 0; k6 < f6.length; k6++) f6[k6].hideLabel(); }; var j6 = (k6) => { for (var H6 = 0; H6 < A6; H6++) { var K = new (c(16)).Glyph(void 0, void 0, H6, this), ce = x6 ? x6[H6] : void 0; ce = ce || this.groupName, ce && K.setLabel(ce), 0 < w6 && K.setFrustumCulled(false), f6[H6] = K, this.morph.add(K.getGroup()); } k6 && this.showLabel(), le(y6[0], g6[0], p[0], u6[0], v6[0]), m6 != null && W6(m6[0]), this.ready = true, this.boundingBoxUpdateRequired = true; }; this.addCustomGlyph = (k6) => { k6.isGlyph && f6.push(k6), this.ready = true, this.boundingBoxUpdateRequired = true; }, this.addMeshAsGlyph = (k6, H6) => { if (k6.isMesh) { var K = new (c(16)).Glyph(void 0, void 0, H6, this); return K.fromMesh(k6), f6.push(K), this.morph.add(K.getGroup()), this.ready = true, this.boundingBoxUpdateRequired = true, K; } }, this.forEachGlyph = (k6) => { for (var H6 = 0; H6 < f6.length; H6++) k6(f6[H6]); }; var re = (k6, H6) => (K, ce) => { var se = K.toBufferGeometry(); this.geometry.copy(se), this.geometry.computeBoundingSphere(), this.geometry.computeBoundingBox(), se.dispose(), ce && ce[0] && (this.morph.material = ce[0]), j6(H6), this.morph.name = this.groupName, this.morph.userData = this, this.setMorph(this.morph), K.dispose(), k6 != null && typeof k6 == "function" && k6(this); }; this.getClosestVertexIndex = function() { var k6 = -1; if (this.morph && this.ready) { this.getBoundingBox().getCenter(this._v1); for (var H6, K = y6[0], ce = K.length / 3, se = -1, V6 = 0, O6 = 0; O6 < ce; O6++) H6 = 3 * O6, this._v2.set(K[H6], K[H6 + 1], K[H6 + 2]), V6 = this._v1.distanceTo(this._v2), (se == -1 || se > V6) && (se = V6, k6 = O6); } return k6; }, this.getClosestVertex = function() { if (this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()), 0 <= this.closestVertexIndex && this.morph) { var k6 = new l.Vector3(); return this.morph.getMatrixAt(this.closestVertexIndex, S6), k6.setFromMatrixPosition(S6), k6; } }, this.getBoundingBox = () => { if (this.morph && this.ready && this.morph.visible) { if (this.boundingBoxUpdateRequired) { I6.setFromBufferAttribute(this.morph.geometry.attributes.position); for (var k6 = 0; k6 < A6; k6++) this.morph.getMatrixAt(k6, S6), b6.copy(I6).applyMatrix4(S6), k6 == 0 ? F6.copy(b6) : F6.union(b6); if (F6) this.cachedBoundingBox.copy(F6), this.morph.updateWorldMatrix(true, true), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = false; else return; } return this.cachedBoundingBox; } }, this.setMorphTime = (k6) => { this.inbuildTime = k6 > this.duration ? this.duration : 0 > k6 ? 0 : k6, (P6 || _6) && ($6(), _6 && (this.markerUpdateRequired = true)); }, this.isTimeVarying = () => !!((this.ready === false || 0 < w6) && (P6 || _6)), this.getCurrentTime = () => this.inbuildTime, this.setScaleAll = function(k6) { this.globalScale = k6, $6(); }, this.dispose = () => { for (var k6 = f6.length - 1; 0 <= k6; k6--) f6[k6].dispose(); this.geometry && this.geometry.dispose(), this.morph && this.morph.material.dispose(), g6 = void 0, p = void 0, u6 = void 0, y6 = void 0, v6 = void 0, m6 = void 0, this.ready = false, this.groupName = void 0; }, this.render = (k6, H6, K) => { if (H6 == true) { var ce = this.inbuildTime + k6; ce > this.duration && (ce -= this.duration), this.inbuildTime = ce, (P6 || _6) && $6(); } this.updateMarker(H6, K); }; }; h6.prototype = Object.create(c(10).ZincObject.prototype), a6.Glyphset = h6; }, /* 19 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ JSONLoader: () => ( /* binding */ M6 ) /* harmony export */ }); var l = c(4), d = c(20).Loader, h6 = l.LoaderUtils, f6 = l.AnimationClip, g6 = l.Vector3, p = l.Vector4, u6 = l.Color, y6 = l.Vector2, v6 = c(6).Face3, m6 = c(6).Geometry, x6 = l.FileLoader, w6 = l.DefaultLoadingManager, A6 = c(21).VideoHandler; function M6(R6) { typeof R6 == "boolean" && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."), R6 = void 0), this.manager = R6 === void 0 ? w6 : R6, this.withCredentials = false, this.paramsString = ""; } Object.assign(M6.prototype, { load: function(L6, T6, P6, _6) { var S6 = this, E6 = this.texturePath && typeof this.texturePath == "string" ? this.texturePath : h6.extractUrlBase(L6), C6 = new x6(this.manager); L6.split("?"), this.paramsString = L6.length === 2 ? paramsStrings[1] : "", C6.setWithCredentials(this.withCredentials), C6.load(L6, function(I6) { var b6; try { b6 = JSON.parse(I6); } catch { if (console.error("The loader has encountered an error while parsing the content of a resource."), _6) return void _6({ responseURL: L6 }); } var F6 = b6.metadata; if (F6 !== void 0) { var D6 = F6.type; if (D6 !== void 0 && D6.toLowerCase() === "object") return void console.error("THREE.JSONLoader: " + L6 + " should be loaded with THREE.ObjectLoader instead."); } if (S6 && S6.parse) try { var N6 = S6.parse(b6, E6); T6(N6.geometry, N6.materials); } catch (B6) { if (console.error("The loader has encountered aon loading the geometry"), console.error(B6), _6) return void _6({ responseURL: L6 }); } }, P6, _6); }, setTexturePath: function(L6) { this.texturePath = L6; }, parse: /* @__PURE__ */ function() { function R6(_6, S6) { function E6(me, Me) { return me & 1 << Me; } var C6, I6, b6, F6, D6, N6, B6, U6, G6, Y, te, ae, ie, le, W6, $6, j6, re, k6, H6, K, ce, se, V6, O6, Z6, X, ee = _6.faces, fe = _6.vertices, be = _6.normals, Ae = _6.colors, he = _6.scale, xe = 0; if (_6.uvs !== void 0) { for (C6 = 0; C6 < _6.uvs.length; C6++) _6.uvs[C6].length && xe++; for (C6 = 0; C6 < xe; C6++) S6.faceVertexUvs[C6] = []; } for (F6 = 0, D6 = fe.length; F6 < D6; ) re = new g6(), re.x = fe[F6++] * he, re.y = fe[F6++] * he, re.z = fe[F6++] * he, S6.vertices.push(re); if (F6 = 0, D6 = ee.length, _6.uvs) for (C6 = 0; C6 < _6.uvs.length; C6++) { S6.uvs[C6] = []; for (var ne = 0; ne < _6.uvs[C6].length; ne++) S6.uvs[C6][ne] = _6.uvs[C6][ne]; } if (be) for (C6 = 0; C6 < be.length; C6++) S6.normals[C6] = be[C6]; if (Ae) for (C6 = 0; C6 < Ae.length; C6++) S6.colors[C6] = Ae[C6]; for (; F6 < D6; ) if (Y = ee[F6++], te = E6(Y, 0), ae = E6(Y, 1), ie = E6(Y, 3), le = E6(Y, 4), W6 = E6(Y, 5), $6 = E6(Y, 6), j6 = E6(Y, 7), te) { if (H6 = new v6(), H6.a = ee[F6], H6.b = ee[F6 + 1], H6.c = ee[F6 + 3], K = new v6(), K.a = ee[F6 + 1], K.b = ee[F6 + 2], K.c = ee[F6 + 3], F6 += 4, ae && (G6 = ee[F6++], H6.materialIndex = G6, K.materialIndex = G6), b6 = S6.faces.length, ie) for (C6 = 0; C6 < xe; C6++) for (V6 = _6.uvs[C6], S6.faceVertexUvs[C6][b6] = [], S6.faceVertexUvs[C6][b6 + 1] = [], I6 = 0; 4 > I6; I6++) U6 = ee[F6++], Z6 = V6[2 * U6], X = V6[2 * U6 + 1], O6 = new y6(Z6, X), I6 !== 2 && S6.faceVertexUvs[C6][b6].push(O6), I6 !== 0 && S6.faceVertexUvs[C6][b6 + 1].push(O6); if (le && (B6 = 3 * ee[F6++], H6.normal.set(be[B6++], be[B6++], be[B6]), K.normal.copy(H6.normal)), W6) for (C6 = 0; 4 > C6; C6++) B6 = 3 * ee[F6++], se = new g6(be[B6++], be[B6++], be[B6]), C6 !== 2 && H6.vertexNormals.push(se), C6 !== 0 && K.vertexNormals.push(se); if ($6 && (N6 = ee[F6++], ce = Ae[N6], H6.color.setHex(ce), K.color.setHex(ce)), j6) for (C6 = 0; 4 > C6; C6++) N6 = ee[F6++], ce = Ae[N6], C6 !== 2 && H6.vertexColors.push(new u6(ce)), C6 !== 0 && K.vertexColors.push(new u6(ce)); S6.faces.push(H6), S6.faces.push(K); } else { if (k6 = new v6(), k6.a = ee[F6++], k6.b = ee[F6++], k6.c = ee[F6++], ae && (G6 = ee[F6++], k6.materialIndex = G6), b6 = S6.faces.length, ie) for (C6 = 0; C6 < xe; C6++) for (V6 = _6.uvs[C6], S6.faceVertexUvs[C6][b6] = [], I6 = 0; 3 > I6; I6++) U6 = ee[F6++], Z6 = V6[2 * U6], X = V6[2 * U6 + 1], O6 = new y6(Z6, X), S6.faceVertexUvs[C6][b6].push(O6); if (le && (B6 = 3 * ee[F6++], k6.normal.set(be[B6++], be[B6++], be[B6])), W6) for (C6 = 0; 3 > C6; C6++) B6 = 3 * ee[F6++], se = new g6(be[B6++], be[B6++], be[B6]), k6.vertexNormals.push(se); if ($6 && (N6 = ee[F6++], k6.color.setHex(Ae[N6])), j6) for (C6 = 0; 3 > C6; C6++) N6 = ee[F6++], k6.vertexColors.push(new u6(Ae[N6])); S6.faces.push(k6); } } function L6(_6, S6) { var E6 = _6.influencesPerVertex === void 0 ? 2 : _6.influencesPerVertex; if (_6.skinWeights) for (var C6 = 0, I6 = _6.skinWeights.length; C6 < I6; C6 += E6) { var b6 = _6.skinWeights[C6], F6 = 1 < E6 ? _6.skinWeights[C6 + 1] : 0, D6 = 2 < E6 ? _6.skinWeights[C6 + 2] : 0, N6 = 3 < E6 ? _6.skinWeights[C6 + 3] : 0; S6.skinWeights.push(new p(b6, F6, D6, N6)); } if (_6.skinIndices) for (var C6 = 0, I6 = _6.skinIndices.length; C6 < I6; C6 += E6) { var B6 = _6.skinIndices[C6], U6 = 1 < E6 ? _6.skinIndices[C6 + 1] : 0, G6 = 2 < E6 ? _6.skinIndices[C6 + 2] : 0, Y = 3 < E6 ? _6.skinIndices[C6 + 3] : 0; S6.skinIndices.push(new p(B6, U6, G6, Y)); } S6.bones = _6.bones, S6.bones && 0 < S6.bones.length && (S6.skinWeights.length !== S6.skinIndices.length || S6.skinIndices.length !== S6.vertices.length) && console.warn("When skinning, number of vertices (" + S6.vertices.length + "), skinIndices (" + S6.skinIndices.length + "), and skinWeights (" + S6.skinWeights.length + ") should match."); } function T6(_6, S6) { var E6 = _6.scale; if (_6.morphTargets !== void 0) for (var C6 = 0, I6 = _6.morphTargets.length; C6 < I6; C6++) { S6.morphTargets[C6] = {}, S6.morphTargets[C6].name = _6.morphTargets[C6].name, S6.morphTargets[C6].vertices = []; for (var b6, F6 = S6.morphTargets[C6].vertices, D6 = _6.morphTargets[C6].vertices, N6 = 0, B6 = D6.length; N6 < B6; N6 += 3) b6 = new g6(), b6.x = D6[N6] * E6, b6.y = D6[N6 + 1] * E6, b6.z = D6[N6 + 2] * E6, F6.push(b6); } if (_6.morphNormals !== void 0) { for (var C6 = 0, I6 = _6.morphNormals.length; C6 < I6; C6++) if (S6.morphTargets[C6]) { S6.morphTargets[C6].normals = []; for (var U6, G6 = S6.morphTargets[C6].normals, Y = _6.morphNormals[C6].normals, N6 = 0, B6 = Y.length; N6 < B6; N6 += 3) U6 = new g6(), U6.x = Y[N6], U6.y = Y[N6 + 1], U6.z = Y[N6 + 2], G6.push(U6); S6.morphNormalsReady = true; } } if (_6.morphColors !== void 0) { var C6, I6, te, ae, ie, le, W6; for (C6 = 0, I6 = _6.morphColors.length; C6 < I6; C6++) for (S6.morphColors[C6] = {}, S6.morphColors[C6].name = _6.morphColors[C6].name, S6.morphColors[C6].colors = [], ie = S6.morphColors[C6].colors, le = _6.morphColors[C6].colors, te = 0, ae = le.length; te < ae; te += 3) W6 = new l.Color(16755200), W6.setRGB(le[te], le[te + 1], le[te + 2]), ie.push(W6); } } function P6(_6, S6) { var E6 = [], C6 = []; _6.animation !== void 0 && C6.push(_6.animation), _6.animations !== void 0 && (_6.animations.length ? C6 = C6.concat(_6.animations) : C6.push(_6.animations)); for (var I6, b6 = 0; b6 < C6.length; b6++) I6 = f6.parseAnimation(C6[b6], S6.bones), I6 && E6.push(I6); if (S6.morphTargets) { var F6 = f6.CreateClipsFromMorphTargetSequences(S6.morphTargets, 10); E6 = E6.concat(F6); } 0 < E6.length && (S6.animations = E6); } return function(_6, S6) { _6.data !== void 0 && (_6 = _6.data), _6.scale = _6.scale === void 0 ? 1 : 1 / _6.scale; var E6 = new m6(); if (E6.morphColors = [], R6(_6, E6), L6(_6, E6), T6(_6, E6), P6(_6, E6), E6.computeFaceNormals(), E6.computeBoundingSphere(), _6.materials === void 0 || _6.materials.length === 0) return { geometry: E6 }; var C6 = d.prototype.initMaterials(_6.materials, S6, "Anonymous"); if (_6.materials[0].video) { var I6 = S6 + _6.materials[0].video; this.paramsString && (I6 += "?".concat(this.paramsString)); var b6 = new A6(I6); E6._video = b6; } return C6 && 0 < C6.length && (C6[0].side = _6.materials[0].singleSided ? l.FrontSide : _6.materials[0].flipSided ? l.BackSide : l.DoubleSide, _6.materials[0].specularCoef && (C6[0].shininess = Math.floor(_6.materials[0].specularCoef / 3))), { geometry: E6, materials: C6 }; }; }() }); }, /* 20 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ Loader: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); c(4); function d() { } d.Handlers = { handlers: [], add: function(f6, g6) { this.handlers.push(f6, g6); }, get: function(f6) { for (var g6 = this.handlers, p = 0, u6 = g6.length; p < u6; p += 2) { var y6 = g6[p], v6 = g6[p + 1]; if (y6.test(f6)) return v6; } return null; } }, Object.assign(d.prototype, { crossOrigin: "anonymous", onLoadStart: function() { }, onLoadProgress: function() { }, onLoadComplete: function() { }, initMaterials: function(f6, g6, p) { for (var u6 = [], y6 = 0; y6 < f6.length; ++y6) u6[y6] = this.createMaterial(f6[y6], g6, p); return u6; }, createMaterial: function() { var h6 = { NoBlending: l.NoBlending, NormalBlending: l.NormalBlending, AdditiveBlending: l.AdditiveBlending, SubtractiveBlending: l.SubtractiveBlending, MultiplyBlending: l.MultiplyBlending, CustomBlending: l.CustomBlending }, f6 = new l.Color(), g6 = new l.TextureLoader(), p = new l.MaterialLoader(); return function(u6, y6, v6) { function m6(R6, L6, T6, P6, _6) { var S6, E6 = y6 + R6, C6 = d.Handlers.get(E6); C6 === null ? (g6.setCrossOrigin(v6), S6 = g6.load(E6)) : S6 = C6.load(E6), L6 !== void 0 && (S6.repeat.fromArray(L6), L6[0] !== 1 && (S6.wrapS = l.RepeatWrapping), L6[1] !== 1 && (S6.wrapT = l.RepeatWrapping)), T6 !== void 0 && S6.offset.fromArray(T6), P6 !== void 0 && (P6[0] === "repeat" && (S6.wrapS = l.RepeatWrapping), P6[0] === "mirror" && (S6.wrapS = l.MirroredRepeatWrapping), P6[1] === "repeat" && (S6.wrapT = l.RepeatWrapping), P6[1] === "mirror" && (S6.wrapT = l.MirroredRepeatWrapping)), _6 !== void 0 && (S6.anisotropy = _6); var I6 = l.MathUtils.generateUUID(); return x6[I6] = S6, I6; } var x6 = {}, w6 = { uuid: l.MathUtils.generateUUID(), type: "MeshLambertMaterial" }; for (var A6 in u6) { var M6 = u6[A6]; switch (A6) { case "DbgColor": case "DbgIndex": case "opticalDensity": case "illumination": break; case "DbgName": w6.name = M6; break; case "blending": w6.blending = h6[M6]; break; case "colorAmbient": case "mapAmbient": console.warn("THREE.Loader.createMaterial:", A6, "is no longer supported."); break; case "colorDiffuse": w6.color = f6.fromArray(M6).getHex(); break; case "colorSpecular": w6.specular = f6.fromArray(M6).getHex(); break; case "colorEmissive": w6.emissive = f6.fromArray(M6).getHex(); break; case "specularCoef": w6.shininess = M6; break; case "shading": M6.toLowerCase() === "basic" && (w6.type = "MeshBasicMaterial"), M6.toLowerCase() === "phong" && (w6.type = "MeshPhongMaterial"), M6.toLowerCase() === "standard" && (w6.type = "MeshStandardMaterial"); break; case "mapDiffuse": w6.map = m6(M6, u6.mapDiffuseRepeat, u6.mapDiffuseOffset, u6.mapDiffuseWrap, u6.mapDiffuseAnisotropy); break; case "mapDiffuseRepeat": case "mapDiffuseOffset": case "mapDiffuseWrap": case "mapDiffuseAnisotropy": break; case "mapEmissive": w6.emissiveMap = m6(M6, u6.mapEmissiveRepeat, u6.mapEmissiveOffset, u6.mapEmissiveWrap, u6.mapEmissiveAnisotropy); break; case "mapEmissiveRepeat": case "mapEmissiveOffset": case "mapEmissiveWrap": case "mapEmissiveAnisotropy": break; case "mapLight": w6.lightMap = m6(M6, u6.mapLightRepeat, u6.mapLightOffset, u6.mapLightWrap, u6.mapLightAnisotropy); break; case "mapLightRepeat": case "mapLightOffset": case "mapLightWrap": case "mapLightAnisotropy": break; case "mapAO": w6.aoMap = m6(M6, u6.mapAORepeat, u6.mapAOOffset, u6.mapAOWrap, u6.mapAOAnisotropy); break; case "mapAORepeat": case "mapAOOffset": case "mapAOWrap": case "mapAOAnisotropy": break; case "mapBump": w6.bumpMap = m6(M6, u6.mapBumpRepeat, u6.mapBumpOffset, u6.mapBumpWrap, u6.mapBumpAnisotropy); break; case "mapBumpScale": w6.bumpScale = M6; break; case "mapBumpRepeat": case "mapBumpOffset": case "mapBumpWrap": case "mapBumpAnisotropy": break; case "mapNormal": w6.normalMap = m6(M6, u6.mapNormalRepeat, u6.mapNormalOffset, u6.mapNormalWrap, u6.mapNormalAnisotropy); break; case "mapNormalFactor": w6.normalScale = M6; break; case "mapNormalRepeat": case "mapNormalOffset": case "mapNormalWrap": case "mapNormalAnisotropy": break; case "mapSpecular": w6.specularMap = m6(M6, u6.mapSpecularRepeat, u6.mapSpecularOffset, u6.mapSpecularWrap, u6.mapSpecularAnisotropy); break; case "mapSpecularRepeat": case "mapSpecularOffset": case "mapSpecularWrap": case "mapSpecularAnisotropy": break; case "mapMetalness": w6.metalnessMap = m6(M6, u6.mapMetalnessRepeat, u6.mapMetalnessOffset, u6.mapMetalnessWrap, u6.mapMetalnessAnisotropy); break; case "mapMetalnessRepeat": case "mapMetalnessOffset": case "mapMetalnessWrap": case "mapMetalnessAnisotropy": break; case "mapRoughness": w6.roughnessMap = m6(M6, u6.mapRoughnessRepeat, u6.mapRoughnessOffset, u6.mapRoughnessWrap, u6.mapRoughnessAnisotropy); break; case "mapRoughnessRepeat": case "mapRoughnessOffset": case "mapRoughnessWrap": case "mapRoughnessAnisotropy": break; case "mapAlpha": w6.alphaMap = m6(M6, u6.mapAlphaRepeat, u6.mapAlphaOffset, u6.mapAlphaWrap, u6.mapAlphaAnisotropy); break; case "mapAlphaRepeat": case "mapAlphaOffset": case "mapAlphaWrap": case "mapAlphaAnisotropy": break; case "flipSided": w6.side = l.BackSide; break; case "doubleSided": w6.side = l.DoubleSide; break; case "transparency": console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"), w6.opacity = M6; break; case "depthTest": case "depthWrite": case "colorWrite": case "opacity": case "reflectivity": case "transparent": case "visible": case "wireframe": w6[A6] = M6; break; case "vertexColors": M6 === true && (w6.vertexColors = l.VertexColors), M6 === "face" && (w6.vertexColors = l.FaceColors); break; default: console.error("THREE.Loader.createMaterial: Unsupported", A6, M6); } } return w6.type === "MeshBasicMaterial" && delete w6.emissive, w6.type !== "MeshPhongMaterial" && delete w6.specular, 1 > w6.opacity && (w6.transparent = true), p.setTextures(x6), p.parse(w6); }; }() }); }, /* 21 */ /***/ (o, a6, c) => { var l = c(4); a6.VideoHandler = function(d) { var h6 = this; this.video = void 0, this.videoTexture = void 0, this.setMorphTime = function(f6, g6) { var p = f6 / g6 * h6.video.duration; h6.video.currentTime = p; }, this.getVideoDuration = function() { return h6.video.duration; }, this.createCanvasVideoTexture = function() { return h6.videoTexture = new l.VideoTexture(h6.video), h6.videoTexture.minFilter = l.LinearFilter, h6.videoTexture.magFilter = l.LinearFilter, h6.videoTexture.format = l.RGBFormat, h6.video.currentTime = 0, h6.videoTexture; }, this.getCurrentTime = function(f6) { return h6.video ? f6 * (h6.video.currentTime / h6.video.duration) : 0; }, this.isReadyToPlay = function() { return !!(h6.video && 3 <= h6.video.readyState); }, function() { document && (h6.video = document.createElement("video"), h6.video.crossOrigin = "anonymous", h6.video.src = d, h6.video.load(), h6.video.loop = true); }(); }; }, /* 22 */ /***/ (o, a6, c) => { var l = c(4), d = c(23).Points, h6 = c(5).toBufferGeometry, f6 = c(5).getCircularTexture, g6 = c(17).Label, p = function() { c(10).ZincObject.call(this), this.isPointset = true; var u6 = []; this.createMesh = (v6, m6, x6) => { if (v6 && m6) { var w6 = h6(v6, x6), A6 = f6(); m6.map = A6; var M6 = new d(w6, m6); this.setMesh(M6, x6.localTimeEnabled, x6.localMorphColour); } }; var y6 = (v6, m6, x6, w6) => { if (x6) { var A6 = new l.Color(w6), M6 = new g6(x6, A6); M6.setPosition(m6[0], m6[1], m6[2]); var R6 = M6.getSprite(); R6.material.sizeAttenuation = false, R6.material.alphaTest = 0.5, R6.material.transparent = true, R6.material.depthWrite = false, R6.material.depthTest = false, this.group.add(R6), u6[v6] = M6; } }; this.addPoints = (v6, m6, x6) => { if (v6 && 0 < v6.length) { var w6 = this.drawRange - 1, A6 = this.addVertices(v6), M6 = this.getMorph(); if (!M6) { var R6 = new l.PointsMaterial({ alphaTest: 0.5, size: 10, color: x6, sizeAttenuation: false }); A6.colorsNeedUpdate = true, this.createMesh(A6, R6, { localTimeEnabled: false, localMorphColour: false }); } var L6 = w6 + v6.length, T6 = 0; if (Array.isArray(m6) && m6.length === v6.length || typeof m6 == "string") for (w6; w6 + T6 < L6; ) { var P6 = typeof m6 == "string" ? m6 : m6[T6]; y6(T6, v6[T6], P6, x6), T6++; } this.region && (this.region.pickableUpdateRequired = true); } }, this.setSize = (v6) => { this.morph && this.morph.material && (this.morph.material.size = v6, this.morph.material.needsUpdate = true); }, this.setSizeAttenuation = (v6) => { this.morph && this.morph.material && (this.morph.material.sizeAttenuation = v6, this.morph.material.needsUpdate = true); }, this.getVerticesByIndex = function(v6) { if (0 <= v6 && this.drawRange > v6) { var m6 = this.getMorph().geometry.getAttribute("position"); return [m6.getX(v6), m6.getY(v6), m6.getZ(v6)]; } }, this.editVertices = function(v6, m6) { if (v6 && v6.length) { var x6 = this.getMorph(), w6 = m6 + v6.length - 1; if (!x6 || 0 > m6 || w6 >= this.drawRange) return; var A6 = x6.geometry.getAttribute("position"), M6 = m6; v6.forEach((R6) => { var L6 = u6[M6]; L6 && L6.setPosition(R6[0], R6[1], R6[2]), A6.setXYZ(M6++, R6[0], R6[1], R6[2]); }), A6.needsUpdate = true, this.boundingBoxUpdateRequired = true; } }, this.render = (v6, m6, x6, w6) => { this.morph && x6 && (this.morph.sizePerPixel = x6.pixelHeight), p.prototype.render.call(this, v6, m6, x6, w6); }; }; p.prototype = Object.create(c(10).ZincObject.prototype), a6.Pointset = p; }, /* 23 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ Points: () => ( /* binding */ y6 ) /* harmony export */ }); var l = c(4), d = new l.Matrix4(), h6 = new l.Ray(), f6 = new l.Sphere(), g6 = new l.Vector3(), p = new l.Vector3(), u6 = new l.Vector3(); class y6 extends l.Object3D { constructor() { var w6 = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), A6 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.PointsMaterial(); super(), this.type = "Points", this.geometry = w6, this.material = A6, this.sizePerPixel = 1, this.updateMorphTargets(); } copy(w6) { return super.copy(w6), this.material = w6.material, this.geometry = w6.geometry, this; } raycast(w6, A6) { var M6 = this.geometry, R6 = this.matrixWorld, L6 = w6.params.Points.threshold, T6 = M6.drawRange; if (M6.boundingSphere === null && M6.computeBoundingSphere(), f6.copy(M6.boundingSphere), f6.applyMatrix4(R6), f6.radius += L6, w6.ray.intersectsSphere(f6) !== false) { d.copy(R6).invert(), h6.copy(w6.ray).applyMatrix4(d); var P6 = L6 / ((this.scale.x + this.scale.y + this.scale.z) / 3) * this.material.size * this.sizePerPixel, _6 = P6 * P6; if (M6.isBufferGeometry) { var S6 = M6.index, E6 = M6.attributes, C6 = E6.position, I6 = M6.morphAttributes.position; if (S6 !== null) for (var b6, F6 = Math.max(0, T6.start), D6 = Math.min(S6.count, T6.start + T6.count), N6 = F6; N6 < D6; N6++) b6 = S6.getX(N6), m6(this, C6, I6, b6), v6(g6, b6, _6, R6, w6, A6, this); else for (var B6 = Math.max(0, T6.start), U6 = Math.min(C6.count, T6.start + T6.count), G6 = B6; G6 < U6; G6++) m6(this, C6, I6, G6), v6(g6, G6, _6, R6, w6, A6, this); } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var w6 = this.geometry; if (w6.isBufferGeometry) { var A6 = w6.morphAttributes, M6 = Object.keys(A6); if (0 < M6.length) { var R6 = A6[M6[0]]; if (R6 !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var L6, T6 = 0, P6 = R6.length; T6 < P6; T6++) L6 = R6[T6].name || T6 + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[L6] = T6; } } } else { var _6 = w6.morphTargets; _6 !== void 0 && 0 < _6.length && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } y6.prototype.isPoints = true; function v6(x6, w6, A6, M6, R6, L6, T6) { var P6 = h6.distanceSqToPoint(x6); if (P6 < A6) { var _6 = new l.Vector3(); h6.closestPointToPoint(x6, _6), _6.applyMatrix4(M6); var S6 = R6.ray.origin.distanceTo(_6); if (S6 < R6.near || S6 > R6.far) return; L6.push({ distance: S6, distanceToRay: Math.sqrt(P6), point: _6, index: w6, face: null, object: T6 }); } } function m6(x6, w6, A6, M6) { g6.fromBufferAttribute(w6, M6); var R6 = x6.morphTargetInfluences; if (x6.material.morphTargets && A6 && R6) { p.set(0, 0, 0); for (var L6 = 0, T6 = A6.length; L6 < T6; L6++) { var P6 = R6[L6], _6 = A6[L6]; P6 !== 0 && (u6.fromBufferAttribute(_6, M6), p.addScaledVector(u6.sub(g6), P6)); } g6.add(p); } } }, /* 24 */ /***/ (o, a6, c) => { var l = c(4), d = c(5).toBufferGeometry, h6 = function() { c(10).ZincObject.call(this), this.isLines = true, this.createLineSegment = (f6, g6, p) => { if (f6 && g6) { var u6 = d(f6, p); p.localMorphColour && u6.morphAttributes.color && (g6.onBeforeCompile = c(9).augmentMorphColor()); var y6 = new (c(12)).LineSegments(u6, g6); this.setMesh(y6, p.localTimeEnabled, p.localMorphColour); } }, this.setWidth = (f6) => { this.morph && this.morph.material && (this.morph.material.linewidth = f6, this.morph.material.needsUpdate = true); }, this.addLines = (f6, g6) => { if (f6 && 0 < f6.length) { var p = this.addVertices(f6), u6 = this.getMorph(); if (!u6) { var y6 = new l.LineBasicMaterial({ color: g6 }); p.colorsNeedUpdate = true, this.createLineSegment(p, y6, { localTimeEnabled: false, localMorphColour: false }); } this.region && (this.region.pickableUpdateRequired = true); } }; }; h6.prototype = Object.create(c(10).ZincObject.prototype), a6.Lines = h6; }, /* 25 */ /***/ (o, a6, c) => { function l(g6, p, u6, y6, v6, m6, x6) { try { var w6 = g6[m6](x6), A6 = w6.value; } catch (M6) { return void u6(M6); } w6.done ? p(A6) : Promise.resolve(A6).then(y6, v6); } function d(g6) { return function() { var p = this, u6 = arguments; return new Promise(function(y6, v6) { function m6(A6) { l(w6, y6, v6, m6, x6, "next", A6); } function x6(A6) { l(w6, y6, v6, m6, x6, "throw", A6); } var w6 = g6.apply(p, u6); m6(void 0); }); }; } var h6 = c(4), f6 = function() { var g6 = this; c(26).Texture.call(this), this.isTextureArray = true, this.loadFromImages = function() { var p = d(function* (u6) { var y6 = 1, v6 = 1, m6 = 0; if (u6 && u6.length) { g6.isLoading = true; var x6 = new Image(); x6.crossOrigin = "Anonymous"; for (var w6, A6 = document.createElement("canvas"), M6 = 0, R6 = Array(u6.length), L6 = 0; L6 < u6.length; L6++) w6 = yield g6.imageToUint8Array(g6, x6, u6[L6], A6), w6 && w6.array && (y6 = w6.width, v6 = w6.height, R6[m6] = w6.array, M6 += R6[m6].length, m6++); var T6 = new Uint8Array(M6); M6 = 0, R6.forEach((P6) => { T6.set(P6, M6), M6 += P6.length; }), g6.impl = new h6.DataTexture2DArray(T6, y6, v6, m6), g6.size = { width: y6, height: v6, depth: m6 }, g6.isLoading = false, g6.impl.needsUpdate = true; } }); return function() { return p.apply(this, arguments); }; }(), this.getMaterial = (p) => { if (this.impl) { var u6; if (!p) u6 = new h6.MeshBasicMaterial({ color: new h6.Color(1, 1, 1), transparent: false, opacity: 1, map: this.impl, side: h6.DoubleSide }); else if (p.vs && p.fs) { var y6 = true; "transparent" in p && (y6 = p.transparent); var v6 = h6.FrontSide; p.side && (v6 = p.side), u6 = new h6.ShaderMaterial({ transparent: y6, uniforms: p.uniforms, vertexShader: p.vs, fragmentShader: p.fs, side: v6 }), p.glslVersion && (u6.glslVersion = p.glslVersion); } if (u6) return u6.needsUpdate = true, u6; } }; }; f6.prototype = Object.create(c(26).Texture.prototype), a6.TextureArray = f6; }, /* 26 */ /***/ (o, a6, c) => { function l(g6, p, u6, y6, v6, m6, x6) { try { var w6 = g6[m6](x6), A6 = w6.value; } catch (M6) { return void u6(M6); } w6.done ? p(A6) : Promise.resolve(A6).then(y6, v6); } function d(g6) { return function() { var p = this, u6 = arguments; return new Promise(function(y6, v6) { function m6(A6) { l(w6, y6, v6, m6, x6, "next", A6); } function x6(A6) { l(w6, y6, v6, m6, x6, "throw", A6); } var w6 = g6.apply(p, u6); m6(void 0); }); }; } var h6 = c(4), f6 = function() { this.isTexture = true, this.impl = void 0, this.isLoading = false, this.size = { width: 1, height: 1, depth: 0 }; }; f6.prototype.loadImage = function(g6, p) { return new Promise((u6, y6) => { g6.onload = () => u6(g6), g6.onerror = y6, g6.src = p; }); }, f6.prototype.imageToUint8Array = function() { var g6 = d(function* (p, u6, y6, v6) { yield p.loadImage(u6, y6), v6.width = u6.width, v6.height = u6.height; var m6 = v6.getContext("2d"); return m6.drawImage(u6, 0, 0), { array: new Uint8Array(m6.getImageData(0, 0, v6.width, v6.height).data.buffer), width: v6.width, height: v6.height }; }); return function() { return g6.apply(this, arguments); }; }(), f6.prototype.loadFromImages = function() { var g6 = d(function* () { }); return function() { return g6.apply(this, arguments); }; }(), f6.prototype.isReady = function() { return !(!this.impl || this.isLoading); }, f6.prototype.getMaterial = function() { if (this.impl) return new h6.MeshBasicMaterial({ color: new h6.Color(1, 1, 1), transparent: false, opacity: 1, map: this.impl, side: h6.DoubleSide }); }, a6.Texture = f6; }, /* 27 */ /***/ (o, a6, c) => { function l(v6, m6) { var x6 = Object.keys(v6); if (Object.getOwnPropertySymbols) { var w6 = Object.getOwnPropertySymbols(v6); m6 && (w6 = w6.filter(function(A6) { return Object.getOwnPropertyDescriptor(v6, A6).enumerable; })), x6.push.apply(x6, w6); } return x6; } function d(v6) { for (var m6, x6 = 1; x6 < arguments.length; x6++) m6 = arguments[x6] == null ? {} : arguments[x6], x6 % 2 ? l(Object(m6), true).forEach(function(w6) { h6(v6, w6, m6[w6]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(v6, Object.getOwnPropertyDescriptors(m6)) : l(Object(m6)).forEach(function(w6) { Object.defineProperty(v6, w6, Object.getOwnPropertyDescriptor(m6, w6)); }); return v6; } function h6(v6, m6, x6) { return (m6 = f6(m6)) in v6 ? Object.defineProperty(v6, m6, { value: x6, enumerable: true, configurable: true, writable: true }) : v6[m6] = x6, v6; } function f6(v6) { var m6 = g6(v6, "string"); return typeof m6 == "symbol" ? m6 : m6 + ""; } function g6(v6, m6) { if (typeof v6 != "object" || !v6) return v6; var x6 = v6[Symbol.toPrimitive]; if (x6 !== void 0) { var w6 = x6.call(v6, m6 || "default"); if (typeof w6 != "object") return w6; throw new TypeError("@@toPrimitive must return a primitive value."); } return (m6 === "string" ? String : Number)(v6); } var p = c(4), u6 = c(28), y6 = function(v6) { c(29).TexturePrimitive.call(this, v6), this.isTextureSlides = true; var m6 = [], x6 = {}; this.morph = new p.Group(), this.group = this.morph, this.morph.userData = this; var w6 = void 0, A6 = true; this.createSlides = (L6) => { L6.forEach((T6) => this.createSlide(T6)); }; var M6 = (L6, T6) => { var P6 = L6.material, _6 = P6.uniforms; switch (L6.rotation.x = 0, L6.rotation.y = 0, L6.rotation.z = 0, L6.position.x = 0, L6.position.y = 0, L6.position.z = 0, T6.direction) { case "x": var S6 = -Math.PI / 2; L6.rotation.y = S6, _6.direction.value = 1, _6.slide.value.set(T6.value, 0, 0), L6.position.x = T6.value; break; case "y": L6.rotation.x = Math.PI / 2, _6.direction.value = 2, _6.slide.value.set(0, T6.value, 0), L6.position.y = T6.value; break; case "z": _6.direction.value = 3, _6.slide.value.set(0, 0, T6.value), L6.position.z = T6.value; break; } P6.needsUpdate = true, this.boundingBoxUpdateRequired = true; }; this.modifySlideSettings = (L6) => { L6 && L6.id && L6.id in x6 && x6[L6.id] && M6(x6[L6.id], L6); }, this.createSlide = (L6) => { if (this.texture && this.texture.isTextureArray && this.texture.isReady() && L6 && L6.direction && L6.value !== void 0) { var T6 = new p.PlaneGeometry(1, 1); T6.translate(0.5, 0.5, 0); var P6 = u6.getUniforms(); P6.diffuse.value = this.texture.impl, P6.depth.value = this.texture.size.depth, P6.flipY.value = A6; var _6 = { fs: u6.fs, vs: u6.vs, uniforms: P6, glslVersion: u6.glslVersion, side: p.DoubleSide, transparent: false }, S6 = this.texture.getMaterial(_6); S6.needsUpdate = true; var E6 = new p.Mesh(T6, S6); E6.name = this.groupName, E6.userData = this; var C6 = { value: L6.value, direction: L6.direction, id: E6.id }; return m6.push(C6), M6(E6, C6), x6[E6.id] = E6, this.morph.add(E6), this.boundingBoxUpdateRequired = true, C6; } }, this.getTextureSettings = () => [...m6], this.getTextureSettingsWithId = (L6) => { for (var T6 = 0; T6 < m6.length; T6++) if (L6 === m6[T6].id) return d({}, m6[T6]); }, this.getSlides = () => this.morph ? [...this.morph.children] : [], this.removeSlide = (L6) => { L6 && this.removeSlideWithId(L6.id); }, this.removeSlideWithId = (L6) => { if (this.morph && L6 in x6 && x6[L6]) { if (this.morph.getObjectById(L6)) { var T6 = x6[L6]; this.morph.remove(T6), T6.clear(), T6.geometry && T6.geometry.dispose(), T6.material && T6.material.dispose(), this.boundingBoxUpdateRequired = true; } var P6 = m6.findIndex((_6) => _6.id === L6); -1 < P6 && m6.splice(P6, 1); } }, this.dispose = () => { this.morph.children.forEach((L6) => { L6.geometry && L6.geometry.dispose(), L6.material && L6.material.dispose(); }), c(29).TexturePrimitive.prototype.dispose.call(this), this.boundingBoxUpdateRequired = true; }; var R6 = (L6, T6, P6) => { if (T6) switch (T6.direction.value) { case 1: P6.copy(T6.slide.value), L6.expandByPoint(P6), P6.setY(1), P6.setZ(1), L6.expandByPoint(P6); break; case 2: P6.copy(T6.slide.value), L6.expandByPoint(P6), P6.setX(1), P6.setZ(1), L6.expandByPoint(P6); break; case 3: P6.copy(T6.slide.value), L6.expandByPoint(P6), P6.setX(1), P6.setY(1), L6.expandByPoint(P6); break; } }; this.getBoundingBox = () => { if (this.morph && this.morph.children && this.morph.visible && this.boundingBoxUpdateRequired) { this.cachedBoundingBox.makeEmpty(); var L6 = new p.Vector3(0, 0, 0); this.morph.children.forEach((T6) => { R6(this.cachedBoundingBox, T6.material.uniforms, L6); }), this.morph.updateMatrixWorld(true, true), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = false; } return this.cachedBoundingBox; }, this.applyTransformation = (L6, T6, P6) => { var _6 = new p.Matrix4(); _6.set(L6[0], L6[1], L6[2], 0, L6[3], L6[4], L6[5], 0, L6[6], L6[7], L6[8], 0, 0, 0, 0, 0); var S6 = new p.Quaternion().setFromRotationMatrix(_6); this.morph.position.set(...T6), this.morph.quaternion.copy(S6), this.morph.scale.set(...P6), this.morph.updateMatrix(), this.boundingBoxUpdateRequired = true; }, this.setRenderOrder = (L6) => { this.morph.renderOrder = L6; }, this.initialise = (L6, T6) => { if (L6) { var P6 = L6.locations; P6 && 0 < P6.length && (this.applyTransformation(P6[0].orientation, P6[0].position, P6[0].scale), "flipY" in P6[0] && (A6 = P6[0].flipY)), this.createSlides(L6.settings.slides), T6 != null && typeof T6 == "function" && T6(this); } }, this.showEdges = (L6) => { if (w6) w6.material.color = L6; else { var T6 = new p.BoxGeometry(1, 1, 1); T6.translate(0.5, 0.5, 0.5); var P6 = new p.EdgesGeometry(T6); w6 = new p.LineSegments(P6, new p.LineBasicMaterial({ color: L6 })), this.group.add(w6); } w6.visible = true; }, this.hideEdges = () => { w6 && (w6.visible = false); }; }; y6.prototype = Object.create(c(29).TexturePrimitive.prototype), y6.prototype.constructor = y6, a6.TextureSlides = y6; }, /* 28 */ /***/ (o, a6, c) => { var l = c(4), d = l.GLSL3, h6 = ` precision highp float; precision highp int; precision highp sampler2DArray; uniform sampler2DArray diffuse; uniform bool discardAlpha; in vec3 vUw; out vec4 outColor; void main() { vec4 color = texture( diffuse, vUw ); // lighten a bit if (discardAlpha && color.a == 0.0) discard; outColor = vec4( color.rgba ); } `, f6 = ` out vec3 vUw; uniform float depth; uniform vec3 slide; uniform int direction; uniform bool flipY; void main() { vec3 slidePos = position.xyz; gl_Position = projectionMatrix * modelViewMatrix * vec4( position.xyz, 1.0 ); if (direction == 1) slidePos = vec3(slide.x, position.y, position.x); if (direction == 2) slidePos = vec3(position.x, slide.y, position.y); if (direction == 3) slidePos = vec3(position.x, position.y, slide.z); if (flipY) slidePos.y = 1.0 - slidePos.y; vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth); } `, g6 = function() { return { diffuse: { value: void 0 }, depth: { value: 1 }, slide: { value: new l.Vector3(0, 0, 1) }, direction: { value: 1 }, flipY: { value: true }, discardAlpha: { value: true } }; }; a6.fs = h6, a6.vs = f6, a6.glslVersion = d, a6.getUniforms = g6; }, /* 29 */ /***/ (o, a6, c) => { c(4); var l = c(5).resolveURL, d = function(h6) { c(10).ZincObject.call(this), this.isTexturePrimitive = true, this.texture = h6, this.load = (f6, g6) => { if (f6 && f6.images && f6.images.source) { var p = new (c(25)).TextureArray(), u6 = []; f6.images.source.forEach((v6) => { u6.push(l(v6)); }); var y6 = this; p.loadFromImages(u6).then(() => { y6.texture = p, y6.initialise(f6, g6); }); } }, this.initialise = (f6, g6) => { g6 != null && typeof g6 == "function" && g6(this); }; }; d.prototype = Object.create(c(10).ZincObject.prototype), d.prototype.constructor = d, a6.TexturePrimitive = d; }, /* 30 */ /***/ (o, a6, c) => { var l = c(4), d = c(31); a6.Renderer = function(h6) { var f6 = h6, g6 = void 0, p = void 0, u6 = new l.Clock(false); this.playAnimation = true; var y6 = 1e3, v6 = [], m6 = 0, x6 = [], w6 = 0, A6 = void 0, M6 = void 0, R6 = void 0, L6 = void 0, T6 = [], P6 = [], _6 = new l.Group(), S6 = void 0, E6 = void 0, C6 = false; this.getDrawingWidth = () => f6 ? f6.clientWidth : S6 ? typeof S6.clientWidth > "u" ? Math.round(S6.width) : Math.round(S6.clientWidth) : 0, this.getDrawingHeight = () => f6 ? f6.clientHeight : S6 ? typeof S6.clientHeight > "u" ? Math.round(S6.height) : Math.round(S6.clientHeight) : 0, this.onWindowResize = () => { p.onWindowResize(); var F6 = this.getDrawingWidth(), D6 = this.getDrawingHeight(); if (g6 != null) { var N6; f6 ? (N6 = f6.getBoundingClientRect(), g6.setSize(F6, D6)) : S6 && (typeof S6.getBoundingClientRect > "u" || (N6 = S6.getBoundingClientRect(), S6.width = F6, S6.height = D6), g6.setSize(F6, D6, false)), N6 && (N6.left, N6.top); var B6 = new l.Vector2(); g6.getSize(B6), B6.x, B6.y; } }, this.initialiseVisualisation = (F6) => { if (F6 = F6 || {}, F6.antialias === void 0) { var D6 = false; try { /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && (D6 = true); } catch { D6 = false; } F6.antialias = !D6; } F6.canvas && (f6 = void 0, S6 = F6.canvas), g6 = new l.WebGLRenderer(F6), f6 !== void 0 && f6.appendChild(g6.domElement), g6.setClearColor(16777215, 1), S6 && S6.style && (S6.style.height = "100%", S6.style.width = "100%"), g6.autoClear = false; var N6 = this.createScene("default"); this.setCurrentScene(N6); }, this.getCurrentScene = () => p, this.setCurrentScene = (F6) => { if (F6) { this.removeActiveScene(F6); var D6 = p; p = F6, D6 && D6.setInteractiveControlEnable(false), p.setInteractiveControlEnable(true), p.setAdditionalScenesGroup(_6), this.onWindowResize(); } }, this.getSceneByName = (F6) => T6[F6], this.createScene = (F6) => { if (T6[F6] == null) { var D6; return D6 = S6 ? new (c(32)).Scene(S6, g6) : new (c(32)).Scene(f6, g6), T6[F6] = D6, D6.sceneName = F6, D6; } }, this.resetView = () => { p.resetView(); }, this.viewAll = () => { if (p) { var F6 = p.getBoundingBox(); if (F6) { for (var D6, N6 = 0; N6 < P6.length; N6++) D6 = P6[N6].getBoundingBox(), D6 && F6.union(D6); p.viewAllWithBoundingBox(F6); } } }, this.loadModelsURL = (F6, D6, N6, B6, U6, G6) => { p.loadModelsURL(F6, D6, N6, B6, U6, G6); }, this.loadViewURL = (F6) => { p.loadViewURL(F6); }, this.loadFromViewURL = (F6, D6) => { p.loadFromViewURL(F6, D6); }, this.updateDirectionalLight = () => { p.updateDirectionalLight(); }; var I6 = () => { C6 ? (A6 = requestAnimationFrame(I6), this.render()) : (cancelAnimationFrame(A6), A6 = void 0); }; this.stopAnimate = () => { C6 && (u6.stop(), C6 = false); }, this.animate = () => { C6 || (u6.start(), C6 = true, I6()); }, this.addPreRenderCallbackFunction = (F6) => (++m6, v6[m6] = F6, m6), this.removePreRenderCallbackFunction = (F6) => { F6 in v6 && delete v6[F6]; }, this.addPostRenderCallbackFunction = (F6) => (++w6, x6[w6] = F6, w6), this.removePostRenderCallbackFunction = (F6) => { F6 in x6 && delete x6[F6]; }, this.getPlayRate = () => y6, this.setPlayRate = (F6) => { y6 = F6; }, this.getCurrentTime = () => p.getCurrentTime(), this.setMorphsTime = (F6) => { p.setMorphsTime(F6); }, this.getZincGeometryByID = (F6) => p.getZincGeometryByID(F6), this.addToScene = (F6) => { p.addObject(F6); }, this.addToOrthoScene = (F6) => { if (R6 == null && (R6 = new l.Scene()), M6 == null) { var D6 = this.getDrawingWidth(), N6 = this.getDrawingHeight(); M6 = new l.OrthographicCamera(-D6 / 2, D6 / 2, N6 / 2, -N6 / 2, 1, 10), M6.position.z = 10; } R6.add(F6); }; var b6 = (F6) => (D6) => { D6.needsUpdate = true; var N6 = new l.SpriteMaterial({ map: D6 }), B6 = N6.map.image.width, U6 = N6.map.image.height; F6.material = N6, F6.scale.set(B6, U6, 1); var G6 = this.getDrawingWidth(), Y = this.getDrawingHeight(); F6.position.set((G6 - B6) / 2, (-Y + U6) / 2, 1), this.addToOrthoScene(F6); }; this.addLogo = () => { L6 = new l.Sprite(), l.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png", void 0, b6(L6)); }, this.render = () => { E6 || (f6 ? 0 < f6.clientWidth && 0 < f6.clientHeight && (E6 = new d(f6, this.onWindowResize)) : S6 && 0 < S6.width && 0 < S6.height && (E6 = new d(S6, this.onWindowResize))); var F6 = u6.getDelta(); p.renderGeometries(y6, F6, this.playAnimation); for (var D6, N6 = 0; N6 < P6.length; N6++) D6 = P6[N6], D6.renderGeometries(y6, F6, this.playAnimation); for (var B6 in M6 != null && R6 != null && (g6.clearDepth(), g6.render(R6, M6)), v6) v6.hasOwnProperty(B6) && v6[B6].call(); for (var U6 in p.render(g6), x6) x6.hasOwnProperty(U6) && x6[U6].call(); }, this.getThreeJSRenderer = () => g6, this.isSceneActive = (F6) => { if (p === F6) return true; for (var D6, N6 = 0; N6 < P6.length; N6++) if (D6 = P6[N6], D6 === F6) return true; return false; }, this.addActiveScene = (F6) => { this.isSceneActive(F6) || (P6.push(F6), _6.add(F6.getThreeJSScene())); }, this.removeActiveScene = (F6) => { for (var D6, N6 = 0; N6 < P6.length; N6++) if (D6 = P6[N6], D6 === F6) return P6.splice(N6, 1), void _6.remove(F6.getThreeJSScene()); }, this.clearAllActiveScene = () => { for (var F6 = 0; F6 < P6.length; F6++) _6.remove(P6[F6].getThreeJSScene()); P6.splice(0, P6.length); }, this.dispose = () => { for (var F6 in C6 && cancelAnimationFrame(A6), T6) T6.hasOwnProperty(F6) && T6[F6].clearAll(); T6 = [], P6 = [], _6 = new l.Group(), this.stopAnimate(), v6 = [], m6 = 0, M6 = void 0, R6 = void 0, L6 = void 0; var D6 = this.createScene("default"); this.setCurrentScene(D6), E6 = void 0; }, this.transitionScene = (F6, D6) => { if (p) { var N6 = p.getZincCameraControls(), B6 = F6.getBoundingBox(); if (B6) { var U6 = B6.min.distanceTo(B6.max) / 2, G6 = (B6.min.x + B6.max.x) / 2, Y = (B6.min.y + B6.max.y) / 2, te = (B6.min.z + B6.max.z) / 2, ae = N6.getViewportFromCentreAndRadius(G6, Y, te, U6, 40, U6 * 4), ie = N6.getCurrentViewport(); N6.cameraTransition(ie, ae, D6), N6.enableCameraTransition(); } } }, this.isWebGL2 = () => !!g6 && g6.capabilities.isWebGL2; }; }, /* 31 */ /***/ (o) => { o.exports = i4(); }, /* 32 */ /***/ (o, a6, c) => { var l = c(4), d = c(33).MarkerCluster, h6 = c(35).SceneLoader, f6 = c(42).SceneExporter, g6 = c(44).Viewport, p = c(5).createBufferGeometry, u6 = c(5).getCircularTexture, y6 = c(5).createNewSpriteText, v6 = 0, m6 = function() { return "sc" + v6++; }, x6 = function() { return { Duration: "6 secs", OriginalDuration: "-", TimeStamps: {} }; }, w6 = 6e3; a6.Scene = function(A6, M6) { var R6 = this, L6 = A6, T6 = void 0, P6 = new h6(this), _6 = void 0, S6 = {}, E6 = 0, C6 = {}, I6 = 0, b6 = new l.Scene(), F6 = new l.Scene(), D6 = new (c(45)).Region(void 0, this); b6.add(D6.getGroup()); var N6 = new l.Group(); b6.add(N6), this.directionalLight = void 0, this.ambient = void 0, this.camera = void 0; var B6 = 6e3, U6 = void 0; this.sceneName = void 0; var G6 = false, Y = void 0; this.autoClearFlag = true, this.displayMarkers = false, this.displayMinimap = false, this.displayMiniAxes = false, this.minimapScissor = { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-right", updateRequired: true }; var te = { x: 0, y: 0 }, ae = x6(), ie = new l.Vector2(), le = []; this.forcePickableObjectsUpdate = false, this.uuid = m6(); var W6 = new d(this); W6.disable(), b6.add(W6.group); var $6 = { main: [], mini: [] }, j6 = new l.Vector3(0, 0, 0), re = () => L6 ? typeof L6.clientWidth > "u" ? L6.width : L6.clientWidth : 0, k6 = () => L6 ? typeof L6.clientHeight > "u" ? L6.height : L6.clientHeight : 0; this.getDownloadProgress = () => P6.getDownloadProgress(), this.onWindowResize = () => { var O6 = k6(); this.camera.aspect = re() / O6, this.camera.updateProjectionMatrix(), this.minimapScissor.updateRequired = true, U6.onResize(), U6.calculateHeightPerPixelAtZeroDepth(O6); }, this.resetView = () => { this.onWindowResize(), U6.resetView(); }, this.changeZoomByScrollRateUnit = (O6) => { U6.changeZoomByScrollRateUnit(O6); }; var H6 = () => { this.camera = new l.PerspectiveCamera(40, re() / k6(), 0, 10), this.ambient = new l.AmbientLight(16777215, 0.2), b6.add(this.ambient), this.directionalLight = new l.DirectionalLight(16777215, 0.8), b6.add(this.directionalLight), U6 = new (c(44)).CameraControls(this.camera, M6.domElement, M6, this), U6.setDirectionalLight(this.directionalLight), U6.resetView(), _6 = new (c(50)).Minimap(this); }; H6(), this.loadView = (O6) => { var Z6 = new g6(); return Z6.setFromObject(O6), U6.setCurrentCameraSettings(Z6), true; }, this.setupMultipleViews = (O6, Z6) => { for (var [X, ee] of Object.entries(Z6)) { var fe = new g6(); fe.setFromObject(ee), U6.addViewport(X, fe); } U6.setDefaultViewport(O6); }, this.getBoundingBox = () => D6.getBoundingBox(true), this.viewAllWithBoundingBox = (O6) => { if (O6) { var Z6 = U6.getViewportFromBoundingBox(O6, 1); U6.setCurrentCameraSettings(Z6), U6.calculateHeightPerPixelAtZeroDepth(k6()), W6.markerUpdateRequired = true; } }, this.viewAll = () => { var O6 = this.getBoundingBox(); this.viewAllWithBoundingBox(O6), W6.markerUpdateRequired = true; }, this.forEachGeometry = (O6) => { D6.forEachGeometry(O6, true); }, this.forEachGlyphset = (O6) => { D6.forEachGlyphset(O6, true); }, this.forEachPointset = (O6) => { D6.forEachPointset(O6, true); }, this.forEachLine = (O6) => { D6.forEachLine(O6, true); }, this.findGeometriesWithGroupName = (O6) => D6.findGeometriesWithGroupName(O6, true), this.findPointsetsWithGroupName = (O6) => D6.findPointsetsWithGroupName(O6, true), this.findGlyphsetsWithGroupName = (O6) => D6.findGlyphsetsWithGroupName(O6, true), this.findLinesWithGroupName = (O6) => D6.findLinesWithGroupName(O6, true), this.findObjectsWithGroupName = (O6) => D6.findObjectsWithGroupName(O6, true), this.findObjectsWithAnatomicalId = (O6) => D6.findObjectsWithAnatomicalId(O6, true), this.getBoundingBoxOfZincObjects = (O6) => { for (var Z6, X = void 0, ee = 0; ee < O6.length; ee++) Z6 = O6[ee].getBoundingBox(), Z6 && (X ? X.union(Z6) : X = Z6); return X; }, this.vectorToScreenXY = (O6) => { O6.project(this.camera); var Z6 = re(), X = k6(), ee = Z6 / 2, fe = X / 2; return O6.x = O6.x * ee + ee, O6.y = -(O6.y * fe) + fe, O6; }, this.getObjectsScreenXY = (O6) => { if (O6 && 0 < O6.length) { var Z6 = this.getBoundingBoxOfZincObjects(O6), X = new l.Vector3(); return Z6.getCenter(X), this.vectorToScreenXY(X); } }, this.getNamedObjectsScreenXY = (O6) => { var Z6 = this.findObjectsWithGroupName(O6); return this.getObjectsScreenXY(Z6); }, this.addZincObject = (O6) => { O6 && (D6.addZincObject(O6), U6 && U6.calculateMaxAllowedDistance(this)); }, this.loadGlyphsetURL = (O6, Z6, X, ee) => { P6.loadGlyphsetURL(D6, O6, Z6, X, ee); }, this.loadPointsetURL = (O6, Z6, X, ee, fe) => { P6.loadPointsetURL(D6, O6, Z6, X, ee, fe); }, this.loadLinesURL = (O6, Z6, X, ee, fe) => { P6.loadLinesURL(D6, O6, Z6, X, ee, fe); }, this.loadSTL = (O6, Z6, X) => { P6.loadSTL(D6, O6, Z6, X); }, this.loadOBJ = (O6, Z6, X) => { P6.loadOBJ(D6, O6, Z6, X); }, this.loadMetadataURL = (O6, Z6, X, ee) => { P6.loadMetadataURL(D6, O6, Z6, X, ee); }, this.loadModelsURL = (O6, Z6, X, ee, fe, be) => { P6.loadModelsURL(D6.urls, Z6, X, ee, fe, be); }, this.loadViewURL = (O6) => { P6.loadViewURL(O6); }, this.loadFromViewURL = (O6, Z6) => { P6.loadFromViewURL(O6, Z6); }, this.loadGLTF = (O6, Z6, X, ee) => { P6.loadGLTF(D6, O6, Z6, X, ee); }, this.updateDirectionalLight = () => { U6.updateDirectionalLight(); }, this.addObject = (O6) => { b6.add(O6); }, this.removeObject = (O6) => { b6.remove(O6); }, this.getCurrentTime = () => { if (T6 != null) return T6.getCurrentTime(B6); var O6 = D6.getCurrentTime(); return O6 === -1 ? 0 : O6; }, this.setMorphsTime = (O6) => { T6 != null && T6.setMorphTime(O6, B6), D6.setMorphTime(O6, true); }, this.isTimeVarying = () => !!(T6 && T6.video && !T6.video.error) || D6.isTimeVarying(), this.renderGeometries = (O6, Z6, X) => { var ee = {}; if (ee.camera = U6, ee.displayMarkers = this.displayMarkers, ee.markerCluster = W6, ee.markersList = W6.markers, ee.ndcToBeUpdated = false, X && (ee.markerCluster.markerUpdateRequired = true), !T6) P6.toBeDownloaded == 0 ? (ee.ndcToBeUpdated = U6.update(Z6), ee.ndcToBeUpdated && U6.calculateHeightPerPixelAtZeroDepth(k6()), D6.renderGeometries(O6, Z6, X, U6, ee, true)) : U6.update(0); else if (T6.isReadyToPlay()) { X ? T6.video.play() : T6.video.pause(); var fe = T6.video.currentTime / T6.getVideoDuration() * B6; P6.toBeDownloaded == 0 ? (U6.setTime(fe), ee.ndcToBeUpdated = U6.update(0), ee.ndcToBeUpdated && U6.calculateHeightPerPixelAtZeroDepth(k6()), D6.setMorphTime(fe, true), D6.renderGeometries(0, 0, X, U6, ee, true)) : U6.update(0); } else myPlayRate = 0; }, this.getThreeJSScene = () => b6, this.setVideoHandler = (O6) => { T6 || (T6 = O6); }, this.setAdditionalScenesGroup = (O6) => { b6.add(O6); }; var K = (O6, Z6, X, ee, fe, be, Ae) => { var he = 0, xe = 0; return xe = O6.includes("top") ? Ae - fe - X : O6.includes("bottom") ? X : Math.floor((Ae - fe) / 2), he = O6.includes("left") ? Z6 : O6.includes("right") ? be - Z6 - ee : Math.floor((be - ee) / 2), { x: he, y: xe }; }, ce = (O6) => { (this.displayMinimap || this.displayMiniAxes) && (O6.setScissorTest(true), O6.getSize(ie), this.minimapScissor.updateRequired && (te = K(this.minimapScissor.align, this.minimapScissor.x_offset, this.minimapScissor.y_offset, this.minimapScissor.width, this.minimapScissor.height, ie.x, ie.y), this.minimapScissor.updateRequired = false), O6.setScissor(te.x, te.y, this.minimapScissor.width, this.minimapScissor.height), O6.setViewport(te.x, te.y, this.minimapScissor.width, this.minimapScissor.height), _6.updateCamera(), this.displayMiniAxes ? O6.render(F6, _6.camera) : (b6.add(_6.mask), O6.render(b6, _6.camera), b6.remove(_6.mask)), O6.setScissorTest(false), O6.setViewport(0, 0, ie.x, ie.y)); }; this.render = (O6) => { this.autoClearFlag && O6.clear(), G6 && Y ? Y.render(b6, this.camera) : (O6.render(b6, this.camera), ce(O6)); }, this.setInteractiveControlEnable = (O6) => { O6 == true ? U6.enable() : U6.disable(); }, this.getZincCameraControls = () => U6, this.getThreeJSScene = () => b6, this.setDuration = (O6) => { D6.setDuration(O6), B6 = O6, U6.setPathDuration(O6), P6.duration = O6; }, this.getDuration = () => B6, this.setStereoEffectEnable = (O6) => { O6 != true || Y || (Y = new c(44).StereoEffect(M6)), M6.setSize(re(), k6()), this.camera.updateProjectionMatrix(), G6 = O6; }, this.objectIsInScene = (O6) => D6.objectIsInRegion(O6, true), this.alignBoundingBoxToCameraView = (O6, Z6) => { if (O6) { O6.getCenter(j6); var X = this.getZincCameraControls().getCurrentViewport(), ee = new l.Vector3(X.targetPosition[0], X.targetPosition[1], X.targetPosition[2]), fe = new l.Vector3(X.eyePosition[0], X.eyePosition[1], X.eyePosition[2]), be = new l.Vector3(), Ae = new l.Vector3(); be.subVectors(ee, fe).normalize(), Ae.subVectors(ee, j6).normalize(); var he = new l.Vector3(); he.crossVectors(be, Ae); var xe = be.angleTo(Ae); 0 < Z6 ? (this.getZincCameraControls().rotateCameraTransition(he, xe, Z6), this.getZincCameraControls().enableCameraTransition()) : this.getZincCameraControls().rotateAboutLookAtpoint(he, xe), W6.markerUpdateRequired = true; } }, this.translateBoundingBoxToCameraView = (O6, Z6, X) => { if (O6) { var ee = this.getZincCameraControls().getCurrentViewport(), fe = this.getZincCameraControls().getViewportFromBoundingBox(O6, Z6); 0 < X && (this.getZincCameraControls().cameraTransition(ee, fe, X), this.getZincCameraControls().enableCameraTransition()), W6.markerUpdateRequired = true; } }, this.alignObjectToCameraView = (O6, Z6) => { if (this.objectIsInScene(O6)) { var X = O6.getBoundingBox(); this.alignBoundingBoxToCameraView(X, Z6); } }, this.setCameraTargetToObject = (O6) => { if (this.objectIsInScene(O6)) { var Z6 = O6.getBoundingBox(), X = this.getZincCameraControls().getCurrentViewport(); Z6.getCenter(j6); var ee = new l.Vector3(X.targetPosition[0], X.targetPosition[1], X.targetPosition[2]), fe = new l.Vector3(X.eyePosition[0], X.eyePosition[1], X.eyePosition[2]), be = new l.Vector3(), Ae = new l.Vector3(); be.subVectors(fe, ee), Ae.addVectors(j6, be), X.eyePosition[0] = Ae.x, X.eyePosition[1] = Ae.y, X.eyePosition[2] = Ae.z, X.targetPosition[0] = j6.x, X.targetPosition[1] = j6.y, X.targetPosition[2] = j6.z, this.getZincCameraControls().setCurrentCameraSettings(X), W6.markerUpdateRequired = true; } }, this.isStereoEffectEnable = () => G6, this.removeZincObject = (O6) => { D6.removeZincObject(O6), U6 && U6.calculateMaxAllowedDistance(this), W6.markerUpdateRequired = true; }, this.updatePickableThreeJSObjects = () => { le.length = 0, W6.isEnabled && le.push(W6.group), D6.getPickableThreeJSObjects(le, true), this.forcePickableObjectsUpdate = false; }, this.getPickableThreeJSObjects = () => ((this.forcePickableObjectsUpdate || D6.checkPickableUpdateRequred(true)) && this.updatePickableThreeJSObjects(), le), this.getNormalisedMinimapCoordinates = (O6, Z6) => { if (this.displayMinimap) { var X = new l.Vector2(); O6.getSize(X); var ee = X.y - Z6.clientY; if (te.x + this.minimapScissor.width > Z6.clientX && Z6.clientX > te.x && te.y + this.minimapScissor.height > ee && ee > te.y) { var fe = 2 * ((Z6.clientX - te.x) / this.minimapScissor.width) - 1, be = 2 * ((ee - te.y) / this.minimapScissor.height) - 1; return { x: fe, y: be }; } } }, this.getMinimapDiffFromNormalised = (O6, Z6) => _6 ? _6.getDiffFromNormalised(O6, Z6) : void 0, this.isWebGL2 = () => M6.isWebGL2(), this.clearAll = () => { W6.clear(), D6.clear(true), this.clearZincObjectAddedCallbacks(), this.clearZincObjectRemovedCallbacks(), P6.toBeDwonloaded = 0, U6 && U6.calculateMaxAllowedDistance(this), W6.markerUpdateRequired = true; }, this.addMetadataTimeStamp = (O6, Z6) => { ae.TimeStamps[O6] = V6(Z6); }, this.getMetadataTag = (O6) => ae[O6], this.getMetadata = () => ae, this.setMetadataTag = (O6, Z6) => { ae[O6] = Z6; }, this.removeMetadataTag = (O6) => { delete ae[O6]; }, this.resetMetadata = () => { ae = x6(); }, this.resetDuration = () => { this.setDuration(w6); }; var se = (O6) => [...O6.years ? ["".concat(O6.years, "years")] : [], ...O6.months ? ["".concat(O6.months, "months")] : [], ...O6.weeks ? ["".concat(O6.weeks, "weeks")] : [], ...O6.days ? ["".concat(O6.days, "days")] : [], ...O6.hours ? ["".concat(O6.hours, "hours")] : [], ...O6.mins ? ["".concat(O6.mins, "mins")] : [], ...O6.secs ? ["".concat(O6.secs, "secs")] : []].join(" "), V6 = (O6) => O6.years ? 31536e6 * O6.years : 0 + O6.months ? 2592e6 * O6.months : 0 + O6.weeks ? 6048e5 * O6.weeks : 0 + O6.days ? 864e5 * O6.days : 0 + O6.hours ? 36e5 * O6.hours : 0 + O6.mins ? 6e4 * O6.mins : 0 + O6.secs ? 1e3 * O6.secs : 0; this.setDurationFromObject = (O6) => { var Z6 = se(O6), X = V6(O6); this.setMetadataTag("Duration", Z6), this.setDuration(X); }, this.setOriginalDurationFromObject = (O6) => { var Z6 = se(O6); this.setMetadataTag("OriginalDuration", Z6); }, this.exportGLTF = (O6) => { var Z6 = new f6(this); return Z6.exportGLTF(O6); }, this.getRootRegion = () => D6, this.createLines = (O6, Z6, X, ee) => { var fe = D6.findChildFromPath(O6); return fe === void 0 && (fe = D6.createChildFromPath(O6)), fe.createLines(Z6, X, ee); }, this.createPoints = (O6, Z6, X, ee, fe) => { var be = D6.findChildFromPath(O6); return be === void 0 && (be = D6.createChildFromPath(O6)), be.createPoints(Z6, X, ee, fe); }, this.addZincObjectAddedCallbacks = (O6) => (++E6, S6[E6] = O6, E6), this.addZincObjectRemovedCallbacks = (O6) => (++I6, C6[I6] = O6, I6), this.removeZincObjectAddedCallbacks = (O6) => { O6 in E6 && delete S6[O6]; }, this.removeZincObjectRemovedCallbacks = (O6) => { O6 in I6 && delete C6[O6]; }, this.clearZincObjectAddedCallbacks = () => { S6 = {}, E6 = 0; }, this.clearZincObjectRemovedCallbacks = () => { C6 = {}, I6 = 0; }, this.triggerObjectAddedCallback = (O6) => { for (var Z6 in S6) S6.hasOwnProperty(Z6) && S6[Z6](O6); }, this.triggerObjectRemovedCallback = (O6) => { for (var Z6 in C6) C6.hasOwnProperty(Z6) && C6[Z6](O6); }, this.addTemporaryPoints = (O6, Z6) => { var X = p(O6.length, O6), ee = new l.PointsMaterial({ alphaTest: 0.5, size: 15, color: Z6, sizeAttenuation: false }), fe = u6(); ee.map = fe; var be = new (c(23)).Points(X, ee); return N6.add(be), be; }, this.addTemporaryLines = (O6, Z6) => { var X = p(O6.length, O6), ee = new l.LineBasicMaterial({ color: Z6 }), fe = new (c(12)).LineSegments(X, ee); return N6.add(fe), fe; }, this.removeTemporaryPrimitive = (O6) => { N6.remove(O6), O6.geometry.dispose(), O6.material.dispose(); }, this.clearTemporaryPrimitives = () => { var O6 = 0, Z6 = N6.children; return Z6.forEach((X) => { X.geometry.dispose(), X.material.dispose(), O6++; }), N6.clear(), O6; }, this.addBoundingBoxPrimitive = function(O6, Z6, X, ee, fe) { var be = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0, Ae = D6.findChildFromPath(O6); Ae === void 0 && (Ae = D6.createChildFromPath(O6)); var he = be || R6.getBoundingBox(); j6.set(0, 0, 0); var xe = j6.subVectors(he.max, he.min), ne = new l.BoxGeometry(xe.x, xe.y, xe.z), me = Ae.createGeometryFromThreeJSGeometry(Z6, ne, X, ee, fe, 1e4); return xe.addVectors(he.min, he.max).multiplyScalar(0.5), me.setPosition(xe.x, xe.y, xe.z), me; }, this.addSlicesPrimitive = function(O6, Z6, X, ee, fe) { var be = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0; if (Z6 && 3 <= Z6.length && X && 3 <= X.length) { var Ae = D6.findChildFromPath(O6); Ae === void 0 && (Ae = D6.createChildFromPath(O6)); var he = be || R6.getBoundingBox(); j6.set(0, 0, 0); var xe = j6.subVectors(he.max, he.min), ne = [], me = 0; return ["x", "y", "z"].forEach((Me) => { var De; switch (Me) { case "x": De = new l.PlaneGeometry(xe.z, xe.y), De.rotateY(Math.PI / 2); break; case "y": De = new l.PlaneGeometry(xe.x, xe.z), De.rotateX(Math.PI / 2); break; case "z": De = new l.PlaneGeometry(xe.x, xe.y); break; } var Ie = Ae.createGeometryFromThreeJSGeometry(Z6[me], De, X[me], ee, fe, 10001); ne.push(Ie), me++; }), xe.addVectors(he.min, he.max).multiplyScalar(0.5), ne.forEach((Me) => { Me.setPosition(xe.x, xe.y, xe.z); }), ne; } }, this.enableMarkerCluster = (O6) => { O6 ? (W6.markerUpdateRequired = true, W6.enable()) : (W6.markerUpdateRequired = false, W6.disable()), this.forcePickableObjectsUpdate = true; }, this.destroyAxisDisplay = () => { this.displayMiniAxes = false, $6.main && (this.enableAxisDisplay(false, false), $6.main.forEach((O6) => { O6.dispose && O6.dispose(); })), $6.mini && (this.enableAxisDisplay(false, true), $6.mini.forEach((O6) => { O6.dispose && O6.dispose(); })), $6 = { main: [], mini: [] }; }, this.createAxisDisplay = function() { var O6 = 0 < arguments.length && arguments[0] !== void 0 && arguments[0]; R6.destroyAxisDisplay(); var Z6 = [{ name: "x", dir: new l.Vector3(1, 0, 0), colour: "red", hex: 16733525 }, { name: "y", dir: new l.Vector3(0, 1, 0), colour: "green", hex: 5635925 }, { name: "z", dir: new l.Vector3(0, 0, 1), colour: "blue", hex: 5592575 }], X = R6.getBoundingBox(), ee = X.min.distanceTo(X.max), fe = new l.Vector3(0, 0, 0); O6 && fe.copy(X.min), Z6.forEach((be) => { var Ae = new l.ArrowHelper(be.dir, fe, ee, be.hex); $6.main.push(Ae); var he = new l.ArrowHelper(be.dir, X.getCenter(j6), ee / 2, be.hex); $6.mini.push(he); var xe = y6(be.name, 0.036, be.colour, "Asap", 120, 700), ne = be.dir.clone().multiplyScalar(ee).add(fe); xe.position.set(ne.x, ne.y, ne.z), $6.main.push(xe); }); }, this.enableAxisDisplay = function(O6) { var Z6, X = 1 < arguments.length && arguments[1] !== void 0 && arguments[1]; X && (Z6 = $6) !== null && Z6 !== void 0 && (Z6 = Z6.mini) !== null && Z6 !== void 0 && Z6.length ? (R6.displayMiniAxes = O6, $6.mini.forEach((ee) => { O6 ? F6.add(ee) : F6.remove(ee); })) : !X && $6.main && $6.main.forEach((ee) => { O6 ? b6.add(ee) : b6.remove(ee); }); }; }; }, /* 33 */ /***/ (o, a6, c) => { function l(A6, M6) { var R6 = Object.keys(A6); if (Object.getOwnPropertySymbols) { var L6 = Object.getOwnPropertySymbols(A6); M6 && (L6 = L6.filter(function(T6) { return Object.getOwnPropertyDescriptor(A6, T6).enumerable; })), R6.push.apply(R6, L6); } return R6; } function d(A6) { for (var M6, R6 = 1; R6 < arguments.length; R6++) M6 = arguments[R6] == null ? {} : arguments[R6], R6 % 2 ? l(Object(M6), true).forEach(function(L6) { h6(A6, L6, M6[L6]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(A6, Object.getOwnPropertyDescriptors(M6)) : l(Object(M6)).forEach(function(L6) { Object.defineProperty(A6, L6, Object.getOwnPropertyDescriptor(M6, L6)); }); return A6; } function h6(A6, M6, R6) { return (M6 = f6(M6)) in A6 ? Object.defineProperty(A6, M6, { value: R6, enumerable: true, configurable: true, writable: true }) : A6[M6] = R6, A6; } function f6(A6) { var M6 = g6(A6, "string"); return typeof M6 == "symbol" ? M6 : M6 + ""; } function g6(A6, M6) { if (typeof A6 != "object" || !A6) return A6; var R6 = A6[Symbol.toPrimitive]; if (R6 !== void 0) { var L6 = R6.call(A6, M6 || "default"); if (typeof L6 != "object") return L6; throw new TypeError("@@toPrimitive must return a primitive value."); } return (M6 === "string" ? String : Number)(A6); } var p = c(4), u6 = new Image(128, 128); u6.src = c(34); var y6 = new p.Texture(); y6.image = u6, y6.needsUpdate = true; var v6 = [0.02, 0.03, 1], m6 = new p.SpriteMaterial({ map: y6, alphaTest: 0.5, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false }), x6 = c(5).createNewSpriteText, w6 = function(A6) { c(10).ZincObject.call(this), this.texture = y6; var M6 = void 0; this.morph = new p.Group(), this.group = this.morph, this.isMarkerCluster = true; var R6 = true, L6 = []; this.markers = {}; var T6 = new p.Vector2(), P6 = new p.Vector2(), _6 = Date.now(); this.setSpriteSize = (b6) => { M6.scale.set(0.015, 0.02, 1), M6.scale.multiplyScalar(b6); }, this.clear = () => { this.group.clear(), this.markers = {}; }, this.dispose = () => { this.clear(), this.morph && this.morph.clear(); }; var S6 = (b6) => { var F6 = new p.Group(), D6 = new p.Sprite(m6); return D6.clusterIndex = b6, D6.center.set(0.5, 0), D6.position.set(0, 0, 0), D6.renderOrder = 1e4, D6.scale.set(v6[0], v6[1], v6[2]), D6.userData = this, F6.add(D6), this.group.add(F6), { group: F6, marker: D6, label: void 0, number: 0, min: [0, 0, 0], max: [1, 1, 1] }; }, E6 = (b6, F6, D6) => { b6.group.visible = true, b6.group.position.set(F6.coords[0], F6.coords[1], F6.coords[2]), (b6.label === void 0 || D6 !== b6.number) && (b6.label && (b6.group.remove(b6.label), b6.label.material.map.dispose(), b6.label.material.dispose()), b6.label = x6(D6, 0.012, "black", "Asap", 120, 700), b6.number = D6, b6.group.add(b6.label)), b6.min = F6.min, b6.max = F6.max; }, C6 = (b6) => { var F6 = 0; for (b6.forEach((D6) => { var N6 = D6.members.length, B6 = 0; N6 === 1 ? D6.members[0].setVisibility(true) : (D6.members.forEach((U6) => { B6 += U6.getNumber(), U6.setVisibility(false); }), !L6[F6] && L6.push(S6(F6)), E6(L6[F6], D6, B6), F6++); }), F6; F6 < L6.length; F6++) L6[F6].group.visible = false; }, I6 = (b6, F6) => { var D6 = true, N6 = { members: [], coords: [0, 0, 0], min: [0, 0, 0], max: [1, 1, 1] }, B6 = 0; for (var U6 in b6) D6 ? (T6.set(b6[U6].ndc.x, b6[U6].ndc.y), this._b1.setFromPoints([b6[U6].morph.position]), D6 = false, N6.members.push(b6[U6]), N6.coords = [b6[U6].morph.position.x, b6[U6].morph.position.y, b6[U6].morph.position.z], F6.push(N6), delete b6[U6]) : (P6.set(b6[U6].ndc.x, b6[U6].ndc.y), B6 = T6.distanceTo(P6), 0.1 > B6 && (N6.members.push(b6[U6]), this._b1.expandByPoint(b6[U6].morph.position), delete b6[U6])); N6.min = [this._b1.min.x, this._b1.min.y, this._b1.min.z], N6.max = [this._b1.max.x, this._b1.max.y, this._b1.max.z], D6 != true && I6(b6, F6); }; this.calculate = () => { if (R6) { var b6 = Date.now(); if (500 < b6 - _6) { var F6 = []; I6(d({}, this.markers), F6), C6(F6), _6 = Date.now(), this.markerUpdateRequired = false; } } }, this.isEnabled = () => R6, this.enable = () => { R6 = true, this.morph.visible = true; }, this.disable = () => { for (var b6 in R6 = false, this.morph.visible = false, this.markers) { var F6; (F6 = this.markers[b6]) !== null && F6 !== void 0 && F6.isMarker && this.markers[b6].isEnabled() && this.markers[b6].setVisibility(true); } }, this.zoomToCluster = (b6) => !!(b6 !== void 0 && -1 < b6 && (this._v1.set(...L6[b6].min), this._v2.set(...L6[b6].max), Math.abs(0 < this._v1.distanceTo(this._v2)))) && (this._b1.set(this._v1, this._v2), A6.translateBoundingBoxToCameraView(this._b1, 3, 300), this.markerUpdateRequired = true, true), this.clusterIsVisible = (b6) => { if (b6 !== void 0 && -1 < b6 && L6[b6]) { var F6; return (F6 = L6[b6].group) === null || F6 === void 0 ? void 0 : F6.visible; } return false; }; }; w6.prototype = Object.create(c(10).ZincObject.prototype), a6.MarkerCluster = w6; }, /* 34 */ /***/ (o) => { o.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"; }, /* 35 */ /***/ (o, a6, c) => { var l = c(4), d = c(5).resolveURL, h6 = c(5).createNewURL, f6 = c(5).isRegionGroup, g6 = c(36).STLLoader, p = c(37).OBJLoader, u6 = c(38).PrimitivesLoader; a6.SceneLoader = function(y6) { var v6 = y6; this.toBeDownloaded = 0, this.progressMap = {}; var m6 = false, x6 = false, w6 = new u6(); this.getDownloadProgress = () => { var W6 = 0, $6 = 0, j6 = false; for (var re in this.progressMap) { var k6 = this.progressMap[re]; W6 += k6[1], $6 += k6[0], k6[1] == 0 && (j6 = true); } return j6 && (W6 = 0), [W6, $6, x6]; }, this.onProgress = (W6) => ($6) => { this.progressMap[W6] = [$6.loaded, $6.total]; }, this.onError = (W6) => ($6) => { --this.toBeDownloaded, x6 = true, console.error("There is an issue with external resource ".concat($6 != null && $6.responseURL ? ": " + ($6 == null ? void 0 : $6.responseURL) : "", ".")), W6 && W6({ type: "Error", xhr: $6 }); }; var A6 = (W6, $6) => { var j6 = $6.Default; if ($6.Inline) v6.setupMultipleViews(j6, $6.Entries); else { var re = [], k6 = function(se) { W6 && (newURL = h6(K, W6), re.push(new Promise((V6, O6) => { fetch(newURL).then((Z6) => Z6.json()).then((Z6) => V6({ key: se, data: Z6 })).catch((Z6) => O6(Z6)); }))); }; for (var [H6, K] of Object.entries($6.Entries)) k6(H6); Promise.all(re).then((ce) => { var se = {}; ce.forEach((O6) => { se[O6.key] = O6.data; }), v6.setupMultipleViews(j6, se); var V6 = v6.getZincCameraControls(); V6 && V6.setCurrentViewport(j6), m6 = true; }); } }; this.loadViewURL = (W6, $6) => { this.toBeDownloaded += 1; var j6 = new XMLHttpRequest(); j6.onreadystatechange = () => { if (j6.readyState == 4) if (j6.status == 200) { var k6 = JSON.parse(j6.responseText); v6.setupMultipleViews("default", { default: k6 }), v6.resetView(), m6 = true, --this.toBeDownloaded, $6 != null && typeof $6 == "function" && $6(); } else this.onError($6)({ responseURL: W6 }); }; var re = d(W6); j6.open("GET", re, true), j6.send(); }, this.loadModelsURL = (W6, $6, j6, re, k6, H6, K) => { var ce = $6.length; this.toBeDownloaded += ce; for (var se = 0; se < ce; se++) { var V6 = $6[se], O6 = c(0).defaultMaterialColor, Z6 = c(0).defaultOpacity; j6 != null && j6[se] != null && (O6 = !!j6[se]), re != null && re[se] != null && (Z6 = re[se]); var X = 0; k6 != null && k6[se] != null && (X = !!k6[se]); var ee = 0; H6 != null && H6[se] != null && (ee = !!H6[se]), w6.load(d(V6), I6(W6, O6, Z6, X, ee, void 0, void 0, void 0, void 0, K), this.onProgress(V6), this.onError(K)); } }, this.loadFromViewURL = (W6, $6, j6) => { var re = new XMLHttpRequest(); re.onreadystatechange = () => { if (re.readyState == 4 && re.status == 200) { var H6 = JSON.parse(re.responseText); v6.loadView(H6); for (var K, ce = [], se = $6 + "_", V6 = 0; V6 < H6.numberOfResources; V6++) K = se + (V6 + 1) + ".json", ce.push(K); this.loadModelsURL(W6, ce, H6.colour, H6.opacity, H6.timeEnabled, H6.morphColour, j6); } }; var k6 = d($6 + "_view.json"); re.open("GET", k6, true), re.send(); }; var M6 = (W6, $6, j6, re, k6, H6, K, ce, se) => (V6, O6) => { var Z6 = ce ? new (c(39)).TubeLines() : new (c(24)).Lines(), X = void 0; O6 && O6[0] && (X = new l.LineBasicMaterial({ color: O6[0].color.clone() }), 1 > O6[0].opacity && (X.transparent = true), X.opacity = O6[0].opacity, X.morphTargets = $6, X.vertexColors = O6[0].vertexColors); var ee = { localTimeEnabled: $6, localMorphColour: j6 }; if (Z6 && (Z6.createLineSegment(V6, X, ee), Z6.setName(re), Z6.setAnatomicalId(k6), Z6.setRenderOrder(H6), W6.addZincObject(Z6), Z6.setDuration(v6.getDuration()), K && K.levels)) for (var [fe, be] of Object.entries(K.levels)) Z6.addLOD(w6, fe, be.URL, be.Index, K.preload); --this.toBeDownloaded, V6.dispose(), se != null && typeof se == "function" && se(Z6); }; this.loadLinesURL = (W6, $6, j6, re, k6, H6, K) => { var ce = 0; this.toBeDownloaded += 1; var se = !!(K != null && K.isInline) && K.isInline, V6 = K != null && K.anatomicalId ? K.anatomicalId : void 0, O6 = K != null && K.renderOrder ? K.renderOrder : void 0; j6 != null && (ce = !!j6); var Z6 = 0; re != null && (Z6 = !!re); var X = K.tubeLines && !ce && !Z6; if (se) { var ee = w6.parse($6); M6(W6, ce, Z6, k6, V6, O6, K.lod, X, H6)(ee.geometry, ee.materials); } else w6.load($6, M6(W6, ce, Z6, k6, V6, O6, K.lod, X, H6), this.onProgress($6), this.onError(H6), K.loaderOptions); }; var R6 = (W6, $6, j6, re, k6, H6) => { var K = H6 && H6.isInline ? H6.isInline : void 0, ce = H6 && H6.anatomicalId ? H6.anatomicalId : void 0, se = H6 && H6.displayLabels ? H6.displayLabels : void 0, V6 = H6 && H6.renderOrder ? H6.renderOrder : void 0, O6 = new (c(18)).Glyphset(); O6.setDuration(v6.getDuration()), O6.groupName = re; var Z6 = () => { --this.toBeDownloaded, k6 != null && typeof k6 == "function" && k6(O6); }; ++this.toBeDownloaded, K ? O6.load($6, j6, Z6, K, se) : O6.load($6, d(j6), Z6, K, se), O6.setAnatomicalId(ce), O6.setRenderOrder(V6), W6.addZincObject(O6); }, L6 = (W6, $6, j6, re, k6, H6) => () => { if ($6.readyState == 4 && $6.status == 200) { var K = JSON.parse($6.responseText); R6(W6, K, j6, re, k6, H6); } }, T6 = (W6, $6, j6, re, k6, H6, K) => (ce, se) => { var V6 = new (c(22)).Pointset(), O6 = new l.PointsMaterial({ alphaTest: 0.5, size: 10, sizeAttenuation: false }); se && se[0] && (1 > se[0].opacity && (O6.transparent = true), O6.opacity = se[0].opacity, O6.color = se[0].color, O6.morphTargets = $6, O6.vertexColors = se[0].vertexColors); var Z6 = {}; Z6.localTimeEnabled = $6, Z6.localMorphColour = j6, V6 && (V6.createMesh(ce, O6, Z6), V6.setName(re), V6.setAnatomicalId(k6), W6.addZincObject(V6), V6.setDuration(v6.getDuration()), V6.setRenderOrder(H6)), ce.dispose(), --this.toBeDownloaded, K != null && typeof K == "function" && K(V6); }; this.loadSTL = (W6, $6, j6, re) => { this.toBeDownloaded += 1; var k6 = c(0).defaultMaterialColor, H6 = c(0).defaultOpacity, K = new g6(); K.crossOrigin = "Anonymous", K.load(d($6), I6(W6, k6, H6, false, false, j6, void 0, void 0, void 0, re)); }, this.loadOBJ = (W6, $6, j6, re) => { this.toBeDownloaded += 1; var k6 = c(0).defaultMaterialColor, H6 = c(0).defaultOpacity, K = new p(); K.crossOrigin = "Anonymous", K.load(d($6), I6(W6, k6, H6, false, false, j6, void 0, void 0, void 0, re)); }; var P6 = (W6, $6, j6, re, k6, H6, K) => { this.toBeDownloaded += 1; var ce = c(0).defaultMaterialColor, se = c(0).defaultOpacity, V6 = 0, O6 = !!(K && K.isInline) && K.isInline, Z6 = K && K.fileFormat ? K.fileFormat : void 0, X = K && K.anatomicalId ? K.anatomicalId : void 0, ee = K && K.renderOrder ? K.renderOrder : void 0; j6 != null && (V6 = !!j6); var fe = 0; re != null && (fe = !!re); var be = w6; if (Z6 !== void 0) { if (Z6 == "STL") be = new g6(); else if (Z6 == "OBJ") return be = new p(), be.crossOrigin = "Anonymous", void be.load($6, objloader(W6, ce, se, V6, fe, k6, X, H6), this.onProgress($6), this.onError, K.loaderOptions); } if (O6) { var Ae = w6.parse($6); I6(W6, ce, se, V6, fe, k6, X, ee, K, H6)(Ae.geometry, Ae.materials); } else be.crossOrigin = "Anonymous", w6.load($6, I6(W6, ce, se, V6, fe, k6, X, ee, K, H6), this.onProgress($6), this.onError(H6), K.loaderOptions); }, _6 = function($6, j6, re) { var k6 = 0; return (H6) => { if (++k6, H6 && j6 != null && typeof j6 == "function" && j6(H6), k6 == $6 && (m6 == false && v6.viewAll(), re != null && typeof re == "function")) { re(); var K = v6.getZincCameraControls(); K && K.calculateMaxAllowedDistance(v6); } }; }; this.loadPointsetURL = (W6, $6, j6, re, k6, H6, K) => { var ce = 0; this.toBeDownloaded += 1, j6 != null && (ce = !!j6); var se = 0; re != null && (se = !!re); var V6 = !!(K && K.isInline) && K.isInline, O6 = K && K.anatomicalId ? K.anatomicalId : void 0, Z6 = K && K.renderOrder ? K.renderOrder : void 0; if (V6) { var X = w6.parse($6); T6(W6, ce, se, k6, O6, Z6, H6)(X.geometry, X.materials); } else w6.load($6, T6(W6, ce, se, k6, O6, Z6, H6), this.onProgress($6), this.onError(H6), K.loaderOptions); }; var S6 = (W6, $6, j6, re, k6, H6) => { var K = H6 && H6.isInline ? H6.isInline : void 0, ce = H6 && H6.anatomicalId ? H6.anatomicalId : void 0, se = H6 && H6.renderOrder ? H6.renderOrder : void 0, V6 = void 0; if (j6) { if ($6 && j6.images && j6.images.source) for (var O6, Z6 = j6.images.source, X = 0; X < Z6.length; X++) O6 = h6(Z6[X], $6), j6.images.source[X] = O6; if (j6.type === "slides" && (V6 = new (c(27)).TextureSlides()), V6) { V6.groupName = re; var ee = () => { --this.toBeDownloaded, k6 != null && typeof k6 == "function" && k6(V6); }; ++this.toBeDownloaded, V6.load(j6, ee, K), V6.setAnatomicalId(ce), V6.setRenderOrder(se), W6.addZincObject(V6); } } }, E6 = (W6, $6, j6, re, k6) => () => { if ($6.readyState == 4 && $6.status == 200) { var H6 = JSON.parse($6.responseText); S6(W6, $6.responseURL, H6, j6, re, k6); } }; this.loadTextureURL = (W6, $6, j6, re, k6) => { var H6 = !!(k6 && k6.isInline) && k6.isInline; if (H6) S6(W6, void 0, $6, j6, re, k6); else { var K = new XMLHttpRequest(); K.onreadystatechange = E6(W6, K, j6, re, k6), K.open("GET", d($6), true), K.send(); } }, this.loadGlyphsetURL = (W6, $6, j6, re, k6, H6) => { var K = !!(H6 && H6.isInline) && H6.isInline; if (K) R6(W6, $6, j6, re, k6, H6); else { var ce = new XMLHttpRequest(); ce.onreadystatechange = L6(W6, ce, j6, re, k6, H6), ce.open("GET", d($6), true), ce.send(); } }; var C6 = (W6, $6, j6, re, k6, H6, K, ce, se, V6, O6) => { var Z6 = { colour: j6, opacity: re, localTimeEnabled: k6, localMorphColour: H6 }, X = new (c(3)).Geometry(); return X.createMesh($6, ce, Z6), X.getMorph() ? (X.setName(se), X.setRenderOrder(V6), X.setAnatomicalId(O6), W6 && W6.addZincObject(X), X.setDuration(v6.getDuration()), X.videoHandler && v6.setVideoHandler(X.videoHandler), X) : void 0; }, I6 = (W6, $6, j6, re, k6, H6, K, ce, se, V6) => (O6, Z6) => { var X; Z6 && Z6[0] && (X = Z6[0]); var ee = C6(W6, O6, $6, j6, re, k6, void 0, X, H6, ce, K); if (se.lod && se.lod.levels) for (var [fe, be] of Object.entries(se.lod.levels)) ee.addLOD(w6, fe, be.URL, be.Index, se.lod.preload); --this.toBeDownloaded, O6.dispose(), V6 != null && typeof V6 == "function" && V6(ee); }, b6 = (W6) => { var $6 = /P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/, [, j6, re, k6, H6, K, ce, se] = W6.match($6); return { years: j6, months: re, weeks: k6, days: H6, hours: K, mins: ce, secs: se }; }; this.loadSettings = (W6) => { if (W6) { if (W6.Duration) { var $6 = b6(W6.Duration); v6.setDurationFromObject($6); } if (W6.OriginalDuration) { var j6 = b6(W6.OriginalDuration); v6.setOriginalDurationFromObject(j6); } if (W6.TimeStamps) for (var re in W6.TimeStamps) { var k6 = b6(W6.TimeStamps[re]); v6.addMetadataTimeStamp(re, k6); } } }; var F6 = (W6, $6, j6, re, k6) => { if (j6) { var H6 = void 0, K = false; j6.URL ? (H6 = j6.URL, $6 && (H6 = h6(H6, $6))) : j6.Inline && (H6 = j6.Inline.URL, K = true); var ce = {}; if (j6.LOD && j6.LOD.Levels) { ce.preload = !!j6.LOD.Preload, ce.levels = {}; for (var [se, V6] of Object.entries(j6.LOD.Levels)) ce.levels[se] = {}, ce.levels[se].URL = h6(V6.URL, $6), ce.levels[se].Index = V6.Index; } var O6 = j6.GroupName; (O6 === void 0 || O6 === "") && (O6 = "_Unnamed"); var Z6 = { loaderOptions: { index: j6.Index }, isInline: K, fileFormat: j6.FileFormat, anatomicalId: j6.AnatomicalId, compression: j6.compression, tubeLines: j6.tubeLines, lod: ce, renderOrder: re }; switch (j6.Type) { case "Surfaces": P6(W6, H6, j6.MorphVertices, j6.MorphColours, O6, k6, Z6); break; case "Glyph": var X; K ? X = j6.Inline.GlyphGeometriesURL : (X = j6.GlyphGeometriesURL, X = h6(j6.GlyphGeometriesURL, $6)), j6.DisplayLabels && (Z6.displayLabels = true), this.loadGlyphsetURL(W6, H6, X, O6, k6, Z6); break; case "Points": this.loadPointsetURL(W6, H6, j6.MorphVertices, j6.MorphColours, O6, k6, Z6); break; case "Lines": this.loadLinesURL(W6, H6, j6.MorphVertices, j6.MorphColours, O6, k6, Z6); break; case "Texture": this.loadTextureURL(W6, H6, O6, k6, Z6); break; } } }, D6 = (W6, $6, j6) => { if ($6) { var re = void 0, k6 = false; switch ($6.URL ? (re = $6.URL, W6 && (re = h6($6.URL, W6))) : $6.Inline && (re = $6.Inline.URL, k6 = true), $6.Type) { case "View": k6 ? (v6.setupMultipleViews("default", { default: re }), m6 = true, j6 != null && typeof j6 == "function" && j6()) : this.loadViewURL(re, j6); break; case "Settings": this.loadSettings($6); break; } } }; this.loadGLTF = (W6, $6, j6, re, k6) => { var H6 = new (c(40)).GLTFToZincJSLoader(); H6.load(v6, W6, $6, j6, re, k6); }; var N6 = (W6, $6, j6, re) => { if (j6.Primitives && j6.Primitives.forEach((ce) => { var se = 1; ce.Order && (se = ce.Order), F6(W6, $6, ce, se, re); }), j6.Transformation && W6.setTransformation(j6.Transformation), j6.Children) for (var [k6, H6] of Object.entries(j6.Children)) { var K = W6.findOrCreateChildFromPath(k6); K && N6(K, $6, H6, re); } }, B6 = (W6, $6) => { var j6, re, k6 = W6, H6 = $6 == null || (j6 = $6.enabled) === null || j6 === void 0 ? void 0 : j6.include, K = $6 == null || (re = $6.enabled) === null || re === void 0 ? void 0 : re.exclude, ce = $6 == null ? void 0 : $6.tubeLines; return (H6 != null && H6.length || K != null && K.length) && (H6 && (k6 = W6.filter((se) => { if (se.Type === "View") return true; for (var V6 = 0; V6 < H6.length; V6++) if (f6(se.RegionPath, se.GroupName, H6[V6])) return true; return false; })), K && (k6 = k6.filter((se) => { if (se.Type === "View") return true; for (var V6 = 0; V6 < K.length; V6++) if (f6(se.RegionPath, se.GroupName, K[V6])) return false; return true; }))), ce && k6.forEach((se) => { se.Type === "Lines" && (se.tubeLines = true); }), k6; }, U6 = (W6, $6) => Array.isArray(W6) ? B6(W6, $6) : W6, G6 = (W6, $6) => { if (Array.isArray(W6)) { for (var j6 = 0, re = 0; re < W6.length; re++) W6[re].Type && ($6 && W6[re].Type === "View" || W6[re].Type === "Surfaces" || W6[re].Type === "Glyph" || W6[re].Type === "Points" || W6[re].Type === "Lines" || W6[re].Type === "Texture") && j6++; return j6; } return 0; }, Y = (W6) => { var $6 = W6.Primitives ? G6(W6.Primitives, false) : 0; return W6.Children && Object.values(W6.Children).forEach((j6) => { $6 += Y(j6); }), $6; }, te = (W6) => Array.isArray(W6) ? G6(W6, true) : typeof W6 == "object" && W6 !== null && W6.Version === "2.0" ? Y(W6.Regions) : void 0, ae = (W6, $6, j6, re, k6) => { var H6 = W6; j6.RegionPath && j6.RegionPath !== "" && (H6 = W6.findOrCreateChildFromPath(j6.RegionPath)), F6(H6, $6, j6, 2 * re, k6); }, ie = (W6, $6, j6, re, k6, H6) => { for (var K = U6($6, H6), ce = te(K), se = new _6(ce, re, k6), V6 = 0; V6 < $6.length; V6++) D6(j6, K[V6], se); for (var O6 = 0; O6 < $6.length; O6++) ae(W6, j6, K[O6], O6, se); }, le = (W6, $6, j6, re, k6) => { var H6 = te($6), K = new _6(H6, re, k6); $6.Settings && this.loadSettings($6.Settings), $6.Views && A6(j6, $6.Views), $6.Regions && N6(W6, j6, $6.Regions, K); }; this.loadMetadataURL = (W6, $6, j6, re, k6) => { var H6 = new XMLHttpRequest(), K = d($6); H6.onreadystatechange = () => { if (H6.readyState == 4 && H6.status == 200) { v6.resetMetadata(), v6.resetDuration(), m6 = false; var ce = H6.responseURL; ce === void 0 && (ce = new URL(K).href); var se = JSON.parse(H6.responseText); Array.isArray(se) ? ie(W6, se, ce, j6, re, k6) : typeof se == "object" && se !== null && se.Version == "2.0" && le(W6, se, ce, j6, re); } }, H6.open("GET", K, true), H6.send(); }; }; }, /* 36 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ STLLoader: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); class d extends l.Loader { constructor(f6) { super(f6); } load(f6, g6, p, u6) { var y6 = this, v6 = new l.FileLoader(this.manager); v6.setPath(this.path), v6.setResponseType("arraybuffer"), v6.setRequestHeader(this.requestHeader), v6.setWithCredentials(this.withCredentials), v6.load(f6, function(m6) { try { g6(y6.parse(m6)); } catch (x6) { u6 ? u6(x6) : console.error(x6), y6.manager.itemError(f6); } }, p, u6); } parse(f6) { function g6(u6, y6, v6) { for (var m6 = 0, x6 = u6.length; m6 < x6; m6++) if (u6[m6] !== y6.getUint8(v6 + m6, false)) return false; return true; } var p = function(u6) { if (typeof u6 == "string") { for (var y6 = new Uint8Array(u6.length), v6 = 0; v6 < u6.length; v6++) y6[v6] = 255 & u6.charCodeAt(v6); return y6.buffer || y6; } return u6; }(f6); return function(u6) { var y6 = new DataView(u6), v6 = y6.getUint32(80, true); if (84 + v6 * 50 === y6.byteLength) return true; for (var m6 = [115, 111, 108, 105, 100], x6 = 0; 5 > x6; x6++) if (g6(m6, y6, x6)) return false; return true; }(p) ? function(u6) { for (var y6, v6, m6, x6, w6, A6, M6, R6, L6 = new DataView(u6), T6 = L6.getUint32(80, true), P6 = false, _6 = 0; _6 < 70; _6++) L6.getUint32(_6, false) == 1129270351 && L6.getUint8(_6 + 4) == 82 && L6.getUint8(_6 + 5) == 61 && (P6 = true, x6 = new Float32Array(3 * (3 * T6)), w6 = L6.getUint8(_6 + 6) / 255, A6 = L6.getUint8(_6 + 7) / 255, M6 = L6.getUint8(_6 + 8) / 255, R6 = L6.getUint8(_6 + 9) / 255); for (var S6 = new l.BufferGeometry(), E6 = new Float32Array(3 * (3 * T6)), C6 = new Float32Array(3 * (3 * T6)), I6 = 0; I6 < T6; I6++) { var b6 = 84 + I6 * 50, F6 = L6.getFloat32(b6, true), D6 = L6.getFloat32(b6 + 4, true), N6 = L6.getFloat32(b6 + 8, true); if (P6) { var B6 = L6.getUint16(b6 + 48, true); 32768 & B6 ? (y6 = w6, v6 = A6, m6 = M6) : (y6 = (31 & B6) / 31, v6 = (31 & B6 >> 5) / 31, m6 = (31 & B6 >> 10) / 31); } for (var U6 = 1; 3 >= U6; U6++) { var G6 = b6 + 12 * U6, Y = 3 * (3 * I6) + 3 * (U6 - 1); E6[Y] = L6.getFloat32(G6, true), E6[Y + 1] = L6.getFloat32(G6 + 4, true), E6[Y + 2] = L6.getFloat32(G6 + 8, true), C6[Y] = F6, C6[Y + 1] = D6, C6[Y + 2] = N6, P6 && (x6[Y] = y6, x6[Y + 1] = v6, x6[Y + 2] = m6); } } return S6.setAttribute("position", new l.BufferAttribute(E6, 3)), S6.setAttribute("normal", new l.BufferAttribute(C6, 3)), P6 && (S6.setAttribute("color", new l.BufferAttribute(x6, 3)), S6.hasColors = true, S6.alpha = R6), S6; }(p) : function(u6) { for (var y6, v6 = new l.BufferGeometry(), m6 = /solid([\s\S]*?)endsolid/g, x6 = /facet([\s\S]*?)endfacet/g, w6 = 0, A6 = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, M6 = new RegExp("vertex" + A6 + A6 + A6, "g"), R6 = new RegExp("normal" + A6 + A6 + A6, "g"), L6 = [], T6 = [], P6 = new l.Vector3(), _6 = 0, S6 = 0, E6 = 0; (y6 = m6.exec(u6)) !== null; ) { S6 = E6; for (var C6 = y6[0]; (y6 = x6.exec(C6)) !== null; ) { for (var I6 = 0, b6 = 0, F6 = y6[0]; (y6 = R6.exec(F6)) !== null; ) P6.x = parseFloat(y6[1]), P6.y = parseFloat(y6[2]), P6.z = parseFloat(y6[3]), b6++; for (; (y6 = M6.exec(F6)) !== null; ) L6.push(parseFloat(y6[1]), parseFloat(y6[2]), parseFloat(y6[3])), T6.push(P6.x, P6.y, P6.z), I6++, E6++; b6 !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + w6), I6 !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + w6), w6++; } var D6 = S6, N6 = E6 - S6; v6.addGroup(D6, N6, _6), _6++; } return v6.setAttribute("position", new l.Float32BufferAttribute(L6, 3)), v6.setAttribute("normal", new l.Float32BufferAttribute(T6, 3)), v6; }(function(u6) { return typeof u6 == "string" ? u6 : l.LoaderUtils.decodeText(new Uint8Array(u6)); }(f6)); } } }, /* 37 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ OBJLoader: () => ( /* binding */ w6 ) /* harmony export */ }); var l = c(4), d = /^[og]\s*(.+)?/, h6 = /^mtllib /, f6 = /^usemtl /, g6 = /^usemap /, p = new l.Vector3(), u6 = new l.Vector3(), y6 = new l.Vector3(), v6 = new l.Vector3(), m6 = new l.Vector3(); function x6() { var A6 = { objects: [], object: {}, vertices: [], normals: [], colors: [], uvs: [], materials: {}, materialLibraries: [], startObject: function(R6, L6) { if (this.object && this.object.fromDeclaration === false) return this.object.name = R6, void (this.object.fromDeclaration = L6 !== false); var T6 = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0; if (this.object && typeof this.object._finalize == "function" && this.object._finalize(true), this.object = { name: R6 || "", fromDeclaration: L6 !== false, geometry: { vertices: [], normals: [], colors: [], uvs: [], hasUVIndices: false }, materials: [], smooth: true, startMaterial: function(S6, E6) { var C6 = this._finalize(false); C6 && (C6.inherited || 0 >= C6.groupCount) && this.materials.splice(C6.index, 1); var I6 = { index: this.materials.length, name: S6 || "", mtllib: Array.isArray(E6) && 0 < E6.length ? E6[E6.length - 1] : "", smooth: C6 === void 0 ? this.smooth : C6.smooth, groupStart: C6 === void 0 ? 0 : C6.groupEnd, groupEnd: -1, groupCount: -1, inherited: false, clone: function(F6) { var D6 = { index: typeof F6 == "number" ? F6 : this.index, name: this.name, mtllib: this.mtllib, smooth: this.smooth, groupStart: 0, groupEnd: -1, groupCount: -1, inherited: false }; return D6.clone = this.clone.bind(D6), D6; } }; return this.materials.push(I6), I6; }, currentMaterial: function() { return 0 < this.materials.length ? this.materials[this.materials.length - 1] : void 0; }, _finalize: function(S6) { var E6 = this.currentMaterial(); if (E6 && E6.groupEnd === -1 && (E6.groupEnd = this.geometry.vertices.length / 3, E6.groupCount = E6.groupEnd - E6.groupStart, E6.inherited = false), S6 && 1 < this.materials.length) for (var C6 = this.materials.length - 1; 0 <= C6; C6--) 0 >= this.materials[C6].groupCount && this.materials.splice(C6, 1); return S6 && this.materials.length === 0 && this.materials.push({ name: "", smooth: this.smooth }), E6; } }, T6 && T6.name && typeof T6.clone == "function") { var P6 = T6.clone(0); P6.inherited = true, this.object.materials.push(P6); } this.objects.push(this.object); }, finalize: function() { this.object && typeof this.object._finalize == "function" && this.object._finalize(true); }, parseVertexIndex: function(R6, L6) { var T6 = parseInt(R6, 10); return 3 * (0 <= T6 ? T6 - 1 : T6 + L6 / 3); }, parseNormalIndex: function(R6, L6) { var T6 = parseInt(R6, 10); return 3 * (0 <= T6 ? T6 - 1 : T6 + L6 / 3); }, parseUVIndex: function(R6, L6) { var T6 = parseInt(R6, 10); return 2 * (0 <= T6 ? T6 - 1 : T6 + L6 / 2); }, addVertex: function(R6, L6, T6) { var P6 = this.vertices, _6 = this.object.geometry.vertices; _6.push(P6[R6 + 0], P6[R6 + 1], P6[R6 + 2]), _6.push(P6[L6 + 0], P6[L6 + 1], P6[L6 + 2]), _6.push(P6[T6 + 0], P6[T6 + 1], P6[T6 + 2]); }, addVertexPoint: function(R6) { var L6 = this.vertices, T6 = this.object.geometry.vertices; T6.push(L6[R6 + 0], L6[R6 + 1], L6[R6 + 2]); }, addVertexLine: function(R6) { var L6 = this.vertices, T6 = this.object.geometry.vertices; T6.push(L6[R6 + 0], L6[R6 + 1], L6[R6 + 2]); }, addNormal: function(R6, L6, T6) { var P6 = this.normals, _6 = this.object.geometry.normals; _6.push(P6[R6 + 0], P6[R6 + 1], P6[R6 + 2]), _6.push(P6[L6 + 0], P6[L6 + 1], P6[L6 + 2]), _6.push(P6[T6 + 0], P6[T6 + 1], P6[T6 + 2]); }, addFaceNormal: function(R6, L6, T6) { var P6 = this.vertices, _6 = this.object.geometry.normals; p.fromArray(P6, R6), u6.fromArray(P6, L6), y6.fromArray(P6, T6), m6.subVectors(y6, u6), v6.subVectors(p, u6), m6.cross(v6), m6.normalize(), _6.push(m6.x, m6.y, m6.z), _6.push(m6.x, m6.y, m6.z), _6.push(m6.x, m6.y, m6.z); }, addColor: function(R6, L6, T6) { var P6 = this.colors, _6 = this.object.geometry.colors; P6[R6] !== void 0 && _6.push(P6[R6 + 0], P6[R6 + 1], P6[R6 + 2]), P6[L6] !== void 0 && _6.push(P6[L6 + 0], P6[L6 + 1], P6[L6 + 2]), P6[T6] !== void 0 && _6.push(P6[T6 + 0], P6[T6 + 1], P6[T6 + 2]); }, addUV: function(R6, L6, T6) { var P6 = this.uvs, _6 = this.object.geometry.uvs; _6.push(P6[R6 + 0], P6[R6 + 1]), _6.push(P6[L6 + 0], P6[L6 + 1]), _6.push(P6[T6 + 0], P6[T6 + 1]); }, addDefaultUV: function() { var R6 = this.object.geometry.uvs; R6.push(0, 0), R6.push(0, 0), R6.push(0, 0); }, addUVLine: function(R6) { var L6 = this.uvs, T6 = this.object.geometry.uvs; T6.push(L6[R6 + 0], L6[R6 + 1]); }, addFace: function(R6, L6, T6, P6, _6, S6, E6, C6, I6) { var b6 = this.vertices.length, F6 = this.parseVertexIndex(R6, b6), D6 = this.parseVertexIndex(L6, b6), N6 = this.parseVertexIndex(T6, b6); if (this.addVertex(F6, D6, N6), this.addColor(F6, D6, N6), E6 !== void 0 && E6 !== "") { var B6 = this.normals.length; F6 = this.parseNormalIndex(E6, B6), D6 = this.parseNormalIndex(C6, B6), N6 = this.parseNormalIndex(I6, B6), this.addNormal(F6, D6, N6); } else this.addFaceNormal(F6, D6, N6); if (P6 !== void 0 && P6 !== "") { var U6 = this.uvs.length; F6 = this.parseUVIndex(P6, U6), D6 = this.parseUVIndex(_6, U6), N6 = this.parseUVIndex(S6, U6), this.addUV(F6, D6, N6), this.object.geometry.hasUVIndices = true; } else this.addDefaultUV(); }, addPointGeometry: function(R6) { this.object.geometry.type = "Points"; for (var L6, T6 = this.vertices.length, P6 = 0, _6 = R6.length; P6 < _6; P6++) L6 = this.parseVertexIndex(R6[P6], T6), this.addVertexPoint(L6), this.addColor(L6); }, addLineGeometry: function(R6, L6) { this.object.geometry.type = "Line"; for (var T6 = this.vertices.length, P6 = this.uvs.length, _6 = 0, S6 = R6.length; _6 < S6; _6++) this.addVertexLine(this.parseVertexIndex(R6[_6], T6)); for (var E6 = 0, C6 = L6.length; E6 < C6; E6++) this.addUVLine(this.parseUVIndex(L6[E6], P6)); } }; return A6.startObject("", false), A6; } class w6 extends l.Loader { constructor(M6) { super(M6), this.materials = null; } load(M6, R6, L6, T6) { var P6 = this, _6 = new l.FileLoader(this.manager); _6.setPath(this.path), _6.setRequestHeader(this.requestHeader), _6.setWithCredentials(this.withCredentials), _6.load(M6, function(S6) { try { R6(P6.parse(S6)); } catch (E6) { T6 ? T6(E6) : console.error(E6), P6.manager.itemError(M6); } }, L6, T6); } setMaterials(M6) { return this.materials = M6, this; } parse(M6) { var R6 = new x6(); M6.indexOf(`\r `) !== -1 && (M6 = M6.replace(/\r\n/g, ` `)), M6.indexOf(`\\ `) !== -1 && (M6 = M6.replace(/\\\n/g, "")); for (var L6 = M6.split(` `), T6 = "", P6 = "", _6 = 0, S6 = [], E6 = typeof "".trimLeft == "function", C6 = 0, I6 = L6.length; C6 < I6; C6++) if (T6 = L6[C6], T6 = E6 ? T6.trimLeft() : T6.trim(), _6 = T6.length, _6 !== 0 && (P6 = T6.charAt(0), P6 !== "#")) if (P6 === "v") { var b6 = T6.split(/\s+/); switch (b6[0]) { case "v": R6.vertices.push(parseFloat(b6[1]), parseFloat(b6[2]), parseFloat(b6[3])), 7 <= b6.length ? R6.colors.push(parseFloat(b6[4]), parseFloat(b6[5]), parseFloat(b6[6])) : R6.colors.push(void 0, void 0, void 0); break; case "vn": R6.normals.push(parseFloat(b6[1]), parseFloat(b6[2]), parseFloat(b6[3])); break; case "vt": R6.uvs.push(parseFloat(b6[1]), parseFloat(b6[2])); } } else if (P6 === "f") { for (var F6, D6 = T6.substr(1).trim(), N6 = D6.split(/\s+/), B6 = [], U6 = 0, G6 = N6.length; U6 < G6; U6++) if (F6 = N6[U6], 0 < F6.length) { var Y = F6.split("/"); B6.push(Y); } for (var te = B6[0], ae = 1, ie = B6.length - 1; ae < ie; ae++) { var le = B6[ae], W6 = B6[ae + 1]; R6.addFace(te[0], le[0], W6[0], te[1], le[1], W6[1], te[2], le[2], W6[2]); } } else if (P6 === "l") { var $6 = T6.substring(1).trim().split(" "), j6 = [], re = []; if (T6.indexOf("/") === -1) j6 = $6; else for (var k6, H6 = 0, K = $6.length; H6 < K; H6++) k6 = $6[H6].split("/"), k6[0] !== "" && j6.push(k6[0]), k6[1] !== "" && re.push(k6[1]); R6.addLineGeometry(j6, re); } else if (P6 === "p") { var ce = T6.substr(1).trim(), se = ce.split(" "); R6.addPointGeometry(se); } else if ((S6 = d.exec(T6)) !== null) { var V6 = (" " + S6[0].substr(1).trim()).substr(1); R6.startObject(V6); } else if (f6.test(T6)) R6.object.startMaterial(T6.substring(7).trim(), R6.materialLibraries); else if (h6.test(T6)) R6.materialLibraries.push(T6.substring(7).trim()); else if (g6.test(T6)) console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.'); else if (P6 === "s") { if (S6 = T6.split(" "), 1 < S6.length) { var O6 = S6[1].trim().toLowerCase(); R6.object.smooth = O6 !== "0" && O6 !== "off"; } else R6.object.smooth = true; var Z6 = R6.object.currentMaterial(); Z6 && (Z6.smooth = R6.object.smooth); } else { if (T6 === "\0") continue; console.warn('THREE.OBJLoader: Unexpected line: "' + T6 + '"'); } R6.finalize(); var X = new l.Group(); X.materialLibraries = [].concat(R6.materialLibraries); var ee = R6.objects.length !== 1 || R6.objects[0].geometry.vertices.length !== 0; if (ee == true) for (var fe = 0, be = R6.objects.length; fe < be; fe++) { var Ae = R6.objects[fe], he = Ae.geometry, xe = Ae.materials, ne = he.type === "Line", me = he.type === "Points", Me = false; if (he.vertices.length !== 0) { var De = new l.BufferGeometry(); De.setAttribute("position", new l.Float32BufferAttribute(he.vertices, 3)), 0 < he.normals.length && De.setAttribute("normal", new l.Float32BufferAttribute(he.normals, 3)), 0 < he.colors.length && (Me = true, De.setAttribute("color", new l.Float32BufferAttribute(he.colors, 3))), he.hasUVIndices === true && De.setAttribute("uv", new l.Float32BufferAttribute(he.uvs, 2)); for (var Ie = [], $e = 0, lt = xe.length; $e < lt; $e++) { var qe = xe[$e], Mt = qe.name + "_" + qe.smooth + "_" + Me, Be = R6.materials[Mt]; if (this.materials !== null) { if (Be = this.materials.create(qe.name), ne && Be && !(Be instanceof l.LineBasicMaterial)) { var it = new l.LineBasicMaterial(); l.Material.prototype.copy.call(it, Be), it.color.copy(Be.color), Be = it; } else if (me && Be && !(Be instanceof l.PointsMaterial)) { var tt = new l.PointsMaterial({ size: 10, sizeAttenuation: false }); l.Material.prototype.copy.call(tt, Be), tt.color.copy(Be.color), tt.map = Be.map, Be = tt; } } Be === void 0 && (Be = ne ? new l.LineBasicMaterial() : me ? new l.PointsMaterial({ size: 1, sizeAttenuation: false }) : new l.MeshPhongMaterial(), Be.name = qe.name, Be.flatShading = !qe.smooth, Be.vertexColors = Me, R6.materials[Mt] = Be), Ie.push(Be); } var qt = void 0; if (1 < Ie.length) { for (var Qt, Pt = 0, Nt = xe.length; Pt < Nt; Pt++) Qt = xe[Pt], De.addGroup(Qt.groupStart, Qt.groupCount, Pt); qt = ne ? new l.LineSegments(De, Ie) : me ? new l.Points(De, Ie) : new l.Mesh(De, Ie); } else qt = ne ? new l.LineSegments(De, Ie[0]) : me ? new l.Points(De, Ie[0]) : new l.Mesh(De, Ie[0]); qt.name = Ae.name, X.add(qt); } } else if (0 < R6.vertices.length) { var Vi = new l.PointsMaterial({ size: 1, sizeAttenuation: false }), Gi = new l.BufferGeometry(); Gi.setAttribute("position", new l.Float32BufferAttribute(R6.vertices, 3)), 0 < R6.colors.length && R6.colors[0] !== void 0 && (Gi.setAttribute("color", new l.Float32BufferAttribute(R6.colors, 3)), Vi.vertexColors = true); var ni = new l.Points(Gi, Vi); X.add(ni); } return X; } } }, /* 38 */ /***/ (o, a6, c) => { function l(w6, A6) { var M6 = Object.keys(w6); if (Object.getOwnPropertySymbols) { var R6 = Object.getOwnPropertySymbols(w6); A6 && (R6 = R6.filter(function(L6) { return Object.getOwnPropertyDescriptor(w6, L6).enumerable; })), M6.push.apply(M6, R6); } return M6; } function d(w6) { for (var A6, M6 = 1; M6 < arguments.length; M6++) A6 = arguments[M6] == null ? {} : arguments[M6], M6 % 2 ? l(Object(A6), true).forEach(function(R6) { h6(w6, R6, A6[R6]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(w6, Object.getOwnPropertyDescriptors(A6)) : l(Object(A6)).forEach(function(R6) { Object.defineProperty(w6, R6, Object.getOwnPropertyDescriptor(A6, R6)); }); return w6; } function h6(w6, A6, M6) { return (A6 = f6(A6)) in w6 ? Object.defineProperty(w6, A6, { value: M6, enumerable: true, configurable: true, writable: true }) : w6[A6] = M6, w6; } function f6(w6) { var A6 = g6(w6, "string"); return typeof A6 == "symbol" ? A6 : A6 + ""; } function g6(w6, A6) { if (typeof w6 != "object" || !w6) return w6; var M6 = w6[Symbol.toPrimitive]; if (M6 !== void 0) { var R6 = M6.call(w6, A6 || "default"); if (typeof R6 != "object") return R6; throw new TypeError("@@toPrimitive must return a primitive value."); } return (A6 === "string" ? String : Number)(w6); } var p = c(19).JSONLoader, u6 = c(4), y6 = u6.FileLoader, v6 = (w6) => { var A6 = (R6, L6) => { R6.merge(L6); }; if (w6 && 0 < w6.length) { for (; 1 < w6.length; ) { var M6 = w6.splice(1, 1); A6(w6[0], M6[0]); } return w6[0]; } }, m6 = function(A6, M6, R6) { var L6 = new y6(), T6 = new p(); L6.crossOrigin = M6; var P6 = A6, _6 = R6, S6 = void 0, E6 = false, C6 = false, I6 = void 0, b6 = [], F6 = (U6) => { var G6 = S6[U6.index]; if (G6) { var Y = T6.parse(G6); U6.onLoad(Y.geometry, Y.materials); } else D6(U6); }, D6 = (U6) => { U6.onError && (!I6 && (I6 = { responseURL: P6 }), U6.onError(I6)); }; this.downloadCompleted = (U6) => { try { S6 = JSON.parse(U6[0]), E6 = false, C6 = true, Array.isArray(S6) ? b6.forEach((G6) => F6(G6)) : b6.forEach((G6) => D6(G6)); } catch { b6.forEach((Y) => D6(Y)); } }; var N6 = () => (U6) => { I6 = U6, C6 = true, E6 = false, b6.forEach((G6) => { D6(G6); }); }, B6 = () => (U6) => { b6.forEach((G6) => { G6.onProgress && G6.onProgress(U6); }); }; this.load = (U6, G6, Y, te) => { var ae = { index: U6, onLoad: G6, onProgress: Y, onError: te }; C6 ? S6 ? F6(ae) : D6(I6) : E6 ? b6.push(ae) : (b6.push(ae), E6 = true, L6.load(P6, _6, B6, N6)); }; }, x6 = function(A6, M6) { var R6 = [], L6 = A6, T6 = M6, P6 = 0; this.itemDownloaded = (_6, S6) => { if (R6[_6] = S6, P6++, P6 == L6) { for (var E6 = R6[0][1], C6 = R6.map((F6) => F6[0]), I6 = v6(C6), b6 = 1; b6 < L6; b6++) R6[_6][0].dispose(), R6[_6][1].forEach((F6) => F6.dispose()); T6(I6, E6); } }; }; a6.PrimitivesLoader = function() { var w6 = 0, A6 = 20; this.crossOrigin = "Anonymous"; var M6 = new p(), R6 = [], L6 = {}, T6 = (E6, C6, I6, b6, F6) => { var D6 = E6.length, N6 = new x6(D6, C6), B6 = 0; E6.forEach((U6) => { var G6 = F6 ? d({}, F6) : {}; G6.msHandler = N6, G6.order = B6, B6++, _6(U6, C6, I6, b6, G6); }); }, P6 = (E6, C6, I6, b6, F6) => { var D6 = F6 ? d({}, F6) : {}, N6 = L6[E6]; if (!N6) if (A6 > w6) { var B6 = new S6(void 0, this, D6); ++w6, N6 = new m6(E6, this.crossOrigin, B6), L6[E6] = N6; } else R6.push({ url: E6, onLoad: C6, onProgress: I6, onError: b6, options: F6 }); N6 && (D6.isHandler = N6, N6.load(F6.index, C6, I6, b6)); }, _6 = (E6, C6, I6, b6, F6) => { if (F6 && F6.index !== void 0) P6(E6, C6, I6, b6, F6); else if (A6 > w6) { ++w6; var D6 = new S6(C6, this, F6), N6 = new S6(b6, this, F6); M6.crossOrigin = this.crossOrigin, M6.load(E6, D6, I6, N6); } else R6.push({ url: E6, onLoad: C6, onProgress: I6, onError: b6, options: F6 }); }; this.load = (E6, C6, I6, b6, F6) => { Array.isArray(E6) ? T6(E6, C6, I6, b6, F6) : _6(E6, C6, I6, b6, F6); }, this.loadFromWaitingList = () => { for (; A6 > w6; ) { var E6 = R6.shift(); if (E6) this.load(E6.url, E6.onLoad, E6.onProgress, E6.onError, E6.options); else return; } }, this.itemRemainingCheck = () => { if (R6.length === 0 && w6 == 0) for (var E6 in L6) L6.hasOwnProperty(E6) && delete L6[E6]; }; var S6 = function(C6, I6, b6) { return function() { --w6; for (var F6 = arguments.length, D6 = Array(F6), N6 = 0; N6 < F6; N6++) D6[N6] = arguments[N6]; b6 != null && b6.msHandler ? b6.msHandler.itemDownloaded(b6.order, D6) : b6 != null && b6.isHandler ? b6.isHandler.downloadCompleted(D6) : C6 && C6(...D6), I6.loadFromWaitingList(), I6.itemRemainingCheck(); }; }; this.parse = (E6) => M6.parse(E6); }; }, /* 39 */ /***/ (o, a6, c) => { var l = c(4), d = c(5).mergeGeometries, h6 = function() { c(10).ZincObject.call(this), this.isTubeLines = true; var f6 = {}, g6 = { radius: 1, radialSegments: 8, smooth: false }; this.createLineSegment = (u6, y6, v6) => { if (u6 && y6) { f6 = { geometryIn: u6, materialIn: y6, options: v6 }; var m6 = p(u6.vertices), x6 = new l.MeshStandardMaterial({ color: y6.color }), w6 = new l.Mesh(m6, x6); this.setMesh(w6, v6.localTimeEnabled, v6.localMorphColour); } }, this.setWidth = (u6) => { this.morph && this.morph.material && (this.morph.material.linewidth = u6, this.morph.material.needsUpdate = true); }, this.setAlpha = function(u6) { var y6 = this.getMorph(); y6.material.opacity = u6, y6.material.transparent = 1 > u6, y6.material.depthWrite = 0.5 < u6; }, this.setWireframe = (u6) => { var y6 = this.getMorph(); y6.material.wireframe = u6; }, this.setTubeLines = (u6, y6) => { if (u6 && y6) { var { geometryIn: v6 } = f6, m6 = this.getMorph(); m6.geometry.dispose(), g6 = Object.assign(g6, { radius: u6, radialSegments: y6 }), m6.geometry = p(v6.vertices); } }; var p = (u6) => { var y6, { radius: v6, radialSegments: m6, smooth: x6 } = g6; if (x6) { var w6 = new l.CatmullRomCurve3(u6); y6 = new l.TubeGeometry(w6, u6.length, v6, m6, false); } else { for (var A6 = [], M6 = 0; M6 + 1 < u6.length; M6 += 2) { var R6 = new l.LineCurve3(u6[M6], u6[M6 + 1]), L6 = new l.TubeGeometry(R6, 1, v6, m6, false); A6.push(L6); } y6 = d(A6, true), A6.forEach((T6) => T6.dispose()); } return y6; }; }; h6.prototype = Object.create(c(10).ZincObject.prototype), a6.TubeLines = h6; }, /* 40 */ /***/ (o, a6, c) => { c(4); var l = c(41).GLTFLoader, d = function() { var h6 = this; this.parseGLTFObjects = (f6, g6, p, u6) => { var y6 = g6; if (p !== 0) { if (f6.type !== "Object3D") { var v6; if (f6.type === "Mesh" ? v6 = new (c(3)).Geometry() : f6.type === "LineSegments" ? v6 = new (c(24)).Lines() : f6.type === "Points" && (v6 = new (c(22)).Pointset()), v6) { var m6 = false, x6 = false; f6.geometry && f6.geometry.morphAttributes && (m6 = !!f6.geometry.morphAttributes.position, x6 = !!f6.geometry.morphAttributes.color), v6.setMesh(f6.clone(), m6, x6); var w6 = v6.getMorph(); v6.groupName = w6.name, w6.matrixAutoUpdate = true, g6.addZincObject(v6), u6 != null && typeof u6 == "function" && u6(v6); } } else if (f6.name !== "" && (g6 && (y6 = g6.findOrCreateChildFromPath(f6.name)), y6)) { var A6 = y6.getGroup(); A6.position.copy(f6.position), A6.rotation.copy(f6.rotation), A6.quaternion.copy(f6.quaternion), A6.matrixAutoUpdate = true; } } p++, f6.children.forEach((M6) => { h6.parseGLTFObjects(M6, y6, p, u6); }); }, this.setCamera = (f6) => { f6.viewAll(); var g6 = f6.getZincCameraControls(), p = g6.getCurrentViewport(); g6.addViewport("default", p), g6.setDefaultViewport("default"); }, this.load = (f6, g6, p, u6, y6) => { var v6 = p.substring(0, p.lastIndexOf("/") + 1), m6 = p.substring(p.lastIndexOf("/") + 1, p.length), x6 = new l().setPath(v6); x6.load(m6, function(w6) { console.log(w6), h6.parseGLTFObjects(w6.scene, g6, 0, u6), h6.setCamera(f6), y6 != null && typeof y6 == "function" && y6(); }); }; }; a6.GLTFToZincJSLoader = d; }, /* 41 */ /***/ (o) => { o.exports = T4; }, /* 42 */ /***/ (o, a6, c) => { var l = c(43).GLTFExporter, d = function(h6) { var f6 = h6; this.exportGLTF = (g6) => { var p = f6.getRootRegion(), u6 = p.getAllObjects(true), y6 = []; u6.forEach((x6) => { x6.animationClip && y6.push({ clip: x6.animationClip[0], mesh: x6.getMorph() }); }); var v6 = new l(), m6 = { binary: g6, animations: y6 }; return new Promise((x6) => { v6.parse(f6.getThreeJSScene(), function(w6) { x6(w6); }, m6); }); }; }; a6.SceneExporter = d; }, /* 43 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ GLTFExporter: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); class d { constructor() { this.pluginCallbacks = [], this.register(function(b6) { return new S6(b6); }), this.register(function(b6) { return new E6(b6); }), this.register(function(b6) { return new C6(b6); }); } register(b6) { return this.pluginCallbacks.indexOf(b6) === -1 && this.pluginCallbacks.push(b6), this; } unregister(b6) { return this.pluginCallbacks.indexOf(b6) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(b6), 1), this; } /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */ parse(b6, F6, D6) { for (var N6 = new _6(), B6 = [], U6 = 0, G6 = this.pluginCallbacks.length; U6 < G6; U6++) B6.push(this.pluginCallbacks[U6](N6)); N6.setPlugins(B6), N6.write(b6, F6, D6); } } var h6 = { POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123, FLOAT: 5126, UNSIGNED_INT: 5125, ARRAY_BUFFER: 34962, ELEMENT_ARRAY_BUFFER: 34963, NEAREST: 9728, LINEAR: 9729, NEAREST_MIPMAP_NEAREST: 9984, LINEAR_MIPMAP_NEAREST: 9985, NEAREST_MIPMAP_LINEAR: 9986, LINEAR_MIPMAP_LINEAR: 9987, CLAMP_TO_EDGE: 33071, MIRRORED_REPEAT: 33648, REPEAT: 10497 }, f6 = {}; f6[l.NearestFilter] = h6.NEAREST, f6[l.NearestMipmapNearestFilter] = h6.NEAREST_MIPMAP_NEAREST, f6[l.NearestMipmapLinearFilter] = h6.NEAREST_MIPMAP_LINEAR, f6[l.LinearFilter] = h6.LINEAR, f6[l.LinearMipmapNearestFilter] = h6.LINEAR_MIPMAP_NEAREST, f6[l.LinearMipmapLinearFilter] = h6.LINEAR_MIPMAP_LINEAR, f6[l.ClampToEdgeWrapping] = h6.CLAMP_TO_EDGE, f6[l.RepeatWrapping] = h6.REPEAT, f6[l.MirroredRepeatWrapping] = h6.MIRRORED_REPEAT; var g6 = { scale: "scale", position: "translation", quaternion: "rotation", morphTargetInfluences: "weights" }, p = 12, u6 = 1179937895, y6 = 2, v6 = 8, m6 = 1313821514, x6 = 5130562; function w6(I6, b6) { return I6.length === b6.length && I6.every(function(F6, D6) { return F6 === b6[D6]; }); } function A6(I6) { if (window.TextEncoder !== void 0) return new TextEncoder().encode(I6).buffer; for (var b6, F6 = new Uint8Array(new ArrayBuffer(I6.length)), D6 = 0, N6 = I6.length; D6 < N6; D6++) b6 = I6.charCodeAt(D6), F6[D6] = 255 < b6 ? 32 : b6; return F6.buffer; } function M6(I6) { return w6(I6.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); } function R6(I6, b6, F6) { for (var D6 = { min: Array(I6.itemSize).fill(Number.POSITIVE_INFINITY), max: Array(I6.itemSize).fill(Number.NEGATIVE_INFINITY) }, N6 = b6; N6 < b6 + F6; N6++) for (var B6, U6 = 0; U6 < I6.itemSize; U6++) B6 = void 0, 4 < I6.itemSize ? B6 = I6.array[N6 * I6.itemSize + U6] : U6 === 0 ? B6 = I6.getX(N6) : U6 === 1 ? B6 = I6.getY(N6) : U6 === 2 ? B6 = I6.getZ(N6) : U6 == 3 && (B6 = I6.getW(N6)), D6.min[U6] = Math.min(D6.min[U6], B6), D6.max[U6] = Math.max(D6.max[U6], B6); return D6; } function L6(I6) { return 4 * Math.ceil(I6 / 4); } function T6(I6) { var b6 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0, F6 = L6(I6.byteLength); if (F6 !== I6.byteLength) { var D6 = new Uint8Array(F6); if (D6.set(new Uint8Array(I6)), b6 !== 0) for (var N6 = I6.byteLength; N6 < F6; N6++) D6[N6] = b6; return D6.buffer; } return I6; } var P6 = null; class _6 { constructor() { this.plugins = [], this.options = {}, this.pending = [], this.buffers = [], this.byteOffset = 0, this.buffers = [], this.nodeMap = /* @__PURE__ */ new Map(), this.skins = [], this.extensionsUsed = {}, this.uids = /* @__PURE__ */ new Map(), this.uid = 0, this.json = { asset: { version: "2.0", generator: "THREE.GLTFExporter" } }, this.cache = { meshes: /* @__PURE__ */ new Map(), attributes: /* @__PURE__ */ new Map(), attributesNormalized: /* @__PURE__ */ new Map(), materials: /* @__PURE__ */ new Map(), textures: /* @__PURE__ */ new Map(), images: /* @__PURE__ */ new Map() }; } setPlugins(b6) { this.plugins = b6; } /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */ write(b6, F6, D6) { this.options = Object.assign({}, { // default options binary: false, trs: false, onlyVisible: true, truncateDrawRange: true, embedImages: true, maxTextureSize: 1 / 0, animations: [], includeCustomExtensions: false }, D6), 0 < this.options.animations.length && (this.options.trs = true), this.processInput(b6); var N6 = this; Promise.all(this.pending).then(function() { var B6 = N6.buffers, U6 = N6.json, G6 = N6.options, Y = N6.extensionsUsed, te = new Blob(B6, { type: "application/octet-stream" }), ae = Object.keys(Y); if (0 < ae.length && (U6.extensionsUsed = ae), U6.buffers && 0 < U6.buffers.length && (U6.buffers[0].byteLength = te.size), G6.binary === true) { var ie = new window.FileReader(); ie.readAsArrayBuffer(te), ie.onloadend = function() { var W6 = T6(ie.result), $6 = new DataView(new ArrayBuffer(v6)); $6.setUint32(0, W6.byteLength, true), $6.setUint32(4, x6, true); var j6 = T6(A6(JSON.stringify(U6)), 32), re = new DataView(new ArrayBuffer(v6)); re.setUint32(0, j6.byteLength, true), re.setUint32(4, m6, true); var k6 = new ArrayBuffer(p), H6 = new DataView(k6); H6.setUint32(0, u6, true), H6.setUint32(4, y6, true); var K = p + re.byteLength + j6.byteLength + $6.byteLength + W6.byteLength; H6.setUint32(8, K, true); var ce = new Blob([k6, re, j6, $6, W6], { type: "application/octet-stream" }), se = new window.FileReader(); se.readAsArrayBuffer(ce), se.onloadend = function() { F6(se.result); }; }; } else if (U6.buffers && 0 < U6.buffers.length) { var le = new window.FileReader(); le.readAsDataURL(te), le.onloadend = function() { var W6 = le.result; U6.buffers[0].uri = W6, F6(U6); }; } else F6(U6); }); } /** * Serializes a userData. * * @param {THREE.Object3D|THREE.Material} object * @param {Object} objectDef */ serializeUserData(b6, F6) { if (!(b6.userData && b6.userData.isZincObject) && Object.keys(b6.userData).length !== 0) { var D6 = this.options, N6 = this.extensionsUsed; try { var B6 = JSON.parse(JSON.stringify(b6.userData)); if (D6.includeCustomExtensions && B6.gltfExtensions) { for (var U6 in F6.extensions === void 0 && (F6.extensions = {}), B6.gltfExtensions) F6.extensions[U6] = B6.gltfExtensions[U6], N6[U6] = true; delete B6.gltfExtensions; } 0 < Object.keys(B6).length && (F6.extras = B6); } catch (G6) { console.warn("THREE.GLTFExporter: userData of '" + b6.name + "' won't be serialized because of JSON.stringify error - " + G6.message); } } } /** * Assign and return a temporal unique id for an object * especially which doesn't have .uuid * @param {Object} object * @return {Integer} */ getUID(b6) { return this.uids.has(b6) || this.uids.set(b6, this.uid++), this.uids.get(b6); } /** * Checks if normal attribute values are normalized. * * @param {BufferAttribute} normal * @returns {Boolean} */ isNormalizedNormalAttribute(b6) { var F6 = this.cache; if (F6.attributesNormalized.has(b6)) return false; for (var D6 = new l.Vector3(), N6 = 0, B6 = b6.count; N6 < B6; N6++) if (5e-4 < Math.abs(D6.fromBufferAttribute(b6, N6).length() - 1)) return false; return true; } /** * Creates normalized normal buffer attribute. * * @param {BufferAttribute} normal * @returns {BufferAttribute} * */ createNormalizedNormalAttribute(b6) { var F6 = this.cache; if (F6.attributesNormalized.has(b6)) return F6.attributesNormalized.get(b6); for (var D6 = b6.clone(), N6 = new l.Vector3(), B6 = 0, U6 = D6.count; B6 < U6; B6++) N6.fromBufferAttribute(D6, B6), N6.x === 0 && N6.y === 0 && N6.z === 0 ? N6.setX(1) : N6.normalize(), D6.setXYZ(B6, N6.x, N6.y, N6.z); return F6.attributesNormalized.set(b6, D6), D6; } /** * Applies a texture transform, if present, to the map definition. Requires * the KHR_texture_transform extension. * * @param {Object} mapDef * @param {THREE.Texture} texture */ applyTextureTransform(b6, F6) { var D6 = false, N6 = {}; (F6.offset.x !== 0 || F6.offset.y !== 0) && (N6.offset = F6.offset.toArray(), D6 = true), F6.rotation !== 0 && (N6.rotation = F6.rotation, D6 = true), (F6.repeat.x !== 1 || F6.repeat.y !== 1) && (N6.scale = F6.repeat.toArray(), D6 = true), D6 && (b6.extensions = b6.extensions || {}, b6.extensions.KHR_texture_transform = N6, this.extensionsUsed.KHR_texture_transform = true); } /** * Process a buffer to append to the default one. * @param {ArrayBuffer} buffer * @return {Integer} */ processBuffer(b6) { var F6 = this.json, D6 = this.buffers; return F6.buffers || (F6.buffers = [{ byteLength: 0 }]), D6.push(b6), 0; } /** * Process and generate a BufferView * @param {BufferAttribute} attribute * @param {number} componentType * @param {number} start * @param {number} count * @param {number} target (Optional) Target usage of the BufferView * @return {Object} */ processBufferView(b6, F6, D6, N6, B6) { var U6 = this.json; U6.bufferViews || (U6.bufferViews = []); for (var G6 = F6 === h6.UNSIGNED_BYTE ? 1 : F6 === h6.UNSIGNED_SHORT ? 2 : 4, Y = L6(N6 * b6.itemSize * G6), te = new DataView(new ArrayBuffer(Y)), ae = 0, ie = D6; ie < D6 + N6; ie++) for (var le, W6 = 0; W6 < b6.itemSize; W6++) le = void 0, 4 < b6.itemSize ? le = b6.array[ie * b6.itemSize + W6] : W6 === 0 ? le = b6.getX(ie) : W6 === 1 ? le = b6.getY(ie) : W6 === 2 ? le = b6.getZ(ie) : W6 == 3 && (le = b6.getW(ie)), F6 === h6.FLOAT ? te.setFloat32(ae, le, true) : F6 === h6.UNSIGNED_INT ? te.setUint32(ae, le, true) : F6 === h6.UNSIGNED_SHORT ? te.setUint16(ae, le, true) : F6 === h6.UNSIGNED_BYTE && te.setUint8(ae, le), ae += G6; var $6 = { buffer: this.processBuffer(te.buffer), byteOffset: this.byteOffset, byteLength: Y }; B6 !== void 0 && ($6.target = B6), B6 === h6.ARRAY_BUFFER && ($6.byteStride = b6.itemSize * G6), this.byteOffset += Y, U6.bufferViews.push($6); var j6 = { id: U6.bufferViews.length - 1, byteLength: 0 }; return j6; } /** * Process and generate a BufferView from an image Blob. * @param {Blob} blob * @return {Promise} */ processBufferViewImage(b6) { var F6 = this, D6 = F6.json; return D6.bufferViews || (D6.bufferViews = []), new Promise(function(N6) { var B6 = new window.FileReader(); B6.readAsArrayBuffer(b6), B6.onloadend = function() { var U6 = T6(B6.result), G6 = { buffer: F6.processBuffer(U6), byteOffset: F6.byteOffset, byteLength: U6.byteLength }; F6.byteOffset += U6.byteLength, N6(D6.bufferViews.push(G6) - 1); }; }); } /** * Process attribute to generate an accessor * @param {BufferAttribute} attribute Attribute to process * @param {THREE.BufferGeometry} geometry (Optional) Geometry used for truncated draw range * @param {Integer} start (Optional) * @param {Integer} count (Optional) * @return {Integer|null} Index of the processed accessor on the "accessors" array */ processAccessor(b6, F6, D6, N6) { var B6, U6 = this.options, G6 = this.json; if (b6.array.constructor === Float32Array) B6 = h6.FLOAT; else if (b6.array.constructor === Uint32Array) B6 = h6.UNSIGNED_INT; else if (b6.array.constructor === Uint16Array) B6 = h6.UNSIGNED_SHORT; else if (b6.array.constructor === Uint8Array) B6 = h6.UNSIGNED_BYTE; else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type."); if (D6 === void 0 && (D6 = 0), N6 === void 0 && (N6 = b6.count), U6.truncateDrawRange && F6 !== void 0 && F6.index === null) { var Y = D6 + N6, te = F6.drawRange.count === 1 / 0 ? b6.count : F6.drawRange.start + F6.drawRange.count; D6 = Math.max(D6, F6.drawRange.start), N6 = Math.min(Y, te) - D6, 0 > N6 && (N6 = 0); } if (N6 === 0) return null; var ae, ie = R6(b6, D6, N6); F6 !== void 0 && (ae = b6 === F6.index ? h6.ELEMENT_ARRAY_BUFFER : h6.ARRAY_BUFFER); var le = this.processBufferView(b6, B6, D6, N6, ae), W6 = { bufferView: le.id, byteOffset: le.byteOffset, componentType: B6, count: N6, max: ie.max, min: ie.min, type: { 1: "SCALAR", 2: "VEC2", 3: "VEC3", 4: "VEC4", 16: "MAT4" }[b6.itemSize] }; return b6.normalized === true && (W6.normalized = true), G6.accessors || (G6.accessors = []), G6.accessors.push(W6) - 1; } /** * Process image * @param {Image} image to process * @param {Integer} format of the image (e.g. RGBFormat, RGBAFormat etc) * @param {Boolean} flipY before writing out the image * @return {Integer} Index of the processed texture in the "images" array */ processImage(b6, F6, D6) { var N6 = this, B6 = N6.cache, U6 = N6.json, G6 = N6.options, Y = N6.pending; B6.images.has(b6) || B6.images.set(b6, {}); var te = B6.images.get(b6), ae = F6 === l.RGBAFormat ? "image/png" : "image/jpeg", ie = ae + ":flipY/" + D6.toString(); if (te[ie] !== void 0) return te[ie]; U6.images || (U6.images = []); var le = { mimeType: ae }; if (G6.embedImages) { var W6 = P6 = P6 || document.createElement("canvas"); W6.width = Math.min(b6.width, G6.maxTextureSize), W6.height = Math.min(b6.height, G6.maxTextureSize); var $6 = W6.getContext("2d"); if (D6 === true && ($6.translate(0, W6.height), $6.scale(1, -1)), typeof HTMLImageElement < "u" && b6 instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && b6 instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && b6 instanceof OffscreenCanvas || typeof ImageBitmap < "u" && b6 instanceof ImageBitmap) $6.drawImage(b6, 0, 0, W6.width, W6.height); else { F6 !== l.RGBAFormat && F6 !== l.RGBFormat && console.error("GLTFExporter: Only RGB and RGBA formats are supported."), (b6.width > G6.maxTextureSize || b6.height > G6.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", b6); var j6 = new Uint8ClampedArray(4 * (b6.height * b6.width)); if (F6 === l.RGBAFormat) for (var re = 0; re < j6.length; re += 4) j6[re + 0] = b6.data[re + 0], j6[re + 1] = b6.data[re + 1], j6[re + 2] = b6.data[re + 2], j6[re + 3] = b6.data[re + 3]; else for (var k6 = 0, H6 = 0; k6 < j6.length; k6 += 4, H6 += 3) j6[k6 + 0] = b6.data[H6 + 0], j6[k6 + 1] = b6.data[H6 + 1], j6[k6 + 2] = b6.data[H6 + 2], j6[k6 + 3] = 255; $6.putImageData(new ImageData(j6, b6.width, b6.height), 0, 0); } G6.binary === true ? Y.push(new Promise(function(ce) { W6.toBlob(function(se) { N6.processBufferViewImage(se).then(function(V6) { le.bufferView = V6, ce(); }); }, ae); })) : le.uri = W6.toDataURL(ae); } else le.uri = b6.src; var K = U6.images.push(le) - 1; return te[ie] = K, K; } /** * Process sampler * @param {Texture} map Texture to process * @return {Integer} Index of the processed texture in the "samplers" array */ processSampler(b6) { var F6 = this.json; F6.samplers || (F6.samplers = []); var D6 = { magFilter: f6[b6.magFilter], minFilter: f6[b6.minFilter], wrapS: f6[b6.wrapS], wrapT: f6[b6.wrapT] }; return F6.samplers.push(D6) - 1; } /** * Process texture * @param {Texture} map Map to process * @return {Integer} Index of the processed texture in the "textures" array */ processTexture(b6) { var F6 = this.cache, D6 = this.json; if (F6.textures.has(b6)) return F6.textures.get(b6); D6.textures || (D6.textures = []); var N6 = { sampler: this.processSampler(b6), source: this.processImage(b6.image, b6.format, b6.flipY) }; b6.name && (N6.name = b6.name), this._invokeAll(function(U6) { U6.writeTexture && U6.writeTexture(b6, N6); }); var B6 = D6.textures.push(N6) - 1; return F6.textures.set(b6, B6), B6; } /** * Process material * @param {THREE.Material} material Material to process * @return {Integer|null} Index of the processed material in the "materials" array */ processMaterial(b6) { var F6 = this.cache, D6 = this.json; if (F6.materials.has(b6)) return F6.materials.get(b6); if (b6.isShaderMaterial) return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."), null; D6.materials || (D6.materials = []); var N6 = { pbrMetallicRoughness: {} }; b6.isMeshStandardMaterial !== true && b6.isMeshBasicMaterial !== true && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results."); var B6 = b6.color.toArray().concat([b6.opacity]); if (w6(B6, [1, 1, 1, 1]) || (N6.pbrMetallicRoughness.baseColorFactor = B6), b6.isMeshStandardMaterial ? (N6.pbrMetallicRoughness.metallicFactor = b6.metalness, N6.pbrMetallicRoughness.roughnessFactor = b6.roughness) : (N6.pbrMetallicRoughness.metallicFactor = 0.5, N6.pbrMetallicRoughness.roughnessFactor = 0.5), b6.metalnessMap || b6.roughnessMap) if (b6.metalnessMap === b6.roughnessMap) { var U6 = { index: this.processTexture(b6.metalnessMap) }; this.applyTextureTransform(U6, b6.metalnessMap), N6.pbrMetallicRoughness.metallicRoughnessTexture = U6; } else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture."); if (b6.map) { var G6 = { index: this.processTexture(b6.map) }; this.applyTextureTransform(G6, b6.map), N6.pbrMetallicRoughness.baseColorTexture = G6; } if (b6.emissive) { var Y = b6.emissive.clone().multiplyScalar(b6.emissiveIntensity), te = Math.max(Y.r, Y.g, Y.b); if (1 < te && (Y.multiplyScalar(1 / te), console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")), 0 < te && (N6.emissiveFactor = Y.toArray()), b6.emissiveMap) { var ae = { index: this.processTexture(b6.emissiveMap) }; this.applyTextureTransform(ae, b6.emissiveMap), N6.emissiveTexture = ae; } } if (b6.normalMap) { var ie = { index: this.processTexture(b6.normalMap) }; b6.normalScale && b6.normalScale.x !== -1 && (b6.normalScale.x !== b6.normalScale.y && console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."), ie.scale = b6.normalScale.x), this.applyTextureTransform(ie, b6.normalMap), N6.normalTexture = ie; } if (b6.aoMap) { var le = { index: this.processTexture(b6.aoMap), texCoord: 1 }; b6.aoMapIntensity !== 1 && (le.strength = b6.aoMapIntensity), this.applyTextureTransform(le, b6.aoMap), N6.occlusionTexture = le; } b6.transparent ? N6.alphaMode = "BLEND" : 0 < b6.alphaTest && (N6.alphaMode = "MASK", N6.alphaCutoff = b6.alphaTest), b6.side === l.DoubleSide && (N6.doubleSided = true), b6.name !== "" && (N6.name = b6.name), this.serializeUserData(b6, N6), this._invokeAll(function($6) { $6.writeMaterial && $6.writeMaterial(b6, N6); }); var W6 = D6.materials.push(N6) - 1; return F6.materials.set(b6, W6), W6; } /** * Process mesh * @param {THREE.Mesh} mesh Mesh to process * @return {Integer|null} Index of the processed mesh in the "meshes" array */ processMesh(b6) { var F6 = this.cache, D6 = this.json, N6 = [b6.geometry.uuid]; if (Array.isArray(b6.material)) for (var B6 = 0, U6 = b6.material.length; B6 < U6; B6++) N6.push(b6.material[B6].uuid); else N6.push(b6.material.uuid); var G6 = N6.join(":"); if (F6.meshes.has(G6)) return F6.meshes.get(G6); var Y, te = b6.geometry; if (Y = b6.isLineSegments ? h6.LINES : b6.isLineLoop ? h6.LINE_LOOP : b6.isLine ? h6.LINE_STRIP : b6.isPoints ? h6.POINTS : b6.material.wireframe ? h6.LINES : h6.TRIANGLES, te.isBufferGeometry !== true) throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry."); var ae = {}, ie = {}, le = [], W6 = [], $6 = { uv: "TEXCOORD_0", uv2: "TEXCOORD_1", color: "COLOR_0", skinWeight: "WEIGHTS_0", skinIndex: "JOINTS_0" }, j6 = te.getAttribute("normal"); j6 === void 0 || this.isNormalizedNormalAttribute(j6) || (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), te.setAttribute("normal", this.createNormalizedNormalAttribute(j6))); var re = null; for (var k6 in te.attributes) if (k6.substr(0, 5) !== "morph") { var H6 = te.attributes[k6]; k6 = $6[k6] || k6.toUpperCase(); var K = /^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/; if (K.test(k6) || (k6 = "_" + k6), F6.attributes.has(this.getUID(H6))) { ie[k6] = F6.attributes.get(this.getUID(H6)); continue; } re = null; var ce = H6.array; k6 !== "JOINTS_0" || ce instanceof Uint16Array || ce instanceof Uint8Array || (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), re = new l.BufferAttribute(new Uint16Array(ce), H6.itemSize, H6.normalized)); var se = this.processAccessor(re || H6, te); se !== null && (ie[k6] = se, F6.attributes.set(this.getUID(H6), se)); } if (j6 !== void 0 && te.setAttribute("normal", j6), Object.keys(ie).length === 0) return null; if (b6.morphTargetInfluences !== void 0 && 0 < b6.morphTargetInfluences.length) { var V6 = [], O6 = [], Z6 = {}; if (b6.morphTargetDictionary !== void 0) for (var X in b6.morphTargetDictionary) Z6[b6.morphTargetDictionary[X]] = X; for (var ee = 0; ee < b6.morphTargetInfluences.length; ++ee) { var fe = {}, be = false; for (var Ae in te.morphAttributes) { if (Ae != "position" && Ae !== "normal" && Ae !== "color") { be || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), be = true); continue; } var he = te.morphAttributes[Ae][ee], xe = Ae.toUpperCase(); $6[Ae] && (xe = $6[Ae]); var ne = te.attributes[Ae]; if (F6.attributes.has(this.getUID(he))) { fe[xe] = F6.attributes.get(this.getUID(he)); continue; } var me = ne.clone(); if (!te.morphTargetsRelative) if (ne) for (var Me = 0, De = he.count; Me < De; Me++) ne.count > Me && me.setXYZ(Me, he.getX(Me) - ne.getX(Me), he.getY(Me) - ne.getY(Me), he.getZ(Me) - ne.getZ(Me)); else for (var Ie = 0, $e = he.count; Ie < $e; Ie++) me.setXYZ(Ie, 0, 0, 0); fe[xe] = this.processAccessor(me, te), F6.attributes.set(this.getUID(ne), fe[xe]); } W6.push(fe), V6.push(b6.morphTargetInfluences[ee]), b6.morphTargetDictionary !== void 0 && O6.push(Z6[ee]); } ae.weights = V6, 0 < O6.length && (ae.extras = {}, ae.extras.targetNames = O6); } var lt = Array.isArray(b6.material); if (lt && te.groups.length === 0) return null; for (var qe, Mt = lt ? b6.material : [b6.material], Be = lt ? te.groups : [{ materialIndex: 0, start: void 0, count: void 0 }], it = 0, tt = Be.length; it < tt; it++) { if (qe = { mode: Y, attributes: ie }, this.serializeUserData(te, qe), 0 < W6.length && (qe.targets = W6), te.index !== null) { var qt = this.getUID(te.index); (Be[it].start !== void 0 || Be[it].count !== void 0) && (qt += ":" + Be[it].start + ":" + Be[it].count), F6.attributes.has(qt) ? qe.indices = F6.attributes.get(qt) : (qe.indices = this.processAccessor(te.index, te, Be[it].start, Be[it].count), F6.attributes.set(qt, qe.indices)), qe.indices === null && delete qe.indices; } var Qt = this.processMaterial(Mt[Be[it].materialIndex]); Qt !== null && (qe.material = Qt), le.push(qe); } ae.primitives = le, D6.meshes || (D6.meshes = []), this._invokeAll(function(Nt) { Nt.writeMesh && Nt.writeMesh(b6, ae); }); var Pt = D6.meshes.push(ae) - 1; return F6.meshes.set(G6, Pt), Pt; } /** * Process camera * @param {THREE.Camera} camera Camera to process * @return {Integer} Index of the processed mesh in the "camera" array */ processCamera(b6) { var F6 = this.json; F6.cameras || (F6.cameras = []); var D6 = b6.isOrthographicCamera, N6 = { type: D6 ? "orthographic" : "perspective" }; return D6 ? N6.orthographic = { xmag: 2 * b6.right, ymag: 2 * b6.top, zfar: 0 >= b6.far ? 1e-3 : b6.far, znear: 0 > b6.near ? 0 : b6.near } : N6.perspective = { aspectRatio: b6.aspect, yfov: l.MathUtils.degToRad(b6.fov), zfar: 0 >= b6.far ? 1e-3 : b6.far, znear: 0 > b6.near ? 0 : b6.near }, b6.name !== "" && (N6.name = b6.type), F6.cameras.push(N6) - 1; } /** * Creates glTF animation entry from AnimationClip object. * * Status: * - Only properties listed in PATH_PROPERTIES may be animated. * * @param {THREE.AnimationClip} clip * @param {THREE.Object3D} root * @return {number|null} */ processAnimation(b6, F6) { var D6 = this.json, N6 = this.nodeMap; D6.animations || (D6.animations = []), b6 = d.Utils.mergeMorphTargetTracks(b6.clone(), F6); for (var B6 = b6.tracks, U6 = [], G6 = [], Y = 0; Y < B6.length; ++Y) { var te = B6[Y], ae = l.PropertyBinding.parseTrackName(te.name), ie = l.PropertyBinding.findNode(F6, ae.nodeName), le = g6[ae.propertyName]; if (ae.objectName === "bones" && (ie.isSkinnedMesh === true ? ie = ie.skeleton.getBoneByName(ae.objectIndex) : ie = void 0), !ie || !le) return console.warn('THREE.GLTFExporter: Could not export animation track "%s".', te.name), null; var W6 = 1, $6 = te.values.length / te.times.length; le === g6.morphTargetInfluences && ($6 /= ie.morphTargetInfluences.length); var j6 = void 0; te.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === true ? (j6 = "CUBICSPLINE", $6 /= 3) : te.getInterpolation() === l.InterpolateDiscrete ? j6 = "STEP" : j6 = "LINEAR", G6.push({ input: this.processAccessor(new l.BufferAttribute(te.times, W6)), output: this.processAccessor(new l.BufferAttribute(te.values, $6)), interpolation: j6 }), U6.push({ sampler: G6.length - 1, target: { node: N6.get(ie), path: le } }); } return D6.animations.push({ name: b6.name || "clip_" + D6.animations.length, samplers: G6, channels: U6 }), D6.animations.length - 1; } /** * @param {THREE.Object3D} object * @return {number|null} */ processSkin(b6) { var F6 = this.json, D6 = this.nodeMap, N6 = F6.nodes[D6.get(b6)], B6 = b6.skeleton; if (B6 === void 0) return null; var U6 = b6.skeleton.bones[0]; if (U6 === void 0) return null; for (var G6 = [], Y = new Float32Array(16 * B6.bones.length), te = new l.Matrix4(), ae = 0; ae < B6.bones.length; ++ae) G6.push(D6.get(B6.bones[ae])), te.copy(B6.boneInverses[ae]), te.multiply(b6.bindMatrix).toArray(Y, 16 * ae); F6.skins === void 0 && (F6.skins = []), F6.skins.push({ inverseBindMatrices: this.processAccessor(new l.BufferAttribute(Y, 16)), joints: G6, skeleton: D6.get(U6) }); var ie = N6.skin = F6.skins.length - 1; return ie; } /** * Process Object3D node * @param {THREE.Object3D} node Object3D to processNode * @return {Integer} Index of the node in the nodes list */ processNode(b6) { var F6 = this.json, D6 = this.options, N6 = this.nodeMap; F6.nodes || (F6.nodes = []); var B6 = {}; if (D6.trs) { var U6 = b6.quaternion.toArray(), G6 = b6.position.toArray(), Y = b6.scale.toArray(); w6(U6, [0, 0, 0, 1]) || (B6.rotation = U6), w6(G6, [0, 0, 0]) || (B6.translation = G6), w6(Y, [1, 1, 1]) || (B6.scale = Y); } else b6.matrixAutoUpdate && b6.updateMatrix(), M6(b6.matrix) === false && (B6.matrix = b6.matrix.elements); if (b6.name !== "" && (B6.name = b6.name + ""), this.serializeUserData(b6, B6), b6.isMesh || b6.isLine || b6.isPoints) { var te = this.processMesh(b6); te !== null && (B6.mesh = te); } else b6.isCamera && (B6.camera = this.processCamera(b6)); if (b6.isSkinnedMesh && this.skins.push(b6), 0 < b6.children.length) { for (var ae, ie = [], le = 0, W6 = b6.children.length; le < W6; le++) if (ae = b6.children[le], ae.visible || D6.onlyVisible === false) { var $6 = this.processNode(ae); $6 !== null && ie.push($6); } 0 < ie.length && (B6.children = ie); } this._invokeAll(function(re) { re.writeNode && re.writeNode(b6, B6); }); var j6 = F6.nodes.push(B6) - 1; return N6.set(b6, j6), j6; } /** * Process Scene * @param {Scene} node Scene to process */ processScene(b6) { var F6 = this.json, D6 = this.options; F6.scenes || (F6.scenes = [], F6.scene = 0); var N6 = {}; b6.name !== "" && (N6.name = b6.name), F6.scenes.push(N6); for (var B6, U6 = [], G6 = 0, Y = b6.children.length; G6 < Y; G6++) if (B6 = b6.children[G6], B6.visible || D6.onlyVisible === false) { var te = this.processNode(B6); te !== null && U6.push(te); } 0 < U6.length && (N6.nodes = U6), this.serializeUserData(b6, N6); } /** * Creates a Scene to hold a list of objects and parse it * @param {Array} objects List of objects to process */ processObjects(b6) { var F6 = new l.Scene(); F6.name = "AuxScene"; for (var D6 = 0; D6 < b6.length; D6++) F6.children.push(b6[D6]); this.processScene(F6); } /** * @param {THREE.Object3D|Array} input */ processInput(b6) { var F6 = this.options; b6 = b6 instanceof Array ? b6 : [b6], this._invokeAll(function(G6) { G6.beforeParse && G6.beforeParse(b6); }); for (var D6 = [], N6 = 0; N6 < b6.length; N6++) b6[N6] instanceof l.Scene ? this.processScene(b6[N6]) : D6.push(b6[N6]); 0 < D6.length && this.processObjects(D6); for (var B6 = 0; B6 < this.skins.length; ++B6) this.processSkin(this.skins[B6]); for (var U6 = 0; U6 < F6.animations.length; ++U6) this.processAnimation(F6.animations[U6].clip, F6.animations[U6].mesh); this._invokeAll(function(G6) { G6.afterParse && G6.afterParse(b6); }); } _invokeAll(b6) { for (var F6 = 0, D6 = this.plugins.length; F6 < D6; F6++) b6(this.plugins[F6]); } } class S6 { constructor(b6) { this.writer = b6, this.name = "KHR_lights_punctual"; } writeNode(b6, F6) { if (b6.isLight) { if (!b6.isDirectionalLight && !b6.isPointLight && !b6.isSpotLight) return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.", b6); var D6 = this.writer, N6 = D6.json, B6 = D6.extensionsUsed, U6 = {}; b6.name && (U6.name = b6.name), U6.color = b6.color.toArray(), U6.intensity = b6.intensity, b6.isDirectionalLight ? U6.type = "directional" : b6.isPointLight ? (U6.type = "point", 0 < b6.distance && (U6.range = b6.distance)) : b6.isSpotLight && (U6.type = "spot", 0 < b6.distance && (U6.range = b6.distance), U6.spot = {}, U6.spot.innerConeAngle = -1 * ((b6.penumbra - 1) * b6.angle), U6.spot.outerConeAngle = b6.angle), b6.decay !== void 0 && b6.decay !== 2 && console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."), b6.target && (b6.target.parent !== b6 || b6.target.position.x !== 0 || b6.target.position.y !== 0 || b6.target.position.z !== -1) && console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."), B6[this.name] || (N6.extensions = N6.extensions || {}, N6.extensions[this.name] = { lights: [] }, B6[this.name] = true); var G6 = N6.extensions[this.name].lights; G6.push(U6), F6.extensions = F6.extensions || {}, F6.extensions[this.name] = { light: G6.length - 1 }; } } } class E6 { constructor(b6) { this.writer = b6, this.name = "KHR_materials_unlit"; } writeMaterial(b6, F6) { if (b6.isMeshBasicMaterial) { var D6 = this.writer, N6 = D6.extensionsUsed; F6.extensions = F6.extensions || {}, F6.extensions[this.name] = {}, N6[this.name] = true, F6.pbrMetallicRoughness.metallicFactor = 0, F6.pbrMetallicRoughness.roughnessFactor = 0.9; } } } class C6 { constructor(b6) { this.writer = b6, this.name = "KHR_materials_pbrSpecularGlossiness"; } writeMaterial(b6, F6) { if (b6.isGLTFSpecularGlossinessMaterial) { var D6 = this.writer, N6 = D6.extensionsUsed, B6 = {}; F6.pbrMetallicRoughness.baseColorFactor && (B6.diffuseFactor = F6.pbrMetallicRoughness.baseColorFactor); var U6 = [1, 1, 1]; if (b6.specular.toArray(U6, 0), B6.specularFactor = U6, B6.glossinessFactor = b6.glossiness, F6.pbrMetallicRoughness.baseColorTexture && (B6.diffuseTexture = F6.pbrMetallicRoughness.baseColorTexture), b6.specularMap) { var G6 = { index: D6.processTexture(b6.specularMap) }; D6.applyTextureTransform(G6, b6.specularMap), B6.specularGlossinessTexture = G6; } F6.extensions = F6.extensions || {}, F6.extensions[this.name] = B6, N6[this.name] = true; } } } d.Utils = { insertKeyframe: function(b6, F6) { var D6, N6 = 1e-3, B6 = b6.getValueSize(), U6 = new b6.TimeBufferType(b6.times.length + 1), G6 = new b6.ValueBufferType(b6.values.length + B6), Y = b6.createInterpolant(new b6.ValueBufferType(B6)); if (b6.times.length === 0) { U6[0] = F6; for (var te = 0; te < B6; te++) G6[te] = 0; D6 = 0; } else if (F6 < b6.times[0]) { if (Math.abs(b6.times[0] - F6) < N6) return 0; U6[0] = F6, U6.set(b6.times, 1), G6.set(Y.evaluate(F6), 0), G6.set(b6.values, B6), D6 = 0; } else if (F6 > b6.times[b6.times.length - 1]) { if (Math.abs(b6.times[b6.times.length - 1] - F6) < N6) return b6.times.length - 1; U6[U6.length - 1] = F6, U6.set(b6.times, 0), G6.set(b6.values, 0), G6.set(Y.evaluate(F6), b6.values.length), D6 = U6.length - 1; } else for (var ae = 0; ae < b6.times.length; ae++) { if (Math.abs(b6.times[ae] - F6) < N6) return ae; if (b6.times[ae] < F6 && b6.times[ae + 1] > F6) { U6.set(b6.times.slice(0, ae + 1), 0), U6[ae + 1] = F6, U6.set(b6.times.slice(ae + 1), ae + 2), G6.set(b6.values.slice(0, (ae + 1) * B6), 0), G6.set(Y.evaluate(F6), (ae + 1) * B6), G6.set(b6.values.slice((ae + 1) * B6), (ae + 2) * B6), D6 = ae + 1; break; } } return b6.times = U6, b6.values = G6, D6; }, mergeMorphTargetTracks: function(b6, F6) { for (var D6 = [], N6 = {}, B6 = b6.tracks, U6 = 0; U6 < B6.length; ++U6) { var G6 = B6[U6], Y = l.PropertyBinding.parseTrackName(G6.name), te = l.PropertyBinding.findNode(F6, Y.nodeName); if (Y.propertyName !== "morphTargetInfluences" || Y.propertyIndex === void 0) { D6.push(G6); continue; } if (G6.createInterpolant !== G6.InterpolantFactoryMethodDiscrete && G6.createInterpolant !== G6.InterpolantFactoryMethodLinear) { if (G6.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation."); console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), G6 = G6.clone(), G6.setInterpolation(l.InterpolateLinear); } var ae = te.morphTargetInfluences.length, ie = te.morphTargetDictionary[Y.propertyIndex]; if (ie === void 0) throw new Error("THREE.GLTFExporter: Morph target name not found: " + Y.propertyIndex); var le = void 0; if (N6[te.uuid] === void 0) { le = G6.clone(); for (var W6 = new le.ValueBufferType(ae * le.times.length), $6 = 0; $6 < le.times.length; $6++) W6[$6 * ae + ie] = le.values[$6]; le.name = (Y.nodeName || "") + ".morphTargetInfluences", le.values = W6, N6[te.uuid] = le, D6.push(le); continue; } var j6 = G6.createInterpolant(new G6.ValueBufferType(1)); le = N6[te.uuid]; for (var re = 0; re < le.times.length; re++) le.values[re * ae + ie] = j6.evaluate(le.times[re]); for (var k6, H6 = 0; H6 < G6.times.length; H6++) k6 = this.insertKeyframe(le, G6.times[H6]), le.values[k6 * ae + ie] = G6.values[H6]; } return b6.tracks = D6, b6; } }; }, /* 44 */ /***/ (o, a6, c) => { var l = c(4), d = c(5).resolveURL, h6 = function() { this.nearPlane = 0.168248, this.farPlane = 6.82906, this.eyePosition = [0.5, -2.86496, 0.5], this.targetPosition = [0.5, 0.5, 0.5], this.upVector = [0, 0, 1]; var A6 = this; this.setFromObject = (M6) => { var { nearPlane: R6, farPlane: L6, eyePosition: T6, targetPosition: P6, upVector: _6 } = M6; A6.nearPlane = R6, A6.farPlane = L6, A6.eyePosition = T6, A6.targetPosition = P6, A6.upVector = _6; }; }, f6 = function(A6, M6, R6, L6) { var T6 = { NONE: -1, DEFAULT: 0, PATH: 1, SMOOTH_CAMERA_TRANSITION: 2, AUTO_TUMBLE: 3, ROTATE_TRANSITION: 4, MINIMAP: 5, SYNC_CONTROL: 6 }, P6 = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5, SCROLL: 6, KEYBOARD_ZOOM: 7, KEYBOARD_ROTATE: 8, KEYBOARD_PAN: 9 }, _6 = { NONE: -1, FREE: 1, HORIZONTAL: 2, VERTICAL: 3 }, S6 = { ARROWLEFT: 37, ARROWUP: 38, ARROWRIGHT: 39, ARROWDOWN: 40, NUMPADADD: 107, NUMPADSUBTRACT: 109, EQUAL: 187, MINUS: 189 }, E6 = {}; E6.MAIN = P6.ROTATE, E6.AUXILIARY = P6.ZOOM, E6.SECONDARY = P6.PAN, this.cameraObject = A6, this.domElement = M6 === void 0 ? document : M6, this.renderer = R6, this.scene = L6, this.tumble_rate = 1.5, this.pointer_x = 0, this.pointer_y = 0, this.pointer_x_start = 0, this.pointer_y_start = 0, this.previous_pointer_x = 0, this.previous_pointer_y = 0, this.near_plane_fly_debt = 0, this.touchZoomDistanceStart = 0, this.touchZoomDistanceEnd = 0, this.directionalLight = 0, this.zoomRate = 50, this.rotateRate = 50, this.panRate = 100, this.pixelHeight = 1; var C6 = 6e3, I6 = true, b6 = 0, F6 = void 0, D6 = void 0, N6 = false, B6 = 500, U6 = void 0, G6 = "default", Y = T6.DEFAULT, te = void 0, ae = void 0, ie = void 0, le = 0, W6 = _6.FREE; this._state = P6.NONE; var $6; this.targetTouchId = -1; var j6 = void 0, re = new l.Vector3(), k6 = new l.Vector3(), H6 = new l.Vector3(), K = new l.Vector3(), ce = new l.Vector3(), se = new l.Vector3(), V6 = new l.Vector3(), O6 = new l.Vector3(), Z6 = new l.Sphere(), X = new l.Vector3(), ee = false, fe = void 0, be = 0, Ae = { default: new h6() }; Ae.default.nearPlane = 0.1, Ae.default.farPlane = 2e3, Ae.default.eyePosition = [0, 0, 0], Ae.default.targetPosition = [0, 0, -1], Ae.default.upVector = [0, 1, 0], this.cameraObject.target === void 0 && (this.cameraObject.target = new l.Vector3(...Ae.default.targetPosition)), this.calculateMaxAllowedDistance = (Q) => { var _e = Q.getBoundingBox(); if (_e) { _e.getBoundingSphere(Z6), be = 6 * Z6.radius; var Oe = 0; this.cameraObject && (Oe = this.cameraObject.position.distanceTo(Z6.center)), be = Oe > be ? 1.5 * Oe : be; } else be = 0; }, this.addViewport = (Q, _e) => { Q && _e && (Ae[Q] = _e); }, this.setDefaultViewport = (Q) => !!(Q && Q in Ae) && (G6 = Q, true), this.getDefaultViewport = () => G6, this.getViewportOfName = (Q) => Ae[Q], this.setCurrentViewport = (Q) => Q in Ae && (this.setCurrentCameraSettings(Ae[Q]), true), this.setRotationMode = (Q) => { switch (Q) { case "none": W6 = _6.NONE; break; case "horizontal": W6 = _6.HORIZONTAL; break; case "vertical": W6 = _6.VERTICAL; break; case "free": default: W6 = _6.FREE; } }, this.onResize = () => { j6 && (j6 = void 0), fe && fe.setCurrentCameraSettings(this.cameraObject, Ae[G6]); }, this.getVisibleHeightAtZDepth = (Q) => { var _e = this.cameraObject.position.distanceTo(this.cameraObject.target); Q < _e ? Q -= _e : Q += _e; var Oe = this.cameraObject.fov * Math.PI / 180; return 2 * Math.tan(Oe / 2) * Math.abs(Q); }, this.calculateHeightPerPixelAtZeroDepth = (Q) => { var _e = this.getVisibleHeightAtZDepth(0); return this.pixelHeight = _e / Q, this.pixelHeight; }, this.getNDCFromDocumentCoords = (Q, _e, Oe) => { Be(false); var Ze = Oe || new l.Vector2(), ht = 2 * ((Q - j6.left) / j6.width) - 1, J = 2 * -((_e - j6.top) / j6.height) + 1; return Ze.set(ht, J); }, this.getRelativeCoordsFromNDC = (Q, _e, Oe) => { Be(false); var Ze = Oe || new l.Vector2(); return Ze.x = (Q + 1) * j6.width / 2, Ze.y = (1 - _e) * j6.height / 2, Ze; }, this.setMouseButtonAction = (Q, _e) => { E6[Q] = P6[_e]; }; var he = (Q, _e) => { Q instanceof HTMLCanvasElement && (Q.tabIndex = _e); }, xe = () => { if (0 < be) { var Q = X.distanceTo(Z6.center); return be > Q || this.cameraObject.position.distanceTo(Z6.center) > Q; } return true; }, ne = (Q) => { X.copy(this.cameraObject.position).add(Q), xe() && (this.cameraObject.target.add(Q), this.cameraObject.position.add(Q), this.updateDirectionalLight()); }, me = (Q) => { Be(false); var _e; if (Y === T6.DEFAULT && (_e = this.scene.getNormalisedMinimapCoordinates(this.renderer, Q)), !_e) Q.button == 0 ? Q.ctrlKey ? this._state = E6.AUXILIARY : Q.shiftKey ? this._state = E6.SECONDARY : this._state = E6.MAIN : Q.button == 1 ? (Q.preventDefault(), this._state = E6.AUXILIARY) : Q.button == 2 && (this._state = E6.SECONDARY), this.pointer_x = Q.clientX - j6.left, this.pointer_y = Q.clientY - j6.top, this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; else { Y = T6.MINIMAP; var Oe = this.scene.getMinimapDiffFromNormalised(_e.x, _e.y); ne(Oe); } }, Me = (Q) => { if (Be(false), j6) if (this.pointer_x = Q.clientX - j6.left, this.pointer_y = Q.clientY - j6.top, Y === T6.MINIMAP) { var _e = this.scene.getNormalisedMinimapCoordinates(this.renderer, Q); if (_e) { var Oe = this.scene.getMinimapDiffFromNormalised(_e.x, _e.y); ne(Oe); } } else this._state === P6.NONE && $6 !== void 0 && $6.move(this, Q.clientX, Q.clientY, this.renderer); }, De = (Q) => { this._state = P6.NONE, Y == T6.MINIMAP && (Y = T6.DEFAULT), $6 !== void 0 && this.pointer_x_start == Q.clientX - j6.left && this.pointer_y_start == Q.clientY - j6.top && $6.pick(this, Q.clientX, Q.clientY, this.renderer); }, Ie = (Q) => { this._state = P6.NONE; }, $e = (Q) => { Be(false); var _e = Q.touches.length; if (_e == 1) { var Oe, Ze; this._state = P6.TOUCH_ROTATE, this.pointer_x = Q.touches[0].clientX - ((Oe = j6) === null || Oe === void 0 ? void 0 : Oe.left), this.pointer_y = Q.touches[0].clientY - ((Ze = j6) === null || Ze === void 0 ? void 0 : Ze.top), this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; } else if (_e == 2) { this._state = P6.TOUCH_ZOOM; var ht = Q.touches[0].clientX - Q.touches[1].clientX, J = Q.touches[0].clientY - Q.touches[1].clientY; this.touchZoomDistanceEnd = this.touchZoomDistanceStart = Math.sqrt(ht * ht + J * J); } else if (_e == 3) { var ye, pe; this._state = P6.TOUCH_PAN, this.targetTouchId = Q.touches[0].identifier, this.pointer_x = Q.touches[0].clientX - ((ye = j6) === null || ye === void 0 ? void 0 : ye.left), this.pointer_y = Q.touches[0].clientY - ((pe = j6) === null || pe === void 0 ? void 0 : pe.top), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; } }, lt = (Q) => { Q.preventDefault(), Q.stopPropagation(); var _e = Q.touches.length; if (_e == 1) this.pointer_x = Q.touches[0].clientX - j6.left, this.pointer_y = Q.touches[0].clientY - j6.top; else if (_e == 2) { if (this._state === P6.TOUCH_ZOOM) { var Oe = Q.touches[0].clientX - Q.touches[1].clientX, Ze = Q.touches[0].clientY - Q.touches[1].clientY; this.touchZoomDistanceEnd = Math.sqrt(Oe * Oe + Ze * Ze); } } else if (_e == 3 && this._state === P6.TOUCH_PAN) for (var ht = 0; 3 > ht; ht++) Q.touches[ht].identifier == this.targetTouchId && (this.pointer_x = Q.touches[0].clientX - j6.left, this.pointer_y = Q.touches[0].clientY - j6.top); }, qe = (Q) => { var _e = Q.touches.length; this.touchZoomDistanceStart = this.touchZoomDistanceEnd = 0, this.targetTouchId = -1, this._state = P6.NONE, _e == 1 && $6 !== void 0 && this.pointer_x_start == Q.touches[0].clientX - j6.left && this.pointer_y_start == Q.touches[0].clientY - j6.top && $6.pick(this.cameraObject, Q.touches[0].clientX, Q.touches[0].clientY, this.renderer); }, Mt = () => { Be(true); }, Be = (Q) => { if (Q || j6 === void 0) { var _e = new IntersectionObserver((Oe) => { for (var Ze of Oe) j6 = Ze.boundingClientRect; _e.disconnect(); }); _e.observe(this.domElement); } }, it = (Q) => { Be(false), this._state = P6.SCROLL; var _e = 0; 0 < Q.deltaY ? _e = this.zoomRate : 0 > Q.deltaY && (_e = -1 * this.zoomRate), le += _e, Q.preventDefault(), Q.stopImmediatePropagation(); }, tt = (Q) => { Be(false); var _e = 0; if (Q.keyCode === S6.EQUAL || Q.keyCode === S6.MINUS || Q.keyCode === S6.NUMPADADD || Q.keyCode === S6.NUMPADSUBTRACT) { this._state = P6.KEYBOARD_ZOOM; var Oe = 1; Q.shiftKey && (Oe *= 2), Q.keyCode === S6.EQUAL || Q.keyCode === S6.NUMPADADD ? _e = -1 * (this.zoomRate * Oe) : (Q.keyCode === S6.MINUS || Q.keyCode === S6.NUMPADSUBTRACT) && (_e = this.zoomRate * Oe), le += _e; } else (Q.keyCode === S6.ARROWLEFT || Q.keyCode === S6.ARROWUP || Q.keyCode === S6.ARROWRIGHT || Q.keyCode === S6.ARROWDOWN) && (Q.shiftKey ? (this._state = P6.KEYBOARD_ROTATE, this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, _e = this.rotateRate) : (this._state = P6.KEYBOARD_PAN, _e = this.panRate), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y, Q.keyCode === S6.ARROWLEFT ? this.pointer_x -= _e : Q.keyCode === S6.ARROWUP ? this.pointer_y -= _e : Q.keyCode === S6.ARROWRIGHT ? this.pointer_x += _e : Q.keyCode === S6.ARROWDOWN && (this.pointer_y += _e)); Object.values(S6).includes(Q.keyCode) && Q.preventDefault(); }, qt = (Q) => { this._state = P6.NONE; }, Qt = () => { if (typeof this.cameraObject < "u") { var Q = j6.height, _e = this.cameraObject.position.distanceTo(this.cameraObject.target), Oe = 0; this.cameraObject.far > this.cameraObject.near && _e >= this.cameraObject.near && _e <= this.cameraObject.far && (Oe = (_e - this.cameraObject.near) / (this.cameraObject.far - this.cameraObject.near)), k6.set(this.previous_pointer_x, Q - this.previous_pointer_y, 0), H6.set(this.previous_pointer_x, Q - this.previous_pointer_y, 1), K.set(this.pointer_x, Q - this.pointer_y, 0), ce.set(this.pointer_x, Q - this.pointer_y, 1), k6.unproject(this.cameraObject), H6.unproject(this.cameraObject), K.unproject(this.cameraObject), ce.unproject(this.cameraObject); var Ze = -2e-3; K.sub(k6).multiplyScalar(1 - Oe), ce.sub(H6).multiplyScalar(Oe), K.add(ce).multiplyScalar(Ze), ne(K); } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }; this.getVectorsFromRotateAboutLookAtPoints = (Q, _e) => { Q.normalize(), V6.copy(this.cameraObject.position).sub(this.cameraObject.target), O6.copy(V6), V6.normalize(), 0.8 < Math.abs(V6.dot(Q)) && V6.copy(this.cameraObject.up), k6.crossVectors(Q, V6).normalize(), H6.crossVectors(Q, k6); var Oe = Q.dot(O6), Ze = k6.dot(O6), ht = H6.dot(O6), J = Q.dot(this.cameraObject.up), ye = k6.dot(this.cameraObject.up), pe = H6.dot(this.cameraObject.up), we = Math.cos(_e), Le = Math.sin(_e); return K.set(we * k6.x + Le * H6.x, we * k6.y + Le * H6.y, we * k6.z + Le * H6.z), ce.set(we * H6.x - Le * k6.x, we * H6.y - Le * k6.y, we * H6.z - Le * k6.z), V6.copy(this.cameraObject.target), V6.x = V6.x + Q.x * Oe + K.x * Ze + ce.x * ht, V6.y = V6.y + Q.y * Oe + K.y * Ze + ce.y * ht, V6.z = V6.z + Q.z * Oe + K.z * Ze + ce.z * ht, re.set(Q.x * J + K.x * ye + ce.x * pe, Q.y * J + K.y * ye + ce.y * pe, Q.z * J + K.z * ye + ce.z * pe), { position: V6, up: re }; }, this.rotateAboutLookAtpoint = (Q, _e) => { var Oe = this.getVectorsFromRotateAboutLookAtPoints(Q, _e); this.cameraObject.position.copy(Oe.position), this.updateDirectionalLight(), this.cameraObject.up.copy(Oe.up); }; var Pt = () => { if (typeof this.cameraObject < "u") { var Q, _e, Oe = (Q = j6) === null || Q === void 0 ? void 0 : Q.width, Ze = (_e = j6) === null || _e === void 0 ? void 0 : _e.height; if (0 < Oe && 0 < Ze) { var ht = 0.25 * (Oe + Ze), J = 0, ye = 0; (W6 === _6.FREE || W6 === _6.HORIZONTAL) && (J = this.pointer_x - this.previous_pointer_x), (W6 === _6.FREE || W6 === _6.VERTICAL) && (ye = this.previous_pointer_y - this.pointer_y); var pe = Math.sqrt(J * J + ye * ye); if (0 < pe) { var we = 1 * -ye / pe, Le = 1 * J / pe, ge = 0; W6 === _6.FREE && we * (this.pointer_x - 0.5 * (Oe - 1)) + Le * (0.5 * (Ze - 1) - this.pointer_y); var Se = Math.acos(ge / ht) - 0.5 * Math.PI, Fe = this.tumble_rate * pe / ht; re.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(), k6.copy(this.cameraObject.up).normalize(), H6.copy(k6).cross(re).normalize().multiplyScalar(we), k6.multiplyScalar(Le), se.addVectors(H6, k6).multiplyScalar(Math.cos(Se)), re.multiplyScalar(Math.sin(Se)), se.add(re), this.rotateAboutLookAtpoint(se, -Fe); } } } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }, Nt = () => { var Q = 0; return this._state === P6.ZOOM ? Q = this.previous_pointer_y - this.pointer_y : this._state === P6.SCROLL || this._state === P6.KEYBOARD_ZOOM ? Q = le : (Q = -1 * (this.touchZoomDistanceEnd - this.touchZoomDistanceStart), this.touchZoomDistanceStart = this.touchZoomDistanceEnd), Q; }; this.changeZoomByScrollRateUnit = (Q) => { var _e = Q * this.zoomRate; this.changeZoomByValue(_e); }, this.changeZoomByValue = (Q) => { if (typeof this.cameraObject < "u") { var _e = j6.height, Oe = this.cameraObject.position.clone(); Oe.sub(this.cameraObject.target); var Ze = Oe.length(), ht = 1.5 * Q / _e; if (0.01 < Ze + ht * Ze && (Oe.normalize(), X.copy(this.cameraObject.position), X.x += Oe.x * ht * Ze, X.y += Oe.y * ht * Ze, X.z += Oe.z * ht * Ze, xe())) { this.cameraObject.position.copy(X), this.updateDirectionalLight(); var J = 1e-5; if (J * this.cameraObject.far < this.cameraObject.near + ht * Ze + this.near_plane_fly_debt) this.near_plane_fly_debt != 0 && (this.near_plane_fly_debt += ht * Ze, 0 < this.near_plane_fly_debt ? (this.cameraObject.near += this.near_plane_fly_debt, this.cameraObject.far += this.near_plane_fly_debt, this.near_plane_fly_debt = 0) : (this.cameraObject.near += ht * Ze, this.cameraObject.far += ht * Ze)); else { if (this.near_plane_fly_debt == 0) { var ye = this.cameraObject.near - J * this.cameraObject.far; this.cameraObject.near = J * this.cameraObject.far, this.cameraObject.far -= ye, this.near_plane_fly_debt -= J * this.cameraObject.far; } this.near_plane_fly_debt += ht * Ze; } ee = true; } } }; var Vi = () => { var Q = Nt(); this.changeZoomByValue(Q), this._state === P6.ZOOM && (this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y), (this._state === P6.SCROLL || this._state === P6.KEYBOARD_ZOOM) && (le = 0, this._state = P6.NONE); }; this.setDirectionalLight = (Q) => { this.directionalLight = Q; }, this.updateDirectionalLight = () => { this.directionalLight != 0 && this.directionalLight.position.set(this.cameraObject.position.x, this.cameraObject.position.y, this.cameraObject.position.z); }, this.enable = function() { I6 = true, this.domElement && this.domElement.addEventListener && (he(this.domElement, 0), this.domElement.addEventListener("mousedown", me, false), this.domElement.addEventListener("mousemove", Me, false), this.domElement.addEventListener("mouseup", De, false), this.domElement.addEventListener("mouseleave", Ie, false), this.domElement.addEventListener("touchstart", $e, false), this.domElement.addEventListener("touchmove", lt, false), this.domElement.addEventListener("touchend", qe, false), this.domElement.addEventListener("wheel", it, false), this.domElement.addEventListener("mouseenter", Mt, false), this.domElement.addEventListener("contextmenu", (Q) => { Q.preventDefault(); }, false), this.domElement.addEventListener("keydown", tt, false), this.domElement.addEventListener("keyup", qt, false)); }, this.disable = function() { I6 = false, this.domElement && this.domElement.removeEventListener && (this.domElement.removeEventListener("mousedown", me, false), this.domElement.removeEventListener("mousemove", Me, false), this.domElement.removeEventListener("mouseup", De, false), this.domElement.removeEventListener("mouseleave", Ie, false), this.domElement.removeEventListener("touchstart", $e, false), this.domElement.removeEventListener("touchmove", lt, false), this.domElement.removeEventListener("touchend", qe, false), this.domElement.removeEventListener("wheel", it, false), this.domElement.removeEventListener("mouseenter", Mt, false), this.domElement.removeEventListener("contextmenu", (Q) => { Q.preventDefault(); }, false), this.domElement.removeEventListener("keydown", tt, false), this.domElement.removeEventListener("keyup", qt, false), he(this.domElement, -1)); }, this.loadPath = (Q) => { F6 = Q.CameraPath, D6 = Q.NumberOfPoints; }, this.loadPathURL = (Q, _e) => { var Oe = new XMLHttpRequest(); Oe.onreadystatechange = () => { if (Oe.readyState == 4 && Oe.status == 200) { var ht = JSON.parse(Oe.responseText); this.loadPath(ht), _e != null && typeof _e == "function" && _e(); } }; var Ze = d(Q); Oe.open("GET", Ze, true), Oe.send(); }, this.setPathDuration = (Q) => { C6 = Q, te && te.setDuration(C6), ae && ae.setDuration(C6); }, this.getPlayRate = () => B6, this.setPlayRate = (Q) => { B6 = Q; }; var Gi = (Q) => { var _e = b6 + Q; _e > C6 && (_e -= C6), b6 = _e; }; this.getTime = () => b6, this.setTime = (Q) => { b6 = Q > C6 ? C6 : 0 > Q ? 0 : Q; }, this.getNumberOfTimeFrame = () => D6, this.getCurrentTimeFrame = () => { if (2 < D6) { var Q = b6 / C6 * (D6 - 1), _e = Math.floor(Q), Oe = 1 - (Q - _e), Ze = Math.ceil(Q); return _e == Ze ? _e == D6 - 1 ? [_e - 1, Ze, 0] : [_e, Ze + 1, 1] : [_e, Ze, Oe]; } return D6 == 1 ? [0, 0, 0] : void 0; }, this.setCurrentTimeFrame = (Q) => { 2 < D6 && (b6 = C6 * Q / (D6 - 1), 0 > b6 && (b6 = 0), b6 > C6 && (b6 = C6)); }; var ni = (Q) => { if (Y === T6.PATH && (Gi(Q), F6)) { for (var _e = this.getCurrentTimeFrame(), Oe = _e[0], Ze = _e[1], ht = _e[2], J = [F6[3 * Oe], F6[3 * Oe + 1], F6[3 * Oe + 2]], ye = [F6[3 * Ze], F6[3 * Ze + 1], F6[3 * Ze + 2]], pe = [], we = 0; we < J.length; we++) pe.push(ht * J[we] + (1 - ht) * ye[we]); this.cameraObject.position.set(pe[0], pe[1], pe[2]), this.cameraObject.target.set(ye[0], ye[1], ye[2]), U6 && this.cameraObject.lookAt(this.cameraObject.target), N6 && (this.directionalLight.position.set(pe[0], pe[1], pe[2]), this.directionalLight.target.position.set(ye[0], ye[1], ye[2])); } }; this.calculatePathNow = () => { ni(0); }; var ts = () => { this._state === P6.ROTATE || this._state === P6.TOUCH_ROTATE || this._state === P6.KEYBOARD_ROTATE ? Pt() : this._state === P6.PAN || this._state === P6.TOUCH_PAN || this._state === P6.KEYBOARD_PAN ? (Qt(), fe.triggerCallback()) : (this._state === P6.ZOOM || this._state === P6.TOUCH_ZOOM || this._state === P6.SCROLL || this._state === P6.KEYBOARD_ZOOM) && (fe.zoom(Nt()), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y, (this._state === P6.SCROLL || this._state === P6.KEYBOARD_ZOOM) && (this._state = P6.NONE), le = 0, fe.triggerCallback()); }; this.update = (Q) => { var _e = Q * B6, Oe = I6, Ze = true; return Y === T6.PATH ? ni(_e) : Y === T6.SMOOTH_CAMERA_TRANSITION && te ? (te.update(_e), te.isTransitionCompleted() && (Y = T6.DEFAULT), Oe = false) : Y === T6.ROTATE_CAMERA_TRANSITION && ae ? (ae.update(_e), ae.isTransitionCompleted() && (Y = T6.DEFAULT), Oe = false) : Y === T6.AUTO_TUMBLE && ie ? ie.update(_e) : Y === T6.SYNC_CONTROL && fe ? (ts(), Oe = false) : Ze = false, Oe && (this._state !== P6.NONE && (Ze = true), this._state === P6.ROTATE || this._state === P6.TOUCH_ROTATE || this._state === P6.KEYBOARD_ROTATE ? Pt() : this._state === P6.PAN || this._state === P6.TOUCH_PAN || this._state === P6.KEYBOARD_PAN ? Qt() : (this._state === P6.ZOOM || this._state === P6.TOUCH_ZOOM || this._state === P6.SCROLL || this._state === P6.KEYBOARD_ZOOM) && Vi(), this._state !== P6.NONE && Y === T6.AUTO_TUMBLE && ie && ie.stopOnCameraInput, this._state === P6.SCROLL && (this._state = P6.NONE)), U6 ? (Ze = true, U6.update()) : this.cameraObject.lookAt(this.cameraObject.target), Ze = Ze || ee, ee = false, Ze; }, this.playPath = () => { Y = T6.PATH; }, this.stopPath = () => { Y = T6.DEFAULT; }, this.isPlayingPath = () => Y === T6.PATH, this.enableDirectionalLightUpdateWithPath = (Q) => { N6 = Q; }, this.enableDeviceOrientation = () => { U6 || (U6 = new x6(this.cameraObject)); }, this.disableDeviceOrientation = () => { U6 && (U6.dispose(), U6 = void 0); }, this.isDeviceOrientationEnabled = () => !!U6, this.resetView = () => { var Q = Ae[G6]; this.cameraObject.near = Q.nearPlane, this.cameraObject.far = Q.farPlane, this.cameraObject.position.set(Q.eyePosition[0], Q.eyePosition[1], Q.eyePosition[2]), this.cameraObject.target.set(Q.targetPosition[0], Q.targetPosition[1], Q.targetPosition[2]), this.cameraObject.up.set(Q.upVector[0], Q.upVector[1], Q.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(); }, this.setCurrentCameraSettings = (Q) => { Q.nearPlane && (this.cameraObject.near = Q.nearPlane), Q.farPlane && (this.cameraObject.far = Q.farPlane), Q.eyePosition && this.cameraObject.position.set(Q.eyePosition[0], Q.eyePosition[1], Q.eyePosition[2]), Q.targetPosition && this.cameraObject.target.set(Q.targetPosition[0], Q.targetPosition[1], Q.targetPosition[2]), Q.upVector && this.cameraObject.up.set(Q.upVector[0], Q.upVector[1], Q.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(), ee = true; }, this.getViewportFromCentreAndRadius = (Q, _e, Oe, Ze, ht, J) => { var ye = this.cameraObject.position.x - this.cameraObject.target.x, pe = this.cameraObject.position.y - this.cameraObject.target.y, we = this.cameraObject.position.z - this.cameraObject.target.z, Le = 1 / Math.sqrt(ye * ye + pe * pe + we * we); ye *= Le, pe *= Le, we *= Le; var ge = [Q, _e, Oe], Se = Ze / Math.tan(ht * Math.PI / 360), Fe = [Q + ye * Se, _e + pe * Se, Oe + we * Se], Ge = Se + J, je = 0, et = 0.95; je = J > et * Se ? (1 - et) * Se : Se - J; var Ye = new h6(); return Ye.nearPlane = je, Ye.farPlane = Ge, Ye.eyePosition = Fe, Ye.targetPosition = ge, Ye.upVector = [this.cameraObject.up.x, this.cameraObject.up.y, this.cameraObject.up.z], Ye; }, this.getViewportFromBoundingBox = (Q, _e) => { var Oe = Q.min.distanceTo(Q.max) / 2 * _e, Ze = (Q.min.x + Q.max.x) / 2, ht = (Q.min.y + Q.max.y) / 2, J = (Q.min.z + Q.max.z) / 2, ye = 4, pe = this.getViewportFromCentreAndRadius(Ze, ht, J, Oe, 40, Oe * ye); return pe; }, this.getCurrentViewport = () => { var Q = new h6(); return Q.nearPlane = this.cameraObject.near, Q.farPlane = this.cameraObject.far, Q.eyePosition[0] = this.cameraObject.position.x, Q.eyePosition[1] = this.cameraObject.position.y, Q.eyePosition[2] = this.cameraObject.position.z, Q.targetPosition[0] = this.cameraObject.target.x, Q.targetPosition[1] = this.cameraObject.target.y, Q.targetPosition[2] = this.cameraObject.target.z, Q.upVector[0] = this.cameraObject.up.x, Q.upVector[1] = this.cameraObject.up.y, Q.upVector[2] = this.cameraObject.up.z, Q; }, this.getDefaultEyePosition = () => eyePosition, this.getDefaultTargetPosition = () => targetPosition, this.cameraTransition = (Q, _e, Oe) => { ae == null && (te = new g6(Q, _e, this, Oe)); }, this.rotateCameraTransition = (Q, _e, Oe) => { te == null && (ae = new p(Q, _e, this, Oe)); }, this.enableCameraTransition = () => { te && (Y = T6.SMOOTH_CAMERA_TRANSITION), ae && (Y = T6.ROTATE_CAMERA_TRANSITION); }, this.pauseCameraTransition = () => { Y = T6.DEFAULT; }, this.stopCameraTransition = () => { Y = T6.DEFAULT, te = void 0, ae = void 0; }, this.isTransitioningCamera = () => Y === T6.SMOOTH_CAMERA_TRANSITION || Y === T6.ROTATE_CAMERA_TRANSITION, this.autoTumble = (Q, _e, Oe) => { ie = new y6(Q, _e, Oe, this); }, this.enableAutoTumble = () => { Y = T6.AUTO_TUMBLE; }, this.stopAutoTumble = () => { Y = T6.DEFAULT, ie = void 0; }, this.updateAutoTumble = () => { ie && (ie.requireUpdate = true); }, this.isAutoTumble = () => Y === T6.AUTO_TUMBLE, this.enableRaycaster = (Q, _e, Oe) => { $6 == null && ($6 = new u6(Q, this.scene, _e, Oe, this.renderer)); }, this.disableRaycaster = () => { $6.disable(), $6 = void 0; }, this.isSyncControl = () => currentMpde === T6.SYNC_CONTROL, this.enableSyncControl = () => (Y = T6.SYNC_CONTROL, fe || (fe = new w6()), fe.setCurrentCameraSettings(this.cameraObject, Ae[G6]), fe), this.disableSyncControl = () => { Y = T6.DEFAULT, this.cameraObject.zoom = 1, this.cameraObject.updateProjectionMatrix(); }, this.enable(); }, g6 = function(M6, R6, L6, T6) { var P6 = M6.eyePosition, _6 = M6.targetPosition, S6 = M6.upVector, E6 = R6.eyePosition, C6 = R6.targetPosition, I6 = R6.upVector, b6 = L6, F6 = T6, D6 = 0, N6 = false; b6.near = Math.min(M6.nearPlane, R6.nearPlane), b6.far = Math.max(M6.farPlane, R6.farPlane), b6.cameraObject.up.set(R6.upVector[0], R6.upVector[1], R6.upVector[2]), this.setDuration = (G6) => { F6 = G6; }; var B6 = (G6) => { var Y = D6 + G6; Y > F6 && (Y = F6), D6 = Y; }, U6 = () => { var G6 = D6 / F6, Y = [P6[0] * (1 - G6) + E6[0] * G6, P6[1] * (1 - G6) + E6[1] * G6, P6[2] * (1 - G6) + E6[2] * G6], te = [_6[0] * (1 - G6) + C6[0] * G6, _6[1] * (1 - G6) + C6[1] * G6, _6[2] * (1 - G6) + C6[2] * G6]; S6[0] * (1 - G6) + I6[0] * G6, S6[1] * (1 - G6) + I6[1] * G6, S6[2] * (1 - G6) + I6[2] * G6, b6.cameraObject.position.set(Y[0], Y[1], Y[2]), b6.cameraObject.target.set(te[0], te[1], te[2]); }; this.update = (G6) => { this.enabled === false || (B6(G6), U6(), D6 == F6 && (N6 = true)); }, this.isTransitionCompleted = () => N6; }, p = function(M6, R6, L6, T6) { var P6 = M6, _6 = R6, S6 = L6, E6 = T6, C6 = 0, I6 = false; this.setDuration = (F6) => { E6 = F6; }; var b6 = (F6) => { var D6 = C6, N6 = C6 + F6; N6 > E6 && (N6 = E6), C6 = N6; var B6 = C6 - D6, U6 = B6 / E6, G6 = U6 * _6; S6.rotateAboutLookAtpoint(P6, G6); }; this.update = (F6) => { this.enabled === false || (b6(F6), C6 == E6 && (I6 = true)); }, this.isTransitionCompleted = () => I6; }, u6 = function(M6, R6, L6, T6, P6) { var _6 = M6, S6 = R6, E6 = P6, C6 = L6, I6 = T6, b6 = new l.Raycaster(); b6.params.Line.threshold = 0.1, b6.params.Points.threshold = 1; var F6 = new l.Vector2(), D6 = false, N6 = /* @__PURE__ */ new Date(), B6 = false, U6 = 0, G6 = [], Y = { zincCamera: void 0, x: -1, y: -1 }, te = void 0; this.enable = () => { enable = true; }, this.disable = () => { enable = false; }, this.getIntersectsObject = (le) => { if (S6 !== _6) { var W6 = _6.getThreeJSScene(); E6.render(W6, le.cameraObject); } var $6 = te || _6.getPickableThreeJSObjects(); return G6.length = 0, b6.intersectObjects($6, true, G6); }, this.setPickableObjects = (le) => { le === void 0 ? te = void 0 : (te = [], le.forEach((W6) => { W6.getGroup() && W6.getGroup().visible && te.push(W6.getGroup()); })); }, this.getIntersectsObjectWithOrigin = (le, W6, $6) => (b6.set(W6, $6), this.getIntersectsObject(le)), this.getIntersectsObjectWithCamera = (le, W6, $6) => (le.getNDCFromDocumentCoords(W6, $6, F6), b6.setFromCamera(F6, le.cameraObject), this.getIntersectsObject(le)), this.pick = (le, W6, $6) => { if (E6 && _6 && le && C6) { this.getIntersectsObjectWithCamera(le, W6, $6); for (var j6, re = G6.length, k6 = 0; k6 < re; k6++) if (j6 = G6[k6].object ? G6[k6].object.userData : void 0, j6 && j6.isMarkerCluster && j6.visible && j6.clusterIsVisible(G6[k6].object.clusterIndex) && j6.zoomToCluster(G6[k6].object.clusterIndex)) return; C6(G6, W6, $6); } }; var ae = (le, W6, $6) => { if (E6 && _6 && le && I6) { if (this.getIntersectsObjectWithCamera(le, W6, $6), N6.setTime(Date.now()), G6.length === 0) { if (B6) return; B6 = true; } else B6 = false; I6(G6, W6, $6); } }; this.move = (le, W6, $6) => { E6 && _6 && le && I6 && (_6.displayMarkers ? ae(le, W6, $6) : (Y.zincCamera = le, Y.x = W6, Y.y = $6, !D6 && (U6 = N6 ? Date.now() - N6.getTime() : 250, 250 <= U6 ? ae(le, W6, $6) : (D6 = true, setTimeout(ie(Y), U6))))); }; var ie = (le) => function() { D6 = false, ae(le.zincCamera, le.x, le.y); }; }, y6 = function(M6, R6, L6, T6) { var P6 = new l.Vector3(), _6 = -R6, S6 = T6, E6 = M6; this.stopOnCameraInput = L6, this.requireUpdate = true; var C6 = new l.Vector3(), I6 = new l.Vector3(), b6 = (F6) => { var D6 = Math.sqrt(F6[0] * F6[0] + F6[1] * F6[1]), N6 = 4 * Math.abs(F6[0]), B6 = 4 * Math.abs(F6[1]), U6 = 0.25 * (N6 + B6), G6 = -F6[1] / D6, Y = F6[0] / D6, te = G6 * F6[0] + Y * -F6[1]; te > U6 ? te = U6 : te < -U6 && (te = -U6); var ae = Math.acos(te / U6) - 0.5 * Math.PI; P6.copy(S6.cameraObject.position).sub(S6.cameraObject.target).normalize(), C6.copy(S6.cameraObject.up).normalize(), I6.crossVectors(C6, P6).normalize().multiplyScalar(G6), C6.multiplyScalar(Y), C6.add(I6).multiplyScalar(Math.cos(ae)), P6.multiplyScalar(Math.sin(ae)).add(C6); }; this.update = (F6) => { this.enabled === false || (this.requireUpdate && (b6(E6), this.requireUpdate = false), S6.rotateAboutLookAtpoint(P6, _6 * F6 / 1e3)); }; }, v6 = function() { this.type = "StereoCamera", this.aspect = 1, this.cameraL = new l.PerspectiveCamera(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = false, this.cameraR = new l.PerspectiveCamera(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = false; }; Object.assign(v6.prototype, { update: (() => { var A6, M6, R6, L6, T6, P6, _6 = new l.Matrix4(), S6 = new l.Matrix4(); return function(C6) { var I6 = A6 !== C6.focus || M6 !== C6.fov || R6 !== C6.aspect * this.aspect || L6 !== C6.near || T6 !== C6.far || P6 !== C6.zoom; if (I6) { A6 = C6.focus, M6 = C6.fov, R6 = C6.aspect * this.aspect, L6 = C6.near, T6 = C6.far, P6 = C6.zoom; var b6, F6, D6 = C6.projectionMatrix.clone(), N6 = 0.064 / 2, B6 = N6 * L6 / A6, U6 = L6 * Math.tan(0.5 * (l.Math.DEG2RAD * M6)) / C6.zoom; S6.elements[12] = -N6, _6.elements[12] = N6, b6 = -U6 * R6 + B6, F6 = U6 * R6 + B6, D6.elements[0] = 2 * L6 / (F6 - b6), D6.elements[8] = (F6 + b6) / (F6 - b6), this.cameraL.projectionMatrix.copy(D6), b6 = -U6 * R6 - B6, F6 = U6 * R6 - B6, D6.elements[0] = 2 * L6 / (F6 - b6), D6.elements[8] = (F6 + b6) / (F6 - b6), this.cameraR.projectionMatrix.copy(D6); } this.cameraL.matrixWorld.copy(C6.matrixWorld).multiply(S6), this.cameraR.matrixWorld.copy(C6.matrixWorld).multiply(_6); }; })() }); var m6 = function(M6) { var R6 = new v6(); R6.aspect = 0.5, this.setSize = (L6, T6) => { M6.setSize(L6, T6); }, this.render = (L6, T6) => { L6.updateMatrixWorld(), T6.parent === null && T6.updateMatrixWorld(), R6.update(T6); var P6 = M6.getSize(); M6.setScissorTest(true), M6.clear(), M6.setScissor(0, 0, P6.width / 2, P6.height), M6.setViewport(0, 0, P6.width / 2, P6.height), M6.render(L6, R6.cameraL), M6.setScissor(P6.width / 2, 0, P6.width / 2, P6.height), M6.setViewport(P6.width / 2, 0, P6.width / 2, P6.height), M6.render(L6, R6.cameraR), M6.setScissorTest(false); }; }, x6 = function(M6) { var R6 = this; this.object = M6, this.object.rotation.reorder("YXZ"), this.enabled = true, this.deviceOrientation = {}, this.screenOrientation = 0; var L6 = (_6) => { R6.deviceOrientation = _6; }, T6 = () => { typeof window < "u" && (R6.screenOrientation = window.orientation || 0); }, P6 = (() => { var _6 = new l.Vector3(0, 0, 1), S6 = new l.Euler(), E6 = new l.Quaternion(), C6 = new l.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); return (I6, b6, F6, D6, N6) => { var B6 = new l.Vector3(0, 0, 1); B6.subVectors(I6.target, I6.position), S6.set(F6, b6, -D6, "YXZ"); var U6 = new l.Quaternion(); U6.setFromEuler(S6), U6.multiply(C6), U6.multiply(E6.setFromAxisAngle(_6, -N6)), B6.applyQuaternion(U6), B6.addVectors(I6.position, B6), I6.lookAt(B6); }; })(); this.connect = () => { T6(), typeof window < "u" && (window.addEventListener("orientationchange", T6, false), window.addEventListener("deviceorientation", L6, false)), R6.enabled = true; }, this.disconnect = () => { typeof window < "u" && (window.removeEventListener("orientationchange", T6, false), window.removeEventListener("deviceorientation", L6, false)), R6.enabled = false; }, this.update = () => { if (R6.enabled !== false) { var _6 = R6.deviceOrientation.alpha ? l.Math.degToRad(R6.deviceOrientation.alpha) : 0, S6 = R6.deviceOrientation.beta ? l.Math.degToRad(R6.deviceOrientation.beta) : 0, E6 = R6.deviceOrientation.gamma ? l.Math.degToRad(R6.deviceOrientation.gamma) : 0, C6 = R6.screenOrientation ? l.Math.degToRad(R6.screenOrientation) : 0; P6(R6.object, _6, S6, E6, C6); } }, this.dispose = function() { this.disconnect(); }, this.connect(); }, w6 = function() { var M6 = void 0, R6 = void 0, L6 = void 0, T6 = new l.Vector3(), P6 = new l.Vector3(), _6 = new l.Vector3(), S6 = new l.Vector3(), E6 = void 0; this.setCurrentCameraSettings = (C6, I6) => { M6 = C6.clone(), R6 = C6, L6 = I6, M6.near = L6.nearPlane, L6.farPlane && (M6.far = L6.farPlane), L6.eyePosition && M6.position.set(L6.eyePosition[0], L6.eyePosition[1], L6.eyePosition[2]), L6.upVector && M6.up.set(L6.upVector[0], L6.upVector[1], L6.upVector[2]), L6.targetPosition && (M6.target = new l.Vector3(L6.targetPosition[0], L6.targetPosition[1], L6.targetPosition[2]), M6.lookAt(M6.target)), M6.updateProjectionMatrix(), T6.copy(M6.position).project(M6), P6.copy(M6.target).project(M6); }, this.getCurrentPosition = () => (P6.copy(R6.target).project(M6), [P6.x, P6.y]), this.zoom = (C6) => { var I6 = 2e-3 * C6, b6 = Math.max(R6.zoom - I6, 1); R6.zoom = b6, R6.updateProjectionMatrix(); }, this.zoomToBox = (C6, I6) => { C6.getCenter(_6), _6.project(M6), this.setCenterZoom([_6.x, _6.y], I6); }, this.getPanZoom = () => ({ target: this.getCurrentPosition(), zoom: R6.zoom }), this.setCenterZoom = (C6, I6) => { _6.set(C6[0], C6[1], P6.z).unproject(M6), S6.copy(_6).sub(R6.target), R6.target.copy(_6), R6.lookAt(R6.target), R6.position.add(S6), R6.zoom = I6, R6.updateProjectionMatrix(); }, this.setEventCallback = (C6) => { (C6 === void 0 || typeof C6 == "function") && (E6 = C6); }, this.triggerCallback = () => { E6 !== void 0 && typeof E6 == "function" && E6(); }; }; a6.Viewport = h6, a6.CameraControls = f6, a6.SmoothCameraTransition = g6, a6.RotateCameraTransition = p, a6.RayCaster = u6, a6.CameraAutoTumble = y6, a6.StereoEffect = m6, a6.NDCCameraControl = w6; }, /* 45 */ /***/ (o, a6, c) => { var { Group: l, Matrix4: d } = c(4), h6 = c(22).Pointset; c(24).Lines; var f6 = c(46).Lines2, g6 = c(3).Geometry, p = c(4), u6 = 0, y6 = function() { return "re" + u6++; }, v6 = function(m6, x6) { var w6 = m6, A6 = new l(); A6.matrixAutoUpdate = false, A6.userData = this; var M6 = [], R6 = "", L6 = [], T6 = x6, P6 = new d(), _6 = 3e3; P6.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.pickableUpdateRequired = true, this.isRegion = true, this.uuid = y6(), this.hideAllPrimitives = () => { M6.forEach((S6) => S6.hideAllPrimitives()), L6.forEach((S6) => S6.setVisibility(false)); }, this.showAllPrimitives = () => { M6.forEach((S6) => S6.showAllPrimitives()), L6.forEach((S6) => S6.setVisibility(true)); }, this.setVisibility = (S6) => { S6 != A6.visible && (A6.visible = S6, this.pickableUpdateRequired = true); }, this.getVisibility = () => A6.visible, this.getGroup = () => A6, this.setTransformation = (S6) => { P6.set(...S6), A6.matrix.copy(P6), A6.updateMatrixWorld(); }, this.setName = (S6) => { S6 && S6 !== "" && (R6 = S6); }, this.getName = () => R6, this.getParent = () => w6, this.getFullSeparatedPath = () => { var S6 = []; if (R6 !== "") { S6.push(R6); for (var E6, C6 = w6; C6 !== void 0; ) E6 = C6.getName(), E6 !== "" && S6.unshift(E6), C6 = C6.getParent(); } return S6; }, this.getFullPath = () => { var S6 = this.getFullSeparatedPath(); if (0 < S6.length) { var E6 = S6.shift(); return S6.forEach((C6) => { E6 = E6.concat("/", C6); }), E6; } return ""; }, this.createChild = (S6) => { var E6 = new v6(this, T6); return E6.setName(S6), M6.push(E6), A6.add(E6.getGroup()), E6; }, this.getChildWithName = (S6) => { if (S6) { for (var E6 = S6.toLowerCase(), C6 = 0; C6 < M6.length; C6++) if (M6[C6].getName().toLowerCase() === E6) return M6[C6]; } }, this.findChildFromSeparatedPath = (S6) => { if (S6 && 0 < S6.length && S6[0] === "" && S6.shift(), S6 && 0 < S6.length) { var E6 = this.getChildWithName(S6[0]); return E6 ? (S6.shift(), E6.findChildFromSeparatedPath(S6)) : void 0; } return this; }, this.findChildFromPath = (S6) => { var E6 = S6.split("/"); return this.findChildFromSeparatedPath(E6); }, this.createChildFromSeparatedPath = (S6) => { if (0 < S6.length && S6[0] === "" && S6.shift(), 0 < S6.length) { var E6 = this.getChildWithName(S6[0]); return E6 || (E6 = this.createChild(S6[0])), S6.shift(), E6.createChildFromSeparatedPath(S6); } return this; }, this.createChildFromPath = (S6) => { var E6 = S6.split("/"); return this.createChildFromSeparatedPath(E6); }, this.findOrCreateChildFromPath = (S6) => { var E6 = this.findChildFromPath(S6); return E6 || (E6 = this.createChildFromPath(S6)), E6; }, this.addZincObject = (S6) => { S6 && (S6.setRegion(this), A6.add(S6.getGroup()), L6.push(S6), this.pickableUpdateRequired = true, T6 && T6.triggerObjectAddedCallback(S6)); }, this.removeZincObject = (S6) => { for (var E6 = 0; E6 < L6.length; E6++) if (S6 === L6[E6]) return A6.remove(S6.getGroup()), L6.splice(E6, 1), T6 && T6.triggerObjectRemovedCallback(S6), S6.dispose(), void (this.pickableUpdateRequired = true); }, this.checkPickableUpdateRequred = (S6) => { if (this.pickableUpdateRequired) return true; if (S6) { for (var E6 = false, C6 = 0; C6 < M6.length; C6++) if (E6 = M6[C6].checkPickableUpdateRequred(S6), E6) return true; } return false; }, this.getPickableThreeJSObjects = (S6, E6) => (A6.visible && (L6.forEach((C6) => { if (C6.isPickable && C6.getGroup() && C6.getGroup().visible) { var I6 = C6.marker; I6 && I6.isEnabled() && S6.push(I6.getMorph()), S6.push(C6.getGroup()); } }), E6 && M6.forEach((C6) => { C6.getPickableThreeJSObjects(S6, E6); }), this.pickableUpdateRequired = false), S6), this.setDuration = (S6) => { _6 = S6, L6.forEach((E6) => E6.setDuration(S6)), M6.forEach((E6) => E6.setDuration(S6)); }, this.getDuration = () => _6, this.getBoundingBox = (S6) => { var E6, C6; return L6.forEach((I6) => { C6 = I6.getBoundingBox(), C6 && (E6 == null ? E6 = C6.clone() : E6.union(C6)); }), S6 && M6.forEach((I6) => { C6 = I6.getBoundingBox(S6), C6 && (E6 == null ? E6 = C6.clone() : E6.union(C6)); }), E6; }, this.clear = (S6) => { S6 && M6.forEach((E6) => E6.clear(S6)), L6.forEach((E6) => { A6.remove(E6.getGroup()), E6.dispose(); }), M6 = [], L6 = []; }, this.objectIsInRegion = (S6, E6) => { for (var C6 = 0; C6 < L6.length; C6++) if (S6 === L6[C6]) return true; if (E6) { for (var I6 = 0; I6 < M6.length; I6++) if (M6[I6].objectIsInRegion(S6, E6)) return true; } return false; }, this.forEachGeometry = (S6, E6) => { L6.forEach((C6) => { C6.isGeometry && S6(C6); }), E6 && M6.forEach((C6) => C6.forEachGeometry(S6, E6)); }, this.forEachGlyphset = (S6, E6) => { L6.forEach((C6) => { C6.isGlyphset && S6(C6); }), E6 && M6.forEach((C6) => C6.forEachGlyphset(S6, E6)); }, this.forEachPointset = (S6, E6) => { L6.forEach((C6) => { C6.isPointset && S6(C6); }), E6 && M6.forEach((C6) => C6.forEachPointset(S6, E6)); }, this.forEachLine = (S6, E6) => { L6.forEach((C6) => { C6.isLines && S6(C6); }), E6 && M6.forEach((C6) => C6.forEachLine(S6, E6)); }, this.findObjectsWithAnatomicalId = (S6, E6) => { var C6 = []; return L6.forEach((I6) => { I6.anatomicalId === S6 && C6.push(I6); }), E6 && M6.forEach((I6) => { var b6 = I6.findObjectsWithAnatomicalId(S6, E6); C6.push(...b6); }), C6; }, this.findObjectsWithGroupName = (S6, E6) => { var C6 = []; return L6.forEach((I6) => { var b6 = I6.groupName ? I6.groupName.toLowerCase() : I6.groupName, F6 = S6 && S6.toLowerCase(); b6 === F6 && C6.push(I6); }), E6 && M6.forEach((I6) => { var b6 = I6.findObjectsWithGroupName(S6, E6); C6.push(...b6); }), C6; }, this.findGeometriesWithGroupName = (S6, E6) => { var C6 = this.findObjectsWithGroupName(S6, E6), I6 = C6.filter((b6) => b6.isGeometry); return I6; }, this.findPointsetsWithGroupName = (S6, E6) => { var C6 = this.findObjectsWithGroupName(S6, E6), I6 = C6.filter((b6) => b6.isPointset); return I6; }, this.findGlyphsetsWithGroupName = (S6, E6) => { var C6 = this.findObjectsWithGroupName(S6, E6), I6 = C6.filter((b6) => b6.isGlyphset); return I6; }, this.findLinesWithGroupName = (S6, E6) => { var C6 = this.findObjectsWithGroupName(S6, E6), I6 = C6.filter((b6) => b6.isLines); return I6; }, this.getAllObjects = (S6) => { var E6 = [...L6]; return S6 && M6.forEach((C6) => { var I6 = C6.getAllObjects(S6); E6.push(...I6); }), E6; }, this.getChildRegions = (S6) => { var E6 = [...M6]; return S6 && M6.forEach((C6) => { var I6 = C6.getChildRegions(S6); E6.push(...I6); }), E6; }, this.getCurrentTime = () => { if (L6[0] != null) return L6[0].getCurrentTime(); for (var S6, E6 = 0; E6 < M6.length; E6++) if (S6 = M6[E6].getCurrentTime(), S6 !== -1) return S6; return -1; }, this.setMorphTime = (S6, E6) => { L6.forEach((C6) => { C6.setMorphTime(S6); }), E6 && M6.forEach((C6) => { C6.setMorphTime(S6); }); }, this.isTimeVarying = () => { for (var S6 = 0; S6 < L6.length; S6++) if (L6[S6].isTimeVarying()) return true; for (var E6 = 0; E6 < M6.length; E6++) if (M6[E6].isTimeVarying()) return true; return false; }, this.renderGeometries = (S6, E6, C6, I6, b6, F6) => { var D6, N6 = this.getAllObjects(F6); N6.forEach((B6) => { B6.render(S6 * E6, C6, I6, b6); }), b6 && C6 === false && (D6 = b6.markerCluster) !== null && D6 !== void 0 && D6.markerUpdateRequired && b6.markerCluster.calculate(); }, this.createPoints = (S6, E6, C6, I6) => { var b6 = false, F6 = this.findObjectsWithGroupName(S6, false), D6 = F6.findIndex((B6) => B6.isPointset), N6 = -1 < D6 ? F6[D6] : new h6(); return N6.addPoints(E6, C6, I6), D6 === -1 ? (N6.setName(S6), this.addZincObject(N6), b6 = true) : this.pickableUpdateRequired = true, { zincObject: N6, isNew: b6 }; }, this.createLines = (S6, E6, C6) => { var I6 = false, b6 = this.findObjectsWithGroupName(S6, false), F6 = b6.findIndex((N6) => N6.isLines), D6 = -1 < F6 ? b6[F6] : new f6(); return D6.addLines(E6, C6), F6 === -1 ? (D6.setName(S6), this.addZincObject(D6), I6 = true) : this.pickableUpdateRequired = true, { zincObject: D6, isNew: I6 }; }, this.createGeometryFromThreeJSGeometry = (S6, E6, C6, I6, b6, F6) => { var D6 = new g6(), N6 = new p.MeshPhongMaterial({ color: C6, morphTargets: false, morphNormals: false, transparent: true, opacity: I6, side: p.DoubleSide }); return D6.createMesh(E6, N6, { localTimeEnabled: false, localMorphColour: false }), D6.getMorph() ? (D6.setVisibility(false), D6.setName(S6), D6.setRenderOrder(F6), this.addZincObject(D6), D6) : void 0; }; }; a6.Region = v6; }, /* 46 */ /***/ (o, a6, c) => { c(4), c(5).toBufferGeometry; var l = c(47).LineSegments2, d = c(49).LineMaterial, h6 = c(48).LineSegmentsGeometry, f6 = function() { c(24).Lines.call(this), this.isLines2 = true; var g6 = Array(300); this.createLineSegment = (p, u6, y6) => { if (p && u6) { var v6 = new h6(); v6.setPositions(p), v6.colorsNeedUpdate = true; var m6 = new l(v6, u6); m6.scale.set(1, 1, 1), m6.computeLineDistances(), this.setMesh(m6, y6.localTimeEnabled, y6.localMorphColour); } }, this.setWidth = (p) => { this.morph && this.morph.material && (this.morph.material.linewidth = p, this.morph.material.needsUpdate = true); }, this.addVertices = function(p) { if (p && p.length) { var u6 = this.getMorph(); u6 || (this.drawRange = 0); var y6 = 3 * this.drawRange; if (p.forEach((v6) => { g6[y6++] = v6[0], g6[y6++] = v6[1], g6[y6++] = v6[2], this.drawRange++; }), !u6) for (; 300 > y6; ) g6[y6++] = p[0][0], g6[y6++] = p[0][1], g6[y6++] = p[0][2]; u6 && (u6.geometry.setPositions(g6), u6.computeLineDistances(), this.boundingBoxUpdateRequired = true); } return g6; }, this.getVerticesByFaceIndex = function(p) { var u6 = 3 * (2 * p), y6 = this.getMorph(); if (y6 && 3 * this.drawRange > u6) { var v6 = y6.geometry.getAttribute("instanceStart"); return [[v6.data.array[u6], v6.data.array[++u6], v6.data.array[++u6]], [v6.data.array[++u6], v6.data.array[++u6], v6.data.array[++u6]]]; } return []; }, this.editVertices = function(p, u6) { if (p && p.length) { var y6 = this.getMorph(), v6 = u6 + p.length - 1; if (!y6 || 0 > u6 || v6 >= this.drawRange) return; var m6 = 3 * u6; for (p.forEach((x6) => { g6[m6++] = x6[0], g6[m6++] = x6[1], g6[m6++] = x6[2]; }), m6 = 3 * this.drawRange; 300 > m6; ) g6[m6++] = p[0][0], g6[m6++] = p[0][1], g6[m6++] = p[0][2]; y6.geometry.setPositions(g6), y6.computeLineDistances(), this.boundingBoxUpdateRequired = true; } return g6; }, this.addLines = (p, u6) => { if (p && 0 < p.length) { this.addVertices(p); var y6 = this.getMorph(); if (!y6) { var v6 = new d({ color: u6, linewidth: 1, vertexColors: false, worldUnits: false }); v6.resolution.set(window.innerWidth, window.innerHeight), this.createLineSegment(g6, v6, { localTimeEnabled: false, localMorphColour: false }); } this.region && (this.region.pickableUpdateRequired = true); } }, this.render = () => { var p = this.getMorph().material; p.resolution.set(window.innerWidth, window.innerHeight); }; }; f6.prototype = Object.create(c(24).Lines.prototype), f6.prototype.constructor = f6, a6.Lines2 = f6; }, /* 47 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ LineSegments2: () => ( /* binding */ L6 ) /* harmony export */ }); var l = c(4), d = c(48), h6 = c(49), f6 = new l.Vector3(), g6 = new l.Vector3(), p = new l.Vector4(), u6 = new l.Vector4(), y6 = new l.Vector4(), v6 = new l.Vector3(), m6 = new l.Matrix4(), x6 = new l.Line3(), w6 = new l.Vector3(), A6 = new l.Box3(), M6 = new l.Sphere(), R6 = new l.Vector4(); class L6 extends l.Mesh { constructor() { var P6 = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new d.LineSegmentsGeometry(), _6 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new h6.LineMaterial({ color: 16777215 * Math.random() }); super(P6, _6), this.type = "LineSegments2"; } // for backwards-compatability, but could be a method of LineSegmentsGeometry... computeLineDistances() { for (var P6 = this.geometry, _6 = P6.attributes.instanceStart, S6 = P6.attributes.instanceEnd, E6 = new Float32Array(2 * _6.count), C6 = 0, I6 = 0, b6 = _6.count; C6 < b6; C6++, I6 += 2) f6.fromBufferAttribute(_6, C6), g6.fromBufferAttribute(S6, C6), E6[I6] = I6 == 0 ? 0 : E6[I6 - 1], E6[I6 + 1] = E6[I6] + f6.distanceTo(g6); var F6 = new l.InstancedInterleavedBuffer(E6, 2, 1); return P6.setAttribute("instanceDistanceStart", new l.InterleavedBufferAttribute(F6, 1, 0)), P6.setAttribute("instanceDistanceEnd", new l.InterleavedBufferAttribute(F6, 1, 1)), this; } raycast(P6, _6) { P6.camera === null && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.'); var S6 = P6.params.Line2 === void 0 ? 0 : P6.params.Line2.threshold || 0, E6 = P6.ray, C6 = P6.camera, I6 = C6.projectionMatrix, b6 = this.matrixWorld, F6 = this.geometry, D6 = this.material, N6 = D6.resolution, B6 = D6.linewidth + S6, U6 = F6.attributes.instanceStart, G6 = F6.attributes.instanceEnd, Y = -C6.near, te = 2 * Math.max(B6 / N6.width, B6 / N6.height); F6.boundingSphere === null && F6.computeBoundingSphere(), M6.copy(F6.boundingSphere).applyMatrix4(b6); var ae = Math.max(C6.near, M6.distanceToPoint(E6.origin)); R6.set(0, 0, -ae, 1).applyMatrix4(C6.projectionMatrix), R6.multiplyScalar(1 / R6.w), R6.applyMatrix4(C6.projectionMatrixInverse); var ie = 0.5 * Math.abs(te / R6.w); if (M6.radius += ie, P6.ray.intersectsSphere(M6) !== false) { F6.boundingBox === null && F6.computeBoundingBox(), A6.copy(F6.boundingBox).applyMatrix4(b6); var le = Math.max(C6.near, A6.distanceToPoint(E6.origin)); R6.set(0, 0, -le, 1).applyMatrix4(C6.projectionMatrix), R6.multiplyScalar(1 / R6.w), R6.applyMatrix4(C6.projectionMatrixInverse); var W6 = 0.5 * Math.abs(te / R6.w); if (A6.max.x += W6, A6.max.y += W6, A6.max.z += W6, A6.min.x -= W6, A6.min.y -= W6, A6.min.z -= W6, P6.ray.intersectsBox(A6) !== false) { E6.at(1, y6), y6.w = 1, y6.applyMatrix4(C6.matrixWorldInverse), y6.applyMatrix4(I6), y6.multiplyScalar(1 / y6.w), y6.x *= N6.x / 2, y6.y *= N6.y / 2, y6.z = 0, v6.copy(y6), m6.multiplyMatrices(C6.matrixWorldInverse, b6); for (var $6 = 0, j6 = U6.count; $6 < j6; $6++) { p.fromBufferAttribute(U6, $6), u6.fromBufferAttribute(G6, $6), p.w = 1, u6.w = 1, p.applyMatrix4(m6), u6.applyMatrix4(m6); var re = p.z > Y && u6.z > Y; if (!re) { if (p.z > Y) { var k6 = p.z - u6.z, H6 = (p.z - Y) / k6; p.lerp(u6, H6); } else if (u6.z > Y) { var K = u6.z - p.z, ce = (u6.z - Y) / K; u6.lerp(p, ce); } p.applyMatrix4(I6), u6.applyMatrix4(I6), p.multiplyScalar(1 / p.w), u6.multiplyScalar(1 / u6.w), p.x *= N6.x / 2, p.y *= N6.y / 2, u6.x *= N6.x / 2, u6.y *= N6.y / 2, x6.start.copy(p), x6.start.z = 0, x6.end.copy(u6), x6.end.z = 0; var se = x6.closestPointToPointParameter(v6, true); x6.at(se, w6); var V6 = l.MathUtils.lerp(p.z, u6.z, se), O6 = -1 <= V6 && 1 >= V6, Z6 = v6.distanceTo(w6) < 0.5 * B6; if (O6 && Z6) { x6.start.fromBufferAttribute(U6, $6), x6.end.fromBufferAttribute(G6, $6), x6.start.applyMatrix4(b6), x6.end.applyMatrix4(b6); var X = new l.Vector3(), ee = new l.Vector3(); E6.distanceSqToSegment(x6.start, x6.end, ee, X), _6.push({ point: ee, pointOnLine: X, distance: E6.origin.distanceTo(ee), object: this, face: null, faceIndex: $6, uv: null, uv2: null }); } } } } } } } L6.prototype.LineSegments2 = true; }, /* 48 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ LineSegmentsGeometry: () => ( /* binding */ f6 ) /* harmony export */ }); var l = c(4), d = new l.Box3(), h6 = new l.Vector3(); class f6 extends l.InstancedBufferGeometry { constructor() { super(), this.type = "LineSegmentsGeometry", this.setIndex([0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5]), this.setAttribute("position", new l.Float32BufferAttribute([-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], 3)), this.setAttribute("uv", new l.Float32BufferAttribute([-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], 2)); } applyMatrix4(p) { var u6 = this.attributes.instanceStart, y6 = this.attributes.instanceEnd; return u6 !== void 0 && (u6.applyMatrix4(p), y6.applyMatrix4(p), u6.needsUpdate = true), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } setPositions(p) { var u6; p instanceof Float32Array ? u6 = p : Array.isArray(p) && (u6 = new Float32Array(p)); var y6 = new l.InstancedInterleavedBuffer(u6, 6, 1); return this.setAttribute("instanceStart", new l.InterleavedBufferAttribute(y6, 3, 0)), this.setAttribute("instanceEnd", new l.InterleavedBufferAttribute(y6, 3, 3)), this.computeBoundingBox(), this.computeBoundingSphere(), this; } setColors(p) { var u6; p instanceof Float32Array ? u6 = p : Array.isArray(p) && (u6 = new Float32Array(p)); var y6 = new l.InstancedInterleavedBuffer(u6, 6, 1); return this.setAttribute("instanceColorStart", new l.InterleavedBufferAttribute(y6, 3, 0)), this.setAttribute("instanceColorEnd", new l.InterleavedBufferAttribute(y6, 3, 3)), this; } fromWireframeGeometry(p) { return this.setPositions(p.attributes.position.array), this; } fromEdgesGeometry(p) { return this.setPositions(p.attributes.position.array), this; } fromMesh(p) { return this.fromWireframeGeometry(new l.WireframeGeometry(p.geometry)), this; } fromLineSegments(p) { var u6 = p.geometry; return u6.isGeometry ? void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.") : (u6.isBufferGeometry && this.setPositions(u6.attributes.position.array), this); } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new l.Box3()); var p = this.attributes.instanceStart, u6 = this.attributes.instanceEnd; p !== void 0 && u6 !== void 0 && (this.boundingBox.setFromBufferAttribute(p), d.setFromBufferAttribute(u6), this.boundingBox.union(d)); } computeBoundingSphere() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingBox === null && this.computeBoundingBox(); var p = this.attributes.instanceStart, u6 = this.attributes.instanceEnd; if (p !== void 0 && u6 !== void 0) { var y6 = this.boundingSphere.center; this.boundingBox.getCenter(y6); for (var v6 = 0, m6 = 0, x6 = p.count; m6 < x6; m6++) h6.fromBufferAttribute(p, m6), v6 = Math.max(v6, y6.distanceToSquared(h6)), h6.fromBufferAttribute(u6, m6), v6 = Math.max(v6, y6.distanceToSquared(h6)); this.boundingSphere.radius = Math.sqrt(v6), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this); } } toJSON() { } applyMatrix(p) { return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."), this.applyMatrix4(p); } } f6.prototype.isLineSegmentsGeometry = true; }, /* 49 */ /***/ (o, a6, c) => { c.r(a6), c.d(a6, { /* harmony export */ LineMaterial: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); l.UniformsLib.line = { linewidth: { value: 1 }, resolution: { value: new l.Vector2(1, 1) }, dashScale: { value: 1 }, dashSize: { value: 1 }, dashOffset: { value: 0 }, gapSize: { value: 1 }, // todo FIX - maybe change to totalSize opacity: { value: 1 } }, l.ShaderLib.line = { uniforms: l.UniformsUtils.merge([l.UniformsLib.common, l.UniformsLib.fog, l.UniformsLib.line]), vertexShader: ( /* glsl */ ` #include #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; varying vec2 vUv; #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; #endif float aspect = resolution.x / resolution.y; vUv = uv; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec2 ndcStart = clipStart.xy / clipStart.w; vec2 ndcEnd = clipEnd.xy / clipEnd.w; // direction vec2 dir = ndcEnd - ndcStart; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); // perpendicular to dir vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include }` ), fragmentShader: ( /* glsl */ ` uniform vec3 diffuse; uniform float opacity; #ifdef USE_DASH uniform float dashSize; uniform float dashOffset; uniform float gapSize; #endif varying float vLineDistance; #include #include #include #include #include varying vec2 vUv; void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include }` ) }; class d extends l.ShaderMaterial { constructor(f6) { super({ type: "LineMaterial", uniforms: l.UniformsUtils.clone(l.ShaderLib.line.uniforms), vertexShader: l.ShaderLib.line.vertexShader, fragmentShader: l.ShaderLib.line.fragmentShader, clipping: true // required for clipping support }), Object.defineProperties(this, { color: { enumerable: true, get: function() { return this.uniforms.diffuse.value; }, set: function(p) { this.uniforms.diffuse.value = p; } }, linewidth: { enumerable: true, get: function() { return this.uniforms.linewidth.value; }, set: function(p) { this.uniforms.linewidth.value = p; } }, dashed: { enumerable: true, get: function() { return "USE_DASH" in this.defines; }, set(g6) { !!g6 != "USE_DASH" in this.defines && (this.needsUpdate = true), g6 === true ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH; } }, dashScale: { enumerable: true, get: function() { return this.uniforms.dashScale.value; }, set: function(p) { this.uniforms.dashScale.value = p; } }, dashSize: { enumerable: true, get: function() { return this.uniforms.dashSize.value; }, set: function(p) { this.uniforms.dashSize.value = p; } }, dashOffset: { enumerable: true, get: function() { return this.uniforms.dashOffset.value; }, set: function(p) { this.uniforms.dashOffset.value = p; } }, gapSize: { enumerable: true, get: function() { return this.uniforms.gapSize.value; }, set: function(p) { this.uniforms.gapSize.value = p; } }, opacity: { enumerable: true, get: function() { return this.uniforms.opacity.value; }, set: function(p) { this.uniforms.opacity.value = p; } }, resolution: { enumerable: true, get: function() { return this.uniforms.resolution.value; }, set: function(p) { this.uniforms.resolution.value.copy(p); } }, alphaToCoverage: { enumerable: true, get: function() { return "ALPHA_TO_COVERAGE" in this.defines; }, set: function(p) { !!p != "ALPHA_TO_COVERAGE" in this.defines && (this.needsUpdate = true), p === true ? (this.defines.ALPHA_TO_COVERAGE = "", this.extensions.derivatives = true) : (delete this.defines.ALPHA_TO_COVERAGE, this.extensions.derivatives = false); } } }), this.setValues(f6); } } d.prototype.isLineMaterial = true; }, /* 50 */ /***/ (o, a6, c) => { var l = c(4); a6.Minimap = function(d) { var h6 = d; this.camera = new l.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, 0.01, 10), this.helper = void 0; var f6 = new l.BufferGeometry(), g6 = new Float32Array([-1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1]), p = new l.BufferAttribute(g6, 3); f6.setAttribute("position", p); var u6 = new l.MeshBasicMaterial({ color: 3355443, depthTest: false, depthWrite: false, opacity: 0.5, transparent: true }); this.mask = new l.Mesh(f6, u6); var y6 = new l.Box3(), v6 = new l.Vector3(); this.getDiffFromNormalised = (x6, w6) => { y6.setFromBufferAttribute(p).getCenter(v6); var A6 = v6.clone().project(this.camera), M6 = new l.Vector3(x6, w6, A6.z).unproject(this.camera); return M6.sub(v6); }; var m6 = (x6, w6) => { h6.camera.near && (this.camera.near = h6.camera.near), w6.farPlane && (this.camera.far = w6.farPlane), w6.eyePosition && this.camera.position.set(w6.eyePosition[0], w6.eyePosition[1], w6.eyePosition[2]), w6.upVector && this.camera.up.set(w6.upVector[0], w6.upVector[1], w6.upVector[2]), w6.targetPosition && this.camera.lookAt(new l.Vector3(w6.targetPosition[0], w6.targetPosition[1], w6.targetPosition[2])), this.camera.zoom = 1 / x6, this.camera.updateProjectionMatrix(); }; this.getBoundary = () => { var x6 = new l.Vector3().copy(h6.camera.target).project(h6.camera), w6 = new l.Vector3(-1, -1, x6.z).unproject(h6.camera), A6 = new l.Vector3(1, -1, x6.z).unproject(h6.camera), M6 = new l.Vector3(1, 1, x6.z).unproject(h6.camera), R6 = new l.Vector3(-1, 1, x6.z).unproject(h6.camera); p.copyVector3sArray([w6, A6, M6, M6, R6, w6]), p.needsUpdate = true; }, this.updateCamera = () => { this.getBoundary(); var x6 = h6.getZincCameraControls(), w6 = h6.getBoundingBox(); if (w6) { var A6 = w6.min.distanceTo(w6.max), M6 = A6 / 2, R6 = (w6.min.x + w6.max.x) / 2, L6 = (w6.min.y + w6.max.y) / 2, T6 = (w6.min.z + w6.max.z) / 2, P6 = x6.getViewportFromCentreAndRadius(R6, L6, T6, M6, 40, M6 * 4); m6(A6, P6); } }; }; }, /* 51 */ /***/ (o, a6, c) => { var l = c(4), d = c(52)(l), h6 = c(3).Geometry, f6 = c(53), g6 = c(54).default, p = l.BufferGeometryLoader, u6 = function(y6) { var v6; y6 && y6.isGeometry && (v6 = y6); var m6 = void 0, x6 = void 0, w6 = false, A6 = void 0, M6 = (_6) => { var S6 = v6.getMorph().material.clone(); S6.morphTargets = false; var E6 = new h6(), C6 = new p(), I6 = C6.parse(_6), b6 = new l.Mesh(I6.geometry, S6); return E6.geometry = b6.geometry, b6.userData = E6, E6.setMorph(b6), E6; }, R6 = (_6) => { switch (_6.data.action) { case "message": console.log(_6.data.message); break; case "result": var S6 = new u6(M6(_6.data.object)); A6 && A6(S6), A6 = void 0, w6 = false; break; default: throw "Cannot handle specified action."; } }, L6 = (_6) => { if (f6 !== void 0 && (x6 = f6( /*require.resolve*/ 55 )), !x6) m6 = new (c(56)).GeometryCSGInternal(_6); else if (_6 && _6.isGeometry) { var S6 = _6.getMorph(), E6 = S6.geometry.clone().applyMatrix(S6.matrix).toJSON(); x6.addEventListener("message", function(C6) { R6(C6); }), x6.postMessage({ action: "initialise", object: E6 }); } }; this.getHostGeometry = () => { var _6 = new d(v6.getMorph()); return new T6(_6); }, this.getGeometry = () => v6; var T6 = (_6) => { var S6 = v6.getMorph().material.clone(); S6.morphTargets = false; var E6 = _6.toMesh(S6), C6 = new h6(); return C6.geometry = E6.geometry, E6.userData = C6, C6.setMorph(E6), C6; }; this.setCSG = (_6) => { m6.setCSG(_6); }; var P6 = (_6, S6, E6, C6) => { if (w6) C6("On progress"); else { var I6 = _6.getMorph(), b6 = I6.geometry.clone().applyMatrix(I6.matrix).toJSON(); A6 = E6, w6 = true, x6.postMessage({ action: S6, object: b6 }); } }; this.intersect = (_6) => new g6((S6, E6) => { if (x6) P6(_6, "intersect", S6, E6); else { var C6 = m6.intersect(_6), I6 = new u6(T6(C6)); I6.setCSG(C6), S6(I6); } }), this.subtract = (_6) => new g6((S6, E6) => { if (x6) P6(_6, "intersect", S6, E6); else { var C6 = m6.subtract(_6), I6 = new u6(T6(C6)); I6.setCSG(C6), S6(I6); } }), this.union = (_6) => new g6((S6, E6) => { if (x6) P6(_6, "intersect", S6, E6); else { var C6 = m6.union(_6), I6 = new u6(T6(C6)); I6.setCSG(C6), S6(I6); } }), this.terminateWorker = () => { x6 && x6.terminate(); }, L6(y6); }; a6.GeometryCSG = u6; }, /* 52 */ /***/ (o) => { var a6 = 1e-5, c = 0, l = 1, d = 2, h6 = 3; o.exports = function(f6) { var g6 = function(p) { var u6, y6, v6, m6, x6, w6, A6, M6 = []; if (p.isBufferGeometry && (p = new f6.Geometry().fromBufferGeometry(p)), p instanceof f6.Geometry) this.matrix = new f6.Matrix4(); else if (p.isMesh) p.updateMatrix(), this.matrix = p.matrix.clone(), p = p.geometry, p.isBufferGeometry && (p = new f6.Geometry().fromBufferGeometry(p)), p.mergeVertices(), p.computeVertexNormals(false); else { if (p instanceof g6.Node) return this.tree = p, this.matrix = new f6.Matrix4(), this; throw "ThreeBSP: Given geometry is unsupported"; } for (u6 = 0, y6 = p.faces.length; u6 < y6; u6++) v6 = p.faces[u6], x6 = p.faceVertexUvs[0][u6], A6 = new g6.Polygon(), v6 instanceof f6.Face3 ? (m6 = p.vertices[v6.a], w6 = x6 ? new f6.Vector2(x6[0].x, x6[0].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[0], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6), m6 = p.vertices[v6.b], w6 = x6 ? new f6.Vector2(x6[1].x, x6[1].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[2], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6), m6 = p.vertices[v6.c], w6 = x6 ? new f6.Vector2(x6[2].x, x6[2].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[2], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6)) : (f6.Face4, m6 = p.vertices[v6.a], w6 = x6 ? new f6.Vector2(x6[0].x, x6[0].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[0], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6), m6 = p.vertices[v6.b], w6 = x6 ? new f6.Vector2(x6[1].x, x6[1].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[1], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6), m6 = p.vertices[v6.c], w6 = x6 ? new f6.Vector2(x6[2].x, x6[2].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[2], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6), m6 = p.vertices[v6.d], w6 = x6 ? new f6.Vector2(x6[3].x, x6[3].y) : null, m6 = new g6.Vertex(m6.x, m6.y, m6.z, v6.vertexNormals[3], w6), m6.applyMatrix4(this.matrix), A6.vertices.push(m6)), A6.calculateProperties(), M6.push(A6); this.tree = new g6.Node(M6); }; return g6.prototype.subtract = function(p) { var u6 = this.tree.clone(), y6 = p.tree.clone(); return u6.invert(), u6.clipTo(y6), y6.clipTo(u6), y6.invert(), y6.clipTo(u6), y6.invert(), u6.build(y6.allPolygons()), u6.invert(), u6 = new g6(u6), u6.matrix = this.matrix, u6; }, g6.prototype.union = function(p) { var u6 = this.tree.clone(), y6 = p.tree.clone(); return u6.clipTo(y6), y6.clipTo(u6), y6.invert(), y6.clipTo(u6), y6.invert(), u6.build(y6.allPolygons()), u6 = new g6(u6), u6.matrix = this.matrix, u6; }, g6.prototype.intersect = function(p) { var u6 = this.tree.clone(), y6 = p.tree.clone(); return u6.invert(), y6.clipTo(u6), y6.invert(), u6.clipTo(y6), y6.clipTo(u6), u6.build(y6.allPolygons()), u6.invert(), u6 = new g6(u6), u6.matrix = this.matrix, u6; }, g6.prototype.toGeometry = function() { var p, u6, y6, v6, m6, x6, w6, A6, M6, R6, L6 = new f6.Matrix4().getInverse(this.matrix), T6 = new f6.Geometry(), P6 = this.tree.allPolygons(), _6 = P6.length, S6 = {}; for (p = 0; p < _6; p++) for (y6 = P6[p], v6 = y6.vertices.length, u6 = 2; u6 < v6; u6++) R6 = [], A6 = y6.vertices[0], R6.push(new f6.Vector2(A6.uv.x, A6.uv.y)), A6 = new f6.Vector3(A6.x, A6.y, A6.z), A6.applyMatrix4(L6), typeof S6[A6.x + "," + A6.y + "," + A6.z] > "u" ? (T6.vertices.push(A6), m6 = S6[A6.x + "," + A6.y + "," + A6.z] = T6.vertices.length - 1) : m6 = S6[A6.x + "," + A6.y + "," + A6.z], A6 = y6.vertices[u6 - 1], R6.push(new f6.Vector2(A6.uv.x, A6.uv.y)), A6 = new f6.Vector3(A6.x, A6.y, A6.z), A6.applyMatrix4(L6), typeof S6[A6.x + "," + A6.y + "," + A6.z] > "u" ? (T6.vertices.push(A6), x6 = S6[A6.x + "," + A6.y + "," + A6.z] = T6.vertices.length - 1) : x6 = S6[A6.x + "," + A6.y + "," + A6.z], A6 = y6.vertices[u6], R6.push(new f6.Vector2(A6.uv.x, A6.uv.y)), A6 = new f6.Vector3(A6.x, A6.y, A6.z), A6.applyMatrix4(L6), typeof S6[A6.x + "," + A6.y + "," + A6.z] > "u" ? (T6.vertices.push(A6), w6 = S6[A6.x + "," + A6.y + "," + A6.z] = T6.vertices.length - 1) : w6 = S6[A6.x + "," + A6.y + "," + A6.z], M6 = new f6.Face3(m6, x6, w6, new f6.Vector3(y6.normal.x, y6.normal.y, y6.normal.z)), T6.faces.push(M6), T6.faceVertexUvs[0].push(R6); return T6; }, g6.prototype.toBufferGeometry = function() { var p = this.toGeometry(), u6 = new f6.BufferGeometry().fromGeometry(p); return u6; }, g6.prototype.toMesh = function(p) { var u6 = this.toBufferGeometry(), y6 = new f6.Mesh(u6, p); return y6.position.setFromMatrixPosition(this.matrix), y6.rotation.setFromRotationMatrix(this.matrix), y6; }, g6.Polygon = function(p) { p instanceof Array || (p = []), this.vertices = p, 0 < p.length ? this.calculateProperties() : this.normal = this.w = void 0; }, g6.Polygon.prototype.calculateProperties = function() { var p = this.vertices[0], u6 = this.vertices[1], y6 = this.vertices[2]; return this.normal = u6.clone().subtract(p).cross(y6.clone().subtract(p)).normalize(), this.w = this.normal.clone().dot(p), this; }, g6.Polygon.prototype.clone = function() { var p, u6, y6 = new g6.Polygon(); for (p = 0, u6 = this.vertices.length; p < u6; p++) y6.vertices.push(this.vertices[p].clone()); return y6.calculateProperties(), y6; }, g6.Polygon.prototype.flip = function() { var p, u6 = []; for (this.normal.multiplyScalar(-1), this.w *= -1, p = this.vertices.length - 1; 0 <= p; p--) u6.push(this.vertices[p]); return this.vertices = u6, this; }, g6.Polygon.prototype.classifyVertex = function(p) { var u6 = this.normal.dot(p) - this.w; return u6 < -a6 ? d : u6 > a6 ? l : c; }, g6.Polygon.prototype.classifySide = function(p) { var u6, y6, v6, m6 = 0, x6 = 0, w6 = p.vertices.length; for (u6 = 0; u6 < w6; u6++) y6 = p.vertices[u6], v6 = this.classifyVertex(y6), v6 === l ? m6++ : v6 === d && x6++; return 0 < m6 && x6 === 0 ? l : m6 === 0 && 0 < x6 ? d : m6 === 0 && x6 === 0 ? c : h6; }, g6.Polygon.prototype.splitPolygon = function(p, u6, y6, v6, m6) { var x6 = this.classifySide(p); if (x6 === c) (0 < this.normal.dot(p.normal) ? u6 : y6).push(p); else if (x6 === l) v6.push(p); else if (x6 === d) m6.push(p); else { var w6, A6, M6, R6, L6, T6, P6, _6, S6, E6 = [], C6 = []; for (A6 = 0, w6 = p.vertices.length; A6 < w6; A6++) M6 = (A6 + 1) % w6, T6 = p.vertices[A6], P6 = p.vertices[M6], R6 = this.classifyVertex(T6), L6 = this.classifyVertex(P6), R6 != d && E6.push(T6), R6 != l && C6.push(T6), (R6 | L6) == h6 && (_6 = (this.w - this.normal.dot(T6)) / this.normal.dot(P6.clone().subtract(T6)), S6 = T6.interpolate(P6, _6), E6.push(S6), C6.push(S6)); 3 <= E6.length && v6.push(new g6.Polygon(E6).calculateProperties()), 3 <= C6.length && m6.push(new g6.Polygon(C6).calculateProperties()); } }, g6.Vertex = function(p, u6, y6, v6, m6) { this.x = p, this.y = u6, this.z = y6, this.normal = v6 || new f6.Vector3(), this.uv = m6 || new f6.Vector2(); }, g6.Vertex.prototype.clone = function() { return new g6.Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone()); }, g6.Vertex.prototype.add = function(p) { return this.x += p.x, this.y += p.y, this.z += p.z, this; }, g6.Vertex.prototype.subtract = function(p) { return this.x -= p.x, this.y -= p.y, this.z -= p.z, this; }, g6.Vertex.prototype.multiplyScalar = function(p) { return this.x *= p, this.y *= p, this.z *= p, this; }, g6.Vertex.prototype.cross = function(p) { var u6 = this.x, y6 = this.y, v6 = this.z; return this.x = y6 * p.z - v6 * p.y, this.y = v6 * p.x - u6 * p.z, this.z = u6 * p.y - y6 * p.x, this; }, g6.Vertex.prototype.normalize = function() { var p = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); return this.x /= p, this.y /= p, this.z /= p, this; }, g6.Vertex.prototype.dot = function(p) { return this.x * p.x + this.y * p.y + this.z * p.z; }, g6.Vertex.prototype.lerp = function(p, u6) { return this.add(p.clone().subtract(this).multiplyScalar(u6)), this.normal.add(p.normal.clone().sub(this.normal).multiplyScalar(u6)), this.uv.add(p.uv.clone().sub(this.uv).multiplyScalar(u6)), this; }, g6.Vertex.prototype.interpolate = function(p, u6) { return this.clone().lerp(p, u6); }, g6.Vertex.prototype.applyMatrix4 = function(p) { var u6 = this.x, y6 = this.y, v6 = this.z, m6 = p.elements; return this.x = m6[0] * u6 + m6[4] * y6 + m6[8] * v6 + m6[12], this.y = m6[1] * u6 + m6[5] * y6 + m6[9] * v6 + m6[13], this.z = m6[2] * u6 + m6[6] * y6 + m6[10] * v6 + m6[14], this; }, g6.Node = function(p) { var u6, y6, v6 = [], m6 = []; if (this.polygons = [], this.front = this.back = void 0, p instanceof Array && p.length !== 0) { for (this.divider = p[0].clone(), u6 = 0, y6 = p.length; u6 < y6; u6++) this.divider.splitPolygon(p[u6], this.polygons, this.polygons, v6, m6); 0 < v6.length && (this.front = new g6.Node(v6)), 0 < m6.length && (this.back = new g6.Node(m6)); } }, g6.Node.isConvex = function(p) { var u6, y6; for (u6 = 0; u6 < p.length; u6++) for (y6 = 0; y6 < p.length; y6++) if (u6 !== y6 && p[u6].classifySide(p[y6]) !== d) return false; return true; }, g6.Node.prototype.build = function(p) { var u6, y6, v6 = [], m6 = []; for (this.divider || (this.divider = p[0].clone()), u6 = 0, y6 = p.length; u6 < y6; u6++) this.divider.splitPolygon(p[u6], this.polygons, this.polygons, v6, m6); 0 < v6.length && (!this.front && (this.front = new g6.Node()), this.front.build(v6)), 0 < m6.length && (!this.back && (this.back = new g6.Node()), this.back.build(m6)); }, g6.Node.prototype.allPolygons = function() { var p = this.polygons.slice(); return this.front && (p = p.concat(this.front.allPolygons())), this.back && (p = p.concat(this.back.allPolygons())), p; }, g6.Node.prototype.clone = function() { var p = new g6.Node(); return p.divider = this.divider.clone(), p.polygons = this.polygons.map(function(u6) { return u6.clone(); }), p.front = this.front && this.front.clone(), p.back = this.back && this.back.clone(), p; }, g6.Node.prototype.invert = function() { var p, u6, y6; for (p = 0, u6 = this.polygons.length; p < u6; p++) this.polygons[p].flip(); return this.divider.flip(), this.front && this.front.invert(), this.back && this.back.invert(), y6 = this.front, this.front = this.back, this.back = y6, this; }, g6.Node.prototype.clipPolygons = function(p) { var u6, y6, v6, m6; if (!this.divider) return p.slice(); for (v6 = [], m6 = [], u6 = 0, y6 = p.length; u6 < y6; u6++) this.divider.splitPolygon(p[u6], v6, m6, v6, m6); return this.front && (v6 = this.front.clipPolygons(v6)), m6 = this.back ? this.back.clipPolygons(m6) : [], v6.concat(m6); }, g6.Node.prototype.clipTo = function(p) { this.polygons = p.clipPolygons(this.polygons), this.front && this.front.clipTo(p), this.back && this.back.clipTo(p); }, g6; }; }, /* 53 */ /***/ (o) => { o.exports = E4(); }, /* 54 */ /***/ (o) => { o.exports = N4; }, /* 55 */ /***/ (o, a6, c) => { var l = c(3).Geometry, d = c(4), h6 = d.BufferGeometryLoader; o.exports = function(f6) { var g6 = void 0, p = function(w6) { var A6 = new h6(), M6 = A6.parse(w6), R6 = new d.MeshPhongMaterial(), L6 = new d.Mesh(M6.geometry, R6), T6 = new l(); return T6.setMorph(L6), T6; }, u6 = function(w6) { var A6 = p(w6); g6 = new (c(56)).GeometryCSGInternal(A6), f6.postMessage({ action: "message", message: "Initialised" }); }, y6 = function(w6) { if (g6) { var A6 = p(w6), M6 = g6.intersect(A6), R6 = M6.toBufferGeometry().toJSON(); f6.postMessage({ action: "result", object: R6 }); } }, v6 = function(w6) { if (g6) { var A6 = p(w6), M6 = g6.subtract(A6), R6 = M6.toBufferGeometry().toJSON(); f6.postMessage({ action: "result", object: R6 }); } }, m6 = function(w6) { if (g6) { var A6 = p(w6), M6 = g6.union(A6), R6 = M6.toBufferGeometry().toJSON(); f6.postMessage({ action: "result", object: R6 }); } }; f6.addEventListener("message", function(x6) { switch (x6.data.action) { case "initialise": u6(x6.data.object); break; case "intersect": y6(x6.data.object); break; case "subtract": v6(x6.data.object); break; case "union": m6(x6.data.object); break; default: throw "Cannot handle specified action."; } }); }; }, /* 56 */ /***/ (o, a6, c) => { var l = c(4), d = c(52)(l); c(3).Geometry, c(51).GeometryCSG; var h6 = function(f6) { var g6; f6 && f6.isGeometry && (g6 = f6); var p; this.setGeometry = (y6) => { y6 && y6.isGeometry && (g6 = y6), p = void 0; }, this.setCSG = (y6) => { p = y6; }; var u6 = (y6) => { if (g6 && g6.morph && y6 && y6.morph) { p === void 0 && (p = new d(g6.morph)); var v6 = new d(y6.morph); return v6; } }; this.intersect = (y6) => { var v6 = u6(y6); return p && v6 ? p.intersect(v6) : void 0; }, this.subtract = (y6) => { var v6 = u6(y6); return p && v6 ? p.subtract(v6) : void 0; }, this.union = (y6) => { var v6 = u6(y6); return p && v6 ? p.union(v6) : void 0; }; }; a6.GeometryCSGInternal = h6; }, /* 57 */ /***/ (o, a6, c) => { var l = c(4), d = c(52)(l); c(18).Glyphset; var h6 = function(f6) { var g6; f6 && f6.isGlyphset && (g6 = f6); var p = []; this.setGlyphset = (v6) => { v6 && v6.isGlyphset && (g6 = v6), hostCSG = void 0; }, this.getGlyphset = () => g6; var u6 = () => (v6) => { var m6 = v6.getMesh(), x6 = v6.getLabel(); if (m6) { var w6 = new d(m6.geometry.clone().applyMatrix(m6.matrix)), A6 = []; A6.csg = w6, A6.label = x6, m6.material && (A6.material = m6.material.clone()), p.push(A6); } }, y6 = (v6) => { if (g6 && v6 && v6.getMorph()) { p.length == 0 && g6.forEachGlyph(u6()); var m6 = new d(v6.getMorph()); return m6; } }; this.intersect = (v6) => { var m6 = y6(v6); if (0 < p.length && m6) { for (var x6 = new (c(18)).Glyphset(), w6 = 0; w6 < p.length; w6++) { var A6 = p[w6], M6 = A6.csg.intersect(m6), R6 = M6.toMesh(); if (R6 && R6.geometry && 0 < R6.geometry.vertices.length) { A6.material && (R6.material = A6.material, R6.material.side = l.DoubleSide, R6.material.clippingPlanes = null); var L6 = x6.addMeshAsGlyph(R6, w6 + 1); L6.setLabel(A6.label); } } var T6 = new h6(x6); return T6; } }; }; a6.GlyphsetCSG = h6; } /******/ ], i = {}; function r(o) { var a6 = i[o]; if (a6 !== void 0) return a6.exports; var c = i[o] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; return t[o].call(c.exports, c, c.exports, r), c.exports; } r.n = (o) => { var a6 = o && o.__esModule ? ( /******/ () => o.default ) : ( /******/ () => o ); return r.d(a6, { a: a6 }), a6; }, r.d = (o, a6) => { for (var c in a6) r.o(a6, c) && !r.o(o, c) && Object.defineProperty(o, c, { enumerable: true, get: a6[c] }); }, r.o = (o, a6) => Object.prototype.hasOwnProperty.call(o, a6), r.r = (o) => { typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: true }); }; var s = r(0); return s; })() )); })(wy); var Pr = wy.exports; var Rc = HC(Pr); var Ai = { SELECTED_COLOUR: "#00ff00", HIGHLIGHTED_COLOUR: "#ff0000", DEFAULT_RADIUS: 1, DEFAULT_RADIAL_SEGMENTS: 8, ZOOM_RADIUS: 5, ZOOM_RADIAL_SEGMENTS: 12 }; var Sv = (n, e) => { if (n) { let t = ""; n.forEach((i) => { t = i.uuid, i.region && (t = i.region.uuid + "/" + t), i && i.getVisibility() && e.push(t); }); } return e; }; var Id = (n, e) => { const t = n[0] - e[0], i = n[1] - e[1], r = n[2] - e[2]; return Math.sqrt(t * t + i * i + r * r); }; var B4 = (n) => { const e = n.zincObjects; if (e.length > 0 && e[0]) { const t = e[0]; if (t.isEditable && t.isLines2) { const i = n.identifiers[0].extraData.intersected; if (i && i.faceIndex > -1) { const r = t.getVerticesByFaceIndex(i.faceIndex), s = n.identifiers[0].extraData.intersected.pointOnLine; if (r.length > 1) { const o = Id(r[0], [s.x, s.y, s.z]), a6 = Id(r[1], [s.x, s.y, s.z]); return o > a6 ? { zincObject: t, faceIndex: i.faceIndex, vertexIndex: i.faceIndex * 2 + 1, point: r[0] } : { zincObject: t, faceIndex: i.faceIndex, vertexIndex: i.faceIndex * 2, point: r[1] }; } } } } }; var U4 = (n) => { const e = n.zincObjects; if (e.length > 0 && e[0]) return e[0]; }; var z4 = (n) => { const e = n.zincObjects; if (e.length > 0 && e[0]) { const t = e[0]; if (t.isEditable) return t; } }; var k4 = (n, e, t) => { if (n != null && n.isEditable && (n != null && n.isPointset)) { let i = false; for (let r = 0; r < 3 && !i; r++) t[r] !== 0 && (i = true); if (i && e > -1) { const r = n.getVerticesByIndex(e); return r && (r[0] = r[0] + t[0], r[1] = r[1] + t[1], r[2] = r[2] + t[2]), n.editVertices([r], e), n.boundingBoxUpdateRequired = true, true; } } return false; }; var Mc = (n, e) => { if (n != null && n.isEditable && (n != null && n.isLines2) && e > -1) { const t = n.getVerticesByFaceIndex(e); if (t && t.length > 1) return Id(t[1], t[0]); } return 0; }; var Fh = (n, e, t, i) => { if (n && t !== 0 && n.isEditable && n.isLines2 && e > -1) { const r = n.getVerticesByFaceIndex(e); let s = [r[1][0] - r[0][0], r[1][1] - r[0][1], r[1][2] - r[0][2]]; const o = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]); for (let a6 = 0; a6 < 3; a6++) s[a6] = s[a6] / o * t, i ? r[1][a6] = r[0][a6] + s[a6] : (r[0][a6] = r[0][a6] + s[a6], r[1][a6] = r[1][a6] + s[a6]); return n.editVertices(r, e * 2), n.boundingBoxUpdateRequired = true, true; } return false; }; var V4 = (n, e) => { const t = e.getBoundingBox(), i = new Pr.THREE.Vector3().subVectors(t.max, t.min), r = new Pr.THREE.BoxGeometry(i.x, i.y, i.z); i.addVectors(t.min, t.max).multiplyScalar(0.5); const s = r.getAttribute("position"), o = s.count, a6 = []; for (let c = 0; c < o; c++) a6[c] = [ s.array[c * 3], s.array[c * 3 + 1], s.array[c * 3 + 2] ]; n.editVertices(a6, 0), n.setPosition(i.x, i.y, i.z), r.dispose(); }; var bM = (n, e) => { let t = ""; n.isRegion && (t = `__r${n.regionPath}`), n.isPrimitives && (t = `${n.regionPath}/${n.label}`), e.push(t), n.children && n.children.forEach((i) => bM(i, e)); }; var xo = (n, e, t, i) => { let r = n; const s = []; if (t && (r = n.findChildFromPath(t)), r) { const o = Array.isArray(e); let a6 = e; o || (a6 = [a6]), a6.forEach((c) => { const l = r.findObjectsWithGroupName(c, i); s.push(...l); }); } return s; }; var Od = (n, e, t) => { const i = n.findIndex((s) => s.uuid === e); let r; return i > -1 && (r = n[i], t && n.splice(i, 1)), r; }; var G4 = (n, e) => { const t = []; if (n && e && e.length > 0) { const i = {}, r = {}, s = [n, ...n.getChildRegions(true)]; let o, a6, c; e.forEach((l) => { const d = l.split("/"); c = d[0], o = Od(s, c, false), o && (r[c] || (r[c] = o.getFullPath()), d[1] ? (i[c] || (i[c] = o.getAllObjects(false)), a6 = Od(i[c], d[1], true), a6 && t.push(`${r[c]}/${a6.groupName}`)) : t.push(`__r/${r[c]}`)); }); } return t; }; var H4 = (n) => { if (n) { const e = []; return n.forEach((i) => { i.isZincObject ? e.push(i) : i.isRegion && e.push(...i.getAllObjects(true)); }), Object.values( e.reduce((i, r) => ({ ...i, [r.uuid]: r }), {}) ); } return []; }; var _v = (n, e) => { const t = { label: "Multiple selections", regionPath: "", objects: [] }; if (e && n) { const i = {}, r = n.getRootRegion(); e.length > 0 && (t.regionPath = e[0].data.region, t.label = e[0].data.group), e.forEach((s) => { s.data.region.includes(t.regionPath) || (t.regionPath = ""), t.label !== s.data.group && (t.label = "Multiple selections"); const o = r.findChildFromPath(s.data.region); i[o.uuid] || (i[o.uuid] = o.getAllObjects(false)); const a6 = Od(i[o.uuid], s.data.uuid); a6 && t.objects.push(a6); }); } return t; }; var W4 = (n) => { const e = n.getMorph(); let t = "position"; n.isLines2 && (t = "instanceStart"); const i = []; let r = 0; const s = e.geometry.getAttribute(t); for (let o = 0; o < n.drawRange; o++) i.push([ s.array[r++], s.array[r++], s.array[r++] ]); return i; }; var xM = (n, e, t, i, r) => { let s; n.isPointset ? s = "MultiPoint" : n.isLines2 ? s = "MultiLineString" : s = "Feature"; const o = s !== "Feature", a6 = s === "Feature" ? "Feature annotation" : "Drawn annotation"; if (s) { const c = W4(n); let l = e.slice(-1) === "/" ? e : e + "/"; l = l + t; const d = l, h6 = { resource: i, item: { id: d }, body: { evidence: [], comment: r }, feature: { id: d, properties: { drawn: o, label: a6 }, geometry: { coordinates: c, type: s } } }; return r === "Deleted" && (h6.feature = void 0), h6; } }; var Tv = (n, e, t, i, r, s, o) => { const a6 = xM(t, i, r, s, o); if (a6) return n && n.currentUser && (a6.creator = { ...n.currentUser }, a6.creator.orcid || (a6.creator.orcid = "0000-0000-0000-0000"), n.addAnnotation(e, a6).then((c) => { c.annotationId || console.log("There is a problem with the submission, please try again later"); }).catch(() => { console.log("There is a problem with the submission, please try again later"); })), a6; }; var Ev = async (n, e, t) => { const i = t; return await n.drawnFeatures(e, i); }; var Cv = (n, e) => { n && e.forEach((t) => { const i = t.geometry, r = decodeURIComponent(t.id), s = r.lastIndexOf("/"), o = r.substring(0, s), a6 = r.substring(s + 1); let c; i.type === "MultiPoint" ? c = n.createPoints( o, a6, i.coordinates, a6, 8942 ) : i.type === "MultiLineString" && (c = n.createLines( o, a6, i.coordinates, 60962 )), c && (c.zincObject.isEditable = true); }); }; var pp = function(n) { const e = []; for (let t = 0; t < n.length; t++) { let i = n[t].userData; if (i) if (i.isGlyph || i.isGlyphset) { let r = i; i.isGlyph && (r = i.getGlyphset()), e.push(r); } else e.push(i); } return e; }; var j4 = { name: "LinesControls", components: { Button: Ko, Col: bi, Container: zi, InputNumber: fr, Main: dr, Slider: ti, ElIconArrowLeft: zr, ElIconArrowRight: kr }, props: { createData: { type: Object }, usageConfig: { type: Object } }, data: function() { return { adjust: 0, pAdjust: 0, lengthScale: 0, distance: 0, newDistance: 0, width: 1, radius: Ai.DEFAULT_RADIUS, radialSegments: Ai.DEFAULT_RADIAL_SEGMENTS, currentIndex: 0, ElIconArrowLeft: shallowRef(zr), ElIconArrowRight: shallowRef(kr), edited: false, zincObject: void 0, isTubeLines: false }; }, computed: { showTubeLinesControls() { return this.usageConfig.showTubeLinesControls; } }, watch: { "createData.faceIndex": { handler: function(n) { var e; (e = this.zincObject) != null && e.isLines2 && (this.currentIndex = n, this.distance = Mc(this.zincObject, this.currentIndex)); }, immediate: true } }, methods: { changeIndex: function(n) { n ? Mc(this.zincObject, this.currentIndex + 1) > 0 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onLengthInput: function() { this.newDistance !== 0 ? (this.distance = this.newDistance, this.edited = Fh( this.zincObject, this.currentIndex, this.newDistance, true ) || this.edited) : this.newDistance = this.distance; }, onLengthSliding: function() { this.newDistance = Math.pow(10, this.lengthScale) * this.distance, this.edited = Fh( this.zincObject, this.currentIndex, this.newDistance, true ) || this.edited; }, onMoveSliding: function() { const n = (this.adjust - this.pAdjust) * this.distance; this.edited = Fh( this.zincObject, this.currentIndex, n, false ) || this.edited, this.pAdjust = this.adjust; }, reset: function() { this.adjust = 0, this.pAdjust = 0, this.lengthScale = 0, this.distance = Mc(this.zincObject, this.currentIndex), this.newDistance = this.distance, this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = false); }, setObject: function(n) { var e; this.currentIndex = -1, this.distance = 0, n.isLines2 || n.isTubeLines ? (this.zincObject = markRaw(n), this.width = this.zincObject.getMorph().material.linewidth, this.isTubeLines = n.isTubeLines, n.isEditable ? (this.currentIndex = 0, this.distance = Mc(n, this.currentIndex)) : (e = n.userData) != null && e.isNerves && (this.radius = Ai.ZOOM_RADIUS, this.radialSegments = Ai.ZOOM_RADIAL_SEGMENTS)) : (this.zincObject = void 0, this.width = 10); }, modifyWidth: function() { this.zincObject.setWidth(this.width); }, modifyTubeLines: function() { this.zincObject.setTubeLines(this.radius, this.radius * this.radialSegments); } } }; function $4(n, e, t, i, r, s) { const o = bi, a6 = ti, c = fr, l = Ui, d = Ko, h6 = dr, f6 = zi; return openBlock(), createBlock(f6, { class: "lines-container" }, { default: withCtx(() => [ createVNode(h6, { class: "slides-block" }, { default: withCtx(() => [ n.isTubeLines && s.showTubeLinesControls ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[15] || (e[15] = [ createTextVNode(" Radius: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.radius, "onUpdate:modelValue": e[0] || (e[0] = (g6) => n.radius = g6), class: "my-slider", step: 1, min: 1, max: 32, "show-tooltip": false, onInput: s.modifyTubeLines }, null, 8, ["modelValue", "onInput"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.radius, "onUpdate:modelValue": e[1] || (e[1] = (g6) => n.radius = g6), step: 1, min: 1, max: 32, controls: false, onChange: s.modifyTubeLines, class: "input-box number-input" }, null, 8, ["modelValue", "onChange"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[16] || (e[16] = [ createTextVNode(" Radial Segments: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.radialSegments, "onUpdate:modelValue": e[2] || (e[2] = (g6) => n.radialSegments = g6), class: "my-slider", step: 1, min: 8, max: 32, "show-tooltip": false, onInput: s.modifyTubeLines }, null, 8, ["modelValue", "onInput"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.radialSegments, "onUpdate:modelValue": e[3] || (e[3] = (g6) => n.radialSegments = g6), step: 1, min: 8, max: 32, controls: false, onChange: s.modifyTubeLines, class: "input-box number-input" }, null, 8, ["modelValue", "onChange"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : n.isTubeLines ? createCommentVNode("", true) : (openBlock(), createBlock(l, { key: 1 }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[17] || (e[17] = [ createTextVNode(" Width: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.width, "onUpdate:modelValue": e[4] || (e[4] = (g6) => n.width = g6), class: "my-slider", step: 1, min: 1, max: 100, "show-tooltip": false, onInput: s.modifyWidth }, null, 8, ["modelValue", "onInput"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.width, "onUpdate:modelValue": e[5] || (e[5] = (g6) => n.width = g6), step: 1, min: 1, max: 100, controls: false, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 })), n.currentIndex > -1 && n.distance > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(d, { size: "small", disabled: n.currentIndex === 0, icon: n.ElIconArrowLeft, onClick: e[6] || (e[6] = (g6) => s.changeIndex(false)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), createVNode(o, { offset: 4, span: 9 }, { default: withCtx(() => [ createTextVNode(" Editing Line " + toDisplayString(n.currentIndex + 1), 1) ]), _: 1 }), createVNode(o, { offset: 2, span: 2 }, { default: withCtx(() => [ createVNode(d, { size: "small", icon: n.ElIconArrowRight, onClick: e[7] || (e[7] = (g6) => s.changeIndex(true)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[18] || (e[18] = [ createTextVNode(" Move: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.adjust, "onUpdate:modelValue": e[8] || (e[8] = (g6) => n.adjust = g6), step: 0.01, min: -3, max: 3, "show-tooltip": false, onInput: e[9] || (e[9] = (g6) => s.onMoveSliding()), onChange: e[10] || (e[10] = (g6) => s.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[19] || (e[19] = [ createTextVNode(" Length: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.lengthScale, "onUpdate:modelValue": e[11] || (e[11] = (g6) => n.lengthScale = g6), step: 0.01, min: -1, max: 1, "show-tooltip": false, onInput: e[12] || (e[12] = (g6) => s.onLengthSliding()), onChange: e[13] || (e[13] = (g6) => s.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.newDistance, "onUpdate:modelValue": e[14] || (e[14] = (g6) => n.newDistance = g6), controls: false, class: "input-box number-input", onChange: s.onLengthInput }, null, 8, ["modelValue", "onChange"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : createCommentVNode("", true) ]), _: 1 }) ]), _: 1 }); } var MM = ki(j4, [["render", $4], ["__scopeId", "data-v-0deb177d"]]); var Z4 = { name: "PointsControls", components: { Col: bi, Container: zi, InputNumber: fr, Main: dr, Select: qo, Slider: ti, Row: Ui, Option: Qo, ElIconArrowLeft: zr, ElIconArrowRight: kr }, inject: ["boundingDims"], data: function() { return { attenuation: false, size: 10, choices: [ { value: true, label: "On" }, { value: false, label: "off" } ], min: [0, 0, 0], max: [1, 1, 1], translation: [0, 0, 0], pTranslation: [0, 0, 0], currentIndex: -1, ElIconArrowLeft: shallowRef(zr), ElIconArrowRight: shallowRef(kr), edited: false, zincObject: void 0 }; }, watch: { boundingDims: { handler: function(n) { const e = n.size; this.min = [ -e[0] / 2, -e[1] / 2, -e[2] / 2 ], this.max = [ e[0] / 2, e[1] / 2, e[2] / 2 ]; }, immediate: true, deep: true } }, methods: { changeIndex: function(n) { n ? this.zincObject.drawRange > this.currentIndex + 1 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onMoveSliding: function() { const n = [ this.translation[0] - this.pTranslation[0], this.translation[1] - this.pTranslation[1], this.translation[2] - this.pTranslation[2] ]; this.edited = k4(this.zincObject, this.currentIndex, n) || this.edited; for (let e = 0; e < 3; e++) this.pTranslation[e] = this.translation[e]; }, reset: function() { this.translation = [0, 0, 0], this.pTranslation = [0, 0, 0], this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = false); }, setObject: function(n) { this.currentIndex = -1, n.isPointset ? (this.zincObject = markRaw(n), this.size = this.zincObject.morph.material.size, this.attenuation = this.zincObject.morph.material.sizeAttenuation, n.isEditable && this.zincObject.drawRange > 0 && (this.currentIndex = 0)) : (this.zincObject = void 0, this.size = 10, this.attenuation = false); }, modifyAttenuation: function(n) { this.attenuation = n, this.zincObject.setSizeAttenuation(n); }, modifySize: function() { this.zincObject.setSize(this.size); } } }; function X4(n, e, t, i, r, s) { const o = bi, a6 = ti, c = fr, l = Ui, d = Qo, h6 = qo, f6 = Ko, g6 = dr, p = zi; return openBlock(), createBlock(p, { class: "pointset-container" }, { default: withCtx(() => [ createVNode(g6, { class: "slides-block" }, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[15] || (e[15] = [ createTextVNode(" Size: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.size, "onUpdate:modelValue": e[0] || (e[0] = (u6) => n.size = u6), class: "my-slider", step: 1, min: 0, max: 100, "show-tooltip": false, onInput: e[1] || (e[1] = (u6) => s.modifySize()) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.size, "onUpdate:modelValue": e[2] || (e[2] = (u6) => n.size = u6), step: 1, min: 0, max: 100, controls: false, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => e[16] || (e[16] = [ createTextVNode(" Size attenuation: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 5 }, { default: withCtx(() => [ createVNode(h6, { teleported: false, "model-value": n.attenuation, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: e[3] || (e[3] = (u6) => s.modifyAttenuation(u6, n.slide)) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.choices, (u6) => (openBlock(), createBlock(d, { key: u6.value, label: u6.label, value: u6.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]), _: 1 }) ]), _: 1 }), n.currentIndex > -1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(f6, { size: "small", disabled: n.currentIndex === 0, icon: n.ElIconArrowLeft, onClick: e[4] || (e[4] = (u6) => s.changeIndex(false)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), createVNode(o, { offset: 4, span: 9 }, { default: withCtx(() => [ createTextVNode(" Editing Point " + toDisplayString(n.currentIndex + 1), 1) ]), _: 1 }), createVNode(o, { offset: 2, span: 2 }, { default: withCtx(() => [ createVNode(f6, { size: "small", icon: n.ElIconArrowRight, onClick: e[5] || (e[5] = (u6) => s.changeIndex(true)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[17] || (e[17] = [ createTextVNode(" x: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.translation[0], "onUpdate:modelValue": e[6] || (e[6] = (u6) => n.translation[0] = u6), step: 0.01, min: n.min[0], max: n.max[0], "show-tooltip": false, onInput: e[7] || (e[7] = (u6) => s.onMoveSliding()), onChange: e[8] || (e[8] = (u6) => s.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[18] || (e[18] = [ createTextVNode(" y: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.translation[1], "onUpdate:modelValue": e[9] || (e[9] = (u6) => n.translation[1] = u6), step: 0.01, min: n.min[1], max: n.max[1], "show-tooltip": false, onInput: e[10] || (e[10] = (u6) => s.onMoveSliding()), onChange: e[11] || (e[11] = (u6) => s.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[19] || (e[19] = [ createTextVNode(" z: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.translation[2], "onUpdate:modelValue": e[12] || (e[12] = (u6) => n.translation[2] = u6), step: 0.01, min: n.min[2], max: n.max[2], "show-tooltip": false, onInput: e[13] || (e[13] = (u6) => s.onMoveSliding()), onChange: e[14] || (e[14] = (u6) => s.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : createCommentVNode("", true) ]), _: 1 }) ]), _: 1 }); } var wM = ki(Z4, [["render", X4], ["__scopeId", "data-v-d1de9c65"]]); var Y4 = { name: "TextureSlidesControls", components: { Col: bi, Container: zi, Footer: dy, Icon: It, InputNumber: fr, Main: dr, Row: Ui, Select: qo, Slider: ti, Option: Qo, ElIconDelete: Nc, ElIconPlus: tu }, data: function() { return { settings: [], directions: [ { value: "x", label: "x" }, { value: "y", label: "y" }, { value: "z", label: "z" } ], zincObject: void 0 }; }, methods: { setObject: function(n) { n.isTextureSlides ? (this.zincObject = markRaw(n), this.settings = this.zincObject.getTextureSettings()) : (this.zincObject = void 0, this.settings = []); }, addNewSlide: function() { const n = { direction: "x", value: 0 }, e = this.zincObject.createSlide(n); this.settings.push(e); }, modifyDirection: function(n, e) { e && (e.direction = n, this.zincObject.modifySlideSettings(e)); }, modifySlide: function(n) { n && this.zincObject.modifySlideSettings(n); }, removeSlide: function(n, e) { this.zincObject.removeSlideWithId(e.id), this.settings.splice(n, 1); } } }; function J4(n, e, t, i, r, s) { const o = Qo, a6 = qo, c = bi, l = ti, d = fr, h6 = Nc, f6 = It, g6 = Ui, p = dr, u6 = tu, y6 = dy, v6 = zi; return openBlock(), createBlock(v6, { class: "t-slides-container" }, { default: withCtx(() => [ createVNode(p, { class: "slides-block" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.settings, (m6, x6) => (openBlock(), createBlock(g6, { key: m6.id, class: "slide-row" }, { default: withCtx(() => [ createVNode(c, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(a6, { teleported: false, "model-value": m6.direction, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: (w6) => s.modifyDirection(w6, m6) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.directions, (w6) => (openBlock(), createBlock(o, { key: w6.value, label: w6.label, value: w6.value }, null, 8, ["label", "value"]))), 128)) ]), _: 2 }, 1032, ["model-value", "onChange"]) ]), _: 2 }, 1024), createVNode(c, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(l, { modelValue: m6.value, "onUpdate:modelValue": (w6) => m6.value = w6, class: "my-slider", step: 0.01, min: 0, max: 1, "show-tooltip": false, onInput: (w6) => s.modifySlide(m6) }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"]) ]), _: 2 }, 1024), createVNode(c, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(d, { modelValue: m6.value, "onUpdate:modelValue": (w6) => m6.value = w6, step: 0.01, min: 0, max: 1, controls: false, class: "input-box number-input" }, null, 8, ["modelValue", "onUpdate:modelValue"]) ]), _: 2 }, 1024), createVNode(c, { offset: 0, span: 2 }, { default: withCtx(() => [ createVNode(f6, { class: "delete-icon", onClick: (w6) => s.removeSlide(x6, m6) }, { default: withCtx(() => [ createVNode(h6) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)) ]), _: 1 }), createVNode(y6, { height: "30px", class: "add-slides-text", onClick: s.addNewSlide }, { default: withCtx(() => [ createVNode(g6, null, { default: withCtx(() => [ createVNode(c, { span: 2 }, { default: withCtx(() => [ createVNode(f6, null, { default: withCtx(() => [ createVNode(u6) ]), _: 1 }) ]), _: 1 }), createVNode(c, { span: 20 }, { default: withCtx(() => e[0] || (e[0] = [ createTextVNode(" Add a new slide ") ])), _: 1 }) ]), _: 1 }) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }); } var AM = ki(Y4, [["render", J4], ["__scopeId", "data-v-12185b7f"]]); var K4 = { name: "TransformationControls", components: { Col: bi, Container: zi, InputNumber: fr, Main: dr, Slider: ti }, inject: ["boundingDims"], data: function() { return { x: 0, y: 0, z: 0, scale: 1, min: [0, 0, 0], max: [1, 1, 1], zincObject: void 0, enableScaling: true }; }, watch: { boundingDims: { handler: function(n) { const e = n.centre, t = n.size; this.min = [ e[0] - t[0], e[1] - t[1], e[2] - t[2] ], this.max = [ e[0] + t[0], e[1] + t[1], e[2] + t[2] ]; }, immediate: true, deep: true } }, methods: { setObject: function(n) { if (n.isZincObject) { this.zincObject = markRaw(n); const e = this.zincObject.getGroup(), t = this.zincObject.userData.originalPos; e && e.position && (this.x = e.position.x, this.y = e.position.y, this.z = e.position.z, this.zincObject.isGlyphset ? this.scale = this.zincObject.globalScale : this.scale = e.scale.x, this.enableScaling = !this.zincObject.isTextureSlides, t && this.boundingDims && (this.min = [ t[0] - this.boundingDims.size[0], t[1] - this.boundingDims.size[1], t[2] - this.boundingDims.size[2] ], this.max = [ t[0] + this.boundingDims.size[0], t[1] + this.boundingDims.size[1], t[2] + this.boundingDims.size[2] ])); } else this.zincObject = void 0, this.x = 0, this.y = 0, this.z = 0, this.scale = 1; }, modifyPosition: function() { this.zincObject && this.zincObject.setPosition(this.x, this.y, this.z); }, modifyScale: function() { this.zincObject.setScaleAll(this.scale); } } }; function q42(n, e, t, i, r, s) { const o = bi, a6 = ti, c = fr, l = Ui, d = dr, h6 = zi; return openBlock(), createBlock(h6, { class: "transformation-container" }, { default: withCtx(() => [ createVNode(d, { class: "slides-block" }, { default: withCtx(() => [ createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[16] || (e[16] = [ createTextVNode(" x: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.x, "onUpdate:modelValue": e[0] || (e[0] = (f6) => n.x = f6), step: 0.01, min: n.min[0], max: n.max[0], "show-tooltip": false, onInput: e[1] || (e[1] = (f6) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.x, "onUpdate:modelValue": e[2] || (e[2] = (f6) => n.x = f6), step: 0.01, min: n.min[0], max: n.max[0], controls: false, class: "input-box number-input", onChange: e[3] || (e[3] = (f6) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[17] || (e[17] = [ createTextVNode(" y: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.y, "onUpdate:modelValue": e[4] || (e[4] = (f6) => n.y = f6), step: 0.01, min: n.min[1], max: n.max[1], "show-tooltip": false, onInput: e[5] || (e[5] = (f6) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.y, "onUpdate:modelValue": e[6] || (e[6] = (f6) => n.y = f6), step: 0.01, min: n.min[1], max: n.max[1], controls: false, class: "input-box number-input", onChange: e[7] || (e[7] = (f6) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[18] || (e[18] = [ createTextVNode(" z: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.z, "onUpdate:modelValue": e[8] || (e[8] = (f6) => n.z = f6), step: 0.01, min: n.min[2], max: n.max[2], "show-tooltip": false, onInput: e[9] || (e[9] = (f6) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.z, "onUpdate:modelValue": e[10] || (e[10] = (f6) => n.z = f6), step: 0.01, min: n.min[2], max: n.max[2], controls: false, class: "input-box number-input", onChange: e[11] || (e[11] = (f6) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), n.enableScaling ? (openBlock(), createBlock(l, { key: 0, class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => e[19] || (e[19] = [ createTextVNode(" Scale: ") ])), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a6, { modelValue: n.scale, "onUpdate:modelValue": e[12] || (e[12] = (f6) => n.scale = f6), step: 0.01, min: 0, max: 5, "show-tooltip": false, onInput: e[13] || (e[13] = (f6) => s.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.scale, "onUpdate:modelValue": e[14] || (e[14] = (f6) => n.scale = f6), step: 0.01, min: 0, max: 5, controls: false, class: "input-box number-input", onChange: e[15] || (e[15] = (f6) => s.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 }) ]), _: 1 }); } var SM = ki(K4, [["render", q42], ["__scopeId", "data-v-cd88ead8"]]); var Q4 = { name: "OpacityControls", components: { Container: zi, Header: $L, Main: dr, Slider: ti }, props: { material: void 0, zincObject: void 0 }, data: function() { return { displayString: "100%" }; }, watch: { "material.opacity": function() { this.material && this.zincObject && this.zincObject.setAlpha(this.material.opacity); } }, methods: { formatTooltip(n) { return this.displayString = Math.floor(100 * n + 0.5) + "%", this.displayString; } } }; var e5 = { class: "block" }; var t5 = { class: "display" }; function n5(n, e, t, i, r, s) { const o = ti, a6 = zi; return t.material ? (openBlock(), createBlock(a6, { key: 0, class: "opacity-container" }, { default: withCtx(() => [ createBaseVNode("div", e5, [ createBaseVNode("span", t5, toDisplayString(n.displayString), 1), createVNode(o, { modelValue: t.material.opacity, "onUpdate:modelValue": e[0] || (e[0] = (c) => t.material.opacity = c), class: "my-slider", step: 0.01, min: 0, max: 1, "format-tooltip": s.formatTooltip, "show-tooltip": false }, null, 8, ["modelValue", "format-tooltip"]) ]) ]), _: 1 })) : createCommentVNode("", true); } var _M = ki(Q4, [["render", n5], ["__scopeId", "data-v-cbfc46a5"]]); var i5 = { name: "PrimitiveControls", components: { Collapse: oy, CollapseItem: ay, LinesControls: MM, OpacityControls: _M, PointsControls: wM, TextureSlidesControls: AM, TransformationControls: SM, ElIconArrowRight: kr }, props: { createData: { type: Object }, viewingMode: { type: String, default: "Exploration" }, usageConfig: { type: Object } }, data: function() { return { activeName: "oControls", material: void 0, isTextureSlides: false, isPointset: false, isLines: false, drawerOpen: true, zincObject: void 0, isEditable: false, displayString: "100%" }; }, computed: { hasValidPrimitive: function() { return this.viewingMode === "Exploration" || this.viewingMode === "Annotation" ? this.material !== void 0 || this.isTextureSlides === true : false; } }, methods: { formatTooltip: function(n) { return this.displayString = Math.floor(100 * n + 0.5) + "%", this.displayString; }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen; }, setObject: function(n) { var e, t; n ? this.zincObject = markRaw(n) : this.zincObject = void 0, this.isEditable = !!((e = this.zincObject) != null && e.isEditable), this.isPointset = false, this.isTextureSlides = false, this.isLines = false, this.activeName = "trControls", n && (n.isTextureSlides ? (this.isTextureSlides = true, this.$refs.tSlidesControls.setObject(n), this.activeName = "tsControls") : n.isPointset ? (this.isPointset = true, this.$refs.pointsetControls.setObject(n), this.activeName = "pControls") : (n.isLines2 || n.isTubeLines && ((t = this.usageConfig) != null && t.showTubeLinesControls)) && (this.isLines = true, this.$refs.linesControls.setObject(n), this.activeName = "lControls"), this.$refs.transformationControls.setObject(n)), n && n.getMorph() ? this.material = n.getMorph().material : this.material = void 0; } } }; function r5(n, e, t, i, r, s) { const o = _M, a6 = ay, c = SM, l = AM, d = wM, h6 = MM, f6 = oy, g6 = kr, p = It; return withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass(["primitive-controls", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createBaseVNode("div", { class: normalizeClass(["my-drawer", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createVNode(f6, { class: "collapse", modelValue: n.activeName, "onUpdate:modelValue": e[2] || (e[2] = (u6) => n.activeName = u6), accordion: "" }, { default: withCtx(() => [ withDirectives(createVNode(a6, { title: "Opacity", name: "oControls" }, { default: withCtx(() => [ createVNode(o, { material: n.material, zincObject: n.zincObject, ref: "opacityControls" }, null, 8, ["material", "zincObject"]) ]), _: 1 }, 512), [ [vShow, !n.isTextureSlides] ]), withDirectives(createVNode(a6, { title: "Transformation", name: "trControls" }, { default: withCtx(() => [ createVNode(c, { class: "transformation-controls", ref: "transformationControls" }, null, 512) ]), _: 1 }, 512), [ [vShow, !n.isEditable] ]), withDirectives(createVNode(a6, { title: "Texture Slides", name: "tsControls" }, { default: withCtx(() => [ createVNode(l, { class: "texture-controls", ref: "tSlidesControls" }, null, 512) ]), _: 1 }, 512), [ [vShow, n.isTextureSlides] ]), withDirectives(createVNode(a6, { title: "Points", name: "pControls" }, { default: withCtx(() => [ createVNode(d, { class: "pointset-controls", ref: "pointsetControls", onPrimitivesUpdated: e[0] || (e[0] = (u6) => n.$emit("primitivesUpdated", u6)) }, null, 512) ]), _: 1 }, 512), [ [vShow, n.isPointset] ]), withDirectives(createVNode(a6, { title: "Lines", name: "lControls" }, { default: withCtx(() => [ createVNode(h6, { class: "lines-controls", ref: "linesControls", createData: t.createData, usageConfig: t.usageConfig, onPrimitivesUpdated: e[1] || (e[1] = (u6) => n.$emit("primitivesUpdated", u6)) }, null, 8, ["createData", "usageConfig"]) ]), _: 1 }, 512), [ [vShow, n.isLines] ]) ]), _: 1 }, 8, ["modelValue"]) ], 2), createBaseVNode("div", { class: normalizeClass(["drawer-button", { open: n.drawerOpen, close: !n.drawerOpen }]), onClick: e[3] || (e[3] = (...u6) => s.toggleDrawer && s.toggleDrawer(...u6)) }, [ createVNode(p, null, { default: withCtx(() => [ createVNode(g6) ]), _: 1 }) ], 2) ], 2)), [ [vShow, s.hasValidPrimitive] ]); } var TM = ki(i5, [["render", r5], ["__scopeId", "data-v-83d11562"]]); var s5 = (n, e) => { const t = n.label.toUpperCase(), i = e.label.toUpperCase(); return t < i ? -1 : t > i ? 1 : 0; }; var o5 = { name: "ScaffoldTreeControls", components: { ElIconArrowLeft: zr, TreeControls: V7 }, props: { /** * Enable/disable colour picker */ showColourPicker: Boolean, isReady: Boolean }, data: function() { return { treeData: [ { label: "Root", regionPath: "", id: void 0, children: [] } ], active: [], hover: [], drawerOpen: true, nodeNumbers: 0, module: void 0 //checkedRegions: [], }; }, computed: { treeDataEntry: function() { return this.treeData[0].children; } }, watch: { treeDataEntry: { deep: true, handler: function(n) { this.isReady && this.setColourField(n); } } /* checkedRegions: { deep: true, handler: function (data) { if (this.isReady) { this.$emit('checked-regions', data); } }, }, */ }, methods: { addTreeItem: function(n, e, t) { n.some((i) => i.label === e.label) || (Object.assign(e, { activeColour: this.getColour(e) }), n.push(e), n.sort((i, r) => s5(i, r)), this.nodeNumbers++, this.$nextTick(() => { !this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id) && t.getVisibility() && this.$refs.treeControls.$refs.regionTree.setChecked(e.id, true); })); }, // find or create new region, region id is always prefixed with // '__r/' findOrCreateRegion: function(n, e, t) { if (this.module && this.module.scene && (this.treeData[0].id = this.module.scene.getRootRegion().uuid, this.treeData[0].isRegion = true), e.length > 0) { const i = [...e]; let r = n.children.find( (a6) => a6.label == i[0] ); const s = t + "/" + e[0], o = this.module.scene.getRootRegion().findChildFromPath(s); return r || (r = { label: i[0], id: o.uuid, children: [], regionPath: s, isRegion: true }, this.addTreeItem(n.children, r, o), s === "/_helper" && this.$nextTick(() => { this.$refs.treeControls.$refs.regionTree.setChecked(r.id, false); })), i.shift(), this.findOrCreateRegion(r, i, s); } else return n; }, removeRegion: function(n) { if (this.treeData[0].children) { for (let e = 0; e < this.treeData[0].children.length; e++) if (this.treeData[0].children[e].label === n) { this.treeData[0].children.splice(e, 1), this.nodeNumbers--; return; } } }, /** * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(n) { const e = n.region; if (e) { const t = e.getFullSeparatedPath(), i = this.findOrCreateRegion(this.treeData[0], t, ""); if (n.groupName && i) { i.children || (i.children = []); const r = { disabled: false, label: n.groupName, id: e.uuid + "/" + n.uuid, isPrimitives: true, regionPath: n.region.getFullPath(), isTextureSlides: !!n.isTextureSlides }; this.addTreeItem(i.children, r, n); } } }, zincObjectRemoved: function(n) { const e = n.groupName; if (n.region.findObjectsWithGroupName(e, false).length === 0) { const i = n.region.getFullSeparatedPath(), r = this.findOrCreateRegion(this.treeData[0], i, ""); if (r.children) { for (let s = 0; s < r.children.length; s++) if (r.children[s].label === e) { r.children.splice(s, 1), this.nodeNumbers--; return; } } } }, checkChanged: function(n, e) { const t = n.isRegion, i = n.isPrimitives, r = e.checkedKeys.includes(n.id), s = this.module.scene.getRootRegion().findChildFromPath(n.regionPath); t && (r ? s.showAllPrimitives() : s.hideAllPrimitives()), i && s.findObjectsWithGroupName(n.label).forEach((a6) => { const c = r && !n.disabled; a6.setVisibility(c); }); }, updateActiveUI: function(n) { this.active.length = 0, Sv(n, this.active); }, changeActiveByPrimitives: function(n, e) { n && n.length > 0 ? (this.updateActiveUI(n), this.$emit("object-selected", n, e)) : this.removeActive(e), this.removeHover(e); }, updateHoverUI: function(n) { this.hover.length = 0, Sv(n, this.hover); }, changeHoverByPrimitives: function(n, e) { n && n.length > 0 ? (this.updateHoverUI(n), this.$emit("object-hovered", n, e)) : this.removeHover(e); }, /** * Select a region by its name. */ changeActiveByNames: function(n, e, t) { const i = this.module.scene.getRootRegion(), r = xo( i, n, e, true ); this.changeActiveByPrimitives(r, t); }, /** * Hover a region by its name. */ changeHoverByNames: function(n, e, t) { const i = this.module.scene.getRootRegion(), r = xo( i, n, e, true ); this.changeHoverByPrimitives(r, t); }, changeActiveByNode: function(n, e) { if (n.isPrimitives || n.isRegion) { const t = !!n.isRegion, i = this.getZincObjectsFromNode(n, t); this.changeActiveByPrimitives(i, e); } }, changeHoverByNode: function(n, e) { if (n.isPrimitives) { const t = this.getZincObjectsFromNode(n, false); this.changeHoverByPrimitives(t, e); } }, /** * Unselect the current selected region. */ removeActive: function(n) { this.active = [], this.$emit("object-selected", [], n); }, /** * Unselect the current hover region. */ removeHover: function(n) { this.hover = [], this.$emit("object-hovered", [], n); }, /** * Reset the controls. */ clear: function() { this.active.length = 0, this.hover.length = 0, this.nodeNumbers = 0, this.$refs.treeControls.$refs.regionTree.updateKeyChildren( this.treeData[0].id, [] ), this.treeData[0].children.length = 0, this.treeData[0].id = void 0, this.$emit("object-selected", []); }, forEachChildInNode: function(n, e, t, i, r) { if (n.isRegion) { if (n.children) { const s = t === "" || e.includes(n.id); n.children.forEach( (o) => this.forEachChildInNode( o, e, n.regionPath, i && s, r ) ); } } else n.isPrimitives && r(n, t, i); }, getColour: function(n) { if (n) { let t = this.getZincObjectsFromNode(n, false)[0]; if (t) { let i = t.getColourHex(); if (i) return "#" + i; } } return "#FFFFFF"; }, getNodeDataByRegionAndGroup: function(n, e) { for (const t of this.treeDataEntry) if (t.isRegion && t.label === n) { const i = t.children; for (const r of i) if (r.isPrimitives && r.label === e) return r; } }, getZincObjectsFromNode: function(n, e) { const t = this.module.scene.getRootRegion(); if (n.isPrimitives) return xo( t, n.label, n.regionPath, e ); if (n.isRegion && n.regionPath) { let i = t.findChildFromPath(n.regionPath); if (i) return i.getAllObjects(e); } return []; }, //Set this right at the beginning. setModule: function(n) { this.module = markRaw(n), this.nodeNumbers = 0, this.module.scene.getRootRegion().getAllObjects(true).forEach((t) => { this.zincObjectAdded(t); }), this.module.addOrganPartAddedCallback(this.zincObjectAdded), this.module.addOrganPartRemovedCallback(this.zincObjectRemoved); }, setColourField: function(n, e = void 0) { n.filter((t) => e && !t.children ? t.id === e.id : true).map((t) => { if (t.children) this.setColourField(t.children, e); else { const i = this.getColour(t); t.defaultColour || (t.defaultColour = i), t.activeColour = i; } }); }, setColour: function(n, e) { n && n.isPrimitives && this.getZincObjectsFromNode(n, false).forEach((i) => { let s = (e || n.defaultColour).replace("#", "0x"); i.setColourHex(s), this.setColourField(this.treeData[0].children, n); }); }, updateAllNodeColours: function() { const n = this.$refs.treeControls.$refs.regionTree.getCheckedKeys(); this.forEachChildInNode( this.treeData[0], n, "", true, (e, t, i) => { e.isPrimitives && (e.activeColour = this.getColour(e)); } ); }, setOutlines: function(n) { const e = this.$refs.treeControls.$refs.regionTree.getCheckedKeys(); this.forEachChildInNode( this.treeData[0], e, "", true, (t, i, r) => { const o = this.module.scene.getRootRegion().findChildFromPath(i).findObjectsWithGroupName(t.label); n ? o.forEach((a6) => { a6.isLines && (e.includes(t.id) && r && a6.setVisibility(true), t.disabled = false); }) : t.isPrimitives && o.forEach((a6) => { a6.isLines && (a6.setVisibility(false), t.disabled = true); }); } ); }, visibilityToggle: function(n, e) { this.module.changeOrganPartsVisibility(n, e), e == false && (this.activeRegion === n && this.removeActive(true), this.hoverRegion === n && this.removeHover(true)); }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen, this.$emit("drawer-toggled", this.drawerOpen); }, //Set visibility using full paths and add found id to the ids list //and remove item from list if remove is set to true. setTreeVisibilityWithFullPaths: function(n, e, t, i) { let r = false, s = ""; n.isRegion && (s = `__r${n.regionPath}`), n.isPrimitives && (s = `${n.regionPath}/${n.label}`); const o = e.indexOf(s); o > -1 && (r = true, e.splice(o, 1), t.push(n.id)); const a6 = this.module.scene.getRootRegion().findChildFromPath(n.regionPath); s && s !== "__r" && n.isPrimitives && a6.findObjectsWithGroupName(n.label).forEach((l) => l.setVisibility(r)), n.children && n.children.forEach((c) => { this.setTreeVisibilityWithFullPaths(c, e, t, true); }); }, setCheckedKeys: function(n, e) { this.$nextTick(() => { e && this.$refs.treeControls.$refs.regionTree.setCheckedKeys([]), n.forEach((t) => { this.$refs.treeControls.$refs.regionTree.setChecked(t, true, true); }); }); }, checkAllKeys: function(n = []) { const e = [], t = []; bM(this.treeData[0], e); const i = e.filter((r) => !n.some((s) => r.includes(s))); this.setTreeVisibilityWithFullPaths( this.treeData[0], i, t, true ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t); }, getState: function() { let n = this.$refs.treeControls.$refs.regionTree.getCheckedKeys(); return n.length === this.nodeNumbers ? { checkAll: true, version: "2.0" } : { checkedItems: G4( this.module.scene.getRootRegion(), n ), version: "2.0" }; }, setState: function(n) { if (n) { if (n.checkAll) this.checkAllKeys(); else if (n.checkedItems) { let e = []; n.version !== "2.0" ? (e = n.checkedItems.map((i) => "/" + i), e.shift("__r/")) : e.push(...n.checkedItems); const t = []; this.setTreeVisibilityWithFullPaths( this.treeData[0], e, t, true ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t); } } } } }; var a5 = { class: "traditional-container" }; function l5(n, e, t, i, r, s) { const o = resolveComponent("TreeControls"), a6 = zr, c = It; return openBlock(), createElementBlock("div", { class: normalizeClass(["tree-controls", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createBaseVNode("div", a5, [ createVNode(o, { mapType: "scaffold", title: "Regions", isReady: t.isReady, treeData: s.treeDataEntry, active: n.active, hover: n.hover, showColourPicker: t.showColourPicker, onSetColour: s.setColour, onCheckChanged: s.checkChanged, onChangeActive: s.changeActiveByNode, onChangeHover: s.changeHoverByNode, ref: "treeControls", onMouseleave: e[0] || (e[0] = (l) => s.removeHover(true)) }, null, 8, ["isReady", "treeData", "active", "hover", "showColourPicker", "onSetColour", "onCheckChanged", "onChangeActive", "onChangeHover"]) ]), createBaseVNode("div", { class: normalizeClass(["drawer-button", { open: n.drawerOpen, close: !n.drawerOpen }]), onClick: e[1] || (e[1] = (...l) => s.toggleDrawer && s.toggleDrawer(...l)) }, [ createVNode(c, null, { default: withCtx(() => [ createVNode(a6) ]), _: 1 }) ], 2) ], 2); } var EM = ki(o5, [["render", l5], ["__scopeId", "data-v-5394b615"]]); var Dd = defineStore("main", { state: () => ({ userProfile: { token: "" } }), getters: { userToken(n) { return n.userProfile.token; } }, actions: { setUserToken(n) { this.userProfile.token = n; } } }); var c5 = { name: "ScaffoldTooltip", components: { Col: bi, CreateTooltipContent: M7, ElIconDelete: Nc, Icon: It, Popover: cu, Row: Ui, Tooltip: z7 }, props: { createData: { type: Object, default: { toBeConfirmed: false, points: [], shape: "", x: 0, y: 0 } }, label: { type: String, default: "" }, annotationDisplay: { type: Boolean, default: false }, annotationFeature: { type: Object, default: {} }, offlineAnnotationEnabled: { type: Boolean, default: false }, region: { type: String, default: "" }, visible: { type: Boolean, default: false }, x: { type: Number, default: 200 }, y: { type: Number, default: 200 } }, inject: ["scaffoldUrl"], provide() { return { userApiKey: this.userToken }; }, data: function() { return { display: false, annotationEntry: [], ElIconDelete: shallowRef(Nc) }; }, computed: { ...mapState(Dd, ["userToken"]), position: function() { let n = 40; return this.region && (n = 55), { left: this.x - 40 + "px", top: this.y - n + "px" }; } }, methods: { checkForDisplay: function() { if (this.visible && this.label && this.label !== "") { if (this.display = true, this.annotationDisplay) { const n = this.region ? this.region + "/" : ""; this.annotationEntry = [{ featureId: n + this.label, resourceId: this.scaffoldUrl, resource: this.scaffoldUrl, feature: this.annotationFeature, offline: this.offlineAnnotationEnabled }]; } } else this.display = false, this.annotationEntry = []; }, hideTriggered: function() { this.$emit("tooltip-hide"); } }, watch: { label: { handler: function() { this.checkForDisplay(); }, immediate: true }, visible: { handler: function() { this.checkForDisplay(); }, immediate: true }, annotationDisplay: { handler: function() { this.checkForDisplay(); }, immediate: true } } }; var u5 = { class: "tooltip-text" }; var h5 = { key: 0, class: "tooltip-text" }; var d5 = { key: 1, class: "delete-container" }; function f5(n, e, t, i, r, s) { const o = resolveComponent("CreateTooltipContent"), a6 = resolveComponent("Tooltip"), c = bi, l = Ko, d = Ui, h6 = cu; return openBlock(), createElementBlock("div", { style: normalizeStyle(s.position), class: "region-tooltip" }, [ createVNode(h6, { ref: "tooltip", visible: t.visible, placement: "top", "show-arrow": false, teleported: false, trigger: "manual", "popper-class": "tooltip-popper non-selectable", "virtual-triggering": "", onHide: s.hideTriggered }, { default: withCtx(() => [ createBaseVNode("div", u5, toDisplayString(t.label), 1), t.region ? (openBlock(), createElementBlock("div", h5, "Region: " + toDisplayString(t.region), 1)) : createCommentVNode("", true), withDirectives(createVNode(o, { createData: t.createData, onConfirmCreate: e[0] || (e[0] = (f6) => n.$emit("confirm-create", f6)), onCancelCreate: e[1] || (e[1] = (f6) => n.$emit("cancel-create")) }, null, 8, ["createData"]), [ [vShow, t.createData.toBeConfirmed] ]), withDirectives(createVNode(a6, { class: "p-tooltip", ref: "annotationTooltip", annotationDisplay: true, annotationEntry: n.annotationEntry, onAnnotation: e[2] || (e[2] = (f6) => n.$emit("confirm-comment", f6)) }, null, 8, ["annotationEntry"]), [ [vShow, t.annotationDisplay && !t.createData.toBeConfirmed] ]), t.createData.toBeDeleted ? (openBlock(), createElementBlock("div", d5, [ createVNode(d, null, { default: withCtx(() => [ createVNode(c, { span: 10 }, { default: withCtx(() => e[5] || (e[5] = [ createTextVNode("Delete this feature?") ])), _: 1 }), createVNode(c, { span: 7 }, { default: withCtx(() => [ createVNode(l, { class: "delete-button", icon: n.ElIconDelete, onClick: e[3] || (e[3] = (f6) => n.$emit("confirm-delete")) }, { default: withCtx(() => e[6] || (e[6] = [ createTextVNode(" Delete ") ])), _: 1 }, 8, ["icon"]) ]), _: 1 }), createVNode(c, { span: 6 }, { default: withCtx(() => [ createVNode(l, { class: "delete-button", onClick: e[4] || (e[4] = (f6) => n.$emit("cancel-create")) }, { default: withCtx(() => e[7] || (e[7] = [ createTextVNode(" Dismiss ") ])), _: 1 }) ]), _: 1 }) ]), _: 1 }) ])) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible", "onHide"]) ], 4); } var CM = ki(c5, [["render", f5], ["__scopeId", "data-v-d3f76b72"]]); var Qa = { ALL: 0, SELECTED: 1, HIGHLIGHTED: 2, MOVE: 3 }; var p5 = function(n, e, t) { this.eventType = n, this.identifiers = e, this.zincObjects = t; }; var m5 = function(n, e, t) { this.targetedID = []; const i = n, r = e; this.targetEventType = t; const s = this; t === void 0 && (this.targetEventType = Qa.ALL), this.getEventType = function() { return t; }, this.notify = function(o, a6, c, l) { if (o !== i && (s.targetEventType === Qa.ALL || s.targetEventType === a6)) { const d = new p5(a6, c, l); r(d); } }; }; var g5 = function() { const n = []; this.publish = function(e, t, i, r) { for (let s = 0; s < n.length; s++) n[s].notify(e, t, i, r); }, this.subscribe = function(e, t, i) { if (typeof t == "function") { const r = new m5(e, t, i); return n.push(r), r; } }, this.unsubscribe = function(e) { for (let t = 0; t < n.length; t++) if (e === n[t]) { n.splice(t, 1); return; } }; }; var Lv = { isWebGLAvailable: function() { try { var n = document.createElement("canvas"); return !!(window.WebGLRenderingContext && (n.getContext("webgl") || n.getContext("experimental-webgl"))); } catch { return false; } }, isWebGL2Available: function() { try { var n = document.createElement("canvas"); return !!(window.WebGL2RenderingContext && n.getContext("webgl2")); } catch { return false; } }, getWebGLErrorMessage: function() { return this.getErrorMessage(1); }, getWebGL2ErrorMessage: function() { return this.getErrorMessage(2); }, getErrorMessage: function(n) { var e = { 1: "WebGL", 2: "WebGL 2" }, t = { 1: window.WebGLRenderingContext, 2: window.WebGL2RenderingContext }, i = 'This module requires $1 support but your $0 does not seem to support it.', r = document.createElement("div"); return r.id = "webglmessage", r.style.fontFamily = "monospace", r.style.fontSize = "20px", r.style.fontWeight = "normal", r.style.textAlign = "center", r.style.background = "#fff", r.style.color = "#000", r.style.padding = "1.5em", r.style.width = "400px", r.style.margin = "5em auto 0", t[n] ? i = i.replace("$0", "graphics card") : i = i.replace("$0", "browser"), i = i.replace("$1", e[n]), r.innerHTML = i, r; } }; var mp = { ALL: 0, DESTROYED: 1, NAME_CHANGED: 2, SETTINGS_CHANGED: 3 }; var Xn = function() { this.typeName = "Base Module", this.instanceName = "default", this.onChangedCallbacks = [], this.eventNotifiers = []; }; Xn.prototype.setName = function(n) { if (n && this.instanceName !== n) { this.instanceName = n; const e = this.onChangedCallbacks.slice(); for (let t = 0; t < e.length; t++) e[t](this, mp.NAME_CHANGED); } }; Xn.prototype.settingsChanged = function() { const n = this.onChangedCallbacks.slice(); for (let e = 0; e < n.length; e++) n[e](this, mp.SETTINGS_CHANGED); }; Xn.prototype.exportSettings = function() { const n = {}; return n.dialog = this.typeName, n.name = this.instanceName, n; }; Xn.prototype.importSettings = function(n) { return n.dialog == this.typeName ? (this.setName(n.name), true) : false; }; Xn.prototype.publishChanges = function(n, e, t) { for (let i = 0; i < this.eventNotifiers.length; i++) this.eventNotifiers[i].publish(this, e, n, t); }; Xn.prototype.getName = function() { return this.instanceName; }; Xn.prototype.destroy = function() { const n = this.onChangedCallbacks.slice(); for (let e = 0; e < n.length; e++) n[e](this, mp.DESTROYED); delete this; }; Xn.prototype.addChangedCallback = function(n) { this.onChangedCallbacks.includes(n) == false && this.onChangedCallbacks.push(n); }; Xn.prototype.removeChangedCallback = function(n) { const e = this.onChangedCallbacks.indexOf(n); e > -1 && this.onChangedCallbacks.splice(e, 1); }; Xn.prototype.addNotifier = function(n) { this.eventNotifiers.push(n); }; var wc = (n, e, t) => { for (let i = 0; i < n.length; i++) if (n[i] && n[i].material && n[i].material.emissive) { let r = n[i].userData; r && r.isZincObject ? r.setEmissiveRGB(e) : n[i].material && n[i].material.emissive && n[i].material.emissive.setRGB(...e), t && n[i].material.depthFunc && (n[i].material.depthFunc = Pr.THREE.LessEqualDepth), n[i].children.forEach((s) => { const o = s.userData; o && o.isZincObject && s.material && s.material.emissive && s.material.emissive.setRGB(...e); }); } }; var v5 = function() { let n = [], e = []; this.highlightColour = [1, 0, 0], this.selectColour = [0, 1, 0], this.originalColour = [0, 0, 0]; const t = [], i = [], r = this, s = function(c, l) { if (c.length == 0 && l.length == 0) return false; for (let d = 0; d < c.length; d++) { let h6 = false; for (let f6 = 0; f6 < l.length; f6++) c[d] === l[f6] && (h6 = true); if (!h6) return true; } for (let d = 0; d < l.length; d++) { let h6 = false; for (let f6 = 0; f6 < c.length; f6++) l[d] === c[f6] && (h6 = true); if (!h6) return true; } return false; }, o = function(c, l) { if (t.length = 0, l.length == 0) return c; for (let d = 0; d < c.length; d++) { let h6 = false; for (let f6 = 0; f6 < l.length; f6++) c[d] === l[f6] && (h6 = true); h6 || t.push(c[d]); } return t; }; this.setHighlighted = function(c) { const l = [...n]; this.setNervesStyle(l), r.resetHighlighted(); const d = o(c, e), h6 = a6(d); return this.setNervesStyle(d, Ai.HIGHLIGHTED_COLOUR), wc(h6, r.highlightColour, false), n = d, s(n, l); }, this.setSelected = function(c) { const l = [...e]; this.setNervesStyle(l), r.resetHighlighted(), r.resetSelected(); const d = a6(c); return this.setNervesStyle(c, Ai.SELECTED_COLOUR), wc(d, r.selectColour, false), e = c, s(e, l); }; const a6 = function(c) { i.length = 0; for (let l = 0; l < c.length; l++) c[l].material && i.push(c[l]); return i; }; this.setNervesStyle = function(c, l) { const d = pp(c); if (d && d.length) { const h6 = l ? Ai.ZOOM_RADIUS : Ai.DEFAULT_RADIUS, f6 = l ? Ai.ZOOM_RADIAL_SEGMENTS : Ai.DEFAULT_RADIAL_SEGMENTS; d.forEach((g6) => { var p, u6, y6; if (g6.isTubeLines && ((p = g6.userData) != null && p.isNerves) && !((u6 = g6.userData) != null && u6.isGreyScale)) { g6.setTubeLines(h6, f6); let v6 = l || ((y6 = g6.userData) == null ? void 0 : y6.defaultColour); v6 = v6.replace("#", "0x"), g6.setColourHex(v6); } }); } }, this.resetHighlighted = function() { const c = a6(n); this.setNervesStyle(n), wc(c, r.originalColour, true), n = []; }, this.resetSelected = function() { const c = a6(e); this.setNervesStyle(n), wc(c, r.originalColour, true), e = []; }, this.getSelected = function() { return e; }, this.reset = function() { r.resetSelected(), r.resetHighlighted(); }; }; var gp = Rc.THREE; var y5 = function() { const n = document.createElement("div"); let e; if (n.style.height = "100%", Lv.isWebGLAvailable()) e = new Rc.Renderer(n, window), Rc.defaultMaterialColor = 16777116, e.initialiseVisualisation(), e.playAnimation = false; else { const t = Lv.getWebGLErrorMessage(); n.appendChild(t); } return { Zinc: Rc, renderer: e, container: n }; }; var Kt = function() { Xn.call(this), this.scene = void 0, this.rendererContainer = void 0, this.displayArea = void 0, this.graphicsHighlight = new v5(), this.selectObjectOnPick = true, this.zincRenderer = null, this.selectedScreenCoordinates = new gp.Vector3(), this.selectedCenter = void 0, this.liveUpdatesObjects = void 0, this.ignorePreviousSelected = false; }; Kt.prototype = Object.create(Xn.prototype); Kt.prototype.getIntersectedObject = function(n) { if (n) { const e = n.map((i) => { if (i && i.object && i.object.userData) { if (i.object.userData.isMarker) return 1; if (i.object.name && i.object.userData.isZincObject) return i.object.name === "_Unnamed" ? 3 : 2; } return 0; }); let t = e.indexOf(1); return t > -1 || (t = e.indexOf(2), t = t > -1 ? t : e.indexOf(3)), n[t]; } }; Kt.prototype.getAnnotationsFromObjects = function(n) { const e = []; for (var t = 0; t < n.length; t++) { const i = n[t].userData; let r; if (i) { if (i.isGlyph || i.isGlyphset) { let s = i; i.isGlyph && (s = i.getGlyphset()), r = s.userData ? s.userData.annotation : void 0, r && r.data && (n[t].name && n[t].name != "" ? r.data.id = n[t].name : r.data.id = s.groupName); } else r = i.userData ? i.userData.annotation : void 0, r && r.data && (r.data.id = n[t].name); r && (r.data.anatomicalId = i.anatomicalId, r.data.isNerves = i.userData.isNerves, r.data.zincObject = i); } r && e.push(r); } return e; }; Kt.prototype.setHighlightedByObjects = function(n, e, t, i) { const r = pp(n), s = this.graphicsHighlight.setHighlighted(n); if (i) { let o = Qa.MOVE; s && (o = Qa.HIGHLIGHTED); const a6 = this.getAnnotationsFromObjects(n); a6.length > 0 && (a6[0].coords = e, a6[0].extraData = t), this.publishChanges(a6, o, r); } return s; }; Kt.prototype.setHighlightedByZincObjects = function(n, e, t, i) { let r = []; return n && n.forEach((s) => { s && s.getMorph() && r.push(s.getMorph()); }), this.setHighlightedByObjects(r, e, t, i); }; Kt.prototype.setupLiveCoordinates = function(n) { if (this.liveUpdatesObjects = n, n && n.length > 0) { const e = this.scene.getBoundingBoxOfZincObjects(n); let t = new gp.Vector3(); e ? (e.getCenter(t), this.selectedCenter == null ? this.selectedCenter = t : this.selectedCenter.copy(t)) : this.selectedCenter = void 0; } else this.selectedCenter = void 0; }; Kt.prototype.setSelectedByObjects = function(n, e, t, i) { let r = false; if (this.selectObjectOnPick ? r = this.graphicsHighlight.setSelected(n) : r = true, r || this.ignorePreviousSelected) { const s = pp(n); if (this.selectObjectOnPick && this.setupLiveCoordinates(s), i) { const o = Qa.SELECTED, a6 = this.getAnnotationsFromObjects(n); a6.length > 0 && (a6[0].coords = e, a6[0].extraData = t), this.publishChanges(a6, o, s); } } return r; }; Kt.prototype.setSelectedByZincObjects = function(n, e, t, i) { let r = []; return n && n.forEach((s) => { if (s) { const o = s.getMorph(); o && r.push(o); } }), this.setSelectedByObjects(r, e, t, i); }; Kt.prototype.findObjectsByGroupName = function(n) { return this.scene.findObjectsWithGroupName(n); }; Kt.prototype.setHighlightedByGroupName = function(n, e) { const t = this.findObjectsByGroupName(n); return this.setHighlightedByObjects(t, void 0, {}, e); }; Kt.prototype.setSelectedByGroupName = function(n, e) { const t = this.findObjectsByGroupName(n); return this.setSelectedByObjects(t, void 0, {}, e); }; Kt.prototype.changeBackgroundColour = function(n) { const e = new gp.Color(n); this.zincRenderer && this.zincRenderer.getThreeJSRenderer().setClearColor(e, 1); }; Kt.prototype.resetView = function() { this.zincRenderer && this.zincRenderer.resetView(); }; Kt.prototype.viewAll = function() { this.zincRenderer && this.zincRenderer.viewAll(); }; Kt.prototype.playAnimation = function(n) { this.zincRenderer && (this.zincRenderer.playAnimation = n); }; Kt.prototype.setPlayRate = function(n) { this.zincRenderer && this.zincRenderer.setPlayRate(n); }; Kt.prototype.getPlayRate = function(n) { return this.zincRenderer ? this.zincRenderer.getPlayRate() : 0; }; Kt.prototype.initialiseRenderer = function(n) { if (this.zincRenderer === void 0 || this.rendererContainer === void 0) { let e = y5(); this.Zinc = e.Zinc, this.zincRenderer = e.renderer, this.rendererContainer = e.container; } n && (this.displayArea = n, this.displayArea.appendChild(this.rendererContainer), this.zincRenderer && this.zincRenderer.animate()); }; Kt.prototype.destroy = function() { this.zincRenderer && (this.zincRenderer.dispose(), this.zincRenderer.getThreeJSRenderer().dispose(), this.zincRenderer = void 0), Xn.prototype.destroy.call(this); }; var b5 = function() { this.type = "anatomical", this.data = void 0, this.isAnnotation = true; }; var x5 = function() { this.currentName = "", this.currentSystem = "", this.currentPart = "", this.currentSpecies = "", this.metaURL = "", this.viewURL = "", this.timeVarying = false, this.currentTime = 0; }; var LM = function(n) { Kt.call(this); const e = this; let t; this.sceneData = new x5(); const i = new Array(), r = new Array(), s = new Array(), o = new Array(); let a6, c; const l = n; this.NDCCameraControl = void 0, e.typeName = "Organ Viewer"; let d = false; this.isIgnorePicking = function() { return d; }, this.setIgnorePicking = function(_6) { d = _6; }, this.getSceneData = function() { return e.sceneData; }, this.updateTime = function(_6) { let S6 = 6e3; e.scene && (S6 = e.scene.getDuration()); const E6 = _6 / 100 * S6; e.sceneData.nerveMapIsActive || e.scene && e.scene.setMorphsTime(E6), e.sceneData.currentTime = _6; }; const h6 = function() { let _6 = 3e3; e.scene && (_6 = e.scene.getDuration()); const S6 = e.zincRenderer.getCurrentTime(); for (let E6 = 0; E6 < i.length; E6++) i[E6](S6); !e.sceneData.nerveMapIsActive && t && t.setMorphsTime(S6), e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setTime(S6 / _6), e.sceneData.currentTime = S6 / _6 * 100; }; this.getCurrentTime = function() { return e.sceneData.currentTime; }, this.toggleSyncControl = (_6, S6) => { let E6 = this.scene.getZincCameraControls(); _6 ? (E6.resetView(), this.NDCCameraControl = E6.enableSyncControl(), E6.setRotationMode(S6)) : (E6.disableSyncControl(), this.NDCCameraControl = void 0, E6.setRotationMode("free")); }, this.isSyncControl = () => this.NDCCameraControl !== void 0, this.setSyncControlZoomToBox = (_6) => { this.NDCCameraControl && this.NDCCameraControl.zoomToBox(_6, 2); }, this.setSyncControlCallback = (_6) => { this.NDCCameraControl && this.NDCCameraControl.setEventCallback(_6); }, this.setSyncControlCenterZoom = (_6, S6) => { this.NDCCameraControl && this.NDCCameraControl.setCenterZoom(_6, S6); }; const f6 = function() { if (e.zincRenderer.playAnimation && e.liveUpdatesObjects && e.setupLiveCoordinates(e.liveUpdatesObjects), e.selectedCenter) { const _6 = new Pr.THREE.Vector3(); _6.copy(e.selectedCenter); const S6 = e.scene.vectorToScreenXY(_6); e.selectedScreenCoordinates.x = S6.x, e.selectedScreenCoordinates.y = S6.y; } }, g6 = function() { return function() { h6(); }; }, p = function() { return function() { f6(); }; }; this.addTimeChangedCallback = function(_6) { i.push(_6); }, this.setTexturePos = function(_6) { e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setSliderPos(_6); }, this.addSceneChangedCallback = function(_6) { r.push(_6); }, this.addOrganPartAddedCallback = function(_6) { s.push(_6); }, this.addOrganPartRemovedCallback = function(_6) { o.push(_6); }, this.setFinishDownloadCallback = function(_6) { a6 = _6; }, this.unsetFinishDownloadCallback = function() { a6 = void 0; }, this.setDownloadErrorCallback = function(_6) { c = _6; }, this.unsetDownloadErrorCallback = function() { c = void 0; }, this.getNamedObjectsToScreenCoordinates = function(_6, S6) { const E6 = new Pr.THREE.Vector3(); E6.setFromMatrixPosition(obj.matrixWorld); const C6 = width / 2, I6 = height / 2; return E6.project(S6), E6.x = E6.x * C6 + C6, E6.y = -(E6.y * I6) + I6, E6; }; const u6 = function(_6) { let S6, E6; if (_6 !== void 0) { let C6 = false; _6.object.userData && _6.object.userData.isMarker ? (C6 = true, E6 = _6.object.userData.parent.getMorph()) : E6 = _6.object; try { E6.userData.userData.annotation.data.lastActionOnMarker = C6; } finally { } if (E6) if (E6.name) S6 = E6.name; else { const I6 = e.getAnnotationsFromObjects( [E6] ); I6 && I6[0] && (S6 = I6[0].data.group); } } return { id: S6, object: E6 }; }, y6 = function() { return function(_6, S6, E6) { var D6; const C6 = e.getIntersectedObject(_6), I6 = u6(C6), b6 = { worldCoords: [ C6 ? C6.point.x : 0, C6 ? C6.point.y : 0, C6 ? C6.point.z : 0 ], intersected: C6, intersects: _6 }, F6 = { x: S6, y: E6 }; if (I6.id) { b6.threeID = (D6 = I6.object) == null ? void 0 : D6.id, I6.object.userData.isGlyph ? I6.object.name ? e.setSelectedByObjects( [I6.object], F6, b6, true ) : e.setSelectedByZincObjects( I6.object.userData.getGlyphset(), F6, b6, true ) : e.setSelectedByObjects([I6.object], F6, b6, true); return; } else { if (d) return; e.setSelectedByObjects([], F6, b6, true); } }; }, v6 = function() { return function(_6, S6, E6) { var D6; const C6 = e.getIntersectedObject(_6), I6 = u6(C6), b6 = { worldCoords: [ C6 ? C6.point.x : 0, C6 ? C6.point.y : 0, C6 ? C6.point.z : 0 ] }, F6 = { x: S6, y: E6 }; if (I6.id) { b6.threeID = (D6 = I6.object) == null ? void 0 : D6.id, e.displayArea.style.cursor = "pointer", e.setHighlightedByObjects([I6.object], F6, b6, true); return; } else e.displayArea.style.cursor = "auto", e.setHighlightedByObjects([], F6, b6, true); }; }, m6 = function(_6, S6, E6, C6) { if (C6 == "all" || C6 == "geometries") { const I6 = _6.findGeometriesWithGroupName(S6); for (let b6 = 0; b6 < I6.length; b6++) I6[b6].setVisibility(E6); } if (C6 == "all" || C6 == "glyphsets") { const I6 = _6.findGlyphsetsWithGroupName(S6); for (let b6 = 0; b6 < I6.length; b6++) I6[b6].setVisibility(E6); } if (C6 == "all" || C6 == "pointsets") { const I6 = _6.findPointsetsWithGroupName(S6); for (let b6 = 0; b6 < I6.length; b6++) I6[b6].setVisibility(E6); } if (C6 == "all" || C6 == "lines") { const I6 = _6.findLinesWithGroupName(S6); for (let b6 = 0; b6 < I6.length; b6++) I6[b6].setVisibility(E6); } }; this.changeGeometriesVisibility = function(_6, S6) { m6(e.scene, _6, S6, "geometries"); }, this.changeGlyphsetsVisibility = function(_6, S6) { m6(e.scene, _6, S6, "glyphsets"); }, this.changeLinesVisibility = function(_6, S6) { m6(e.scene, _6, S6, "lines"); }, this.changePointsetsVisibility = function(_6, S6) { m6(e.scene, _6, S6, "pointsets"); }, this.changeOrganPartsVisibility = function(_6, S6, E6) { let C6 = "all"; E6 !== void 0 && (C6 = E6), m6(e.scene, _6, S6, C6); }, this.changeOrganPartsVisibilityCallback = function(_6) { return function(S6) { e.changeOrganPartsVisibility(_6, S6); }; }, this.changeBackgroundColour = function(_6) { const S6 = new Pr.THREE.Color(_6); e.zincRenderer && e.zincRenderer.getThreeJSRenderer().setClearColor(S6, 1); }; const x6 = function(_6, S6, E6, C6) { for (let F6 = 0; F6 < s.length; F6++) s[F6](C6, e.scene.isTimeVarying()); const I6 = new b5(), b6 = C6.region.getFullPath(); I6.data = { species: e.sceneData.currentSpecies, system: _6, part: S6, group: C6.groupName, region: b6, uuid: C6.uuid, lastActionOnMarker: false }, C6.userData.annotation = I6; }, w6 = function(_6, S6, E6, C6) { for (let I6 = 0; I6 < o.length; I6++) o[I6](C6); }, A6 = function(_6, S6, E6) { return function(C6) { x6(_6, S6, E6, C6); }; }, M6 = function(_6, S6, E6) { return function(C6) { w6(_6, S6, E6, C6); }; }, R6 = function() { return function() { e.settingsChanged(), e.sceneData.timeVarying = e.scene.isTimeVarying(), a6 && a6(); }; }, L6 = function() { return function(_6) { if ((_6 == null ? void 0 : _6.type) === "Error" && c) { const S6 = { xhr: _6.xhr, type: "download-error" }; c(S6); } }; }; this.updateFieldvisibility = function(_6, S6) { for (let E6 = 0; E6 < _6.length; E6++) if (S6 != E6) { const C6 = _6[E6].PartName; e.changeOrganPartsVisibility(C6, false); } if (S6 > -1) { const E6 = _6[S6].PartName; if (e.scene.findGeometriesWithGroupName(E6).length > 0 || e.scene.findGlyphsetsWithGroupName(E6).length > 0) e.changeOrganPartsVisibility(E6, true); else { const C6 = getOrganDetails(_6[S6].SystemName, E6); C6 != null && e.scene.loadMetadataURL(l.getOrgansDirectoryPrefix() + "/" + C6.meta); } } }, this.getAvailableSpecies = function(_6, S6, E6) { const C6 = new Array(); C6.push("none"); const I6 = Object.keys(organsFileMap); for (index in I6) { const b6 = I6[index]; b6 != _6 && organsFileMap[b6].hasOwnProperty(S6) && organsFileMap[b6][S6].hasOwnProperty(E6) && C6.push(b6); } return C6; }, this.getCentreAndSize = function() { const _6 = new Pr.THREE.Vector3(), S6 = this.scene.getBoundingBox(); S6.getCenter(_6); const E6 = [_6.x, _6.y, _6.z]; S6.getSize(_6); const C6 = [_6.x, _6.y, _6.z]; return { centre: E6, size: C6 }; }; const T6 = function(_6, S6, E6, C6) { e.sceneData.nerveMapIsActive = false, e.sceneData.nerveMap = void 0, e.sceneData.metaURL = "", e.sceneData.viewURL = "", e.sceneData.currentSpecies = _6, e.sceneData.currentSystem = S6, e.sceneData.currentPart = E6, e.sceneData.currentTime = 0, e.sceneData.timeVarying = false; let I6 = ""; _6 && (I6 = _6 + "/"), S6 && (I6 = S6 + "/"), E6 && (I6 = E6), e.sceneData.currentName = I6; }; this.loadOrgansFromURL = function(_6, S6, E6, C6, I6, b6, F6) { if (e.zincRenderer && C6 && e.sceneData.metaURL !== _6) { T6(S6, E6, C6); const D6 = e.sceneData.currentName; let N6 = e.zincRenderer.getSceneByName(D6); N6 ? b6 && N6.clearAll() : N6 = e.zincRenderer.createScene(D6), e.selectObjectOnPick = true; for (let U6 = 0; U6 < r.length; U6++) r[U6](e.sceneData); I6 && I6 != "" ? (e.sceneData.viewURL = I6, N6.loadViewURL(e.sceneData.viewURL)) : e.sceneData.viewURL = void 0, e.sceneData.metaURL = _6, N6.addZincObjectAddedCallbacks(A6(E6, C6, false)), N6.addZincObjectRemovedCallbacks(M6(void 0, C6, false)), N6.loadMetadataURL(_6, L6(), R6(), F6), e.scene = N6, e.zincRenderer.setCurrentScene(N6), e.graphicsHighlight.reset(); const B6 = N6.getZincCameraControls(); B6.enableRaycaster(N6, y6(), v6()), B6.setMouseButtonAction("AUXILIARY", "ZOOM"), B6.setMouseButtonAction("SECONDARY", "PAN"); } }, this.loadGLTFFromURL = function(_6, S6, E6) { if (e.zincRenderer && S6 && e.sceneData.metaURL !== _6) { T6(void 0, void 0, S6); const C6 = e.sceneData.currentName; let I6 = e.zincRenderer.getSceneByName(C6); I6 ? E6 && I6.clearAll() : I6 = e.zincRenderer.createScene(C6); for (let F6 = 0; F6 < r.length; F6++) r[F6](e.sceneData); e.sceneData.viewURL = void 0, e.sceneData.metaURL = _6, I6.addZincObjectAddedCallbacks(A6(void 0, S6, false)), I6.addZincObjectRemovedCallbacks(M6(void 0, S6, false)), I6.loadGLTF(_6, void 0, R6()), e.scene = I6, e.zincRenderer.setCurrentScene(I6), e.graphicsHighlight.reset(); const b6 = I6.getZincCameraControls(); b6.enableRaycaster(I6, y6(), v6()), b6.setMouseButtonAction("AUXILIARY", "ZOOM"), b6.setMouseButtonAction("SECONDARY", "PAN"); } }, this.alignCameraWithSelectedObject = function(_6) { const S6 = e.graphicsHighlight.getSelected(); S6 && S6[0] && S6[0].userData && e.scene.alignObjectToCameraView(S6[0].userData, _6); }, this.exportSettings = function() { const _6 = {}; return _6.name = e.instanceName, e.sceneData.currentSystem && (_6.system = e.sceneData.currentSystem), e.sceneData.currentSpecies && (_6.species = e.sceneData.currentSpecies), e.sceneData.currentPart && (_6.part = e.sceneData.currentPart), _6.metaURL = e.sceneData.metaURL, e.sceneData.viewURL && (_6.viewURL = e.sceneData.viewURL), _6.dialog = "Organ Viewer", _6; }, this.importSettings = function(_6) { return _6 && _6.dialog == this.typeName ? (e.setName(_6.name), _6.metaURL !== void 0 && _6.metaURL != "" ? e.loadOrgansFromURL( _6.metaURL, _6.species, _6.system, _6.part, _6.viewURL, true ) : e.loadOrgans(_6.species, _6.system, _6.part), true) : false; }, function() { e.initialiseRenderer(void 0), e.zincRenderer && (e.zincRenderer.addPreRenderCallbackFunction(g6()), e.zincRenderer.addPostRenderCallbackFunction(p())); }(); }; LM.prototype = Object.create(Kt.prototype); var _t = function() { return _t = Object.assign || function(e) { for (var t, i = 1, r = arguments.length; i < r; i++) { t = arguments[i]; for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]); } return e; }, _t.apply(this, arguments); }; function M5(n, e, t, i) { function r(s) { return s instanceof t ? s : new t(function(o) { o(s); }); } return new (t || (t = Promise))(function(s, o) { function a6(d) { try { l(i.next(d)); } catch (h6) { o(h6); } } function c(d) { try { l(i.throw(d)); } catch (h6) { o(h6); } } function l(d) { d.done ? s(d.value) : r(d.value).then(a6, c); } l((i = i.apply(n, [])).next()); }); } function w5(n, e) { var t = { label: 0, sent: function() { if (s[0] & 1) throw s[1]; return s[1]; }, trys: [], ops: [] }, i, r, s, o; return o = { next: a6(0), throw: a6(1), return: a6(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() { return this; }), o; function a6(l) { return function(d) { return c([l, d]); }; } function c(l) { if (i) throw new TypeError("Generator is already executing."); for (; o && (o = 0, l[0] && (t = 0)), t; ) try { if (i = 1, r && (s = l[0] & 2 ? r.return : l[0] ? r.throw || ((s = r.return) && s.call(r), 0) : r.next) && !(s = s.call(r, l[1])).done) return s; switch (r = 0, s && (l = [l[0] & 2, s.value]), l[0]) { case 0: case 1: s = l; break; case 4: return t.label++, { value: l[1], done: false }; case 5: t.label++, r = l[1], l = [0]; continue; case 7: l = t.ops.pop(), t.trys.pop(); continue; default: if (s = t.trys, !(s = s.length > 0 && s[s.length - 1]) && (l[0] === 6 || l[0] === 2)) { t = 0; continue; } if (l[0] === 3 && (!s || l[1] > s[0] && l[1] < s[3])) { t.label = l[1]; break; } if (l[0] === 6 && t.label < s[1]) { t.label = s[1], s = l; break; } if (s && t.label < s[2]) { t.label = s[2], t.ops.push(l); break; } s[2] && t.ops.pop(), t.trys.pop(); continue; } l = e.call(n, t); } catch (d) { l = [6, d], r = 0; } finally { i = s = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: true }; } } function ct(n) { var e = typeof Symbol == "function" && Symbol.iterator, t = e && n[e], i = 0; if (t) return t.call(n); if (n && typeof n.length == "number") return { next: function() { return n && i >= n.length && (n = void 0), { value: n && n[i++], done: !n }; } }; throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); } function Wt(n, e) { var t = typeof Symbol == "function" && n[Symbol.iterator]; if (!t) return n; var i = t.call(n), r, s = [], o; try { for (; (e === void 0 || e-- > 0) && !(r = i.next()).done; ) s.push(r.value); } catch (a6) { o = { error: a6 }; } finally { try { r && !r.done && (t = i.return) && t.call(i); } finally { if (o) throw o.error; } } return s; } var A5 = "ENTRIES"; var RM = "KEYS"; var FM = "VALUES"; var pn2 = ""; var Ph = ( /** @class */ function() { function n(e, t) { var i = e._tree, r = Array.from(i.keys()); this.set = e, this._type = t, this._path = r.length > 0 ? [{ node: i, keys: r }] : []; } return n.prototype.next = function() { var e = this.dive(); return this.backtrack(), e; }, n.prototype.dive = function() { if (this._path.length === 0) return { done: true, value: void 0 }; var e = uo(this._path), t = e.node, i = e.keys; if (uo(i) === pn2) return { done: false, value: this.result() }; var r = t.get(uo(i)); return this._path.push({ node: r, keys: Array.from(r.keys()) }), this.dive(); }, n.prototype.backtrack = function() { if (this._path.length !== 0) { var e = uo(this._path).keys; e.pop(), !(e.length > 0) && (this._path.pop(), this.backtrack()); } }, n.prototype.key = function() { return this.set._prefix + this._path.map(function(e) { var t = e.keys; return uo(t); }).filter(function(e) { return e !== pn2; }).join(""); }, n.prototype.value = function() { return uo(this._path).node.get(pn2); }, n.prototype.result = function() { switch (this._type) { case FM: return this.value(); case RM: return this.key(); default: return [this.key(), this.value()]; } }, n.prototype[Symbol.iterator] = function() { return this; }, n; }() ); var uo = function(n) { return n[n.length - 1]; }; var S5 = function(n, e, t) { var i = /* @__PURE__ */ new Map(); if (e === void 0) return i; for (var r = e.length + 1, s = r + t, o = new Uint8Array(s * r).fill(t + 1), a6 = 0; a6 < r; ++a6) o[a6] = a6; for (var c = 1; c < s; ++c) o[c * r] = c; return PM(n, e, t, i, o, 1, r, ""), i; }; var PM = function(n, e, t, i, r, s, o, a6) { var c, l, d = s * o; try { e: for (var h6 = ct(n.keys()), f6 = h6.next(); !f6.done; f6 = h6.next()) { var g6 = f6.value; if (g6 === pn2) { var p = r[d - 1]; p <= t && i.set(a6, [n.get(g6), p]); } else { for (var u6 = s, y6 = 0; y6 < g6.length; ++y6, ++u6) { for (var v6 = g6[y6], m6 = o * u6, x6 = m6 - o, w6 = r[m6], A6 = Math.max(0, u6 - t - 1), M6 = Math.min(o - 1, u6 + t), R6 = A6; R6 < M6; ++R6) { var L6 = v6 !== e[R6], T6 = r[x6 + R6] + +L6, P6 = r[x6 + R6 + 1] + 1, _6 = r[m6 + R6] + 1, S6 = r[m6 + R6 + 1] = Math.min(T6, P6, _6); S6 < w6 && (w6 = S6); } if (w6 > t) continue e; } PM(n.get(g6), e, t, i, r, u6, o, a6 + g6); } } } catch (E6) { c = { error: E6 }; } finally { try { f6 && !f6.done && (l = h6.return) && l.call(h6); } finally { if (c) throw c.error; } } }; var Ih = ( /** @class */ function() { function n(e, t) { e === void 0 && (e = /* @__PURE__ */ new Map()), t === void 0 && (t = ""), this._size = void 0, this._tree = e, this._prefix = t; } return n.prototype.atPrefix = function(e) { var t, i; if (!e.startsWith(this._prefix)) throw new Error("Mismatched prefix"); var r = Wt($c(this._tree, e.slice(this._prefix.length)), 2), s = r[0], o = r[1]; if (s === void 0) { var a6 = Wt(vp(o), 2), c = a6[0], l = a6[1]; try { for (var d = ct(c.keys()), h6 = d.next(); !h6.done; h6 = d.next()) { var f6 = h6.value; if (f6 !== pn2 && f6.startsWith(l)) { var g6 = /* @__PURE__ */ new Map(); return g6.set(f6.slice(l.length), c.get(f6)), new n(g6, e); } } } catch (p) { t = { error: p }; } finally { try { h6 && !h6.done && (i = d.return) && i.call(d); } finally { if (t) throw t.error; } } } return new n(s, e); }, n.prototype.clear = function() { this._size = void 0, this._tree.clear(); }, n.prototype.delete = function(e) { return this._size = void 0, _5(this._tree, e); }, n.prototype.entries = function() { return new Ph(this, A5); }, n.prototype.forEach = function(e) { var t, i; try { for (var r = ct(this), s = r.next(); !s.done; s = r.next()) { var o = Wt(s.value, 2), a6 = o[0], c = o[1]; e(a6, c, this); } } catch (l) { t = { error: l }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } }, n.prototype.fuzzyGet = function(e, t) { return S5(this._tree, e, t); }, n.prototype.get = function(e) { var t = Nd(this._tree, e); return t !== void 0 ? t.get(pn2) : void 0; }, n.prototype.has = function(e) { var t = Nd(this._tree, e); return t !== void 0 && t.has(pn2); }, n.prototype.keys = function() { return new Ph(this, RM); }, n.prototype.set = function(e, t) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = Oh(this._tree, e); return i.set(pn2, t), this; }, Object.defineProperty(n.prototype, "size", { /** * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size */ get: function() { if (this._size) return this._size; this._size = 0; for (var e = this.entries(); !e.next().done; ) this._size += 1; return this._size; }, enumerable: false, configurable: true }), n.prototype.update = function(e, t) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = Oh(this._tree, e); return i.set(pn2, t(i.get(pn2))), this; }, n.prototype.fetch = function(e, t) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = Oh(this._tree, e), r = i.get(pn2); return r === void 0 && i.set(pn2, r = t()), r; }, n.prototype.values = function() { return new Ph(this, FM); }, n.prototype[Symbol.iterator] = function() { return this.entries(); }, n.from = function(e) { var t, i, r = new n(); try { for (var s = ct(e), o = s.next(); !o.done; o = s.next()) { var a6 = Wt(o.value, 2), c = a6[0], l = a6[1]; r.set(c, l); } } catch (d) { t = { error: d }; } finally { try { o && !o.done && (i = s.return) && i.call(s); } finally { if (t) throw t.error; } } return r; }, n.fromObject = function(e) { return n.from(Object.entries(e)); }, n; }() ); var $c = function(n, e, t) { var i, r; if (t === void 0 && (t = []), e.length === 0 || n == null) return [n, t]; try { for (var s = ct(n.keys()), o = s.next(); !o.done; o = s.next()) { var a6 = o.value; if (a6 !== pn2 && e.startsWith(a6)) return t.push([n, a6]), $c(n.get(a6), e.slice(a6.length), t); } } catch (c) { i = { error: c }; } finally { try { o && !o.done && (r = s.return) && r.call(s); } finally { if (i) throw i.error; } } return t.push([n, e]), $c(void 0, "", t); }; var Nd = function(n, e) { var t, i; if (e.length === 0 || n == null) return n; try { for (var r = ct(n.keys()), s = r.next(); !s.done; s = r.next()) { var o = s.value; if (o !== pn2 && e.startsWith(o)) return Nd(n.get(o), e.slice(o.length)); } } catch (a6) { t = { error: a6 }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } }; var Oh = function(n, e) { var t, i, r = e.length; e: for (var s = 0; n && s < r; ) { try { for (var o = (t = void 0, ct(n.keys())), a6 = o.next(); !a6.done; a6 = o.next()) { var c = a6.value; if (c !== pn2 && e[s] === c[0]) { for (var l = Math.min(r - s, c.length), d = 1; d < l && e[s + d] === c[d]; ) ++d; var h6 = n.get(c); if (d === c.length) n = h6; else { var f6 = /* @__PURE__ */ new Map(); f6.set(c.slice(d), h6), n.set(e.slice(s, s + d), f6), n.delete(c), n = f6; } s += d; continue e; } } } catch (p) { t = { error: p }; } finally { try { a6 && !a6.done && (i = o.return) && i.call(o); } finally { if (t) throw t.error; } } var g6 = /* @__PURE__ */ new Map(); return n.set(e.slice(s), g6), g6; } return n; }; var _5 = function(n, e) { var t = Wt($c(n, e), 2), i = t[0], r = t[1]; if (i !== void 0) { if (i.delete(pn2), i.size === 0) IM(r); else if (i.size === 1) { var s = Wt(i.entries().next().value, 2), o = s[0], a6 = s[1]; OM(r, o, a6); } } }; var IM = function(n) { if (n.length !== 0) { var e = Wt(vp(n), 2), t = e[0], i = e[1]; if (t.delete(i), t.size === 0) IM(n.slice(0, -1)); else if (t.size === 1) { var r = Wt(t.entries().next().value, 2), s = r[0], o = r[1]; s !== pn2 && OM(n.slice(0, -1), s, o); } } }; var OM = function(n, e, t) { if (n.length !== 0) { var i = Wt(vp(n), 2), r = i[0], s = i[1]; r.set(s + e, t), r.delete(s); } }; var vp = function(n) { return n[n.length - 1]; }; var _a; var yp = "or"; var DM = "and"; var T5 = "and_not"; var E5 = ( /** @class */ function() { function n(e) { if ((e == null ? void 0 : e.fields) == null) throw new Error('MiniSearch: option "fields" must be provided'); var t = e.autoVacuum == null || e.autoVacuum === true ? Bh : e.autoVacuum; this._options = _t(_t(_t({}, Nh), e), { autoVacuum: t, searchOptions: _t(_t({}, Rv), e.searchOptions || {}), autoSuggestOptions: _t(_t({}, P5), e.autoSuggestOptions || {}) }), this._index = new Ih(), this._documentCount = 0, this._documentIds = /* @__PURE__ */ new Map(), this._idToShortId = /* @__PURE__ */ new Map(), this._fieldIds = {}, this._fieldLength = /* @__PURE__ */ new Map(), this._avgFieldLength = [], this._nextId = 0, this._storedFields = /* @__PURE__ */ new Map(), this._dirtCount = 0, this._currentVacuum = null, this._enqueuedVacuum = null, this._enqueuedVacuumConditions = Ud, this.addFields(this._options.fields); } return n.prototype.add = function(e) { var t, i, r, s, o, a6, c = this._options, l = c.extractField, d = c.tokenize, h6 = c.processTerm, f6 = c.fields, g6 = c.idField, p = l(e, g6); if (p == null) throw new Error('MiniSearch: document does not have ID field "'.concat(g6, '"')); if (this._idToShortId.has(p)) throw new Error("MiniSearch: duplicate ID ".concat(p)); var u6 = this.addDocumentId(p); this.saveStoredFields(u6, e); try { for (var y6 = ct(f6), v6 = y6.next(); !v6.done; v6 = y6.next()) { var m6 = v6.value, x6 = l(e, m6); if (x6 != null) { var w6 = d(x6.toString(), m6), A6 = this._fieldIds[m6], M6 = new Set(w6).size; this.addFieldLength(u6, A6, this._documentCount - 1, M6); try { for (var R6 = (r = void 0, ct(w6)), L6 = R6.next(); !L6.done; L6 = R6.next()) { var T6 = L6.value, P6 = h6(T6, m6); if (Array.isArray(P6)) try { for (var _6 = (o = void 0, ct(P6)), S6 = _6.next(); !S6.done; S6 = _6.next()) { var E6 = S6.value; this.addTerm(A6, u6, E6); } } catch (C6) { o = { error: C6 }; } finally { try { S6 && !S6.done && (a6 = _6.return) && a6.call(_6); } finally { if (o) throw o.error; } } else P6 && this.addTerm(A6, u6, P6); } } catch (C6) { r = { error: C6 }; } finally { try { L6 && !L6.done && (s = R6.return) && s.call(R6); } finally { if (r) throw r.error; } } } } } catch (C6) { t = { error: C6 }; } finally { try { v6 && !v6.done && (i = y6.return) && i.call(y6); } finally { if (t) throw t.error; } } }, n.prototype.addAll = function(e) { var t, i; try { for (var r = ct(e), s = r.next(); !s.done; s = r.next()) { var o = s.value; this.add(o); } } catch (a6) { t = { error: a6 }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } }, n.prototype.addAllAsync = function(e, t) { var i = this; t === void 0 && (t = {}); var r = t.chunkSize, s = r === void 0 ? 10 : r, o = { chunk: [], promise: Promise.resolve() }, a6 = e.reduce(function(d, h6, f6) { var g6 = d.chunk, p = d.promise; return g6.push(h6), (f6 + 1) % s === 0 ? { chunk: [], promise: p.then(function() { return new Promise(function(u6) { return setTimeout(u6, 0); }); }).then(function() { return i.addAll(g6); }) } : { chunk: g6, promise: p }; }, o), c = a6.chunk, l = a6.promise; return l.then(function() { return i.addAll(c); }); }, n.prototype.remove = function(e) { var t, i, r, s, o, a6, c = this._options, l = c.tokenize, d = c.processTerm, h6 = c.extractField, f6 = c.fields, g6 = c.idField, p = h6(e, g6); if (p == null) throw new Error('MiniSearch: document does not have ID field "'.concat(g6, '"')); var u6 = this._idToShortId.get(p); if (u6 == null) throw new Error("MiniSearch: cannot remove document with ID ".concat(p, ": it is not in the index")); try { for (var y6 = ct(f6), v6 = y6.next(); !v6.done; v6 = y6.next()) { var m6 = v6.value, x6 = h6(e, m6); if (x6 != null) { var w6 = l(x6.toString(), m6), A6 = this._fieldIds[m6], M6 = new Set(w6).size; this.removeFieldLength(u6, A6, this._documentCount, M6); try { for (var R6 = (r = void 0, ct(w6)), L6 = R6.next(); !L6.done; L6 = R6.next()) { var T6 = L6.value, P6 = d(T6, m6); if (Array.isArray(P6)) try { for (var _6 = (o = void 0, ct(P6)), S6 = _6.next(); !S6.done; S6 = _6.next()) { var E6 = S6.value; this.removeTerm(A6, u6, E6); } } catch (C6) { o = { error: C6 }; } finally { try { S6 && !S6.done && (a6 = _6.return) && a6.call(_6); } finally { if (o) throw o.error; } } else P6 && this.removeTerm(A6, u6, P6); } } catch (C6) { r = { error: C6 }; } finally { try { L6 && !L6.done && (s = R6.return) && s.call(R6); } finally { if (r) throw r.error; } } } } } catch (C6) { t = { error: C6 }; } finally { try { v6 && !v6.done && (i = y6.return) && i.call(y6); } finally { if (t) throw t.error; } } this._storedFields.delete(u6), this._documentIds.delete(u6), this._idToShortId.delete(p), this._fieldLength.delete(u6), this._documentCount -= 1; }, n.prototype.removeAll = function(e) { var t, i; if (e) try { for (var r = ct(e), s = r.next(); !s.done; s = r.next()) { var o = s.value; this.remove(o); } } catch (a6) { t = { error: a6 }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } else { if (arguments.length > 0) throw new Error("Expected documents to be present. Omit the argument to remove all documents."); this._index = new Ih(), this._documentCount = 0, this._documentIds = /* @__PURE__ */ new Map(), this._idToShortId = /* @__PURE__ */ new Map(), this._fieldLength = /* @__PURE__ */ new Map(), this._avgFieldLength = [], this._storedFields = /* @__PURE__ */ new Map(), this._nextId = 0; } }, n.prototype.discard = function(e) { var t = this, i = this._idToShortId.get(e); if (i == null) throw new Error("MiniSearch: cannot discard document with ID ".concat(e, ": it is not in the index")); this._idToShortId.delete(e), this._documentIds.delete(i), this._storedFields.delete(i), (this._fieldLength.get(i) || []).forEach(function(r, s) { t.removeFieldLength(i, s, t._documentCount, r); }), this._fieldLength.delete(i), this._documentCount -= 1, this._dirtCount += 1, this.maybeAutoVacuum(); }, n.prototype.maybeAutoVacuum = function() { if (this._options.autoVacuum !== false) { var e = this._options.autoVacuum, t = e.minDirtFactor, i = e.minDirtCount, r = e.batchSize, s = e.batchWait; this.conditionalVacuum({ batchSize: r, batchWait: s }, { minDirtCount: i, minDirtFactor: t }); } }, n.prototype.discardAll = function(e) { var t, i, r = this._options.autoVacuum; try { this._options.autoVacuum = false; try { for (var s = ct(e), o = s.next(); !o.done; o = s.next()) { var a6 = o.value; this.discard(a6); } } catch (c) { t = { error: c }; } finally { try { o && !o.done && (i = s.return) && i.call(s); } finally { if (t) throw t.error; } } } finally { this._options.autoVacuum = r; } this.maybeAutoVacuum(); }, n.prototype.replace = function(e) { var t = this._options, i = t.idField, r = t.extractField, s = r(e, i); this.discard(s), this.add(e); }, n.prototype.vacuum = function(e) { return e === void 0 && (e = {}), this.conditionalVacuum(e); }, n.prototype.conditionalVacuum = function(e, t) { var i = this; return this._currentVacuum ? (this._enqueuedVacuumConditions = this._enqueuedVacuumConditions && t, this._enqueuedVacuum != null ? this._enqueuedVacuum : (this._enqueuedVacuum = this._currentVacuum.then(function() { var r = i._enqueuedVacuumConditions; return i._enqueuedVacuumConditions = Ud, i.performVacuuming(e, r); }), this._enqueuedVacuum)) : this.vacuumConditionsMet(t) === false ? Promise.resolve() : (this._currentVacuum = this.performVacuuming(e), this._currentVacuum); }, n.prototype.performVacuuming = function(e, t) { return M5(this, void 0, void 0, function() { var i, r, s, o, a6, c, l, d, h6, f6, g6, p, u6, y6, v6, m6, x6, w6, A6, M6, R6, L6, T6, P6, _6; return w5(this, function(S6) { switch (S6.label) { case 0: if (i = this._dirtCount, !this.vacuumConditionsMet(t)) return [3, 10]; r = e.batchSize || Bd.batchSize, s = e.batchWait || Bd.batchWait, o = 1, S6.label = 1; case 1: S6.trys.push([1, 7, 8, 9]), a6 = ct(this._index), c = a6.next(), S6.label = 2; case 2: if (c.done) return [3, 6]; l = Wt(c.value, 2), d = l[0], h6 = l[1]; try { for (f6 = (L6 = void 0, ct(h6)), g6 = f6.next(); !g6.done; g6 = f6.next()) { p = Wt(g6.value, 2), u6 = p[0], y6 = p[1]; try { for (v6 = (P6 = void 0, ct(y6)), m6 = v6.next(); !m6.done; m6 = v6.next()) x6 = Wt(m6.value, 1), w6 = x6[0], !this._documentIds.has(w6) && (y6.size <= 1 ? h6.delete(u6) : y6.delete(w6)); } catch (E6) { P6 = { error: E6 }; } finally { try { m6 && !m6.done && (_6 = v6.return) && _6.call(v6); } finally { if (P6) throw P6.error; } } } } catch (E6) { L6 = { error: E6 }; } finally { try { g6 && !g6.done && (T6 = f6.return) && T6.call(f6); } finally { if (L6) throw L6.error; } } return this._index.get(d).size === 0 && this._index.delete(d), o % r !== 0 ? [3, 4] : [4, new Promise(function(E6) { return setTimeout(E6, s); })]; case 3: S6.sent(), S6.label = 4; case 4: o += 1, S6.label = 5; case 5: return c = a6.next(), [3, 2]; case 6: return [3, 9]; case 7: return A6 = S6.sent(), M6 = { error: A6 }, [3, 9]; case 8: try { c && !c.done && (R6 = a6.return) && R6.call(a6); } finally { if (M6) throw M6.error; } return [ 7 /*endfinally*/ ]; case 9: this._dirtCount -= i, S6.label = 10; case 10: return [4, null]; case 11: return S6.sent(), this._currentVacuum = this._enqueuedVacuum, this._enqueuedVacuum = null, [ 2 /*return*/ ]; } }); }); }, n.prototype.vacuumConditionsMet = function(e) { if (e == null) return true; var t = e.minDirtCount, i = e.minDirtFactor; return t = t || Bh.minDirtCount, i = i || Bh.minDirtFactor, this.dirtCount >= t && this.dirtFactor >= i; }, Object.defineProperty(n.prototype, "isVacuuming", { /** * Is `true` if a vacuuming operation is ongoing, `false` otherwise */ get: function() { return this._currentVacuum != null; }, enumerable: false, configurable: true }), Object.defineProperty(n.prototype, "dirtCount", { /** * The number of documents discarded since the most recent vacuuming */ get: function() { return this._dirtCount; }, enumerable: false, configurable: true }), Object.defineProperty(n.prototype, "dirtFactor", { /** * A number between 0 and 1 giving an indication about the proportion of * documents that are discarded, and can therefore be cleaned up by vacuuming. * A value close to 0 means that the index is relatively clean, while a higher * value means that the index is relatively dirty, and vacuuming could release * memory. */ get: function() { return this._dirtCount / (1 + this._documentCount + this._dirtCount); }, enumerable: false, configurable: true }), n.prototype.has = function(e) { return this._idToShortId.has(e); }, n.prototype.getStoredFields = function(e) { var t = this._idToShortId.get(e); if (t != null) return this._storedFields.get(t); }, n.prototype.search = function(e, t) { var i, r; t === void 0 && (t = {}); var s = this.executeQuery(e, t), o = []; try { for (var a6 = ct(s), c = a6.next(); !c.done; c = a6.next()) { var l = Wt(c.value, 2), d = l[0], h6 = l[1], f6 = h6.score, g6 = h6.terms, p = h6.match, u6 = g6.length || 1, y6 = { id: this._documentIds.get(d), score: f6 * u6, terms: Object.keys(p), queryTerms: g6, match: p }; Object.assign(y6, this._storedFields.get(d)), (t.filter == null || t.filter(y6)) && o.push(y6); } } catch (v6) { i = { error: v6 }; } finally { try { c && !c.done && (r = a6.return) && r.call(a6); } finally { if (i) throw i.error; } } return e === n.wildcard && t.boostDocument == null && this._options.searchOptions.boostDocument == null || o.sort(Pv), o; }, n.prototype.autoSuggest = function(e, t) { var i, r, s, o; t === void 0 && (t = {}), t = _t(_t({}, this._options.autoSuggestOptions), t); var a6 = /* @__PURE__ */ new Map(); try { for (var c = ct(this.search(e, t)), l = c.next(); !l.done; l = c.next()) { var d = l.value, h6 = d.score, f6 = d.terms, g6 = f6.join(" "), p = a6.get(g6); p != null ? (p.score += h6, p.count += 1) : a6.set(g6, { score: h6, terms: f6, count: 1 }); } } catch (A6) { i = { error: A6 }; } finally { try { l && !l.done && (r = c.return) && r.call(c); } finally { if (i) throw i.error; } } var u6 = []; try { for (var y6 = ct(a6), v6 = y6.next(); !v6.done; v6 = y6.next()) { var m6 = Wt(v6.value, 2), p = m6[0], x6 = m6[1], h6 = x6.score, f6 = x6.terms, w6 = x6.count; u6.push({ suggestion: p, terms: f6, score: h6 / w6 }); } } catch (A6) { s = { error: A6 }; } finally { try { v6 && !v6.done && (o = y6.return) && o.call(y6); } finally { if (s) throw s.error; } } return u6.sort(Pv), u6; }, Object.defineProperty(n.prototype, "documentCount", { /** * Total number of documents available to search */ get: function() { return this._documentCount; }, enumerable: false, configurable: true }), Object.defineProperty(n.prototype, "termCount", { /** * Number of terms in the index */ get: function() { return this._index.size; }, enumerable: false, configurable: true }), n.loadJSON = function(e, t) { if (t == null) throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index"); return this.loadJS(JSON.parse(e), t); }, n.getDefault = function(e) { if (Nh.hasOwnProperty(e)) return Dh(Nh, e); throw new Error('MiniSearch: unknown option "'.concat(e, '"')); }, n.loadJS = function(e, t) { var i, r, s, o, a6, c, l = e.index, d = e.documentCount, h6 = e.nextId, f6 = e.documentIds, g6 = e.fieldIds, p = e.fieldLength, u6 = e.averageFieldLength, y6 = e.storedFields, v6 = e.dirtCount, m6 = e.serializationVersion; if (m6 !== 1 && m6 !== 2) throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version"); var x6 = new n(t); x6._documentCount = d, x6._nextId = h6, x6._documentIds = Ac(f6), x6._idToShortId = /* @__PURE__ */ new Map(), x6._fieldIds = g6, x6._fieldLength = Ac(p), x6._avgFieldLength = u6, x6._storedFields = Ac(y6), x6._dirtCount = v6 || 0, x6._index = new Ih(); try { for (var w6 = ct(x6._documentIds), A6 = w6.next(); !A6.done; A6 = w6.next()) { var M6 = Wt(A6.value, 2), R6 = M6[0], L6 = M6[1]; x6._idToShortId.set(L6, R6); } } catch (N6) { i = { error: N6 }; } finally { try { A6 && !A6.done && (r = w6.return) && r.call(w6); } finally { if (i) throw i.error; } } try { for (var T6 = ct(l), P6 = T6.next(); !P6.done; P6 = T6.next()) { var _6 = Wt(P6.value, 2), S6 = _6[0], E6 = _6[1], C6 = /* @__PURE__ */ new Map(); try { for (var I6 = (a6 = void 0, ct(Object.keys(E6))), b6 = I6.next(); !b6.done; b6 = I6.next()) { var F6 = b6.value, D6 = E6[F6]; m6 === 1 && (D6 = D6.ds), C6.set(parseInt(F6, 10), Ac(D6)); } } catch (N6) { a6 = { error: N6 }; } finally { try { b6 && !b6.done && (c = I6.return) && c.call(I6); } finally { if (a6) throw a6.error; } } x6._index.set(S6, C6); } } catch (N6) { s = { error: N6 }; } finally { try { P6 && !P6.done && (o = T6.return) && o.call(T6); } finally { if (s) throw s.error; } } return x6; }, n.prototype.executeQuery = function(e, t) { var i = this; if (t === void 0 && (t = {}), e === n.wildcard) return this.executeWildcardQuery(t); if (typeof e != "string") { var r = _t(_t(_t({}, t), e), { queries: void 0 }), s = e.queries.map(function(y6) { return i.executeQuery(y6, r); }); return this.combineResults(s, r.combineWith); } var o = this._options, a6 = o.tokenize, c = o.processTerm, l = o.searchOptions, d = _t(_t({ tokenize: a6, processTerm: c }, l), t), h6 = d.tokenize, f6 = d.processTerm, g6 = h6(e).flatMap(function(y6) { return f6(y6); }).filter(function(y6) { return !!y6; }), p = g6.map(F5(d)), u6 = p.map(function(y6) { return i.executeQuerySpec(y6, d); }); return this.combineResults(u6, d.combineWith); }, n.prototype.executeQuerySpec = function(e, t) { var i, r, s, o, a6 = _t(_t({}, this._options.searchOptions), t), c = (a6.fields || this._options.fields).reduce(function(F6, D6) { var N6; return _t(_t({}, F6), (N6 = {}, N6[D6] = Dh(a6.boost, D6) || 1, N6)); }, {}), l = a6.boostDocument, d = a6.weights, h6 = a6.maxFuzzy, f6 = a6.bm25, g6 = _t(_t({}, Rv.weights), d), p = g6.fuzzy, u6 = g6.prefix, y6 = this._index.get(e.term), v6 = this.termResults(e.term, e.term, 1, y6, c, l, f6), m6, x6; if (e.prefix && (m6 = this._index.atPrefix(e.term)), e.fuzzy) { var w6 = e.fuzzy === true ? 0.2 : e.fuzzy, A6 = w6 < 1 ? Math.min(h6, Math.round(e.term.length * w6)) : w6; A6 && (x6 = this._index.fuzzyGet(e.term, A6)); } if (m6) try { for (var M6 = ct(m6), R6 = M6.next(); !R6.done; R6 = M6.next()) { var L6 = Wt(R6.value, 2), T6 = L6[0], P6 = L6[1], _6 = T6.length - e.term.length; if (_6) { x6 == null || x6.delete(T6); var S6 = u6 * T6.length / (T6.length + 0.3 * _6); this.termResults(e.term, T6, S6, P6, c, l, f6, v6); } } } catch (F6) { i = { error: F6 }; } finally { try { R6 && !R6.done && (r = M6.return) && r.call(M6); } finally { if (i) throw i.error; } } if (x6) try { for (var E6 = ct(x6.keys()), C6 = E6.next(); !C6.done; C6 = E6.next()) { var T6 = C6.value, I6 = Wt(x6.get(T6), 2), b6 = I6[0], _6 = I6[1]; if (_6) { var S6 = p * T6.length / (T6.length + _6); this.termResults(e.term, T6, S6, b6, c, l, f6, v6); } } } catch (F6) { s = { error: F6 }; } finally { try { C6 && !C6.done && (o = E6.return) && o.call(E6); } finally { if (s) throw s.error; } } return v6; }, n.prototype.executeWildcardQuery = function(e) { var t, i, r = /* @__PURE__ */ new Map(), s = _t(_t({}, this._options.searchOptions), e); try { for (var o = ct(this._documentIds), a6 = o.next(); !a6.done; a6 = o.next()) { var c = Wt(a6.value, 2), l = c[0], d = c[1], h6 = s.boostDocument ? s.boostDocument(d, "", this._storedFields.get(l)) : 1; r.set(l, { score: h6, terms: [], match: {} }); } } catch (f6) { t = { error: f6 }; } finally { try { a6 && !a6.done && (i = o.return) && i.call(o); } finally { if (t) throw t.error; } } return r; }, n.prototype.combineResults = function(e, t) { if (t === void 0 && (t = yp), e.length === 0) return /* @__PURE__ */ new Map(); var i = t.toLowerCase(); return e.reduce(C5[i]) || /* @__PURE__ */ new Map(); }, n.prototype.toJSON = function() { var e, t, i, r, s = []; try { for (var o = ct(this._index), a6 = o.next(); !a6.done; a6 = o.next()) { var c = Wt(a6.value, 2), l = c[0], d = c[1], h6 = {}; try { for (var f6 = (i = void 0, ct(d)), g6 = f6.next(); !g6.done; g6 = f6.next()) { var p = Wt(g6.value, 2), u6 = p[0], y6 = p[1]; h6[u6] = Object.fromEntries(y6); } } catch (v6) { i = { error: v6 }; } finally { try { g6 && !g6.done && (r = f6.return) && r.call(f6); } finally { if (i) throw i.error; } } s.push([l, h6]); } } catch (v6) { e = { error: v6 }; } finally { try { a6 && !a6.done && (t = o.return) && t.call(o); } finally { if (e) throw e.error; } } return { documentCount: this._documentCount, nextId: this._nextId, documentIds: Object.fromEntries(this._documentIds), fieldIds: this._fieldIds, fieldLength: Object.fromEntries(this._fieldLength), averageFieldLength: this._avgFieldLength, storedFields: Object.fromEntries(this._storedFields), dirtCount: this._dirtCount, index: s, serializationVersion: 2 }; }, n.prototype.termResults = function(e, t, i, r, s, o, a6, c) { var l, d, h6, f6, g6; if (c === void 0 && (c = /* @__PURE__ */ new Map()), r == null) return c; try { for (var p = ct(Object.keys(s)), u6 = p.next(); !u6.done; u6 = p.next()) { var y6 = u6.value, v6 = s[y6], m6 = this._fieldIds[y6], x6 = r.get(m6); if (x6 != null) { var w6 = x6.size, A6 = this._avgFieldLength[m6]; try { for (var M6 = (h6 = void 0, ct(x6.keys())), R6 = M6.next(); !R6.done; R6 = M6.next()) { var L6 = R6.value; if (!this._documentIds.has(L6)) { this.removeTerm(m6, L6, t), w6 -= 1; continue; } var T6 = o ? o(this._documentIds.get(L6), t, this._storedFields.get(L6)) : 1; if (T6) { var P6 = x6.get(L6), _6 = this._fieldLength.get(L6)[m6], S6 = R5(P6, w6, this._documentCount, _6, A6, a6), E6 = i * v6 * T6 * S6, C6 = c.get(L6); if (C6) { C6.score += E6, I5(C6.terms, e); var I6 = Dh(C6.match, t); I6 ? I6.push(y6) : C6.match[t] = [y6]; } else c.set(L6, { score: E6, terms: [e], match: (g6 = {}, g6[t] = [y6], g6) }); } } } catch (b6) { h6 = { error: b6 }; } finally { try { R6 && !R6.done && (f6 = M6.return) && f6.call(M6); } finally { if (h6) throw h6.error; } } } } } catch (b6) { l = { error: b6 }; } finally { try { u6 && !u6.done && (d = p.return) && d.call(p); } finally { if (l) throw l.error; } } return c; }, n.prototype.addTerm = function(e, t, i) { var r = this._index.fetch(i, Iv), s = r.get(e); if (s == null) s = /* @__PURE__ */ new Map(), s.set(t, 1), r.set(e, s); else { var o = s.get(t); s.set(t, (o || 0) + 1); } }, n.prototype.removeTerm = function(e, t, i) { if (!this._index.has(i)) { this.warnDocumentChanged(t, e, i); return; } var r = this._index.fetch(i, Iv), s = r.get(e); s == null || s.get(t) == null ? this.warnDocumentChanged(t, e, i) : s.get(t) <= 1 ? s.size <= 1 ? r.delete(e) : s.delete(t) : s.set(t, s.get(t) - 1), this._index.get(i).size === 0 && this._index.delete(i); }, n.prototype.warnDocumentChanged = function(e, t, i) { var r, s; try { for (var o = ct(Object.keys(this._fieldIds)), a6 = o.next(); !a6.done; a6 = o.next()) { var c = a6.value; if (this._fieldIds[c] === t) { this._options.logger("warn", "MiniSearch: document with ID ".concat(this._documentIds.get(e), ' has changed before removal: term "').concat(i, '" was not present in field "').concat(c, '". Removing a document after it has changed can corrupt the index!'), "version_conflict"); return; } } } catch (l) { r = { error: l }; } finally { try { a6 && !a6.done && (s = o.return) && s.call(o); } finally { if (r) throw r.error; } } }, n.prototype.addDocumentId = function(e) { var t = this._nextId; return this._idToShortId.set(e, t), this._documentIds.set(t, e), this._documentCount += 1, this._nextId += 1, t; }, n.prototype.addFields = function(e) { for (var t = 0; t < e.length; t++) this._fieldIds[e[t]] = t; }, n.prototype.addFieldLength = function(e, t, i, r) { var s = this._fieldLength.get(e); s == null && this._fieldLength.set(e, s = []), s[t] = r; var o = this._avgFieldLength[t] || 0, a6 = o * i + r; this._avgFieldLength[t] = a6 / (i + 1); }, n.prototype.removeFieldLength = function(e, t, i, r) { if (i === 1) { this._avgFieldLength[t] = 0; return; } var s = this._avgFieldLength[t] * i - r; this._avgFieldLength[t] = s / (i - 1); }, n.prototype.saveStoredFields = function(e, t) { var i, r, s = this._options, o = s.storeFields, a6 = s.extractField; if (!(o == null || o.length === 0)) { var c = this._storedFields.get(e); c == null && this._storedFields.set(e, c = {}); try { for (var l = ct(o), d = l.next(); !d.done; d = l.next()) { var h6 = d.value, f6 = a6(t, h6); f6 !== void 0 && (c[h6] = f6); } } catch (g6) { i = { error: g6 }; } finally { try { d && !d.done && (r = l.return) && r.call(l); } finally { if (i) throw i.error; } } } }, n.wildcard = Symbol("*"), n; }() ); var Dh = function(n, e) { return Object.prototype.hasOwnProperty.call(n, e) ? n[e] : void 0; }; var C5 = (_a = {}, _a[yp] = function(n, e) { var t, i; try { for (var r = ct(e.keys()), s = r.next(); !s.done; s = r.next()) { var o = s.value, a6 = n.get(o); if (a6 == null) n.set(o, e.get(o)); else { var c = e.get(o), l = c.score, d = c.terms, h6 = c.match; a6.score = a6.score + l, a6.match = Object.assign(a6.match, h6), Fv(a6.terms, d); } } } catch (f6) { t = { error: f6 }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } return n; }, _a[DM] = function(n, e) { var t, i, r = /* @__PURE__ */ new Map(); try { for (var s = ct(e.keys()), o = s.next(); !o.done; o = s.next()) { var a6 = o.value, c = n.get(a6); if (c != null) { var l = e.get(a6), d = l.score, h6 = l.terms, f6 = l.match; Fv(c.terms, h6), r.set(a6, { score: c.score + d, terms: c.terms, match: Object.assign(c.match, f6) }); } } } catch (g6) { t = { error: g6 }; } finally { try { o && !o.done && (i = s.return) && i.call(s); } finally { if (t) throw t.error; } } return r; }, _a[T5] = function(n, e) { var t, i; try { for (var r = ct(e.keys()), s = r.next(); !s.done; s = r.next()) { var o = s.value; n.delete(o); } } catch (a6) { t = { error: a6 }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } return n; }, _a); var L5 = { k: 1.2, b: 0.7, d: 0.5 }; var R5 = function(n, e, t, i, r, s) { var o = s.k, a6 = s.b, c = s.d, l = Math.log(1 + (t - e + 0.5) / (e + 0.5)); return l * (c + n * (o + 1) / (n + o * (1 - a6 + a6 * i / r))); }; var F5 = function(n) { return function(e, t, i) { var r = typeof n.fuzzy == "function" ? n.fuzzy(e, t, i) : n.fuzzy || false, s = typeof n.prefix == "function" ? n.prefix(e, t, i) : n.prefix === true; return { term: e, fuzzy: r, prefix: s }; }; }; var Nh = { idField: "id", extractField: function(n, e) { return n[e]; }, tokenize: function(n) { return n.split(O5); }, processTerm: function(n) { return n.toLowerCase(); }, fields: void 0, searchOptions: void 0, storeFields: [], logger: function(n, e) { typeof (console == null ? void 0 : console[n]) == "function" && console[n](e); }, autoVacuum: true }; var Rv = { combineWith: yp, prefix: false, fuzzy: false, maxFuzzy: 6, boost: {}, weights: { fuzzy: 0.45, prefix: 0.375 }, bm25: L5 }; var P5 = { combineWith: DM, prefix: function(n, e, t) { return e === t.length - 1; } }; var Bd = { batchSize: 1e3, batchWait: 10 }; var Ud = { minDirtFactor: 0.1, minDirtCount: 20 }; var Bh = _t(_t({}, Bd), Ud); var I5 = function(n, e) { n.includes(e) || n.push(e); }; var Fv = function(n, e) { var t, i; try { for (var r = ct(e), s = r.next(); !s.done; s = r.next()) { var o = s.value; n.includes(o) || n.push(o); } } catch (a6) { t = { error: a6 }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t) throw t.error; } } }; var Pv = function(n, e) { var t = n.score, i = e.score; return i - t; }; var Iv = function() { return /* @__PURE__ */ new Map(); }; var Ac = function(n) { var e, t, i = /* @__PURE__ */ new Map(); try { for (var r = ct(Object.keys(n)), s = r.next(); !s.done; s = r.next()) { var o = s.value; i.set(parseInt(o, 10), n[o]); } } catch (a6) { e = { error: a6 }; } finally { try { s && !s.done && (t = r.return) && t.call(r); } finally { if (e) throw e.error; } } return i; }; var O5 = /[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u; var D5 = class { constructor() { this._searchEngine = new E5({ fields: ["path", "name"], storeFields: ["path"], tokenize: (e, t) => e.split(/[\s/]+/) // indexing tokenizer }), this.idMaps = {}; } addZincObject(e, t) { const i = e.getRegion().getFullPath(); let r = e.groupName, s = i ? `${i}/${e.groupName}` : e.groupName; r = r.replaceAll('"', ""), s = s.replaceAll('"', ""); const o = { path: s, name: r, id: t }; this._searchEngine.add(o), this.idMaps[t] = { path: s, zincObject: e }; } removeZincObject(e, t) { const i = e.getRegion().getFullPath(); let r = e.groupName, s = i ? `${i}/${e.groupName}` : e.groupName; r = r.replaceAll('"', ""), s = s.replaceAll('"', ""); const o = { path: s, name: r, id: t }; this._searchEngine.remove(o), delete this.idMaps[t]; } addRegion(e, t) { let i = e.getFullPath(), r = e.getName(); i = i.replaceAll('"', ""), r = r.replaceAll('"', ""); const s = { path: i, name: r, id: t }; this._searchEngine.add(s), this.idMaps[t] = { path: i, zincObject: e }; } clearResults() { this._; } removeAll() { this._searchEngine.removeAll(), this.idMaps = {}; } auto_suggest(e) { let t = []; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), t = this._searchEngine.search(e, { prefix: true, combineWith: "AND" })) : e.length > 1 && (t = this._searchEngine.search(e, { prefix: true })); const i = []; t.forEach((o) => { o.id in this.idMaps && i.push(this.idMaps[o.id].path); }); const r = [...new Set(i)], s = []; return r.forEach((o) => s.push({ suggestion: '"' + o + '"' })), s; } processResults(e, t) { const i = { regionPath: void 0, label: 'Search Results for "' }; return Array.isArray(t) ? i.label += ",".join(t) : i.label += t, i.label += '"', e.length === 1 && (e[0].isRegion ? i.regionPath = e[0].getFullPath() : e[0].isZincObject && (i.regionPath = e[0].getRegion().getFullPath(), i.label = e[0].groupName)), i.zincObjects = H4(e), i; } search(e) { let t; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), t = this._searchEngine.search(e, { prefix: true, combineWith: "AND" })) : e.length > 1 && (t = this._searchEngine.search(e, { prefix: true })); const i = []; return t.forEach((r) => { r.id in this.idMaps && i.push(this.idMaps[r.id].zincObject); }), i; } searchTerms(e) { let t = []; return e.forEach((i) => { const r = this.search(i); t.push(...r); }), t; } searchAndProcessResult(e) { let t = []; return Array.isArray(e) ? t = this.searchTerms(e) : t = this.search(e), this.processResults(t, e); } }; var N5 = [ { id: 0, nerve_id: "ILX:0793723", label: "Auriculotemporal nerve", "FMA subclasses (in human nerves)": ["FMA:53002", "FMA:53001"], "subclass labels": ["Left auriculotemporal nerve", "Right auriculotemporal nerve"] }, { id: 1, nerve_id: "ILX:0792409", label: "gray communicating ramus of tenth thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6895", "FMA:6894"], "subclass labels": ["Left T10 grey ramus communicans", "Right T10 grey ramus communicans"] }, { id: 2, nerve_id: "UBERON:0011326", label: "superior laryngeal nerve", "FMA subclasses (in human nerves)": ["FMA:53530", "FMA:53536"], "subclass labels": ["Right superior laryngeal nerve", "Left superior laryngeal nerve"] }, { id: 3, nerve_id: "ILX:0793220", label: "white communicating ramus of first lumbar spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 4, nerve_id: "ILX:0787082", label: "gray communicating ramus of the first thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6082", "FMA:6084"], "subclass labels": ["Right T1 grey ramus communicans", "Left T1 grey ramus communicans"] }, { id: 5, nerve_id: "ILX:0793809", label: "Clitoral cavernous nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 6, nerve_id: "UBERON:0011096", label: "lacrimal nerve", "FMA subclasses (in human nerves)": ["FMA:52630", "FMA:52629"], "subclass labels": ["Left lacrimal nerve", "Right lacrimal nerve"] }, { id: 7, nerve_id: "ILX:0793215", label: "white communicating ramus of ninth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 8, nerve_id: "ILX:0795005", label: "Posterior cutaneous nerve of arm", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 9, nerve_id: "UBERON:0001649", label: "glossopharyngeal nerve", "FMA subclasses (in human nerves)": ["FMA:50894", "FMA:50892"], "subclass labels": [] }, { id: 10, nerve_id: "UBERON:0022302", label: "short ciliary nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 11, nerve_id: "ILX:0785932", label: "gray communicating ramus of third lumbar nerve", "FMA subclasses (in human nerves)": ["FMA:65920", "FMA:65919"], "subclass labels": ["Left L3 grey ramus communicans", "Right L3 grey ramus communicans"] }, { id: 12, nerve_id: "ILX:0738293", label: "Ganglioglomerular nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 13, nerve_id: "ILX:0739298", label: "gray communicating ramus of twelfth thoracic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 14, nerve_id: "UBERON:0001492", label: "radial nerve", "FMA subclasses (in human nerves)": ["FMA:37070", "FMA:37071"], "subclass labels": ["Right radial nerve", "Left radial nerve"] }, { id: 15, nerve_id: "ILX:0793214", label: "white communicating ramus of eighth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 16, nerve_id: "UBERON:0018681", label: "lesser splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6957", "FMA:6958"], "subclass labels": ["Right lesser splanchnic nerve", "Left lesser splanchnic nerve"] }, { id: 17, nerve_id: "ILX:0794476", label: "abdominal branch of vagus nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 18, nerve_id: "ILX:0791105", label: "gray communicating ramus of the second thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6122", "FMA:6757"], "subclass labels": ["Right T2 grey ramus communicans", "Left T2 grey ramus communicans"] }, { id: 19, nerve_id: "ILX:0794853", label: "esophageal vagus trunk", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 20, nerve_id: "ILX:0793210", label: "white communicating ramus of fourth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 21, nerve_id: "UBERON:0001759", label: "vagus nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 22, nerve_id: "UBERON:0009675", label: "chorda tympani branch of facial nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 23, nerve_id: "ILX:0794949", label: "recurrent branch of the median nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 24, nerve_id: "ILX:0789339", label: "Pharyngeal branch of glossopharyngeal nerve", "FMA subclasses (in human nerves)": ["FMA:53495", "FMA:53494"], "subclass labels": ["Pharyngeal branch of left glossopharyngeal nerve", "Pharyngeal branch of right glossopharyngeal nerve"] }, { id: 25, nerve_id: "ILX:0793712", label: "Zygomatic nerve", "FMA subclasses (in human nerves)": ["FMA:52968", "FMA:52969"], "subclass labels": ["Right zygomatic nerve", "Left zygomatic nerve"] }, { id: 26, nerve_id: "ILX:0788536", label: "gray communicating ramus of fourth lumbar nerve", "FMA subclasses (in human nerves)": ["FMA:65917", "FMA:65918"], "subclass labels": ["Right L4 grey ramus communicans", "Left L4 grey ramus communicans"] }, { id: 27, nerve_id: "UBERON:0018680", label: "greater splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6956", "FMA:6955"], "subclass labels": ["Right greater splanchnic nerve", "Left greater splanchnic nerve"] }, { id: 28, nerve_id: "UBERON:0001322", label: "sciatic nerve", "FMA subclasses (in human nerves)": ["FMA:22111", "FMA:22112"], "subclass labels": ["Right sciatic nerve", "Left sciatic nerve"] }, { id: 29, nerve_id: "ILX:0793209", label: "white communicating ramus of third thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 30, nerve_id: "UBERON:0011391", label: "perineal nerve", "FMA subclasses (in human nerves)": ["FMA:21874", "FMA:21873"], "subclass labels": ["Left perineal nerve", "Right perineal nerve"] }, { id: 31, nerve_id: "ILX:0788945", label: "gray communicating ramus of the fourth thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6759", "FMA:6758"], "subclass labels": ["Right T4 grey ramus communicans", "Left T4 grey ramus communicans"] }, { id: 32, nerve_id: "ILX:0790497", label: "Gray communicating ramus of cervicothoracic ganglion to first thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 33, nerve_id: "UBERON:0001323", label: "tibial nerve", "FMA subclasses (in human nerves)": ["FMA:22109", "FMA:22110"], "subclass labels": ["Right tibial nerve", "Left tibial nerve"] }, { id: 34, nerve_id: "ILX:0794969", label: "deep branch of ulnar nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 35, nerve_id: "ILX:0793227", label: "gray communicating ramus of thirteenth thoracic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 36, nerve_id: "ILX:0793228", label: "gray communicating ramus of first sacral nerve", "FMA subclasses (in human nerves)": ["FMA:65992", "FMA:65991"], "subclass labels": ["Left S1 grey ramus communicans", "Right S1 grey ramus communicans"] }, { id: 37, nerve_id: "UBERON:0035111", label: "medial plantar nerve", "FMA subclasses (in human nerves)": ["FMA:45435", "FMA:45434"], "subclass labels": ["Left medial plantar nerve", "Right medial plantar nerve"] }, { id: 38, nerve_id: "UBERON:0001780", label: "spinal nerve", "FMA subclasses (in human nerves)": ["FMA:6117", "FMA:6435", "FMA:6295", "FMA:6422", "FMA:6417", "FMA:6421", "FMA:6038", "FMA:6292", "FMA:6439", "FMA:6313", "FMA:6410", "FMA:6412", "FMA:6088", "FMA:6298", "FMA:6433", "FMA:6411", "FMA:6438", "FMA:6314", "FMA:6291", "FMA:6420", "FMA:6116", "FMA:6413", "FMA:6310", "FMA:6432", "FMA:6305", "FMA:6182", "FMA:6297", "FMA:6436", "FMA:6418", "FMA:6039", "FMA:6089", "FMA:6301", "FMA:6294", "FMA:6303", "FMA:6183", "FMA:6434", "FMA:6429", "FMA:6308", "FMA:6300", "FMA:6430", "FMA:6428", "FMA:6419", "FMA:6437", "FMA:6307", "FMA:6311", "FMA:6431"], "subclass labels": ["Left T3 spinal nerve", "Left S4 spinal nerve", "Left T5 spinal nerve", "Left L5 spinal nerve", "Right L3 spinal nerve", "Right L5 spinal nerve", "Right T1 spinal nerve", "Left T4 spinal nerve", "Left coccygeal spinal nerve", "Right T11 spinal nerve", "Right L1 spinal nerve", "Right L2 spinal nerve", "Right T2 spinal nerve", "Left T6 spinal nerve", "Left S3 spinal nerve", "Left L1 spinal nerve", "Right coccygeal spinal nerve", "Left T11 spinal nerve", "Right T4 spinal nerve", "Left L4 spinal nerve", "Right T3 spinal nerve", "Left L2 spinal nerve", "Right T10 spinal nerve", "Right S3 spinal nerve", "Left T8 spinal nerve", "Right T12 spinal nerve", "Right T6 spinal nerve", "Right S5 spinal nerve", "Left L3 spinal nerve", "Left T1 spinal nerve", "Left T2 spinal nerve", "Left T7 spinal nerve", "Right T5 spinal nerve", "Right T8 spinal nerve", "Left T12 spinal nerve", "Right S4 spinal nerve", "Left S1 spinal nerve", "Left T9 spinal nerve", "Right T7 spinal nerve", "Right S2 spinal nerve", "Right S1 spinal nerve", "Right L4 spinal nerve", "Left S5 spinal nerve", "Right T9 spinal nerve", "Left T10 spinal nerve", "Left S2 spinal nerve"] }, { id: 39, nerve_id: "UBERON:0018683", label: "lumbar splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6924", "FMA:6928", "FMA:6929", "FMA:6931", "FMA:6925", "FMA:6930", "FMA:6927", "FMA:6926"], "subclass labels": ["Right first lumbar splanchnic nerve", "Right third lumbar splanchnic nerve", "Left third lumbar splanchnic nerve", "Left fourth lumbar splanchnic nerve", "Left first lumbar splanchnic nerve", "Right fourth lumbar splanchnic nerve", "Left second lumbar splanchnic nerve", "Right second lumbar splanchnic nerve"] }, { id: 40, nerve_id: "UBERON:0001643", label: "oculomotor nerve", "FMA subclasses (in human nerves)": ["FMA:50880", "FMA:50879"], "subclass labels": ["Left oculomotor nerve", "Right oculomotor nerve"] }, { id: 41, nerve_id: "ILX:0793212", label: "white communicating ramus of sixth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 42, nerve_id: "UBERON:0003724", label: "musculocutaneous nerve", "FMA subclasses (in human nerves)": ["FMA:37066", "FMA:37065"], "subclass labels": ["Left musculocutaneous nerve", "Right musculocutaneous nerve"] }, { id: 43, nerve_id: "ILX:0738372", label: "white communicating ramus of first thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 44, nerve_id: "ILX:0793563", label: "splenic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 45, nerve_id: "UBERON:0035526", label: "superficial fibular nerve", "FMA subclasses (in human nerves)": ["FMA:45363", "FMA:45364"], "subclass labels": ["Right superficial fibular nerve", "Left superficial fibular nerve"] }, { id: 46, nerve_id: "ILX:0791560", label: "gray communicating ramus of eighth thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6891", "FMA:6890"], "subclass labels": ["Left T8 grey ramus communicans", "Right T8 grey ramus communicans"] }, { id: 47, nerve_id: "ILX:0793827", label: "posterior abdominal vagal trunk", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 48, nerve_id: "ILX:0794141", label: "right cervical vagus nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 49, nerve_id: "ILX:0793714", label: "Mesenteric nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 50, nerve_id: "UBERON:0001964", label: "least splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6960", "FMA:6959"], "subclass labels": ["Left least splanchnic nerve", "Right least splanchnic nerve"] }, { id: 51, nerve_id: "UBERON:0001267", label: "femoral nerve", "FMA subclasses (in human nerves)": ["FMA:16499", "FMA:16500"], "subclass labels": ["Right femoral nerve", "Left femoral nerve"] }, { id: 52, nerve_id: "UBERON:0034984", label: "nerve to quadratus femoris", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 53, nerve_id: "UBERON:0003721", label: "lingual nerve", "FMA subclasses (in human nerves)": ["FMA:53219", "FMA:53220"], "subclass labels": ["Right lingual nerve", "Left lingual nerve"] }, { id: 54, nerve_id: "UBERON:0036216", label: "tympanic nerve", "FMA subclasses (in human nerves)": ["FMA:53481", "FMA:53482"], "subclass labels": ["Right tympanic nerve", "Left tympanic nerve"] }, { id: 55, nerve_id: "ILX:0793216", label: "white communicating ramus of tenth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 56, nerve_id: "ILX:0793362", label: "White communicating ramus of fourth lumbar anterior ramus", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 57, nerve_id: "ILX:0793561", label: "Internal branch of superior laryngeal nerve", "FMA subclasses (in human nerves)": ["FMA:53539", "FMA:53540"], "subclass labels": ["Right internal laryngeal nerve", "Left internal laryngeal nerve"] }, { id: 58, nerve_id: "ILX:0738312", label: "Aortic arch depressor nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 59, nerve_id: "ILX:0793218", label: "white communicating ramus of twelfth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 60, nerve_id: "ILX:0738308", label: "External branch of inferior laryngeal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 61, nerve_id: "ILX:0739299", label: "gray communicating ramus of sixth lumbar nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 62, nerve_id: "ILX:0793559", label: "bladder nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 63, nerve_id: "ILX:0793822", label: "Superior ovarian nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 64, nerve_id: "ILX:0793807", label: "Penile cavernous nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 65, nerve_id: "UBERON:0011390", label: "pudendal nerve", "FMA subclasses (in human nerves)": ["FMA:21863", "FMA:21864"], "subclass labels": ["Right pudendal nerve", "Left pudendal nerve"] }, { id: 66, nerve_id: "UBERON:0008810", label: "nasopalatine nerve", "FMA subclasses (in human nerves)": ["FMA:52799", "FMA:52798"], "subclass labels": ["Left nasopalatine nerve", "Right nasopalatine nerve"] }, { id: 67, nerve_id: "ILX:0793219", label: "white communicating ramus of thirteenth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 68, nerve_id: "ILX:0793632", label: "lumbar colonic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 69, nerve_id: "ILX:0784439", label: "gray communicating ramus of the fifth thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6760", "FMA:6761"], "subclass labels": ["Left T5 grey ramus communicans", "Right T5 grey ramus communicans"] }, { id: 70, nerve_id: "ILX:0794977", label: "deep branch of radial nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 71, nerve_id: "UBERON:0001884", label: "phrenic nerve", "FMA subclasses (in human nerves)": ["FMA:6193", "FMA:6192"], "subclass labels": ["Left phrenic nerve", "Right phrenic nerve"] }, { id: 72, nerve_id: "UBERON:0035110", label: "lateral plantar nerve", "FMA subclasses (in human nerves)": ["FMA:45450", "FMA:45451"], "subclass labels": ["Right lateral plantar nerve", "Left lateral plantar nerve"] }, { id: 73, nerve_id: "ILX:0793711", label: "Communicating branch of zygomatic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 74, nerve_id: "ILX:0793560", label: "External branch of superior laryngeal nerve", "FMA subclasses (in human nerves)": ["FMA:53537", "FMA:53538"], "subclass labels": ["Right external laryngeal nerve", "Left external laryngeal nerve"] }, { id: 75, nerve_id: "ILX:0738309", label: "Internal branch of inferior laryngeal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 76, nerve_id: "UBERON:0001021", label: "nerve", "FMA subclasses (in human nerves)": ["FMA:6775", "FMA:6894", "FMA:6784", "FMA:6728", "FMA:65325", "FMA:21873", "FMA:45429", "FMA:6844", "FMA:53609", "FMA:7116", "FMA:44770", "FMA:8916", "FMA:52995", "FMA:6071", "FMA:45309", "FMA:6122", "FMA:6892", "FMA:6767", "FMA:16405", "FMA:53560", "FMA:6092", "FMA:65343", "FMA:37066", "FMA:8894", "FMA:8868", "FMA:65341", "FMA:53559", "FMA:8897", "FMA:82956", "FMA:20633", "FMA:6763", "FMA:65339", "FMA:8829", "FMA:16493", "FMA:8817", "FMA:8821", "FMA:11757", "FMA:45456", "FMA:45422", "FMA:11261", "FMA:65388", "FMA:6192", "FMA:65347", "FMA:37068", "FMA:65995", "FMA:6764", "FMA:39081", "FMA:45338", "FMA:53402", "FMA:11210", "FMA:52644", "FMA:37067", "FMA:65313", "FMA:11153", "FMA:6155", "FMA:8797", "FMA:53302", "FMA:8883", "FMA:53067", "FMA:52939", "FMA:53301", "FMA:292889", "FMA:45423", "FMA:8791", "FMA:45380", "FMA:11759", "FMA:7305", "FMA:8830", "FMA:78650", "FMA:65389", "FMA:45387", "FMA:8827", "FMA:8912", "FMA:52941", "FMA:6743", "FMA:7126", "FMA:53485", "FMA:16492", "FMA:53399", "FMA:65337", "FMA:11209", "FMA:6772", "FMA:52726", "FMA:6121", "FMA:52627", "FMA:52974", "FMA:53571", "FMA:6729", "FMA:8729", "FMA:53606", "FMA:80025", "FMA:53481", "FMA:53575", "FMA:45451", "FMA:11218", "FMA:22109", "FMA:6852", "FMA:8909", "FMA:11751", "FMA:65991", "FMA:8836", "FMA:65350", "FMA:53423", "FMA:65569", "FMA:65314", "FMA:82957", "FMA:65438", "FMA:39146", "FMA:8911", "FMA:22111", "FMA:65916", "FMA:65739", "FMA:65917", "FMA:6779", "FMA:8889", "FMA:65924", "FMA:65316", "FMA:53002", "FMA:16887", "FMA:53366", "FMA:6890", "FMA:8790", "FMA:6730", "FMA:45358", "FMA:52716", "FMA:53494", "FMA:7115", "FMA:53561", "FMA:78655", "FMA:45366", "FMA:11219", "FMA:11555", "FMA:7092", "FMA:53220", "FMA:45428", "FMA:6193", "FMA:20604", "FMA:45433", "FMA:21874", "FMA:21875", "FMA:53244", "FMA:45432", "FMA:6770", "FMA:52640", "FMA:11249", "FMA:20630", "FMA:53308", "FMA:11216", "FMA:65399", "FMA:78649", "FMA:11084", "FMA:6897", "FMA:53633", "FMA:6085", "FMA:6851", "FMA:45457", "FMA:6757", "FMA:8732", "FMA:8824", "FMA:20632", "FMA:6137", "FMA:52730", "FMA:7301", "FMA:52699", "FMA:53607", "FMA:7300", "FMA:53576", "FMA:44904", "FMA:65342", "FMA:7127", "FMA:6737", "FMA:52669", "FMA:21876", "FMA:45425", "FMA:65999", "FMA:8728", "FMA:21871", "FMA:55172", "FMA:6149", "FMA:45453", "FMA:44932", "FMA:292832", "FMA:6744", "FMA:6781", "FMA:44769", "FMA:45326", "FMA:6760", "FMA:53634", "FMA:53605", "FMA:53530", "FMA:6821", "FMA:52968", "FMA:53001", "FMA:11552", "FMA:45264", "FMA:8835", "FMA:6888", "FMA:55160", "FMA:44899", "FMA:52979", "FMA:45333", "FMA:45310", "FMA:6084", "FMA:11781", "FMA:82962", "FMA:53280", "FMA:52715", "FMA:53311", "FMA:16491", "FMA:21880", "FMA:44952", "FMA:11687", "FMA:11212", "FMA:65335", "FMA:52940", "FMA:6774", "FMA:8823", "FMA:45388", "FMA:6666", "FMA:6072", "FMA:16886", "FMA:53312", "FMA:65915", "FMA:45357", "FMA:11262", "FMA:65921", "FMA:0328826", "FMA:81290", "FMA:53279", "FMA:11551", "FMA:7293", "FMA:6677", "FMA:11756", "FMA:53598", "FMA:52732", "FMA:44902", "FMA:53545", "FMA:6740", "FMA:53502", "FMA:53562", "FMA:52700", "FMA:7122", "FMA:6118", "FMA:65918", "FMA:8814", "FMA:16403", "FMA:65346", "FMA:6667", "FMA:52630", "FMA:52629", "FMA:8871", "FMA:16500", "FMA:52725", "FMA:6108", "FMA:45363", "FMA:65340", "FMA:8872", "FMA:11760", "FMA:53604", "FMA:11214", "FMA:52777", "FMA:21864", "FMA:53503", "FMA:6738", "FMA:66000", "FMA:6776", "FMA:6777", "FMA:6765", "FMA:6111", "FMA:8890", "FMA:20607", "FMA:52643", "FMA:8908", "FMA:65437", "FMA:6762", "FMA:11154", "FMA:65344", "FMA:52937", "FMA:8919", "FMA:45354", "FMA:6766", "FMA:53424", "FMA:6145", "FMA:65568", "FMA:20634", "FMA:6732", "FMA:8893", "FMA:11758", "FMA:6889", "FMA:11554", "FMA:65922", "FMA:7118", "FMA:16884", "FMA:45308", "FMA:7290", "FMA:6758", "FMA:65743", "FMA:11063", "FMA:16885", "FMA:8882", "FMA:65286", "FMA:291238", "FMA:53482", "FMA:52976", "FMA:11308", "FMA:53432", "FMA:53540", "FMA:45379", "FMA:44871", "FMA:6714", "FMA:82955", "FMA:65993", "FMA:45452", "FMA:52626", "FMA:6083", "FMA:53582", "FMA:65919", "FMA:52936", "FMA:53506", "FMA:8918", "FMA:44901", "FMA:6073", "FMA:65315", "FMA:53219", "FMA:11194", "FMA:6792", "FMA:7119", "FMA:52785", "FMA:7296", "FMA:53068", "FMA:6845", "FMA:52677", "FMA:53504", "FMA:53548", "FMA:52698", "FMA:53570", "FMA:6771", "FMA:7078", "FMA:65997", "FMA:65338", "FMA:52969", "FMA:16401", "FMA:65416", "FMA:6835", "FMA:39082", "FMA:8726", "FMA:45254", "FMA:8879", "FMA:11250", "FMA:53049", "FMA:45382", "FMA:8795", "FMA:53495", "FMA:45434", "FMA:82963", "FMA:0328827", "FMA:52656", "FMA:82961", "FMA:11753", "FMA:39147", "FMA:45339", "FMA:20605", "FMA:20631", "FMA:8898", "FMA:6070", "FMA:44892", "FMA:16404", "FMA:52942", "FMA:6082", "FMA:8861", "FMA:82953", "FMA:8808", "FMA:8805", "FMA:52994", "FMA:65348", "FMA:55173", "FMA:7129", "FMA:52674", "FMA:44894", "FMA:55159", "FMA:65327", "FMA:37320", "FMA:6761", "FMA:65349", "FMA:11253", "FMA:53507", "FMA:11213", "FMA:7307", "FMA:6769", "FMA:6759", "FMA:55155", "FMA:53675", "FMA:53599", "FMA:65282", "FMA:53251", "FMA:6731", "FMA:11111", "FMA:16497", "FMA:8878", "FMA:11211", "FMA:65740", "FMA:45367", "FMA:53588", "FMA:45365", "UBERON:0011766", "FMA:16502", "FMA:6891", "FMA:6091", "FMA:11018", "FMA:6090", "FMA:292887", "FMA:65401", "FMA:65326", "FMA:11215", "FMA:44735", "FMA:8735", "FMA:53538", "FMA:6849", "FMA:53608", "FMA:11217", "FMA:8860", "FMA:6134", "FMA:6893", "FMA:53534", "FMA:45361", "FMA:37321", "FMA:82734", "FMA:22112", "FMA:7294", "FMA:52987", "FMA:65247", "FMA:53535", "FMA:6895", "FMA:52787", "FMA:53635", "FMA:65920", "FMA:55156", "FMA:16498", "FMA:53569", "FMA:6739", "FMA:8807", "FMA:22110", "FMA:81294", "FMA:45450", "FMA:8922", "FMA:8725", "FMA:20608", "FMA:7308", "FMA:65281", "FMA:39084", "FMA:78656", "FMA:6133", "FMA:53581", "FMA:16494", "FMA:53252", "FMA:11789", "FMA:45364", "FMA:65345", "FMA:44870", "FMA:39083", "FMA:45355", "FMA:11193", "FMA:16400", "FMA:81287", "FMA:52776", "FMA:65747", "FMA:8900", "UBERON:0011767", "FMA:45424", "FMA:292830", "FMA:44734", "FMA:45381", "FMA:82960", "FMA:0328831", "FMA:6689", "FMA:7077", "FMA:291236", "FMA:8886", "FMA:276381", "FMA:6124", "FMA:65336", "FMA:65328", "FMA:52670", "FMA:53537", "FMA:53636", "FMA:6896", "FMA:21879", "FMA:8798", "FMA:81288", "FMA:53542", "FMA:45368", "FMA:53547", "FMA:55157", "FMA:65415", "FMA:53309", "FMA:65744", "FMA:53367", "FMA:53590", "FMA:65923", "FMA:53048", "FMA:16499", "FMA:53610", "FMA:44951", "FMA:44953", "FMA:8832", "FMA:45426", "FMA:6114", "FMA:52799", "FMA:11039", "FMA:53546", "FMA:53589", "FMA:8901", "FMA:11681", "FMA:52639", "FMA:8905", "FMA:52733", "FMA:65992", "FMA:52807", "FMA:45435", "FMA:53484", "FMA:52975", "FMA:7289", "FMA:44905", "FMA:37071", "FMA:7130", "FMA:65996", "FMA:6132", "FMA:8826", "FMA:6741", "FMA:11252", "FMA:8917", "FMA:82954", "FMA:6832", "FMA:37073", "FMA:37074", "FMA:44893", "FMA:82959", "FMA:20635", "FMA:6093", "FMA:65248", "FMA:45362", "FMA:52622", "FMA:53508", "FMA:11755", "FMA:82958", "FMA:52997", "FMA:16501", "FMA:65402", "FMA:45427", "FMA:52803", "FMA:16402", "FMA:8734", "FMA:52784", "FMA:45454", "FMA:6736", "FMA:7304", "FMA:6742", "FMA:52998", "FMA:52804", "FMA:11788", "FMA:6713", "FMA:52623", "FMA:53536", "FMA:11780", "FMA:45334", "FMA:52701", "FMA:65998", "FMA:11092", "FMA:6684", "FMA:52779", "FMA:52778", "FMA:78652", "FMA:0328830", "FMA:6733", "FMA:44950", "FMA:78653", "FMA:45455", "FMA:8864", "FMA:8833", "FMA:8876", "FMA:8867", "FMA:11752", "FMA:53541", "FMA:53611", "FMA:8904", "FMA:6745", "FMA:21863", "FMA:7297", "FMA:52676", "FMA:52798", "FMA:8818", "FMA:82735", "FMA:52657", "FMA:52786", "FMA:6773", "FMA:45253", "FMA:6127", "FMA:45263", "FMA:8875", "FMA:81295", "FMA:11754", "FMA:8812", "FMA:45311", "FMA:53568", "FMA:276379", "FMA:6842", "FMA:8794", "FMA:8820", "FMA:53572", "FMA:53409", "FMA:37070", "FMA:6119", "FMA:53433", "FMA:7123", "FMA:8811", "FMA:65444", "FMA:52806", "FMA:53245", "FMA:65285", "FMA:6768", "FMA:8731", "FMA:11220", "FMA:6778", "FMA:53509", "FMA:55158", "FMA:53567", "FMA:65994", "FMA:53539", "FMA:45327", "FMA:8865", "FMA:44898", "FMA:52673", "FMA:80026", "FMA:52980", "FMA:53505", "FMA:82952", "FMA:21872", "FMA:37065", "FMA:52988", "FMA:8815", "FMA:53398", "FMA:52729", "FMA:81289", "FMA:65398", "FMA:52977", "FMA:8887"], "subclass labels": ["Left T9 white ramus communicans", "Right T10 grey ramus communicans", "Right T4 spinal nerve posterior ramus", "Right fourth intercostal nerve", "Right anterior interosseous nerve", "Right perineal nerve", "Left lateral calcaneal branch A of left sural nerve", "Right C3 spinal nerve posterior ramus medial branch", "Oesophageal branch of left recurrent laryngeal nerve", "Anterior branch of lateral cutaneous branch of left third intercostal nerve", "Left common plantar digital nerve F", "Anterior cutaneous branch of right subcostal nerve", "Left superior labial branch of infraorbital nerve", "Left T1 spinal nerve posterior ramus", "Anterior branch of left obturator nerve", "Right T2 grey ramus communicans", "Right T9 grey ramus communicans", "Left T5 white ramus communicans", "Left L3 spinal nerve posterior ramus lateral branch", "Communicating branch of left vagus nerve with left glossopharyngeal nerve", "Right second intercostal nerve", "Right proper palmar digital nerve G", "Left musculocutaneous nerve", "Anterior cutaneous branch of left ninth intercostal nerve", "Posterior branch of lateral cutaneous branch of left sixth intercostal nerve", "Right proper palmar digital nerve H", "Communicating branch of right vagus nerve with right glossopharyngeal nerve", "Anterior branch of lateral cutaneous branch of right ninth intercostal nerve", "Right proper plantar digital nerve C", "Left genital branch of genitofemoral nerve", "Left T6 grey ramus communicans", "Right proper palmar digital nerve I", "Right T12 spinal nerve posterior ramus", "Right ilioinguinal nerve", "Right T8 spinal nerve posterior ramus", "Left T9 spinal nerve posterior ramus", "Right T11 spinal nerve posterior ramus lateral branch", "Right proper plantar digital nerve J", "Right medial sural cutaneous nerve", "Right T6 spinal nerve posterior ramus medial branch", "Right lesser occipital nerve", "Right phrenic nerve", "Right proper palmar digital nerve E", "Left median nerve", "Right S3 grey ramus communicans", "Right T4 white ramus communicans", "Right medial cutaneous nerve of forearm", "Right posterior femoral cutaneous nerve", "Right vestibular nerve", "Lateral cutaneous branch of left sixth intercostal nerve", "Left supratrochlear nerve", "Right median nerve", "Anterior branch of right medial cutaneous nerve of forearm", "Right T5 spinal nerve posterior ramus medial branch", "Anterior cutaneous branch of right third intercostal nerve", "Right C6 spinal nerve posterior ramus", "Temporal branch of left facial nerve", "Anterior cutaneous branch of left eighth intercostal nerve", "Right buccal nerve", "Right middle superior alveolar nerve", "Temporal branch of right facial nerve", "Left superficial branch of radial nerve", "Left medial sural cutaneous nerve", "Left C4 spinal nerve posterior ramus", "Left lateral dorsal digital nerve of the third toe", "Right T12 spinal nerve posterior ramus lateral branch", "Anterior branch of lateral cutaneous branch of left eleventh intercostal nerve", "Left T12 spinal nerve posterior ramus", "Left anterior supraclavicular nerve", "Left lesser occipital nerve", "Right deep fibular nerve", "Left T11 spinal nerve posterior ramus", "Posterior branch of lateral cutaneous branch of left tenth intercostal nerve", "Right anterior superior alveolar nerve", "Left tenth intercostal nerve", "Anterior branch of lateral cutaneous branch of right fourth intercostal nerve", "Communicating branch of left glossopharyngeal nerve with auricular branch of left vagus nerve", "Left iliohypogastric nerve", "Cervical branch of left facial nerve", "Right proper palmar digital nerve J", "Lateral cutaneous branch of right sixth intercostal nerve", "Right T8 white ramus communicans", "Left maxillary nerve", "Left intercostobrachial nerve", "Left tentorial nerve", "Right zygomaticotemporal nerve", "Communicating branch of right internal laryngeal nerve with right recurrent laryngeal nerve", "Left fourth intercostal nerve", "Brachial plexus left C7 root", "Vagal branch to right carotid body", "Right proper plantar digital nerve G", "Right tympanic nerve", "Left lateral plantar nerve", "Lateral cutaneous branch of left tenth intercostal nerve", "Right tibial nerve", "Left third occipital nerve", "Anterior branch of lateral cutaneous branch of left tenth intercostal nerve", "Right T8 spinal nerve posterior ramus lateral branch", "Right S1 grey ramus communicans", "Left L3 spinal nerve posterior ramus", "Palmar cutaneous branch of left ulnar nerve", "Right greater petrosal nerve", "Left subcostal nerve", "Anterior branch of left medial cutaneous nerve of forearm", "Left proper plantar digital nerve C", "Left C3 spinal nerve branch to left supraclavicular nerve", "Right posterior cutaneous nerve of forearm", "Posterior branch of lateral cutaneous branch of right tenth intercostal nerve", "Right sciatic nerve", "Left L5 grey ramus communicans", "Right C4 spinal nerve posterior ramus medial branch", "Right L4 grey ramus communicans", "Left T11 white ramus communicans", "Posterior branch of lateral cutaneous branch of right eighth intercostal nerve", "Left L1 grey ramus communicans", "Posterior branch of left medial cutaneous nerve of forearm", "Left auriculotemporal nerve", "Left L2 white ramus communicans", "Marginal mandibular branch of right facial nerve", "Right T8 grey ramus communicans", "Right C4 spinal nerve posterior ramus", "Right fifth intercostal nerve", "Left common fibular nerve", "Left posterior ethmoidal nerve", "Pharyngeal branch of right glossopharyngeal nerve", "Anterior branch of lateral cutaneous branch of right third intercostal nerve", "Communicating branch of right external laryngeal nerve with right superior cardiac nerve", "Right posterior supraclavicular nerve", "Left medial dorsal cutaneous nerve", "Lateral cutaneous branch of right eleventh intercostal nerve", "Posterior branch of lateral cutaneous branch of left subcostal nerve", "Anterior cutaneous branch of left second intercostal nerve", "Left lingual nerve", "Right lateral calcaneal branch A of right sural nerve", "Left phrenic nerve", "Right hypogastric nerve", "Medial calcaneal branch A of left tibial nerve", "Left perineal nerve", "Right posterior scrotal nerve", "Right inferior alveolar nerve", "Medial calcaneal branch A of right tibial nerve", "Right T7 white ramus communicans", "Left frontal nerve", "Right T1 spinal nerve posterior ramus medial branch", "Right genitofemoral nerve", "Zygomatic branch of right facial nerve", "Lateral cutaneous branch of left ninth intercostal nerve", "Left C2 spinal nerve branch to left great auricular nerve", "Right anterior supraclavicular nerve", "Lateral cutaneous branch of right fourth intercostal nerve", "Left T11 grey ramus communicans", "Lingual branch of right vagus nerve", "Left T1 white ramus communicans", "Left C3 spinal nerve posterior ramus medial branch", "Left proper plantar digital nerve J", "Left T2 grey ramus communicans", "Brachial plexus left C6 root", "Left T10 spinal nerve posterior ramus", "Right genital branch of genitofemoral nerve", "Anterior cutaneous branch of right first intercostal nerve", "Left middle meningeal nerve", "Anterior cutaneous branch of left eleventh intercostal nerve", "Left infratrochlear nerve", "Vagal branch to left carotid body", "Anterior cutaneous branch of right eleventh intercostal nerve", "Right proper palmar digital nerve B", "Left proper palmar digital nerve H", "Anterior branch of lateral cutaneous branch of left fourth intercostal nerve", "Left seventh intercostal nerve", "Right nasociliary nerve", "Left posterior scrotal nerve", "Left sural nerve", "Right S5 grey ramus communicans", "Brachial plexus right C7 root", "Right inferior rectal nerve", "Right transverse cervical nerve", "Anterior cutaneous branch of left third intercostal nerve", "Left proper plantar digital nerve H", "Superficial branch of left ulnar nerve", "Dorsal branch of left ulnar nerve", "Right eleventh intercostal nerve", "Right T2 white ramus communicans", "Right common plantar digital nerve F", "Infrapatellar branch of right saphenous nerve", "Left T5 grey ramus communicans", "Lingual branch of left vagus nerve", "Thoracic cardiac branch of left vagus nerve", "Right superior laryngeal nerve", "Right C2 spinal nerve posterior ramus", "Right zygomatic nerve", "Right auriculotemporal nerve", "Anterior branch of lateral cutaneous branch of left subcostal nerve", "Left saphenous nerve", "Right L3 spinal nerve posterior ramus", "Right T7 grey ramus communicans", "Left great auricular nerve posterior branch", "Left proper palmar digital nerve A", "Right infraorbital nerve", "Cutaneous branch of right obturator nerve", "Posterior branch of right obturator nerve", "Left T1 grey ramus communicans", "Right T12 white ramus communicans", "Right proper plantar digital nerve F", "Left posterior auricular nerve", "Right posterior ethmoidal nerve", "Buccal branch of right facial nerve", "Right iliohypogastric nerve", "Left dorsal nerve of penis", "Right inferior lateral cutaneous nerve of arm", "Left T7 spinal nerve posterior ramus lateral branch", "Lateral cutaneous branch of left seventh intercostal nerve", "Right posterior interosseous nerve", "Left middle superior alveolar nerve", "Right T9 white ramus communicans", "Right T10 spinal nerve posterior ramus", "Left deep fibular nerve", "Hepatic branch of anterior vagal trunk", "Left first intercostal nerve", "Right L2 white ramus communicans", "Buccal branch of left facial nerve", "Right L5 grey ramus communicans", "Right common fibular nerve", "Left T6 spinal nerve posterior ramus medial branch", "Right L2 grey ramus communicans", "Right deep petrosal nerve", "Left axillary nerve posterior branch", "Right posterior auricular nerve", "Anterior branch of lateral cutaneous branch of right subcostal nerve", "Anterior branch of lateral cutaneous branch of right fifth intercostal nerve", "Pyloric branch of greater posterior gastric nerve", "Left T10 spinal nerve posterior ramus lateral branch", "Superior cervical cardiac branch of right vagus nerve", "Ganglionic branch of right maxillary nerve to pterygopalatine ganglion", "Left proper palmar digital nerve C", "Right superior cervical cardiac nerve", "Right ninth intercostal nerve", "Right lesser petrosal nerve", "Communicating branch of left external laryngeal nerve with left superior cardiac nerve", "Right long ciliary nerve B", "Anterior cutaneous branch of right fourth intercostal nerve", "Right third intercostal nerve", "Left L4 grey ramus communicans", "Right T7 spinal nerve posterior ramus", "Left L2 spinal nerve posterior ramus lateral branch", "Left proper palmar digital nerve F", "Coeliac branch of posterior vagal trunk", "Left lacrimal nerve", "Right lacrimal nerve", "Anterior cutaneous branch of right seventh intercostal nerve", "Left femoral nerve", "Right maxillary nerve", "Lateral cutaneous branch of right third intercostal nerve", "Right superficial fibular nerve", "Left proper palmar digital nerve I", "Anterior cutaneous branch of left seventh intercostal nerve", "Left T12 spinal nerve posterior ramus lateral branch", "Thoracic cardiac branch of right vagus nerve", "Lateral cutaneous branch of left eighth intercostal nerve", "Orbital branch of left maxillary nerve to left ethmoidal sinus", "Left pudendal nerve", "Left lesser petrosal nerve", "Right eighth intercostal nerve", "Left S5 grey ramus communicans", "Right T10 white ramus communicans", "Left T10 white ramus communicans", "Left T4 white ramus communicans", "Lateral cutaneous branch of left third intercostal nerve", "Posterior branch of lateral cutaneous branch of left eighth intercostal nerve", "Lateral cutaneous branch of right iliohypogastric nerve", "Right supratrochlear nerve", "Anterior branch of lateral cutaneous branch of right tenth intercostal nerve", "Right C3 spinal nerve branch to right supraclavicular nerve", "Right T6 grey ramus communicans", "Left T5 spinal nerve posterior ramus medial branch", "Left proper palmar digital nerve G", "Left posterior superior alveolar nerve", "Lateral cutaneous branch of left subcostal nerve", "Gluteal branch A of right posterior femoral cutaneous nerve", "Right T5 white ramus communicans", "Left greater petrosal nerve", "Left T3 spinal nerve posterior ramus", "Right subcostal nerve", "Right femoral branch of genitofemoral nerve", "Right sixth intercostal nerve", "Anterior cutaneous branch of right ninth intercostal nerve", "Left T11 spinal nerve posterior ramus lateral branch", "Left T7 grey ramus communicans", "Posterior branch of lateral cutaneous branch of right subcostal nerve", "Left L2 grey ramus communicans", "Posterior branch of lateral cutaneous branch of right third intercostal nerve", "Right L1 white ramus communicans", "Anterior branch of right obturator nerve", "Anterior cutaneous branch of left fifth intercostal nerve", "Left T4 grey ramus communicans", "Right C5 spinal nerve posterior ramus medial branch", "Right T4 spinal nerve posterior ramus medial branch", "Left L1 white ramus communicans", "Anterior cutaneous branch of right eighth intercostal nerve", "Left subclavian nerve", "Pericardial branch of left phrenic nerve", "Left tympanic nerve", "Right zygomaticofacial nerve", "Right intercostobrachial nerve", "Right cochlear nerve", "Left internal laryngeal nerve", "Right lateral dorsal digital nerve of the third toe", "Left proper palmar digital nerve D", "Inferior cervical cardiac branch of left vagus nerve", "Left proper plantar digital nerve B", "Right S2 grey ramus communicans", "Right proper plantar digital nerve H", "Right tentorial nerve", "Right T1 white ramus communicans", "Inferior ramus of left internal laryngeal nerve", "Right L3 grey ramus communicans", "Right posterior superior alveolar nerve", "Tonsillar branch of right glossopharyngeal nerve", "Lateral cutaneous branch of right subcostal nerve", "Right proper palmar digital nerve C", "Right first intercostal nerve", "Posterior branch of right medial cutaneous nerve of forearm", "Right lingual nerve", "Lateral cutaneous branch of right fifth intercostal nerve", "Left T4 spinal nerve posterior ramus", "Posterior branch of lateral cutaneous branch of left third intercostal nerve", "Right posterior superior lateral nasal branch of maxillary nerve", "Posterior branch of lateral cutaneous branch of right fifth intercostal nerve", "Left buccal nerve", "Right third occipital nerve", "Left anterior ethmoidal nerve", "Right lingual branch of glossopharyngeal nerve", "Left laryngopharyngeal branch of superior cervical ganglion", "Right infratrochlear nerve", "Left external laryngeal nerve branch to pharyngeal plexus", "Left T7 white ramus communicans", "Left L1 spinal nerve posterior ramus", "Right S4 grey ramus communicans", "Left proper palmar digital nerve J", "Left zygomatic nerve", "Left L1 spinal nerve posterior ramus lateral branch", "Left greater occipital nerve", "Left medial cutaneous nerve of forearm", "Brachial plexus left C8 root", "Left anterior femoral cutaneous branch A", "Posterior branch of lateral cutaneous branch of left seventh intercostal nerve", "Left T1 spinal nerve posterior ramus medial branch", "Left meningeal branch of mandibular nerve", "Left medial dorsal digital nerve of the fourth toe", "Left C5 spinal nerve posterior ramus", "Pharyngeal branch of left glossopharyngeal nerve", "Right medial plantar nerve", "Left proper plantar digital nerve F", "Left deep petrosal nerve", "Right supraorbital nerve", "Left proper plantar digital nerve E", "Right T9 spinal nerve posterior ramus lateral branch", "Left posterior cutaneous nerve of forearm", "Left posterior femoral cutaneous nerve", "Left hypogastric nerve", "Left genitofemoral nerve", "Anterior branch of lateral cutaneous branch of left ninth intercostal nerve", "Right T1 spinal nerve posterior ramus", "Right common palmar digital nerve A", "Right L3 spinal nerve posterior ramus lateral branch", "Left anterior superior alveolar nerve", "Right T1 grey ramus communicans", "Anterior cutaneous branch of left sixth intercostal nerve", "Left proper plantar digital nerve A", "Left T5 spinal nerve posterior ramus", "Right T3 spinal nerve posterior ramus", "Right superior labial branch of infraorbital nerve", "Left proper palmar digital nerve E", "Left transverse cervical nerve", "Posterior branch of lateral cutaneous branch of right fourth intercostal nerve", "Left communicating branch of nasociliary nerve with ciliary ganglion", "Superficial branch of right ulnar nerve", "Right great auricular nerve posterior branch", "Palmar branch of right median nerve", "Right ulnar nerve", "Right T5 grey ramus communicans", "Palmar cutaneous branch of right ulnar nerve", "Left T2 spinal nerve posterior ramus medial branch", "Tonsillar branch of left glossopharyngeal nerve", "Lateral cutaneous branch of right eighth intercostal nerve", "Posterior branch of lateral cutaneous branch of right eleventh intercostal nerve", "Left T6 white ramus communicans", "Right T4 grey ramus communicans", "Branch of right vagus nerve to oesophageal nerve plexus", "Superior cervical cardiac branch of left vagus nerve", "Left long thoracic nerve", "Right mental nerve", "Left fifth intercostal nerve", "Lateral cutaneous branch of left fourth intercostal nerve", "Right lateral femoral cutaneous nerve", "Posterior branch of lateral cutaneous branch of right seventh intercostal nerve", "Lateral cutaneous branch of right seventh intercostal nerve", "Left C4 spinal nerve posterior ramus medial branch", "Right intermediate dorsal cutaneous nerve", "Right medial dorsal cutaneous nerve", "Left recurrent laryngeal nerve", "Left obturator nerve", "Left T8 grey ramus communicans", "Right T2 spinal nerve posterior ramus", "Right T3 spinal nerve posterior ramus medial branch", "Left T2 spinal nerve posterior ramus", "Right superficial branch of radial nerve", "Right C3 spinal nerve branch to right great auricular nerve", "Left anterior interosseous nerve", "Lateral cutaneous branch of right ninth intercostal nerve", "Left common plantar digital nerve E", "Brachial plexus left C5 root", "Left external laryngeal nerve", "Left C3 spinal nerve posterior ramus", "Oesophageal branch of right recurrent laryngeal nerve", "Lateral cutaneous branch of right tenth intercostal nerve", "Anterior cutaneous branch of right sixth intercostal nerve", "Right T3 white ramus communicans", "Left T9 grey ramus communicans", "Auricular branch of right vagus nerve", "Right lateral sural cutaneous nerve", "Left ulnar nerve", "Right long ciliary nerve A", "Left sciatic nerve", "Anterior branch of lateral cutaneous branch of left fifth intercostal nerve", "Right inferior palpebral branch of infraorbital nerve", "Right medial cutaneous nerve of arm", "Auricular branch of left vagus nerve", "Left T10 grey ramus communicans", "Left medial posterior superior nasal nerve", "Pharyngeal branch of right vagus nerve to pharyngeal nerve plexus", "Left L3 grey ramus communicans", "Left lateral femoral cutaneous nerve", "Right external laryngeal nerve branch to pharyngeal plexus", "Left eighth intercostal nerve", "Right T5 spinal nerve posterior ramus", "Left tibial nerve", "Right superior lateral cutaneous nerve of arm", "Right lateral plantar nerve", "Anterior cutaneous branch of left first intercostal nerve", "Brachial plexus right C8 root", "Lateral cutaneous branch of left iliohypogastric nerve", "Posterior branch of lateral cutaneous branch of left eleventh intercostal nerve", "Right long thoracic nerve", "Left lateral cutaneous nerve of forearm", "Left posterior supraclavicular nerve", "Left T3 grey ramus communicans", "Left ilioinguinal nerve", "Left mental nerve", "Left T12 white ramus communicans", "Left superficial fibular nerve", "Right proper palmar digital nerve F", "Right proper palmar digital nerve D", "Right lateral cutaneous nerve of forearm", "Gluteal branch A of left posterior femoral cutaneous nerve", "Lateral cutaneous branch of left fifth intercostal nerve", "Right L1 spinal nerve posterior ramus lateral branch", "Right axillary nerve anterior branch", "Orbital branch of right maxillary nerve to right ethmoidal sinus", "Right C6 spinal nerve posterior ramus medial branch", "Posterior branch of lateral cutaneous branch of right ninth intercostal nerve", "Right recurrent laryngeal nerve", "Right sural nerve", "Dorsal branch of right ulnar nerve", "Right common plantar digital nerve E", "Right medial dorsal digital nerve of the fourth toe", "Right proper plantar digital nerve E", "Left caroticotympanic nerve", "Greater posterior gastric nerve", "Right L1 spinal nerve posterior ramus", "Pericardial branch of right phrenic nerve", "Anterior branch of lateral cutaneous branch of right eighth intercostal nerve", "Left incisive branch of inferior alveolar nerve", "Right T3 grey ramus communicans", "Left posterior interosseous nerve", "Palmar branch of left median nerve", "Left nasociliary nerve", "Right external laryngeal nerve", "Pharyngeal branch of left vagus nerve to pharyngeal nerve plexus", "Right T11 grey ramus communicans", "Right dorsal nerve of penis", "Left C6 spinal nerve posterior ramus", "Left axillary nerve anterior branch", "Meningeal branch of left vagus nerve", "Left intermediate dorsal cutaneous nerve", "Right laryngopharyngeal branch of superior cervical ganglion", "Right great auricular nerve anterior branch", "Zygomatic branch of left facial nerve", "Left C5 spinal nerve posterior ramus medial branch", "Marginal mandibular branch of left facial nerve", "Right L1 grey ramus communicans", "Right meningeal branch of mandibular nerve", "Right femoral nerve", "Tracheal branch of right recurrent laryngeal nerve", "Left posterior cutaneous nerve of arm", "Left inferior lateral cutaneous nerve of arm", "Right L2 spinal nerve posterior ramus", "Right lateral dorsal cutaneous nerve", "Anterior cutaneous branch of right second intercostal nerve", "Left nasopalatine nerve", "Left T3 spinal nerve posterior ramus medial branch", "Left superior cervical cardiac nerve", "Posterior branch of lateral cutaneous branch of left ninth intercostal nerve", "Right T7 spinal nerve posterior ramus lateral branch", "Right frontal nerve", "Anterior cutaneous branch of left tenth intercostal nerve", "Ganglionic branch of left maxillary nerve to pterygopalatine ganglion", "Left S1 grey ramus communicans", "Left lesser palatine nerve", "Left medial plantar nerve", "Communicating branch of right glossopharyngeal nerve with auricular branch of right vagus nerve", "Left zygomaticotemporal nerve", "Anterior cutaneous branch of right fifth intercostal nerve", "Left proper palmar digital nerve B", "Left radial nerve", "Posterior branch of lateral cutaneous branch of left fourth intercostal nerve", "Left S3 grey ramus communicans", "Left T3 white ramus communicans", "Right T11 spinal nerve posterior ramus", "Left ninth intercostal nerve", "Right T2 spinal nerve posterior ramus medial branch", "Anterior cutaneous branch of left subcostal nerve", "Right proper plantar digital nerve B", "Left C2 spinal nerve posterior ramus", "Right axillary nerve", "Left axillary nerve", "Left common palmar digital nerve A", "Left proper plantar digital nerve D", "Left femoral branch of genitofemoral nerve", "Left second intercostal nerve", "Left medial cutaneous nerve of arm", "Left lateral sural cutaneous nerve", "Right ophthalmic nerve", "Right carotid sinus nerve", "Right T10 spinal nerve posterior ramus lateral branch", "Right proper plantar digital nerve D", "Right mandibular nerve", "Right obturator nerve", "Left C3 spinal nerve branch to left great auricular nerve", "Left lateral dorsal cutaneous nerve", "Right greater palatine nerve", "Right L2 spinal nerve posterior ramus lateral branch", "Brachial plexus right C5 root", "Left posterior superior lateral nasal branch of maxillary nerve", "Right proper plantar digital nerve I", "Right seventh intercostal nerve", "Anterior branch of lateral cutaneous branch of right eleventh intercostal nerve", "Right tenth intercostal nerve", "Left mandibular nerve", "Left greater palatine nerve", "Left T12 grey ramus communicans", "Inferior cervical cardiac branch of right vagus nerve", "Left ophthalmic nerve", "Left superior laryngeal nerve", "Right T12 grey ramus communicans", "Cutaneous branch of left obturator nerve", "Left long ciliary nerve B", "Left S4 grey ramus communicans", "Left T4 spinal nerve posterior ramus medial branch", "Greater anterior gastric nerve", "Orbital branch of left maxillary nerve to left sphenoidal sinus", "Orbital branch of right maxillary nerve to right sphenoidal sinus", "Right middle supraclavicular nerve", "Right caroticotympanic nerve", "Left sixth intercostal nerve", "Right posterior cutaneous nerve of arm", "Left middle supraclavicular nerve", "Left proper plantar digital nerve I", "Anterior branch of lateral cutaneous branch of right sixth intercostal nerve", "Left L2 spinal nerve posterior ramus", "Anterior branch of lateral cutaneous branch of left seventh intercostal nerve", "Posterior branch of lateral cutaneous branch of right sixth intercostal nerve", "Left T8 spinal nerve posterior ramus lateral branch", "Meningeal branch of right vagus nerve", "Tracheal branch of left recurrent laryngeal nerve", "Anterior cutaneous branch of right tenth intercostal nerve", "Left eleventh intercostal nerve", "Right pudendal nerve", "Posterior branch of lateral cutaneous branch of left fifth intercostal nerve", "Right anterior ethmoidal nerve", "Right nasopalatine nerve", "Left T8 spinal nerve posterior ramus", "Left long ciliary nerve A", "Left supraorbital nerve", "Right medial posterior superior nasal nerve", "Left T8 white ramus communicans", "Right anterior femoral cutaneous branch A", "Left T2 white ramus communicans", "Right saphenous nerve", "Anterior branch of lateral cutaneous branch of right seventh intercostal nerve", "Left superior lateral cutaneous nerve of arm", "Left T9 spinal nerve posterior ramus lateral branch", "Left T6 spinal nerve posterior ramus", "Posterior branch of left obturator nerve", "Left external laryngeal nerve branch to inferior pharyngeal constrictor", "Right incisive branch of inferior alveolar nerve", "Right C3 spinal nerve posterior ramus", "Right C5 spinal nerve posterior ramus", "Right T9 spinal nerve posterior ramus", "Communicating branch of left internal laryngeal nerve with left recurrent laryngeal nerve", "Left vestibular nerve", "Right radial nerve", "Left third intercostal nerve", "Left cochlear nerve", "Anterior cutaneous branch of left fourth intercostal nerve", "Right T6 spinal nerve posterior ramus", "Right greater occipital nerve", "Right lesser palatine nerve", "Left inferior alveolar nerve", "Right subclavian nerve", "Right T6 white ramus communicans", "Brachial plexus right C6 root", "Lateral cutaneous branch of left eleventh intercostal nerve", "Right T11 white ramus communicans", "Left carotid sinus nerve", "Left great auricular nerve anterior branch", "Right external laryngeal nerve branch to inferior pharyngeal constrictor", "Left S2 grey ramus communicans", "Right internal laryngeal nerve", "Infrapatellar branch of left saphenous nerve", "Anterior branch of lateral cutaneous branch of left sixth intercostal nerve", "Right proper palmar digital nerve A", "Right communicating branch of nasociliary nerve with ciliary ganglion", "Left proper plantar digital nerve G", "Left infraorbital nerve", "Left lingual branch of glossopharyngeal nerve", "Right proper plantar digital nerve A", "Left inferior rectal nerve", "Right musculocutaneous nerve", "Left inferior palpebral branch of infraorbital nerve", "Left T7 spinal nerve posterior ramus", "Cervical branch of right facial nerve", "Right middle meningeal nerve", "Right axillary nerve posterior branch", "Right C2 spinal nerve branch to right great auricular nerve", "Left zygomaticofacial nerve", "Anterior branch of lateral cutaneous branch of left eighth intercostal nerve"] }, { id: 77, nerve_id: "UBERON:0001647", label: "facial nerve", "FMA subclasses (in human nerves)": ["FMA:50888", "FMA:50889"], "subclass labels": ["Right facial nerve", "Left facial nerve"] }, { id: 78, nerve_id: "UBERON:0001148", label: "median nerve", "FMA subclasses (in human nerves)": ["FMA:37067", "FMA:37068"], "subclass labels": ["Right median nerve", "Left median nerve"] }, { id: 79, nerve_id: "UBERON:0009009", label: "carotid sinus nerve", "FMA subclasses (in human nerves)": ["FMA:53508", "FMA:53509"], "subclass labels": ["Right carotid sinus nerve", "Left carotid sinus nerve"] }, { id: 80, nerve_id: "UBERON:0003715", label: "splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6924", "FMA:6928", "FMA:6929", "FMA:6931", "FMA:6930", "FMA:6960", "FMA:6958", "FMA:6959", "FMA:6925", "FMA:6956", "FMA:6927", "FMA:6955", "FMA:6926", "FMA:6957"], "subclass labels": ["Right first lumbar splanchnic nerve", "Right third lumbar splanchnic nerve", "Left third lumbar splanchnic nerve", "Left fourth lumbar splanchnic nerve", "Right fourth lumbar splanchnic nerve", "Left least splanchnic nerve", "Left lesser splanchnic nerve", "Right least splanchnic nerve", "Left first lumbar splanchnic nerve", "Right greater splanchnic nerve", "Left second lumbar splanchnic nerve", "Left greater splanchnic nerve", "Right second lumbar splanchnic nerve", "Right lesser splanchnic nerve"] }, { id: 81, nerve_id: "ILX:0793826", label: "anterior abdominal vagal trunk", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 82, nerve_id: "UBERON:0001650", label: "hypoglossal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 83, nerve_id: "ILX:0794967", label: "posterior interosseous nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 84, nerve_id: "ILX:0793713", label: "Deep petrosal nerve", "FMA subclasses (in human nerves)": ["FMA:0328827", "FMA:0328826"], "subclass labels": ["Left deep petrosal nerve", "Right deep petrosal nerve"] }, { id: 85, nerve_id: "ILX:0793361", label: "white communicating ramus of third lumbar spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 86, nerve_id: "ILX:0787562", label: "gray communicating ramus of the third thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6133", "FMA:6124"], "subclass labels": ["Left T3 grey ramus communicans", "Right T3 grey ramus communicans"] }, { id: 87, nerve_id: "ILX:0793211", label: "white communicating ramus of fifth thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 88, nerve_id: "UBERON:0018679", label: "thoracic splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6958", "FMA:6960", "FMA:6955", "FMA:6959", "FMA:6957", "FMA:6956"], "subclass labels": ["Left lesser splanchnic nerve", "Left least splanchnic nerve", "Left greater splanchnic nerve", "Right least splanchnic nerve", "Right lesser splanchnic nerve", "Right greater splanchnic nerve"] }, { id: 89, nerve_id: "ILX:0731969", label: "least splanchnic nerve", "FMA subclasses (in human nerves)": ["FMA:6960", "FMA:6959"], "subclass labels": ["Left least splanchnic nerve", "Right least splanchnic nerve"] }, { id: 90, nerve_id: "ILX:0788771", label: "gray communicating ramus of seventh thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6888", "FMA:6889"], "subclass labels": ["Right T7 grey ramus communicans", "Left T7 grey ramus communicans"] }, { id: 91, nerve_id: "UBERON:0022301", label: "long ciliary nerve", "FMA subclasses (in human nerves)": ["FMA:52701", "FMA:52700", "FMA:82734", "FMA:82735"], "subclass labels": ["Left long ciliary nerve B", "Right long ciliary nerve B", "Right long ciliary nerve A", "Left long ciliary nerve A"] }, { id: 92, nerve_id: "ILX:0793221", label: "white communicating ramus of second lumbar spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 93, nerve_id: "ILX:0785825", label: "gray communicating ramus of first lumbar nerve", "FMA subclasses (in human nerves)": ["FMA:65924", "FMA:65923"], "subclass labels": ["Left L1 grey ramus communicans", "Right L1 grey ramus communicans"] }, { id: 94, nerve_id: "ILX:0793208", label: "white communicating ramus of second thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 95, nerve_id: "UBERON:0018412", label: "vidian nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 96, nerve_id: "ILX:0739303", label: "gray communicating ramus of second thoracic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 97, nerve_id: "ILX:0795006", label: "Suboccipital nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 98, nerve_id: "ILX:0785733", label: "gray communicating ramus of second lumbar nerve", "FMA subclasses (in human nerves)": ["FMA:65921", "FMA:65922"], "subclass labels": ["Right L2 grey ramus communicans", "Left L2 grey ramus communicans"] }, { id: 99, nerve_id: "UBERON:0035207", label: "deep fibular nerve", "FMA subclasses (in human nerves)": ["FMA:45387", "FMA:45388"], "subclass labels": ["Right deep fibular nerve", "Left deep fibular nerve"] }, { id: 100, nerve_id: "ILX:0739304", label: "gray communicating ramus of third thoracic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 101, nerve_id: "UBERON:0002019", label: "accessory XI nerve", "FMA subclasses (in human nerves)": ["FMA:50899", "FMA:50897"], "subclass labels": ["Left accessory nerve", "Right accessory nerve"] }, { id: 102, nerve_id: "ILX:0793217", label: "white communicating ramus of eleventh thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 103, nerve_id: "ILX:0793722", label: "Lesser petrosal nerve", "FMA subclasses (in human nerves)": ["FMA:53503", "FMA:53502"], "subclass labels": ["Left lesser petrosal nerve", "Right lesser petrosal nerve"] }, { id: 104, nerve_id: "UBERON:0018675", label: "pelvic splanchnic nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 105, nerve_id: "ILX:0793702", label: "Greater petrosal nerve", "FMA subclasses (in human nerves)": ["FMA:53423", "FMA:53424"], "subclass labels": ["Right greater petrosal nerve", "Left greater petrosal nerve"] }, { id: 106, nerve_id: "ILX:0794916", label: "white ramus communicans", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 107, nerve_id: "UBERON:0003716", label: "Recurrent Laryngeal Nerve", "FMA subclasses (in human nerves)": ["UBERON:0011766", "UBERON:0011767"], "subclass labels": ["Left recurrent laryngeal nerve", "Right recurrent laryngeal nerve"] }, { id: 108, nerve_id: "UBERON:0005465", label: "obturator nerve", "FMA subclasses (in human nerves)": ["FMA:16501", "FMA:16502"], "subclass labels": ["Right obturator nerve", "Left obturator nerve"] }, { id: 109, nerve_id: "ILX:0793213", label: "white communicating ramus of seventh thoracic spinal nerve", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 110, nerve_id: "ILX:0785067", label: "gray communicating ramus of eleventh thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6897", "FMA:6896"], "subclass labels": ["Left T11 grey ramus communicans", "Right T11 grey ramus communicans"] }, { id: 111, nerve_id: "UBERON:0001494", label: "ulnar nerve", "FMA subclasses (in human nerves)": ["FMA:37320", "FMA:37321"], "subclass labels": ["Right ulnar nerve", "Left ulnar nerve"] }, { id: 112, nerve_id: "ILX:0794959", label: "posterior rami lower cervical nerves", "FMA subclasses (in human nerves)": [], "subclass labels": [] }, { id: 113, nerve_id: "UBERON:0001493", label: "axillary nerve", "FMA subclasses (in human nerves)": ["FMA:37074", "FMA:37073"], "subclass labels": ["Left axillary nerve", "Right axillary nerve"] }, { id: 114, nerve_id: "ILX:0787946", label: "gray communicating ramus of sixth thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6762", "FMA:6763"], "subclass labels": ["Right T6 grey ramus communicans", "Left T6 grey ramus communicans"] }, { id: 115, nerve_id: "ILX:0785542", label: "gray communicating ramus of ninth thoracic nerve", "FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"], "subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"] } ]; var B5 = () => { const n = {}; return N5.forEach((e) => { e.nerve_id && e.label !== "nerve" && e["subclass labels"].forEach((t) => { t in n || (n[t.toLowerCase()] = e.nerve_id); }); }), n; }; var U5 = [ { label: "urinary bladder", anatomicalId: "UBERON:0001255" }, { label: "brainstem", anatomicalId: "UBERON:0002298" }, { label: "caecum", anatomicalId: "UBERON:0001153" }, { label: "colon", anatomicalId: "UBERON:0001155" }, { label: "esophagus", anatomicalId: "UBERON:0001043" }, { label: "small intestine", anatomicalId: "UBERON:0002108" }, { label: "stomach", anatomicalId: "UBERON:0000945" }, { label: "heart", anatomicalId: "UBERON:0000948" }, { label: "lung", anatomicalId: "UBERON:0002048" } ]; var z5 = () => { const n = {}; return U5.forEach((e) => { const t = e.label.toLowerCase(); t in n || (n[t.toLowerCase()] = e.anatomicalId); }), n; }; var Ov = B5(); var Dv = z5(); var k5 = { name: "ScaffoldVuer", components: { Button: Ko, Col: bi, Loading: b3, Option: Qo, Popover: cu, Radio: ty, RadioGroup: ny, Row: Ui, ScaffoldOverlay: My, Select: qo, Slider: ti, TabPane: xy, Tabs: by, MapSvgIcon: wn, MapSvgSpriteColor: hn, PrimitiveControls: TM, ScaffoldTooltip: CM, ElIconWarningFilled: u0, ElIconArrowDown: Xd, ElIconArrowLeft: zr, DrawToolbar: $7, ScaffoldTreeControls: EM }, setup(n) { let e = inject("$annotator"); return e || (e = markRaw(new AnnotationService(`${n.flatmapAPI}annotator`)), provide("$annotator", e)), { annotator: e }; }, props: { /** * The option to show annotation information in sidebar */ annotationSidebar: { type: Boolean, default: false }, /** * URL of the zincjs metadata. This value will be ignored if a valid * state prop is also provided. * If the url needs to be updated with state present, please use * the setURL method. */ url: { type: String, default: "" }, /** * Show the colour control of set to true. */ showColourPicker: { type: Boolean, default: false }, /** * Flag to show/hide the UI. */ displayUI: { type: Boolean, default: true }, /** * Display all graphics at start. * * This setting only works when traditional is set to false. */ displayAtStartUp: { type: Boolean, default: true }, /** * Use for toggling the help tooltips. */ helpMode: { type: Boolean, default: false }, /** * The active item index of help mode. */ helpModeActiveItem: { type: Number, default: 0 }, /** * The option to use helpModeDialog. * On default, `false`, clicking help will show all tooltips. * If `true`, clicking help will show the help-mode-dialog. */ helpModeDialog: { type: Boolean, default: false }, /** * The last item of help mode. */ helpModeLastItem: { type: Boolean, default: false }, /** * The initial index number for help mode tooltips. * Set negative (e.g. -1) if there are other tooltips outside of `hoverVisibilities`. */ helpModeInitialIndex: { type: Number, default: 0 }, /** * Use for show/display beta warning icon. */ displayWarning: { type: Boolean, default: true }, /** * Warning message for the hovered over text * on the warning icon. */ warningMessage: { type: String, default: "Beta feature - under active development" }, displayLatestChanges: { type: Boolean, default: false }, latestChangesMessage: { type: String, default: "New feature - Local search is now available" }, /** * Show/hide pickable markers for regions. */ displayMarkers: { type: Boolean, default: false }, /** * Display adjacent markers with a cluster marker. */ markerCluster: { type: Boolean, default: false }, /** * GroupName to value pair. * The value can be a single number or and object in the following * form: * * { * number: Number, * imgURL: String * } * * When imgURL is specified, scaffoldvuer will attempt to render * the image in imgURL as marker instead. * */ markerLabels: { type: Object, default: function() { return {}; } }, /** * Show/hide minimap. */ displayMinimap: { type: Boolean, default: false }, /** * Format of the input URL */ format: { type: String, default: "metadata" }, /** * Settings for minimap position, size and alignment. */ minimapSettings: { type: Object, default: function() { return { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-right" }; } }, /** * Flag to determine rather the open map UI icon and popup * should be shown or not. */ enableOpenMapUI: { type: Boolean, default: false }, /** * Experimental feature to restrict rotation at * one-axis based on position of the initial click */ positionalRotation: { type: Boolean, default: false }, /** * Define what is considered as nerves. */ isNerves: { type: Object, default: function() { return { regions: ["nerves"] }; } }, /** * This array populate the the openMapOptions popup. * Each entry contains a pair of display and key. */ openMapOptions: { type: Array, default: function() { return [ { display: "Open AC Map", key: "AC" }, { display: "Open FC Map", key: "FC" }, { display: "Open 3D Human Map", key: "3D" } ]; } }, /** * State containing state of the scaffold. */ state: { type: Object, default: void 0 }, /** * Optional prop for the name of the region to focus on, * this option is ignored if state or viewURL is also provided. */ region: { type: String, default: "" }, /** * Optional prop for an URL of containing information of a viewport. * This option is ignored if state is also provided. * It will use the provided URL as base if a relative parth is provided. */ viewURL: { type: String, default: "" }, /** * Settings for turning on/off rendering */ render: { type: Boolean, default: true }, /** * Specify the endpoint of the flatmap server. * This is used by annotation service included in * third party flatmapvuer library. */ flatmapAPI: { type: String, default: "https://mapcore-demo.org/current/flatmap/v3/" }, /** * The option to show local settings UI * (background colour, viewing mode, etc.) */ showLocalSettings: { type: Boolean, default: true }, /** * The option to show open new map button */ showOpenMapButton: { type: Boolean, default: true }, /** * Manage the settings when used in standalone or as child component. */ usageConfig: { type: Object, default: function() { return { showTubeLinesControls: true, tubeLines: false }; } } }, provide() { return { flatmapAPI: this.flatmapAPI, scaffoldUrl: this.url, boundingDims: this.boundingDims }; }, data: function() { return { annotator: void 0, colourRadio: true, createData: { drawingBox: false, toBeConfirmed: false, points: [], shape: "", x: 0, y: 0, editingIndex: -1, faceIndex: -1, toBeDeleted: false }, currentTime: 0, timeVarying: false, isPlaying: false, isReady: false, /** * This is set when scene is transitioning. */ isTransitioning: false, tooltipAppendToBody: false, hoverVisibilities: [ { value: false, ref: "zoomInPopover" }, // 0 { value: false, ref: "zoomOutPopover" }, // 1 { value: false, ref: "zoomFitPopover" }, // 2 { value: false, ref: "openMapPopover" }, // 3 { value: false, ref: "settingsPopover" }, // 4 { value: false, ref: "sliderPopover" }, // 5 { value: false, ref: "regionVisibilityPopover" }, // 6 { value: false, ref: "warningPopover" }, // 7 { value: false, ref: "whatsNewPopover" }, // 8 { value: false, refs: "toolbarPopover", ref: "editPopover" }, // 9 { value: false, refs: "toolbarPopover", ref: "pointPopover" }, // 10 { value: false, refs: "toolbarPopover", ref: "lineStringPopover" }, // 11 { value: false, refs: "toolbarPopover", ref: "deletePopover" } // 11 ], inHelp: false, helpModeActiveIndex: this.helpModeInitialIndex, loading: false, duration: 3e3, drawerOpen: true, currentBackground: "white", availableBackground: ["white", "lightskyblue", "black"], minimisedSlider: false, sliderPosition: "", timeMax: 100, orginalDuration: "", animateDuration: "6secs", playSpeed: [ { value: 0.1, label: "0.1x" }, { value: 0.5, label: "0.5x" }, { value: 1, label: "1x" }, { value: 2, label: "2x" }, { value: 5, label: "5x" }, { value: 10, label: "10x" } ], currentSpeed: 1, timeStamps: {}, defaultCheckedKeys: [], outlinesRadio: true, tData: { label: "", region: "", visible: false, x: 200, y: 200, active: false }, fileFormat: "metadata", previousMarkerLabels: markRaw({}), viewingMode: "Exploration", viewingModes: { Exploration: "View and explore detailed visualization of 3D scaffolds", "Neuron Connection": "Discover nerve connections by selecting a nerve and viewing its associated connections", Annotation: ["View feature annotations", "Add, comment on and view feature annotations"] }, openMapRef: void 0, backgroundIconRef: void 0, annotationFeature: {}, offlineAnnotationEnabled: false, offlineAnnotations: markRaw([]), authorisedUser: void 0, toolbarOptions: [ "Delete", "Edit", "Point", "LineString" ], existDrawnFeatures: markRaw([]), // Store all exist drawn features activeDrawTool: void 0, activeDrawMode: void 0, boundingDims: { centre: [0, 0, 0], size: [1, 1, 1] }, lastSelected: markRaw({ region: "", group: "", isSearch: false }) //checkedRegions: [] }; }, watch: { format: { handler: function(n) { this.fileFormat = n; }, immediate: true }, url: { handler: function(n) { (this.state === void 0 || this.state.url === void 0) && this.setURL(n); }, immediate: true }, region: { handler: function(n) { this.state || this.viewURL || this.setFocusedRegion(n); }, immediate: true }, state: { handler: function(n) { this.setState(n); }, immediate: true, deep: true }, viewURL: { handler: function(n) { this.updateViewURL(n); }, immediate: true }, helpMode: function(n, e) { n !== e && this.setHelpMode(n); }, helpModeActiveItem: function() { this.helpMode && (this.helpModeActiveIndex += 1, this.setHelpMode(this.helpMode)); }, displayMarkers: function(n) { this.$module.scene.displayMarkers = n, this.$module.scene.forcePickableObjectsUpdate = true; }, displayMinimap: function(n) { this.$module.scene.displayMinimap = n; }, currentTime: { handler: function() { this.$emit("timeChanged", this.currentTime); } }, duration: function() { this.$module.scene.setDuration(this.duration); }, minimapSettings: { deep: true, handler: "updateMinimapScissor" }, render: function(n) { this.toggleRendering(n); }, markerCluster: { handler: function(n) { this.$module.scene.enableMarkerCluster(n); }, immediate: true }, markerLabels: function(n) { for (const [e, t] of Object.entries(this.previousMarkerLabels)) this.setMarkerModeForObjectsWithName(e, t, "off"); for (const [e, t] of Object.entries(n)) this.setMarkerModeForObjectsWithName(e, t, "on"); this.previousMarkerLabels = markRaw({ ...n }); } }, beforeCreate: function() { this.$module = new LM(), this.selectedObjects = [], this.hoveredObjects = [], this.currentBackground = "white", this._currentURL = void 0, this.availableBackground = ["white", "black", "lightskyblue"], this.$_searchIndex = new D5(); }, mounted: function() { this.openMapRef = shallowRef(this.$refs.openMapRef), this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef), this.$refs.scaffoldTreeControls.setModule(this.$module); let n = new g5(); n.subscribe(this, this.eventNotifierCallback), this.$module.addNotifier(n), this.$module.addOrganPartAddedCallback(this.zincObjectAdded), this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved), this.$module.initialiseRenderer(this.$refs.display), this.toggleRendering(this.render), this.ro = new ResizeObserver(this.adjustLayout).observe( this.$refs.scaffoldContainer.$el ), this.helpTextWait = [], this.helpTextWait.length = this.hoverVisibilities.length, this.defaultRate = this.$module.getPlayRate(), this.$module.zincRenderer.addPreRenderCallbackFunction(() => { this.currentTime = this.$module.getCurrentTime(); }); }, beforeUnmount: function() { this.ro && this.ro.disconnect(), this.$module.destroy(), this.$module = void 0; }, computed: { ...mapStores(Dd), ...mapState(Dd, ["userToken"]), annotationDisplay: function() { return this.viewingMode === "Annotation" && this.tData.active === true && this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString"; }, enableColourPicker: function() { return this.showColourPicker && this.colourRadio; }, modeDescription: function() { let n = this.viewingModes[this.viewingMode]; return this.viewingMode === "Annotation" ? this.authorisedUser ? n[1] : n[0] : n; } }, methods: { /* setCheckedRegions: function (data) { this.checkedRegions = data; }, */ /** * * @param nerves array of nerve names, show all nerves if empty * @param processed boolean, whether unselect all checkboxes */ zoomToNerves: function(n, e = false) { if (this.$module.scene) { this.$module.setIgnorePicking(e); const t = []; this.$module.scene.getRootRegion().getChildRegions().forEach((r) => { r.getName() === "Nerves" && e && n.forEach((o) => { const a6 = this.findObjectsWithGroupName(o); t.push(...a6); }); }), this.$module.setSelectedByZincObjects(t, void 0, {}, true), this.$module.scene.viewAll(); } }, enableAxisDisplay: function(n, e) { this.$module.scene && this.$module.scene.enableAxisDisplay(n, e); }, createAxisDisplay: function(n) { this.$module.scene && this.$module.scene.createAxisDisplay(n); }, /** * @public * Call this to manually add a zinc object into the current scene. * This will subsequently trigger a zincObjectAdded * @arg {Object} "ZincObject object to be added" */ addZincObject: function(n) { this.$module.scene && this.$module.scene.addZincObject(n); }, /** * Internal only. * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(n) { var r; this.loading = false, this.$_searchIndex.addZincObject(n, n.uuid), this.timeVarying === false && n.isTimeVarying() && (this.timeVarying = true); const e = n.groupName.toLowerCase(); e in Dv && n.setAnatomicalId(Dv[e]); const t = n.getGroup(); t && t.position ? n.userData.originalPos = [ t.position.x, t.position.y, t.position.z ] : n.userData.originalPos = [0, 0, 0]; const i = (r = this.isNerves) == null ? void 0 : r.regions; if (i) { const s = n.getRegion().getFullPath().toLowerCase(); for (let o = 0; o < i.length; o++) s.includes(i[o].toLowerCase()) ? (n.userData.isNerves = true, n.userData.defaultColour = `#${n.getColourHex()}`, n.userData.isGreyScale = false, e in Ov && n.setAnatomicalId(Ov[e])) : n.userData.isNerves = false; } this.$emit("zinc-object-added", n); }, /** * Internal only. * Remove an entry matching region and group from * local annotation list. */ removeFromOfflineAnnotation: function(n, e) { for (let t = 0; t < this.offlineAnnotations.length; t++) { const i = this.offlineAnnotations[t]; if (i.region === n && i.group === e) { this.offlineAnnotations.splice(t, 1); return; } } }, /** * Internal only. * This is called when a zinc object is removed. */ zincObjectRemoved: function(n) { if (this.$module.scene) { const e = n.groupName; n.region.findObjectsWithGroupName(e, false).length === 0 && this.$_searchIndex.removeZincObject(n, n.uuid); } }, /** * Internal only. * Add regions to search index. */ addRegionsToSearchIndex: function() { this.$module.scene.getRootRegion().getChildRegions(true).forEach((t) => { this.$_searchIndex.addRegion(t, t.uuid); }); }, /** * Internal only. * This is called when Change backgspeedround colour button * is pressed an causes the backgrouColornd colour to be changed * to one of the three preset colour: white, black and * lightskyblue. */ backgroundChangeCallback: function(n) { this.currentBackground = n, this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground, 1); }, /** * Internal only. * This is called by captueeScreenshot and after the last render * loop, it download a screenshot of the current scene with no UI. */ captureScreenshotCallback: function() { this.$module.zincRenderer.removePostRenderCallbackFunction( this.captureID ); let n = this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"), e = document.createElement("a"); document.body.append(e), this.captureFilename ? e.download = this.captureFilename : e.download = "screenshot.png", e.href = n, e.click(), e.remove(); }, /** * @public * Function for capturing a screenshot of the current rendering. * * @arg {String} "filename given to the screenshot." */ captureScreenshot: function(n) { this.captureFilename = n, this.captureID = this.$module.zincRenderer.addPostRenderCallbackFunction( this.captureScreenshotCallback ); }, /** * @public * Function to clear current scene, the tree controls and the search index. */ clearScene: function() { this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.$_searchIndex && this.$_searchIndex.removeAll(), this.$module.scene && this.$module.scene.clearAll(); }, /** * @public * Add and edit local annotations * @arg `region`, * @arg `group`, * @arg `zincObject`, * @arg `comment` */ addAndEditAnnotations: function(n, e, t, i) { const r = Tv( this.annotator, this.userToken, t, n, e, this.url, i ); if (this.existDrawnFeatures = markRaw(this.existDrawnFeatures.filter((s) => s.id !== r.item.id)), this.existDrawnFeatures.push(r.feature), this.offlineAnnotationEnabled) { r.group = e; let s = n; s.slice(-1) === "/" && (s = s.slice(0, -1)), r.region = s, this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], this.offlineAnnotations.push(r), sessionStorage.setItem("anonymous-annotation", JSON.stringify(this.offlineAnnotations)); } this.$emit("userPrimitivesUpdated", { region: n, group: e, zincObject: t }); }, /** * @public * Callback for when primitives have been update using primitive controls. * This is only called from callback. * @arg `object` */ primitivesUpdated: function(n) { if (n.isZincObject && n.isEditable) { const e = n.groupName, t = n.region.getFullPath(); this.addAndEditAnnotations(t, e, n, "Position Updated"); } }, /** * @public * Confirm creation of new primitive. This is only called from callback. * @arg `payload` */ confirmCreate: function(n) { if (n) { let e; if (n.shape === "Point") e = this.$module.scene.createPoints( n.region, n.group, this.createData.points, n.group, 8942 ); else if (n.shape === "LineString") e = this.$module.scene.createLines( n.region, n.group, [this.createData.points[0], this.createData.points[1]], 60962 ); else if (n.editingIndex > -1 && this._editingZincObject) { this._editingZincObject.editVertices( [this.createData.points[1]], n.editingIndex ); const t = this._editingZincObject.region.getFullPath() + "/", i = this._editingZincObject.groupName; this.addAndEditAnnotations(t, i, this._editingZincObject, "Position Updated"); } e && (this.addAndEditAnnotations(n.region, n.group, e.zincObject, "Create"), e.zincObject.isEditable = true, this.tData.region = n.region, this.tData.label = n.group, this.changeActiveByName([n.group], n.region, false)); } this.cancelCreate(); }, /** * Internal only. * Cancel create workflows. Reset all relevant UIs and data. */ cancelCreate: function() { this.createData.points.length = 0, this.createData.toBeConfirmed = false, this._editingZincObject = void 0, this.createData.editingIndex = -1, this.createData.faceIndex = -1, this.tData.visible = false, this.createData.toBeDeleted = false, this._tempLine && (this.$module.scene.removeTemporaryPrimitive(this._tempLine), this._tempLine = void 0), this._tempPoint && (this.$module.scene.removeTemporaryPrimitive(this._tempPoint), this._tempPoint = void 0), this.annotationSidebar && this.$emit("annotation-close"); }, /** * Internal only. * Confirm delete of user created primitive. * This is only called from callback. */ confirmComment: function(n) { if (this._editingZincObject) { let e = n; this._editingZincObject.isEditable && (this.existDrawnFeatures = markRaw(this.existDrawnFeatures.filter((t) => t.id !== e.item.id)), this.existDrawnFeatures.push(n.feature)), this.offlineAnnotationEnabled && (e.group = this._editingZincObject.groupName, e.region = this._editingZincObject.region.getFullPath(), this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], this.offlineAnnotations.push(e), sessionStorage.setItem("anonymous-annotation", JSON.stringify(this.offlineAnnotations))); } }, /** * Internal only. * Confirm delete of user created primitive. * This is only called from callback. */ confirmDelete: function() { var n; if ((n = this._editingZincObject) != null && n.isEditable) { const e = this._editingZincObject.region.getFullPath() + "/", t = this._editingZincObject.groupName, i = Tv( this.annotator, this.userToken, this._editingZincObject, e, t, this.url, "Deleted" ); i && (this.existDrawnFeatures = markRaw(this.existDrawnFeatures.filter((s) => s.id !== i.item.id)), this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject), this.offlineAnnotationEnabled && (this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], this.offlineAnnotations = this.offlineAnnotations.filter((s) => s.item.id !== i.item.id), sessionStorage.setItem("anonymous-annotation", JSON.stringify(this.offlineAnnotations)))); } this.cancelCreate(); }, /** * Internal only. * This is triggered when tooltip is hidden */ onTooltipHide: function() { this.createData.toBeConfirmed && !this.annotationSidebar && this.cancelCreate(); }, formatTooltip(n) { if (this.timeMax >= 1e3 && n) { let e = (n % 6e4 / 1e3).toFixed(2) + "s"; return (n > 6e4 ? (n / 6e4).toFixed(0) + "m " : "") + e; } return n ? n.toFixed(2) + " ms" : "0 ms"; }, /** * @public * Function to reset the view to default. * Also called when the associated button is pressed. */ fitWindow: function() { if (this.$module.scene) { let n = false; this._boundingBoxGeo && (n = this._boundingBoxGeo.getVisibility(), this._boundingBoxGeo.setVisibility(false)), this.$module.scene.viewAll(), this._boundingBoxGeo && (V4(this._boundingBoxGeo, this.$module.scene), this._boundingBoxGeo.setVisibility(n)); } }, /** * @public * Function to zoom in. * Also called when the associated button is pressed. */ zoomIn: function() { this.$module.scene && this.$module.scene.changeZoomByScrollRateUnit(-1); }, /** * Function to zoom out. * Also called when the associated button is pressed. * * @public */ zoomOut: function() { this.$module.scene && this.$module.scene.changeZoomByScrollRateUnit(1); }, /** * Function to change the current play speed. * * @public * @arg `speed` */ speedChanged: function(n) { this.currentSpeed = n, this.$module.setPlayRate(this.defaultRate * this.currentSpeed); }, /** * Function used to stop the free spin * * @public */ stopFreeSpin: function() { this.$module.scene.getZincCameraControls().stopAutoTumble(), this.isTransitioning = false; }, /** * Return a list of obejcts with the provided name. * @arg "Group name to search." * * @public */ findObjectsWithGroupName: function(n) { let e = []; return n && n != "" && this.$module.scene && (e = this.$module.scene.findObjectsWithGroupName(n)), e; }, /** * @public * Switch active drawing type * @arg {String} `type` * @arg {String} `icon` */ toggleDrawing: function(n, e) { this.createData.toBeDeleted = false, n === "mode" ? (this.cancelCreate(), this.activeDrawMode = e, this.createData.shape = "", this.$module.selectObjectOnPick = true) : n === "tool" && (this.activeDrawTool = e, this.createData.shape = this.activeDrawTool ? this.activeDrawTool : "", this.$module.selectObjectOnPick = false); }, /** * Toggle the drawing box which aid the drawing * * @public */ toggleDrawingBox: function() { this.createData.drawingBox = !this.createData.drawingBox; }, /** * Find and and zoom into objects with the provided list of names. * @arg "List of names" * * @public */ viewRegion: function(n) { const e = this.$module.scene.getRootRegion(), t = Array.isArray(n) ? n : [n], i = xo(e, t, "", true); let r = this.$module.scene.getBoundingBoxOfZincObjects(i); if (r) { if (this.$module.isSyncControl()) this.$module.setSyncControlZoomToBox(r); else { const s = this.$module.scene.camera.far - this.$module.scene.camera.near; this.$module.scene.viewAllWithBoundingBox(r), this.$module.scene.camera.far = this.$module.scene.camera.near + s, this.$module.scene.camera.updateProjectionMatrix(); } return true; } return false; }, setFocusedRegion: function(n) { n && (this.isReady ? this.viewRegion(n) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ region: n }) )); }, setRotationMode: function(n) { this.$module.scene && this.$module.scene.getZincCameraControls().setRotationMode(n); }, updateViewURL: function(n) { if (n) if (this.isReady) { const e = new URL(n, this.url); this.$module.scene.loadViewURL(e); } else this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ viewURL: n }) ); }, createEditTemporaryLines: function(n) { const e = n[0].extraData.worldCoords; if (e && (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.createData.points.length === 1) if (this.showRegionTooltipWithAnnotations(n, true, false), this.tData.x = 50, this.tData.y = 200, this._tempLine) { const t = this._tempLine.geometry.getAttribute("position"); t.setXYZ(1, e[0], e[1], e[2]), t.needsUpdate = true; } else this._tempLine = this.$module.scene.addTemporaryLines( [this.createData.points[0], e], 65535 ); }, draw: function(n) { n && n.length > 0 && n[0].data.group && n[0].extraData.worldCoords && (this.createData.shape === "Point" ? this.drawPoint(n[0].extraData.worldCoords, n) : (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.drawLine(n[0].extraData.worldCoords, n)); }, drawPoint: function(n, e) { this.createData.toBeConfirmed === false && (this.createData.points.length = 0, this.createData.points.push(n), this.createData.toBeConfirmed = true, this.showRegionTooltipWithAnnotations(e, true, false), this.tData.x = 50, this.tData.y = 200, this._tempPoint = this.$module.scene.addTemporaryPoints([n], 16776960)); }, drawLine: function(n, e) { this.createData.toBeConfirmed === false && (this.createData.points.length === 1 ? (this.createData.points.push(n), this.createData.toBeConfirmed = true, this.showRegionTooltipWithAnnotations(e, true, false), this.tData.x = 50, this.tData.y = 200) : (this._tempPoint = this.$module.scene.addTemporaryPoints([n], 16776960), this.createData.points.push(n))); }, /** * Return renderer information * * @public */ getRendererInfo: function() { if (this.$module.zincRenderer) return this.$module.zincRenderer.getThreeJSRenderer().info; }, /** * Function used to rotate the scene. * Also called when the associated button is pressed. * * @public */ freeSpin: function() { if (this.$module.scene) { let n = this.$module.scene.getZincCameraControls(); this.isTransitioning = true, n.enableAutoTumble(), n.autoTumble([1, 0], Math.PI, true), setTimeout(this.stopFreeSpin, 4e3); } }, activateAnnotationMode: function(n, e) { if (this.authorisedUser || this.offlineAnnotationEnabled) if (this.createData.toBeDeleted = false, this.createData.shape !== "" || this.createData.editingIndex > -1) n.length > 0 && e.identifiers[0].coords && (this.createData.x = e.identifiers[0].coords.x, this.createData.y = e.identifiers[0].coords.y, this.draw(e.identifiers)); else { if (this.activeDrawMode === "Edit") { const t = B4(e); t && this.activateEditingMode( t.zincObject, t.faceIndex, t.vertexIndex, t.point ); } else if (this.activeDrawMode === "Delete") { const t = z4(e); t && (this.createData.toBeDeleted = true, this._editingZincObject = t); } this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString" ? this.showRegionTooltipWithAnnotations(e.identifiers, true, false) : this.showRegionTooltipWithAnnotations(e.identifiers, true, true); } else this.showRegionTooltipWithAnnotations(e.identifiers, true, true); }, activateEditingMode: function(n, e, t, i) { this._editingZincObject = n, this.createData.faceIndex = e, this.createData.editingIndex = t, this.drawLine(i, void 0); }, /** * Callback when a region is selected/highlighted. * It will also update other controls. * */ eventNotifierCallback: function(n) { if (!(this.createData.toBeConfirmed || this.createData.toBeDeleted)) { const e = []; let t = []; (n.eventType == 1 || n.eventType == 2) && (n.identifiers.forEach((s) => { if (s) { let o = s.data.id ? s.data.id : s.data.group; e.push(o); } }), t = n.zincObjects); let i, r; if (n.identifiers.length > 0 && n.identifiers[0] && (i = n.identifiers[0].data.id ? n.identifiers[0].data.id : n.identifiers[0].data.group, n.identifiers[0].data.region && (r = n.identifiers[0].data.region)), n.eventType == 1) if (this.viewingMode === "Annotation") { this.tData.label = i, this.tData.region = r; const s = U4(n); if (this._editingZincObject = s, s) { const o = this._editingZincObject.region.getFullPath() + "/", a6 = this._editingZincObject.groupName; this.annotationFeature = xM( this._editingZincObject, o, a6, this.url, "" ).feature; } this.activateAnnotationMode(e, n); } else this.$refs.scaffoldTreeControls && (e.length > 0 ? (this.$refs.scaffoldTreeControls.updateActiveUI(t), this.updatePrimitiveControls(t)) : (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls.removeActive(false))), n.identifiers.length === 1 ? this.lastSelected = { isSearch: false, region: r, group: n.identifiers[0].data.group } : n.identifiers.length === 0 && (this.lastSelected = { isSearch: false, region: "", group: "" }), this.$emit("scaffold-selected", n.identifiers); else if (n.eventType == 2) this.selectedObjects.length === 0 && (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls && (e.length > 0 ? this.$refs.scaffoldTreeControls.updateHoverUI(t) : this.$refs.scaffoldTreeControls.removeHover(true)), n.identifiers.length > 0 && n.identifiers[0] && n.identifiers[0].coords && (this.tData.active = false, (this.viewingMode !== "Annotation" || !this.annotationSidebar) && (this.tData.visible = true), this.tData.label = i, this.tData.region = r, this.tData.x = n.identifiers[0].coords.x, this.tData.y = n.identifiers[0].coords.y, this.createEditTemporaryLines(n.identifiers)), this.$emit("scaffold-highlighted", n.identifiers)); else if (n.eventType == 3 && n.identifiers.length > 0 && n.identifiers[0]) { if (n.identifiers[0].coords) { const s = this.$refs.scaffoldContainer.$el.getBoundingClientRect(); this.tData.x = n.identifiers[0].coords.x - s.left, this.tData.y = n.identifiers[0].coords.y - s.top; } this.createEditTemporaryLines(n.identifiers); } } }, /** * Get the coordinates of the current selected region. * * @public */ getCoordinatesOfSelected: function() { if (this.selectedObjects && this.selectedObjects.length > 0) return this.$module.scene.getObjectsScreenXY(this.selectedObjects); }, /** * Return an object containing the window coordinates of the * current selected region which will be updated after each render * loop. * * @public */ getDynamicSelectedCoordinates: function() { return this.$module.selectedScreenCoordinates; }, /** * Callback when time is changed through the UI. */ timeChange: function(n) { let e = n / this.timeMax * 100; e != this.currentTime && this.$module.updateTime(e); }, /** * Update primitive controls UI with the specified objects * * @arg objects objects to be set for the selected */ updatePrimitiveControls: function(n) { (this.viewingMode === "Exploration" || this.viewingMode === "Annotation") && (this.selectedObjects = n, this.selectedObjects && this.selectedObjects.length > 0 ? this.$refs.primitiveControls.setObject(this.selectedObjects[0]) : this.$refs.primitiveControls.setObject(void 0)); }, /** * A callback used by children components. Set the selected zinc object * * @arg Selected zinc objects * @arg Flag to determine if callback should be triggered when new selection * is made */ objectSelected: function(n, e) { this.$module.isIgnorePicking() || (this.updatePrimitiveControls(n), this.$module.setSelectedByZincObjects(n, void 0, {}, e)); }, /** * A callback used by children components. Set the highlighted zinc object * * @arg Hovered zinc objects * @arg Flag to determine if callback should be triggered when new selection * is made */ objectHovered: function(n, e) { this.hoveredObjects = n, this.$module.setHighlightedByZincObjects(n, void 0, {}, e); }, /** * Set the selected by name. * * @param {} name Name of the group */ changeActiveByName: function(n, e, t) { const i = Array.isArray(n); if (n === void 0 || i && n.length === 0) this.$refs.scaffoldTreeControls.removeActive(t); else { let r = n; i || (r = [r]), this.$refs.scaffoldTreeControls.changeActiveByNames(r, e, t); } }, /** * Set the highlighted by name. * * @param {name} name Name of the group */ changeHighlightedByName: function(n, e, t) { const i = Array.isArray(n); if (n === void 0 || i && n.length === 0) this.$refs.scaffoldTreeControls.removeHover(t); else { let r = n; i || (r = [r]), this.$refs.scaffoldTreeControls.changeHoverByNames(r, e, t); } }, /** * @public * Start the animation. * * @arg "flag to turn the animation on/off" */ play: function(n) { this.$module.playAnimation(n), this.isPlaying = n; }, /** * @public * Function to toggle on/off overlay help. */ setHelpMode: function(n) { const e = this.hoverVisibilities.length, t = e - 1, i = this.hoverVisibilities[this.helpModeActiveIndex]; if (i) { const r = i == null ? void 0 : i.refs, s = i == null ? void 0 : i.ref; this.$refs[r || s] || (this.helpModeActiveIndex += 1); } n || (this.helpModeActiveIndex = this.helpModeInitialIndex), n && this.helpModeActiveIndex >= t && this.$emit("help-mode-last-item", true), n && !this.helpModeDialog ? (this.inHelp = true, this.hoverVisibilities.forEach((r) => { r.value = true; })) : n && this.helpModeDialog && e > this.helpModeActiveIndex ? this.helpModeActiveIndex > -1 && setTimeout(() => { this.inHelp = false, this.hoverVisibilities.forEach((r) => { r.value = false; }), this.showHelpText(this.helpModeActiveIndex, 200); }, 300) : (this.inHelp = false, this.hoverVisibilities.forEach((r) => { r.value = false; })); }, /** * Callback function used by showRegionTooltip in the case when the tooltip * is out of view. */ displayTooltipOfObjectsCallback: function(n, e, t, i, r) { const s = this; return function() { s.$module.zincRenderer.removePostRenderCallbackFunction( s.$_regionTooltipCallback ), s.$_regionTooltipCallback = void 0, s.displayTooltipOfObjects(n, e, t, i, r); }; }, liveUpdateTooltipPosition: function() { this.$module.selectedCenter && (this.tData.x = this.$module.selectedScreenCoordinates.x, this.tData.y = this.$module.selectedScreenCoordinates.y); }, displayTooltipOfObjects: function(n, e, t, i, r) { if (e.length > 0) { let s = e[0].getClosestVertexDOMElementCoords( this.$module.scene ); if (s) return s.inView ? (n.includes("Search Results for") ? this.tData.active = false : this.tData.active = true, this.tData.visible = true, this.tData.label = n, this.tData.x = s.position.x, this.tData.y = s.position.y, this.tData.region = t, this.$_liveCoordinatesUpdated && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), r && (this.$module.setupLiveCoordinates(e), this.$_liveCoordinatesUpdated = this.$module.zincRenderer.addPostRenderCallbackFunction( this.liveUpdateTooltipPosition ))) : (this.hideRegionTooltip(), i && (this.$module.scene.viewAll(), this.$_regionTooltipCallback && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_regionTooltipCallback ), this.$_regionTooltipCallback = this.$module.zincRenderer.addPostRenderCallbackFunction( this.displayTooltipOfObjectsCallback( n, e, t, i, r ) ))), true; } return this.hideRegionTooltip(), false; }, /** * Display the tooltip used for displaying search result. * When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltipWithObjects: function(n, e, t, i, r) { return n && e && e.length > 0 && this.$module.scene ? this.displayTooltipOfObjects( n, e, t, i, r ) : (this.hideRegionTooltip(), false); }, /** * Display the tooltip. When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltip: function(n, e, t) { if (n && this.$module.scene) { const i = this.$module.scene.getRootRegion(), s = xo(i, [n], "", true); let o; return s && s.length > 0 && (o = s[0].getRegion().getFullPath()), this.showRegionTooltipWithObjects( n, s, o, e, t ); } return this.hideRegionTooltip(), false; }, /** * Display the tooltip using the list of annotations. * When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltipWithAnnotations: function(n, e, t) { if (this.$module.scene) { const i = _v(this.$module.scene, n); if (i && i.objects.length > 0) if (this.annotationSidebar) { const s = [{ featureId: (this.tData.region ? this.tData.region + "/" : "") + this.tData.label, resourceId: this.url, resource: this.url, feature: this.annotationFeature, offline: this.offlineAnnotationEnabled }]; this.$emit("annotation-open", { annotationEntry: s, createData: this.createData, confirmCreate: this.confirmCreate, cancelCreate: this.cancelCreate, confirmDelete: this.confirmDelete, confirmComment: this.confirmComment }); return; } else return this.showRegionTooltipWithObjects( i.label, i.objects, i.regionPath, e, t ); } return this.hideRegionTooltip(), false; }, clearAnnotationFeature: function() { const n = this.getOfflineAnnotations(); this.existDrawnFeatures.map((t) => decodeURIComponent(t.id).split("/").pop()).forEach((t) => { const i = this.$module.scene.findObjectsWithGroupName(t, false); if (i && i.length) { const r = i[0].region.getFullPath() + "/"; this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0]); } }), this.$refs.scaffoldTreeControls.removeRegion("__annotation"), this.offlineAnnotations = n; }, addAnnotationFeature: async function() { let n; if (this.offlineAnnotationEnabled) this.offlineAnnotations = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [], n = this.offlineAnnotations.filter((e) => e.resource === this.url && e.feature.properties.drawn).map((e) => e.feature); else { n = []; const e = await Ev(this.annotator, this.userToken, this.url); e && e.features && (n = [...e.features]); const t = await Ev(this.annotator, this.userToken, encodeURIComponent(this.url)); t && t.features && (n = [...n, ...t.features]); } this.existDrawnFeatures = markRaw(n), Cv(this.$module.scene, n); }, /** * Callback on viewing mode change * Optional, can be used to update the view mode. */ changeViewingMode: function(n) { let e = true; this.$module && (n && (this.viewingMode = n), this.clearAnnotationFeature(), this.viewingMode === "Annotation" ? (this.loading = true, this.annotator.authenticate(this.userToken).then((t) => { t.name && t.email && t.canUpdate ? (this.authorisedUser = t, this.offlineAnnotationEnabled = false) : (this.authorisedUser = void 0, this.offlineAnnotationEnabled = true), this.emitOfflineAnnotationUpdate(), this.addAnnotationFeature(), this.loading = false; })) : this.viewingMode === "Exploration" ? (this.activeDrawTool = void 0, this.activeDrawMode = void 0, this.createData.shape = "") : this.viewingMode === "Neuron Connection" && (e = false), this.viewingMode === "Exploration" || this.viewingMode === "Neuron Connection" || this.viewingMode === "Annotation" && this.createData.shape === "" ? this.$module.selectObjectOnPick = true : this.$module.selectObjectOnPick = false, this.cancelCreate(), n && this.setObjectIsPickable(e)); }, /** * Function to emit offline annotation enabled status */ emitOfflineAnnotationUpdate: function() { this.$emit("update-offline-annotation-enabled", this.offlineAnnotationEnabled); }, /** * @public * Hide the tooltip */ hideRegionTooltip: function() { this.$_liveCoordinatesUpdated && (this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), this.$module.setupLiveCoordinates(void 0)), this.tData.active = false, this.tData.visible = false, this.tData.region = void 0; }, /** * Currently will apply to non-nerve object and object without anatomical id * @param flag boolean to control whether objects pickable */ setObjectIsPickable: function(n) { this.$module.scene.getRootRegion().getAllObjects(true).forEach((t) => { var i; !((i = t.userData) != null && i.isNerves) && !t.anatomicalId && t.setIsPickable(n); }); }, /** * Update objects to greyscale or colour. * This will update all objects except those with the provided nerves labels. * @param flag boolean * @param labels array of nerve names that exclude from greyscale */ setGreyScale: function(n, e = []) { this.$module.scene.getRootRegion().getAllObjects(true).forEach((i) => { var a6; const r = i.groupName.toLowerCase(), s = (a6 = i.userData) == null ? void 0 : a6.isNerves; (e.length > 0 && s && !e.includes(r) || e.length === 0 && !s) && (i.setGreyScale(n), i.userData.isGreyScale = n); }), this.$refs.scaffoldTreeControls.updateAllNodeColours(); }, /** * @public * Function to toggle colour/greyscale of primitives. * The parameter ``flag`` is a boolean, ``true`` (colour) and ``false`` (greyscale). * @arg {Boolean} `flag` */ setColour: function(n, e = false) { this.isReady && this.$module.scene && typeof n == "boolean" && (e || n !== this.colourRadio) && (this.loading = true, setTimeout(() => { this.setGreyScale(!n), this.loading = false, this.colourRadio = n; }, 100)); }, /** * @public * Function to toggle lines graphics. * The parameter ``flag`` is a boolean, ``true`` to show lines, ``false`` to hide them. * @arg {Boolean} `flag` */ setOutlines: function(n, e = false) { this.isReady && this.$module.scene && typeof n == "boolean" && (e || n !== this.outlinesRadio) && (this.outlinesRadio = n, this.$nextTick(() => this.$refs.scaffoldTreeControls.setOutlines(n))); }, /** * Set the marker modes for objects with the provided name, mode can * be "on", "off" or "inherited". * Value can either be number or an object containing number and * imgURL. */ setMarkerModeForObjectsWithName: function(n, e, t) { if (n && this.$module.scene) { let i = e; typeof e == "number" && (i = { number: e, imgURL: void 0 }); const r = this.$module.scene.getRootRegion(); xo(r, [n], "", true).forEach((a6) => a6.setMarkerMode(t, i)); } }, /** * @public * Set the marker modes for objects specified by the list of annotations * @arg `annotations` * @arg `mode` */ setMarkerModeWithAnnotations: function(n, e) { if (this.$module.scene) { const t = _v(this.$module.scene, n); t && t.objects.length > 0 && t.objects.forEach((i) => i.setMarkerMode(e)); } }, /** * This is called when mouse cursor enters supported elements * with help tootltips. */ showHelpText: function(n, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[n]), this.helpTextWait[n] = setTimeout(() => { this.hoverVisibilities[n].value = true, this.$emit("shown-tooltip"); }, e)); }, /** * This is called when mouse cursor exits supported element.. */ hideHelpText: function(n, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[n]), this.helpTextWait[n] = setTimeout(() => { this.hoverVisibilities[n].value = false; }, e)); }, /** * @public * * Search a object and display the tooltip * @arg "text to search across" * @arg "toggle the tooltip if this is set" */ search: function(n, e) { if (this.$_searchIndex) { if (n === void 0 || n === "" || Array.isArray(n) && n.length === 0) return this.lastSelected = { region: "", group: "", isSearch: true }, this.objectSelected([], true), false; { this.lastSelected = { region: "", group: n, isSearch: true }; const t = this.$_searchIndex.searchAndProcessResult(n), i = t.zincObjects; if (i.length > 0) { if (this.objectSelected(i, true), e) for (let r = 0; r < i.length; r++) i[r] && i[r].groupName && this.showRegionTooltipWithObjects( t.label, i, t.regionPath, true, true ); return true; } else this.objectSelected([], true); } } return false; }, /** * @public * * Get the list of suggested terms based on the provided term. * This can be used for autocomplete. * @arg `term` */ fetchSuggestions: function(n) { return this.$_searchIndex === void 0 ? [] : this.$_searchIndex.auto_suggest(n); }, /** * Called when minimap settings has changed. Pass the * parameters to ZincJS and marked it for update. */ updateMinimapScissor: function() { Object.keys(this.minimapSettings).forEach((n) => { this.$module.scene.minimapScissor[n] = this.minimapSettings[n]; }), this.$module.scene.minimapScissor.updateRequired = true; }, updateSettingsfromScene: function() { this.currentSpeed = 1, this.$module.setPlayRate(this.defaultRate), this.orginalDuration = this.$module.scene.getMetadataTag("OriginalDuration"), this.animateDuration = this.$module.scene.getMetadataTag("Duration"); let n = this.$module.scene.getMetadataTag("TimeStamps"); this.timeStamps = {}; for (const e in n) this.timeStamps[n[e]] = e; this.timeMax = this.$module.scene.getDuration(); }, restoreSettings: function(n) { if (n) { if (n.viewport) this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport); else if (n.viewURL && n.viewURL !== "") { const t = new URL(n.viewURL, this.url); this.$module.scene.loadViewURL(t); } else n.region && n.region !== "" && this.viewRegion(n.region); n.visibility && this.$nextTick(() => { this.$refs.scaffoldTreeControls.setState(n.visibility); }), n.background && this.backgroundChangeCallback(n.background), "colour" in n && this.setColour(n.colour), n.offlineAnnotations && sessionStorage.setItem("anonymous-annotation", n.offlineAnnotations), "outlines" in n && this.setOutlines(n.outlines), n.viewingMode && this.changeViewingMode(n.viewingMode); const e = n.search; e && e.group && (e.isSearch ? this.search(e.group, true) : this.changeActiveByName(e.group, e.region, true)); } }, downloadErrorCallback: function() { return (n) => { this.$emit("on-error", n); }; }, setURLFinishCallback: function(n) { return () => { this.offlineAnnotations.length = 0, this.updateSettingsfromScene(), this.$module.updateTime(0.01), this.$module.updateTime(0), this.$module.unsetFinishDownloadCallback(), this.addRegionsToSearchIndex(), this.setMarkers(), this._boundingBoxGeo = this.$module.scene.addBoundingBoxPrimitive( "_helper", "boundingBox", 4251856, 0.15 ), this._slides = this.$module.scene.addSlicesPrimitive( "_helper", ["x-plane", "y-plane", "z-plane"], [16733525, 5635925, 5592575], 0.5 ); const { centre: e, size: t } = this.$module.getCentreAndSize(); this.boundingDims.centre = e, this.boundingDims.size = t, this.isReady = true, this.$nextTick(() => { this.restoreSettings(n), this.$emit("on-ready"); }); }; }, /** * Function used for getting the current states of the scene. This exported states * can be imported using the importStates method. * * @public */ getState: function() { let n = { format: this.fileFormat, url: this._currentURL, viewport: void 0, visibility: void 0, background: this.currentBackground, colour: this.colourRadio, outlines: this.outlinesRadio, viewingMode: this.viewingMode, usageConfig: this.usageConfig }; if (this.$refs.scaffoldTreeControls && (n.visibility = this.$refs.scaffoldTreeControls.getState()), this.$module.scene) { let e = this.$module.scene.getZincCameraControls(); n.viewport = e.getCurrentViewport(); } return this.lastSelected && this.lastSelected.group && (n.search = { ...this.lastSelected }), this.offlineAnnotationEnabled && (n.offlineAnnotations = sessionStorage.getItem("anonymous-annotation")), n; }, /** * Function used for importing the states of the scene. This exported states * can be imported using the read states method. * * @public * @arg `state` */ setState: function(n) { n && (n.url && n.url !== this._currentURL ? this.setURLAndState(n.url, { fileFormat: n.fileFormat, viewport: n.viewport, visibility: n.visibility, background: n.background, colour: n.colour, outlines: n.outlines, viewingMode: n.viewingMode, search: n.search, offlineAnnotations: n.offlineAnnotations }) : (n.background || n.colour || n.search || n.outlines || n.viewport || n.viewingMode || n.visibility) && (this.isReady && this.$module.scene ? this.restoreSettings(n) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: n.background, colour: n.colour, search: n.search, offlineAnnotations: n.offlineAnnotations, outlines: n.outlines, viewingMode: n.viewingMode, viewport: n.viewport, visibility: n.visibility }) ))); }, /** * export current scene in GLTF. * @arg "Return in binary form when set to true" * * @public */ exportGLTF: function(n) { return this.$module.scene.exportGLTF(n); }, /** * Return a copy of the local annotations list. * This list is used for storing user created annotation * when offlineAnnotationEnabled is set to true. * * @public */ getOfflineAnnotations: function() { return [...this.offlineAnnotations]; }, /** * Import local annotations. The annotations will only * be imported when offlineAnnotationEnabled is set to * true; * * @public * @arg {Array} `annotationsList` */ importOfflineAnnotations: function(n) { if (this.offlineAnnotationEnabled) { n.forEach((t) => { const i = t.group, r = t.region; let s = r.slice(-1) === "/" ? r : r + "/"; const o = s.slice(0, -1); t.region = o, s = s + i; const a6 = s; t.item.id = a6, t.feature.id = a6; }); const e = n.map((t) => t.feature); Cv(this.$module.scene, e), n.forEach((t) => { this.offlineAnnotations.push({ ...t }); }), sessionStorage.setItem("anonymous-annotation", JSON.stringify(this.offlineAnnotations)); } }, /** * Function used for reading in new scaffold metadata and a custom * viewport. This function will ignore the state prop and * read in the new url. * * @public * @arg `newValue` * @arg `state` */ setURLAndState: function(n, e) { var t, i; if (n != this._currentURL) { const r = {}; e != null && e.format && (this.fileFormat = e.format), this._currentURL = n, this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.loading = true, this.timeVarying = false, this.isReady = false, this.$_searchIndex.removeAll(), this.hideRegionTooltip(), this.$module.setDownloadErrorCallback( this.downloadErrorCallback() ), this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: e == null ? void 0 : e.background, colour: e == null ? void 0 : e.colour, outlines: e == null ? void 0 : e.outlines, region: this.region, search: e == null ? void 0 : e.search, viewingMode: e == null ? void 0 : e.viewingMode, viewURL: this.viewURL, viewport: e == null ? void 0 : e.viewport, visibility: e == null ? void 0 : e.visibility, offlineAnnotations: e == null ? void 0 : e.offlineAnnotations }) ), this.fileFormat === "gltf" ? this.$module.loadGLTFFromURL(n, "scene", true) : (((t = this == null ? void 0 : this.usageConfig) != null && t.tubeLines || (i = e == null ? void 0 : e.usageConfig) != null && i.tubeLines) && (r.tubeLines = true), this.$module.loadOrgansFromURL( n, void 0, void 0, "scene", void 0, true, r )), this.$module && this.$module.scene && (this.$module.scene.displayMarkers = this.displayMarkers, this.$module.scene.forcePickableObjectsUpdate = true, this.$module.scene.displayMinimap = this.displayMinimap, this.updateMinimapScissor()); } }, /** * Function used for reading in new scaffold metadata. This function will ignore * the state prop and read in the new url. * * @public * @arg `newValue` */ setURL: function(n) { this.setURLAndState(n, void 0); }, /** * Callback when drawer is toggled. */ drawerToggled: function(n) { this.drawerOpen = n, this.adjustLayout(); }, /** * Callback using ResizeObserver. */ adjustLayout: function() { var n; if ((n = this.$refs.scaffoldContainer) != null && n.$el) { let e = this.$refs.scaffoldContainer.$el.clientWidth; this.minimisedSlider = e < 812, this.minimisedSlider ? this.sliderPosition = this.drawerOpen ? "right" : "left" : this.sliderPosition = ""; } }, toggleRendering: function(n) { this.$module.zincRenderer && (n ? this.$module.zincRenderer.animate() : this.$module.zincRenderer.stopAnimate()); }, /** * @public * * Force the renderer to resize */ forceResize: function() { this.$module.zincRenderer && this.$module.zincRenderer.onWindowResize(); }, syncControlCallback: function() { const n = this.$module.NDCCameraControl.getPanZoom(); this.tData.visible && this.showRegionTooltip(this.tData.label, true, true), this.$emit("scaffold-navigated", n); }, /** * Rotate mode - "none", "horizontal", "vertical", "free" but * it will be ignored if flag is set to false. */ toggleSyncControl: function(n, e) { this.$module.toggleSyncControl(n, e), this.$module.setSyncControlCallback(this.syncControlCallback); }, /** * Set the markers for the scene. */ setMarkers: function() { for (const [n, e] of Object.entries(this.markerLabels)) this.setMarkerModeForObjectsWithName(n, e, "on"); } } }; var V5 = { class: "primitive-controls-box" }; var G5 = { class: "animation-data" }; var H5 = { class: "purple" }; var W5 = { class: "animation-data" }; var j5 = { class: "purple" }; var $5 = { class: "animation-data" }; var Z5 = { class: "bottom-right-control control-layer" }; var X5 = { class: "control-layer" }; var Y5 = { style: { "margin-bottom": "2px" } }; var J5 = { key: 0, class: "viewing-mode-title" }; var K5 = ["onClick"]; var q5 = ["onClick"]; function Q5(n, e, t, i, r, s) { const o = resolveComponent("map-svg-sprite-color"), a6 = CM, c = resolveComponent("DrawToolbar"), l = u0, d = It, h6 = cu, f6 = EM, g6 = TM, p = resolveComponent("map-svg-icon"), u6 = ti, y6 = Ui, v6 = xy, m6 = Qo, x6 = qo, w6 = by, A6 = Ko, M6 = ty, R6 = ny, L6 = My, T6 = td; return withDirectives((openBlock(), createBlock(L6, { ref: "scaffoldContainer", class: "scaffold-container", "element-loading-text": "Loading...", "element-loading-background": "rgba(0, 0, 0, 0.3)", positionalRotation: t.positionalRotation, onOnRotationModeChange: s.setRotationMode }, { default: withCtx(() => [ createVNode(o), createVNode(a6, { createData: n.createData, label: n.tData.label, region: n.tData.region, visible: n.tData.visible, x: n.tData.x, y: n.tData.y, annotationDisplay: s.annotationDisplay, annotationFeature: n.annotationFeature, offlineAnnotationEnabled: n.offlineAnnotationEnabled, onConfirmCreate: e[0] || (e[0] = (P6) => s.confirmCreate(P6)), onCancelCreate: e[1] || (e[1] = (P6) => s.cancelCreate()), onConfirmComment: e[2] || (e[2] = (P6) => s.confirmComment(P6)), onConfirmDelete: e[3] || (e[3] = (P6) => s.confirmDelete()), onTooltipHide: e[4] || (e[4] = (P6) => s.onTooltipHide()) }, null, 8, ["createData", "label", "region", "visible", "x", "y", "annotationDisplay", "annotationFeature", "offlineAnnotationEnabled"]), createBaseVNode("div", { id: "organsDisplayArea", ref: "display", tabindex: "-1", style: { height: "100%", width: "100%" }, onKeydown: e[5] || (e[5] = withKeys((...P6) => s.backgroundChangeCallback && s.backgroundChangeCallback(...P6), ["66"])) }, null, 544), withDirectives(createBaseVNode("div", null, [ n.viewingMode === "Annotation" && (n.authorisedUser || n.offlineAnnotationEnabled) ? (openBlock(), createBlock(c, { key: 0, class: "control-layer", toolbarOptions: n.toolbarOptions, activeDrawTool: n.activeDrawTool, activeDrawMode: n.activeDrawMode, hoverVisibilities: n.hoverVisibilities, onClickToolbar: s.toggleDrawing, onShowTooltip: s.showHelpText, onHideTooltip: s.hideHelpText, ref: "toolbarPopover" }, null, 8, ["toolbarOptions", "activeDrawTool", "activeDrawMode", "hoverVisibilities", "onClickToolbar", "onShowTooltip", "onHideTooltip"])) : createCommentVNode("", true), t.displayWarning ? (openBlock(), createBlock(h6, { key: 1, ref: "warningPopover", visible: n.hoverVisibilities[7].value, content: t.warningMessage, placement: "right", width: "max-content", teleported: false, "popper-class": "scaffold-popper message-popper right-popper non-selectable" }, { reference: withCtx(() => [ t.displayWarning ? (openBlock(), createElementBlock("div", { key: 0, class: "message-icon warning-icon control-layer", onMouseover: e[6] || (e[6] = (P6) => s.showHelpText(7)), onMouseout: e[7] || (e[7] = (P6) => s.hideHelpText(7)) }, [ createVNode(d, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }), e[31] || (e[31] = createBaseVNode("span", { class: "message-text" }, "Beta", -1)) ], 32)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible", "content"])) : createCommentVNode("", true), t.displayLatestChanges ? (openBlock(), createBlock(h6, { key: 2, visible: n.hoverVisibilities[8].value, content: t.latestChangesMessage, placement: "right", teleported: false, trigger: "manual", "popper-class": "scaffold-popper message-popper right-popper non-selectable", ref: "whatsNewPopover" }, { reference: withCtx(() => [ t.displayLatestChanges && t.latestChangesMessage ? (openBlock(), createElementBlock("div", { key: 0, class: "el-icon-warning message-icon latest-changesicon control-layer", onMouseover: e[8] || (e[8] = (P6) => s.showHelpText(8)), onMouseout: e[9] || (e[9] = (P6) => s.hideHelpText(8)) }, [ createVNode(d, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }), e[32] || (e[32] = createBaseVNode("span", { class: "message-text" }, "What's new?", -1)) ], 32)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible", "content"])) : createCommentVNode("", true), createVNode(h6, { visible: n.hoverVisibilities[6].value, content: "Change region visibility", placement: "right", width: "max-content", teleported: false, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "regionVisibilityPopover" }, { reference: withCtx(() => [ createVNode(f6, { class: "control-layer", ref: "scaffoldTreeControls", isReady: n.isReady, "show-colour-picker": s.enableColourPicker, onObjectSelected: s.objectSelected, onObjectHovered: s.objectHovered, onDrawerToggled: s.drawerToggled }, null, 8, ["isReady", "show-colour-picker", "onObjectSelected", "onObjectHovered", "onDrawerToggled"]) ]), _: 1 }, 8, ["visible"]), createBaseVNode("div", V5, [ createVNode(g6, { class: "control-layer", ref: "primitiveControls", createData: n.createData, viewingMode: n.viewingMode, usageConfig: t.usageConfig, onPrimitivesUpdated: s.primitivesUpdated }, null, 8, ["createData", "viewingMode", "usageConfig", "onPrimitivesUpdated"]) ]), n.timeVarying ? (openBlock(), createBlock(h6, { key: 3, ref: "sliderPopover", width: "max-content", visible: n.hoverVisibilities[5].value, content: "Move the slider to animate the region", placement: "top", teleported: false, trigger: "manual", "popper-class": "scaffold-popper top-popper non-selectable" }, { reference: withCtx(() => [ n.timeVarying ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(["time-slider-container control-layer", [n.minimisedSlider ? "minimised" : "", n.sliderPosition]]) }, [ createVNode(w6, { type: "card" }, { default: withCtx(() => [ createVNode(v6, { label: "Animate scaffold" }, { default: withCtx(() => [ createVNode(y6, { class: "tab-content" }, { default: withCtx(() => [ n.isPlaying ? (openBlock(), createBlock(p, { key: 0, icon: "pause", class: "icon-button video-button", onClick: e[10] || (e[10] = (P6) => s.play(false)) })) : (openBlock(), createBlock(p, { key: 1, icon: "play", class: "video-button icon-button", onClick: e[11] || (e[11] = (P6) => s.play(true)) })), createVNode(u6, { min: 0, max: n.timeMax, "model-value": n.currentTime / 100 * n.timeMax, step: 0.1, "tooltip-class": "time-slider-tooltip", class: "slider", "format-tooltip": s.formatTooltip, marks: n.timeStamps, onInput: e[12] || (e[12] = (P6) => s.timeChange(P6)) }, null, 8, ["max", "model-value", "format-tooltip", "marks"]) ]), _: 1 }) ]), _: 1 }), createVNode(v6, { label: "Animation data" }, { default: withCtx(() => [ createVNode(y6, { class: "tab-content" }, { default: withCtx(() => [ createBaseVNode("div", G5, [ e[33] || (e[33] = createTextVNode(" Original duration: ")), createBaseVNode("div", H5, toDisplayString(n.orginalDuration), 1) ]), createBaseVNode("div", W5, [ e[34] || (e[34] = createTextVNode(" Animation duration: ")), createBaseVNode("div", j5, toDisplayString(n.animateDuration), 1) ]), createBaseVNode("div", $5, [ e[35] || (e[35] = createTextVNode(" Playback speed ")), createVNode(x6, { teleported: true, "model-value": n.currentSpeed, placeholder: "Select", class: "scaffold-select-box speed", "popper-class": "scaffold_viewer_dropdown", onChange: e[13] || (e[13] = (P6) => s.speedChanged(P6)) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.playSpeed, (P6) => (openBlock(), createBlock(m6, { key: P6.value, label: P6.label, value: P6.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ], 2)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), createBaseVNode("div", Z5, [ createVNode(h6, { visible: n.hoverVisibilities[0].value, content: "Zoom in", width: "max-content", placement: "left", teleported: false, trigger: "manual", "popper-class": "scaffold-popper left-popper non-selectable", ref: "zoomInPopover" }, { reference: withCtx(() => [ createVNode(p, { icon: "zoomIn", class: "icon-button zoomIn", onClick: e[14] || (e[14] = (P6) => s.zoomIn()), onMouseover: e[15] || (e[15] = (P6) => s.showHelpText(0)), onMouseout: e[16] || (e[16] = (P6) => s.hideHelpText(0)) }) ]), _: 1 }, 8, ["visible"]), createVNode(h6, { visible: n.hoverVisibilities[1].value, content: "Zoom out", placement: "top-end", width: "max-content", teleported: false, trigger: "manual", "popper-class": "scaffold-popper popper-zoomout non-selectable", ref: "zoomOutPopover" }, { reference: withCtx(() => [ createVNode(p, { icon: "zoomOut", class: "icon-button zoomOut", onClick: e[17] || (e[17] = (P6) => s.zoomOut()), onMouseover: e[18] || (e[18] = (P6) => s.showHelpText(1)), onMouseout: e[19] || (e[19] = (P6) => s.hideHelpText(1)) }) ]), _: 1 }, 8, ["visible"]), createVNode(h6, { visible: n.hoverVisibilities[2].value, placement: "top", teleported: false, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper non-selectable", ref: "zoomFitPopover" }, { reference: withCtx(() => [ createVNode(p, { icon: "fitWindow", class: "icon-button fitWindow", onClick: e[20] || (e[20] = (P6) => s.fitWindow()), onMouseover: e[21] || (e[21] = (P6) => s.showHelpText(2)), onMouseout: e[22] || (e[22] = (P6) => s.hideHelpText(2)) }) ]), default: withCtx(() => [ e[36] || (e[36] = createBaseVNode("div", null, [ createTextVNode(" Fit to "), createBaseVNode("br"), createTextVNode(" window ") ], -1)) ]), _: 1 }, 8, ["visible"]) ]), n.openMapRef ? (openBlock(), createBlock(h6, { key: 4, ref: "open-map-popover", "virtual-ref": n.openMapRef, placement: "top-start", width: "128", teleported: false, trigger: "click", "popper-class": "open-map-popper", "virtual-triggering": "" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t.openMapOptions, (P6) => (openBlock(), createBlock(y6, { key: P6.key }, { default: withCtx(() => [ createVNode(A6, { type: "primary", plain: "", onClick: (_6) => n.$emit("open-map", P6.key) }, { default: withCtx(() => [ createTextVNode(toDisplayString(P6.display), 1) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }, 8, ["virtual-ref"])) : createCommentVNode("", true), createVNode(h6, { ref: "backgroundPopover", "virtual-ref": n.backgroundIconRef, placement: "top-start", width: "320", teleported: false, trigger: "click", "popper-class": "background-popper non-selectable h-auto", "virtual-triggering": "" }, { default: withCtx(() => [ createBaseVNode("div", X5, [ createVNode(y6, { class: "backgroundText" }, { default: withCtx(() => e[37] || (e[37] = [ createTextVNode("Viewing Mode") ])), _: 1 }), createVNode(y6, { class: "backgroundControl" }, { default: withCtx(() => [ createBaseVNode("div", Y5, [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.viewingModes, (P6, _6, S6) => (openBlock(), createElementBlock(Fragment, { key: _6 }, [ _6 === n.viewingMode ? (openBlock(), createElementBlock("span", J5, [ createBaseVNode("b", null, toDisplayString(_6), 1) ])) : (openBlock(), createElementBlock("span", { key: 1, class: "viewing-mode-unselected", onClick: (E6) => s.changeViewingMode(_6) }, toDisplayString(_6), 9, K5)) ], 64))), 128)) ]), createVNode(y6, { class: "viewing-mode-description" }, { default: withCtx(() => [ createTextVNode(toDisplayString(s.modeDescription), 1) ]), _: 1 }), n.viewingMode === "Annotation" && n.offlineAnnotationEnabled ? (openBlock(), createBlock(y6, { key: 0, class: "viewing-mode-description" }, { default: withCtx(() => e[38] || (e[38] = [ createTextVNode(" (Anonymous annotate) ") ])), _: 1 })) : createCommentVNode("", true) ]), _: 1 }), createVNode(y6, { class: "backgroundSpacer" }), createVNode(y6, { class: "backgroundText" }, { default: withCtx(() => e[39] || (e[39] = [ createTextVNode("Organs display") ])), _: 1 }), createVNode(y6, { class: "backgroundControl" }, { default: withCtx(() => [ createVNode(R6, { modelValue: n.colourRadio, "onUpdate:modelValue": e[23] || (e[23] = (P6) => n.colourRadio = P6), class: "scaffold-radio", onChange: e[24] || (e[24] = (P6) => s.setColour(n.colourRadio, true)) }, { default: withCtx(() => [ createVNode(M6, { value: true }, { default: withCtx(() => e[40] || (e[40] = [ createTextVNode("Colour") ])), _: 1 }), createVNode(M6, { value: false }, { default: withCtx(() => e[41] || (e[41] = [ createTextVNode("Greyscale") ])), _: 1 }) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }), createVNode(y6, { class: "backgroundSpacer" }), createVNode(y6, { class: "backgroundText" }, { default: withCtx(() => e[42] || (e[42] = [ createTextVNode("Outlines display") ])), _: 1 }), createVNode(y6, { class: "backgroundControl" }, { default: withCtx(() => [ createVNode(R6, { modelValue: n.outlinesRadio, "onUpdate:modelValue": e[25] || (e[25] = (P6) => n.outlinesRadio = P6), class: "scaffold-radio", onChange: e[26] || (e[26] = (P6) => s.setOutlines(n.outlinesRadio, true)) }, { default: withCtx(() => [ createVNode(M6, { value: true }, { default: withCtx(() => e[43] || (e[43] = [ createTextVNode("Show") ])), _: 1 }), createVNode(M6, { value: false }, { default: withCtx(() => e[44] || (e[44] = [ createTextVNode("Hide") ])), _: 1 }) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }), createVNode(y6, { class: "backgroundSpacer" }), createVNode(y6, { class: "backgroundText" }, { default: withCtx(() => e[45] || (e[45] = [ createTextVNode(" Change background ") ])), _: 1 }), createVNode(y6, { class: "backgroundChooser" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.availableBackground, (P6) => (openBlock(), createElementBlock("div", { key: P6, class: normalizeClass([ "backgroundChoice", P6, P6 == n.currentBackground ? "active" : "" ]), onClick: (_6) => s.backgroundChangeCallback(P6) }, null, 10, q5))), 128)) ]), _: 1 }) ]) ]), _: 1 }, 8, ["virtual-ref"]), createBaseVNode("div", { class: normalizeClass(["settings-group control-layer", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ t.showOpenMapButton ? (openBlock(), createBlock(y6, { key: 0 }, { default: withCtx(() => [ createVNode(h6, { visible: n.hoverVisibilities[3].value, content: "Open new map", placement: "right", teleported: false, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper right-popper non-selectable", ref: "openMapPopover" }, { reference: withCtx(() => [ t.enableOpenMapUI && t.openMapOptions.length > 0 ? (openBlock(), createBlock(p, { key: 0, ref: "openMapRef", icon: "openMap", class: "icon-button open-map-button", onMouseover: e[27] || (e[27] = (P6) => s.showHelpText(3)), onMouseout: e[28] || (e[28] = (P6) => s.hideHelpText(3)) }, null, 512)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible"]) ]), _: 1 })) : createCommentVNode("", true), t.showLocalSettings ? (openBlock(), createBlock(y6, { key: 1 }, { default: withCtx(() => [ createVNode(h6, { visible: n.hoverVisibilities[4].value, content: "Change background color", placement: "right", width: "max-content", teleported: false, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "settingsPopover" }, { reference: withCtx(() => [ createVNode(p, { ref: "backgroundIconRef", icon: "changeBckgd", class: "icon-button", onMouseover: e[29] || (e[29] = (P6) => s.showHelpText(4)), onMouseout: e[30] || (e[30] = (P6) => s.hideHelpText(4)) }, null, 512) ]), _: 1 }, 8, ["visible"]) ]), _: 1 })) : createCommentVNode("", true) ], 2) ], 512), [ [vShow, t.displayUI && !n.isTransitioning] ]) ]), _: 1 }, 8, ["positionalRotation", "onOnRotationModeChange"])), [ [T6, n.loading] ]); } var sU = ki(k5, [["render", Q5], ["__scopeId", "data-v-0a5e41b2"]]); export { sU as ScaffoldVuer }; /*! Bundled license information: @abi-software/scaffoldvuer/dist/scaffoldvuer.js: (** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **) (*! Element Plus Icons Vue v2.3.1 *) (** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT *) */ //# sourceMappingURL=@abi-software_scaffoldvuer.js.map