diff --git a/demo/lib/iflow-engine.es.js b/demo/lib/iflow-engine.es.js index 3554620..76f9f9a 100644 --- a/demo/lib/iflow-engine.es.js +++ b/demo/lib/iflow-engine.es.js @@ -405,7 +405,7 @@ class ng { this.listeners.forEach((e) => e(this.currentLocale)); } } -const Jt = new ng(), Ce = (s) => Jt.t(s), cd = { +const Jt = new ng(), Ce = (s) => Jt.t(s), ld = { name: "light", primary: "#2563eb", primaryHover: "#1d4ed8", @@ -593,7 +593,7 @@ const Jt = new ng(), Ce = (s) => Jt.t(s), cd = { } }; class sg { - currentTheme = cd; + currentTheme = ld; listeners = []; constructor() { } @@ -608,7 +608,7 @@ class sg { * @param themeName 'dark' | 'light' */ setTheme(e) { - e === "light" ? this.applyTheme(cd) : this.applyTheme(ig); + e === "light" ? this.applyTheme(ld) : this.applyTheme(ig); } /** * 应用自定义主题配置 @@ -679,7 +679,7 @@ class rg { this.events.clear(); } } -class wt { +class Tt { /** 单例实例 */ static instance = null; /** 事件发射器 */ @@ -722,11 +722,11 @@ class wt { } /** 获取单例实例 */ static getInstance() { - return wt.instance || (wt.instance = new wt()), wt.instance; + return Tt.instance || (Tt.instance = new Tt()), Tt.instance; } /** 重置单例(用于测试或重新初始化) */ static reset() { - wt.instance && (wt.instance.eventEmitter.clear(), wt.instance = null); + Tt.instance && (Tt.instance.eventEmitter.clear(), Tt.instance = null); } /** * 发送事件 @@ -758,7 +758,7 @@ class wt { this.eventEmitter.clear(); } } -class yu { +class bu { container; options; groups = []; @@ -799,7 +799,7 @@ class yu { }), this.initContainer(), this.applyStyles(); } emit(e, t) { - wt.getInstance().emit(e, t); + Tt.getInstance().emit(e, t); } initContainer() { this.container.innerHTML = "", this.container.classList.add("bim-btn-group-root"), this.options.direction === "column" ? this.container.classList.add("dir-column") : this.container.classList.add("dir-row"), this.options.className && this.container.classList.add(this.options.className), this.options.type && this.options.type !== "default" && this.container.classList.add(`type-${this.options.type}`), this.updatePosition(), this.setupEventInterception(this.container); @@ -1133,11 +1133,11 @@ class yu { this.unsubscribeLocale && (this.unsubscribeLocale(), this.unsubscribeLocale = null), this.unsubscribeTheme && (this.unsubscribeTheme(), this.unsubscribeTheme = null), this.closeDropdown(), this.container.innerHTML = "", this.btnRefs.clear(); } } -class og extends yu { +class og extends bu { async init() { await super.init(); - const { createHomeButton: e } = await Promise.resolve().then(() => XT), { createZoomBoxButton: t } = await Promise.resolve().then(() => qT), { createWalkMenuButton: n } = await Promise.resolve().then(() => YT), { createMapButton: i } = await Promise.resolve().then(() => $T), { createPropertyButton: r } = await Promise.resolve().then(() => QT), { createSettingButton: o } = await Promise.resolve().then(() => tA), { createInfoButton: a } = await Promise.resolve().then(() => iA), { createFullscreenButton: l } = await Promise.resolve().then(() => rA), { createMeasureButton: c } = await Promise.resolve().then(() => aA), { createSectionMenuButton: h } = await Promise.resolve().then(() => cA), { createSectionPlaneButton: u } = await Promise.resolve().then(() => uA), { createSectionAxisButton: d } = await Promise.resolve().then(() => fA), { createSectionBoxButton: f } = await Promise.resolve().then(() => mA); - this.addGroup("group-1"), this.addButton(e()), this.addButton(t()), this.addButton(c()), this.addButton(h()), this.addButton(u()), this.addButton(d()), this.addButton(f()), this.addButton(n()), this.addButton(i()), this.addButton(r()), this.addGroup("group-2"), this.addButton(o()), this.addButton(a()), this.addButton(l()), this.render(); + const { createHomeButton: e } = await Promise.resolve().then(() => XT), { createZoomBoxButton: t } = await Promise.resolve().then(() => ZT), { createWalkMenuButton: n } = await Promise.resolve().then(() => YT), { createPropertyButton: i } = await Promise.resolve().then(() => $T), { createSettingButton: r } = await Promise.resolve().then(() => QT), { createInfoButton: o } = await Promise.resolve().then(() => tA), { createFullscreenButton: a } = await Promise.resolve().then(() => iA), { createMeasureButton: l } = await Promise.resolve().then(() => rA), { createSectionMenuButton: c } = await Promise.resolve().then(() => aA), { createSectionPlaneButton: h } = await Promise.resolve().then(() => cA), { createSectionAxisButton: u } = await Promise.resolve().then(() => uA), { createSectionBoxButton: d } = await Promise.resolve().then(() => fA); + this.addGroup("group-1"), this.addButton(e()), this.addButton(t()), this.addButton(l()), this.addButton(c()), this.addButton(h()), this.addButton(u()), this.addButton(d()), this.addButton(n()), this.addButton(i()), this.addGroup("group-2"), this.addButton(r()), this.addButton(o()), this.addButton(a()), this.render(); } } class Ii { @@ -1146,7 +1146,7 @@ class Ii { /** 事件订阅列表,用于自动清理 */ subscriptions = []; constructor() { - this.registry = wt.getInstance(); + this.registry = Tt.getInstance(); } /** * 订阅事件(自动追踪,destroy 时自动取消) @@ -1306,7 +1306,7 @@ class lg extends Ii { * @returns 按钮组实例 */ create(e, t) { - const n = new yu({ + const n = new bu({ container: this.container, ...t }); @@ -1519,8 +1519,8 @@ class Qp { f.preventDefault(), f.stopPropagation(), e = f.clientX, t = f.clientY, n = this.element.offsetLeft, i = this.element.offsetTop, r = this.container.clientWidth, o = this.container.clientHeight, a = this.element.offsetWidth, l = this.element.offsetHeight, c = this.options.bottomOffset ?? 70, document.addEventListener("mousemove", u, { capture: !0 }), document.addEventListener("mouseup", d, { capture: !0 }); }, u = (f) => { f.preventDefault(), f.stopPropagation(), !this.rafId && (this.rafId = requestAnimationFrame(() => { - const p = f.clientX - e, g = f.clientY - t; - let x = n + p, m = i + g; + const g = f.clientX - e, p = f.clientY - t; + let x = n + g, m = i + p; const b = r - a, v = o - l - c; x = Math.max(0, Math.min(x, b)), m = Math.max(0, Math.min(m, v)), this.element.style.left = `${x}px`, this.element.style.top = `${m}px`, this.rafId = null; })); @@ -1652,21 +1652,21 @@ class hg extends Ii { this.activeDialogs.forEach((e) => e.destroy()), this.activeDialogs = [], super.destroy(); } } -const Do = "181", fr = { ROTATE: 0, DOLLY: 1, PAN: 2 }, cr = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, ug = 0, hd = 1, dg = 2, em = 1, tm = 2, Si = 3, Fn = 0, un = 1, At = 2, Xt = 0, pr = 1, sh = 2, ud = 3, dd = 4, nm = 5, Zn = 100, fg = 101, pg = 102, mg = 103, gg = 104, lo = 200, xg = 201, vg = 202, bg = 203, rh = 204, oh = 205, ah = 206, yg = 207, lh = 208, _g = 209, Mg = 210, wg = 211, Sg = 212, Eg = 213, Tg = 214, ch = 0, hh = 1, uh = 2, vr = 3, dh = 4, fh = 5, ph = 6, mh = 7, Tl = 0, Ag = 1, Cg = 2, Ki = 0, im = 1, sm = 2, rm = 3, _u = 4, om = 5, am = 6, lm = 7, fd = "attached", Pg = "detached", cm = 300, br = 301, yr = 302, gh = 303, xh = 304, Al = 306, hi = 1e3, ai = 1001, pl = 1002, Qt = 1003, hm = 1004, co = 1005, Yt = 1006, el = 1007, Ai = 1008, Jn = 1009, um = 1010, dm = 1011, wo = 1012, Mu = 1013, Ms = 1014, $n = 1015, Un = 1016, wu = 1017, Su = 1018, _r = 1020, fm = 35902, pm = 35899, mm = 1021, gm = 1022, xn = 1023, So = 1026, Mr = 1027, Eu = 1028, Tu = 1029, Au = 1030, Cu = 1031, Pu = 1033, tl = 33776, nl = 33777, il = 33778, sl = 33779, vh = 35840, bh = 35841, yh = 35842, _h = 35843, Mh = 36196, wh = 37492, Sh = 37496, Eh = 37808, Th = 37809, Ah = 37810, Ch = 37811, Ph = 37812, Rh = 37813, Lh = 37814, Dh = 37815, Ih = 37816, Bh = 37817, Nh = 37818, kh = 37819, Uh = 37820, Oh = 37821, Fh = 36492, zh = 36494, Hh = 36495, Vh = 36283, Gh = 36284, Wh = 36285, Xh = 36286, Eo = 2300, To = 2301, zl = 2302, pd = 2400, md = 2401, gd = 2402, Rg = 2500, Lg = 0, xm = 1, jh = 2, Dg = 3200, Ig = 3201, Io = 0, Bg = 1, Xi = "", xt = "srgb", Bt = "srgb-linear", ml = "linear", lt = "srgb", Bs = 7680, xd = 519, Ng = 512, kg = 513, Ug = 514, vm = 515, Og = 516, Fg = 517, zg = 518, Hg = 519, qh = 35044, vd = "300 es", li = 2e3, gl = 2001; +const Io = "181", pr = { ROTATE: 0, DOLLY: 1, PAN: 2 }, hr = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, ug = 0, cd = 1, dg = 2, em = 1, tm = 2, Si = 3, Fn = 0, un = 1, At = 2, Xt = 0, mr = 1, sh = 2, hd = 3, ud = 4, nm = 5, qn = 100, fg = 101, pg = 102, mg = 103, gg = 104, co = 200, xg = 201, vg = 202, bg = 203, rh = 204, oh = 205, ah = 206, yg = 207, lh = 208, _g = 209, Mg = 210, wg = 211, Sg = 212, Eg = 213, Tg = 214, ch = 0, hh = 1, uh = 2, br = 3, dh = 4, fh = 5, ph = 6, mh = 7, Tl = 0, Ag = 1, Cg = 2, Ki = 0, im = 1, sm = 2, rm = 3, yu = 4, om = 5, am = 6, lm = 7, dd = "attached", Pg = "detached", cm = 300, yr = 301, _r = 302, gh = 303, xh = 304, Al = 306, hi = 1e3, ai = 1001, fl = 1002, Qt = 1003, hm = 1004, ho = 1005, Yt = 1006, Qa = 1007, Ai = 1008, Jn = 1009, um = 1010, dm = 1011, So = 1012, _u = 1013, Ms = 1014, $n = 1015, On = 1016, Mu = 1017, wu = 1018, Mr = 1020, fm = 35902, pm = 35899, mm = 1021, gm = 1022, xn = 1023, Eo = 1026, wr = 1027, Su = 1028, Eu = 1029, Tu = 1030, Au = 1031, Cu = 1033, el = 33776, tl = 33777, nl = 33778, il = 33779, vh = 35840, bh = 35841, yh = 35842, _h = 35843, Mh = 36196, wh = 37492, Sh = 37496, Eh = 37808, Th = 37809, Ah = 37810, Ch = 37811, Ph = 37812, Rh = 37813, Lh = 37814, Dh = 37815, Ih = 37816, Bh = 37817, Nh = 37818, Uh = 37819, Oh = 37820, kh = 37821, Fh = 36492, zh = 36494, Hh = 36495, Vh = 36283, Gh = 36284, Wh = 36285, Xh = 36286, To = 2300, Ao = 2301, zl = 2302, fd = 2400, pd = 2401, md = 2402, Rg = 2500, Lg = 0, xm = 1, jh = 2, Dg = 3200, Ig = 3201, Bo = 0, Bg = 1, Xi = "", xt = "srgb", It = "srgb-linear", pl = "linear", lt = "srgb", Ns = 7680, gd = 519, Ng = 512, Ug = 513, Og = 514, vm = 515, kg = 516, Fg = 517, zg = 518, Hg = 519, Zh = 35044, xd = "300 es", li = 2e3, ml = 2001; function bm(s) { for (let e = s.length - 1; e >= 0; --e) if (s[e] >= 65535) return !0; return !1; } -function Ao(s) { +function Co(s) { return document.createElementNS("http://www.w3.org/1999/xhtml", s); } function Vg() { - const s = Ao("canvas"); + const s = Co("canvas"); return s.style.display = "block", s; } -const bd = {}; -function xl(...s) { +const vd = {}; +function gl(...s) { const e = "THREE." + s.shift(); console.log(e, ...s); } @@ -1678,9 +1678,9 @@ function et(...s) { const e = "THREE." + s.shift(); console.error(e, ...s); } -function Co(...s) { +function Po(...s) { const e = s.join(" "); - e in bd || (bd[e] = !0, He(...s)); + e in vd || (vd[e] = !0, He(...s)); } function Gg(s, e, t) { return new Promise(function(n, i) { @@ -1699,7 +1699,7 @@ function Gg(s, e, t) { setTimeout(r, t); }); } -class As { +class Cs { /** * Adds the given event listener to the given event type. * @@ -1756,16 +1756,16 @@ class As { } } const en = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"]; -let yd = 1234567; -const po = Math.PI / 180, wr = 180 / Math.PI; -function On() { +let bd = 1234567; +const mo = Math.PI / 180, Sr = 180 / Math.PI; +function kn() { const s = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0; return (en[s & 255] + en[s >> 8 & 255] + en[s >> 16 & 255] + en[s >> 24 & 255] + "-" + en[e & 255] + en[e >> 8 & 255] + "-" + en[e >> 16 & 15 | 64] + en[e >> 24 & 255] + "-" + en[t & 63 | 128] + en[t >> 8 & 255] + "-" + en[t >> 16 & 255] + en[t >> 24 & 255] + en[n & 255] + en[n >> 8 & 255] + en[n >> 16 & 255] + en[n >> 24 & 255]).toLowerCase(); } -function Ze(s, e, t) { +function qe(s, e, t) { return Math.max(e, Math.min(t, s)); } -function Ru(s, e) { +function Pu(s, e) { return (s % e + e) % e; } function Wg(s, e, t, n, i) { @@ -1774,16 +1774,16 @@ function Wg(s, e, t, n, i) { function Xg(s, e, t) { return s !== e ? (t - s) / (e - s) : 0; } -function mo(s, e, t) { +function go(s, e, t) { return (1 - t) * s + t * e; } function jg(s, e, t, n) { - return mo(s, e, 1 - Math.exp(-t * n)); + return go(s, e, 1 - Math.exp(-t * n)); } -function qg(s, e = 1) { - return e - Math.abs(Ru(s, e * 2) - e); +function Zg(s, e = 1) { + return e - Math.abs(Pu(s, e * 2) - e); } -function Zg(s, e, t) { +function qg(s, e, t) { return s <= e ? 0 : s >= t ? 1 : (s = (s - e) / (t - e), s * s * (3 - 2 * s)); } function Yg(s, e, t) { @@ -1799,15 +1799,15 @@ function Jg(s) { return s * (0.5 - Math.random()); } function Qg(s) { - s !== void 0 && (yd = s); - let e = yd += 1831565813; + s !== void 0 && (bd = s); + let e = bd += 1831565813; return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296; } function ex(s) { - return s * po; + return s * mo; } function tx(s) { - return s * wr; + return s * Sr; } function nx(s) { return (s & s - 1) === 0 && s !== 0; @@ -1819,7 +1819,7 @@ function sx(s) { return Math.pow(2, Math.floor(Math.log(s) / Math.LN2)); } function rx(s, e, t, n, i) { - const r = Math.cos, o = Math.sin, a = r(t / 2), l = o(t / 2), c = r((e + n) / 2), h = o((e + n) / 2), u = r((e - n) / 2), d = o((e - n) / 2), f = r((n - e) / 2), p = o((n - e) / 2); + const r = Math.cos, o = Math.sin, a = r(t / 2), l = o(t / 2), c = r((e + n) / 2), h = o((e + n) / 2), u = r((e - n) / 2), d = o((e - n) / 2), f = r((n - e) / 2), g = o((n - e) / 2); switch (i) { case "XYX": s.set(a * h, l * u, l * d, a * c); @@ -1831,13 +1831,13 @@ function rx(s, e, t, n, i) { s.set(l * u, l * d, a * h, a * c); break; case "XZX": - s.set(a * h, l * p, l * f, a * c); + s.set(a * h, l * g, l * f, a * c); break; case "YXY": - s.set(l * f, a * h, l * p, a * c); + s.set(l * f, a * h, l * g, a * c); break; case "ZYZ": - s.set(l * p, l * f, a * h, a * c); + s.set(l * g, l * f, a * h, a * c); break; default: He("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + i); @@ -1883,9 +1883,9 @@ function ct(s, e) { throw new Error("Invalid component type."); } } -const go = { - DEG2RAD: po, - RAD2DEG: wr, +const xo = { + DEG2RAD: mo, + RAD2DEG: Sr, /** * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) * (universally unique identifier). @@ -1894,7 +1894,7 @@ const go = { * @method * @return {string} The UUID. */ - generateUUID: On, + generateUUID: kn, /** * Clamps the given value between min and max. * @@ -1905,7 +1905,7 @@ const go = { * @param {number} max - The max value. * @return {number} The clamped value. */ - clamp: Ze, + clamp: qe, /** * Computes the Euclidean modulo of the given parameters that * is `( ( n % m ) + m ) % m`. @@ -1916,7 +1916,7 @@ const go = { * @param {number} m - The second parameter. * @return {number} The Euclidean modulo. */ - euclideanModulo: Ru, + euclideanModulo: Pu, /** * Performs a linear mapping from range `` to range `` * for the given value. @@ -1954,7 +1954,7 @@ const go = { * @param {number} t - The interpolation factor in the closed interval `[0, 1]`. * @return {number} The interpolated value. */ - lerp: mo, + lerp: go, /** * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta * time to maintain frame rate independent movement. For details, see @@ -1979,7 +1979,7 @@ const go = { * @param {number} [length=1] - The positive value the function will pingpong to. * @return {number} The alternated value. */ - pingpong: qg, + pingpong: Zg, /** * Returns a value in the range `[0,1]` that represents the percentage that `x` has * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to @@ -1994,7 +1994,7 @@ const go = { * @param {number} max - The max value. Any x value above max will be `1`. * @return {number} The alternated value. */ - smoothstep: Zg, + smoothstep: qg, /** * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations) * that has zero 1st and 2nd order derivatives at x=0 and x=1. @@ -2393,7 +2393,7 @@ class ce { * @return {Vector2} A reference to this vector. */ clamp(e, t) { - return this.x = Ze(this.x, e.x, t.x), this.y = Ze(this.y, e.y, t.y), this; + return this.x = qe(this.x, e.x, t.x), this.y = qe(this.y, e.y, t.y), this; } /** * If this vector's x or y values are greater than the max value, they are @@ -2406,7 +2406,7 @@ class ce { * @return {Vector2} A reference to this vector. */ clampScalar(e, t) { - return this.x = Ze(this.x, e, t), this.y = Ze(this.y, e, t), this; + return this.x = qe(this.x, e, t), this.y = qe(this.y, e, t), this; } /** * If this vector's length is greater than the max value, it is replaced by @@ -2420,7 +2420,7 @@ class ce { */ clampLength(e, t) { const n = this.length(); - return this.divideScalar(n || 1).multiplyScalar(Ze(n, e, t)); + return this.divideScalar(n || 1).multiplyScalar(qe(n, e, t)); } /** * The components of this vector are rounded down to the nearest integer value. @@ -2534,7 +2534,7 @@ class ce { const t = Math.sqrt(this.lengthSq() * e.lengthSq()); if (t === 0) return Math.PI / 2; const n = this.dot(e) / t; - return Math.acos(Ze(n, -1, 1)); + return Math.acos(qe(n, -1, 1)); } /** * Computes the distance from the given vector to this instance. @@ -2692,24 +2692,24 @@ class zn { * @see {@link Quaternion#slerp} */ static slerpFlat(e, t, n, i, r, o, a) { - let l = n[i + 0], c = n[i + 1], h = n[i + 2], u = n[i + 3], d = r[o + 0], f = r[o + 1], p = r[o + 2], g = r[o + 3]; + let l = n[i + 0], c = n[i + 1], h = n[i + 2], u = n[i + 3], d = r[o + 0], f = r[o + 1], g = r[o + 2], p = r[o + 3]; if (a <= 0) { e[t + 0] = l, e[t + 1] = c, e[t + 2] = h, e[t + 3] = u; return; } if (a >= 1) { - e[t + 0] = d, e[t + 1] = f, e[t + 2] = p, e[t + 3] = g; + e[t + 0] = d, e[t + 1] = f, e[t + 2] = g, e[t + 3] = p; return; } - if (u !== g || l !== d || c !== f || h !== p) { - let x = l * d + c * f + h * p + u * g; - x < 0 && (d = -d, f = -f, p = -p, g = -g, x = -x); + if (u !== p || l !== d || c !== f || h !== g) { + let x = l * d + c * f + h * g + u * p; + x < 0 && (d = -d, f = -f, g = -g, p = -p, x = -x); let m = 1 - a; if (x < 0.9995) { const b = Math.acos(x), v = Math.sin(b); - m = Math.sin(m * b) / v, a = Math.sin(a * b) / v, l = l * m + d * a, c = c * m + f * a, h = h * m + p * a, u = u * m + g * a; + m = Math.sin(m * b) / v, a = Math.sin(a * b) / v, l = l * m + d * a, c = c * m + f * a, h = h * m + g * a, u = u * m + p * a; } else { - l = l * m + d * a, c = c * m + f * a, h = h * m + p * a, u = u * m + g * a; + l = l * m + d * a, c = c * m + f * a, h = h * m + g * a, u = u * m + p * a; const b = 1 / Math.sqrt(l * l + c * c + h * h + u * u); l *= b, c *= b, h *= b, u *= b; } @@ -2730,8 +2730,8 @@ class zn { * @see {@link Quaternion#multiplyQuaternions}. */ static multiplyQuaternionsFlat(e, t, n, i, r, o) { - const a = n[i], l = n[i + 1], c = n[i + 2], h = n[i + 3], u = r[o], d = r[o + 1], f = r[o + 2], p = r[o + 3]; - return e[t] = a * p + h * u + l * f - c * d, e[t + 1] = l * p + h * d + c * u - a * f, e[t + 2] = c * p + h * f + a * d - l * u, e[t + 3] = h * p - a * u - l * d - c * f, e; + const a = n[i], l = n[i + 1], c = n[i + 2], h = n[i + 3], u = r[o], d = r[o + 1], f = r[o + 2], g = r[o + 3]; + return e[t] = a * g + h * u + l * f - c * d, e[t + 1] = l * g + h * d + c * u - a * f, e[t + 2] = c * g + h * f + a * d - l * u, e[t + 3] = h * g - a * u - l * d - c * f, e; } /** * The x value of this quaternion. @@ -2819,25 +2819,25 @@ class zn { * @return {Quaternion} A reference to this quaternion. */ setFromEuler(e, t = !0) { - const n = e._x, i = e._y, r = e._z, o = e._order, a = Math.cos, l = Math.sin, c = a(n / 2), h = a(i / 2), u = a(r / 2), d = l(n / 2), f = l(i / 2), p = l(r / 2); + const n = e._x, i = e._y, r = e._z, o = e._order, a = Math.cos, l = Math.sin, c = a(n / 2), h = a(i / 2), u = a(r / 2), d = l(n / 2), f = l(i / 2), g = l(r / 2); switch (o) { case "XYZ": - this._x = d * h * u + c * f * p, this._y = c * f * u - d * h * p, this._z = c * h * p + d * f * u, this._w = c * h * u - d * f * p; + this._x = d * h * u + c * f * g, this._y = c * f * u - d * h * g, this._z = c * h * g + d * f * u, this._w = c * h * u - d * f * g; break; case "YXZ": - this._x = d * h * u + c * f * p, this._y = c * f * u - d * h * p, this._z = c * h * p - d * f * u, this._w = c * h * u + d * f * p; + this._x = d * h * u + c * f * g, this._y = c * f * u - d * h * g, this._z = c * h * g - d * f * u, this._w = c * h * u + d * f * g; break; case "ZXY": - this._x = d * h * u - c * f * p, this._y = c * f * u + d * h * p, this._z = c * h * p + d * f * u, this._w = c * h * u - d * f * p; + this._x = d * h * u - c * f * g, this._y = c * f * u + d * h * g, this._z = c * h * g + d * f * u, this._w = c * h * u - d * f * g; break; case "ZYX": - this._x = d * h * u - c * f * p, this._y = c * f * u + d * h * p, this._z = c * h * p - d * f * u, this._w = c * h * u + d * f * p; + this._x = d * h * u - c * f * g, this._y = c * f * u + d * h * g, this._z = c * h * g - d * f * u, this._w = c * h * u + d * f * g; break; case "YZX": - this._x = d * h * u + c * f * p, this._y = c * f * u + d * h * p, this._z = c * h * p - d * f * u, this._w = c * h * u - d * f * p; + this._x = d * h * u + c * f * g, this._y = c * f * u + d * h * g, this._z = c * h * g - d * f * u, this._w = c * h * u - d * f * g; break; case "XZY": - this._x = d * h * u - c * f * p, this._y = c * f * u - d * h * p, this._z = c * h * p + d * f * u, this._w = c * h * u + d * f * p; + this._x = d * h * u - c * f * g, this._y = c * f * u - d * h * g, this._z = c * h * g + d * f * u, this._w = c * h * u + d * f * g; break; default: He("Quaternion: .setFromEuler() encountered an unknown order: " + o); @@ -2897,7 +2897,7 @@ class zn { * @return {number} The angle in radians. */ angleTo(e) { - return 2 * Math.acos(Math.abs(Ze(this.dot(e), -1, 1))); + return 2 * Math.acos(Math.abs(qe(this.dot(e), -1, 1))); } /** * Rotates this quaternion by a given angular step to the given quaternion. @@ -3330,7 +3330,7 @@ class P { * @return {Vector3} A reference to this vector. */ applyEuler(e) { - return this.applyQuaternion(_d.setFromEuler(e)); + return this.applyQuaternion(yd.setFromEuler(e)); } /** * Applies a rotation specified by an axis and an angle to this vector. @@ -3340,7 +3340,7 @@ class P { * @return {Vector3} A reference to this vector. */ applyAxisAngle(e, t) { - return this.applyQuaternion(_d.setFromAxisAngle(e, t)); + return this.applyQuaternion(yd.setFromAxisAngle(e, t)); } /** * Multiplies this vector with the given 3x3 matrix. @@ -3463,7 +3463,7 @@ class P { * @return {Vector3} A reference to this vector. */ clamp(e, t) { - return this.x = Ze(this.x, e.x, t.x), this.y = Ze(this.y, e.y, t.y), this.z = Ze(this.z, e.z, t.z), this; + return this.x = qe(this.x, e.x, t.x), this.y = qe(this.y, e.y, t.y), this.z = qe(this.z, e.z, t.z), this; } /** * If this vector's x, y or z values are greater than the max value, they are @@ -3476,7 +3476,7 @@ class P { * @return {Vector3} A reference to this vector. */ clampScalar(e, t) { - return this.x = Ze(this.x, e, t), this.y = Ze(this.y, e, t), this.z = Ze(this.z, e, t), this; + return this.x = qe(this.x, e, t), this.y = qe(this.y, e, t), this.z = qe(this.z, e, t), this; } /** * If this vector's length is greater than the max value, it is replaced by @@ -3490,7 +3490,7 @@ class P { */ clampLength(e, t) { const n = this.length(); - return this.divideScalar(n || 1).multiplyScalar(Ze(n, e, t)); + return this.divideScalar(n || 1).multiplyScalar(qe(n, e, t)); } /** * The components of this vector are rounded down to the nearest integer value. @@ -3675,7 +3675,7 @@ class P { const t = Math.sqrt(this.lengthSq() * e.lengthSq()); if (t === 0) return Math.PI / 2; const n = this.dot(e) / t; - return Math.acos(Ze(n, -1, 1)); + return Math.acos(qe(n, -1, 1)); } /** * Computes the distance from the given vector to this instance. @@ -3872,7 +3872,7 @@ class P { yield this.x, yield this.y, yield this.z; } } -const Hl = /* @__PURE__ */ new P(), _d = /* @__PURE__ */ new zn(); +const Hl = /* @__PURE__ */ new P(), yd = /* @__PURE__ */ new zn(); class $e { /** * Constructs a new 3x3 matrix. The arguments are supposed to be @@ -4007,8 +4007,8 @@ class $e { * @return {Matrix3} A reference to this matrix. */ multiplyMatrices(e, t) { - const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[3], l = n[6], c = n[1], h = n[4], u = n[7], d = n[2], f = n[5], p = n[8], g = i[0], x = i[3], m = i[6], b = i[1], v = i[4], y = i[7], M = i[2], E = i[5], A = i[8]; - return r[0] = o * g + a * b + l * M, r[3] = o * x + a * v + l * E, r[6] = o * m + a * y + l * A, r[1] = c * g + h * b + u * M, r[4] = c * x + h * v + u * E, r[7] = c * m + h * y + u * A, r[2] = d * g + f * b + p * M, r[5] = d * x + f * v + p * E, r[8] = d * m + f * y + p * A, this; + const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[3], l = n[6], c = n[1], h = n[4], u = n[7], d = n[2], f = n[5], g = n[8], p = i[0], x = i[3], m = i[6], b = i[1], v = i[4], y = i[7], M = i[2], E = i[5], A = i[8]; + return r[0] = o * p + a * b + l * M, r[3] = o * x + a * v + l * E, r[6] = o * m + a * y + l * A, r[1] = c * p + h * b + u * M, r[4] = c * x + h * v + u * E, r[7] = c * m + h * y + u * A, r[2] = d * p + f * b + g * M, r[5] = d * x + f * v + g * E, r[8] = d * m + f * y + g * A, this; } /** * Multiplies every component of the matrix by the given scalar. @@ -4037,10 +4037,10 @@ class $e { * @return {Matrix3} A reference to this matrix. */ invert() { - const e = this.elements, t = e[0], n = e[1], i = e[2], r = e[3], o = e[4], a = e[5], l = e[6], c = e[7], h = e[8], u = h * o - a * c, d = a * l - h * r, f = c * r - o * l, p = t * u + n * d + i * f; - if (p === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); - const g = 1 / p; - return e[0] = u * g, e[1] = (i * c - h * n) * g, e[2] = (a * n - i * o) * g, e[3] = d * g, e[4] = (h * t - i * l) * g, e[5] = (i * r - a * t) * g, e[6] = f * g, e[7] = (n * l - c * t) * g, e[8] = (o * t - n * r) * g, this; + const e = this.elements, t = e[0], n = e[1], i = e[2], r = e[3], o = e[4], a = e[5], l = e[6], c = e[7], h = e[8], u = h * o - a * c, d = a * l - h * r, f = c * r - o * l, g = t * u + n * d + i * f; + if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); + const p = 1 / g; + return e[0] = u * p, e[1] = (i * c - h * n) * p, e[2] = (a * n - i * o) * p, e[3] = d * p, e[4] = (h * t - i * l) * p, e[5] = (i * r - a * t) * p, e[6] = f * p, e[7] = (n * l - c * t) * p, e[8] = (o * t - n * r) * p, this; } /** * Transposes this matrix in place. @@ -4243,7 +4243,7 @@ class $e { return new this.constructor().fromArray(this.elements); } } -const Vl = /* @__PURE__ */ new $e(), Md = /* @__PURE__ */ new $e().set( +const Vl = /* @__PURE__ */ new $e(), _d = /* @__PURE__ */ new $e().set( 0.4123908, 0.3575843, 0.1804808, @@ -4253,7 +4253,7 @@ const Vl = /* @__PURE__ */ new $e(), Md = /* @__PURE__ */ new $e().set( 0.0193308, 0.1191948, 0.9505322 -), wd = /* @__PURE__ */ new $e().set( +), Md = /* @__PURE__ */ new $e().set( 3.2409699, -1.5373832, -0.4986108, @@ -4267,7 +4267,7 @@ const Vl = /* @__PURE__ */ new $e(), Md = /* @__PURE__ */ new $e().set( function ox() { const s = { enabled: !0, - workingColorSpace: Bt, + workingColorSpace: It, /** * Implementations of supported color spaces. * @@ -4288,7 +4288,7 @@ function ox() { */ spaces: {}, convert: function(i, r, o) { - return this.enabled === !1 || r === o || !r || !o || (this.spaces[r].transfer === lt && (i.r = Pi(i.r), i.g = Pi(i.g), i.b = Pi(i.b)), this.spaces[r].primaries !== this.spaces[o].primaries && (i.applyMatrix3(this.spaces[r].toXYZ), i.applyMatrix3(this.spaces[o].fromXYZ)), this.spaces[o].transfer === lt && (i.r = mr(i.r), i.g = mr(i.g), i.b = mr(i.b))), i; + return this.enabled === !1 || r === o || !r || !o || (this.spaces[r].transfer === lt && (i.r = Pi(i.r), i.g = Pi(i.g), i.b = Pi(i.b)), this.spaces[r].primaries !== this.spaces[o].primaries && (i.applyMatrix3(this.spaces[r].toXYZ), i.applyMatrix3(this.spaces[o].fromXYZ)), this.spaces[o].transfer === lt && (i.r = gr(i.r), i.g = gr(i.g), i.b = gr(i.b))), i; }, workingToColorSpace: function(i, r) { return this.convert(i, this.workingColorSpace, r); @@ -4300,7 +4300,7 @@ function ox() { return this.spaces[i].primaries; }, getTransfer: function(i) { - return i === Xi ? ml : this.spaces[i].transfer; + return i === Xi ? pl : this.spaces[i].transfer; }, getToneMappingMode: function(i) { return this.spaces[i].outputColorSpaceConfig.toneMappingMode || "standard"; @@ -4323,19 +4323,19 @@ function ox() { }, // Deprecated fromWorkingColorSpace: function(i, r) { - return Co("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), s.workingToColorSpace(i, r); + return Po("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), s.workingToColorSpace(i, r); }, toWorkingColorSpace: function(i, r) { - return Co("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), s.colorSpaceToWorking(i, r); + return Po("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), s.colorSpaceToWorking(i, r); } }, e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], t = [0.2126, 0.7152, 0.0722], n = [0.3127, 0.329]; return s.define({ - [Bt]: { + [It]: { primaries: e, whitePoint: n, - transfer: ml, - toXYZ: Md, - fromXYZ: wd, + transfer: pl, + toXYZ: _d, + fromXYZ: Md, luminanceCoefficients: t, workingColorSpaceConfig: { unpackColorSpace: xt }, outputColorSpaceConfig: { drawingBufferColorSpace: xt } @@ -4344,8 +4344,8 @@ function ox() { primaries: e, whitePoint: n, transfer: lt, - toXYZ: Md, - fromXYZ: wd, + toXYZ: _d, + fromXYZ: Md, luminanceCoefficients: t, outputColorSpaceConfig: { drawingBufferColorSpace: xt } } @@ -4355,10 +4355,10 @@ const st = /* @__PURE__ */ ox(); function Pi(s) { return s < 0.04045 ? s * 0.0773993808 : Math.pow(s * 0.9478672986 + 0.0521327014, 2.4); } -function mr(s) { +function gr(s) { return s < 31308e-7 ? s * 12.92 : 1.055 * Math.pow(s, 0.41666) - 0.055; } -let Ns; +let Us; class ax { /** * Returns a data URI containing a representation of the given image. @@ -4374,9 +4374,9 @@ class ax { if (e instanceof HTMLCanvasElement) n = e; else { - Ns === void 0 && (Ns = Ao("canvas")), Ns.width = e.width, Ns.height = e.height; - const i = Ns.getContext("2d"); - e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height), n = Ns; + Us === void 0 && (Us = Co("canvas")), Us.width = e.width, Us.height = e.height; + const i = Us.getContext("2d"); + e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height), n = Us; } return n.toDataURL(t); } @@ -4388,7 +4388,7 @@ class ax { */ static sRGBToLinear(e) { if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap) { - const t = Ao("canvas"); + const t = Co("canvas"); t.width = e.width, t.height = e.height; const n = t.getContext("2d"); n.drawImage(e, 0, 0, e.width, e.height); @@ -4410,14 +4410,14 @@ class ax { } } let lx = 0; -class Lu { +class Ru { /** * Constructs a new video texture. * * @param {any} [data=null] - The data definition of a texture. */ constructor(e = null) { - this.isSource = !0, Object.defineProperty(this, "id", { value: lx++ }), this.uuid = On(), this.data = e, this.dataReady = !0, this.version = 0; + this.isSource = !0, Object.defineProperty(this, "id", { value: lx++ }), this.uuid = kn(), this.data = e, this.dataReady = !0, this.version = 0; } /** * Returns the dimensions of the source into the given target vector. @@ -4479,7 +4479,7 @@ function Gl(s) { } let cx = 0; const Wl = /* @__PURE__ */ new P(); -class Ht extends As { +class Ht extends Cs { /** * Constructs a new texture. * @@ -4495,7 +4495,7 @@ class Ht extends As { * @param {string} [colorSpace=NoColorSpace] - The color space. */ constructor(e = Ht.DEFAULT_IMAGE, t = Ht.DEFAULT_MAPPING, n = ai, i = ai, r = Yt, o = Ai, a = xn, l = Jn, c = Ht.DEFAULT_ANISOTROPY, h = Xi) { - super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: cx++ }), this.uuid = On(), this.name = "", this.source = new Lu(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = i, this.magFilter = r, this.minFilter = o, this.anisotropy = c, this.format = a, this.internalFormat = null, this.type = l, this.offset = new ce(0, 0), this.repeat = new ce(1, 1), this.center = new ce(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new $e(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0; + super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: cx++ }), this.uuid = kn(), this.name = "", this.source = new Ru(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = i, this.magFilter = r, this.minFilter = o, this.anisotropy = c, this.format = a, this.internalFormat = null, this.type = l, this.offset = new ce(0, 0), this.repeat = new ce(1, 1), this.center = new ce(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new $e(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0; } /** * The width of the texture in pixels. @@ -4650,7 +4650,7 @@ class Ht extends As { case ai: e.x = e.x < 0 ? 0 : 1; break; - case pl: + case fl: 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; } @@ -4662,7 +4662,7 @@ class Ht extends As { case ai: e.y = e.y < 0 ? 0 : 1; break; - case pl: + case fl: 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; } @@ -4984,16 +4984,16 @@ class tt { */ setAxisAngleFromRotationMatrix(e) { let t, n, i, r; - const l = e.elements, c = l[0], h = l[4], u = l[8], d = l[1], f = l[5], p = l[9], g = l[2], x = l[6], m = l[10]; - if (Math.abs(h - d) < 0.01 && Math.abs(u - g) < 0.01 && Math.abs(p - x) < 0.01) { - if (Math.abs(h + d) < 0.1 && Math.abs(u + g) < 0.1 && Math.abs(p + x) < 0.1 && Math.abs(c + f + m - 3) < 0.1) + const l = e.elements, c = l[0], h = l[4], u = l[8], d = l[1], f = l[5], g = l[9], p = l[2], x = l[6], m = l[10]; + if (Math.abs(h - d) < 0.01 && Math.abs(u - p) < 0.01 && Math.abs(g - x) < 0.01) { + if (Math.abs(h + d) < 0.1 && Math.abs(u + p) < 0.1 && Math.abs(g + x) < 0.1 && Math.abs(c + f + m - 3) < 0.1) return this.set(1, 0, 0, 0), this; t = Math.PI; - const v = (c + 1) / 2, y = (f + 1) / 2, M = (m + 1) / 2, E = (h + d) / 4, A = (u + g) / 4, R = (p + x) / 4; + const v = (c + 1) / 2, y = (f + 1) / 2, M = (m + 1) / 2, E = (h + d) / 4, A = (u + p) / 4, R = (g + x) / 4; return v > y && v > M ? v < 0.01 ? (n = 0, i = 0.707106781, r = 0.707106781) : (n = Math.sqrt(v), i = E / n, r = A / n) : y > M ? y < 0.01 ? (n = 0.707106781, i = 0, r = 0.707106781) : (i = Math.sqrt(y), n = E / i, r = R / i) : M < 0.01 ? (n = 0.707106781, i = 0.707106781, r = 0) : (r = Math.sqrt(M), n = A / r, i = R / r), this.set(n, i, r, t), this; } - let b = Math.sqrt((x - p) * (x - p) + (u - g) * (u - g) + (d - h) * (d - h)); - return Math.abs(b) < 1e-3 && (b = 1), this.x = (x - p) / b, this.y = (u - g) / b, this.z = (d - h) / b, this.w = Math.acos((c + f + m - 1) / 2), this; + let b = Math.sqrt((x - g) * (x - g) + (u - p) * (u - p) + (d - h) * (d - h)); + return Math.abs(b) < 1e-3 && (b = 1), this.x = (x - g) / b, this.y = (u - p) / b, this.z = (d - h) / b, this.w = Math.acos((c + f + m - 1) / 2), this; } /** * Sets the vector components to the position elements of the @@ -5037,7 +5037,7 @@ class tt { * @return {Vector4} A reference to this vector. */ clamp(e, t) { - return this.x = Ze(this.x, e.x, t.x), this.y = Ze(this.y, e.y, t.y), this.z = Ze(this.z, e.z, t.z), this.w = Ze(this.w, e.w, t.w), this; + return this.x = qe(this.x, e.x, t.x), this.y = qe(this.y, e.y, t.y), this.z = qe(this.z, e.z, t.z), this.w = qe(this.w, e.w, t.w), this; } /** * If this vector's x, y, z or w values are greater than the max value, they are @@ -5050,7 +5050,7 @@ class tt { * @return {Vector4} A reference to this vector. */ clampScalar(e, t) { - return this.x = Ze(this.x, e, t), this.y = Ze(this.y, e, t), this.z = Ze(this.z, e, t), this.w = Ze(this.w, e, t), this; + return this.x = qe(this.x, e, t), this.y = qe(this.y, e, t), this.z = qe(this.z, e, t), this.w = qe(this.w, e, t), this; } /** * If this vector's length is greater than the max value, it is replaced by @@ -5064,7 +5064,7 @@ class tt { */ clampLength(e, t) { const n = this.length(); - return this.divideScalar(n || 1).multiplyScalar(Ze(n, e, t)); + return this.divideScalar(n || 1).multiplyScalar(qe(n, e, t)); } /** * The components of this vector are rounded down to the nearest integer value. @@ -5240,7 +5240,7 @@ class tt { yield this.x, yield this.y, yield this.z, yield this.w; } } -class hx extends As { +class hx extends Cs { /** * Render target options. * @@ -5367,7 +5367,7 @@ class hx extends As { for (let t = 0, n = e.textures.length; t < n; t++) { this.textures[t] = e.textures[t].clone(), this.textures[t].isRenderTargetTexture = !0, this.textures[t].renderTarget = this; const i = Object.assign({}, e.textures[t].image); - this.textures[t].source = new Lu(i); + this.textures[t].source = new Ru(i); } return this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.resolveDepthBuffer = e.resolveDepthBuffer, this.resolveStencilBuffer = e.resolveStencilBuffer, e.depthTexture !== null && (this.depthTexture = e.depthTexture.clone()), this.samples = e.samples, this; } @@ -5704,37 +5704,37 @@ class vt { intersectsTriangle(e) { if (this.isEmpty()) return !1; - this.getCenter(zr), Xo.subVectors(this.max, zr), ks.subVectors(e.a, zr), Us.subVectors(e.b, zr), Os.subVectors(e.c, zr), Ni.subVectors(Us, ks), ki.subVectors(Os, Us), is.subVectors(ks, Os); + this.getCenter(Hr), Xo.subVectors(this.max, Hr), Os.subVectors(e.a, Hr), ks.subVectors(e.b, Hr), Fs.subVectors(e.c, Hr), Ni.subVectors(ks, Os), Ui.subVectors(Fs, ks), is.subVectors(Os, Fs); let t = [ 0, -Ni.z, Ni.y, 0, - -ki.z, - ki.y, + -Ui.z, + Ui.y, 0, -is.z, is.y, Ni.z, 0, -Ni.x, - ki.z, + Ui.z, 0, - -ki.x, + -Ui.x, is.z, 0, -is.x, -Ni.y, Ni.x, 0, - -ki.y, - ki.x, + -Ui.y, + Ui.x, 0, -is.y, is.x, 0 ]; - return !Xl(t, ks, Us, Os, Xo) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Xl(t, ks, Us, Os, Xo)) ? !1 : (jo.crossVectors(Ni, ki), t = [jo.x, jo.y, jo.z], Xl(t, ks, Us, Os, Xo)); + return !Xl(t, Os, ks, Fs, Xo) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Xl(t, Os, ks, Fs, Xo)) ? !1 : (jo.crossVectors(Ni, Ui), t = [jo.x, jo.y, jo.z], Xl(t, Os, ks, Fs, Xo)); } /** * Clamps the given point within the bounds of this box. @@ -5846,7 +5846,7 @@ const pi = [ /* @__PURE__ */ new P(), /* @__PURE__ */ new P(), /* @__PURE__ */ new P() -], Wn = /* @__PURE__ */ new P(), Wo = /* @__PURE__ */ new vt(), ks = /* @__PURE__ */ new P(), Us = /* @__PURE__ */ new P(), Os = /* @__PURE__ */ new P(), Ni = /* @__PURE__ */ new P(), ki = /* @__PURE__ */ new P(), is = /* @__PURE__ */ new P(), zr = /* @__PURE__ */ new P(), Xo = /* @__PURE__ */ new P(), jo = /* @__PURE__ */ new P(), ss = /* @__PURE__ */ new P(); +], Wn = /* @__PURE__ */ new P(), Wo = /* @__PURE__ */ new vt(), Os = /* @__PURE__ */ new P(), ks = /* @__PURE__ */ new P(), Fs = /* @__PURE__ */ new P(), Ni = /* @__PURE__ */ new P(), Ui = /* @__PURE__ */ new P(), is = /* @__PURE__ */ new P(), Hr = /* @__PURE__ */ new P(), Xo = /* @__PURE__ */ new P(), jo = /* @__PURE__ */ new P(), ss = /* @__PURE__ */ new P(); function Xl(s, e, t, n, i) { for (let r = 0, o = s.length - 3; r <= o; r += 3) { ss.fromArray(s, r); @@ -5856,7 +5856,7 @@ function Xl(s, e, t, n, i) { } return !0; } -const dx = /* @__PURE__ */ new vt(), Hr = /* @__PURE__ */ new P(), jl = /* @__PURE__ */ new P(); +const dx = /* @__PURE__ */ new vt(), Vr = /* @__PURE__ */ new P(), jl = /* @__PURE__ */ new P(); class di { /** * Constructs a new sphere. @@ -6021,11 +6021,11 @@ class di { expandByPoint(e) { if (this.isEmpty()) return this.center.copy(e), this.radius = 0, this; - Hr.subVectors(e, this.center); - const t = Hr.lengthSq(); + Vr.subVectors(e, this.center); + const t = Vr.lengthSq(); if (t > this.radius * this.radius) { const n = Math.sqrt(t), i = (n - this.radius) * 0.5; - this.center.addScaledVector(Hr, i / n), this.radius += i; + this.center.addScaledVector(Vr, i / n), this.radius += i; } return this; } @@ -6036,7 +6036,7 @@ class di { * @return {Sphere} A reference to this sphere. */ union(e) { - return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (jl.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(Hr.copy(e.center).add(jl)), this.expandByPoint(Hr.copy(e.center).sub(jl))), this); + return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (jl.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(Vr.copy(e.center).add(jl)), this.expandByPoint(Vr.copy(e.center).sub(jl))), this); } /** * Returns `true` if this sphere is equal with the given one. @@ -6076,7 +6076,7 @@ class di { return this.radius = e.radius, this.center.fromArray(e.center), this; } } -const mi = /* @__PURE__ */ new P(), ql = /* @__PURE__ */ new P(), qo = /* @__PURE__ */ new P(), Ui = /* @__PURE__ */ new P(), Zl = /* @__PURE__ */ new P(), Zo = /* @__PURE__ */ new P(), Yl = /* @__PURE__ */ new P(); +const mi = /* @__PURE__ */ new P(), Zl = /* @__PURE__ */ new P(), Zo = /* @__PURE__ */ new P(), Oi = /* @__PURE__ */ new P(), ql = /* @__PURE__ */ new P(), qo = /* @__PURE__ */ new P(), Yl = /* @__PURE__ */ new P(); class Qi { /** * Constructs a new ray. @@ -6175,24 +6175,24 @@ class Qi { * @return {number} The squared distance. */ distanceSqToSegment(e, t, n, i) { - ql.copy(e).add(t).multiplyScalar(0.5), qo.copy(t).sub(e).normalize(), Ui.copy(this.origin).sub(ql); - const r = e.distanceTo(t) * 0.5, o = -this.direction.dot(qo), a = Ui.dot(this.direction), l = -Ui.dot(qo), c = Ui.lengthSq(), h = Math.abs(1 - o * o); - let u, d, f, p; + Zl.copy(e).add(t).multiplyScalar(0.5), Zo.copy(t).sub(e).normalize(), Oi.copy(this.origin).sub(Zl); + const r = e.distanceTo(t) * 0.5, o = -this.direction.dot(Zo), a = Oi.dot(this.direction), l = -Oi.dot(Zo), c = Oi.lengthSq(), h = Math.abs(1 - o * o); + let u, d, f, g; if (h > 0) - if (u = o * l - a, d = o * a - l, p = r * h, u >= 0) - if (d >= -p) - if (d <= p) { - const g = 1 / h; - u *= g, d *= g, f = u * (u + o * d + 2 * a) + d * (o * u + d + 2 * l) + c; + if (u = o * l - a, d = o * a - l, g = r * h, u >= 0) + if (d >= -g) + if (d <= g) { + const p = 1 / h; + u *= p, d *= p, f = u * (u + o * d + 2 * a) + d * (o * u + d + 2 * l) + c; } else d = r, u = Math.max(0, -(o * d + a)), f = -u * u + d * (d + 2 * l) + c; else d = -r, u = Math.max(0, -(o * d + a)), f = -u * u + d * (d + 2 * l) + c; else - d <= -p ? (u = Math.max(0, -(-o * r + a)), d = u > 0 ? -r : Math.min(Math.max(-r, -l), r), f = -u * u + d * (d + 2 * l) + c) : d <= p ? (u = 0, d = Math.min(Math.max(-r, -l), r), f = d * (d + 2 * l) + c) : (u = Math.max(0, -(o * r + a)), d = u > 0 ? r : Math.min(Math.max(-r, -l), r), f = -u * u + d * (d + 2 * l) + c); + d <= -g ? (u = Math.max(0, -(-o * r + a)), d = u > 0 ? -r : Math.min(Math.max(-r, -l), r), f = -u * u + d * (d + 2 * l) + c) : d <= g ? (u = 0, d = Math.min(Math.max(-r, -l), r), f = d * (d + 2 * l) + c) : (u = Math.max(0, -(o * r + a)), d = u > 0 ? r : Math.min(Math.max(-r, -l), r), f = -u * u + d * (d + 2 * l) + c); else d = o > 0 ? -r : r, u = Math.max(0, -(o * d + a)), f = -u * u + d * (d + 2 * l) + c; - return n && n.copy(this.origin).addScaledVector(this.direction, u), i && i.copy(ql).addScaledVector(qo, d), f; + return n && n.copy(this.origin).addScaledVector(this.direction, u), i && i.copy(Zl).addScaledVector(Zo, d), f; } /** * Intersects this ray with the given sphere, returning the intersection @@ -6288,7 +6288,7 @@ class Qi { * @return {?Vector3} The intersection point. */ intersectTriangle(e, t, n, i, r) { - Zl.subVectors(t, e), Zo.subVectors(n, e), Yl.crossVectors(Zl, Zo); + ql.subVectors(t, e), qo.subVectors(n, e), Yl.crossVectors(ql, qo); let o = this.direction.dot(Yl), a; if (o > 0) { if (i) return null; @@ -6297,14 +6297,14 @@ class Qi { a = -1, o = -o; else return null; - Ui.subVectors(this.origin, e); - const l = a * this.direction.dot(Zo.crossVectors(Ui, Zo)); + Oi.subVectors(this.origin, e); + const l = a * this.direction.dot(qo.crossVectors(Oi, qo)); if (l < 0) return null; - const c = a * this.direction.dot(Zl.cross(Ui)); + const c = a * this.direction.dot(ql.cross(Oi)); if (c < 0 || l + c > o) return null; - const h = -a * Ui.dot(Yl); + const h = -a * Oi.dot(Yl); return h < 0 ? null : this.at(h / o, r); } /** @@ -6357,7 +6357,7 @@ class ze { * @param {number} [n43] - 4-3 matrix element. * @param {number} [n44] - 4-4 matrix element. */ - constructor(e, t, n, i, r, o, a, l, c, h, u, d, f, p, g, x) { + constructor(e, t, n, i, r, o, a, l, c, h, u, d, f, g, p, x) { ze.prototype.isMatrix4 = !0, this.elements = [ 1, 0, @@ -6375,7 +6375,7 @@ class ze { 0, 0, 1 - ], e !== void 0 && this.set(e, t, n, i, r, o, a, l, c, h, u, d, f, p, g, x); + ], e !== void 0 && this.set(e, t, n, i, r, o, a, l, c, h, u, d, f, g, p, x); } /** * Sets the elements of the matrix.The arguments are supposed to be @@ -6399,9 +6399,9 @@ class ze { * @param {number} [n44] - 4-4 matrix element. * @return {Matrix4} A reference to this matrix. */ - set(e, t, n, i, r, o, a, l, c, h, u, d, f, p, g, x) { + set(e, t, n, i, r, o, a, l, c, h, u, d, f, g, p, x) { const m = this.elements; - return m[0] = e, m[4] = t, m[8] = n, m[12] = i, m[1] = r, m[5] = o, m[9] = a, m[13] = l, m[2] = c, m[6] = h, m[10] = u, m[14] = d, m[3] = f, m[7] = p, m[11] = g, m[15] = x, this; + return m[0] = e, m[4] = t, m[8] = n, m[12] = i, m[1] = r, m[5] = o, m[9] = a, m[13] = l, m[2] = c, m[6] = h, m[10] = u, m[14] = d, m[3] = f, m[7] = g, m[11] = p, m[15] = x, this; } /** * Sets this matrix to the 4x4 identity matrix. @@ -6533,7 +6533,7 @@ class ze { * @return {Matrix4} A reference to this matrix. */ extractRotation(e) { - const t = this.elements, n = e.elements, i = 1 / Fs.setFromMatrixColumn(e, 0).length(), r = 1 / Fs.setFromMatrixColumn(e, 1).length(), o = 1 / Fs.setFromMatrixColumn(e, 2).length(); + const t = this.elements, n = e.elements, i = 1 / zs.setFromMatrixColumn(e, 0).length(), r = 1 / zs.setFromMatrixColumn(e, 1).length(), o = 1 / zs.setFromMatrixColumn(e, 2).length(); return t[0] = n[0] * i, t[1] = n[1] * i, t[2] = n[2] * i, t[3] = 0, t[4] = n[4] * r, t[5] = n[5] * r, t[6] = n[6] * r, t[7] = 0, t[8] = n[8] * o, t[9] = n[9] * o, t[10] = n[10] * o, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this; } /** @@ -6549,23 +6549,23 @@ class ze { makeRotationFromEuler(e) { const t = this.elements, n = e.x, i = e.y, r = e.z, o = Math.cos(n), a = Math.sin(n), l = Math.cos(i), c = Math.sin(i), h = Math.cos(r), u = Math.sin(r); if (e.order === "XYZ") { - const d = o * h, f = o * u, p = a * h, g = a * u; - t[0] = l * h, t[4] = -l * u, t[8] = c, t[1] = f + p * c, t[5] = d - g * c, t[9] = -a * l, t[2] = g - d * c, t[6] = p + f * c, t[10] = o * l; + const d = o * h, f = o * u, g = a * h, p = a * u; + t[0] = l * h, t[4] = -l * u, t[8] = c, t[1] = f + g * c, t[5] = d - p * c, t[9] = -a * l, t[2] = p - d * c, t[6] = g + f * c, t[10] = o * l; } else if (e.order === "YXZ") { - const d = l * h, f = l * u, p = c * h, g = c * u; - t[0] = d + g * a, t[4] = p * a - f, t[8] = o * c, t[1] = o * u, t[5] = o * h, t[9] = -a, t[2] = f * a - p, t[6] = g + d * a, t[10] = o * l; + const d = l * h, f = l * u, g = c * h, p = c * u; + t[0] = d + p * a, t[4] = g * a - f, t[8] = o * c, t[1] = o * u, t[5] = o * h, t[9] = -a, t[2] = f * a - g, t[6] = p + d * a, t[10] = o * l; } else if (e.order === "ZXY") { - const d = l * h, f = l * u, p = c * h, g = c * u; - t[0] = d - g * a, t[4] = -o * u, t[8] = p + f * a, t[1] = f + p * a, t[5] = o * h, t[9] = g - d * a, t[2] = -o * c, t[6] = a, t[10] = o * l; + const d = l * h, f = l * u, g = c * h, p = c * u; + t[0] = d - p * a, t[4] = -o * u, t[8] = g + f * a, t[1] = f + g * a, t[5] = o * h, t[9] = p - d * a, t[2] = -o * c, t[6] = a, t[10] = o * l; } else if (e.order === "ZYX") { - const d = o * h, f = o * u, p = a * h, g = a * u; - t[0] = l * h, t[4] = p * c - f, t[8] = d * c + g, t[1] = l * u, t[5] = g * c + d, t[9] = f * c - p, t[2] = -c, t[6] = a * l, t[10] = o * l; + const d = o * h, f = o * u, g = a * h, p = a * u; + t[0] = l * h, t[4] = g * c - f, t[8] = d * c + p, t[1] = l * u, t[5] = p * c + d, t[9] = f * c - g, t[2] = -c, t[6] = a * l, t[10] = o * l; } else if (e.order === "YZX") { - const d = o * l, f = o * c, p = a * l, g = a * c; - t[0] = l * h, t[4] = g - d * u, t[8] = p * u + f, t[1] = u, t[5] = o * h, t[9] = -a * h, t[2] = -c * h, t[6] = f * u + p, t[10] = d - g * u; + const d = o * l, f = o * c, g = a * l, p = a * c; + t[0] = l * h, t[4] = p - d * u, t[8] = g * u + f, t[1] = u, t[5] = o * h, t[9] = -a * h, t[2] = -c * h, t[6] = f * u + g, t[10] = d - p * u; } else if (e.order === "XZY") { - const d = o * l, f = o * c, p = a * l, g = a * c; - t[0] = l * h, t[4] = -u, t[8] = c * h, t[1] = d * u + g, t[5] = o * h, t[9] = f * u - p, t[2] = p * u - f, t[6] = a * h, t[10] = g * u + d; + const d = o * l, f = o * c, g = a * l, p = a * c; + t[0] = l * h, t[4] = -u, t[8] = c * h, t[1] = d * u + p, t[5] = o * h, t[9] = f * u - g, t[2] = g * u - f, t[6] = a * h, t[10] = p * u + d; } return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this; } @@ -6591,7 +6591,7 @@ class ze { */ lookAt(e, t, n) { const i = this.elements; - return Tn.subVectors(e, t), Tn.lengthSq() === 0 && (Tn.z = 1), Tn.normalize(), Oi.crossVectors(n, Tn), Oi.lengthSq() === 0 && (Math.abs(n.z) === 1 ? Tn.x += 1e-4 : Tn.z += 1e-4, Tn.normalize(), Oi.crossVectors(n, Tn)), Oi.normalize(), Yo.crossVectors(Tn, Oi), i[0] = Oi.x, i[4] = Yo.x, i[8] = Tn.x, i[1] = Oi.y, i[5] = Yo.y, i[9] = Tn.y, i[2] = Oi.z, i[6] = Yo.z, i[10] = Tn.z, this; + return Tn.subVectors(e, t), Tn.lengthSq() === 0 && (Tn.z = 1), Tn.normalize(), ki.crossVectors(n, Tn), ki.lengthSq() === 0 && (Math.abs(n.z) === 1 ? Tn.x += 1e-4 : Tn.z += 1e-4, Tn.normalize(), ki.crossVectors(n, Tn)), ki.normalize(), Yo.crossVectors(Tn, ki), i[0] = ki.x, i[4] = Yo.x, i[8] = Tn.x, i[1] = ki.y, i[5] = Yo.y, i[9] = Tn.y, i[2] = ki.z, i[6] = Yo.z, i[10] = Tn.z, this; } /** * Post-multiplies this matrix by the given 4x4 matrix. @@ -6620,8 +6620,8 @@ class ze { * @return {Matrix4} A reference to this matrix. */ multiplyMatrices(e, t) { - const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[4], l = n[8], c = n[12], h = n[1], u = n[5], d = n[9], f = n[13], p = n[2], g = n[6], x = n[10], m = n[14], b = n[3], v = n[7], y = n[11], M = n[15], E = i[0], A = i[4], R = i[8], _ = i[12], S = i[1], D = i[5], C = i[9], B = i[13], w = i[2], F = i[6], W = i[10], j = i[14], $ = i[3], Z = i[7], re = i[11], X = i[15]; - return r[0] = o * E + a * S + l * w + c * $, r[4] = o * A + a * D + l * F + c * Z, r[8] = o * R + a * C + l * W + c * re, r[12] = o * _ + a * B + l * j + c * X, r[1] = h * E + u * S + d * w + f * $, r[5] = h * A + u * D + d * F + f * Z, r[9] = h * R + u * C + d * W + f * re, r[13] = h * _ + u * B + d * j + f * X, r[2] = p * E + g * S + x * w + m * $, r[6] = p * A + g * D + x * F + m * Z, r[10] = p * R + g * C + x * W + m * re, r[14] = p * _ + g * B + x * j + m * X, r[3] = b * E + v * S + y * w + M * $, r[7] = b * A + v * D + y * F + M * Z, r[11] = b * R + v * C + y * W + M * re, r[15] = b * _ + v * B + y * j + M * X, this; + const n = e.elements, i = t.elements, r = this.elements, o = n[0], a = n[4], l = n[8], c = n[12], h = n[1], u = n[5], d = n[9], f = n[13], g = n[2], p = n[6], x = n[10], m = n[14], b = n[3], v = n[7], y = n[11], M = n[15], E = i[0], A = i[4], R = i[8], _ = i[12], S = i[1], D = i[5], C = i[9], B = i[13], w = i[2], F = i[6], W = i[10], j = i[14], $ = i[3], q = i[7], re = i[11], X = i[15]; + return r[0] = o * E + a * S + l * w + c * $, r[4] = o * A + a * D + l * F + c * q, r[8] = o * R + a * C + l * W + c * re, r[12] = o * _ + a * B + l * j + c * X, r[1] = h * E + u * S + d * w + f * $, r[5] = h * A + u * D + d * F + f * q, r[9] = h * R + u * C + d * W + f * re, r[13] = h * _ + u * B + d * j + f * X, r[2] = g * E + p * S + x * w + m * $, r[6] = g * A + p * D + x * F + m * q, r[10] = g * R + p * C + x * W + m * re, r[14] = g * _ + p * B + x * j + m * X, r[3] = b * E + v * S + y * w + M * $, r[7] = b * A + v * D + y * F + M * q, r[11] = b * R + v * C + y * W + M * re, r[15] = b * _ + v * B + y * j + M * X, this; } /** * Multiplies every component of the matrix by the given scalar. @@ -6641,8 +6641,8 @@ class ze { * @return {number} The determinant. */ determinant() { - const e = this.elements, t = e[0], n = e[4], i = e[8], r = e[12], o = e[1], a = e[5], l = e[9], c = e[13], h = e[2], u = e[6], d = e[10], f = e[14], p = e[3], g = e[7], x = e[11], m = e[15]; - return p * (+r * l * u - i * c * u - r * a * d + n * c * d + i * a * f - n * l * f) + g * (+t * l * f - t * c * d + r * o * d - i * o * f + i * c * h - r * l * h) + x * (+t * c * u - t * a * f - r * o * u + n * o * f + r * a * h - n * c * h) + m * (-i * a * h - t * l * u + t * a * d + i * o * u - n * o * d + n * l * h); + const e = this.elements, t = e[0], n = e[4], i = e[8], r = e[12], o = e[1], a = e[5], l = e[9], c = e[13], h = e[2], u = e[6], d = e[10], f = e[14], g = e[3], p = e[7], x = e[11], m = e[15]; + return g * (+r * l * u - i * c * u - r * a * d + n * c * d + i * a * f - n * l * f) + p * (+t * l * f - t * c * d + r * o * d - i * o * f + i * c * h - r * l * h) + x * (+t * c * u - t * a * f - r * o * u + n * o * f + r * a * h - n * c * h) + m * (-i * a * h - t * l * u + t * a * d + i * o * u - n * o * d + n * l * h); } /** * Transposes this matrix in place. @@ -6675,10 +6675,10 @@ class ze { * @return {Matrix4} A reference to this matrix. */ invert() { - const e = this.elements, t = e[0], n = e[1], i = e[2], r = e[3], o = e[4], a = e[5], l = e[6], c = e[7], h = e[8], u = e[9], d = e[10], f = e[11], p = e[12], g = e[13], x = e[14], m = e[15], b = u * x * c - g * d * c + g * l * f - a * x * f - u * l * m + a * d * m, v = p * d * c - h * x * c - p * l * f + o * x * f + h * l * m - o * d * m, y = h * g * c - p * u * c + p * a * f - o * g * f - h * a * m + o * u * m, M = p * u * l - h * g * l - p * a * d + o * g * d + h * a * x - o * u * x, E = t * b + n * v + i * y + r * M; + const e = this.elements, t = e[0], n = e[1], i = e[2], r = e[3], o = e[4], a = e[5], l = e[6], c = e[7], h = e[8], u = e[9], d = e[10], f = e[11], g = e[12], p = e[13], x = e[14], m = e[15], b = u * x * c - p * d * c + p * l * f - a * x * f - u * l * m + a * d * m, v = g * d * c - h * x * c - g * l * f + o * x * f + h * l * m - o * d * m, y = h * p * c - g * u * c + g * a * f - o * p * f - h * a * m + o * u * m, M = g * u * l - h * p * l - g * a * d + o * p * d + h * a * x - o * u * x, E = t * b + n * v + i * y + r * M; if (E === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const A = 1 / E; - return e[0] = b * A, e[1] = (g * d * r - u * x * r - g * i * f + n * x * f + u * i * m - n * d * m) * A, e[2] = (a * x * r - g * l * r + g * i * c - n * x * c - a * i * m + n * l * m) * A, e[3] = (u * l * r - a * d * r - u * i * c + n * d * c + a * i * f - n * l * f) * A, e[4] = v * A, e[5] = (h * x * r - p * d * r + p * i * f - t * x * f - h * i * m + t * d * m) * A, e[6] = (p * l * r - o * x * r - p * i * c + t * x * c + o * i * m - t * l * m) * A, e[7] = (o * d * r - h * l * r + h * i * c - t * d * c - o * i * f + t * l * f) * A, e[8] = y * A, e[9] = (p * u * r - h * g * r - p * n * f + t * g * f + h * n * m - t * u * m) * A, e[10] = (o * g * r - p * a * r + p * n * c - t * g * c - o * n * m + t * a * m) * A, e[11] = (h * a * r - o * u * r - h * n * c + t * u * c + o * n * f - t * a * f) * A, e[12] = M * A, e[13] = (h * g * i - p * u * i + p * n * d - t * g * d - h * n * x + t * u * x) * A, e[14] = (p * a * i - o * g * i - p * n * l + t * g * l + o * n * x - t * a * x) * A, e[15] = (o * u * i - h * a * i + h * n * l - t * u * l - o * n * d + t * a * d) * A, this; + return e[0] = b * A, e[1] = (p * d * r - u * x * r - p * i * f + n * x * f + u * i * m - n * d * m) * A, e[2] = (a * x * r - p * l * r + p * i * c - n * x * c - a * i * m + n * l * m) * A, e[3] = (u * l * r - a * d * r - u * i * c + n * d * c + a * i * f - n * l * f) * A, e[4] = v * A, e[5] = (h * x * r - g * d * r + g * i * f - t * x * f - h * i * m + t * d * m) * A, e[6] = (g * l * r - o * x * r - g * i * c + t * x * c + o * i * m - t * l * m) * A, e[7] = (o * d * r - h * l * r + h * i * c - t * d * c - o * i * f + t * l * f) * A, e[8] = y * A, e[9] = (g * u * r - h * p * r - g * n * f + t * p * f + h * n * m - t * u * m) * A, e[10] = (o * p * r - g * a * r + g * n * c - t * p * c - o * n * m + t * a * m) * A, e[11] = (h * a * r - o * u * r - h * n * c + t * u * c + o * n * f - t * a * f) * A, e[12] = M * A, e[13] = (h * p * i - g * u * i + g * n * d - t * p * d - h * n * x + t * u * x) * A, e[14] = (g * a * i - o * p * i - g * n * l + t * p * l + o * n * x - t * a * x) * A, e[15] = (o * u * i - h * a * i + h * n * l - t * u * l - o * n * d + t * a * d) * A, this; } /** * Multiplies the columns of this matrix by the given vector. @@ -6929,8 +6929,8 @@ class ze { * @return {Matrix4} A reference to this matrix. */ compose(e, t, n) { - const i = this.elements, r = t._x, o = t._y, a = t._z, l = t._w, c = r + r, h = o + o, u = a + a, d = r * c, f = r * h, p = r * u, g = o * h, x = o * u, m = a * u, b = l * c, v = l * h, y = l * u, M = n.x, E = n.y, A = n.z; - return i[0] = (1 - (g + m)) * M, i[1] = (f + y) * M, i[2] = (p - v) * M, i[3] = 0, i[4] = (f - y) * E, i[5] = (1 - (d + m)) * E, i[6] = (x + b) * E, i[7] = 0, i[8] = (p + v) * A, i[9] = (x - b) * A, i[10] = (1 - (d + g)) * A, i[11] = 0, i[12] = e.x, i[13] = e.y, i[14] = e.z, i[15] = 1, this; + const i = this.elements, r = t._x, o = t._y, a = t._z, l = t._w, c = r + r, h = o + o, u = a + a, d = r * c, f = r * h, g = r * u, p = o * h, x = o * u, m = a * u, b = l * c, v = l * h, y = l * u, M = n.x, E = n.y, A = n.z; + return i[0] = (1 - (p + m)) * M, i[1] = (f + y) * M, i[2] = (g - v) * M, i[3] = 0, i[4] = (f - y) * E, i[5] = (1 - (d + m)) * E, i[6] = (x + b) * E, i[7] = 0, i[8] = (g + v) * A, i[9] = (x - b) * A, i[10] = (1 - (d + p)) * A, i[11] = 0, i[12] = e.x, i[13] = e.y, i[14] = e.z, i[15] = 1, this; } /** * Decomposes this matrix into its position, rotation and scale components @@ -6947,8 +6947,8 @@ class ze { */ decompose(e, t, n) { const i = this.elements; - let r = Fs.set(i[0], i[1], i[2]).length(); - const o = Fs.set(i[4], i[5], i[6]).length(), a = Fs.set(i[8], i[9], i[10]).length(); + let r = zs.set(i[0], i[1], i[2]).length(); + const o = zs.set(i[4], i[5], i[6]).length(), a = zs.set(i[8], i[9], i[10]).length(); this.determinant() < 0 && (r = -r), e.x = i[12], e.y = i[13], e.z = i[14], Xn.copy(this); const c = 1 / r, h = 1 / o, u = 1 / a; return Xn.elements[0] *= c, Xn.elements[1] *= c, Xn.elements[2] *= c, Xn.elements[4] *= h, Xn.elements[5] *= h, Xn.elements[6] *= h, Xn.elements[8] *= u, Xn.elements[9] *= u, Xn.elements[10] *= u, t.setFromRotationMatrix(Xn), n.x = r, n.y = o, n.z = a, this; @@ -6969,16 +6969,16 @@ class ze { */ makePerspective(e, t, n, i, r, o, a = li, l = !1) { const c = this.elements, h = 2 * r / (t - e), u = 2 * r / (n - i), d = (t + e) / (t - e), f = (n + i) / (n - i); - let p, g; + let g, p; if (l) - p = r / (o - r), g = o * r / (o - r); + g = r / (o - r), p = o * r / (o - r); else if (a === li) - p = -(o + r) / (o - r), g = -2 * o * r / (o - r); - else if (a === gl) - p = -o / (o - r), g = -o * r / (o - r); + g = -(o + r) / (o - r), p = -2 * o * r / (o - r); + else if (a === ml) + g = -o / (o - r), p = -o * r / (o - r); else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + a); - return c[0] = h, c[4] = 0, c[8] = d, c[12] = 0, c[1] = 0, c[5] = u, c[9] = f, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = p, c[14] = g, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this; + return c[0] = h, c[4] = 0, c[8] = d, c[12] = 0, c[1] = 0, c[5] = u, c[9] = f, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = g, c[14] = p, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this; } /** * Creates a orthographic projection matrix. This is used internally by @@ -6996,16 +6996,16 @@ class ze { */ makeOrthographic(e, t, n, i, r, o, a = li, l = !1) { const c = this.elements, h = 2 / (t - e), u = 2 / (n - i), d = -(t + e) / (t - e), f = -(n + i) / (n - i); - let p, g; + let g, p; if (l) - p = 1 / (o - r), g = o / (o - r); + g = 1 / (o - r), p = o / (o - r); else if (a === li) - p = -2 / (o - r), g = -(o + r) / (o - r); - else if (a === gl) - p = -1 / (o - r), g = -r / (o - r); + g = -2 / (o - r), p = -(o + r) / (o - r); + else if (a === ml) + g = -1 / (o - r), p = -r / (o - r); else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + a); - return c[0] = h, c[4] = 0, c[8] = 0, c[12] = d, c[1] = 0, c[5] = u, c[9] = 0, c[13] = f, c[2] = 0, c[6] = 0, c[10] = p, c[14] = g, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this; + return c[0] = h, c[4] = 0, c[8] = 0, c[12] = d, c[1] = 0, c[5] = u, c[9] = 0, c[13] = f, c[2] = 0, c[6] = 0, c[10] = g, c[14] = p, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this; } /** * Returns `true` if this matrix is equal with the given one. @@ -7044,7 +7044,7 @@ class ze { return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e; } } -const Fs = /* @__PURE__ */ new P(), Xn = /* @__PURE__ */ new ze(), fx = /* @__PURE__ */ new P(0, 0, 0), px = /* @__PURE__ */ new P(1, 1, 1), Oi = /* @__PURE__ */ new P(), Yo = /* @__PURE__ */ new P(), Tn = /* @__PURE__ */ new P(), Sd = /* @__PURE__ */ new ze(), Ed = /* @__PURE__ */ new zn(); +const zs = /* @__PURE__ */ new P(), Xn = /* @__PURE__ */ new ze(), fx = /* @__PURE__ */ new P(0, 0, 0), px = /* @__PURE__ */ new P(1, 1, 1), ki = /* @__PURE__ */ new P(), Yo = /* @__PURE__ */ new P(), Tn = /* @__PURE__ */ new P(), wd = /* @__PURE__ */ new ze(), Sd = /* @__PURE__ */ new zn(); class wn { /** * Constructs a new euler instance. @@ -7146,22 +7146,22 @@ class wn { const i = e.elements, r = i[0], o = i[4], a = i[8], l = i[1], c = i[5], h = i[9], u = i[2], d = i[6], f = i[10]; switch (t) { case "XYZ": - this._y = Math.asin(Ze(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(-h, f), this._z = Math.atan2(-o, r)) : (this._x = Math.atan2(d, c), this._z = 0); + this._y = Math.asin(qe(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(-h, f), this._z = Math.atan2(-o, r)) : (this._x = Math.atan2(d, c), this._z = 0); break; case "YXZ": - this._x = Math.asin(-Ze(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(a, f), this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, r), this._z = 0); + this._x = Math.asin(-qe(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(a, f), this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, r), this._z = 0); break; case "ZXY": - this._x = Math.asin(Ze(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(-u, f), this._z = Math.atan2(-o, c)) : (this._y = 0, this._z = Math.atan2(l, r)); + this._x = Math.asin(qe(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(-u, f), this._z = Math.atan2(-o, c)) : (this._y = 0, this._z = Math.atan2(l, r)); break; case "ZYX": - this._y = Math.asin(-Ze(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(d, f), this._z = Math.atan2(l, r)) : (this._x = 0, this._z = Math.atan2(-o, c)); + this._y = Math.asin(-qe(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(d, f), this._z = Math.atan2(l, r)) : (this._x = 0, this._z = Math.atan2(-o, c)); break; case "YZX": - this._z = Math.asin(Ze(l, -1, 1)), Math.abs(l) < 0.9999999 ? (this._x = Math.atan2(-h, c), this._y = Math.atan2(-u, r)) : (this._x = 0, this._y = Math.atan2(a, f)); + this._z = Math.asin(qe(l, -1, 1)), Math.abs(l) < 0.9999999 ? (this._x = Math.atan2(-h, c), this._y = Math.atan2(-u, r)) : (this._x = 0, this._y = Math.atan2(a, f)); break; case "XZY": - this._z = Math.asin(-Ze(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(a, r)) : (this._x = Math.atan2(-h, f), this._y = 0); + this._z = Math.asin(-qe(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(a, r)) : (this._x = Math.atan2(-h, f), this._y = 0); break; default: He("Euler: .setFromRotationMatrix() encountered an unknown order: " + t); @@ -7177,7 +7177,7 @@ class wn { * @return {Euler} A reference to this Euler instance. */ setFromQuaternion(e, t, n) { - return Sd.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Sd, t, n); + return wd.makeRotationFromQuaternion(e), this.setFromRotationMatrix(wd, t, n); } /** * Sets the angles of this Euler instance from the given vector. @@ -7200,7 +7200,7 @@ class wn { * @return {Euler} A reference to this Euler instance. */ reorder(e) { - return Ed.setFromEuler(this), this.setFromQuaternion(Ed, e); + return Sd.setFromEuler(this), this.setFromQuaternion(Sd, e); } /** * Returns `true` if this Euler instance is equal with the given one. @@ -7243,7 +7243,7 @@ class wn { } } wn.DEFAULT_ORDER = "XYZ"; -class Du { +class Lu { /** * Constructs a new layers instance, with membership * initially set to layer `0`. @@ -7316,13 +7316,13 @@ class Du { } } let mx = 0; -const Td = /* @__PURE__ */ new P(), zs = /* @__PURE__ */ new zn(), gi = /* @__PURE__ */ new ze(), Ko = /* @__PURE__ */ new P(), Vr = /* @__PURE__ */ new P(), gx = /* @__PURE__ */ new P(), xx = /* @__PURE__ */ new zn(), Ad = /* @__PURE__ */ new P(1, 0, 0), Cd = /* @__PURE__ */ new P(0, 1, 0), Pd = /* @__PURE__ */ new P(0, 0, 1), Rd = { type: "added" }, vx = { type: "removed" }, Hs = { type: "childadded", child: null }, Kl = { type: "childremoved", child: null }; -class St extends As { +const Ed = /* @__PURE__ */ new P(), Hs = /* @__PURE__ */ new zn(), gi = /* @__PURE__ */ new ze(), Ko = /* @__PURE__ */ new P(), Gr = /* @__PURE__ */ new P(), gx = /* @__PURE__ */ new P(), xx = /* @__PURE__ */ new zn(), Td = /* @__PURE__ */ new P(1, 0, 0), Ad = /* @__PURE__ */ new P(0, 1, 0), Cd = /* @__PURE__ */ new P(0, 0, 1), Pd = { type: "added" }, vx = { type: "removed" }, Vs = { type: "childadded", child: null }, Kl = { type: "childremoved", child: null }; +class wt extends Cs { /** * Constructs a new 3D object. */ constructor() { - super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: mx++ }), this.uuid = On(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = St.DEFAULT_UP.clone(); + super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: mx++ }), this.uuid = kn(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = wt.DEFAULT_UP.clone(); const e = new P(), t = new wn(), n = new zn(), i = new P(1, 1, 1); function r() { n.setFromEuler(t, !1); @@ -7396,7 +7396,7 @@ class St extends As { normalMatrix: { value: new $e() } - }), this.matrix = new ze(), this.matrixWorld = new ze(), this.matrixAutoUpdate = St.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = St.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new Du(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.customDepthMaterial = void 0, this.customDistanceMaterial = void 0, this.userData = {}; + }), this.matrix = new ze(), this.matrixWorld = new ze(), this.matrixAutoUpdate = wt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = wt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new Lu(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.customDepthMaterial = void 0, this.customDistanceMaterial = void 0, this.userData = {}; } /** * A callback that is executed immediately before a 3D object is rendered to a shadow map. @@ -7508,7 +7508,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ rotateOnAxis(e, t) { - return zs.setFromAxisAngle(e, t), this.quaternion.multiply(zs), this; + return Hs.setFromAxisAngle(e, t), this.quaternion.multiply(Hs), this; } /** * Rotates the 3D object along an axis in world space. @@ -7518,7 +7518,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ rotateOnWorldAxis(e, t) { - return zs.setFromAxisAngle(e, t), this.quaternion.premultiply(zs), this; + return Hs.setFromAxisAngle(e, t), this.quaternion.premultiply(Hs), this; } /** * Rotates the 3D object around its X axis in local space. @@ -7527,7 +7527,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ rotateX(e) { - return this.rotateOnAxis(Ad, e); + return this.rotateOnAxis(Td, e); } /** * Rotates the 3D object around its Y axis in local space. @@ -7536,7 +7536,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ rotateY(e) { - return this.rotateOnAxis(Cd, e); + return this.rotateOnAxis(Ad, e); } /** * Rotates the 3D object around its Z axis in local space. @@ -7545,7 +7545,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ rotateZ(e) { - return this.rotateOnAxis(Pd, e); + return this.rotateOnAxis(Cd, e); } /** * Translate the 3D object by a distance along the given axis in local space. @@ -7555,7 +7555,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ translateOnAxis(e, t) { - return Td.copy(e).applyQuaternion(this.quaternion), this.position.add(Td.multiplyScalar(t)), this; + return Ed.copy(e).applyQuaternion(this.quaternion), this.position.add(Ed.multiplyScalar(t)), this; } /** * Translate the 3D object by a distance along its X-axis in local space. @@ -7564,7 +7564,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ translateX(e) { - return this.translateOnAxis(Ad, e); + return this.translateOnAxis(Td, e); } /** * Translate the 3D object by a distance along its Y-axis in local space. @@ -7573,7 +7573,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ translateY(e) { - return this.translateOnAxis(Cd, e); + return this.translateOnAxis(Ad, e); } /** * Translate the 3D object by a distance along its Z-axis in local space. @@ -7582,7 +7582,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ translateZ(e) { - return this.translateOnAxis(Pd, e); + return this.translateOnAxis(Cd, e); } /** * Converts the given vector from this 3D object's local space to world space. @@ -7614,7 +7614,7 @@ class St extends As { lookAt(e, t, n) { e.isVector3 ? Ko.copy(e) : Ko.set(e, t, n); const i = this.parent; - this.updateWorldMatrix(!0, !1), Vr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? gi.lookAt(Vr, Ko, this.up) : gi.lookAt(Ko, Vr, this.up), this.quaternion.setFromRotationMatrix(gi), i && (gi.extractRotation(i.matrixWorld), zs.setFromRotationMatrix(gi), this.quaternion.premultiply(zs.invert())); + this.updateWorldMatrix(!0, !1), Gr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? gi.lookAt(Gr, Ko, this.up) : gi.lookAt(Ko, Gr, this.up), this.quaternion.setFromRotationMatrix(gi), i && (gi.extractRotation(i.matrixWorld), Hs.setFromRotationMatrix(gi), this.quaternion.premultiply(Hs.invert())); } /** * Adds the given 3D object as a child to this 3D object. An arbitrary number of @@ -7632,7 +7632,7 @@ class St extends As { this.add(arguments[t]); return this; } - return e === this ? (et("Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.removeFromParent(), e.parent = this, this.children.push(e), e.dispatchEvent(Rd), Hs.child = e, this.dispatchEvent(Hs), Hs.child = null) : et("Object3D.add: object not an instance of THREE.Object3D.", e), this); + return e === this ? (et("Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.removeFromParent(), e.parent = this, this.children.push(e), e.dispatchEvent(Pd), Vs.child = e, this.dispatchEvent(Vs), Vs.child = null) : et("Object3D.add: object not an instance of THREE.Object3D.", e), this); } /** * Removes the given 3D object as child from this 3D object. @@ -7683,7 +7683,7 @@ class St extends As { * @return {Object3D} A reference to this instance. */ attach(e) { - return this.updateWorldMatrix(!0, !1), gi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), gi.multiply(e.parent.matrixWorld)), e.applyMatrix4(gi), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Rd), Hs.child = e, this.dispatchEvent(Hs), Hs.child = null, this; + return this.updateWorldMatrix(!0, !1), gi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), gi.multiply(e.parent.matrixWorld)), e.applyMatrix4(gi), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Pd), Vs.child = e, this.dispatchEvent(Vs), Vs.child = null, this; } /** * Searches through the 3D object and its children, starting with the 3D object @@ -7753,7 +7753,7 @@ class St extends As { * @return {Quaternion} The 3D object's rotation in world space. */ getWorldQuaternion(e) { - return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Vr, e, gx), e; + return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Gr, e, gx), e; } /** * Returns a vector representing the scale of the 3D object in world space. @@ -7762,7 +7762,7 @@ class St extends As { * @return {Vector3} The 3D object's scale in world space. */ getWorldScale(e) { - return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Vr, xx, e), e; + return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Gr, xx, e), e; } /** * Returns a vector representing the ("look") direction of the 3D object in world space. @@ -7933,8 +7933,8 @@ class St extends As { } } if (t) { - const a = o(e.geometries), l = o(e.materials), c = o(e.textures), h = o(e.images), u = o(e.shapes), d = o(e.skeletons), f = o(e.animations), p = o(e.nodes); - a.length > 0 && (n.geometries = a), l.length > 0 && (n.materials = l), c.length > 0 && (n.textures = c), h.length > 0 && (n.images = h), u.length > 0 && (n.shapes = u), d.length > 0 && (n.skeletons = d), f.length > 0 && (n.animations = f), p.length > 0 && (n.nodes = p); + const a = o(e.geometries), l = o(e.materials), c = o(e.textures), h = o(e.images), u = o(e.shapes), d = o(e.skeletons), f = o(e.animations), g = o(e.nodes); + a.length > 0 && (n.geometries = a), l.length > 0 && (n.materials = l), c.length > 0 && (n.textures = c), h.length > 0 && (n.images = h), u.length > 0 && (n.shapes = u), d.length > 0 && (n.skeletons = d), f.length > 0 && (n.animations = f), g.length > 0 && (n.nodes = g); } return n.object = i, n; function o(a) { @@ -7971,10 +7971,10 @@ class St extends As { return this; } } -St.DEFAULT_UP = /* @__PURE__ */ new P(0, 1, 0); -St.DEFAULT_MATRIX_AUTO_UPDATE = !0; -St.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0; -const jn = /* @__PURE__ */ new P(), xi = /* @__PURE__ */ new P(), $l = /* @__PURE__ */ new P(), vi = /* @__PURE__ */ new P(), Vs = /* @__PURE__ */ new P(), Gs = /* @__PURE__ */ new P(), Ld = /* @__PURE__ */ new P(), Jl = /* @__PURE__ */ new P(), Ql = /* @__PURE__ */ new P(), ec = /* @__PURE__ */ new P(), tc = /* @__PURE__ */ new tt(), nc = /* @__PURE__ */ new tt(), ic = /* @__PURE__ */ new tt(); +wt.DEFAULT_UP = /* @__PURE__ */ new P(0, 1, 0); +wt.DEFAULT_MATRIX_AUTO_UPDATE = !0; +wt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0; +const jn = /* @__PURE__ */ new P(), xi = /* @__PURE__ */ new P(), $l = /* @__PURE__ */ new P(), vi = /* @__PURE__ */ new P(), Gs = /* @__PURE__ */ new P(), Ws = /* @__PURE__ */ new P(), Rd = /* @__PURE__ */ new P(), Jl = /* @__PURE__ */ new P(), Ql = /* @__PURE__ */ new P(), ec = /* @__PURE__ */ new P(), tc = /* @__PURE__ */ new tt(), nc = /* @__PURE__ */ new tt(), ic = /* @__PURE__ */ new tt(); class bt { /** * Constructs a new triangle. @@ -8016,8 +8016,8 @@ class bt { const o = jn.dot(jn), a = jn.dot(xi), l = jn.dot($l), c = xi.dot(xi), h = xi.dot($l), u = o * c - a * a; if (u === 0) return r.set(0, 0, 0), null; - const d = 1 / u, f = (c * l - a * h) * d, p = (o * h - a * l) * d; - return r.set(1 - f - p, p, f); + const d = 1 / u, f = (c * l - a * h) * d, g = (o * h - a * l) * d; + return r.set(1 - f - g, g, f); } /** * Returns `true` if the given point, when projected onto the plane of the @@ -8227,29 +8227,29 @@ class bt { closestPointToPoint(e, t) { const n = this.a, i = this.b, r = this.c; let o, a; - Vs.subVectors(i, n), Gs.subVectors(r, n), Jl.subVectors(e, n); - const l = Vs.dot(Jl), c = Gs.dot(Jl); + Gs.subVectors(i, n), Ws.subVectors(r, n), Jl.subVectors(e, n); + const l = Gs.dot(Jl), c = Ws.dot(Jl); if (l <= 0 && c <= 0) return t.copy(n); Ql.subVectors(e, i); - const h = Vs.dot(Ql), u = Gs.dot(Ql); + const h = Gs.dot(Ql), u = Ws.dot(Ql); if (h >= 0 && u <= h) return t.copy(i); const d = l * u - h * c; if (d <= 0 && l >= 0 && h <= 0) - return o = l / (l - h), t.copy(n).addScaledVector(Vs, o); + return o = l / (l - h), t.copy(n).addScaledVector(Gs, o); ec.subVectors(e, r); - const f = Vs.dot(ec), p = Gs.dot(ec); - if (p >= 0 && f <= p) + const f = Gs.dot(ec), g = Ws.dot(ec); + if (g >= 0 && f <= g) return t.copy(r); - const g = f * c - l * p; - if (g <= 0 && c >= 0 && p <= 0) - return a = c / (c - p), t.copy(n).addScaledVector(Gs, a); - const x = h * p - f * u; - if (x <= 0 && u - h >= 0 && f - p >= 0) - return Ld.subVectors(r, i), a = (u - h) / (u - h + (f - p)), t.copy(i).addScaledVector(Ld, a); - const m = 1 / (x + g + d); - return o = g * m, a = d * m, t.copy(n).addScaledVector(Vs, o).addScaledVector(Gs, a); + const p = f * c - l * g; + if (p <= 0 && c >= 0 && g <= 0) + return a = c / (c - g), t.copy(n).addScaledVector(Ws, a); + const x = h * g - f * u; + if (x <= 0 && u - h >= 0 && f - g >= 0) + return Rd.subVectors(r, i), a = (u - h) / (u - h + (f - g)), t.copy(i).addScaledVector(Rd, a); + const m = 1 / (x + p + d); + return o = p * m, a = d * m, t.copy(n).addScaledVector(Gs, o).addScaledVector(Ws, a); } /** * Returns `true` if this triangle is equal with the given one. @@ -8414,7 +8414,7 @@ const _m = { function sc(s, e, t) { return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? s + (e - s) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? s + (e - s) * 6 * (2 / 3 - t) : s; } -class Fe { +class Oe { /** * Constructs a new color. * @@ -8487,7 +8487,7 @@ class Fe { * @return {Color} A reference to this color. */ setHSL(e, t, n, i = st.workingColorSpace) { - if (e = Ru(e, 1), t = Ze(t, 0, 1), n = Ze(n, 0, 1), t === 0) + if (e = Pu(e, 1), t = qe(t, 0, 1), n = qe(n, 0, 1), t === 0) this.r = this.g = this.b = n; else { const r = n <= 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - r; @@ -8612,7 +8612,7 @@ class Fe { * @return {Color} A reference to this color. */ copyLinearToSRGB(e) { - return this.r = mr(e.r), this.g = mr(e.g), this.b = mr(e.b), this; + return this.r = gr(e.r), this.g = gr(e.g), this.b = gr(e.b), this; } /** * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`. @@ -8637,7 +8637,7 @@ class Fe { * @return {number} The hexadecimal value. */ getHex(e = xt) { - return st.workingToColorSpace(tn.copy(this), e), Math.round(Ze(tn.r * 255, 0, 255)) * 65536 + Math.round(Ze(tn.g * 255, 0, 255)) * 256 + Math.round(Ze(tn.b * 255, 0, 255)); + return st.workingToColorSpace(tn.copy(this), e), Math.round(qe(tn.r * 255, 0, 255)) * 65536 + Math.round(qe(tn.g * 255, 0, 255)) * 256 + Math.round(qe(tn.b * 255, 0, 255)); } /** * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF'). @@ -8807,7 +8807,7 @@ class Fe { */ lerpHSL(e, t) { this.getHSL(Fi), e.getHSL($o); - const n = mo(Fi.h, $o.h, t), i = mo(Fi.s, $o.s, t), r = mo(Fi.l, $o.l, t); + const n = go(Fi.h, $o.h, t), i = go(Fi.s, $o.s, t), r = go(Fi.l, $o.l, t); return this.setHSL(n, i, r), this; } /** @@ -8882,15 +8882,15 @@ class Fe { yield this.r, yield this.g, yield this.b; } } -const tn = /* @__PURE__ */ new Fe(); -Fe.NAMES = _m; +const tn = /* @__PURE__ */ new Oe(); +Oe.NAMES = _m; let bx = 0; -class yn extends As { +class yn extends Cs { /** * Constructs a new material. */ constructor() { - super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: bx++ }), this.uuid = On(), this.name = "", this.type = "Material", this.blending = pr, this.side = Fn, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = rh, this.blendDst = oh, this.blendEquation = Zn, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Fe(0, 0, 0), this.blendAlpha = 0, this.depthFunc = vr, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = xd, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Bs, this.stencilZFail = Bs, this.stencilZPass = Bs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0; + super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: bx++ }), this.uuid = kn(), this.name = "", this.type = "Material", this.blending = mr, this.side = Fn, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = rh, this.blendDst = oh, this.blendEquation = qn, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Oe(0, 0, 0), this.blendAlpha = 0, this.depthFunc = br, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = gd, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Ns, this.stencilZFail = Ns, this.stencilZPass = Ns, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0; } /** * Sets the alpha value to be used when running an alpha test. The material @@ -8989,7 +8989,7 @@ class yn extends As { generator: "Material.toJSON" } }; - n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== pr && (n.blending = this.blending), this.side !== Fn && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== rh && (n.blendSrc = this.blendSrc), this.blendDst !== oh && (n.blendDst = this.blendDst), this.blendEquation !== Zn && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== vr && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== xd && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Bs && (n.stencilFail = this.stencilFail), this.stencilZFail !== Bs && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Bs && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData); + n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== mr && (n.blending = this.blending), this.side !== Fn && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== rh && (n.blendSrc = this.blendSrc), this.blendDst !== oh && (n.blendDst = this.blendDst), this.blendEquation !== qn && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== br && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== gd && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Ns && (n.stencilFail = this.stencilFail), this.stencilZFail !== Ns && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Ns && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData); function i(r) { const o = []; for (const a in r) { @@ -9051,7 +9051,7 @@ class yn extends As { e === !0 && this.version++; } } -class Zt extends yn { +class qt extends yn { /** * Constructs a new mesh basic material. * @@ -9062,13 +9062,13 @@ class Zt extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Fe(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.envMapRotation = new wn(), this.combine = Tl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e); + super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Oe(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.envMapRotation = new wn(), this.combine = Tl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, 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.envMapRotation.copy(e.envMapRotation), 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.fog = e.fog, this; } } -const Ot = /* @__PURE__ */ new P(), Jo = /* @__PURE__ */ new ce(); +const kt = /* @__PURE__ */ new P(), Jo = /* @__PURE__ */ new ce(); let yx = 0; class at { /** @@ -9081,7 +9081,7 @@ class at { constructor(e, t, n = !1) { if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); - this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: yx++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = qh, this.updateRanges = [], this.gpuType = $n, this.version = 0; + this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: yx++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = Zh, this.updateRanges = [], this.gpuType = $n, this.version = 0; } /** * A callback function that is executed after the renderer has transferred the attribute @@ -9171,7 +9171,7 @@ class at { Jo.fromBufferAttribute(this, t), Jo.applyMatrix3(e), this.setXY(t, Jo.x, Jo.y); else if (this.itemSize === 3) for (let t = 0, n = this.count; t < n; t++) - Ot.fromBufferAttribute(this, t), Ot.applyMatrix3(e), this.setXYZ(t, Ot.x, Ot.y, Ot.z); + kt.fromBufferAttribute(this, t), kt.applyMatrix3(e), this.setXYZ(t, kt.x, kt.y, kt.z); return this; } /** @@ -9183,7 +9183,7 @@ class at { */ applyMatrix4(e) { for (let t = 0, n = this.count; t < n; t++) - Ot.fromBufferAttribute(this, t), Ot.applyMatrix4(e), this.setXYZ(t, Ot.x, Ot.y, Ot.z); + kt.fromBufferAttribute(this, t), kt.applyMatrix4(e), this.setXYZ(t, kt.x, kt.y, kt.z); return this; } /** @@ -9195,7 +9195,7 @@ class at { */ applyNormalMatrix(e) { for (let t = 0, n = this.count; t < n; t++) - Ot.fromBufferAttribute(this, t), Ot.applyNormalMatrix(e), this.setXYZ(t, Ot.x, Ot.y, Ot.z); + kt.fromBufferAttribute(this, t), kt.applyNormalMatrix(e), this.setXYZ(t, kt.x, kt.y, kt.z); return this; } /** @@ -9207,7 +9207,7 @@ class at { */ transformDirection(e) { for (let t = 0, n = this.count; t < n; t++) - Ot.fromBufferAttribute(this, t), Ot.transformDirection(e), this.setXYZ(t, Ot.x, Ot.y, Ot.z); + kt.fromBufferAttribute(this, t), kt.transformDirection(e), this.setXYZ(t, kt.x, kt.y, kt.z); return this; } /** @@ -9389,7 +9389,7 @@ class at { array: Array.from(this.array), normalized: this.normalized }; - return this.name !== "" && (e.name = this.name), this.usage !== qh && (e.usage = this.usage), e; + return this.name !== "" && (e.name = this.name), this.usage !== Zh && (e.usage = this.usage), e; } } class Mm extends at { @@ -9429,13 +9429,13 @@ class rn extends at { } } let _x = 0; -const Rn = /* @__PURE__ */ new ze(), rc = /* @__PURE__ */ new St(), Ws = /* @__PURE__ */ new P(), An = /* @__PURE__ */ new vt(), Gr = /* @__PURE__ */ new vt(), Wt = /* @__PURE__ */ new P(); -class ut extends As { +const Rn = /* @__PURE__ */ new ze(), rc = /* @__PURE__ */ new wt(), Xs = /* @__PURE__ */ new P(), An = /* @__PURE__ */ new vt(), Wr = /* @__PURE__ */ new vt(), Wt = /* @__PURE__ */ new P(); +class ut extends Cs { /** * Constructs a new geometry. */ constructor() { - super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: _x++ }), this.uuid = On(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {}; + super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: _x++ }), this.uuid = kn(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {}; } /** * Returns the index of this geometry. @@ -9642,7 +9642,7 @@ class ut extends As { * @return {BufferGeometry} A reference to this instance. */ center() { - return this.computeBoundingBox(), this.boundingBox.getCenter(Ws).negate(), this.translate(Ws.x, Ws.y, Ws.z), this; + return this.computeBoundingBox(), this.boundingBox.getCenter(Xs).negate(), this.translate(Xs.x, Xs.y, Xs.z), this; } /** * Defines a geometry by creating a `position` attribute based on the given array of points. The array @@ -9716,7 +9716,7 @@ class ut extends As { if (An.setFromBufferAttribute(e), t) for (let r = 0, o = t.length; r < o; r++) { const a = t[r]; - Gr.setFromBufferAttribute(a), this.morphTargetsRelative ? (Wt.addVectors(An.min, Gr.min), An.expandByPoint(Wt), Wt.addVectors(An.max, Gr.max), An.expandByPoint(Wt)) : (An.expandByPoint(Gr.min), An.expandByPoint(Gr.max)); + Wr.setFromBufferAttribute(a), this.morphTargetsRelative ? (Wt.addVectors(An.min, Wr.min), An.expandByPoint(Wt), Wt.addVectors(An.max, Wr.max), An.expandByPoint(Wt)) : (An.expandByPoint(Wr.min), An.expandByPoint(Wr.max)); } An.getCenter(n); let i = 0; @@ -9726,7 +9726,7 @@ class ut extends As { for (let r = 0, o = t.length; r < o; r++) { const a = t[r], l = this.morphTargetsRelative; for (let c = 0, h = a.count; c < h; c++) - Wt.fromBufferAttribute(a, c), l && (Ws.fromBufferAttribute(e, c), Wt.add(Ws)), i = Math.max(i, n.distanceToSquared(Wt)); + Wt.fromBufferAttribute(a, c), l && (Xs.fromBufferAttribute(e, c), Wt.add(Xs)), i = Math.max(i, n.distanceToSquared(Wt)); } this.boundingSphere.radius = Math.sqrt(i), isNaN(this.boundingSphere.radius) && et('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this); } @@ -9749,11 +9749,11 @@ class ut extends As { const o = this.getAttribute("tangent"), a = [], l = []; for (let R = 0; R < n.count; R++) a[R] = new P(), l[R] = new P(); - const c = new P(), h = new P(), u = new P(), d = new ce(), f = new ce(), p = new ce(), g = new P(), x = new P(); + const c = new P(), h = new P(), u = new P(), d = new ce(), f = new ce(), g = new ce(), p = new P(), x = new P(); function m(R, _, S) { - c.fromBufferAttribute(n, R), h.fromBufferAttribute(n, _), u.fromBufferAttribute(n, S), d.fromBufferAttribute(r, R), f.fromBufferAttribute(r, _), p.fromBufferAttribute(r, S), h.sub(c), u.sub(c), f.sub(d), p.sub(d); - const D = 1 / (f.x * p.y - p.x * f.y); - isFinite(D) && (g.copy(h).multiplyScalar(p.y).addScaledVector(u, -f.y).multiplyScalar(D), x.copy(u).multiplyScalar(f.x).addScaledVector(h, -p.x).multiplyScalar(D), a[R].add(g), a[_].add(g), a[S].add(g), l[R].add(x), l[_].add(x), l[S].add(x)); + c.fromBufferAttribute(n, R), h.fromBufferAttribute(n, _), u.fromBufferAttribute(n, S), d.fromBufferAttribute(r, R), f.fromBufferAttribute(r, _), g.fromBufferAttribute(r, S), h.sub(c), u.sub(c), f.sub(d), g.sub(d); + const D = 1 / (f.x * g.y - g.x * f.y); + isFinite(D) && (p.copy(h).multiplyScalar(g.y).addScaledVector(u, -f.y).multiplyScalar(D), x.copy(u).multiplyScalar(f.x).addScaledVector(h, -g.x).multiplyScalar(D), a[R].add(p), a[_].add(p), a[S].add(p), l[R].add(x), l[_].add(x), l[S].add(x)); } let b = this.groups; b.length === 0 && (b = [{ @@ -9801,8 +9801,8 @@ class ut extends As { const i = new P(), r = new P(), o = new P(), a = new P(), l = new P(), c = new P(), h = new P(), u = new P(); if (e) for (let d = 0, f = e.count; d < f; d += 3) { - const p = e.getX(d + 0), g = e.getX(d + 1), x = e.getX(d + 2); - i.fromBufferAttribute(t, p), r.fromBufferAttribute(t, g), o.fromBufferAttribute(t, x), h.subVectors(o, r), u.subVectors(i, r), h.cross(u), a.fromBufferAttribute(n, p), l.fromBufferAttribute(n, g), c.fromBufferAttribute(n, x), a.add(h), l.add(h), c.add(h), n.setXYZ(p, a.x, a.y, a.z), n.setXYZ(g, l.x, l.y, l.z), n.setXYZ(x, c.x, c.y, c.z); + const g = e.getX(d + 0), p = e.getX(d + 1), x = e.getX(d + 2); + i.fromBufferAttribute(t, g), r.fromBufferAttribute(t, p), o.fromBufferAttribute(t, x), h.subVectors(o, r), u.subVectors(i, r), h.cross(u), a.fromBufferAttribute(n, g), l.fromBufferAttribute(n, p), c.fromBufferAttribute(n, x), a.add(h), l.add(h), c.add(h), n.setXYZ(g, a.x, a.y, a.z), n.setXYZ(p, l.x, l.y, l.z), n.setXYZ(x, c.x, c.y, c.z); } else for (let d = 0, f = t.count; d < f; d += 3) @@ -9828,11 +9828,11 @@ class ut extends As { toNonIndexed() { function e(a, l) { const c = a.array, h = a.itemSize, u = a.normalized, d = new c.constructor(l.length * h); - let f = 0, p = 0; - for (let g = 0, x = l.length; g < x; g++) { - a.isInterleavedBufferAttribute ? f = l[g] * a.data.stride + a.offset : f = l[g] * h; + let f = 0, g = 0; + for (let p = 0, x = l.length; p < x; p++) { + a.isInterleavedBufferAttribute ? f = l[p] * a.data.stride + a.offset : f = l[p] * h; for (let m = 0; m < h; m++) - d[p++] = c[f++]; + d[g++] = c[f++]; } return new at(d, h, u); } @@ -9959,15 +9959,15 @@ class ut extends As { this.dispatchEvent({ type: "dispose" }); } } -const Dd = /* @__PURE__ */ new ze(), rs = /* @__PURE__ */ new Qi(), Qo = /* @__PURE__ */ new di(), Id = /* @__PURE__ */ new P(), ea = /* @__PURE__ */ new P(), ta = /* @__PURE__ */ new P(), na = /* @__PURE__ */ new P(), oc = /* @__PURE__ */ new P(), ia = /* @__PURE__ */ new P(), Bd = /* @__PURE__ */ new P(), sa = /* @__PURE__ */ new P(); -class dt extends St { +const Ld = /* @__PURE__ */ new ze(), rs = /* @__PURE__ */ new Qi(), Qo = /* @__PURE__ */ new di(), Dd = /* @__PURE__ */ new P(), ea = /* @__PURE__ */ new P(), ta = /* @__PURE__ */ new P(), na = /* @__PURE__ */ new P(), oc = /* @__PURE__ */ new P(), ia = /* @__PURE__ */ new P(), Id = /* @__PURE__ */ new P(), sa = /* @__PURE__ */ new P(); +class dt extends wt { /** * Constructs a new mesh. * * @param {BufferGeometry} [geometry] - The mesh geometry. * @param {Material|Array} [material] - The mesh material. */ - constructor(e = new ut(), t = new Zt()) { + constructor(e = new ut(), t = new qt()) { super(), this.isMesh = !0, this.type = "Mesh", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets(); } copy(e, t) { @@ -10020,39 +10020,39 @@ class dt extends St { */ raycast(e, t) { const n = this.geometry, i = this.material, r = this.matrixWorld; - i !== void 0 && (n.boundingSphere === null && n.computeBoundingSphere(), Qo.copy(n.boundingSphere), Qo.applyMatrix4(r), rs.copy(e.ray).recast(e.near), !(Qo.containsPoint(rs.origin) === !1 && (rs.intersectSphere(Qo, Id) === null || rs.origin.distanceToSquared(Id) > (e.far - e.near) ** 2)) && (Dd.copy(r).invert(), rs.copy(e.ray).applyMatrix4(Dd), !(n.boundingBox !== null && rs.intersectsBox(n.boundingBox) === !1) && this._computeIntersections(e, t, rs))); + i !== void 0 && (n.boundingSphere === null && n.computeBoundingSphere(), Qo.copy(n.boundingSphere), Qo.applyMatrix4(r), rs.copy(e.ray).recast(e.near), !(Qo.containsPoint(rs.origin) === !1 && (rs.intersectSphere(Qo, Dd) === null || rs.origin.distanceToSquared(Dd) > (e.far - e.near) ** 2)) && (Ld.copy(r).invert(), rs.copy(e.ray).applyMatrix4(Ld), !(n.boundingBox !== null && rs.intersectsBox(n.boundingBox) === !1) && this._computeIntersections(e, t, rs))); } _computeIntersections(e, t, n) { let i; const r = this.geometry, o = this.material, a = r.index, l = r.attributes.position, c = r.attributes.uv, h = r.attributes.uv1, u = r.attributes.normal, d = r.groups, f = r.drawRange; if (a !== null) if (Array.isArray(o)) - for (let p = 0, g = d.length; p < g; p++) { - const x = d[p], m = o[x.materialIndex], b = Math.max(x.start, f.start), v = Math.min(a.count, Math.min(x.start + x.count, f.start + f.count)); + for (let g = 0, p = d.length; g < p; g++) { + const x = d[g], m = o[x.materialIndex], b = Math.max(x.start, f.start), v = Math.min(a.count, Math.min(x.start + x.count, f.start + f.count)); for (let y = b, M = v; y < M; y += 3) { const E = a.getX(y), A = a.getX(y + 1), R = a.getX(y + 2); i = ra(this, m, e, n, c, h, u, E, A, R), i && (i.faceIndex = Math.floor(y / 3), i.face.materialIndex = x.materialIndex, t.push(i)); } } else { - const p = Math.max(0, f.start), g = Math.min(a.count, f.start + f.count); - for (let x = p, m = g; x < m; x += 3) { + const g = Math.max(0, f.start), p = Math.min(a.count, f.start + f.count); + for (let x = g, m = p; x < m; x += 3) { const b = a.getX(x), v = a.getX(x + 1), y = a.getX(x + 2); i = ra(this, o, e, n, c, h, u, b, v, y), i && (i.faceIndex = Math.floor(x / 3), t.push(i)); } } else if (l !== void 0) if (Array.isArray(o)) - for (let p = 0, g = d.length; p < g; p++) { - const x = d[p], m = o[x.materialIndex], b = Math.max(x.start, f.start), v = Math.min(l.count, Math.min(x.start + x.count, f.start + f.count)); + for (let g = 0, p = d.length; g < p; g++) { + const x = d[g], m = o[x.materialIndex], b = Math.max(x.start, f.start), v = Math.min(l.count, Math.min(x.start + x.count, f.start + f.count)); for (let y = b, M = v; y < M; y += 3) { const E = y, A = y + 1, R = y + 2; i = ra(this, m, e, n, c, h, u, E, A, R), i && (i.faceIndex = Math.floor(y / 3), i.face.materialIndex = x.materialIndex, t.push(i)); } } else { - const p = Math.max(0, f.start), g = Math.min(l.count, f.start + f.count); - for (let x = p, m = g; x < m; x += 3) { + const g = Math.max(0, f.start), p = Math.min(l.count, f.start + f.count); + for (let x = g, m = p; x < m; x += 3) { const b = x, v = x + 1, y = x + 2; i = ra(this, o, e, n, c, h, u, b, v, y), i && (i.faceIndex = Math.floor(x / 3), t.push(i)); } @@ -10072,10 +10072,10 @@ function Mx(s, e, t, n, i, r, o, a) { } function ra(s, e, t, n, i, r, o, a, l, c) { s.getVertexPosition(a, ea), s.getVertexPosition(l, ta), s.getVertexPosition(c, na); - const h = Mx(s, e, t, n, ea, ta, na, Bd); + const h = Mx(s, e, t, n, ea, ta, na, Id); if (h) { const u = new P(); - bt.getBarycoord(Bd, ea, ta, na, u), i && (h.uv = bt.getInterpolatedAttribute(i, a, l, c, u, new ce())), r && (h.uv1 = bt.getInterpolatedAttribute(r, a, l, c, u, new ce())), o && (h.normal = bt.getInterpolatedAttribute(o, a, l, c, u, new P()), h.normal.dot(n.direction) > 0 && h.normal.multiplyScalar(-1)); + bt.getBarycoord(Id, ea, ta, na, u), i && (h.uv = bt.getInterpolatedAttribute(i, a, l, c, u, new ce())), r && (h.uv1 = bt.getInterpolatedAttribute(r, a, l, c, u, new ce())), o && (h.normal = bt.getInterpolatedAttribute(o, a, l, c, u, new P()), h.normal.dot(n.direction) > 0 && h.normal.multiplyScalar(-1)); const d = { a, b: l, @@ -10111,16 +10111,16 @@ class $i extends ut { i = Math.floor(i), r = Math.floor(r), o = Math.floor(o); const l = [], c = [], h = [], u = []; let d = 0, f = 0; - p("z", "y", "x", -1, -1, n, t, e, o, r, 0), p("z", "y", "x", 1, -1, n, t, -e, o, r, 1), p("x", "z", "y", 1, 1, e, n, t, i, o, 2), p("x", "z", "y", 1, -1, e, n, -t, i, o, 3), p("x", "y", "z", 1, -1, e, t, n, i, r, 4), p("x", "y", "z", -1, -1, e, t, -n, i, r, 5), this.setIndex(l), this.setAttribute("position", new rn(c, 3)), this.setAttribute("normal", new rn(h, 3)), this.setAttribute("uv", new rn(u, 2)); - function p(g, x, m, b, v, y, M, E, A, R, _) { + g("z", "y", "x", -1, -1, n, t, e, o, r, 0), g("z", "y", "x", 1, -1, n, t, -e, o, r, 1), g("x", "z", "y", 1, 1, e, n, t, i, o, 2), g("x", "z", "y", 1, -1, e, n, -t, i, o, 3), g("x", "y", "z", 1, -1, e, t, n, i, r, 4), g("x", "y", "z", -1, -1, e, t, -n, i, r, 5), this.setIndex(l), this.setAttribute("position", new rn(c, 3)), this.setAttribute("normal", new rn(h, 3)), this.setAttribute("uv", new rn(u, 2)); + function g(p, x, m, b, v, y, M, E, A, R, _) { const S = y / A, D = M / R, C = y / 2, B = M / 2, w = E / 2, F = A + 1, W = R + 1; let j = 0, $ = 0; - const Z = new P(); + const q = new P(); for (let re = 0; re < W; re++) { const X = re * D - B; for (let Y = 0; Y < F; Y++) { const ge = Y * S - C; - Z[g] = ge * b, Z[x] = X * v, Z[m] = w, c.push(Z.x, Z.y, Z.z), Z[g] = 0, Z[x] = 0, Z[m] = E > 0 ? 1 : -1, h.push(Z.x, Z.y, Z.z), u.push(Y / A), u.push(1 - re / R), j += 1; + q[p] = ge * b, q[x] = X * v, q[m] = w, c.push(q.x, q.y, q.z), q[p] = 0, q[x] = 0, q[m] = E > 0 ? 1 : -1, h.push(q.x, q.y, q.z), u.push(Y / A), u.push(1 - re / R), j += 1; } } for (let re = 0; re < R; re++) @@ -10145,7 +10145,7 @@ class $i extends ut { return new $i(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments); } } -function Sr(s) { +function Er(s) { const e = {}; for (const t in s) { e[t] = {}; @@ -10159,7 +10159,7 @@ function Sr(s) { function cn(s) { const e = {}; for (let t = 0; t < s.length; t++) { - const n = Sr(s[t]); + const n = Er(s[t]); for (const i in n) e[i] = n[i]; } @@ -10175,13 +10175,13 @@ function Sm(s) { const e = s.getRenderTarget(); return e === null ? s.outputColorSpace : e.isXRRenderTarget === !0 ? e.texture.colorSpace : st.workingColorSpace; } -const oi = { clone: Sr, merge: cn }; +const oi = { clone: Er, merge: cn }; var Sx = `void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`, Ex = `void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }`; -class Ut extends yn { +class Ot extends yn { /** * Constructs a new shader material. * @@ -10204,7 +10204,7 @@ class Ut extends yn { }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && this.setValues(e); } copy(e) { - return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Sr(e.uniforms), this.uniformsGroups = wx(e.uniformsGroups), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.fog = e.fog, this.lights = e.lights, this.clipping = e.clipping, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this; + return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Er(e.uniforms), this.uniformsGroups = wx(e.uniformsGroups), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.fog = e.fog, this.lights = e.lights, this.clipping = e.clipping, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this; } toJSON(e) { const t = super.toJSON(e); @@ -10243,7 +10243,7 @@ class Ut extends yn { return Object.keys(n).length > 0 && (t.extensions = n), t; } } -class Em extends St { +class Em extends wt { /** * Constructs a new camera. */ @@ -10284,7 +10284,7 @@ class Em extends St { return new this.constructor().copy(this); } } -const zi = /* @__PURE__ */ new P(), Nd = /* @__PURE__ */ new ce(), kd = /* @__PURE__ */ new ce(); +const zi = /* @__PURE__ */ new P(), Bd = /* @__PURE__ */ new ce(), Nd = /* @__PURE__ */ new ce(); class nn extends Em { /** * Constructs a new perspective camera. @@ -10310,7 +10310,7 @@ class nn extends Em { */ setFocalLength(e) { const t = 0.5 * this.getFilmHeight() / e; - this.fov = wr * 2 * Math.atan(t), this.updateProjectionMatrix(); + this.fov = Sr * 2 * Math.atan(t), this.updateProjectionMatrix(); } /** * Returns the focal length from the current {@link PerspectiveCamera#fov} and @@ -10319,7 +10319,7 @@ class nn extends Em { * @return {number} The computed focal length. */ getFocalLength() { - const e = Math.tan(po * 0.5 * this.fov); + const e = Math.tan(mo * 0.5 * this.fov); return 0.5 * this.getFilmHeight() / e; } /** @@ -10328,8 +10328,8 @@ class nn extends Em { * @return {number} The effective FOV. */ getEffectiveFOV() { - return wr * 2 * Math.atan( - Math.tan(po * 0.5 * this.fov) / this.zoom + return Sr * 2 * Math.atan( + Math.tan(mo * 0.5 * this.fov) / this.zoom ); } /** @@ -10369,7 +10369,7 @@ class nn extends Em { * @returns {Vector2} The view size. */ getViewSize(e, t) { - return this.getViewBounds(e, Nd, kd), t.subVectors(kd, Nd); + return this.getViewBounds(e, Bd, Nd), t.subVectors(Nd, Bd); } /** * Sets an offset in a larger frustum. This is useful for multi-window or @@ -10437,7 +10437,7 @@ class nn extends Em { */ updateProjectionMatrix() { const e = this.near; - let t = e * Math.tan(po * 0.5 * this.fov) / this.zoom, n = 2 * t, i = this.aspect * n, r = -0.5 * i; + let t = e * Math.tan(mo * 0.5 * this.fov) / this.zoom, n = 2 * t, i = this.aspect * n, r = -0.5 * i; const o = this.view; if (this.view !== null && this.view.enabled) { const l = o.fullWidth, c = o.fullHeight; @@ -10451,8 +10451,8 @@ class nn extends Em { 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; } } -const Xs = -90, js = 1; -class Tx extends St { +const js = -90, Zs = 1; +class Tx extends wt { /** * Constructs a new cube camera. * @@ -10462,17 +10462,17 @@ class Tx extends St { */ constructor(e, t, n) { super(), this.type = "CubeCamera", this.renderTarget = n, this.coordinateSystem = null, this.activeMipmapLevel = 0; - const i = new nn(Xs, js, e, t); + const i = new nn(js, Zs, e, t); i.layers = this.layers, this.add(i); - const r = new nn(Xs, js, e, t); + const r = new nn(js, Zs, e, t); r.layers = this.layers, this.add(r); - const o = new nn(Xs, js, e, t); + const o = new nn(js, Zs, e, t); o.layers = this.layers, this.add(o); - const a = new nn(Xs, js, e, t); + const a = new nn(js, Zs, e, t); a.layers = this.layers, this.add(a); - const l = new nn(Xs, js, e, t); + const l = new nn(js, Zs, e, t); l.layers = this.layers, this.add(l); - const c = new nn(Xs, js, e, t); + const c = new nn(js, Zs, e, t); c.layers = this.layers, this.add(c); } /** @@ -10483,7 +10483,7 @@ class Tx extends St { for (const c of t) this.remove(c); if (e === li) n.up.set(0, 1, 0), n.lookAt(1, 0, 0), i.up.set(0, 1, 0), i.lookAt(-1, 0, 0), r.up.set(0, 0, -1), r.lookAt(0, 1, 0), o.up.set(0, 0, 1), o.lookAt(0, -1, 0), a.up.set(0, 1, 0), a.lookAt(0, 0, 1), l.up.set(0, 1, 0), l.lookAt(0, 0, -1); - else if (e === gl) + else if (e === ml) n.up.set(0, -1, 0), n.lookAt(-1, 0, 0), i.up.set(0, -1, 0), i.lookAt(1, 0, 0), r.up.set(0, 0, 1), r.lookAt(0, 1, 0), o.up.set(0, 0, -1), o.lookAt(0, -1, 0), a.up.set(0, -1, 0), a.lookAt(0, 0, 1), l.up.set(0, -1, 0), l.lookAt(0, 0, -1); else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: " + e); @@ -10501,10 +10501,10 @@ class Tx extends St { this.parent === null && this.updateMatrixWorld(); const { renderTarget: n, activeMipmapLevel: i } = this; this.coordinateSystem !== e.coordinateSystem && (this.coordinateSystem = e.coordinateSystem, this.updateCoordinateSystem()); - const [r, o, a, l, c, h] = this.children, u = e.getRenderTarget(), d = e.getActiveCubeFace(), f = e.getActiveMipmapLevel(), p = e.xr.enabled; + const [r, o, a, l, c, h] = this.children, u = e.getRenderTarget(), d = e.getActiveCubeFace(), f = e.getActiveMipmapLevel(), g = e.xr.enabled; e.xr.enabled = !1; - const g = n.texture.generateMipmaps; - n.texture.generateMipmaps = !1, e.setRenderTarget(n, 0, i), e.render(t, r), e.setRenderTarget(n, 1, i), e.render(t, o), e.setRenderTarget(n, 2, i), e.render(t, a), e.setRenderTarget(n, 3, i), e.render(t, l), e.setRenderTarget(n, 4, i), e.render(t, c), n.texture.generateMipmaps = g, e.setRenderTarget(n, 5, i), e.render(t, h), e.setRenderTarget(u, d, f), e.xr.enabled = p, n.texture.needsPMREMUpdate = !0; + const p = n.texture.generateMipmaps; + n.texture.generateMipmaps = !1, e.setRenderTarget(n, 0, i), e.render(t, r), e.setRenderTarget(n, 1, i), e.render(t, o), e.setRenderTarget(n, 2, i), e.render(t, a), e.setRenderTarget(n, 3, i), e.render(t, l), e.setRenderTarget(n, 4, i), e.render(t, c), n.texture.generateMipmaps = p, e.setRenderTarget(n, 5, i), e.render(t, h), e.setRenderTarget(u, d, f), e.xr.enabled = g, n.texture.needsPMREMUpdate = !0; } } class Tm extends Ht { @@ -10522,7 +10522,7 @@ class Tm extends Ht { * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. * @param {string} [colorSpace=NoColorSpace] - The color space value. */ - constructor(e = [], t = br, n, i, r, o, a, l, c, h) { + constructor(e = [], t = yr, n, i, r, o, a, l, c, h) { super(e, t, n, i, r, o, a, l, c, h), this.isCubeTexture = !0, this.flipY = !1; } /** @@ -10605,9 +10605,9 @@ class Ax extends bn { } ` ) - }, i = new $i(5, 5, 5), r = new Ut({ + }, i = new $i(5, 5, 5), r = new Ot({ name: "CubemapFromEquirect", - uniforms: Sr(n.uniforms), + uniforms: Er(n.uniforms), vertexShader: n.vertexShader, fragmentShader: n.fragmentShader, side: un, @@ -10632,7 +10632,7 @@ class Ax extends bn { e.setRenderTarget(r); } } -class vn extends St { +class vn extends wt { constructor() { super(), this.isGroup = !0, this.type = "Group"; } @@ -10719,16 +10719,16 @@ class ac { if (e && t.session.visibilityState !== "visible-blurred") { if (c && e.hand) { o = !0; - for (const g of e.hand.values()) { - const x = t.getJointPose(g, n), m = this._getHandJoint(c, g); + for (const p of e.hand.values()) { + const x = t.getJointPose(p, n), m = this._getHandJoint(c, p); x !== null && (m.matrix.fromArray(x.transform.matrix), m.matrix.decompose(m.position, m.rotation, m.scale), m.matrixWorldNeedsUpdate = !0, m.jointRadius = x.radius), m.visible = x !== null; } - const h = c.joints["index-finger-tip"], u = c.joints["thumb-tip"], d = h.position.distanceTo(u.position), f = 0.02, p = 5e-3; - c.inputState.pinching && d > f + p ? (c.inputState.pinching = !1, this.dispatchEvent({ + const h = c.joints["index-finger-tip"], u = c.joints["thumb-tip"], d = h.position.distanceTo(u.position), f = 0.02, g = 5e-3; + c.inputState.pinching && d > f + g ? (c.inputState.pinching = !1, this.dispatchEvent({ type: "pinchend", handedness: e.handedness, target: this - })) : !c.inputState.pinching && d <= f - p && (c.inputState.pinching = !0, this.dispatchEvent({ + })) : !c.inputState.pinching && d <= f - g && (c.inputState.pinching = !0, this.dispatchEvent({ type: "pinchstart", handedness: e.handedness, target: this @@ -10755,7 +10755,7 @@ class ac { return e.joints[t.jointName]; } } -class Am extends St { +class Am extends wt { /** * Constructs a new scene. */ @@ -10770,7 +10770,7 @@ class Am extends St { return this.fog !== null && (t.object.fog = this.fog.toJSON()), this.backgroundBlurriness > 0 && (t.object.backgroundBlurriness = this.backgroundBlurriness), this.backgroundIntensity !== 1 && (t.object.backgroundIntensity = this.backgroundIntensity), t.object.backgroundRotation = this.backgroundRotation.toArray(), this.environmentIntensity !== 1 && (t.object.environmentIntensity = this.environmentIntensity), t.object.environmentRotation = this.environmentRotation.toArray(), t; } } -class Iu { +class Du { /** * Constructs a new interleaved buffer. * @@ -10778,7 +10778,7 @@ class Iu { * @param {number} stride - The number of typed-array elements per vertex. */ constructor(e, t) { - this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = qh, this.updateRanges = [], this.version = 0, this.uuid = On(); + this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = Zh, this.updateRanges = [], this.version = 0, this.uuid = kn(); } /** * A callback function that is executed after the renderer has transferred the attribute array @@ -10863,7 +10863,7 @@ class Iu { * @return {InterleavedBuffer} A clone of this instance. */ clone(e) { - e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = On()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer); + e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = kn()), 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]), n = new this.constructor(t, this.stride); return n.setUsage(this.usage), n; } @@ -10885,7 +10885,7 @@ class Iu { * @return {Object} A JSON object representing the serialized interleaved buffer. */ toJSON(e) { - return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = On()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), { + return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = kn()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), { uuid: this.uuid, buffer: this.array.buffer._uuid, type: this.array.constructor.name, @@ -10894,7 +10894,7 @@ class Iu { } } const an = /* @__PURE__ */ new P(); -class Er { +class Tr { /** * Constructs a new interleaved buffer attribute. * @@ -11118,7 +11118,7 @@ class Er { */ clone(e) { if (e === void 0) { - xl("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data."); + gl("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data."); const t = []; for (let n = 0; n < this.count; n++) { const i = n * this.data.stride + this.offset; @@ -11127,7 +11127,7 @@ class Er { } return new at(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 Er(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized); + return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)), new Tr(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized); } /** * Serializes the buffer attribute into JSON. @@ -11139,7 +11139,7 @@ class Er { */ toJSON(e) { if (e === void 0) { - xl("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data."); + gl("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data."); const t = []; for (let n = 0; n < this.count; n++) { const i = n * this.data.stride + this.offset; @@ -11173,15 +11173,15 @@ class Px extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isSpriteMaterial = !0, this.type = "SpriteMaterial", this.color = new Fe(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = !0, this.transparent = !0, this.fog = !0, this.setValues(e); + super(), this.isSpriteMaterial = !0, this.type = "SpriteMaterial", this.color = new Oe(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = !0, this.transparent = !0, this.fog = !0, 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.fog = e.fog, this; } } let qs; -const Wr = /* @__PURE__ */ new P(), Zs = /* @__PURE__ */ new P(), Ys = /* @__PURE__ */ new P(), Ks = /* @__PURE__ */ new ce(), Xr = /* @__PURE__ */ new ce(), Cm = /* @__PURE__ */ new ze(), oa = /* @__PURE__ */ new P(), jr = /* @__PURE__ */ new P(), aa = /* @__PURE__ */ new P(), Ud = /* @__PURE__ */ new ce(), lc = /* @__PURE__ */ new ce(), Od = /* @__PURE__ */ new ce(); -class Rx extends St { +const Xr = /* @__PURE__ */ new P(), Ys = /* @__PURE__ */ new P(), Ks = /* @__PURE__ */ new P(), $s = /* @__PURE__ */ new ce(), jr = /* @__PURE__ */ new ce(), Cm = /* @__PURE__ */ new ze(), oa = /* @__PURE__ */ new P(), Zr = /* @__PURE__ */ new P(), aa = /* @__PURE__ */ new P(), Ud = /* @__PURE__ */ new ce(), lc = /* @__PURE__ */ new ce(), Od = /* @__PURE__ */ new ce(); +class Rx extends wt { /** * Constructs a new sprite. * @@ -11211,8 +11211,8 @@ class Rx extends St { 0, 0, 1 - ]), n = new Iu(t, 5); - qs.setIndex([0, 1, 2, 0, 2, 3]), qs.setAttribute("position", new Er(n, 3, 0, !1)), qs.setAttribute("uv", new Er(n, 2, 3, !1)); + ]), n = new Du(t, 5); + qs.setIndex([0, 1, 2, 0, 2, 3]), qs.setAttribute("position", new Tr(n, 3, 0, !1)), qs.setAttribute("uv", new Tr(n, 2, 3, !1)); } this.geometry = qs, this.material = e, this.center = new ce(0.5, 0.5), this.count = 1; } @@ -11223,20 +11223,20 @@ class Rx extends St { * @param {Array} intersects - The target array that holds the intersection points. */ raycast(e, t) { - e.camera === null && et('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'), Zs.setFromMatrixScale(this.matrixWorld), Cm.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), Ys.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === !1 && Zs.multiplyScalar(-Ys.z); + e.camera === null && et('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'), Ys.setFromMatrixScale(this.matrixWorld), Cm.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), Ks.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === !1 && Ys.multiplyScalar(-Ks.z); const n = this.material.rotation; let i, r; n !== 0 && (r = Math.cos(n), i = Math.sin(n)); const o = this.center; - la(oa.set(-0.5, -0.5, 0), Ys, o, Zs, i, r), la(jr.set(0.5, -0.5, 0), Ys, o, Zs, i, r), la(aa.set(0.5, 0.5, 0), Ys, o, Zs, i, r), Ud.set(0, 0), lc.set(1, 0), Od.set(1, 1); - let a = e.ray.intersectTriangle(oa, jr, aa, !1, Wr); - if (a === null && (la(jr.set(-0.5, 0.5, 0), Ys, o, Zs, i, r), lc.set(0, 1), a = e.ray.intersectTriangle(oa, aa, jr, !1, Wr), a === null)) + la(oa.set(-0.5, -0.5, 0), Ks, o, Ys, i, r), la(Zr.set(0.5, -0.5, 0), Ks, o, Ys, i, r), la(aa.set(0.5, 0.5, 0), Ks, o, Ys, i, r), Ud.set(0, 0), lc.set(1, 0), Od.set(1, 1); + let a = e.ray.intersectTriangle(oa, Zr, aa, !1, Xr); + if (a === null && (la(Zr.set(-0.5, 0.5, 0), Ks, o, Ys, i, r), lc.set(0, 1), a = e.ray.intersectTriangle(oa, aa, Zr, !1, Xr), a === null)) return; - const l = e.ray.origin.distanceTo(Wr); + const l = e.ray.origin.distanceTo(Xr); l < e.near || l > e.far || t.push({ distance: l, - point: Wr.clone(), - uv: bt.getInterpolation(Wr, oa, jr, aa, Ud, lc, Od, new ce()), + point: Xr.clone(), + uv: bt.getInterpolation(Xr, oa, Zr, aa, Ud, lc, Od, new ce()), face: null, object: this }); @@ -11246,9 +11246,9 @@ class Rx extends St { } } function la(s, e, t, n, i, r) { - Ks.subVectors(s, t).addScalar(0.5).multiply(n), i !== void 0 ? (Xr.x = r * Ks.x - i * Ks.y, Xr.y = i * Ks.x + r * Ks.y) : Xr.copy(Ks), s.copy(e), s.x += Xr.x, s.y += Xr.y, s.applyMatrix4(Cm); + $s.subVectors(s, t).addScalar(0.5).multiply(n), i !== void 0 ? (jr.x = r * $s.x - i * $s.y, jr.y = i * $s.x + r * $s.y) : jr.copy($s), s.copy(e), s.x += jr.x, s.y += jr.y, s.applyMatrix4(Cm); } -const Fd = /* @__PURE__ */ new P(), zd = /* @__PURE__ */ new tt(), Hd = /* @__PURE__ */ new tt(), Lx = /* @__PURE__ */ new P(), Vd = /* @__PURE__ */ new ze(), ca = /* @__PURE__ */ new P(), cc = /* @__PURE__ */ new di(), Gd = /* @__PURE__ */ new ze(), hc = /* @__PURE__ */ new Qi(); +const kd = /* @__PURE__ */ new P(), Fd = /* @__PURE__ */ new tt(), zd = /* @__PURE__ */ new tt(), Lx = /* @__PURE__ */ new P(), Hd = /* @__PURE__ */ new ze(), ca = /* @__PURE__ */ new P(), cc = /* @__PURE__ */ new di(), Vd = /* @__PURE__ */ new ze(), hc = /* @__PURE__ */ new Qi(); class Dx extends dt { /** * Constructs a new skinned mesh. @@ -11257,7 +11257,7 @@ class Dx extends dt { * @param {Material|Array} [material] - The mesh material. */ constructor(e, t) { - super(e, t), this.isSkinnedMesh = !0, this.type = "SkinnedMesh", this.bindMode = fd, this.bindMatrix = new ze(), this.bindMatrixInverse = new ze(), this.boundingBox = null, this.boundingSphere = null; + super(e, t), this.isSkinnedMesh = !0, this.type = "SkinnedMesh", this.bindMode = dd, this.bindMatrix = new ze(), this.bindMatrixInverse = new ze(), this.boundingBox = null, this.boundingSphere = null; } /** * Computes the bounding box of the skinned mesh, and updates {@link SkinnedMesh#boundingBox}. @@ -11290,7 +11290,7 @@ class Dx extends dt { } raycast(e, t) { const n = this.material, i = this.matrixWorld; - n !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), cc.copy(this.boundingSphere), cc.applyMatrix4(i), e.ray.intersectsSphere(cc) !== !1 && (Gd.copy(i).invert(), hc.copy(e.ray).applyMatrix4(Gd), !(this.boundingBox !== null && hc.intersectsBox(this.boundingBox) === !1) && this._computeIntersections(e, t, hc))); + n !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), cc.copy(this.boundingSphere), cc.applyMatrix4(i), e.ray.intersectsSphere(cc) !== !1 && (Vd.copy(i).invert(), hc.copy(e.ray).applyMatrix4(Vd), !(this.boundingBox !== null && hc.intersectsBox(this.boundingBox) === !1) && this._computeIntersections(e, t, hc))); } getVertexPosition(e, t) { return super.getVertexPosition(e, t), this.applyBoneTransform(e, t), t; @@ -11324,7 +11324,7 @@ class Dx extends dt { } } updateMatrixWorld(e) { - super.updateMatrixWorld(e), this.bindMode === fd ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === Pg ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : He("SkinnedMesh: Unrecognized bindMode: " + this.bindMode); + super.updateMatrixWorld(e), this.bindMode === dd ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === Pg ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : He("SkinnedMesh: Unrecognized bindMode: " + this.bindMode); } /** * Applies the bone transform associated with the given index to the given @@ -11337,18 +11337,18 @@ class Dx extends dt { */ applyBoneTransform(e, t) { const n = this.skeleton, i = this.geometry; - zd.fromBufferAttribute(i.attributes.skinIndex, e), Hd.fromBufferAttribute(i.attributes.skinWeight, e), Fd.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0); + Fd.fromBufferAttribute(i.attributes.skinIndex, e), zd.fromBufferAttribute(i.attributes.skinWeight, e), kd.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0); for (let r = 0; r < 4; r++) { - const o = Hd.getComponent(r); + const o = zd.getComponent(r); if (o !== 0) { - const a = zd.getComponent(r); - Vd.multiplyMatrices(n.bones[a].matrixWorld, n.boneInverses[a]), t.addScaledVector(Lx.copy(Fd).applyMatrix4(Vd), o); + const a = Fd.getComponent(r); + Hd.multiplyMatrices(n.bones[a].matrixWorld, n.boneInverses[a]), t.addScaledVector(Lx.copy(kd).applyMatrix4(Hd), o); } } return t.applyMatrix4(this.bindMatrixInverse); } } -class Pm extends St { +class Pm extends wt { /** * Constructs a new bone. */ @@ -11356,7 +11356,7 @@ class Pm extends St { super(), this.isBone = !0, this.type = "Bone"; } } -class Bo extends Ht { +class No extends Ht { /** * Constructs a new data texture. * @@ -11377,8 +11377,8 @@ class Bo extends Ht { super(null, o, a, l, c, h, i, r, u, d), this.isDataTexture = !0, this.image = { data: e, width: t, height: n }, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1; } } -const Wd = /* @__PURE__ */ new ze(), Ix = /* @__PURE__ */ new ze(); -class Bu { +const Gd = /* @__PURE__ */ new ze(), Ix = /* @__PURE__ */ new ze(); +class Iu { /** * Constructs a new skeleton. * @@ -11387,7 +11387,7 @@ class Bu { * If not provided, these matrices will be computed automatically via {@link Skeleton#calculateInverses}. */ constructor(e = [], t = []) { - this.uuid = On(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.init(); + this.uuid = kn(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.init(); } /** * Initializes the skeleton. This method gets automatically called by the constructor @@ -11435,7 +11435,7 @@ class Bu { const e = this.bones, t = this.boneInverses, n = this.boneMatrices, i = this.boneTexture; for (let r = 0, o = e.length; r < o; r++) { const a = e[r] ? e[r].matrixWorld : Ix; - Wd.multiplyMatrices(a, t[r]), Wd.toArray(n, r * 16); + Gd.multiplyMatrices(a, t[r]), Gd.toArray(n, r * 16); } i !== null && (i.needsUpdate = !0); } @@ -11445,7 +11445,7 @@ class Bu { * @return {Skeleton} A clone of this instance. */ clone() { - return new Bu(this.bones, this.boneInverses); + return new Iu(this.bones, this.boneInverses); } /** * Computes a data texture for passing bone data to the vertex shader. @@ -11457,7 +11457,7 @@ class Bu { e = Math.ceil(e / 4) * 4, e = Math.max(e, 4); const t = new Float32Array(e * e * 4); t.set(this.boneMatrices); - const n = new Bo(t, e, e, xn, $n); + const n = new No(t, e, e, xn, $n); return n.needsUpdate = !0, this.boneMatrices = t, this.boneTexture = n, this; } /** @@ -11524,7 +11524,7 @@ class Bu { return e; } } -class Zh extends at { +class xl extends at { /** * Constructs a new instanced buffer attribute. * @@ -11544,8 +11544,8 @@ class Zh extends at { return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = !0, e; } } -const $s = /* @__PURE__ */ new ze(), Xd = /* @__PURE__ */ new ze(), ha = [], jd = /* @__PURE__ */ new vt(), Bx = /* @__PURE__ */ new ze(), qr = /* @__PURE__ */ new dt(), Zr = /* @__PURE__ */ new di(); -class No extends dt { +const Js = /* @__PURE__ */ new ze(), Wd = /* @__PURE__ */ new ze(), ha = [], Xd = /* @__PURE__ */ new vt(), Bx = /* @__PURE__ */ new ze(), qr = /* @__PURE__ */ new dt(), Yr = /* @__PURE__ */ new di(); +class ws extends dt { /** * Constructs a new instanced mesh. * @@ -11554,7 +11554,7 @@ class No extends dt { * @param {number} count - The number of instances. */ constructor(e, t, n) { - super(e, t), this.isInstancedMesh = !0, this.instanceMatrix = new Zh(new Float32Array(n * 16), 16), this.instanceColor = null, this.morphTexture = null, this.count = n, this.boundingBox = null, this.boundingSphere = null; + super(e, t), this.isInstancedMesh = !0, this.instanceMatrix = new xl(new Float32Array(n * 16), 16), this.instanceColor = null, this.morphTexture = null, this.count = n, this.boundingBox = null, this.boundingSphere = null; for (let i = 0; i < n; i++) this.setMatrixAt(i, Bx); } @@ -11567,7 +11567,7 @@ class No extends dt { const e = this.geometry, t = this.count; this.boundingBox === null && (this.boundingBox = new vt()), e.boundingBox === null && e.computeBoundingBox(), this.boundingBox.makeEmpty(); for (let n = 0; n < t; n++) - this.getMatrixAt(n, $s), jd.copy(e.boundingBox).applyMatrix4($s), this.boundingBox.union(jd); + this.getMatrixAt(n, Js), Xd.copy(e.boundingBox).applyMatrix4(Js), this.boundingBox.union(Xd); } /** * Computes the bounding sphere of the instanced mesh, and updates {@link InstancedMesh#boundingSphere} @@ -11578,7 +11578,7 @@ class No extends dt { const e = this.geometry, t = this.count; this.boundingSphere === null && (this.boundingSphere = new di()), e.boundingSphere === null && e.computeBoundingSphere(), this.boundingSphere.makeEmpty(); for (let n = 0; n < t; n++) - this.getMatrixAt(n, $s), Zr.copy(e.boundingSphere).applyMatrix4($s), this.boundingSphere.union(Zr); + this.getMatrixAt(n, Js), Yr.copy(e.boundingSphere).applyMatrix4(Js), this.boundingSphere.union(Yr); } copy(e, t) { return super.copy(e, t), this.instanceMatrix.copy(e.instanceMatrix), e.morphTexture !== null && (this.morphTexture = e.morphTexture.clone()), e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()), this.count = e.count, e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this; @@ -11614,9 +11614,9 @@ class No extends dt { } raycast(e, t) { const n = this.matrixWorld, i = this.count; - if (qr.geometry = this.geometry, qr.material = this.material, qr.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), Zr.copy(this.boundingSphere), Zr.applyMatrix4(n), e.ray.intersectsSphere(Zr) !== !1)) + if (qr.geometry = this.geometry, qr.material = this.material, qr.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), Yr.copy(this.boundingSphere), Yr.applyMatrix4(n), e.ray.intersectsSphere(Yr) !== !1)) for (let r = 0; r < i; r++) { - this.getMatrixAt(r, $s), Xd.multiplyMatrices(n, $s), qr.matrixWorld = Xd, qr.raycast(e, ha); + this.getMatrixAt(r, Js), Wd.multiplyMatrices(n, Js), qr.matrixWorld = Wd, qr.raycast(e, ha); for (let o = 0, a = ha.length; o < a; o++) { const l = ha[o]; l.instanceId = r, l.object = this, t.push(l); @@ -11632,7 +11632,7 @@ class No extends dt { * @param {Color} color - The instance color. */ setColorAt(e, t) { - this.instanceColor === null && (this.instanceColor = new Zh(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3)), t.toArray(this.instanceColor.array, e * 3); + this.instanceColor === null && (this.instanceColor = new xl(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3)), t.toArray(this.instanceColor.array, e * 3); } /** * Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of @@ -11654,7 +11654,7 @@ class No extends dt { */ setMorphAt(e, t) { const n = t.morphTargetInfluences, i = n.length + 1; - this.morphTexture === null && (this.morphTexture = new Bo(new Float32Array(i * this.count), i, this.count, Eu, $n)); + this.morphTexture === null && (this.morphTexture = new No(new Float32Array(i * this.count), i, this.count, Su, $n)); const r = this.morphTexture.source.data.data; let o = 0; for (let c = 0; c < n.length; c++) @@ -11672,7 +11672,7 @@ class No extends dt { this.dispatchEvent({ type: "dispose" }), this.morphTexture !== null && (this.morphTexture.dispose(), this.morphTexture = null); } } -const uc = /* @__PURE__ */ new P(), Nx = /* @__PURE__ */ new P(), kx = /* @__PURE__ */ new $e(); +const uc = /* @__PURE__ */ new P(), Nx = /* @__PURE__ */ new P(), Ux = /* @__PURE__ */ new $e(); class _t { /** * Constructs a new plane. @@ -11852,7 +11852,7 @@ class _t { * @return {Plane} A reference to this plane. */ applyMatrix4(e, t) { - const n = t || kx.getNormalMatrix(e), i = this.coplanarPoint(uc).applyMatrix4(e), r = this.normal.applyMatrix3(n).normalize(); + const n = t || Ux.getNormalMatrix(e), i = this.coplanarPoint(uc).applyMatrix4(e), r = this.normal.applyMatrix3(n).normalize(); return this.constant = -i.dot(r), this; } /** @@ -11883,8 +11883,8 @@ class _t { return new this.constructor().copy(this); } } -const os = /* @__PURE__ */ new di(), Ux = /* @__PURE__ */ new ce(0.5, 0.5), ua = /* @__PURE__ */ new P(); -class Nu { +const os = /* @__PURE__ */ new di(), Ox = /* @__PURE__ */ new ce(0.5, 0.5), ua = /* @__PURE__ */ new P(); +class Bu { /** * Constructs a new frustum. * @@ -11934,12 +11934,12 @@ class Nu { * @return {Frustum} A reference to this frustum. */ setFromProjectionMatrix(e, t = li, n = !1) { - const i = this.planes, r = e.elements, o = r[0], a = r[1], l = r[2], c = r[3], h = r[4], u = r[5], d = r[6], f = r[7], p = r[8], g = r[9], x = r[10], m = r[11], b = r[12], v = r[13], y = r[14], M = r[15]; - if (i[0].setComponents(c - o, f - h, m - p, M - b).normalize(), i[1].setComponents(c + o, f + h, m + p, M + b).normalize(), i[2].setComponents(c + a, f + u, m + g, M + v).normalize(), i[3].setComponents(c - a, f - u, m - g, M - v).normalize(), n) + const i = this.planes, r = e.elements, o = r[0], a = r[1], l = r[2], c = r[3], h = r[4], u = r[5], d = r[6], f = r[7], g = r[8], p = r[9], x = r[10], m = r[11], b = r[12], v = r[13], y = r[14], M = r[15]; + if (i[0].setComponents(c - o, f - h, m - g, M - b).normalize(), i[1].setComponents(c + o, f + h, m + g, M + b).normalize(), i[2].setComponents(c + a, f + u, m + p, M + v).normalize(), i[3].setComponents(c - a, f - u, m - p, M - v).normalize(), n) i[4].setComponents(l, d, x, y).normalize(), i[5].setComponents(c - l, f - d, m - x, M - y).normalize(); else if (i[4].setComponents(c - l, f - d, m - x, M - y).normalize(), t === li) i[5].setComponents(c + l, f + d, m + x, M + y).normalize(); - else if (t === gl) + else if (t === ml) i[5].setComponents(l, d, x, y).normalize(); else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + t); @@ -11970,7 +11970,7 @@ class Nu { */ intersectsSprite(e) { os.center.set(0, 0, 0); - const t = Ux.distanceTo(e.center); + const t = Ox.distanceTo(e.center); return os.radius = 0.7071067811865476 + t, os.applyMatrix4(e.matrixWorld), this.intersectsSphere(os); } /** @@ -12023,7 +12023,7 @@ class Nu { return new this.constructor().copy(this); } } -class Cs extends yn { +class Ps extends yn { /** * Constructs a new line basic material. * @@ -12034,21 +12034,21 @@ class Cs extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isLineBasicMaterial = !0, this.type = "LineBasicMaterial", this.color = new Fe(16777215), this.map = null, this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.fog = !0, this.setValues(e); + super(), this.isLineBasicMaterial = !0, this.type = "LineBasicMaterial", this.color = new Oe(16777215), this.map = null, this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.fog = !0, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.fog = e.fog, this; } } -const vl = /* @__PURE__ */ new P(), bl = /* @__PURE__ */ new P(), qd = /* @__PURE__ */ new ze(), Yr = /* @__PURE__ */ new Qi(), da = /* @__PURE__ */ new di(), dc = /* @__PURE__ */ new P(), Zd = /* @__PURE__ */ new P(); -class es extends St { +const vl = /* @__PURE__ */ new P(), bl = /* @__PURE__ */ new P(), jd = /* @__PURE__ */ new ze(), Kr = /* @__PURE__ */ new Qi(), da = /* @__PURE__ */ new di(), dc = /* @__PURE__ */ new P(), Zd = /* @__PURE__ */ new P(); +class es extends wt { /** * Constructs a new line. * * @param {BufferGeometry} [geometry] - The line geometry. * @param {Material|Array} [material] - The line material. */ - constructor(e = new ut(), t = new Cs()) { + constructor(e = new ut(), t = new Ps()) { super(), this.isLine = !0, this.type = "Line", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets(); } copy(e, t) { @@ -12081,27 +12081,27 @@ class es extends St { raycast(e, t) { const n = this.geometry, i = this.matrixWorld, r = e.params.Line.threshold, o = n.drawRange; if (n.boundingSphere === null && n.computeBoundingSphere(), da.copy(n.boundingSphere), da.applyMatrix4(i), da.radius += r, e.ray.intersectsSphere(da) === !1) return; - qd.copy(i).invert(), Yr.copy(e.ray).applyMatrix4(qd); + jd.copy(i).invert(), Kr.copy(e.ray).applyMatrix4(jd); const a = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = a * a, c = this.isLineSegments ? 2 : 1, h = n.index, d = n.attributes.position; if (h !== null) { - const f = Math.max(0, o.start), p = Math.min(h.count, o.start + o.count); - for (let g = f, x = p - 1; g < x; g += c) { - const m = h.getX(g), b = h.getX(g + 1), v = fa(this, e, Yr, l, m, b, g); + const f = Math.max(0, o.start), g = Math.min(h.count, o.start + o.count); + for (let p = f, x = g - 1; p < x; p += c) { + const m = h.getX(p), b = h.getX(p + 1), v = fa(this, e, Kr, l, m, b, p); v && t.push(v); } if (this.isLineLoop) { - const g = h.getX(p - 1), x = h.getX(f), m = fa(this, e, Yr, l, g, x, p - 1); + const p = h.getX(g - 1), x = h.getX(f), m = fa(this, e, Kr, l, p, x, g - 1); m && t.push(m); } } else { - const f = Math.max(0, o.start), p = Math.min(d.count, o.start + o.count); - for (let g = f, x = p - 1; g < x; g += c) { - const m = fa(this, e, Yr, l, g, g + 1, g); + const f = Math.max(0, o.start), g = Math.min(d.count, o.start + o.count); + for (let p = f, x = g - 1; p < x; p += c) { + const m = fa(this, e, Kr, l, p, p + 1, p); m && t.push(m); } if (this.isLineLoop) { - const g = fa(this, e, Yr, l, p - 1, f, p - 1); - g && t.push(g); + const p = fa(this, e, Kr, l, g - 1, f, g - 1); + p && t.push(p); } } } @@ -12141,7 +12141,7 @@ function fa(s, e, t, n, i, r, o) { object: s }; } -const Yd = /* @__PURE__ */ new P(), Kd = /* @__PURE__ */ new P(); +const qd = /* @__PURE__ */ new P(), Yd = /* @__PURE__ */ new P(); class Rm extends es { /** * Constructs a new line segments. @@ -12157,14 +12157,14 @@ class Rm extends es { if (e.index === null) { const t = e.attributes.position, n = []; for (let i = 0, r = t.count; i < r; i += 2) - Yd.fromBufferAttribute(t, i), Kd.fromBufferAttribute(t, i + 1), n[i] = i === 0 ? 0 : n[i - 1], n[i + 1] = n[i] + Yd.distanceTo(Kd); + qd.fromBufferAttribute(t, i), Yd.fromBufferAttribute(t, i + 1), n[i] = i === 0 ? 0 : n[i - 1], n[i + 1] = n[i] + qd.distanceTo(Yd); e.setAttribute("lineDistance", new rn(n, 1)); } else He("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } } -class Ox extends es { +class kx extends es { /** * Constructs a new line loop. * @@ -12186,14 +12186,14 @@ class Lm extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isPointsMaterial = !0, this.type = "PointsMaterial", this.color = new Fe(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = !0, this.fog = !0, this.setValues(e); + super(), this.isPointsMaterial = !0, this.type = "PointsMaterial", this.color = new Oe(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = !0, this.fog = !0, 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.fog = e.fog, this; } } -const $d = /* @__PURE__ */ new ze(), Yh = /* @__PURE__ */ new Qi(), pa = /* @__PURE__ */ new di(), ma = /* @__PURE__ */ new P(); -class Dm extends St { +const Kd = /* @__PURE__ */ new ze(), qh = /* @__PURE__ */ new Qi(), pa = /* @__PURE__ */ new di(), ma = /* @__PURE__ */ new P(); +class Dm extends wt { /** * Constructs a new point cloud. * @@ -12215,18 +12215,18 @@ class Dm extends St { raycast(e, t) { const n = this.geometry, i = this.matrixWorld, r = e.params.Points.threshold, o = n.drawRange; if (n.boundingSphere === null && n.computeBoundingSphere(), pa.copy(n.boundingSphere), pa.applyMatrix4(i), pa.radius += r, e.ray.intersectsSphere(pa) === !1) return; - $d.copy(i).invert(), Yh.copy(e.ray).applyMatrix4($d); + Kd.copy(i).invert(), qh.copy(e.ray).applyMatrix4(Kd); const a = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), l = a * a, c = n.index, u = n.attributes.position; if (c !== null) { const d = Math.max(0, o.start), f = Math.min(c.count, o.start + o.count); - for (let p = d, g = f; p < g; p++) { - const x = c.getX(p); - ma.fromBufferAttribute(u, x), Jd(ma, x, l, i, e, t, this); + for (let g = d, p = f; g < p; g++) { + const x = c.getX(g); + ma.fromBufferAttribute(u, x), $d(ma, x, l, i, e, t, this); } } else { const d = Math.max(0, o.start), f = Math.min(u.count, o.start + o.count); - for (let p = d, g = f; p < g; p++) - ma.fromBufferAttribute(u, p), Jd(ma, p, l, i, e, t, this); + for (let g = d, p = f; g < p; g++) + ma.fromBufferAttribute(u, g), $d(ma, g, l, i, e, t, this); } } /** @@ -12247,11 +12247,11 @@ class Dm extends St { } } } -function Jd(s, e, t, n, i, r, o) { - const a = Yh.distanceSqToPoint(s); +function $d(s, e, t, n, i, r, o) { + const a = qh.distanceSqToPoint(s); if (a < t) { const l = new P(); - Yh.closestPointToPoint(s, l), l.applyMatrix4(n); + qh.closestPointToPoint(s, l), l.applyMatrix4(n); const c = i.ray.origin.distanceTo(l); if (c < i.near || c > i.far) return; r.push({ @@ -12266,7 +12266,7 @@ function Jd(s, e, t, n, i, r, o) { }); } } -class ku extends Ht { +class Nu extends Ht { /** * Constructs a new depth texture. * @@ -12282,14 +12282,14 @@ class ku extends Ht { * @param {number} [format=DepthFormat] - The texture format. * @param {number} [depth=1] - The depth of the texture. */ - constructor(e, t, n = Ms, i, r, o, a = Qt, l = Qt, c, h = So, u = 1) { - if (h !== So && h !== Mr) + constructor(e, t, n = Ms, i, r, o, a = Qt, l = Qt, c, h = Eo, u = 1) { + if (h !== Eo && h !== wr) throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); const d = { width: e, height: t, depth: u }; super(d, i, r, o, a, l, h, n, c), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null; } copy(e) { - return super.copy(e), this.source = new Lu(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this; + return super.copy(e), this.source = new Ru(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this; } toJSON(e) { const t = super.toJSON(e); @@ -12473,8 +12473,8 @@ class fi { computeFrenetFrames(e, t = !1) { const n = new P(), i = [], r = [], o = [], a = new P(), l = new ze(); for (let f = 0; f <= e; f++) { - const p = f / e; - i[f] = this.getTangentAt(p, new P()); + const g = f / e; + i[f] = this.getTangentAt(g, new P()); } r[0] = new P(), o[0] = new P(); let c = Number.MAX_VALUE; @@ -12483,16 +12483,16 @@ class fi { for (let f = 1; f <= e; f++) { if (r[f] = r[f - 1].clone(), o[f] = o[f - 1].clone(), a.crossVectors(i[f - 1], i[f]), a.length() > Number.EPSILON) { a.normalize(); - const p = Math.acos(Ze(i[f - 1].dot(i[f]), -1, 1)); - r[f].applyMatrix4(l.makeRotationAxis(a, p)); + const g = Math.acos(qe(i[f - 1].dot(i[f]), -1, 1)); + r[f].applyMatrix4(l.makeRotationAxis(a, g)); } o[f].crossVectors(i[f], r[f]); } if (t === !0) { - let f = Math.acos(Ze(r[0].dot(r[e]), -1, 1)); + let f = Math.acos(qe(r[0].dot(r[e]), -1, 1)); f /= e, i[0].dot(a.crossVectors(r[0], r[e])) > 0 && (f = -f); - for (let p = 1; p <= e; p++) - r[p].applyMatrix4(l.makeRotationAxis(i[p], f * p)), o[p].crossVectors(i[p], r[p]); + for (let g = 1; g <= e; g++) + r[g].applyMatrix4(l.makeRotationAxis(i[g], f * g)), o[g].crossVectors(i[g], r[g]); } return { tangents: i, @@ -12655,8 +12655,8 @@ class zx extends fi { const u = i[a % r], d = i[(a + 1) % r]; if (this.closed || a + 2 < r ? h = i[(a + 2) % r] : (ga.subVectors(i[r - 1], i[r - 2]).add(i[r - 1]), h = ga), this.curveType === "centripetal" || this.curveType === "chordal") { const f = this.curveType === "chordal" ? 0.5 : 0.25; - let p = Math.pow(c.distanceToSquared(u), f), g = Math.pow(u.distanceToSquared(d), f), x = Math.pow(d.distanceToSquared(h), f); - g < 1e-4 && (g = 1), p < 1e-4 && (p = g), x < 1e-4 && (x = g), fc.initNonuniformCatmullRom(c.x, u.x, d.x, h.x, p, g, x), pc.initNonuniformCatmullRom(c.y, u.y, d.y, h.y, p, g, x), mc.initNonuniformCatmullRom(c.z, u.z, d.z, h.z, p, g, x); + let g = Math.pow(c.distanceToSquared(u), f), p = Math.pow(u.distanceToSquared(d), f), x = Math.pow(d.distanceToSquared(h), f); + p < 1e-4 && (p = 1), g < 1e-4 && (g = p), x < 1e-4 && (x = p), fc.initNonuniformCatmullRom(c.x, u.x, d.x, h.x, g, p, x), pc.initNonuniformCatmullRom(c.y, u.y, d.y, h.y, g, p, x), mc.initNonuniformCatmullRom(c.z, u.z, d.z, h.z, g, p, x); } else this.curveType === "catmullrom" && (fc.initCatmullRom(c.x, u.x, d.x, h.x, this.tension), pc.initCatmullRom(c.y, u.y, d.y, h.y, this.tension), mc.initCatmullRom(c.z, u.z, d.z, h.z, this.tension)); return n.set( fc.calc(l), @@ -12690,7 +12690,7 @@ class zx extends fi { return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } } -function Qd(s, e, t, n, i) { +function Jd(s, e, t, n, i) { const r = (n - e) * 0.5, o = (i - t) * 0.5, a = s * s, l = s * a; return (2 * t - 2 * n + r + o) * l + (-3 * t + 3 * n - 2 * r - o) * a + r * s + t; } @@ -12704,7 +12704,7 @@ function Vx(s, e) { function Gx(s, e) { return s * s * e; } -function xo(s, e, t, n) { +function vo(s, e, t, n) { return Hx(s, e) + Vx(s, t) + Gx(s, n); } function Wx(s, e) { @@ -12718,11 +12718,11 @@ function Xx(s, e) { function jx(s, e) { return 3 * (1 - s) * s * s * e; } -function qx(s, e) { +function Zx(s, e) { return s * s * s * e; } -function vo(s, e, t, n, i) { - return Wx(s, e) + Xx(s, t) + jx(s, n) + qx(s, i); +function bo(s, e, t, n, i) { + return Wx(s, e) + Xx(s, t) + jx(s, n) + Zx(s, i); } class Bm extends fi { /** @@ -12746,8 +12746,8 @@ class Bm extends fi { getPoint(e, t = new ce()) { const n = t, i = this.v0, r = this.v1, o = this.v2, a = this.v3; return n.set( - vo(e, i.x, r.x, o.x, a.x), - vo(e, i.y, r.y, o.y, a.y) + bo(e, i.x, r.x, o.x, a.x), + bo(e, i.y, r.y, o.y, a.y) ), n; } copy(e) { @@ -12761,7 +12761,7 @@ class Bm extends fi { 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; } } -class Zx extends fi { +class qx extends fi { /** * Constructs a new Cubic Bezier curve. * @@ -12783,9 +12783,9 @@ class Zx extends fi { getPoint(e, t = new P()) { const n = t, i = this.v0, r = this.v1, o = this.v2, a = this.v3; return n.set( - vo(e, i.x, r.x, o.x, a.x), - vo(e, i.y, r.y, o.y, a.y), - vo(e, i.z, r.z, o.z, a.z) + bo(e, i.x, r.x, o.x, a.x), + bo(e, i.y, r.y, o.y, a.y), + bo(e, i.z, r.z, o.z, a.z) ), n; } copy(e) { @@ -12883,7 +12883,7 @@ class Yx extends fi { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } -class km extends fi { +class Um extends fi { /** * Constructs a new Quadratic Bezier curve. * @@ -12904,8 +12904,8 @@ class km extends fi { getPoint(e, t = new ce()) { const n = t, i = this.v0, r = this.v1, o = this.v2; return n.set( - xo(e, i.x, r.x, o.x), - xo(e, i.y, r.y, o.y) + vo(e, i.x, r.x, o.x), + vo(e, i.y, r.y, o.y) ), n; } copy(e) { @@ -12940,9 +12940,9 @@ class Kx extends fi { getPoint(e, t = new P()) { const n = t, i = this.v0, r = this.v1, o = this.v2; return n.set( - xo(e, i.x, r.x, o.x), - xo(e, i.y, r.y, o.y), - xo(e, i.z, r.z, o.z) + vo(e, i.x, r.x, o.x), + vo(e, i.y, r.y, o.y), + vo(e, i.z, r.z, o.z) ), n; } copy(e) { @@ -12956,7 +12956,7 @@ class Kx extends fi { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } -class Um extends fi { +class Om extends fi { /** * Constructs a new 2D spline curve. * @@ -12975,8 +12975,8 @@ class Um extends fi { getPoint(e, t = new ce()) { const n = t, i = this.points, r = (i.length - 1) * e, o = Math.floor(r), a = r - o, l = i[o === 0 ? o : o - 1], c = i[o], h = i[o > i.length - 2 ? i.length - 1 : o + 1], u = i[o > i.length - 3 ? i.length - 1 : o + 2]; return n.set( - Qd(a, l.x, c.x, h.x, u.x), - Qd(a, l.y, c.y, h.y, u.y) + Jd(a, l.x, c.x, h.x, u.x), + Jd(a, l.y, c.y, h.y, u.y) ), n; } copy(e) { @@ -13005,18 +13005,18 @@ class Um extends fi { return this; } } -var Kh = /* @__PURE__ */ Object.freeze({ +var Yh = /* @__PURE__ */ Object.freeze({ __proto__: null, ArcCurve: Fx, CatmullRomCurve3: zx, CubicBezierCurve: Bm, - CubicBezierCurve3: Zx, + CubicBezierCurve3: qx, EllipseCurve: Uu, LineCurve: Nm, LineCurve3: Yx, - QuadraticBezierCurve: km, + QuadraticBezierCurve: Um, QuadraticBezierCurve3: Kx, - SplineCurve: Um + SplineCurve: Om }); class $x extends fi { /** @@ -13042,7 +13042,7 @@ class $x extends fi { const e = this.curves[0].getPoint(0), t = this.curves[this.curves.length - 1].getPoint(1); if (!e.equals(t)) { const n = e.isVector2 === !0 ? "LineCurve" : "LineCurve3"; - this.curves.push(new Kh[n](t, e)); + this.curves.push(new Yh[n](t, e)); } return this; } @@ -13126,12 +13126,12 @@ class $x extends fi { super.fromJSON(e), this.autoClose = e.autoClose, this.curves = []; for (let t = 0, n = e.curves.length; t < n; t++) { const i = e.curves[t]; - this.curves.push(new Kh[i.type]().fromJSON(i)); + this.curves.push(new Yh[i.type]().fromJSON(i)); } return this; } } -class ef extends $x { +class Qd extends $x { /** * Constructs a new path. * @@ -13186,7 +13186,7 @@ class ef extends $x { * @return {Path} A reference to this path. */ quadraticCurveTo(e, t, n, i) { - const r = new km( + const r = new Um( this.currentPoint.clone(), new ce(e, t), new ce(n, i) @@ -13222,7 +13222,7 @@ class ef extends $x { * @return {Path} A reference to this path. */ splineThru(e) { - const t = [this.currentPoint.clone()].concat(e), n = new Um(t); + const t = [this.currentPoint.clone()].concat(e), n = new Om(t); return this.curves.push(n), this.currentPoint.copy(e[e.length - 1]), this; } /** @@ -13314,14 +13314,14 @@ class ef extends $x { return super.fromJSON(e), this.currentPoint.fromArray(e.currentPoint), this; } } -class Om extends ef { +class km extends Qd { /** * Constructs a new shape. * * @param {Array} [points] - An array of 2D points defining the shape. */ constructor(e) { - super(e), this.uuid = On(), this.type = "Shape", this.holes = []; + super(e), this.uuid = kn(), this.type = "Shape", this.holes = []; } /** * Returns an array representing each contour of the holes @@ -13371,7 +13371,7 @@ class Om extends ef { super.fromJSON(e), this.uuid = e.uuid, this.holes = []; for (let t = 0, n = e.holes.length; t < n; t++) { const i = e.holes[t]; - this.holes.push(new ef().fromJSON(i)); + this.holes.push(new Qd().fromJSON(i)); } return this; } @@ -13386,46 +13386,46 @@ function Jx(s, e, t = 2) { a = s[0], l = s[1]; let h = a, u = l; for (let d = t; d < i; d += t) { - const f = s[d], p = s[d + 1]; - f < a && (a = f), p < l && (l = p), f > h && (h = f), p > u && (u = p); + const f = s[d], g = s[d + 1]; + f < a && (a = f), g < l && (l = g), f > h && (h = f), g > u && (u = g); } c = Math.max(h - a, u - l), c = c !== 0 ? 32767 / c : 0; } - return Po(r, o, t, a, l, c, 0), o; + return Ro(r, o, t, a, l, c, 0), o; } function Fm(s, e, t, n, i) { let r; if (i === pv(s, e, t, n) > 0) - for (let o = e; o < t; o += n) r = tf(o / n | 0, s[o], s[o + 1], r); + for (let o = e; o < t; o += n) r = ef(o / n | 0, s[o], s[o + 1], r); else - for (let o = t - n; o >= e; o -= n) r = tf(o / n | 0, s[o], s[o + 1], r); - return r && Tr(r, r.next) && (Lo(r), r = r.next), r; + for (let o = t - n; o >= e; o -= n) r = ef(o / n | 0, s[o], s[o + 1], r); + return r && Ar(r, r.next) && (Do(r), r = r.next), r; } -function ws(s, e) { +function Ss(s, e) { if (!s) return s; e || (e = s); let t = s, n; do - if (n = !1, !t.steiner && (Tr(t, t.next) || Ct(t.prev, t, t.next) === 0)) { - if (Lo(t), t = e = t.prev, t === t.next) break; + if (n = !1, !t.steiner && (Ar(t, t.next) || Ct(t.prev, t, t.next) === 0)) { + if (Do(t), t = e = t.prev, t === t.next) break; n = !0; } else t = t.next; while (n || t !== e); return e; } -function Po(s, e, t, n, i, r, o) { +function Ro(s, e, t, n, i, r, o) { if (!s) return; !o && r && lv(s, n, i, r); let a = s; for (; s.prev !== s.next; ) { const l = s.prev, c = s.next; if (r ? ev(s, n, i, r) : Qx(s)) { - e.push(l.i, s.i, c.i), Lo(s), s = c.next, a = c.next; + e.push(l.i, s.i, c.i), Do(s), s = c.next, a = c.next; continue; } if (s = c, s === a) { - o ? o === 1 ? (s = tv(ws(s), e), Po(s, e, t, n, i, r, 2)) : o === 2 && nv(s, e, t, n, i, r) : Po(ws(s), e, t, n, i, r, 1); + o ? o === 1 ? (s = tv(Ss(s), e), Ro(s, e, t, n, i, r, 2)) : o === 2 && nv(s, e, t, n, i, r) : Ro(Ss(s), e, t, n, i, r, 1); break; } } @@ -13434,28 +13434,28 @@ function Qx(s) { const e = s.prev, t = s, n = s.next; if (Ct(e, t, n) >= 0) return !1; const i = e.x, r = t.x, o = n.x, a = e.y, l = t.y, c = n.y, h = Math.min(i, r, o), u = Math.min(a, l, c), d = Math.max(i, r, o), f = Math.max(a, l, c); - let p = n.next; - for (; p !== e; ) { - if (p.x >= h && p.x <= d && p.y >= u && p.y <= f && ho(i, a, r, l, o, c, p.x, p.y) && Ct(p.prev, p, p.next) >= 0) return !1; - p = p.next; + let g = n.next; + for (; g !== e; ) { + if (g.x >= h && g.x <= d && g.y >= u && g.y <= f && uo(i, a, r, l, o, c, g.x, g.y) && Ct(g.prev, g, g.next) >= 0) return !1; + g = g.next; } return !0; } function ev(s, e, t, n) { const i = s.prev, r = s, o = s.next; if (Ct(i, r, o) >= 0) return !1; - const a = i.x, l = r.x, c = o.x, h = i.y, u = r.y, d = o.y, f = Math.min(a, l, c), p = Math.min(h, u, d), g = Math.max(a, l, c), x = Math.max(h, u, d), m = $h(f, p, e, t, n), b = $h(g, x, e, t, n); + const a = i.x, l = r.x, c = o.x, h = i.y, u = r.y, d = o.y, f = Math.min(a, l, c), g = Math.min(h, u, d), p = Math.max(a, l, c), x = Math.max(h, u, d), m = Kh(f, g, e, t, n), b = Kh(p, x, e, t, n); let v = s.prevZ, y = s.nextZ; for (; v && v.z >= m && y && y.z <= b; ) { - if (v.x >= f && v.x <= g && v.y >= p && v.y <= x && v !== i && v !== o && ho(a, h, l, u, c, d, v.x, v.y) && Ct(v.prev, v, v.next) >= 0 || (v = v.prevZ, y.x >= f && y.x <= g && y.y >= p && y.y <= x && y !== i && y !== o && ho(a, h, l, u, c, d, y.x, y.y) && Ct(y.prev, y, y.next) >= 0)) return !1; + if (v.x >= f && v.x <= p && v.y >= g && v.y <= x && v !== i && v !== o && uo(a, h, l, u, c, d, v.x, v.y) && Ct(v.prev, v, v.next) >= 0 || (v = v.prevZ, y.x >= f && y.x <= p && y.y >= g && y.y <= x && y !== i && y !== o && uo(a, h, l, u, c, d, y.x, y.y) && Ct(y.prev, y, y.next) >= 0)) return !1; y = y.nextZ; } for (; v && v.z >= m; ) { - if (v.x >= f && v.x <= g && v.y >= p && v.y <= x && v !== i && v !== o && ho(a, h, l, u, c, d, v.x, v.y) && Ct(v.prev, v, v.next) >= 0) return !1; + if (v.x >= f && v.x <= p && v.y >= g && v.y <= x && v !== i && v !== o && uo(a, h, l, u, c, d, v.x, v.y) && Ct(v.prev, v, v.next) >= 0) return !1; v = v.prevZ; } for (; y && y.z <= b; ) { - if (y.x >= f && y.x <= g && y.y >= p && y.y <= x && y !== i && y !== o && ho(a, h, l, u, c, d, y.x, y.y) && Ct(y.prev, y, y.next) >= 0) return !1; + if (y.x >= f && y.x <= p && y.y >= g && y.y <= x && y !== i && y !== o && uo(a, h, l, u, c, d, y.x, y.y) && Ct(y.prev, y, y.next) >= 0) return !1; y = y.nextZ; } return !0; @@ -13464,9 +13464,9 @@ function tv(s, e) { let t = s; do { const n = t.prev, i = t.next.next; - !Tr(n, i) && Hm(n, t, t.next, i) && Ro(n, i) && Ro(i, n) && (e.push(n.i, t.i, i.i), Lo(t), Lo(t.next), t = s = i), t = t.next; + !Ar(n, i) && Hm(n, t, t.next, i) && Lo(n, i) && Lo(i, n) && (e.push(n.i, t.i, i.i), Do(t), Do(t.next), t = s = i), t = t.next; } while (t !== s); - return ws(t); + return Ss(t); } function nv(s, e, t, n, i, r) { let o = s; @@ -13475,7 +13475,7 @@ function nv(s, e, t, n, i, r) { for (; a !== o.prev; ) { if (o.i !== a.i && uv(o, a)) { let l = Vm(o, a); - o = ws(o, o.next), l = ws(l, l.next), Po(o, e, t, n, i, r, 0), Po(l, e, t, n, i, r, 0); + o = Ss(o, o.next), l = Ss(l, l.next), Ro(o, e, t, n, i, r, 0), Ro(l, e, t, n, i, r, 0); return; } a = a.next; @@ -13507,15 +13507,15 @@ function rv(s, e) { if (!t) return e; const n = Vm(t, s); - return ws(n, n.next), ws(t, t.next); + return Ss(n, n.next), Ss(t, t.next); } function ov(s, e) { let t = e; const n = s.x, i = s.y; let r = -1 / 0, o; - if (Tr(s, t)) return t; + if (Ar(s, t)) return t; do { - if (Tr(s, t.next)) return t.next; + if (Ar(s, t.next)) return t.next; if (i <= t.y && i >= t.next.y && t.next.y !== t.y) { const u = t.x + (i - t.y) * (t.next.x - t.x) / (t.next.y - t.y); if (u <= n && u > r && (r = u, o = t.x < t.next.x ? t : t.next, u === n)) @@ -13530,7 +13530,7 @@ function ov(s, e) { do { if (n >= t.x && t.x >= l && n !== t.x && zm(i < c ? n : r, i, l, c, i < c ? r : n, i, t.x, t.y)) { const u = Math.abs(i - t.y) / (n - t.x); - Ro(t, s) && (u < h || u === h && (t.x > o.x || t.x === o.x && av(o, t))) && (o = t, h = u); + Lo(t, s) && (u < h || u === h && (t.x > o.x || t.x === o.x && av(o, t))) && (o = t, h = u); } t = t.next; } while (t !== a); @@ -13542,7 +13542,7 @@ function av(s, e) { function lv(s, e, t, n) { let i = s; do - i.z === 0 && (i.z = $h(i.x, i.y, e, t, n)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next; + i.z === 0 && (i.z = Kh(i.x, i.y, e, t, n)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next; while (i !== s); i.prevZ.nextZ = null, i.prevZ = null, cv(i); } @@ -13566,7 +13566,7 @@ function cv(s) { } while (e > 1); return s; } -function $h(s, e, t, n, i) { +function Kh(s, e, t, n, i) { return s = (s - t) * i | 0, e = (e - n) * i | 0, s = (s | s << 8) & 16711935, s = (s | s << 4) & 252645135, s = (s | s << 2) & 858993459, s = (s | s << 1) & 1431655765, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, s | e << 1; } function hv(s) { @@ -13579,19 +13579,19 @@ function hv(s) { function zm(s, e, t, n, i, r, o, a) { return (i - o) * (e - a) >= (s - o) * (r - a) && (s - o) * (n - a) >= (t - o) * (e - a) && (t - o) * (r - a) >= (i - o) * (n - a); } -function ho(s, e, t, n, i, r, o, a) { +function uo(s, e, t, n, i, r, o, a) { return !(s === o && e === a) && zm(s, e, t, n, i, r, o, a); } function uv(s, e) { return s.next.i !== e.i && s.prev.i !== e.i && !dv(s, e) && // doesn't intersect other edges - (Ro(s, e) && Ro(e, s) && fv(s, e) && // locally visible + (Lo(s, e) && Lo(e, s) && fv(s, e) && // locally visible (Ct(s.prev, s, e.prev) || Ct(s, e.prev, e)) || // does not create opposite-facing sectors - Tr(s, e) && Ct(s.prev, s, s.next) > 0 && Ct(e.prev, e, e.next) > 0); + Ar(s, e) && Ct(s.prev, s, s.next) > 0 && Ct(e.prev, e, e.next) > 0); } function Ct(s, e, t) { return (e.y - s.y) * (t.x - e.x) - (e.x - s.x) * (t.y - e.y); } -function Tr(s, e) { +function Ar(s, e) { return s.x === e.x && s.y === e.y; } function Hm(s, e, t, n) { @@ -13612,7 +13612,7 @@ function dv(s, e) { } while (t !== s); return !1; } -function Ro(s, e) { +function Lo(s, e) { return Ct(s.prev, s, s.next) < 0 ? Ct(s, e, s.next) >= 0 && Ct(s, s.prev, e) >= 0 : Ct(s, e, s.prev) < 0 || Ct(s, s.next, e) < 0; } function fv(s, e) { @@ -13624,17 +13624,17 @@ function fv(s, e) { return n; } function Vm(s, e) { - const t = Jh(s.i, s.x, s.y), n = Jh(e.i, e.x, e.y), i = s.next, r = e.prev; + const t = $h(s.i, s.x, s.y), n = $h(e.i, e.x, e.y), i = s.next, r = e.prev; return s.next = e, e.prev = s, t.next = i, i.prev = t, n.next = t, t.prev = n, r.next = n, n.prev = r, n; } -function tf(s, e, t, n) { - const i = Jh(s, e, t); +function ef(s, e, t, n) { + const i = $h(s, e, t); return n ? (i.next = n.next, i.prev = n, n.next.prev = i, n.next = i) : (i.prev = i, i.next = i), i; } -function Lo(s) { +function Do(s) { s.next.prev = s.prev, s.prev.next = s.next, s.prevZ && (s.prevZ.nextZ = s.nextZ), s.nextZ && (s.nextZ.prevZ = s.prevZ); } -function Jh(s, e, t) { +function $h(s, e, t) { return { i: s, // vertex index in coordinates array @@ -13673,7 +13673,7 @@ class mv { return Jx(e, t, n); } } -class hr { +class ur { /** * Calculate area of a ( 2D ) contour polygon. * @@ -13694,7 +13694,7 @@ class hr { * @return {boolean} Whether the given contour uses a clockwise winding order or not. */ static isClockWise(e) { - return hr.area(e) < 0; + return ur.area(e) < 0; } /** * Triangulates the given shape definition. @@ -13705,33 +13705,33 @@ class hr { */ static triangulateShape(e, t) { const n = [], i = [], r = []; - nf(e), sf(n, e); + tf(e), nf(n, e); let o = e.length; - t.forEach(nf); + t.forEach(tf); for (let l = 0; l < t.length; l++) - i.push(o), o += t[l].length, sf(n, t[l]); + i.push(o), o += t[l].length, nf(n, t[l]); const a = mv.triangulate(n, i); for (let l = 0; l < a.length; l += 3) r.push(a.slice(l, l + 3)); return r; } } -function nf(s) { +function tf(s) { const e = s.length; e > 2 && s[e - 1].equals(s[0]) && s.pop(); } -function sf(s, e) { +function nf(s, e) { for (let t = 0; t < e.length; t++) s.push(e[t].x), s.push(e[t].y); } -class Fu extends ut { +class ku extends ut { /** * Constructs a new extrude geometry. * * @param {Shape|Array} [shapes] - A shape or an array of shapes. * @param {ExtrudeGeometry~Options} [options] - The extrude settings. */ - constructor(e = new Om([new ce(0.5, 0.5), new ce(-0.5, 0.5), new ce(-0.5, -0.5), new ce(0.5, -0.5)]), t = {}) { + constructor(e = new km([new ce(0.5, 0.5), new ce(-0.5, 0.5), new ce(-0.5, -0.5), new ce(0.5, -0.5)]), t = {}) { super(), this.type = "ExtrudeGeometry", this.parameters = { shapes: e, options: t @@ -13744,35 +13744,35 @@ class Fu extends ut { this.setAttribute("position", new rn(i, 3)), this.setAttribute("uv", new rn(r, 2)), this.computeVertexNormals(); function o(a) { const l = [], c = t.curveSegments !== void 0 ? t.curveSegments : 12, h = t.steps !== void 0 ? t.steps : 1, u = t.depth !== void 0 ? t.depth : 1; - let d = t.bevelEnabled !== void 0 ? t.bevelEnabled : !0, f = t.bevelThickness !== void 0 ? t.bevelThickness : 0.2, p = t.bevelSize !== void 0 ? t.bevelSize : f - 0.1, g = t.bevelOffset !== void 0 ? t.bevelOffset : 0, x = t.bevelSegments !== void 0 ? t.bevelSegments : 3; + let d = t.bevelEnabled !== void 0 ? t.bevelEnabled : !0, f = t.bevelThickness !== void 0 ? t.bevelThickness : 0.2, g = t.bevelSize !== void 0 ? t.bevelSize : f - 0.1, p = t.bevelOffset !== void 0 ? t.bevelOffset : 0, x = t.bevelSegments !== void 0 ? t.bevelSegments : 3; const m = t.extrudePath, b = t.UVGenerator !== void 0 ? t.UVGenerator : gv; let v, y = !1, M, E, A, R; - m && (v = m.getSpacedPoints(h), y = !0, d = !1, M = m.computeFrenetFrames(h, !1), E = new P(), A = new P(), R = new P()), d || (x = 0, f = 0, p = 0, g = 0); + m && (v = m.getSpacedPoints(h), y = !0, d = !1, M = m.computeFrenetFrames(h, !1), E = new P(), A = new P(), R = new P()), d || (x = 0, f = 0, g = 0, p = 0); const _ = a.extractPoints(c); let S = _.shape; const D = _.holes; - if (!hr.isClockWise(S)) { + if (!ur.isClockWise(S)) { S = S.reverse(); for (let T = 0, I = D.length; T < I; T++) { const V = D[T]; - hr.isClockWise(V) && (D[T] = V.reverse()); + ur.isClockWise(V) && (D[T] = V.reverse()); } } function B(T) { const V = 10000000000000001e-36; - let U = T[0]; - for (let k = 1; k <= T.length; k++) { - const z = k % T.length, ee = T[z], J = ee.x - U.x, G = ee.y - U.y, N = J * J + G * G, L = Math.max( + let O = T[0]; + for (let U = 1; U <= T.length; U++) { + const z = U % T.length, ee = T[z], J = ee.x - O.x, G = ee.y - O.y, N = J * J + G * G, L = Math.max( Math.abs(ee.x), Math.abs(ee.y), - Math.abs(U.x), - Math.abs(U.y) + Math.abs(O.x), + Math.abs(O.y) ), H = V * L * L; if (N <= H) { - T.splice(z, 1), k--; + T.splice(z, 1), U--; continue; } - U = ee; + O = ee; } } B(S), D.forEach(B); @@ -13786,43 +13786,43 @@ class Fu extends ut { } const j = S.length; function $(T, I, V) { - let U, k, z; + let O, U, z; const ee = T.x - I.x, J = T.y - I.y, G = V.x - T.x, N = V.y - T.y, L = ee * ee + J * J, H = ee * N - J * G; if (Math.abs(H) > Number.EPSILON) { const K = Math.sqrt(L), le = Math.sqrt(G * G + N * N), te = I.x - J / K, Te = I.y + ee / K, be = V.x - N / le, Re = V.y + G / le, De = ((be - te) * N - (Re - Te) * G) / (ee * N - J * G); - U = te + ee * De - T.x, k = Te + J * De - T.y; - const ue = U * U + k * k; + O = te + ee * De - T.x, U = Te + J * De - T.y; + const ue = O * O + U * U; if (ue <= 2) - return new ce(U, k); + return new ce(O, U); z = Math.sqrt(ue / 2); } else { let K = !1; - ee > Number.EPSILON ? G > Number.EPSILON && (K = !0) : ee < -Number.EPSILON ? G < -Number.EPSILON && (K = !0) : Math.sign(J) === Math.sign(N) && (K = !0), K ? (U = -J, k = ee, z = Math.sqrt(L)) : (U = ee, k = J, z = Math.sqrt(L / 2)); + ee > Number.EPSILON ? G > Number.EPSILON && (K = !0) : ee < -Number.EPSILON ? G < -Number.EPSILON && (K = !0) : Math.sign(J) === Math.sign(N) && (K = !0), K ? (O = -J, U = ee, z = Math.sqrt(L)) : (O = ee, U = J, z = Math.sqrt(L / 2)); } - return new ce(U / z, k / z); + return new ce(O / z, U / z); } - const Z = []; - for (let T = 0, I = F.length, V = I - 1, U = T + 1; T < I; T++, V++, U++) - V === I && (V = 0), U === I && (U = 0), Z[T] = $(F[T], F[V], F[U]); + const q = []; + for (let T = 0, I = F.length, V = I - 1, O = T + 1; T < I; T++, V++, O++) + V === I && (V = 0), O === I && (O = 0), q[T] = $(F[T], F[V], F[O]); const re = []; - let X, Y = Z.concat(); + let X, Y = q.concat(); for (let T = 0, I = w; T < I; T++) { const V = D[T]; X = []; - for (let U = 0, k = V.length, z = k - 1, ee = U + 1; U < k; U++, z++, ee++) - z === k && (z = 0), ee === k && (ee = 0), X[U] = $(V[U], V[z], V[ee]); + for (let O = 0, U = V.length, z = U - 1, ee = O + 1; O < U; O++, z++, ee++) + z === U && (z = 0), ee === U && (ee = 0), X[O] = $(V[O], V[z], V[ee]); re.push(X), Y = Y.concat(X); } let ge; if (x === 0) - ge = hr.triangulateShape(F, D); + ge = ur.triangulateShape(F, D); else { const T = [], I = []; for (let V = 0; V < x; V++) { - const U = V / x, k = f * Math.cos(U * Math.PI / 2), z = p * Math.sin(U * Math.PI / 2) + g; + const O = V / x, U = f * Math.cos(O * Math.PI / 2), z = g * Math.sin(O * Math.PI / 2) + p; for (let ee = 0, J = F.length; ee < J; ee++) { - const G = W(F[ee], Z[ee], z); - ve(G.x, G.y, -k), U === 0 && T.push(G); + const G = W(F[ee], q[ee], z); + ve(G.x, G.y, -U), O === 0 && T.push(G); } for (let ee = 0, J = w; ee < J; ee++) { const G = D[ee]; @@ -13830,14 +13830,14 @@ class Fu extends ut { const N = []; for (let L = 0, H = G.length; L < H; L++) { const K = W(G[L], X[L], z); - ve(K.x, K.y, -k), U === 0 && N.push(K); + ve(K.x, K.y, -U), O === 0 && N.push(K); } - U === 0 && I.push(N); + O === 0 && I.push(N); } } - ge = hr.triangulateShape(T, I); + ge = ur.triangulateShape(T, I); } - const pe = ge.length, de = p + g; + const pe = ge.length, de = g + p; for (let T = 0; T < j; T++) { const I = d ? W(S[T], Y[T], de) : S[T]; y ? (A.copy(M.normals[0]).multiplyScalar(I.x), E.copy(M.binormals[0]).multiplyScalar(I.y), R.copy(v[0]).add(A).add(E), ve(R.x, R.y, R.z)) : ve(I.x, I.y, 0); @@ -13848,16 +13848,16 @@ class Fu extends ut { y ? (A.copy(M.normals[T]).multiplyScalar(V.x), E.copy(M.binormals[T]).multiplyScalar(V.y), R.copy(v[T]).add(A).add(E), ve(R.x, R.y, R.z)) : ve(V.x, V.y, u / h * T); } for (let T = x - 1; T >= 0; T--) { - const I = T / x, V = f * Math.cos(I * Math.PI / 2), U = p * Math.sin(I * Math.PI / 2) + g; - for (let k = 0, z = F.length; k < z; k++) { - const ee = W(F[k], Z[k], U); + const I = T / x, V = f * Math.cos(I * Math.PI / 2), O = g * Math.sin(I * Math.PI / 2) + p; + for (let U = 0, z = F.length; U < z; U++) { + const ee = W(F[U], q[U], O); ve(ee.x, ee.y, u + V); } - for (let k = 0, z = D.length; k < z; k++) { - const ee = D[k]; - X = re[k]; + for (let U = 0, z = D.length; U < z; U++) { + const ee = D[U]; + X = re[U]; for (let J = 0, G = ee.length; J < G; J++) { - const N = W(ee[J], X[J], U); + const N = W(ee[J], X[J], O); y ? ve(N.x, N.y + v[h - 1].y, v[h - 1].x + V) : ve(N.x, N.y, u + V); } } @@ -13867,14 +13867,14 @@ class Fu extends ut { const T = i.length / 3; if (d) { let I = 0, V = j * I; - for (let U = 0; U < pe; U++) { - const k = ge[U]; - we(k[2] + V, k[1] + V, k[0] + V); + for (let O = 0; O < pe; O++) { + const U = ge[O]; + we(U[2] + V, U[1] + V, U[0] + V); } I = h + x * 2, V = j * I; - for (let U = 0; U < pe; U++) { - const k = ge[U]; - we(k[0] + V, k[1] + V, k[2] + V); + for (let O = 0; O < pe; O++) { + const U = ge[O]; + we(U[0] + V, U[1] + V, U[2] + V); } } else { for (let I = 0; I < pe; I++) { @@ -13892,20 +13892,20 @@ class Fu extends ut { const T = i.length / 3; let I = 0; fe(F, I), I += F.length; - for (let V = 0, U = D.length; V < U; V++) { - const k = D[V]; - fe(k, I), I += k.length; + for (let V = 0, O = D.length; V < O; V++) { + const U = D[V]; + fe(U, I), I += U.length; } n.addGroup(T, i.length / 3 - T, 1); } function fe(T, I) { let V = T.length; for (; --V >= 0; ) { - const U = V; - let k = V - 1; - k < 0 && (k = T.length - 1); + const O = V; + let U = V - 1; + U < 0 && (U = T.length - 1); for (let z = 0, ee = h + x * 2; z < ee; z++) { - const J = j * z, G = j * (z + 1), N = I + U + J, L = I + k + J, H = I + k + G, K = I + U + G; + const J = j * z, G = j * (z + 1), N = I + O + J, L = I + U + J, H = I + U + G, K = I + O + G; Be(N, L, H, K); } } @@ -13915,12 +13915,12 @@ class Fu extends ut { } function we(T, I, V) { Ke(T), Ke(I), Ke(V); - const U = i.length / 3, k = b.generateTopUV(n, i, U - 3, U - 2, U - 1); - Ne(k[0]), Ne(k[1]), Ne(k[2]); + const O = i.length / 3, U = b.generateTopUV(n, i, O - 3, O - 2, O - 1); + Ne(U[0]), Ne(U[1]), Ne(U[2]); } - function Be(T, I, V, U) { - Ke(T), Ke(I), Ke(U), Ke(I), Ke(V), Ke(U); - const k = i.length / 3, z = b.generateSideWallUV(n, i, k - 6, k - 3, k - 2, k - 1); + function Be(T, I, V, O) { + Ke(T), Ke(I), Ke(O), Ke(I), Ke(V), Ke(O); + const U = i.length / 3, z = b.generateSideWallUV(n, i, U - 6, U - 3, U - 2, U - 1); Ne(z[0]), Ne(z[1]), Ne(z[3]), Ne(z[1]), Ne(z[2]), Ne(z[3]); } function Ke(T) { @@ -13953,7 +13953,7 @@ class Fu extends ut { n.push(a); } const i = e.options.extrudePath; - return i !== void 0 && (e.options.extrudePath = new Kh[i.type]().fromJSON(i)), new Fu(n, e.options); + return i !== void 0 && (e.options.extrudePath = new Yh[i.type]().fromJSON(i)), new ku(n, e.options); } } const gv = { @@ -13966,16 +13966,16 @@ const gv = { ]; }, generateSideWallUV: function(s, e, t, n, i, r) { - const o = e[t * 3], a = e[t * 3 + 1], l = e[t * 3 + 2], c = e[n * 3], h = e[n * 3 + 1], u = e[n * 3 + 2], d = e[i * 3], f = e[i * 3 + 1], p = e[i * 3 + 2], g = e[r * 3], x = e[r * 3 + 1], m = e[r * 3 + 2]; + const o = e[t * 3], a = e[t * 3 + 1], l = e[t * 3 + 2], c = e[n * 3], h = e[n * 3 + 1], u = e[n * 3 + 2], d = e[i * 3], f = e[i * 3 + 1], g = e[i * 3 + 2], p = e[r * 3], x = e[r * 3 + 1], m = e[r * 3 + 2]; return Math.abs(a - h) < Math.abs(o - c) ? [ new ce(o, 1 - l), new ce(c, 1 - u), - new ce(d, 1 - p), - new ce(g, 1 - m) + new ce(d, 1 - g), + new ce(p, 1 - m) ] : [ new ce(a, 1 - l), new ce(h, 1 - u), - new ce(f, 1 - p), + new ce(f, 1 - g), new ce(x, 1 - m) ]; } @@ -13990,7 +13990,7 @@ function xv(s, e, t) { t.shapes.push(s.uuid); return t.options = Object.assign({}, e), e.extrudePath !== void 0 && (t.options.extrudePath = e.extrudePath.toJSON()), t; } -class ko extends ut { +class Uo extends ut { /** * Constructs a new plane geometry. * @@ -14006,12 +14006,12 @@ class ko extends ut { widthSegments: n, heightSegments: i }; - const r = e / 2, o = t / 2, a = Math.floor(n), l = Math.floor(i), c = a + 1, h = l + 1, u = e / a, d = t / l, f = [], p = [], g = [], x = []; + const r = e / 2, o = t / 2, a = Math.floor(n), l = Math.floor(i), c = a + 1, h = l + 1, u = e / a, d = t / l, f = [], g = [], p = [], x = []; for (let m = 0; m < h; m++) { const b = m * d - o; for (let v = 0; v < c; v++) { const y = v * u - r; - p.push(y, -b, 0), g.push(0, 0, 1), x.push(v / a), x.push(1 - m / l); + g.push(y, -b, 0), p.push(0, 0, 1), x.push(v / a), x.push(1 - m / l); } } for (let m = 0; m < l; m++) @@ -14019,7 +14019,7 @@ class ko extends ut { const v = b + c * m, y = b + c * (m + 1), M = b + 1 + c * (m + 1), E = b + 1 + c * m; f.push(v, y, E), f.push(y, M, E); } - this.setIndex(f), this.setAttribute("position", new rn(p, 3)), this.setAttribute("normal", new rn(g, 3)), this.setAttribute("uv", new rn(x, 2)); + this.setIndex(f), this.setAttribute("position", new rn(g, 3)), this.setAttribute("normal", new rn(p, 3)), this.setAttribute("uv", new rn(x, 2)); } copy(e) { return super.copy(e), this.parameters = Object.assign({}, e.parameters), this; @@ -14032,10 +14032,10 @@ class ko extends ut { * @return {PlaneGeometry} A new instance. */ static fromJSON(e) { - return new ko(e.width, e.height, e.widthSegments, e.heightSegments); + return new Uo(e.width, e.height, e.widthSegments, e.heightSegments); } } -class vv extends Ut { +class vv extends Ot { /** * Constructs a new raw shader material. * @@ -14049,7 +14049,7 @@ class vv extends Ut { super(e), this.isRawShaderMaterial = !0, this.type = "RawShaderMaterial"; } } -class Ss extends yn { +class Es extends yn { /** * Constructs a new mesh standard material. * @@ -14060,13 +14060,13 @@ class Ss extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isMeshStandardMaterial = !0, this.type = "MeshStandardMaterial", this.defines = { STANDARD: "" }, this.color = new Fe(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 Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Io, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new wn(), this.envMapIntensity = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e); + super(), this.isMeshStandardMaterial = !0, this.type = "MeshStandardMaterial", this.defines = { STANDARD: "" }, this.color = new Oe(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 Oe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Bo, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new wn(), this.envMapIntensity = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, 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.envMapRotation.copy(e.envMapRotation), this.envMapIntensity = e.envMapIntensity, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.flatShading = e.flatShading, this.fog = e.fog, this; } } -class Qn extends Ss { +class Qn extends Es { /** * Constructs a new mesh physical material. * @@ -14082,12 +14082,12 @@ class Qn extends Ss { PHYSICAL: "" }, this.type = "MeshPhysicalMaterial", this.anisotropyRotation = 0, this.anisotropyMap = null, this.clearcoatMap = null, this.clearcoatRoughness = 0, this.clearcoatRoughnessMap = null, this.clearcoatNormalScale = new ce(1, 1), this.clearcoatNormalMap = null, this.ior = 1.5, Object.defineProperty(this, "reflectivity", { get: function() { - return Ze(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1); + return qe(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1); }, set: function(t) { this.ior = (1 + 0.4 * t) / (1 - 0.4 * t); } - }), this.iridescenceMap = null, this.iridescenceIOR = 1.3, this.iridescenceThicknessRange = [100, 400], this.iridescenceThicknessMap = null, this.sheenColor = new Fe(0), this.sheenColorMap = null, this.sheenRoughness = 1, this.sheenRoughnessMap = null, this.transmissionMap = null, this.thickness = 0, this.thicknessMap = null, this.attenuationDistance = 1 / 0, this.attenuationColor = new Fe(1, 1, 1), this.specularIntensity = 1, this.specularIntensityMap = null, this.specularColor = new Fe(1, 1, 1), this.specularColorMap = null, this._anisotropy = 0, this._clearcoat = 0, this._dispersion = 0, this._iridescence = 0, this._sheen = 0, this._transmission = 0, this.setValues(e); + }), this.iridescenceMap = null, this.iridescenceIOR = 1.3, this.iridescenceThicknessRange = [100, 400], this.iridescenceThicknessMap = null, this.sheenColor = new Oe(0), this.sheenColorMap = null, this.sheenRoughness = 1, this.sheenRoughnessMap = null, this.transmissionMap = null, this.thickness = 0, this.thicknessMap = null, this.attenuationDistance = 1 / 0, this.attenuationColor = new Oe(1, 1, 1), this.specularIntensity = 1, this.specularIntensityMap = null, this.specularColor = new Oe(1, 1, 1), this.specularColorMap = null, this._anisotropy = 0, this._clearcoat = 0, this._dispersion = 0, this._iridescence = 0, this._sheen = 0, this._transmission = 0, this.setValues(e); } /** * The anisotropy strength, from `0.0` to `1.0`. @@ -14190,7 +14190,7 @@ class bv extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isMeshPhongMaterial = !0, this.type = "MeshPhongMaterial", this.color = new Fe(16777215), this.specular = new Fe(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Io, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new wn(), this.combine = Tl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e); + super(), this.isMeshPhongMaterial = !0, this.type = "MeshPhongMaterial", this.color = new Oe(16777215), this.specular = new Oe(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Oe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Bo, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new wn(), this.combine = Tl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, 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.envMapRotation.copy(e.envMapRotation), 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.flatShading = e.flatShading, this.fog = e.fog, this; @@ -14207,7 +14207,7 @@ class yv extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isMeshNormalMaterial = !0, this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Io, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.flatShading = !1, this.setValues(e); + super(), this.isMeshNormalMaterial = !0, this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Bo, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.flatShading = !1, 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.flatShading = e.flatShading, this; @@ -14224,7 +14224,7 @@ class Gm extends yn { * by {@link Color#set}. */ constructor(e) { - super(), this.isMeshLambertMaterial = !0, this.type = "MeshLambertMaterial", this.color = new Fe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Io, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new wn(), this.combine = Tl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, this.setValues(e); + super(), this.isMeshLambertMaterial = !0, this.type = "MeshLambertMaterial", this.color = new Oe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Oe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Bo, this.normalScale = new ce(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new wn(), this.combine = Tl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.flatShading = !1, this.fog = !0, 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.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.envMapRotation.copy(e.envMapRotation), 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.flatShading = e.flatShading, this.fog = e.fog, this; @@ -14278,7 +14278,7 @@ function Sv(s) { for (let i = 0; i !== t; ++i) n[i] = i; return n.sort(e), n; } -function rf(s, e, t) { +function sf(s, e, t) { const n = s.length, i = new s.constructor(n); for (let r = 0, o = 0; o !== n; ++r) { const a = t[r] * e; @@ -14307,7 +14307,7 @@ function Wm(s, e, t, n) { o = r[n], o !== void 0 && (e.push(r.time), t.push(o)), r = s[i++]; while (r !== void 0); } -class Uo { +class Oo { /** * Constructs a new interpolant. * @@ -14416,7 +14416,7 @@ class Uo { intervalChanged_() { } } -class Ev extends Uo { +class Ev extends Oo { /** * Constructs a new cubic interpolant. * @@ -14427,8 +14427,8 @@ class Ev extends Uo { */ constructor(e, t, n, i) { super(e, t, n, i), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = { - endingStart: pd, - endingEnd: pd + endingStart: fd, + endingEnd: fd }; } intervalChanged_(e, t, n) { @@ -14436,10 +14436,10 @@ class Ev extends Uo { let r = e - 2, o = e + 1, a = i[r], l = i[o]; if (a === void 0) switch (this.getSettings_().endingStart) { - case md: + case pd: r = e, a = 2 * t - n; break; - case gd: + case md: r = i.length - 2, a = t + i[r] - i[r + 1]; break; default: @@ -14447,10 +14447,10 @@ class Ev extends Uo { } if (l === void 0) switch (this.getSettings_().endingEnd) { - case md: + case pd: o = e, l = 2 * n - t; break; - case gd: + case md: o = 1, l = n + i[1] - i[0]; break; default: @@ -14460,13 +14460,13 @@ class Ev extends Uo { this._weightPrev = c / (t - a), this._weightNext = c / (l - n), this._offsetPrev = r * h, this._offsetNext = o * h; } interpolate_(e, t, n, i) { - const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = e * a, c = l - a, h = this._offsetPrev, u = this._offsetNext, d = this._weightPrev, f = this._weightNext, p = (n - t) / (i - t), g = p * p, x = g * p, m = -d * x + 2 * d * g - d * p, b = (1 + d) * x + (-1.5 - 2 * d) * g + (-0.5 + d) * p + 1, v = (-1 - f) * x + (1.5 + f) * g + 0.5 * p, y = f * x - f * g; + const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = e * a, c = l - a, h = this._offsetPrev, u = this._offsetNext, d = this._weightPrev, f = this._weightNext, g = (n - t) / (i - t), p = g * g, x = p * g, m = -d * x + 2 * d * p - d * g, b = (1 + d) * x + (-1.5 - 2 * d) * p + (-0.5 + d) * g + 1, v = (-1 - f) * x + (1.5 + f) * p + 0.5 * g, y = f * x - f * p; for (let M = 0; M !== a; ++M) r[M] = m * o[h + M] + b * o[c + M] + v * o[l + M] + y * o[u + M]; return r; } } -class Tv extends Uo { +class Tv extends Oo { /** * Constructs a new linear interpolant. * @@ -14485,7 +14485,7 @@ class Tv extends Uo { return r; } } -class Av extends Uo { +class Av extends Oo { /** * Constructs a new discrete interpolant. * @@ -14577,10 +14577,10 @@ class ei { setInterpolation(e) { let t; switch (e) { - case Eo: + case To: t = this.InterpolantFactoryMethodDiscrete; break; - case To: + case Ao: t = this.InterpolantFactoryMethodLinear; break; case zl: @@ -14606,9 +14606,9 @@ class ei { getInterpolation() { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: - return Eo; - case this.InterpolantFactoryMethodLinear: return To; + case this.InterpolantFactoryMethodLinear: + return Ao; case this.InterpolantFactoryMethodSmooth: return zl; } @@ -14725,9 +14725,9 @@ class ei { l = !0; else { const u = a * n, d = u - n, f = u + n; - for (let p = 0; p !== n; ++p) { - const g = t[u + p]; - if (g !== t[d + p] || g !== t[f + p]) { + for (let g = 0; g !== n; ++g) { + const p = t[u + g]; + if (p !== t[d + g] || p !== t[f + g]) { l = !0; break; } @@ -14764,8 +14764,8 @@ class ei { ei.prototype.ValueTypeName = ""; ei.prototype.TimeBufferType = Float32Array; ei.prototype.ValueBufferType = Float32Array; -ei.prototype.DefaultInterpolation = To; -class Ir extends ei { +ei.prototype.DefaultInterpolation = Ao; +class Br extends ei { /** * Constructs a new boolean keyframe track. * @@ -14780,11 +14780,11 @@ class Ir extends ei { super(e, t, n); } } -Ir.prototype.ValueTypeName = "bool"; -Ir.prototype.ValueBufferType = Array; -Ir.prototype.DefaultInterpolation = Eo; -Ir.prototype.InterpolantFactoryMethodLinear = void 0; -Ir.prototype.InterpolantFactoryMethodSmooth = void 0; +Br.prototype.ValueTypeName = "bool"; +Br.prototype.ValueBufferType = Array; +Br.prototype.DefaultInterpolation = To; +Br.prototype.InterpolantFactoryMethodLinear = void 0; +Br.prototype.InterpolantFactoryMethodSmooth = void 0; class Xm extends ei { /** * Constructs a new color keyframe track. @@ -14799,7 +14799,7 @@ class Xm extends ei { } } Xm.prototype.ValueTypeName = "color"; -class Ar extends ei { +class Cr extends ei { /** * Constructs a new number keyframe track. * @@ -14812,8 +14812,8 @@ class Ar extends ei { super(e, t, n, i); } } -Ar.prototype.ValueTypeName = "number"; -class Cv extends Uo { +Cr.prototype.ValueTypeName = "number"; +class Cv extends Oo { /** * Constructs a new SLERP interpolant. * @@ -14833,7 +14833,7 @@ class Cv extends Uo { return r; } } -class Cr extends ei { +class Pr extends ei { /** * Constructs a new Quaternion keyframe track. * @@ -14856,9 +14856,9 @@ class Cr extends ei { return new Cv(this.times, this.values, this.getValueSize(), e); } } -Cr.prototype.ValueTypeName = "quaternion"; -Cr.prototype.InterpolantFactoryMethodSmooth = void 0; -class Br extends ei { +Pr.prototype.ValueTypeName = "quaternion"; +Pr.prototype.InterpolantFactoryMethodSmooth = void 0; +class Nr extends ei { /** * Constructs a new string keyframe track. * @@ -14873,12 +14873,12 @@ class Br extends ei { super(e, t, n); } } -Br.prototype.ValueTypeName = "string"; -Br.prototype.ValueBufferType = Array; -Br.prototype.DefaultInterpolation = Eo; -Br.prototype.InterpolantFactoryMethodLinear = void 0; -Br.prototype.InterpolantFactoryMethodSmooth = void 0; -class Pr extends ei { +Nr.prototype.ValueTypeName = "string"; +Nr.prototype.ValueBufferType = Array; +Nr.prototype.DefaultInterpolation = To; +Nr.prototype.InterpolantFactoryMethodLinear = void 0; +Nr.prototype.InterpolantFactoryMethodSmooth = void 0; +class Rr extends ei { /** * Constructs a new vector keyframe track. * @@ -14891,7 +14891,7 @@ class Pr extends ei { super(e, t, n, i); } } -Pr.prototype.ValueTypeName = "vector"; +Rr.prototype.ValueTypeName = "vector"; class Pv { /** * Constructs a new animation clip. @@ -14908,7 +14908,7 @@ class Pv { * is blended/combined when two or more animations are simultaneously played. */ constructor(e = "", t = -1, n = [], i = Rg) { - this.name = e, this.tracks = n, this.duration = t, this.blendMode = i, this.uuid = On(), this.userData = {}, this.duration < 0 && this.resetDuration(); + this.name = e, this.tracks = n, this.duration = t, this.blendMode = i, this.uuid = kn(), this.userData = {}, this.duration < 0 && this.resetDuration(); } /** * Factory method for creating an animation clip from the given JSON. @@ -14968,8 +14968,8 @@ class Pv { (a + 1) % r ), c.push(0, 1, 0); const h = Sv(l); - l = rf(l, 1, h), c = rf(c, 1, h), !i && l[0] === 0 && (l.push(r), c.push(c[0])), o.push( - new Ar( + l = sf(l, 1, h), c = sf(c, 1, h), !i && l[0] === 0 && (l.push(r), c.push(c[0])), o.push( + new Cr( ".morphTargetInfluences[" + t[a].name + "]", l, c @@ -15039,10 +15039,10 @@ class Pv { static parseAnimation(e, t) { if (He("AnimationClip: parseAnimation() is deprecated and will be removed with r185"), !e) return et("AnimationClip: No animation in JSONLoader data."), null; - const n = function(u, d, f, p, g) { + const n = function(u, d, f, g, p) { if (f.length !== 0) { const x = [], m = []; - Wm(f, x, m, p), x.length !== 0 && g.push(new u(d, x, m)); + Wm(f, x, m, g), x.length !== 0 && p.push(new u(d, x, m)); } }, i = [], r = e.name || "default", o = e.fps || 30, a = e.blendMode; let l = e.length || -1; @@ -15052,36 +15052,36 @@ class Pv { if (!(!d || d.length === 0)) if (d[0].morphTargets) { const f = {}; - let p; - for (p = 0; p < d.length; p++) - if (d[p].morphTargets) - for (let g = 0; g < d[p].morphTargets.length; g++) - f[d[p].morphTargets[g]] = -1; - for (const g in f) { + let g; + for (g = 0; g < d.length; g++) + if (d[g].morphTargets) + for (let p = 0; p < d[g].morphTargets.length; p++) + f[d[g].morphTargets[p]] = -1; + for (const p in f) { const x = [], m = []; - for (let b = 0; b !== d[p].morphTargets.length; ++b) { - const v = d[p]; - x.push(v.time), m.push(v.morphTarget === g ? 1 : 0); + for (let b = 0; b !== d[g].morphTargets.length; ++b) { + const v = d[g]; + x.push(v.time), m.push(v.morphTarget === p ? 1 : 0); } - i.push(new Ar(".morphTargetInfluence[" + g + "]", x, m)); + i.push(new Cr(".morphTargetInfluence[" + p + "]", x, m)); } l = f.length * o; } else { const f = ".bones[" + t[u].name + "]"; n( - Pr, + Rr, f + ".position", d, "pos", i ), n( - Cr, + Pr, f + ".quaternion", d, "rot", i ), n( - Pr, + Rr, f + ".scale", d, "scl", @@ -15166,21 +15166,21 @@ function Rv(s) { case "float": case "number": case "integer": - return Ar; + return Cr; case "vector": case "vector2": case "vector3": case "vector4": - return Pr; + return Rr; case "color": return Xm; case "quaternion": - return Cr; + return Pr; case "bool": case "boolean": - return Ir; - case "string": return Br; + case "string": + return Nr; } throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + s); } @@ -15279,9 +15279,9 @@ class Dv { return u !== -1 && c.splice(u, 2), this; }, this.getHandler = function(h) { for (let u = 0, d = c.length; u < d; u += 2) { - const f = c[u], p = c[u + 1]; + const f = c[u], g = c[u + 1]; if (f.global && (f.lastIndex = 0), f.test(h)) - return p; + return g; } return null; }, this.abort = function() { @@ -15300,7 +15300,7 @@ class Dv { } } const Iv = /* @__PURE__ */ new Dv(); -class Ps { +class Rs { /** * Constructs a new loader. * @@ -15403,14 +15403,14 @@ class Ps { return this; } } -Ps.DEFAULT_MATERIAL_NAME = "__DEFAULT"; +Rs.DEFAULT_MATERIAL_NAME = "__DEFAULT"; const bi = {}; class Bv extends Error { constructor(e, t) { super(e), this.response = t; } } -class yl extends Ps { +class yl extends Rs { /** * Constructs a new file loader. * @@ -15457,8 +15457,8 @@ class yl extends Ps { if (c.status === 200 || c.status === 0) { if (c.status === 0 && He("FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || c.body === void 0 || c.body.getReader === void 0) return c; - const h = bi[e], u = c.body.getReader(), d = c.headers.get("X-File-Size") || c.headers.get("Content-Length"), f = d ? parseInt(d) : 0, p = f !== 0; - let g = 0; + const h = bi[e], u = c.body.getReader(), d = c.headers.get("X-File-Size") || c.headers.get("Content-Length"), f = d ? parseInt(d) : 0, g = f !== 0; + let p = 0; const x = new ReadableStream({ start(m) { b(); @@ -15467,8 +15467,8 @@ class yl extends Ps { if (v) m.close(); else { - g += y.byteLength; - const M = new ProgressEvent("progress", { lengthComputable: p, loaded: g, total: f }); + p += y.byteLength; + const M = new ProgressEvent("progress", { lengthComputable: g, loaded: p, total: f }); for (let E = 0, A = h.length; E < A; E++) { const R = h[E]; R.onProgress && R.onProgress(M); @@ -15499,7 +15499,7 @@ class yl extends Ps { return c.text(); { const u = /charset="?([^;"\s]*)"?/i.exec(a), d = u && u[1] ? u[1].toLowerCase() : void 0, f = new TextDecoder(d); - return c.arrayBuffer().then((p) => f.decode(p)); + return c.arrayBuffer().then((g) => f.decode(g)); } } }).then((c) => { @@ -15551,8 +15551,8 @@ class yl extends Ps { return this._abortController.abort(), this._abortController = new AbortController(), this; } } -const Js = /* @__PURE__ */ new WeakMap(); -class Nv extends Ps { +const Qs = /* @__PURE__ */ new WeakMap(); +class Nv extends Rs { /** * Constructs a new image loader. * @@ -15582,29 +15582,29 @@ class Nv extends Ps { t && t(o), r.manager.itemEnd(e); }, 0); else { - let u = Js.get(o); - u === void 0 && (u = [], Js.set(o, u)), u.push({ onLoad: t, onError: i }); + let u = Qs.get(o); + u === void 0 && (u = [], Qs.set(o, u)), u.push({ onLoad: t, onError: i }); } return o; } - const a = Ao("img"); + const a = Co("img"); function l() { h(), t && t(this); - const u = Js.get(this) || []; + const u = Qs.get(this) || []; for (let d = 0; d < u.length; d++) { const f = u[d]; f.onLoad && f.onLoad(this); } - Js.delete(this), r.manager.itemEnd(e); + Qs.delete(this), r.manager.itemEnd(e); } function c(u) { h(), i && i(u), Ci.remove(`image:${e}`); - const d = Js.get(this) || []; + const d = Qs.get(this) || []; for (let f = 0; f < d.length; f++) { - const p = d[f]; - p.onError && p.onError(u); + const g = d[f]; + g.onError && g.onError(u); } - Js.delete(this), r.manager.itemError(e), r.manager.itemEnd(e); + Qs.delete(this), r.manager.itemError(e), r.manager.itemEnd(e); } function h() { a.removeEventListener("load", l, !1), a.removeEventListener("error", c, !1); @@ -15612,7 +15612,7 @@ class Nv extends Ps { return a.addEventListener("load", l, !1), a.addEventListener("error", c, !1), e.slice(0, 5) !== "data:" && this.crossOrigin !== void 0 && (a.crossOrigin = this.crossOrigin), Ci.add(`image:${e}`, a), r.manager.itemStart(e), a.src = e, a; } } -class jm extends Ps { +class jm extends Rs { /** * Constructs a new texture loader. * @@ -15640,7 +15640,7 @@ class jm extends Ps { }, n, i), r; } } -class Cl extends St { +class Cl extends wt { /** * Constructs a new light. * @@ -15648,7 +15648,7 @@ class Cl extends St { * @param {number} [intensity=1] - The light's strength/intensity. */ constructor(e, t = 1) { - super(), this.isLight = !0, this.type = "Light", this.color = new Fe(e), this.intensity = t; + super(), this.isLight = !0, this.type = "Light", this.color = new Oe(e), this.intensity = t; } /** * Frees the GPU-related resources allocated by this instance. Call this @@ -15664,15 +15664,15 @@ class Cl extends St { 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()), this.target !== void 0 && (t.object.target = this.target.uuid), t; } } -const gc = /* @__PURE__ */ new ze(), of = /* @__PURE__ */ new P(), af = /* @__PURE__ */ new P(); -class zu { +const gc = /* @__PURE__ */ new ze(), rf = /* @__PURE__ */ new P(), of = /* @__PURE__ */ new P(); +class Fu { /** * Constructs a new light shadow. * * @param {Camera} camera - The light's view of the world. */ constructor(e) { - this.camera = e, this.intensity = 1, this.bias = 0, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new ce(512, 512), this.mapType = Jn, this.map = null, this.mapPass = null, this.matrix = new ze(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new Nu(), this._frameExtents = new ce(1, 1), this._viewportCount = 1, this._viewports = [ + this.camera = e, this.intensity = 1, this.bias = 0, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new ce(512, 512), this.mapType = Jn, this.map = null, this.mapPass = null, this.matrix = new ze(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new Bu(), this._frameExtents = new ce(1, 1), this._viewportCount = 1, this._viewports = [ new tt(0, 0, 1, 1) ]; } @@ -15700,7 +15700,7 @@ class zu { */ updateMatrices(e) { const t = this.camera, n = this.matrix; - of.setFromMatrixPosition(e.matrixWorld), t.position.copy(of), af.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(af), t.updateMatrixWorld(), gc.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(gc, t.coordinateSystem, t.reversedDepth), t.reversedDepth ? n.set( + rf.setFromMatrixPosition(e.matrixWorld), t.position.copy(rf), of.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(of), t.updateMatrixWorld(), gc.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(gc, t.coordinateSystem, t.reversedDepth), t.reversedDepth ? n.set( 0.5, 0, 0, @@ -15788,7 +15788,7 @@ class zu { return this.intensity !== 1 && (e.intensity = this.intensity), 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(!1).object, delete e.camera.matrix, e; } } -class kv extends zu { +class Uv extends Fu { /** * Constructs a new spot light shadow. */ @@ -15796,14 +15796,14 @@ class kv extends zu { super(new nn(50, 1, 0.5, 500)), this.isSpotLightShadow = !0, this.focus = 1, this.aspect = 1; } updateMatrices(e) { - const t = this.camera, n = wr * 2 * e.angle * this.focus, i = this.mapSize.width / this.mapSize.height * this.aspect, r = e.distance || t.far; + const t = this.camera, n = Sr * 2 * e.angle * this.focus, i = this.mapSize.width / this.mapSize.height * this.aspect, r = e.distance || t.far; (n !== t.fov || i !== t.aspect || r !== t.far) && (t.fov = n, t.aspect = i, t.far = r, t.updateProjectionMatrix()), super.updateMatrices(e); } copy(e) { return super.copy(e), this.focus = e.focus, this; } } -class Uv extends Cl { +class Ov extends Cl { /** * Constructs a new spot light. * @@ -15815,7 +15815,7 @@ class Uv extends Cl { * @param {number} [decay=2] - The amount the light dims along the distance of the light. */ constructor(e, t, n = 0, i = Math.PI / 3, r = 0, o = 2) { - super(e, t), this.isSpotLight = !0, this.type = "SpotLight", this.position.copy(St.DEFAULT_UP), this.updateMatrix(), this.target = new St(), this.distance = n, this.angle = i, this.penumbra = r, this.decay = o, this.map = null, this.shadow = new kv(); + super(e, t), this.isSpotLight = !0, this.type = "SpotLight", this.position.copy(wt.DEFAULT_UP), this.updateMatrix(), this.target = new wt(), this.distance = n, this.angle = i, this.penumbra = r, this.decay = o, this.map = null, this.shadow = new Uv(); } /** * The light's power. Power is the luminous power of the light measured in lumens (lm). @@ -15836,8 +15836,8 @@ class Uv extends Cl { return super.copy(e, t), 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; } } -const lf = /* @__PURE__ */ new ze(), Kr = /* @__PURE__ */ new P(), xc = /* @__PURE__ */ new P(); -class Ov extends zu { +const af = /* @__PURE__ */ new ze(), $r = /* @__PURE__ */ new P(), xc = /* @__PURE__ */ new P(); +class kv extends Fu { /** * Constructs a new point light shadow. */ @@ -15891,7 +15891,7 @@ class Ov extends zu { */ updateMatrices(e, t = 0) { const n = this.camera, i = this.matrix, r = e.distance || n.far; - r !== n.far && (n.far = r, n.updateProjectionMatrix()), Kr.setFromMatrixPosition(e.matrixWorld), n.position.copy(Kr), xc.copy(n.position), xc.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(xc), n.updateMatrixWorld(), i.makeTranslation(-Kr.x, -Kr.y, -Kr.z), lf.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(lf, n.coordinateSystem, n.reversedDepth); + r !== n.far && (n.far = r, n.updateProjectionMatrix()), $r.setFromMatrixPosition(e.matrixWorld), n.position.copy($r), xc.copy(n.position), xc.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(xc), n.updateMatrixWorld(), i.makeTranslation(-$r.x, -$r.y, -$r.z), af.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(af, n.coordinateSystem, n.reversedDepth); } } class Fv extends Cl { @@ -15904,7 +15904,7 @@ class Fv extends Cl { * @param {number} [decay=2] - The amount the light dims along the distance of the light. */ constructor(e, t, n = 0, i = 2) { - super(e, t), this.isPointLight = !0, this.type = "PointLight", this.distance = n, this.decay = i, this.shadow = new Ov(); + super(e, t), this.isPointLight = !0, this.type = "PointLight", this.distance = n, this.decay = i, this.shadow = new kv(); } /** * The light's power. Power is the luminous power of the light measured in lumens (lm). @@ -15925,7 +15925,7 @@ class Fv extends Cl { return super.copy(e, t), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this; } } -class Rs extends Em { +class Ls extends Em { /** * Constructs a new orthographic camera. * @@ -15989,15 +15989,15 @@ class Rs extends Em { 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; } } -class zv extends zu { +class zv extends Fu { /** * Constructs a new directional light shadow. */ constructor() { - super(new Rs(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = !0; + super(new Ls(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = !0; } } -class ur extends Cl { +class dr extends Cl { /** * Constructs a new directional light. * @@ -16005,7 +16005,7 @@ class ur extends Cl { * @param {number} [intensity=1] - The light's strength/intensity. */ constructor(e, t) { - super(e, t), this.isDirectionalLight = !0, this.type = "DirectionalLight", this.position.copy(St.DEFAULT_UP), this.updateMatrix(), this.target = new St(), this.shadow = new zv(); + super(e, t), this.isDirectionalLight = !0, this.type = "DirectionalLight", this.position.copy(wt.DEFAULT_UP), this.updateMatrix(), this.target = new wt(), this.shadow = new zv(); } dispose() { this.shadow.dispose(); @@ -16025,7 +16025,7 @@ class _l extends Cl { super(e, t), this.isAmbientLight = !0, this.type = "AmbientLight"; } } -class bo { +class yo { /** * Extracts the base URL from the given URL. * @@ -16050,7 +16050,7 @@ class bo { } } const vc = /* @__PURE__ */ new WeakMap(); -class Hv extends Ps { +class Hv extends Rs { /** * Constructs a new image bitmap loader. * @@ -16174,8 +16174,8 @@ class Gv { return e; } } -const Hu = "\\[\\]\\.:\\/", Wv = new RegExp("[" + Hu + "]", "g"), Vu = "[^" + Hu + "]", Xv = "[^" + Hu.replace("\\.", "") + "]", jv = /* @__PURE__ */ /((?:WC+[\/:])*)/.source.replace("WC", Vu), qv = /* @__PURE__ */ /(WCOD+)?/.source.replace("WCOD", Xv), Zv = /* @__PURE__ */ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", Vu), Yv = /* @__PURE__ */ /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", Vu), Kv = new RegExp( - "^" + jv + qv + Zv + Yv + "$" +const zu = "\\[\\]\\.:\\/", Wv = new RegExp("[" + zu + "]", "g"), Hu = "[^" + zu + "]", Xv = "[^" + zu.replace("\\.", "") + "]", jv = /* @__PURE__ */ /((?:WC+[\/:])*)/.source.replace("WC", Hu), Zv = /* @__PURE__ */ /(WCOD+)?/.source.replace("WCOD", Xv), qv = /* @__PURE__ */ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", Hu), Yv = /* @__PURE__ */ /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", Hu), Kv = new RegExp( + "^" + jv + Zv + qv + Yv + "$" ), $v = ["material", "materials", "bones", "map"]; class Jv { constructor(e, t, n) { @@ -16525,8 +16525,8 @@ ht.prototype.SetterByBindingTypeAndVersioning = [ ht.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate ] ]; -const cf = /* @__PURE__ */ new ze(); -class Es { +const lf = /* @__PURE__ */ new ze(); +class Ts { /** * Constructs a new raycaster. * @@ -16536,7 +16536,7 @@ class Es { * @param {number} [far=Infinity] - All results returned are closer than far. Far can't be lower than near. */ constructor(e, t, n = 0, i = 1 / 0) { - this.ray = new Qi(e, t), this.near = n, this.far = i, this.camera = null, this.layers = new Du(), this.params = { + this.ray = new Qi(e, t), this.near = n, this.far = i, this.camera = null, this.layers = new Lu(), this.params = { Mesh: {}, Line: { threshold: 1 }, LOD: {}, @@ -16570,7 +16570,7 @@ class Es { * @return {Raycaster} A reference to this raycaster. */ setFromXRController(e) { - return cf.identity().extractRotation(e.matrixWorld), this.ray.origin.setFromMatrixPosition(e.matrixWorld), this.ray.direction.set(0, 0, -1).applyMatrix4(cf), this; + return lf.identity().extractRotation(e.matrixWorld), this.ray.origin.setFromMatrixPosition(e.matrixWorld), this.ray.direction.set(0, 0, -1).applyMatrix4(lf), this; } /** * The intersection point of a raycaster intersection test. @@ -16608,7 +16608,7 @@ class Es { * @return {Array} An array holding the intersection points. */ intersectObject(e, t = !0, n = []) { - return Qh(e, this, n, t), n.sort(hf), n; + return Jh(e, this, n, t), n.sort(cf), n; } /** * Checks all intersection between the ray and the objects with or without @@ -16622,22 +16622,22 @@ class Es { */ intersectObjects(e, t = !0, n = []) { for (let i = 0, r = e.length; i < r; i++) - Qh(e[i], this, n, t); - return n.sort(hf), n; + Jh(e[i], this, n, t); + return n.sort(cf), n; } } -function hf(s, e) { +function cf(s, e) { return s.distance - e.distance; } -function Qh(s, e, t, n) { +function Jh(s, e, t, n) { let i = !0; if (s.layers.test(e.layers) && s.raycast(e, t) === !1 && (i = !1), i === !0 && n === !0) { const r = s.children; for (let o = 0, a = r.length; o < a; o++) - Qh(r[o], e, t, !0); + Jh(r[o], e, t, !0); } } -class uf { +class hf { /** * Constructs a new spherical. * @@ -16675,7 +16675,7 @@ class uf { * @return {Spherical} A reference to this spherical. */ makeSafe() { - return this.phi = Ze(this.phi, 1e-6, Math.PI - 1e-6), this; + return this.phi = qe(this.phi, 1e-6, Math.PI - 1e-6), this; } /** * Sets the spherical components from the given vector which is assumed to hold @@ -16696,7 +16696,7 @@ class uf { * @return {Spherical} A reference to this spherical. */ setFromCartesianCoords(e, t, n) { - return this.radius = Math.sqrt(e * e + t * t + n * n), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, n), this.phi = Math.acos(Ze(t / this.radius, -1, 1))), this; + return this.radius = Math.sqrt(e * e + t * t + n * n), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, n), this.phi = Math.acos(qe(t / this.radius, -1, 1))), this; } /** * Returns a new spherical with copied values from this instance. @@ -16707,7 +16707,7 @@ class uf { return new this.constructor().copy(this); } } -const df = /* @__PURE__ */ new P(), ya = /* @__PURE__ */ new P(), Qs = /* @__PURE__ */ new P(), er = /* @__PURE__ */ new P(), bc = /* @__PURE__ */ new P(), Qv = /* @__PURE__ */ new P(), e1 = /* @__PURE__ */ new P(); +const uf = /* @__PURE__ */ new P(), ya = /* @__PURE__ */ new P(), er = /* @__PURE__ */ new P(), tr = /* @__PURE__ */ new P(), bc = /* @__PURE__ */ new P(), Qv = /* @__PURE__ */ new P(), e1 = /* @__PURE__ */ new P(); class Hn { /** * Constructs a new line segment. @@ -16789,10 +16789,10 @@ class Hn { * @return {number} The point parameter. */ closestPointToPointParameter(e, t) { - df.subVectors(e, this.start), ya.subVectors(this.end, this.start); + uf.subVectors(e, this.start), ya.subVectors(this.end, this.start); const n = ya.dot(ya); - let r = ya.dot(df) / n; - return t && (r = Ze(r, 0, 1)), r; + let r = ya.dot(uf) / n; + return t && (r = qe(r, 0, 1)), r; } /** * Returns the closest point on the line for a given point. @@ -16818,22 +16818,22 @@ class Hn { const i = 10000000000000001e-32; let r, o; const a = this.start, l = e.start, c = this.end, h = e.end; - Qs.subVectors(c, a), er.subVectors(h, l), bc.subVectors(a, l); - const u = Qs.dot(Qs), d = er.dot(er), f = er.dot(bc); + er.subVectors(c, a), tr.subVectors(h, l), bc.subVectors(a, l); + const u = er.dot(er), d = tr.dot(tr), f = tr.dot(bc); if (u <= i && d <= i) return t.copy(a), n.copy(l), t.sub(n), t.dot(t); if (u <= i) - r = 0, o = f / d, o = Ze(o, 0, 1); + r = 0, o = f / d, o = qe(o, 0, 1); else { - const p = Qs.dot(bc); + const g = er.dot(bc); if (d <= i) - o = 0, r = Ze(-p / u, 0, 1); + o = 0, r = qe(-g / u, 0, 1); else { - const g = Qs.dot(er), x = u * d - g * g; - x !== 0 ? r = Ze((g * f - p * d) / x, 0, 1) : r = 0, o = (g * r + f) / d, o < 0 ? (o = 0, r = Ze(-p / u, 0, 1)) : o > 1 && (o = 1, r = Ze((g - p) / u, 0, 1)); + const p = er.dot(tr), x = u * d - p * p; + x !== 0 ? r = qe((p * f - g * d) / x, 0, 1) : r = 0, o = (p * r + f) / d, o < 0 ? (o = 0, r = qe(-g / u, 0, 1)) : o > 1 && (o = 1, r = qe((p - g) / u, 0, 1)); } } - return t.copy(a).add(Qs.multiplyScalar(r)), n.copy(l).add(er.multiplyScalar(o)), t.sub(n), t.dot(t); + return t.copy(a).add(er.multiplyScalar(r)), n.copy(l).add(tr.multiplyScalar(o)), t.sub(n), t.dot(t); } /** * Applies a 4x4 transformation matrix to this line segment. @@ -16862,7 +16862,7 @@ class Hn { return new this.constructor().copy(this); } } -class t1 extends As { +class t1 extends Cs { /** * Constructs a new controls instance. * @@ -16905,32 +16905,32 @@ class t1 extends As { update() { } } -function ff(s, e, t, n) { +function df(s, e, t, n) { const i = n1(n); switch (t) { // https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml case mm: return s * e; + case Su: + return s * e / i.components * i.byteLength; case Eu: return s * e / i.components * i.byteLength; case Tu: - return s * e / i.components * i.byteLength; - case Au: return s * e * 2 / i.components * i.byteLength; - case Cu: + case Au: return s * e * 2 / i.components * i.byteLength; case gm: return s * e * 3 / i.components * i.byteLength; case xn: return s * e * 4 / i.components * i.byteLength; - case Pu: + case Cu: return s * e * 4 / i.components * i.byteLength; // https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/ + case el: case tl: - case nl: return Math.floor((s + 3) / 4) * Math.floor((e + 3) / 4) * 8; + case nl: case il: - case sl: return Math.floor((s + 3) / 4) * Math.floor((e + 3) / 4) * 16; // https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/ case bh: @@ -16968,11 +16968,11 @@ function ff(s, e, t, n) { return Math.floor((s + 9) / 10) * Math.floor((e + 5) / 6) * 16; case Nh: return Math.floor((s + 9) / 10) * Math.floor((e + 7) / 8) * 16; - case kh: - return Math.floor((s + 9) / 10) * Math.floor((e + 9) / 10) * 16; case Uh: - return Math.floor((s + 11) / 12) * Math.floor((e + 9) / 10) * 16; + return Math.floor((s + 9) / 10) * Math.floor((e + 9) / 10) * 16; case Oh: + return Math.floor((s + 11) / 12) * Math.floor((e + 9) / 10) * 16; + case kh: return Math.floor((s + 11) / 12) * Math.floor((e + 11) / 12) * 16; // https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/ case Fh: @@ -16996,15 +16996,15 @@ function n1(s) { case Jn: case um: return { byteLength: 1, components: 1 }; - case wo: + case So: case dm: - case Un: + case On: return { byteLength: 2, components: 1 }; + case Mu: case wu: - case Su: return { byteLength: 2, components: 4 }; case Ms: - case Mu: + case _u: case $n: return { byteLength: 4, components: 1 }; case fm: @@ -17014,10 +17014,10 @@ function n1(s) { throw new Error(`Unknown texture type ${s}.`); } typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { - revision: Do + revision: Io } })); -typeof window < "u" && (window.__THREE__ ? He("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = Do); -function qm() { +typeof window < "u" && (window.__THREE__ ? He("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = Io); +function Zm() { let s = null, e = !1, t = null, n = null; function i(r, o) { t(r, o), n = s.requestAnimationFrame(i); @@ -17076,24 +17076,24 @@ function i1(s) { if (s.bindBuffer(c, a), u.length === 0) s.bufferSubData(c, 0, h); else { - u.sort((f, p) => f.start - p.start); + u.sort((f, g) => f.start - g.start); let d = 0; for (let f = 1; f < u.length; f++) { - const p = u[d], g = u[f]; - g.start <= p.start + p.count + 1 ? p.count = Math.max( - p.count, - g.start + g.count - p.start - ) : (++d, u[d] = g); + const g = u[d], p = u[f]; + p.start <= g.start + g.count + 1 ? g.count = Math.max( + g.count, + p.start + p.count - g.start + ) : (++d, u[d] = p); } u.length = d + 1; - for (let f = 0, p = u.length; f < p; f++) { - const g = u[f]; + for (let f = 0, g = u.length; f < g; f++) { + const p = u[f]; s.bufferSubData( c, - g.start * h.BYTES_PER_ELEMENT, + p.start * h.BYTES_PER_ELEMENT, h, - g.start, - g.count + p.start, + p.count ); } l.clearUpdateRanges(); @@ -17630,7 +17630,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } vec4 sRGBTransferOETF( 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 ); -}`, k1 = `#ifdef USE_ENVMAP +}`, U1 = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -17659,7 +17659,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`, U1 = `#ifdef USE_ENVMAP +#endif`, O1 = `#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -17668,7 +17668,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else uniform sampler2D envMap; #endif -#endif`, O1 = `#ifdef USE_ENVMAP +#endif`, k1 = `#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -17742,9 +17742,9 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { }`, j1 = `#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`, q1 = `LambertMaterial material; +#endif`, Z1 = `LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`, Z1 = `varying vec3 vViewPosition; +material.specularStrength = specularStrength;`, q1 = `varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -18774,18 +18774,18 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`, Nb = `#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`, kb = `#ifdef DITHERING +#endif`, Ub = `#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`, Ub = `float roughnessFactor = roughness; +#endif`, Ob = `float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`, Ob = `#ifdef USE_ROUGHNESSMAP +#endif`, kb = `#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`, Fb = `#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; @@ -19126,13 +19126,13 @@ gl_Position = projectionMatrix * mvPosition;`, Nb = `#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`, qb = `float specularStrength; +#endif`, Zb = `float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`, Zb = `#ifdef USE_SPECULARMAP +#endif`, qb = `#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`, Yb = `#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); @@ -20656,7 +20656,7 @@ void main() { #include #include #include -}`, ky = `uniform vec3 diffuse; +}`, Uy = `uniform vec3 diffuse; uniform float opacity; #include #include @@ -20714,9 +20714,9 @@ void main() { emissivemap_pars_fragment: I1, colorspace_fragment: B1, colorspace_pars_fragment: N1, - envmap_fragment: k1, - envmap_common_pars_fragment: U1, - envmap_pars_fragment: O1, + envmap_fragment: U1, + envmap_common_pars_fragment: O1, + envmap_pars_fragment: k1, envmap_pars_vertex: F1, envmap_physical_pars_fragment: K1, envmap_vertex: z1, @@ -20726,8 +20726,8 @@ void main() { fog_pars_fragment: W1, gradientmap_pars_fragment: X1, lightmap_pars_fragment: j1, - lights_lambert_fragment: q1, - lights_lambert_pars_fragment: Z1, + lights_lambert_fragment: Z1, + lights_lambert_pars_fragment: q1, lights_pars_begin: Y1, lights_toon_fragment: $1, lights_toon_pars_fragment: J1, @@ -20768,9 +20768,9 @@ void main() { premultiplied_alpha_fragment: Ib, project_vertex: Bb, dithering_fragment: Nb, - dithering_pars_fragment: kb, - roughnessmap_fragment: Ub, - roughnessmap_pars_fragment: Ob, + dithering_pars_fragment: Ub, + roughnessmap_fragment: Ob, + roughnessmap_pars_fragment: kb, shadowmap_pars_fragment: Fb, shadowmap_pars_vertex: zb, shadowmap_vertex: Hb, @@ -20779,8 +20779,8 @@ void main() { skinning_pars_vertex: Wb, skinning_vertex: Xb, skinnormal_vertex: jb, - specularmap_fragment: qb, - specularmap_pars_fragment: Zb, + specularmap_fragment: Zb, + specularmap_pars_fragment: qb, tonemapping_fragment: Yb, tonemapping_pars_fragment: Kb, transmission_fragment: $b, @@ -20822,10 +20822,10 @@ void main() { shadow_vert: Iy, shadow_frag: By, sprite_vert: Ny, - sprite_frag: ky + sprite_frag: Uy }, Pe = { common: { - diffuse: { value: /* @__PURE__ */ new Fe(16777215) }, + diffuse: { value: /* @__PURE__ */ new Oe(16777215) }, opacity: { value: 1 }, map: { value: null }, mapTransform: { value: /* @__PURE__ */ new $e() }, @@ -20895,7 +20895,7 @@ void main() { fogDensity: { value: 25e-5 }, fogNear: { value: 1 }, fogFar: { value: 2e3 }, - fogColor: { value: /* @__PURE__ */ new Fe(16777215) } + fogColor: { value: /* @__PURE__ */ new Oe(16777215) } }, lights: { ambientLightColor: { value: [] }, @@ -20965,7 +20965,7 @@ void main() { ltc_2: { value: null } }, points: { - diffuse: { value: /* @__PURE__ */ new Fe(16777215) }, + diffuse: { value: /* @__PURE__ */ new Oe(16777215) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, @@ -20976,7 +20976,7 @@ void main() { uvTransform: { value: /* @__PURE__ */ new $e() } }, sprite: { - diffuse: { value: /* @__PURE__ */ new Fe(16777215) }, + diffuse: { value: /* @__PURE__ */ new Oe(16777215) }, opacity: { value: 1 }, center: { value: /* @__PURE__ */ new ce(0.5, 0.5) }, rotation: { value: 0 }, @@ -21013,7 +21013,7 @@ void main() { Pe.fog, Pe.lights, { - emissive: { value: /* @__PURE__ */ new Fe(0) } + emissive: { value: /* @__PURE__ */ new Oe(0) } } ]), vertexShader: Qe.meshlambert_vert, @@ -21033,8 +21033,8 @@ void main() { Pe.fog, Pe.lights, { - emissive: { value: /* @__PURE__ */ new Fe(0) }, - specular: { value: /* @__PURE__ */ new Fe(1118481) }, + emissive: { value: /* @__PURE__ */ new Oe(0) }, + specular: { value: /* @__PURE__ */ new Oe(1118481) }, shininess: { value: 30 } } ]), @@ -21056,7 +21056,7 @@ void main() { Pe.fog, Pe.lights, { - emissive: { value: /* @__PURE__ */ new Fe(0) }, + emissive: { value: /* @__PURE__ */ new Oe(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 } @@ -21078,7 +21078,7 @@ void main() { Pe.fog, Pe.lights, { - emissive: { value: /* @__PURE__ */ new Fe(0) } + emissive: { value: /* @__PURE__ */ new Oe(0) } } ]), vertexShader: Qe.meshtoon_vert, @@ -21202,7 +21202,7 @@ void main() { Pe.lights, Pe.fog, { - color: { value: /* @__PURE__ */ new Fe(0) }, + color: { value: /* @__PURE__ */ new Oe(0) }, opacity: { value: 1 } } ]), @@ -21233,7 +21233,7 @@ ri.physical = { iridescenceThicknessMap: { value: null }, iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new $e() }, sheen: { value: 0 }, - sheenColor: { value: /* @__PURE__ */ new Fe(0) }, + sheenColor: { value: /* @__PURE__ */ new Oe(0) }, sheenColorMap: { value: null }, sheenColorMapTransform: { value: /* @__PURE__ */ new $e() }, sheenRoughness: { value: 1 }, @@ -21248,8 +21248,8 @@ ri.physical = { thicknessMap: { value: null }, thicknessMapTransform: { value: /* @__PURE__ */ new $e() }, attenuationDistance: { value: 0 }, - attenuationColor: { value: /* @__PURE__ */ new Fe(0) }, - specularColor: { value: /* @__PURE__ */ new Fe(1, 1, 1) }, + attenuationColor: { value: /* @__PURE__ */ new Oe(0) }, + specularColor: { value: /* @__PURE__ */ new Oe(1, 1, 1) }, specularColorMap: { value: null }, specularColorMapTransform: { value: /* @__PURE__ */ new $e() }, specularIntensity: { value: 1 }, @@ -21263,28 +21263,28 @@ ri.physical = { vertexShader: Qe.meshphysical_vert, fragmentShader: Qe.meshphysical_frag }; -const _a = { r: 0, b: 0, g: 0 }, as = /* @__PURE__ */ new wn(), Uy = /* @__PURE__ */ new ze(); -function Oy(s, e, t, n, i, r, o) { - const a = new Fe(0); +const _a = { r: 0, b: 0, g: 0 }, as = /* @__PURE__ */ new wn(), Oy = /* @__PURE__ */ new ze(); +function ky(s, e, t, n, i, r, o) { + const a = new Oe(0); let l = r === !0 ? 0 : 1, c, h, u = null, d = 0, f = null; - function p(v) { + function g(v) { let y = v.isScene === !0 ? v.background : null; return y && y.isTexture && (y = (v.backgroundBlurriness > 0 ? t : e).get(y)), y; } - function g(v) { + function p(v) { let y = !1; - const M = p(v); + const M = g(v); M === null ? m(a, l) : M && M.isColor && (m(M, 1), y = !0); const E = s.xr.getEnvironmentBlendMode(); E === "additive" ? n.buffers.color.setClear(0, 0, 0, 1, o) : E === "alpha-blend" && n.buffers.color.setClear(0, 0, 0, 0, o), (s.autoClear || y) && (n.buffers.depth.setTest(!0), n.buffers.depth.setMask(!0), n.buffers.color.setMask(!0), s.clear(s.autoClearColor, s.autoClearDepth, s.autoClearStencil)); } function x(v, y) { - const M = p(y); + const M = g(y); M && (M.isCubeTexture || M.mapping === Al) ? (h === void 0 && (h = new dt( new $i(1, 1, 1), - new Ut({ + new Ot({ name: "BackgroundCubeMaterial", - uniforms: Sr(ri.backgroundCube.uniforms), + uniforms: Er(ri.backgroundCube.uniforms), vertexShader: ri.backgroundCube.vertexShader, fragmentShader: ri.backgroundCube.fragmentShader, side: un, @@ -21299,11 +21299,11 @@ function Oy(s, e, t, n, i, r, o) { get: function() { return this.uniforms.envMap.value; } - }), i.update(h)), as.copy(y.backgroundRotation), as.x *= -1, as.y *= -1, as.z *= -1, M.isCubeTexture && M.isRenderTargetTexture === !1 && (as.y *= -1, as.z *= -1), h.material.uniforms.envMap.value = M, h.material.uniforms.flipEnvMap.value = M.isCubeTexture && M.isRenderTargetTexture === !1 ? -1 : 1, h.material.uniforms.backgroundBlurriness.value = y.backgroundBlurriness, h.material.uniforms.backgroundIntensity.value = y.backgroundIntensity, h.material.uniforms.backgroundRotation.value.setFromMatrix4(Uy.makeRotationFromEuler(as)), h.material.toneMapped = st.getTransfer(M.colorSpace) !== lt, (u !== M || d !== M.version || f !== s.toneMapping) && (h.material.needsUpdate = !0, u = M, d = M.version, f = s.toneMapping), h.layers.enableAll(), v.unshift(h, h.geometry, h.material, 0, 0, null)) : M && M.isTexture && (c === void 0 && (c = new dt( - new ko(2, 2), - new Ut({ + }), i.update(h)), as.copy(y.backgroundRotation), as.x *= -1, as.y *= -1, as.z *= -1, M.isCubeTexture && M.isRenderTargetTexture === !1 && (as.y *= -1, as.z *= -1), h.material.uniforms.envMap.value = M, h.material.uniforms.flipEnvMap.value = M.isCubeTexture && M.isRenderTargetTexture === !1 ? -1 : 1, h.material.uniforms.backgroundBlurriness.value = y.backgroundBlurriness, h.material.uniforms.backgroundIntensity.value = y.backgroundIntensity, h.material.uniforms.backgroundRotation.value.setFromMatrix4(Oy.makeRotationFromEuler(as)), h.material.toneMapped = st.getTransfer(M.colorSpace) !== lt, (u !== M || d !== M.version || f !== s.toneMapping) && (h.material.needsUpdate = !0, u = M, d = M.version, f = s.toneMapping), h.layers.enableAll(), v.unshift(h, h.geometry, h.material, 0, 0, null)) : M && M.isTexture && (c === void 0 && (c = new dt( + new Uo(2, 2), + new Ot({ name: "BackgroundMaterial", - uniforms: Sr(ri.background.uniforms), + uniforms: Er(ri.background.uniforms), vertexShader: ri.background.vertexShader, fragmentShader: ri.background.fragmentShader, side: Fn, @@ -21337,7 +21337,7 @@ function Oy(s, e, t, n, i, r, o) { setClearAlpha: function(v) { l = v, m(a, l); }, - render: g, + render: p, addToRenderList: x, dispose: b }; @@ -21348,7 +21348,7 @@ function Fy(s, e) { function a(S, D, C, B, w) { let F = !1; const W = u(B, C, D); - r !== W && (r = W, c(r.object)), F = f(S, B, C, w), F && p(S, B, C, w), w !== null && e.update(w, s.ELEMENT_ARRAY_BUFFER), (F || o) && (o = !1, y(S, D, C, B), w !== null && s.bindBuffer(s.ELEMENT_ARRAY_BUFFER, e.get(w).buffer)); + r !== W && (r = W, c(r.object)), F = f(S, B, C, w), F && g(S, B, C, w), w !== null && e.update(w, s.ELEMENT_ARRAY_BUFFER), (F || o) && (o = !1, y(S, D, C, B), w !== null && s.bindBuffer(s.ELEMENT_ARRAY_BUFFER, e.get(w).buffer)); } function l() { return s.createVertexArray(); @@ -21398,7 +21398,7 @@ function Fy(s, e) { } return r.attributesNum !== W || r.index !== B; } - function p(S, D, C, B) { + function g(S, D, C, B) { const w = {}, F = D.attributes; let W = 0; const j = C.getAttributes(); @@ -21411,7 +21411,7 @@ function Fy(s, e) { } r.attributes = w, r.attributesNum = W, r.index = B; } - function g() { + function p() { const S = r.newAttributes; for (let D = 0, C = S.length; D < C; D++) S[D] = 0; @@ -21432,18 +21432,18 @@ function Fy(s, e) { W === !0 ? s.vertexAttribIPointer(S, D, C, w, F) : s.vertexAttribPointer(S, D, C, B, w, F); } function y(S, D, C, B) { - g(); + p(); const w = B.attributes, F = C.getAttributes(), W = D.defaultAttributeValues; for (const j in F) { const $ = F[j]; if ($.location >= 0) { - let Z = w[j]; - if (Z === void 0 && (j === "instanceMatrix" && S.instanceMatrix && (Z = S.instanceMatrix), j === "instanceColor" && S.instanceColor && (Z = S.instanceColor)), Z !== void 0) { - const re = Z.normalized, X = Z.itemSize, Y = e.get(Z); + let q = w[j]; + if (q === void 0 && (j === "instanceMatrix" && S.instanceMatrix && (q = S.instanceMatrix), j === "instanceColor" && S.instanceColor && (q = S.instanceColor)), q !== void 0) { + const re = q.normalized, X = q.itemSize, Y = e.get(q); if (Y === void 0) continue; - const ge = Y.buffer, pe = Y.type, de = Y.bytesPerElement, ie = pe === s.INT || pe === s.UNSIGNED_INT || Z.gpuType === Mu; - if (Z.isInterleavedBufferAttribute) { - const he = Z.data, fe = he.stride, ve = Z.offset; + const ge = Y.buffer, pe = Y.type, de = Y.bytesPerElement, ie = pe === s.INT || pe === s.UNSIGNED_INT || q.gpuType === _u; + if (q.isInterleavedBufferAttribute) { + const he = q.data, fe = he.stride, ve = q.offset; if (he.isInstancedInterleavedBuffer) { for (let we = 0; we < $.locationSize; we++) m($.location + we, he.meshPerAttribute); @@ -21463,10 +21463,10 @@ function Fy(s, e) { ie ); } else { - if (Z.isInstancedBufferAttribute) { + if (q.isInstancedBufferAttribute) { for (let he = 0; he < $.locationSize; he++) - m($.location + he, Z.meshPerAttribute); - S.isInstancedMesh !== !0 && B._maxInstanceCount === void 0 && (B._maxInstanceCount = Z.meshPerAttribute * Z.count); + m($.location + he, q.meshPerAttribute); + S.isInstancedMesh !== !0 && B._maxInstanceCount === void 0 && (B._maxInstanceCount = q.meshPerAttribute * q.count); } else for (let he = 0; he < $.locationSize; he++) x($.location + he); @@ -21550,7 +21550,7 @@ function Fy(s, e) { dispose: M, releaseStatesOfGeometry: E, releaseStatesOfProgram: A, - initAttributes: g, + initAttributes: p, enableAttribute: x, disableUnusedAttributes: b }; @@ -21570,22 +21570,22 @@ function zy(s, e, t) { if (u === 0) return; e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n, c, 0, h, 0, u); let f = 0; - for (let p = 0; p < u; p++) - f += h[p]; + for (let g = 0; g < u; g++) + f += h[g]; t.update(f, n, 1); } function l(c, h, u, d) { if (u === 0) return; const f = e.get("WEBGL_multi_draw"); if (f === null) - for (let p = 0; p < c.length; p++) - o(c[p], h[p], d[p]); + for (let g = 0; g < c.length; g++) + o(c[g], h[g], d[g]); else { f.multiDrawArraysInstancedWEBGL(n, c, 0, h, 0, d, 0, u); - let p = 0; - for (let g = 0; g < u; g++) - p += h[g] * d[g]; - t.update(p, n, 1); + let g = 0; + for (let p = 0; p < u; p++) + g += h[p] * d[p]; + t.update(g, n, 1); } } this.setMode = i, this.render = r, this.renderInstances = o, this.renderMultiDraw = a, this.renderMultiDrawInstances = l; @@ -21605,7 +21605,7 @@ function Hy(s, e, t, n) { return !(A !== xn && n.convert(A) !== s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT)); } function a(A) { - const R = A === Un && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float")); + const R = A === On && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float")); return !(A !== Jn && n.convert(A) !== s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513) A !== $n && !R); } @@ -21620,7 +21620,7 @@ function Hy(s, e, t, n) { let c = t.precision !== void 0 ? t.precision : "highp"; const h = l(c); h !== c && (He("WebGLRenderer:", c, "not supported, using", h, "instead."), c = h); - const u = t.logarithmicDepthBuffer === !0, d = t.reversedDepthBuffer === !0 && e.has("EXT_clip_control"), f = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS), p = s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS), g = s.getParameter(s.MAX_TEXTURE_SIZE), x = s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE), m = s.getParameter(s.MAX_VERTEX_ATTRIBS), b = s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS), v = s.getParameter(s.MAX_VARYING_VECTORS), y = s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS), M = p > 0, E = s.getParameter(s.MAX_SAMPLES); + const u = t.logarithmicDepthBuffer === !0, d = t.reversedDepthBuffer === !0 && e.has("EXT_clip_control"), f = s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS), g = s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS), p = s.getParameter(s.MAX_TEXTURE_SIZE), x = s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE), m = s.getParameter(s.MAX_VERTEX_ATTRIBS), b = s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS), v = s.getParameter(s.MAX_VARYING_VECTORS), y = s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS), M = g > 0, E = s.getParameter(s.MAX_SAMPLES); return { isWebGL2: !0, // keeping this for backwards compatibility @@ -21632,8 +21632,8 @@ function Hy(s, e, t, n) { logarithmicDepthBuffer: u, reversedDepthBuffer: d, maxTextures: f, - maxVertexTextures: p, - maxTextureSize: g, + maxVertexTextures: g, + maxTextureSize: p, maxCubemapSize: x, maxAttributes: m, maxVertexUniforms: b, @@ -21659,40 +21659,40 @@ function Vy(s) { }, this.setGlobalState = function(u, d) { t = h(u, d, 0); }, this.setState = function(u, d, f) { - const p = u.clippingPlanes, g = u.clipIntersection, x = u.clipShadows, m = s.get(u); - if (!i || p === null || p.length === 0 || r && !x) + const g = u.clippingPlanes, p = u.clipIntersection, x = u.clipShadows, m = s.get(u); + if (!i || g === null || g.length === 0 || r && !x) r ? h(null) : c(); else { const b = r ? 0 : n, v = b * 4; let y = m.clippingState || null; - l.value = y, y = h(p, d, v, f); + l.value = y, y = h(g, d, v, f); for (let M = 0; M !== v; ++M) y[M] = t[M]; - m.clippingState = y, this.numIntersection = g ? this.numPlanes : 0, this.numPlanes += b; + m.clippingState = y, this.numIntersection = p ? this.numPlanes : 0, this.numPlanes += b; } }; function c() { l.value !== t && (l.value = t, l.needsUpdate = n > 0), e.numPlanes = n, e.numIntersection = 0; } - function h(u, d, f, p) { - const g = u !== null ? u.length : 0; + function h(u, d, f, g) { + const p = u !== null ? u.length : 0; let x = null; - if (g !== 0) { - if (x = l.value, p !== !0 || x === null) { - const m = f + g * 4, b = d.matrixWorldInverse; + if (p !== 0) { + if (x = l.value, g !== !0 || x === null) { + const m = f + p * 4, b = d.matrixWorldInverse; a.getNormalMatrix(b), (x === null || x.length < m) && (x = new Float32Array(m)); - for (let v = 0, y = f; v !== g; ++v, y += 4) + for (let v = 0, y = f; v !== p; ++v, y += 4) o.copy(u[v]).applyMatrix4(b, a), o.normal.toArray(x, y), x[y + 3] = o.constant; } l.value = x, l.needsUpdate = !0; } - return e.numPlanes = g, e.numIntersection = 0, x; + return e.numPlanes = p, e.numIntersection = 0, x; } } function Gy(s) { let e = /* @__PURE__ */ new WeakMap(); function t(o, a) { - return a === gh ? o.mapping = br : a === xh && (o.mapping = yr), o; + return a === gh ? o.mapping = yr : a === xh && (o.mapping = _r), o; } function n(o) { if (o && o.isTexture) { @@ -21726,10 +21726,10 @@ function Gy(s) { dispose: r }; } -const qi = 4, pf = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], ms = 20, Wy = 256, $r = /* @__PURE__ */ new Rs(), mf = /* @__PURE__ */ new Fe(); +const Zi = 4, ff = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], ms = 20, Wy = 256, Jr = /* @__PURE__ */ new Ls(), pf = /* @__PURE__ */ new Oe(); let yc = null, _c = 0, Mc = 0, wc = !1; const Xy = /* @__PURE__ */ new P(); -class gf { +class mf { /** * Constructs a new PMREM generator. * @@ -21791,14 +21791,14 @@ class gf { * your texture's network fetch for increased concurrency. */ compileCubemapShader() { - this._cubemapMaterial === null && (this._cubemapMaterial = bf(), this._compileMaterial(this._cubemapMaterial)); + this._cubemapMaterial === null && (this._cubemapMaterial = vf(), this._compileMaterial(this._cubemapMaterial)); } /** * 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._equirectMaterial === null && (this._equirectMaterial = vf(), this._compileMaterial(this._equirectMaterial)); + this._equirectMaterial === null && (this._equirectMaterial = xf(), this._compileMaterial(this._equirectMaterial)); } /** * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, @@ -21818,10 +21818,10 @@ class gf { this._lodMeshes[e].geometry.dispose(); } _cleanup(e) { - this._renderer.setRenderTarget(yc, _c, Mc), this._renderer.xr.enabled = wc, e.scissorTest = !1, tr(e, 0, 0, e.width, e.height); + this._renderer.setRenderTarget(yc, _c, Mc), this._renderer.xr.enabled = wc, e.scissorTest = !1, nr(e, 0, 0, e.width, e.height); } _fromTexture(e, t) { - e.mapping === br || e.mapping === yr ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), yc = this._renderer.getRenderTarget(), _c = this._renderer.getActiveCubeFace(), Mc = this._renderer.getActiveMipmapLevel(), wc = this._renderer.xr.enabled, this._renderer.xr.enabled = !1; + e.mapping === yr || e.mapping === _r ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), yc = this._renderer.getRenderTarget(), _c = this._renderer.getActiveCubeFace(), Mc = this._renderer.getActiveMipmapLevel(), wc = this._renderer.xr.enabled, this._renderer.xr.enabled = !1; const n = t || this._allocateTargets(); return this._textureToCubeUV(e, n), this._applyPMREM(n), this._cleanup(n), n; } @@ -21830,54 +21830,54 @@ class gf { magFilter: Yt, minFilter: Yt, generateMipmaps: !1, - type: Un, + type: On, format: xn, - colorSpace: Bt, + colorSpace: It, depthBuffer: !1 - }, i = xf(e, t, n); + }, i = gf(e, t, n); if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) { - this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = xf(e, t, n); + this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = gf(e, t, n); const { _lodMax: r } = this; - ({ lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas } = jy(r)), this._blurMaterial = Zy(r, e, t), this._ggxMaterial = qy(r, e, t); + ({ lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas } = jy(r)), this._blurMaterial = qy(r, e, t), this._ggxMaterial = Zy(r, e, t); } return i; } _compileMaterial(e) { const t = new dt(new ut(), e); - this._renderer.compile(t, $r); + this._renderer.compile(t, Jr); } _sceneToCubeUV(e, t, n, i, r) { const l = new nn(90, 1, t, n), c = [1, -1, 1, 1, 1, 1], h = [1, 1, 1, -1, -1, -1], u = this._renderer, d = u.autoClear, f = u.toneMapping; - u.getClearColor(mf), u.toneMapping = Ki, u.autoClear = !1, u.state.buffers.depth.getReversed() && (u.setRenderTarget(i), u.clearDepth(), u.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new dt( + u.getClearColor(pf), u.toneMapping = Ki, u.autoClear = !1, u.state.buffers.depth.getReversed() && (u.setRenderTarget(i), u.clearDepth(), u.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new dt( new $i(), - new Zt({ + new qt({ name: "PMREM.Background", side: un, depthWrite: !1, depthTest: !1 }) )); - const g = this._backgroundBox, x = g.material; + const p = this._backgroundBox, x = p.material; let m = !1; const b = e.background; - b ? b.isColor && (x.color.copy(b), e.background = null, m = !0) : (x.color.copy(mf), m = !0); + b ? b.isColor && (x.color.copy(b), e.background = null, m = !0) : (x.color.copy(pf), m = !0); for (let v = 0; v < 6; v++) { const y = v % 3; y === 0 ? (l.up.set(0, c[v], 0), l.position.set(r.x, r.y, r.z), l.lookAt(r.x + h[v], r.y, r.z)) : y === 1 ? (l.up.set(0, 0, c[v]), l.position.set(r.x, r.y, r.z), l.lookAt(r.x, r.y + h[v], r.z)) : (l.up.set(0, c[v], 0), l.position.set(r.x, r.y, r.z), l.lookAt(r.x, r.y, r.z + h[v])); const M = this._cubeSize; - tr(i, y * M, v > 2 ? M : 0, M, M), u.setRenderTarget(i), m && u.render(g, l), u.render(e, l); + nr(i, y * M, v > 2 ? M : 0, M, M), u.setRenderTarget(i), m && u.render(p, l), u.render(e, l); } u.toneMapping = f, u.autoClear = d, e.background = b; } _textureToCubeUV(e, t) { - const n = this._renderer, i = e.mapping === br || e.mapping === yr; - i ? (this._cubemapMaterial === null && (this._cubemapMaterial = bf()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = vf()); + const n = this._renderer, i = e.mapping === yr || e.mapping === _r; + i ? (this._cubemapMaterial === null && (this._cubemapMaterial = vf()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = xf()); const r = i ? this._cubemapMaterial : this._equirectMaterial, o = this._lodMeshes[0]; o.material = r; const a = r.uniforms; a.envMap.value = e; const l = this._cubeSize; - tr(t, 0, 0, 3 * l, 2 * l), n.setRenderTarget(t), n.render(o, $r); + nr(t, 0, 0, 3 * l, 2 * l), n.setRenderTarget(t), n.render(o, Jr); } _applyPMREM(e) { const t = this._renderer, n = t.autoClear; @@ -21901,8 +21901,8 @@ class gf { _applyGGXFilter(e, t, n) { const i = this._renderer, r = this._pingPongRenderTarget, o = this._ggxMaterial, a = this._lodMeshes[n]; a.material = o; - const l = o.uniforms, c = n / (this._lodMeshes.length - 1), h = t / (this._lodMeshes.length - 1), u = Math.sqrt(c * c - h * h), d = 0.05 + c * 0.95, f = u * d, { _lodMax: p } = this, g = this._sizeLods[n], x = 3 * g * (n > p - qi ? n - p + qi : 0), m = 4 * (this._cubeSize - g); - l.envMap.value = e.texture, l.roughness.value = f, l.mipInt.value = p - t, tr(r, x, m, 3 * g, 2 * g), i.setRenderTarget(r), i.render(a, $r), l.envMap.value = r.texture, l.roughness.value = 0, l.mipInt.value = p - n, tr(e, x, m, 3 * g, 2 * g), i.setRenderTarget(e), i.render(a, $r); + const l = o.uniforms, c = n / (this._lodMeshes.length - 1), h = t / (this._lodMeshes.length - 1), u = Math.sqrt(c * c - h * h), d = 0.05 + c * 0.95, f = u * d, { _lodMax: g } = this, p = this._sizeLods[n], x = 3 * p * (n > g - Zi ? n - g + Zi : 0), m = 4 * (this._cubeSize - p); + l.envMap.value = e.texture, l.roughness.value = f, l.mipInt.value = g - t, nr(r, x, m, 3 * p, 2 * p), i.setRenderTarget(r), i.render(a, Jr), l.envMap.value = r.texture, l.roughness.value = 0, l.mipInt.value = g - n, nr(e, x, m, 3 * p, 2 * p), i.setRenderTarget(e), i.render(a, Jr); } /** * This is a two-pass Gaussian blur for a cubemap. Normally this is done @@ -21947,33 +21947,33 @@ class gf { ); const h = 3, u = this._lodMeshes[i]; u.material = c; - const d = c.uniforms, f = this._sizeLods[n] - 1, p = isFinite(r) ? Math.PI / (2 * f) : 2 * Math.PI / (2 * ms - 1), g = r / p, x = isFinite(r) ? 1 + Math.floor(h * g) : ms; + const d = c.uniforms, f = this._sizeLods[n] - 1, g = isFinite(r) ? Math.PI / (2 * f) : 2 * Math.PI / (2 * ms - 1), p = r / g, x = isFinite(r) ? 1 + Math.floor(h * p) : ms; x > ms && He(`sigmaRadians, ${r}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${ms}`); const m = []; let b = 0; for (let A = 0; A < ms; ++A) { - const R = A / g, _ = Math.exp(-R * R / 2); + const R = A / p, _ = Math.exp(-R * R / 2); m.push(_), A === 0 ? b += _ : A < x && (b += 2 * _); } for (let A = 0; A < m.length; A++) m[A] = m[A] / b; d.envMap.value = e.texture, d.samples.value = x, d.weights.value = m, d.latitudinal.value = o === "latitudinal", a && (d.poleAxis.value = a); const { _lodMax: v } = this; - d.dTheta.value = p, d.mipInt.value = v - n; - const y = this._sizeLods[i], M = 3 * y * (i > v - qi ? i - v + qi : 0), E = 4 * (this._cubeSize - y); - tr(t, M, E, 3 * y, 2 * y), l.setRenderTarget(t), l.render(u, $r); + d.dTheta.value = g, d.mipInt.value = v - n; + const y = this._sizeLods[i], M = 3 * y * (i > v - Zi ? i - v + Zi : 0), E = 4 * (this._cubeSize - y); + nr(t, M, E, 3 * y, 2 * y), l.setRenderTarget(t), l.render(u, Jr); } } function jy(s) { const e = [], t = [], n = []; let i = s; - const r = s - qi + 1 + pf.length; + const r = s - Zi + 1 + ff.length; for (let o = 0; o < r; o++) { const a = Math.pow(2, i); e.push(a); let l = 1 / a; - o > s - qi ? l = pf[o - s + qi - 1] : o === 0 && (l = 0), t.push(l); - const c = 1 / (a - 2), h = -c, u = 1 + c, d = [h, h, u, h, u, u, h, h, u, u, h, u], f = 6, p = 6, g = 3, x = 2, m = 1, b = new Float32Array(g * p * f), v = new Float32Array(x * p * f), y = new Float32Array(m * p * f); + o > s - Zi ? l = ff[o - s + Zi - 1] : o === 0 && (l = 0), t.push(l); + const c = 1 / (a - 2), h = -c, u = 1 + c, d = [h, h, u, h, u, u, h, h, u, u, h, u], f = 6, g = 6, p = 3, x = 2, m = 1, b = new Float32Array(p * g * f), v = new Float32Array(x * g * f), y = new Float32Array(m * g * f); for (let E = 0; E < f; E++) { const A = E % 3 * 2 / 3 - 1, R = E > 2 ? 0 : -1, _ = [ A, @@ -21995,24 +21995,24 @@ function jy(s) { R + 1, 0 ]; - b.set(_, g * p * E), v.set(d, x * p * E); + b.set(_, p * g * E), v.set(d, x * g * E); const S = [E, E, E, E, E, E]; - y.set(S, m * p * E); + y.set(S, m * g * E); } const M = new ut(); - M.setAttribute("position", new at(b, g)), M.setAttribute("uv", new at(v, x)), M.setAttribute("faceIndex", new at(y, m)), n.push(new dt(M, null)), i > qi && i--; + M.setAttribute("position", new at(b, p)), M.setAttribute("uv", new at(v, x)), M.setAttribute("faceIndex", new at(y, m)), n.push(new dt(M, null)), i > Zi && i--; } return { lodMeshes: n, sizeLods: e, sigmas: t }; } -function xf(s, e, t) { +function gf(s, e, t) { const n = new bn(s, e, t); return n.texture.mapping = Al, n.texture.name = "PMREM.cubeUv", n.scissorTest = !0, n; } -function tr(s, e, t, n, i) { +function nr(s, e, t, n, i) { s.viewport.set(e, t, n, i), s.scissor.set(e, t, n, i); } -function qy(s, e, t) { - return new Ut({ +function Zy(s, e, t) { + return new Ot({ name: "PMREMGGXConvolution", defines: { GGX_SAMPLES: Wy, @@ -22143,9 +22143,9 @@ function qy(s, e, t) { depthWrite: !1 }); } -function Zy(s, e, t) { +function qy(s, e, t) { const n = new Float32Array(ms), i = new P(0, 1, 0); - return new Ut({ + return new Ot({ name: "SphericalGaussianBlur", defines: { n: ms, @@ -22232,8 +22232,8 @@ function Zy(s, e, t) { depthWrite: !1 }); } -function vf() { - return new Ut({ +function xf() { + return new Ot({ name: "EquirectangularToCubeUV", uniforms: { envMap: { value: null } @@ -22267,8 +22267,8 @@ function vf() { depthWrite: !1 }); } -function bf() { - return new Ut({ +function vf() { + return new Ot({ name: "CubemapToCubeUV", uniforms: { envMap: { value: null }, @@ -22365,17 +22365,17 @@ function Yy(s) { let e = /* @__PURE__ */ new WeakMap(), t = null; function n(a) { if (a && a.isTexture) { - const l = a.mapping, c = l === gh || l === xh, h = l === br || l === yr; + const l = a.mapping, c = l === gh || l === xh, h = l === yr || l === _r; if (c || h) { let u = e.get(a); const d = u !== void 0 ? u.texture.pmremVersion : 0; if (a.isRenderTargetTexture && a.pmremVersion !== d) - return t === null && (t = new gf(s)), u = c ? t.fromEquirectangular(a, u) : t.fromCubemap(a, u), u.texture.pmremVersion = a.pmremVersion, e.set(a, u), u.texture; + return t === null && (t = new mf(s)), u = c ? t.fromEquirectangular(a, u) : t.fromCubemap(a, u), u.texture.pmremVersion = a.pmremVersion, e.set(a, u), u.texture; if (u !== void 0) return u.texture; { const f = a.image; - return c && f && f.height > 0 || h && f && i(f) ? (t === null && (t = new gf(s)), u = c ? t.fromEquirectangular(a) : t.fromCubemap(a), u.texture.pmremVersion = a.pmremVersion, e.set(a, u), a.addEventListener("dispose", r), u.texture) : null; + return c && f && f.height > 0 || h && f && i(f) ? (t === null && (t = new mf(s)), u = c ? t.fromEquirectangular(a) : t.fromCubemap(a), u.texture.pmremVersion = a.pmremVersion, e.set(a, u), a.addEventListener("dispose", r), u.texture) : null; } } } @@ -22419,7 +22419,7 @@ function Ky(s) { }, get: function(n) { const i = t(n); - return i === null && Co("WebGLRenderer: " + n + " extension not supported."), i; + return i === null && Po("WebGLRenderer: " + n + " extension not supported."), i; } }; } @@ -22428,8 +22428,8 @@ function $y(s, e, t, n) { function o(u) { const d = u.target; d.index !== null && e.remove(d.index); - for (const p in d.attributes) - e.remove(d.attributes[p]); + for (const g in d.attributes) + e.remove(d.attributes[g]); d.removeEventListener("dispose", o), delete i[d.id]; const f = r.get(d); f && (e.remove(f), r.delete(d)), n.releaseStatesOfGeometry(d), d.isInstancedBufferGeometry === !0 && delete d._maxInstanceCount, t.memory.geometries--; @@ -22443,18 +22443,18 @@ function $y(s, e, t, n) { e.update(d[f], s.ARRAY_BUFFER); } function c(u) { - const d = [], f = u.index, p = u.attributes.position; - let g = 0; + const d = [], f = u.index, g = u.attributes.position; + let p = 0; if (f !== null) { const b = f.array; - g = f.version; + p = f.version; for (let v = 0, y = b.length; v < y; v += 3) { const M = b[v + 0], E = b[v + 1], A = b[v + 2]; d.push(M, E, E, A, A, M); } - } else if (p !== void 0) { - const b = p.array; - g = p.version; + } else if (g !== void 0) { + const b = g.array; + p = g.version; for (let v = 0, y = b.length / 3 - 1; v < y; v += 3) { const M = v + 0, E = v + 1, A = v + 2; d.push(M, E, E, A, A, M); @@ -22462,7 +22462,7 @@ function $y(s, e, t, n) { } else return; const x = new (bm(d) ? wm : Mm)(d, 1); - x.version = g; + x.version = p; const m = r.get(u); m && e.remove(m), r.set(u, x); } @@ -22493,28 +22493,28 @@ function Jy(s, e, t) { function l(d, f) { s.drawElements(n, f, r, d * o), t.update(f, n, 1); } - function c(d, f, p) { - p !== 0 && (s.drawElementsInstanced(n, f, r, d * o, p), t.update(f, n, p)); + function c(d, f, g) { + g !== 0 && (s.drawElementsInstanced(n, f, r, d * o, g), t.update(f, n, g)); } - function h(d, f, p) { - if (p === 0) return; - e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n, f, 0, r, d, 0, p); + function h(d, f, g) { + if (g === 0) return; + e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n, f, 0, r, d, 0, g); let x = 0; - for (let m = 0; m < p; m++) + for (let m = 0; m < g; m++) x += f[m]; t.update(x, n, 1); } - function u(d, f, p, g) { - if (p === 0) return; + function u(d, f, g, p) { + if (g === 0) return; const x = e.get("WEBGL_multi_draw"); if (x === null) for (let m = 0; m < d.length; m++) - c(d[m] / o, f[m], g[m]); + c(d[m] / o, f[m], p[m]); else { - x.multiDrawElementsInstancedWEBGL(n, f, 0, r, d, 0, g, 0, p); + x.multiDrawElementsInstancedWEBGL(n, f, 0, r, d, 0, p, 0, g); let m = 0; - for (let b = 0; b < p; b++) - m += f[b] * g[b]; + for (let b = 0; b < g; b++) + m += f[b] * p[b]; t.update(m, n, 1); } } @@ -22575,9 +22575,9 @@ function e_(s, e, t) { A.dispose(), n.delete(a), a.removeEventListener("dispose", _); }; d !== void 0 && d.texture.dispose(); - const f = a.morphAttributes.position !== void 0, p = a.morphAttributes.normal !== void 0, g = a.morphAttributes.color !== void 0, x = a.morphAttributes.position || [], m = a.morphAttributes.normal || [], b = a.morphAttributes.color || []; + const f = a.morphAttributes.position !== void 0, g = a.morphAttributes.normal !== void 0, p = a.morphAttributes.color !== void 0, x = a.morphAttributes.position || [], m = a.morphAttributes.normal || [], b = a.morphAttributes.color || []; let v = 0; - f === !0 && (v = 1), p === !0 && (v = 2), g === !0 && (v = 3); + f === !0 && (v = 1), g === !0 && (v = 2), p === !0 && (v = 3); let y = a.attributes.position.count * v, M = 1; y > e.maxTextureSize && (M = Math.ceil(y / e.maxTextureSize), y = e.maxTextureSize); const E = new Float32Array(y * M * 4 * u), A = new ym(E, y, M, u); @@ -22587,7 +22587,7 @@ function e_(s, e, t) { const D = x[S], C = m[S], B = b[S], w = y * M * 4 * S; for (let F = 0; F < D.count; F++) { const W = F * R; - f === !0 && (i.fromBufferAttribute(D, F), E[w + W + 0] = i.x, E[w + W + 1] = i.y, E[w + W + 2] = i.z, E[w + W + 3] = 0), p === !0 && (i.fromBufferAttribute(C, F), E[w + W + 4] = i.x, E[w + W + 5] = i.y, E[w + W + 6] = i.z, E[w + W + 7] = 0), g === !0 && (i.fromBufferAttribute(B, F), E[w + W + 8] = i.x, E[w + W + 9] = i.y, E[w + W + 10] = i.z, E[w + W + 11] = B.itemSize === 4 ? i.w : 1); + f === !0 && (i.fromBufferAttribute(D, F), E[w + W + 0] = i.x, E[w + W + 1] = i.y, E[w + W + 2] = i.z, E[w + W + 3] = 0), g === !0 && (i.fromBufferAttribute(C, F), E[w + W + 4] = i.x, E[w + W + 5] = i.y, E[w + W + 6] = i.z, E[w + W + 7] = 0), p === !0 && (i.fromBufferAttribute(B, F), E[w + W + 8] = i.x, E[w + W + 9] = i.y, E[w + W + 10] = i.z, E[w + W + 11] = B.itemSize === 4 ? i.w : 1); } } d = { @@ -22600,10 +22600,10 @@ function e_(s, e, t) { l.getUniforms().setValue(s, "morphTexture", o.morphTexture, t); else { let f = 0; - for (let g = 0; g < c.length; g++) - f += c[g]; - const p = a.morphTargetsRelative ? 1 : 1 - f; - l.getUniforms().setValue(s, "morphTargetBaseInfluence", p), l.getUniforms().setValue(s, "morphTargetInfluences", c); + for (let p = 0; p < c.length; p++) + f += c[p]; + const g = a.morphTargetsRelative ? 1 : 1 - f; + l.getUniforms().setValue(s, "morphTargetBaseInfluence", g), l.getUniforms().setValue(s, "morphTargetInfluences", c); } l.getUniforms().setValue(s, "morphTargetsTexture", d.texture, t), l.getUniforms().setValue(s, "morphTargetsTextureSize", d.size); } @@ -22633,13 +22633,13 @@ function t_(s, e, t, n) { dispose: o }; } -const Zm = /* @__PURE__ */ new Ht(), yf = /* @__PURE__ */ new ku(1, 1), Ym = /* @__PURE__ */ new ym(), Km = /* @__PURE__ */ new ux(), $m = /* @__PURE__ */ new Tm(), _f = [], Mf = [], wf = new Float32Array(16), Sf = new Float32Array(9), Ef = new Float32Array(4); -function Nr(s, e, t) { +const qm = /* @__PURE__ */ new Ht(), bf = /* @__PURE__ */ new Nu(1, 1), Ym = /* @__PURE__ */ new ym(), Km = /* @__PURE__ */ new ux(), $m = /* @__PURE__ */ new Tm(), yf = [], _f = [], Mf = new Float32Array(16), wf = new Float32Array(9), Sf = new Float32Array(4); +function Ur(s, e, t) { const n = s[0]; if (n <= 0 || n > 0) return s; const i = e * t; - let r = _f[i]; - if (r === void 0 && (r = new Float32Array(i), _f[i] = r), e !== 0) { + let r = yf[i]; + if (r === void 0 && (r = new Float32Array(i), yf[i] = r), e !== 0) { n.toArray(r, 0); for (let o = 1, a = 0; o !== e; ++o) a += t, s[o].toArray(r, a); @@ -22657,8 +22657,8 @@ function Gt(s, e) { s[t] = e[t]; } function Rl(s, e) { - let t = Mf[e]; - t === void 0 && (t = new Int32Array(e), Mf[e] = t); + let t = _f[e]; + t === void 0 && (t = new Int32Array(e), _f[e] = t); for (let n = 0; n !== e; ++n) t[n] = s.allocateTextureUnit(); return t; @@ -22703,7 +22703,7 @@ function o_(s, e) { s.uniformMatrix2fv(this.addr, !1, e), Gt(t, e); } else { if (Vt(t, n)) return; - Ef.set(n), s.uniformMatrix2fv(this.addr, !1, Ef), Gt(t, n); + Sf.set(n), s.uniformMatrix2fv(this.addr, !1, Sf), Gt(t, n); } } function a_(s, e) { @@ -22713,7 +22713,7 @@ function a_(s, e) { s.uniformMatrix3fv(this.addr, !1, e), Gt(t, e); } else { if (Vt(t, n)) return; - Sf.set(n), s.uniformMatrix3fv(this.addr, !1, Sf), Gt(t, n); + wf.set(n), s.uniformMatrix3fv(this.addr, !1, wf), Gt(t, n); } } function l_(s, e) { @@ -22723,7 +22723,7 @@ function l_(s, e) { s.uniformMatrix4fv(this.addr, !1, e), Gt(t, e); } else { if (Vt(t, n)) return; - wf.set(n), s.uniformMatrix4fv(this.addr, !1, wf), Gt(t, n); + Mf.set(n), s.uniformMatrix4fv(this.addr, !1, Mf), Gt(t, n); } } function c_(s, e) { @@ -22792,7 +22792,7 @@ function x_(s, e, t) { const n = this.cache, i = t.allocateTextureUnit(); n[0] !== i && (s.uniform1i(this.addr, i), n[0] = i); let r; - this.type === s.SAMPLER_2D_SHADOW ? (yf.compareFunction = vm, r = yf) : r = Zm, t.setTexture2D(e || r, i); + this.type === s.SAMPLER_2D_SHADOW ? (bf.compareFunction = vm, r = bf) : r = qm, t.setTexture2D(e || r, i); } function v_(s, e, t) { const n = this.cache, i = t.allocateTextureUnit(); @@ -22895,27 +22895,27 @@ function M_(s, e) { s.uniform1fv(this.addr, e); } function w_(s, e) { - const t = Nr(e, this.size, 2); + const t = Ur(e, this.size, 2); s.uniform2fv(this.addr, t); } function S_(s, e) { - const t = Nr(e, this.size, 3); + const t = Ur(e, this.size, 3); s.uniform3fv(this.addr, t); } function E_(s, e) { - const t = Nr(e, this.size, 4); + const t = Ur(e, this.size, 4); s.uniform4fv(this.addr, t); } function T_(s, e) { - const t = Nr(e, this.size, 4); + const t = Ur(e, this.size, 4); s.uniformMatrix2fv(this.addr, !1, t); } function A_(s, e) { - const t = Nr(e, this.size, 9); + const t = Ur(e, this.size, 9); s.uniformMatrix3fv(this.addr, !1, t); } function C_(s, e) { - const t = Nr(e, this.size, 16); + const t = Ur(e, this.size, 16); s.uniformMatrix4fv(this.addr, !1, t); } function P_(s, e) { @@ -22939,16 +22939,16 @@ function B_(s, e) { function N_(s, e) { s.uniform3uiv(this.addr, e); } -function k_(s, e) { +function U_(s, e) { s.uniform4uiv(this.addr, e); } -function U_(s, e, t) { +function O_(s, e, t) { const n = this.cache, i = e.length, r = Rl(t, i); Vt(n, r) || (s.uniform1iv(this.addr, r), Gt(n, r)); for (let o = 0; o !== i; ++o) - t.setTexture2D(e[o] || Zm, r[o]); + t.setTexture2D(e[o] || qm, r[o]); } -function O_(s, e, t) { +function k_(s, e, t) { const n = this.cache, i = e.length, r = Rl(t, i); Vt(n, r) || (s.uniform1iv(this.addr, r), Gt(n, r)); for (let o = 0; o !== i; ++o) @@ -23015,7 +23015,7 @@ function H_(s) { return N_; // _VEC3 case 36296: - return k_; + return U_; // _VEC4 case 35678: // SAMPLER_2D @@ -23026,13 +23026,13 @@ function H_(s) { case 36306: // UNSIGNED_INT_SAMPLER_2D case 35682: - return U_; + return O_; case 35679: // SAMPLER_3D case 36299: // INT_SAMPLER_3D case 36307: - return O_; + return k_; case 35680: // SAMPLER_CUBE case 36300: @@ -23074,7 +23074,7 @@ class W_ { } } const Sc = /(\w+)(\])?(\[|\.)?/g; -function Tf(s, e) { +function Ef(s, e) { s.seq.push(e), s.map[e.id] = e; } function X_(s, e, t) { @@ -23084,15 +23084,15 @@ function X_(s, e, t) { let a = r[1]; const l = r[2] === "]", c = r[3]; if (l && (a = a | 0), c === void 0 || c === "[" && o + 2 === i) { - Tf(t, c === void 0 ? new V_(a, s, e) : new G_(a, s, e)); + Ef(t, c === void 0 ? new V_(a, s, e) : new G_(a, s, e)); break; } else { let u = t.map[a]; - u === void 0 && (u = new W_(a), Tf(t, u)), t = u; + u === void 0 && (u = new W_(a), Ef(t, u)), t = u; } } } -class rl { +class sl { constructor(e, t) { this.seq = [], this.map = {}; const n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS); @@ -23124,13 +23124,13 @@ class rl { return n; } } -function Af(s, e, t) { +function Tf(s, e, t) { const n = s.createShader(e); return s.shaderSource(n, t), s.compileShader(n), n; } const j_ = 37297; -let q_ = 0; -function Z_(s, e) { +let Z_ = 0; +function q_(s, e) { const t = s.split(` `), n = [], i = Math.max(e - 6, 0), r = Math.min(e + 6, t.length); for (let o = i; o < r; o++) { @@ -23140,12 +23140,12 @@ function Z_(s, e) { return n.join(` `); } -const Cf = /* @__PURE__ */ new $e(); +const Af = /* @__PURE__ */ new $e(); function Y_(s) { - st._getMatrix(Cf, st.workingColorSpace, s); - const e = `mat3( ${Cf.elements.map((t) => t.toFixed(4))} )`; + st._getMatrix(Af, st.workingColorSpace, s); + const e = `mat3( ${Af.elements.map((t) => t.toFixed(4))} )`; switch (st.getTransfer(s)) { - case ml: + case pl: return [e, "LinearTransferOETF"]; case lt: return [e, "sRGBTransferOETF"]; @@ -23153,7 +23153,7 @@ function Y_(s) { return He("WebGLProgram: Unsupported color space: ", s), [e, "LinearTransferOETF"]; } } -function Pf(s, e, t) { +function Cf(s, e, t) { const n = s.getShaderParameter(e, s.COMPILE_STATUS), r = (s.getShaderInfoLog(e) || "").trim(); if (n && r === "") return ""; const o = /ERROR: 0:(\d+)/.exec(r); @@ -23163,7 +23163,7 @@ function Pf(s, e, t) { ` + r + ` -` + Z_(s.getShaderSource(e), a); +` + q_(s.getShaderSource(e), a); } else return r; } @@ -23188,7 +23188,7 @@ function $_(s, e) { case rm: t = "Cineon"; break; - case _u: + case yu: t = "ACESFilmic"; break; case am: @@ -23221,7 +23221,7 @@ function Q_(s) { return [ s.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", s.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : "" - ].filter(uo).join(` + ].filter(fo).join(` `); } function e2(s) { @@ -23246,18 +23246,18 @@ function t2(s, e) { } return t; } -function uo(s) { +function fo(s) { return s !== ""; } -function Rf(s, e) { +function Pf(s, e) { const t = e.numSpotLightShadows + e.numSpotLightMaps - e.numSpotLightShadowsWithMaps; return s.replace(/NUM_DIR_LIGHTS/g, e.numDirLights).replace(/NUM_SPOT_LIGHTS/g, e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, t).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_WITH_MAPS/g, e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, e.numPointLightShadows); } -function Lf(s, e) { +function Rf(s, e) { return s.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection); } const n2 = /^[ \t]*#include +<([\w\d./]+)>/gm; -function eu(s) { +function Qh(s) { return s.replace(n2, s2); } const i2 = /* @__PURE__ */ new Map(); @@ -23270,10 +23270,10 @@ function s2(s, e) { else throw new Error("Can not resolve #include <" + e + ">"); } - return eu(t); + return Qh(t); } const r2 = /#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 Df(s) { +function Lf(s) { return s.replace(r2, o2); } function o2(s, e, t, n) { @@ -23282,7 +23282,7 @@ function o2(s, e, t, n) { i += n.replace(/\[\s*i\s*\]/g, "[ " + r + " ]").replace(/UNROLLED_LOOP_INDEX/g, r); return i; } -function If(s) { +function Df(s) { let e = `precision ${s.precision} float; precision ${s.precision} int; precision ${s.precision} sampler2D; @@ -23314,8 +23314,8 @@ function l2(s) { let e = "ENVMAP_TYPE_CUBE"; if (s.envMap) switch (s.envMapMode) { - case br: case yr: + case _r: e = "ENVMAP_TYPE_CUBE"; break; case Al: @@ -23328,7 +23328,7 @@ function c2(s) { let e = "ENVMAP_MODE_REFLECTION"; if (s.envMap) switch (s.envMapMode) { - case yr: + case _r: e = "ENVMAP_MODE_REFRACTION"; break; } @@ -23359,26 +23359,26 @@ function u2(s) { function d2(s, e, t, n) { const i = s.getContext(), r = t.defines; let o = t.vertexShader, a = t.fragmentShader; - const l = a2(t), c = l2(t), h = c2(t), u = h2(t), d = u2(t), f = Q_(t), p = e2(r), g = i.createProgram(); + const l = a2(t), c = l2(t), h = c2(t), u = h2(t), d = u2(t), f = Q_(t), g = e2(r), p = i.createProgram(); let x, m, b = t.glslVersion ? "#version " + t.glslVersion + ` ` : ""; t.isRawShaderMaterial ? (x = [ "#define SHADER_TYPE " + t.shaderType, "#define SHADER_NAME " + t.shaderName, - p - ].filter(uo).join(` + g + ].filter(fo).join(` `), x.length > 0 && (x += ` `), m = [ "#define SHADER_TYPE " + t.shaderType, "#define SHADER_NAME " + t.shaderName, - p - ].filter(uo).join(` + g + ].filter(fo).join(` `), m.length > 0 && (m += ` `)) : (x = [ - If(t), + Df(t), "#define SHADER_TYPE " + t.shaderType, "#define SHADER_NAME " + t.shaderName, - p, + g, t.extensionClipCullDistance ? "#define USE_CLIP_DISTANCE" : "", t.batching ? "#define USE_BATCHING" : "", t.batchingColor ? "#define USE_BATCHING_COLOR" : "", @@ -23506,12 +23506,12 @@ function d2(s, e, t, n) { "#endif", ` ` - ].filter(uo).join(` + ].filter(fo).join(` `), m = [ - If(t), + Df(t), "#define SHADER_TYPE " + t.shaderType, "#define SHADER_NAME " + t.shaderName, - p, + g, t.useFog && t.fog ? "#define USE_FOG" : "", t.useFog && t.fogExp2 ? "#define FOG_EXP2" : "", t.alphaToCoverage ? "#define ALPHA_TO_COVERAGE" : "", @@ -23590,8 +23590,8 @@ function d2(s, e, t, n) { t.useDepthPacking ? "#define DEPTH_PACKING " + t.depthPacking : "", ` ` - ].filter(uo).join(` -`)), o = eu(o), o = Rf(o, t), o = Lf(o, t), a = eu(a), a = Rf(a, t), a = Lf(a, t), o = Df(o), a = Df(a), t.isRawShaderMaterial !== !0 && (b = `#version 300 es + ].filter(fo).join(` +`)), o = Qh(o), o = Pf(o, t), o = Rf(o, t), a = Qh(a), a = Pf(a, t), a = Rf(a, t), o = Lf(o), a = Lf(a), t.isRawShaderMaterial !== !0 && (b = `#version 300 es `, x = [ f, "#define attribute in", @@ -23601,8 +23601,8 @@ function d2(s, e, t, n) { `) + ` ` + x, m = [ "#define varying in", - t.glslVersion === vd ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", - t.glslVersion === vd ? "" : "#define gl_FragColor pc_fragColor", + t.glslVersion === xd ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", + t.glslVersion === xd ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", @@ -23616,19 +23616,19 @@ function d2(s, e, t, n) { ].join(` `) + ` ` + m); - const v = b + x + o, y = b + m + a, M = Af(i, i.VERTEX_SHADER, v), E = Af(i, i.FRAGMENT_SHADER, y); - i.attachShader(g, M), i.attachShader(g, E), t.index0AttributeName !== void 0 ? i.bindAttribLocation(g, 0, t.index0AttributeName) : t.morphTargets === !0 && i.bindAttribLocation(g, 0, "position"), i.linkProgram(g); + const v = b + x + o, y = b + m + a, M = Tf(i, i.VERTEX_SHADER, v), E = Tf(i, i.FRAGMENT_SHADER, y); + i.attachShader(p, M), i.attachShader(p, E), t.index0AttributeName !== void 0 ? i.bindAttribLocation(p, 0, t.index0AttributeName) : t.morphTargets === !0 && i.bindAttribLocation(p, 0, "position"), i.linkProgram(p); function A(D) { if (s.debug.checkShaderErrors) { - const C = i.getProgramInfoLog(g) || "", B = i.getShaderInfoLog(M) || "", w = i.getShaderInfoLog(E) || "", F = C.trim(), W = B.trim(), j = w.trim(); - let $ = !0, Z = !0; - if (i.getProgramParameter(g, i.LINK_STATUS) === !1) + const C = i.getProgramInfoLog(p) || "", B = i.getShaderInfoLog(M) || "", w = i.getShaderInfoLog(E) || "", F = C.trim(), W = B.trim(), j = w.trim(); + let $ = !0, q = !0; + if (i.getProgramParameter(p, i.LINK_STATUS) === !1) if ($ = !1, typeof s.debug.onShaderError == "function") - s.debug.onShaderError(i, g, M, E); + s.debug.onShaderError(i, p, M, E); else { - const re = Pf(i, M, "vertex"), X = Pf(i, E, "fragment"); + const re = Cf(i, M, "vertex"), X = Cf(i, E, "fragment"); et( - "THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(g, i.VALIDATE_STATUS) + ` + "THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(p, i.VALIDATE_STATUS) + ` Material Name: ` + D.name + ` Material Type: ` + D.type + ` @@ -23638,8 +23638,8 @@ Program Info Log: ` + F + ` ` + X ); } - else F !== "" ? He("WebGLProgram: Program Info Log:", F) : (W === "" || j === "") && (Z = !1); - Z && (D.diagnostics = { + else F !== "" ? He("WebGLProgram: Program Info Log:", F) : (W === "" || j === "") && (q = !1); + q && (D.diagnostics = { runnable: $, programLog: F, vertexShader: { @@ -23652,7 +23652,7 @@ Program Info Log: ` + F + ` } }); } - i.deleteShader(M), i.deleteShader(E), R = new rl(i, g), _ = t2(i, g); + i.deleteShader(M), i.deleteShader(E), R = new sl(i, p), _ = t2(i, p); } let R; this.getUniforms = function() { @@ -23664,10 +23664,10 @@ Program Info Log: ` + F + ` }; let S = t.rendererExtensionParallelShaderCompile === !1; return this.isReady = function() { - return S === !1 && (S = i.getProgramParameter(g, j_)), S; + return S === !1 && (S = i.getProgramParameter(p, j_)), S; }, this.destroy = function() { - n.releaseStatesOfProgram(this), i.deleteProgram(g), this.program = void 0; - }, this.type = t.shaderType, this.name = t.shaderName, this.id = q_++, this.cacheKey = e, this.usedTimes = 1, this.program = g, this.vertexShader = M, this.fragmentShader = E, this; + n.releaseStatesOfProgram(this), i.deleteProgram(p), this.program = void 0; + }, this.type = t.shaderType, this.name = t.shaderName, this.id = Z_++, this.cacheKey = e, this.usedTimes = 1, this.program = p, this.vertexShader = M, this.fragmentShader = E, this; } let f2 = 0; class p2 { @@ -23710,9 +23710,9 @@ class m2 { } } function g2(s, e, t, n, i, r, o) { - const a = new Du(), l = new p2(), c = /* @__PURE__ */ new Set(), h = [], u = i.logarithmicDepthBuffer, d = i.vertexTextures; + const a = new Lu(), l = new p2(), c = /* @__PURE__ */ new Set(), h = [], u = i.logarithmicDepthBuffer, d = i.vertexTextures; let f = i.precision; - const p = { + const g = { MeshDepthMaterial: "depth", MeshDistanceMaterial: "distanceRGBA", MeshNormalMaterial: "normal", @@ -23729,26 +23729,26 @@ function g2(s, e, t, n, i, r, o) { ShadowMaterial: "shadow", SpriteMaterial: "sprite" }; - function g(_) { + function p(_) { return c.add(_), _ === 0 ? "uv" : `uv${_}`; } function x(_, S, D, C, B) { - const w = C.fog, F = B.geometry, W = _.isMeshStandardMaterial ? C.environment : null, j = (_.isMeshStandardMaterial ? t : e).get(_.envMap || W), $ = j && j.mapping === Al ? j.image.height : null, Z = p[_.type]; + const w = C.fog, F = B.geometry, W = _.isMeshStandardMaterial ? C.environment : null, j = (_.isMeshStandardMaterial ? t : e).get(_.envMap || W), $ = j && j.mapping === Al ? j.image.height : null, q = g[_.type]; _.precision !== null && (f = i.getMaxPrecision(_.precision), f !== _.precision && He("WebGLProgram.getParameters:", _.precision, "not supported, using", f, "instead.")); const re = F.morphAttributes.position || F.morphAttributes.normal || F.morphAttributes.color, X = re !== void 0 ? re.length : 0; let Y = 0; F.morphAttributes.position !== void 0 && (Y = 1), F.morphAttributes.normal !== void 0 && (Y = 2), F.morphAttributes.color !== void 0 && (Y = 3); let ge, pe, de, ie; - if (Z) { - const ft = ri[Z]; + if (q) { + const ft = ri[q]; ge = ft.vertexShader, pe = ft.fragmentShader; } else ge = _.vertexShader, pe = _.fragmentShader, l.update(_), de = l.getVertexShaderID(_), ie = l.getFragmentShaderID(_); - const he = s.getRenderTarget(), fe = s.state.buffers.depth.getReversed(), ve = B.isInstancedMesh === !0, we = B.isBatchedMesh === !0, Be = !!_.map, Ke = !!_.matcap, Ne = !!j, T = !!_.aoMap, I = !!_.lightMap, V = !!_.bumpMap, U = !!_.normalMap, k = !!_.displacementMap, z = !!_.emissiveMap, ee = !!_.metalnessMap, J = !!_.roughnessMap, G = _.anisotropy > 0, N = _.clearcoat > 0, L = _.dispersion > 0, H = _.iridescence > 0, K = _.sheen > 0, le = _.transmission > 0, te = G && !!_.anisotropyMap, Te = N && !!_.clearcoatMap, be = N && !!_.clearcoatNormalMap, Re = N && !!_.clearcoatRoughnessMap, De = H && !!_.iridescenceMap, ue = H && !!_.iridescenceThicknessMap, ye = K && !!_.sheenColorMap, Ve = K && !!_.sheenRoughnessMap, ke = !!_.specularMap, Ae = !!_.specularColorMap, Ge = !!_.specularIntensityMap, q = le && !!_.transmissionMap, Ee = le && !!_.thicknessMap, _e = !!_.gradientMap, Me = !!_.alphaMap, xe = _.alphaTest > 0, me = !!_.alphaHash, Ue = !!_.extensions; + const he = s.getRenderTarget(), fe = s.state.buffers.depth.getReversed(), ve = B.isInstancedMesh === !0, we = B.isBatchedMesh === !0, Be = !!_.map, Ke = !!_.matcap, Ne = !!j, T = !!_.aoMap, I = !!_.lightMap, V = !!_.bumpMap, O = !!_.normalMap, U = !!_.displacementMap, z = !!_.emissiveMap, ee = !!_.metalnessMap, J = !!_.roughnessMap, G = _.anisotropy > 0, N = _.clearcoat > 0, L = _.dispersion > 0, H = _.iridescence > 0, K = _.sheen > 0, le = _.transmission > 0, te = G && !!_.anisotropyMap, Te = N && !!_.clearcoatMap, be = N && !!_.clearcoatNormalMap, Re = N && !!_.clearcoatRoughnessMap, De = H && !!_.iridescenceMap, ue = H && !!_.iridescenceThicknessMap, ye = K && !!_.sheenColorMap, Ve = K && !!_.sheenRoughnessMap, Ue = !!_.specularMap, Ae = !!_.specularColorMap, Ge = !!_.specularIntensityMap, Z = le && !!_.transmissionMap, Ee = le && !!_.thicknessMap, _e = !!_.gradientMap, Me = !!_.alphaMap, xe = _.alphaTest > 0, me = !!_.alphaHash, ke = !!_.extensions; let Ye = Ki; _.toneMapped && (he === null || he.isXRRenderTarget === !0) && (Ye = s.toneMapping); const yt = { - shaderID: Z, + shaderID: q, shaderType: _.type, shaderName: _.name, vertexShader: ge, @@ -23765,7 +23765,7 @@ function g2(s, e, t, n, i, r, o) { instancingColor: ve && B.instanceColor !== null, instancingMorph: ve && B.morphTexture !== null, supportsVertexTextures: d, - outputColorSpace: he === null ? s.outputColorSpace : he.isXRRenderTarget === !0 ? he.texture.colorSpace : Bt, + outputColorSpace: he === null ? s.outputColorSpace : he.isXRRenderTarget === !0 ? he.texture.colorSpace : It, alphaToCoverage: !!_.alphaToCoverage, map: Be, matcap: Ke, @@ -23775,11 +23775,11 @@ function g2(s, e, t, n, i, r, o) { aoMap: T, lightMap: I, bumpMap: V, - normalMap: U, - displacementMap: d && k, + normalMap: O, + displacementMap: d && U, emissiveMap: z, - normalMapObjectSpace: U && _.normalMapType === Bg, - normalMapTangentSpace: U && _.normalMapType === Io, + normalMapObjectSpace: O && _.normalMapType === Bg, + normalMapTangentSpace: O && _.normalMapType === Bo, metalnessMap: ee, roughnessMap: J, anisotropy: G, @@ -23795,44 +23795,44 @@ function g2(s, e, t, n, i, r, o) { sheen: K, sheenColorMap: ye, sheenRoughnessMap: Ve, - specularMap: ke, + specularMap: Ue, specularColorMap: Ae, specularIntensityMap: Ge, transmission: le, - transmissionMap: q, + transmissionMap: Z, thicknessMap: Ee, gradientMap: _e, - opaque: _.transparent === !1 && _.blending === pr && _.alphaToCoverage === !1, + opaque: _.transparent === !1 && _.blending === mr && _.alphaToCoverage === !1, alphaMap: Me, alphaTest: xe, alphaHash: me, combine: _.combine, // - mapUv: Be && g(_.map.channel), - aoMapUv: T && g(_.aoMap.channel), - lightMapUv: I && g(_.lightMap.channel), - bumpMapUv: V && g(_.bumpMap.channel), - normalMapUv: U && g(_.normalMap.channel), - displacementMapUv: k && g(_.displacementMap.channel), - emissiveMapUv: z && g(_.emissiveMap.channel), - metalnessMapUv: ee && g(_.metalnessMap.channel), - roughnessMapUv: J && g(_.roughnessMap.channel), - anisotropyMapUv: te && g(_.anisotropyMap.channel), - clearcoatMapUv: Te && g(_.clearcoatMap.channel), - clearcoatNormalMapUv: be && g(_.clearcoatNormalMap.channel), - clearcoatRoughnessMapUv: Re && g(_.clearcoatRoughnessMap.channel), - iridescenceMapUv: De && g(_.iridescenceMap.channel), - iridescenceThicknessMapUv: ue && g(_.iridescenceThicknessMap.channel), - sheenColorMapUv: ye && g(_.sheenColorMap.channel), - sheenRoughnessMapUv: Ve && g(_.sheenRoughnessMap.channel), - specularMapUv: ke && g(_.specularMap.channel), - specularColorMapUv: Ae && g(_.specularColorMap.channel), - specularIntensityMapUv: Ge && g(_.specularIntensityMap.channel), - transmissionMapUv: q && g(_.transmissionMap.channel), - thicknessMapUv: Ee && g(_.thicknessMap.channel), - alphaMapUv: Me && g(_.alphaMap.channel), + mapUv: Be && p(_.map.channel), + aoMapUv: T && p(_.aoMap.channel), + lightMapUv: I && p(_.lightMap.channel), + bumpMapUv: V && p(_.bumpMap.channel), + normalMapUv: O && p(_.normalMap.channel), + displacementMapUv: U && p(_.displacementMap.channel), + emissiveMapUv: z && p(_.emissiveMap.channel), + metalnessMapUv: ee && p(_.metalnessMap.channel), + roughnessMapUv: J && p(_.roughnessMap.channel), + anisotropyMapUv: te && p(_.anisotropyMap.channel), + clearcoatMapUv: Te && p(_.clearcoatMap.channel), + clearcoatNormalMapUv: be && p(_.clearcoatNormalMap.channel), + clearcoatRoughnessMapUv: Re && p(_.clearcoatRoughnessMap.channel), + iridescenceMapUv: De && p(_.iridescenceMap.channel), + iridescenceThicknessMapUv: ue && p(_.iridescenceThicknessMap.channel), + sheenColorMapUv: ye && p(_.sheenColorMap.channel), + sheenRoughnessMapUv: Ve && p(_.sheenRoughnessMap.channel), + specularMapUv: Ue && p(_.specularMap.channel), + specularColorMapUv: Ae && p(_.specularColorMap.channel), + specularIntensityMapUv: Ge && p(_.specularIntensityMap.channel), + transmissionMapUv: Z && p(_.transmissionMap.channel), + thicknessMapUv: Ee && p(_.thicknessMap.channel), + alphaMapUv: Me && p(_.alphaMap.channel), // - vertexTangents: !!F.attributes.tangent && (U || G), + vertexTangents: !!F.attributes.tangent && (O || G), vertexColors: _.vertexColors, vertexAlphas: _.vertexColors === !0 && !!F.attributes.color && F.attributes.color.itemSize === 4, pointsUvs: B.isPoints === !0 && !!F.attributes.uv && (Be || Me), @@ -23874,8 +23874,8 @@ function g2(s, e, t, n, i, r, o) { useDepthPacking: _.depthPacking >= 0, depthPacking: _.depthPacking || 0, index0AttributeName: _.index0AttributeName, - extensionClipCullDistance: Ue && _.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"), - extensionMultiDraw: (Ue && _.extensions.multiDraw === !0 || we) && n.has("WEBGL_multi_draw"), + extensionClipCullDistance: ke && _.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"), + extensionMultiDraw: (ke && _.extensions.multiDraw === !0 || we) && n.has("WEBGL_multi_draw"), rendererExtensionParallelShaderCompile: n.has("KHR_parallel_shader_compile"), customProgramCacheKey: _.customProgramCacheKey() }; @@ -23895,7 +23895,7 @@ function g2(s, e, t, n, i, r, o) { a.disableAll(), S.supportsVertexTextures && a.enable(0), S.instancing && a.enable(1), S.instancingColor && a.enable(2), S.instancingMorph && a.enable(3), S.matcap && a.enable(4), S.envMap && a.enable(5), S.normalMapObjectSpace && a.enable(6), S.normalMapTangentSpace && a.enable(7), S.clearcoat && a.enable(8), S.iridescence && a.enable(9), S.alphaTest && a.enable(10), S.vertexColors && a.enable(11), S.vertexAlphas && a.enable(12), S.vertexUv1s && a.enable(13), S.vertexUv2s && a.enable(14), S.vertexUv3s && a.enable(15), S.vertexTangents && a.enable(16), S.anisotropy && a.enable(17), S.alphaHash && a.enable(18), S.batching && a.enable(19), S.dispersion && a.enable(20), S.batchingColor && a.enable(21), S.gradientMap && a.enable(22), _.push(a.mask), a.disableAll(), S.fog && a.enable(0), S.useFog && a.enable(1), S.flatShading && a.enable(2), S.logarithmicDepthBuffer && a.enable(3), S.reversedDepthBuffer && a.enable(4), S.skinning && a.enable(5), S.morphTargets && a.enable(6), S.morphNormals && a.enable(7), S.morphColors && a.enable(8), S.premultipliedAlpha && a.enable(9), S.shadowMapEnabled && a.enable(10), S.doubleSided && a.enable(11), S.flipSided && a.enable(12), S.useDepthPacking && a.enable(13), S.dithering && a.enable(14), S.transmission && a.enable(15), S.sheen && a.enable(16), S.opaque && a.enable(17), S.pointsUvs && a.enable(18), S.decodeVideoTexture && a.enable(19), S.decodeVideoTextureEmissive && a.enable(20), S.alphaToCoverage && a.enable(21), _.push(a.mask); } function y(_) { - const S = p[_.type]; + const S = g[_.type]; let D; if (S) { const C = ri[S]; @@ -23968,39 +23968,39 @@ function x2() { function v2(s, e) { return s.groupOrder !== e.groupOrder ? s.groupOrder - e.groupOrder : s.renderOrder !== e.renderOrder ? s.renderOrder - e.renderOrder : s.material.id !== e.material.id ? s.material.id - e.material.id : s.z !== e.z ? s.z - e.z : s.id - e.id; } -function Bf(s, e) { +function If(s, e) { return s.groupOrder !== e.groupOrder ? s.groupOrder - e.groupOrder : s.renderOrder !== e.renderOrder ? s.renderOrder - e.renderOrder : s.z !== e.z ? e.z - s.z : s.id - e.id; } -function Nf() { +function Bf() { const s = []; let e = 0; const t = [], n = [], i = []; function r() { e = 0, t.length = 0, n.length = 0, i.length = 0; } - function o(u, d, f, p, g, x) { + function o(u, d, f, g, p, x) { let m = s[e]; return m === void 0 ? (m = { id: u.id, object: u, geometry: d, material: f, - groupOrder: p, + groupOrder: g, renderOrder: u.renderOrder, - z: g, + z: p, group: x - }, s[e] = m) : (m.id = u.id, m.object = u, m.geometry = d, m.material = f, m.groupOrder = p, m.renderOrder = u.renderOrder, m.z = g, m.group = x), e++, m; + }, s[e] = m) : (m.id = u.id, m.object = u, m.geometry = d, m.material = f, m.groupOrder = g, m.renderOrder = u.renderOrder, m.z = p, m.group = x), e++, m; } - function a(u, d, f, p, g, x) { - const m = o(u, d, f, p, g, x); + function a(u, d, f, g, p, x) { + const m = o(u, d, f, g, p, x); f.transmission > 0 ? n.push(m) : f.transparent === !0 ? i.push(m) : t.push(m); } - function l(u, d, f, p, g, x) { - const m = o(u, d, f, p, g, x); + function l(u, d, f, g, p, x) { + const m = o(u, d, f, g, p, x); f.transmission > 0 ? n.unshift(m) : f.transparent === !0 ? i.unshift(m) : t.unshift(m); } function c(u, d) { - t.length > 1 && t.sort(u || v2), n.length > 1 && n.sort(d || Bf), i.length > 1 && i.sort(d || Bf); + t.length > 1 && t.sort(u || v2), n.length > 1 && n.sort(d || If), i.length > 1 && i.sort(d || If); } function h() { for (let u = e, d = s.length; u < d; u++) { @@ -24025,7 +24025,7 @@ function b2() { function e(n, i) { const r = s.get(n); let o; - return r === void 0 ? (o = new Nf(), s.set(n, [o])) : i >= r.length ? (o = new Nf(), r.push(o)) : o = r[i], o; + return r === void 0 ? (o = new Bf(), s.set(n, [o])) : i >= r.length ? (o = new Bf(), r.push(o)) : o = r[i], o; } function t() { s = /* @__PURE__ */ new WeakMap(); @@ -24046,14 +24046,14 @@ function y2() { case "DirectionalLight": t = { direction: new P(), - color: new Fe() + color: new Oe() }; break; case "SpotLight": t = { position: new P(), direction: new P(), - color: new Fe(), + color: new Oe(), distance: 0, coneCos: 0, penumbraCos: 0, @@ -24063,7 +24063,7 @@ function y2() { case "PointLight": t = { position: new P(), - color: new Fe(), + color: new Oe(), distance: 0, decay: 0 }; @@ -24071,13 +24071,13 @@ function y2() { case "HemisphereLight": t = { direction: new P(), - skyColor: new Fe(), - groundColor: new Fe() + skyColor: new Oe(), + groundColor: new Oe() }; break; case "RectAreaLight": t = { - color: new Fe(), + color: new Oe(), position: new P(), halfWidth: new P(), halfHeight: new P() @@ -24176,7 +24176,7 @@ function S2(s) { function a(c) { let h = 0, u = 0, d = 0; for (let _ = 0; _ < 9; _++) n.probe[_].set(0, 0, 0); - let f = 0, p = 0, g = 0, x = 0, m = 0, b = 0, v = 0, y = 0, M = 0, E = 0, A = 0; + let f = 0, g = 0, p = 0, x = 0, m = 0, b = 0, v = 0, y = 0, M = 0, E = 0, A = 0; c.sort(w2); for (let _ = 0, S = c.length; _ < S; _++) { const D = c[_], C = D.color, B = D.intensity, w = D.distance, F = D.shadow && D.shadow.map ? D.shadow.map.texture : null; @@ -24195,13 +24195,13 @@ function S2(s) { n.directional[f] = W, f++; } else if (D.isSpotLight) { const W = e.get(D); - W.position.setFromMatrixPosition(D.matrixWorld), W.color.copy(C).multiplyScalar(B), W.distance = w, W.coneCos = Math.cos(D.angle), W.penumbraCos = Math.cos(D.angle * (1 - D.penumbra)), W.decay = D.decay, n.spot[g] = W; + W.position.setFromMatrixPosition(D.matrixWorld), W.color.copy(C).multiplyScalar(B), W.distance = w, W.coneCos = Math.cos(D.angle), W.penumbraCos = Math.cos(D.angle * (1 - D.penumbra)), W.decay = D.decay, n.spot[p] = W; const j = D.shadow; - if (D.map && (n.spotLightMap[M] = D.map, M++, j.updateMatrices(D), D.castShadow && E++), n.spotLightMatrix[g] = j.matrix, D.castShadow) { + if (D.map && (n.spotLightMap[M] = D.map, M++, j.updateMatrices(D), D.castShadow && E++), n.spotLightMatrix[p] = j.matrix, D.castShadow) { const $ = t.get(D); - $.shadowIntensity = j.intensity, $.shadowBias = j.bias, $.shadowNormalBias = j.normalBias, $.shadowRadius = j.radius, $.shadowMapSize = j.mapSize, n.spotShadow[g] = $, n.spotShadowMap[g] = F, y++; + $.shadowIntensity = j.intensity, $.shadowBias = j.bias, $.shadowNormalBias = j.normalBias, $.shadowRadius = j.radius, $.shadowMapSize = j.mapSize, n.spotShadow[p] = $, n.spotShadowMap[p] = F, y++; } - g++; + p++; } else if (D.isRectAreaLight) { const W = e.get(D); W.color.copy(C).multiplyScalar(B), W.halfWidth.set(D.width * 0.5, 0, 0), W.halfHeight.set(0, D.height * 0.5, 0), n.rectArea[x] = W, x++; @@ -24209,9 +24209,9 @@ function S2(s) { const W = e.get(D); if (W.color.copy(D.color).multiplyScalar(D.intensity), W.distance = D.distance, W.decay = D.decay, D.castShadow) { const j = D.shadow, $ = t.get(D); - $.shadowIntensity = j.intensity, $.shadowBias = j.bias, $.shadowNormalBias = j.normalBias, $.shadowRadius = j.radius, $.shadowMapSize = j.mapSize, $.shadowCameraNear = j.camera.near, $.shadowCameraFar = j.camera.far, n.pointShadow[p] = $, n.pointShadowMap[p] = F, n.pointShadowMatrix[p] = D.shadow.matrix, v++; + $.shadowIntensity = j.intensity, $.shadowBias = j.bias, $.shadowNormalBias = j.normalBias, $.shadowRadius = j.radius, $.shadowMapSize = j.mapSize, $.shadowCameraNear = j.camera.near, $.shadowCameraFar = j.camera.far, n.pointShadow[g] = $, n.pointShadowMap[g] = F, n.pointShadowMatrix[g] = D.shadow.matrix, v++; } - n.point[p] = W, p++; + n.point[g] = W, g++; } else if (D.isHemisphereLight) { const W = e.get(D); W.skyColor.copy(D.color).multiplyScalar(B), W.groundColor.copy(D.groundColor).multiplyScalar(B), n.hemi[m] = W, m++; @@ -24219,10 +24219,10 @@ function S2(s) { } x > 0 && (s.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = Pe.LTC_FLOAT_1, n.rectAreaLTC2 = Pe.LTC_FLOAT_2) : (n.rectAreaLTC1 = Pe.LTC_HALF_1, n.rectAreaLTC2 = Pe.LTC_HALF_2)), n.ambient[0] = h, n.ambient[1] = u, n.ambient[2] = d; const R = n.hash; - (R.directionalLength !== f || R.pointLength !== p || R.spotLength !== g || R.rectAreaLength !== x || R.hemiLength !== m || R.numDirectionalShadows !== b || R.numPointShadows !== v || R.numSpotShadows !== y || R.numSpotMaps !== M || R.numLightProbes !== A) && (n.directional.length = f, n.spot.length = g, n.rectArea.length = x, n.point.length = p, n.hemi.length = m, n.directionalShadow.length = b, n.directionalShadowMap.length = b, n.pointShadow.length = v, n.pointShadowMap.length = v, n.spotShadow.length = y, n.spotShadowMap.length = y, n.directionalShadowMatrix.length = b, n.pointShadowMatrix.length = v, n.spotLightMatrix.length = y + M - E, n.spotLightMap.length = M, n.numSpotLightShadowsWithMaps = E, n.numLightProbes = A, R.directionalLength = f, R.pointLength = p, R.spotLength = g, R.rectAreaLength = x, R.hemiLength = m, R.numDirectionalShadows = b, R.numPointShadows = v, R.numSpotShadows = y, R.numSpotMaps = M, R.numLightProbes = A, n.version = M2++); + (R.directionalLength !== f || R.pointLength !== g || R.spotLength !== p || R.rectAreaLength !== x || R.hemiLength !== m || R.numDirectionalShadows !== b || R.numPointShadows !== v || R.numSpotShadows !== y || R.numSpotMaps !== M || R.numLightProbes !== A) && (n.directional.length = f, n.spot.length = p, n.rectArea.length = x, n.point.length = g, n.hemi.length = m, n.directionalShadow.length = b, n.directionalShadowMap.length = b, n.pointShadow.length = v, n.pointShadowMap.length = v, n.spotShadow.length = y, n.spotShadowMap.length = y, n.directionalShadowMatrix.length = b, n.pointShadowMatrix.length = v, n.spotLightMatrix.length = y + M - E, n.spotLightMap.length = M, n.numSpotLightShadowsWithMaps = E, n.numLightProbes = A, R.directionalLength = f, R.pointLength = g, R.spotLength = p, R.rectAreaLength = x, R.hemiLength = m, R.numDirectionalShadows = b, R.numPointShadows = v, R.numSpotShadows = y, R.numSpotMaps = M, R.numLightProbes = A, n.version = M2++); } function l(c, h) { - let u = 0, d = 0, f = 0, p = 0, g = 0; + let u = 0, d = 0, f = 0, g = 0, p = 0; const x = h.matrixWorldInverse; for (let m = 0, b = c.length; m < b; m++) { const v = c[m]; @@ -24233,14 +24233,14 @@ function S2(s) { const y = n.spot[f]; y.position.setFromMatrixPosition(v.matrixWorld), y.position.applyMatrix4(x), y.direction.setFromMatrixPosition(v.matrixWorld), i.setFromMatrixPosition(v.target.matrixWorld), y.direction.sub(i), y.direction.transformDirection(x), f++; } else if (v.isRectAreaLight) { - const y = n.rectArea[p]; - y.position.setFromMatrixPosition(v.matrixWorld), y.position.applyMatrix4(x), o.identity(), r.copy(v.matrixWorld), r.premultiply(x), o.extractRotation(r), y.halfWidth.set(v.width * 0.5, 0, 0), y.halfHeight.set(0, v.height * 0.5, 0), y.halfWidth.applyMatrix4(o), y.halfHeight.applyMatrix4(o), p++; + const y = n.rectArea[g]; + y.position.setFromMatrixPosition(v.matrixWorld), y.position.applyMatrix4(x), o.identity(), r.copy(v.matrixWorld), r.premultiply(x), o.extractRotation(r), y.halfWidth.set(v.width * 0.5, 0, 0), y.halfHeight.set(0, v.height * 0.5, 0), y.halfWidth.applyMatrix4(o), y.halfHeight.applyMatrix4(o), g++; } else if (v.isPointLight) { const y = n.point[d]; y.position.setFromMatrixPosition(v.matrixWorld), y.position.applyMatrix4(x), d++; } else if (v.isHemisphereLight) { - const y = n.hemi[g]; - y.direction.setFromMatrixPosition(v.matrixWorld), y.direction.transformDirection(x), g++; + const y = n.hemi[p]; + y.direction.setFromMatrixPosition(v.matrixWorld), y.direction.transformDirection(x), p++; } } } @@ -24250,7 +24250,7 @@ function S2(s) { state: n }; } -function kf(s) { +function Nf(s) { const e = new S2(s), t = [], n = []; function i(h) { c.camera = h, t.length = 0, n.length = 0; @@ -24288,7 +24288,7 @@ function E2(s) { function t(i, r = 0) { const o = e.get(i); let a; - return o === void 0 ? (a = new kf(s), e.set(i, [a])) : r >= o.length ? (a = new kf(s), o.push(a)) : a = o[r], a; + return o === void 0 ? (a = new Nf(s), e.set(i, [a])) : r >= o.length ? (a = new Nf(s), o.push(a)) : a = o[r], a; } function n() { e = /* @__PURE__ */ new WeakMap(); @@ -24328,8 +24328,8 @@ void main() { gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`; function C2(s, e, t) { - let n = new Nu(); - const i = new ce(), r = new ce(), o = new tt(), a = new _v({ depthPacking: Ig }), l = new Mv(), c = {}, h = t.maxTextureSize, u = { [Fn]: un, [un]: Fn, [At]: At }, d = new Ut({ + let n = new Bu(); + const i = new ce(), r = new ce(), o = new tt(), a = new _v({ depthPacking: Ig }), l = new Mv(), c = {}, h = t.maxTextureSize, u = { [Fn]: un, [un]: Fn, [At]: At }, d = new Ot({ defines: { VSM_SAMPLES: 8 }, @@ -24342,15 +24342,15 @@ function C2(s, e, t) { fragmentShader: A2 }), f = d.clone(); f.defines.HORIZONTAL_PASS = 1; - const p = new ut(); - p.setAttribute( + const g = new ut(); + g.setAttribute( "position", new at( new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3 ) ); - const g = new dt(p, d), x = this; + const p = new dt(g, d), x = this; this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = em; let m = this.type; this.render = function(E, A, R) { @@ -24366,8 +24366,8 @@ function C2(s, e, t) { } if ($.autoUpdate === !1 && $.needsUpdate === !1) continue; i.copy($.mapSize); - const Z = $.getFrameExtents(); - if (i.multiply(Z), r.copy($.mapSize), (i.x > h || i.y > h) && (i.x > h && (r.x = Math.floor(h / Z.x), i.x = r.x * Z.x, $.mapSize.x = r.x), i.y > h && (r.y = Math.floor(h / Z.y), i.y = r.y * Z.y, $.mapSize.y = r.y)), $.map === null || B === !0 || w === !0) { + const q = $.getFrameExtents(); + if (i.multiply(q), r.copy($.mapSize), (i.x > h || i.y > h) && (i.x > h && (r.x = Math.floor(h / q.x), i.x = r.x * q.x, $.mapSize.x = r.x), i.y > h && (r.y = Math.floor(h / q.y), i.y = r.y * q.y, $.mapSize.y = r.y)), $.map === null || B === !0 || w === !0) { const X = this.type !== Si ? { minFilter: Qt, magFilter: Qt } : {}; $.map !== null && $.map.dispose(), $.map = new bn(i.x, i.y, X), $.map.texture.name = j.name + ".shadowMap", $.camera.updateProjectionMatrix(); } @@ -24387,8 +24387,8 @@ function C2(s, e, t) { m = this.type, x.needsUpdate = !1, s.setRenderTarget(_, S, D); }; function b(E, A) { - const R = e.update(g); - d.defines.VSM_SAMPLES !== E.blurSamples && (d.defines.VSM_SAMPLES = E.blurSamples, f.defines.VSM_SAMPLES = E.blurSamples, d.needsUpdate = !0, f.needsUpdate = !0), E.mapPass === null && (E.mapPass = new bn(i.x, i.y)), d.uniforms.shadow_pass.value = E.map.texture, d.uniforms.resolution.value = E.mapSize, d.uniforms.radius.value = E.radius, s.setRenderTarget(E.mapPass), s.clear(), s.renderBufferDirect(A, null, R, d, g, null), f.uniforms.shadow_pass.value = E.mapPass.texture, f.uniforms.resolution.value = E.mapSize, f.uniforms.radius.value = E.radius, s.setRenderTarget(E.map), s.clear(), s.renderBufferDirect(A, null, R, f, g, null); + const R = e.update(p); + d.defines.VSM_SAMPLES !== E.blurSamples && (d.defines.VSM_SAMPLES = E.blurSamples, f.defines.VSM_SAMPLES = E.blurSamples, d.needsUpdate = !0, f.needsUpdate = !0), E.mapPass === null && (E.mapPass = new bn(i.x, i.y)), d.uniforms.shadow_pass.value = E.map.texture, d.uniforms.resolution.value = E.mapSize, d.uniforms.radius.value = E.radius, s.setRenderTarget(E.mapPass), s.clear(), s.renderBufferDirect(A, null, R, d, p, null), f.uniforms.shadow_pass.value = E.mapPass.texture, f.uniforms.resolution.value = E.mapSize, f.uniforms.radius.value = E.radius, s.setRenderTarget(E.map), s.clear(), s.renderBufferDirect(A, null, R, f, p, null); } function v(E, A, R, _) { let S = null; @@ -24416,9 +24416,9 @@ function C2(s, e, t) { if (Array.isArray(w)) { const F = B.groups; for (let W = 0, j = F.length; W < j; W++) { - const $ = F[W], Z = w[$.materialIndex]; - if (Z && Z.visible) { - const re = v(E, Z, _, S); + const $ = F[W], q = w[$.materialIndex]; + if (q && q.visible) { + const re = v(E, q, _, S); E.onBeforeShadow(s, E, A, R, B, re, $), s.renderBufferDirect(R, null, B, re, E, $), E.onAfterShadow(s, E, A, R, B, re, $); } } @@ -24443,40 +24443,40 @@ const P2 = { [ch]: hh, [uh]: ph, [dh]: mh, - [vr]: fh, + [br]: fh, [hh]: ch, [ph]: uh, [mh]: dh, - [fh]: vr + [fh]: br }; function R2(s, e) { function t() { - let q = !1; + let Z = !1; const Ee = new tt(); let _e = null; const Me = new tt(0, 0, 0, 0); return { setMask: function(xe) { - _e !== xe && !q && (s.colorMask(xe, xe, xe, xe), _e = xe); + _e !== xe && !Z && (s.colorMask(xe, xe, xe, xe), _e = xe); }, setLocked: function(xe) { - q = xe; + Z = xe; }, - setClear: function(xe, me, Ue, Ye, yt) { - yt === !0 && (xe *= Ye, me *= Ye, Ue *= Ye), Ee.set(xe, me, Ue, Ye), Me.equals(Ee) === !1 && (s.clearColor(xe, me, Ue, Ye), Me.copy(Ee)); + setClear: function(xe, me, ke, Ye, yt) { + yt === !0 && (xe *= Ye, me *= Ye, ke *= Ye), Ee.set(xe, me, ke, Ye), Me.equals(Ee) === !1 && (s.clearColor(xe, me, ke, Ye), Me.copy(Ee)); }, reset: function() { - q = !1, _e = null, Me.set(-1, 0, 0, 0); + Z = !1, _e = null, Me.set(-1, 0, 0, 0); } }; } function n() { - let q = !1, Ee = !1, _e = null, Me = null, xe = null; + let Z = !1, Ee = !1, _e = null, Me = null, xe = null; return { setReversed: function(me) { if (Ee !== me) { - const Ue = e.get("EXT_clip_control"); - me ? Ue.clipControlEXT(Ue.LOWER_LEFT_EXT, Ue.ZERO_TO_ONE_EXT) : Ue.clipControlEXT(Ue.LOWER_LEFT_EXT, Ue.NEGATIVE_ONE_TO_ONE_EXT), Ee = me; + const ke = e.get("EXT_clip_control"); + me ? ke.clipControlEXT(ke.LOWER_LEFT_EXT, ke.ZERO_TO_ONE_EXT) : ke.clipControlEXT(ke.LOWER_LEFT_EXT, ke.NEGATIVE_ONE_TO_ONE_EXT), Ee = me; const Ye = xe; xe = null, this.setClear(Ye); } @@ -24488,7 +24488,7 @@ function R2(s, e) { me ? he(s.DEPTH_TEST) : fe(s.DEPTH_TEST); }, setMask: function(me) { - _e !== me && !q && (s.depthMask(me), _e = me); + _e !== me && !Z && (s.depthMask(me), _e = me); }, setFunc: function(me) { if (Ee && (me = P2[me]), Me !== me) { @@ -24502,7 +24502,7 @@ function R2(s, e) { case uh: s.depthFunc(s.LESS); break; - case vr: + case br: s.depthFunc(s.LEQUAL); break; case dh: @@ -24524,75 +24524,75 @@ function R2(s, e) { } }, setLocked: function(me) { - q = me; + Z = me; }, setClear: function(me) { xe !== me && (Ee && (me = 1 - me), s.clearDepth(me), xe = me); }, reset: function() { - q = !1, _e = null, Me = null, xe = null, Ee = !1; + Z = !1, _e = null, Me = null, xe = null, Ee = !1; } }; } function i() { - let q = !1, Ee = null, _e = null, Me = null, xe = null, me = null, Ue = null, Ye = null, yt = null; + let Z = !1, Ee = null, _e = null, Me = null, xe = null, me = null, ke = null, Ye = null, yt = null; return { setTest: function(ft) { - q || (ft ? he(s.STENCIL_TEST) : fe(s.STENCIL_TEST)); + Z || (ft ? he(s.STENCIL_TEST) : fe(s.STENCIL_TEST)); }, setMask: function(ft) { - Ee !== ft && !q && (s.stencilMask(ft), Ee = ft); + Ee !== ft && !Z && (s.stencilMask(ft), Ee = ft); }, setFunc: function(ft, ni, Gn) { (_e !== ft || Me !== ni || xe !== Gn) && (s.stencilFunc(ft, ni, Gn), _e = ft, Me = ni, xe = Gn); }, setOp: function(ft, ni, Gn) { - (me !== ft || Ue !== ni || Ye !== Gn) && (s.stencilOp(ft, ni, Gn), me = ft, Ue = ni, Ye = Gn); + (me !== ft || ke !== ni || Ye !== Gn) && (s.stencilOp(ft, ni, Gn), me = ft, ke = ni, Ye = Gn); }, setLocked: function(ft) { - q = ft; + Z = ft; }, setClear: function(ft) { yt !== ft && (s.clearStencil(ft), yt = ft); }, reset: function() { - q = !1, Ee = null, _e = null, Me = null, xe = null, me = null, Ue = null, Ye = null, yt = null; + Z = !1, Ee = null, _e = null, Me = null, xe = null, me = null, ke = null, Ye = null, yt = null; } }; } const r = new t(), o = new n(), a = new i(), l = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(); - let h = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], p = null, g = !1, x = null, m = null, b = null, v = null, y = null, M = null, E = null, A = new Fe(0, 0, 0), R = 0, _ = !1, S = null, D = null, C = null, B = null, w = null; + let h = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], g = null, p = !1, x = null, m = null, b = null, v = null, y = null, M = null, E = null, A = new Oe(0, 0, 0), R = 0, _ = !1, S = null, D = null, C = null, B = null, w = null; const F = s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS); let W = !1, j = 0; const $ = s.getParameter(s.VERSION); $.indexOf("WebGL") !== -1 ? (j = parseFloat(/^WebGL (\d)/.exec($)[1]), W = j >= 1) : $.indexOf("OpenGL ES") !== -1 && (j = parseFloat(/^OpenGL ES (\d)/.exec($)[1]), W = j >= 2); - let Z = null, re = {}; + let q = null, re = {}; const X = s.getParameter(s.SCISSOR_BOX), Y = s.getParameter(s.VIEWPORT), ge = new tt().fromArray(X), pe = new tt().fromArray(Y); - function de(q, Ee, _e, Me) { + function de(Z, Ee, _e, Me) { const xe = new Uint8Array(4), me = s.createTexture(); - s.bindTexture(q, me), s.texParameteri(q, s.TEXTURE_MIN_FILTER, s.NEAREST), s.texParameteri(q, s.TEXTURE_MAG_FILTER, s.NEAREST); - for (let Ue = 0; Ue < _e; Ue++) - q === s.TEXTURE_3D || q === s.TEXTURE_2D_ARRAY ? s.texImage3D(Ee, 0, s.RGBA, 1, 1, Me, 0, s.RGBA, s.UNSIGNED_BYTE, xe) : s.texImage2D(Ee + Ue, 0, s.RGBA, 1, 1, 0, s.RGBA, s.UNSIGNED_BYTE, xe); + s.bindTexture(Z, me), s.texParameteri(Z, s.TEXTURE_MIN_FILTER, s.NEAREST), s.texParameteri(Z, s.TEXTURE_MAG_FILTER, s.NEAREST); + for (let ke = 0; ke < _e; ke++) + Z === s.TEXTURE_3D || Z === s.TEXTURE_2D_ARRAY ? s.texImage3D(Ee, 0, s.RGBA, 1, 1, Me, 0, s.RGBA, s.UNSIGNED_BYTE, xe) : s.texImage2D(Ee + ke, 0, s.RGBA, 1, 1, 0, s.RGBA, s.UNSIGNED_BYTE, xe); return me; } const ie = {}; - ie[s.TEXTURE_2D] = de(s.TEXTURE_2D, s.TEXTURE_2D, 1), ie[s.TEXTURE_CUBE_MAP] = de(s.TEXTURE_CUBE_MAP, s.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ie[s.TEXTURE_2D_ARRAY] = de(s.TEXTURE_2D_ARRAY, s.TEXTURE_2D_ARRAY, 1, 1), ie[s.TEXTURE_3D] = de(s.TEXTURE_3D, s.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), o.setClear(1), a.setClear(0), he(s.DEPTH_TEST), o.setFunc(vr), V(!1), U(hd), he(s.CULL_FACE), T(Xt); - function he(q) { - h[q] !== !0 && (s.enable(q), h[q] = !0); + ie[s.TEXTURE_2D] = de(s.TEXTURE_2D, s.TEXTURE_2D, 1), ie[s.TEXTURE_CUBE_MAP] = de(s.TEXTURE_CUBE_MAP, s.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ie[s.TEXTURE_2D_ARRAY] = de(s.TEXTURE_2D_ARRAY, s.TEXTURE_2D_ARRAY, 1, 1), ie[s.TEXTURE_3D] = de(s.TEXTURE_3D, s.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), o.setClear(1), a.setClear(0), he(s.DEPTH_TEST), o.setFunc(br), V(!1), O(cd), he(s.CULL_FACE), T(Xt); + function he(Z) { + h[Z] !== !0 && (s.enable(Z), h[Z] = !0); } - function fe(q) { - h[q] !== !1 && (s.disable(q), h[q] = !1); + function fe(Z) { + h[Z] !== !1 && (s.disable(Z), h[Z] = !1); } - function ve(q, Ee) { - return u[q] !== Ee ? (s.bindFramebuffer(q, Ee), u[q] = Ee, q === s.DRAW_FRAMEBUFFER && (u[s.FRAMEBUFFER] = Ee), q === s.FRAMEBUFFER && (u[s.DRAW_FRAMEBUFFER] = Ee), !0) : !1; + function ve(Z, Ee) { + return u[Z] !== Ee ? (s.bindFramebuffer(Z, Ee), u[Z] = Ee, Z === s.DRAW_FRAMEBUFFER && (u[s.FRAMEBUFFER] = Ee), Z === s.FRAMEBUFFER && (u[s.DRAW_FRAMEBUFFER] = Ee), !0) : !1; } - function we(q, Ee) { + function we(Z, Ee) { let _e = f, Me = !1; - if (q) { + if (Z) { _e = d.get(Ee), _e === void 0 && (_e = [], d.set(Ee, _e)); - const xe = q.textures; + const xe = Z.textures; if (_e.length !== xe.length || _e[0] !== s.COLOR_ATTACHMENT0) { - for (let me = 0, Ue = xe.length; me < Ue; me++) + for (let me = 0, ke = xe.length; me < ke; me++) _e[me] = s.COLOR_ATTACHMENT0 + me; _e.length = xe.length, Me = !0; } @@ -24600,17 +24600,17 @@ function R2(s, e) { _e[0] !== s.BACK && (_e[0] = s.BACK, Me = !0); Me && s.drawBuffers(_e); } - function Be(q) { - return p !== q ? (s.useProgram(q), p = q, !0) : !1; + function Be(Z) { + return g !== Z ? (s.useProgram(Z), g = Z, !0) : !1; } const Ke = { - [Zn]: s.FUNC_ADD, + [qn]: s.FUNC_ADD, [fg]: s.FUNC_SUBTRACT, [pg]: s.FUNC_REVERSE_SUBTRACT }; Ke[mg] = s.MIN, Ke[gg] = s.MAX; const Ne = { - [lo]: s.ZERO, + [co]: s.ZERO, [xg]: s.ONE, [vg]: s.SRC_COLOR, [rh]: s.SRC_ALPHA, @@ -24626,177 +24626,177 @@ function R2(s, e) { [Eg]: s.CONSTANT_ALPHA, [Tg]: s.ONE_MINUS_CONSTANT_ALPHA }; - function T(q, Ee, _e, Me, xe, me, Ue, Ye, yt, ft) { - if (q === Xt) { - g === !0 && (fe(s.BLEND), g = !1); + function T(Z, Ee, _e, Me, xe, me, ke, Ye, yt, ft) { + if (Z === Xt) { + p === !0 && (fe(s.BLEND), p = !1); return; } - if (g === !1 && (he(s.BLEND), g = !0), q !== nm) { - if (q !== x || ft !== _) { - if ((m !== Zn || y !== Zn) && (s.blendEquation(s.FUNC_ADD), m = Zn, y = Zn), ft) - switch (q) { - case pr: + if (p === !1 && (he(s.BLEND), p = !0), Z !== nm) { + if (Z !== x || ft !== _) { + if ((m !== qn || y !== qn) && (s.blendEquation(s.FUNC_ADD), m = qn, y = qn), ft) + switch (Z) { + case mr: s.blendFuncSeparate(s.ONE, s.ONE_MINUS_SRC_ALPHA, s.ONE, s.ONE_MINUS_SRC_ALPHA); break; case sh: s.blendFunc(s.ONE, s.ONE); break; - case ud: + case hd: s.blendFuncSeparate(s.ZERO, s.ONE_MINUS_SRC_COLOR, s.ZERO, s.ONE); break; - case dd: + case ud: s.blendFuncSeparate(s.DST_COLOR, s.ONE_MINUS_SRC_ALPHA, s.ZERO, s.ONE); break; default: - et("WebGLState: Invalid blending: ", q); + et("WebGLState: Invalid blending: ", Z); break; } else - switch (q) { - case pr: + switch (Z) { + case mr: s.blendFuncSeparate(s.SRC_ALPHA, s.ONE_MINUS_SRC_ALPHA, s.ONE, s.ONE_MINUS_SRC_ALPHA); break; case sh: s.blendFuncSeparate(s.SRC_ALPHA, s.ONE, s.ONE, s.ONE); break; - case ud: + case hd: et("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true"); break; - case dd: + case ud: et("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true"); break; default: - et("WebGLState: Invalid blending: ", q); + et("WebGLState: Invalid blending: ", Z); break; } - b = null, v = null, M = null, E = null, A.set(0, 0, 0), R = 0, x = q, _ = ft; + b = null, v = null, M = null, E = null, A.set(0, 0, 0), R = 0, x = Z, _ = ft; } return; } - xe = xe || Ee, me = me || _e, Ue = Ue || Me, (Ee !== m || xe !== y) && (s.blendEquationSeparate(Ke[Ee], Ke[xe]), m = Ee, y = xe), (_e !== b || Me !== v || me !== M || Ue !== E) && (s.blendFuncSeparate(Ne[_e], Ne[Me], Ne[me], Ne[Ue]), b = _e, v = Me, M = me, E = Ue), (Ye.equals(A) === !1 || yt !== R) && (s.blendColor(Ye.r, Ye.g, Ye.b, yt), A.copy(Ye), R = yt), x = q, _ = !1; + xe = xe || Ee, me = me || _e, ke = ke || Me, (Ee !== m || xe !== y) && (s.blendEquationSeparate(Ke[Ee], Ke[xe]), m = Ee, y = xe), (_e !== b || Me !== v || me !== M || ke !== E) && (s.blendFuncSeparate(Ne[_e], Ne[Me], Ne[me], Ne[ke]), b = _e, v = Me, M = me, E = ke), (Ye.equals(A) === !1 || yt !== R) && (s.blendColor(Ye.r, Ye.g, Ye.b, yt), A.copy(Ye), R = yt), x = Z, _ = !1; } - function I(q, Ee) { - q.side === At ? fe(s.CULL_FACE) : he(s.CULL_FACE); - let _e = q.side === un; - Ee && (_e = !_e), V(_e), q.blending === pr && q.transparent === !1 ? T(Xt) : T(q.blending, q.blendEquation, q.blendSrc, q.blendDst, q.blendEquationAlpha, q.blendSrcAlpha, q.blendDstAlpha, q.blendColor, q.blendAlpha, q.premultipliedAlpha), o.setFunc(q.depthFunc), o.setTest(q.depthTest), o.setMask(q.depthWrite), r.setMask(q.colorWrite); - const Me = q.stencilWrite; - a.setTest(Me), Me && (a.setMask(q.stencilWriteMask), a.setFunc(q.stencilFunc, q.stencilRef, q.stencilFuncMask), a.setOp(q.stencilFail, q.stencilZFail, q.stencilZPass)), z(q.polygonOffset, q.polygonOffsetFactor, q.polygonOffsetUnits), q.alphaToCoverage === !0 ? he(s.SAMPLE_ALPHA_TO_COVERAGE) : fe(s.SAMPLE_ALPHA_TO_COVERAGE); + function I(Z, Ee) { + Z.side === At ? fe(s.CULL_FACE) : he(s.CULL_FACE); + let _e = Z.side === un; + Ee && (_e = !_e), V(_e), Z.blending === mr && Z.transparent === !1 ? T(Xt) : T(Z.blending, Z.blendEquation, Z.blendSrc, Z.blendDst, Z.blendEquationAlpha, Z.blendSrcAlpha, Z.blendDstAlpha, Z.blendColor, Z.blendAlpha, Z.premultipliedAlpha), o.setFunc(Z.depthFunc), o.setTest(Z.depthTest), o.setMask(Z.depthWrite), r.setMask(Z.colorWrite); + const Me = Z.stencilWrite; + a.setTest(Me), Me && (a.setMask(Z.stencilWriteMask), a.setFunc(Z.stencilFunc, Z.stencilRef, Z.stencilFuncMask), a.setOp(Z.stencilFail, Z.stencilZFail, Z.stencilZPass)), z(Z.polygonOffset, Z.polygonOffsetFactor, Z.polygonOffsetUnits), Z.alphaToCoverage === !0 ? he(s.SAMPLE_ALPHA_TO_COVERAGE) : fe(s.SAMPLE_ALPHA_TO_COVERAGE); } - function V(q) { - S !== q && (q ? s.frontFace(s.CW) : s.frontFace(s.CCW), S = q); + function V(Z) { + S !== Z && (Z ? s.frontFace(s.CW) : s.frontFace(s.CCW), S = Z); } - function U(q) { - q !== ug ? (he(s.CULL_FACE), q !== D && (q === hd ? s.cullFace(s.BACK) : q === dg ? s.cullFace(s.FRONT) : s.cullFace(s.FRONT_AND_BACK))) : fe(s.CULL_FACE), D = q; + function O(Z) { + Z !== ug ? (he(s.CULL_FACE), Z !== D && (Z === cd ? s.cullFace(s.BACK) : Z === dg ? s.cullFace(s.FRONT) : s.cullFace(s.FRONT_AND_BACK))) : fe(s.CULL_FACE), D = Z; } - function k(q) { - q !== C && (W && s.lineWidth(q), C = q); + function U(Z) { + Z !== C && (W && s.lineWidth(Z), C = Z); } - function z(q, Ee, _e) { - q ? (he(s.POLYGON_OFFSET_FILL), (B !== Ee || w !== _e) && (s.polygonOffset(Ee, _e), B = Ee, w = _e)) : fe(s.POLYGON_OFFSET_FILL); + function z(Z, Ee, _e) { + Z ? (he(s.POLYGON_OFFSET_FILL), (B !== Ee || w !== _e) && (s.polygonOffset(Ee, _e), B = Ee, w = _e)) : fe(s.POLYGON_OFFSET_FILL); } - function ee(q) { - q ? he(s.SCISSOR_TEST) : fe(s.SCISSOR_TEST); + function ee(Z) { + Z ? he(s.SCISSOR_TEST) : fe(s.SCISSOR_TEST); } - function J(q) { - q === void 0 && (q = s.TEXTURE0 + F - 1), Z !== q && (s.activeTexture(q), Z = q); + function J(Z) { + Z === void 0 && (Z = s.TEXTURE0 + F - 1), q !== Z && (s.activeTexture(Z), q = Z); } - function G(q, Ee, _e) { - _e === void 0 && (Z === null ? _e = s.TEXTURE0 + F - 1 : _e = Z); + function G(Z, Ee, _e) { + _e === void 0 && (q === null ? _e = s.TEXTURE0 + F - 1 : _e = q); let Me = re[_e]; - Me === void 0 && (Me = { type: void 0, texture: void 0 }, re[_e] = Me), (Me.type !== q || Me.texture !== Ee) && (Z !== _e && (s.activeTexture(_e), Z = _e), s.bindTexture(q, Ee || ie[q]), Me.type = q, Me.texture = Ee); + Me === void 0 && (Me = { type: void 0, texture: void 0 }, re[_e] = Me), (Me.type !== Z || Me.texture !== Ee) && (q !== _e && (s.activeTexture(_e), q = _e), s.bindTexture(Z, Ee || ie[Z]), Me.type = Z, Me.texture = Ee); } function N() { - const q = re[Z]; - q !== void 0 && q.type !== void 0 && (s.bindTexture(q.type, null), q.type = void 0, q.texture = void 0); + const Z = re[q]; + Z !== void 0 && Z.type !== void 0 && (s.bindTexture(Z.type, null), Z.type = void 0, Z.texture = void 0); } function L() { try { s.compressedTexImage2D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function H() { try { s.compressedTexImage3D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function K() { try { s.texSubImage2D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function le() { try { s.texSubImage3D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function te() { try { s.compressedTexSubImage2D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function Te() { try { s.compressedTexSubImage3D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function be() { try { s.texStorage2D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function Re() { try { s.texStorage3D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function De() { try { s.texImage2D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } function ue() { try { s.texImage3D(...arguments); - } catch (q) { - q("WebGLState:", q); + } catch (Z) { + Z("WebGLState:", Z); } } - function ye(q) { - ge.equals(q) === !1 && (s.scissor(q.x, q.y, q.z, q.w), ge.copy(q)); + function ye(Z) { + ge.equals(Z) === !1 && (s.scissor(Z.x, Z.y, Z.z, Z.w), ge.copy(Z)); } - function Ve(q) { - pe.equals(q) === !1 && (s.viewport(q.x, q.y, q.z, q.w), pe.copy(q)); + function Ve(Z) { + pe.equals(Z) === !1 && (s.viewport(Z.x, Z.y, Z.z, Z.w), pe.copy(Z)); } - function ke(q, Ee) { + function Ue(Z, Ee) { let _e = c.get(Ee); _e === void 0 && (_e = /* @__PURE__ */ new WeakMap(), c.set(Ee, _e)); - let Me = _e.get(q); - Me === void 0 && (Me = s.getUniformBlockIndex(Ee, q.name), _e.set(q, Me)); + let Me = _e.get(Z); + Me === void 0 && (Me = s.getUniformBlockIndex(Ee, Z.name), _e.set(Z, Me)); } - function Ae(q, Ee) { - const Me = c.get(Ee).get(q); - l.get(Ee) !== Me && (s.uniformBlockBinding(Ee, Me, q.__bindingPointIndex), l.set(Ee, Me)); + function Ae(Z, Ee) { + const Me = c.get(Ee).get(Z); + l.get(Ee) !== Me && (s.uniformBlockBinding(Ee, Me, Z.__bindingPointIndex), l.set(Ee, Me)); } function Ge() { - s.disable(s.BLEND), s.disable(s.CULL_FACE), s.disable(s.DEPTH_TEST), s.disable(s.POLYGON_OFFSET_FILL), s.disable(s.SCISSOR_TEST), s.disable(s.STENCIL_TEST), s.disable(s.SAMPLE_ALPHA_TO_COVERAGE), s.blendEquation(s.FUNC_ADD), s.blendFunc(s.ONE, s.ZERO), s.blendFuncSeparate(s.ONE, s.ZERO, s.ONE, s.ZERO), s.blendColor(0, 0, 0, 0), s.colorMask(!0, !0, !0, !0), s.clearColor(0, 0, 0, 0), s.depthMask(!0), s.depthFunc(s.LESS), o.setReversed(!1), s.clearDepth(1), s.stencilMask(4294967295), s.stencilFunc(s.ALWAYS, 0, 4294967295), s.stencilOp(s.KEEP, s.KEEP, s.KEEP), s.clearStencil(0), s.cullFace(s.BACK), s.frontFace(s.CCW), s.polygonOffset(0, 0), s.activeTexture(s.TEXTURE0), s.bindFramebuffer(s.FRAMEBUFFER, null), s.bindFramebuffer(s.DRAW_FRAMEBUFFER, null), s.bindFramebuffer(s.READ_FRAMEBUFFER, null), s.useProgram(null), s.lineWidth(1), s.scissor(0, 0, s.canvas.width, s.canvas.height), s.viewport(0, 0, s.canvas.width, s.canvas.height), h = {}, Z = null, re = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], p = null, g = !1, x = null, m = null, b = null, v = null, y = null, M = null, E = null, A = new Fe(0, 0, 0), R = 0, _ = !1, S = null, D = null, C = null, B = null, w = null, ge.set(0, 0, s.canvas.width, s.canvas.height), pe.set(0, 0, s.canvas.width, s.canvas.height), r.reset(), o.reset(), a.reset(); + s.disable(s.BLEND), s.disable(s.CULL_FACE), s.disable(s.DEPTH_TEST), s.disable(s.POLYGON_OFFSET_FILL), s.disable(s.SCISSOR_TEST), s.disable(s.STENCIL_TEST), s.disable(s.SAMPLE_ALPHA_TO_COVERAGE), s.blendEquation(s.FUNC_ADD), s.blendFunc(s.ONE, s.ZERO), s.blendFuncSeparate(s.ONE, s.ZERO, s.ONE, s.ZERO), s.blendColor(0, 0, 0, 0), s.colorMask(!0, !0, !0, !0), s.clearColor(0, 0, 0, 0), s.depthMask(!0), s.depthFunc(s.LESS), o.setReversed(!1), s.clearDepth(1), s.stencilMask(4294967295), s.stencilFunc(s.ALWAYS, 0, 4294967295), s.stencilOp(s.KEEP, s.KEEP, s.KEEP), s.clearStencil(0), s.cullFace(s.BACK), s.frontFace(s.CCW), s.polygonOffset(0, 0), s.activeTexture(s.TEXTURE0), s.bindFramebuffer(s.FRAMEBUFFER, null), s.bindFramebuffer(s.DRAW_FRAMEBUFFER, null), s.bindFramebuffer(s.READ_FRAMEBUFFER, null), s.useProgram(null), s.lineWidth(1), s.scissor(0, 0, s.canvas.width, s.canvas.height), s.viewport(0, 0, s.canvas.width, s.canvas.height), h = {}, q = null, re = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], g = null, p = !1, x = null, m = null, b = null, v = null, y = null, M = null, E = null, A = new Oe(0, 0, 0), R = 0, _ = !1, S = null, D = null, C = null, B = null, w = null, ge.set(0, 0, s.canvas.width, s.canvas.height), pe.set(0, 0, s.canvas.width, s.canvas.height), r.reset(), o.reset(), a.reset(); } return { buffers: { @@ -24812,8 +24812,8 @@ function R2(s, e) { setBlending: T, setMaterial: I, setFlipSided: V, - setCullFace: U, - setLineWidth: k, + setCullFace: O, + setLineWidth: U, setPolygonOffset: z, setScissorTest: ee, activeTexture: J, @@ -24823,7 +24823,7 @@ function R2(s, e) { compressedTexImage3D: H, texImage2D: De, texImage3D: ue, - updateUBOMapping: ke, + updateUBOMapping: Ue, uniformBlockBinding: Ae, texStorage2D: be, texStorage3D: Re, @@ -24845,20 +24845,20 @@ function L2(s, e, t, n, i, r, o) { f = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null; } catch { } - function p(N, L) { + function g(N, L) { return f ? ( // eslint-disable-next-line compat/compat new OffscreenCanvas(N, L) - ) : Ao("canvas"); + ) : Co("canvas"); } - function g(N, L, H) { + function p(N, L, H) { let K = 1; const le = G(N); if ((le.width > H || le.height > H) && (K = H / Math.max(le.width, le.height)), K < 1) if (typeof HTMLImageElement < "u" && N instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && N instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && N instanceof ImageBitmap || typeof VideoFrame < "u" && N instanceof VideoFrame) { const te = Math.floor(K * le.width), Te = Math.floor(K * le.height); - u === void 0 && (u = p(te, Te)); - const be = L ? p(te, Te) : u; + u === void 0 && (u = g(te, Te)); + const be = L ? g(te, Te) : u; return be.width = te, be.height = Te, be.getContext("2d").drawImage(N, 0, 0, te, Te), He("WebGLRenderer: Texture has been resized from (" + le.width + "x" + le.height + ") to (" + te + "x" + Te + ")."), be; } else return "data" in N && He("WebGLRenderer: Image in DataTexture is too big (" + le.width + "x" + le.height + ")."), N; @@ -24880,14 +24880,14 @@ function L2(s, e, t, n, i, r, o) { } let te = L; if (L === s.RED && (H === s.FLOAT && (te = s.R32F), H === s.HALF_FLOAT && (te = s.R16F), H === s.UNSIGNED_BYTE && (te = s.R8)), L === s.RED_INTEGER && (H === s.UNSIGNED_BYTE && (te = s.R8UI), H === s.UNSIGNED_SHORT && (te = s.R16UI), H === s.UNSIGNED_INT && (te = s.R32UI), H === s.BYTE && (te = s.R8I), H === s.SHORT && (te = s.R16I), H === s.INT && (te = s.R32I)), L === s.RG && (H === s.FLOAT && (te = s.RG32F), H === s.HALF_FLOAT && (te = s.RG16F), H === s.UNSIGNED_BYTE && (te = s.RG8)), L === s.RG_INTEGER && (H === s.UNSIGNED_BYTE && (te = s.RG8UI), H === s.UNSIGNED_SHORT && (te = s.RG16UI), H === s.UNSIGNED_INT && (te = s.RG32UI), H === s.BYTE && (te = s.RG8I), H === s.SHORT && (te = s.RG16I), H === s.INT && (te = s.RG32I)), L === s.RGB_INTEGER && (H === s.UNSIGNED_BYTE && (te = s.RGB8UI), H === s.UNSIGNED_SHORT && (te = s.RGB16UI), H === s.UNSIGNED_INT && (te = s.RGB32UI), H === s.BYTE && (te = s.RGB8I), H === s.SHORT && (te = s.RGB16I), H === s.INT && (te = s.RGB32I)), L === s.RGBA_INTEGER && (H === s.UNSIGNED_BYTE && (te = s.RGBA8UI), H === s.UNSIGNED_SHORT && (te = s.RGBA16UI), H === s.UNSIGNED_INT && (te = s.RGBA32UI), H === s.BYTE && (te = s.RGBA8I), H === s.SHORT && (te = s.RGBA16I), H === s.INT && (te = s.RGBA32I)), L === s.RGB && (H === s.UNSIGNED_INT_5_9_9_9_REV && (te = s.RGB9_E5), H === s.UNSIGNED_INT_10F_11F_11F_REV && (te = s.R11F_G11F_B10F)), L === s.RGBA) { - const Te = le ? ml : st.getTransfer(K); + const Te = le ? pl : st.getTransfer(K); H === s.FLOAT && (te = s.RGBA32F), H === s.HALF_FLOAT && (te = s.RGBA16F), H === s.UNSIGNED_BYTE && (te = Te === lt ? s.SRGB8_ALPHA8 : s.RGBA8), H === s.UNSIGNED_SHORT_4_4_4_4 && (te = s.RGBA4), H === s.UNSIGNED_SHORT_5_5_5_1 && (te = s.RGB5_A1); } return (te === s.R16F || te === s.R32F || te === s.RG16F || te === s.RG32F || te === s.RGBA16F || te === s.RGBA32F) && e.get("EXT_color_buffer_float"), te; } function y(N, L) { let H; - return N ? L === null || L === Ms || L === _r ? H = s.DEPTH24_STENCIL8 : L === $n ? H = s.DEPTH32F_STENCIL8 : L === wo && (H = s.DEPTH24_STENCIL8, He("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : L === null || L === Ms || L === _r ? H = s.DEPTH_COMPONENT24 : L === $n ? H = s.DEPTH_COMPONENT32F : L === wo && (H = s.DEPTH_COMPONENT16), H; + return N ? L === null || L === Ms || L === Mr ? H = s.DEPTH24_STENCIL8 : L === $n ? H = s.DEPTH32F_STENCIL8 : L === So && (H = s.DEPTH24_STENCIL8, He("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : L === null || L === Ms || L === Mr ? H = s.DEPTH_COMPONENT24 : L === $n ? H = s.DEPTH_COMPONENT32F : L === So && (H = s.DEPTH_COMPONENT16), H; } function M(N, L) { return x(N) === !0 || N.isFramebufferTexture && N.minFilter !== Qt && N.minFilter !== Yt ? Math.log2(Math.max(L.width, L.height)) + 1 : N.mipmaps !== void 0 && N.mipmaps.length > 0 ? N.mipmaps.length : N.isCompressedTexture && Array.isArray(N.image) ? L.mipmaps.length : 1; @@ -24994,30 +24994,30 @@ function L2(s, e, t, n, i, r, o) { } t.bindTexture(s.TEXTURE_CUBE_MAP, H.__webglTexture, s.TEXTURE0 + L); } - const Z = { + const q = { [hi]: s.REPEAT, [ai]: s.CLAMP_TO_EDGE, - [pl]: s.MIRRORED_REPEAT + [fl]: s.MIRRORED_REPEAT }, re = { [Qt]: s.NEAREST, [hm]: s.NEAREST_MIPMAP_NEAREST, - [co]: s.NEAREST_MIPMAP_LINEAR, + [ho]: s.NEAREST_MIPMAP_LINEAR, [Yt]: s.LINEAR, - [el]: s.LINEAR_MIPMAP_NEAREST, + [Qa]: s.LINEAR_MIPMAP_NEAREST, [Ai]: s.LINEAR_MIPMAP_LINEAR }, X = { [Ng]: s.NEVER, [Hg]: s.ALWAYS, - [kg]: s.LESS, + [Ug]: s.LESS, [vm]: s.LEQUAL, - [Ug]: s.EQUAL, + [Og]: s.EQUAL, [zg]: s.GEQUAL, - [Og]: s.GREATER, + [kg]: s.GREATER, [Fg]: s.NOTEQUAL }; function Y(N, L) { - if (L.type === $n && e.has("OES_texture_float_linear") === !1 && (L.magFilter === Yt || L.magFilter === el || L.magFilter === co || L.magFilter === Ai || L.minFilter === Yt || L.minFilter === el || L.minFilter === co || L.minFilter === Ai) && He("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), s.texParameteri(N, s.TEXTURE_WRAP_S, Z[L.wrapS]), s.texParameteri(N, s.TEXTURE_WRAP_T, Z[L.wrapT]), (N === s.TEXTURE_3D || N === s.TEXTURE_2D_ARRAY) && s.texParameteri(N, s.TEXTURE_WRAP_R, Z[L.wrapR]), s.texParameteri(N, s.TEXTURE_MAG_FILTER, re[L.magFilter]), s.texParameteri(N, s.TEXTURE_MIN_FILTER, re[L.minFilter]), L.compareFunction && (s.texParameteri(N, s.TEXTURE_COMPARE_MODE, s.COMPARE_REF_TO_TEXTURE), s.texParameteri(N, s.TEXTURE_COMPARE_FUNC, X[L.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) { - if (L.magFilter === Qt || L.minFilter !== co && L.minFilter !== Ai || L.type === $n && e.has("OES_texture_float_linear") === !1) return; + if (L.type === $n && e.has("OES_texture_float_linear") === !1 && (L.magFilter === Yt || L.magFilter === Qa || L.magFilter === ho || L.magFilter === Ai || L.minFilter === Yt || L.minFilter === Qa || L.minFilter === ho || L.minFilter === Ai) && He("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), s.texParameteri(N, s.TEXTURE_WRAP_S, q[L.wrapS]), s.texParameteri(N, s.TEXTURE_WRAP_T, q[L.wrapT]), (N === s.TEXTURE_3D || N === s.TEXTURE_2D_ARRAY) && s.texParameteri(N, s.TEXTURE_WRAP_R, q[L.wrapR]), s.texParameteri(N, s.TEXTURE_MAG_FILTER, re[L.magFilter]), s.texParameteri(N, s.TEXTURE_MIN_FILTER, re[L.minFilter]), L.compareFunction && (s.texParameteri(N, s.TEXTURE_COMPARE_MODE, s.COMPARE_REF_TO_TEXTURE), s.texParameteri(N, s.TEXTURE_COMPARE_FUNC, X[L.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) { + if (L.magFilter === Qt || L.minFilter !== ho && L.minFilter !== Ai || L.type === $n && e.has("OES_texture_float_linear") === !1) return; if (L.anisotropy > 1 || n.get(L).__currentAnisotropy) { const H = e.get("EXT_texture_filter_anisotropic"); s.texParameterf(N, H.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(L.anisotropy, i.getMaxAnisotropy())), n.get(L).__currentAnisotropy = L.anisotropy; @@ -25052,8 +25052,8 @@ function L2(s, e, t, n, i, r, o) { te.sort((ue, ye) => ue.start - ye.start); let Te = 0; for (let ue = 1; ue < te.length; ue++) { - const ye = te[Te], Ve = te[ue], ke = ye.start + ye.count, Ae = pe(Ve.start, L.width, 4), Ge = pe(ye.start, L.width, 4); - Ve.start <= ke + 1 && Ae === Ge && pe(Ve.start + Ve.count - 1, L.width, 4) === Ae ? ye.count = Math.max( + const ye = te[Te], Ve = te[ue], Ue = ye.start + ye.count, Ae = pe(Ve.start, L.width, 4), Ge = pe(ye.start, L.width, 4); + Ve.start <= Ue + 1 && Ae === Ge && pe(Ve.start + Ve.count - 1, L.width, 4) === Ae ? ye.count = Math.max( ye.count, Ve.start + Ve.count - ye.start ) : (++Te, te[Te] = Ve); @@ -25062,8 +25062,8 @@ function L2(s, e, t, n, i, r, o) { const be = s.getParameter(s.UNPACK_ROW_LENGTH), Re = s.getParameter(s.UNPACK_SKIP_PIXELS), De = s.getParameter(s.UNPACK_SKIP_ROWS); s.pixelStorei(s.UNPACK_ROW_LENGTH, L.width); for (let ue = 0, ye = te.length; ue < ye; ue++) { - const Ve = te[ue], ke = Math.floor(Ve.start / 4), Ae = Math.ceil(Ve.count / 4), Ge = ke % L.width, q = Math.floor(ke / L.width), Ee = Ae, _e = 1; - s.pixelStorei(s.UNPACK_SKIP_PIXELS, Ge), s.pixelStorei(s.UNPACK_SKIP_ROWS, q), t.texSubImage2D(s.TEXTURE_2D, 0, Ge, q, Ee, _e, H, K, L.data); + const Ve = te[ue], Ue = Math.floor(Ve.start / 4), Ae = Math.ceil(Ve.count / 4), Ge = Ue % L.width, Z = Math.floor(Ue / L.width), Ee = Ae, _e = 1; + s.pixelStorei(s.UNPACK_SKIP_PIXELS, Ge), s.pixelStorei(s.UNPACK_SKIP_ROWS, Z), t.texSubImage2D(s.TEXTURE_2D, 0, Ge, Z, Ee, _e, H, K, L.data); } N.clearUpdateRanges(), s.pixelStorei(s.UNPACK_ROW_LENGTH, be), s.pixelStorei(s.UNPACK_SKIP_PIXELS, Re), s.pixelStorei(s.UNPACK_SKIP_ROWS, De); } @@ -25078,37 +25078,37 @@ function L2(s, e, t, n, i, r, o) { t.activeTexture(s.TEXTURE0 + H); const be = st.getPrimaries(st.workingColorSpace), Re = L.colorSpace === Xi ? null : st.getPrimaries(L.colorSpace), De = L.colorSpace === Xi || be === Re ? s.NONE : s.BROWSER_DEFAULT_WEBGL; s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, L.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, L.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, L.unpackAlignment), s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL, De); - let ue = g(L.image, !1, i.maxTextureSize); + let ue = p(L.image, !1, i.maxTextureSize); ue = J(L, ue); const ye = r.convert(L.format, L.colorSpace), Ve = r.convert(L.type); - let ke = v(L.internalFormat, ye, Ve, L.colorSpace, L.isVideoTexture); + let Ue = v(L.internalFormat, ye, Ve, L.colorSpace, L.isVideoTexture); Y(K, L); let Ae; - const Ge = L.mipmaps, q = L.isVideoTexture !== !0, Ee = Te.__version === void 0 || le === !0, _e = te.dataReady, Me = M(L, ue); + const Ge = L.mipmaps, Z = L.isVideoTexture !== !0, Ee = Te.__version === void 0 || le === !0, _e = te.dataReady, Me = M(L, ue); if (L.isDepthTexture) - ke = y(L.format === Mr, L.type), Ee && (q ? t.texStorage2D(s.TEXTURE_2D, 1, ke, ue.width, ue.height) : t.texImage2D(s.TEXTURE_2D, 0, ke, ue.width, ue.height, 0, ye, Ve, null)); + Ue = y(L.format === wr, L.type), Ee && (Z ? t.texStorage2D(s.TEXTURE_2D, 1, Ue, ue.width, ue.height) : t.texImage2D(s.TEXTURE_2D, 0, Ue, ue.width, ue.height, 0, ye, Ve, null)); else if (L.isDataTexture) if (Ge.length > 0) { - q && Ee && t.texStorage2D(s.TEXTURE_2D, Me, ke, Ge[0].width, Ge[0].height); + Z && Ee && t.texStorage2D(s.TEXTURE_2D, Me, Ue, Ge[0].width, Ge[0].height); for (let xe = 0, me = Ge.length; xe < me; xe++) - Ae = Ge[xe], q ? _e && t.texSubImage2D(s.TEXTURE_2D, xe, 0, 0, Ae.width, Ae.height, ye, Ve, Ae.data) : t.texImage2D(s.TEXTURE_2D, xe, ke, Ae.width, Ae.height, 0, ye, Ve, Ae.data); + Ae = Ge[xe], Z ? _e && t.texSubImage2D(s.TEXTURE_2D, xe, 0, 0, Ae.width, Ae.height, ye, Ve, Ae.data) : t.texImage2D(s.TEXTURE_2D, xe, Ue, Ae.width, Ae.height, 0, ye, Ve, Ae.data); L.generateMipmaps = !1; } else - q ? (Ee && t.texStorage2D(s.TEXTURE_2D, Me, ke, ue.width, ue.height), _e && de(L, ue, ye, Ve)) : t.texImage2D(s.TEXTURE_2D, 0, ke, ue.width, ue.height, 0, ye, Ve, ue.data); + Z ? (Ee && t.texStorage2D(s.TEXTURE_2D, Me, Ue, ue.width, ue.height), _e && de(L, ue, ye, Ve)) : t.texImage2D(s.TEXTURE_2D, 0, Ue, ue.width, ue.height, 0, ye, Ve, ue.data); else if (L.isCompressedTexture) if (L.isCompressedArrayTexture) { - q && Ee && t.texStorage3D(s.TEXTURE_2D_ARRAY, Me, ke, Ge[0].width, Ge[0].height, ue.depth); + Z && Ee && t.texStorage3D(s.TEXTURE_2D_ARRAY, Me, Ue, Ge[0].width, Ge[0].height, ue.depth); for (let xe = 0, me = Ge.length; xe < me; xe++) if (Ae = Ge[xe], L.format !== xn) if (ye !== null) - if (q) { + if (Z) { if (_e) if (L.layerUpdates.size > 0) { - const Ue = ff(Ae.width, Ae.height, L.format, L.type); + const ke = df(Ae.width, Ae.height, L.format, L.type); for (const Ye of L.layerUpdates) { const yt = Ae.data.subarray( - Ye * Ue / Ae.data.BYTES_PER_ELEMENT, - (Ye + 1) * Ue / Ae.data.BYTES_PER_ELEMENT + Ye * ke / Ae.data.BYTES_PER_ELEMENT, + (Ye + 1) * ke / Ae.data.BYTES_PER_ELEMENT ); t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY, xe, 0, 0, Ye, Ae.width, Ae.height, 1, ye, yt); } @@ -25116,60 +25116,60 @@ function L2(s, e, t, n, i, r, o) { } else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY, xe, 0, 0, 0, Ae.width, Ae.height, ue.depth, ye, Ae.data); } else - t.compressedTexImage3D(s.TEXTURE_2D_ARRAY, xe, ke, Ae.width, Ae.height, ue.depth, 0, Ae.data, 0, 0); + t.compressedTexImage3D(s.TEXTURE_2D_ARRAY, xe, Ue, Ae.width, Ae.height, ue.depth, 0, Ae.data, 0, 0); else He("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"); else - q ? _e && t.texSubImage3D(s.TEXTURE_2D_ARRAY, xe, 0, 0, 0, Ae.width, Ae.height, ue.depth, ye, Ve, Ae.data) : t.texImage3D(s.TEXTURE_2D_ARRAY, xe, ke, Ae.width, Ae.height, ue.depth, 0, ye, Ve, Ae.data); + Z ? _e && t.texSubImage3D(s.TEXTURE_2D_ARRAY, xe, 0, 0, 0, Ae.width, Ae.height, ue.depth, ye, Ve, Ae.data) : t.texImage3D(s.TEXTURE_2D_ARRAY, xe, Ue, Ae.width, Ae.height, ue.depth, 0, ye, Ve, Ae.data); } else { - q && Ee && t.texStorage2D(s.TEXTURE_2D, Me, ke, Ge[0].width, Ge[0].height); + Z && Ee && t.texStorage2D(s.TEXTURE_2D, Me, Ue, Ge[0].width, Ge[0].height); for (let xe = 0, me = Ge.length; xe < me; xe++) - Ae = Ge[xe], L.format !== xn ? ye !== null ? q ? _e && t.compressedTexSubImage2D(s.TEXTURE_2D, xe, 0, 0, Ae.width, Ae.height, ye, Ae.data) : t.compressedTexImage2D(s.TEXTURE_2D, xe, ke, Ae.width, Ae.height, 0, Ae.data) : He("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : q ? _e && t.texSubImage2D(s.TEXTURE_2D, xe, 0, 0, Ae.width, Ae.height, ye, Ve, Ae.data) : t.texImage2D(s.TEXTURE_2D, xe, ke, Ae.width, Ae.height, 0, ye, Ve, Ae.data); + Ae = Ge[xe], L.format !== xn ? ye !== null ? Z ? _e && t.compressedTexSubImage2D(s.TEXTURE_2D, xe, 0, 0, Ae.width, Ae.height, ye, Ae.data) : t.compressedTexImage2D(s.TEXTURE_2D, xe, Ue, Ae.width, Ae.height, 0, Ae.data) : He("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Z ? _e && t.texSubImage2D(s.TEXTURE_2D, xe, 0, 0, Ae.width, Ae.height, ye, Ve, Ae.data) : t.texImage2D(s.TEXTURE_2D, xe, Ue, Ae.width, Ae.height, 0, ye, Ve, Ae.data); } else if (L.isDataArrayTexture) - if (q) { - if (Ee && t.texStorage3D(s.TEXTURE_2D_ARRAY, Me, ke, ue.width, ue.height, ue.depth), _e) + if (Z) { + if (Ee && t.texStorage3D(s.TEXTURE_2D_ARRAY, Me, Ue, ue.width, ue.height, ue.depth), _e) if (L.layerUpdates.size > 0) { - const xe = ff(ue.width, ue.height, L.format, L.type); + const xe = df(ue.width, ue.height, L.format, L.type); for (const me of L.layerUpdates) { - const Ue = ue.data.subarray( + const ke = ue.data.subarray( me * xe / ue.data.BYTES_PER_ELEMENT, (me + 1) * xe / ue.data.BYTES_PER_ELEMENT ); - t.texSubImage3D(s.TEXTURE_2D_ARRAY, 0, 0, 0, me, ue.width, ue.height, 1, ye, Ve, Ue); + t.texSubImage3D(s.TEXTURE_2D_ARRAY, 0, 0, 0, me, ue.width, ue.height, 1, ye, Ve, ke); } L.clearLayerUpdates(); } else t.texSubImage3D(s.TEXTURE_2D_ARRAY, 0, 0, 0, 0, ue.width, ue.height, ue.depth, ye, Ve, ue.data); } else - t.texImage3D(s.TEXTURE_2D_ARRAY, 0, ke, ue.width, ue.height, ue.depth, 0, ye, Ve, ue.data); + t.texImage3D(s.TEXTURE_2D_ARRAY, 0, Ue, ue.width, ue.height, ue.depth, 0, ye, Ve, ue.data); else if (L.isData3DTexture) - q ? (Ee && t.texStorage3D(s.TEXTURE_3D, Me, ke, ue.width, ue.height, ue.depth), _e && t.texSubImage3D(s.TEXTURE_3D, 0, 0, 0, 0, ue.width, ue.height, ue.depth, ye, Ve, ue.data)) : t.texImage3D(s.TEXTURE_3D, 0, ke, ue.width, ue.height, ue.depth, 0, ye, Ve, ue.data); + Z ? (Ee && t.texStorage3D(s.TEXTURE_3D, Me, Ue, ue.width, ue.height, ue.depth), _e && t.texSubImage3D(s.TEXTURE_3D, 0, 0, 0, 0, ue.width, ue.height, ue.depth, ye, Ve, ue.data)) : t.texImage3D(s.TEXTURE_3D, 0, Ue, ue.width, ue.height, ue.depth, 0, ye, Ve, ue.data); else if (L.isFramebufferTexture) { if (Ee) - if (q) - t.texStorage2D(s.TEXTURE_2D, Me, ke, ue.width, ue.height); + if (Z) + t.texStorage2D(s.TEXTURE_2D, Me, Ue, ue.width, ue.height); else { let xe = ue.width, me = ue.height; - for (let Ue = 0; Ue < Me; Ue++) - t.texImage2D(s.TEXTURE_2D, Ue, ke, xe, me, 0, ye, Ve, null), xe >>= 1, me >>= 1; + for (let ke = 0; ke < Me; ke++) + t.texImage2D(s.TEXTURE_2D, ke, Ue, xe, me, 0, ye, Ve, null), xe >>= 1, me >>= 1; } } else if (Ge.length > 0) { - if (q && Ee) { + if (Z && Ee) { const xe = G(Ge[0]); - t.texStorage2D(s.TEXTURE_2D, Me, ke, xe.width, xe.height); + t.texStorage2D(s.TEXTURE_2D, Me, Ue, xe.width, xe.height); } for (let xe = 0, me = Ge.length; xe < me; xe++) - Ae = Ge[xe], q ? _e && t.texSubImage2D(s.TEXTURE_2D, xe, 0, 0, ye, Ve, Ae) : t.texImage2D(s.TEXTURE_2D, xe, ke, ye, Ve, Ae); + Ae = Ge[xe], Z ? _e && t.texSubImage2D(s.TEXTURE_2D, xe, 0, 0, ye, Ve, Ae) : t.texImage2D(s.TEXTURE_2D, xe, Ue, ye, Ve, Ae); L.generateMipmaps = !1; - } else if (q) { + } else if (Z) { if (Ee) { const xe = G(ue); - t.texStorage2D(s.TEXTURE_2D, Me, ke, xe.width, xe.height); + t.texStorage2D(s.TEXTURE_2D, Me, Ue, xe.width, xe.height); } _e && t.texSubImage2D(s.TEXTURE_2D, 0, 0, 0, ye, Ve, ue); } else - t.texImage2D(s.TEXTURE_2D, 0, ke, ye, Ve, ue); + t.texImage2D(s.TEXTURE_2D, 0, Ue, ye, Ve, ue); x(L) && m(K), Te.__version = te.version, L.onUpdate && L.onUpdate(L); } N.__version = L.version; @@ -25185,38 +25185,38 @@ function L2(s, e, t, n, i, r, o) { s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, L.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, L.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, L.unpackAlignment), s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL, Re); const De = L.isCompressedTexture || L.image[0].isCompressedTexture, ue = L.image[0] && L.image[0].isDataTexture, ye = []; for (let me = 0; me < 6; me++) - !De && !ue ? ye[me] = g(L.image[me], !0, i.maxCubemapSize) : ye[me] = ue ? L.image[me].image : L.image[me], ye[me] = J(L, ye[me]); - const Ve = ye[0], ke = r.convert(L.format, L.colorSpace), Ae = r.convert(L.type), Ge = v(L.internalFormat, ke, Ae, L.colorSpace), q = L.isVideoTexture !== !0, Ee = te.__version === void 0 || K === !0, _e = le.dataReady; + !De && !ue ? ye[me] = p(L.image[me], !0, i.maxCubemapSize) : ye[me] = ue ? L.image[me].image : L.image[me], ye[me] = J(L, ye[me]); + const Ve = ye[0], Ue = r.convert(L.format, L.colorSpace), Ae = r.convert(L.type), Ge = v(L.internalFormat, Ue, Ae, L.colorSpace), Z = L.isVideoTexture !== !0, Ee = te.__version === void 0 || K === !0, _e = le.dataReady; let Me = M(L, Ve); Y(s.TEXTURE_CUBE_MAP, L); let xe; if (De) { - q && Ee && t.texStorage2D(s.TEXTURE_CUBE_MAP, Me, Ge, Ve.width, Ve.height); + Z && Ee && t.texStorage2D(s.TEXTURE_CUBE_MAP, Me, Ge, Ve.width, Ve.height); for (let me = 0; me < 6; me++) { xe = ye[me].mipmaps; - for (let Ue = 0; Ue < xe.length; Ue++) { - const Ye = xe[Ue]; - L.format !== xn ? ke !== null ? q ? _e && t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue, 0, 0, Ye.width, Ye.height, ke, Ye.data) : t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue, Ge, Ye.width, Ye.height, 0, Ye.data) : He("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : q ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue, 0, 0, Ye.width, Ye.height, ke, Ae, Ye.data) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue, Ge, Ye.width, Ye.height, 0, ke, Ae, Ye.data); + for (let ke = 0; ke < xe.length; ke++) { + const Ye = xe[ke]; + L.format !== xn ? Ue !== null ? Z ? _e && t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke, 0, 0, Ye.width, Ye.height, Ue, Ye.data) : t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke, Ge, Ye.width, Ye.height, 0, Ye.data) : He("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : Z ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke, 0, 0, Ye.width, Ye.height, Ue, Ae, Ye.data) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke, Ge, Ye.width, Ye.height, 0, Ue, Ae, Ye.data); } } } else { - if (xe = L.mipmaps, q && Ee) { + if (xe = L.mipmaps, Z && Ee) { xe.length > 0 && Me++; const me = G(ye[0]); t.texStorage2D(s.TEXTURE_CUBE_MAP, Me, Ge, me.width, me.height); } for (let me = 0; me < 6; me++) if (ue) { - q ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, 0, 0, ye[me].width, ye[me].height, ke, Ae, ye[me].data) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, Ge, ye[me].width, ye[me].height, 0, ke, Ae, ye[me].data); - for (let Ue = 0; Ue < xe.length; Ue++) { - const yt = xe[Ue].image[me].image; - q ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue + 1, 0, 0, yt.width, yt.height, ke, Ae, yt.data) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue + 1, Ge, yt.width, yt.height, 0, ke, Ae, yt.data); + Z ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, 0, 0, ye[me].width, ye[me].height, Ue, Ae, ye[me].data) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, Ge, ye[me].width, ye[me].height, 0, Ue, Ae, ye[me].data); + for (let ke = 0; ke < xe.length; ke++) { + const yt = xe[ke].image[me].image; + Z ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke + 1, 0, 0, yt.width, yt.height, Ue, Ae, yt.data) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke + 1, Ge, yt.width, yt.height, 0, Ue, Ae, yt.data); } } else { - q ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, 0, 0, ke, Ae, ye[me]) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, Ge, ke, Ae, ye[me]); - for (let Ue = 0; Ue < xe.length; Ue++) { - const Ye = xe[Ue]; - q ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue + 1, 0, 0, ke, Ae, Ye.image[me]) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, Ue + 1, Ge, ke, Ae, Ye.image[me]); + Z ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, 0, 0, Ue, Ae, ye[me]) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, 0, Ge, Ue, Ae, ye[me]); + for (let ke = 0; ke < xe.length; ke++) { + const Ye = xe[ke]; + Z ? _e && t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke + 1, 0, 0, Ue, Ae, Ye.image[me]) : t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + me, ke + 1, Ge, Ue, Ae, Ye.image[me]); } } } @@ -25230,16 +25230,16 @@ function L2(s, e, t, n, i, r, o) { const ye = Math.max(1, L.width >> te), Ve = Math.max(1, L.height >> te); le === s.TEXTURE_3D || le === s.TEXTURE_2D_ARRAY ? t.texImage3D(le, te, Re, ye, Ve, L.depth, 0, Te, be, null) : t.texImage2D(le, te, Re, ye, Ve, 0, Te, be, null); } - t.bindFramebuffer(s.FRAMEBUFFER, N), z(L) ? a.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER, K, le, ue.__webglTexture, 0, k(L)) : (le === s.TEXTURE_2D || le >= s.TEXTURE_CUBE_MAP_POSITIVE_X && le <= s.TEXTURE_CUBE_MAP_NEGATIVE_Z) && s.framebufferTexture2D(s.FRAMEBUFFER, K, le, ue.__webglTexture, te), t.bindFramebuffer(s.FRAMEBUFFER, null); + t.bindFramebuffer(s.FRAMEBUFFER, N), z(L) ? a.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER, K, le, ue.__webglTexture, 0, U(L)) : (le === s.TEXTURE_2D || le >= s.TEXTURE_CUBE_MAP_POSITIVE_X && le <= s.TEXTURE_CUBE_MAP_NEGATIVE_Z) && s.framebufferTexture2D(s.FRAMEBUFFER, K, le, ue.__webglTexture, te), t.bindFramebuffer(s.FRAMEBUFFER, null); } function ve(N, L, H) { if (s.bindRenderbuffer(s.RENDERBUFFER, N), L.depthBuffer) { - const K = L.depthTexture, le = K && K.isDepthTexture ? K.type : null, te = y(L.stencilBuffer, le), Te = L.stencilBuffer ? s.DEPTH_STENCIL_ATTACHMENT : s.DEPTH_ATTACHMENT, be = k(L); + const K = L.depthTexture, le = K && K.isDepthTexture ? K.type : null, te = y(L.stencilBuffer, le), Te = L.stencilBuffer ? s.DEPTH_STENCIL_ATTACHMENT : s.DEPTH_ATTACHMENT, be = U(L); z(L) ? a.renderbufferStorageMultisampleEXT(s.RENDERBUFFER, be, te, L.width, L.height) : H ? s.renderbufferStorageMultisample(s.RENDERBUFFER, be, te, L.width, L.height) : s.renderbufferStorage(s.RENDERBUFFER, te, L.width, L.height), s.framebufferRenderbuffer(s.FRAMEBUFFER, Te, s.RENDERBUFFER, N); } else { const K = L.textures; for (let le = 0; le < K.length; le++) { - const te = K[le], Te = r.convert(te.format, te.colorSpace), be = r.convert(te.type), Re = v(te.internalFormat, Te, be, te.colorSpace), De = k(L); + const te = K[le], Te = r.convert(te.format, te.colorSpace), be = r.convert(te.type), Re = v(te.internalFormat, Te, be, te.colorSpace), De = U(L); H && z(L) === !1 ? s.renderbufferStorageMultisample(s.RENDERBUFFER, De, Re, L.width, L.height) : z(L) ? a.renderbufferStorageMultisampleEXT(s.RENDERBUFFER, De, Re, L.width, L.height) : s.renderbufferStorage(s.RENDERBUFFER, Re, L.width, L.height); } } @@ -25251,10 +25251,10 @@ function L2(s, e, t, n, i, r, o) { throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); const K = n.get(L.depthTexture); K.__renderTarget = L, (!K.__webglTexture || L.depthTexture.image.width !== L.width || L.depthTexture.image.height !== L.height) && (L.depthTexture.image.width = L.width, L.depthTexture.image.height = L.height, L.depthTexture.needsUpdate = !0), F(L.depthTexture, 0); - const le = K.__webglTexture, te = k(L); - if (L.depthTexture.format === So) + const le = K.__webglTexture, te = U(L); + if (L.depthTexture.format === Eo) z(L) ? a.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER, s.DEPTH_ATTACHMENT, s.TEXTURE_2D, le, 0, te) : s.framebufferTexture2D(s.FRAMEBUFFER, s.DEPTH_ATTACHMENT, s.TEXTURE_2D, le, 0); - else if (L.depthTexture.format === Mr) + else if (L.depthTexture.format === wr) z(L) ? a.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER, s.DEPTH_STENCIL_ATTACHMENT, s.TEXTURE_2D, le, 0, te) : s.framebufferTexture2D(s.FRAMEBUFFER, s.DEPTH_STENCIL_ATTACHMENT, s.TEXTURE_2D, le, 0); else throw new Error("Unknown depthTexture format"); @@ -25329,7 +25329,7 @@ function L2(s, e, t, n, i, r, o) { for (let be = 0; be < le.length; be++) { const Re = le[be]; H.__webglColorRenderbuffer[be] = s.createRenderbuffer(), s.bindRenderbuffer(s.RENDERBUFFER, H.__webglColorRenderbuffer[be]); - const De = r.convert(Re.format, Re.colorSpace), ue = r.convert(Re.type), ye = v(Re.internalFormat, De, ue, Re.colorSpace, N.isXRRenderTarget === !0), Ve = k(N); + const De = r.convert(Re.format, Re.colorSpace), ue = r.convert(Re.type), ye = v(Re.internalFormat, De, ue, Re.colorSpace, N.isXRRenderTarget === !0), Ve = U(N); s.renderbufferStorageMultisample(s.RENDERBUFFER, Ve, ye, N.width, N.height), s.framebufferRenderbuffer(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0 + be, s.RENDERBUFFER, H.__webglColorRenderbuffer[be]); } s.bindRenderbuffer(s.RENDERBUFFER, null), N.depthBuffer && (H.__webglDepthRenderbuffer = s.createRenderbuffer(), ve(H.__webglDepthRenderbuffer, N, !0)), t.bindFramebuffer(s.FRAMEBUFFER, null); @@ -25373,7 +25373,7 @@ function L2(s, e, t, n, i, r, o) { } } const I = [], V = []; - function U(N) { + function O(N) { if (N.samples > 0) { if (z(N) === !1) { const L = N.textures, H = N.width, K = N.height; @@ -25406,7 +25406,7 @@ function L2(s, e, t, n, i, r, o) { } } } - function k(N) { + function U(N) { return Math.min(i.maxSamples, N.samples); } function z(N) { @@ -25419,53 +25419,53 @@ function L2(s, e, t, n, i, r, o) { } function J(N, L) { const H = N.colorSpace, K = N.format, le = N.type; - return N.isCompressedTexture === !0 || N.isVideoTexture === !0 || H !== Bt && H !== Xi && (st.getTransfer(H) === lt ? (K !== xn || le !== Jn) && He("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : et("WebGLTextures: Unsupported texture color space:", H)), L; + return N.isCompressedTexture === !0 || N.isVideoTexture === !0 || H !== It && H !== Xi && (st.getTransfer(H) === lt ? (K !== xn || le !== Jn) && He("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : et("WebGLTextures: Unsupported texture color space:", H)), L; } function G(N) { return typeof HTMLImageElement < "u" && N instanceof HTMLImageElement ? (c.width = N.naturalWidth || N.width, c.height = N.naturalHeight || N.height) : typeof VideoFrame < "u" && N instanceof VideoFrame ? (c.width = N.displayWidth, c.height = N.displayHeight) : (c.width = N.width, c.height = N.height), c; } - this.allocateTextureUnit = B, this.resetTextureUnits = C, this.setTexture2D = F, this.setTexture2DArray = W, this.setTexture3D = j, this.setTextureCube = $, this.rebindTextures = Ke, this.setupRenderTarget = Ne, this.updateRenderTargetMipmap = T, this.updateMultisampleRenderTarget = U, this.setupDepthRenderbuffer = Be, this.setupFrameBufferTexture = fe, this.useMultisampledRTT = z; + this.allocateTextureUnit = B, this.resetTextureUnits = C, this.setTexture2D = F, this.setTexture2DArray = W, this.setTexture3D = j, this.setTextureCube = $, this.rebindTextures = Ke, this.setupRenderTarget = Ne, this.updateRenderTargetMipmap = T, this.updateMultisampleRenderTarget = O, this.setupDepthRenderbuffer = Be, this.setupFrameBufferTexture = fe, this.useMultisampledRTT = z; } function D2(s, e) { function t(n, i = Xi) { let r; const o = st.getTransfer(i); if (n === Jn) return s.UNSIGNED_BYTE; - if (n === wu) return s.UNSIGNED_SHORT_4_4_4_4; - if (n === Su) return s.UNSIGNED_SHORT_5_5_5_1; + if (n === Mu) return s.UNSIGNED_SHORT_4_4_4_4; + if (n === wu) return s.UNSIGNED_SHORT_5_5_5_1; if (n === fm) return s.UNSIGNED_INT_5_9_9_9_REV; if (n === pm) return s.UNSIGNED_INT_10F_11F_11F_REV; if (n === um) return s.BYTE; if (n === dm) return s.SHORT; - if (n === wo) return s.UNSIGNED_SHORT; - if (n === Mu) return s.INT; + if (n === So) return s.UNSIGNED_SHORT; + if (n === _u) return s.INT; if (n === Ms) return s.UNSIGNED_INT; if (n === $n) return s.FLOAT; - if (n === Un) return s.HALF_FLOAT; + if (n === On) return s.HALF_FLOAT; if (n === mm) return s.ALPHA; if (n === gm) return s.RGB; if (n === xn) return s.RGBA; - if (n === So) return s.DEPTH_COMPONENT; - if (n === Mr) return s.DEPTH_STENCIL; - if (n === Eu) return s.RED; - if (n === Tu) return s.RED_INTEGER; - if (n === Au) return s.RG; - if (n === Cu) return s.RG_INTEGER; - if (n === Pu) return s.RGBA_INTEGER; - if (n === tl || n === nl || n === il || n === sl) + if (n === Eo) return s.DEPTH_COMPONENT; + if (n === wr) return s.DEPTH_STENCIL; + if (n === Su) return s.RED; + if (n === Eu) return s.RED_INTEGER; + if (n === Tu) return s.RG; + if (n === Au) return s.RG_INTEGER; + if (n === Cu) return s.RGBA_INTEGER; + if (n === el || n === tl || n === nl || n === il) if (o === lt) if (r = e.get("WEBGL_compressed_texture_s3tc_srgb"), r !== null) { - if (n === tl) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT; - if (n === nl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - if (n === il) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - if (n === sl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + if (n === el) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT; + if (n === tl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + if (n === nl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + if (n === il) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; } else return null; else if (r = e.get("WEBGL_compressed_texture_s3tc"), r !== null) { - if (n === tl) return r.COMPRESSED_RGB_S3TC_DXT1_EXT; - if (n === nl) return r.COMPRESSED_RGBA_S3TC_DXT1_EXT; - if (n === il) return r.COMPRESSED_RGBA_S3TC_DXT3_EXT; - if (n === sl) return r.COMPRESSED_RGBA_S3TC_DXT5_EXT; + if (n === el) return r.COMPRESSED_RGB_S3TC_DXT1_EXT; + if (n === tl) return r.COMPRESSED_RGBA_S3TC_DXT1_EXT; + if (n === nl) return r.COMPRESSED_RGBA_S3TC_DXT3_EXT; + if (n === il) return r.COMPRESSED_RGBA_S3TC_DXT5_EXT; } else return null; if (n === vh || n === bh || n === yh || n === _h) @@ -25482,7 +25482,7 @@ function D2(s, e) { if (n === Sh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC; } else return null; - if (n === Eh || n === Th || n === Ah || n === Ch || n === Ph || n === Rh || n === Lh || n === Dh || n === Ih || n === Bh || n === Nh || n === kh || n === Uh || n === Oh) + if (n === Eh || n === Th || n === Ah || n === Ch || n === Ph || n === Rh || n === Lh || n === Dh || n === Ih || n === Bh || n === Nh || n === Uh || n === Oh || n === kh) if (r = e.get("WEBGL_compressed_texture_astc"), r !== null) { if (n === Eh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR; if (n === Th) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR; @@ -25495,9 +25495,9 @@ function D2(s, e) { if (n === Ih) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR; if (n === Bh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR; if (n === Nh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR; - if (n === kh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR; - if (n === Uh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR; - if (n === Oh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR; + if (n === Uh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR; + if (n === Oh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR; + if (n === kh) return o === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR; } else return null; if (n === Fh || n === zh || n === Hh) @@ -25515,7 +25515,7 @@ function D2(s, e) { if (n === Xh) return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT; } else return null; - return n === _r ? s.UNSIGNED_INT_24_8 : s[n] !== void 0 ? s[n] : null; + return n === Mr ? s.UNSIGNED_INT_24_8 : s[n] !== void 0 ? s[n] : null; } return { convert: t }; } @@ -25571,7 +25571,7 @@ class N2 { */ getMesh(e) { if (this.texture !== null && this.mesh === null) { - const t = e.cameras[0].viewport, n = new Ut({ + const t = e.cameras[0].viewport, n = new Ot({ vertexShader: I2, fragmentShader: B2, uniforms: { @@ -25580,7 +25580,7 @@ class N2 { depthHeight: { value: t.w } } }); - this.mesh = new dt(new ko(20, 20), n); + this.mesh = new dt(new Uo(20, 20), n); } return this.mesh; } @@ -25599,7 +25599,7 @@ class N2 { return this.texture; } } -class k2 extends As { +class U2 extends Cs { /** * Constructs a new WebGL renderer. * @@ -25609,8 +25609,8 @@ class k2 extends As { constructor(e, t) { super(); const n = this; - let i = null, r = 1, o = null, a = "local-floor", l = 1, c = null, h = null, u = null, d = null, f = null, p = null; - const g = typeof XRWebGLBinding < "u", x = new N2(), m = {}, b = t.getContextAttributes(); + let i = null, r = 1, o = null, a = "local-floor", l = 1, c = null, h = null, u = null, d = null, f = null, g = null; + const p = typeof XRWebGLBinding < "u", x = new N2(), m = {}, b = t.getContextAttributes(); let v = null, y = null; const M = [], E = [], A = new ce(); let R = null; @@ -25659,16 +25659,16 @@ class k2 extends As { }, this.getBaseLayer = function() { return d !== null ? d : f; }, this.getBinding = function() { - return u === null && g && (u = new XRWebGLBinding(i, t)), u; + return u === null && p && (u = new XRWebGLBinding(i, t)), u; }, this.getFrame = function() { - return p; + return g; }, this.getSession = function() { return i; }, this.setSession = async function(ie) { if (i = ie, i !== null) { - if (v = e.getRenderTarget(), i.addEventListener("select", F), i.addEventListener("selectstart", F), i.addEventListener("selectend", F), i.addEventListener("squeeze", F), i.addEventListener("squeezestart", F), i.addEventListener("squeezeend", F), i.addEventListener("end", W), i.addEventListener("inputsourceschange", j), b.xrCompatible !== !0 && await t.makeXRCompatible(), R = e.getPixelRatio(), e.getSize(A), g && "createProjectionLayer" in XRWebGLBinding.prototype) { + if (v = e.getRenderTarget(), i.addEventListener("select", F), i.addEventListener("selectstart", F), i.addEventListener("selectend", F), i.addEventListener("squeeze", F), i.addEventListener("squeezestart", F), i.addEventListener("squeezeend", F), i.addEventListener("end", W), i.addEventListener("inputsourceschange", j), b.xrCompatible !== !0 && await t.makeXRCompatible(), R = e.getPixelRatio(), e.getSize(A), p && "createProjectionLayer" in XRWebGLBinding.prototype) { let fe = null, ve = null, we = null; - b.depth && (we = b.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, fe = b.stencil ? Mr : So, ve = b.stencil ? _r : Ms); + b.depth && (we = b.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, fe = b.stencil ? wr : Eo, ve = b.stencil ? Mr : Ms); const Be = { colorFormat: t.RGBA8, depthFormat: we, @@ -25680,7 +25680,7 @@ class k2 extends As { { format: xn, type: Jn, - depthTexture: new ku(d.textureWidth, d.textureHeight, ve, void 0, void 0, void 0, void 0, void 0, void 0, fe), + depthTexture: new Nu(d.textureWidth, d.textureHeight, ve, void 0, void 0, void 0, void 0, void 0, void 0, fe), stencilBuffer: b.stencil, colorSpace: e.outputColorSpace, samples: b.antialias ? 4 : 0, @@ -25740,14 +25740,14 @@ class k2 extends As { we && we.connect(fe); } } - const $ = new P(), Z = new P(); + const $ = new P(), q = new P(); function re(ie, he, fe) { - $.setFromMatrixPosition(he.matrixWorld), Z.setFromMatrixPosition(fe.matrixWorld); - const ve = $.distanceTo(Z), we = he.projectionMatrix.elements, Be = fe.projectionMatrix.elements, Ke = we[14] / (we[10] - 1), Ne = we[14] / (we[10] + 1), T = (we[9] + 1) / we[5], I = (we[9] - 1) / we[5], V = (we[8] - 1) / we[0], U = (Be[8] + 1) / Be[0], k = Ke * V, z = Ke * U, ee = ve / (-V + U), J = ee * -V; + $.setFromMatrixPosition(he.matrixWorld), q.setFromMatrixPosition(fe.matrixWorld); + const ve = $.distanceTo(q), we = he.projectionMatrix.elements, Be = fe.projectionMatrix.elements, Ke = we[14] / (we[10] - 1), Ne = we[14] / (we[10] + 1), T = (we[9] + 1) / we[5], I = (we[9] - 1) / we[5], V = (we[8] - 1) / we[0], O = (Be[8] + 1) / Be[0], U = Ke * V, z = Ke * O, ee = ve / (-V + O), J = ee * -V; if (he.matrixWorld.decompose(ie.position, ie.quaternion, ie.scale), ie.translateX(J), ie.translateZ(ee), ie.matrixWorld.compose(ie.position, ie.quaternion, ie.scale), ie.matrixWorldInverse.copy(ie.matrixWorld).invert(), we[10] === -1) ie.projectionMatrix.copy(he.projectionMatrix), ie.projectionMatrixInverse.copy(he.projectionMatrixInverse); else { - const G = Ke + ee, N = Ne + ee, L = k - J, H = z + (ve - J), K = T * Ne / N * G, le = I * Ne / N * G; + const G = Ke + ee, N = Ne + ee, L = U - J, H = z + (ve - J), K = T * Ne / N * G, le = I * Ne / N * G; ie.projectionMatrix.makePerspective(L, H, K, le, G, N), ie.projectionMatrixInverse.copy(ie.projectionMatrix).invert(); } } @@ -25768,7 +25768,7 @@ class k2 extends As { we.length === 2 ? re(C, _, S) : C.projectionMatrix.copy(_.projectionMatrix), Y(ie, C, ve); }; function Y(ie, he, fe) { - fe === null ? ie.matrix.copy(he.matrixWorld) : (ie.matrix.copy(fe.matrixWorld), ie.matrix.invert(), ie.matrix.multiply(he.matrixWorld)), ie.matrix.decompose(ie.position, ie.quaternion, ie.scale), ie.updateMatrixWorld(!0), ie.projectionMatrix.copy(he.projectionMatrix), ie.projectionMatrixInverse.copy(he.projectionMatrixInverse), ie.isPerspectiveCamera && (ie.fov = wr * 2 * Math.atan(1 / ie.projectionMatrix.elements[5]), ie.zoom = 1); + fe === null ? ie.matrix.copy(he.matrixWorld) : (ie.matrix.copy(fe.matrixWorld), ie.matrix.invert(), ie.matrix.multiply(he.matrixWorld)), ie.matrix.decompose(ie.position, ie.quaternion, ie.scale), ie.updateMatrixWorld(!0), ie.projectionMatrix.copy(he.projectionMatrix), ie.projectionMatrixInverse.copy(he.projectionMatrixInverse), ie.isPerspectiveCamera && (ie.fov = Sr * 2 * Math.atan(1 / ie.projectionMatrix.elements[5]), ie.zoom = 1); } this.getCamera = function() { return C; @@ -25786,7 +25786,7 @@ class k2 extends As { }; let ge = null; function pe(ie, he) { - if (h = he.getViewerPose(c || o), p = he, h !== null) { + if (h = he.getViewerPose(c || o), g = he, h !== null) { const fe = h.views; f !== null && (e.setRenderTargetFramebuffer(y, f.framebuffer), e.setRenderTarget(y)); let ve = !1; @@ -25797,23 +25797,23 @@ class k2 extends As { if (f !== null) I = f.getViewport(T); else { - const U = u.getViewSubImage(d, T); - I = U.viewport, Ne === 0 && (e.setRenderTargetTextures( + const O = u.getViewSubImage(d, T); + I = O.viewport, Ne === 0 && (e.setRenderTargetTextures( y, - U.colorTexture, - U.depthStencilTexture + O.colorTexture, + O.depthStencilTexture ), e.setRenderTarget(y)); } let V = D[Ne]; V === void 0 && (V = new nn(), V.layers.enable(Ne), V.viewport = new tt(), D[Ne] = V), V.matrix.fromArray(T.transform.matrix), V.matrix.decompose(V.position, V.quaternion, V.scale), V.projectionMatrix.fromArray(T.projectionMatrix), V.projectionMatrixInverse.copy(V.projectionMatrix).invert(), V.viewport.set(I.x, I.y, I.width, I.height), Ne === 0 && (C.matrix.copy(V.matrix), C.matrix.decompose(C.position, C.quaternion, C.scale)), ve === !0 && C.cameras.push(V); } const we = i.enabledFeatures; - if (we && we.includes("depth-sensing") && i.depthUsage == "gpu-optimized" && g) { + if (we && we.includes("depth-sensing") && i.depthUsage == "gpu-optimized" && p) { u = n.getBinding(); const Ne = u.getDepthInformation(fe[0]); Ne && Ne.isValid && Ne.texture && x.init(Ne, i.renderState); } - if (we && we.includes("camera-access") && g) { + if (we && we.includes("camera-access") && p) { e.state.unbindTexture(), u = n.getBinding(); for (let Ne = 0; Ne < fe.length; Ne++) { const T = fe[Ne].camera; @@ -25830,17 +25830,17 @@ class k2 extends As { const ve = E[fe], we = M[fe]; ve !== null && we !== void 0 && we.update(ve, he, c || o); } - ge && ge(ie, he), he.detectedPlanes && n.dispatchEvent({ type: "planesdetected", data: he }), p = null; + ge && ge(ie, he), he.detectedPlanes && n.dispatchEvent({ type: "planesdetected", data: he }), g = null; } - const de = new qm(); + const de = new Zm(); de.setAnimationLoop(pe), this.setAnimationLoop = function(ie) { ge = ie; }, this.dispose = function() { }; } } -const ls = /* @__PURE__ */ new wn(), U2 = /* @__PURE__ */ new ze(); -function O2(s, e) { +const ls = /* @__PURE__ */ new wn(), O2 = /* @__PURE__ */ new ze(); +function k2(s, e) { function t(x, m) { x.matrixAutoUpdate === !0 && x.updateMatrix(), m.value.copy(x.matrix); } @@ -25848,12 +25848,12 @@ function O2(s, e) { m.color.getRGB(x.fogColor.value, Sm(s)), m.isFog ? (x.fogNear.value = m.near, x.fogFar.value = m.far) : m.isFogExp2 && (x.fogDensity.value = m.density); } function i(x, m, b, v, y) { - m.isMeshBasicMaterial || m.isMeshLambertMaterial ? r(x, m) : m.isMeshToonMaterial ? (r(x, m), u(x, m)) : m.isMeshPhongMaterial ? (r(x, m), h(x, m)) : m.isMeshStandardMaterial ? (r(x, m), d(x, m), m.isMeshPhysicalMaterial && f(x, m, y)) : m.isMeshMatcapMaterial ? (r(x, m), p(x, m)) : m.isMeshDepthMaterial ? r(x, m) : m.isMeshDistanceMaterial ? (r(x, m), g(x, m)) : m.isMeshNormalMaterial ? r(x, m) : m.isLineBasicMaterial ? (o(x, m), m.isLineDashedMaterial && a(x, m)) : m.isPointsMaterial ? l(x, m, b, v) : m.isSpriteMaterial ? c(x, m) : m.isShadowMaterial ? (x.color.value.copy(m.color), x.opacity.value = m.opacity) : m.isShaderMaterial && (m.uniformsNeedUpdate = !1); + m.isMeshBasicMaterial || m.isMeshLambertMaterial ? r(x, m) : m.isMeshToonMaterial ? (r(x, m), u(x, m)) : m.isMeshPhongMaterial ? (r(x, m), h(x, m)) : m.isMeshStandardMaterial ? (r(x, m), d(x, m), m.isMeshPhysicalMaterial && f(x, m, y)) : m.isMeshMatcapMaterial ? (r(x, m), g(x, m)) : m.isMeshDepthMaterial ? r(x, m) : m.isMeshDistanceMaterial ? (r(x, m), p(x, m)) : m.isMeshNormalMaterial ? r(x, m) : m.isLineBasicMaterial ? (o(x, m), m.isLineDashedMaterial && a(x, m)) : m.isPointsMaterial ? l(x, m, b, v) : m.isSpriteMaterial ? c(x, m) : m.isShadowMaterial ? (x.color.value.copy(m.color), x.opacity.value = m.opacity) : m.isShaderMaterial && (m.uniformsNeedUpdate = !1); } function r(x, m) { x.opacity.value = m.opacity, m.color && x.diffuse.value.copy(m.color), m.emissive && x.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity), m.map && (x.map.value = m.map, t(m.map, x.mapTransform)), m.alphaMap && (x.alphaMap.value = m.alphaMap, t(m.alphaMap, x.alphaMapTransform)), m.bumpMap && (x.bumpMap.value = m.bumpMap, t(m.bumpMap, x.bumpMapTransform), x.bumpScale.value = m.bumpScale, m.side === un && (x.bumpScale.value *= -1)), m.normalMap && (x.normalMap.value = m.normalMap, t(m.normalMap, x.normalMapTransform), x.normalScale.value.copy(m.normalScale), m.side === un && x.normalScale.value.negate()), m.displacementMap && (x.displacementMap.value = m.displacementMap, t(m.displacementMap, x.displacementMapTransform), x.displacementScale.value = m.displacementScale, x.displacementBias.value = m.displacementBias), m.emissiveMap && (x.emissiveMap.value = m.emissiveMap, t(m.emissiveMap, x.emissiveMapTransform)), m.specularMap && (x.specularMap.value = m.specularMap, t(m.specularMap, x.specularMapTransform)), m.alphaTest > 0 && (x.alphaTest.value = m.alphaTest); const b = e.get(m), v = b.envMap, y = b.envMapRotation; - v && (x.envMap.value = v, ls.copy(y), ls.x *= -1, ls.y *= -1, ls.z *= -1, v.isCubeTexture && v.isRenderTargetTexture === !1 && (ls.y *= -1, ls.z *= -1), x.envMapRotation.value.setFromMatrix4(U2.makeRotationFromEuler(ls)), x.flipEnvMap.value = v.isCubeTexture && v.isRenderTargetTexture === !1 ? -1 : 1, x.reflectivity.value = m.reflectivity, x.ior.value = m.ior, x.refractionRatio.value = m.refractionRatio), m.lightMap && (x.lightMap.value = m.lightMap, x.lightMapIntensity.value = m.lightMapIntensity, t(m.lightMap, x.lightMapTransform)), m.aoMap && (x.aoMap.value = m.aoMap, x.aoMapIntensity.value = m.aoMapIntensity, t(m.aoMap, x.aoMapTransform)); + v && (x.envMap.value = v, ls.copy(y), ls.x *= -1, ls.y *= -1, ls.z *= -1, v.isCubeTexture && v.isRenderTargetTexture === !1 && (ls.y *= -1, ls.z *= -1), x.envMapRotation.value.setFromMatrix4(O2.makeRotationFromEuler(ls)), x.flipEnvMap.value = v.isCubeTexture && v.isRenderTargetTexture === !1 ? -1 : 1, x.reflectivity.value = m.reflectivity, x.ior.value = m.ior, x.refractionRatio.value = m.refractionRatio), m.lightMap && (x.lightMap.value = m.lightMap, x.lightMapIntensity.value = m.lightMapIntensity, t(m.lightMap, x.lightMapTransform)), m.aoMap && (x.aoMap.value = m.aoMap, x.aoMapIntensity.value = m.aoMapIntensity, t(m.aoMap, x.aoMapTransform)); } function o(x, m) { x.diffuse.value.copy(m.color), x.opacity.value = m.opacity, m.map && (x.map.value = m.map, t(m.map, x.mapTransform)); @@ -25879,10 +25879,10 @@ function O2(s, e) { function f(x, m, b) { x.ior.value = m.ior, m.sheen > 0 && (x.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen), x.sheenRoughness.value = m.sheenRoughness, m.sheenColorMap && (x.sheenColorMap.value = m.sheenColorMap, t(m.sheenColorMap, x.sheenColorMapTransform)), m.sheenRoughnessMap && (x.sheenRoughnessMap.value = m.sheenRoughnessMap, t(m.sheenRoughnessMap, x.sheenRoughnessMapTransform))), m.clearcoat > 0 && (x.clearcoat.value = m.clearcoat, x.clearcoatRoughness.value = m.clearcoatRoughness, m.clearcoatMap && (x.clearcoatMap.value = m.clearcoatMap, t(m.clearcoatMap, x.clearcoatMapTransform)), m.clearcoatRoughnessMap && (x.clearcoatRoughnessMap.value = m.clearcoatRoughnessMap, t(m.clearcoatRoughnessMap, x.clearcoatRoughnessMapTransform)), m.clearcoatNormalMap && (x.clearcoatNormalMap.value = m.clearcoatNormalMap, t(m.clearcoatNormalMap, x.clearcoatNormalMapTransform), x.clearcoatNormalScale.value.copy(m.clearcoatNormalScale), m.side === un && x.clearcoatNormalScale.value.negate())), m.dispersion > 0 && (x.dispersion.value = m.dispersion), m.iridescence > 0 && (x.iridescence.value = m.iridescence, x.iridescenceIOR.value = m.iridescenceIOR, x.iridescenceThicknessMinimum.value = m.iridescenceThicknessRange[0], x.iridescenceThicknessMaximum.value = m.iridescenceThicknessRange[1], m.iridescenceMap && (x.iridescenceMap.value = m.iridescenceMap, t(m.iridescenceMap, x.iridescenceMapTransform)), m.iridescenceThicknessMap && (x.iridescenceThicknessMap.value = m.iridescenceThicknessMap, t(m.iridescenceThicknessMap, x.iridescenceThicknessMapTransform))), m.transmission > 0 && (x.transmission.value = m.transmission, x.transmissionSamplerMap.value = b.texture, x.transmissionSamplerSize.value.set(b.width, b.height), m.transmissionMap && (x.transmissionMap.value = m.transmissionMap, t(m.transmissionMap, x.transmissionMapTransform)), x.thickness.value = m.thickness, m.thicknessMap && (x.thicknessMap.value = m.thicknessMap, t(m.thicknessMap, x.thicknessMapTransform)), x.attenuationDistance.value = m.attenuationDistance, x.attenuationColor.value.copy(m.attenuationColor)), m.anisotropy > 0 && (x.anisotropyVector.value.set(m.anisotropy * Math.cos(m.anisotropyRotation), m.anisotropy * Math.sin(m.anisotropyRotation)), m.anisotropyMap && (x.anisotropyMap.value = m.anisotropyMap, t(m.anisotropyMap, x.anisotropyMapTransform))), x.specularIntensity.value = m.specularIntensity, x.specularColor.value.copy(m.specularColor), m.specularColorMap && (x.specularColorMap.value = m.specularColorMap, t(m.specularColorMap, x.specularColorMapTransform)), m.specularIntensityMap && (x.specularIntensityMap.value = m.specularIntensityMap, t(m.specularIntensityMap, x.specularIntensityMapTransform)); } - function p(x, m) { + function g(x, m) { m.matcap && (x.matcap.value = m.matcap); } - function g(x, m) { + function p(x, m) { const b = e.get(m).light; x.referencePosition.value.setFromMatrixPosition(b.matrixWorld), x.nearDistance.value = b.shadow.camera.near, x.farDistance.value = b.shadow.camera.far; } @@ -25900,7 +25900,7 @@ function F2(s, e, t, n) { } function c(b, v) { let y = i[b.id]; - y === void 0 && (p(b), y = h(b), i[b.id] = y, b.addEventListener("dispose", x)); + y === void 0 && (g(b), y = h(b), i[b.id] = y, b.addEventListener("dispose", x)); const M = v.program; n.updateUBOMapping(b, M); const E = e.render.frame; @@ -25929,7 +25929,7 @@ function F2(s, e, t, n) { const C = D.__offset, B = Array.isArray(D.value) ? D.value : [D.value]; let w = 0; for (let F = 0; F < B.length; F++) { - const W = B[F], j = g(W); + const W = B[F], j = p(W); typeof W == "number" || typeof W == "boolean" ? (D.__data[0] = W, s.bufferSubData(s.UNIFORM_BUFFER, C + w, D.__data)) : W.isMatrix3 ? (D.__data[0] = W.elements[0], D.__data[1] = W.elements[1], D.__data[2] = W.elements[2], D.__data[3] = 0, D.__data[4] = W.elements[3], D.__data[5] = W.elements[4], D.__data[6] = W.elements[5], D.__data[7] = 0, D.__data[8] = W.elements[6], D.__data[9] = W.elements[7], D.__data[10] = W.elements[8], D.__data[11] = 0) : (W.toArray(D.__data, w), w += j.storage / Float32Array.BYTES_PER_ELEMENT); } s.bufferSubData(s.UNIFORM_BUFFER, C, D.__data); @@ -25952,7 +25952,7 @@ function F2(s, e, t, n) { } return !1; } - function p(b) { + function g(b) { const v = b.uniforms; let y = 0; const M = 16; @@ -25961,15 +25961,15 @@ function F2(s, e, t, n) { for (let S = 0, D = _.length; S < D; S++) { const C = _[S], B = Array.isArray(C.value) ? C.value : [C.value]; for (let w = 0, F = B.length; w < F; w++) { - const W = B[w], j = g(W), $ = y % M, Z = $ % j.boundary, re = $ + Z; - y += Z, re !== 0 && M - re < j.storage && (y += M - re), C.__data = new Float32Array(j.storage / Float32Array.BYTES_PER_ELEMENT), C.__offset = y, y += j.storage; + const W = B[w], j = p(W), $ = y % M, q = $ % j.boundary, re = $ + q; + y += q, re !== 0 && M - re < j.storage && (y += M - re), C.__data = new Float32Array(j.storage / Float32Array.BYTES_PER_ELEMENT), C.__offset = y, y += j.storage; } } } const E = y % M; return E > 0 && (y += M - E), b.__size = y, b.__cache = {}, this; } - function g(b) { + function p(b) { const v = { boundary: 0, // bytes @@ -28047,7 +28047,7 @@ const z2 = new Uint16Array([ ]); let yi = null; function H2() { - return yi === null && (yi = new Bo(z2, 32, 32, Au, Un), yi.minFilter = Yt, yi.magFilter = Yt, yi.wrapS = ai, yi.wrapT = ai, yi.generateMipmaps = !1, yi.needsUpdate = !0), yi; + return yi === null && (yi = new No(z2, 32, 32, Tu, On), yi.minFilter = Yt, yi.magFilter = Yt, yi.wrapS = ai, yi.wrapT = ai, yi.generateMipmaps = !1, yi.needsUpdate = !0), yi; } class Jm { /** @@ -28077,17 +28077,17 @@ class Jm { f = n.getContextAttributes().alpha; } else f = o; - const p = /* @__PURE__ */ new Set([ - Pu, + const g = /* @__PURE__ */ new Set([ Cu, - Tu - ]), g = /* @__PURE__ */ new Set([ + Au, + Eu + ]), p = /* @__PURE__ */ new Set([ Jn, Ms, - wo, - _r, - wu, - Su + So, + Mr, + Mu, + wu ]), x = new Uint32Array(4), m = new Int32Array(4); let b = null, v = null; const y = [], M = []; @@ -28109,11 +28109,11 @@ class Jm { let R = 0, _ = 0, S = null, D = -1, C = null; const B = new tt(), w = new tt(); let F = null; - const W = new Fe(0); - let j = 0, $ = t.width, Z = t.height, re = 1, X = null, Y = null; - const ge = new tt(0, 0, $, Z), pe = new tt(0, 0, $, Z); + const W = new Oe(0); + let j = 0, $ = t.width, q = t.height, re = 1, X = null, Y = null; + const ge = new tt(0, 0, $, q), pe = new tt(0, 0, $, q); let de = !1; - const ie = new Nu(); + const ie = new Bu(); let he = !1, fe = !1; const ve = new ze(), we = new P(), Be = new tt(), Ke = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 }; let Ne = !1; @@ -28121,11 +28121,11 @@ class Jm { return S === null ? re : 1; } let I = n; - function V(O, Q) { - return t.getContext(O, Q); + function V(k, Q) { + return t.getContext(k, Q); } try { - const O = { + const k = { alpha: !0, depth: i, stencil: r, @@ -28135,83 +28135,83 @@ class Jm { powerPreference: h, failIfMajorPerformanceCaveat: u }; - if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${Do}`), t.addEventListener("webglcontextlost", xe, !1), t.addEventListener("webglcontextrestored", me, !1), t.addEventListener("webglcontextcreationerror", Ue, !1), I === null) { + if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${Io}`), t.addEventListener("webglcontextlost", xe, !1), t.addEventListener("webglcontextrestored", me, !1), t.addEventListener("webglcontextcreationerror", ke, !1), I === null) { const Q = "webgl2"; - if (I = V(Q, O), I === null) + if (I = V(Q, k), I === null) throw V(Q) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context."); } - } catch (O) { - throw O("WebGLRenderer: " + O.message), O; + } catch (k) { + throw k("WebGLRenderer: " + k.message), k; } - let U, k, z, ee, J, G, N, L, H, K, le, te, Te, be, Re, De, ue, ye, Ve, ke, Ae, Ge, q, Ee; + let O, U, z, ee, J, G, N, L, H, K, le, te, Te, be, Re, De, ue, ye, Ve, Ue, Ae, Ge, Z, Ee; function _e() { - U = new Ky(I), U.init(), Ge = new D2(I, U), k = new Hy(I, U, e, Ge), z = new R2(I, U), k.reversedDepthBuffer && d && z.buffers.depth.setReversed(!0), ee = new Qy(I), J = new x2(), G = new L2(I, U, z, J, k, Ge, ee), N = new Gy(E), L = new Yy(E), H = new i1(I), q = new Fy(I, H), K = new $y(I, H, ee, q), le = new t_(I, K, H, ee), Ve = new e_(I, k, G), De = new Vy(J), te = new g2(E, N, L, U, k, q, De), Te = new O2(E, J), be = new b2(), Re = new E2(U), ye = new Oy(E, N, L, z, le, f, l), ue = new C2(E, le, k), Ee = new F2(I, ee, k, z), ke = new zy(I, U, ee), Ae = new Jy(I, U, ee), ee.programs = te.programs, E.capabilities = k, E.extensions = U, E.properties = J, E.renderLists = be, E.shadowMap = ue, E.state = z, E.info = ee; + O = new Ky(I), O.init(), Ge = new D2(I, O), U = new Hy(I, O, e, Ge), z = new R2(I, O), U.reversedDepthBuffer && d && z.buffers.depth.setReversed(!0), ee = new Qy(I), J = new x2(), G = new L2(I, O, z, J, U, Ge, ee), N = new Gy(E), L = new Yy(E), H = new i1(I), Z = new Fy(I, H), K = new $y(I, H, ee, Z), le = new t_(I, K, H, ee), Ve = new e_(I, U, G), De = new Vy(J), te = new g2(E, N, L, O, U, Z, De), Te = new k2(E, J), be = new b2(), Re = new E2(O), ye = new ky(E, N, L, z, le, f, l), ue = new C2(E, le, U), Ee = new F2(I, ee, U, z), Ue = new zy(I, O, ee), Ae = new Jy(I, O, ee), ee.programs = te.programs, E.capabilities = U, E.extensions = O, E.properties = J, E.renderLists = be, E.shadowMap = ue, E.state = z, E.info = ee; } _e(); - const Me = new k2(E, I); + const Me = new U2(E, I); this.xr = Me, this.getContext = function() { return I; }, this.getContextAttributes = function() { return I.getContextAttributes(); }, this.forceContextLoss = function() { - const O = U.get("WEBGL_lose_context"); - O && O.loseContext(); + const k = O.get("WEBGL_lose_context"); + k && k.loseContext(); }, this.forceContextRestore = function() { - const O = U.get("WEBGL_lose_context"); - O && O.restoreContext(); + const k = O.get("WEBGL_lose_context"); + k && k.restoreContext(); }, this.getPixelRatio = function() { return re; - }, this.setPixelRatio = function(O) { - O !== void 0 && (re = O, this.setSize($, Z, !1)); - }, this.getSize = function(O) { - return O.set($, Z); - }, this.setSize = function(O, Q, oe = !0) { + }, this.setPixelRatio = function(k) { + k !== void 0 && (re = k, this.setSize($, q, !1)); + }, this.getSize = function(k) { + return k.set($, q); + }, this.setSize = function(k, Q, oe = !0) { if (Me.isPresenting) { He("WebGLRenderer: Can't change size while VR device is presenting."); return; } - $ = O, Z = Q, t.width = Math.floor(O * re), t.height = Math.floor(Q * re), oe === !0 && (t.style.width = O + "px", t.style.height = Q + "px"), this.setViewport(0, 0, O, Q); - }, this.getDrawingBufferSize = function(O) { - return O.set($ * re, Z * re).floor(); - }, this.setDrawingBufferSize = function(O, Q, oe) { - $ = O, Z = Q, re = oe, t.width = Math.floor(O * oe), t.height = Math.floor(Q * oe), this.setViewport(0, 0, O, Q); - }, this.getCurrentViewport = function(O) { - return O.copy(B); - }, this.getViewport = function(O) { - return O.copy(ge); - }, this.setViewport = function(O, Q, oe, ae) { - O.isVector4 ? ge.set(O.x, O.y, O.z, O.w) : ge.set(O, Q, oe, ae), z.viewport(B.copy(ge).multiplyScalar(re).round()); - }, this.getScissor = function(O) { - return O.copy(pe); - }, this.setScissor = function(O, Q, oe, ae) { - O.isVector4 ? pe.set(O.x, O.y, O.z, O.w) : pe.set(O, Q, oe, ae), z.scissor(w.copy(pe).multiplyScalar(re).round()); + $ = k, q = Q, t.width = Math.floor(k * re), t.height = Math.floor(Q * re), oe === !0 && (t.style.width = k + "px", t.style.height = Q + "px"), this.setViewport(0, 0, k, Q); + }, this.getDrawingBufferSize = function(k) { + return k.set($ * re, q * re).floor(); + }, this.setDrawingBufferSize = function(k, Q, oe) { + $ = k, q = Q, re = oe, t.width = Math.floor(k * oe), t.height = Math.floor(Q * oe), this.setViewport(0, 0, k, Q); + }, this.getCurrentViewport = function(k) { + return k.copy(B); + }, this.getViewport = function(k) { + return k.copy(ge); + }, this.setViewport = function(k, Q, oe, ae) { + k.isVector4 ? ge.set(k.x, k.y, k.z, k.w) : ge.set(k, Q, oe, ae), z.viewport(B.copy(ge).multiplyScalar(re).round()); + }, this.getScissor = function(k) { + return k.copy(pe); + }, this.setScissor = function(k, Q, oe, ae) { + k.isVector4 ? pe.set(k.x, k.y, k.z, k.w) : pe.set(k, Q, oe, ae), z.scissor(w.copy(pe).multiplyScalar(re).round()); }, this.getScissorTest = function() { return de; - }, this.setScissorTest = function(O) { - z.setScissorTest(de = O); - }, this.setOpaqueSort = function(O) { - X = O; - }, this.setTransparentSort = function(O) { - Y = O; - }, this.getClearColor = function(O) { - return O.copy(ye.getClearColor()); + }, this.setScissorTest = function(k) { + z.setScissorTest(de = k); + }, this.setOpaqueSort = function(k) { + X = k; + }, this.setTransparentSort = function(k) { + Y = k; + }, this.getClearColor = function(k) { + return k.copy(ye.getClearColor()); }, this.setClearColor = function() { ye.setClearColor(...arguments); }, this.getClearAlpha = function() { return ye.getClearAlpha(); }, this.setClearAlpha = function() { ye.setClearAlpha(...arguments); - }, this.clear = function(O = !0, Q = !0, oe = !0) { + }, this.clear = function(k = !0, Q = !0, oe = !0) { let ae = 0; - if (O) { + if (k) { let ne = !1; if (S !== null) { const Se = S.texture.format; - ne = p.has(Se); + ne = g.has(Se); } if (ne) { - const Se = S.texture.type, Le = g.has(Se), Oe = ye.getClearColor(), Ie = ye.getClearAlpha(), je = Oe.r, qe = Oe.g, We = Oe.b; - Le ? (x[0] = je, x[1] = qe, x[2] = We, x[3] = Ie, I.clearBufferuiv(I.COLOR, 0, x)) : (m[0] = je, m[1] = qe, m[2] = We, m[3] = Ie, I.clearBufferiv(I.COLOR, 0, m)); + const Se = S.texture.type, Le = p.has(Se), Fe = ye.getClearColor(), Ie = ye.getClearAlpha(), je = Fe.r, Ze = Fe.g, We = Fe.b; + Le ? (x[0] = je, x[1] = Ze, x[2] = We, x[3] = Ie, I.clearBufferuiv(I.COLOR, 0, x)) : (m[0] = je, m[1] = Ze, m[2] = We, m[3] = Ie, I.clearBufferiv(I.COLOR, 0, m)); } else ae |= I.COLOR_BUFFER_BIT; } @@ -28223,49 +28223,49 @@ class Jm { }, this.clearStencil = function() { this.clear(!1, !1, !0); }, this.dispose = function() { - t.removeEventListener("webglcontextlost", xe, !1), t.removeEventListener("webglcontextrestored", me, !1), t.removeEventListener("webglcontextcreationerror", Ue, !1), ye.dispose(), be.dispose(), Re.dispose(), J.dispose(), N.dispose(), L.dispose(), le.dispose(), q.dispose(), Ee.dispose(), te.dispose(), Me.dispose(), Me.removeEventListener("sessionstart", nd), Me.removeEventListener("sessionend", id), ts.stop(); + t.removeEventListener("webglcontextlost", xe, !1), t.removeEventListener("webglcontextrestored", me, !1), t.removeEventListener("webglcontextcreationerror", ke, !1), ye.dispose(), be.dispose(), Re.dispose(), J.dispose(), N.dispose(), L.dispose(), le.dispose(), Z.dispose(), Ee.dispose(), te.dispose(), Me.dispose(), Me.removeEventListener("sessionstart", td), Me.removeEventListener("sessionend", nd), ts.stop(); }; - function xe(O) { - O.preventDefault(), xl("WebGLRenderer: Context Lost."), A = !0; + function xe(k) { + k.preventDefault(), gl("WebGLRenderer: Context Lost."), A = !0; } function me() { - xl("WebGLRenderer: Context Restored."), A = !1; - const O = ee.autoReset, Q = ue.enabled, oe = ue.autoUpdate, ae = ue.needsUpdate, ne = ue.type; - _e(), ee.autoReset = O, ue.enabled = Q, ue.autoUpdate = oe, ue.needsUpdate = ae, ue.type = ne; + gl("WebGLRenderer: Context Restored."), A = !1; + const k = ee.autoReset, Q = ue.enabled, oe = ue.autoUpdate, ae = ue.needsUpdate, ne = ue.type; + _e(), ee.autoReset = k, ue.enabled = Q, ue.autoUpdate = oe, ue.needsUpdate = ae, ue.type = ne; } - function Ue(O) { - et("WebGLRenderer: A WebGL context could not be created. Reason: ", O.statusMessage); + function ke(k) { + et("WebGLRenderer: A WebGL context could not be created. Reason: ", k.statusMessage); } - function Ye(O) { - const Q = O.target; + function Ye(k) { + const Q = k.target; Q.removeEventListener("dispose", Ye), yt(Q); } - function yt(O) { - ft(O), J.remove(O); + function yt(k) { + ft(k), J.remove(k); } - function ft(O) { - const Q = J.get(O).programs; + function ft(k) { + const Q = J.get(k).programs; Q !== void 0 && (Q.forEach(function(oe) { te.releaseProgram(oe); - }), O.isShaderMaterial && te.releaseShaderCache(O)); + }), k.isShaderMaterial && te.releaseShaderCache(k)); } - this.renderBufferDirect = function(O, Q, oe, ae, ne, Se) { + this.renderBufferDirect = function(k, Q, oe, ae, ne, Se) { Q === null && (Q = Ke); - const Le = ne.isMesh && ne.matrixWorld.determinant() < 0, Oe = Z0(O, Q, oe, ae, ne); + const Le = ne.isMesh && ne.matrixWorld.determinant() < 0, Fe = q0(k, Q, oe, ae, ne); z.setMaterial(ae, Le); let Ie = oe.index, je = 1; if (ae.wireframe === !0) { if (Ie = K.getWireframeAttribute(oe), Ie === void 0) return; je = 2; } - const qe = oe.drawRange, We = oe.attributes.position; - let it = qe.start * je, pt = (qe.start + qe.count) * je; + const Ze = oe.drawRange, We = oe.attributes.position; + let it = Ze.start * je, pt = (Ze.start + Ze.count) * je; Se !== null && (it = Math.max(it, Se.start * je), pt = Math.min(pt, (Se.start + Se.count) * je)), Ie !== null ? (it = Math.max(it, 0), pt = Math.min(pt, Ie.count)) : We != null && (it = Math.max(it, 0), pt = Math.min(pt, We.count)); - const Rt = pt - it; - if (Rt < 0 || Rt === 1 / 0) return; - q.setup(ne, ae, Oe, oe, Ie); - let Lt, gt = ke; - if (Ie !== null && (Lt = H.get(Ie), gt = Ae, gt.setIndex(Lt)), ne.isMesh) + const Pt = pt - it; + if (Pt < 0 || Pt === 1 / 0) return; + Z.setup(ne, ae, Fe, oe, Ie); + let Rt, gt = Ue; + if (Ie !== null && (Rt = H.get(Ie), gt = Ae, gt.setIndex(Rt)), ne.isMesh) ae.wireframe === !0 ? (z.setLineWidth(ae.wireframeLinewidth * T()), gt.setMode(I.LINES)) : gt.setMode(I.TRIANGLES); else if (ne.isLine) { let Xe = ae.linewidth; @@ -28273,143 +28273,143 @@ class Jm { } else ne.isPoints ? gt.setMode(I.POINTS) : ne.isSprite && gt.setMode(I.TRIANGLES); if (ne.isBatchedMesh) if (ne._multiDrawInstances !== null) - Co("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), gt.renderMultiDrawInstances(ne._multiDrawStarts, ne._multiDrawCounts, ne._multiDrawCount, ne._multiDrawInstances); - else if (U.get("WEBGL_multi_draw")) + Po("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), gt.renderMultiDrawInstances(ne._multiDrawStarts, ne._multiDrawCounts, ne._multiDrawCount, ne._multiDrawInstances); + else if (O.get("WEBGL_multi_draw")) gt.renderMultiDraw(ne._multiDrawStarts, ne._multiDrawCounts, ne._multiDrawCount); else { - const Xe = ne._multiDrawStarts, Et = ne._multiDrawCounts, rt = ne._multiDrawCount, Sn = Ie ? H.get(Ie).bytesPerElement : 1, Is = J.get(ae).currentProgram.getUniforms(); + const Xe = ne._multiDrawStarts, St = ne._multiDrawCounts, rt = ne._multiDrawCount, Sn = Ie ? H.get(Ie).bytesPerElement : 1, Bs = J.get(ae).currentProgram.getUniforms(); for (let En = 0; En < rt; En++) - Is.setValue(I, "_gl_DrawID", En), gt.render(Xe[En] / Sn, Et[En]); + Bs.setValue(I, "_gl_DrawID", En), gt.render(Xe[En] / Sn, St[En]); } else if (ne.isInstancedMesh) - gt.renderInstances(it, Rt, ne.count); + gt.renderInstances(it, Pt, ne.count); else if (oe.isInstancedBufferGeometry) { - const Xe = oe._maxInstanceCount !== void 0 ? oe._maxInstanceCount : 1 / 0, Et = Math.min(oe.instanceCount, Xe); - gt.renderInstances(it, Rt, Et); + const Xe = oe._maxInstanceCount !== void 0 ? oe._maxInstanceCount : 1 / 0, St = Math.min(oe.instanceCount, Xe); + gt.renderInstances(it, Pt, St); } else - gt.render(it, Rt); + gt.render(it, Pt); }; - function ni(O, Q, oe) { - O.transparent === !0 && O.side === At && O.forceSinglePass === !1 ? (O.side = un, O.needsUpdate = !0, Go(O, Q, oe), O.side = Fn, O.needsUpdate = !0, Go(O, Q, oe), O.side = At) : Go(O, Q, oe); + function ni(k, Q, oe) { + k.transparent === !0 && k.side === At && k.forceSinglePass === !1 ? (k.side = un, k.needsUpdate = !0, Go(k, Q, oe), k.side = Fn, k.needsUpdate = !0, Go(k, Q, oe), k.side = At) : Go(k, Q, oe); } - this.compile = function(O, Q, oe = null) { - oe === null && (oe = O), v = Re.get(oe), v.init(Q), M.push(v), oe.traverseVisible(function(ne) { + this.compile = function(k, Q, oe = null) { + oe === null && (oe = k), v = Re.get(oe), v.init(Q), M.push(v), oe.traverseVisible(function(ne) { ne.isLight && ne.layers.test(Q.layers) && (v.pushLight(ne), ne.castShadow && v.pushShadow(ne)); - }), O !== oe && O.traverseVisible(function(ne) { + }), k !== oe && k.traverseVisible(function(ne) { ne.isLight && ne.layers.test(Q.layers) && (v.pushLight(ne), ne.castShadow && v.pushShadow(ne)); }), v.setupLights(); const ae = /* @__PURE__ */ new Set(); - return O.traverse(function(ne) { + return k.traverse(function(ne) { if (!(ne.isMesh || ne.isPoints || ne.isLine || ne.isSprite)) return; const Se = ne.material; if (Se) if (Array.isArray(Se)) for (let Le = 0; Le < Se.length; Le++) { - const Oe = Se[Le]; - ni(Oe, oe, ne), ae.add(Oe); + const Fe = Se[Le]; + ni(Fe, oe, ne), ae.add(Fe); } else ni(Se, oe, ne), ae.add(Se); }), v = M.pop(), ae; - }, this.compileAsync = function(O, Q, oe = null) { - const ae = this.compile(O, Q, oe); + }, this.compileAsync = function(k, Q, oe = null) { + const ae = this.compile(k, Q, oe); return new Promise((ne) => { function Se() { if (ae.forEach(function(Le) { J.get(Le).currentProgram.isReady() && ae.delete(Le); }), ae.size === 0) { - ne(O); + ne(k); return; } setTimeout(Se, 10); } - U.get("KHR_parallel_shader_compile") !== null ? Se() : setTimeout(Se, 10); + O.get("KHR_parallel_shader_compile") !== null ? Se() : setTimeout(Se, 10); }); }; let Gn = null; - function q0(O) { - Gn && Gn(O); + function Z0(k) { + Gn && Gn(k); } - function nd() { + function td() { ts.stop(); } - function id() { + function nd() { ts.start(); } - const ts = new qm(); - ts.setAnimationLoop(q0), typeof self < "u" && ts.setContext(self), this.setAnimationLoop = function(O) { - Gn = O, Me.setAnimationLoop(O), O === null ? ts.stop() : ts.start(); - }, Me.addEventListener("sessionstart", nd), Me.addEventListener("sessionend", id), this.render = function(O, Q) { + const ts = new Zm(); + ts.setAnimationLoop(Z0), typeof self < "u" && ts.setContext(self), this.setAnimationLoop = function(k) { + Gn = k, Me.setAnimationLoop(k), k === null ? ts.stop() : ts.start(); + }, Me.addEventListener("sessionstart", td), Me.addEventListener("sessionend", nd), this.render = function(k, Q) { if (Q !== void 0 && Q.isCamera !== !0) { et("WebGLRenderer.render: camera is not an instance of THREE.Camera."); return; } if (A === !0) return; - if (O.matrixWorldAutoUpdate === !0 && O.updateMatrixWorld(), Q.parent === null && Q.matrixWorldAutoUpdate === !0 && Q.updateMatrixWorld(), Me.enabled === !0 && Me.isPresenting === !0 && (Me.cameraAutoUpdate === !0 && Me.updateCamera(Q), Q = Me.getCamera()), O.isScene === !0 && O.onBeforeRender(E, O, Q, S), v = Re.get(O, M.length), v.init(Q), M.push(v), ve.multiplyMatrices(Q.projectionMatrix, Q.matrixWorldInverse), ie.setFromProjectionMatrix(ve, li, Q.reversedDepth), fe = this.localClippingEnabled, he = De.init(this.clippingPlanes, fe), b = be.get(O, y.length), b.init(), y.push(b), Me.enabled === !0 && Me.isPresenting === !0) { + if (k.matrixWorldAutoUpdate === !0 && k.updateMatrixWorld(), Q.parent === null && Q.matrixWorldAutoUpdate === !0 && Q.updateMatrixWorld(), Me.enabled === !0 && Me.isPresenting === !0 && (Me.cameraAutoUpdate === !0 && Me.updateCamera(Q), Q = Me.getCamera()), k.isScene === !0 && k.onBeforeRender(E, k, Q, S), v = Re.get(k, M.length), v.init(Q), M.push(v), ve.multiplyMatrices(Q.projectionMatrix, Q.matrixWorldInverse), ie.setFromProjectionMatrix(ve, li, Q.reversedDepth), fe = this.localClippingEnabled, he = De.init(this.clippingPlanes, fe), b = be.get(k, y.length), b.init(), y.push(b), Me.enabled === !0 && Me.isPresenting === !0) { const Se = E.xr.getDepthSensingMesh(); - Se !== null && Ol(Se, Q, -1 / 0, E.sortObjects); + Se !== null && kl(Se, Q, -1 / 0, E.sortObjects); } - Ol(O, Q, 0, E.sortObjects), b.finish(), E.sortObjects === !0 && b.sort(X, Y), Ne = Me.enabled === !1 || Me.isPresenting === !1 || Me.hasDepthSensing() === !1, Ne && ye.addToRenderList(b, O), this.info.render.frame++, he === !0 && De.beginShadows(); + kl(k, Q, 0, E.sortObjects), b.finish(), E.sortObjects === !0 && b.sort(X, Y), Ne = Me.enabled === !1 || Me.isPresenting === !1 || Me.hasDepthSensing() === !1, Ne && ye.addToRenderList(b, k), this.info.render.frame++, he === !0 && De.beginShadows(); const oe = v.state.shadowsArray; - ue.render(oe, O, Q), he === !0 && De.endShadows(), this.info.autoReset === !0 && this.info.reset(); + ue.render(oe, k, Q), he === !0 && De.endShadows(), this.info.autoReset === !0 && this.info.reset(); const ae = b.opaque, ne = b.transmissive; if (v.setupLights(), Q.isArrayCamera) { const Se = Q.cameras; if (ne.length > 0) - for (let Le = 0, Oe = Se.length; Le < Oe; Le++) { + for (let Le = 0, Fe = Se.length; Le < Fe; Le++) { const Ie = Se[Le]; - rd(ae, ne, O, Ie); + sd(ae, ne, k, Ie); } - Ne && ye.render(O); - for (let Le = 0, Oe = Se.length; Le < Oe; Le++) { + Ne && ye.render(k); + for (let Le = 0, Fe = Se.length; Le < Fe; Le++) { const Ie = Se[Le]; - sd(b, O, Ie, Ie.viewport); + id(b, k, Ie, Ie.viewport); } } else - ne.length > 0 && rd(ae, ne, O, Q), Ne && ye.render(O), sd(b, O, Q); - S !== null && _ === 0 && (G.updateMultisampleRenderTarget(S), G.updateRenderTargetMipmap(S)), O.isScene === !0 && O.onAfterRender(E, O, Q), q.resetDefaultState(), D = -1, C = null, M.pop(), M.length > 0 ? (v = M[M.length - 1], he === !0 && De.setGlobalState(E.clippingPlanes, v.state.camera)) : v = null, y.pop(), y.length > 0 ? b = y[y.length - 1] : b = null; + ne.length > 0 && sd(ae, ne, k, Q), Ne && ye.render(k), id(b, k, Q); + S !== null && _ === 0 && (G.updateMultisampleRenderTarget(S), G.updateRenderTargetMipmap(S)), k.isScene === !0 && k.onAfterRender(E, k, Q), Z.resetDefaultState(), D = -1, C = null, M.pop(), M.length > 0 ? (v = M[M.length - 1], he === !0 && De.setGlobalState(E.clippingPlanes, v.state.camera)) : v = null, y.pop(), y.length > 0 ? b = y[y.length - 1] : b = null; }; - function Ol(O, Q, oe, ae) { - if (O.visible === !1) return; - if (O.layers.test(Q.layers)) { - if (O.isGroup) - oe = O.renderOrder; - else if (O.isLOD) - O.autoUpdate === !0 && O.update(Q); - else if (O.isLight) - v.pushLight(O), O.castShadow && v.pushShadow(O); - else if (O.isSprite) { - if (!O.frustumCulled || ie.intersectsSprite(O)) { - ae && Be.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve); - const Le = le.update(O), Oe = O.material; - Oe.visible && b.push(O, Le, Oe, oe, Be.z, null); + function kl(k, Q, oe, ae) { + if (k.visible === !1) return; + if (k.layers.test(Q.layers)) { + if (k.isGroup) + oe = k.renderOrder; + else if (k.isLOD) + k.autoUpdate === !0 && k.update(Q); + else if (k.isLight) + v.pushLight(k), k.castShadow && v.pushShadow(k); + else if (k.isSprite) { + if (!k.frustumCulled || ie.intersectsSprite(k)) { + ae && Be.setFromMatrixPosition(k.matrixWorld).applyMatrix4(ve); + const Le = le.update(k), Fe = k.material; + Fe.visible && b.push(k, Le, Fe, oe, Be.z, null); } - } else if ((O.isMesh || O.isLine || O.isPoints) && (!O.frustumCulled || ie.intersectsObject(O))) { - const Le = le.update(O), Oe = O.material; - if (ae && (O.boundingSphere !== void 0 ? (O.boundingSphere === null && O.computeBoundingSphere(), Be.copy(O.boundingSphere.center)) : (Le.boundingSphere === null && Le.computeBoundingSphere(), Be.copy(Le.boundingSphere.center)), Be.applyMatrix4(O.matrixWorld).applyMatrix4(ve)), Array.isArray(Oe)) { + } else if ((k.isMesh || k.isLine || k.isPoints) && (!k.frustumCulled || ie.intersectsObject(k))) { + const Le = le.update(k), Fe = k.material; + if (ae && (k.boundingSphere !== void 0 ? (k.boundingSphere === null && k.computeBoundingSphere(), Be.copy(k.boundingSphere.center)) : (Le.boundingSphere === null && Le.computeBoundingSphere(), Be.copy(Le.boundingSphere.center)), Be.applyMatrix4(k.matrixWorld).applyMatrix4(ve)), Array.isArray(Fe)) { const Ie = Le.groups; - for (let je = 0, qe = Ie.length; je < qe; je++) { - const We = Ie[je], it = Oe[We.materialIndex]; - it && it.visible && b.push(O, Le, it, oe, Be.z, We); + for (let je = 0, Ze = Ie.length; je < Ze; je++) { + const We = Ie[je], it = Fe[We.materialIndex]; + it && it.visible && b.push(k, Le, it, oe, Be.z, We); } - } else Oe.visible && b.push(O, Le, Oe, oe, Be.z, null); + } else Fe.visible && b.push(k, Le, Fe, oe, Be.z, null); } } - const Se = O.children; - for (let Le = 0, Oe = Se.length; Le < Oe; Le++) - Ol(Se[Le], Q, oe, ae); + const Se = k.children; + for (let Le = 0, Fe = Se.length; Le < Fe; Le++) + kl(Se[Le], Q, oe, ae); } - function sd(O, Q, oe, ae) { - const { opaque: ne, transmissive: Se, transparent: Le } = O; + function id(k, Q, oe, ae) { + const { opaque: ne, transmissive: Se, transparent: Le } = k; v.setupLightsView(oe), he === !0 && De.setGlobalState(E.clippingPlanes, oe), ae && z.viewport(B.copy(ae)), ne.length > 0 && Vo(ne, Q, oe), Se.length > 0 && Vo(Se, Q, oe), Le.length > 0 && Vo(Le, Q, oe), z.buffers.depth.setTest(!0), z.buffers.depth.setMask(!0), z.buffers.color.setMask(!0), z.setPolygonOffset(!1); } - function rd(O, Q, oe, ae) { + function sd(k, Q, oe, ae) { if ((oe.isScene === !0 ? oe.overrideMaterial : null) !== null) return; v.state.transmissionRenderTarget[ae.id] === void 0 && (v.state.transmissionRenderTarget[ae.id] = new bn(1, 1, { generateMipmaps: !0, - type: U.has("EXT_color_buffer_half_float") || U.has("EXT_color_buffer_float") ? Un : Jn, + type: O.has("EXT_color_buffer_half_float") || O.has("EXT_color_buffer_float") ? On : Jn, minFilter: Ai, samples: 4, stencilBuffer: r, @@ -28419,93 +28419,93 @@ class Jm { })); const Se = v.state.transmissionRenderTarget[ae.id], Le = ae.viewport || B; Se.setSize(Le.z * E.transmissionResolutionScale, Le.w * E.transmissionResolutionScale); - const Oe = E.getRenderTarget(), Ie = E.getActiveCubeFace(), je = E.getActiveMipmapLevel(); + const Fe = E.getRenderTarget(), Ie = E.getActiveCubeFace(), je = E.getActiveMipmapLevel(); E.setRenderTarget(Se), E.getClearColor(W), j = E.getClearAlpha(), j < 1 && E.setClearColor(16777215, 0.5), E.clear(), Ne && ye.render(oe); - const qe = E.toneMapping; + const Ze = E.toneMapping; E.toneMapping = Ki; const We = ae.viewport; - if (ae.viewport !== void 0 && (ae.viewport = void 0), v.setupLightsView(ae), he === !0 && De.setGlobalState(E.clippingPlanes, ae), Vo(O, oe, ae), G.updateMultisampleRenderTarget(Se), G.updateRenderTargetMipmap(Se), U.has("WEBGL_multisampled_render_to_texture") === !1) { + if (ae.viewport !== void 0 && (ae.viewport = void 0), v.setupLightsView(ae), he === !0 && De.setGlobalState(E.clippingPlanes, ae), Vo(k, oe, ae), G.updateMultisampleRenderTarget(Se), G.updateRenderTargetMipmap(Se), O.has("WEBGL_multisampled_render_to_texture") === !1) { let it = !1; - for (let pt = 0, Rt = Q.length; pt < Rt; pt++) { - const Lt = Q[pt], { object: gt, geometry: Xe, material: Et, group: rt } = Lt; - if (Et.side === At && gt.layers.test(ae.layers)) { - const Sn = Et.side; - Et.side = un, Et.needsUpdate = !0, od(gt, oe, ae, Xe, Et, rt), Et.side = Sn, Et.needsUpdate = !0, it = !0; + for (let pt = 0, Pt = Q.length; pt < Pt; pt++) { + const Rt = Q[pt], { object: gt, geometry: Xe, material: St, group: rt } = Rt; + if (St.side === At && gt.layers.test(ae.layers)) { + const Sn = St.side; + St.side = un, St.needsUpdate = !0, rd(gt, oe, ae, Xe, St, rt), St.side = Sn, St.needsUpdate = !0, it = !0; } } it === !0 && (G.updateMultisampleRenderTarget(Se), G.updateRenderTargetMipmap(Se)); } - E.setRenderTarget(Oe, Ie, je), E.setClearColor(W, j), We !== void 0 && (ae.viewport = We), E.toneMapping = qe; + E.setRenderTarget(Fe, Ie, je), E.setClearColor(W, j), We !== void 0 && (ae.viewport = We), E.toneMapping = Ze; } - function Vo(O, Q, oe) { + function Vo(k, Q, oe) { const ae = Q.isScene === !0 ? Q.overrideMaterial : null; - for (let ne = 0, Se = O.length; ne < Se; ne++) { - const Le = O[ne], { object: Oe, geometry: Ie, group: je } = Le; - let qe = Le.material; - qe.allowOverride === !0 && ae !== null && (qe = ae), Oe.layers.test(oe.layers) && od(Oe, Q, oe, Ie, qe, je); + for (let ne = 0, Se = k.length; ne < Se; ne++) { + const Le = k[ne], { object: Fe, geometry: Ie, group: je } = Le; + let Ze = Le.material; + Ze.allowOverride === !0 && ae !== null && (Ze = ae), Fe.layers.test(oe.layers) && rd(Fe, Q, oe, Ie, Ze, je); } } - function od(O, Q, oe, ae, ne, Se) { - O.onBeforeRender(E, Q, oe, ae, ne, Se), O.modelViewMatrix.multiplyMatrices(oe.matrixWorldInverse, O.matrixWorld), O.normalMatrix.getNormalMatrix(O.modelViewMatrix), ne.onBeforeRender(E, Q, oe, ae, O, Se), ne.transparent === !0 && ne.side === At && ne.forceSinglePass === !1 ? (ne.side = un, ne.needsUpdate = !0, E.renderBufferDirect(oe, Q, ae, ne, O, Se), ne.side = Fn, ne.needsUpdate = !0, E.renderBufferDirect(oe, Q, ae, ne, O, Se), ne.side = At) : E.renderBufferDirect(oe, Q, ae, ne, O, Se), O.onAfterRender(E, Q, oe, ae, ne, Se); + function rd(k, Q, oe, ae, ne, Se) { + k.onBeforeRender(E, Q, oe, ae, ne, Se), k.modelViewMatrix.multiplyMatrices(oe.matrixWorldInverse, k.matrixWorld), k.normalMatrix.getNormalMatrix(k.modelViewMatrix), ne.onBeforeRender(E, Q, oe, ae, k, Se), ne.transparent === !0 && ne.side === At && ne.forceSinglePass === !1 ? (ne.side = un, ne.needsUpdate = !0, E.renderBufferDirect(oe, Q, ae, ne, k, Se), ne.side = Fn, ne.needsUpdate = !0, E.renderBufferDirect(oe, Q, ae, ne, k, Se), ne.side = At) : E.renderBufferDirect(oe, Q, ae, ne, k, Se), k.onAfterRender(E, Q, oe, ae, ne, Se); } - function Go(O, Q, oe) { + function Go(k, Q, oe) { Q.isScene !== !0 && (Q = Ke); - const ae = J.get(O), ne = v.state.lights, Se = v.state.shadowsArray, Le = ne.state.version, Oe = te.getParameters(O, ne.state, Se, Q, oe), Ie = te.getProgramCacheKey(Oe); + const ae = J.get(k), ne = v.state.lights, Se = v.state.shadowsArray, Le = ne.state.version, Fe = te.getParameters(k, ne.state, Se, Q, oe), Ie = te.getProgramCacheKey(Fe); let je = ae.programs; - ae.environment = O.isMeshStandardMaterial ? Q.environment : null, ae.fog = Q.fog, ae.envMap = (O.isMeshStandardMaterial ? L : N).get(O.envMap || ae.environment), ae.envMapRotation = ae.environment !== null && O.envMap === null ? Q.environmentRotation : O.envMapRotation, je === void 0 && (O.addEventListener("dispose", Ye), je = /* @__PURE__ */ new Map(), ae.programs = je); - let qe = je.get(Ie); - if (qe !== void 0) { - if (ae.currentProgram === qe && ae.lightsStateVersion === Le) - return ld(O, Oe), qe; + ae.environment = k.isMeshStandardMaterial ? Q.environment : null, ae.fog = Q.fog, ae.envMap = (k.isMeshStandardMaterial ? L : N).get(k.envMap || ae.environment), ae.envMapRotation = ae.environment !== null && k.envMap === null ? Q.environmentRotation : k.envMapRotation, je === void 0 && (k.addEventListener("dispose", Ye), je = /* @__PURE__ */ new Map(), ae.programs = je); + let Ze = je.get(Ie); + if (Ze !== void 0) { + if (ae.currentProgram === Ze && ae.lightsStateVersion === Le) + return ad(k, Fe), Ze; } else - Oe.uniforms = te.getUniforms(O), O.onBeforeCompile(Oe, E), qe = te.acquireProgram(Oe, Ie), je.set(Ie, qe), ae.uniforms = Oe.uniforms; + Fe.uniforms = te.getUniforms(k), k.onBeforeCompile(Fe, E), Ze = te.acquireProgram(Fe, Ie), je.set(Ie, Ze), ae.uniforms = Fe.uniforms; const We = ae.uniforms; - return (!O.isShaderMaterial && !O.isRawShaderMaterial || O.clipping === !0) && (We.clippingPlanes = De.uniform), ld(O, Oe), ae.needsLights = K0(O), ae.lightsStateVersion = Le, ae.needsLights && (We.ambientLightColor.value = ne.state.ambient, We.lightProbe.value = ne.state.probe, We.directionalLights.value = ne.state.directional, We.directionalLightShadows.value = ne.state.directionalShadow, We.spotLights.value = ne.state.spot, We.spotLightShadows.value = ne.state.spotShadow, We.rectAreaLights.value = ne.state.rectArea, We.ltc_1.value = ne.state.rectAreaLTC1, We.ltc_2.value = ne.state.rectAreaLTC2, We.pointLights.value = ne.state.point, We.pointLightShadows.value = ne.state.pointShadow, We.hemisphereLights.value = ne.state.hemi, We.directionalShadowMap.value = ne.state.directionalShadowMap, We.directionalShadowMatrix.value = ne.state.directionalShadowMatrix, We.spotShadowMap.value = ne.state.spotShadowMap, We.spotLightMatrix.value = ne.state.spotLightMatrix, We.spotLightMap.value = ne.state.spotLightMap, We.pointShadowMap.value = ne.state.pointShadowMap, We.pointShadowMatrix.value = ne.state.pointShadowMatrix), ae.currentProgram = qe, ae.uniformsList = null, qe; + return (!k.isShaderMaterial && !k.isRawShaderMaterial || k.clipping === !0) && (We.clippingPlanes = De.uniform), ad(k, Fe), ae.needsLights = K0(k), ae.lightsStateVersion = Le, ae.needsLights && (We.ambientLightColor.value = ne.state.ambient, We.lightProbe.value = ne.state.probe, We.directionalLights.value = ne.state.directional, We.directionalLightShadows.value = ne.state.directionalShadow, We.spotLights.value = ne.state.spot, We.spotLightShadows.value = ne.state.spotShadow, We.rectAreaLights.value = ne.state.rectArea, We.ltc_1.value = ne.state.rectAreaLTC1, We.ltc_2.value = ne.state.rectAreaLTC2, We.pointLights.value = ne.state.point, We.pointLightShadows.value = ne.state.pointShadow, We.hemisphereLights.value = ne.state.hemi, We.directionalShadowMap.value = ne.state.directionalShadowMap, We.directionalShadowMatrix.value = ne.state.directionalShadowMatrix, We.spotShadowMap.value = ne.state.spotShadowMap, We.spotLightMatrix.value = ne.state.spotLightMatrix, We.spotLightMap.value = ne.state.spotLightMap, We.pointShadowMap.value = ne.state.pointShadowMap, We.pointShadowMatrix.value = ne.state.pointShadowMatrix), ae.currentProgram = Ze, ae.uniformsList = null, Ze; } - function ad(O) { - if (O.uniformsList === null) { - const Q = O.currentProgram.getUniforms(); - O.uniformsList = rl.seqWithValue(Q.seq, O.uniforms); + function od(k) { + if (k.uniformsList === null) { + const Q = k.currentProgram.getUniforms(); + k.uniformsList = sl.seqWithValue(Q.seq, k.uniforms); } - return O.uniformsList; + return k.uniformsList; } - function ld(O, Q) { - const oe = J.get(O); + function ad(k, Q) { + const oe = J.get(k); oe.outputColorSpace = Q.outputColorSpace, oe.batching = Q.batching, oe.batchingColor = Q.batchingColor, oe.instancing = Q.instancing, oe.instancingColor = Q.instancingColor, oe.instancingMorph = Q.instancingMorph, oe.skinning = Q.skinning, oe.morphTargets = Q.morphTargets, oe.morphNormals = Q.morphNormals, oe.morphColors = Q.morphColors, oe.morphTargetsCount = Q.morphTargetsCount, oe.numClippingPlanes = Q.numClippingPlanes, oe.numIntersection = Q.numClipIntersection, oe.vertexAlphas = Q.vertexAlphas, oe.vertexTangents = Q.vertexTangents, oe.toneMapping = Q.toneMapping; } - function Z0(O, Q, oe, ae, ne) { + function q0(k, Q, oe, ae, ne) { Q.isScene !== !0 && (Q = Ke), G.resetTextureUnits(); - const Se = Q.fog, Le = ae.isMeshStandardMaterial ? Q.environment : null, Oe = S === null ? E.outputColorSpace : S.isXRRenderTarget === !0 ? S.texture.colorSpace : Bt, Ie = (ae.isMeshStandardMaterial ? L : N).get(ae.envMap || Le), je = ae.vertexColors === !0 && !!oe.attributes.color && oe.attributes.color.itemSize === 4, qe = !!oe.attributes.tangent && (!!ae.normalMap || ae.anisotropy > 0), We = !!oe.morphAttributes.position, it = !!oe.morphAttributes.normal, pt = !!oe.morphAttributes.color; - let Rt = Ki; - ae.toneMapped && (S === null || S.isXRRenderTarget === !0) && (Rt = E.toneMapping); - const Lt = oe.morphAttributes.position || oe.morphAttributes.normal || oe.morphAttributes.color, gt = Lt !== void 0 ? Lt.length : 0, Xe = J.get(ae), Et = v.state.lights; - if (he === !0 && (fe === !0 || O !== C)) { - const on = O === C && ae.id === D; - De.setState(ae, O, on); + const Se = Q.fog, Le = ae.isMeshStandardMaterial ? Q.environment : null, Fe = S === null ? E.outputColorSpace : S.isXRRenderTarget === !0 ? S.texture.colorSpace : It, Ie = (ae.isMeshStandardMaterial ? L : N).get(ae.envMap || Le), je = ae.vertexColors === !0 && !!oe.attributes.color && oe.attributes.color.itemSize === 4, Ze = !!oe.attributes.tangent && (!!ae.normalMap || ae.anisotropy > 0), We = !!oe.morphAttributes.position, it = !!oe.morphAttributes.normal, pt = !!oe.morphAttributes.color; + let Pt = Ki; + ae.toneMapped && (S === null || S.isXRRenderTarget === !0) && (Pt = E.toneMapping); + const Rt = oe.morphAttributes.position || oe.morphAttributes.normal || oe.morphAttributes.color, gt = Rt !== void 0 ? Rt.length : 0, Xe = J.get(ae), St = v.state.lights; + if (he === !0 && (fe === !0 || k !== C)) { + const on = k === C && ae.id === D; + De.setState(ae, k, on); } let rt = !1; - ae.version === Xe.__version ? (Xe.needsLights && Xe.lightsStateVersion !== Et.state.version || Xe.outputColorSpace !== Oe || ne.isBatchedMesh && Xe.batching === !1 || !ne.isBatchedMesh && Xe.batching === !0 || ne.isBatchedMesh && Xe.batchingColor === !0 && ne.colorTexture === null || ne.isBatchedMesh && Xe.batchingColor === !1 && ne.colorTexture !== null || ne.isInstancedMesh && Xe.instancing === !1 || !ne.isInstancedMesh && Xe.instancing === !0 || ne.isSkinnedMesh && Xe.skinning === !1 || !ne.isSkinnedMesh && Xe.skinning === !0 || ne.isInstancedMesh && Xe.instancingColor === !0 && ne.instanceColor === null || ne.isInstancedMesh && Xe.instancingColor === !1 && ne.instanceColor !== null || ne.isInstancedMesh && Xe.instancingMorph === !0 && ne.morphTexture === null || ne.isInstancedMesh && Xe.instancingMorph === !1 && ne.morphTexture !== null || Xe.envMap !== Ie || ae.fog === !0 && Xe.fog !== Se || Xe.numClippingPlanes !== void 0 && (Xe.numClippingPlanes !== De.numPlanes || Xe.numIntersection !== De.numIntersection) || Xe.vertexAlphas !== je || Xe.vertexTangents !== qe || Xe.morphTargets !== We || Xe.morphNormals !== it || Xe.morphColors !== pt || Xe.toneMapping !== Rt || Xe.morphTargetsCount !== gt) && (rt = !0) : (rt = !0, Xe.__version = ae.version); + ae.version === Xe.__version ? (Xe.needsLights && Xe.lightsStateVersion !== St.state.version || Xe.outputColorSpace !== Fe || ne.isBatchedMesh && Xe.batching === !1 || !ne.isBatchedMesh && Xe.batching === !0 || ne.isBatchedMesh && Xe.batchingColor === !0 && ne.colorTexture === null || ne.isBatchedMesh && Xe.batchingColor === !1 && ne.colorTexture !== null || ne.isInstancedMesh && Xe.instancing === !1 || !ne.isInstancedMesh && Xe.instancing === !0 || ne.isSkinnedMesh && Xe.skinning === !1 || !ne.isSkinnedMesh && Xe.skinning === !0 || ne.isInstancedMesh && Xe.instancingColor === !0 && ne.instanceColor === null || ne.isInstancedMesh && Xe.instancingColor === !1 && ne.instanceColor !== null || ne.isInstancedMesh && Xe.instancingMorph === !0 && ne.morphTexture === null || ne.isInstancedMesh && Xe.instancingMorph === !1 && ne.morphTexture !== null || Xe.envMap !== Ie || ae.fog === !0 && Xe.fog !== Se || Xe.numClippingPlanes !== void 0 && (Xe.numClippingPlanes !== De.numPlanes || Xe.numIntersection !== De.numIntersection) || Xe.vertexAlphas !== je || Xe.vertexTangents !== Ze || Xe.morphTargets !== We || Xe.morphNormals !== it || Xe.morphColors !== pt || Xe.toneMapping !== Pt || Xe.morphTargetsCount !== gt) && (rt = !0) : (rt = !0, Xe.__version = ae.version); let Sn = Xe.currentProgram; rt === !0 && (Sn = Go(ae, Q, ne)); - let Is = !1, En = !1, Fr = !1; - const Tt = Sn.getUniforms(), fn = Xe.uniforms; - if (z.useProgram(Sn.program) && (Is = !0, En = !0, Fr = !0), ae.id !== D && (D = ae.id, En = !0), Is || C !== O) { - z.buffers.depth.getReversed() && O.reversedDepth !== !0 && (O._reversedDepth = !0, O.updateProjectionMatrix()), Tt.setValue(I, "projectionMatrix", O.projectionMatrix), Tt.setValue(I, "viewMatrix", O.matrixWorldInverse); - const pn = Tt.map.cameraPosition; - pn !== void 0 && pn.setValue(I, we.setFromMatrixPosition(O.matrixWorld)), k.logarithmicDepthBuffer && Tt.setValue( + let Bs = !1, En = !1, zr = !1; + const Et = Sn.getUniforms(), fn = Xe.uniforms; + if (z.useProgram(Sn.program) && (Bs = !0, En = !0, zr = !0), ae.id !== D && (D = ae.id, En = !0), Bs || C !== k) { + z.buffers.depth.getReversed() && k.reversedDepth !== !0 && (k._reversedDepth = !0, k.updateProjectionMatrix()), Et.setValue(I, "projectionMatrix", k.projectionMatrix), Et.setValue(I, "viewMatrix", k.matrixWorldInverse); + const pn = Et.map.cameraPosition; + pn !== void 0 && pn.setValue(I, we.setFromMatrixPosition(k.matrixWorld)), U.logarithmicDepthBuffer && Et.setValue( I, "logDepthBufFC", - 2 / (Math.log(O.far + 1) / Math.LN2) - ), (ae.isMeshPhongMaterial || ae.isMeshToonMaterial || ae.isMeshLambertMaterial || ae.isMeshBasicMaterial || ae.isMeshStandardMaterial || ae.isShaderMaterial) && Tt.setValue(I, "isOrthographic", O.isOrthographicCamera === !0), C !== O && (C = O, En = !0, Fr = !0); + 2 / (Math.log(k.far + 1) / Math.LN2) + ), (ae.isMeshPhongMaterial || ae.isMeshToonMaterial || ae.isMeshLambertMaterial || ae.isMeshBasicMaterial || ae.isMeshStandardMaterial || ae.isShaderMaterial) && Et.setValue(I, "isOrthographic", k.isOrthographicCamera === !0), C !== k && (C = k, En = !0, zr = !0); } if (ne.isSkinnedMesh) { - Tt.setOptional(I, ne, "bindMatrix"), Tt.setOptional(I, ne, "bindMatrixInverse"); + Et.setOptional(I, ne, "bindMatrix"), Et.setOptional(I, ne, "bindMatrixInverse"); const on = ne.skeleton; - on && (on.boneTexture === null && on.computeBoneTexture(), Tt.setValue(I, "boneTexture", on.boneTexture, G)); + on && (on.boneTexture === null && on.computeBoneTexture(), Et.setValue(I, "boneTexture", on.boneTexture, G)); } - ne.isBatchedMesh && (Tt.setOptional(I, ne, "batchingTexture"), Tt.setValue(I, "batchingTexture", ne._matricesTexture, G), Tt.setOptional(I, ne, "batchingIdTexture"), Tt.setValue(I, "batchingIdTexture", ne._indirectTexture, G), Tt.setOptional(I, ne, "batchingColorTexture"), ne._colorsTexture !== null && Tt.setValue(I, "batchingColorTexture", ne._colorsTexture, G)); + ne.isBatchedMesh && (Et.setOptional(I, ne, "batchingTexture"), Et.setValue(I, "batchingTexture", ne._matricesTexture, G), Et.setOptional(I, ne, "batchingIdTexture"), Et.setValue(I, "batchingIdTexture", ne._indirectTexture, G), Et.setOptional(I, ne, "batchingColorTexture"), ne._colorsTexture !== null && Et.setValue(I, "batchingColorTexture", ne._colorsTexture, G)); const Pn = oe.morphAttributes; - if ((Pn.position !== void 0 || Pn.normal !== void 0 || Pn.color !== void 0) && Ve.update(ne, oe, Sn), (En || Xe.receiveShadow !== ne.receiveShadow) && (Xe.receiveShadow = ne.receiveShadow, Tt.setValue(I, "receiveShadow", ne.receiveShadow)), ae.isMeshGouraudMaterial && ae.envMap !== null && (fn.envMap.value = Ie, fn.flipEnvMap.value = Ie.isCubeTexture && Ie.isRenderTargetTexture === !1 ? -1 : 1), ae.isMeshStandardMaterial && ae.envMap === null && Q.environment !== null && (fn.envMapIntensity.value = Q.environmentIntensity), fn.dfgLUT !== void 0 && (fn.dfgLUT.value = H2()), En && (Tt.setValue(I, "toneMappingExposure", E.toneMappingExposure), Xe.needsLights && Y0(fn, Fr), Se && ae.fog === !0 && Te.refreshFogUniforms(fn, Se), Te.refreshMaterialUniforms(fn, ae, re, Z, v.state.transmissionRenderTarget[O.id]), rl.upload(I, ad(Xe), fn, G)), ae.isShaderMaterial && ae.uniformsNeedUpdate === !0 && (rl.upload(I, ad(Xe), fn, G), ae.uniformsNeedUpdate = !1), ae.isSpriteMaterial && Tt.setValue(I, "center", ne.center), Tt.setValue(I, "modelViewMatrix", ne.modelViewMatrix), Tt.setValue(I, "normalMatrix", ne.normalMatrix), Tt.setValue(I, "modelMatrix", ne.matrixWorld), ae.isShaderMaterial || ae.isRawShaderMaterial) { + if ((Pn.position !== void 0 || Pn.normal !== void 0 || Pn.color !== void 0) && Ve.update(ne, oe, Sn), (En || Xe.receiveShadow !== ne.receiveShadow) && (Xe.receiveShadow = ne.receiveShadow, Et.setValue(I, "receiveShadow", ne.receiveShadow)), ae.isMeshGouraudMaterial && ae.envMap !== null && (fn.envMap.value = Ie, fn.flipEnvMap.value = Ie.isCubeTexture && Ie.isRenderTargetTexture === !1 ? -1 : 1), ae.isMeshStandardMaterial && ae.envMap === null && Q.environment !== null && (fn.envMapIntensity.value = Q.environmentIntensity), fn.dfgLUT !== void 0 && (fn.dfgLUT.value = H2()), En && (Et.setValue(I, "toneMappingExposure", E.toneMappingExposure), Xe.needsLights && Y0(fn, zr), Se && ae.fog === !0 && Te.refreshFogUniforms(fn, Se), Te.refreshMaterialUniforms(fn, ae, re, q, v.state.transmissionRenderTarget[k.id]), sl.upload(I, od(Xe), fn, G)), ae.isShaderMaterial && ae.uniformsNeedUpdate === !0 && (sl.upload(I, od(Xe), fn, G), ae.uniformsNeedUpdate = !1), ae.isSpriteMaterial && Et.setValue(I, "center", ne.center), Et.setValue(I, "modelViewMatrix", ne.modelViewMatrix), Et.setValue(I, "normalMatrix", ne.normalMatrix), Et.setValue(I, "modelMatrix", ne.matrixWorld), ae.isShaderMaterial || ae.isRawShaderMaterial) { const on = ae.uniformsGroups; for (let pn = 0, Fl = on.length; pn < Fl; pn++) { const ns = on[pn]; @@ -28514,11 +28514,11 @@ class Jm { } return Sn; } - function Y0(O, Q) { - O.ambientLightColor.needsUpdate = Q, O.lightProbe.needsUpdate = Q, O.directionalLights.needsUpdate = Q, O.directionalLightShadows.needsUpdate = Q, O.pointLights.needsUpdate = Q, O.pointLightShadows.needsUpdate = Q, O.spotLights.needsUpdate = Q, O.spotLightShadows.needsUpdate = Q, O.rectAreaLights.needsUpdate = Q, O.hemisphereLights.needsUpdate = Q; + function Y0(k, Q) { + k.ambientLightColor.needsUpdate = Q, k.lightProbe.needsUpdate = Q, k.directionalLights.needsUpdate = Q, k.directionalLightShadows.needsUpdate = Q, k.pointLights.needsUpdate = Q, k.pointLightShadows.needsUpdate = Q, k.spotLights.needsUpdate = Q, k.spotLightShadows.needsUpdate = Q, k.rectAreaLights.needsUpdate = Q, k.hemisphereLights.needsUpdate = Q; } - function K0(O) { - return O.isMeshLambertMaterial || O.isMeshToonMaterial || O.isMeshPhongMaterial || O.isMeshStandardMaterial || O.isShadowMaterial || O.isShaderMaterial && O.lights === !0; + function K0(k) { + return k.isMeshLambertMaterial || k.isMeshToonMaterial || k.isMeshPhongMaterial || k.isMeshStandardMaterial || k.isShadowMaterial || k.isShaderMaterial && k.lights === !0; } this.getActiveCubeFace = function() { return R; @@ -28526,140 +28526,140 @@ class Jm { return _; }, this.getRenderTarget = function() { return S; - }, this.setRenderTargetTextures = function(O, Q, oe) { - const ae = J.get(O); - ae.__autoAllocateDepthBuffer = O.resolveDepthBuffer === !1, ae.__autoAllocateDepthBuffer === !1 && (ae.__useRenderToTexture = !1), J.get(O.texture).__webglTexture = Q, J.get(O.depthTexture).__webglTexture = ae.__autoAllocateDepthBuffer ? void 0 : oe, ae.__hasExternalTextures = !0; - }, this.setRenderTargetFramebuffer = function(O, Q) { - const oe = J.get(O); + }, this.setRenderTargetTextures = function(k, Q, oe) { + const ae = J.get(k); + ae.__autoAllocateDepthBuffer = k.resolveDepthBuffer === !1, ae.__autoAllocateDepthBuffer === !1 && (ae.__useRenderToTexture = !1), J.get(k.texture).__webglTexture = Q, J.get(k.depthTexture).__webglTexture = ae.__autoAllocateDepthBuffer ? void 0 : oe, ae.__hasExternalTextures = !0; + }, this.setRenderTargetFramebuffer = function(k, Q) { + const oe = J.get(k); oe.__webglFramebuffer = Q, oe.__useDefaultFramebuffer = Q === void 0; }; const $0 = I.createFramebuffer(); - this.setRenderTarget = function(O, Q = 0, oe = 0) { - S = O, R = Q, _ = oe; + this.setRenderTarget = function(k, Q = 0, oe = 0) { + S = k, R = Q, _ = oe; let ae = !0, ne = null, Se = !1, Le = !1; - if (O) { - const Ie = J.get(O); + if (k) { + const Ie = J.get(k); if (Ie.__useDefaultFramebuffer !== void 0) z.bindFramebuffer(I.FRAMEBUFFER, null), ae = !1; else if (Ie.__webglFramebuffer === void 0) - G.setupRenderTarget(O); + G.setupRenderTarget(k); else if (Ie.__hasExternalTextures) - G.rebindTextures(O, J.get(O.texture).__webglTexture, J.get(O.depthTexture).__webglTexture); - else if (O.depthBuffer) { - const We = O.depthTexture; + G.rebindTextures(k, J.get(k.texture).__webglTexture, J.get(k.depthTexture).__webglTexture); + else if (k.depthBuffer) { + const We = k.depthTexture; if (Ie.__boundDepthTexture !== We) { - if (We !== null && J.has(We) && (O.width !== We.image.width || O.height !== We.image.height)) + if (We !== null && J.has(We) && (k.width !== We.image.width || k.height !== We.image.height)) throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size."); - G.setupDepthRenderbuffer(O); + G.setupDepthRenderbuffer(k); } } - const je = O.texture; + const je = k.texture; (je.isData3DTexture || je.isDataArrayTexture || je.isCompressedArrayTexture) && (Le = !0); - const qe = J.get(O).__webglFramebuffer; - O.isWebGLCubeRenderTarget ? (Array.isArray(qe[Q]) ? ne = qe[Q][oe] : ne = qe[Q], Se = !0) : O.samples > 0 && G.useMultisampledRTT(O) === !1 ? ne = J.get(O).__webglMultisampledFramebuffer : Array.isArray(qe) ? ne = qe[oe] : ne = qe, B.copy(O.viewport), w.copy(O.scissor), F = O.scissorTest; + const Ze = J.get(k).__webglFramebuffer; + k.isWebGLCubeRenderTarget ? (Array.isArray(Ze[Q]) ? ne = Ze[Q][oe] : ne = Ze[Q], Se = !0) : k.samples > 0 && G.useMultisampledRTT(k) === !1 ? ne = J.get(k).__webglMultisampledFramebuffer : Array.isArray(Ze) ? ne = Ze[oe] : ne = Ze, B.copy(k.viewport), w.copy(k.scissor), F = k.scissorTest; } else B.copy(ge).multiplyScalar(re).floor(), w.copy(pe).multiplyScalar(re).floor(), F = de; - if (oe !== 0 && (ne = $0), z.bindFramebuffer(I.FRAMEBUFFER, ne) && ae && z.drawBuffers(O, ne), z.viewport(B), z.scissor(w), z.setScissorTest(F), Se) { - const Ie = J.get(O.texture); + if (oe !== 0 && (ne = $0), z.bindFramebuffer(I.FRAMEBUFFER, ne) && ae && z.drawBuffers(k, ne), z.viewport(B), z.scissor(w), z.setScissorTest(F), Se) { + const Ie = J.get(k.texture); I.framebufferTexture2D(I.FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_CUBE_MAP_POSITIVE_X + Q, Ie.__webglTexture, oe); } else if (Le) { const Ie = Q; - for (let je = 0; je < O.textures.length; je++) { - const qe = J.get(O.textures[je]); - I.framebufferTextureLayer(I.FRAMEBUFFER, I.COLOR_ATTACHMENT0 + je, qe.__webglTexture, oe, Ie); + for (let je = 0; je < k.textures.length; je++) { + const Ze = J.get(k.textures[je]); + I.framebufferTextureLayer(I.FRAMEBUFFER, I.COLOR_ATTACHMENT0 + je, Ze.__webglTexture, oe, Ie); } - } else if (O !== null && oe !== 0) { - const Ie = J.get(O.texture); + } else if (k !== null && oe !== 0) { + const Ie = J.get(k.texture); I.framebufferTexture2D(I.FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, Ie.__webglTexture, oe); } D = -1; - }, this.readRenderTargetPixels = function(O, Q, oe, ae, ne, Se, Le, Oe = 0) { - if (!(O && O.isWebGLRenderTarget)) { + }, this.readRenderTargetPixels = function(k, Q, oe, ae, ne, Se, Le, Fe = 0) { + if (!(k && k.isWebGLRenderTarget)) { et("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); return; } - let Ie = J.get(O).__webglFramebuffer; - if (O.isWebGLCubeRenderTarget && Le !== void 0 && (Ie = Ie[Le]), Ie) { + let Ie = J.get(k).__webglFramebuffer; + if (k.isWebGLCubeRenderTarget && Le !== void 0 && (Ie = Ie[Le]), Ie) { z.bindFramebuffer(I.FRAMEBUFFER, Ie); try { - const je = O.textures[Oe], qe = je.format, We = je.type; - if (!k.textureFormatReadable(qe)) { + const je = k.textures[Fe], Ze = je.format, We = je.type; + if (!U.textureFormatReadable(Ze)) { et("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); return; } - if (!k.textureTypeReadable(We)) { + if (!U.textureTypeReadable(We)) { et("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); return; } - Q >= 0 && Q <= O.width - ae && oe >= 0 && oe <= O.height - ne && (O.textures.length > 1 && I.readBuffer(I.COLOR_ATTACHMENT0 + Oe), I.readPixels(Q, oe, ae, ne, Ge.convert(qe), Ge.convert(We), Se)); + Q >= 0 && Q <= k.width - ae && oe >= 0 && oe <= k.height - ne && (k.textures.length > 1 && I.readBuffer(I.COLOR_ATTACHMENT0 + Fe), I.readPixels(Q, oe, ae, ne, Ge.convert(Ze), Ge.convert(We), Se)); } finally { const je = S !== null ? J.get(S).__webglFramebuffer : null; z.bindFramebuffer(I.FRAMEBUFFER, je); } } - }, this.readRenderTargetPixelsAsync = async function(O, Q, oe, ae, ne, Se, Le, Oe = 0) { - if (!(O && O.isWebGLRenderTarget)) + }, this.readRenderTargetPixelsAsync = async function(k, Q, oe, ae, ne, Se, Le, Fe = 0) { + if (!(k && k.isWebGLRenderTarget)) throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); - let Ie = J.get(O).__webglFramebuffer; - if (O.isWebGLCubeRenderTarget && Le !== void 0 && (Ie = Ie[Le]), Ie) - if (Q >= 0 && Q <= O.width - ae && oe >= 0 && oe <= O.height - ne) { + let Ie = J.get(k).__webglFramebuffer; + if (k.isWebGLCubeRenderTarget && Le !== void 0 && (Ie = Ie[Le]), Ie) + if (Q >= 0 && Q <= k.width - ae && oe >= 0 && oe <= k.height - ne) { z.bindFramebuffer(I.FRAMEBUFFER, Ie); - const je = O.textures[Oe], qe = je.format, We = je.type; - if (!k.textureFormatReadable(qe)) + const je = k.textures[Fe], Ze = je.format, We = je.type; + if (!U.textureFormatReadable(Ze)) throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format."); - if (!k.textureTypeReadable(We)) + if (!U.textureTypeReadable(We)) throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type."); const it = I.createBuffer(); - I.bindBuffer(I.PIXEL_PACK_BUFFER, it), I.bufferData(I.PIXEL_PACK_BUFFER, Se.byteLength, I.STREAM_READ), O.textures.length > 1 && I.readBuffer(I.COLOR_ATTACHMENT0 + Oe), I.readPixels(Q, oe, ae, ne, Ge.convert(qe), Ge.convert(We), 0); + I.bindBuffer(I.PIXEL_PACK_BUFFER, it), I.bufferData(I.PIXEL_PACK_BUFFER, Se.byteLength, I.STREAM_READ), k.textures.length > 1 && I.readBuffer(I.COLOR_ATTACHMENT0 + Fe), I.readPixels(Q, oe, ae, ne, Ge.convert(Ze), Ge.convert(We), 0); const pt = S !== null ? J.get(S).__webglFramebuffer : null; z.bindFramebuffer(I.FRAMEBUFFER, pt); - const Rt = I.fenceSync(I.SYNC_GPU_COMMANDS_COMPLETE, 0); - return I.flush(), await Gg(I, Rt, 4), I.bindBuffer(I.PIXEL_PACK_BUFFER, it), I.getBufferSubData(I.PIXEL_PACK_BUFFER, 0, Se), I.deleteBuffer(it), I.deleteSync(Rt), Se; + const Pt = I.fenceSync(I.SYNC_GPU_COMMANDS_COMPLETE, 0); + return I.flush(), await Gg(I, Pt, 4), I.bindBuffer(I.PIXEL_PACK_BUFFER, it), I.getBufferSubData(I.PIXEL_PACK_BUFFER, 0, Se), I.deleteBuffer(it), I.deleteSync(Pt), Se; } else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range."); - }, this.copyFramebufferToTexture = function(O, Q = null, oe = 0) { - const ae = Math.pow(2, -oe), ne = Math.floor(O.image.width * ae), Se = Math.floor(O.image.height * ae), Le = Q !== null ? Q.x : 0, Oe = Q !== null ? Q.y : 0; - G.setTexture2D(O, 0), I.copyTexSubImage2D(I.TEXTURE_2D, oe, 0, 0, Le, Oe, ne, Se), z.unbindTexture(); + }, this.copyFramebufferToTexture = function(k, Q = null, oe = 0) { + const ae = Math.pow(2, -oe), ne = Math.floor(k.image.width * ae), Se = Math.floor(k.image.height * ae), Le = Q !== null ? Q.x : 0, Fe = Q !== null ? Q.y : 0; + G.setTexture2D(k, 0), I.copyTexSubImage2D(I.TEXTURE_2D, oe, 0, 0, Le, Fe, ne, Se), z.unbindTexture(); }; const J0 = I.createFramebuffer(), Q0 = I.createFramebuffer(); - this.copyTextureToTexture = function(O, Q, oe = null, ae = null, ne = 0, Se = null) { - Se === null && (ne !== 0 ? (Co("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), Se = ne, ne = 0) : Se = 0); - let Le, Oe, Ie, je, qe, We, it, pt, Rt; - const Lt = O.isCompressedTexture ? O.mipmaps[Se] : O.image; + this.copyTextureToTexture = function(k, Q, oe = null, ae = null, ne = 0, Se = null) { + Se === null && (ne !== 0 ? (Po("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), Se = ne, ne = 0) : Se = 0); + let Le, Fe, Ie, je, Ze, We, it, pt, Pt; + const Rt = k.isCompressedTexture ? k.mipmaps[Se] : k.image; if (oe !== null) - Le = oe.max.x - oe.min.x, Oe = oe.max.y - oe.min.y, Ie = oe.isBox3 ? oe.max.z - oe.min.z : 1, je = oe.min.x, qe = oe.min.y, We = oe.isBox3 ? oe.min.z : 0; + Le = oe.max.x - oe.min.x, Fe = oe.max.y - oe.min.y, Ie = oe.isBox3 ? oe.max.z - oe.min.z : 1, je = oe.min.x, Ze = oe.min.y, We = oe.isBox3 ? oe.min.z : 0; else { const Pn = Math.pow(2, -ne); - Le = Math.floor(Lt.width * Pn), Oe = Math.floor(Lt.height * Pn), O.isDataArrayTexture ? Ie = Lt.depth : O.isData3DTexture ? Ie = Math.floor(Lt.depth * Pn) : Ie = 1, je = 0, qe = 0, We = 0; + Le = Math.floor(Rt.width * Pn), Fe = Math.floor(Rt.height * Pn), k.isDataArrayTexture ? Ie = Rt.depth : k.isData3DTexture ? Ie = Math.floor(Rt.depth * Pn) : Ie = 1, je = 0, Ze = 0, We = 0; } - ae !== null ? (it = ae.x, pt = ae.y, Rt = ae.z) : (it = 0, pt = 0, Rt = 0); + ae !== null ? (it = ae.x, pt = ae.y, Pt = ae.z) : (it = 0, pt = 0, Pt = 0); const gt = Ge.convert(Q.format), Xe = Ge.convert(Q.type); - let Et; - Q.isData3DTexture ? (G.setTexture3D(Q, 0), Et = I.TEXTURE_3D) : Q.isDataArrayTexture || Q.isCompressedArrayTexture ? (G.setTexture2DArray(Q, 0), Et = I.TEXTURE_2D_ARRAY) : (G.setTexture2D(Q, 0), Et = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, Q.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, Q.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, Q.unpackAlignment); - const rt = I.getParameter(I.UNPACK_ROW_LENGTH), Sn = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Is = I.getParameter(I.UNPACK_SKIP_PIXELS), En = I.getParameter(I.UNPACK_SKIP_ROWS), Fr = I.getParameter(I.UNPACK_SKIP_IMAGES); - I.pixelStorei(I.UNPACK_ROW_LENGTH, Lt.width), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Lt.height), I.pixelStorei(I.UNPACK_SKIP_PIXELS, je), I.pixelStorei(I.UNPACK_SKIP_ROWS, qe), I.pixelStorei(I.UNPACK_SKIP_IMAGES, We); - const Tt = O.isDataArrayTexture || O.isData3DTexture, fn = Q.isDataArrayTexture || Q.isData3DTexture; - if (O.isDepthTexture) { - const Pn = J.get(O), on = J.get(Q), pn = J.get(Pn.__renderTarget), Fl = J.get(on.__renderTarget); + let St; + Q.isData3DTexture ? (G.setTexture3D(Q, 0), St = I.TEXTURE_3D) : Q.isDataArrayTexture || Q.isCompressedArrayTexture ? (G.setTexture2DArray(Q, 0), St = I.TEXTURE_2D_ARRAY) : (G.setTexture2D(Q, 0), St = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, Q.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, Q.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, Q.unpackAlignment); + const rt = I.getParameter(I.UNPACK_ROW_LENGTH), Sn = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Bs = I.getParameter(I.UNPACK_SKIP_PIXELS), En = I.getParameter(I.UNPACK_SKIP_ROWS), zr = I.getParameter(I.UNPACK_SKIP_IMAGES); + I.pixelStorei(I.UNPACK_ROW_LENGTH, Rt.width), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Rt.height), I.pixelStorei(I.UNPACK_SKIP_PIXELS, je), I.pixelStorei(I.UNPACK_SKIP_ROWS, Ze), I.pixelStorei(I.UNPACK_SKIP_IMAGES, We); + const Et = k.isDataArrayTexture || k.isData3DTexture, fn = Q.isDataArrayTexture || Q.isData3DTexture; + if (k.isDepthTexture) { + const Pn = J.get(k), on = J.get(Q), pn = J.get(Pn.__renderTarget), Fl = J.get(on.__renderTarget); z.bindFramebuffer(I.READ_FRAMEBUFFER, pn.__webglFramebuffer), z.bindFramebuffer(I.DRAW_FRAMEBUFFER, Fl.__webglFramebuffer); for (let ns = 0; ns < Ie; ns++) - Tt && (I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, J.get(O).__webglTexture, ne, We + ns), I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, J.get(Q).__webglTexture, Se, Rt + ns)), I.blitFramebuffer(je, qe, Le, Oe, it, pt, Le, Oe, I.DEPTH_BUFFER_BIT, I.NEAREST); + Et && (I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, J.get(k).__webglTexture, ne, We + ns), I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, J.get(Q).__webglTexture, Se, Pt + ns)), I.blitFramebuffer(je, Ze, Le, Fe, it, pt, Le, Fe, I.DEPTH_BUFFER_BIT, I.NEAREST); z.bindFramebuffer(I.READ_FRAMEBUFFER, null), z.bindFramebuffer(I.DRAW_FRAMEBUFFER, null); - } else if (ne !== 0 || O.isRenderTargetTexture || J.has(O)) { - const Pn = J.get(O), on = J.get(Q); + } else if (ne !== 0 || k.isRenderTargetTexture || J.has(k)) { + const Pn = J.get(k), on = J.get(Q); z.bindFramebuffer(I.READ_FRAMEBUFFER, J0), z.bindFramebuffer(I.DRAW_FRAMEBUFFER, Q0); for (let pn = 0; pn < Ie; pn++) - Tt ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, Pn.__webglTexture, ne, We + pn) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, Pn.__webglTexture, ne), fn ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, on.__webglTexture, Se, Rt + pn) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, on.__webglTexture, Se), ne !== 0 ? I.blitFramebuffer(je, qe, Le, Oe, it, pt, Le, Oe, I.COLOR_BUFFER_BIT, I.NEAREST) : fn ? I.copyTexSubImage3D(Et, Se, it, pt, Rt + pn, je, qe, Le, Oe) : I.copyTexSubImage2D(Et, Se, it, pt, je, qe, Le, Oe); + Et ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, Pn.__webglTexture, ne, We + pn) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, Pn.__webglTexture, ne), fn ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, on.__webglTexture, Se, Pt + pn) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, on.__webglTexture, Se), ne !== 0 ? I.blitFramebuffer(je, Ze, Le, Fe, it, pt, Le, Fe, I.COLOR_BUFFER_BIT, I.NEAREST) : fn ? I.copyTexSubImage3D(St, Se, it, pt, Pt + pn, je, Ze, Le, Fe) : I.copyTexSubImage2D(St, Se, it, pt, je, Ze, Le, Fe); z.bindFramebuffer(I.READ_FRAMEBUFFER, null), z.bindFramebuffer(I.DRAW_FRAMEBUFFER, null); } else - fn ? O.isDataTexture || O.isData3DTexture ? I.texSubImage3D(Et, Se, it, pt, Rt, Le, Oe, Ie, gt, Xe, Lt.data) : Q.isCompressedArrayTexture ? I.compressedTexSubImage3D(Et, Se, it, pt, Rt, Le, Oe, Ie, gt, Lt.data) : I.texSubImage3D(Et, Se, it, pt, Rt, Le, Oe, Ie, gt, Xe, Lt) : O.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, Se, it, pt, Le, Oe, gt, Xe, Lt.data) : O.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, Se, it, pt, Lt.width, Lt.height, gt, Lt.data) : I.texSubImage2D(I.TEXTURE_2D, Se, it, pt, Le, Oe, gt, Xe, Lt); - I.pixelStorei(I.UNPACK_ROW_LENGTH, rt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Sn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Is), I.pixelStorei(I.UNPACK_SKIP_ROWS, En), I.pixelStorei(I.UNPACK_SKIP_IMAGES, Fr), Se === 0 && Q.generateMipmaps && I.generateMipmap(Et), z.unbindTexture(); - }, this.initRenderTarget = function(O) { - J.get(O).__webglFramebuffer === void 0 && G.setupRenderTarget(O); - }, this.initTexture = function(O) { - O.isCubeTexture ? G.setTextureCube(O, 0) : O.isData3DTexture ? G.setTexture3D(O, 0) : O.isDataArrayTexture || O.isCompressedArrayTexture ? G.setTexture2DArray(O, 0) : G.setTexture2D(O, 0), z.unbindTexture(); + fn ? k.isDataTexture || k.isData3DTexture ? I.texSubImage3D(St, Se, it, pt, Pt, Le, Fe, Ie, gt, Xe, Rt.data) : Q.isCompressedArrayTexture ? I.compressedTexSubImage3D(St, Se, it, pt, Pt, Le, Fe, Ie, gt, Rt.data) : I.texSubImage3D(St, Se, it, pt, Pt, Le, Fe, Ie, gt, Xe, Rt) : k.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, Se, it, pt, Le, Fe, gt, Xe, Rt.data) : k.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, Se, it, pt, Rt.width, Rt.height, gt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, Se, it, pt, Le, Fe, gt, Xe, Rt); + I.pixelStorei(I.UNPACK_ROW_LENGTH, rt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Sn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Bs), I.pixelStorei(I.UNPACK_SKIP_ROWS, En), I.pixelStorei(I.UNPACK_SKIP_IMAGES, zr), Se === 0 && Q.generateMipmaps && I.generateMipmap(St), z.unbindTexture(); + }, this.initRenderTarget = function(k) { + J.get(k).__webglFramebuffer === void 0 && G.setupRenderTarget(k); + }, this.initTexture = function(k) { + k.isCubeTexture ? G.setTextureCube(k, 0) : k.isData3DTexture ? G.setTexture3D(k, 0) : k.isDataArrayTexture || k.isCompressedArrayTexture ? G.setTexture2DArray(k, 0) : G.setTexture2D(k, 0), z.unbindTexture(); }, this.resetState = function() { - R = 0, _ = 0, S = null, z.reset(), q.reset(); + R = 0, _ = 0, S = null, z.reset(), Z.reset(); }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } /** @@ -28712,7 +28712,7 @@ class G2 { 1e3 ), this.perspectiveCamera.position.set(2, 2, 2), this.perspectiveCamera.lookAt(0, 0, 0); const t = 50, n = this.engine.container.clientWidth / this.engine.container.clientHeight; - this.orthographicCamera = new Rs(t * n / -2, t * n / 2, t / 2, t / -2, 0.1, 1e3); + this.orthographicCamera = new Ls(t * n / -2, t * n / 2, t / 2, t / -2, 0.1, 1e3); } // 切换当前相机 switchCurrentCamera() { @@ -28806,13 +28806,13 @@ class X2 { alpha: !0, premultipliedAlpha: !1, stencil: !0 - }), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = tm, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = xt, this.renderer.toneMapping = _u, this.renderer.toneMappingExposure = 1.5, this.engine.container.appendChild(this.renderer.domElement), this.renderer; + }), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = tm, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = xt, this.renderer.toneMapping = yu, this.renderer.toneMappingExposure = 1.5, this.engine.container.appendChild(this.renderer.domElement), this.renderer; } disposeRenderer() { this.renderer?.dispose(); } } -const Uf = { type: "change" }, Gu = { type: "start" }, Qm = { type: "end" }, wa = new Qi(), Of = new _t(), j2 = Math.cos(70 * go.DEG2RAD), Ft = new P(), mn = 2 * Math.PI, mt = { +const Uf = { type: "change" }, Vu = { type: "start" }, Qm = { type: "end" }, wa = new Qi(), Of = new _t(), j2 = Math.cos(70 * xo.DEG2RAD), Ft = new P(), mn = 2 * Math.PI, mt = { NONE: -1, ROTATE: 0, DOLLY: 1, @@ -28822,7 +28822,7 @@ const Uf = { type: "change" }, Gu = { type: "start" }, Qm = { type: "end" }, wa TOUCH_DOLLY_PAN: 5, TOUCH_DOLLY_ROTATE: 6 }, Ec = 1e-6; -class q2 extends t1 { +class Z2 extends t1 { /** * Constructs a new controls instance. * @@ -28833,7 +28833,7 @@ class q2 extends t1 { super(t, n), this.engine = e, this.state = mt.NONE, this.target = new P(), this.cursor = new P(), this.origin = new P(0, 0, 0), this.showOriginIcon = !0, this.originPosition = { x: 0, y: 0 - }, this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: fr.ROTATE, MIDDLE: fr.DOLLY, RIGHT: fr.PAN }, this.touches = { ONE: cr.ROTATE, TWO: cr.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new P(), this._lastQuaternion = new zn(), this._lastTargetPosition = new P(), this._quat = new zn().setFromUnitVectors(t.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new uf(), this._sphericalDelta = new uf(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new ce(), this._rotateEnd = new ce(), this._rotateDelta = new ce(), this._panStart = new ce(), this._panEnd = new ce(), this._panDelta = new ce(), this._dollyStart = new ce(), this._dollyEnd = new ce(), this._dollyDelta = new ce(), this._dollyDirection = new P(), this._mouse = new ce(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Y2.bind(this), this._onPointerDown = Z2.bind(this), this._onPointerUp = K2.bind(this), this._onContextMenu = iM.bind(this), this._onMouseWheel = Q2.bind(this), this._onKeyDown = eM.bind(this), this._onTouchStart = tM.bind(this), this._onTouchMove = nM.bind(this), this._onMouseDown = $2.bind(this), this._onMouseMove = J2.bind(this), this._interceptControlDown = sM.bind(this), this._interceptControlUp = rM.bind(this), this.domElement !== null && this.connect(this.domElement), this.update(); + }, this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: pr.ROTATE, MIDDLE: pr.DOLLY, RIGHT: pr.PAN }, this.touches = { ONE: hr.ROTATE, TWO: hr.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new P(), this._lastQuaternion = new zn(), this._lastTargetPosition = new P(), this._quat = new zn().setFromUnitVectors(t.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new hf(), this._sphericalDelta = new hf(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new ce(), this._rotateEnd = new ce(), this._rotateDelta = new ce(), this._panStart = new ce(), this._panEnd = new ce(), this._panDelta = new ce(), this._dollyStart = new ce(), this._dollyEnd = new ce(), this._dollyDelta = new ce(), this._dollyDirection = new P(), this._mouse = new ce(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Y2.bind(this), this._onPointerDown = q2.bind(this), this._onPointerUp = K2.bind(this), this._onContextMenu = iM.bind(this), this._onMouseWheel = Q2.bind(this), this._onKeyDown = eM.bind(this), this._onTouchStart = tM.bind(this), this._onTouchMove = nM.bind(this), this._onMouseDown = $2.bind(this), this._onMouseMove = J2.bind(this), this._interceptControlDown = sM.bind(this), this._interceptControlUp = rM.bind(this), this.domElement !== null && this.connect(this.domElement), this.update(); } connect(e) { super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none"; @@ -29143,7 +29143,7 @@ class q2 extends t1 { return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n; } } -function Z2(s) { +function q2(s) { this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(s.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(s) && (this._addPointer(s), s.pointerType === "touch" ? this._onTouchStart(s) : this._onMouseDown(s))); } function Y2(s) { @@ -29180,11 +29180,11 @@ function $2(s) { e = -1; } switch (e) { - case fr.DOLLY: + case pr.DOLLY: if (this.enableZoom === !1) return; this._handleMouseDownDolly(s), this.state = mt.DOLLY; break; - case fr.ROTATE: + case pr.ROTATE: if (s.ctrlKey || s.metaKey || s.shiftKey) { if (this.enablePan === !1) return; this._handleMouseDownPan(s), this.state = mt.PAN; @@ -29193,7 +29193,7 @@ function $2(s) { this._handleMouseDownRotate(s), this.state = mt.ROTATE; } break; - case fr.PAN: + case pr.PAN: if (s.ctrlKey || s.metaKey || s.shiftKey) { if (this.enableRotate === !1) return; this._handleMouseDownRotate(s), this.state = mt.ROTATE; @@ -29205,7 +29205,7 @@ function $2(s) { default: this.state = mt.NONE; } - this.state !== mt.NONE && this.dispatchEvent(Gu); + this.state !== mt.NONE && this.dispatchEvent(Vu); } function J2(s) { switch (this.state) { @@ -29224,7 +29224,7 @@ function J2(s) { } } function Q2(s) { - this.enabled === !1 || this.enableZoom === !1 || this.state !== mt.NONE || (s.preventDefault(), this.dispatchEvent(Gu), this._handleMouseWheel(this._customWheelEvent(s)), this.dispatchEvent(Qm)); + this.enabled === !1 || this.enableZoom === !1 || this.state !== mt.NONE || (s.preventDefault(), this.dispatchEvent(Vu), this._handleMouseWheel(this._customWheelEvent(s)), this.dispatchEvent(Qm)); } function eM(s) { this.enabled !== !1 && this._handleKeyDown(s); @@ -29233,11 +29233,11 @@ function tM(s) { switch (this._trackPointer(s), this._pointers.length) { case 1: switch (this.touches.ONE) { - case cr.ROTATE: + case hr.ROTATE: if (this.enableRotate === !1) return; this._handleTouchStartRotate(s), this.state = mt.TOUCH_ROTATE; break; - case cr.PAN: + case hr.PAN: if (this.enablePan === !1) return; this._handleTouchStartPan(s), this.state = mt.TOUCH_PAN; break; @@ -29247,11 +29247,11 @@ function tM(s) { break; case 2: switch (this.touches.TWO) { - case cr.DOLLY_PAN: + case hr.DOLLY_PAN: if (this.enableZoom === !1 && this.enablePan === !1) return; this._handleTouchStartDollyPan(s), this.state = mt.TOUCH_DOLLY_PAN; break; - case cr.DOLLY_ROTATE: + case hr.DOLLY_ROTATE: if (this.enableZoom === !1 && this.enableRotate === !1) return; this._handleTouchStartDollyRotate(s), this.state = mt.TOUCH_DOLLY_ROTATE; break; @@ -29262,7 +29262,7 @@ function tM(s) { default: this.state = mt.NONE; } - this.state !== mt.NONE && this.dispatchEvent(Gu); + this.state !== mt.NONE && this.dispatchEvent(Vu); } function nM(s) { switch (this._trackPointer(s), this.state) { @@ -29295,9 +29295,9 @@ function sM(s) { function rM(s) { s.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 })); } -class Ff { +class kf { constructor(e, t, n, i) { - this._Engine = e, this.camera = t, this.domElement = n, this._isEnabled = !1, this._rayOriginOffset = new P(0, -1, 0), this._camerLocalDirection = new P(), this._tmpVector = new P(), this._rayCaster = new Es(), this._fallingTime = 0, this._euler = new wn(0, 0, 0, "YZX"), this._prevMouseX = 0, this._prevMouseY = 0, this.applyGravity = !1, this.gravityMinHeight = !0, this.applyCollision = !0, this.positionEasing = !0, this.lookflag = 1, this.lookSpeed = 8e-3, this.moveSpeed = 0.02, this.playerHeight = 1.4, this.maxRotateX = 0.8, this.g = 9.8, this.bindmousedown = this._Engine && this._Engine.DeviceType !== "PC" ? this.onTouchStart.bind(this) : this.onMouseDown.bind(this), this.bindmouseup = this._Engine && this._Engine.DeviceType !== "PC" ? this.onTouchEnd.bind(this) : this.onMouseUp.bind(this), this.bindmousemove = this._Engine && this._Engine.DeviceType !== "PC" ? this.onTouchMove.bind(this) : this.onMouseMove.bind(this), this.bindonKeyDown = this.onKeyDown.bind(this), this.bindonKeyUp = this.onKeyUp.bind(this), this.bindMousewheel = this.onMousewheel.bind(this), this.needMousewheel = !1, this.moveWheelRun = !0, this.moveWheelStop = !1, this.wheelClock, this.keydown = !1, this.GetEngine = () => e; + this._Engine = e, this.camera = t, this.domElement = n, this._isEnabled = !1, this._rayOriginOffset = new P(0, -1, 0), this._camerLocalDirection = new P(), this._tmpVector = new P(), this._rayCaster = new Ts(), this._fallingTime = 0, this._euler = new wn(0, 0, 0, "YZX"), this._prevMouseX = 0, this._prevMouseY = 0, this.applyGravity = !1, this.gravityMinHeight = !0, this.applyCollision = !0, this.positionEasing = !0, this.lookflag = 1, this.lookSpeed = 8e-3, this.moveSpeed = 0.02, this.playerHeight = 1.4, this.maxRotateX = 0.8, this.g = 9.8, this.bindmousedown = this._Engine && this._Engine.DeviceType !== "PC" ? this.onTouchStart.bind(this) : this.onMouseDown.bind(this), this.bindmouseup = this._Engine && this._Engine.DeviceType !== "PC" ? this.onTouchEnd.bind(this) : this.onMouseUp.bind(this), this.bindmousemove = this._Engine && this._Engine.DeviceType !== "PC" ? this.onTouchMove.bind(this) : this.onMouseMove.bind(this), this.bindonKeyDown = this.onKeyDown.bind(this), this.bindonKeyUp = this.onKeyUp.bind(this), this.bindMousewheel = this.onMousewheel.bind(this), this.needMousewheel = !1, this.moveWheelRun = !0, this.moveWheelStop = !1, this.wheelClock, this.keydown = !1, this.GetEngine = () => e; } /** * @param {Object} colliders set objects for collision detection @@ -29535,7 +29535,7 @@ class Ff { return t && t.material.type, null; } } -function Wu(s) { +function Gu(s) { const e = { self: null, // 当前激活的行为对象 @@ -29564,18 +29564,18 @@ function Wu(s) { u.key === "Alt" && e.self && e.self.handelKeyAltUp != null && e.self.handelKeyAltUp(), u.key === "Tab" && e.self && e.self.handelKeyTabUp != null && e.self.handelKeyTabUp(), u.key === "Control" && e.self && e.self.handelKeyCtrlUp != null && e.self.handelKeyCtrlUp(), u.key === "Shift" && e.self && e.self.handelKeyShiftUp != null && e.self.handelKeyShiftUp(), u.key === "Meta" && e.self && e.self.handelKeyMetaUp != null && e.self.handelKeyMetaUp(), u.key === "Command" && e.self && e.self.handelKeyCommandUp != null && e.self.handelKeyCommandUp(), u.key === "Windows" && e.self && e.self.handelKeyWindowsUp != null && e.self.handelKeyWindowsUp(); } function i(u) { - const d = new ce(), f = s.renderer.domElement.clientWidth, p = s.renderer.domElement.clientHeight; - return d.x = u.offsetX / f * 2 - 1, d.y = -(u.offsetY / p) * 2 + 1, d; + const d = new ce(), f = s.renderer.domElement.clientWidth, g = s.renderer.domElement.clientHeight; + return d.x = u.offsetX / f * 2 - 1, d.y = -(u.offsetY / g) * 2 + 1, d; } function r(u) { - const d = new Es(), f = i(u); + const d = new Ts(), f = i(u); return d.setFromCamera(f, s.camera), d; } function o(u, d = !1) { const f = r(u); if (u.raycaster = f, d) { - const p = h(f, u); - u.catch = p; + const g = h(f, u); + u.catch = g; } } function a(u) { @@ -29590,8 +29590,8 @@ function Wu(s) { const d = Date.now(), f = d - e.mouseDownTime; if (e.self && e.self.handleMouseUp != null && (o(u, !1), e.self.handleMouseUp(u)), f < 100 && e.self && e.self.handleMouseClick != null) { o(u, !0); - const p = d - e.lastClickTime; - console.log(p), p < 200 ? e.self.handleMouseDoubleClick(u) : e.self.handleMouseClick(u), e.lastClickTime = Date.now(); + const g = d - e.lastClickTime; + console.log(g), g < 200 ? e.self.handleMouseDoubleClick(u) : e.self.handleMouseClick(u), e.lastClickTime = Date.now(); } } function h(u, d) { @@ -29599,7 +29599,7 @@ function Wu(s) { const f = s.octreeBox.rayInterationModel(u); if (f.length === 0) return; - let p = f[0].object.url, g = f[0].object.name, x = s.modelEdge.getModelEdge(p, g); + let g = f[0].object.url, p = f[0].object.name, x = s.modelEdge.getModelEdge(g, p); x || (x = [0, 0, []]); let m = "face", b = [], v = [], y = 5; if (x[2].map((R) => R[0]).forEach((R) => { @@ -29648,7 +29648,7 @@ function Wu(s) { const D = new ce().subVectors(S, _), C = D.lengthSq(); if (C < 1e-10) return R.distanceTo(_); - const B = new ce().subVectors(R, _), w = go.clamp(B.dot(D) / C, 0, 1), F = new ce().copy(D).multiplyScalar(w).add(_); + const B = new ce().subVectors(R, _), w = xo.clamp(B.dot(D) / C, 0, 1), F = new ce().copy(D).multiplyScalar(w).add(_); return R.distanceTo(F); } function E(R, _, S) { @@ -29656,10 +29656,10 @@ function Wu(s) { if (C < 1e-10) return 0; const B = new ce().subVectors(R, _); - return go.clamp(B.dot(D) / C, 0, 1); + return xo.clamp(B.dot(D) / C, 0, 1); } function A(R, _, S) { - const D = go.clamp(R, 0, 1); + const D = xo.clamp(R, 0, 1); return new P().lerpVectors(_, S, D); } } @@ -29676,10 +29676,10 @@ class oM { isDown = !1; containerOffset = { left: 0, top: 0 }; constructor(e) { - this.engine = e, this.init(), this.handelBehaved = Wu(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active(); + this.engine = e, this.init(), this.handelBehaved = Gu(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active(); } init() { - this.orbitControls = new q2(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new Ff(this.engine, this.engine.camera, this.engine.renderer.domElement); + this.orbitControls = new Z2(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new kf(this.engine, this.engine.camera, this.engine.renderer.domElement); const e = document.createElement("div"); this.originDiv = e, e.className = "originDiv", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.width = "30px", e.style.height = "30px", e.style.borderRadius = "50%", e.style.pointerEvents = "none", e.style.backgroundImage = "url(./assets/svg/rotate-orbit.svg)", this.engine.container.appendChild(this.originDiv); } @@ -29691,7 +29691,7 @@ class oM { } // 切换第一人称漫游模式 switchFirstPersonMode() { - this.firstPersonControls = new Ff( + this.firstPersonControls = new kf( this.engine, this.engine.camera, this.engine.renderer.domElement, @@ -29761,7 +29761,7 @@ const bs = { }` ) }; -class Ls { +class Ds { /** * Constructs a new pass. */ @@ -29801,7 +29801,7 @@ class Ls { dispose() { } } -const aM = new Rs(-1, 1, 1, -1, 0, 1); +const aM = new Ls(-1, 1, 1, -1, 0, 1); class lM extends ut { constructor() { super(), this.setAttribute("position", new rn([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new rn([0, 2, 0, 0, 2, 0], 2)); @@ -29844,7 +29844,7 @@ class Ll { this._mesh.material = e; } } -class ol extends Ls { +class rl extends Ds { /** * Constructs a new shader pass. * @@ -29854,7 +29854,7 @@ class ol extends Ls { * the read buffer. */ constructor(e, t = "tDiffuse") { - super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof Ut ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = oi.clone(e.uniforms), this.material = new Ut({ + super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof Ot ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = oi.clone(e.uniforms), this.material = new Ot({ name: e.name !== void 0 ? e.name : "unspecified", defines: Object.assign({}, e.defines), uniforms: this.uniforms, @@ -29884,7 +29884,7 @@ class ol extends Ls { this.material.dispose(), this._fsQuad.dispose(); } } -class zf extends Ls { +class Ff extends Ds { /** * Constructs a new mask pass. * @@ -29912,7 +29912,7 @@ class zf extends Ls { this.inverse ? (o = 0, a = 1) : (o = 1, a = 0), r.buffers.stencil.setTest(!0), r.buffers.stencil.setOp(i.REPLACE, i.REPLACE, i.REPLACE), r.buffers.stencil.setFunc(i.ALWAYS, o, 4294967295), r.buffers.stencil.setClear(a), r.buffers.stencil.setLocked(!0), e.setRenderTarget(n), this.clear && e.clear(), e.render(this.scene, this.camera), e.setRenderTarget(t), this.clear && e.clear(), e.render(this.scene, this.camera), r.buffers.color.setLocked(!1), r.buffers.depth.setLocked(!1), r.buffers.color.setMask(!0), r.buffers.depth.setMask(!0), r.buffers.stencil.setLocked(!1), r.buffers.stencil.setFunc(i.EQUAL, 1, 4294967295), r.buffers.stencil.setOp(i.KEEP, i.KEEP, i.KEEP), r.buffers.stencil.setLocked(!0); } } -class hM extends Ls { +class hM extends Ds { /** * Constructs a new clear mask pass. */ @@ -29946,10 +29946,10 @@ class uM { constructor(e, t) { if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) { const n = e.getSize(new ce()); - this._width = n.width, this._height = n.height, t = new bn(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: Un }), t.texture.name = "EffectComposer.rt1"; + this._width = n.width, this._height = n.height, t = new bn(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: On }), t.texture.name = "EffectComposer.rt1"; } else this._width = t.width, this._height = t.height; - this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new ol(bs), this.copyPass.material.blending = Xt, this.clock = new Gv(); + this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new rl(bs), this.copyPass.material.blending = Xt, this.clock = new Gv(); } /** * Swaps the internal read/write buffers. @@ -30016,7 +30016,7 @@ class uM { } this.swapBuffers(); } - zf !== void 0 && (o instanceof zf ? n = !0 : o instanceof hM && (n = !1)); + Ff !== void 0 && (o instanceof Ff ? n = !0 : o instanceof hM && (n = !1)); } } this.renderer.setRenderTarget(t); @@ -30065,7 +30065,7 @@ class uM { this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.copyPass.dispose(); } } -class dM extends Ls { +class dM extends Ds { /** * Constructs a new render pass. * @@ -30077,7 +30077,7 @@ class dM extends Ls { * @param {?number} [clearAlpha=null] - The clear alpha of the render pass. */ constructor(e, t, n = null, i = null, r = null) { - super(), this.scene = e, this.camera = t, this.overrideMaterial = n, this.clearColor = i, this.clearAlpha = r, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this._oldClearColor = new Fe(); + super(), this.scene = e, this.camera = t, this.overrideMaterial = n, this.clearColor = i, this.clearAlpha = r, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this._oldClearColor = new Oe(); } /** * Performs a beauty pass with the configured scene and camera. @@ -30399,7 +30399,7 @@ function fM(s = 5) { ).normalize(); i[o * 4] = (c.x * 0.5 + 0.5) * 255, i[o * 4 + 1] = (c.y * 0.5 + 0.5) * 255, i[o * 4 + 2] = 127, i[o * 4 + 3] = 255; } - const r = new Bo(i, e, e); + const r = new No(i, e, e); return r.wrapS = hi, r.wrapT = hi, r.needsUpdate = !0, r; } function pM(s) { @@ -30746,12 +30746,12 @@ class gM { */ noise(e, t) { let n, i, r; - const o = 0.5 * (Math.sqrt(3) - 1), a = (e + t) * o, l = Math.floor(e + a), c = Math.floor(t + a), h = (3 - Math.sqrt(3)) / 6, u = (l + c) * h, d = l - u, f = c - u, p = e - d, g = t - f; + const o = 0.5 * (Math.sqrt(3) - 1), a = (e + t) * o, l = Math.floor(e + a), c = Math.floor(t + a), h = (3 - Math.sqrt(3)) / 6, u = (l + c) * h, d = l - u, f = c - u, g = e - d, p = t - f; let x, m; - p > g ? (x = 1, m = 0) : (x = 0, m = 1); - const b = p - x + h, v = g - m + h, y = p - 1 + 2 * h, M = g - 1 + 2 * h, E = l & 255, A = c & 255, R = this.perm[E + this.perm[A]] % 12, _ = this.perm[E + x + this.perm[A + m]] % 12, S = this.perm[E + 1 + this.perm[A + 1]] % 12; - let D = 0.5 - p * p - g * g; - D < 0 ? n = 0 : (D *= D, n = D * D * this._dot(this.grad3[R], p, g)); + g > p ? (x = 1, m = 0) : (x = 0, m = 1); + const b = g - x + h, v = p - m + h, y = g - 1 + 2 * h, M = p - 1 + 2 * h, E = l & 255, A = c & 255, R = this.perm[E + this.perm[A]] % 12, _ = this.perm[E + x + this.perm[A + m]] % 12, S = this.perm[E + 1 + this.perm[A + 1]] % 12; + let D = 0.5 - g * g - p * p; + D < 0 ? n = 0 : (D *= D, n = D * D * this._dot(this.grad3[R], g, p)); let C = 0.5 - b * b - v * v; C < 0 ? i = 0 : (C *= C, i = C * C * this._dot(this.grad3[_], b, v)); let B = 0.5 - y * y - M * M; @@ -30767,10 +30767,10 @@ class gM { */ noise3d(e, t, n) { let i, r, o, a; - const l = (e + t + n) * 0.3333333333333333, c = Math.floor(e + l), h = Math.floor(t + l), u = Math.floor(n + l), d = 1 / 6, f = (c + h + u) * d, p = c - f, g = h - f, x = u - f, m = e - p, b = t - g, v = n - x; + const l = (e + t + n) * 0.3333333333333333, c = Math.floor(e + l), h = Math.floor(t + l), u = Math.floor(n + l), d = 1 / 6, f = (c + h + u) * d, g = c - f, p = h - f, x = u - f, m = e - g, b = t - p, v = n - x; let y, M, E, A, R, _; m >= b ? b >= v ? (y = 1, M = 0, E = 0, A = 1, R = 1, _ = 0) : m >= v ? (y = 1, M = 0, E = 0, A = 1, R = 0, _ = 1) : (y = 0, M = 0, E = 1, A = 1, R = 0, _ = 1) : b < v ? (y = 0, M = 0, E = 1, A = 0, R = 1, _ = 1) : m < v ? (y = 0, M = 1, E = 0, A = 0, R = 1, _ = 1) : (y = 0, M = 1, E = 0, A = 1, R = 1, _ = 0); - const S = m - y + d, D = b - M + d, C = v - E + d, B = m - A + 2 * d, w = b - R + 2 * d, F = v - _ + 2 * d, W = m - 1 + 3 * d, j = b - 1 + 3 * d, $ = v - 1 + 3 * d, Z = c & 255, re = h & 255, X = u & 255, Y = this.perm[Z + this.perm[re + this.perm[X]]] % 12, ge = this.perm[Z + y + this.perm[re + M + this.perm[X + E]]] % 12, pe = this.perm[Z + A + this.perm[re + R + this.perm[X + _]]] % 12, de = this.perm[Z + 1 + this.perm[re + 1 + this.perm[X + 1]]] % 12; + const S = m - y + d, D = b - M + d, C = v - E + d, B = m - A + 2 * d, w = b - R + 2 * d, F = v - _ + 2 * d, W = m - 1 + 3 * d, j = b - 1 + 3 * d, $ = v - 1 + 3 * d, q = c & 255, re = h & 255, X = u & 255, Y = this.perm[q + this.perm[re + this.perm[X]]] % 12, ge = this.perm[q + y + this.perm[re + M + this.perm[X + E]]] % 12, pe = this.perm[q + A + this.perm[re + R + this.perm[X + _]]] % 12, de = this.perm[q + 1 + this.perm[re + 1 + this.perm[X + 1]]] % 12; let ie = 0.6 - m * m - b * b - v * v; ie < 0 ? i = 0 : (ie *= ie, i = ie * ie * this._dot3(this.grad3[Y], m, b, v)); let he = 0.6 - S * S - D * D - C * C; @@ -30791,18 +30791,18 @@ class gM { */ noise4d(e, t, n, i) { const r = this.grad4, o = this.simplex, a = this.perm, l = (Math.sqrt(5) - 1) / 4, c = (5 - Math.sqrt(5)) / 20; - let h, u, d, f, p; - const g = (e + t + n + i) * l, x = Math.floor(e + g), m = Math.floor(t + g), b = Math.floor(n + g), v = Math.floor(i + g), y = (x + m + b + v) * c, M = x - y, E = m - y, A = b - y, R = v - y, _ = e - M, S = t - E, D = n - A, C = i - R, B = _ > S ? 32 : 0, w = _ > D ? 16 : 0, F = S > D ? 8 : 0, W = _ > C ? 4 : 0, j = S > C ? 2 : 0, $ = D > C ? 1 : 0, Z = B + w + F + W + j + $, re = o[Z][0] >= 3 ? 1 : 0, X = o[Z][1] >= 3 ? 1 : 0, Y = o[Z][2] >= 3 ? 1 : 0, ge = o[Z][3] >= 3 ? 1 : 0, pe = o[Z][0] >= 2 ? 1 : 0, de = o[Z][1] >= 2 ? 1 : 0, ie = o[Z][2] >= 2 ? 1 : 0, he = o[Z][3] >= 2 ? 1 : 0, fe = o[Z][0] >= 1 ? 1 : 0, ve = o[Z][1] >= 1 ? 1 : 0, we = o[Z][2] >= 1 ? 1 : 0, Be = o[Z][3] >= 1 ? 1 : 0, Ke = _ - re + c, Ne = S - X + c, T = D - Y + c, I = C - ge + c, V = _ - pe + 2 * c, U = S - de + 2 * c, k = D - ie + 2 * c, z = C - he + 2 * c, ee = _ - fe + 3 * c, J = S - ve + 3 * c, G = D - we + 3 * c, N = C - Be + 3 * c, L = _ - 1 + 4 * c, H = S - 1 + 4 * c, K = D - 1 + 4 * c, le = C - 1 + 4 * c, te = x & 255, Te = m & 255, be = b & 255, Re = v & 255, De = a[te + a[Te + a[be + a[Re]]]] % 32, ue = a[te + re + a[Te + X + a[be + Y + a[Re + ge]]]] % 32, ye = a[te + pe + a[Te + de + a[be + ie + a[Re + he]]]] % 32, Ve = a[te + fe + a[Te + ve + a[be + we + a[Re + Be]]]] % 32, ke = a[te + 1 + a[Te + 1 + a[be + 1 + a[Re + 1]]]] % 32; + let h, u, d, f, g; + const p = (e + t + n + i) * l, x = Math.floor(e + p), m = Math.floor(t + p), b = Math.floor(n + p), v = Math.floor(i + p), y = (x + m + b + v) * c, M = x - y, E = m - y, A = b - y, R = v - y, _ = e - M, S = t - E, D = n - A, C = i - R, B = _ > S ? 32 : 0, w = _ > D ? 16 : 0, F = S > D ? 8 : 0, W = _ > C ? 4 : 0, j = S > C ? 2 : 0, $ = D > C ? 1 : 0, q = B + w + F + W + j + $, re = o[q][0] >= 3 ? 1 : 0, X = o[q][1] >= 3 ? 1 : 0, Y = o[q][2] >= 3 ? 1 : 0, ge = o[q][3] >= 3 ? 1 : 0, pe = o[q][0] >= 2 ? 1 : 0, de = o[q][1] >= 2 ? 1 : 0, ie = o[q][2] >= 2 ? 1 : 0, he = o[q][3] >= 2 ? 1 : 0, fe = o[q][0] >= 1 ? 1 : 0, ve = o[q][1] >= 1 ? 1 : 0, we = o[q][2] >= 1 ? 1 : 0, Be = o[q][3] >= 1 ? 1 : 0, Ke = _ - re + c, Ne = S - X + c, T = D - Y + c, I = C - ge + c, V = _ - pe + 2 * c, O = S - de + 2 * c, U = D - ie + 2 * c, z = C - he + 2 * c, ee = _ - fe + 3 * c, J = S - ve + 3 * c, G = D - we + 3 * c, N = C - Be + 3 * c, L = _ - 1 + 4 * c, H = S - 1 + 4 * c, K = D - 1 + 4 * c, le = C - 1 + 4 * c, te = x & 255, Te = m & 255, be = b & 255, Re = v & 255, De = a[te + a[Te + a[be + a[Re]]]] % 32, ue = a[te + re + a[Te + X + a[be + Y + a[Re + ge]]]] % 32, ye = a[te + pe + a[Te + de + a[be + ie + a[Re + he]]]] % 32, Ve = a[te + fe + a[Te + ve + a[be + we + a[Re + Be]]]] % 32, Ue = a[te + 1 + a[Te + 1 + a[be + 1 + a[Re + 1]]]] % 32; let Ae = 0.6 - _ * _ - S * S - D * D - C * C; Ae < 0 ? h = 0 : (Ae *= Ae, h = Ae * Ae * this._dot4(r[De], _, S, D, C)); let Ge = 0.6 - Ke * Ke - Ne * Ne - T * T - I * I; Ge < 0 ? u = 0 : (Ge *= Ge, u = Ge * Ge * this._dot4(r[ue], Ke, Ne, T, I)); - let q = 0.6 - V * V - U * U - k * k - z * z; - q < 0 ? d = 0 : (q *= q, d = q * q * this._dot4(r[ye], V, U, k, z)); + let Z = 0.6 - V * V - O * O - U * U - z * z; + Z < 0 ? d = 0 : (Z *= Z, d = Z * Z * this._dot4(r[ye], V, O, U, z)); let Ee = 0.6 - ee * ee - J * J - G * G - N * N; Ee < 0 ? f = 0 : (Ee *= Ee, f = Ee * Ee * this._dot4(r[Ve], ee, J, G, N)); let _e = 0.6 - L * L - H * H - K * K - le * le; - return _e < 0 ? p = 0 : (_e *= _e, p = _e * _e * this._dot4(r[ke], L, H, K, le)), 27 * (h + u + d + f + p); + return _e < 0 ? g = 0 : (_e *= _e, g = _e * _e * this._dot4(r[Ue], L, H, K, le)), 27 * (h + u + d + f + g); } // private _dot(e, t, n) { @@ -30815,7 +30815,7 @@ class gM { return e[0] * t + e[1] * n + e[2] * i + e[3] * r; } } -class gn extends Ls { +class gn extends Ds { /** * Constructs a new GTAO pass. * @@ -30828,7 +30828,7 @@ class gn extends Ls { * @param {Object} [pdParameters] - The denoise parameters. */ constructor(e, t, n = 512, i = 512, r, o, a) { - super(), this.width = n, this.height = i, this.clear = !0, this.camera = t, this.scene = e, this.output = 0, this._renderGBuffer = !0, this._visibilityCache = [], this.blendIntensity = 1, this.pdRings = 2, this.pdRadiusExponent = 2, this.pdSamples = 16, this.gtaoNoiseTexture = fM(), this.pdNoiseTexture = this._generateNoise(), this.gtaoRenderTarget = new bn(this.width, this.height, { type: Un }), this.pdRenderTarget = this.gtaoRenderTarget.clone(), this.gtaoMaterial = new Ut({ + super(), this.width = n, this.height = i, this.clear = !0, this.camera = t, this.scene = e, this.output = 0, this._renderGBuffer = !0, this._visibilityCache = [], this.blendIntensity = 1, this.pdRings = 2, this.pdRadiusExponent = 2, this.pdSamples = 16, this.gtaoNoiseTexture = fM(), this.pdNoiseTexture = this._generateNoise(), this.gtaoRenderTarget = new bn(this.width, this.height, { type: On }), this.pdRenderTarget = this.gtaoRenderTarget.clone(), this.gtaoMaterial = new Ot({ defines: Object.assign({}, Sa.defines), uniforms: oi.clone(Sa.uniforms), vertexShader: Sa.vertexShader, @@ -30836,20 +30836,20 @@ class gn extends Ls { blending: Xt, depthTest: !1, depthWrite: !1 - }), this.gtaoMaterial.defines.PERSPECTIVE_CAMERA = this.camera.isPerspectiveCamera ? 1 : 0, this.gtaoMaterial.uniforms.tNoise.value = this.gtaoNoiseTexture, this.gtaoMaterial.uniforms.resolution.value.set(this.width, this.height), this.gtaoMaterial.uniforms.cameraNear.value = this.camera.near, this.gtaoMaterial.uniforms.cameraFar.value = this.camera.far, this.normalMaterial = new yv(), this.normalMaterial.blending = Xt, this.pdMaterial = new Ut({ + }), this.gtaoMaterial.defines.PERSPECTIVE_CAMERA = this.camera.isPerspectiveCamera ? 1 : 0, this.gtaoMaterial.uniforms.tNoise.value = this.gtaoNoiseTexture, this.gtaoMaterial.uniforms.resolution.value.set(this.width, this.height), this.gtaoMaterial.uniforms.cameraNear.value = this.camera.near, this.gtaoMaterial.uniforms.cameraFar.value = this.camera.far, this.normalMaterial = new yv(), this.normalMaterial.blending = Xt, this.pdMaterial = new Ot({ defines: Object.assign({}, Ta.defines), uniforms: oi.clone(Ta.uniforms), vertexShader: Ta.vertexShader, fragmentShader: Ta.fragmentShader, depthTest: !1, depthWrite: !1 - }), this.pdMaterial.uniforms.tDiffuse.value = this.gtaoRenderTarget.texture, this.pdMaterial.uniforms.tNoise.value = this.pdNoiseTexture, this.pdMaterial.uniforms.resolution.value.set(this.width, this.height), this.pdMaterial.uniforms.lumaPhi.value = 10, this.pdMaterial.uniforms.depthPhi.value = 2, this.pdMaterial.uniforms.normalPhi.value = 3, this.pdMaterial.uniforms.radius.value = 8, this.depthRenderMaterial = new Ut({ + }), this.pdMaterial.uniforms.tDiffuse.value = this.gtaoRenderTarget.texture, this.pdMaterial.uniforms.tNoise.value = this.pdNoiseTexture, this.pdMaterial.uniforms.resolution.value.set(this.width, this.height), this.pdMaterial.uniforms.lumaPhi.value = 10, this.pdMaterial.uniforms.depthPhi.value = 2, this.pdMaterial.uniforms.normalPhi.value = 3, this.pdMaterial.uniforms.radius.value = 8, this.depthRenderMaterial = new Ot({ defines: Object.assign({}, Ea.defines), uniforms: oi.clone(Ea.uniforms), vertexShader: Ea.vertexShader, fragmentShader: Ea.fragmentShader, blending: Xt - }), this.depthRenderMaterial.uniforms.cameraNear.value = this.camera.near, this.depthRenderMaterial.uniforms.cameraFar.value = this.camera.far, this.copyMaterial = new Ut({ + }), this.depthRenderMaterial.uniforms.cameraNear.value = this.camera.near, this.depthRenderMaterial.uniforms.cameraFar.value = this.camera.far, this.copyMaterial = new Ot({ uniforms: oi.clone(bs.uniforms), vertexShader: bs.vertexShader, fragmentShader: bs.fragmentShader, @@ -30857,12 +30857,12 @@ class gn extends Ls { depthTest: !1, depthWrite: !1, blendSrc: lh, - blendDst: lo, - blendEquation: Zn, + blendDst: co, + blendEquation: qn, blendSrcAlpha: ah, - blendDstAlpha: lo, - blendEquationAlpha: Zn - }), this.blendMaterial = new Ut({ + blendDstAlpha: co, + blendEquationAlpha: qn + }), this.blendMaterial = new Ot({ uniforms: oi.clone(Tc.uniforms), vertexShader: Tc.vertexShader, fragmentShader: Tc.fragmentShader, @@ -30871,12 +30871,12 @@ class gn extends Ls { depthWrite: !1, blending: nm, blendSrc: lh, - blendDst: lo, - blendEquation: Zn, + blendDst: co, + blendEquation: qn, blendSrcAlpha: ah, - blendDstAlpha: lo, - blendEquationAlpha: Zn - }), this._fsQuad = new Ll(null), this._originalClearColor = new Fe(), this.setGBuffer(r ? r.depthTexture : void 0, r ? r.normalTexture : void 0), o !== void 0 && this.updateGtaoMaterial(o), a !== void 0 && this.updatePdMaterial(a); + blendDstAlpha: co, + blendEquationAlpha: qn + }), this._fsQuad = new Ll(null), this._originalClearColor = new Oe(), this.setGBuffer(r ? r.depthTexture : void 0, r ? r.normalTexture : void 0), o !== void 0 && this.updateGtaoMaterial(o), a !== void 0 && this.updatePdMaterial(a); } /** * Sets the size of the pass. @@ -30912,10 +30912,10 @@ class gn extends Ls { * @param {DepthTexture} [normalTexture] - The normal texture. */ setGBuffer(e, t) { - e !== void 0 ? (this.depthTexture = e, this.normalTexture = t, this._renderGBuffer = !1) : (this.depthTexture = new ku(), this.depthTexture.format = Mr, this.depthTexture.type = _r, this.normalRenderTarget = new bn(this.width, this.height, { + e !== void 0 ? (this.depthTexture = e, this.normalTexture = t, this._renderGBuffer = !1) : (this.depthTexture = new Nu(), this.depthTexture.format = wr, this.depthTexture.type = Mr, this.normalRenderTarget = new bn(this.width, this.height, { minFilter: Qt, magFilter: Qt, - type: Un, + type: On, depthTexture: this.depthTexture }), this.normalTexture = this.normalRenderTarget.texture, this._renderGBuffer = !0); const n = this.normalTexture ? 1 : 0, i = this.depthTexture === this.normalTexture ? "w" : "x"; @@ -31014,7 +31014,7 @@ class gn extends Ls { const l = o, c = a; i[(o * e + a) * 4] = (t.noise(l, c) * 0.5 + 0.5) * 255, i[(o * e + a) * 4 + 1] = (t.noise(l + e, c) * 0.5 + 0.5) * 255, i[(o * e + a) * 4 + 2] = (t.noise(l, c + e) * 0.5 + 0.5) * 255, i[(o * e + a) * 4 + 3] = (t.noise(l + e, c + e) * 0.5 + 0.5) * 255; } - const r = new Bo(i, e, e, xn, Jn); + const r = new No(i, e, e, xn, Jn); return r.wrapS = hi, r.wrapT = hi, r.needsUpdate = !0, r; } } @@ -31032,7 +31032,7 @@ const xM = { tDiffuse: { value: null }, luminosityThreshold: { value: 1 }, smoothWidth: { value: 1 }, - defaultColor: { value: new Fe(0) }, + defaultColor: { value: new Oe(0) }, defaultOpacity: { value: 0 } }, vertexShader: ( @@ -31076,7 +31076,7 @@ const xM = { }` ) }; -class Rr extends Ls { +class Lr extends Ds { /** * Constructs a new Unreal Bloom pass. * @@ -31086,17 +31086,17 @@ class Rr extends Ls { * @param {number} threshold - The luminance threshold limits which bright areas contribute to the Bloom effect. */ constructor(e, t = 1, n, i) { - super(), this.strength = t, this.radius = n, this.threshold = i, this.resolution = e !== void 0 ? new ce(e.x, e.y) : new ce(256, 256), this.clearColor = new Fe(0, 0, 0), this.needsSwap = !1, this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5; + super(), this.strength = t, this.radius = n, this.threshold = i, this.resolution = e !== void 0 ? new ce(e.x, e.y) : new ce(256, 256), this.clearColor = new Oe(0, 0, 0), this.needsSwap = !1, this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5; let r = Math.round(this.resolution.x / 2), o = Math.round(this.resolution.y / 2); - this.renderTargetBright = new bn(r, o, { type: Un }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1; + this.renderTargetBright = new bn(r, o, { type: On }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1; for (let h = 0; h < this.nMips; h++) { - const u = new bn(r, o, { type: Un }); + const u = new bn(r, o, { type: On }); u.texture.name = "UnrealBloomPass.h" + h, u.texture.generateMipmaps = !1, this.renderTargetsHorizontal.push(u); - const d = new bn(r, o, { type: Un }); + const d = new bn(r, o, { type: On }); d.texture.name = "UnrealBloomPass.v" + h, d.texture.generateMipmaps = !1, this.renderTargetsVertical.push(d), r = Math.round(r / 2), o = Math.round(o / 2); } const a = xM; - this.highPassUniforms = oi.clone(a.uniforms), this.highPassUniforms.luminosityThreshold.value = i, this.highPassUniforms.smoothWidth.value = 0.01, this.materialHighPassFilter = new Ut({ + this.highPassUniforms = oi.clone(a.uniforms), this.highPassUniforms.luminosityThreshold.value = i, this.highPassUniforms.smoothWidth.value = 0.01, this.materialHighPassFilter = new Ot({ uniforms: this.highPassUniforms, vertexShader: a.vertexShader, fragmentShader: a.fragmentShader @@ -31107,7 +31107,7 @@ class Rr extends Ls { this.separableBlurMaterials.push(this._getSeparableBlurMaterial(l[h])), this.separableBlurMaterials[h].uniforms.invSize.value = new ce(1 / r, 1 / o), r = Math.round(r / 2), o = Math.round(o / 2); this.compositeMaterial = this._getCompositeMaterial(this.nMips), this.compositeMaterial.uniforms.blurTexture1.value = this.renderTargetsVertical[0].texture, this.compositeMaterial.uniforms.blurTexture2.value = this.renderTargetsVertical[1].texture, this.compositeMaterial.uniforms.blurTexture3.value = this.renderTargetsVertical[2].texture, this.compositeMaterial.uniforms.blurTexture4.value = this.renderTargetsVertical[3].texture, this.compositeMaterial.uniforms.blurTexture5.value = this.renderTargetsVertical[4].texture, this.compositeMaterial.uniforms.bloomStrength.value = t, this.compositeMaterial.uniforms.bloomRadius.value = 0.1; const c = [1, 0.8, 0.6, 0.4, 0.2]; - this.compositeMaterial.uniforms.bloomFactors.value = c, this.bloomTintColors = [new P(1, 1, 1), new P(1, 1, 1), new P(1, 1, 1), new P(1, 1, 1), new P(1, 1, 1)], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = oi.clone(bs.uniforms), this.blendMaterial = new Ut({ + this.compositeMaterial.uniforms.bloomFactors.value = c, this.bloomTintColors = [new P(1, 1, 1), new P(1, 1, 1), new P(1, 1, 1), new P(1, 1, 1), new P(1, 1, 1)], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = oi.clone(bs.uniforms), this.blendMaterial = new Ot({ uniforms: this.copyUniforms, vertexShader: bs.vertexShader, fragmentShader: bs.fragmentShader, @@ -31115,7 +31115,7 @@ class Rr extends Ls { depthTest: !1, depthWrite: !1, transparent: !0 - }), this._oldClearColor = new Fe(), this._oldClearAlpha = 1, this._basic = new Zt(), this._fsQuad = new Ll(null); + }), this._oldClearColor = new Oe(), this._oldClearAlpha = 1, this._basic = new qt(), this._fsQuad = new Ll(null); } /** * Frees the GPU-related resources allocated by this instance. Call this @@ -31160,7 +31160,7 @@ class Rr extends Ls { e.autoClear = !1, e.setClearColor(this.clearColor, 0), r && e.state.buffers.stencil.setTest(!1), this.renderToScreen && (this._fsQuad.material = this._basic, this._basic.map = n.texture, e.setRenderTarget(null), e.clear(), this._fsQuad.render(e)), this.highPassUniforms.tDiffuse.value = n.texture, this.highPassUniforms.luminosityThreshold.value = this.threshold, this._fsQuad.material = this.materialHighPassFilter, e.setRenderTarget(this.renderTargetBright), e.clear(), this._fsQuad.render(e); let a = this.renderTargetBright; for (let l = 0; l < this.nMips; l++) - this._fsQuad.material = this.separableBlurMaterials[l], this.separableBlurMaterials[l].uniforms.colorTexture.value = a.texture, this.separableBlurMaterials[l].uniforms.direction.value = Rr.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[l]), e.clear(), this._fsQuad.render(e), this.separableBlurMaterials[l].uniforms.colorTexture.value = this.renderTargetsHorizontal[l].texture, this.separableBlurMaterials[l].uniforms.direction.value = Rr.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[l]), e.clear(), this._fsQuad.render(e), a = this.renderTargetsVertical[l]; + this._fsQuad.material = this.separableBlurMaterials[l], this.separableBlurMaterials[l].uniforms.colorTexture.value = a.texture, this.separableBlurMaterials[l].uniforms.direction.value = Lr.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[l]), e.clear(), this._fsQuad.render(e), this.separableBlurMaterials[l].uniforms.colorTexture.value = this.renderTargetsHorizontal[l].texture, this.separableBlurMaterials[l].uniforms.direction.value = Lr.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[l]), e.clear(), this._fsQuad.render(e), a = this.renderTargetsVertical[l]; this._fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture, r && e.state.buffers.stencil.setTest(!0), this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(n), this._fsQuad.render(e)), e.setClearColor(this._oldClearColor, this._oldClearAlpha), e.autoClear = o; } // internals @@ -31168,7 +31168,7 @@ class Rr extends Ls { const t = [], n = e / 3; for (let i = 0; i < e; i++) t.push(0.39894 * Math.exp(-0.5 * i * i / (n * n)) / n); - return new Ut({ + return new Ot({ defines: { KERNEL_RADIUS: e }, @@ -31208,7 +31208,7 @@ class Rr extends Ls { }); } _getCompositeMaterial(e) { - return new Ut({ + return new Ot({ defines: { NUM_MIPS: e }, @@ -31254,8 +31254,8 @@ class Rr extends Ls { }); } } -Rr.BlurDirectionX = new ce(1, 0); -Rr.BlurDirectionY = new ce(0, 1); +Lr.BlurDirectionX = new ce(1, 0); +Lr.BlurDirectionY = new ce(0, 1); const Aa = { name: "OutputShader", uniforms: { @@ -31342,7 +31342,7 @@ const Aa = { }` ) }; -class vM extends Ls { +class vM extends Ds { /** * Constructs a new output pass. */ @@ -31366,7 +31366,7 @@ class vM extends Ls { * @param {boolean} maskActive - Whether masking is active or not. */ render(e, t, n) { - this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, st.getTransfer(this._outputColorSpace) === lt && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === im ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === sm ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === rm ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === _u ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === am ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === lm ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === om && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e)); + this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, st.getTransfer(this._outputColorSpace) === lt && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === im ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === sm ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === rm ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === yu ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === am ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === lm ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === om && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e)); } /** * Frees the GPU-related resources allocated by this instance. Call this @@ -31695,16 +31695,20 @@ class _M { constructor(e) { this.engine = e; } - resize() { - const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), n = e / t; - if (this.composer) { - this.composer.setPixelRatio(n), this.composer.setSize(e, t); - const i = this.composer.passes.find((r) => r instanceof ol && r.material.uniforms.resolution); - i && (i.material.uniforms.resolution.value.x = 1 / (e * n), i.material.uniforms.resolution.value.y = 1 / (t * n)); + resize(e, t) { + if (e === void 0 || t === void 0) { + const r = this.engine.deviceModule.getContainerSize(); + e = e ?? r.width, t = t ?? r.height; } + if (!e || !t || !this.composer) + return; + const n = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1; + this.composer.setPixelRatio(n), this.composer.setSize(e, t); + const i = this.composer.passes.find((r) => r instanceof rl && r.material.uniforms.resolution); + i && (i.material.uniforms.resolution.value.x = 1 / (e * n), i.material.uniforms.resolution.value.y = 1 / (t * n)); } init() { - const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), n = this.engine.scene, i = this.engine.camera, r = this.engine.renderer, o = e / t, a = new bn(e, t, { + const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), n = this.engine.scene, i = this.engine.camera, r = this.engine.renderer, o = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, a = new bn(e, t, { minFilter: Yt, magFilter: Yt, format: xn, @@ -31727,7 +31731,7 @@ class _M { distanceFallOff: 1, // 距离衰减 screenSpaceRadius: !0 - }), new Rr( + }), new Lr( new ce(e, t), 0.1, // 强度 @@ -31735,10 +31739,10 @@ class _M { // 半径 0.5 // 阈值 - ), this.saturationPass = new ol(yM), this.saturationPass.uniforms.saturation.value = 1.3, this.saturationPass.uniforms.contrast.value = 1.1, this.composer.addPass(this.saturationPass); + ), this.saturationPass = new rl(yM), this.saturationPass.uniforms.saturation.value = 1.3, this.saturationPass.uniforms.contrast.value = 1.1, this.composer.addPass(this.saturationPass); const h = new vM(); this.composer.addPass(h); - const u = new ol(bM); + const u = new rl(bM); u.material.uniforms.resolution.value.x = 1 / (e * o), u.material.uniforms.resolution.value.y = 1 / (t * o), this.composer.addPass(u); } } @@ -31749,9 +31753,9 @@ function t0(s) { function Pa(s) { throw new Error('Could not dynamically require "' + s + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } -var Hf = { exports: {} }, Vf; +var zf = { exports: {} }, Hf; function MM() { - return Vf || (Vf = 1, (function(s, e) { + return Hf || (Hf = 1, (function(s, e) { (function(t) { s.exports = t(); })(function() { @@ -31766,9 +31770,9 @@ function MM() { throw d.code = "MODULE_NOT_FOUND", d; } var f = i[c] = { exports: {} }; - n[c][0].call(f.exports, function(p) { - var g = n[c][1][p]; - return o(g || p); + n[c][0].call(f.exports, function(g) { + var p = n[c][1][g]; + return o(p || g); }, f, f.exports, t, n, i, r); } return i[c].exports; @@ -31778,20 +31782,20 @@ function MM() { })({ 1: [function(t, n, i) { var r = t("./utils"), o = t("./support"), a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; i.encode = function(l) { - for (var c, h, u, d, f, p, g, x = [], m = 0, b = l.length, v = b, y = r.getTypeOf(l) !== "string"; m < l.length; ) v = b - m, u = y ? (c = l[m++], h = m < b ? l[m++] : 0, m < b ? l[m++] : 0) : (c = l.charCodeAt(m++), h = m < b ? l.charCodeAt(m++) : 0, m < b ? l.charCodeAt(m++) : 0), d = c >> 2, f = (3 & c) << 4 | h >> 4, p = 1 < v ? (15 & h) << 2 | u >> 6 : 64, g = 2 < v ? 63 & u : 64, x.push(a.charAt(d) + a.charAt(f) + a.charAt(p) + a.charAt(g)); + for (var c, h, u, d, f, g, p, x = [], m = 0, b = l.length, v = b, y = r.getTypeOf(l) !== "string"; m < l.length; ) v = b - m, u = y ? (c = l[m++], h = m < b ? l[m++] : 0, m < b ? l[m++] : 0) : (c = l.charCodeAt(m++), h = m < b ? l.charCodeAt(m++) : 0, m < b ? l.charCodeAt(m++) : 0), d = c >> 2, f = (3 & c) << 4 | h >> 4, g = 1 < v ? (15 & h) << 2 | u >> 6 : 64, p = 2 < v ? 63 & u : 64, x.push(a.charAt(d) + a.charAt(f) + a.charAt(g) + a.charAt(p)); return x.join(""); }, i.decode = function(l) { - var c, h, u, d, f, p, g = 0, x = 0, m = "data:"; + var c, h, u, d, f, g, p = 0, x = 0, m = "data:"; if (l.substr(0, m.length) === m) throw new Error("Invalid base64 input, it looks like a data url."); var b, v = 3 * (l = l.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4; if (l.charAt(l.length - 1) === a.charAt(64) && v--, l.charAt(l.length - 2) === a.charAt(64) && v--, v % 1 != 0) throw new Error("Invalid base64 input, bad content length."); - for (b = o.uint8array ? new Uint8Array(0 | v) : new Array(0 | v); g < l.length; ) c = a.indexOf(l.charAt(g++)) << 2 | (d = a.indexOf(l.charAt(g++))) >> 4, h = (15 & d) << 4 | (f = a.indexOf(l.charAt(g++))) >> 2, u = (3 & f) << 6 | (p = a.indexOf(l.charAt(g++))), b[x++] = c, f !== 64 && (b[x++] = h), p !== 64 && (b[x++] = u); + for (b = o.uint8array ? new Uint8Array(0 | v) : new Array(0 | v); p < l.length; ) c = a.indexOf(l.charAt(p++)) << 2 | (d = a.indexOf(l.charAt(p++))) >> 4, h = (15 & d) << 4 | (f = a.indexOf(l.charAt(p++))) >> 2, u = (3 & f) << 6 | (g = a.indexOf(l.charAt(p++))), b[x++] = c, f !== 64 && (b[x++] = h), g !== 64 && (b[x++] = u); return b; }; }, { "./support": 30, "./utils": 32 }], 2: [function(t, n, i) { var r = t("./external"), o = t("./stream/DataWorker"), a = t("./stream/Crc32Probe"), l = t("./stream/DataLengthProbe"); - function c(h, u, d, f, p) { - this.compressedSize = h, this.uncompressedSize = u, this.crc32 = d, this.compression = f, this.compressedContent = p; + function c(h, u, d, f, g) { + this.compressedSize = h, this.uncompressedSize = u, this.crc32 = d, this.compression = f, this.compressedContent = g; } c.prototype = { getContentWorker: function() { var h = new o(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")), u = this; @@ -31821,14 +31825,14 @@ function MM() { })(); n.exports = function(a, l) { return a !== void 0 && a.length ? r.getTypeOf(a) !== "string" ? (function(c, h, u, d) { - var f = o, p = d + u; + var f = o, g = d + u; c ^= -1; - for (var g = d; g < p; g++) c = c >>> 8 ^ f[255 & (c ^ h[g])]; + for (var p = d; p < g; p++) c = c >>> 8 ^ f[255 & (c ^ h[p])]; return -1 ^ c; })(0 | l, a, a.length, 0) : (function(c, h, u, d) { - var f = o, p = d + u; + var f = o, g = d + u; c ^= -1; - for (var g = d; g < p; g++) c = c >>> 8 ^ f[255 & (c ^ h.charCodeAt(g))]; + for (var p = d; p < g; p++) c = c >>> 8 ^ f[255 & (c ^ h.charCodeAt(p))]; return -1 ^ c; })(0 | l, a, a.length, 0) : 0; }; @@ -31860,81 +31864,81 @@ function MM() { return new h("Inflate", {}); }; }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(t, n, i) { - function r(f, p) { - var g, x = ""; - for (g = 0; g < p; g++) x += String.fromCharCode(255 & f), f >>>= 8; + function r(f, g) { + var p, x = ""; + for (p = 0; p < g; p++) x += String.fromCharCode(255 & f), f >>>= 8; return x; } - function o(f, p, g, x, m, b) { - var v, y, M = f.file, E = f.compression, A = b !== c.utf8encode, R = a.transformTo("string", b(M.name)), _ = a.transformTo("string", c.utf8encode(M.name)), S = M.comment, D = a.transformTo("string", b(S)), C = a.transformTo("string", c.utf8encode(S)), B = _.length !== M.name.length, w = C.length !== S.length, F = "", W = "", j = "", $ = M.dir, Z = M.date, re = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; - p && !g || (re.crc32 = f.crc32, re.compressedSize = f.compressedSize, re.uncompressedSize = f.uncompressedSize); + function o(f, g, p, x, m, b) { + var v, y, M = f.file, E = f.compression, A = b !== c.utf8encode, R = a.transformTo("string", b(M.name)), _ = a.transformTo("string", c.utf8encode(M.name)), S = M.comment, D = a.transformTo("string", b(S)), C = a.transformTo("string", c.utf8encode(S)), B = _.length !== M.name.length, w = C.length !== S.length, F = "", W = "", j = "", $ = M.dir, q = M.date, re = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; + g && !p || (re.crc32 = f.crc32, re.compressedSize = f.compressedSize, re.uncompressedSize = f.uncompressedSize); var X = 0; - p && (X |= 8), A || !B && !w || (X |= 2048); + g && (X |= 8), A || !B && !w || (X |= 2048); var Y = 0, ge = 0; $ && (Y |= 16), m === "UNIX" ? (ge = 798, Y |= (function(de, ie) { var he = de; return de || (he = ie ? 16893 : 33204), (65535 & he) << 16; })(M.unixPermissions, $)) : (ge = 20, Y |= (function(de) { return 63 & (de || 0); - })(M.dosPermissions)), v = Z.getUTCHours(), v <<= 6, v |= Z.getUTCMinutes(), v <<= 5, v |= Z.getUTCSeconds() / 2, y = Z.getUTCFullYear() - 1980, y <<= 4, y |= Z.getUTCMonth() + 1, y <<= 5, y |= Z.getUTCDate(), B && (W = r(1, 1) + r(h(R), 4) + _, F += "up" + r(W.length, 2) + W), w && (j = r(1, 1) + r(h(D), 4) + C, F += "uc" + r(j.length, 2) + j); + })(M.dosPermissions)), v = q.getUTCHours(), v <<= 6, v |= q.getUTCMinutes(), v <<= 5, v |= q.getUTCSeconds() / 2, y = q.getUTCFullYear() - 1980, y <<= 4, y |= q.getUTCMonth() + 1, y <<= 5, y |= q.getUTCDate(), B && (W = r(1, 1) + r(h(R), 4) + _, F += "up" + r(W.length, 2) + W), w && (j = r(1, 1) + r(h(D), 4) + C, F += "uc" + r(j.length, 2) + j); var pe = ""; return pe += ` \0`, pe += r(X, 2), pe += E.magic, pe += r(v, 2), pe += r(y, 2), pe += r(re.crc32, 4), pe += r(re.compressedSize, 4), pe += r(re.uncompressedSize, 4), pe += r(R.length, 2), pe += r(F.length, 2), { fileRecord: u.LOCAL_FILE_HEADER + pe + R + F, dirRecord: u.CENTRAL_FILE_HEADER + r(ge, 2) + pe + r(D.length, 2) + "\0\0\0\0" + r(Y, 4) + r(x, 4) + R + F + D }; } var a = t("../utils"), l = t("../stream/GenericWorker"), c = t("../utf8"), h = t("../crc32"), u = t("../signature"); - function d(f, p, g, x) { - l.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = p, this.zipPlatform = g, this.encodeFileName = x, this.streamFiles = f, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = []; + function d(f, g, p, x) { + l.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = g, this.zipPlatform = p, this.encodeFileName = x, this.streamFiles = f, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = []; } a.inherits(d, l), d.prototype.push = function(f) { - var p = f.meta.percent || 0, g = this.entriesCount, x = this._sources.length; - this.accumulate ? this.contentBuffer.push(f) : (this.bytesWritten += f.data.length, l.prototype.push.call(this, { data: f.data, meta: { currentFile: this.currentFile, percent: g ? (p + 100 * (g - x - 1)) / g : 100 } })); + var g = f.meta.percent || 0, p = this.entriesCount, x = this._sources.length; + this.accumulate ? this.contentBuffer.push(f) : (this.bytesWritten += f.data.length, l.prototype.push.call(this, { data: f.data, meta: { currentFile: this.currentFile, percent: p ? (g + 100 * (p - x - 1)) / p : 100 } })); }, d.prototype.openedSource = function(f) { this.currentSourceOffset = this.bytesWritten, this.currentFile = f.file.name; - var p = this.streamFiles && !f.file.dir; - if (p) { - var g = o(f, p, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); - this.push({ data: g.fileRecord, meta: { percent: 0 } }); + var g = this.streamFiles && !f.file.dir; + if (g) { + var p = o(f, g, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); + this.push({ data: p.fileRecord, meta: { percent: 0 } }); } else this.accumulate = !0; }, d.prototype.closedSource = function(f) { this.accumulate = !1; - var p = this.streamFiles && !f.file.dir, g = o(f, p, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); - if (this.dirRecords.push(g.dirRecord), p) this.push({ data: (function(x) { + var g = this.streamFiles && !f.file.dir, p = o(f, g, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); + if (this.dirRecords.push(p.dirRecord), g) this.push({ data: (function(x) { return u.DATA_DESCRIPTOR + r(x.crc32, 4) + r(x.compressedSize, 4) + r(x.uncompressedSize, 4); })(f), meta: { percent: 100 } }); - else for (this.push({ data: g.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift()); + else for (this.push({ data: p.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift()); this.currentFile = null; }, d.prototype.flush = function() { - for (var f = this.bytesWritten, p = 0; p < this.dirRecords.length; p++) this.push({ data: this.dirRecords[p], meta: { percent: 100 } }); - var g = this.bytesWritten - f, x = (function(m, b, v, y, M) { + for (var f = this.bytesWritten, g = 0; g < this.dirRecords.length; g++) this.push({ data: this.dirRecords[g], meta: { percent: 100 } }); + var p = this.bytesWritten - f, x = (function(m, b, v, y, M) { var E = a.transformTo("string", M(y)); return u.CENTRAL_DIRECTORY_END + "\0\0\0\0" + r(m, 2) + r(m, 2) + r(b, 4) + r(v, 4) + r(E.length, 2) + E; - })(this.dirRecords.length, g, f, this.zipComment, this.encodeFileName); + })(this.dirRecords.length, p, f, this.zipComment, this.encodeFileName); this.push({ data: x, meta: { percent: 100 } }); }, d.prototype.prepareNextSource = function() { this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume(); }, d.prototype.registerPrevious = function(f) { this._sources.push(f); - var p = this; - return f.on("data", function(g) { - p.processChunk(g); + var g = this; + return f.on("data", function(p) { + g.processChunk(p); }), f.on("end", function() { - p.closedSource(p.previous.streamInfo), p._sources.length ? p.prepareNextSource() : p.end(); - }), f.on("error", function(g) { - p.error(g); + g.closedSource(g.previous.streamInfo), g._sources.length ? g.prepareNextSource() : g.end(); + }), f.on("error", function(p) { + g.error(p); }), this; }, d.prototype.resume = function() { return !!l.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0)); }, d.prototype.error = function(f) { - var p = this._sources; + var g = this._sources; if (!l.prototype.error.call(this, f)) return !1; - for (var g = 0; g < p.length; g++) try { - p[g].error(f); + for (var p = 0; p < g.length; p++) try { + g[p].error(f); } catch { } return !0; }, d.prototype.lock = function() { l.prototype.lock.call(this); - for (var f = this._sources, p = 0; p < f.length; p++) f[p].lock(); + for (var f = this._sources, g = 0; g < f.length; g++) f[g].lock(); }, n.exports = d; }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(t, n, i) { var r = t("../compressions"), o = t("./ZipFileWorker"); @@ -31943,12 +31947,12 @@ function MM() { try { a.forEach(function(d, f) { u++; - var p = (function(b, v) { + var g = (function(b, v) { var y = b || v, M = r[y]; if (!M) throw new Error(y + " is not a valid compression method !"); return M; - })(f.options.compression, l.compression), g = f.options.compressionOptions || l.compressionOptions || {}, x = f.dir, m = f.date; - f._compressWorker(p, g).withStreamInfo("file", { name: d, dir: x, date: m, comment: f.comment || "", unixPermissions: f.unixPermissions, dosPermissions: f.dosPermissions }).pipe(h); + })(f.options.compression, l.compression), p = f.options.compressionOptions || l.compressionOptions || {}, x = f.dir, m = f.date; + f._compressWorker(g, p).withStreamInfo("file", { name: d, dir: x, date: m, comment: f.comment || "", unixPermissions: f.unixPermissions, dosPermissions: f.dosPermissions }).pipe(h); }), h.entriesCount = u; } catch (d) { h.error(d); @@ -31971,30 +31975,30 @@ function MM() { }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(t, n, i) { var r = t("./utils"), o = t("./external"), a = t("./utf8"), l = t("./zipEntries"), c = t("./stream/Crc32Probe"), h = t("./nodejsUtils"); function u(d) { - return new o.Promise(function(f, p) { - var g = d.decompressed.getContentWorker().pipe(new c()); - g.on("error", function(x) { - p(x); + return new o.Promise(function(f, g) { + var p = d.decompressed.getContentWorker().pipe(new c()); + p.on("error", function(x) { + g(x); }).on("end", function() { - g.streamInfo.crc32 !== d.decompressed.crc32 ? p(new Error("Corrupted zip : CRC32 mismatch")) : f(); + p.streamInfo.crc32 !== d.decompressed.crc32 ? g(new Error("Corrupted zip : CRC32 mismatch")) : f(); }).resume(); }); } n.exports = function(d, f) { - var p = this; - return f = r.extend(f || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: a.utf8decode }), h.isNode && h.isStream(d) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : r.prepareContent("the loaded zip file", d, !0, f.optimizedBinaryString, f.base64).then(function(g) { + var g = this; + return f = r.extend(f || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: a.utf8decode }), h.isNode && h.isStream(d) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : r.prepareContent("the loaded zip file", d, !0, f.optimizedBinaryString, f.base64).then(function(p) { var x = new l(f); - return x.load(g), x; - }).then(function(g) { - var x = [o.Promise.resolve(g)], m = g.files; + return x.load(p), x; + }).then(function(p) { + var x = [o.Promise.resolve(p)], m = p.files; if (f.checkCRC32) for (var b = 0; b < m.length; b++) x.push(u(m[b])); return o.Promise.all(x); - }).then(function(g) { - for (var x = g.shift(), m = x.files, b = 0; b < m.length; b++) { + }).then(function(p) { + for (var x = p.shift(), m = x.files, b = 0; b < m.length; b++) { var v = m[b], y = v.fileNameStr, M = r.resolve(v.fileNameStr); - p.file(M, v.decompressed, { binary: !0, optimizedBinaryString: !0, date: v.date, dir: v.dir, comment: v.fileCommentStr.length ? v.fileCommentStr : null, unixPermissions: v.unixPermissions, dosPermissions: v.dosPermissions, createFolders: f.createFolders }), v.dir || (p.file(M).unsafeOriginalName = y); + g.file(M, v.decompressed, { binary: !0, optimizedBinaryString: !0, date: v.date, dir: v.dir, comment: v.fileCommentStr.length ? v.fileCommentStr : null, unixPermissions: v.unixPermissions, dosPermissions: v.dosPermissions, createFolders: f.createFolders }), v.dir || (g.file(M).unsafeOriginalName = y); } - return x.zipComment.length && (p.comment = x.zipComment), p; + return x.zipComment.length && (g.comment = x.zipComment), g; }); }; }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(t, n, i) { @@ -32053,11 +32057,11 @@ function MM() { var D = _ === "string" && S.binary === !1 && S.base64 === !1; A && A.binary !== void 0 || (S.binary = !D), (E instanceof u && E.uncompressedSize === 0 || S.dir || !E || E.length === 0) && (S.base64 = !1, S.binary = !0, E = "", S.compression = "STORE", _ = "string"); var C = null; - C = E instanceof u || E instanceof l ? E : p.isNode && p.isStream(E) ? new g(M, E) : a.prepareContent(M, E, S.binary, S.optimizedBinaryString, S.base64); + C = E instanceof u || E instanceof l ? E : g.isNode && g.isStream(E) ? new p(M, E) : a.prepareContent(M, E, S.binary, S.optimizedBinaryString, S.base64); var B = new d(M, C, S); this.files[M] = B; } - var o = t("./utf8"), a = t("./utils"), l = t("./stream/GenericWorker"), c = t("./stream/StreamHelper"), h = t("./defaults"), u = t("./compressedObject"), d = t("./zipObject"), f = t("./generate"), p = t("./nodejsUtils"), g = t("./nodejs/NodejsStreamInputAdapter"), x = function(M) { + var o = t("./utf8"), a = t("./utils"), l = t("./stream/GenericWorker"), c = t("./stream/StreamHelper"), h = t("./defaults"), u = t("./compressedObject"), d = t("./zipObject"), f = t("./generate"), g = t("./nodejsUtils"), p = t("./nodejs/NodejsStreamInputAdapter"), x = function(M) { M.slice(-1) === "/" && (M = M.substring(0, M.length - 1)); var E = M.lastIndexOf("/"); return 0 < E ? M.substring(0, E) : ""; @@ -32339,11 +32343,11 @@ function MM() { u = t("../nodejs/NodejsStreamOutputAdapter"); } catch { } - function d(p, g) { + function d(g, p) { return new h.Promise(function(x, m) { - var b = [], v = p._internalType, y = p._outputType, M = p._mimeType; - p.on("data", function(E, A) { - b.push(E), g && g(A); + var b = [], v = g._internalType, y = g._outputType, M = g._mimeType; + g.on("data", function(E, A) { + b.push(E), p && p(A); }).on("error", function(E) { b = [], m(E); }).on("end", function() { @@ -32382,9 +32386,9 @@ function MM() { }).resume(); }); } - function f(p, g, x) { - var m = g; - switch (g) { + function f(g, p, x) { + var m = p; + switch (p) { case "blob": case "arraybuffer": m = "uint8array"; @@ -32393,27 +32397,27 @@ function MM() { m = "string"; } try { - this._internalType = m, this._outputType = g, this._mimeType = x, r.checkSupport(m), this._worker = p.pipe(new o(m)), p.lock(); + this._internalType = m, this._outputType = p, this._mimeType = x, r.checkSupport(m), this._worker = g.pipe(new o(m)), g.lock(); } catch (b) { this._worker = new a("error"), this._worker.error(b); } } - f.prototype = { accumulate: function(p) { - return d(this, p); - }, on: function(p, g) { + f.prototype = { accumulate: function(g) { + return d(this, g); + }, on: function(g, p) { var x = this; - return p === "data" ? this._worker.on(p, function(m) { - g.call(x, m.data, m.meta); - }) : this._worker.on(p, function() { - r.delay(g, arguments, x); + return g === "data" ? this._worker.on(g, function(m) { + p.call(x, m.data, m.meta); + }) : this._worker.on(g, function() { + r.delay(p, arguments, x); }), this; }, resume: function() { return r.delay(this._worker.resume, [], this._worker), this; }, pause: function() { return this._worker.pause(), this; - }, toNodejsStream: function(p) { + }, toNodejsStream: function(g) { if (r.checkSupport("nodestream"), this._outputType !== "nodebuffer") throw new Error(this._outputType + " is not supported by this method"); - return new u(this, { objectMode: this._outputType !== "nodebuffer" }, p); + return new u(this, { objectMode: this._outputType !== "nodebuffer" }, g); } }, n.exports = f; }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(t, n, i) { if (i.base64 = !0, i.array = !0, i.string = !0, i.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", i.nodebuffer = typeof Buffer < "u", i.uint8array = typeof Uint8Array < "u", typeof ArrayBuffer > "u") i.blob = !1; @@ -32445,38 +32449,38 @@ function MM() { l.call(this, "utf-8 encode"); } i.utf8encode = function(f) { - return o.nodebuffer ? a.newBufferFrom(f, "utf-8") : (function(p) { - var g, x, m, b, v, y = p.length, M = 0; - for (b = 0; b < y; b++) (64512 & (x = p.charCodeAt(b))) == 55296 && b + 1 < y && (64512 & (m = p.charCodeAt(b + 1))) == 56320 && (x = 65536 + (x - 55296 << 10) + (m - 56320), b++), M += x < 128 ? 1 : x < 2048 ? 2 : x < 65536 ? 3 : 4; - for (g = o.uint8array ? new Uint8Array(M) : new Array(M), b = v = 0; v < M; b++) (64512 & (x = p.charCodeAt(b))) == 55296 && b + 1 < y && (64512 & (m = p.charCodeAt(b + 1))) == 56320 && (x = 65536 + (x - 55296 << 10) + (m - 56320), b++), x < 128 ? g[v++] = x : (x < 2048 ? g[v++] = 192 | x >>> 6 : (x < 65536 ? g[v++] = 224 | x >>> 12 : (g[v++] = 240 | x >>> 18, g[v++] = 128 | x >>> 12 & 63), g[v++] = 128 | x >>> 6 & 63), g[v++] = 128 | 63 & x); - return g; + return o.nodebuffer ? a.newBufferFrom(f, "utf-8") : (function(g) { + var p, x, m, b, v, y = g.length, M = 0; + for (b = 0; b < y; b++) (64512 & (x = g.charCodeAt(b))) == 55296 && b + 1 < y && (64512 & (m = g.charCodeAt(b + 1))) == 56320 && (x = 65536 + (x - 55296 << 10) + (m - 56320), b++), M += x < 128 ? 1 : x < 2048 ? 2 : x < 65536 ? 3 : 4; + for (p = o.uint8array ? new Uint8Array(M) : new Array(M), b = v = 0; v < M; b++) (64512 & (x = g.charCodeAt(b))) == 55296 && b + 1 < y && (64512 & (m = g.charCodeAt(b + 1))) == 56320 && (x = 65536 + (x - 55296 << 10) + (m - 56320), b++), x < 128 ? p[v++] = x : (x < 2048 ? p[v++] = 192 | x >>> 6 : (x < 65536 ? p[v++] = 224 | x >>> 12 : (p[v++] = 240 | x >>> 18, p[v++] = 128 | x >>> 12 & 63), p[v++] = 128 | x >>> 6 & 63), p[v++] = 128 | 63 & x); + return p; })(f); }, i.utf8decode = function(f) { - return o.nodebuffer ? r.transformTo("nodebuffer", f).toString("utf-8") : (function(p) { - var g, x, m, b, v = p.length, y = new Array(2 * v); - for (g = x = 0; g < v; ) if ((m = p[g++]) < 128) y[x++] = m; - else if (4 < (b = c[m])) y[x++] = 65533, g += b - 1; + return o.nodebuffer ? r.transformTo("nodebuffer", f).toString("utf-8") : (function(g) { + var p, x, m, b, v = g.length, y = new Array(2 * v); + for (p = x = 0; p < v; ) if ((m = g[p++]) < 128) y[x++] = m; + else if (4 < (b = c[m])) y[x++] = 65533, p += b - 1; else { - for (m &= b === 2 ? 31 : b === 3 ? 15 : 7; 1 < b && g < v; ) m = m << 6 | 63 & p[g++], b--; + for (m &= b === 2 ? 31 : b === 3 ? 15 : 7; 1 < b && p < v; ) m = m << 6 | 63 & g[p++], b--; 1 < b ? y[x++] = 65533 : m < 65536 ? y[x++] = m : (m -= 65536, y[x++] = 55296 | m >> 10 & 1023, y[x++] = 56320 | 1023 & m); } return y.length !== x && (y.subarray ? y = y.subarray(0, x) : y.length = x), r.applyFromCharCode(y); })(f = r.transformTo(o.uint8array ? "uint8array" : "array", f)); }, r.inherits(u, l), u.prototype.processChunk = function(f) { - var p = r.transformTo(o.uint8array ? "uint8array" : "array", f.data); + var g = r.transformTo(o.uint8array ? "uint8array" : "array", f.data); if (this.leftOver && this.leftOver.length) { if (o.uint8array) { - var g = p; - (p = new Uint8Array(g.length + this.leftOver.length)).set(this.leftOver, 0), p.set(g, this.leftOver.length); - } else p = this.leftOver.concat(p); + var p = g; + (g = new Uint8Array(p.length + this.leftOver.length)).set(this.leftOver, 0), g.set(p, this.leftOver.length); + } else g = this.leftOver.concat(g); this.leftOver = null; } var x = (function(b, v) { var y; for ((v = v || b.length) > b.length && (v = b.length), y = v - 1; 0 <= y && (192 & b[y]) == 128; ) y--; return y < 0 || y === 0 ? v : y + c[b[y]] > v ? y : v; - })(p), m = p; - x !== p.length && (o.uint8array ? (m = p.subarray(0, x), this.leftOver = p.subarray(x, p.length)) : (m = p.slice(0, x), this.leftOver = p.slice(x, p.length))), this.push({ data: i.utf8decode(m), meta: f.meta }); + })(g), m = g; + x !== g.length && (o.uint8array ? (m = g.subarray(0, x), this.leftOver = g.subarray(x, g.length)) : (m = g.slice(0, x), this.leftOver = g.slice(x, g.length))), this.push({ data: i.utf8decode(m), meta: f.meta }); }, u.prototype.flush = function() { this.leftOver && this.leftOver.length && (this.push({ data: i.utf8decode(this.leftOver), meta: {} }), this.leftOver = null); }, i.Utf8DecodeWorker = u, r.inherits(d, l), d.prototype.processChunk = function(f) { @@ -32484,33 +32488,33 @@ function MM() { }, i.Utf8EncodeWorker = d; }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(t, n, i) { var r = t("./support"), o = t("./base64"), a = t("./nodejsUtils"), l = t("./external"); - function c(g) { - return g; + function c(p) { + return p; } - function h(g, x) { - for (var m = 0; m < g.length; ++m) x[m] = 255 & g.charCodeAt(m); + function h(p, x) { + for (var m = 0; m < p.length; ++m) x[m] = 255 & p.charCodeAt(m); return x; } - t("setimmediate"), i.newBlob = function(g, x) { + t("setimmediate"), i.newBlob = function(p, x) { i.checkSupport("blob"); try { - return new Blob([g], { type: x }); + return new Blob([p], { type: x }); } catch { try { var m = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); - return m.append(g), m.getBlob(x); + return m.append(p), m.getBlob(x); } catch { throw new Error("Bug : can't construct the Blob."); } } }; - var u = { stringifyByChunk: function(g, x, m) { - var b = [], v = 0, y = g.length; - if (y <= m) return String.fromCharCode.apply(null, g); - for (; v < y; ) x === "array" || x === "nodebuffer" ? b.push(String.fromCharCode.apply(null, g.slice(v, Math.min(v + m, y)))) : b.push(String.fromCharCode.apply(null, g.subarray(v, Math.min(v + m, y)))), v += m; + var u = { stringifyByChunk: function(p, x, m) { + var b = [], v = 0, y = p.length; + if (y <= m) return String.fromCharCode.apply(null, p); + for (; v < y; ) x === "array" || x === "nodebuffer" ? b.push(String.fromCharCode.apply(null, p.slice(v, Math.min(v + m, y)))) : b.push(String.fromCharCode.apply(null, p.subarray(v, Math.min(v + m, y)))), v += m; return b.join(""); - }, stringifyByChar: function(g) { - for (var x = "", m = 0; m < g.length; m++) x += String.fromCharCode(g[m]); + }, stringifyByChar: function(p) { + for (var x = "", m = 0; m < p.length; m++) x += String.fromCharCode(p[m]); return x; }, applyCanBeUsed: { uint8array: (function() { try { @@ -32525,87 +32529,87 @@ function MM() { return !1; } })() } }; - function d(g) { - var x = 65536, m = i.getTypeOf(g), b = !0; + function d(p) { + var x = 65536, m = i.getTypeOf(p), b = !0; if (m === "uint8array" ? b = u.applyCanBeUsed.uint8array : m === "nodebuffer" && (b = u.applyCanBeUsed.nodebuffer), b) for (; 1 < x; ) try { - return u.stringifyByChunk(g, m, x); + return u.stringifyByChunk(p, m, x); } catch { x = Math.floor(x / 2); } - return u.stringifyByChar(g); + return u.stringifyByChar(p); } - function f(g, x) { - for (var m = 0; m < g.length; m++) x[m] = g[m]; + function f(p, x) { + for (var m = 0; m < p.length; m++) x[m] = p[m]; return x; } i.applyFromCharCode = d; - var p = {}; - p.string = { string: c, array: function(g) { - return h(g, new Array(g.length)); - }, arraybuffer: function(g) { - return p.string.uint8array(g).buffer; - }, uint8array: function(g) { - return h(g, new Uint8Array(g.length)); - }, nodebuffer: function(g) { - return h(g, a.allocBuffer(g.length)); - } }, p.array = { string: d, array: c, arraybuffer: function(g) { - return new Uint8Array(g).buffer; - }, uint8array: function(g) { - return new Uint8Array(g); - }, nodebuffer: function(g) { - return a.newBufferFrom(g); - } }, p.arraybuffer = { string: function(g) { - return d(new Uint8Array(g)); - }, array: function(g) { - return f(new Uint8Array(g), new Array(g.byteLength)); - }, arraybuffer: c, uint8array: function(g) { - return new Uint8Array(g); - }, nodebuffer: function(g) { - return a.newBufferFrom(new Uint8Array(g)); - } }, p.uint8array = { string: d, array: function(g) { - return f(g, new Array(g.length)); - }, arraybuffer: function(g) { - return g.buffer; - }, uint8array: c, nodebuffer: function(g) { - return a.newBufferFrom(g); - } }, p.nodebuffer = { string: d, array: function(g) { - return f(g, new Array(g.length)); - }, arraybuffer: function(g) { - return p.nodebuffer.uint8array(g).buffer; - }, uint8array: function(g) { - return f(g, new Uint8Array(g.length)); - }, nodebuffer: c }, i.transformTo = function(g, x) { - if (x = x || "", !g) return x; - i.checkSupport(g); + var g = {}; + g.string = { string: c, array: function(p) { + return h(p, new Array(p.length)); + }, arraybuffer: function(p) { + return g.string.uint8array(p).buffer; + }, uint8array: function(p) { + return h(p, new Uint8Array(p.length)); + }, nodebuffer: function(p) { + return h(p, a.allocBuffer(p.length)); + } }, g.array = { string: d, array: c, arraybuffer: function(p) { + return new Uint8Array(p).buffer; + }, uint8array: function(p) { + return new Uint8Array(p); + }, nodebuffer: function(p) { + return a.newBufferFrom(p); + } }, g.arraybuffer = { string: function(p) { + return d(new Uint8Array(p)); + }, array: function(p) { + return f(new Uint8Array(p), new Array(p.byteLength)); + }, arraybuffer: c, uint8array: function(p) { + return new Uint8Array(p); + }, nodebuffer: function(p) { + return a.newBufferFrom(new Uint8Array(p)); + } }, g.uint8array = { string: d, array: function(p) { + return f(p, new Array(p.length)); + }, arraybuffer: function(p) { + return p.buffer; + }, uint8array: c, nodebuffer: function(p) { + return a.newBufferFrom(p); + } }, g.nodebuffer = { string: d, array: function(p) { + return f(p, new Array(p.length)); + }, arraybuffer: function(p) { + return g.nodebuffer.uint8array(p).buffer; + }, uint8array: function(p) { + return f(p, new Uint8Array(p.length)); + }, nodebuffer: c }, i.transformTo = function(p, x) { + if (x = x || "", !p) return x; + i.checkSupport(p); var m = i.getTypeOf(x); - return p[m][g](x); - }, i.resolve = function(g) { - for (var x = g.split("/"), m = [], b = 0; b < x.length; b++) { + return g[m][p](x); + }, i.resolve = function(p) { + for (var x = p.split("/"), m = [], b = 0; b < x.length; b++) { var v = x[b]; v === "." || v === "" && b !== 0 && b !== x.length - 1 || (v === ".." ? m.pop() : m.push(v)); } return m.join("/"); - }, i.getTypeOf = function(g) { - return typeof g == "string" ? "string" : Object.prototype.toString.call(g) === "[object Array]" ? "array" : r.nodebuffer && a.isBuffer(g) ? "nodebuffer" : r.uint8array && g instanceof Uint8Array ? "uint8array" : r.arraybuffer && g instanceof ArrayBuffer ? "arraybuffer" : void 0; - }, i.checkSupport = function(g) { - if (!r[g.toLowerCase()]) throw new Error(g + " is not supported by this platform"); - }, i.MAX_VALUE_16BITS = 65535, i.MAX_VALUE_32BITS = -1, i.pretty = function(g) { + }, i.getTypeOf = function(p) { + return typeof p == "string" ? "string" : Object.prototype.toString.call(p) === "[object Array]" ? "array" : r.nodebuffer && a.isBuffer(p) ? "nodebuffer" : r.uint8array && p instanceof Uint8Array ? "uint8array" : r.arraybuffer && p instanceof ArrayBuffer ? "arraybuffer" : void 0; + }, i.checkSupport = function(p) { + if (!r[p.toLowerCase()]) throw new Error(p + " is not supported by this platform"); + }, i.MAX_VALUE_16BITS = 65535, i.MAX_VALUE_32BITS = -1, i.pretty = function(p) { var x, m, b = ""; - for (m = 0; m < (g || "").length; m++) b += "\\x" + ((x = g.charCodeAt(m)) < 16 ? "0" : "") + x.toString(16).toUpperCase(); + for (m = 0; m < (p || "").length; m++) b += "\\x" + ((x = p.charCodeAt(m)) < 16 ? "0" : "") + x.toString(16).toUpperCase(); return b; - }, i.delay = function(g, x, m) { + }, i.delay = function(p, x, m) { setImmediate(function() { - g.apply(m || null, x || []); + p.apply(m || null, x || []); }); - }, i.inherits = function(g, x) { + }, i.inherits = function(p, x) { function m() { } - m.prototype = x.prototype, g.prototype = new m(); + m.prototype = x.prototype, p.prototype = new m(); }, i.extend = function() { - var g, x, m = {}; - for (g = 0; g < arguments.length; g++) for (x in arguments[g]) Object.prototype.hasOwnProperty.call(arguments[g], x) && m[x] === void 0 && (m[x] = arguments[g][x]); + var p, x, m = {}; + for (p = 0; p < arguments.length; p++) for (x in arguments[p]) Object.prototype.hasOwnProperty.call(arguments[p], x) && m[x] === void 0 && (m[x] = arguments[p][x]); return m; - }, i.prepareContent = function(g, x, m, b, v) { + }, i.prepareContent = function(p, x, m, b, v) { return l.Promise.resolve(x).then(function(y) { return r.blob && (y instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(y)) !== -1) && typeof FileReader < "u" ? new l.Promise(function(M, E) { var A = new FileReader(); @@ -32619,7 +32623,7 @@ function MM() { var M = i.getTypeOf(y); return M ? (M === "arraybuffer" ? y = i.transformTo("uint8array", y) : M === "string" && (v ? y = o.decode(y) : m && b !== !0 && (y = (function(E) { return h(E, r.uint8array ? new Uint8Array(E.length) : new Array(E.length)); - })(y))), y) : l.Promise.reject(new Error("Can't read the data of '" + g + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")); + })(y))), y) : l.Promise.reject(new Error("Can't read the data of '" + p + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")); }); }; }, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(t, n, i) { @@ -32636,15 +32640,15 @@ function MM() { }, isSignature: function(u, d) { var f = this.reader.index; this.reader.setIndex(u); - var p = this.reader.readString(4) === d; - return this.reader.setIndex(f), p; + var g = this.reader.readString(4) === d; + return this.reader.setIndex(f), g; }, readBlockEndOfCentral: function() { this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2); var u = this.reader.readData(this.zipCommentLength), d = c.uint8array ? "uint8array" : "array", f = o.transformTo(d, u); this.zipComment = this.loadOptions.decodeFileName(f); }, readBlockZip64EndOfCentral: function() { this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {}; - for (var u, d, f, p = this.zip64EndOfCentralSize - 44; 0 < p; ) u = this.reader.readInt(2), d = this.reader.readInt(4), f = this.reader.readData(d), this.zip64ExtensibleData[u] = { id: u, length: d, value: f }; + for (var u, d, f, g = this.zip64EndOfCentralSize - 44; 0 < g; ) u = this.reader.readInt(2), d = this.reader.readInt(4), f = this.reader.readData(d), this.zip64ExtensibleData[u] = { id: u, length: d, value: f }; }, readBlockZip64EndOfCentralLocator: function() { if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount) throw new Error("Multi-volumes zip are not supported"); }, readLocalFiles: function() { @@ -32666,9 +32670,9 @@ function MM() { } var f = this.centralDirOffset + this.centralDirSize; this.zip64 && (f += 20, f += 12 + this.zip64EndOfCentralSize); - var p = d - f; - if (0 < p) this.isSignature(d, a.CENTRAL_FILE_HEADER) || (this.reader.zero = p); - else if (p < 0) throw new Error("Corrupted zip: missing " + Math.abs(p) + " bytes."); + var g = d - f; + if (0 < g) this.isSignature(d, a.CENTRAL_FILE_HEADER) || (this.reader.zero = g); + else if (g < 0) throw new Error("Corrupted zip: missing " + Math.abs(g) + " bytes."); }, prepareReader: function(u) { this.reader = r(u); }, load: function(u) { @@ -32676,26 +32680,26 @@ function MM() { } }, n.exports = h; }, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(t, n, i) { var r = t("./reader/readerFor"), o = t("./utils"), a = t("./compressedObject"), l = t("./crc32"), c = t("./utf8"), h = t("./compressions"), u = t("./support"); - function d(f, p) { - this.options = f, this.loadOptions = p; + function d(f, g) { + this.options = f, this.loadOptions = g; } d.prototype = { isEncrypted: function() { return (1 & this.bitFlag) == 1; }, useUTF8: function() { return (2048 & this.bitFlag) == 2048; }, readLocalPart: function(f) { - var p, g; - if (f.skip(22), this.fileNameLength = f.readInt(2), g = f.readInt(2), this.fileName = f.readData(this.fileNameLength), f.skip(g), this.compressedSize === -1 || this.uncompressedSize === -1) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)"); - if ((p = (function(x) { + var g, p; + if (f.skip(22), this.fileNameLength = f.readInt(2), p = f.readInt(2), this.fileName = f.readData(this.fileNameLength), f.skip(p), this.compressedSize === -1 || this.uncompressedSize === -1) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)"); + if ((g = (function(x) { for (var m in h) if (Object.prototype.hasOwnProperty.call(h, m) && h[m].magic === x) return h[m]; return null; })(this.compressionMethod)) === null) throw new Error("Corrupted zip : compression " + o.pretty(this.compressionMethod) + " unknown (inner file : " + o.transformTo("string", this.fileName) + ")"); - this.decompressed = new a(this.compressedSize, this.uncompressedSize, this.crc32, p, f.readData(this.compressedSize)); + this.decompressed = new a(this.compressedSize, this.uncompressedSize, this.crc32, g, f.readData(this.compressedSize)); }, readCentralPart: function(f) { this.versionMadeBy = f.readInt(2), f.skip(2), this.bitFlag = f.readInt(2), this.compressionMethod = f.readString(2), this.date = f.readDate(), this.crc32 = f.readInt(4), this.compressedSize = f.readInt(4), this.uncompressedSize = f.readInt(4); - var p = f.readInt(2); + var g = f.readInt(2); if (this.extraFieldsLength = f.readInt(2), this.fileCommentLength = f.readInt(2), this.diskNumberStart = f.readInt(2), this.internalFileAttributes = f.readInt(2), this.externalFileAttributes = f.readInt(4), this.localHeaderOffset = f.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported"); - f.skip(p), this.readExtraFields(f), this.parseZIP64ExtraField(f), this.fileComment = f.readData(this.fileCommentLength); + f.skip(g), this.readExtraFields(f), this.parseZIP64ExtraField(f), this.fileComment = f.readData(this.fileCommentLength); }, processAttributes: function() { this.unixPermissions = null, this.dosPermissions = null; var f = this.versionMadeBy >> 8; @@ -32706,18 +32710,18 @@ function MM() { this.uncompressedSize === o.MAX_VALUE_32BITS && (this.uncompressedSize = f.readInt(8)), this.compressedSize === o.MAX_VALUE_32BITS && (this.compressedSize = f.readInt(8)), this.localHeaderOffset === o.MAX_VALUE_32BITS && (this.localHeaderOffset = f.readInt(8)), this.diskNumberStart === o.MAX_VALUE_32BITS && (this.diskNumberStart = f.readInt(4)); } }, readExtraFields: function(f) { - var p, g, x, m = f.index + this.extraFieldsLength; - for (this.extraFields || (this.extraFields = {}); f.index + 4 < m; ) p = f.readInt(2), g = f.readInt(2), x = f.readData(g), this.extraFields[p] = { id: p, length: g, value: x }; + var g, p, x, m = f.index + this.extraFieldsLength; + for (this.extraFields || (this.extraFields = {}); f.index + 4 < m; ) g = f.readInt(2), p = f.readInt(2), x = f.readData(p), this.extraFields[g] = { id: g, length: p, value: x }; f.setIndex(m); }, handleUTF8: function() { var f = u.uint8array ? "uint8array" : "array"; if (this.useUTF8()) this.fileNameStr = c.utf8decode(this.fileName), this.fileCommentStr = c.utf8decode(this.fileComment); else { - var p = this.findExtraFieldUnicodePath(); - if (p !== null) this.fileNameStr = p; + var g = this.findExtraFieldUnicodePath(); + if (g !== null) this.fileNameStr = g; else { - var g = o.transformTo(f, this.fileName); - this.fileNameStr = this.loadOptions.decodeFileName(g); + var p = o.transformTo(f, this.fileName); + this.fileNameStr = this.loadOptions.decodeFileName(p); } var x = this.findExtraFieldUnicodeComment(); if (x !== null) this.fileCommentStr = x; @@ -32729,43 +32733,43 @@ function MM() { }, findExtraFieldUnicodePath: function() { var f = this.extraFields[28789]; if (f) { - var p = r(f.value); - return p.readInt(1) !== 1 || l(this.fileName) !== p.readInt(4) ? null : c.utf8decode(p.readData(f.length - 5)); + var g = r(f.value); + return g.readInt(1) !== 1 || l(this.fileName) !== g.readInt(4) ? null : c.utf8decode(g.readData(f.length - 5)); } return null; }, findExtraFieldUnicodeComment: function() { var f = this.extraFields[25461]; if (f) { - var p = r(f.value); - return p.readInt(1) !== 1 || l(this.fileComment) !== p.readInt(4) ? null : c.utf8decode(p.readData(f.length - 5)); + var g = r(f.value); + return g.readInt(1) !== 1 || l(this.fileComment) !== g.readInt(4) ? null : c.utf8decode(g.readData(f.length - 5)); } return null; } }, n.exports = d; }, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(t, n, i) { - function r(p, g, x) { - this.name = p, this.dir = x.dir, this.date = x.date, this.comment = x.comment, this.unixPermissions = x.unixPermissions, this.dosPermissions = x.dosPermissions, this._data = g, this._dataBinary = x.binary, this.options = { compression: x.compression, compressionOptions: x.compressionOptions }; + function r(g, p, x) { + this.name = g, this.dir = x.dir, this.date = x.date, this.comment = x.comment, this.unixPermissions = x.unixPermissions, this.dosPermissions = x.dosPermissions, this._data = p, this._dataBinary = x.binary, this.options = { compression: x.compression, compressionOptions: x.compressionOptions }; } var o = t("./stream/StreamHelper"), a = t("./stream/DataWorker"), l = t("./utf8"), c = t("./compressedObject"), h = t("./stream/GenericWorker"); - r.prototype = { internalStream: function(p) { - var g = null, x = "string"; + r.prototype = { internalStream: function(g) { + var p = null, x = "string"; try { - if (!p) throw new Error("No output type specified."); - var m = (x = p.toLowerCase()) === "string" || x === "text"; - x !== "binarystring" && x !== "text" || (x = "string"), g = this._decompressWorker(); + if (!g) throw new Error("No output type specified."); + var m = (x = g.toLowerCase()) === "string" || x === "text"; + x !== "binarystring" && x !== "text" || (x = "string"), p = this._decompressWorker(); var b = !this._dataBinary; - b && !m && (g = g.pipe(new l.Utf8EncodeWorker())), !b && m && (g = g.pipe(new l.Utf8DecodeWorker())); + b && !m && (p = p.pipe(new l.Utf8EncodeWorker())), !b && m && (p = p.pipe(new l.Utf8DecodeWorker())); } catch (v) { - (g = new h("error")).error(v); + (p = new h("error")).error(v); } - return new o(g, x, ""); - }, async: function(p, g) { - return this.internalStream(p).accumulate(g); - }, nodeStream: function(p, g) { - return this.internalStream(p || "nodebuffer").toNodejsStream(g); - }, _compressWorker: function(p, g) { - if (this._data instanceof c && this._data.compression.magic === p.magic) return this._data.getCompressedWorker(); + return new o(p, x, ""); + }, async: function(g, p) { + return this.internalStream(g).accumulate(p); + }, nodeStream: function(g, p) { + return this.internalStream(g || "nodebuffer").toNodejsStream(p); + }, _compressWorker: function(g, p) { + if (this._data instanceof c && this._data.compression.magic === g.magic) return this._data.getCompressedWorker(); var x = this._decompressWorker(); - return this._dataBinary || (x = x.pipe(new l.Utf8EncodeWorker())), c.createWorkerFrom(x, p, g); + return this._dataBinary || (x = x.pipe(new l.Utf8EncodeWorker())), c.createWorkerFrom(x, g, p); }, _decompressWorker: function() { return this._data instanceof c ? this._data.getContentWorker() : this._data instanceof h ? this._data : new a(this._data); } }; @@ -32777,36 +32781,36 @@ function MM() { (function(r) { var o, a, l = r.MutationObserver || r.WebKitMutationObserver; if (l) { - var c = 0, h = new l(p), u = r.document.createTextNode(""); + var c = 0, h = new l(g), u = r.document.createTextNode(""); h.observe(u, { characterData: !0 }), o = function() { u.data = c = ++c % 2; }; } else if (r.setImmediate || r.MessageChannel === void 0) o = "document" in r && "onreadystatechange" in r.document.createElement("script") ? function() { - var g = r.document.createElement("script"); - g.onreadystatechange = function() { - p(), g.onreadystatechange = null, g.parentNode.removeChild(g), g = null; - }, r.document.documentElement.appendChild(g); + var p = r.document.createElement("script"); + p.onreadystatechange = function() { + g(), p.onreadystatechange = null, p.parentNode.removeChild(p), p = null; + }, r.document.documentElement.appendChild(p); } : function() { - setTimeout(p, 0); + setTimeout(g, 0); }; else { var d = new r.MessageChannel(); - d.port1.onmessage = p, o = function() { + d.port1.onmessage = g, o = function() { d.port2.postMessage(0); }; } var f = []; - function p() { - var g, x; + function g() { + var p, x; a = !0; for (var m = f.length; m; ) { - for (x = f, f = [], g = -1; ++g < m; ) x[g](); + for (x = f, f = [], p = -1; ++p < m; ) x[p](); m = f.length; } a = !1; } - n.exports = function(g) { - f.push(g) !== 1 || a || o(); + n.exports = function(p) { + f.push(p) !== 1 || a || o(); }; }).call(this, typeof Ca < "u" ? Ca : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 37: [function(t, n, i) { @@ -32816,7 +32820,7 @@ function MM() { var a = {}, l = ["REJECTED"], c = ["FULFILLED"], h = ["PENDING"]; function u(m) { if (typeof m != "function") throw new TypeError("resolver must be a function"); - this.state = h, this.queue = [], this.outcome = void 0, m !== o && g(this, m); + this.state = h, this.queue = [], this.outcome = void 0, m !== o && p(this, m); } function d(m, b, v) { this.promise = m, typeof b == "function" && (this.onFulfilled = b, this.callFulfilled = this.otherCallFulfilled), typeof v == "function" && (this.onRejected = v, this.callRejected = this.otherCallRejected); @@ -32832,13 +32836,13 @@ function MM() { y === m ? a.reject(m, new TypeError("Cannot resolve promise with itself")) : a.resolve(m, y); }); } - function p(m) { + function g(m) { var b = m && m.then; if (m && (typeof m == "object" || typeof m == "function") && typeof b == "function") return function() { b.apply(m, arguments); }; } - function g(m, b) { + function p(m, b) { var v = !1; function y(A) { v || (v = !0, a.reject(m, A)); @@ -32887,10 +32891,10 @@ function MM() { }, d.prototype.otherCallRejected = function(m) { f(this.promise, this.onRejected, m); }, a.resolve = function(m, b) { - var v = x(p, b); + var v = x(g, b); if (v.status === "error") return a.reject(m, v.value); var y = v.value; - if (y) g(m, y); + if (y) p(m, y); else { m.state = c, m.outcome = b; for (var M = -1, E = m.queue.length; ++M < E; ) m.queue[M].callFulfilled(b); @@ -32936,10 +32940,10 @@ function MM() { var r = {}; (0, t("./lib/utils/common").assign)(r, t("./lib/deflate"), t("./lib/inflate"), t("./lib/zlib/constants")), n.exports = r; }, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(t, n, i) { - var r = t("./zlib/deflate"), o = t("./utils/common"), a = t("./utils/strings"), l = t("./zlib/messages"), c = t("./zlib/zstream"), h = Object.prototype.toString, u = 0, d = -1, f = 0, p = 8; - function g(m) { - if (!(this instanceof g)) return new g(m); - this.options = o.assign({ level: d, method: p, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: f, to: "" }, m || {}); + var r = t("./zlib/deflate"), o = t("./utils/common"), a = t("./utils/strings"), l = t("./zlib/messages"), c = t("./zlib/zstream"), h = Object.prototype.toString, u = 0, d = -1, f = 0, g = 8; + function p(m) { + if (!(this instanceof p)) return new p(m); + this.options = o.assign({ level: d, method: g, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: f, to: "" }, m || {}); var b = this.options; b.raw && 0 < b.windowBits ? b.windowBits = -b.windowBits : b.gzip && 0 < b.windowBits && b.windowBits < 16 && (b.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new c(), this.strm.avail_out = 0; var v = r.deflateInit2(this.strm, b.level, b.method, b.windowBits, b.memLevel, b.strategy); @@ -32951,11 +32955,11 @@ function MM() { } } function x(m, b) { - var v = new g(b); + var v = new p(b); if (v.push(m, !0), v.err) throw v.msg || l[v.err]; return v.result; } - g.prototype.push = function(m, b) { + p.prototype.push = function(m, b) { var v, y, M = this.strm, E = this.options.chunkSize; if (this.ended) return !1; y = b === ~~b ? b : b === !0 ? 4 : 0, typeof m == "string" ? M.input = a.string2buf(m) : h.call(m) === "[object ArrayBuffer]" ? M.input = new Uint8Array(m) : M.input = m, M.next_in = 0, M.avail_in = M.input.length; @@ -32964,47 +32968,47 @@ function MM() { M.avail_out !== 0 && (M.avail_in !== 0 || y !== 4 && y !== 2) || (this.options.to === "string" ? this.onData(a.buf2binstring(o.shrinkBuf(M.output, M.next_out))) : this.onData(o.shrinkBuf(M.output, M.next_out))); } while ((0 < M.avail_in || M.avail_out === 0) && v !== 1); return y === 4 ? (v = r.deflateEnd(this.strm), this.onEnd(v), this.ended = !0, v === u) : y !== 2 || (this.onEnd(u), !(M.avail_out = 0)); - }, g.prototype.onData = function(m) { + }, p.prototype.onData = function(m) { this.chunks.push(m); - }, g.prototype.onEnd = function(m) { + }, p.prototype.onEnd = function(m) { m === u && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = m, this.msg = this.strm.msg; - }, i.Deflate = g, i.deflate = x, i.deflateRaw = function(m, b) { + }, i.Deflate = p, i.deflate = x, i.deflateRaw = function(m, b) { return (b = b || {}).raw = !0, x(m, b); }, i.gzip = function(m, b) { return (b = b || {}).gzip = !0, x(m, b); }; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(t, n, i) { var r = t("./zlib/inflate"), o = t("./utils/common"), a = t("./utils/strings"), l = t("./zlib/constants"), c = t("./zlib/messages"), h = t("./zlib/zstream"), u = t("./zlib/gzheader"), d = Object.prototype.toString; - function f(g) { - if (!(this instanceof f)) return new f(g); - this.options = o.assign({ chunkSize: 16384, windowBits: 0, to: "" }, g || {}); + function f(p) { + if (!(this instanceof f)) return new f(p); + this.options = o.assign({ chunkSize: 16384, windowBits: 0, to: "" }, p || {}); var x = this.options; - x.raw && 0 <= x.windowBits && x.windowBits < 16 && (x.windowBits = -x.windowBits, x.windowBits === 0 && (x.windowBits = -15)), !(0 <= x.windowBits && x.windowBits < 16) || g && g.windowBits || (x.windowBits += 32), 15 < x.windowBits && x.windowBits < 48 && (15 & x.windowBits) == 0 && (x.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new h(), this.strm.avail_out = 0; + x.raw && 0 <= x.windowBits && x.windowBits < 16 && (x.windowBits = -x.windowBits, x.windowBits === 0 && (x.windowBits = -15)), !(0 <= x.windowBits && x.windowBits < 16) || p && p.windowBits || (x.windowBits += 32), 15 < x.windowBits && x.windowBits < 48 && (15 & x.windowBits) == 0 && (x.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new h(), this.strm.avail_out = 0; var m = r.inflateInit2(this.strm, x.windowBits); if (m !== l.Z_OK) throw new Error(c[m]); this.header = new u(), r.inflateGetHeader(this.strm, this.header); } - function p(g, x) { + function g(p, x) { var m = new f(x); - if (m.push(g, !0), m.err) throw m.msg || c[m.err]; + if (m.push(p, !0), m.err) throw m.msg || c[m.err]; return m.result; } - f.prototype.push = function(g, x) { + f.prototype.push = function(p, x) { var m, b, v, y, M, E, A = this.strm, R = this.options.chunkSize, _ = this.options.dictionary, S = !1; if (this.ended) return !1; - b = x === ~~x ? x : x === !0 ? l.Z_FINISH : l.Z_NO_FLUSH, typeof g == "string" ? A.input = a.binstring2buf(g) : d.call(g) === "[object ArrayBuffer]" ? A.input = new Uint8Array(g) : A.input = g, A.next_in = 0, A.avail_in = A.input.length; + b = x === ~~x ? x : x === !0 ? l.Z_FINISH : l.Z_NO_FLUSH, typeof p == "string" ? A.input = a.binstring2buf(p) : d.call(p) === "[object ArrayBuffer]" ? A.input = new Uint8Array(p) : A.input = p, A.next_in = 0, A.avail_in = A.input.length; do { if (A.avail_out === 0 && (A.output = new o.Buf8(R), A.next_out = 0, A.avail_out = R), (m = r.inflate(A, l.Z_NO_FLUSH)) === l.Z_NEED_DICT && _ && (E = typeof _ == "string" ? a.string2buf(_) : d.call(_) === "[object ArrayBuffer]" ? new Uint8Array(_) : _, m = r.inflateSetDictionary(this.strm, E)), m === l.Z_BUF_ERROR && S === !0 && (m = l.Z_OK, S = !1), m !== l.Z_STREAM_END && m !== l.Z_OK) return this.onEnd(m), !(this.ended = !0); A.next_out && (A.avail_out !== 0 && m !== l.Z_STREAM_END && (A.avail_in !== 0 || b !== l.Z_FINISH && b !== l.Z_SYNC_FLUSH) || (this.options.to === "string" ? (v = a.utf8border(A.output, A.next_out), y = A.next_out - v, M = a.buf2string(A.output, v), A.next_out = y, A.avail_out = R - y, y && o.arraySet(A.output, A.output, v, y, 0), this.onData(M)) : this.onData(o.shrinkBuf(A.output, A.next_out)))), A.avail_in === 0 && A.avail_out === 0 && (S = !0); } while ((0 < A.avail_in || A.avail_out === 0) && m !== l.Z_STREAM_END); return m === l.Z_STREAM_END && (b = l.Z_FINISH), b === l.Z_FINISH ? (m = r.inflateEnd(this.strm), this.onEnd(m), this.ended = !0, m === l.Z_OK) : b !== l.Z_SYNC_FLUSH || (this.onEnd(l.Z_OK), !(A.avail_out = 0)); - }, f.prototype.onData = function(g) { - this.chunks.push(g); - }, f.prototype.onEnd = function(g) { - g === l.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = g, this.msg = this.strm.msg; - }, i.Inflate = f, i.inflate = p, i.inflateRaw = function(g, x) { - return (x = x || {}).raw = !0, p(g, x); - }, i.ungzip = p; + }, f.prototype.onData = function(p) { + this.chunks.push(p); + }, f.prototype.onEnd = function(p) { + p === l.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = p, this.msg = this.strm.msg; + }, i.Inflate = f, i.inflate = g, i.inflateRaw = function(p, x) { + return (x = x || {}).raw = !0, g(p, x); + }, i.ungzip = g; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(t, n, i) { var r = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u"; i.assign = function(l) { @@ -33023,10 +33027,10 @@ function MM() { if (c.subarray && l.subarray) l.set(c.subarray(h, h + u), d); else for (var f = 0; f < u; f++) l[d + f] = c[h + f]; }, flattenChunks: function(l) { - var c, h, u, d, f, p; + var c, h, u, d, f, g; for (c = u = 0, h = l.length; c < h; c++) u += l[c].length; - for (p = new Uint8Array(u), c = d = 0, h = l.length; c < h; c++) f = l[c], p.set(f, d), d += f.length; - return p; + for (g = new Uint8Array(u), c = d = 0, h = l.length; c < h; c++) f = l[c], g.set(f, d), d += f.length; + return g; } }, a = { arraySet: function(l, c, h, u, d) { for (var f = 0; f < u; f++) l[d + f] = c[h + f]; }, flattenChunks: function(l) { @@ -33050,28 +33054,28 @@ function MM() { for (var l = new r.Buf8(256), c = 0; c < 256; c++) l[c] = 252 <= c ? 6 : 248 <= c ? 5 : 240 <= c ? 4 : 224 <= c ? 3 : 192 <= c ? 2 : 1; function h(u, d) { if (d < 65537 && (u.subarray && a || !u.subarray && o)) return String.fromCharCode.apply(null, r.shrinkBuf(u, d)); - for (var f = "", p = 0; p < d; p++) f += String.fromCharCode(u[p]); + for (var f = "", g = 0; g < d; g++) f += String.fromCharCode(u[g]); return f; } l[254] = l[254] = 1, i.string2buf = function(u) { - var d, f, p, g, x, m = u.length, b = 0; - for (g = 0; g < m; g++) (64512 & (f = u.charCodeAt(g))) == 55296 && g + 1 < m && (64512 & (p = u.charCodeAt(g + 1))) == 56320 && (f = 65536 + (f - 55296 << 10) + (p - 56320), g++), b += f < 128 ? 1 : f < 2048 ? 2 : f < 65536 ? 3 : 4; - for (d = new r.Buf8(b), g = x = 0; x < b; g++) (64512 & (f = u.charCodeAt(g))) == 55296 && g + 1 < m && (64512 & (p = u.charCodeAt(g + 1))) == 56320 && (f = 65536 + (f - 55296 << 10) + (p - 56320), g++), f < 128 ? d[x++] = f : (f < 2048 ? d[x++] = 192 | f >>> 6 : (f < 65536 ? d[x++] = 224 | f >>> 12 : (d[x++] = 240 | f >>> 18, d[x++] = 128 | f >>> 12 & 63), d[x++] = 128 | f >>> 6 & 63), d[x++] = 128 | 63 & f); + var d, f, g, p, x, m = u.length, b = 0; + for (p = 0; p < m; p++) (64512 & (f = u.charCodeAt(p))) == 55296 && p + 1 < m && (64512 & (g = u.charCodeAt(p + 1))) == 56320 && (f = 65536 + (f - 55296 << 10) + (g - 56320), p++), b += f < 128 ? 1 : f < 2048 ? 2 : f < 65536 ? 3 : 4; + for (d = new r.Buf8(b), p = x = 0; x < b; p++) (64512 & (f = u.charCodeAt(p))) == 55296 && p + 1 < m && (64512 & (g = u.charCodeAt(p + 1))) == 56320 && (f = 65536 + (f - 55296 << 10) + (g - 56320), p++), f < 128 ? d[x++] = f : (f < 2048 ? d[x++] = 192 | f >>> 6 : (f < 65536 ? d[x++] = 224 | f >>> 12 : (d[x++] = 240 | f >>> 18, d[x++] = 128 | f >>> 12 & 63), d[x++] = 128 | f >>> 6 & 63), d[x++] = 128 | 63 & f); return d; }, i.buf2binstring = function(u) { return h(u, u.length); }, i.binstring2buf = function(u) { - for (var d = new r.Buf8(u.length), f = 0, p = d.length; f < p; f++) d[f] = u.charCodeAt(f); + for (var d = new r.Buf8(u.length), f = 0, g = d.length; f < g; f++) d[f] = u.charCodeAt(f); return d; }, i.buf2string = function(u, d) { - var f, p, g, x, m = d || u.length, b = new Array(2 * m); - for (f = p = 0; f < m; ) if ((g = u[f++]) < 128) b[p++] = g; - else if (4 < (x = l[g])) b[p++] = 65533, f += x - 1; + var f, g, p, x, m = d || u.length, b = new Array(2 * m); + for (f = g = 0; f < m; ) if ((p = u[f++]) < 128) b[g++] = p; + else if (4 < (x = l[p])) b[g++] = 65533, f += x - 1; else { - for (g &= x === 2 ? 31 : x === 3 ? 15 : 7; 1 < x && f < m; ) g = g << 6 | 63 & u[f++], x--; - 1 < x ? b[p++] = 65533 : g < 65536 ? b[p++] = g : (g -= 65536, b[p++] = 55296 | g >> 10 & 1023, b[p++] = 56320 | 1023 & g); + for (p &= x === 2 ? 31 : x === 3 ? 15 : 7; 1 < x && f < m; ) p = p << 6 | 63 & u[f++], x--; + 1 < x ? b[g++] = 65533 : p < 65536 ? b[g++] = p : (p -= 65536, b[g++] = 55296 | p >> 10 & 1023, b[g++] = 56320 | 1023 & p); } - return h(b, p); + return h(b, g); }, i.utf8border = function(u, d) { var f; for ((d = d || u.length) > u.length && (d = u.length), f = d - 1; 0 <= f && (192 & u[f]) == 128; ) f--; @@ -33103,11 +33107,11 @@ function MM() { return -1 ^ o; }; }, {}], 46: [function(t, n, i) { - var r, o = t("../utils/common"), a = t("./trees"), l = t("./adler32"), c = t("./crc32"), h = t("./messages"), u = 0, d = 4, f = 0, p = -2, g = -1, x = 4, m = 2, b = 8, v = 9, y = 286, M = 30, E = 19, A = 2 * y + 1, R = 15, _ = 3, S = 258, D = S + _ + 1, C = 42, B = 113, w = 1, F = 2, W = 3, j = 4; + var r, o = t("../utils/common"), a = t("./trees"), l = t("./adler32"), c = t("./crc32"), h = t("./messages"), u = 0, d = 4, f = 0, g = -2, p = -1, x = 4, m = 2, b = 8, v = 9, y = 286, M = 30, E = 19, A = 2 * y + 1, R = 15, _ = 3, S = 258, D = S + _ + 1, C = 42, B = 113, w = 1, F = 2, W = 3, j = 4; function $(T, I) { return T.msg = h[I], I; } - function Z(T) { + function q(T) { return (T << 1) - (4 < T ? 9 : 0); } function re(T) { @@ -33127,73 +33131,73 @@ function MM() { T.pending_buf[T.pending++] = I >>> 8 & 255, T.pending_buf[T.pending++] = 255 & I; } function de(T, I) { - var V, U, k = T.max_chain_length, z = T.strstart, ee = T.prev_length, J = T.nice_match, G = T.strstart > T.w_size - D ? T.strstart - (T.w_size - D) : 0, N = T.window, L = T.w_mask, H = T.prev, K = T.strstart + S, le = N[z + ee - 1], te = N[z + ee]; - T.prev_length >= T.good_match && (k >>= 2), J > T.lookahead && (J = T.lookahead); + var V, O, U = T.max_chain_length, z = T.strstart, ee = T.prev_length, J = T.nice_match, G = T.strstart > T.w_size - D ? T.strstart - (T.w_size - D) : 0, N = T.window, L = T.w_mask, H = T.prev, K = T.strstart + S, le = N[z + ee - 1], te = N[z + ee]; + T.prev_length >= T.good_match && (U >>= 2), J > T.lookahead && (J = T.lookahead); do if (N[(V = I) + ee] === te && N[V + ee - 1] === le && N[V] === N[z] && N[++V] === N[z + 1]) { z += 2, V++; do ; while (N[++z] === N[++V] && N[++z] === N[++V] && N[++z] === N[++V] && N[++z] === N[++V] && N[++z] === N[++V] && N[++z] === N[++V] && N[++z] === N[++V] && N[++z] === N[++V] && z < K); - if (U = S - (K - z), z = K - S, ee < U) { - if (T.match_start = I, J <= (ee = U)) break; + if (O = S - (K - z), z = K - S, ee < O) { + if (T.match_start = I, J <= (ee = O)) break; le = N[z + ee - 1], te = N[z + ee]; } } - while ((I = H[I & L]) > G && --k != 0); + while ((I = H[I & L]) > G && --U != 0); return ee <= T.lookahead ? ee : T.lookahead; } function ie(T) { - var I, V, U, k, z, ee, J, G, N, L, H = T.w_size; + var I, V, O, U, z, ee, J, G, N, L, H = T.w_size; do { - if (k = T.window_size - T.lookahead - T.strstart, T.strstart >= H + (H - D)) { - for (o.arraySet(T.window, T.window, H, H, 0), T.match_start -= H, T.strstart -= H, T.block_start -= H, I = V = T.hash_size; U = T.head[--I], T.head[I] = H <= U ? U - H : 0, --V; ) ; - for (I = V = H; U = T.prev[--I], T.prev[I] = H <= U ? U - H : 0, --V; ) ; - k += H; + if (U = T.window_size - T.lookahead - T.strstart, T.strstart >= H + (H - D)) { + for (o.arraySet(T.window, T.window, H, H, 0), T.match_start -= H, T.strstart -= H, T.block_start -= H, I = V = T.hash_size; O = T.head[--I], T.head[I] = H <= O ? O - H : 0, --V; ) ; + for (I = V = H; O = T.prev[--I], T.prev[I] = H <= O ? O - H : 0, --V; ) ; + U += H; } if (T.strm.avail_in === 0) break; - if (ee = T.strm, J = T.window, G = T.strstart + T.lookahead, N = k, L = void 0, L = ee.avail_in, N < L && (L = N), V = L === 0 ? 0 : (ee.avail_in -= L, o.arraySet(J, ee.input, ee.next_in, L, G), ee.state.wrap === 1 ? ee.adler = l(ee.adler, J, L, G) : ee.state.wrap === 2 && (ee.adler = c(ee.adler, J, L, G)), ee.next_in += L, ee.total_in += L, L), T.lookahead += V, T.lookahead + T.insert >= _) for (z = T.strstart - T.insert, T.ins_h = T.window[z], T.ins_h = (T.ins_h << T.hash_shift ^ T.window[z + 1]) & T.hash_mask; T.insert && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[z + _ - 1]) & T.hash_mask, T.prev[z & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = z, z++, T.insert--, !(T.lookahead + T.insert < _)); ) ; + if (ee = T.strm, J = T.window, G = T.strstart + T.lookahead, N = U, L = void 0, L = ee.avail_in, N < L && (L = N), V = L === 0 ? 0 : (ee.avail_in -= L, o.arraySet(J, ee.input, ee.next_in, L, G), ee.state.wrap === 1 ? ee.adler = l(ee.adler, J, L, G) : ee.state.wrap === 2 && (ee.adler = c(ee.adler, J, L, G)), ee.next_in += L, ee.total_in += L, L), T.lookahead += V, T.lookahead + T.insert >= _) for (z = T.strstart - T.insert, T.ins_h = T.window[z], T.ins_h = (T.ins_h << T.hash_shift ^ T.window[z + 1]) & T.hash_mask; T.insert && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[z + _ - 1]) & T.hash_mask, T.prev[z & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = z, z++, T.insert--, !(T.lookahead + T.insert < _)); ) ; } while (T.lookahead < D && T.strm.avail_in !== 0); } function he(T, I) { - for (var V, U; ; ) { + for (var V, O; ; ) { if (T.lookahead < D) { if (ie(T), T.lookahead < D && I === u) return w; if (T.lookahead === 0) break; } - if (V = 0, T.lookahead >= _ && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + _ - 1]) & T.hash_mask, V = T.prev[T.strstart & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = T.strstart), V !== 0 && T.strstart - V <= T.w_size - D && (T.match_length = de(T, V)), T.match_length >= _) if (U = a._tr_tally(T, T.strstart - T.match_start, T.match_length - _), T.lookahead -= T.match_length, T.match_length <= T.max_lazy_match && T.lookahead >= _) { + if (V = 0, T.lookahead >= _ && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + _ - 1]) & T.hash_mask, V = T.prev[T.strstart & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = T.strstart), V !== 0 && T.strstart - V <= T.w_size - D && (T.match_length = de(T, V)), T.match_length >= _) if (O = a._tr_tally(T, T.strstart - T.match_start, T.match_length - _), T.lookahead -= T.match_length, T.match_length <= T.max_lazy_match && T.lookahead >= _) { for (T.match_length--; T.strstart++, T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + _ - 1]) & T.hash_mask, V = T.prev[T.strstart & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = T.strstart, --T.match_length != 0; ) ; T.strstart++; } else T.strstart += T.match_length, T.match_length = 0, T.ins_h = T.window[T.strstart], T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + 1]) & T.hash_mask; - else U = a._tr_tally(T, 0, T.window[T.strstart]), T.lookahead--, T.strstart++; - if (U && (Y(T, !1), T.strm.avail_out === 0)) return w; + else O = a._tr_tally(T, 0, T.window[T.strstart]), T.lookahead--, T.strstart++; + if (O && (Y(T, !1), T.strm.avail_out === 0)) return w; } return T.insert = T.strstart < _ - 1 ? T.strstart : _ - 1, I === d ? (Y(T, !0), T.strm.avail_out === 0 ? W : j) : T.last_lit && (Y(T, !1), T.strm.avail_out === 0) ? w : F; } function fe(T, I) { - for (var V, U, k; ; ) { + for (var V, O, U; ; ) { if (T.lookahead < D) { if (ie(T), T.lookahead < D && I === u) return w; if (T.lookahead === 0) break; } if (V = 0, T.lookahead >= _ && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + _ - 1]) & T.hash_mask, V = T.prev[T.strstart & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = T.strstart), T.prev_length = T.match_length, T.prev_match = T.match_start, T.match_length = _ - 1, V !== 0 && T.prev_length < T.max_lazy_match && T.strstart - V <= T.w_size - D && (T.match_length = de(T, V), T.match_length <= 5 && (T.strategy === 1 || T.match_length === _ && 4096 < T.strstart - T.match_start) && (T.match_length = _ - 1)), T.prev_length >= _ && T.match_length <= T.prev_length) { - for (k = T.strstart + T.lookahead - _, U = a._tr_tally(T, T.strstart - 1 - T.prev_match, T.prev_length - _), T.lookahead -= T.prev_length - 1, T.prev_length -= 2; ++T.strstart <= k && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + _ - 1]) & T.hash_mask, V = T.prev[T.strstart & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = T.strstart), --T.prev_length != 0; ) ; - if (T.match_available = 0, T.match_length = _ - 1, T.strstart++, U && (Y(T, !1), T.strm.avail_out === 0)) return w; + for (U = T.strstart + T.lookahead - _, O = a._tr_tally(T, T.strstart - 1 - T.prev_match, T.prev_length - _), T.lookahead -= T.prev_length - 1, T.prev_length -= 2; ++T.strstart <= U && (T.ins_h = (T.ins_h << T.hash_shift ^ T.window[T.strstart + _ - 1]) & T.hash_mask, V = T.prev[T.strstart & T.w_mask] = T.head[T.ins_h], T.head[T.ins_h] = T.strstart), --T.prev_length != 0; ) ; + if (T.match_available = 0, T.match_length = _ - 1, T.strstart++, O && (Y(T, !1), T.strm.avail_out === 0)) return w; } else if (T.match_available) { - if ((U = a._tr_tally(T, 0, T.window[T.strstart - 1])) && Y(T, !1), T.strstart++, T.lookahead--, T.strm.avail_out === 0) return w; + if ((O = a._tr_tally(T, 0, T.window[T.strstart - 1])) && Y(T, !1), T.strstart++, T.lookahead--, T.strm.avail_out === 0) return w; } else T.match_available = 1, T.strstart++, T.lookahead--; } - return T.match_available && (U = a._tr_tally(T, 0, T.window[T.strstart - 1]), T.match_available = 0), T.insert = T.strstart < _ - 1 ? T.strstart : _ - 1, I === d ? (Y(T, !0), T.strm.avail_out === 0 ? W : j) : T.last_lit && (Y(T, !1), T.strm.avail_out === 0) ? w : F; + return T.match_available && (O = a._tr_tally(T, 0, T.window[T.strstart - 1]), T.match_available = 0), T.insert = T.strstart < _ - 1 ? T.strstart : _ - 1, I === d ? (Y(T, !0), T.strm.avail_out === 0 ? W : j) : T.last_lit && (Y(T, !1), T.strm.avail_out === 0) ? w : F; } - function ve(T, I, V, U, k) { - this.good_length = T, this.max_lazy = I, this.nice_length = V, this.max_chain = U, this.func = k; + function ve(T, I, V, O, U) { + this.good_length = T, this.max_lazy = I, this.nice_length = V, this.max_chain = O, this.func = U; } function we() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = b, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new o.Buf16(2 * A), this.dyn_dtree = new o.Buf16(2 * (2 * M + 1)), this.bl_tree = new o.Buf16(2 * (2 * E + 1)), re(this.dyn_ltree), re(this.dyn_dtree), re(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new o.Buf16(R + 1), this.heap = new o.Buf16(2 * y + 1), re(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new o.Buf16(2 * y + 1), re(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } function Be(T) { var I; - return T && T.state ? (T.total_in = T.total_out = 0, T.data_type = m, (I = T.state).pending = 0, I.pending_out = 0, I.wrap < 0 && (I.wrap = -I.wrap), I.status = I.wrap ? C : B, T.adler = I.wrap === 2 ? 0 : 1, I.last_flush = u, a._tr_init(I), f) : $(T, p); + return T && T.state ? (T.total_in = T.total_out = 0, T.data_type = m, (I = T.state).pending = 0, I.pending_out = 0, I.wrap < 0 && (I.wrap = -I.wrap), I.status = I.wrap ? C : B, T.adler = I.wrap === 2 ? 0 : 1, I.last_flush = u, a._tr_init(I), f) : $(T, g); } function Ke(T) { var I = Be(T); @@ -33201,13 +33205,13 @@ function MM() { V.window_size = 2 * V.w_size, re(V.head), V.max_lazy_match = r[V.level].max_lazy, V.good_match = r[V.level].good_length, V.nice_match = r[V.level].nice_length, V.max_chain_length = r[V.level].max_chain, V.strstart = 0, V.block_start = 0, V.lookahead = 0, V.insert = 0, V.match_length = V.prev_length = _ - 1, V.match_available = 0, V.ins_h = 0; })(T.state), I; } - function Ne(T, I, V, U, k, z) { - if (!T) return p; + function Ne(T, I, V, O, U, z) { + if (!T) return g; var ee = 1; - if (I === g && (I = 6), U < 0 ? (ee = 0, U = -U) : 15 < U && (ee = 2, U -= 16), k < 1 || v < k || V !== b || U < 8 || 15 < U || I < 0 || 9 < I || z < 0 || x < z) return $(T, p); - U === 8 && (U = 9); + if (I === p && (I = 6), O < 0 ? (ee = 0, O = -O) : 15 < O && (ee = 2, O -= 16), U < 1 || v < U || V !== b || O < 8 || 15 < O || I < 0 || 9 < I || z < 0 || x < z) return $(T, g); + O === 8 && (O = 9); var J = new we(); - return (T.state = J).strm = T, J.wrap = ee, J.gzhead = null, J.w_bits = U, J.w_size = 1 << J.w_bits, J.w_mask = J.w_size - 1, J.hash_bits = k + 7, J.hash_size = 1 << J.hash_bits, J.hash_mask = J.hash_size - 1, J.hash_shift = ~~((J.hash_bits + _ - 1) / _), J.window = new o.Buf8(2 * J.w_size), J.head = new o.Buf16(J.hash_size), J.prev = new o.Buf16(J.w_size), J.lit_bufsize = 1 << k + 6, J.pending_buf_size = 4 * J.lit_bufsize, J.pending_buf = new o.Buf8(J.pending_buf_size), J.d_buf = 1 * J.lit_bufsize, J.l_buf = 3 * J.lit_bufsize, J.level = I, J.strategy = z, J.method = V, Ke(T); + return (T.state = J).strm = T, J.wrap = ee, J.gzhead = null, J.w_bits = O, J.w_size = 1 << J.w_bits, J.w_mask = J.w_size - 1, J.hash_bits = U + 7, J.hash_size = 1 << J.hash_bits, J.hash_mask = J.hash_size - 1, J.hash_shift = ~~((J.hash_bits + _ - 1) / _), J.window = new o.Buf8(2 * J.w_size), J.head = new o.Buf16(J.hash_size), J.prev = new o.Buf16(J.w_size), J.lit_bufsize = 1 << U + 6, J.pending_buf_size = 4 * J.lit_bufsize, J.pending_buf = new o.Buf8(J.pending_buf_size), J.d_buf = 1 * J.lit_bufsize, J.l_buf = 3 * J.lit_bufsize, J.level = I, J.strategy = z, J.method = V, Ke(T); } r = [new ve(0, 0, 0, 0, function(T, I) { var V = 65535; @@ -33217,55 +33221,55 @@ function MM() { if (T.lookahead === 0) break; } T.strstart += T.lookahead, T.lookahead = 0; - var U = T.block_start + V; - if ((T.strstart === 0 || T.strstart >= U) && (T.lookahead = T.strstart - U, T.strstart = U, Y(T, !1), T.strm.avail_out === 0) || T.strstart - T.block_start >= T.w_size - D && (Y(T, !1), T.strm.avail_out === 0)) return w; + var O = T.block_start + V; + if ((T.strstart === 0 || T.strstart >= O) && (T.lookahead = T.strstart - O, T.strstart = O, Y(T, !1), T.strm.avail_out === 0) || T.strstart - T.block_start >= T.w_size - D && (Y(T, !1), T.strm.avail_out === 0)) return w; } return T.insert = 0, I === d ? (Y(T, !0), T.strm.avail_out === 0 ? W : j) : (T.strstart > T.block_start && (Y(T, !1), T.strm.avail_out), w); }), new ve(4, 4, 8, 4, he), new ve(4, 5, 16, 8, he), new ve(4, 6, 32, 32, he), new ve(4, 4, 16, 16, fe), new ve(8, 16, 32, 32, fe), new ve(8, 16, 128, 128, fe), new ve(8, 32, 128, 256, fe), new ve(32, 128, 258, 1024, fe), new ve(32, 258, 258, 4096, fe)], i.deflateInit = function(T, I) { return Ne(T, I, b, 15, 8, 0); }, i.deflateInit2 = Ne, i.deflateReset = Ke, i.deflateResetKeep = Be, i.deflateSetHeader = function(T, I) { - return T && T.state ? T.state.wrap !== 2 ? p : (T.state.gzhead = I, f) : p; + return T && T.state ? T.state.wrap !== 2 ? g : (T.state.gzhead = I, f) : g; }, i.deflate = function(T, I) { - var V, U, k, z; - if (!T || !T.state || 5 < I || I < 0) return T ? $(T, p) : p; - if (U = T.state, !T.output || !T.input && T.avail_in !== 0 || U.status === 666 && I !== d) return $(T, T.avail_out === 0 ? -5 : p); - if (U.strm = T, V = U.last_flush, U.last_flush = I, U.status === C) if (U.wrap === 2) T.adler = 0, ge(U, 31), ge(U, 139), ge(U, 8), U.gzhead ? (ge(U, (U.gzhead.text ? 1 : 0) + (U.gzhead.hcrc ? 2 : 0) + (U.gzhead.extra ? 4 : 0) + (U.gzhead.name ? 8 : 0) + (U.gzhead.comment ? 16 : 0)), ge(U, 255 & U.gzhead.time), ge(U, U.gzhead.time >> 8 & 255), ge(U, U.gzhead.time >> 16 & 255), ge(U, U.gzhead.time >> 24 & 255), ge(U, U.level === 9 ? 2 : 2 <= U.strategy || U.level < 2 ? 4 : 0), ge(U, 255 & U.gzhead.os), U.gzhead.extra && U.gzhead.extra.length && (ge(U, 255 & U.gzhead.extra.length), ge(U, U.gzhead.extra.length >> 8 & 255)), U.gzhead.hcrc && (T.adler = c(T.adler, U.pending_buf, U.pending, 0)), U.gzindex = 0, U.status = 69) : (ge(U, 0), ge(U, 0), ge(U, 0), ge(U, 0), ge(U, 0), ge(U, U.level === 9 ? 2 : 2 <= U.strategy || U.level < 2 ? 4 : 0), ge(U, 3), U.status = B); + var V, O, U, z; + if (!T || !T.state || 5 < I || I < 0) return T ? $(T, g) : g; + if (O = T.state, !T.output || !T.input && T.avail_in !== 0 || O.status === 666 && I !== d) return $(T, T.avail_out === 0 ? -5 : g); + if (O.strm = T, V = O.last_flush, O.last_flush = I, O.status === C) if (O.wrap === 2) T.adler = 0, ge(O, 31), ge(O, 139), ge(O, 8), O.gzhead ? (ge(O, (O.gzhead.text ? 1 : 0) + (O.gzhead.hcrc ? 2 : 0) + (O.gzhead.extra ? 4 : 0) + (O.gzhead.name ? 8 : 0) + (O.gzhead.comment ? 16 : 0)), ge(O, 255 & O.gzhead.time), ge(O, O.gzhead.time >> 8 & 255), ge(O, O.gzhead.time >> 16 & 255), ge(O, O.gzhead.time >> 24 & 255), ge(O, O.level === 9 ? 2 : 2 <= O.strategy || O.level < 2 ? 4 : 0), ge(O, 255 & O.gzhead.os), O.gzhead.extra && O.gzhead.extra.length && (ge(O, 255 & O.gzhead.extra.length), ge(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (T.adler = c(T.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = 69) : (ge(O, 0), ge(O, 0), ge(O, 0), ge(O, 0), ge(O, 0), ge(O, O.level === 9 ? 2 : 2 <= O.strategy || O.level < 2 ? 4 : 0), ge(O, 3), O.status = B); else { - var ee = b + (U.w_bits - 8 << 4) << 8; - ee |= (2 <= U.strategy || U.level < 2 ? 0 : U.level < 6 ? 1 : U.level === 6 ? 2 : 3) << 6, U.strstart !== 0 && (ee |= 32), ee += 31 - ee % 31, U.status = B, pe(U, ee), U.strstart !== 0 && (pe(U, T.adler >>> 16), pe(U, 65535 & T.adler)), T.adler = 1; + var ee = b + (O.w_bits - 8 << 4) << 8; + ee |= (2 <= O.strategy || O.level < 2 ? 0 : O.level < 6 ? 1 : O.level === 6 ? 2 : 3) << 6, O.strstart !== 0 && (ee |= 32), ee += 31 - ee % 31, O.status = B, pe(O, ee), O.strstart !== 0 && (pe(O, T.adler >>> 16), pe(O, 65535 & T.adler)), T.adler = 1; } - if (U.status === 69) if (U.gzhead.extra) { - for (k = U.pending; U.gzindex < (65535 & U.gzhead.extra.length) && (U.pending !== U.pending_buf_size || (U.gzhead.hcrc && U.pending > k && (T.adler = c(T.adler, U.pending_buf, U.pending - k, k)), X(T), k = U.pending, U.pending !== U.pending_buf_size)); ) ge(U, 255 & U.gzhead.extra[U.gzindex]), U.gzindex++; - U.gzhead.hcrc && U.pending > k && (T.adler = c(T.adler, U.pending_buf, U.pending - k, k)), U.gzindex === U.gzhead.extra.length && (U.gzindex = 0, U.status = 73); - } else U.status = 73; - if (U.status === 73) if (U.gzhead.name) { - k = U.pending; + if (O.status === 69) if (O.gzhead.extra) { + for (U = O.pending; O.gzindex < (65535 & O.gzhead.extra.length) && (O.pending !== O.pending_buf_size || (O.gzhead.hcrc && O.pending > U && (T.adler = c(T.adler, O.pending_buf, O.pending - U, U)), X(T), U = O.pending, O.pending !== O.pending_buf_size)); ) ge(O, 255 & O.gzhead.extra[O.gzindex]), O.gzindex++; + O.gzhead.hcrc && O.pending > U && (T.adler = c(T.adler, O.pending_buf, O.pending - U, U)), O.gzindex === O.gzhead.extra.length && (O.gzindex = 0, O.status = 73); + } else O.status = 73; + if (O.status === 73) if (O.gzhead.name) { + U = O.pending; do { - if (U.pending === U.pending_buf_size && (U.gzhead.hcrc && U.pending > k && (T.adler = c(T.adler, U.pending_buf, U.pending - k, k)), X(T), k = U.pending, U.pending === U.pending_buf_size)) { + if (O.pending === O.pending_buf_size && (O.gzhead.hcrc && O.pending > U && (T.adler = c(T.adler, O.pending_buf, O.pending - U, U)), X(T), U = O.pending, O.pending === O.pending_buf_size)) { z = 1; break; } - z = U.gzindex < U.gzhead.name.length ? 255 & U.gzhead.name.charCodeAt(U.gzindex++) : 0, ge(U, z); + z = O.gzindex < O.gzhead.name.length ? 255 & O.gzhead.name.charCodeAt(O.gzindex++) : 0, ge(O, z); } while (z !== 0); - U.gzhead.hcrc && U.pending > k && (T.adler = c(T.adler, U.pending_buf, U.pending - k, k)), z === 0 && (U.gzindex = 0, U.status = 91); - } else U.status = 91; - if (U.status === 91) if (U.gzhead.comment) { - k = U.pending; + O.gzhead.hcrc && O.pending > U && (T.adler = c(T.adler, O.pending_buf, O.pending - U, U)), z === 0 && (O.gzindex = 0, O.status = 91); + } else O.status = 91; + if (O.status === 91) if (O.gzhead.comment) { + U = O.pending; do { - if (U.pending === U.pending_buf_size && (U.gzhead.hcrc && U.pending > k && (T.adler = c(T.adler, U.pending_buf, U.pending - k, k)), X(T), k = U.pending, U.pending === U.pending_buf_size)) { + if (O.pending === O.pending_buf_size && (O.gzhead.hcrc && O.pending > U && (T.adler = c(T.adler, O.pending_buf, O.pending - U, U)), X(T), U = O.pending, O.pending === O.pending_buf_size)) { z = 1; break; } - z = U.gzindex < U.gzhead.comment.length ? 255 & U.gzhead.comment.charCodeAt(U.gzindex++) : 0, ge(U, z); + z = O.gzindex < O.gzhead.comment.length ? 255 & O.gzhead.comment.charCodeAt(O.gzindex++) : 0, ge(O, z); } while (z !== 0); - U.gzhead.hcrc && U.pending > k && (T.adler = c(T.adler, U.pending_buf, U.pending - k, k)), z === 0 && (U.status = 103); - } else U.status = 103; - if (U.status === 103 && (U.gzhead.hcrc ? (U.pending + 2 > U.pending_buf_size && X(T), U.pending + 2 <= U.pending_buf_size && (ge(U, 255 & T.adler), ge(U, T.adler >> 8 & 255), T.adler = 0, U.status = B)) : U.status = B), U.pending !== 0) { - if (X(T), T.avail_out === 0) return U.last_flush = -1, f; - } else if (T.avail_in === 0 && Z(I) <= Z(V) && I !== d) return $(T, -5); - if (U.status === 666 && T.avail_in !== 0) return $(T, -5); - if (T.avail_in !== 0 || U.lookahead !== 0 || I !== u && U.status !== 666) { - var J = U.strategy === 2 ? (function(G, N) { + O.gzhead.hcrc && O.pending > U && (T.adler = c(T.adler, O.pending_buf, O.pending - U, U)), z === 0 && (O.status = 103); + } else O.status = 103; + if (O.status === 103 && (O.gzhead.hcrc ? (O.pending + 2 > O.pending_buf_size && X(T), O.pending + 2 <= O.pending_buf_size && (ge(O, 255 & T.adler), ge(O, T.adler >> 8 & 255), T.adler = 0, O.status = B)) : O.status = B), O.pending !== 0) { + if (X(T), T.avail_out === 0) return O.last_flush = -1, f; + } else if (T.avail_in === 0 && q(I) <= q(V) && I !== d) return $(T, -5); + if (O.status === 666 && T.avail_in !== 0) return $(T, -5); + if (T.avail_in !== 0 || O.lookahead !== 0 || I !== u && O.status !== 666) { + var J = O.strategy === 2 ? (function(G, N) { for (var L; ; ) { if (G.lookahead === 0 && (ie(G), G.lookahead === 0)) { if (N === u) return w; @@ -33274,7 +33278,7 @@ function MM() { if (G.match_length = 0, L = a._tr_tally(G, 0, G.window[G.strstart]), G.lookahead--, G.strstart++, L && (Y(G, !1), G.strm.avail_out === 0)) return w; } return G.insert = 0, N === d ? (Y(G, !0), G.strm.avail_out === 0 ? W : j) : G.last_lit && (Y(G, !1), G.strm.avail_out === 0) ? w : F; - })(U, I) : U.strategy === 3 ? (function(G, N) { + })(O, I) : O.strategy === 3 ? (function(G, N) { for (var L, H, K, le, te = G.window; ; ) { if (G.lookahead <= S) { if (ie(G), G.lookahead <= S && N === u) return w; @@ -33290,20 +33294,20 @@ function MM() { if (G.match_length >= _ ? (L = a._tr_tally(G, 1, G.match_length - _), G.lookahead -= G.match_length, G.strstart += G.match_length, G.match_length = 0) : (L = a._tr_tally(G, 0, G.window[G.strstart]), G.lookahead--, G.strstart++), L && (Y(G, !1), G.strm.avail_out === 0)) return w; } return G.insert = 0, N === d ? (Y(G, !0), G.strm.avail_out === 0 ? W : j) : G.last_lit && (Y(G, !1), G.strm.avail_out === 0) ? w : F; - })(U, I) : r[U.level].func(U, I); - if (J !== W && J !== j || (U.status = 666), J === w || J === W) return T.avail_out === 0 && (U.last_flush = -1), f; - if (J === F && (I === 1 ? a._tr_align(U) : I !== 5 && (a._tr_stored_block(U, 0, 0, !1), I === 3 && (re(U.head), U.lookahead === 0 && (U.strstart = 0, U.block_start = 0, U.insert = 0))), X(T), T.avail_out === 0)) return U.last_flush = -1, f; + })(O, I) : r[O.level].func(O, I); + if (J !== W && J !== j || (O.status = 666), J === w || J === W) return T.avail_out === 0 && (O.last_flush = -1), f; + if (J === F && (I === 1 ? a._tr_align(O) : I !== 5 && (a._tr_stored_block(O, 0, 0, !1), I === 3 && (re(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), X(T), T.avail_out === 0)) return O.last_flush = -1, f; } - return I !== d ? f : U.wrap <= 0 ? 1 : (U.wrap === 2 ? (ge(U, 255 & T.adler), ge(U, T.adler >> 8 & 255), ge(U, T.adler >> 16 & 255), ge(U, T.adler >> 24 & 255), ge(U, 255 & T.total_in), ge(U, T.total_in >> 8 & 255), ge(U, T.total_in >> 16 & 255), ge(U, T.total_in >> 24 & 255)) : (pe(U, T.adler >>> 16), pe(U, 65535 & T.adler)), X(T), 0 < U.wrap && (U.wrap = -U.wrap), U.pending !== 0 ? f : 1); + return I !== d ? f : O.wrap <= 0 ? 1 : (O.wrap === 2 ? (ge(O, 255 & T.adler), ge(O, T.adler >> 8 & 255), ge(O, T.adler >> 16 & 255), ge(O, T.adler >> 24 & 255), ge(O, 255 & T.total_in), ge(O, T.total_in >> 8 & 255), ge(O, T.total_in >> 16 & 255), ge(O, T.total_in >> 24 & 255)) : (pe(O, T.adler >>> 16), pe(O, 65535 & T.adler)), X(T), 0 < O.wrap && (O.wrap = -O.wrap), O.pending !== 0 ? f : 1); }, i.deflateEnd = function(T) { var I; - return T && T.state ? (I = T.state.status) !== C && I !== 69 && I !== 73 && I !== 91 && I !== 103 && I !== B && I !== 666 ? $(T, p) : (T.state = null, I === B ? $(T, -3) : f) : p; + return T && T.state ? (I = T.state.status) !== C && I !== 69 && I !== 73 && I !== 91 && I !== 103 && I !== B && I !== 666 ? $(T, g) : (T.state = null, I === B ? $(T, -3) : f) : g; }, i.deflateSetDictionary = function(T, I) { - var V, U, k, z, ee, J, G, N, L = I.length; - if (!T || !T.state || (z = (V = T.state).wrap) === 2 || z === 1 && V.status !== C || V.lookahead) return p; + var V, O, U, z, ee, J, G, N, L = I.length; + if (!T || !T.state || (z = (V = T.state).wrap) === 2 || z === 1 && V.status !== C || V.lookahead) return g; for (z === 1 && (T.adler = l(T.adler, I, L, 0)), V.wrap = 0, L >= V.w_size && (z === 0 && (re(V.head), V.strstart = 0, V.block_start = 0, V.insert = 0), N = new o.Buf8(V.w_size), o.arraySet(N, I, L - V.w_size, V.w_size, 0), I = N, L = V.w_size), ee = T.avail_in, J = T.next_in, G = T.input, T.avail_in = L, T.next_in = 0, T.input = I, ie(V); V.lookahead >= _; ) { - for (U = V.strstart, k = V.lookahead - (_ - 1); V.ins_h = (V.ins_h << V.hash_shift ^ V.window[U + _ - 1]) & V.hash_mask, V.prev[U & V.w_mask] = V.head[V.ins_h], V.head[V.ins_h] = U, U++, --k; ) ; - V.strstart = U, V.lookahead = _ - 1, ie(V); + for (O = V.strstart, U = V.lookahead - (_ - 1); V.ins_h = (V.ins_h << V.hash_shift ^ V.window[O + _ - 1]) & V.hash_mask, V.prev[O & V.w_mask] = V.head[V.ins_h], V.head[V.ins_h] = O, O++, --U; ) ; + V.strstart = O, V.lookahead = _ - 1, ie(V); } return V.strstart += V.lookahead, V.block_start = V.strstart, V.insert = V.lookahead, V.lookahead = 0, V.match_length = V.prev_length = _ - 1, V.match_available = 0, T.next_in = J, T.input = G, T.avail_in = ee, V.wrap = z, f; }, i.deflateInfo = "pako deflate (from Nodeca project)"; @@ -33313,8 +33317,8 @@ function MM() { }; }, {}], 48: [function(t, n, i) { n.exports = function(r, o) { - var a, l, c, h, u, d, f, p, g, x, m, b, v, y, M, E, A, R, _, S, D, C, B, w, F; - a = r.state, l = r.next_in, w = r.input, c = l + (r.avail_in - 5), h = r.next_out, F = r.output, u = h - (o - r.avail_out), d = h + (r.avail_out - 257), f = a.dmax, p = a.wsize, g = a.whave, x = a.wnext, m = a.window, b = a.hold, v = a.bits, y = a.lencode, M = a.distcode, E = (1 << a.lenbits) - 1, A = (1 << a.distbits) - 1; + var a, l, c, h, u, d, f, g, p, x, m, b, v, y, M, E, A, R, _, S, D, C, B, w, F; + a = r.state, l = r.next_in, w = r.input, c = l + (r.avail_in - 5), h = r.next_out, F = r.output, u = h - (o - r.avail_out), d = h + (r.avail_out - 257), f = a.dmax, g = a.wsize, p = a.whave, x = a.wnext, m = a.window, b = a.hold, v = a.bits, y = a.lencode, M = a.distcode, E = (1 << a.lenbits) - 1, A = (1 << a.distbits) - 1; e: do { v < 15 && (b += w[l++] << v, v += 8, b += w[l++] << v, v += 8), R = y[b & E]; t: for (; ; ) { @@ -33347,17 +33351,17 @@ function MM() { break e; } if (b >>>= _, v -= _, (_ = h - u) < D) { - if (g < (_ = D - _) && a.sane) { + if (p < (_ = D - _) && a.sane) { r.msg = "invalid distance too far back", a.mode = 30; break e; } if (B = m, (C = 0) === x) { - if (C += p - _, _ < S) { + if (C += g - _, _ < S) { for (S -= _; F[h++] = m[C++], --_; ) ; C = h - D, B = F; } } else if (x < _) { - if (C += p + x - _, (_ -= x) < S) { + if (C += g + x - _, (_ -= x) < S) { for (S -= _; F[h++] = m[C++], --_; ) ; if (C = 0, x < S) { for (S -= _ = x; F[h++] = m[C++], --_; ) ; @@ -33383,7 +33387,7 @@ function MM() { l -= S = v >> 3, b &= (1 << (v -= S << 3)) - 1, r.next_in = l, r.next_out = h, r.avail_in = l < c ? c - l + 5 : 5 - (l - c), r.avail_out = h < d ? d - h + 257 : 257 - (h - d), a.hold = b, a.bits = v; }; }, {}], 49: [function(t, n, i) { - var r = t("../utils/common"), o = t("./adler32"), a = t("./crc32"), l = t("./inffast"), c = t("./inftrees"), h = 1, u = 2, d = 0, f = -2, p = 1, g = 852, x = 592; + var r = t("../utils/common"), o = t("./adler32"), a = t("./crc32"), l = t("./inffast"), c = t("./inftrees"), h = 1, u = 2, d = 0, f = -2, g = 1, p = 852, x = 592; function m(C) { return (C >>> 24 & 255) + (C >>> 8 & 65280) + ((65280 & C) << 8) + ((255 & C) << 24); } @@ -33392,7 +33396,7 @@ function MM() { } function v(C) { var B; - return C && C.state ? (B = C.state, C.total_in = C.total_out = B.total = 0, C.msg = "", B.wrap && (C.adler = 1 & B.wrap), B.mode = p, B.last = 0, B.havedict = 0, B.dmax = 32768, B.head = null, B.hold = 0, B.bits = 0, B.lencode = B.lendyn = new r.Buf32(g), B.distcode = B.distdyn = new r.Buf32(x), B.sane = 1, B.back = -1, d) : f; + return C && C.state ? (B = C.state, C.total_in = C.total_out = B.total = 0, C.msg = "", B.wrap && (C.adler = 1 & B.wrap), B.mode = g, B.last = 0, B.havedict = 0, B.dmax = 32768, B.head = null, B.hold = 0, B.bits = 0, B.lencode = B.lendyn = new r.Buf32(p), B.distcode = B.distdyn = new r.Buf32(x), B.sane = 1, B.back = -1, d) : f; } function y(C) { var B; @@ -33426,18 +33430,18 @@ function MM() { i.inflateReset = y, i.inflateReset2 = M, i.inflateResetKeep = v, i.inflateInit = function(C) { return E(C, 15); }, i.inflateInit2 = E, i.inflate = function(C, B) { - var w, F, W, j, $, Z, re, X, Y, ge, pe, de, ie, he, fe, ve, we, Be, Ke, Ne, T, I, V, U, k = 0, z = new r.Buf8(4), ee = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + var w, F, W, j, $, q, re, X, Y, ge, pe, de, ie, he, fe, ve, we, Be, Ke, Ne, T, I, V, O, U = 0, z = new r.Buf8(4), ee = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!C || !C.state || !C.output || !C.input && C.avail_in !== 0) return f; - (w = C.state).mode === 12 && (w.mode = 13), $ = C.next_out, W = C.output, re = C.avail_out, j = C.next_in, F = C.input, Z = C.avail_in, X = w.hold, Y = w.bits, ge = Z, pe = re, I = d; + (w = C.state).mode === 12 && (w.mode = 13), $ = C.next_out, W = C.output, re = C.avail_out, j = C.next_in, F = C.input, q = C.avail_in, X = w.hold, Y = w.bits, ge = q, pe = re, I = d; e: for (; ; ) switch (w.mode) { - case p: + case g: if (w.wrap === 0) { w.mode = 13; break; } for (; Y < 16; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (2 & w.wrap && X === 35615) { z[w.check = 0] = 255 & X, z[1] = X >>> 8 & 255, w.check = a(w.check, z, 2, 0), Y = X = 0, w.mode = 2; @@ -33460,8 +33464,8 @@ function MM() { break; case 2: for (; Y < 16; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (w.flags = X, (255 & w.flags) != 8) { C.msg = "unknown compression method", w.mode = 30; @@ -33474,47 +33478,47 @@ function MM() { w.head && (w.head.text = X >> 8 & 1), 512 & w.flags && (z[0] = 255 & X, z[1] = X >>> 8 & 255, w.check = a(w.check, z, 2, 0)), Y = X = 0, w.mode = 3; case 3: for (; Y < 32; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } w.head && (w.head.time = X), 512 & w.flags && (z[0] = 255 & X, z[1] = X >>> 8 & 255, z[2] = X >>> 16 & 255, z[3] = X >>> 24 & 255, w.check = a(w.check, z, 4, 0)), Y = X = 0, w.mode = 4; case 4: for (; Y < 16; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } w.head && (w.head.xflags = 255 & X, w.head.os = X >> 8), 512 & w.flags && (z[0] = 255 & X, z[1] = X >>> 8 & 255, w.check = a(w.check, z, 2, 0)), Y = X = 0, w.mode = 5; case 5: if (1024 & w.flags) { for (; Y < 16; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } w.length = X, w.head && (w.head.extra_len = X), 512 & w.flags && (z[0] = 255 & X, z[1] = X >>> 8 & 255, w.check = a(w.check, z, 2, 0)), Y = X = 0; } else w.head && (w.head.extra = null); w.mode = 6; case 6: - if (1024 & w.flags && (Z < (de = w.length) && (de = Z), de && (w.head && (T = w.head.extra_len - w.length, w.head.extra || (w.head.extra = new Array(w.head.extra_len)), r.arraySet(w.head.extra, F, j, de, T)), 512 & w.flags && (w.check = a(w.check, F, de, j)), Z -= de, j += de, w.length -= de), w.length)) break e; + if (1024 & w.flags && (q < (de = w.length) && (de = q), de && (w.head && (T = w.head.extra_len - w.length, w.head.extra || (w.head.extra = new Array(w.head.extra_len)), r.arraySet(w.head.extra, F, j, de, T)), 512 & w.flags && (w.check = a(w.check, F, de, j)), q -= de, j += de, w.length -= de), w.length)) break e; w.length = 0, w.mode = 7; case 7: if (2048 & w.flags) { - if (Z === 0) break e; - for (de = 0; T = F[j + de++], w.head && T && w.length < 65536 && (w.head.name += String.fromCharCode(T)), T && de < Z; ) ; - if (512 & w.flags && (w.check = a(w.check, F, de, j)), Z -= de, j += de, T) break e; + if (q === 0) break e; + for (de = 0; T = F[j + de++], w.head && T && w.length < 65536 && (w.head.name += String.fromCharCode(T)), T && de < q; ) ; + if (512 & w.flags && (w.check = a(w.check, F, de, j)), q -= de, j += de, T) break e; } else w.head && (w.head.name = null); w.length = 0, w.mode = 8; case 8: if (4096 & w.flags) { - if (Z === 0) break e; - for (de = 0; T = F[j + de++], w.head && T && w.length < 65536 && (w.head.comment += String.fromCharCode(T)), T && de < Z; ) ; - if (512 & w.flags && (w.check = a(w.check, F, de, j)), Z -= de, j += de, T) break e; + if (q === 0) break e; + for (de = 0; T = F[j + de++], w.head && T && w.length < 65536 && (w.head.comment += String.fromCharCode(T)), T && de < q; ) ; + if (512 & w.flags && (w.check = a(w.check, F, de, j)), q -= de, j += de, T) break e; } else w.head && (w.head.comment = null); w.mode = 9; case 9: if (512 & w.flags) { for (; Y < 16; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (X !== (65535 & w.check)) { C.msg = "header crc mismatch", w.mode = 30; @@ -33526,12 +33530,12 @@ function MM() { break; case 10: for (; Y < 32; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } C.adler = w.check = m(X), Y = X = 0, w.mode = 11; case 11: - if (w.havedict === 0) return C.next_out = $, C.avail_out = re, C.next_in = j, C.avail_in = Z, w.hold = X, w.bits = Y, 2; + if (w.havedict === 0) return C.next_out = $, C.avail_out = re, C.next_in = j, C.avail_in = q, w.hold = X, w.bits = Y, 2; C.adler = w.check = 1, w.mode = 12; case 12: if (B === 5 || B === 6) break e; @@ -33541,8 +33545,8 @@ function MM() { break; } for (; Y < 3; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } switch (w.last = 1 & X, Y -= 1, 3 & (X >>>= 1)) { case 0: @@ -33562,8 +33566,8 @@ function MM() { break; case 14: for (X >>>= 7 & Y, Y -= 7 & Y; Y < 32; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if ((65535 & X) != (X >>> 16 ^ 65535)) { C.msg = "invalid stored block lengths", w.mode = 30; @@ -33574,16 +33578,16 @@ function MM() { w.mode = 16; case 16: if (de = w.length) { - if (Z < de && (de = Z), re < de && (de = re), de === 0) break e; - r.arraySet(W, F, j, de, $), Z -= de, j += de, re -= de, $ += de, w.length -= de; + if (q < de && (de = q), re < de && (de = re), de === 0) break e; + r.arraySet(W, F, j, de, $), q -= de, j += de, re -= de, $ += de, w.length -= de; break; } w.mode = 12; break; case 17: for (; Y < 14; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (w.nlen = 257 + (31 & X), X >>>= 5, Y -= 5, w.ndist = 1 + (31 & X), X >>>= 5, Y -= 5, w.ncode = 4 + (15 & X), X >>>= 4, Y -= 4, 286 < w.nlen || 30 < w.ndist) { C.msg = "too many length or distance symbols", w.mode = 30; @@ -33593,8 +33597,8 @@ function MM() { case 18: for (; w.have < w.ncode; ) { for (; Y < 3; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } w.lens[ee[w.have++]] = 7 & X, X >>>= 3, Y -= 3; } @@ -33606,16 +33610,16 @@ function MM() { w.have = 0, w.mode = 19; case 19: for (; w.have < w.nlen + w.ndist; ) { - for (; ve = (k = w.lencode[X & (1 << w.lenbits) - 1]) >>> 16 & 255, we = 65535 & k, !((fe = k >>> 24) <= Y); ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (; ve = (U = w.lencode[X & (1 << w.lenbits) - 1]) >>> 16 & 255, we = 65535 & U, !((fe = U >>> 24) <= Y); ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (we < 16) X >>>= fe, Y -= fe, w.lens[w.have++] = we; else { if (we === 16) { - for (U = fe + 2; Y < U; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (O = fe + 2; Y < O; ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (X >>>= fe, Y -= fe, w.have === 0) { C.msg = "invalid bit length repeat", w.mode = 30; @@ -33623,15 +33627,15 @@ function MM() { } T = w.lens[w.have - 1], de = 3 + (3 & X), X >>>= 2, Y -= 2; } else if (we === 17) { - for (U = fe + 3; Y < U; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (O = fe + 3; Y < O; ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } Y -= fe, T = 0, de = 3 + (7 & (X >>>= fe)), X >>>= 3, Y -= 3; } else { - for (U = fe + 7; Y < U; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (O = fe + 7; Y < O; ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } Y -= fe, T = 0, de = 11 + (127 & (X >>>= fe)), X >>>= 7, Y -= 7; } @@ -33659,18 +33663,18 @@ function MM() { case 20: w.mode = 21; case 21: - if (6 <= Z && 258 <= re) { - C.next_out = $, C.avail_out = re, C.next_in = j, C.avail_in = Z, w.hold = X, w.bits = Y, l(C, pe), $ = C.next_out, W = C.output, re = C.avail_out, j = C.next_in, F = C.input, Z = C.avail_in, X = w.hold, Y = w.bits, w.mode === 12 && (w.back = -1); + if (6 <= q && 258 <= re) { + C.next_out = $, C.avail_out = re, C.next_in = j, C.avail_in = q, w.hold = X, w.bits = Y, l(C, pe), $ = C.next_out, W = C.output, re = C.avail_out, j = C.next_in, F = C.input, q = C.avail_in, X = w.hold, Y = w.bits, w.mode === 12 && (w.back = -1); break; } - for (w.back = 0; ve = (k = w.lencode[X & (1 << w.lenbits) - 1]) >>> 16 & 255, we = 65535 & k, !((fe = k >>> 24) <= Y); ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (w.back = 0; ve = (U = w.lencode[X & (1 << w.lenbits) - 1]) >>> 16 & 255, we = 65535 & U, !((fe = U >>> 24) <= Y); ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (ve && (240 & ve) == 0) { - for (Be = fe, Ke = ve, Ne = we; ve = (k = w.lencode[Ne + ((X & (1 << Be + Ke) - 1) >> Be)]) >>> 16 & 255, we = 65535 & k, !(Be + (fe = k >>> 24) <= Y); ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (Be = fe, Ke = ve, Ne = we; ve = (U = w.lencode[Ne + ((X & (1 << Be + Ke) - 1) >> Be)]) >>> 16 & 255, we = 65535 & U, !(Be + (fe = U >>> 24) <= Y); ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } X >>>= Be, Y -= Be, w.back += Be; } @@ -33689,22 +33693,22 @@ function MM() { w.extra = 15 & ve, w.mode = 22; case 22: if (w.extra) { - for (U = w.extra; Y < U; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (O = w.extra; Y < O; ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } w.length += X & (1 << w.extra) - 1, X >>>= w.extra, Y -= w.extra, w.back += w.extra; } w.was = w.length, w.mode = 23; case 23: - for (; ve = (k = w.distcode[X & (1 << w.distbits) - 1]) >>> 16 & 255, we = 65535 & k, !((fe = k >>> 24) <= Y); ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (; ve = (U = w.distcode[X & (1 << w.distbits) - 1]) >>> 16 & 255, we = 65535 & U, !((fe = U >>> 24) <= Y); ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if ((240 & ve) == 0) { - for (Be = fe, Ke = ve, Ne = we; ve = (k = w.distcode[Ne + ((X & (1 << Be + Ke) - 1) >> Be)]) >>> 16 & 255, we = 65535 & k, !(Be + (fe = k >>> 24) <= Y); ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (Be = fe, Ke = ve, Ne = we; ve = (U = w.distcode[Ne + ((X & (1 << Be + Ke) - 1) >> Be)]) >>> 16 & 255, we = 65535 & U, !(Be + (fe = U >>> 24) <= Y); ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } X >>>= Be, Y -= Be, w.back += Be; } @@ -33715,9 +33719,9 @@ function MM() { w.offset = we, w.extra = 15 & ve, w.mode = 24; case 24: if (w.extra) { - for (U = w.extra; Y < U; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + for (O = w.extra; Y < O; ) { + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } w.offset += X & (1 << w.extra) - 1, X >>>= w.extra, Y -= w.extra, w.back += w.extra; } @@ -33745,8 +33749,8 @@ function MM() { case 27: if (w.wrap) { for (; Y < 32; ) { - if (Z === 0) break e; - Z--, X |= F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X |= F[j++] << Y, Y += 8; } if (pe -= re, C.total_out += pe, w.total += pe, pe && (C.adler = w.check = w.flags ? a(w.check, W, pe, $ - pe) : o(w.check, W, pe, $ - pe)), pe = re, (w.flags ? X : m(X)) !== w.check) { C.msg = "incorrect data check", w.mode = 30; @@ -33758,8 +33762,8 @@ function MM() { case 28: if (w.wrap && w.flags) { for (; Y < 32; ) { - if (Z === 0) break e; - Z--, X += F[j++] << Y, Y += 8; + if (q === 0) break e; + q--, X += F[j++] << Y, Y += 8; } if (X !== (4294967295 & w.total)) { C.msg = "incorrect length check", w.mode = 30; @@ -33780,7 +33784,7 @@ function MM() { default: return f; } - return C.next_out = $, C.avail_out = re, C.next_in = j, C.avail_in = Z, w.hold = X, w.bits = Y, (w.wsize || pe !== C.avail_out && w.mode < 30 && (w.mode < 27 || B !== 4)) && D(C, C.output, C.next_out, pe - C.avail_out) ? (w.mode = 31, -4) : (ge -= C.avail_in, pe -= C.avail_out, C.total_in += ge, C.total_out += pe, w.total += pe, w.wrap && pe && (C.adler = w.check = w.flags ? a(w.check, W, pe, C.next_out - pe) : o(w.check, W, pe, C.next_out - pe)), C.data_type = w.bits + (w.last ? 64 : 0) + (w.mode === 12 ? 128 : 0) + (w.mode === 20 || w.mode === 15 ? 256 : 0), (ge == 0 && pe === 0 || B === 4) && I === d && (I = -5), I); + return C.next_out = $, C.avail_out = re, C.next_in = j, C.avail_in = q, w.hold = X, w.bits = Y, (w.wsize || pe !== C.avail_out && w.mode < 30 && (w.mode < 27 || B !== 4)) && D(C, C.output, C.next_out, pe - C.avail_out) ? (w.mode = 31, -4) : (ge -= C.avail_in, pe -= C.avail_out, C.total_in += ge, C.total_out += pe, w.total += pe, w.wrap && pe && (C.adler = w.check = w.flags ? a(w.check, W, pe, C.next_out - pe) : o(w.check, W, pe, C.next_out - pe)), C.data_type = w.bits + (w.last ? 64 : 0) + (w.mode === 12 ? 128 : 0) + (w.mode === 20 || w.mode === 15 ? 256 : 0), (ge == 0 && pe === 0 || B === 4) && I === d && (I = -5), I); }, i.inflateEnd = function(C) { if (!C || !C.state) return f; var B = C.state; @@ -33794,41 +33798,41 @@ function MM() { }, i.inflateInfo = "pako inflate (from Nodeca project)"; }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(t, n, i) { var r = t("../utils/common"), o = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], a = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], l = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], c = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; - n.exports = function(h, u, d, f, p, g, x, m) { - var b, v, y, M, E, A, R, _, S, D = m.bits, C = 0, B = 0, w = 0, F = 0, W = 0, j = 0, $ = 0, Z = 0, re = 0, X = 0, Y = null, ge = 0, pe = new r.Buf16(16), de = new r.Buf16(16), ie = null, he = 0; + n.exports = function(h, u, d, f, g, p, x, m) { + var b, v, y, M, E, A, R, _, S, D = m.bits, C = 0, B = 0, w = 0, F = 0, W = 0, j = 0, $ = 0, q = 0, re = 0, X = 0, Y = null, ge = 0, pe = new r.Buf16(16), de = new r.Buf16(16), ie = null, he = 0; for (C = 0; C <= 15; C++) pe[C] = 0; for (B = 0; B < f; B++) pe[u[d + B]]++; for (W = D, F = 15; 1 <= F && pe[F] === 0; F--) ; - if (F < W && (W = F), F === 0) return p[g++] = 20971520, p[g++] = 20971520, m.bits = 1, 0; + if (F < W && (W = F), F === 0) return g[p++] = 20971520, g[p++] = 20971520, m.bits = 1, 0; for (w = 1; w < F && pe[w] === 0; w++) ; - for (W < w && (W = w), C = Z = 1; C <= 15; C++) if (Z <<= 1, (Z -= pe[C]) < 0) return -1; - if (0 < Z && (h === 0 || F !== 1)) return -1; + for (W < w && (W = w), C = q = 1; C <= 15; C++) if (q <<= 1, (q -= pe[C]) < 0) return -1; + if (0 < q && (h === 0 || F !== 1)) return -1; for (de[1] = 0, C = 1; C < 15; C++) de[C + 1] = de[C] + pe[C]; for (B = 0; B < f; B++) u[d + B] !== 0 && (x[de[u[d + B]]++] = B); - if (A = h === 0 ? (Y = ie = x, 19) : h === 1 ? (Y = o, ge -= 257, ie = a, he -= 257, 256) : (Y = l, ie = c, -1), C = w, E = g, $ = B = X = 0, y = -1, M = (re = 1 << (j = W)) - 1, h === 1 && 852 < re || h === 2 && 592 < re) return 1; + if (A = h === 0 ? (Y = ie = x, 19) : h === 1 ? (Y = o, ge -= 257, ie = a, he -= 257, 256) : (Y = l, ie = c, -1), C = w, E = p, $ = B = X = 0, y = -1, M = (re = 1 << (j = W)) - 1, h === 1 && 852 < re || h === 2 && 592 < re) return 1; for (; ; ) { - for (R = C - $, S = x[B] < A ? (_ = 0, x[B]) : x[B] > A ? (_ = ie[he + x[B]], Y[ge + x[B]]) : (_ = 96, 0), b = 1 << C - $, w = v = 1 << j; p[E + (X >> $) + (v -= b)] = R << 24 | _ << 16 | S | 0, v !== 0; ) ; + for (R = C - $, S = x[B] < A ? (_ = 0, x[B]) : x[B] > A ? (_ = ie[he + x[B]], Y[ge + x[B]]) : (_ = 96, 0), b = 1 << C - $, w = v = 1 << j; g[E + (X >> $) + (v -= b)] = R << 24 | _ << 16 | S | 0, v !== 0; ) ; for (b = 1 << C - 1; X & b; ) b >>= 1; if (b !== 0 ? (X &= b - 1, X += b) : X = 0, B++, --pe[C] == 0) { if (C === F) break; C = u[d + x[B]]; } if (W < C && (X & M) !== y) { - for ($ === 0 && ($ = W), E += w, Z = 1 << (j = C - $); j + $ < F && !((Z -= pe[j + $]) <= 0); ) j++, Z <<= 1; + for ($ === 0 && ($ = W), E += w, q = 1 << (j = C - $); j + $ < F && !((q -= pe[j + $]) <= 0); ) j++, q <<= 1; if (re += 1 << j, h === 1 && 852 < re || h === 2 && 592 < re) return 1; - p[y = X & M] = W << 24 | j << 16 | E - g | 0; + g[y = X & M] = W << 24 | j << 16 | E - p | 0; } } - return X !== 0 && (p[E + X] = C - $ << 24 | 64 << 16 | 0), m.bits = W, 0; + return X !== 0 && (g[E + X] = C - $ << 24 | 64 << 16 | 0), m.bits = W, 0; }; }, { "../utils/common": 41 }], 51: [function(t, n, i) { n.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }; }, {}], 52: [function(t, n, i) { var r = t("../utils/common"), o = 0, a = 1; - function l(k) { - for (var z = k.length; 0 <= --z; ) k[z] = 0; + function l(U) { + for (var z = U.length; 0 <= --z; ) U[z] = 0; } - var c = 0, h = 29, u = 256, d = u + 1 + h, f = 30, p = 19, g = 2 * d + 1, x = 15, m = 16, b = 7, v = 256, y = 16, M = 17, E = 18, A = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], R = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], _ = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], D = new Array(2 * (d + 2)); + var c = 0, h = 29, u = 256, d = u + 1 + h, f = 30, g = 19, p = 2 * d + 1, x = 15, m = 16, b = 7, v = 256, y = 16, M = 17, E = 18, A = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], R = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], _ = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], D = new Array(2 * (d + 2)); l(D); var C = new Array(2 * f); l(C); @@ -33838,135 +33842,135 @@ function MM() { l(w); var F = new Array(h); l(F); - var W, j, $, Z = new Array(f); - function re(k, z, ee, J, G) { - this.static_tree = k, this.extra_bits = z, this.extra_base = ee, this.elems = J, this.max_length = G, this.has_stree = k && k.length; + var W, j, $, q = new Array(f); + function re(U, z, ee, J, G) { + this.static_tree = U, this.extra_bits = z, this.extra_base = ee, this.elems = J, this.max_length = G, this.has_stree = U && U.length; } - function X(k, z) { - this.dyn_tree = k, this.max_code = 0, this.stat_desc = z; + function X(U, z) { + this.dyn_tree = U, this.max_code = 0, this.stat_desc = z; } - function Y(k) { - return k < 256 ? B[k] : B[256 + (k >>> 7)]; + function Y(U) { + return U < 256 ? B[U] : B[256 + (U >>> 7)]; } - function ge(k, z) { - k.pending_buf[k.pending++] = 255 & z, k.pending_buf[k.pending++] = z >>> 8 & 255; + function ge(U, z) { + U.pending_buf[U.pending++] = 255 & z, U.pending_buf[U.pending++] = z >>> 8 & 255; } - function pe(k, z, ee) { - k.bi_valid > m - ee ? (k.bi_buf |= z << k.bi_valid & 65535, ge(k, k.bi_buf), k.bi_buf = z >> m - k.bi_valid, k.bi_valid += ee - m) : (k.bi_buf |= z << k.bi_valid & 65535, k.bi_valid += ee); + function pe(U, z, ee) { + U.bi_valid > m - ee ? (U.bi_buf |= z << U.bi_valid & 65535, ge(U, U.bi_buf), U.bi_buf = z >> m - U.bi_valid, U.bi_valid += ee - m) : (U.bi_buf |= z << U.bi_valid & 65535, U.bi_valid += ee); } - function de(k, z, ee) { - pe(k, ee[2 * z], ee[2 * z + 1]); + function de(U, z, ee) { + pe(U, ee[2 * z], ee[2 * z + 1]); } - function ie(k, z) { - for (var ee = 0; ee |= 1 & k, k >>>= 1, ee <<= 1, 0 < --z; ) ; + function ie(U, z) { + for (var ee = 0; ee |= 1 & U, U >>>= 1, ee <<= 1, 0 < --z; ) ; return ee >>> 1; } - function he(k, z, ee) { + function he(U, z, ee) { var J, G, N = new Array(x + 1), L = 0; for (J = 1; J <= x; J++) N[J] = L = L + ee[J - 1] << 1; for (G = 0; G <= z; G++) { - var H = k[2 * G + 1]; - H !== 0 && (k[2 * G] = ie(N[H]++, H)); + var H = U[2 * G + 1]; + H !== 0 && (U[2 * G] = ie(N[H]++, H)); } } - function fe(k) { + function fe(U) { var z; - for (z = 0; z < d; z++) k.dyn_ltree[2 * z] = 0; - for (z = 0; z < f; z++) k.dyn_dtree[2 * z] = 0; - for (z = 0; z < p; z++) k.bl_tree[2 * z] = 0; - k.dyn_ltree[2 * v] = 1, k.opt_len = k.static_len = 0, k.last_lit = k.matches = 0; + for (z = 0; z < d; z++) U.dyn_ltree[2 * z] = 0; + for (z = 0; z < f; z++) U.dyn_dtree[2 * z] = 0; + for (z = 0; z < g; z++) U.bl_tree[2 * z] = 0; + U.dyn_ltree[2 * v] = 1, U.opt_len = U.static_len = 0, U.last_lit = U.matches = 0; } - function ve(k) { - 8 < k.bi_valid ? ge(k, k.bi_buf) : 0 < k.bi_valid && (k.pending_buf[k.pending++] = k.bi_buf), k.bi_buf = 0, k.bi_valid = 0; + function ve(U) { + 8 < U.bi_valid ? ge(U, U.bi_buf) : 0 < U.bi_valid && (U.pending_buf[U.pending++] = U.bi_buf), U.bi_buf = 0, U.bi_valid = 0; } - function we(k, z, ee, J) { + function we(U, z, ee, J) { var G = 2 * z, N = 2 * ee; - return k[G] < k[N] || k[G] === k[N] && J[z] <= J[ee]; + return U[G] < U[N] || U[G] === U[N] && J[z] <= J[ee]; } - function Be(k, z, ee) { - for (var J = k.heap[ee], G = ee << 1; G <= k.heap_len && (G < k.heap_len && we(z, k.heap[G + 1], k.heap[G], k.depth) && G++, !we(z, J, k.heap[G], k.depth)); ) k.heap[ee] = k.heap[G], ee = G, G <<= 1; - k.heap[ee] = J; + function Be(U, z, ee) { + for (var J = U.heap[ee], G = ee << 1; G <= U.heap_len && (G < U.heap_len && we(z, U.heap[G + 1], U.heap[G], U.depth) && G++, !we(z, J, U.heap[G], U.depth)); ) U.heap[ee] = U.heap[G], ee = G, G <<= 1; + U.heap[ee] = J; } - function Ke(k, z, ee) { + function Ke(U, z, ee) { var J, G, N, L, H = 0; - if (k.last_lit !== 0) for (; J = k.pending_buf[k.d_buf + 2 * H] << 8 | k.pending_buf[k.d_buf + 2 * H + 1], G = k.pending_buf[k.l_buf + H], H++, J === 0 ? de(k, G, z) : (de(k, (N = w[G]) + u + 1, z), (L = A[N]) !== 0 && pe(k, G -= F[N], L), de(k, N = Y(--J), ee), (L = R[N]) !== 0 && pe(k, J -= Z[N], L)), H < k.last_lit; ) ; - de(k, v, z); + if (U.last_lit !== 0) for (; J = U.pending_buf[U.d_buf + 2 * H] << 8 | U.pending_buf[U.d_buf + 2 * H + 1], G = U.pending_buf[U.l_buf + H], H++, J === 0 ? de(U, G, z) : (de(U, (N = w[G]) + u + 1, z), (L = A[N]) !== 0 && pe(U, G -= F[N], L), de(U, N = Y(--J), ee), (L = R[N]) !== 0 && pe(U, J -= q[N], L)), H < U.last_lit; ) ; + de(U, v, z); } - function Ne(k, z) { + function Ne(U, z) { var ee, J, G, N = z.dyn_tree, L = z.stat_desc.static_tree, H = z.stat_desc.has_stree, K = z.stat_desc.elems, le = -1; - for (k.heap_len = 0, k.heap_max = g, ee = 0; ee < K; ee++) N[2 * ee] !== 0 ? (k.heap[++k.heap_len] = le = ee, k.depth[ee] = 0) : N[2 * ee + 1] = 0; - for (; k.heap_len < 2; ) N[2 * (G = k.heap[++k.heap_len] = le < 2 ? ++le : 0)] = 1, k.depth[G] = 0, k.opt_len--, H && (k.static_len -= L[2 * G + 1]); - for (z.max_code = le, ee = k.heap_len >> 1; 1 <= ee; ee--) Be(k, N, ee); - for (G = K; ee = k.heap[1], k.heap[1] = k.heap[k.heap_len--], Be(k, N, 1), J = k.heap[1], k.heap[--k.heap_max] = ee, k.heap[--k.heap_max] = J, N[2 * G] = N[2 * ee] + N[2 * J], k.depth[G] = (k.depth[ee] >= k.depth[J] ? k.depth[ee] : k.depth[J]) + 1, N[2 * ee + 1] = N[2 * J + 1] = G, k.heap[1] = G++, Be(k, N, 1), 2 <= k.heap_len; ) ; - k.heap[--k.heap_max] = k.heap[1], (function(te, Te) { - var be, Re, De, ue, ye, Ve, ke = Te.dyn_tree, Ae = Te.max_code, Ge = Te.stat_desc.static_tree, q = Te.stat_desc.has_stree, Ee = Te.stat_desc.extra_bits, _e = Te.stat_desc.extra_base, Me = Te.stat_desc.max_length, xe = 0; + for (U.heap_len = 0, U.heap_max = p, ee = 0; ee < K; ee++) N[2 * ee] !== 0 ? (U.heap[++U.heap_len] = le = ee, U.depth[ee] = 0) : N[2 * ee + 1] = 0; + for (; U.heap_len < 2; ) N[2 * (G = U.heap[++U.heap_len] = le < 2 ? ++le : 0)] = 1, U.depth[G] = 0, U.opt_len--, H && (U.static_len -= L[2 * G + 1]); + for (z.max_code = le, ee = U.heap_len >> 1; 1 <= ee; ee--) Be(U, N, ee); + for (G = K; ee = U.heap[1], U.heap[1] = U.heap[U.heap_len--], Be(U, N, 1), J = U.heap[1], U.heap[--U.heap_max] = ee, U.heap[--U.heap_max] = J, N[2 * G] = N[2 * ee] + N[2 * J], U.depth[G] = (U.depth[ee] >= U.depth[J] ? U.depth[ee] : U.depth[J]) + 1, N[2 * ee + 1] = N[2 * J + 1] = G, U.heap[1] = G++, Be(U, N, 1), 2 <= U.heap_len; ) ; + U.heap[--U.heap_max] = U.heap[1], (function(te, Te) { + var be, Re, De, ue, ye, Ve, Ue = Te.dyn_tree, Ae = Te.max_code, Ge = Te.stat_desc.static_tree, Z = Te.stat_desc.has_stree, Ee = Te.stat_desc.extra_bits, _e = Te.stat_desc.extra_base, Me = Te.stat_desc.max_length, xe = 0; for (ue = 0; ue <= x; ue++) te.bl_count[ue] = 0; - for (ke[2 * te.heap[te.heap_max] + 1] = 0, be = te.heap_max + 1; be < g; be++) Me < (ue = ke[2 * ke[2 * (Re = te.heap[be]) + 1] + 1] + 1) && (ue = Me, xe++), ke[2 * Re + 1] = ue, Ae < Re || (te.bl_count[ue]++, ye = 0, _e <= Re && (ye = Ee[Re - _e]), Ve = ke[2 * Re], te.opt_len += Ve * (ue + ye), q && (te.static_len += Ve * (Ge[2 * Re + 1] + ye))); + for (Ue[2 * te.heap[te.heap_max] + 1] = 0, be = te.heap_max + 1; be < p; be++) Me < (ue = Ue[2 * Ue[2 * (Re = te.heap[be]) + 1] + 1] + 1) && (ue = Me, xe++), Ue[2 * Re + 1] = ue, Ae < Re || (te.bl_count[ue]++, ye = 0, _e <= Re && (ye = Ee[Re - _e]), Ve = Ue[2 * Re], te.opt_len += Ve * (ue + ye), Z && (te.static_len += Ve * (Ge[2 * Re + 1] + ye))); if (xe !== 0) { do { for (ue = Me - 1; te.bl_count[ue] === 0; ) ue--; te.bl_count[ue]--, te.bl_count[ue + 1] += 2, te.bl_count[Me]--, xe -= 2; } while (0 < xe); - for (ue = Me; ue !== 0; ue--) for (Re = te.bl_count[ue]; Re !== 0; ) Ae < (De = te.heap[--be]) || (ke[2 * De + 1] !== ue && (te.opt_len += (ue - ke[2 * De + 1]) * ke[2 * De], ke[2 * De + 1] = ue), Re--); + for (ue = Me; ue !== 0; ue--) for (Re = te.bl_count[ue]; Re !== 0; ) Ae < (De = te.heap[--be]) || (Ue[2 * De + 1] !== ue && (te.opt_len += (ue - Ue[2 * De + 1]) * Ue[2 * De], Ue[2 * De + 1] = ue), Re--); } - })(k, z), he(N, le, k.bl_count); + })(U, z), he(N, le, U.bl_count); } - function T(k, z, ee) { + function T(U, z, ee) { var J, G, N = -1, L = z[1], H = 0, K = 7, le = 4; - for (L === 0 && (K = 138, le = 3), z[2 * (ee + 1) + 1] = 65535, J = 0; J <= ee; J++) G = L, L = z[2 * (J + 1) + 1], ++H < K && G === L || (H < le ? k.bl_tree[2 * G] += H : G !== 0 ? (G !== N && k.bl_tree[2 * G]++, k.bl_tree[2 * y]++) : H <= 10 ? k.bl_tree[2 * M]++ : k.bl_tree[2 * E]++, N = G, le = (H = 0) === L ? (K = 138, 3) : G === L ? (K = 6, 3) : (K = 7, 4)); + for (L === 0 && (K = 138, le = 3), z[2 * (ee + 1) + 1] = 65535, J = 0; J <= ee; J++) G = L, L = z[2 * (J + 1) + 1], ++H < K && G === L || (H < le ? U.bl_tree[2 * G] += H : G !== 0 ? (G !== N && U.bl_tree[2 * G]++, U.bl_tree[2 * y]++) : H <= 10 ? U.bl_tree[2 * M]++ : U.bl_tree[2 * E]++, N = G, le = (H = 0) === L ? (K = 138, 3) : G === L ? (K = 6, 3) : (K = 7, 4)); } - function I(k, z, ee) { + function I(U, z, ee) { var J, G, N = -1, L = z[1], H = 0, K = 7, le = 4; for (L === 0 && (K = 138, le = 3), J = 0; J <= ee; J++) if (G = L, L = z[2 * (J + 1) + 1], !(++H < K && G === L)) { - if (H < le) for (; de(k, G, k.bl_tree), --H != 0; ) ; - else G !== 0 ? (G !== N && (de(k, G, k.bl_tree), H--), de(k, y, k.bl_tree), pe(k, H - 3, 2)) : H <= 10 ? (de(k, M, k.bl_tree), pe(k, H - 3, 3)) : (de(k, E, k.bl_tree), pe(k, H - 11, 7)); + if (H < le) for (; de(U, G, U.bl_tree), --H != 0; ) ; + else G !== 0 ? (G !== N && (de(U, G, U.bl_tree), H--), de(U, y, U.bl_tree), pe(U, H - 3, 2)) : H <= 10 ? (de(U, M, U.bl_tree), pe(U, H - 3, 3)) : (de(U, E, U.bl_tree), pe(U, H - 11, 7)); N = G, le = (H = 0) === L ? (K = 138, 3) : G === L ? (K = 6, 3) : (K = 7, 4); } } - l(Z); + l(q); var V = !1; - function U(k, z, ee, J) { - pe(k, (c << 1) + (J ? 1 : 0), 3), (function(G, N, L, H) { + function O(U, z, ee, J) { + pe(U, (c << 1) + (J ? 1 : 0), 3), (function(G, N, L, H) { ve(G), ge(G, L), ge(G, ~L), r.arraySet(G.pending_buf, G.window, N, L, G.pending), G.pending += L; - })(k, z, ee); + })(U, z, ee); } - i._tr_init = function(k) { + i._tr_init = function(U) { V || ((function() { var z, ee, J, G, N, L = new Array(x + 1); for (G = J = 0; G < h - 1; G++) for (F[G] = J, z = 0; z < 1 << A[G]; z++) w[J++] = G; - for (w[J - 1] = G, G = N = 0; G < 16; G++) for (Z[G] = N, z = 0; z < 1 << R[G]; z++) B[N++] = G; - for (N >>= 7; G < f; G++) for (Z[G] = N << 7, z = 0; z < 1 << R[G] - 7; z++) B[256 + N++] = G; + for (w[J - 1] = G, G = N = 0; G < 16; G++) for (q[G] = N, z = 0; z < 1 << R[G]; z++) B[N++] = G; + for (N >>= 7; G < f; G++) for (q[G] = N << 7, z = 0; z < 1 << R[G] - 7; z++) B[256 + N++] = G; for (ee = 0; ee <= x; ee++) L[ee] = 0; for (z = 0; z <= 143; ) D[2 * z + 1] = 8, z++, L[8]++; for (; z <= 255; ) D[2 * z + 1] = 9, z++, L[9]++; for (; z <= 279; ) D[2 * z + 1] = 7, z++, L[7]++; for (; z <= 287; ) D[2 * z + 1] = 8, z++, L[8]++; for (he(D, d + 1, L), z = 0; z < f; z++) C[2 * z + 1] = 5, C[2 * z] = ie(z, 5); - W = new re(D, A, u + 1, d, x), j = new re(C, R, 0, f, x), $ = new re(new Array(0), _, 0, p, b); - })(), V = !0), k.l_desc = new X(k.dyn_ltree, W), k.d_desc = new X(k.dyn_dtree, j), k.bl_desc = new X(k.bl_tree, $), k.bi_buf = 0, k.bi_valid = 0, fe(k); - }, i._tr_stored_block = U, i._tr_flush_block = function(k, z, ee, J) { + W = new re(D, A, u + 1, d, x), j = new re(C, R, 0, f, x), $ = new re(new Array(0), _, 0, g, b); + })(), V = !0), U.l_desc = new X(U.dyn_ltree, W), U.d_desc = new X(U.dyn_dtree, j), U.bl_desc = new X(U.bl_tree, $), U.bi_buf = 0, U.bi_valid = 0, fe(U); + }, i._tr_stored_block = O, i._tr_flush_block = function(U, z, ee, J) { var G, N, L = 0; - 0 < k.level ? (k.strm.data_type === 2 && (k.strm.data_type = (function(H) { + 0 < U.level ? (U.strm.data_type === 2 && (U.strm.data_type = (function(H) { var K, le = 4093624447; for (K = 0; K <= 31; K++, le >>>= 1) if (1 & le && H.dyn_ltree[2 * K] !== 0) return o; if (H.dyn_ltree[18] !== 0 || H.dyn_ltree[20] !== 0 || H.dyn_ltree[26] !== 0) return a; for (K = 32; K < u; K++) if (H.dyn_ltree[2 * K] !== 0) return a; return o; - })(k)), Ne(k, k.l_desc), Ne(k, k.d_desc), L = (function(H) { + })(U)), Ne(U, U.l_desc), Ne(U, U.d_desc), L = (function(H) { var K; - for (T(H, H.dyn_ltree, H.l_desc.max_code), T(H, H.dyn_dtree, H.d_desc.max_code), Ne(H, H.bl_desc), K = p - 1; 3 <= K && H.bl_tree[2 * S[K] + 1] === 0; K--) ; + for (T(H, H.dyn_ltree, H.l_desc.max_code), T(H, H.dyn_dtree, H.d_desc.max_code), Ne(H, H.bl_desc), K = g - 1; 3 <= K && H.bl_tree[2 * S[K] + 1] === 0; K--) ; return H.opt_len += 3 * (K + 1) + 5 + 5 + 4, K; - })(k), G = k.opt_len + 3 + 7 >>> 3, (N = k.static_len + 3 + 7 >>> 3) <= G && (G = N)) : G = N = ee + 5, ee + 4 <= G && z !== -1 ? U(k, z, ee, J) : k.strategy === 4 || N === G ? (pe(k, 2 + (J ? 1 : 0), 3), Ke(k, D, C)) : (pe(k, 4 + (J ? 1 : 0), 3), (function(H, K, le, te) { + })(U), G = U.opt_len + 3 + 7 >>> 3, (N = U.static_len + 3 + 7 >>> 3) <= G && (G = N)) : G = N = ee + 5, ee + 4 <= G && z !== -1 ? O(U, z, ee, J) : U.strategy === 4 || N === G ? (pe(U, 2 + (J ? 1 : 0), 3), Ke(U, D, C)) : (pe(U, 4 + (J ? 1 : 0), 3), (function(H, K, le, te) { var Te; for (pe(H, K - 257, 5), pe(H, le - 1, 5), pe(H, te - 4, 4), Te = 0; Te < te; Te++) pe(H, H.bl_tree[2 * S[Te] + 1], 3); I(H, H.dyn_ltree, K - 1), I(H, H.dyn_dtree, le - 1); - })(k, k.l_desc.max_code + 1, k.d_desc.max_code + 1, L + 1), Ke(k, k.dyn_ltree, k.dyn_dtree)), fe(k), J && ve(k); - }, i._tr_tally = function(k, z, ee) { - return k.pending_buf[k.d_buf + 2 * k.last_lit] = z >>> 8 & 255, k.pending_buf[k.d_buf + 2 * k.last_lit + 1] = 255 & z, k.pending_buf[k.l_buf + k.last_lit] = 255 & ee, k.last_lit++, z === 0 ? k.dyn_ltree[2 * ee]++ : (k.matches++, z--, k.dyn_ltree[2 * (w[ee] + u + 1)]++, k.dyn_dtree[2 * Y(z)]++), k.last_lit === k.lit_bufsize - 1; - }, i._tr_align = function(k) { - pe(k, 2, 3), de(k, v, D), (function(z) { + })(U, U.l_desc.max_code + 1, U.d_desc.max_code + 1, L + 1), Ke(U, U.dyn_ltree, U.dyn_dtree)), fe(U), J && ve(U); + }, i._tr_tally = function(U, z, ee) { + return U.pending_buf[U.d_buf + 2 * U.last_lit] = z >>> 8 & 255, U.pending_buf[U.d_buf + 2 * U.last_lit + 1] = 255 & z, U.pending_buf[U.l_buf + U.last_lit] = 255 & ee, U.last_lit++, z === 0 ? U.dyn_ltree[2 * ee]++ : (U.matches++, z--, U.dyn_ltree[2 * (w[ee] + u + 1)]++, U.dyn_dtree[2 * Y(z)]++), U.last_lit === U.lit_bufsize - 1; + }, i._tr_align = function(U) { + pe(U, 2, 3), de(U, v, D), (function(z) { z.bi_valid === 16 ? (ge(z, z.bi_buf), z.bi_buf = 0, z.bi_valid = 0) : 8 <= z.bi_valid && (z.pending_buf[z.pending++] = 255 & z.bi_buf, z.bi_buf >>= 8, z.bi_valid -= 8); - })(k); + })(U); }; }, { "../utils/common": 41 }], 53: [function(t, n, i) { n.exports = function() { @@ -33976,7 +33980,7 @@ function MM() { (function(r) { (function(o, a) { if (!o.setImmediate) { - var l, c, h, u, d = 1, f = {}, p = !1, g = o.document, x = Object.getPrototypeOf && Object.getPrototypeOf(o); + var l, c, h, u, d = 1, f = {}, g = !1, p = o.document, x = Object.getPrototypeOf && Object.getPrototypeOf(o); x = x && x.setTimeout ? x : o, l = {}.toString.call(o.process) === "[object process]" ? function(y) { process.nextTick(function() { b(y); @@ -33994,8 +33998,8 @@ function MM() { b(y.data); }, function(y) { h.port2.postMessage(y); - }) : g && "onreadystatechange" in g.createElement("script") ? (c = g.documentElement, function(y) { - var M = g.createElement("script"); + }) : p && "onreadystatechange" in p.createElement("script") ? (c = p.documentElement, function(y) { + var M = p.createElement("script"); M.onreadystatechange = function() { b(y), M.onreadystatechange = null, c.removeChild(M), M = null; }, c.appendChild(M); @@ -34012,11 +34016,11 @@ function MM() { delete f[y]; } function b(y) { - if (p) setTimeout(b, 0, y); + if (g) setTimeout(b, 0, y); else { var M = f[y]; if (M) { - p = !0; + g = !0; try { (function(E) { var A = E.callback, R = E.args; @@ -34038,7 +34042,7 @@ function MM() { } })(M); } finally { - m(y), p = !1; + m(y), g = !1; } } } @@ -34050,7 +34054,7 @@ function MM() { }).call(this, typeof Ca < "u" ? Ca : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}] }, {}, [10])(10); }); - })(Hf)), Hf.exports; + })(zf)), zf.exports; } var wM = MM(); const n0 = /* @__PURE__ */ t0(wM); @@ -34059,25 +34063,25 @@ function i0(s, e) { return s.apply(e, arguments); }; } -const { toString: SM } = Object.prototype, { getPrototypeOf: Xu } = Object, { iterator: Dl, toStringTag: s0 } = Symbol, Il = /* @__PURE__ */ ((s) => (e) => { +const { toString: SM } = Object.prototype, { getPrototypeOf: Wu } = Object, { iterator: Dl, toStringTag: s0 } = Symbol, Il = /* @__PURE__ */ ((s) => (e) => { const t = SM.call(e); return s[t] || (s[t] = t.slice(8, -1).toLowerCase()); -})(/* @__PURE__ */ Object.create(null)), ti = (s) => (s = s.toLowerCase(), (e) => Il(e) === s), Bl = (s) => (e) => typeof e === s, { isArray: kr } = Array, Lr = Bl("undefined"); -function Oo(s) { - return s !== null && !Lr(s) && s.constructor !== null && !Lr(s.constructor) && _n(s.constructor.isBuffer) && s.constructor.isBuffer(s); +})(/* @__PURE__ */ Object.create(null)), ti = (s) => (s = s.toLowerCase(), (e) => Il(e) === s), Bl = (s) => (e) => typeof e === s, { isArray: Or } = Array, Dr = Bl("undefined"); +function ko(s) { + return s !== null && !Dr(s) && s.constructor !== null && !Dr(s.constructor) && _n(s.constructor.isBuffer) && s.constructor.isBuffer(s); } const r0 = ti("ArrayBuffer"); function EM(s) { let e; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(s) : e = s && s.buffer && r0(s.buffer), e; } -const TM = Bl("string"), _n = Bl("function"), o0 = Bl("number"), Fo = (s) => s !== null && typeof s == "object", AM = (s) => s === !0 || s === !1, al = (s) => { +const TM = Bl("string"), _n = Bl("function"), o0 = Bl("number"), Fo = (s) => s !== null && typeof s == "object", AM = (s) => s === !0 || s === !1, ol = (s) => { if (Il(s) !== "object") return !1; - const e = Xu(s); + const e = Wu(s); return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(s0 in s) && !(Dl in s); }, CM = (s) => { - if (!Fo(s) || Oo(s)) + if (!Fo(s) || ko(s)) return !1; try { return Object.keys(s).length === 0 && Object.getPrototypeOf(s) === Object.prototype; @@ -34088,16 +34092,16 @@ const TM = Bl("string"), _n = Bl("function"), o0 = Bl("number"), Fo = (s) => s ! let e; return s && (typeof FormData == "function" && s instanceof FormData || _n(s.append) && ((e = Il(s)) === "formdata" || // detect form-data instance e === "object" && _n(s.toString) && s.toString() === "[object FormData]")); -}, NM = ti("URLSearchParams"), [kM, UM, OM, FM] = ["ReadableStream", "Request", "Response", "Headers"].map(ti), zM = (s) => s.trim ? s.trim() : s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); +}, NM = ti("URLSearchParams"), [UM, OM, kM, FM] = ["ReadableStream", "Request", "Response", "Headers"].map(ti), zM = (s) => s.trim ? s.trim() : s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function zo(s, e, { allOwnKeys: t = !1 } = {}) { if (s === null || typeof s > "u") return; let n, i; - if (typeof s != "object" && (s = [s]), kr(s)) + if (typeof s != "object" && (s = [s]), Or(s)) for (n = 0, i = s.length; n < i; n++) e.call(null, s[n], n, s); else { - if (Oo(s)) + if (ko(s)) return; const r = t ? Object.getOwnPropertyNames(s) : Object.keys(s), o = r.length; let a; @@ -34106,7 +34110,7 @@ function zo(s, e, { allOwnKeys: t = !1 } = {}) { } } function a0(s, e) { - if (Oo(s)) + if (ko(s)) return null; e = e.toLowerCase(); const t = Object.keys(s); @@ -34116,11 +34120,11 @@ function a0(s, e) { return i; return null; } -const vs = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, l0 = (s) => !Lr(s) && s !== vs; -function tu() { +const vs = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, l0 = (s) => !Dr(s) && s !== vs; +function eu() { const { caseless: s, skipUndefined: e } = l0(this) && this || {}, t = {}, n = (i, r) => { const o = s && a0(t, r) || r; - al(t[o]) && al(i) ? t[o] = tu(t[o], i) : al(i) ? t[o] = tu({}, i) : kr(i) ? t[o] = i.slice() : (!e || !Lr(i)) && (t[o] = i); + ol(t[o]) && ol(i) ? t[o] = eu(t[o], i) : ol(i) ? t[o] = eu({}, i) : Or(i) ? t[o] = i.slice() : (!e || !Dr(i)) && (t[o] = i); }; for (let i = 0, r = arguments.length; i < r; i++) arguments[i] && zo(arguments[i], n); @@ -34139,7 +34143,7 @@ const HM = (s, e, t, { allOwnKeys: n } = {}) => (zo(e, (i, r) => { do { for (i = Object.getOwnPropertyNames(s), r = i.length; r-- > 0; ) o = i[r], (!n || n(o, s, e)) && !a[o] && (e[o] = s[o], a[o] = !0); - s = t !== !1 && Xu(s); + s = t !== !1 && Wu(s); } while (s && (!t || t(s, e)) && s !== Object.prototype); return e; }, XM = (s, e, t) => { @@ -34148,14 +34152,14 @@ const HM = (s, e, t, { allOwnKeys: n } = {}) => (zo(e, (i, r) => { return n !== -1 && n === t; }, jM = (s) => { if (!s) return null; - if (kr(s)) return s; + if (Or(s)) return s; let e = s.length; if (!o0(e)) return null; const t = new Array(e); for (; e-- > 0; ) t[e] = s[e]; return t; -}, qM = /* @__PURE__ */ ((s) => (e) => s && e instanceof s)(typeof Uint8Array < "u" && Xu(Uint8Array)), ZM = (s, e) => { +}, ZM = /* @__PURE__ */ ((s) => (e) => s && e instanceof s)(typeof Uint8Array < "u" && Wu(Uint8Array)), qM = (s, e) => { const t = (s && s[Dl]).call(s); let n; for (; (n = t.next()) && !n.done; ) { @@ -34173,7 +34177,7 @@ const HM = (s, e, t, { allOwnKeys: n } = {}) => (zo(e, (i, r) => { function(e, t, n) { return t.toUpperCase() + n; } -), Gf = (({ hasOwnProperty: s }) => (e, t) => s.call(e, t))(Object.prototype), JM = ti("RegExp"), c0 = (s, e) => { +), Vf = (({ hasOwnProperty: s }) => (e, t) => s.call(e, t))(Object.prototype), JM = ti("RegExp"), c0 = (s, e) => { const t = Object.getOwnPropertyDescriptors(s), n = {}; zo(t, (i, r) => { let o; @@ -34200,7 +34204,7 @@ const HM = (s, e, t, { allOwnKeys: n } = {}) => (zo(e, (i, r) => { t[r] = !0; }); }; - return kr(s) ? n(s) : n(String(s).split(e)), t; + return Or(s) ? n(s) : n(String(s).split(e)), t; }, t3 = () => { }, n3 = (s, e) => s != null && Number.isFinite(s = +s) ? s : e; function i3(s) { @@ -34211,14 +34215,14 @@ const s3 = (s) => { if (Fo(n)) { if (e.indexOf(n) >= 0) return; - if (Oo(n)) + if (ko(n)) return n; if (!("toJSON" in n)) { e[i] = n; - const r = kr(n) ? [] : {}; + const r = Or(n) ? [] : {}; return zo(n, (o, a) => { const l = t(o, i + 1); - !Lr(l) && (r[a] = l); + !Dr(l) && (r[a] = l); }), e[i] = void 0, r; } } @@ -34233,22 +34237,22 @@ const s3 = (s) => { typeof setImmediate == "function", _n(vs.postMessage) ), a3 = typeof queueMicrotask < "u" ? queueMicrotask.bind(vs) : typeof process < "u" && process.nextTick || h0, l3 = (s) => s != null && _n(s[Dl]), se = { - isArray: kr, + isArray: Or, isArrayBuffer: r0, - isBuffer: Oo, + isBuffer: ko, isFormData: BM, isArrayBufferView: EM, isString: TM, isNumber: o0, isBoolean: AM, isObject: Fo, - isPlainObject: al, + isPlainObject: ol, isEmptyObject: CM, - isReadableStream: kM, - isRequest: UM, - isResponse: OM, + isReadableStream: UM, + isRequest: OM, + isResponse: kM, isHeaders: FM, - isUndefined: Lr, + isUndefined: Dr, isDate: PM, isFile: RM, isBlob: LM, @@ -34256,10 +34260,10 @@ const s3 = (s) => { isFunction: _n, isStream: IM, isURLSearchParams: NM, - isTypedArray: qM, + isTypedArray: ZM, isFileList: DM, forEach: zo, - merge: tu, + merge: eu, extend: HM, trim: zM, stripBOM: VM, @@ -34269,11 +34273,11 @@ const s3 = (s) => { kindOfTest: ti, endsWith: XM, toArray: jM, - forEachEntry: ZM, + forEachEntry: qM, matchAll: YM, isHTMLForm: KM, - hasOwnProperty: Gf, - hasOwnProp: Gf, + hasOwnProperty: Vf, + hasOwnProp: Vf, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: c0, freezeMethods: QM, @@ -34345,19 +34349,19 @@ Je.from = (s, e, t, n, i, r) => { return Je.call(o, a, l, t, n, i), s && o.cause == null && Object.defineProperty(o, "cause", { value: s, configurable: !0 }), o.name = s && s.name || "Error", r && Object.assign(o, r), o; }; const c3 = null; -function nu(s) { +function tu(s) { return se.isPlainObject(s) || se.isArray(s); } function f0(s) { return se.endsWith(s, "[]") ? s.slice(0, -2) : s; } -function Wf(s, e, t) { +function Gf(s, e, t) { return s ? s.concat(e).map(function(n, i) { return n = f0(n), !t && i ? "[" + n + "]" : n; }).join(t ? "." : "") : e; } function h3(s) { - return se.isArray(s) && !s.some(nu); + return se.isArray(s) && !s.some(tu); } const u3 = se.toFlatObject(se, {}, null, function(s) { return /^is[A-Z]/.test(s); @@ -34369,8 +34373,8 @@ function Nl(s, e, t) { metaTokens: !0, dots: !1, indexes: !1 - }, !1, function(f, p) { - return !se.isUndefined(p[f]); + }, !1, function(f, g) { + return !se.isUndefined(g[f]); }); const n = t.metaTokens, i = t.visitor || c, r = t.dots, o = t.indexes, a = (t.Blob || typeof Blob < "u" && Blob) && se.isSpecCompliantForm(e); if (!se.isFunction(i)) @@ -34385,39 +34389,39 @@ function Nl(s, e, t) { throw new Je("Blob is not supported. Use a Buffer instead."); return se.isArrayBuffer(f) || se.isTypedArray(f) ? a && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f; } - function c(f, p, g) { + function c(f, g, p) { let x = f; - if (f && !g && typeof f == "object") { - if (se.endsWith(p, "{}")) - p = n ? p : p.slice(0, -2), f = JSON.stringify(f); - else if (se.isArray(f) && h3(f) || (se.isFileList(f) || se.endsWith(p, "[]")) && (x = se.toArray(f))) - return p = f0(p), x.forEach(function(m, b) { + if (f && !p && typeof f == "object") { + if (se.endsWith(g, "{}")) + g = n ? g : g.slice(0, -2), f = JSON.stringify(f); + else if (se.isArray(f) && h3(f) || (se.isFileList(f) || se.endsWith(g, "[]")) && (x = se.toArray(f))) + return g = f0(g), x.forEach(function(m, b) { !(se.isUndefined(m) || m === null) && e.append( // eslint-disable-next-line no-nested-ternary - o === !0 ? Wf([p], b, r) : o === null ? p : p + "[]", + o === !0 ? Gf([g], b, r) : o === null ? g : g + "[]", l(m) ); }), !1; } - return nu(f) ? !0 : (e.append(Wf(g, p, r), l(f)), !1); + return tu(f) ? !0 : (e.append(Gf(p, g, r), l(f)), !1); } const h = [], u = Object.assign(u3, { defaultVisitor: c, convertValue: l, - isVisitable: nu + isVisitable: tu }); - function d(f, p) { + function d(f, g) { if (!se.isUndefined(f)) { if (h.indexOf(f) !== -1) - throw Error("Circular reference detected in " + p.join(".")); - h.push(f), se.forEach(f, function(g, x) { - (!(se.isUndefined(g) || g === null) && i.call( + throw Error("Circular reference detected in " + g.join(".")); + h.push(f), se.forEach(f, function(p, x) { + (!(se.isUndefined(p) || p === null) && i.call( e, - g, - se.isString(x) ? x.trim() : x, p, + se.isString(x) ? x.trim() : x, + g, u - )) === !0 && d(g, p ? p.concat(x) : [x]); + )) === !0 && d(p, g ? g.concat(x) : [x]); }), h.pop(); } } @@ -34425,7 +34429,7 @@ function Nl(s, e, t) { throw new TypeError("data must be an object"); return d(s), e; } -function Xf(s) { +function Wf(s) { const e = { "!": "%21", "'": "%27", @@ -34439,17 +34443,17 @@ function Xf(s) { return e[t]; }); } -function ju(s, e) { +function Xu(s, e) { this._pairs = [], s && Nl(s, this, e); } -const p0 = ju.prototype; +const p0 = Xu.prototype; p0.append = function(s, e) { this._pairs.push([s, e]); }; p0.toString = function(s) { const e = s ? function(t) { - return s.call(this, t, Xf); - } : Xf; + return s.call(this, t, Wf); + } : Wf; return this._pairs.map(function(t) { return e(t[0]) + "=" + e(t[1]); }, "").join("&"); @@ -34466,13 +34470,13 @@ function m0(s, e, t) { }); const i = t && t.serialize; let r; - if (i ? r = i(e, t) : r = se.isURLSearchParams(e) ? e.toString() : new ju(e, t).toString(n), r) { + if (i ? r = i(e, t) : r = se.isURLSearchParams(e) ? e.toString() : new Xu(e, t).toString(n), r) { const o = s.indexOf("#"); o !== -1 && (s = s.slice(0, o)), s += (s.indexOf("?") === -1 ? "?" : "&") + r; } return s; } -class jf { +class Xf { constructor() { this.handlers = []; } @@ -34530,7 +34534,7 @@ const g0 = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 -}, f3 = typeof URLSearchParams < "u" ? URLSearchParams : ju, p3 = typeof FormData < "u" ? FormData : null, m3 = typeof Blob < "u" ? Blob : null, g3 = { +}, f3 = typeof URLSearchParams < "u" ? URLSearchParams : Xu, p3 = typeof FormData < "u" ? FormData : null, m3 = typeof Blob < "u" ? Blob : null, g3 = { isBrowser: !0, classes: { URLSearchParams: f3, @@ -34538,13 +34542,13 @@ const g0 = { Blob: m3 }, protocols: ["http", "https", "file", "blob", "url", "data"] -}, qu = typeof window < "u" && typeof document < "u", iu = typeof navigator == "object" && navigator || void 0, x3 = qu && (!iu || ["ReactNative", "NativeScript", "NS"].indexOf(iu.product) < 0), v3 = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef -self instanceof WorkerGlobalScope && typeof self.importScripts == "function", b3 = qu && window.location.href || "http://localhost", y3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}, ju = typeof window < "u" && typeof document < "u", nu = typeof navigator == "object" && navigator || void 0, x3 = ju && (!nu || ["ReactNative", "NativeScript", "NS"].indexOf(nu.product) < 0), v3 = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef +self instanceof WorkerGlobalScope && typeof self.importScripts == "function", b3 = ju && window.location.href || "http://localhost", y3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - hasBrowserEnv: qu, + hasBrowserEnv: ju, hasStandardBrowserEnv: x3, hasStandardBrowserWebWorkerEnv: v3, - navigator: iu, + navigator: nu, origin: b3 }, Symbol.toStringTag, { value: "Module" })), sn = { ...y3, @@ -34689,12 +34693,12 @@ const E3 = se.toObjectSet([ `).forEach(function(r) { i = r.indexOf(":"), t = r.substring(0, i).trim().toLowerCase(), n = r.substring(i + 1).trim(), !(!t || e[t] && E3[t]) && (t === "set-cookie" ? e[t] ? e[t].push(n) : e[t] = [n] : e[t] = e[t] ? e[t] + ", " + n : n); }), e; -}, qf = Symbol("internals"); -function Jr(s) { +}, jf = Symbol("internals"); +function Qr(s) { return s && String(s).trim().toLowerCase(); } -function ll(s) { - return s === !1 || s == null ? s : se.isArray(s) ? s.map(ll) : String(s); +function al(s) { + return s === !1 || s == null ? s : se.isArray(s) ? s.map(al) : String(s); } function A3(s) { const e = /* @__PURE__ */ Object.create(null), t = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; @@ -34735,11 +34739,11 @@ let Mn = class { set(s, e, t) { const n = this; function i(o, a, l) { - const c = Jr(a); + const c = Qr(a); if (!c) throw new Error("header name must be a non-empty string"); const h = se.findKey(n, c); - (!h || n[h] === void 0 || l === !0 || l === void 0 && n[h] !== !1) && (n[h || a] = ll(o)); + (!h || n[h] === void 0 || l === !0 || l === void 0 && n[h] !== !1) && (n[h || a] = al(o)); } const r = (o, a) => se.forEach(o, (l, c) => i(l, c, a)); if (se.isPlainObject(s) || s instanceof this.constructor) @@ -34759,7 +34763,7 @@ let Mn = class { return this; } get(s, e) { - if (s = Jr(s), s) { + if (s = Qr(s), s) { const t = se.findKey(this, s); if (t) { const n = this[t]; @@ -34776,7 +34780,7 @@ let Mn = class { } } has(s, e) { - if (s = Jr(s), s) { + if (s = Qr(s), s) { const t = se.findKey(this, s); return !!(t && this[t] !== void 0 && (!e || Ac(this, this[t], t, e))); } @@ -34786,7 +34790,7 @@ let Mn = class { const t = this; let n = !1; function i(r) { - if (r = Jr(r), r) { + if (r = Qr(r), r) { const o = se.findKey(t, r); o && (!e || Ac(t, t[o], o, e)) && (delete t[o], n = !0); } @@ -34807,11 +34811,11 @@ let Mn = class { return se.forEach(this, (n, i) => { const r = se.findKey(t, i); if (r) { - e[r] = ll(n), delete e[i]; + e[r] = al(n), delete e[i]; return; } const o = s ? P3(i) : String(i).trim(); - o !== i && delete e[i], e[o] = ll(n), t[o] = !0; + o !== i && delete e[i], e[o] = al(n), t[o] = !0; }), this; } concat(...s) { @@ -34844,11 +34848,11 @@ let Mn = class { return e.forEach((n) => t.set(n)), t; } static accessor(s) { - const e = (this[qf] = this[qf] = { + const e = (this[jf] = this[jf] = { accessors: {} }).accessors, t = this.prototype; function n(i) { - const r = Jr(i); + const r = Qr(i); e[r] || (R3(t, i), e[r] = !0); } return se.isArray(s) ? s.forEach(n) : n(s), this; @@ -34875,10 +34879,10 @@ function Cc(s, e) { function v0(s) { return !!(s && s.__CANCEL__); } -function Ur(s, e, t) { +function kr(s, e, t) { Je.call(this, s ?? "canceled", Je.ERR_CANCELED, e, t), this.name = "CanceledError"; } -se.inherits(Ur, Je, { +se.inherits(kr, Je, { __CANCEL__: !0 }); function b0(s, e, t) { @@ -34949,7 +34953,7 @@ const Ml = (s, e, t = 3) => { total: s, loaded: n }), e[1]]; -}, Yf = (s) => (...e) => se.asap(() => s(...e)), B3 = sn.hasStandardBrowserEnv ? /* @__PURE__ */ ((s, e) => (t) => (t = new URL(t, sn.origin), s.protocol === t.protocol && s.host === t.host && (e || s.port === t.port)))( +}, qf = (s) => (...e) => se.asap(() => s(...e)), B3 = sn.hasStandardBrowserEnv ? /* @__PURE__ */ ((s, e) => (t) => (t = new URL(t, sn.origin), s.protocol === t.protocol && s.host === t.host && (e || s.port === t.port)))( new URL(sn.origin), sn.navigator && /(msie|trident)/i.test(sn.navigator.userAgent) ) : () => !0, N3 = sn.hasStandardBrowserEnv ? ( @@ -34981,18 +34985,18 @@ const Ml = (s, e, t = 3) => { } } ); -function k3(s) { +function U3(s) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s); } -function U3(s, e) { +function O3(s, e) { return e ? s.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : s; } function y0(s, e, t) { - let n = !k3(e); - return s && (n || t == !1) ? U3(s, e) : e; + let n = !U3(e); + return s && (n || t == !1) ? O3(s, e) : e; } -const Kf = (s) => s instanceof Mn ? { ...s } : s; -function Ts(s, e) { +const Yf = (s) => s instanceof Mn ? { ...s } : s; +function As(s, e) { e = e || {}; const t = {}; function n(c, h, u, d) { @@ -35049,7 +35053,7 @@ function Ts(s, e) { socketPath: o, responseEncoding: o, validateStatus: a, - headers: (c, h, u) => i(Kf(c), Kf(h), u, !0) + headers: (c, h, u) => i(Yf(c), Yf(h), u, !0) }; return se.forEach(Object.keys({ ...s, ...e }), function(c) { const h = l[c] || i, u = h(s[c], e[c], c); @@ -35057,7 +35061,7 @@ function Ts(s, e) { }), t; } const _0 = (s) => { - const e = Ts({}, s); + const e = As({}, s); let { data: t, withXSRFToken: n, xsrfHeaderName: i, xsrfCookieName: r, headers: o, auth: a } = e; if (e.headers = o = Mn.from(o), e.url = m0(y0(e.baseURL, e.url, e.allowAbsoluteUrls), s.params, s.paramsSerializer), a && o.set( "Authorization", @@ -35077,63 +35081,63 @@ const _0 = (s) => { l && o.set(i, l); } return e; -}, O3 = typeof XMLHttpRequest < "u", F3 = O3 && function(s) { +}, k3 = typeof XMLHttpRequest < "u", F3 = k3 && function(s) { return new Promise(function(e, t) { const n = _0(s); let i = n.data; const r = Mn.from(n.headers).normalize(); let { responseType: o, onUploadProgress: a, onDownloadProgress: l } = n, c, h, u, d, f; - function p() { + function g() { d && d(), f && f(), n.cancelToken && n.cancelToken.unsubscribe(c), n.signal && n.signal.removeEventListener("abort", c); } - let g = new XMLHttpRequest(); - g.open(n.method.toUpperCase(), n.url, !0), g.timeout = n.timeout; + let p = new XMLHttpRequest(); + p.open(n.method.toUpperCase(), n.url, !0), p.timeout = n.timeout; function x() { - if (!g) + if (!p) return; const b = Mn.from( - "getAllResponseHeaders" in g && g.getAllResponseHeaders() + "getAllResponseHeaders" in p && p.getAllResponseHeaders() ), v = { - data: !o || o === "text" || o === "json" ? g.responseText : g.response, - status: g.status, - statusText: g.statusText, + data: !o || o === "text" || o === "json" ? p.responseText : p.response, + status: p.status, + statusText: p.statusText, headers: b, config: s, - request: g + request: p }; b0(function(y) { - e(y), p(); + e(y), g(); }, function(y) { - t(y), p(); - }, v), g = null; + t(y), g(); + }, v), p = null; } - "onloadend" in g ? g.onloadend = x : g.onreadystatechange = function() { - !g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(x); - }, g.onabort = function() { - g && (t(new Je("Request aborted", Je.ECONNABORTED, s, g)), g = null); - }, g.onerror = function(b) { - const v = b && b.message ? b.message : "Network Error", y = new Je(v, Je.ERR_NETWORK, s, g); - y.event = b || null, t(y), g = null; - }, g.ontimeout = function() { + "onloadend" in p ? p.onloadend = x : p.onreadystatechange = function() { + !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(x); + }, p.onabort = function() { + p && (t(new Je("Request aborted", Je.ECONNABORTED, s, p)), p = null); + }, p.onerror = function(b) { + const v = b && b.message ? b.message : "Network Error", y = new Je(v, Je.ERR_NETWORK, s, p); + y.event = b || null, t(y), p = null; + }, p.ontimeout = function() { let b = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded"; const v = n.transitional || g0; n.timeoutErrorMessage && (b = n.timeoutErrorMessage), t(new Je( b, v.clarifyTimeoutError ? Je.ETIMEDOUT : Je.ECONNABORTED, s, - g - )), g = null; - }, i === void 0 && r.setContentType(null), "setRequestHeader" in g && se.forEach(r.toJSON(), function(b, v) { - g.setRequestHeader(v, b); - }), se.isUndefined(n.withCredentials) || (g.withCredentials = !!n.withCredentials), o && o !== "json" && (g.responseType = n.responseType), l && ([u, f] = Ml(l, !0), g.addEventListener("progress", u)), a && g.upload && ([h, d] = Ml(a), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", d)), (n.cancelToken || n.signal) && (c = (b) => { - g && (t(!b || b.type ? new Ur(null, s, g) : b), g.abort(), g = null); + p + )), p = null; + }, i === void 0 && r.setContentType(null), "setRequestHeader" in p && se.forEach(r.toJSON(), function(b, v) { + p.setRequestHeader(v, b); + }), se.isUndefined(n.withCredentials) || (p.withCredentials = !!n.withCredentials), o && o !== "json" && (p.responseType = n.responseType), l && ([u, f] = Ml(l, !0), p.addEventListener("progress", u)), a && p.upload && ([h, d] = Ml(a), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", d)), (n.cancelToken || n.signal) && (c = (b) => { + p && (t(!b || b.type ? new kr(null, s, p) : b), p.abort(), p = null); }, n.cancelToken && n.cancelToken.subscribe(c), n.signal && (n.signal.aborted ? c() : n.signal.addEventListener("abort", c))); const m = L3(n.url); if (m && sn.protocols.indexOf(m) === -1) { t(new Je("Unsupported protocol " + m + ":", Je.ERR_BAD_REQUEST, s)); return; } - g.send(i || null); + p.send(i || null); }); }, z3 = (s, e) => { const { length: t } = s = s ? s.filter(Boolean) : []; @@ -35143,7 +35147,7 @@ const _0 = (s) => { if (!i) { i = !0, a(); const h = c instanceof Error ? c : this.reason; - n.abort(h instanceof Je ? h : new Ur(h instanceof Error ? h.message : h)); + n.abort(h instanceof Je ? h : new kr(h instanceof Error ? h.message : h)); } }; let o = e && setTimeout(() => { @@ -35186,7 +35190,7 @@ const _0 = (s) => { } finally { await e.cancel(); } -}, $f = (s, e, t, n) => { +}, Kf = (s, e, t, n) => { const i = V3(s, e); let r = 0, o, a = (l) => { o || (o = !0, n && n(l)); @@ -35215,13 +35219,13 @@ const _0 = (s) => { }, { highWaterMark: 2 }); -}, Jf = 64 * 1024, { isFunction: Ra } = se, W3 = (({ Request: s, Response: e }) => ({ +}, $f = 64 * 1024, { isFunction: Ra } = se, W3 = (({ Request: s, Response: e }) => ({ Request: s, Response: e }))(se.global), { - ReadableStream: Qf, - TextEncoder: ep -} = se.global, tp = (s, ...e) => { + ReadableStream: Jf, + TextEncoder: Qf +} = se.global, ep = (s, ...e) => { try { return !!s(...e); } catch { @@ -35234,45 +35238,45 @@ const _0 = (s) => { const { fetch: e, Request: t, Response: n } = s, i = e ? Ra(e) : typeof fetch == "function", r = Ra(t), o = Ra(n); if (!i) return !1; - const a = i && Ra(Qf), l = i && (typeof ep == "function" ? /* @__PURE__ */ ((p) => (g) => p.encode(g))(new ep()) : async (p) => new Uint8Array(await new t(p).arrayBuffer())), c = r && a && tp(() => { - let p = !1; - const g = new t(sn.origin, { - body: new Qf(), + const a = i && Ra(Jf), l = i && (typeof Qf == "function" ? /* @__PURE__ */ ((g) => (p) => g.encode(p))(new Qf()) : async (g) => new Uint8Array(await new t(g).arrayBuffer())), c = r && a && ep(() => { + let g = !1; + const p = new t(sn.origin, { + body: new Jf(), method: "POST", get duplex() { - return p = !0, "half"; + return g = !0, "half"; } }).headers.has("Content-Type"); - return p && !g; - }), h = o && a && tp(() => se.isReadableStream(new n("").body)), u = { - stream: h && ((p) => p.body) + return g && !p; + }), h = o && a && ep(() => se.isReadableStream(new n("").body)), u = { + stream: h && ((g) => g.body) }; - i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => { - !u[p] && (u[p] = (g, x) => { - let m = g && g[p]; + i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((g) => { + !u[g] && (u[g] = (p, x) => { + let m = p && p[g]; if (m) - return m.call(g); - throw new Je(`Response type '${p}' is not supported`, Je.ERR_NOT_SUPPORT, x); + return m.call(p); + throw new Je(`Response type '${g}' is not supported`, Je.ERR_NOT_SUPPORT, x); }); }); - const d = async (p) => { - if (p == null) + const d = async (g) => { + if (g == null) return 0; - if (se.isBlob(p)) - return p.size; - if (se.isSpecCompliantForm(p)) + if (se.isBlob(g)) + return g.size; + if (se.isSpecCompliantForm(g)) return (await new t(sn.origin, { method: "POST", - body: p + body: g }).arrayBuffer()).byteLength; - if (se.isArrayBufferView(p) || se.isArrayBuffer(p)) - return p.byteLength; - if (se.isURLSearchParams(p) && (p = p + ""), se.isString(p)) - return (await l(p)).byteLength; - }, f = async (p, g) => se.toFiniteNumber(p.getContentLength()) ?? d(g); - return async (p) => { + if (se.isArrayBufferView(g) || se.isArrayBuffer(g)) + return g.byteLength; + if (se.isURLSearchParams(g) && (g = g + ""), se.isString(g)) + return (await l(g)).byteLength; + }, f = async (g, p) => se.toFiniteNumber(g.getContentLength()) ?? d(p); + return async (g) => { let { - url: g, + url: p, method: x, data: m, signal: b, @@ -35284,7 +35288,7 @@ const _0 = (s) => { headers: R, withCredentials: _ = "same-origin", fetchOptions: S - } = _0(p), D = e || fetch; + } = _0(g), D = e || fetch; A = A ? (A + "").toLowerCase() : "text"; let C = z3([b, v && v.toAbortSignal()], y), B = null; const w = C && C.unsubscribe && (() => { @@ -35293,7 +35297,7 @@ const _0 = (s) => { let F; try { if (E && c && x !== "get" && x !== "head" && (F = await f(R, m)) !== 0) { - let X = new t(g, { + let X = new t(p, { method: "POST", body: m, duplex: "half" @@ -35301,9 +35305,9 @@ const _0 = (s) => { if (se.isFormData(m) && (Y = X.headers.get("content-type")) && R.setContentType(Y), X.body) { const [ge, pe] = Zf( F, - Ml(Yf(E)) + Ml(qf(E)) ); - m = $f(X.body, Jf, ge, pe); + m = Kf(X.body, $f, ge, pe); } } se.isString(_) || (_ = _ ? "include" : "omit"); @@ -35316,44 +35320,44 @@ const _0 = (s) => { duplex: "half", credentials: W ? _ : void 0 }; - B = r && new t(g, j); - let $ = await (r ? D(B, S) : D(g, j)); - const Z = h && (A === "stream" || A === "response"); - if (h && (M || Z && w)) { + B = r && new t(p, j); + let $ = await (r ? D(B, S) : D(p, j)); + const q = h && (A === "stream" || A === "response"); + if (h && (M || q && w)) { const X = {}; ["status", "statusText", "headers"].forEach((de) => { X[de] = $[de]; }); const Y = se.toFiniteNumber($.headers.get("content-length")), [ge, pe] = M && Zf( Y, - Ml(Yf(M), !0) + Ml(qf(M), !0) ) || []; $ = new n( - $f($.body, Jf, ge, () => { + Kf($.body, $f, ge, () => { pe && pe(), w && w(); }), X ); } A = A || "text"; - let re = await u[se.findKey(u, A) || "text"]($, p); - return !Z && w && w(), await new Promise((X, Y) => { + let re = await u[se.findKey(u, A) || "text"]($, g); + return !q && w && w(), await new Promise((X, Y) => { b0(X, Y, { data: re, headers: Mn.from($.headers), status: $.status, statusText: $.statusText, - config: p, + config: g, request: B }); }); } catch (W) { throw w && w(), W && W.name === "TypeError" && /Load failed|fetch/i.test(W.message) ? Object.assign( - new Je("Network Error", Je.ERR_NETWORK, p, B), + new Je("Network Error", Je.ERR_NETWORK, g, B), { cause: W.cause || W } - ) : Je.from(W, W && W.code, p, B); + ) : Je.from(W, W && W.code, g, B); } }; }, j3 = /* @__PURE__ */ new Map(), M0 = (s) => { @@ -35385,8 +35389,8 @@ se.forEach(Zu, (s, e) => { Object.defineProperty(s, "adapterName", { value: e }); } }); -const np = (s) => `- ${s}`, q3 = (s) => se.isFunction(s) || s === null || s === !1; -function Z3(s, e) { +const tp = (s) => `- ${s}`, Z3 = (s) => se.isFunction(s) || s === null || s === !1; +function q3(s, e) { s = se.isArray(s) ? s : [s]; const { length: t } = s; let n, i; @@ -35394,7 +35398,7 @@ function Z3(s, e) { for (let o = 0; o < t; o++) { n = s[o]; let a; - if (i = n, !q3(n) && (i = Zu[(a = String(n)).toLowerCase()], i === void 0)) + if (i = n, !Z3(n) && (i = Zu[(a = String(n)).toLowerCase()], i === void 0)) throw new Je(`Unknown adapter '${a}'`); if (i && (se.isFunction(i) || (i = i.get(e)))) break; @@ -35405,8 +35409,8 @@ function Z3(s, e) { ([l, c]) => `adapter ${l} ` + (c === !1 ? "is not supported by the environment" : "is not available in the build") ); let a = t ? o.length > 1 ? `since : -` + o.map(np).join(` -`) : " " + np(o[0]) : "as no adapter specified"; +` + o.map(tp).join(` +`) : " " + tp(o[0]) : "as no adapter specified"; throw new Je( "There is no suitable adapter to dispatch the request " + a, "ERR_NOT_SUPPORT" @@ -35419,7 +35423,7 @@ const w0 = { * Resolve an adapter from a list of adapter names or functions. * @type {Function} */ - getAdapter: Z3, + getAdapter: q3, /** * Exposes all known adapters * @type {Object} @@ -35428,9 +35432,9 @@ const w0 = { }; function Pc(s) { if (s.cancelToken && s.cancelToken.throwIfRequested(), s.signal && s.signal.aborted) - throw new Ur(null, s); + throw new kr(null, s); } -function ip(s) { +function np(s) { return Pc(s), s.headers = Mn.from(s.headers), s.data = Cc.call( s, s.transformRequest @@ -35448,14 +35452,14 @@ function ip(s) { ), e.response.headers = Mn.from(e.response.headers))), Promise.reject(e); }); } -const S0 = "1.13.2", kl = {}; +const S0 = "1.13.2", Ul = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((s, e) => { - kl[s] = function(t) { + Ul[s] = function(t) { return typeof t === s || "a" + (e < 1 ? "n " : " ") + s; }; }); -const sp = {}; -kl.transitional = function(s, e, t) { +const ip = {}; +Ul.transitional = function(s, e, t) { function n(i, r) { return "[Axios v" + S0 + "] Transitional option '" + i + "'" + r + (t ? ". " + t : ""); } @@ -35465,7 +35469,7 @@ kl.transitional = function(s, e, t) { n(r, " has been removed" + (e ? " in " + e : "")), Je.ERR_DEPRECATED ); - return e && !sp[r] && (sp[r] = !0, console.warn( + return e && !ip[r] && (ip[r] = !0, console.warn( n( r, " has been deprecated since v" + e + " and will be removed in the near future" @@ -35473,7 +35477,7 @@ kl.transitional = function(s, e, t) { )), s ? s(i, r, o) : !0; }; }; -kl.spelling = function(s) { +Ul.spelling = function(s) { return (e, t) => (console.warn(`${t} is likely a misspelling of ${s}`), !0); }; function Y3(s, e, t) { @@ -35493,15 +35497,15 @@ function Y3(s, e, t) { throw new Je("Unknown option " + r, Je.ERR_BAD_OPTION); } } -const cl = { +const ll = { assertOptions: Y3, - validators: kl -}, ii = cl.validators; + validators: Ul +}, ii = ll.validators; let ys = class { constructor(s) { this.defaults = s || {}, this.interceptors = { - request: new jf(), - response: new jf() + request: new Xf(), + response: new Xf() }; } /** @@ -35530,18 +35534,18 @@ let ys = class { } } _request(s, e) { - typeof s == "string" ? (e = e || {}, e.url = s) : e = s || {}, e = Ts(this.defaults, e); + typeof s == "string" ? (e = e || {}, e.url = s) : e = s || {}, e = As(this.defaults, e); const { transitional: t, paramsSerializer: n, headers: i } = e; - t !== void 0 && cl.assertOptions(t, { + t !== void 0 && ll.assertOptions(t, { silentJSONParsing: ii.transitional(ii.boolean), forcedJSONParsing: ii.transitional(ii.boolean), clarifyTimeoutError: ii.transitional(ii.boolean) }, !1), n != null && (se.isFunction(n) ? e.paramsSerializer = { serialize: n - } : cl.assertOptions(n, { + } : ll.assertOptions(n, { encode: ii.function, serialize: ii.function - }, !0)), e.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? e.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : e.allowAbsoluteUrls = !0), cl.assertOptions(e, { + }, !0)), e.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? e.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : e.allowAbsoluteUrls = !0), ll.assertOptions(e, { baseUrl: ii.spelling("baseURL"), withXsrfToken: ii.spelling("withXSRFToken") }, !0), e.method = (e.method || this.defaults.method || "get").toLowerCase(); @@ -35566,7 +35570,7 @@ let ys = class { }); let c, h = 0, u; if (!a) { - const f = [ip.bind(this), void 0]; + const f = [np.bind(this), void 0]; for (f.unshift(...o), f.push(...l), u = f.length, c = Promise.resolve(e); h < u; ) c = c.then(f[h++], f[h++]); return c; @@ -35574,16 +35578,16 @@ let ys = class { u = o.length; let d = e; for (; h < u; ) { - const f = o[h++], p = o[h++]; + const f = o[h++], g = o[h++]; try { d = f(d); - } catch (g) { - p.call(this, g); + } catch (p) { + g.call(this, p); break; } } try { - c = ip.call(this, d); + c = np.call(this, d); } catch (f) { return Promise.reject(f); } @@ -35592,14 +35596,14 @@ let ys = class { return c; } getUri(s) { - s = Ts(this.defaults, s); + s = As(this.defaults, s); const e = y0(s.baseURL, s.url, s.allowAbsoluteUrls); return m0(e, s.params, s.paramsSerializer); } }; se.forEach(["delete", "get", "head", "options"], function(s) { ys.prototype[s] = function(e, t) { - return this.request(Ts(t || {}, { + return this.request(As(t || {}, { method: s, url: e, data: (t || {}).data @@ -35609,7 +35613,7 @@ se.forEach(["delete", "get", "head", "options"], function(s) { se.forEach(["post", "put", "patch"], function(s) { function e(t) { return function(n, i, r) { - return this.request(Ts(r || {}, { + return this.request(As(r || {}, { method: s, headers: t ? { "Content-Type": "multipart/form-data" @@ -35645,7 +35649,7 @@ let K3 = class E0 { n.unsubscribe(r); }, o; }, e(function(i, r, o) { - n.reason || (n.reason = new Ur(i, r, o), t(n.reason)); + n.reason || (n.reason = new kr(i, r, o), t(n.reason)); }); } /** @@ -35702,7 +35706,7 @@ function $3(s) { function J3(s) { return se.isObject(s) && s.isAxiosError === !0; } -const su = { +const iu = { Continue: 100, SwitchingProtocols: 101, Processing: 102, @@ -35773,18 +35777,18 @@ const su = { SslHandshakeFailed: 525, InvalidSslCertificate: 526 }; -Object.entries(su).forEach(([s, e]) => { - su[e] = s; +Object.entries(iu).forEach(([s, e]) => { + iu[e] = s; }); function T0(s) { const e = new ys(s), t = i0(ys.prototype.request, e); return se.extend(t, ys.prototype, e, { allOwnKeys: !0 }), se.extend(t, e, null, { allOwnKeys: !0 }), t.create = function(n) { - return T0(Ts(s, n)); + return T0(As(s, n)); }, t; } const Nt = T0(Ho); Nt.Axios = ys; -Nt.CanceledError = Ur; +Nt.CanceledError = kr; Nt.CancelToken = K3; Nt.isCancel = v0; Nt.VERSION = S0; @@ -35796,31 +35800,31 @@ Nt.all = function(s) { }; Nt.spread = $3; Nt.isAxiosError = J3; -Nt.mergeConfig = Ts; +Nt.mergeConfig = As; Nt.AxiosHeaders = Mn; Nt.formToJSON = (s) => x0(se.isHTMLForm(s) ? new FormData(s) : s); Nt.getAdapter = w0.getAdapter; -Nt.HttpStatusCode = su; +Nt.HttpStatusCode = iu; Nt.default = Nt; const { - Axios: MA, - AxiosError: wA, - CanceledError: SA, - isCancel: EA, - CancelToken: TA, - VERSION: AA, - all: CA, - Cancel: PA, - isAxiosError: RA, - spread: LA, - toFormData: DA, - AxiosHeaders: IA, - HttpStatusCode: BA, - formToJSON: NA, - getAdapter: kA, - mergeConfig: UA + Axios: yA, + AxiosError: _A, + CanceledError: MA, + isCancel: wA, + CancelToken: SA, + VERSION: EA, + all: TA, + Cancel: AA, + isAxiosError: CA, + spread: PA, + toFormData: RA, + AxiosHeaders: LA, + HttpStatusCode: DA, + formToJSON: IA, + getAdapter: BA, + mergeConfig: NA } = Nt; -function Q3(s, e) { +function sp(s, e) { var t; if (window.XMLHttpRequest ? t = new XMLHttpRequest() : window.ActiveXObject ? t = new window.ActiveXObject() : alert("请升级至最新版本的浏览器"), t != null) { let n = s; @@ -35831,7 +35835,7 @@ function Q3(s, e) { }; } } -function ew(s, e) { +function Q3(s, e) { Nt({ method: "get", responseType: "blob", @@ -35894,7 +35898,7 @@ function A0(s, e) { } } const Rc = /* @__PURE__ */ new WeakMap(); -class tw extends Ps { +class ew extends Rs { /** * Constructs a new Draco loader. * @@ -35968,7 +35972,7 @@ class tw extends Ps { this.decodeDracoFile(e, t, null, null, xt, n).catch(n); } // - decodeDracoFile(e, t, n, i, r = Bt, o = () => { + decodeDracoFile(e, t, n, i, r = It, o = () => { }) { const a = { attributeIDs: n || this.defaultAttributeIDs, @@ -36009,8 +36013,8 @@ class tw extends Ps { if (o === a) c = new at(r, o); else { - const h = new Iu(r, a); - c = new Er(h, o, 0); + const h = new Du(r, a); + c = new Tr(h, o, 0); } i === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(r instanceof Float32Array)), t.setAttribute(i, c); } @@ -36018,7 +36022,7 @@ class tw extends Ps { } _assignVertexColorSpace(e, t) { if (t !== xt) return; - const n = new Fe(); + const n = new Oe(); for (let i = 0, r = e.count; i < r; i++) n.fromBufferAttribute(e, i), st.colorSpaceToWorking(n, xt), e.setXYZ(i, n.r, n.g, n.b); } @@ -36037,7 +36041,7 @@ class tw extends Ps { return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(t).then((n) => { const i = n[0]; e || (this.decoderConfig.wasmBinary = n[1]); - const r = nw.toString(), o = [ + const r = tw.toString(), o = [ "/* draco decoder */", i, "", @@ -36085,7 +36089,7 @@ class tw extends Ps { return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this; } } -function nw() { +function tw() { let s, e; onmessage = function(o) { const a = o.data; @@ -36102,8 +36106,8 @@ function nw() { e.then((h) => { const u = h.draco, d = new u.Decoder(); try { - const f = t(u, d, new Int8Array(l), c), p = f.attributes.map((g) => g.array.buffer); - f.index && p.push(f.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: f }, p); + const f = t(u, d, new Int8Array(l), c), g = f.attributes.map((p) => p.array.buffer); + f.index && g.push(f.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: f }, g); } catch (f) { console.error(f), self.postMessage({ type: "error", id: a.id, error: f.message }); } finally { @@ -36116,16 +36120,16 @@ function nw() { function t(o, a, l, c) { const h = c.attributeIDs, u = c.attributeTypes; let d, f; - const p = a.GetEncodedGeometryType(l); - if (p === o.TRIANGULAR_MESH) + const g = a.GetEncodedGeometryType(l); + if (g === o.TRIANGULAR_MESH) d = new o.Mesh(), f = a.DecodeArrayToMesh(l, l.byteLength, d); - else if (p === o.POINT_CLOUD) + else if (g === o.POINT_CLOUD) d = new o.PointCloud(), f = a.DecodeArrayToPointCloud(l, l.byteLength, d); else throw new Error("THREE.DRACOLoader: Unexpected geometry type."); if (!f.ok() || d.ptr === 0) throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg()); - const g = { index: null, attributes: [] }; + const p = { index: null, attributes: [] }; for (const x in h) { const m = self[u[x]]; let b, v; @@ -36136,9 +36140,9 @@ function nw() { b = a.GetAttribute(d, v); } const y = i(o, a, d, x, m, b); - x === "color" && (y.vertexColorSpace = c.vertexColorSpace), g.attributes.push(y); + x === "color" && (y.vertexColorSpace = c.vertexColorSpace), p.attributes.push(y); } - return p === o.TRIANGULAR_MESH && (g.index = n(o, a, d)), o.destroy(d), g; + return g === o.TRIANGULAR_MESH && (p.index = n(o, a, d)), o.destroy(d), p; } function n(o, a, l) { const c = l.num_faces() * 3, h = c * 4, u = o._malloc(h); @@ -36147,11 +36151,11 @@ function nw() { return o._free(u), { array: d, itemSize: 1 }; } function i(o, a, l, c, h, u) { - const d = l.num_points(), f = u.num_components(), p = r(o, h), g = f * h.BYTES_PER_ELEMENT, x = Math.ceil(g / 4) * 4, m = x / h.BYTES_PER_ELEMENT, b = d * g, v = d * x, y = o._malloc(b); - a.GetAttributeDataArrayForAllPoints(l, u, p, b, y); + const d = l.num_points(), f = u.num_components(), g = r(o, h), p = f * h.BYTES_PER_ELEMENT, x = Math.ceil(p / 4) * 4, m = x / h.BYTES_PER_ELEMENT, b = d * p, v = d * x, y = o._malloc(b); + a.GetAttributeDataArrayForAllPoints(l, u, g, b, y); const M = new h(o.HEAPF32.buffer, y, b / h.BYTES_PER_ELEMENT); let E; - if (g === x) + if (p === x) E = M.slice(); else { E = new h(v / h.BYTES_PER_ELEMENT); @@ -36189,13 +36193,13 @@ function nw() { } } } -var Dr = /* @__PURE__ */ ((s) => (s.ModelLoadStart = "model-load-start", s.ModelLoadProgress = "model-load-progress", s.ModelLoaded = "model-loaded", s.ModelError = "model-error", s.SelectionChanged = "selection-changed", s.HoverChanged = "hover-changed", s.Click = "click", s.MouseMove = "mouse-move", s.CameraChanged = "camera-changed", s.CameraIdle = "camera-idle", s.ViewportResize = "viewport-resize", s.EngineFree = "engine-free", s.EngineBusy = "engine-busy", s))(Dr || {}); -function iw(s, e, t, n) { +var Ir = /* @__PURE__ */ ((s) => (s.ModelLoadStart = "model-load-start", s.ModelLoadProgress = "model-load-progress", s.ModelLoaded = "model-loaded", s.ModelError = "model-error", s.SelectionChanged = "selection-changed", s.HoverChanged = "hover-changed", s.Click = "click", s.MouseMove = "mouse-move", s.CameraChanged = "camera-changed", s.CameraIdle = "camera-idle", s.ViewportResize = "viewport-resize", s.EngineFree = "engine-free", s.EngineBusy = "engine-busy", s))(Ir || {}); +function nw(s, e, t, n) { let i = 0, r = 0, o = 0, a = s.models.find((f) => f.url == t), l = e.circularMeps, c = e.rectMeps.filter((f) => f.type === "风管"), h = e.rectMeps.filter((f) => f.type === "桥架"), u = e.ellipseMeps, d = s.scene; - if (new Zt(), new ut(), La(d, "InstancedMesh"), l && l.length) { - let f = []; + if (new qt(), new ut(), l && l.length) { + let f = [], g = 0; for (let p of l) - p.color = new Fe(`rgb(${p.color})`), p.position = { + p.color = new Oe(`rgb(${p.color})`), p.position = { x: p.startPoint.X * 0.3048 + i, y: p.startPoint.Z * 0.3048 + r, z: -p.startPoint.Y * 0.3048 + o @@ -36203,13 +36207,15 @@ function iw(s, e, t, n) { x: 0, y: 0, z: 0 - }, a.nodesMap.set(p.id, [p]), f.push(p); - Da("Circle", d, f, 2); + }, p.indexes = [ + [s.scene.children.length, g++, 0, 0] + ], a.nodesMap.set(Number(p.id), p), f.push(p); + La("Circle", d, f, t); } - if (La(d, "InstancedMesh"), c && c.length) { - let f = []; + if (c && c.length) { + let f = [], g = 0; for (let p of c) - p.color = new Fe(`rgb(${p.color})`), p.position = { + p.color = new Oe(`rgb(${p.color})`), p.position = { x: p.startPoint.X * 0.3048 + i, y: p.startPoint.Z * 0.3048 + r, z: -p.startPoint.Y * 0.3048 + o @@ -36217,13 +36223,15 @@ function iw(s, e, t, n) { x: 0, y: 0, z: 0 - }, a.nodesMap.set(p.id, [p]), f.push(p); - Da("Rect", d, f, 3); + }, p.indexes = [ + [s.scene.children.length, g++, 0, 0] + ], a.nodesMap.set(Number(p.id), p), f.push(p); + La("Rect", d, f, t); } - if (La(d, "InstancedMesh"), u && u.length) { - let f = []; + if (u && u.length) { + let f = [], g = 0; for (let p of u) - p.color = new Fe(`rgb(${p.color})`), p.position = { + p.color = new Oe(`rgb(${p.color})`), p.position = { x: p.startPoint.X * 0.3048 + i, y: p.startPoint.Z * 0.3048 + r, z: -p.startPoint.Y * 0.3048 + o @@ -36231,13 +36239,15 @@ function iw(s, e, t, n) { x: 0, y: 0, z: 0 - }, a.nodesMap.set(p.id, [p]), f.push(p); - Da("Ellipse", d, f, 4); + }, p.indexes = [ + [s.scene.children.length, g++, 0, 0] + ], a.nodesMap.set(Number(p.id), p), f.push(p); + La("Ellipse", d, f, t); } - if (La(d, "InstancedMesh"), h && h.length) { - let f = []; + if (h && h.length) { + let f = [], g = 0; for (let p of h) - p.color = new Fe(`rgb(${p.color})`), p.position = { + p.color = new Oe(`rgb(${p.color})`), p.position = { x: p.startPoint.X * 0.3048 + i, y: p.startPoint.Z * 0.3048 + r, z: -p.startPoint.Y * 0.3048 + o @@ -36245,21 +36255,19 @@ function iw(s, e, t, n) { x: 0, y: 0, z: 0 - }, a.nodesMap.set(p.id, [p]), f.push(p); - Da("Bridge", d, f, 5); + }, p.indexes = [ + [s.scene.children.length, g++, 0, 0] + ], a.nodesMap.set(Number(p.id), p), f.push(p); + La("Bridge", d, f, t); } } -function La(s, e) { - let t = new No(e.geometry, e.material, 1); - t.index = e.index, t.dataType = e.type, t.url = e.url, t.relativeIndex = e.relativeIndex, t.name = "机电", s.add(t); -} -function Da(s, e, t, n, i) { +function La(s, e, t, n, i) { let r, o, a = { width: 1, height: 1, length: 1, diameter: 1, - color: new Fe(), + color: new Oe(), position: { x: 0, y: 0, @@ -36273,29 +36281,29 @@ function Da(s, e, t, n, i) { }; switch (s) { case "Rect": - o = Ia("Rect", a); + o = Da("Rect", a); break; case "Bridge": - o = Ia("Bridge", a); + o = Da("Bridge", a); break; case "Circle": - o = Ia("Circle", a); + o = Da("Circle", a); break; case "Ellipse": - o = Ia("Ellipse", a); + o = Da("Ellipse", a); break; } - o && (r = new No(o.geometry, o.material, t.length)); + o && (r = new ws(o.geometry, o.material, t.length), r.url = n, e.add(r)); let l = []; for (var c = 0; c < t.length; c++) { - let d = t[c], f = new P(d.startPoint.X, 0, -d.startPoint.Y), p = new P(d.endPoint.X, 0, -d.endPoint.Y), g = new P(d.startPoint.X, d.startPoint.Z, -d.startPoint.Y), x = new P(d.endPoint.X, d.endPoint.Z, -d.endPoint.Y), m = 0, b = 0, v = 0; - if (Math.abs(p.clone().sub(f.clone()).z) < 0.01 && Math.abs(p.clone().sub(f.clone()).x) < 0.01) { + let d = t[c], f = new P(d.startPoint.X, 0, -d.startPoint.Y), g = new P(d.endPoint.X, 0, -d.endPoint.Y), p = new P(d.startPoint.X, d.startPoint.Z, -d.startPoint.Y), x = new P(d.endPoint.X, d.endPoint.Z, -d.endPoint.Y), m = 0, b = 0, v = 0; + if (Math.abs(g.clone().sub(f.clone()).z) < 0.01 && Math.abs(g.clone().sub(f.clone()).x) < 0.01) { if (m = (d.startPoint.Z > d.endPoint.Z ? 1 : -1) * Math.PI * 0.5, d.base_x != null) { var h = new P(d.base_x.X, 0, -d.base_x.Y); b = (h.clone().cross(new P(0, 0, 1)).y <= 0 ? 1 : -1) * h.angleTo(new P(0, 0, 1)) + Math.PI * 0.5; } } else - b = (p.clone().sub(f.clone()).cross(new P(0, 0, 1)).y > 0 ? -1 : 1) * p.clone().sub(f.clone()).angleTo(new P(0, 0, 1)), m = (d.startPoint.Z > d.endPoint.Z ? 1 : -1) * p.clone().sub(f.clone()).angleTo(x.clone().sub(g.clone())); + b = (g.clone().sub(f.clone()).cross(new P(0, 0, 1)).y > 0 ? -1 : 1) * g.clone().sub(f.clone()).angleTo(new P(0, 0, 1)), m = (d.startPoint.Z > d.endPoint.Z ? 1 : -1) * g.clone().sub(f.clone()).angleTo(x.clone().sub(p.clone())); let y = new ze(); const M = new wn(m, b, v, "YXZ"); let E = y.clone().makeRotationFromEuler(M), A, R; @@ -36321,7 +36329,7 @@ function Da(s, e, t, n, i) { x: d.endPoint.X * 0.3048, y: d.endPoint.Z * 0.3048, z: -d.endPoint.Y * 0.3048 - }, F.minC = W, F.maxC = j), l.push(F); + }, F.minC = W, F.maxC = j), r.ids || (r.ids = []), r.ids.push(Number(d.id)), l.push(F); } r.castShadow = !0, r.ElementInfos = l, r.name = "rootModel", r.TypeName = "InstancedMesh-Pipe", r.PipeType = s, r.MeshId = null, r.realMaterial = r.material.clone(), r.originalMaterial = r.material.clone(); let u = []; @@ -36330,10 +36338,10 @@ function Da(s, e, t, n, i) { matrix: r.matrix, position: r.position, rotation: r.rotation - }, r.meshs = u, r.instanceMatrix && r.instanceMatrix.array && (r.cloneInstanceMatrix = Array.from(r.instanceMatrix.array)), r.index = n, r.Version = "V1", e.children[n] = r; + }, r.meshs = u, r.instanceMatrix && r.instanceMatrix.array && (r.cloneInstanceMatrix = Array.from(r.instanceMatrix.array)); } -function Ia(s, e, t) { - let n = new Om(); +function Da(s, e, t) { + let n = new km(); switch (e.width = e.width * 0.3048, e.height = e.height * 0.3048, e.diameter = e.diameter * 0.3048, s) { case "Rect": n.moveTo(-e.width / 2, -e.height / 2), n.lineTo(-e.width / 2, e.height / 2), n.lineTo(e.width / 2, e.height / 2), n.lineTo(e.width / 2, -e.height / 2), n.lineTo(-e.width / 2, -e.height / 2); @@ -36355,7 +36363,7 @@ function Ia(s, e, t) { }; return r(n, i, e.color, e.position, e.rotation); function r(o, a, l, c, h) { - let u = new Fu(o, a), d = new bv({ + let u = new ku(o, a), d = new bv({ color: l, side: At // depthTest:false @@ -36364,7 +36372,7 @@ function Ia(s, e, t) { return f.position.set(c.x, c.y, c.z), f.rotation._order = "YXZ", f.rotation.set(h.x, h.y, h.z), f; } } -function sw(s, e = !1) { +function iw(s, e = !1) { const t = s[0].index !== null, n = new Set(Object.keys(s[0].attributes)), i = new Set(Object.keys(s[0].morphAttributes)), r = {}, o = {}, a = s[0].morphTargetsRelative, l = new ut(); let c = 0; for (let h = 0; h < s.length; ++h) { @@ -36402,8 +36410,8 @@ function sw(s, e = !1) { const u = []; for (let d = 0; d < s.length; ++d) { const f = s[d].index; - for (let p = 0; p < f.count; ++p) - u.push(f.getX(p) + h); + for (let g = 0; g < f.count; ++g) + u.push(f.getX(g) + h); h += s[d].attributes.position.count; } l.setIndex(u); @@ -36420,12 +36428,12 @@ function sw(s, e = !1) { l.morphAttributes = l.morphAttributes || {}, l.morphAttributes[h] = []; for (let d = 0; d < u; ++d) { const f = []; - for (let g = 0; g < o[h].length; ++g) - f.push(o[h][g][d]); - const p = rp(f); - if (!p) + for (let p = 0; p < o[h].length; ++p) + f.push(o[h][p][d]); + const g = rp(f); + if (!g) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + h + " morphAttribute."), null; - l.morphAttributes[h].push(p); + l.morphAttributes[h].push(g); } } return l; @@ -36451,9 +36459,9 @@ function rp(s) { if (h.isInterleavedBufferAttribute) { const u = l / t; for (let d = 0, f = h.count; d < f; d++) - for (let p = 0; p < t; p++) { - const g = h.getComponent(d, p); - a.setComponent(d + u, p, g); + for (let g = 0; g < t; g++) { + const p = h.getComponent(d, g); + a.setComponent(d + u, g, p); } } else o.set(h.array, l); @@ -36488,7 +36496,7 @@ function op(s, e) { } else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), s; } -class rw extends Ps { +class sw extends Rs { /** * Constructs a new glTF loader. * @@ -36496,39 +36504,39 @@ class rw extends Ps { */ constructor(e) { super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) { + return new cw(t); + }), this.register(function(t) { return new hw(t); }), this.register(function(t) { - return new uw(t); + return new bw(t); }), this.register(function(t) { return new yw(t); }), this.register(function(t) { return new _w(t); }), this.register(function(t) { - return new Mw(t); + return new dw(t); }), this.register(function(t) { return new fw(t); }), this.register(function(t) { return new pw(t); }), this.register(function(t) { return new mw(t); + }), this.register(function(t) { + return new lw(t); }), this.register(function(t) { return new gw(t); }), this.register(function(t) { - return new cw(t); - }), this.register(function(t) { - return new xw(t); - }), this.register(function(t) { - return new dw(t); - }), this.register(function(t) { - return new bw(t); + return new uw(t); }), this.register(function(t) { return new vw(t); }), this.register(function(t) { - return new aw(t); + return new xw(t); + }), this.register(function(t) { + return new ow(t); + }), this.register(function(t) { + return new Mw(t); }), this.register(function(t) { return new ww(t); - }), this.register(function(t) { - return new Sw(t); }); } /** @@ -36546,10 +36554,10 @@ class rw extends Ps { if (this.resourcePath !== "") o = this.resourcePath; else if (this.path !== "") { - const c = bo.extractUrlBase(e); - o = bo.resolveURL(c, this.path); + const c = yo.extractUrlBase(e); + o = yo.resolveURL(c, this.path); } else - o = bo.extractUrlBase(e); + o = yo.extractUrlBase(e); this.manager.itemStart(e); const a = function(c) { i ? i(c) : console.error(c), r.manager.itemError(e), r.manager.itemEnd(e); @@ -36630,7 +36638,7 @@ class rw extends Ps { else if (e instanceof ArrayBuffer) if (l.decode(new Uint8Array(e, 0, 4)) === C0) { try { - o[nt.KHR_BINARY_GLTF] = new Ew(e); + o[nt.KHR_BINARY_GLTF] = new Sw(e); } catch (h) { i && i(h); return; @@ -36662,16 +36670,16 @@ class rw extends Ps { const u = r.extensionsUsed[h], d = r.extensionsRequired || []; switch (u) { case nt.KHR_MATERIALS_UNLIT: - o[u] = new lw(); + o[u] = new aw(); break; case nt.KHR_DRACO_MESH_COMPRESSION: - o[u] = new Tw(r, this.dracoLoader); + o[u] = new Ew(r, this.dracoLoader); break; case nt.KHR_TEXTURE_TRANSFORM: - o[u] = new Aw(); + o[u] = new Tw(); break; case nt.KHR_MESH_QUANTIZATION: - o[u] = new Cw(); + o[u] = new Aw(); break; default: d.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".'); @@ -36694,7 +36702,7 @@ class rw extends Ps { }); } } -function ow() { +function rw() { let s = {}; return { get: function(e) { @@ -36735,7 +36743,7 @@ const nt = { EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression", EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing" }; -class aw { +class ow { constructor(e) { this.parser = e, this.name = nt.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} }; } @@ -36752,18 +36760,18 @@ class aw { if (i) return i; const r = t.json, o = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e]; let a; - const l = new Fe(16777215); - o.color !== void 0 && l.setRGB(o.color[0], o.color[1], o.color[2], Bt); + const l = new Oe(16777215); + o.color !== void 0 && l.setRGB(o.color[0], o.color[1], o.color[2], It); const c = o.range !== void 0 ? o.range : 0; switch (o.type) { case "directional": - a = new ur(l), a.target.position.set(0, 0, -1), a.add(a.target); + a = new dr(l), a.target.position.set(0, 0, -1), a.add(a.target); break; case "point": a = new Fv(l), a.distance = c; break; case "spot": - a = new Uv(l), a.distance = c, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, a.angle = o.spot.outerConeAngle, a.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, a.target.position.set(0, 0, -1), a.add(a.target); + a = new Ov(l), a.distance = c, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, a.angle = o.spot.outerConeAngle, a.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, a.target.position.set(0, 0, -1), a.add(a.target); break; default: throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type); @@ -36781,28 +36789,28 @@ class aw { }); } } -class lw { +class aw { constructor() { this.name = nt.KHR_MATERIALS_UNLIT; } getMaterialType() { - return Zt; + return qt; } extendParams(e, t, n) { const i = []; - e.color = new Fe(1, 1, 1), e.opacity = 1; + e.color = new Oe(1, 1, 1), e.opacity = 1; const r = t.pbrMetallicRoughness; if (r) { if (Array.isArray(r.baseColorFactor)) { const o = r.baseColorFactor; - e.color.setRGB(o[0], o[1], o[2], Bt), e.opacity = o[3]; + e.color.setRGB(o[0], o[1], o[2], It), e.opacity = o[3]; } r.baseColorTexture !== void 0 && i.push(n.assignTexture(e, "map", r.baseColorTexture, xt)); } return Promise.all(i); } } -class cw { +class lw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_EMISSIVE_STRENGTH; } @@ -36814,7 +36822,7 @@ class cw { return i !== void 0 && (t.emissiveIntensity = i), Promise.resolve(); } } -class hw { +class cw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_CLEARCOAT; } @@ -36834,7 +36842,7 @@ class hw { return Promise.all(r); } } -class uw { +class hw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_DISPERSION; } @@ -36850,7 +36858,7 @@ class uw { return t.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve(); } } -class dw { +class uw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_IRIDESCENCE; } @@ -36866,7 +36874,7 @@ class dw { return o.iridescenceFactor !== void 0 && (t.iridescence = o.iridescenceFactor), o.iridescenceTexture !== void 0 && r.push(n.assignTexture(t, "iridescenceMap", o.iridescenceTexture)), o.iridescenceIor !== void 0 && (t.iridescenceIOR = o.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), o.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = o.iridescenceThicknessMinimum), o.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = o.iridescenceThicknessMaximum), o.iridescenceThicknessTexture !== void 0 && r.push(n.assignTexture(t, "iridescenceThicknessMap", o.iridescenceThicknessTexture)), Promise.all(r); } } -class fw { +class dw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_SHEEN; } @@ -36879,16 +36887,16 @@ class fw { if (!i.extensions || !i.extensions[this.name]) return Promise.resolve(); const r = []; - t.sheenColor = new Fe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1; + t.sheenColor = new Oe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1; const o = i.extensions[this.name]; if (o.sheenColorFactor !== void 0) { const a = o.sheenColorFactor; - t.sheenColor.setRGB(a[0], a[1], a[2], Bt); + t.sheenColor.setRGB(a[0], a[1], a[2], It); } return o.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = o.sheenRoughnessFactor), o.sheenColorTexture !== void 0 && r.push(n.assignTexture(t, "sheenColorMap", o.sheenColorTexture, xt)), o.sheenRoughnessTexture !== void 0 && r.push(n.assignTexture(t, "sheenRoughnessMap", o.sheenRoughnessTexture)), Promise.all(r); } } -class pw { +class fw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_TRANSMISSION; } @@ -36904,7 +36912,7 @@ class pw { return o.transmissionFactor !== void 0 && (t.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && r.push(n.assignTexture(t, "transmissionMap", o.transmissionTexture)), Promise.all(r); } } -class mw { +class pw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_VOLUME; } @@ -36919,10 +36927,10 @@ class mw { const r = [], o = i.extensions[this.name]; t.thickness = o.thicknessFactor !== void 0 ? o.thicknessFactor : 0, o.thicknessTexture !== void 0 && r.push(n.assignTexture(t, "thicknessMap", o.thicknessTexture)), t.attenuationDistance = o.attenuationDistance || 1 / 0; const a = o.attenuationColor || [1, 1, 1]; - return t.attenuationColor = new Fe().setRGB(a[0], a[1], a[2], Bt), Promise.all(r); + return t.attenuationColor = new Oe().setRGB(a[0], a[1], a[2], It), Promise.all(r); } } -class gw { +class mw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_IOR; } @@ -36938,7 +36946,7 @@ class gw { return t.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve(); } } -class xw { +class gw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_SPECULAR; } @@ -36953,10 +36961,10 @@ class xw { const r = [], o = i.extensions[this.name]; t.specularIntensity = o.specularFactor !== void 0 ? o.specularFactor : 1, o.specularTexture !== void 0 && r.push(n.assignTexture(t, "specularIntensityMap", o.specularTexture)); const a = o.specularColorFactor || [1, 1, 1]; - return t.specularColor = new Fe().setRGB(a[0], a[1], a[2], Bt), o.specularColorTexture !== void 0 && r.push(n.assignTexture(t, "specularColorMap", o.specularColorTexture, xt)), Promise.all(r); + return t.specularColor = new Oe().setRGB(a[0], a[1], a[2], It), o.specularColorTexture !== void 0 && r.push(n.assignTexture(t, "specularColorMap", o.specularColorTexture, xt)), Promise.all(r); } } -class vw { +class xw { constructor(e) { this.parser = e, this.name = nt.EXT_MATERIALS_BUMP; } @@ -36972,7 +36980,7 @@ class vw { return t.bumpScale = o.bumpFactor !== void 0 ? o.bumpFactor : 1, o.bumpTexture !== void 0 && r.push(n.assignTexture(t, "bumpMap", o.bumpTexture)), Promise.all(r); } } -class bw { +class vw { constructor(e) { this.parser = e, this.name = nt.KHR_MATERIALS_ANISOTROPY; } @@ -36988,7 +36996,7 @@ class bw { return o.anisotropyStrength !== void 0 && (t.anisotropy = o.anisotropyStrength), o.anisotropyRotation !== void 0 && (t.anisotropyRotation = o.anisotropyRotation), o.anisotropyTexture !== void 0 && r.push(n.assignTexture(t, "anisotropyMap", o.anisotropyTexture)), Promise.all(r); } } -class yw { +class bw { constructor(e) { this.parser = e, this.name = nt.KHR_TEXTURE_BASISU; } @@ -37005,7 +37013,7 @@ class yw { return t.loadTextureImage(e, r.source, o); } } -class _w { +class yw { constructor(e) { this.parser = e, this.name = nt.EXT_TEXTURE_WEBP; } @@ -37022,7 +37030,7 @@ class _w { return n.loadTextureImage(e, o.source, l); } } -class Mw { +class _w { constructor(e) { this.parser = e, this.name = nt.EXT_TEXTURE_AVIF; } @@ -37039,7 +37047,7 @@ class Mw { return n.loadTextureImage(e, o.source, l); } } -class ww { +class Mw { constructor(e) { this.name = nt.EXT_MESHOPT_COMPRESSION, this.parser = e; } @@ -37065,7 +37073,7 @@ class ww { return null; } } -class Sw { +class ww { constructor(e) { this.name = nt.EXT_MESH_GPU_INSTANCING, this.parser = e; } @@ -37083,25 +37091,25 @@ class Sw { return o.length < 1 ? null : (o.push(this.parser.createNodeMesh(e)), Promise.all(o).then((l) => { const c = l.pop(), h = c.isGroup ? c.children : [c], u = l[0].count, d = []; for (const f of h) { - const p = new ze(), g = new P(), x = new zn(), m = new P(1, 1, 1), b = new No(f.geometry, f.material, u); + const g = new ze(), p = new P(), x = new zn(), m = new P(1, 1, 1), b = new ws(f.geometry, f.material, u); for (let v = 0; v < u; v++) - a.TRANSLATION && g.fromBufferAttribute(a.TRANSLATION, v), a.ROTATION && x.fromBufferAttribute(a.ROTATION, v), a.SCALE && m.fromBufferAttribute(a.SCALE, v), b.setMatrixAt(v, p.compose(g, x, m)); + a.TRANSLATION && p.fromBufferAttribute(a.TRANSLATION, v), a.ROTATION && x.fromBufferAttribute(a.ROTATION, v), a.SCALE && m.fromBufferAttribute(a.SCALE, v), b.setMatrixAt(v, g.compose(p, x, m)); for (const v in a) if (v === "_COLOR_0") { const y = a[v]; - b.instanceColor = new Zh(y.array, y.itemSize, y.normalized); + b.instanceColor = new xl(y.array, y.itemSize, y.normalized); } else v !== "TRANSLATION" && v !== "ROTATION" && v !== "SCALE" && f.geometry.setAttribute(v, a[v]); - St.prototype.copy.call(b, f), this.parser.assignFinalMaterial(b), d.push(b); + wt.prototype.copy.call(b, f), this.parser.assignFinalMaterial(b), d.push(b); } return c.isGroup ? (c.clear(), c.add(...d), c) : d[0]; })); } } -const C0 = "glTF", Qr = 12, ap = { JSON: 1313821514, BIN: 5130562 }; -class Ew { +const C0 = "glTF", eo = 12, ap = { JSON: 1313821514, BIN: 5130562 }; +class Sw { constructor(e) { this.name = nt.KHR_BINARY_GLTF, this.content = null, this.body = null; - const t = new DataView(e, 0, Qr), n = new TextDecoder(); + const t = new DataView(e, 0, eo), n = new TextDecoder(); if (this.header = { magic: n.decode(new Uint8Array(e.slice(0, 4))), version: t.getUint32(4, !0), @@ -37110,17 +37118,17 @@ class Ew { 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 - Qr, r = new DataView(e, Qr); + const i = this.header.length - eo, r = new DataView(e, eo); let o = 0; for (; o < i; ) { const a = r.getUint32(o, !0); o += 4; const l = r.getUint32(o, !0); if (o += 4, l === ap.JSON) { - const c = new Uint8Array(e, Qr + o, a); + const c = new Uint8Array(e, eo + o, a); this.content = n.decode(c); } else if (l === ap.BIN) { - const c = Qr + o; + const c = eo + o; this.body = e.slice(c, c + a); } o += a; @@ -37129,7 +37137,7 @@ class Ew { throw new Error("THREE.GLTFLoader: JSON content not found."); } } -class Tw { +class Ew { constructor(e, t) { if (!t) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided."); @@ -37138,30 +37146,30 @@ class Tw { decodePrimitive(e, t) { const n = this.json, i = this.dracoLoader, r = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, c = {}; for (const h in o) { - const u = ru[h] || h.toLowerCase(); + const u = su[h] || h.toLowerCase(); a[u] = o[h]; } for (const h in e.attributes) { - const u = ru[h] || h.toLowerCase(); + const u = su[h] || h.toLowerCase(); if (o[h] !== void 0) { - const d = n.accessors[e.attributes[h]], f = gr[d.componentType]; + const d = n.accessors[e.attributes[h]], f = xr[d.componentType]; c[u] = f.name, l[u] = d.normalized === !0; } } return t.getDependency("bufferView", r).then(function(h) { return new Promise(function(u, d) { i.decodeDracoFile(h, function(f) { - for (const p in f.attributes) { - const g = f.attributes[p], x = l[p]; - x !== void 0 && (g.normalized = x); + for (const g in f.attributes) { + const p = f.attributes[g], x = l[g]; + x !== void 0 && (p.normalized = x); } u(f); - }, a, c, Bt, d); + }, a, c, It, d); }); }); } } -class Aw { +class Tw { constructor() { this.name = nt.KHR_TEXTURE_TRANSFORM; } @@ -37169,12 +37177,12 @@ class Aw { return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), 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 = !0), e; } } -class Cw { +class Aw { constructor() { this.name = nt.KHR_MESH_QUANTIZATION; } } -class P0 extends Uo { +class P0 extends Oo { constructor(e, t, n, i) { super(e, t, n, i); } @@ -37185,19 +37193,19 @@ class P0 extends Uo { return t; } interpolate_(e, t, n, i) { - const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, h = i - t, u = (n - t) / h, d = u * u, f = d * u, p = e * c, g = p - c, x = -2 * f + 3 * d, m = f - d, b = 1 - x, v = m - d + u; + const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, h = i - t, u = (n - t) / h, d = u * u, f = d * u, g = e * c, p = g - c, x = -2 * f + 3 * d, m = f - d, b = 1 - x, v = m - d + u; for (let y = 0; y !== a; y++) { - const M = o[g + y + a], E = o[g + y + l] * h, A = o[p + y + a], R = o[p + y] * h; + const M = o[p + y + a], E = o[p + y + l] * h, A = o[g + y + a], R = o[g + y] * h; r[y] = b * M + v * E + x * A + m * R; } return r; } } -const Pw = new zn(); -class Rw extends P0 { +const Cw = new zn(); +class Pw extends P0 { interpolate_(e, t, n, i) { const r = super.interpolate_(e, t, n, i); - return Pw.fromArray(r).normalize().toArray(r), r; + return Cw.fromArray(r).normalize().toArray(r), r; } } const In = { @@ -37208,7 +37216,7 @@ const In = { TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6 -}, gr = { +}, xr = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, @@ -37219,12 +37227,12 @@ const In = { 9728: Qt, 9729: Yt, 9984: hm, - 9985: el, - 9986: co, + 9985: Qa, + 9986: ho, 9987: Ai }, cp = { 33071: ai, - 33648: pl, + 33648: fl, 10497: hi }, Lc = { SCALAR: 1, @@ -37234,7 +37242,7 @@ const In = { MAT2: 4, MAT3: 9, MAT4: 16 -}, ru = { +}, su = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", @@ -37250,19 +37258,19 @@ const In = { translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" -}, Lw = { +}, Rw = { 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: To, - STEP: Eo + LINEAR: Ao, + STEP: To }, Dc = { OPAQUE: "OPAQUE", MASK: "MASK", BLEND: "BLEND" }; -function Dw(s) { - return s.DefaultMaterial === void 0 && (s.DefaultMaterial = new Ss({ +function Lw(s) { + return s.DefaultMaterial === void 0 && (s.DefaultMaterial = new Es({ color: 16777215, emissive: 0, metalness: 1, @@ -37279,7 +37287,7 @@ function cs(s, e, t) { function si(s, e) { e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(s.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras)); } -function Iw(s, e, t) { +function Dw(s, e, t) { let n = !1, i = !1, r = !1; for (let c = 0, h = e.length; c < h; c++) { const u = e[c]; @@ -37311,7 +37319,7 @@ function Iw(s, e, t) { return n && (s.morphAttributes.position = h), i && (s.morphAttributes.normal = u), r && (s.morphAttributes.color = d), s.morphTargetsRelative = !0, s; }); } -function Bw(s, e) { +function Iw(s, e) { if (s.updateMorphTargets(), e.weights !== void 0) for (let t = 0, n = e.weights.length; t < n; t++) s.morphTargetInfluences[t] = e.weights[t]; @@ -37325,7 +37333,7 @@ function Bw(s, e) { console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names."); } } -function Nw(s) { +function Bw(s) { let e; const t = s.extensions && s.extensions[nt.KHR_DRACO_MESH_COMPRESSION]; if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Ic(t.attributes) : e = s.indices + ":" + Ic(s.attributes) + ":" + s.mode, s.targets !== void 0) @@ -37340,7 +37348,7 @@ function Ic(s) { e += t[n] + ":" + s[t[n]] + ";"; return e; } -function ou(s) { +function ru(s) { switch (s) { case Int8Array: return 1 / 127; @@ -37354,13 +37362,13 @@ function ou(s) { throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type."); } } -function kw(s) { +function Nw(s) { return s.search(/\.jpe?g($|\?)/i) > 0 || s.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : s.search(/\.webp($|\?)/i) > 0 || s.search(/^data\:image\/webp/) === 0 ? "image/webp" : s.search(/\.ktx2($|\?)/i) > 0 || s.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png"; } const Uw = new ze(); class Ow { constructor(e = {}, t = {}) { - this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new ow(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {}; + this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new rw(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {}; let n = !1, i = -1, r = !1, o = -1; if (typeof navigator < "u") { const a = navigator.userAgent; @@ -37579,7 +37587,7 @@ class Ow { return Promise.resolve(this.extensions[nt.KHR_BINARY_GLTF].body); const i = this.options; return new Promise(function(r, o) { - n.load(bo.resolveURL(t.uri, i.path), r, void 0, function() { + n.load(yo.resolveURL(t.uri, i.path), r, void 0, function() { o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".')); }); }); @@ -37608,27 +37616,27 @@ class Ow { loadAccessor(e) { const t = this, n = this.json, i = this.json.accessors[e]; if (i.bufferView === void 0 && i.sparse === void 0) { - const o = Lc[i.type], a = gr[i.componentType], l = i.normalized === !0, c = new a(i.count * o); + const o = Lc[i.type], a = xr[i.componentType], l = i.normalized === !0, c = new a(i.count * o); return Promise.resolve(new at(c, o, l)); } const r = []; return i.bufferView !== void 0 ? r.push(this.getDependency("bufferView", i.bufferView)) : r.push(null), i.sparse !== void 0 && (r.push(this.getDependency("bufferView", i.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", i.sparse.values.bufferView))), Promise.all(r).then(function(o) { - const a = o[0], l = Lc[i.type], c = gr[i.componentType], h = c.BYTES_PER_ELEMENT, u = h * l, d = i.byteOffset || 0, f = i.bufferView !== void 0 ? n.bufferViews[i.bufferView].byteStride : void 0, p = i.normalized === !0; - let g, x; + const a = o[0], l = Lc[i.type], c = xr[i.componentType], h = c.BYTES_PER_ELEMENT, u = h * l, d = i.byteOffset || 0, f = i.bufferView !== void 0 ? n.bufferViews[i.bufferView].byteStride : void 0, g = i.normalized === !0; + let p, x; if (f && f !== u) { const m = Math.floor(d / f), b = "InterleavedBuffer:" + i.bufferView + ":" + i.componentType + ":" + m + ":" + i.count; let v = t.cache.get(b); - v || (g = new c(a, m * f, i.count * f / h), v = new Iu(g, f / h), t.cache.add(b, v)), x = new Er(v, l, d % f / h, p); + v || (p = new c(a, m * f, i.count * f / h), v = new Du(p, f / h), t.cache.add(b, v)), x = new Tr(v, l, d % f / h, g); } else - a === null ? g = new c(i.count * l) : g = new c(a, d, i.count * l), x = new at(g, l, p); + a === null ? p = new c(i.count * l) : p = new c(a, d, i.count * l), x = new at(p, l, g); if (i.sparse !== void 0) { - const m = Lc.SCALAR, b = gr[i.sparse.indices.componentType], v = i.sparse.indices.byteOffset || 0, y = i.sparse.values.byteOffset || 0, M = new b(o[1], v, i.sparse.count * m), E = new c(o[2], y, i.sparse.count * l); + const m = Lc.SCALAR, b = xr[i.sparse.indices.componentType], v = i.sparse.indices.byteOffset || 0, y = i.sparse.values.byteOffset || 0, M = new b(o[1], v, i.sparse.count * m), E = new c(o[2], y, i.sparse.count * l); a !== null && (x = new at(x.array.slice(), x.itemSize, x.normalized)), x.normalized = !1; for (let A = 0, R = M.length; A < R; A++) { const _ = M[A]; if (x.setX(_, E[A * l]), l >= 2 && x.setY(_, E[A * l + 1]), l >= 3 && x.setZ(_, E[A * l + 2]), l >= 4 && x.setW(_, E[A * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute."); } - x.normalized = p; + x.normalized = g; } return x; }); @@ -37678,14 +37686,14 @@ class Ow { throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView"); const h = Promise.resolve(l).then(function(u) { return new Promise(function(d, f) { - let p = d; - t.isImageBitmapLoader === !0 && (p = function(g) { - const x = new Ht(g); + let g = d; + t.isImageBitmapLoader === !0 && (g = function(p) { + const x = new Ht(p); x.needsUpdate = !0, d(x); - }), t.load(bo.resolveURL(u, r.path), p, void 0, f); + }), t.load(yo.resolveURL(u, r.path), g, void 0, f); }); }).then(function(u) { - return c === !0 && a.revokeObjectURL(l), si(u, o), u.userData.mimeType = o.mimeType || kw(o.uri), u; + return c === !0 && a.revokeObjectURL(l), si(u, o), u.userData.mimeType = o.mimeType || Nw(o.uri), u; }).catch(function(u) { throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u; }); @@ -37736,7 +37744,7 @@ class Ow { } else if (e.isLine) { const a = "LineBasicMaterial:" + n.uuid; let l = this.cache.get(a); - l || (l = new Cs(), yn.prototype.copy.call(l, n), l.color.copy(n.color), l.map = n.map, this.cache.add(a, l)), n = l; + l || (l = new Ps(), yn.prototype.copy.call(l, n), l.color.copy(n.color), l.map = n.map, this.cache.add(a, l)), n = l; } if (i || r || o) { let a = "ClonedMaterial:" + n.uuid + ":"; @@ -37747,7 +37755,7 @@ class Ow { e.material = n; } getMaterialType() { - return Ss; + return Es; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials @@ -37765,9 +37773,9 @@ class Ow { o = u.getMaterialType(), c.push(u.extendParams(a, r, t)); } else { const u = r.pbrMetallicRoughness || {}; - if (a.color = new Fe(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) { + if (a.color = new Oe(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) { const d = u.baseColorFactor; - a.color.setRGB(d[0], d[1], d[2], Bt), a.opacity = d[3]; + a.color.setRGB(d[0], d[1], d[2], It), a.opacity = d[3]; } u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture, xt)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), o = this._invokeOne(function(d) { return d.getMaterialType && d.getMaterialType(e); @@ -37777,15 +37785,15 @@ class Ow { } r.doubleSided === !0 && (a.side = At); const h = r.alphaMode || Dc.OPAQUE; - if (h === Dc.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === Dc.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== Zt && (c.push(t.assignTexture(a, "normalMap", r.normalTexture)), a.normalScale = new ce(1, 1), r.normalTexture.scale !== void 0)) { + if (h === Dc.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === Dc.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== qt && (c.push(t.assignTexture(a, "normalMap", r.normalTexture)), a.normalScale = new ce(1, 1), r.normalTexture.scale !== void 0)) { const u = r.normalTexture.scale; a.normalScale.set(u, u); } - if (r.occlusionTexture !== void 0 && o !== Zt && (c.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== Zt) { + if (r.occlusionTexture !== void 0 && o !== qt && (c.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== qt) { const u = r.emissiveFactor; - a.emissive = new Fe().setRGB(u[0], u[1], u[2], Bt); + a.emissive = new Oe().setRGB(u[0], u[1], u[2], It); } - return r.emissiveTexture !== void 0 && o !== Zt && c.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, xt)), Promise.all(c).then(function() { + return r.emissiveTexture !== void 0 && o !== qt && c.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, xt)), Promise.all(c).then(function() { const u = new o(a); return r.name && (u.name = r.name), si(u, r), t.associations.set(u, { materials: e }), r.extensions && cs(i, u, r), u; }); @@ -37819,7 +37827,7 @@ class Ow { } const o = []; for (let a = 0, l = e.length; a < l; a++) { - const c = e[a], h = Nw(c), u = i[h]; + const c = e[a], h = Bw(c), u = i[h]; if (u) o.push(u.promise); else { @@ -37839,30 +37847,30 @@ class Ow { loadMesh(e) { const t = this, n = this.json, i = this.extensions, r = n.meshes[e], o = r.primitives, a = []; for (let l = 0, c = o.length; l < c; l++) { - const h = o[l].material === void 0 ? Dw(this.cache) : this.getDependency("material", o[l].material); + const h = o[l].material === void 0 ? Lw(this.cache) : this.getDependency("material", o[l].material); a.push(h); } return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) { const c = l.slice(0, l.length - 1), h = l[l.length - 1], u = []; - for (let f = 0, p = h.length; f < p; f++) { - const g = h[f], x = o[f]; + for (let f = 0, g = h.length; f < g; f++) { + const p = h[f], x = o[f]; let m; const b = c[f]; if (x.mode === In.TRIANGLES || x.mode === In.TRIANGLE_STRIP || x.mode === In.TRIANGLE_FAN || x.mode === void 0) - m = r.isSkinnedMesh === !0 ? new Dx(g, b) : new dt(g, b), m.isSkinnedMesh === !0 && m.normalizeSkinWeights(), x.mode === In.TRIANGLE_STRIP ? m.geometry = op(m.geometry, xm) : x.mode === In.TRIANGLE_FAN && (m.geometry = op(m.geometry, jh)); + m = r.isSkinnedMesh === !0 ? new Dx(p, b) : new dt(p, b), m.isSkinnedMesh === !0 && m.normalizeSkinWeights(), x.mode === In.TRIANGLE_STRIP ? m.geometry = op(m.geometry, xm) : x.mode === In.TRIANGLE_FAN && (m.geometry = op(m.geometry, jh)); else if (x.mode === In.LINES) - m = new Rm(g, b); + m = new Rm(p, b); else if (x.mode === In.LINE_STRIP) - m = new es(g, b); + m = new es(p, b); else if (x.mode === In.LINE_LOOP) - m = new Ox(g, b); + m = new kx(p, b); else if (x.mode === In.POINTS) - m = new Dm(g, b); + m = new Dm(p, b); else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + x.mode); - Object.keys(m.geometry.morphAttributes).length > 0 && Bw(m, r), m.name = t.createUniqueName(r.name || "mesh_" + e), si(m, r), x.extensions && cs(i, m, x), t.assignFinalMaterial(m), u.push(m); + Object.keys(m.geometry.morphAttributes).length > 0 && Iw(m, r), m.name = t.createUniqueName(r.name || "mesh_" + e), si(m, r), x.extensions && cs(i, m, x), t.assignFinalMaterial(m), u.push(m); } - for (let f = 0, p = u.length; f < p; f++) + for (let f = 0, g = u.length; f < g; f++) t.associations.set(u[f], { meshes: e, primitives: f @@ -37871,7 +37879,7 @@ class Ow { return r.extensions && cs(i, u[0], r), u[0]; const d = new vn(); r.extensions && cs(i, d, r), t.associations.set(d, { meshes: e }); - for (let f = 0, p = u.length; f < p; f++) + for (let f = 0, g = u.length; f < g; f++) d.add(u[f]); return d; }); @@ -37890,7 +37898,7 @@ class Ow { console.warn("THREE.GLTFLoader: Missing camera parameters."); return; } - return n.type === "perspective" ? t = new nn(go.radToDeg(i.yfov), i.aspectRatio || 1, i.znear || 1, i.zfar || 2e6) : n.type === "orthographic" && (t = new Rs(-i.xmag, i.xmag, i.ymag, -i.ymag, i.znear, i.zfar)), n.name && (t.name = this.createUniqueName(n.name)), si(t, n), Promise.resolve(t); + return n.type === "perspective" ? t = new nn(xo.radToDeg(i.yfov), i.aspectRatio || 1, i.znear || 1, i.zfar || 2e6) : n.type === "orthographic" && (t = new Ls(-i.xmag, i.xmag, i.ymag, -i.ymag, i.znear, i.zfar)), n.name && (t.name = this.createUniqueName(n.name)), si(t, n), Promise.resolve(t); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins @@ -37914,7 +37922,7 @@ class Ow { } else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]); } - return new Bu(a, l); + return new Iu(a, l); }); } /** @@ -37927,8 +37935,8 @@ class Ow { loadAnimation(e) { const t = this.json, n = this, i = t.animations[e], r = i.name ? i.name : "animation_" + e, o = [], a = [], l = [], c = [], h = []; for (let u = 0, d = i.channels.length; u < d; u++) { - const f = i.channels[u], p = i.samplers[f.sampler], g = f.target, x = g.node, m = i.parameters !== void 0 ? i.parameters[p.input] : p.input, b = i.parameters !== void 0 ? i.parameters[p.output] : p.output; - g.node !== void 0 && (o.push(this.getDependency("node", x)), a.push(this.getDependency("accessor", m)), l.push(this.getDependency("accessor", b)), c.push(p), h.push(g)); + const f = i.channels[u], g = i.samplers[f.sampler], p = f.target, x = p.node, m = i.parameters !== void 0 ? i.parameters[g.input] : g.input, b = i.parameters !== void 0 ? i.parameters[g.output] : g.output; + p.node !== void 0 && (o.push(this.getDependency("node", x)), a.push(this.getDependency("accessor", m)), l.push(this.getDependency("accessor", b)), c.push(g), h.push(p)); } return Promise.all([ Promise.all(o), @@ -37937,9 +37945,9 @@ class Ow { Promise.all(c), Promise.all(h) ]).then(function(u) { - const d = u[0], f = u[1], p = u[2], g = u[3], x = u[4], m = []; + const d = u[0], f = u[1], g = u[2], p = u[3], x = u[4], m = []; for (let v = 0, y = d.length; v < y; v++) { - const M = d[v], E = f[v], A = p[v], R = g[v], _ = x[v]; + const M = d[v], E = f[v], A = g[v], R = p[v], _ = x[v]; if (M === void 0) continue; M.updateMatrix && M.updateMatrix(); const S = n._createAnimationTracks(M, E, A, R, _); @@ -37983,7 +37991,7 @@ class Ow { d !== null && h.traverse(function(f) { f.isSkinnedMesh && f.bind(d, Uw); }); - for (let f = 0, p = u.length; f < p; f++) + for (let f = 0, g = u.length; f < g; f++) h.add(u[f]); return h; }); @@ -38005,7 +38013,7 @@ class Ow { a.push(c); }), this.nodeCache[e] = Promise.all(a).then(function(c) { let h; - if (r.isBone === !0 ? h = new Pm() : c.length > 1 ? h = new vn() : c.length === 1 ? h = c[0] : h = new St(), h !== c[0]) + if (r.isBone === !0 ? h = new Pm() : c.length > 1 ? h = new vn() : c.length === 1 ? h = c[0] : h = new wt(), h !== c[0]) for (let u = 0, d = c.length; u < d; u++) h.add(c[u]); if (r.name && (h.userData.name = r.name, h.name = o), si(h, r), r.extensions && cs(n, h, r), r.matrix !== void 0) { @@ -38058,44 +38066,44 @@ class Ow { let c; switch (Hi[r.path]) { case Hi.weights: - c = Ar; + c = Cr; break; case Hi.rotation: - c = Cr; + c = Pr; break; case Hi.translation: case Hi.scale: - c = Pr; + c = Rr; break; default: switch (n.itemSize) { case 1: - c = Ar; + c = Cr; break; case 2: case 3: default: - c = Pr; + c = Rr; break; } break; } - const h = i.interpolation !== void 0 ? Lw[i.interpolation] : To, u = this._getArrayFromAccessor(n); + const h = i.interpolation !== void 0 ? Rw[i.interpolation] : Ao, u = this._getArrayFromAccessor(n); for (let d = 0, f = l.length; d < f; d++) { - const p = new c( + const g = new c( l[d] + "." + Hi[r.path], t.array, u, h ); - i.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p); + i.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g), o.push(g); } return o; } _getArrayFromAccessor(e) { let t = e.array; if (e.normalized) { - const n = ou(t.constructor), i = new Float32Array(t.length); + const n = ru(t.constructor), i = new Float32Array(t.length); for (let r = 0, o = t.length; r < o; r++) i[r] = t[r] * n; t = i; @@ -38104,12 +38112,12 @@ class Ow { } _createCubicSplineTrackInterpolant(e) { e.createInterpolant = function(t) { - const n = this instanceof Cr ? Rw : P0; + const n = this instanceof Pr ? Pw : P0; return new n(this.times, this.values, this.getValueSize() / 3, t); }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0; } } -function Fw(s, e, t) { +function kw(s, e, t) { const n = e.attributes, i = new vt(); if (n.POSITION !== void 0) { const a = t.json.accessors[n.POSITION], l = a.min, c = a.max; @@ -38118,7 +38126,7 @@ function Fw(s, e, t) { new P(l[0], l[1], l[2]), new P(c[0], c[1], c[2]) ), a.normalized) { - const h = ou(gr[a.componentType]); + const h = ru(xr[a.componentType]); i.min.multiplyScalar(h), i.max.multiplyScalar(h); } } else { @@ -38133,11 +38141,11 @@ function Fw(s, e, t) { for (let c = 0, h = r.length; c < h; c++) { const u = r[c]; if (u.POSITION !== void 0) { - const d = t.json.accessors[u.POSITION], f = d.min, p = d.max; - if (f !== void 0 && p !== void 0) { - if (l.setX(Math.max(Math.abs(f[0]), Math.abs(p[0]))), l.setY(Math.max(Math.abs(f[1]), Math.abs(p[1]))), l.setZ(Math.max(Math.abs(f[2]), Math.abs(p[2]))), d.normalized) { - const g = ou(gr[d.componentType]); - l.multiplyScalar(g); + const d = t.json.accessors[u.POSITION], f = d.min, g = d.max; + if (f !== void 0 && g !== void 0) { + if (l.setX(Math.max(Math.abs(f[0]), Math.abs(g[0]))), l.setY(Math.max(Math.abs(f[1]), Math.abs(g[1]))), l.setZ(Math.max(Math.abs(f[2]), Math.abs(g[2]))), d.normalized) { + const p = ru(xr[d.componentType]); + l.multiplyScalar(p); } a.max(l); } else @@ -38158,7 +38166,7 @@ function hp(s, e, t) { }); } for (const o in n) { - const a = ru[o] || o.toLowerCase(); + const a = su[o] || o.toLowerCase(); a in s.attributes || i.push(r(n[o], a)); } if (e.indices !== void 0 && !s.index) { @@ -38167,11 +38175,11 @@ function hp(s, e, t) { }); i.push(o); } - return st.workingColorSpace !== Bt && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${st.workingColorSpace}" not supported.`), si(s, e), Fw(s, e, t), Promise.all(i).then(function() { - return e.targets !== void 0 ? Iw(s, e.targets, t) : s; + return st.workingColorSpace !== It && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${st.workingColorSpace}" not supported.`), si(s, e), kw(s, e, t), Promise.all(i).then(function() { + return e.targets !== void 0 ? Dw(s, e.targets, t) : s; }); } -function zw(s, e, t) { +function Fw(s, e, t) { let n = new vn(); n.name = e, s.scene.add(n), A0(e + "/info", (i) => { let r = JSON.parse(i); @@ -38189,55 +38197,65 @@ function zw(s, e, t) { min: new P(r.baseInfo.min.X * 0.3048, r.baseInfo.min.Z * 0.3048, -r.baseInfo.min.Y * 0.3048), max: new P(r.baseInfo.max.X * 0.3048, r.baseInfo.max.Z * 0.3048, -r.baseInfo.max.Y * 0.3048) } - }), s.events.trigger(Dr.EngineFree, null); + }), s.events.trigger(Ir.EngineFree, null); }); } -function Hw(s) { +function zw(s) { s.engineStatus.models.forEach((e) => { e.loadStatus == null && (e.loadStatus = { mep: !1, instance: !1, normal: !1 - }), e.status === "loading" && e.type === "light" && (e.loadStatus.modelMep != !0 && (e.loadStatus.modelMep = !0, iw(s, e.info.modelMep, e.url)), e.loadStatus.normal != !0 && Vw(s, e)); + }), e.status === "loading" && e.type === "light" && (e.loadStatus.modelMep != !0 && (e.loadStatus.modelMep = !0, nw(s, e.info.modelMep, e.url)), e.loadStatus.normal != !0 && Hw(s, e)); }); } -function Vw(s, e) { +function Hw(s, e) { if (s.camera.position, e.size, e.info == null || e.info.lods == null) return; e.info.lods.forEach((n) => { if (n.status != !0) if (n.glbs == null) - console.log("加载GLB............."), n.glbs = {}, ew(e.url + n.path, (i) => { - Q3(i.get("/nodes.json"), (r) => { - let o = JSON.parse(r), a = /* @__PURE__ */ new Map(); - s.models.find((c) => c.url == e.url).nodesMap = a; - let l = 0; + console.log("加载GLB............."), n.glbs = {}, Q3(e.url + n.path, (i) => { + sp(i.get("/nodes.json"), (r) => { + let o = JSON.parse(r); + s.models.find((c) => c.url == e.url).nodesMap == null && (s.models.find((c) => c.url == e.url).nodesMap = /* @__PURE__ */ new Map()); + let a = s.models.find((c) => c.url == e.url).nodesMap, l = 0; for (let c in o) { o[c].forEach((d) => { d.glb = c, a.has(d.id) == !1 ? a.set(d.id, { infos: [d] }) : a.get(d.id).infos.push(d); }); - let h = new rw(); - const u = new tw(); + let h = new sw(); + const u = new ew(); u.setDecoderPath("/static/js/draco/"), u.preload(), h.setDRACOLoader(u), h.load(i.get(c + ".glb"), (d) => { - n.glbs[c] = d.scene.children, l++, l == Object.keys(o).length && s.engineStatus.isFree && (s.events.trigger(Dr.EngineFree, null), s.viewCube.CameraGoHome()); + n.glbs[c] = d.scene.children, l++, l == Object.keys(o).length && s.engineStatus.isFree && (s.events.trigger(Ir.EngineFree, null), s.viewCube.CameraGoHome()); }); } + sp(i.get("/instances.json"), (c) => { + let h = JSON.parse(c); + s.models.find((u) => u.url == e.url).instanceNodes = h; + }); }); }); else { console.log("加载模型............."); - let i = t(e, n, n.octreeBox), r = [], o = s.models.find((a) => a.url == e.url); - i.forEach((a) => { - o.nodesMap.has(a) && o.nodesMap.get(a).infos.forEach((l) => { - let c = n.glbs[l.glb][l.mesh]; - if (c != null && c.geometry != null && c.material != null) { - let h = new ze(); - h.elements = l.matrix; - let u = new dt(c.geometry.clone().applyMatrix4(h), c.material), d = new vt().setFromObject(u); - l.box = d, l.mesh = u, u.name = a, u.glb = l.glb, u.url = e.url, r.push(u); + let i = t(e, n, n.octreeBox), r = [], o = s.models.find((l) => l.url == e.url); + i.forEach((l) => { + o.nodesMap.has(l) && o.nodesMap.get(l).infos.forEach((c) => { + let h = n.glbs[c.glb][c.mesh]; + if (h != null && h.geometry != null && h.material != null) { + let u = new ze(); + u.elements = c.matrix; + let d = new dt(h.geometry.clone().applyMatrix4(u), h.material), f = new vt().setFromObject(d); + c.box = f, c.mesh = d, d.name = l, d.glb = c.glb, d.url = e.url, r.push(d); } }); - }), console.log("加载模型数量", r.length), Gw(e.url, s, r); + }), console.log("加载模型数量", r.length), Vw(e.url, s, r); + let a = o.instanceNodes; + for (let l in a) + (a[l].isLoaded == null || a[l].isLoaded == !1) && (a[l].isLoaded = !0, a[l].forEach((c) => { + let h = n.glbs[l][c.mesh]; + Gw(e.url, c.mesh, s, h, c.children); + })); } }); function t(n, i, r) { @@ -38257,7 +38275,7 @@ function Vw(s, e) { return o; } } -function Gw(s, e, t) { +function Vw(s, e, t) { let n = []; t.forEach((i) => { n.findIndex((o) => o.glb == i.glb) == -1 ? n.push({ @@ -38274,7 +38292,7 @@ function Gw(s, e, t) { r.castShadow = !0, r.receiveShadow = !0; else { let o = new ut(); - i.meshes.map((c) => c.material), o = sw(i.meshes.map((c) => c.geometry), !0); + i.meshes.map((c) => c.material), o = iw(i.meshes.map((c) => c.geometry), !0); let a = new dt(o, i.meshes.map((c) => c.material)); a.castShadow = !0, a.receiveShadow = !0, e.scene.add(a), a.index = e.scene.children.length - 1, a.url = s, a.glb = i.glb, a.indexes = i.indexes, a.materialClone = i.meshes[0].material; let l = e.models.find((c) => c.url == s); @@ -38290,8 +38308,21 @@ function Gw(s, e, t) { } }); } +function Gw(s, e, t, n, i) { + let r = new ws(n.geometry, n.material, i.length); + t.scene.add(r); + const o = new Float32Array(i.length * 3); + for (let a = 0; a < i.length; a++) + o[a * 3] = 1, o[a * 3 + 1] = 1, o[a * 3 + 2] = 1; + r.instanceColor = new xl(o, 3); + for (let a = 0; a < i.length; a++) { + let l = i[a], c = new ze(); + c.elements = l.matrix, r.setMatrixAt(a, c), t.models.find((h) => h.url == s).nodesMap.has(l.id) ? t.models.find((h) => h.url == s).nodesMap.get(l.id).indexes.push([t.scene.children.length - 1, a, 0, 0]) : t.models.find((h) => h.url == s).nodesMap.set(l.id, { instance: !0, info: l, indexes: [[t.scene.children.length - 1, a, 0, 0]] }); + } + r.index = t.scene.children.length - 1, r.materialClone = n.material, r.url = s, r.glb = n.glb, r.ids = i.map((a) => a.id); +} function up(s) { - s.shadowSide = Fn, s.roughness = 0.6, s.metalness = 0, s.side = At, s.map != null && (s.map.colorSpace = xt, s.map.needsUpdate = !0, console.log("优化贴图")), s instanceof Ss && (s.map && (s.map.colorSpace = xt, s.map.needsUpdate = !0), s.emissiveMap && (s.emissiveMap.colorSpace = xt, s.emissiveMap.needsUpdate = !0), s.roughnessMap && (s.roughnessMap.colorSpace = Bt, s.roughnessMap.needsUpdate = !0), s.metalnessMap && (s.metalnessMap.colorSpace = Bt, s.metalnessMap.needsUpdate = !0), s.normalMap && (s.normalMap.colorSpace = Bt, s.normalMap.needsUpdate = !0), s.aoMap && (s.aoMap.colorSpace = Bt, s.aoMap.needsUpdate = !0), s.roughness = Math.max(0.1, Math.min(1, s.roughness)), s.metalness = Math.max(0, Math.min(1, s.metalness)), s.envMapIntensity = s.envMapIntensity || 1, s.needsUpdate = !0), s instanceof Qn && (this.optimizeMaterial(s), s.transmissionMap && (s.transmissionMap.colorSpace = Bt, s.transmissionMap.needsUpdate = !0), s.thicknessMap && (s.thicknessMap.colorSpace = Bt, s.thicknessMap.needsUpdate = !0), s.transmission = Math.max(0, Math.min(1, s.transmission)), s.thickness = Math.max(0, Math.min(10, s.thickness))), s instanceof Zt && s.map && (s.map.colorSpace = xt, s.map.needsUpdate = !0), s instanceof Gm && (s.map && (s.map.colorSpace = xt, s.map.needsUpdate = !0), s.emissiveMap && (s.emissiveMap.colorSpace = xt, s.emissiveMap.needsUpdate = !0)); + s.shadowSide = Fn, s.roughness = 0.6, s.metalness = 0, s.side = At, s.map != null && (s.map.colorSpace = xt, s.map.needsUpdate = !0, console.log("优化贴图")), s instanceof Es && (s.map && (s.map.colorSpace = xt, s.map.needsUpdate = !0), s.emissiveMap && (s.emissiveMap.colorSpace = xt, s.emissiveMap.needsUpdate = !0), s.roughnessMap && (s.roughnessMap.colorSpace = It, s.roughnessMap.needsUpdate = !0), s.metalnessMap && (s.metalnessMap.colorSpace = It, s.metalnessMap.needsUpdate = !0), s.normalMap && (s.normalMap.colorSpace = It, s.normalMap.needsUpdate = !0), s.aoMap && (s.aoMap.colorSpace = It, s.aoMap.needsUpdate = !0), s.roughness = Math.max(0.1, Math.min(1, s.roughness)), s.metalness = Math.max(0, Math.min(1, s.metalness)), s.envMapIntensity = s.envMapIntensity || 1, s.needsUpdate = !0), s instanceof Qn && (this.optimizeMaterial(s), s.transmissionMap && (s.transmissionMap.colorSpace = It, s.transmissionMap.needsUpdate = !0), s.thicknessMap && (s.thicknessMap.colorSpace = It, s.thicknessMap.needsUpdate = !0), s.transmission = Math.max(0, Math.min(1, s.transmission)), s.thickness = Math.max(0, Math.min(10, s.thickness))), s instanceof qt && s.map && (s.map.colorSpace = xt, s.map.needsUpdate = !0), s instanceof Gm && (s.map && (s.map.colorSpace = xt, s.map.needsUpdate = !0), s.emissiveMap && (s.emissiveMap.colorSpace = xt, s.emissiveMap.needsUpdate = !0)); } class Ww { engine; @@ -38301,7 +38332,7 @@ class Ww { // 加载多个模型 async loadModels(e, t) { for (const i of e) - n(i) === "light" && zw(this.engine, i); + n(i) === "light" && Fw(this.engine, i); function n(i) { const r = i.split(".").pop(); return r === "glb" || r === "gltf" ? "gltf" : "light"; @@ -38318,9 +38349,9 @@ class Xw { this.engine = e, this.isFree = !0, this.highlightModels = [], this.hideModels = [], this.models = []; } init() { - this.engine.events.on(Dr.EngineFree, () => { - this.updateFree(!0), console.log("引擎空闲"), Hw(this.engine); - }), this.engine.events.on(Dr.EngineBusy, () => { + this.engine.events.on(Ir.EngineFree, () => { + this.updateFree(!0), console.log("引擎空闲"), zw(this.engine); + }), this.engine.events.on(Ir.EngineBusy, () => { this.updateFree(!1), console.log("引擎繁忙"); }); } @@ -38352,14 +38383,14 @@ class jw { }); } } -class qw { +class Zw { engine; constructor(e) { this.engine = e; } // 加入场景基本光照 init() { - const e = new ur(16777215, 2); + const e = new dr(16777215, 2); e.position.set(10, 20, 10), e.castShadow = !0, e.shadow.mapSize.width = 4096, e.shadow.mapSize.height = 4096, e.shadow.camera.near = 0.1, e.shadow.camera.far = 500, e.shadow.bias = -5e-5, e.shadow.normalBias = 0.02; const t = 50; e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, this.engine.scene.add(e); @@ -38368,10 +38399,13 @@ class qw { } } var Ri = /* @__PURE__ */ ((s) => (s.ModelLoadStart = "model-load-start", s.ModelLoadProgress = "model-load-progress", s.ModelLoaded = "model-loaded", s.ModelError = "model-error", s.SelectionChanged = "selection-changed", s.HoverChanged = "hover-changed", s.Click = "click", s.MouseMove = "mouse-move", s.CameraChanged = "camera-changed", s.CameraIdle = "camera-idle", s.EngineFree = "engine-free", s.EngineBusy = "engine-busy", s.MeasureChanged = "measure-changed", s))(Ri || {}); -class Zw { +class qw { engine; behavior; isCtrlDown = !1; + highlightedInstances = []; + highlightColor = new Oe(43775); + // 高亮颜色:蓝色 constructor(e) { this.engine = e; } @@ -38393,13 +38427,18 @@ class Zw { } // 业务功能-监听鼠标谈起,点选模型 handleMouseClick(e) { - if (this.handleMouseClickInstance(e.raycaster), e.catch) { - const t = e.catch; - t.object, this.engine.events.trigger(Ri.Click, t); - let n = t.object; - this.isCtrlDown || this.engine.modelToolModule.unhighlightAllModels(), console.log([{ url: n.url, ids: [n.name] }]), this.engine.controlModule.orbitControls.origin.set(t.point.x, t.point.y, t.point.z), this.engine.modelToolModule.highlightModel([{ url: n.url, ids: [n.name] }]); - } else - this.engine.modelToolModule.unhighlightAllModels(); + let t = this.handleMouseClickInstance(e.raycaster); + if (t.length > 0 && (e.catch == null || t[0].distance < e.catch.distance)) { + this.engine.controlModule.orbitControls.origin.set(t[0].point.x, t[0].point.y, t[0].point.z), this.isCtrlDown || this.engine.modelToolModule.unhighlightAllModels(); + let n = t[0].object; + this.engine.modelToolModule.highlightModel([{ url: n.url, ids: [n.ids[t[0].instanceId]] }]); + } else if (e.catch != null && (t.length == 0 || t[0].distance > e.catch.distance)) { + const n = e.catch; + n.object, this.engine.events.trigger(Ri.Click, n); + let i = n.object; + this.isCtrlDown || this.engine.modelToolModule.unhighlightAllModels(), console.log([{ url: i.url, ids: [i.name] }]), this.engine.controlModule.orbitControls.origin.set(n.point.x, n.point.y, n.point.z), this.engine.modelToolModule.highlightModel([{ url: i.url, ids: [i.name] }]); + } + e.catch == null && t.length == 0 && this.engine.modelToolModule.unhighlightAllModels(); } // 双击模型事件 handleMouseDoubleClick(e) { @@ -38418,7 +38457,7 @@ class Zw { } // 判断点击instance节点 handleMouseClickInstance(e) { - return e.intersectObjects(this.engine.scene.children.filter((t) => t instanceof No), !0); + return e.intersectObjects(this.engine.scene.children.filter((t) => t instanceof ws), !0); } } class Yw { @@ -38426,7 +38465,7 @@ class Yw { highlightMaterial; hideMaterial; constructor(e) { - this.engine = e, this.highlightMaterial = new Zt({ + this.engine = e, this.highlightMaterial = new qt({ color: 43775, // 明显的蓝色 depthTest: !1, @@ -38438,7 +38477,7 @@ class Yw { // 半透明效果 side: At // 双面渲染 - }), this.hideMaterial = new Zt({ + }), this.hideMaterial = new qt({ color: 0, // 明显的蓝色 depthTest: !1, @@ -38455,20 +38494,30 @@ class Yw { // 设置模型高亮 highlightModel(e) { e.forEach((t) => { - t.ids.forEach((n) => { - this.engine.models.find((i) => i.url == t.url).nodesMap.get(n).indexes.forEach((i) => { - dp(this.engine.scene.children[i[0]]), this.engine.scene.children[i[0]].material[i[1]] = this.highlightMaterial; + let n = /* @__PURE__ */ new Map(); + t.ids.forEach((i) => { + this.engine.models.find((o) => o.url == t.url).nodesMap.get(i)?.indexes.forEach((o) => { + dp(this.engine.scene.children[o[0]]), this.engine.scene.children[o[0]] instanceof ws ? n.has(o[0]) ? n.get(o[0]).push(o[1]) : n.set(o[0], [o[1]]) : this.engine.scene.children[o[0]].material[o[1]] = this.highlightMaterial; }); + }), n.forEach((i, r) => { + i.forEach((o) => { + this.engine.scene.children[r].instanceColor.setXYZ(o, 0, 0.667, 1); + }), this.engine.scene.children[r].instanceColor.needsUpdate = !0; }), this.engine.engineStatus.highlightModels.push(t); }); } // 取消模型高亮 unhighlightModel(e) { e.forEach((t) => { - t.ids.forEach((n) => { - this.engine.models.find((i) => i.url == t.url).nodesMap.get(n).indexes.forEach((i) => { - this.engine.scene.children[i[0]].material[i[1]] = this.engine.scene.children[i[0]].materialClone; + let n = /* @__PURE__ */ new Map(); + t.ids.forEach((i) => { + this.engine.models.find((o) => o.url == t.url).nodesMap.get(i)?.indexes.forEach((o) => { + this.engine.scene.children[o[0]] instanceof ws ? n.has(o[0]) ? n.get(o[0]).push(o[1]) : n.set(o[0], [o[1]]) : this.engine.scene.children[o[0]].material[o[1]] = this.engine.scene.children[o[0]].materialClone; }); + }), n.forEach((i, r) => { + i.forEach((o) => { + this.engine.scene.children[r].instanceColor.setXYZ(o, 1, 1, 1); + }), this.engine.scene.children[r].instanceColor.needsUpdate = !0; }); }); } @@ -38581,7 +38630,7 @@ class Dn { * @param scene - Three.js 场景对象(用于屏幕坐标转世界坐标时的射线检测,可选) */ constructor(e, t, n) { - this.camera = e, this.renderer = t, this.scene = n, this.raycaster = new Es(); + this.camera = e, this.renderer = t, this.scene = n, this.raycaster = new Ts(); } raycaster; /** @@ -38667,7 +38716,7 @@ class Dn { this.scene = e; } } -var au = { exports: {} }, Kw = au.exports, fp; +var ou = { exports: {} }, Kw = ou.exports, fp; function $w() { return fp || (fp = 1, (function(s, e) { (function(t, n) { @@ -38678,7 +38727,7 @@ function $w() { return o.appendChild(f.dom), f; } function i(f) { - for (var p = 0; p < o.children.length; p++) o.children[p].style.display = p === f ? "block" : "none"; + for (var g = 0; g < o.children.length; g++) o.children[g].style.display = g === f ? "block" : "none"; r = f; } var r = 0, o = document.createElement("div"); @@ -38693,8 +38742,8 @@ function $w() { c++; var f = (performance || Date).now(); if (u.update(f - a, 200), f > l + 1e3 && (h.update(1e3 * c / (f - l), 100), l = f, c = 0, d)) { - var p = performance.memory; - d.update(p.usedJSHeapSize / 1048576, p.jsHeapSizeLimit / 1048576); + var g = performance.memory; + d.update(g.usedJSHeapSize / 1048576, g.jsHeapSizeLimit / 1048576); } return f; }, update: function() { @@ -38702,19 +38751,19 @@ function $w() { }, domElement: o, setMode: i }; }; return t.Panel = function(n, i, r) { - var o = 1 / 0, a = 0, l = Math.round, c = l(window.devicePixelRatio || 1), h = 80 * c, u = 48 * c, d = 3 * c, f = 2 * c, p = 3 * c, g = 15 * c, x = 74 * c, m = 30 * c, b = document.createElement("canvas"); + var o = 1 / 0, a = 0, l = Math.round, c = l(window.devicePixelRatio || 1), h = 80 * c, u = 48 * c, d = 3 * c, f = 2 * c, g = 3 * c, p = 15 * c, x = 74 * c, m = 30 * c, b = document.createElement("canvas"); b.width = h, b.height = u, b.style.cssText = "width:80px;height:48px"; var v = b.getContext("2d"); - return v.font = "bold " + 9 * c + "px Helvetica,Arial,sans-serif", v.textBaseline = "top", v.fillStyle = r, v.fillRect(0, 0, h, u), v.fillStyle = i, v.fillText(n, d, f), v.fillRect(p, g, x, m), v.fillStyle = r, v.globalAlpha = 0.9, v.fillRect(p, g, x, m), { dom: b, update: function(y, M) { - o = Math.min(o, y), a = Math.max(a, y), v.fillStyle = r, v.globalAlpha = 1, v.fillRect(0, 0, h, g), v.fillStyle = i, v.fillText(l(y) + " " + n + " (" + l(o) + "-" + l(a) + ")", d, f), v.drawImage(b, p + c, g, x - c, m, p, g, x - c, m), v.fillRect(p + x - c, g, c, m), v.fillStyle = r, v.globalAlpha = 0.9, v.fillRect(p + x - c, g, c, l((1 - y / M) * m)); + return v.font = "bold " + 9 * c + "px Helvetica,Arial,sans-serif", v.textBaseline = "top", v.fillStyle = r, v.fillRect(0, 0, h, u), v.fillStyle = i, v.fillText(n, d, f), v.fillRect(g, p, x, m), v.fillStyle = r, v.globalAlpha = 0.9, v.fillRect(g, p, x, m), { dom: b, update: function(y, M) { + o = Math.min(o, y), a = Math.max(a, y), v.fillStyle = r, v.globalAlpha = 1, v.fillRect(0, 0, h, p), v.fillStyle = i, v.fillText(l(y) + " " + n + " (" + l(o) + "-" + l(a) + ")", d, f), v.drawImage(b, g + c, p, x - c, m, g, p, x - c, m), v.fillRect(g + x - c, p, c, m), v.fillStyle = r, v.globalAlpha = 0.9, v.fillRect(g + x - c, p, c, l((1 - y / M) * m)); } }; }, t; }); - })(au)), au.exports; + })(ou)), ou.exports; } var Jw = $w(); const Qw = /* @__PURE__ */ t0(Jw); -var xr = Object.freeze({ +var vr = Object.freeze({ Linear: Object.freeze({ None: function(s) { return s; @@ -38833,13 +38882,13 @@ var xr = Object.freeze({ }), Bounce: Object.freeze({ In: function(s) { - return 1 - xr.Bounce.Out(1 - s); + return 1 - vr.Bounce.Out(1 - s); }, Out: function(s) { return s < 1 / 2.75 ? 7.5625 * s * s : s < 2 / 2.75 ? 7.5625 * (s -= 1.5 / 2.75) * s + 0.75 : s < 2.5 / 2.75 ? 7.5625 * (s -= 2.25 / 2.75) * s + 0.9375 : 7.5625 * (s -= 2.625 / 2.75) * s + 0.984375; }, InOut: function(s) { - return s < 0.5 ? xr.Bounce.In(s * 2) * 0.5 : xr.Bounce.Out(s * 2 - 1) * 0.5 + 0.5; + return s < 0.5 ? vr.Bounce.In(s * 2) * 0.5 : vr.Bounce.Out(s * 2 - 1) * 0.5 + 0.5; } }), generatePow: function(s) { @@ -38855,7 +38904,7 @@ var xr = Object.freeze({ } }; } -}), fo = function() { +}), po = function() { return performance.now(); }, eS = ( /** @class */ @@ -38875,7 +38924,7 @@ var xr = Object.freeze({ }, s.prototype.remove = function(e) { delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()]; }, s.prototype.update = function(e, t) { - e === void 0 && (e = fo()), t === void 0 && (t = !1); + e === void 0 && (e = po()), t === void 0 && (t = !1); var n = Object.keys(this._tweens); if (n.length === 0) return !1; @@ -38890,9 +38939,9 @@ var xr = Object.freeze({ return !0; }, s; })() -), lu = { +), au = { Linear: function(s, e) { - var t = s.length - 1, n = t * e, i = Math.floor(n), r = lu.Utils.Linear; + var t = s.length - 1, n = t * e, i = Math.floor(n), r = au.Utils.Linear; return e < 0 ? r(s[0], s[1], n) : e > 1 ? r(s[t], s[t - 1], t - n) : r(s[i], s[i + 1 > t ? t : i + 1], n - i); }, Utils: { @@ -38909,11 +38958,11 @@ var xr = Object.freeze({ return s._nextId++; }, s._nextId = 0, s; })() -), cu = new eS(), tS = ( +), lu = new eS(), tS = ( /** @class */ (function() { function s(e, t) { - t === void 0 && (t = cu), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = xr.Linear.None, this._interpolationFunction = lu.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = R0.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1; + t === void 0 && (t = lu), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = vr.Linear.None, this._interpolationFunction = au.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = R0.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1; } return s.prototype.getId = function() { return this._id; @@ -38932,7 +38981,7 @@ var xr = Object.freeze({ }, s.prototype.dynamic = function(e) { return e === void 0 && (e = !1), this._isDynamic = e, this; }, s.prototype.start = function(e, t) { - if (e === void 0 && (e = fo()), t === void 0 && (t = !1), this._isPlaying) + if (e === void 0 && (e = po()), t === void 0 && (t = !1), this._isPlaying) return this; if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) { this._reversed = !1; @@ -38959,13 +39008,13 @@ var xr = Object.freeze({ var u = n[o]; if (u.length === 0) continue; - for (var d = [a], f = 0, p = u.length; f < p; f += 1) { - var g = this._handleRelativeValue(a, u[f]); - if (isNaN(g)) { + for (var d = [a], f = 0, g = u.length; f < g; f += 1) { + var p = this._handleRelativeValue(a, u[f]); + if (isNaN(p)) { h = !1, console.warn("Found invalid interpolation list. Skipping."); break; } - d.push(g); + d.push(p); } h && (n[o] = d); } @@ -38992,15 +39041,15 @@ var xr = Object.freeze({ }, s.prototype.end = function() { return this._goToEnd = !0, this.update(1 / 0), this; }, s.prototype.pause = function(e) { - return e === void 0 && (e = fo()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this); + return e === void 0 && (e = po()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this); }, s.prototype.resume = function(e) { - return e === void 0 && (e = fo()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this); + return e === void 0 && (e = po()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this); }, s.prototype.stopChainedTweens = function() { for (var e = 0, t = this._chainedTweens.length; e < t; e++) this._chainedTweens[e].stop(); return this; }, s.prototype.group = function(e) { - return e === void 0 && (e = cu), this._group = e, this; + return e === void 0 && (e = lu), this._group = e, this; }, s.prototype.delay = function(e) { return e === void 0 && (e = 0), this._delayTime = e, this; }, s.prototype.repeat = function(e) { @@ -39010,9 +39059,9 @@ var xr = Object.freeze({ }, s.prototype.yoyo = function(e) { return e === void 0 && (e = !1), this._yoyo = e, this; }, s.prototype.easing = function(e) { - return e === void 0 && (e = xr.Linear.None), this._easingFunction = e, this; + return e === void 0 && (e = vr.Linear.None), this._easingFunction = e, this; }, s.prototype.interpolation = function(e) { - return e === void 0 && (e = lu.Linear), this._interpolationFunction = e, this; + return e === void 0 && (e = au.Linear), this._interpolationFunction = e, this; }, s.prototype.chain = function() { for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t]; @@ -39031,7 +39080,7 @@ var xr = Object.freeze({ return this._onStopCallback = e, this; }, s.prototype.update = function(e, t) { var n = this, i; - if (e === void 0 && (e = fo()), t === void 0 && (t = !0), this._isPaused) + if (e === void 0 && (e = po()), t === void 0 && (t = !0), this._isPaused) return !0; var r, o = this._startTime + this._duration; if (!this._goToEnd && !this._isPlaying) { @@ -39059,8 +39108,8 @@ var xr = Object.freeze({ return this._yoyo && (this._reversed = !this._reversed), this._startTime += l * f, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0; } else { this._onCompleteCallback && this._onCompleteCallback(this._object); - for (var p = 0, g = this._chainedTweens.length; p < g; p++) - this._chainedTweens[p].start(this._startTime + this._duration, !1); + for (var g = 0, p = this._chainedTweens.length; g < p; g++) + this._chainedTweens[g].start(this._startTime + this._duration, !1); return this._isPlaying = !1, !1; } return !0; @@ -39079,14 +39128,14 @@ var xr = Object.freeze({ })() ); R0.nextId; -var ui = cu; +var ui = lu; ui.getAll.bind(ui); ui.removeAll.bind(ui); ui.add.bind(ui); ui.remove.bind(ui); ui.update.bind(ui); var Bc = { - Easing: xr, + Easing: vr, Tween: tS }; function nS() { @@ -39107,28 +39156,28 @@ function sS(s, e, t) { r.style.display = "block", n.visible = !0; }, n.RenderScene = function() { n.camera.quaternion.copy(e.camera.quaternion); - let p = new P(0, 0, -1).clone().applyMatrix4(e.camera.matrixWorld.clone()), g = e.camera.position.clone().sub(p.clone()).setLength(100); - n.camera.position.copy(g), n.camera.lookAt(new P()), n.sceneOrtho.renderer.render(n.sceneOrtho, n.camera); - }, n.ToggleDirectionView = function(p) { - console.log(p); - var g = new P(0, 0, 0); - p == "top" ? g = new P(0, 1, 0) : p == "down" ? g = new P(0, -1, 0) : p == "front" ? g = new P(0, 0, 1) : p == "left" ? g = new P(-1, 0, 0) : p == "back" ? g = new P(0, 0, -1) : p == "right" ? g = new P(1, 0, 0) : p == "top_front" ? g = new P(1, 1, 0) : p == "top_left" ? g = new P(0, 1, -1) : p == "top_back" ? g = new P(-1, 1, 0) : p == "top_right" ? g = new P(0, 1, 1) : p == "down_front" ? g = new P(1, -1, 0) : p == "down_left" ? g = new P(0, -1, -1) : p == "down_back" ? g = new P(-1, -1, 0) : p == "down_right" ? g = new P(0, -1, 1) : p == "front_right" ? g = new P(1, 0, 1) : p == "right_back" ? g = new P(-1, 0, 1) : p == "back_left" ? g = new P(-1, 0, -1) : p == "left_front" ? g = new P(1, 0, -1) : p == "top_left_front" ? g = new P(1, 1, -1) : p == "top_front_right" ? g = new P(1, 1, 1) : p == "top_right_back" ? g = new P(-1, 1, 1) : p == "top_back_left" ? g = new P(-1, 1, -1) : p == "button_left_front" ? g = new P(1, -1, -1) : p == "button_front_right" ? g = new P(1, -1, 1) : p == "button_right_back" ? g = new P(-1, 1, 1) : p == "button_back_left" && (g = new P(-1, -1, -1)); - var x = s.octreeBox.getBoundingBox(), m = x.min, b = x.max, v = m.clone().add(b.clone()).multiplyScalar(0.5), y = v.clone().add(g.multiplyScalar(1 * b.distanceTo(m))); + let g = new P(0, 0, -1).clone().applyMatrix4(e.camera.matrixWorld.clone()), p = e.camera.position.clone().sub(g.clone()).setLength(100); + n.camera.position.copy(p), n.camera.lookAt(new P()), n.sceneOrtho.renderer.render(n.sceneOrtho, n.camera); + }, n.ToggleDirectionView = function(g) { + console.log(g); + var p = new P(0, 0, 0); + g == "top" ? p = new P(0, 1, 0) : g == "down" ? p = new P(0, -1, 0) : g == "front" ? p = new P(0, 0, 1) : g == "left" ? p = new P(-1, 0, 0) : g == "back" ? p = new P(0, 0, -1) : g == "right" ? p = new P(1, 0, 0) : g == "top_front" ? p = new P(1, 1, 0) : g == "top_left" ? p = new P(0, 1, -1) : g == "top_back" ? p = new P(-1, 1, 0) : g == "top_right" ? p = new P(0, 1, 1) : g == "down_front" ? p = new P(1, -1, 0) : g == "down_left" ? p = new P(0, -1, -1) : g == "down_back" ? p = new P(-1, -1, 0) : g == "down_right" ? p = new P(0, -1, 1) : g == "front_right" ? p = new P(1, 0, 1) : g == "right_back" ? p = new P(-1, 0, 1) : g == "back_left" ? p = new P(-1, 0, -1) : g == "left_front" ? p = new P(1, 0, -1) : g == "top_left_front" ? p = new P(1, 1, -1) : g == "top_front_right" ? p = new P(1, 1, 1) : g == "top_right_back" ? p = new P(-1, 1, 1) : g == "top_back_left" ? p = new P(-1, 1, -1) : g == "button_left_front" ? p = new P(1, -1, -1) : g == "button_front_right" ? p = new P(1, -1, 1) : g == "button_right_back" ? p = new P(-1, 1, 1) : g == "button_back_left" && (p = new P(-1, -1, -1)); + var x = s.octreeBox.getBoundingBox(), m = x.min, b = x.max, v = m.clone().add(b.clone()).multiplyScalar(0.5), y = v.clone().add(p.multiplyScalar(1 * b.distanceTo(m))); l(e.camera.position, y, s.controls.target.clone(), v); }, n.GetCameraPose = function() { - var p = e.camera.quaternion, g = e.camera.position, x = s.controls.target, m = { - quaternion: p, - position: g, + var g = e.camera.quaternion, p = e.camera.position, x = s.controls.target, m = { + quaternion: g, + position: p, target: x }; return m; - }, n.ReductionCameraPose = function(p, g = 1e3, x) { + }, n.ReductionCameraPose = function(g, p = 1e3, x) { var m = new zn( - p.quaternion._x, - p.quaternion._y, - p.quaternion._z, - p.quaternion._w - ), b = new P(p.position.x, p.position.y, p.position.z), v = new P(p.target.x, p.target.y, p.target.z); + g.quaternion._x, + g.quaternion._y, + g.quaternion._z, + g.quaternion._w + ), b = new P(g.position.x, g.position.y, g.position.z), v = new P(g.target.x, g.target.y, g.target.z); let y = !1; l( e.camera.position, @@ -39137,36 +39186,36 @@ function sS(s, e, t) { v, e.camera.quaternion, m, - g, + p, (M) => { x && (y || (x(M), y = !0)); } ), x && setTimeout(() => { y || (x(!0), y = !0); - }, g + 10); + }, p + 10); }, n.CameraGoHome = function() { - var p = s.octreeBox.getBoundingBox(), g = p.min.clone().add(p.max.clone()).multiplyScalar(0.5); + var g = s.octreeBox.getBoundingBox(), p = g.min.clone().add(g.max.clone()).multiplyScalar(0.5); let x = new P(1, 1, 1); - var m = p.max.distanceTo(p.min), b = g.clone().add(x.multiplyScalar(m)); + var m = g.max.distanceTo(g.min), b = p.clone().add(x.multiplyScalar(m)); if (e.camera.isOrthographicCamera) { var v = s.container.clientWidth / s.container.clientHeight, y = m * 0.6; e.camera.left = -y * v, e.camera.right = y * v, e.camera.top = y, e.camera.bottom = -y, e.camera.zoom = 1, e.camera.updateProjectionMatrix(); } - l(e.camera.position, b, s.controls.target.clone(), g); - }, n.zoomToBox = function(p) { - var g = p.min.clone().add(p.max.clone()).multiplyScalar(0.5); + l(e.camera.position, b, s.controls.target.clone(), p); + }, n.zoomToBox = function(g) { + var p = g.min.clone().add(g.max.clone()).multiplyScalar(0.5); let x = e.camera.position.clone().sub(s.controls.target.clone()).normalize(); - var m = g.clone().add(x.multiplyScalar(1 * p.max.distanceTo(p.min))); - l(e.camera.position, m, s.controls.target.clone(), g); + var m = p.clone().add(x.multiplyScalar(1 * g.max.distanceTo(g.min))); + l(e.camera.position, m, s.controls.target.clone(), p); }; - function l(p, g, x, m, b, v, y = 1e3, M) { + function l(g, p, x, m, b, v, y = 1e3, M) { var E; b && v ? (E = new Bc.Tween({ - x1: p.x, + x1: g.x, // 相机当前位置x - y1: p.y, + y1: g.y, // 相机当前位置y - z1: p.z, + z1: g.z, // 相机当前位置z x2: x.x, // 控制当前的中心点x @@ -39184,11 +39233,11 @@ function sS(s, e, t) { // 相机当前quaternion }), E.to( { - x1: g.x, + x1: p.x, // 新的相机位置x - y1: g.y, + y1: p.y, // 新的相机位置y - z1: g.z, + z1: p.z, // 新的相机位置z x2: m.x, // 新的控制中心点位置x @@ -39207,11 +39256,11 @@ function sS(s, e, t) { }, y )) : (E = new Bc.Tween({ - x1: p.x, + x1: g.x, // 相机当前位置x - y1: p.y, + y1: g.y, // 相机当前位置y - z1: p.z, + z1: g.z, // 相机当前位置z x2: x.x, // 控制当前的中心点x @@ -39221,11 +39270,11 @@ function sS(s, e, t) { // 控制当前的中心点z }), E.to( { - x1: g.x, + x1: p.x, // 新的相机位置x - y1: g.y, + y1: p.y, // 新的相机位置y - z1: g.z, + z1: p.z, // 新的相机位置z x2: m.x, // 新的控制中心点位置x @@ -39247,14 +39296,14 @@ function sS(s, e, t) { } function c() { r = document.createElement("div"), r.className = "ViewCube", t.appendChild(r), o = document.createElement("div"), o.className = "viewSettingWrapper", o.innerHTML = "...", r.appendChild(o); - var p = document.createElement("div"); - p.className = "homeViewWrapper", p.addEventListener("mousedown", function() { + var g = document.createElement("div"); + g.className = "homeViewWrapper", g.addEventListener("mousedown", function() { console.log("归位"), n.CameraGoHome(); - }), r.appendChild(p); - const g = document.createElement("div"); - g.className = "cameraToggleWrapper", g.title = "切换正交/透视视图", g.innerHTML = "⊞", g.addEventListener("mousedown", function(y) { - y.stopPropagation(), console.log("切换视图"), n.ToggleCameraType(), b(); }), r.appendChild(g); + const p = document.createElement("div"); + p.className = "cameraToggleWrapper", p.title = "切换正交/透视视图", p.innerHTML = "⊞", p.addEventListener("mousedown", function(y) { + y.stopPropagation(), console.log("切换视图"), n.ToggleCameraType(), b(); + }), r.appendChild(p); const x = document.createElement("div"); x.className = "screenshotWrapper", x.title = "截图", x.innerHTML = "📷", x.addEventListener("mousedown", function(y) { y.stopPropagation(), console.log("截图"), n.TakeScreenshot(), b(); @@ -39263,23 +39312,23 @@ function sS(s, e, t) { m.className = "fullscreenWrapper", m.title = "全屏", m.innerHTML = "⛶", m.addEventListener("mousedown", function(y) { y.stopPropagation(), console.log("全屏"), n.ToggleFullscreen(), b(); }), r.appendChild(m), o.addEventListener("mousedown", function(y) { - y.stopPropagation(), g.classList.contains("show") ? (b(), console.log("隐藏功能按钮")) : (v(), console.log("显示功能按钮")); + y.stopPropagation(), p.classList.contains("show") ? (b(), console.log("隐藏功能按钮")) : (v(), console.log("显示功能按钮")); }); function b() { - g.classList.remove("show"), x.classList.remove("show"), m.classList.remove("show"); + p.classList.remove("show"), x.classList.remove("show"), m.classList.remove("show"); } function v() { - g.classList.add("show"), x.classList.add("show"), m.classList.add("show"); + p.classList.add("show"), x.classList.add("show"), m.classList.add("show"); } } function h() { n.sceneOrtho = nS(); - var x = t.clientWidth, m = t.clientWidth, p = x > m ? x / m : m / x, g = 300; - n.camera = new Rs( - g * p / -2, - g * p / 2, - g / 2, - g / -2, + var x = t.clientWidth, m = t.clientWidth, g = x > m ? x / m : m / x, p = 300; + n.camera = new Ls( + p * g / -2, + p * g / 2, + p / 2, + p / -2, 0.01, 1e4 ); @@ -39291,37 +39340,37 @@ function sS(s, e, t) { n.sceneOrtho.add(v), iS(r, b); } function u() { - const p = "/assets/viewcube/"; - let g = [ + const g = "/assets/viewcube/"; + let p = [ { label: "右", - icon: p + "cn_right.png" + icon: g + "cn_right.png" }, { label: "左", - icon: p + "cn_left.png" + icon: g + "cn_left.png" }, { label: "顶", - icon: p + "cn_top.png" + icon: g + "cn_top.png" }, { label: "底", - icon: p + "cn_bottom.png" + icon: g + "cn_bottom.png" }, { label: "前", - icon: p + "cn_front.png" + icon: g + "cn_front.png" }, { label: "后", - icon: p + "cn_back.png" + icon: g + "cn_back.png" } ]; var x = []; - for (const b of g) + for (const b of p) x.push( - new Zt({ + new qt({ color: 16777215, map: new jm().load(b.icon) }) @@ -39333,14 +39382,14 @@ function sS(s, e, t) { n.sceneOrtho.add(m), d(122), r.addEventListener("mousedown", (b) => { var v = {}; v.x = b.offsetX / r.clientWidth * 2 - 1, v.y = -(b.offsetY / r.clientHeight) * 2 + 1; - var y = new Es(); + var y = new Ts(); y.setFromCamera(v, n.camera); const M = y.intersectObjects(a, !1); M.length > 0 && n.ToggleDirectionView(M[0].object.name); }), r.addEventListener("mousemove", (b) => { var v = {}; v.x = b.offsetX / r.clientWidth * 2 - 1, v.y = -(b.offsetY / r.clientHeight) * 2 + 1; - var y = new Es(); + var y = new Ts(); y.setFromCamera(v, n.camera); const M = y.intersectObjects(a, !1); for (var E of a) @@ -39348,49 +39397,49 @@ function sS(s, e, t) { M.length > 0 && (M[0].object.material.opacity = 0.2); }); } - function d(p) { - for (var g = p * 0.5 - 20, x = [ + function d(g) { + for (var p = g * 0.5 - 20, x = [ { name: "right", a: 30, b: 75, c: 75, - point: new P(g, 0, 0) + point: new P(p, 0, 0) }, { name: "back", a: 75, b: 75, c: 30, - point: new P(0, 0, -g) + point: new P(0, 0, -p) }, { name: "left", a: 30, b: 75, c: 75, - point: new P(-g, 0, 0) + point: new P(-p, 0, 0) }, { name: "front", a: 75, b: 75, c: 30, - point: new P(0, 0, g) + point: new P(0, 0, p) }, { name: "top", a: 75, b: 30, c: 75, - point: new P(0, g, 0) + point: new P(0, p, 0) }, { name: "button", a: 75, b: 30, c: 75, - point: new P(0, -g, 0) + point: new P(0, -p, 0) } ], m = [ { @@ -39398,56 +39447,56 @@ function sS(s, e, t) { a: 30, b: 30, c: 30, - point: new P(-g, g, g) + point: new P(-p, p, p) }, { name: "button_front_right", a: 30, b: 30, c: 30, - point: new P(-g, -g, g) + point: new P(-p, -p, p) }, { name: "top_front_right", a: 30, b: 30, c: 30, - point: new P(g, g, g) + point: new P(p, p, p) }, { name: "button_right_back", a: 30, b: 30, c: 30, - point: new P(g, -g, g) + point: new P(p, -p, p) }, { name: "top_back_left", a: 30, b: 30, c: 30, - point: new P(-g, g, -g) + point: new P(-p, p, -p) }, { name: "button_back_left", a: 30, b: 30, c: 30, - point: new P(-g, -g, -g) + point: new P(-p, -p, -p) }, { name: "top_left_front", a: 30, b: 30, c: 30, - point: new P(g, g, -g) + point: new P(p, p, -p) }, { name: "button_left_front", a: 30, b: 30, c: 30, - point: new P(g, -g, -g) + point: new P(p, -p, -p) } ], b = [ { @@ -39455,84 +39504,84 @@ function sS(s, e, t) { a: 30, b: 30, c: 75, - point: new P(g, g, 0) + point: new P(p, p, 0) }, { name: "top_right", a: 75, b: 30, c: 30, - point: new P(0, g, g) + point: new P(0, p, p) }, { name: "top_back", a: 30, b: 30, c: 75, - point: new P(-g, g, 0) + point: new P(-p, p, 0) }, { name: "top_left", a: 75, b: 30, c: 30, - point: new P(0, g, -g) + point: new P(0, p, -p) }, { name: "button_front", a: 30, b: 30, c: 75, - point: new P(g, -g, 0) + point: new P(p, -p, 0) }, { name: "button_right", a: 75, b: 30, c: 30, - point: new P(0, -g, g) + point: new P(0, -p, p) }, { name: "button_back", a: 30, b: 30, c: 75, - point: new P(-g, -g, 0) + point: new P(-p, -p, 0) }, { name: "button_left", a: 75, b: 30, c: 30, - point: new P(0, -g, -g) + point: new P(0, -p, -p) }, { name: "front_right", a: 30, b: 75, c: 30, - point: new P(g, 0, g) + point: new P(p, 0, p) }, { name: "right_back", a: 30, b: 75, c: 30, - point: new P(-g, 0, g) + point: new P(-p, 0, p) }, { name: "back_left", a: 30, b: 75, c: 30, - point: new P(-g, 0, -g) + point: new P(-p, 0, -p) }, { name: "left_front", a: 30, b: 75, c: 30, - point: new P(g, 0, -g) + point: new P(p, 0, -p) } ], v = 0; v < x.length; v++) a.push(f(x[v])); @@ -39541,14 +39590,14 @@ function sS(s, e, t) { for (var v = 0; v < b.length; v++) a.push(f(b[v])); } - function f(p) { - const g = new $i(p.a, p.b, p.c), x = new Zt({ + function f(g) { + const p = new $i(g.a, g.b, g.c), x = new qt({ color: "blue", transparent: !0, opacity: 0.01 - }), m = new ze().makeTranslation(p.point.x, p.point.y, p.point.z); - let b = g.applyMatrix4(m), v = new dt(b, x); - return v.name = p.name, n.sceneOrtho.add(v), v; + }), m = new ze().makeTranslation(g.point.x, g.point.y, g.point.z); + let b = p.applyMatrix4(m), v = new dt(b, x); + return v.name = g.name, n.sceneOrtho.add(v), v; } return n.ToggleCameraType = function() { s.cameraModule.switchCurrentCamera(); @@ -39559,14 +39608,14 @@ function sS(s, e, t) { return; } s.renderer.render(e, e.camera); - const p = s.renderer.domElement.toDataURL("image/png"), g = document.createElement("a"), x = (/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-"); - g.download = `screenshot_${x}.png`, g.href = p, g.click(), console.log("截图已保存"); - } catch (p) { - console.error("截图失败:", p); + const g = s.renderer.domElement.toDataURL("image/png"), p = document.createElement("a"), x = (/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-"); + p.download = `screenshot_${x}.png`, p.href = g, p.click(), console.log("截图已保存"); + } catch (g) { + console.error("截图失败:", g); } }, n.ToggleFullscreen = function() { - const p = t || document.documentElement; - !document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (p.requestFullscreen ? p.requestFullscreen() : p.webkitRequestFullscreen ? p.webkitRequestFullscreen() : p.mozRequestFullScreen ? p.mozRequestFullScreen() : p.msRequestFullscreen && p.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式")); + const g = t || document.documentElement; + !document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (g.requestFullscreen ? g.requestFullscreen() : g.webkitRequestFullscreen ? g.webkitRequestFullscreen() : g.mozRequestFullScreen ? g.mozRequestFullScreen() : g.msRequestFullscreen && g.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式")); }, n; } class rS { @@ -39615,26 +39664,28 @@ function oS(s) { if (!(f == null || f == !1)) if (o.children == null || o.children.length == 0) { if (o.elements != null) - for (var p of o.elements) { - let g = s.engineStatus.hideModels.find((m) => m.url == a.url)?.ids; - if (g != null && g.includes(p)) + for (var g of o.elements) { + let p = s.engineStatus.hideModels.find((m) => m.url == a.url)?.ids; + if (p != null && p.includes(g)) continue; - s.models.find((m) => m.url == a.url).nodesMap.get(p)?.infos.map((m) => m.mesh).forEach((m) => { + let x = s.models.find((m) => m.url == a.url).nodesMap.get(g); + x != null && !x.instance && x.infos.map((m) => m.mesh).forEach((m) => { n.push(m); }); } } else { if (o.elements != null) - for (var p of o.elements) { + for (var g of o.elements) { let x = s.engineStatus.hideModels.find((b) => b.url == a.url)?.ids; - if (x != null && x.includes(p)) + if (x != null && x.includes(g)) continue; - s.models.find((b) => b.url == a.url).nodesMap.get(p)?.infos.map((b) => b.mesh).forEach((b) => { + let m = s.models.find((b) => b.url == a.url).nodesMap.get(g); + m != null && !m.instance && m.infos.map((b) => b.mesh).forEach((b) => { n.push(b); }); } - for (let g of o.children) - i(r, g, a); + for (let p of o.children) + i(r, p, a); } } }, e; @@ -39804,7 +39855,7 @@ class aS { c.dot(h.normalize()) < 0 && c.negate(); const u = i.clone().sub(c.multiplyScalar(l)); t.position.copy(u), n.target && n.target.copy(i), t.lookAt(i), n.update(); - } else if (t instanceof Rs) { + } else if (t instanceof Ls) { const a = o * 1.2, l = this.engine.renderer?.domElement, c = l ? l.width / l.height : 1; t.left = -a * c / 2, t.right = a * c / 2, t.top = a / 2, t.bottom = -a / 2, t.updateProjectionMatrix(); const h = new P(); @@ -39856,7 +39907,7 @@ class lS { */ setDirectionalLightIntensity(e) { const t = this.engine.scene.children.find( - (n) => n instanceof ur + (n) => n instanceof dr ); t && (t.intensity = e); } @@ -39866,7 +39917,7 @@ class lS { */ setDirectionalLightColor(e) { const t = this.engine.scene.children.find( - (n) => n instanceof ur + (n) => n instanceof dr ); t && t.color.set(e); } @@ -39876,7 +39927,7 @@ class lS { */ setShadowQuality(e) { const t = this.engine.scene.children.find( - (n) => n instanceof ur + (n) => n instanceof dr ); if (t?.shadow) { const n = { @@ -39894,7 +39945,7 @@ class lS { */ setDirectionalLightShadow(e) { const t = this.engine.scene.children.find( - (n) => n instanceof ur + (n) => n instanceof dr ); t && (t.castShadow = e), this.engine.renderer && (this.engine.renderer.shadowMap.enabled = e); } @@ -39965,7 +40016,7 @@ class lS { if (this.ground) this.ground.visible = !0; else { - const n = t?.size ?? 100, i = t?.color ?? 8421504, r = t?.opacity ?? 0.3, o = new ko(n, n), a = new Ss({ + const n = t?.size ?? 100, i = t?.color ?? 8421504, r = t?.opacity ?? 0.3, o = new Uo(n, n), a = new Es({ color: i, transparent: !0, opacity: r, @@ -39993,7 +40044,7 @@ class Bi { engine; handelBehaved; constructor(e) { - this.engine = e, this.handelBehaved = Wu(e), this.handelBehaved.init(this, null); + this.engine = e, this.handelBehaved = Gu(e), this.handelBehaved.init(this, null); } active() { this.handelBehaved.active(); @@ -40076,10 +40127,10 @@ class Bi { } let c = new Dn(e.engine.camera, e.engine.renderer, e.engine.scene).worldToScreen(l.point1), h = new Dn(e.engine.camera, e.engine.renderer, e.engine.scene).worldToScreen(l.point2), u = new Dn(e.engine.camera, e.engine.renderer, e.engine.scene).worldToScreen(l.point3), d = e.engine.reactBoundingClientRect.left, f = e.engine.reactBoundingClientRect.top; c.x += d, c.y += f, h.x += d, h.y += f, u.x += d, u.y += f; - let p = l.container; - p.getElementsByTagName("circle")[0].setAttribute("cx", c.x), p.getElementsByTagName("circle")[0].setAttribute("cy", c.y), p.getElementsByTagName("circle")[1].setAttribute("cx", h.x), p.getElementsByTagName("circle")[1].setAttribute("cy", h.y), p.getElementsByTagName("circle")[2].setAttribute("cx", u.x), p.getElementsByTagName("circle")[2].setAttribute("cy", u.y), p.getElementsByTagName("polyline")[0].setAttribute("points", c.x + "," + c.y + " " + h.x + "," + h.y), p.getElementsByTagName("polyline")[1].setAttribute("points", h.x + "," + h.y + " " + u.x + "," + u.y); - let g = h.x, x = h.y - 30; - p.getElementsByTagName("rect")[0].setAttribute("x", g - 40), p.getElementsByTagName("rect")[0].setAttribute("y", x - 12.5), p.getElementsByTagName("text")[0].setAttribute("x", g), p.getElementsByTagName("text")[0].setAttribute("y", x + 4), p.getElementsByTagName("text")[0].innerHTML = l.text, p.style.top = "0px", p.style.left = "0px"; + let g = l.container; + g.getElementsByTagName("circle")[0].setAttribute("cx", c.x), g.getElementsByTagName("circle")[0].setAttribute("cy", c.y), g.getElementsByTagName("circle")[1].setAttribute("cx", h.x), g.getElementsByTagName("circle")[1].setAttribute("cy", h.y), g.getElementsByTagName("circle")[2].setAttribute("cx", u.x), g.getElementsByTagName("circle")[2].setAttribute("cy", u.y), g.getElementsByTagName("polyline")[0].setAttribute("points", c.x + "," + c.y + " " + h.x + "," + h.y), g.getElementsByTagName("polyline")[1].setAttribute("points", h.x + "," + h.y + " " + u.x + "," + u.y); + let p = h.x, x = h.y - 30; + g.getElementsByTagName("rect")[0].setAttribute("x", p - 40), g.getElementsByTagName("rect")[0].setAttribute("y", x - 12.5), g.getElementsByTagName("text")[0].setAttribute("x", p), g.getElementsByTagName("text")[0].setAttribute("y", x + 4), g.getElementsByTagName("text")[0].innerHTML = l.text, g.style.top = "0px", g.style.left = "0px"; } function n(l) { if (l.container == null) { @@ -40105,10 +40156,10 @@ class Bi { v.x += c, v.y += h, u.push(v), d += v.x, f += v.y; } d = d / u.length, f = f / u.length; - let p = u.map((b) => b.x + "," + b.y).join(" "), g = l.container; - g.getElementsByTagName("polygon")[0].setAttribute("points", p), g.getElementsByTagName("polyline")[0].setAttribute("points", p); + let g = u.map((b) => b.x + "," + b.y).join(" "), p = l.container; + p.getElementsByTagName("polygon")[0].setAttribute("points", g), p.getElementsByTagName("polyline")[0].setAttribute("points", g); let x = d, m = f; - g.getElementsByTagName("rect")[0].setAttribute("x", x - 40), g.getElementsByTagName("rect")[0].setAttribute("y", m - 12.5), g.getElementsByTagName("text")[0].setAttribute("x", x), g.getElementsByTagName("text")[0].setAttribute("y", m + 4), g.getElementsByTagName("text")[0].innerHTML = l.text, g.style.top = "0px", g.style.left = "0px"; + p.getElementsByTagName("rect")[0].setAttribute("x", x - 40), p.getElementsByTagName("rect")[0].setAttribute("y", m - 12.5), p.getElementsByTagName("text")[0].setAttribute("x", x), p.getElementsByTagName("text")[0].setAttribute("y", m + 4), p.getElementsByTagName("text")[0].innerHTML = l.text, p.style.top = "0px", p.style.left = "0px"; } function i(l) { if (l.container == null) { @@ -40134,8 +40185,8 @@ class Bi { c.x += u, c.y += d, h.x += u, h.y += d; let f = l.container; f.getElementsByTagName("polyline")[0].setAttribute("points", c.x + "," + c.y + " " + h.x + "," + h.y); - let p = (c.x + h.x) / 2, g = (c.y + h.y) / 2 - 30; - f.getElementsByTagName("rect")[0].setAttribute("x", p - 50), f.getElementsByTagName("rect")[0].setAttribute("y", g - 12.5), f.getElementsByTagName("text")[0].setAttribute("x", p), f.getElementsByTagName("text")[0].setAttribute("y", g + 4), f.getElementsByTagName("text")[0].innerHTML = l.text, f.style.top = "0px", f.style.left = "0px"; + let g = (c.x + h.x) / 2, p = (c.y + h.y) / 2 - 30; + f.getElementsByTagName("rect")[0].setAttribute("x", g - 50), f.getElementsByTagName("rect")[0].setAttribute("y", p - 12.5), f.getElementsByTagName("text")[0].setAttribute("x", g), f.getElementsByTagName("text")[0].setAttribute("y", p + 4), f.getElementsByTagName("text")[0].innerHTML = l.text, f.style.top = "0px", f.style.left = "0px"; } function r(l) { if (l.container == null) { @@ -40158,8 +40209,8 @@ class Bi { h.x += u, h.y += d, c.style.top = "0px", c.style.left = "0px"; let f = c.getElementsByTagName("circle")[0]; f && (f.setAttribute("cx", h.x), f.setAttribute("cy", h.y)); - let p = c.getElementsByTagName("rect"), g = c.getElementsByTagName("text"), x = -55; - p[0] && (p[0].setAttribute("x", h.x + 10), p[0].setAttribute("y", h.y + 10 + x)), g[0] && (g[0].setAttribute("x", h.x + 10 + 40), g[0].setAttribute("y", h.y + 10 + 16 + x)), p[1] && (p[1].setAttribute("x", h.x + 10), p[1].setAttribute("y", h.y + 10 + 30 + x)), g[1] && (g[1].setAttribute("x", h.x + 10 + 40), g[1].setAttribute("y", h.y + 10 + 46 + x)), p[2] && (p[2].setAttribute("x", h.x + 10), p[2].setAttribute("y", h.y + 10 + 60 + x)), g[2] && (g[2].setAttribute("x", h.x + 10 + 40), g[2].setAttribute("y", h.y + 10 + 76 + x)), g[0] && (g[0].innerHTML = l.textX), g[1] && (g[1].innerHTML = l.textY), g[2] && (g[2].innerHTML = l.textZ); + let g = c.getElementsByTagName("rect"), p = c.getElementsByTagName("text"), x = -55; + g[0] && (g[0].setAttribute("x", h.x + 10), g[0].setAttribute("y", h.y + 10 + x)), p[0] && (p[0].setAttribute("x", h.x + 10 + 40), p[0].setAttribute("y", h.y + 10 + 16 + x)), g[1] && (g[1].setAttribute("x", h.x + 10), g[1].setAttribute("y", h.y + 10 + 30 + x)), p[1] && (p[1].setAttribute("x", h.x + 10 + 40), p[1].setAttribute("y", h.y + 10 + 46 + x)), g[2] && (g[2].setAttribute("x", h.x + 10), g[2].setAttribute("y", h.y + 10 + 60 + x)), p[2] && (p[2].setAttribute("x", h.x + 10 + 40), p[2].setAttribute("y", h.y + 10 + 76 + x)), p[0] && (p[0].innerHTML = l.textX), p[1] && (p[1].innerHTML = l.textY), p[2] && (p[2].innerHTML = l.textZ); } function o(l) { if (l.container == null) { @@ -40179,7 +40230,7 @@ class Bi { } function a(l) { if (l.container == null) { - let p = [ + let g = [ '', '', '', @@ -40188,7 +40239,7 @@ class Bi { '' + l.text + "", "" ].join(""); - l.container = document.createElement("div"), l.container.className = "normal-annotation", l.container.id = l.id, l.container.innerHTML = p, e.engine.measure.annotationContainer.appendChild(l.container), l.container.getElementsByTagName("svg")[0].addEventListener("click", function() { + l.container = document.createElement("div"), l.container.className = "normal-annotation", l.container.id = l.id, l.container.innerHTML = g, e.engine.measure.annotationContainer.appendChild(l.container), l.container.getElementsByTagName("svg")[0].addEventListener("click", function() { e.clearHighlight(), l.container.getElementsByTagName("svg")[0].classList.add("Hight"), l.highlight = !0; }); } @@ -40245,7 +40296,7 @@ class cS { id: Li(), isSelect: !0 }, this.engine.measure.annotationData.normalAnnotation.push(t)); - let n = new Es(e.catch.point.clone().add(new P(0, 0.01, 0)), new P(0, 1, 0)); + let n = new Ts(e.catch.point.clone().add(new P(0, 0.01, 0)), new P(0, 1, 0)); const i = this.engine.octreeBox.rayInterationModel(n); if (i.length === 0) { t.point2 = null; @@ -40350,7 +40401,7 @@ class uS { id: Li(), isSelect: !0 }, this.engine.measure.annotationData.normalAnnotation.push(t)); - let n = new Es(e.catch.point.clone().add(e.catch.normal.clone().setLength(0.01)), e.catch.normal); + let n = new Ts(e.catch.point.clone().add(e.catch.normal.clone().setLength(0.01)), e.catch.normal); const i = this.engine.octreeBox.rayInterationModel(n); if (i.length == 0) { t.point2 = null; @@ -40693,7 +40744,7 @@ class xS { volumeAnnotation: [] }; constructor(e) { - this.engine = e, this.clearHeightMeasure = new cS(e), this.distanceMeasure = new hS(e), this.clearDistanceMeasure = new uS(e), this.elevationMeasure = new dS(e), this.pointMeasure = new fS(e), this.angleMeasure = new pS(e), this.areaMeasure = new mS(e), this.slopeMeasure = new gS(e), this.tools = new Bi(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.parentElement.appendChild(this.annotationContainer); + this.engine = e, this.clearHeightMeasure = new cS(e), this.distanceMeasure = new hS(e), this.clearDistanceMeasure = new uS(e), this.elevationMeasure = new dS(e), this.pointMeasure = new fS(e), this.angleMeasure = new pS(e), this.areaMeasure = new mS(e), this.slopeMeasure = new gS(e), this.tools = new Bi(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer); } active() { this.isActive = !0, this.tools.active(); @@ -40801,7 +40852,7 @@ class vS { c.setAttribute("position", new at(h, 3)), c.setIndex(u); let d = t.meshs.find((m) => m.name == l); if (d == null) { - const m = new Zt({ + const m = new qt({ color: 65280, // 绿色 transparent: !0, @@ -40834,10 +40885,10 @@ class vS { o[0].z // 点1 ]); - let p = new Cs({ color: 255 }), g = new ut(); - g.setAttribute("position", new at(f, 3)); + let g = new Ps({ color: 255 }), p = new ut(); + p.setAttribute("position", new at(f, 3)); let x = t.meshs.find((m) => m.name == l + "Line"); - x == null && (x = new es(g, p), x.name = l + "Line", n.add(x), t.meshs.push(x)), x.geometry = g, x.material = p, t.engine.sectionPlane.find((m) => m.name == l).setFromNormalAndCoplanarPoint(a.clone().setLength(-1), e.min); + x == null && (x = new es(p, g), x.name = l + "Line", n.add(x), t.meshs.push(x)), x.geometry = p, x.material = g, t.engine.sectionPlane.find((m) => m.name == l).setFromNormalAndCoplanarPoint(a.clone().setLength(-1), e.min); } } // 重写鼠标按下事件 @@ -40874,11 +40925,11 @@ class vS { } } } -const L0 = 0, bS = 1, yS = 2, pp = 2, Nc = 1.25, mp = 1, hn = 32, jt = hn / 4, D0 = 65535, _S = Math.pow(2, -24), kc = Symbol("SKIP_GENERATION"); +const L0 = 0, bS = 1, yS = 2, pp = 2, Nc = 1.25, mp = 1, hn = 32, jt = hn / 4, D0 = 65535, _S = Math.pow(2, -24), Uc = Symbol("SKIP_GENERATION"); function MS(s) { return s.index ? s.index.count : s.attributes.position.count; } -function Ds(s) { +function Is(s) { return MS(s) / 3; } function wS(s, e = ArrayBuffer) { @@ -40893,7 +40944,7 @@ function SS(s, e) { } } function I0(s, e) { - const t = Ds(s), n = e || s.drawRange, i = n.start / 3, r = (n.start + n.count) / 3, o = Math.max(0, i), a = Math.min(t, r) - o; + const t = Is(s), n = e || s.drawRange, i = n.start / 3, r = (n.start + n.count) / 3, o = Math.max(0, i), a = Math.min(t, r) - o; return [{ offset: Math.floor(o), count: Math.floor(a) @@ -40902,10 +40953,10 @@ function I0(s, e) { function gp(s, e) { if (!s.groups || !s.groups.length) return I0(s, e); - const t = [], n = e || s.drawRange, i = n.start / 3, r = (n.start + n.count) / 3, o = Ds(s), a = []; + const t = [], n = e || s.drawRange, i = n.start / 3, r = (n.start + n.count) / 3, o = Is(s), a = []; for (const h of s.groups) { - const { start: u, count: d } = h, f = u / 3, p = isFinite(d) ? d : o * 3 - u, g = (u + p) / 3; - f < r && g > i && (a.push({ pos: Math.max(i, f), isStart: !0 }), a.push({ pos: Math.min(r, g), isStart: !1 })); + const { start: u, count: d } = h, f = u / 3, g = isFinite(d) ? d : o * 3 - u, p = (u + g) / 3; + f < r && p > i && (a.push({ pos: Math.max(i, f), isStart: !0 }), a.push({ pos: Math.min(r, p), isStart: !1 })); } a.sort((h, u) => h.pos !== u.pos ? h.pos - u.pos : h.type === "end" ? -1 : 1); let l = 0, c = null; @@ -40918,18 +40969,18 @@ function gp(s, e) { } return t; } -function Uc(s, e, t, n, i) { - let r = 1 / 0, o = 1 / 0, a = 1 / 0, l = -1 / 0, c = -1 / 0, h = -1 / 0, u = 1 / 0, d = 1 / 0, f = 1 / 0, p = -1 / 0, g = -1 / 0, x = -1 / 0; +function Oc(s, e, t, n, i) { + let r = 1 / 0, o = 1 / 0, a = 1 / 0, l = -1 / 0, c = -1 / 0, h = -1 / 0, u = 1 / 0, d = 1 / 0, f = 1 / 0, g = -1 / 0, p = -1 / 0, x = -1 / 0; const m = s.offset || 0; for (let b = (e - m) * 6, v = (e + t - m) * 6; b < v; b += 6) { const y = s[b + 0], M = s[b + 1], E = y - M, A = y + M; - E < r && (r = E), A > l && (l = A), y < u && (u = y), y > p && (p = y); + E < r && (r = E), A > l && (l = A), y < u && (u = y), y > g && (g = y); const R = s[b + 2], _ = s[b + 3], S = R - _, D = R + _; - S < o && (o = S), D > c && (c = D), R < d && (d = R), R > g && (g = R); + S < o && (o = S), D > c && (c = D), R < d && (d = R), R > p && (p = R); const C = s[b + 4], B = s[b + 5], w = C - B, F = C + B; w < a && (a = w), F > h && (h = F), C < f && (f = C), C > x && (x = C); } - n[0] = r, n[1] = o, n[2] = a, n[3] = l, n[4] = c, n[5] = h, i[0] = u, i[1] = d, i[2] = f, i[3] = p, i[4] = g, i[5] = x; + n[0] = r, n[1] = o, n[2] = a, n[3] = l, n[4] = c, n[5] = h, i[0] = u, i[1] = d, i[2] = f, i[3] = g, i[4] = p, i[5] = x; } function xp(s, e, t = null, n = null, i = null) { const r = s.attributes.position, o = s.index ? s.index.array : null, a = r.normalized; @@ -40941,9 +40992,9 @@ function xp(s, e, t = null, n = null, i = null) { let h = 3; r.isInterleavedBufferAttribute && (h = r.data.stride); const u = ["getX", "getY", "getZ"], d = i.offset; - for (let f = e, p = e + t; f < p; f++) { - const g = (n ? n[f] : f) * 3, x = (f - d) * 6; - let m = g + 0, b = g + 1, v = g + 2; + for (let f = e, g = e + t; f < g; f++) { + const p = (n ? n[f] : f) * 3, x = (f - d) * 6; + let m = p + 0, b = p + 1, v = p + 2; o && (m = o[m], b = o[b], v = o[v]), a || (m = m * h + c, b = b * h + c, v = v * h + c); for (let y = 0; y < 3; y++) { let M, E, A; @@ -40958,7 +41009,7 @@ function xp(s, e, t = null, n = null, i = null) { } return i; } -function It(s, e, t) { +function Dt(s, e, t) { return t.min.x = e[s], t.min.y = e[s + 1], t.min.z = e[s + 2], t.max.x = e[s + 3], t.max.y = e[s + 4], t.max.z = e[s + 5], t; } function vp(s) { @@ -40979,13 +41030,13 @@ function yp(s, e, t) { n = s[r], i = e[r], t[r] = n < i ? n : i, n = s[o], i = e[o], t[o] = n > i ? n : i; } } -function Ba(s, e, t) { +function Ia(s, e, t) { for (let n = 0; n < 3; n++) { const i = e[s + 2 * n], r = e[s + 2 * n + 1], o = i - r, a = i + r; o < t[n] && (t[n] = o), a > t[n + 3] && (t[n + 3] = a); } } -function eo(s) { +function to(s) { const e = s[3] - s[0], t = s[4] - s[1], n = s[5] - s[2]; return 2 * (e * t + t * n + n * e); } @@ -40995,7 +41046,7 @@ const Ei = 32, ES = (s, e) => s.candidate - e.candidate, Vi = /* @__PURE__ */ ne rightCacheBounds: new Float32Array(6), leftCacheBounds: new Float32Array(6), candidate: 0 -})), Na = /* @__PURE__ */ new Float32Array(6); +})), Ba = /* @__PURE__ */ new Float32Array(6); function TS(s, e, t, n, i, r) { let o = -1, a = 0; if (r === L0) @@ -41003,11 +41054,11 @@ function TS(s, e, t, n, i, r) { else if (r === bS) o = vp(s), o !== -1 && (a = AS(t, n, i, o)); else if (r === yS) { - const l = eo(s); + const l = to(s); let c = Nc * i; const h = t.offset || 0, u = (n - h) * 6, d = (n + i - h) * 6; for (let f = 0; f < 3; f++) { - const p = e[f], g = (e[f + 3] - p) / Ei; + const g = e[f], p = (e[f + 3] - g) / Ei; if (i < Ei / 4) { const x = [...Vi]; x.length = i; @@ -41022,7 +41073,7 @@ function TS(s, e, t, n, i, r) { } = y; for (let R = 0; R < 3; R++) A[R] = 1 / 0, A[R + 3] = -1 / 0, E[R] = 1 / 0, E[R + 3] = -1 / 0, M[R] = 1 / 0, M[R + 3] = -1 / 0; - Ba(v, t, M); + Ia(v, t, M); } x.sort(ES); let b = i; @@ -41035,31 +41086,31 @@ function TS(s, e, t, n, i, r) { const y = t[v + 2 * f]; for (let M = 0; M < b; M++) { const E = x[M]; - y >= E.candidate ? Ba(v, t, E.rightCacheBounds) : (Ba(v, t, E.leftCacheBounds), E.count++); + y >= E.candidate ? Ia(v, t, E.rightCacheBounds) : (Ia(v, t, E.leftCacheBounds), E.count++); } } for (let v = 0; v < b; v++) { const y = x[v], M = y.count, E = i - y.count, A = y.leftCacheBounds, R = y.rightCacheBounds; let _ = 0; - M !== 0 && (_ = eo(A) / l); + M !== 0 && (_ = to(A) / l); let S = 0; - E !== 0 && (S = eo(R) / l); + E !== 0 && (S = to(R) / l); const D = mp + Nc * (_ * M + S * E); D < c && (o = f, c = D, a = y.candidate); } } else { for (let b = 0; b < Ei; b++) { const v = Vi[b]; - v.count = 0, v.candidate = p + g + b * g; + v.count = 0, v.candidate = g + p + b * p; const y = v.bounds; for (let M = 0; M < 3; M++) y[M] = 1 / 0, y[M + 3] = -1 / 0; } for (let b = u; b < d; b += 6) { - let v = ~~((t[b + 2 * f] - p) / g); + let v = ~~((t[b + 2 * f] - g) / p); v >= Ei && (v = Ei - 1); const y = Vi[v]; - y.count++, Ba(b, t, y.bounds); + y.count++, Ia(b, t, y.bounds); } const x = Vi[Ei - 1]; bp(x.bounds, x.rightCacheBounds); @@ -41070,11 +41121,11 @@ function TS(s, e, t, n, i, r) { let m = 0; for (let b = 0; b < Ei - 1; b++) { const v = Vi[b], y = v.count, M = v.bounds, E = Vi[b + 1].rightCacheBounds; - y !== 0 && (m === 0 ? bp(M, Na) : yp(M, Na, Na)), m += y; + y !== 0 && (m === 0 ? bp(M, Ba) : yp(M, Ba, Ba)), m += y; let A = 0, R = 0; - m !== 0 && (A = eo(Na) / l); + m !== 0 && (A = to(Ba) / l); const _ = i - m; - _ !== 0 && (R = eo(E) / l); + _ !== 0 && (R = to(E) / l); const S = mp + Nc * (A * m + R * _); S < c && (o = f, c = S, a = v.candidate); } @@ -41091,7 +41142,7 @@ function AS(s, e, t, n) { i += s[(o - r) * 6 + n * 2]; return i / t; } -class Oc { +class kc { constructor() { this.boundingData = new Float32Array(6); } @@ -41110,8 +41161,8 @@ function CS(s, e, t, n, i, r) { e[o * 3 + u] = e[a * 3 + u], e[a * 3 + u] = d; } for (let u = 0; u < 6; u++) { - const d = o - h, f = a - h, p = t[d * 6 + u]; - t[d * 6 + u] = t[f * 6 + u], t[f * 6 + u] = p; + const d = o - h, f = a - h, g = t[d * 6 + u]; + t[d * 6 + u] = t[f * 6 + u], t[f * 6 + u] = g; } o++, a--; } else @@ -41130,35 +41181,35 @@ function PS(s, e, t, n, i, r) { let u = s[o]; s[o] = s[a], s[a] = u; for (let d = 0; d < 6; d++) { - const f = o - h, p = a - h, g = t[f * 6 + d]; - t[f * 6 + d] = t[p * 6 + d], t[p * 6 + d] = g; + const f = o - h, g = a - h, p = t[f * 6 + d]; + t[f * 6 + d] = t[g * 6 + d], t[g * 6 + d] = p; } o++, a--; } else return o; } } -let B0, hl, hu, N0; +let B0, cl, cu, N0; const RS = Math.pow(2, 32); -function uu(s) { - return "count" in s ? 1 : 1 + uu(s.left) + uu(s.right); +function hu(s) { + return "count" in s ? 1 : 1 + hu(s.left) + hu(s.right); } function LS(s, e, t) { - return B0 = new Float32Array(t), hl = new Uint32Array(t), hu = new Uint16Array(t), N0 = new Uint8Array(t), du(s, e); + return B0 = new Float32Array(t), cl = new Uint32Array(t), cu = new Uint16Array(t), N0 = new Uint8Array(t), uu(s, e); } -function du(s, e) { +function uu(s, e) { const t = s / 4, n = s / 2, i = "count" in e, r = e.boundingData; for (let o = 0; o < 6; o++) B0[t + o] = r[o]; if (i) - return e.buffer ? (N0.set(new Uint8Array(e.buffer), s), s + e.buffer.byteLength) : (hl[t + 6] = e.offset, hu[n + 14] = e.count, hu[n + 15] = D0, s + hn); + return e.buffer ? (N0.set(new Uint8Array(e.buffer), s), s + e.buffer.byteLength) : (cl[t + 6] = e.offset, cu[n + 14] = e.count, cu[n + 15] = D0, s + hn); { const { left: o, right: a, splitAxis: l } = e, c = s + hn; - let h = du(c, o); + let h = uu(c, o); const u = s / hn, d = h / hn - u; if (d > RS) throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits."); - return hl[t + 6] = d, hl[t + 7] = l, du(h, a); + return cl[t + 6] = d, cl[t + 7] = l, uu(h, a); } } function DS(s, e, t) { @@ -41180,12 +41231,12 @@ function IS(s, e, t, n, i) { strategy: l, onProgress: c, indirect: h - } = i, u = s._indirectBuffer, d = s.geometry, f = d.index ? d.index.array : null, p = h ? PS : CS, g = Ds(d), x = new Float32Array(6); + } = i, u = s._indirectBuffer, d = s.geometry, f = d.index ? d.index.array : null, g = h ? PS : CS, p = Is(d), x = new Float32Array(6); let m = !1; - const b = new Oc(); - return Uc(e, t, n, b.boundingData, x), y(b, t, n, x), b; + const b = new kc(); + return Oc(e, t, n, b.boundingData, x), y(b, t, n, x), b; function v(M) { - c && c(M / g); + c && c(M / p); } function y(M, E, A, R = null, _ = 0) { if (!m && _ >= r && (m = !0, o && (console.warn(`MeshBVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`), console.warn(d))), A <= a || _ >= r) @@ -41193,15 +41244,15 @@ function IS(s, e, t, n, i) { const S = TS(M.boundingData, R, e, E, A, l); if (S.axis === -1) return v(E + A), M.offset = E, M.count = A, M; - const D = p(u, f, e, E, A, S); + const D = g(u, f, e, E, A, S); if (D === E || D === E + A) v(E + A), M.offset = E, M.count = A; else { M.splitAxis = S.axis; - const C = new Oc(), B = E, w = D - E; - M.left = C, Uc(e, B, w, C.boundingData, x), y(C, B, w, x, _ + 1); - const F = new Oc(), W = D, j = A - w; - M.right = F, Uc(e, W, j, F.boundingData, x), y(F, W, j, x, _ + 1); + const C = new kc(), B = E, w = D - E; + M.left = C, Oc(e, B, w, C.boundingData, x), y(C, B, w, x, _ + 1); + const F = new kc(), W = D, j = A - w; + M.right = F, Oc(e, W, j, F.boundingData, x), y(F, W, j, x, _ + 1); } return M; } @@ -41218,7 +41269,7 @@ function BS(s, e) { i = xp(n, o.offset, o.count), r = gp(n, e.range); } s._roots = r.map((o) => { - const a = IS(s, i, o.offset, o.count, e), l = uu(a), c = new t(hn * l); + const a = IS(s, i, o.offset, o.count, e), l = hu(a), c = new t(hn * l); return LS(0, a, c), c; }); } @@ -41266,11 +41317,11 @@ const NS = /* @__PURE__ */ (function() { return function(n, i, r) { const o = n.start, a = s, l = i.start, c = e; t.subVectors(o, l), s.subVectors(n.end, n.start), e.subVectors(i.end, i.start); - const h = t.dot(c), u = c.dot(a), d = c.dot(c), f = t.dot(a), p = a.dot(a) * d - u * u; - let g, x; - p !== 0 ? g = (h * u - f * d) / p : g = 0, x = (h + g * u) / d, r.x = g, r.y = x; + const h = t.dot(c), u = c.dot(a), d = c.dot(c), f = t.dot(a), g = a.dot(a) * d - u * u; + let p, x; + g !== 0 ? p = (h * u - f * d) / g : p = 0, x = (h + p * u) / d, r.x = p, r.y = x; }; -})(), Yu = /* @__PURE__ */ (function() { +})(), qu = /* @__PURE__ */ (function() { const s = /* @__PURE__ */ new ce(), e = /* @__PURE__ */ new P(), t = /* @__PURE__ */ new P(); return function(n, i, r, o) { NS(n, i, s); @@ -41299,7 +41350,7 @@ const NS = /* @__PURE__ */ (function() { } } }; -})(), kS = /* @__PURE__ */ (function() { +})(), US = /* @__PURE__ */ (function() { const s = /* @__PURE__ */ new P(), e = /* @__PURE__ */ new P(), t = /* @__PURE__ */ new _t(), n = /* @__PURE__ */ new Hn(); return function(i, r) { const { radius: o, center: a } = i, { a: l, b: c, c: h } = r; @@ -41311,7 +41362,7 @@ const NS = /* @__PURE__ */ (function() { } return !1; }; -})(), US = ["x", "y", "z"], Ti = 1e-15, _p = Ti * Ti; +})(), OS = ["x", "y", "z"], Ti = 1e-15, _p = Ti * Ti; function Ln(s) { return Math.abs(s) < Ti; } @@ -41320,7 +41371,7 @@ class Vn extends bt { super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new P()), this.satBounds = new Array(4).fill().map(() => new Di()), this.points = [this.a, this.b, this.c], this.plane = new _t(), this.isDegenerateIntoSegment = !1, this.isDegenerateIntoPoint = !1, this.degenerateSegment = new Hn(), this.needsUpdate = !0; } intersectsSphere(e) { - return kS(e, this); + return US(e, this); } update() { const e = this.a, t = this.b, n = this.c, i = this.points, r = this.satAxes, o = this.satBounds, a = r[0], l = o[0]; @@ -41329,10 +41380,10 @@ class Vn extends bt { c.subVectors(e, t), h.setFromPoints(c, i); const u = r[2], d = o[2]; u.subVectors(t, n), d.setFromPoints(u, i); - const f = r[3], p = o[3]; - f.subVectors(n, e), p.setFromPoints(f, i); - const g = c.length(), x = u.length(), m = f.length(); - this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, g < Ti ? x < Ti || m < Ti ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : x < Ti ? m < Ti ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : m < Ti && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1; + const f = r[3], g = o[3]; + f.subVectors(n, e), g.setFromPoints(f, i); + const p = c.length(), x = u.length(), m = f.length(); + this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, p < Ti ? x < Ti || m < Ti ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : x < Ti ? m < Ti ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : m < Ti && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1; } } Vn.prototype.closestPointToSegment = /* @__PURE__ */ (function() { @@ -41342,7 +41393,7 @@ Vn.prototype.closestPointToSegment = /* @__PURE__ */ (function() { let c, h = 1 / 0; for (let u = 0; u < 3; u++) { const d = (u + 1) % 3; - t.start.copy(l[u]), t.end.copy(l[d]), Yu(t, n, s, e), c = s.distanceToSquared(e), c < h && (h = c, i && i.copy(s), r && r.copy(e)); + t.start.copy(l[u]), t.end.copy(l[d]), qu(t, n, s, e), c = s.distanceToSquared(e), c < h && (h = c, i && i.copy(s), r && r.copy(e)); } return this.closestPointToPoint(o, s), c = o.distanceToSquared(s), c < h && (h = c, i && i.copy(s), r && r.copy(o)), this.closestPointToPoint(a, s), c = a.distanceToSquared(s), c < h && (h = c, i && i.copy(s), r && r.copy(a)), Math.sqrt(h); }; @@ -41368,7 +41419,7 @@ Vn.prototype.intersectsTriangle = /* @__PURE__ */ (function() { let w = _ / (_ - S); C.x = E + (A - E) * w, B.start.subVectors(y, v).multiplyScalar(w).add(v), w = _ / (_ - D), C.y = E + (R - E) * w, B.end.subVectors(M, v).multiplyScalar(w).add(v); } - function p(v, y, M, E, A, R, _, S, D, C, B) { + function g(v, y, M, E, A, R, _, S, D, C, B) { if (A > 0) f(v.c, v.a, v.b, E, y, M, D, _, S, C, B); else if (R > 0) @@ -41383,7 +41434,7 @@ Vn.prototype.intersectsTriangle = /* @__PURE__ */ (function() { return !0; return !1; } - function g(v, y, M, E) { + function p(v, y, M, E) { const A = y.degenerateSegment, R = v.plane.distanceToPoint(A.start), _ = v.plane.distanceToPoint(A.end); return Ln(R) ? Ln(_) ? d(v, y, M, E) : (M && (M.start.copy(A.start), M.end.copy(A.start)), v.containsPoint(A.start)) : Ln(_) ? (M && (M.start.copy(A.end), M.end.copy(A.end)), v.containsPoint(A.end)) : v.plane.intersectLine(A, n) != null ? (M && (M.start.copy(n), M.end.copy(n)), v.containsPoint(n)) : !1; } @@ -41408,14 +41459,14 @@ Vn.prototype.intersectsTriangle = /* @__PURE__ */ (function() { return !1; const F = A.start.z + _.z * B, W = R.start.z + S.z * w; return Ln(F - W) ? (M && (M.start.copy(A.start).addScaledVector(_, B), M.end.copy(A.start).addScaledVector(_, B)), !0) : !1; - } else return y.isDegenerateIntoPoint ? m(v, y, M) : g(y, v, M, E); + } else return y.isDegenerateIntoPoint ? m(v, y, M) : p(y, v, M, E); else { if (v.isDegenerateIntoPoint) return y.isDegenerateIntoPoint ? y.a.distanceToSquared(v.a) < _p ? (M && (M.start.copy(v.a), M.end.copy(v.a)), !0) : !1 : y.isDegenerateIntoSegment ? m(y, v, M) : x(y, v, M); if (y.isDegenerateIntoPoint) return x(v, y, M); if (y.isDegenerateIntoSegment) - return g(v, y, M, E); + return p(v, y, M, E); } } return function(v, y = null, M = !1) { @@ -41435,14 +41486,14 @@ Vn.prototype.intersectsTriangle = /* @__PURE__ */ (function() { if (j > 0 && $ > 0) return !1; i.copy(A.normal), r.copy(R.normal); - const Z = i.cross(r); - let re = 0, X = Math.abs(Z.x); - const Y = Math.abs(Z.y); - Y > X && (X = Y, re = 1), Math.abs(Z.z) > X && (re = 2); - const ge = US[re], pe = this.a[ge], de = this.b[ge], ie = this.c[ge], he = v.a[ge], fe = v.b[ge], ve = v.c[ge]; - if (p(this, pe, de, ie, C, B, _, S, D, h, a)) + const q = i.cross(r); + let re = 0, X = Math.abs(q.x); + const Y = Math.abs(q.y); + Y > X && (X = Y, re = 1), Math.abs(q.z) > X && (re = 2); + const ge = OS[re], pe = this.a[ge], de = this.b[ge], ie = this.c[ge], he = v.a[ge], fe = v.b[ge], ve = v.c[ge]; + if (g(this, pe, de, ie, C, B, _, S, D, h, a)) return d(this, v, y, M); - if (p(v, he, fe, ve, j, $, w, F, W, u, l)) + if (g(v, he, fe, ve, j, $, w, F, W, u, l)) return d(this, v, y, M); if (h.y < h.x) { const we = h.y; @@ -41472,15 +41523,15 @@ Vn.prototype.distanceToTriangle = /* @__PURE__ */ (function() { let u; const d = t[h], f = r[d]; this.closestPointToPoint(f, s), u = f.distanceToSquared(s), u < c && (c = u, o && o.copy(s), a && a.copy(f)); - const p = this[d]; - r.closestPointToPoint(p, s), u = p.distanceToSquared(s), u < c && (c = u, o && o.copy(p), a && a.copy(s)); + const g = this[d]; + r.closestPointToPoint(g, s), u = g.distanceToSquared(s), u < c && (c = u, o && o.copy(g), a && a.copy(s)); } for (let h = 0; h < 3; h++) { const u = t[h], d = t[(h + 1) % 3]; n.set(this[u], this[d]); for (let f = 0; f < 3; f++) { - const p = t[f], g = t[(f + 1) % 3]; - i.set(r[p], r[g]), Yu(n, i, s, e); + const g = t[f], p = t[(f + 1) % 3]; + i.set(r[g], r[p]), qu(n, i, s, e); const x = s.distanceToSquared(e); x < c && (c = x, o && o.copy(s), a && a.copy(e)); } @@ -41548,8 +41599,8 @@ dn.prototype.intersectsTriangle = /* @__PURE__ */ (function() { for (let u = 0; u < 3; u++) { const d = a[u]; for (let f = 0; f < 4; f++) { - const p = c[f]; - if (i.crossVectors(d, p), t.setFromPoints(i, e), n.setFromPoints(i, h), t.isSeparated(n)) return !1; + const g = c[f]; + if (i.crossVectors(d, g), t.setFromPoints(i, e), n.setFromPoints(i, h), t.isSeparated(n)) return !1; } } return !0; @@ -41573,35 +41624,35 @@ dn.prototype.distanceToBox = /* @__PURE__ */ (function() { return (a || l) && (r.getCenter(i), this.closestPointToPoint(i, n), r.closestPointToPoint(n, i), a && a.copy(n), l && l.copy(i)), 0; const c = o * o, h = r.min, u = r.max, d = this.points; let f = 1 / 0; - for (let g = 0; g < 8; g++) { - const x = d[g]; + for (let p = 0; p < 8; p++) { + const x = d[p]; i.copy(x).clamp(h, u); const m = x.distanceToSquared(i); if (m < f && (f = m, a && a.copy(x), l && l.copy(i), m < c)) return Math.sqrt(m); } - let p = 0; - for (let g = 0; g < 3; g++) + let g = 0; + for (let p = 0; p < 3; p++) for (let x = 0; x <= 1; x++) for (let m = 0; m <= 1; m++) { - const b = (g + 1) % 3, v = (g + 2) % 3, y = x << b | m << v, M = 1 << g | x << b | m << v, E = d[y], A = d[M]; - e[p].set(E, A); - const R = s[g], _ = s[b], S = s[v], D = t[p], C = D.start, B = D.end; - C[R] = h[R], C[_] = x ? h[_] : u[_], C[S] = m ? h[S] : u[_], B[R] = u[R], B[_] = x ? h[_] : u[_], B[S] = m ? h[S] : u[_], p++; + const b = (p + 1) % 3, v = (p + 2) % 3, y = x << b | m << v, M = 1 << p | x << b | m << v, E = d[y], A = d[M]; + e[g].set(E, A); + const R = s[p], _ = s[b], S = s[v], D = t[g], C = D.start, B = D.end; + C[R] = h[R], C[_] = x ? h[_] : u[_], C[S] = m ? h[S] : u[_], B[R] = u[R], B[_] = x ? h[_] : u[_], B[S] = m ? h[S] : u[_], g++; } - for (let g = 0; g <= 1; g++) + for (let p = 0; p <= 1; p++) for (let x = 0; x <= 1; x++) for (let m = 0; m <= 1; m++) { - i.x = g ? u.x : h.x, i.y = x ? u.y : h.y, i.z = m ? u.z : h.z, this.closestPointToPoint(i, n); + i.x = p ? u.x : h.x, i.y = x ? u.y : h.y, i.z = m ? u.z : h.z, this.closestPointToPoint(i, n); const b = i.distanceToSquared(n); if (b < f && (f = b, a && a.copy(n), l && l.copy(i), b < c)) return Math.sqrt(b); } - for (let g = 0; g < 12; g++) { - const x = e[g]; + for (let p = 0; p < 12; p++) { + const x = e[p]; for (let m = 0; m < 12; m++) { const b = t[m]; - Yu(x, b, n, i); + qu(x, b, n, i); const v = n.distanceToSquared(i); if (v < f && (f = v, a && a.copy(n), l && l.copy(i), v < c)) return Math.sqrt(v); @@ -41610,7 +41661,7 @@ dn.prototype.distanceToBox = /* @__PURE__ */ (function() { return Math.sqrt(f); }; })(); -class Ku { +class Yu { constructor(e) { this._getNewPrimitive = e, this._primitives = []; } @@ -41622,19 +41673,19 @@ class Ku { this._primitives.push(e); } } -class OS extends Ku { +class kS extends Yu { constructor() { super(() => new Vn()); } } -const Nn = /* @__PURE__ */ new OS(); -function qt(s, e) { +const Nn = /* @__PURE__ */ new kS(); +function Zt(s, e) { return e[s + 15] === D0; } function Cn(s, e) { return e[s + 6]; } -function kn(s, e) { +function Un(s, e) { return e[s + 14]; } function Kt(s) { @@ -41644,7 +41695,7 @@ function $t(s, e) { const t = e[s + 6]; return s + t * jt; } -function $u(s, e) { +function Ku(s, e) { return e[s + 7]; } class FS { @@ -41660,51 +41711,51 @@ class FS { } } const Mt = /* @__PURE__ */ new FS(); -let Zi, dr; -const nr = [], ka = /* @__PURE__ */ new Ku(() => new vt()); +let qi, fr; +const ir = [], Na = /* @__PURE__ */ new Yu(() => new vt()); function zS(s, e, t, n, i, r) { - Zi = ka.getPrimitive(), dr = ka.getPrimitive(), nr.push(Zi, dr), Mt.setBuffer(s._roots[e]); - const o = fu(0, s.geometry, t, n, i, r); - Mt.clearBuffer(), ka.releasePrimitive(Zi), ka.releasePrimitive(dr), nr.pop(), nr.pop(); - const a = nr.length; - return a > 0 && (dr = nr[a - 1], Zi = nr[a - 2]), o; + qi = Na.getPrimitive(), fr = Na.getPrimitive(), ir.push(qi, fr), Mt.setBuffer(s._roots[e]); + const o = du(0, s.geometry, t, n, i, r); + Mt.clearBuffer(), Na.releasePrimitive(qi), Na.releasePrimitive(fr), ir.pop(), ir.pop(); + const a = ir.length; + return a > 0 && (fr = ir[a - 1], qi = ir[a - 2]), o; } -function fu(s, e, t, n, i = null, r = 0, o = 0) { +function du(s, e, t, n, i = null, r = 0, o = 0) { const { float32Array: a, uint16Array: l, uint32Array: c } = Mt; let h = s * 2; - if (qt(h, l)) { - const u = Cn(s, c), d = kn(h, l); - return It(s, a, Zi), n(u, d, !1, o, r + s / jt, Zi); + if (Zt(h, l)) { + const u = Cn(s, c), d = Un(h, l); + return Dt(s, a, qi), n(u, d, !1, o, r + s / jt, qi); } else { let u = function(D) { const { uint16Array: C, uint32Array: B } = Mt; let w = D * 2; - for (; !qt(w, C); ) + for (; !Zt(w, C); ) D = Kt(D), w = D * 2; return Cn(D, B); }, d = function(D) { const { uint16Array: C, uint32Array: B } = Mt; let w = D * 2; - for (; !qt(w, C); ) + for (; !Zt(w, C); ) D = $t(D, B), w = D * 2; - return Cn(D, B) + kn(w, C); + return Cn(D, B) + Un(w, C); }; - const f = Kt(s), p = $t(s, c); - let g = f, x = p, m, b, v, y; - if (i && (v = Zi, y = dr, It(g, a, v), It(x, a, y), m = i(v), b = i(y), b < m)) { - g = p, x = f; + const f = Kt(s), g = $t(s, c); + let p = f, x = g, m, b, v, y; + if (i && (v = qi, y = fr, Dt(p, a, v), Dt(x, a, y), m = i(v), b = i(y), b < m)) { + p = g, x = f; const D = m; m = b, b = D, v = y; } - v || (v = Zi, It(g, a, v)); - const M = qt(g * 2, l), E = t(v, M, m, o + 1, r + g / jt); + v || (v = qi, Dt(p, a, v)); + const M = Zt(p * 2, l), E = t(v, M, m, o + 1, r + p / jt); let A; if (E === pp) { - const D = u(g), C = d(g) - D; - A = n(D, C, !0, o + 1, r + g / jt, v); + const D = u(p), C = d(p) - D; + A = n(D, C, !0, o + 1, r + p / jt, v); } else - A = E && fu( - g, + A = E && du( + p, e, t, n, @@ -41713,14 +41764,14 @@ function fu(s, e, t, n, i = null, r = 0, o = 0) { o + 1 ); if (A) return !0; - y = dr, It(x, a, y); - const R = qt(x * 2, l), _ = t(y, R, b, o + 1, r + x / jt); + y = fr, Dt(x, a, y); + const R = Zt(x * 2, l), _ = t(y, R, b, o + 1, r + x / jt); let S; if (_ === pp) { const D = u(x), C = d(x) - D; S = n(D, C, !0, o + 1, r + x / jt, y); } else - S = _ && fu( + S = _ && du( x, e, t, @@ -41732,25 +41783,25 @@ function fu(s, e, t, n, i = null, r = 0, o = 0) { return !!S; } } -const to = /* @__PURE__ */ new P(), Fc = /* @__PURE__ */ new P(); +const no = /* @__PURE__ */ new P(), Fc = /* @__PURE__ */ new P(); function HS(s, e, t = {}, n = 0, i = 1 / 0) { const r = n * n, o = i * i; let a = 1 / 0, l = null; if (s.shapecast( { - boundsTraverseOrder: (h) => (to.copy(e).clamp(h.min, h.max), to.distanceToSquared(e)), + boundsTraverseOrder: (h) => (no.copy(e).clamp(h.min, h.max), no.distanceToSquared(e)), intersectsBounds: (h, u, d) => d < a && d < o, intersectsTriangle: (h, u) => { - h.closestPointToPoint(e, to); - const d = e.distanceToSquared(to); - return d < a && (Fc.copy(to), a = d, l = u), d < r; + h.closestPointToPoint(e, no); + const d = e.distanceToSquared(no); + return d < a && (Fc.copy(no), a = d, l = u), d < r; } } ), a === 1 / 0) return null; const c = Math.sqrt(a); return t.point ? t.point.copy(Fc) : t.point = Fc.clone(), t.distance = c, t.faceIndex = l, t; } -const Ua = parseInt(Do) >= 169, VS = parseInt(Do) <= 161, hs = /* @__PURE__ */ new P(), us = /* @__PURE__ */ new P(), ds = /* @__PURE__ */ new P(), Oa = /* @__PURE__ */ new ce(), Fa = /* @__PURE__ */ new ce(), za = /* @__PURE__ */ new ce(), Mp = /* @__PURE__ */ new P(), wp = /* @__PURE__ */ new P(), Sp = /* @__PURE__ */ new P(), no = /* @__PURE__ */ new P(); +const Ua = parseInt(Io) >= 169, VS = parseInt(Io) <= 161, hs = /* @__PURE__ */ new P(), us = /* @__PURE__ */ new P(), ds = /* @__PURE__ */ new P(), Oa = /* @__PURE__ */ new ce(), ka = /* @__PURE__ */ new ce(), Fa = /* @__PURE__ */ new ce(), Mp = /* @__PURE__ */ new P(), wp = /* @__PURE__ */ new P(), Sp = /* @__PURE__ */ new P(), io = /* @__PURE__ */ new P(); function GS(s, e, t, n, i, r, o, a) { let l; if (r === un ? l = s.intersectTriangle(n, t, e, !0, i) : l = s.intersectTriangle(e, t, n, r !== At, i), l === null) return null; @@ -41762,21 +41813,21 @@ function GS(s, e, t, n, i, r, o, a) { } function Ep(s, e, t, n, i, r, o, a, l, c, h) { hs.fromBufferAttribute(e, r), us.fromBufferAttribute(e, o), ds.fromBufferAttribute(e, a); - const u = GS(s, hs, us, ds, no, l, c, h); + const u = GS(s, hs, us, ds, io, l, c, h); if (u) { if (n) { - Oa.fromBufferAttribute(n, r), Fa.fromBufferAttribute(n, o), za.fromBufferAttribute(n, a), u.uv = new ce(); - const f = bt.getInterpolation(no, hs, us, ds, Oa, Fa, za, u.uv); + Oa.fromBufferAttribute(n, r), ka.fromBufferAttribute(n, o), Fa.fromBufferAttribute(n, a), u.uv = new ce(); + const f = bt.getInterpolation(io, hs, us, ds, Oa, ka, Fa, u.uv); Ua || (u.uv = f); } if (i) { - Oa.fromBufferAttribute(i, r), Fa.fromBufferAttribute(i, o), za.fromBufferAttribute(i, a), u.uv1 = new ce(); - const f = bt.getInterpolation(no, hs, us, ds, Oa, Fa, za, u.uv1); + Oa.fromBufferAttribute(i, r), ka.fromBufferAttribute(i, o), Fa.fromBufferAttribute(i, a), u.uv1 = new ce(); + const f = bt.getInterpolation(io, hs, us, ds, Oa, ka, Fa, u.uv1); Ua || (u.uv1 = f), VS && (u.uv2 = u.uv1); } if (t) { Mp.fromBufferAttribute(t, r), wp.fromBufferAttribute(t, o), Sp.fromBufferAttribute(t, a), u.normal = new P(); - const f = bt.getInterpolation(no, hs, us, ds, Mp, wp, Sp, u.normal); + const f = bt.getInterpolation(io, hs, us, ds, Mp, wp, Sp, u.normal); u.normal.dot(s.direction) > 0 && u.normal.multiplyScalar(-1), Ua || (u.normal = f); } const d = { @@ -41788,7 +41839,7 @@ function Ep(s, e, t, n, i, r, o, a, l, c, h) { }; if (bt.getNormal(hs, us, ds, d.normal), u.face = d, u.faceIndex = r, Ua) { const f = new P(); - bt.getBarycoord(no, hs, us, ds, f), u.barycoord = f; + bt.getBarycoord(io, hs, us, ds, f), u.barycoord = f; } } return u; @@ -41796,18 +41847,18 @@ function Ep(s, e, t, n, i, r, o, a, l, c, h) { function Tp(s) { return s && s.isMaterial ? s.side : s; } -function Ul(s, e, t, n, i, r, o) { +function Ol(s, e, t, n, i, r, o) { const a = n * 3; let l = a + 0, c = a + 1, h = a + 2; const { index: u, groups: d } = s; s.index && (l = u.getX(l), c = u.getX(c), h = u.getX(h)); - const { position: f, normal: p, uv: g, uv1: x } = s.attributes; + const { position: f, normal: g, uv: p, uv1: x } = s.attributes; if (Array.isArray(e)) { const m = n * 3; for (let b = 0, v = d.length; b < v; b++) { const { start: y, count: M, materialIndex: E } = d[b]; if (m >= y && m < y + M) { - const A = Tp(e[E]), R = Ep(t, f, p, g, x, l, c, h, A, r, o); + const A = Tp(e[E]), R = Ep(t, f, g, p, x, l, c, h, A, r, o); if (R) if (R.faceIndex = n, R.face.materialIndex = E, i) i.push(R); @@ -41816,7 +41867,7 @@ function Ul(s, e, t, n, i, r, o) { } } } else { - const m = Tp(e), b = Ep(t, f, p, g, x, l, c, h, m, r, o); + const m = Tp(e), b = Ep(t, f, g, p, x, l, c, h, m, r, o); if (b) if (b.faceIndex = n, b.face.materialIndex = 0, i) i.push(b); @@ -41833,14 +41884,14 @@ function zt(s, e, t, n) { function WS(s, e, t, n, i, r, o, a) { const { geometry: l, _indirectBuffer: c } = s; for (let h = n, u = n + i; h < u; h++) - Ul(l, e, t, h, r, o, a); + Ol(l, e, t, h, r, o, a); } function XS(s, e, t, n, i, r, o) { const { geometry: a, _indirectBuffer: l } = s; let c = 1 / 0, h = null; for (let u = n, d = n + i; u < d; u++) { let f; - f = Ul(a, e, t, u, null, r, o), f && f.distance < c && (h = f, c = f.distance); + f = Ol(a, e, t, u, null, r, o), f && f.distance < c && (h = f, c = f.distance); } return h; } @@ -41853,17 +41904,17 @@ function jS(s, e, t, n, i, r, o) { } return !1; } -function qS(s, e = null) { +function ZS(s, e = null) { e && Array.isArray(e) && (e = new Set(e)); const t = s.geometry, n = t.index ? t.index.array : null, i = t.attributes.position; let r, o, a, l, c = 0; const h = s._roots; for (let d = 0, f = h.length; d < f; d++) r = h[d], o = new Uint32Array(r), a = new Uint16Array(r), l = new Float32Array(r), u(0, c), c += r.byteLength; - function u(d, f, p = !1) { - const g = d * 2; - if (qt(g, a)) { - const x = o[d + 6], m = a[g + 14]; + function u(d, f, g = !1) { + const p = d * 2; + if (Zt(p, a)) { + const x = o[d + 6], m = a[p + 14]; let b = 1 / 0, v = 1 / 0, y = 1 / 0, M = -1 / 0, E = -1 / 0, A = -1 / 0; for (let R = 3 * x, _ = 3 * (x + m); R < _; R++) { let S = n[R]; @@ -41873,7 +41924,7 @@ function qS(s, e = null) { return l[d + 0] !== b || l[d + 1] !== v || l[d + 2] !== y || l[d + 3] !== M || l[d + 4] !== E || l[d + 5] !== A ? (l[d + 0] = b, l[d + 1] = v, l[d + 2] = y, l[d + 3] = M, l[d + 4] = E, l[d + 5] = A, !0) : !1; } else { const x = Kt(d), m = $t(d, o); - let b = p, v = !1, y = !1; + let b = g, v = !1, y = !1; if (e) { if (!b) { const S = x / jt + f / hn, D = m / jt + f / hn; @@ -41898,15 +41949,15 @@ function qS(s, e = null) { } function Ji(s, e, t, n, i) { let r, o, a, l, c, h; - const u = 1 / t.direction.x, d = 1 / t.direction.y, f = 1 / t.direction.z, p = t.origin.x, g = t.origin.y, x = t.origin.z; + const u = 1 / t.direction.x, d = 1 / t.direction.y, f = 1 / t.direction.z, g = t.origin.x, p = t.origin.y, x = t.origin.z; let m = e[s], b = e[s + 3], v = e[s + 1], y = e[s + 3 + 1], M = e[s + 2], E = e[s + 3 + 2]; - return u >= 0 ? (r = (m - p) * u, o = (b - p) * u) : (r = (b - p) * u, o = (m - p) * u), d >= 0 ? (a = (v - g) * d, l = (y - g) * d) : (a = (y - g) * d, l = (v - g) * d), r > l || a > o || ((a > r || isNaN(r)) && (r = a), (l < o || isNaN(o)) && (o = l), f >= 0 ? (c = (M - x) * f, h = (E - x) * f) : (c = (E - x) * f, h = (M - x) * f), r > h || c > o) ? !1 : ((c > r || r !== r) && (r = c), (h < o || o !== o) && (o = h), r <= i && o >= n); + return u >= 0 ? (r = (m - g) * u, o = (b - g) * u) : (r = (b - g) * u, o = (m - g) * u), d >= 0 ? (a = (v - p) * d, l = (y - p) * d) : (a = (y - p) * d, l = (v - p) * d), r > l || a > o || ((a > r || isNaN(r)) && (r = a), (l < o || isNaN(o)) && (o = l), f >= 0 ? (c = (M - x) * f, h = (E - x) * f) : (c = (E - x) * f, h = (M - x) * f), r > h || c > o) ? !1 : ((c > r || r !== r) && (r = c), (h < o || o !== o) && (o = h), r <= i && o >= n); } -function ZS(s, e, t, n, i, r, o, a) { +function qS(s, e, t, n, i, r, o, a) { const { geometry: l, _indirectBuffer: c } = s; for (let h = n, u = n + i; h < u; h++) { let d = c ? c[h] : h; - Ul(l, e, t, d, r, o, a); + Ol(l, e, t, d, r, o, a); } } function YS(s, e, t, n, i, r, o) { @@ -41914,7 +41965,7 @@ function YS(s, e, t, n, i, r, o) { let c = 1 / 0, h = null; for (let u = n, d = n + i; u < d; u++) { let f; - f = Ul(a, e, t, l ? l[u] : u, null, r, o), f && f.distance < c && (h = f, c = f.distance); + f = Ol(a, e, t, l ? l[u] : u, null, r, o), f && f.distance < c && (h = f, c = f.distance); } return h; } @@ -41928,128 +41979,128 @@ function KS(s, e, t, n, i, r, o) { return !1; } function $S(s, e, t, n, i, r, o) { - Mt.setBuffer(s._roots[e]), pu(0, s, t, n, i, r, o), Mt.clearBuffer(); + Mt.setBuffer(s._roots[e]), fu(0, s, t, n, i, r, o), Mt.clearBuffer(); } -function pu(s, e, t, n, i, r, o) { +function fu(s, e, t, n, i, r, o) { const { float32Array: a, uint16Array: l, uint32Array: c } = Mt, h = s * 2; - if (qt(h, l)) { - const u = Cn(s, c), d = kn(h, l); + if (Zt(h, l)) { + const u = Cn(s, c), d = Un(h, l); WS(e, t, n, u, d, i, r, o); } else { const u = Kt(s); - Ji(u, a, n, r, o) && pu(u, e, t, n, i, r, o); + Ji(u, a, n, r, o) && fu(u, e, t, n, i, r, o); const d = $t(s, c); - Ji(d, a, n, r, o) && pu(d, e, t, n, i, r, o); + Ji(d, a, n, r, o) && fu(d, e, t, n, i, r, o); } } const JS = ["x", "y", "z"]; function QS(s, e, t, n, i, r) { Mt.setBuffer(s._roots[e]); - const o = mu(0, s, t, n, i, r); + const o = pu(0, s, t, n, i, r); return Mt.clearBuffer(), o; } -function mu(s, e, t, n, i, r) { +function pu(s, e, t, n, i, r) { const { float32Array: o, uint16Array: a, uint32Array: l } = Mt; let c = s * 2; - if (qt(c, a)) { - const h = Cn(s, l), u = kn(c, a); + if (Zt(c, a)) { + const h = Cn(s, l), u = Un(c, a); return XS(e, t, n, h, u, i, r); } else { - const h = $u(s, l), u = JS[h], d = n.direction[u] >= 0; - let f, p; - d ? (f = Kt(s), p = $t(s, l)) : (f = $t(s, l), p = Kt(s)); - const g = Ji(f, o, n, i, r) ? mu(f, e, t, n, i, r) : null; - if (g) { - const m = g.point[u]; - if (d ? m <= o[p + h] : ( + const h = Ku(s, l), u = JS[h], d = n.direction[u] >= 0; + let f, g; + d ? (f = Kt(s), g = $t(s, l)) : (f = $t(s, l), g = Kt(s)); + const p = Ji(f, o, n, i, r) ? pu(f, e, t, n, i, r) : null; + if (p) { + const m = p.point[u]; + if (d ? m <= o[g + h] : ( // min bounding data - m >= o[p + h + 3] + m >= o[g + h + 3] )) - return g; + return p; } - const x = Ji(p, o, n, i, r) ? mu(p, e, t, n, i, r) : null; - return g && x ? g.distance <= x.distance ? g : x : g || x || null; + const x = Ji(g, o, n, i, r) ? pu(g, e, t, n, i, r) : null; + return p && x ? p.distance <= x.distance ? p : x : p || x || null; } } -const Ha = /* @__PURE__ */ new vt(), ir = /* @__PURE__ */ new Vn(), sr = /* @__PURE__ */ new Vn(), io = /* @__PURE__ */ new ze(), Ap = /* @__PURE__ */ new dn(), Va = /* @__PURE__ */ new dn(); +const za = /* @__PURE__ */ new vt(), sr = /* @__PURE__ */ new Vn(), rr = /* @__PURE__ */ new Vn(), so = /* @__PURE__ */ new ze(), Ap = /* @__PURE__ */ new dn(), Ha = /* @__PURE__ */ new dn(); function eE(s, e, t, n) { Mt.setBuffer(s._roots[e]); - const i = gu(0, s, t, n); + const i = mu(0, s, t, n); return Mt.clearBuffer(), i; } -function gu(s, e, t, n, i = null) { +function mu(s, e, t, n, i = null) { const { float32Array: r, uint16Array: o, uint32Array: a } = Mt; let l = s * 2; - if (i === null && (t.boundingBox || t.computeBoundingBox(), Ap.set(t.boundingBox.min, t.boundingBox.max, n), i = Ap), qt(l, o)) { - const c = e.geometry, h = c.index, u = c.attributes.position, d = t.index, f = t.attributes.position, p = Cn(s, a), g = kn(l, o); - if (io.copy(n).invert(), t.boundsTree) - return It(s, r, Va), Va.matrix.copy(io), Va.needsUpdate = !0, t.boundsTree.shapecast({ - intersectsBounds: (x) => Va.intersectsBox(x), + if (i === null && (t.boundingBox || t.computeBoundingBox(), Ap.set(t.boundingBox.min, t.boundingBox.max, n), i = Ap), Zt(l, o)) { + const c = e.geometry, h = c.index, u = c.attributes.position, d = t.index, f = t.attributes.position, g = Cn(s, a), p = Un(l, o); + if (so.copy(n).invert(), t.boundsTree) + return Dt(s, r, Ha), Ha.matrix.copy(so), Ha.needsUpdate = !0, t.boundsTree.shapecast({ + intersectsBounds: (x) => Ha.intersectsBox(x), intersectsTriangle: (x) => { x.a.applyMatrix4(n), x.b.applyMatrix4(n), x.c.applyMatrix4(n), x.needsUpdate = !0; - for (let m = p * 3, b = (g + p) * 3; m < b; m += 3) - if (zt(sr, m, h, u), sr.needsUpdate = !0, x.intersectsTriangle(sr)) + for (let m = g * 3, b = (p + g) * 3; m < b; m += 3) + if (zt(rr, m, h, u), rr.needsUpdate = !0, x.intersectsTriangle(rr)) return !0; return !1; } }); { - const x = Ds(t); - for (let m = p * 3, b = (g + p) * 3; m < b; m += 3) { - zt(ir, m, h, u), ir.a.applyMatrix4(io), ir.b.applyMatrix4(io), ir.c.applyMatrix4(io), ir.needsUpdate = !0; + const x = Is(t); + for (let m = g * 3, b = (p + g) * 3; m < b; m += 3) { + zt(sr, m, h, u), sr.a.applyMatrix4(so), sr.b.applyMatrix4(so), sr.c.applyMatrix4(so), sr.needsUpdate = !0; for (let v = 0, y = x * 3; v < y; v += 3) - if (zt(sr, v, d, f), sr.needsUpdate = !0, ir.intersectsTriangle(sr)) + if (zt(rr, v, d, f), rr.needsUpdate = !0, sr.intersectsTriangle(rr)) return !0; } } } else { const c = Kt(s), h = $t(s, a); - return It(c, r, Ha), !!(i.intersectsBox(Ha) && gu(c, e, t, n, i) || (It(h, r, Ha), i.intersectsBox(Ha) && gu(h, e, t, n, i))); + return Dt(c, r, za), !!(i.intersectsBox(za) && mu(c, e, t, n, i) || (Dt(h, r, za), i.intersectsBox(za) && mu(h, e, t, n, i))); } } -const Ga = /* @__PURE__ */ new ze(), zc = /* @__PURE__ */ new dn(), so = /* @__PURE__ */ new dn(), tE = /* @__PURE__ */ new P(), nE = /* @__PURE__ */ new P(), iE = /* @__PURE__ */ new P(), sE = /* @__PURE__ */ new P(); +const Va = /* @__PURE__ */ new ze(), zc = /* @__PURE__ */ new dn(), ro = /* @__PURE__ */ new dn(), tE = /* @__PURE__ */ new P(), nE = /* @__PURE__ */ new P(), iE = /* @__PURE__ */ new P(), sE = /* @__PURE__ */ new P(); function rE(s, e, t, n = {}, i = {}, r = 0, o = 1 / 0) { e.boundingBox || e.computeBoundingBox(), zc.set(e.boundingBox.min, e.boundingBox.max, t), zc.needsUpdate = !0; const a = s.geometry, l = a.attributes.position, c = a.index, h = e.attributes.position, u = e.index, d = Nn.getPrimitive(), f = Nn.getPrimitive(); - let p = tE, g = nE, x = null, m = null; + let g = tE, p = nE, x = null, m = null; i && (x = iE, m = sE); let b = 1 / 0, v = null, y = null; - return Ga.copy(t).invert(), so.matrix.copy(Ga), s.shapecast( + return Va.copy(t).invert(), ro.matrix.copy(Va), s.shapecast( { boundsTraverseOrder: (M) => zc.distanceToBox(M), - intersectsBounds: (M, E, A) => A < b && A < o ? (E && (so.min.copy(M.min), so.max.copy(M.max), so.needsUpdate = !0), !0) : !1, + intersectsBounds: (M, E, A) => A < b && A < o ? (E && (ro.min.copy(M.min), ro.max.copy(M.max), ro.needsUpdate = !0), !0) : !1, intersectsRange: (M, E) => { if (e.boundsTree) return e.boundsTree.shapecast({ - boundsTraverseOrder: (A) => so.distanceToBox(A), + boundsTraverseOrder: (A) => ro.distanceToBox(A), intersectsBounds: (A, R, _) => _ < b && _ < o, intersectsRange: (A, R) => { for (let _ = A, S = A + R; _ < S; _++) { zt(f, 3 * _, u, h), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0; for (let D = M, C = M + E; D < C; D++) { zt(d, 3 * D, c, l), d.needsUpdate = !0; - const B = d.distanceToTriangle(f, p, x); - if (B < b && (g.copy(p), m && m.copy(x), b = B, v = D, y = _), B < r) + const B = d.distanceToTriangle(f, g, x); + if (B < b && (p.copy(g), m && m.copy(x), b = B, v = D, y = _), B < r) return !0; } } } }); { - const A = Ds(e); + const A = Is(e); for (let R = 0, _ = A; R < _; R++) { zt(f, 3 * R, u, h), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0; for (let S = M, D = M + E; S < D; S++) { zt(d, 3 * S, c, l), d.needsUpdate = !0; - const C = d.distanceToTriangle(f, p, x); - if (C < b && (g.copy(p), m && m.copy(x), b = C, v = S, y = R), C < r) + const C = d.distanceToTriangle(f, g, x); + if (C < b && (p.copy(g), m && m.copy(x), b = C, v = S, y = R), C < r) return !0; } } } } } - ), Nn.releasePrimitive(d), Nn.releasePrimitive(f), b === 1 / 0 ? null : (n.point ? n.point.copy(g) : n.point = g.clone(), n.distance = b, n.faceIndex = v, i && (i.point ? i.point.copy(m) : i.point = m.clone(), i.point.applyMatrix4(Ga), g.applyMatrix4(Ga), i.distance = g.sub(i.point).length(), i.faceIndex = y), n); + ), Nn.releasePrimitive(d), Nn.releasePrimitive(f), b === 1 / 0 ? null : (n.point ? n.point.copy(p) : n.point = p.clone(), n.distance = b, n.faceIndex = v, i && (i.point ? i.point.copy(m) : i.point = m.clone(), i.point.applyMatrix4(Va), p.applyMatrix4(Va), i.distance = p.sub(i.point).length(), i.faceIndex = y), n); } function oE(s, e = null) { e && Array.isArray(e) && (e = new Set(e)); @@ -42058,10 +42109,10 @@ function oE(s, e = null) { const h = s._roots; for (let d = 0, f = h.length; d < f; d++) r = h[d], o = new Uint32Array(r), a = new Uint16Array(r), l = new Float32Array(r), u(0, c), c += r.byteLength; - function u(d, f, p = !1) { - const g = d * 2; - if (qt(g, a)) { - const x = o[d + 6], m = a[g + 14]; + function u(d, f, g = !1) { + const p = d * 2; + if (Zt(p, a)) { + const x = o[d + 6], m = a[p + 14]; let b = 1 / 0, v = 1 / 0, y = 1 / 0, M = -1 / 0, E = -1 / 0, A = -1 / 0; for (let R = x, _ = x + m; R < _; R++) { const S = 3 * s.resolveTriangleIndex(R); @@ -42075,7 +42126,7 @@ function oE(s, e = null) { return l[d + 0] !== b || l[d + 1] !== v || l[d + 2] !== y || l[d + 3] !== M || l[d + 4] !== E || l[d + 5] !== A ? (l[d + 0] = b, l[d + 1] = v, l[d + 2] = y, l[d + 3] = M, l[d + 4] = E, l[d + 5] = A, !0) : !1; } else { const x = Kt(d), m = $t(d, o); - let b = p, v = !1, y = !1; + let b = g, v = !1, y = !1; if (e) { if (!b) { const S = x / jt + f / hn, D = m / jt + f / hn; @@ -42099,102 +42150,102 @@ function oE(s, e = null) { } } function aE(s, e, t, n, i, r, o) { - Mt.setBuffer(s._roots[e]), xu(0, s, t, n, i, r, o), Mt.clearBuffer(); + Mt.setBuffer(s._roots[e]), gu(0, s, t, n, i, r, o), Mt.clearBuffer(); } -function xu(s, e, t, n, i, r, o) { +function gu(s, e, t, n, i, r, o) { const { float32Array: a, uint16Array: l, uint32Array: c } = Mt, h = s * 2; - if (qt(h, l)) { - const u = Cn(s, c), d = kn(h, l); - ZS(e, t, n, u, d, i, r, o); + if (Zt(h, l)) { + const u = Cn(s, c), d = Un(h, l); + qS(e, t, n, u, d, i, r, o); } else { const u = Kt(s); - Ji(u, a, n, r, o) && xu(u, e, t, n, i, r, o); + Ji(u, a, n, r, o) && gu(u, e, t, n, i, r, o); const d = $t(s, c); - Ji(d, a, n, r, o) && xu(d, e, t, n, i, r, o); + Ji(d, a, n, r, o) && gu(d, e, t, n, i, r, o); } } const lE = ["x", "y", "z"]; function cE(s, e, t, n, i, r) { Mt.setBuffer(s._roots[e]); - const o = vu(0, s, t, n, i, r); + const o = xu(0, s, t, n, i, r); return Mt.clearBuffer(), o; } -function vu(s, e, t, n, i, r) { +function xu(s, e, t, n, i, r) { const { float32Array: o, uint16Array: a, uint32Array: l } = Mt; let c = s * 2; - if (qt(c, a)) { - const h = Cn(s, l), u = kn(c, a); + if (Zt(c, a)) { + const h = Cn(s, l), u = Un(c, a); return YS(e, t, n, h, u, i, r); } else { - const h = $u(s, l), u = lE[h], d = n.direction[u] >= 0; - let f, p; - d ? (f = Kt(s), p = $t(s, l)) : (f = $t(s, l), p = Kt(s)); - const g = Ji(f, o, n, i, r) ? vu(f, e, t, n, i, r) : null; - if (g) { - const m = g.point[u]; - if (d ? m <= o[p + h] : ( + const h = Ku(s, l), u = lE[h], d = n.direction[u] >= 0; + let f, g; + d ? (f = Kt(s), g = $t(s, l)) : (f = $t(s, l), g = Kt(s)); + const p = Ji(f, o, n, i, r) ? xu(f, e, t, n, i, r) : null; + if (p) { + const m = p.point[u]; + if (d ? m <= o[g + h] : ( // min bounding data - m >= o[p + h + 3] + m >= o[g + h + 3] )) - return g; + return p; } - const x = Ji(p, o, n, i, r) ? vu(p, e, t, n, i, r) : null; - return g && x ? g.distance <= x.distance ? g : x : g || x || null; + const x = Ji(g, o, n, i, r) ? xu(g, e, t, n, i, r) : null; + return p && x ? p.distance <= x.distance ? p : x : p || x || null; } } -const Wa = /* @__PURE__ */ new vt(), rr = /* @__PURE__ */ new Vn(), or = /* @__PURE__ */ new Vn(), ro = /* @__PURE__ */ new ze(), Cp = /* @__PURE__ */ new dn(), Xa = /* @__PURE__ */ new dn(); +const Ga = /* @__PURE__ */ new vt(), or = /* @__PURE__ */ new Vn(), ar = /* @__PURE__ */ new Vn(), oo = /* @__PURE__ */ new ze(), Cp = /* @__PURE__ */ new dn(), Wa = /* @__PURE__ */ new dn(); function hE(s, e, t, n) { Mt.setBuffer(s._roots[e]); - const i = bu(0, s, t, n); + const i = vu(0, s, t, n); return Mt.clearBuffer(), i; } -function bu(s, e, t, n, i = null) { +function vu(s, e, t, n, i = null) { const { float32Array: r, uint16Array: o, uint32Array: a } = Mt; let l = s * 2; - if (i === null && (t.boundingBox || t.computeBoundingBox(), Cp.set(t.boundingBox.min, t.boundingBox.max, n), i = Cp), qt(l, o)) { - const c = e.geometry, h = c.index, u = c.attributes.position, d = t.index, f = t.attributes.position, p = Cn(s, a), g = kn(l, o); - if (ro.copy(n).invert(), t.boundsTree) - return It(s, r, Xa), Xa.matrix.copy(ro), Xa.needsUpdate = !0, t.boundsTree.shapecast({ - intersectsBounds: (x) => Xa.intersectsBox(x), + if (i === null && (t.boundingBox || t.computeBoundingBox(), Cp.set(t.boundingBox.min, t.boundingBox.max, n), i = Cp), Zt(l, o)) { + const c = e.geometry, h = c.index, u = c.attributes.position, d = t.index, f = t.attributes.position, g = Cn(s, a), p = Un(l, o); + if (oo.copy(n).invert(), t.boundsTree) + return Dt(s, r, Wa), Wa.matrix.copy(oo), Wa.needsUpdate = !0, t.boundsTree.shapecast({ + intersectsBounds: (x) => Wa.intersectsBox(x), intersectsTriangle: (x) => { x.a.applyMatrix4(n), x.b.applyMatrix4(n), x.c.applyMatrix4(n), x.needsUpdate = !0; - for (let m = p, b = g + p; m < b; m++) - if (zt(or, 3 * e.resolveTriangleIndex(m), h, u), or.needsUpdate = !0, x.intersectsTriangle(or)) + for (let m = g, b = p + g; m < b; m++) + if (zt(ar, 3 * e.resolveTriangleIndex(m), h, u), ar.needsUpdate = !0, x.intersectsTriangle(ar)) return !0; return !1; } }); { - const x = Ds(t); - for (let m = p, b = g + p; m < b; m++) { + const x = Is(t); + for (let m = g, b = p + g; m < b; m++) { const v = e.resolveTriangleIndex(m); - zt(rr, 3 * v, h, u), rr.a.applyMatrix4(ro), rr.b.applyMatrix4(ro), rr.c.applyMatrix4(ro), rr.needsUpdate = !0; + zt(or, 3 * v, h, u), or.a.applyMatrix4(oo), or.b.applyMatrix4(oo), or.c.applyMatrix4(oo), or.needsUpdate = !0; for (let y = 0, M = x * 3; y < M; y += 3) - if (zt(or, y, d, f), or.needsUpdate = !0, rr.intersectsTriangle(or)) + if (zt(ar, y, d, f), ar.needsUpdate = !0, or.intersectsTriangle(ar)) return !0; } } } else { const c = Kt(s), h = $t(s, a); - return It(c, r, Wa), !!(i.intersectsBox(Wa) && bu(c, e, t, n, i) || (It(h, r, Wa), i.intersectsBox(Wa) && bu(h, e, t, n, i))); + return Dt(c, r, Ga), !!(i.intersectsBox(Ga) && vu(c, e, t, n, i) || (Dt(h, r, Ga), i.intersectsBox(Ga) && vu(h, e, t, n, i))); } } -const ja = /* @__PURE__ */ new ze(), Hc = /* @__PURE__ */ new dn(), oo = /* @__PURE__ */ new dn(), uE = /* @__PURE__ */ new P(), dE = /* @__PURE__ */ new P(), fE = /* @__PURE__ */ new P(), pE = /* @__PURE__ */ new P(); +const Xa = /* @__PURE__ */ new ze(), Hc = /* @__PURE__ */ new dn(), ao = /* @__PURE__ */ new dn(), uE = /* @__PURE__ */ new P(), dE = /* @__PURE__ */ new P(), fE = /* @__PURE__ */ new P(), pE = /* @__PURE__ */ new P(); function mE(s, e, t, n = {}, i = {}, r = 0, o = 1 / 0) { e.boundingBox || e.computeBoundingBox(), Hc.set(e.boundingBox.min, e.boundingBox.max, t), Hc.needsUpdate = !0; const a = s.geometry, l = a.attributes.position, c = a.index, h = e.attributes.position, u = e.index, d = Nn.getPrimitive(), f = Nn.getPrimitive(); - let p = uE, g = dE, x = null, m = null; + let g = uE, p = dE, x = null, m = null; i && (x = fE, m = pE); let b = 1 / 0, v = null, y = null; - return ja.copy(t).invert(), oo.matrix.copy(ja), s.shapecast( + return Xa.copy(t).invert(), ao.matrix.copy(Xa), s.shapecast( { boundsTraverseOrder: (M) => Hc.distanceToBox(M), - intersectsBounds: (M, E, A) => A < b && A < o ? (E && (oo.min.copy(M.min), oo.max.copy(M.max), oo.needsUpdate = !0), !0) : !1, + intersectsBounds: (M, E, A) => A < b && A < o ? (E && (ao.min.copy(M.min), ao.max.copy(M.max), ao.needsUpdate = !0), !0) : !1, intersectsRange: (M, E) => { if (e.boundsTree) { const A = e.boundsTree; return A.shapecast({ - boundsTraverseOrder: (R) => oo.distanceToBox(R), + boundsTraverseOrder: (R) => ao.distanceToBox(R), intersectsBounds: (R, _, S) => S < b && S < o, intersectsRange: (R, _) => { for (let S = R, D = R + _; S < D; S++) { @@ -42203,34 +42254,34 @@ function mE(s, e, t, n = {}, i = {}, r = 0, o = 1 / 0) { for (let B = M, w = M + E; B < w; B++) { const F = s.resolveTriangleIndex(B); zt(d, 3 * F, c, l), d.needsUpdate = !0; - const W = d.distanceToTriangle(f, p, x); - if (W < b && (g.copy(p), m && m.copy(x), b = W, v = B, y = S), W < r) + const W = d.distanceToTriangle(f, g, x); + if (W < b && (p.copy(g), m && m.copy(x), b = W, v = B, y = S), W < r) return !0; } } } }); } else { - const A = Ds(e); + const A = Is(e); for (let R = 0, _ = A; R < _; R++) { zt(f, 3 * R, u, h), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0; for (let S = M, D = M + E; S < D; S++) { const C = s.resolveTriangleIndex(S); zt(d, 3 * C, c, l), d.needsUpdate = !0; - const B = d.distanceToTriangle(f, p, x); - if (B < b && (g.copy(p), m && m.copy(x), b = B, v = S, y = R), B < r) + const B = d.distanceToTriangle(f, g, x); + if (B < b && (p.copy(g), m && m.copy(x), b = B, v = S, y = R), B < r) return !0; } } } } } - ), Nn.releasePrimitive(d), Nn.releasePrimitive(f), b === 1 / 0 ? null : (n.point ? n.point.copy(g) : n.point = g.clone(), n.distance = b, n.faceIndex = v, i && (i.point ? i.point.copy(m) : i.point = m.clone(), i.point.applyMatrix4(ja), g.applyMatrix4(ja), i.distance = g.sub(i.point).length(), i.faceIndex = y), n); + ), Nn.releasePrimitive(d), Nn.releasePrimitive(f), b === 1 / 0 ? null : (n.point ? n.point.copy(p) : n.point = p.clone(), n.distance = b, n.faceIndex = v, i && (i.point ? i.point.copy(m) : i.point = m.clone(), i.point.applyMatrix4(Xa), p.applyMatrix4(Xa), i.distance = p.sub(i.point).length(), i.faceIndex = y), n); } function gE() { return typeof SharedArrayBuffer < "u"; } -const yo = /* @__PURE__ */ new Mt.constructor(), wl = /* @__PURE__ */ new Mt.constructor(), Wi = /* @__PURE__ */ new Ku(() => new vt()), ar = /* @__PURE__ */ new vt(), lr = /* @__PURE__ */ new vt(), Vc = /* @__PURE__ */ new vt(), Gc = /* @__PURE__ */ new vt(); +const _o = /* @__PURE__ */ new Mt.constructor(), wl = /* @__PURE__ */ new Mt.constructor(), Wi = /* @__PURE__ */ new Yu(() => new vt()), lr = /* @__PURE__ */ new vt(), cr = /* @__PURE__ */ new vt(), Vc = /* @__PURE__ */ new vt(), Gc = /* @__PURE__ */ new vt(); let Wc = !1; function xE(s, e, t, n) { if (Wc) @@ -42240,10 +42291,10 @@ function xE(s, e, t, n) { let o, a = 0, l = 0; const c = new ze().copy(t).invert(); for (let h = 0, u = i.length; h < u; h++) { - yo.setBuffer(i[h]), l = 0; + _o.setBuffer(i[h]), l = 0; const d = Wi.getPrimitive(); - It(0, yo.float32Array, d), d.applyMatrix4(c); - for (let f = 0, p = r.length; f < p && (wl.setBuffer(r[f]), o = qn( + Dt(0, _o.float32Array, d), d.applyMatrix4(c); + for (let f = 0, g = r.length; f < g && (wl.setBuffer(r[f]), o = Zn( 0, 0, t, @@ -42256,31 +42307,31 @@ function xE(s, e, t, n) { d ), wl.clearBuffer(), l += r[f].byteLength / hn, !o); f++) ; - if (Wi.releasePrimitive(d), yo.clearBuffer(), a += i[h].byteLength / hn, o) + if (Wi.releasePrimitive(d), _o.clearBuffer(), a += i[h].byteLength / hn, o) break; } return Wc = !1, o; } -function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { +function Zn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { let u, d; - h ? (u = wl, d = yo) : (u = yo, d = wl); - const f = u.float32Array, p = u.uint32Array, g = u.uint16Array, x = d.float32Array, m = d.uint32Array, b = d.uint16Array, v = s * 2, y = e * 2, M = qt(v, g), E = qt(y, b); + h ? (u = wl, d = _o) : (u = _o, d = wl); + const f = u.float32Array, g = u.uint32Array, p = u.uint16Array, x = d.float32Array, m = d.uint32Array, b = d.uint16Array, v = s * 2, y = e * 2, M = Zt(v, p), E = Zt(y, b); let A = !1; if (E && M) h ? A = i( Cn(e, m), - kn(e * 2, b), - Cn(s, p), - kn(s * 2, g), + Un(e * 2, b), + Cn(s, g), + Un(s * 2, p), l, o + e / jt, a, r + s / jt ) : A = i( - Cn(s, p), - kn(s * 2, g), + Cn(s, g), + Un(s * 2, p), Cn(e, m), - kn(e * 2, b), + Un(e * 2, b), a, r + s / jt, l, @@ -42288,11 +42339,11 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { ); else if (E) { const R = Wi.getPrimitive(); - It(e, x, R), R.applyMatrix4(t); - const _ = Kt(s), S = $t(s, p); - It(_, f, ar), It(S, f, lr); - const D = R.intersectsBox(ar), C = R.intersectsBox(lr); - A = D && qn( + Dt(e, x, R), R.applyMatrix4(t); + const _ = Kt(s), S = $t(s, g); + Dt(_, f, lr), Dt(S, f, cr); + const D = R.intersectsBox(lr), C = R.intersectsBox(cr); + A = D && Zn( e, _, n, @@ -42304,7 +42355,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { a + 1, R, !h - ) || C && qn( + ) || C && Zn( e, S, n, @@ -42319,10 +42370,10 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { ), Wi.releasePrimitive(R); } else { const R = Kt(e), _ = $t(e, m); - It(R, x, Vc), It(_, x, Gc); + Dt(R, x, Vc), Dt(_, x, Gc); const S = c.intersectsBox(Vc), D = c.intersectsBox(Gc); if (S && D) - A = qn( + A = Zn( s, R, t, @@ -42334,7 +42385,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { l + 1, c, h - ) || qn( + ) || Zn( s, _, t, @@ -42349,7 +42400,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { ); else if (S) if (M) - A = qn( + A = Zn( s, R, t, @@ -42365,10 +42416,10 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { else { const C = Wi.getPrimitive(); C.copy(Vc).applyMatrix4(t); - const B = Kt(s), w = $t(s, p); - It(B, f, ar), It(w, f, lr); - const F = C.intersectsBox(ar), W = C.intersectsBox(lr); - A = F && qn( + const B = Kt(s), w = $t(s, g); + Dt(B, f, lr), Dt(w, f, cr); + const F = C.intersectsBox(lr), W = C.intersectsBox(cr); + A = F && Zn( R, B, n, @@ -42380,7 +42431,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { a + 1, C, !h - ) || W && qn( + ) || W && Zn( R, w, n, @@ -42396,7 +42447,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { } else if (D) if (M) - A = qn( + A = Zn( s, _, t, @@ -42412,10 +42463,10 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { else { const C = Wi.getPrimitive(); C.copy(Gc).applyMatrix4(t); - const B = Kt(s), w = $t(s, p); - It(B, f, ar), It(w, f, lr); - const F = C.intersectsBox(ar), W = C.intersectsBox(lr); - A = F && qn( + const B = Kt(s), w = $t(s, g); + Dt(B, f, lr), Dt(w, f, cr); + const F = C.intersectsBox(lr), W = C.intersectsBox(cr); + A = F && Zn( _, B, n, @@ -42427,7 +42478,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { a + 1, C, !h - ) || W && qn( + ) || W && Zn( _, w, n, @@ -42444,7 +42495,7 @@ function qn(s, e, t, n, i, r = 0, o = 0, a = 0, l = 0, c = null, h = !1) { } return A; } -const qa = /* @__PURE__ */ new dn(), Pp = /* @__PURE__ */ new vt(), vE = { +const ja = /* @__PURE__ */ new dn(), Pp = /* @__PURE__ */ new vt(), vE = { strategy: L0, maxDepth: 40, maxLeafTris: 10, @@ -42455,7 +42506,7 @@ const qa = /* @__PURE__ */ new dn(), Pp = /* @__PURE__ */ new vt(), vE = { verbose: !0, range: null }; -class Ju { +class $u { static serialize(e, t = {}) { t = { cloneBuffers: !0, @@ -42479,7 +42530,7 @@ class Ju { e.version || (console.warn( "MeshBVH.deserialize: Serialization format has been changed and will be fixed up. It is recommended to regenerate any stored serialized data." ), l(r)); - const a = new Ju(t, { ...n, [kc]: !0 }); + const a = new $u(t, { ...n, [Uc]: !0 }); if (a._roots = r, a._indirectBuffer = o || null, n.setIndex) { const c = t.getIndex(); if (c === null) { @@ -42491,9 +42542,9 @@ class Ju { function l(c) { for (let h = 0; h < c.length; h++) { const u = c[h], d = new Uint32Array(u), f = new Uint16Array(u); - for (let p = 0, g = u.byteLength / hn; p < g; p++) { - const x = jt * p, m = 2 * x; - qt(m, f) || (d[x + 6] = d[x + 6] / jt - p); + for (let g = 0, p = u.byteLength / hn; g < p; g++) { + const x = jt * g, m = 2 * x; + Zt(m, f) || (d[x + 6] = d[x + 6] / jt - g); } } } @@ -42510,10 +42561,10 @@ class Ju { ...vE, // undocumented options // Whether to skip generating the tree. Used for deserialization. - [kc]: !1 + [Uc]: !1 }, t), t.useSharedArrayBuffer && !gE()) throw new Error("MeshBVH: SharedArrayBuffer is not available."); - this.geometry = e, this._roots = null, this._indirectBuffer = null, t[kc] || (BS(this, t), !e.boundingBox && t.setBoundingBox && (e.boundingBox = this.getBoundingBox(new vt()))), this.resolveTriangleIndex = t.indirect ? (n) => this._indirectBuffer[n] : (n) => n; + this.geometry = e, this._roots = null, this._indirectBuffer = null, t[Uc] || (BS(this, t), !e.boundingBox && t.setBoundingBox && (e.boundingBox = this.getBoundingBox(new vt()))), this.resolveTriangleIndex = t.indirect ? (n) => this._indirectBuffer[n] : (n) => n; } shiftTriangleOffsets(e) { const t = this._indirectBuffer; @@ -42526,24 +42577,24 @@ class Ju { const r = n[i], o = new Uint32Array(r), a = new Uint16Array(r), l = r.byteLength / hn; for (let c = 0; c < l; c++) { const h = jt * c, u = 2 * h; - qt(u, a) && (o[h + 6] += e); + Zt(u, a) && (o[h + 6] += e); } } } } refit(e = null) { - return (this.indirect ? oE : qS)(this, e); + return (this.indirect ? oE : ZS)(this, e); } traverse(e, t = 0) { const n = this._roots[t], i = new Uint32Array(n), r = new Uint16Array(n); o(0); function o(a, l = 0) { - const c = a * 2, h = qt(c, r); + const c = a * 2, h = Zt(c, r); if (h) { const u = i[a + 6], d = r[c + 14]; e(l, h, new Float32Array(n, a * 4, 6), u, d); } else { - const u = Kt(a), d = $t(a, i), f = $u(a, i); + const u = Kt(a), d = $t(a, i), f = Ku(a, i); e(l, h, new Float32Array(n, a * 4, 6), f) || (o(u, l + 1), o(d, l + 1)); } } @@ -42582,8 +42633,8 @@ class Ju { } = e; if (o && a) { const u = o; - o = (d, f, p, g, x) => u(d, f, p, g, x) ? !0 : n(d, f, this, a, p, g, t); - } else o || (a ? o = (u, d, f, p) => n(u, d, this, a, f, p, t) : o = (u, d, f) => f); + o = (d, f, g, p, x) => u(d, f, g, p, x) ? !0 : n(d, f, this, a, g, p, t); + } else o || (a ? o = (u, d, f, g) => n(u, d, this, a, f, g, t) : o = (u, d, f) => f); let l = !1, c = 0; const h = this._roots; for (let u = 0, d = h.length; u < d; u++) { @@ -42599,43 +42650,43 @@ class Ju { intersectsRanges: i, intersectsTriangles: r } = n; - const o = Nn.getPrimitive(), a = this.geometry.index, l = this.geometry.attributes.position, c = this.indirect ? (p) => { - const g = this.resolveTriangleIndex(p); - zt(o, g * 3, a, l); - } : (p) => { + const o = Nn.getPrimitive(), a = this.geometry.index, l = this.geometry.attributes.position, c = this.indirect ? (g) => { + const p = this.resolveTriangleIndex(g); zt(o, p * 3, a, l); - }, h = Nn.getPrimitive(), u = e.geometry.index, d = e.geometry.attributes.position, f = e.indirect ? (p) => { - const g = e.resolveTriangleIndex(p); - zt(h, g * 3, u, d); - } : (p) => { + } : (g) => { + zt(o, g * 3, a, l); + }, h = Nn.getPrimitive(), u = e.geometry.index, d = e.geometry.attributes.position, f = e.indirect ? (g) => { + const p = e.resolveTriangleIndex(g); zt(h, p * 3, u, d); + } : (g) => { + zt(h, g * 3, u, d); }; if (r) { - const p = (g, x, m, b, v, y, M, E) => { + const g = (p, x, m, b, v, y, M, E) => { for (let A = m, R = m + b; A < R; A++) { f(A), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0; - for (let _ = g, S = g + x; _ < S; _++) + for (let _ = p, S = p + x; _ < S; _++) if (c(_), o.needsUpdate = !0, r(o, h, _, A, v, y, M, E)) return !0; } return !1; }; if (i) { - const g = i; + const p = i; i = function(x, m, b, v, y, M, E, A) { - return g(x, m, b, v, y, M, E, A) ? !0 : p(x, m, b, v, y, M, E, A); + return p(x, m, b, v, y, M, E, A) ? !0 : g(x, m, b, v, y, M, E, A); }; } else - i = p; + i = g; } return xE(this, e, t, i); } /* Derived Cast Functions */ intersectsBox(e, t) { - return qa.set(e.min, e.max, t), qa.needsUpdate = !0, this.shapecast( + return ja.set(e.min, e.max, t), ja.needsUpdate = !0, this.shapecast( { - intersectsBounds: (n) => qa.intersectsBox(n), - intersectsTriangle: (n) => qa.intersectsTriangle(n) + intersectsBounds: (n) => ja.intersectsBox(n), + intersectsTriangle: (n) => ja.intersectsTriangle(n) } ); } @@ -42669,13 +42720,13 @@ class Ju { } getBoundingBox(e) { return e.makeEmpty(), this._roots.forEach((t) => { - It(0, new Float32Array(t), Pp), e.union(Pp); + Dt(0, new Float32Array(t), Pp), e.union(Pp); }), e; } } -const k0 = 1e-6, bE = k0 * 0.5, U0 = Math.pow(10, -Math.log10(k0)), yE = bE * U0; +const U0 = 1e-6, bE = U0 * 0.5, O0 = Math.pow(10, -Math.log10(U0)), yE = bE * O0; function ci(s) { - return ~~(s * U0 + yE); + return ~~(s * O0 + yE); } function _E(s) { return `${ci(s.x)},${ci(s.y)}`; @@ -42691,7 +42742,7 @@ function wE(s, e, t) { const n = s.dot(t.direction); return t.origin.copy(s).addScaledVector(t.direction, -n), t; } -function O0() { +function k0() { return typeof SharedArrayBuffer < "u"; } function SE(s) { @@ -42714,7 +42765,7 @@ function TE(s, e) { function AE(s) { return s.index ? s.index.count : s.attributes.position.count; } -function Qu(s) { +function Ju(s) { return AE(s) / 3; } const CE = 1e-8, PE = new P(); @@ -42812,9 +42863,9 @@ const Xc = new P(), jc = new P(), Za = new Qi(); function BE(s, e, t) { const n = s.attributes, i = s.index, r = n.position, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = Array.from(e), c = new IE(); for (let h = 0, u = l.length; h < u; h++) { - const d = l[h], f = RE(d), p = LE(d); - let g = 3 * f + p, x = 3 * f + (p + 1) % 3; - i && (g = i.getX(g), x = i.getX(x)), Xc.fromBufferAttribute(r, g), jc.fromBufferAttribute(r, x), wE(Xc, jc, Za); + const d = l[h], f = RE(d), g = LE(d); + let p = 3 * f + g, x = 3 * f + (g + 1) % 3; + i && (p = i.getX(p), x = i.getX(x)), Xc.fromBufferAttribute(r, p), jc.fromBufferAttribute(r, x), wE(Xc, jc, Za); let m, b = c.findClosestRay(Za); b === null && (b = Za.clone(), c.addRay(b)), a.has(b) || a.set(b, { forward: [], @@ -42831,8 +42882,8 @@ function BE(s, e, t) { fragmentMap: a }; } -const NE = new ce(), qc = new P(), kE = new tt(), Zc = ["", "", ""]; -class UE { +const NE = new ce(), Zc = new P(), UE = new tt(), qc = ["", "", ""]; +class OE { constructor(e = null) { this.data = null, this.disjointConnections = null, this.unmatchedDisjointEdges = null, this.unmatchedEdges = -1, this.matchedEdges = -1, this.useDrawRange = !0, this.useAllAttributes = !1, this.matchDisjointEdges = !1, this.degenerateEpsilon = 1e-8, e && this.updateFrom(e); } @@ -42857,24 +42908,24 @@ class UE { } updateFrom(e) { const { useAllAttributes: t, useDrawRange: n, matchDisjointEdges: i, degenerateEpsilon: r } = this, o = t ? v : b, a = /* @__PURE__ */ new Map(), { attributes: l } = e, c = t ? Object.keys(l) : null, h = e.index, u = l.position; - let d = Qu(e); + let d = Ju(e); const f = d; - let p = 0; - n && (p = e.drawRange.start, e.drawRange.count !== 1 / 0 && (d = ~~(e.drawRange.count / 3))); - let g = this.data; - (!g || g.length < 3 * f) && (g = new Int32Array(3 * f)), g.fill(-1); + let g = 0; + n && (g = e.drawRange.start, e.drawRange.count !== 1 / 0 && (d = ~~(e.drawRange.count / 3))); + let p = this.data; + (!p || p.length < 3 * f) && (p = new Int32Array(3 * f)), p.fill(-1); let x = 0, m = /* @__PURE__ */ new Set(); - for (let y = p, M = d * 3 + p; y < M; y += 3) { + for (let y = g, M = d * 3 + g; y < M; y += 3) { const E = y; for (let A = 0; A < 3; A++) { let R = E + A; - h && (R = h.getX(R)), Zc[A] = o(R); + h && (R = h.getX(R)), qc[A] = o(R); } for (let A = 0; A < 3; A++) { - const R = (A + 1) % 3, _ = Zc[A], S = Zc[R], D = `${S}_${_}`; + const R = (A + 1) % 3, _ = qc[A], S = qc[R], D = `${S}_${_}`; if (a.has(D)) { const C = E + A, B = a.get(D); - g[C] = B, g[B] = C, a.delete(D), x += 2, m.delete(B); + p[C] = B, p[B] = C, a.delete(D), x += 2, m.delete(B); } else { const C = `${_}_${S}`, B = E + A; a.set(C, B), m.add(B); @@ -42890,9 +42941,9 @@ class UE { E.forEach(({ index: R }) => m.add(R)), A.forEach(({ index: R }) => m.add(R)); }), this.unmatchedDisjointEdges = y, this.disjointConnections = M, x = d * 3 - m.size; } - this.matchedEdges = x, this.unmatchedEdges = m.size, this.data = g; + this.matchedEdges = x, this.unmatchedEdges = m.size, this.data = p; function b(y) { - return qc.fromBufferAttribute(u, y), Rp(qc); + return Zc.fromBufferAttribute(u, y), Rp(Zc); } function v(y) { let M = ""; @@ -42907,10 +42958,10 @@ class UE { _ = _E(NE.fromBufferAttribute(R, y)); break; case 3: - _ = Rp(qc.fromBufferAttribute(R, y)); + _ = Rp(Zc.fromBufferAttribute(R, y)); break; case 4: - _ = ME(kE.fromBufferAttribute(R, y)); + _ = ME(UE.fromBufferAttribute(R, y)); break; } M !== "" && (M += "|"), M += _; @@ -42934,7 +42985,7 @@ class Sl extends dt { return !1; } prepareGeometry() { - const e = this.geometry, t = e.attributes, n = O0(); + const e = this.geometry, t = e.attributes, n = k0(); if (n) for (const i in t) { const r = t[i]; @@ -42942,8 +42993,8 @@ class Sl extends dt { throw new Error("Brush: InterleavedBufferAttributes are not supported."); r.array = SE(r.array); } - if (e.boundsTree || (TE(e, { useSharedArrayBuffer: n }), e.boundsTree = new Ju(e, { maxLeafTris: 3, indirect: !0, useSharedArrayBuffer: n })), e.halfEdges || (e.halfEdges = new UE(e)), !e.groupIndices) { - const i = Qu(e), r = new Uint16Array(i), o = e.groups; + if (e.boundsTree || (TE(e, { useSharedArrayBuffer: n }), e.boundsTree = new $u(e, { maxLeafTris: 3, indirect: !0, useSharedArrayBuffer: n })), e.halfEdges || (e.halfEdges = new OE(e)), !e.groupIndices) { + const i = Ju(e), r = new Uint16Array(i), o = e.groups; for (let a = 0, l = o.length; a < l; a++) { const { start: c, count: h } = o[a]; for (let u = c / 3, d = (c + h) / 3; u < d; u++) @@ -42957,13 +43008,13 @@ class Sl extends dt { e.halfEdges = null, e.boundsTree = null, e.groupIndices = null; } } -const OE = 1e-14, Yc = new P(), Np = new P(), kp = new P(); -function ji(s, e = OE) { - Yc.subVectors(s.b, s.a), Np.subVectors(s.c, s.a), kp.subVectors(s.b, s.c); - const t = Yc.angleTo(Np), n = Yc.angleTo(kp), i = Math.PI - t - n; +const kE = 1e-14, Yc = new P(), Np = new P(), Up = new P(); +function ji(s, e = kE) { + Yc.subVectors(s.b, s.a), Np.subVectors(s.c, s.a), Up.subVectors(s.b, s.c); + const t = Yc.angleTo(Np), n = Yc.angleTo(Up), i = Math.PI - t - n; return Math.abs(t) < e || Math.abs(n) < e || Math.abs(i) < e || s.a.distanceToSquared(s.b) < e || s.a.distanceToSquared(s.c) < e || s.b.distanceToSquared(s.c) < e; } -const Kc = 1e-10, ao = 1e-10, FE = 1e-10, _i = new Hn(), kt = new Hn(), Mi = new P(), $c = new P(), Up = new P(), Ya = new _t(), Jc = new Vn(); +const Kc = 1e-10, lo = 1e-10, FE = 1e-10, _i = new Hn(), Ut = new Hn(), Mi = new P(), $c = new P(), Op = new P(), qa = new _t(), Jc = new Vn(); class zE { constructor() { this._pool = [], this._index = 0; @@ -43015,10 +43066,10 @@ class HE { const i = [e.a, e.b, e.c]; for (let r = 0; r < 3; r++) { const o = (r + 1) % 3, a = i[r], l = i[o]; - Mi.subVectors(l, a).normalize(), Up.crossVectors($c, Mi), Ya.setFromNormalAndCoplanarPoint(Up, a), this.splitByPlane(Ya, e); + Mi.subVectors(l, a).normalize(), Op.crossVectors($c, Mi), qa.setFromNormalAndCoplanarPoint(Op, a), this.splitByPlane(qa, e); } } else - e.getPlane(Ya), this.splitByPlane(Ya, e); + e.getPlane(qa), this.splitByPlane(qa, e); } // Split the triangles by the given plan. If a triangle is provided then we ensure we // intersect the triangle before splitting the plane @@ -43030,22 +43081,22 @@ class HE { if (!Jc.intersectsTriangle(a, _i, !0)) continue; const { a: l, b: c, c: h } = a; - let u = 0, d = -1, f = !1, p = [], g = []; + let u = 0, d = -1, f = !1, g = [], p = []; const x = [l, c, h]; for (let m = 0; m < 3; m++) { const b = (m + 1) % 3; _i.start.copy(x[m]), _i.end.copy(x[b]); const v = e.distanceToPoint(_i.start), y = e.distanceToPoint(_i.end); - if (Math.abs(v) < ao && Math.abs(y) < ao) { + if (Math.abs(v) < lo && Math.abs(y) < lo) { f = !0; break; } - if (v > 0 ? p.push(m) : g.push(m), Math.abs(v) < ao) + if (v > 0 ? g.push(m) : p.push(m), Math.abs(v) < lo) continue; let M = !!e.intersectLine(_i, Mi); - !M && Math.abs(y) < ao && (Mi.copy(_i.end), M = !0), M && !(Mi.distanceTo(_i.start) < Kc) && (Mi.distanceTo(_i.end) < Kc && (d = m), u === 0 ? kt.start.copy(Mi) : kt.end.copy(Mi), u++); + !M && Math.abs(y) < lo && (Mi.copy(_i.end), M = !0), M && !(Mi.distanceTo(_i.start) < Kc) && (Mi.distanceTo(_i.end) < Kc && (d = m), u === 0 ? Ut.start.copy(Mi) : Ut.end.copy(Mi), u++); } - if (!f && u === 2 && kt.distance() > ao) + if (!f && u === 2 && Ut.distance() > lo) if (d !== -1) { d = (d + 1) % 3; let m = 0; @@ -43053,15 +43104,15 @@ class HE { let b = m + 1; b === d && (b = (b + 1) % 3); const v = i.getTriangle(); - v.a.copy(x[b]), v.b.copy(kt.end), v.c.copy(kt.start), ji(v) || n.push(v), a.a.copy(x[m]), a.b.copy(kt.start), a.c.copy(kt.end), ji(a) && (n.splice(r, 1), r--, o--); + v.a.copy(x[b]), v.b.copy(Ut.end), v.c.copy(Ut.start), ji(v) || n.push(v), a.a.copy(x[m]), a.b.copy(Ut.start), a.c.copy(Ut.end), ji(a) && (n.splice(r, 1), r--, o--); } else { - const m = p.length >= 2 ? g[0] : p[0]; + const m = g.length >= 2 ? p[0] : g[0]; if (m === 0) { - let E = kt.start; - kt.start = kt.end, kt.end = E; + let E = Ut.start; + Ut.start = Ut.end, Ut.end = E; } const b = (m + 1) % 3, v = (m + 2) % 3, y = i.getTriangle(), M = i.getTriangle(); - x[b].distanceToSquared(kt.start) < x[v].distanceToSquared(kt.end) ? (y.a.copy(x[b]), y.b.copy(kt.start), y.c.copy(kt.end), M.a.copy(x[b]), M.b.copy(x[v]), M.c.copy(kt.start)) : (y.a.copy(x[v]), y.b.copy(kt.start), y.c.copy(kt.end), M.a.copy(x[b]), M.b.copy(x[v]), M.c.copy(kt.end)), a.a.copy(x[m]), a.b.copy(kt.end), a.c.copy(kt.start), ji(y) || n.push(y), ji(M) || n.push(M), ji(a) && (n.splice(r, 1), r--, o--); + x[b].distanceToSquared(Ut.start) < x[v].distanceToSquared(Ut.end) ? (y.a.copy(x[b]), y.b.copy(Ut.start), y.c.copy(Ut.end), M.a.copy(x[b]), M.b.copy(x[v]), M.c.copy(Ut.start)) : (y.a.copy(x[v]), y.b.copy(Ut.start), y.c.copy(Ut.end), M.a.copy(x[b]), M.b.copy(x[v]), M.c.copy(Ut.end)), a.a.copy(x[m]), a.b.copy(Ut.end), a.c.copy(Ut.start), ji(y) || n.push(y), ji(M) || n.push(M), ji(a) && (n.splice(r, 1), r--, o--); } else u === 3 && console.warn("TriangleClipper: Coplanar clip not handled"); } @@ -43073,7 +43124,7 @@ class HE { function VE(s) { return s = ~~s, s + 4 - s % 4; } -class Op { +class kp { constructor(e, t = 500) { this.expansionFactor = 1.5, this.type = e, this.length = 0, this.array = null, this.setSize(t); } @@ -43086,7 +43137,7 @@ class Op { setSize(e) { if (this.array && e === this.array.length) return; - const t = this.type, n = O0() ? SharedArrayBuffer : ArrayBuffer, i = new t(new n(VE(e * t.BYTES_PER_ELEMENT))); + const t = this.type, n = k0() ? SharedArrayBuffer : ArrayBuffer, i = new t(new n(VE(e * t.BYTES_PER_ELEMENT))); this.array && i.set(this.array, 0), this.array = i; } expand() { @@ -43143,7 +43194,7 @@ class GE { const i = {}; t.push(i); for (const r in n) { - const o = n[r], a = new Op(o.type); + const o = n[r], a = new kp(o.type); a.itemSize = o.itemSize, a.normalized = o.normalized, i[r] = a; } } @@ -43167,7 +43218,7 @@ class GE { } } else for (let a = 0, l = r.length; a < l; a++) { - const c = new Op(t); + const c = new kp(t); c.itemSize = n, c.normalized = i, r[a][e] = c; } } @@ -43200,10 +43251,10 @@ class Fp { n[e] || (n[e] = [], i.push(e)), n[e].push(t); } } -const WE = 0, XE = 1, jE = 2, F0 = 3, qE = 4, z0 = 5, H0 = 6, Bn = new Qi(), zp = new ze(), ln = new bt(), wi = new P(), Hp = new tt(), Vp = new tt(), Gp = new tt(), Qc = new tt(), Ka = new tt(), $a = new tt(), Wp = new Hn(), eh = new P(), th = 1e-8, ZE = 1e-15, gs = -1, xs = 1, ul = -2, dl = 2, _o = 0, fs = 1, ed = 2, YE = 1e-14; -let fl = null; +const WE = 0, XE = 1, jE = 2, F0 = 3, ZE = 4, z0 = 5, H0 = 6, Bn = new Qi(), zp = new ze(), ln = new bt(), wi = new P(), Hp = new tt(), Vp = new tt(), Gp = new tt(), Qc = new tt(), Ya = new tt(), Ka = new tt(), Wp = new Hn(), eh = new P(), th = 1e-8, qE = 1e-15, gs = -1, xs = 1, hl = -2, ul = 2, Mo = 0, fs = 1, Qu = 2, YE = 1e-14; +let dl = null; function Xp(s) { - fl = s; + dl = s; } function V0(s, e) { s.getMidpoint(Bn.origin), s.getNormal(Bn.direction); @@ -43220,8 +43271,8 @@ function KE(s, e) { for (let o = 0; o < n; o++) { Bn.direction.x += t() * th, Bn.direction.y += t() * th, Bn.direction.z += t() * th, Bn.direction.multiplyScalar(-1); const a = e.raycastFirst(Bn, At); - if (a && Bn.direction.dot(a.face.normal) > 0 && i++, a !== null && (r = Math.min(r, a.distance)), r <= ZE) - return a.face.normal.dot(eh) > 0 ? dl : ul; + if (a && Bn.direction.dot(a.face.normal) > 0 && i++, a !== null && (r = Math.min(r, a.distance)), r <= qE) + return a.face.normal.dot(eh) > 0 ? ul : hl; if (i / n > 0.5 || (o - i + 1) / n > 0.5) break; } @@ -43239,7 +43290,7 @@ function $E(s, e) { } if (l) { let c = s.geometry.boundsTree.resolveTriangleIndex(o), h = e.geometry.boundsTree.resolveTriangleIndex(a); - t.add(c, h), n.add(h, c), fl && (fl.addEdge(Wp), fl.addIntersectingTriangles(o, i, a, r)); + t.add(c, h), n.add(h, c), dl && (dl.addEdge(Wp), dl.addIntersectingTriangles(o, i, a, r)); } } return !1; @@ -43249,11 +43300,11 @@ function $E(s, e) { function JE(s, e, t, n, i, r, o = !1) { const a = t.attributes, l = t.index, c = s * 3, h = l.getX(c + 0), u = l.getX(c + 1), d = l.getX(c + 2); for (const f in r) { - const p = a[f], g = r[f]; + const g = a[f], p = r[f]; if (!(f in a)) throw new Error(`CSG Operations: Attribute ${f} not available on geometry.`); - const x = p.itemSize; - f === "position" ? (ln.a.fromBufferAttribute(p, h).applyMatrix4(n), ln.b.fromBufferAttribute(p, u).applyMatrix4(n), ln.c.fromBufferAttribute(p, d).applyMatrix4(n), nh(ln.a, ln.b, ln.c, e, 3, g, o)) : f === "normal" ? (ln.a.fromBufferAttribute(p, h).applyNormalMatrix(i), ln.b.fromBufferAttribute(p, u).applyNormalMatrix(i), ln.c.fromBufferAttribute(p, d).applyNormalMatrix(i), o && (ln.a.multiplyScalar(-1), ln.b.multiplyScalar(-1), ln.c.multiplyScalar(-1)), nh(ln.a, ln.b, ln.c, e, 3, g, o, !0)) : (Hp.fromBufferAttribute(p, h), Vp.fromBufferAttribute(p, u), Gp.fromBufferAttribute(p, d), nh(Hp, Vp, Gp, e, x, g, o)); + const x = g.itemSize; + f === "position" ? (ln.a.fromBufferAttribute(g, h).applyMatrix4(n), ln.b.fromBufferAttribute(g, u).applyMatrix4(n), ln.c.fromBufferAttribute(g, d).applyMatrix4(n), nh(ln.a, ln.b, ln.c, e, 3, p, o)) : f === "normal" ? (ln.a.fromBufferAttribute(g, h).applyNormalMatrix(i), ln.b.fromBufferAttribute(g, u).applyNormalMatrix(i), ln.c.fromBufferAttribute(g, d).applyNormalMatrix(i), o && (ln.a.multiplyScalar(-1), ln.b.multiplyScalar(-1), ln.c.multiplyScalar(-1)), nh(ln.a, ln.b, ln.c, e, 3, p, o, !0)) : (Hp.fromBufferAttribute(g, h), Vp.fromBufferAttribute(g, u), Gp.fromBufferAttribute(g, d), nh(Hp, Vp, Gp, e, x, p, o)); } } function QE(s, e, t, n, i, r, o, a = !1) { @@ -43262,51 +43313,51 @@ function QE(s, e, t, n, i, r, o, a = !1) { function G0(s, e, t = !1) { switch (s) { case WE: - if (e === xs || e === dl && !t) + if (e === xs || e === ul && !t) return fs; break; case XE: if (t) { if (e === gs) - return _o; - } else if (e === xs || e === ul) + return Mo; + } else if (e === xs || e === hl) return fs; break; case jE: if (t) { - if (e === xs || e === ul) + if (e === xs || e === hl) return fs; } else if (e === gs) - return _o; + return Mo; break; - case qE: + case ZE: if (e === gs) - return _o; + return Mo; if (e === xs) return fs; break; case F0: - if (e === gs || e === dl && !t) + if (e === gs || e === ul && !t) return fs; break; case z0: - if (!t && (e === xs || e === ul)) + if (!t && (e === xs || e === hl)) return fs; break; case H0: - if (!t && (e === gs || e === dl)) + if (!t && (e === gs || e === ul)) return fs; break; default: throw new Error(`Unrecognized CSG operation enum "${s}".`); } - return ed; + return Qu; } function nh(s, e, t, n, i, r, o = !1, a = !1) { const l = (c) => { r.push(c.x), i > 1 && r.push(c.y), i > 2 && r.push(c.z), i > 3 && r.push(c.w); }; - Qc.set(0, 0, 0, 0).addScaledVector(s, n.a.x).addScaledVector(e, n.a.y).addScaledVector(t, n.a.z), Ka.set(0, 0, 0, 0).addScaledVector(s, n.b.x).addScaledVector(e, n.b.y).addScaledVector(t, n.b.z), $a.set(0, 0, 0, 0).addScaledVector(s, n.c.x).addScaledVector(e, n.c.y).addScaledVector(t, n.c.z), a && (Qc.normalize(), Ka.normalize(), $a.normalize()), l(Qc), o ? (l($a), l(Ka)) : (l(Ka), l($a)); + Qc.set(0, 0, 0, 0).addScaledVector(s, n.a.x).addScaledVector(e, n.a.y).addScaledVector(t, n.a.z), Ya.set(0, 0, 0, 0).addScaledVector(s, n.b.x).addScaledVector(e, n.b.y).addScaledVector(t, n.b.z), Ka.set(0, 0, 0, 0).addScaledVector(s, n.c.x).addScaledVector(e, n.c.y).addScaledVector(t, n.c.z), a && (Qc.normalize(), Ya.normalize(), Ka.normalize()), l(Qc), o ? (l(Ka), l(Ya)) : (l(Ya), l(Ka)); } function ih(s, e, t, n, i, r = !1) { for (const o in i) { @@ -43398,29 +43449,29 @@ class tT { this.enabled && Xp(null); } } -const Yi = new ze(), El = new $e(), ps = new bt(), Ja = new bt(), Gi = new bt(), Qa = new bt(), Kn = [], _s = []; +const Yi = new ze(), El = new $e(), ps = new bt(), $a = new bt(), Gi = new bt(), Ja = new bt(), Kn = [], _s = []; function nT(s) { for (const e of s) return e; } function iT(s, e, t, n, i, r = {}) { const { useGroups: o = !0 } = r, { aIntersections: a, bIntersections: l } = $E(s, e), c = []; let h = null, u; - return u = o ? 0 : -1, qp(s, e, a, t, !1, n, i, u), Zp(s, e, a, t, !1, i, u), t.findIndex((d) => d !== H0 && d !== z0) !== -1 && (u = o ? s.geometry.groups.length || 1 : -1, qp(e, s, l, t, !0, n, i, u), Zp(e, s, l, t, !0, i, u)), Kn.length = 0, _s.length = 0, { + return u = o ? 0 : -1, Zp(s, e, a, t, !1, n, i, u), qp(s, e, a, t, !1, i, u), t.findIndex((d) => d !== H0 && d !== z0) !== -1 && (u = o ? s.geometry.groups.length || 1 : -1, Zp(e, s, l, t, !0, n, i, u), qp(e, s, l, t, !0, i, u)), Kn.length = 0, _s.length = 0, { groups: c, materials: h }; } -function qp(s, e, t, n, i, r, o, a = 0) { +function Zp(s, e, t, n, i, r, o, a = 0) { const l = s.matrixWorld.determinant() < 0; Yi.copy(e.matrixWorld).invert().multiply(s.matrixWorld), El.getNormalMatrix(s.matrixWorld).multiplyScalar(l ? -1 : 1); - const c = s.geometry.groupIndices, h = s.geometry.index, u = s.geometry.attributes.position, d = e.geometry.boundsTree, f = e.geometry.index, p = e.geometry.attributes.position, g = t.ids, x = t.intersectionSet; - for (let m = 0, b = g.length; m < b; m++) { - const v = g[m], y = a === -1 ? 0 : c[v] + a, M = 3 * v, E = h.getX(M + 0), A = h.getX(M + 1), R = h.getX(M + 2); + const c = s.geometry.groupIndices, h = s.geometry.index, u = s.geometry.attributes.position, d = e.geometry.boundsTree, f = e.geometry.index, g = e.geometry.attributes.position, p = t.ids, x = t.intersectionSet; + for (let m = 0, b = p.length; m < b; m++) { + const v = p[m], y = a === -1 ? 0 : c[v] + a, M = 3 * v, E = h.getX(M + 0), A = h.getX(M + 1), R = h.getX(M + 2); ps.a.fromBufferAttribute(u, E).applyMatrix4(Yi), ps.b.fromBufferAttribute(u, A).applyMatrix4(Yi), ps.c.fromBufferAttribute(u, R).applyMatrix4(Yi), r.reset(), r.initialize(ps); const _ = x[v]; for (let D = 0, C = _.length; D < C; D++) { const B = 3 * _[D], w = f.getX(B + 0), F = f.getX(B + 1), W = f.getX(B + 2); - Ja.a.fromBufferAttribute(p, w), Ja.b.fromBufferAttribute(p, F), Ja.c.fromBufferAttribute(p, W), r.splitByTriangle(Ja); + $a.a.fromBufferAttribute(g, w), $a.b.fromBufferAttribute(g, F), $a.c.fromBufferAttribute(g, W), r.splitByTriangle($a); } const S = r.triangles; for (let D = 0, C = S.length; D < C; D++) { @@ -43428,47 +43479,47 @@ function qp(s, e, t, n, i, r, o, a = 0) { Kn.length = 0, _s.length = 0; for (let F = 0, W = n.length; F < W; F++) { const j = G0(n[F], w, i); - j !== ed && (_s.push(j), Kn.push(o[F].getGroupAttrSet(y))); + j !== Qu && (_s.push(j), Kn.push(o[F].getGroupAttrSet(y))); } if (Kn.length !== 0) { - ps.getBarycoord(B.a, Qa.a), ps.getBarycoord(B.b, Qa.b), ps.getBarycoord(B.c, Qa.c); + ps.getBarycoord(B.a, Ja.a), ps.getBarycoord(B.b, Ja.b), ps.getBarycoord(B.c, Ja.c); for (let F = 0, W = Kn.length; F < W; F++) { - const j = Kn[F], $ = _s[F] === _o; - JE(v, Qa, s.geometry, s.matrixWorld, El, j, l !== $); + const j = Kn[F], $ = _s[F] === Mo; + JE(v, Ja, s.geometry, s.matrixWorld, El, j, l !== $); } } } } - return g.length; + return p.length; } -function Zp(s, e, t, n, i, r, o = 0) { +function qp(s, e, t, n, i, r, o = 0) { const a = s.matrixWorld.determinant() < 0; Yi.copy(e.matrixWorld).invert().multiply(s.matrixWorld), El.getNormalMatrix(s.matrixWorld).multiplyScalar(a ? -1 : 1); - const l = e.geometry.boundsTree, c = s.geometry.groupIndices, h = s.geometry.index, u = s.geometry.attributes, d = u.position, f = [], p = s.geometry.halfEdges, g = /* @__PURE__ */ new Set(), x = Qu(s.geometry); + const l = e.geometry.boundsTree, c = s.geometry.groupIndices, h = s.geometry.index, u = s.geometry.attributes, d = u.position, f = [], g = s.geometry.halfEdges, p = /* @__PURE__ */ new Set(), x = Ju(s.geometry); for (let m = 0, b = x; m < b; m++) - m in t.intersectionSet || g.add(m); - for (; g.size > 0; ) { - const m = nT(g); - g.delete(m), f.push(m); + m in t.intersectionSet || p.add(m); + for (; p.size > 0; ) { + const m = nT(p); + p.delete(m), f.push(m); const b = 3 * m, v = h.getX(b + 0), y = h.getX(b + 1), M = h.getX(b + 2); Gi.a.fromBufferAttribute(d, v).applyMatrix4(Yi), Gi.b.fromBufferAttribute(d, y).applyMatrix4(Yi), Gi.c.fromBufferAttribute(d, M).applyMatrix4(Yi); const E = V0(Gi, l); _s.length = 0, Kn.length = 0; for (let A = 0, R = n.length; A < R; A++) { const _ = G0(n[A], E, i); - _ !== ed && (_s.push(_), Kn.push(r[A])); + _ !== Qu && (_s.push(_), Kn.push(r[A])); } for (; f.length > 0; ) { const A = f.pop(); for (let R = 0; R < 3; R++) { - const _ = p.getSiblingTriangleIndex(A, R); - _ !== -1 && g.has(_) && (f.push(_), g.delete(_)); + const _ = g.getSiblingTriangleIndex(A, R); + _ !== -1 && p.has(_) && (f.push(_), p.delete(_)); } if (Kn.length !== 0) { const R = 3 * A, _ = h.getX(R + 0), S = h.getX(R + 1), D = h.getX(R + 2), C = o === -1 ? 0 : c[A] + o; if (Gi.a.fromBufferAttribute(d, _), Gi.b.fromBufferAttribute(d, S), Gi.c.fromBufferAttribute(d, D), !ji(Gi)) for (let B = 0, w = Kn.length; B < w; B++) { - const F = _s[B], W = Kn[B].getGroupAttrSet(C), j = F === _o; + const F = _s[B], W = Kn[B].getGroupAttrSet(C), j = F === Mo; QE(_, S, D, u, s.matrixWorld, El, W, j !== a); } } @@ -43503,10 +43554,10 @@ function oT(s, e, t) { const c = e.getTotalLength(l), h = e.getType(l), u = e.getItemSize(l), d = e.getNormalized(l); let f = r[l]; (!f || f.array.length < c) && (f = new at(new h(c), u, d), s.setAttribute(l, f), n = !0); - let p = 0; - for (let g = 0, x = Math.min(t.length, e.groupCount); g < x; g++) { - const m = t[g].index, { array: b, type: v, length: y } = e.groupAttributes[m][l], M = new v(b.buffer, 0, y); - f.array.set(M, p), p += M.length; + let g = 0; + for (let p = 0, x = Math.min(t.length, e.groupCount); p < x; p++) { + const m = t[p].index, { array: b, type: v, length: y } = e.groupAttributes[m][l], M = new v(b.buffer, 0, y); + f.array.set(M, g), g += M.length; } f.needsUpdate = !0, i = c / f.itemSize; } @@ -43557,11 +43608,11 @@ class aT { i.forEach((m, b) => { rT(e.geometry, m.geometry, a[b], l); }), u.init(), iT(e, t, n, o, a, { useGroups: c }), u.complete(); - const d = this.getGroupRanges(e.geometry), f = Yp(d, e.material), p = this.getGroupRanges(t.geometry), g = Yp(p, t.material); - p.forEach((m) => m.materialIndex += f.length); - let x = [...d, ...p].map((m, b) => ({ ...m, index: b })); + const d = this.getGroupRanges(e.geometry), f = Yp(d, e.material), g = this.getGroupRanges(t.geometry), p = Yp(g, t.material); + g.forEach((m) => m.materialIndex += f.length); + let x = [...d, ...g].map((m, b) => ({ ...m, index: b })); if (c) { - const m = [...f, ...g]; + const m = [...f, ...p]; h && (x = x.map((v) => { const y = m[v.materialIndex]; return v.materialIndex = m.indexOf(y), v; @@ -43663,8 +43714,8 @@ class W0 { * 创建空的剖切补面网格 */ createEmptySectionMesh(e, t) { - const n = new ut(), i = new Ss({ - color: new Fe(33023), + const n = new ut(), i = new Es({ + color: new Oe(33023), metalness: 0.1, roughness: 0.75, side: At, @@ -43891,7 +43942,7 @@ class W0 { */ setSectionColor(e) { this.planeObjects.forEach((t) => { - t.material instanceof Ss && t.material.color.set(e); + t.material instanceof Es && t.material.color.set(e); }); } /** @@ -44075,7 +44126,7 @@ class lT { c.setAttribute("position", new at(h, 3)), c.setIndex(u); let d = t.meshs.find((m) => m.name == l); if (d == null) { - const m = new Zt({ + const m = new qt({ color: 65280, // 绿色 transparent: !0, @@ -44102,10 +44153,10 @@ class lT { o[0].y, o[0].z ]); - let p = new Cs({ color: 255 }), g = new ut(); - g.setAttribute("position", new at(f, 3)); + let g = new Ps({ color: 255 }), p = new ut(); + p.setAttribute("position", new at(f, 3)); let x = t.meshs.find((m) => m.name == l + "Line"); - x == null && (x = new es(g, p), x.name = l + "Line", n.add(x), t.meshs.push(x)), x.geometry = g, x.material = p, t.engine.sectionPlane.find((m) => m.name == l).setFromNormalAndCoplanarPoint(a.clone().setLength(-1), e.max), t.engine.scene.children.filter((m) => m.type == "Mesh" && m.url).forEach((m) => { + x == null && (x = new es(p, g), x.name = l + "Line", n.add(x), t.meshs.push(x)), x.geometry = p, x.material = g, t.engine.sectionPlane.find((m) => m.name == l).setFromNormalAndCoplanarPoint(a.clone().setLength(-1), e.max), t.engine.scene.children.filter((m) => m.type == "Mesh" && m.url).forEach((m) => { m.material && Array.isArray(m.material) ? m.material.forEach((b) => { b.clippingPlanes = t.engine.sectionPlane; }) : m.material.clippingPlanes = t.engine.sectionPlane; @@ -44277,7 +44328,7 @@ class cT { c.setAttribute("position", new at(h, 3)), c.setIndex(u); let d = t.meshs.find((m) => m.name == l); if (d == null) { - const m = new Zt({ + const m = new qt({ color: 65280, // 绿色 transparent: !0, @@ -44310,10 +44361,10 @@ class cT { o[0].z // 点1 ]); - let p = new Cs({ color: 255 }), g = new ut(); - g.setAttribute("position", new at(f, 3)); + let g = new Ps({ color: 255 }), p = new ut(); + p.setAttribute("position", new at(f, 3)); let x = t.meshs.find((m) => m.name == l + "Line"); - x == null && (x = new es(g, p), x.name = l + "Line", n.add(x), t.meshs.push(x)), x.geometry = g, x.material = p, t.engine.sectionPlane.find((m) => m.name == l).setFromNormalAndCoplanarPoint(a.clone().setLength(-1), e.min), t.engine.scene.children.filter((m) => m.type == "Mesh" && m.url).forEach((m) => { + x == null && (x = new es(p, g), x.name = l + "Line", n.add(x), t.meshs.push(x)), x.geometry = p, x.material = g, t.engine.sectionPlane.find((m) => m.name == l).setFromNormalAndCoplanarPoint(a.clone().setLength(-1), e.min), t.engine.scene.children.filter((m) => m.type == "Mesh" && m.url).forEach((m) => { m.material && Array.isArray(m.material) ? m.material.forEach((b) => { b.clippingPlanes = t.engine.sectionPlane; }) : m.material.clippingPlanes = t.engine.sectionPlane; @@ -44382,7 +44433,7 @@ class hT { }), this.csgClipping.planes = this.engine.sectionPlane, this.csgClipping.init(); } active() { - console.log("调用这里了"), !this.isActive && (this.isActive = !0, this.init(), this.meshs.forEach((e) => { + this.isActive || (this.isActive = !0, this.init(), this.meshs.forEach((e) => { e.visible = !0; }), this.engine.handelBehaved.init(this), this.engine.handelBehaved.active(), this.csgClipping && this.csgClipping.active(), this.engine.models.forEach((e) => { e.nodesMap.forEach((t) => { @@ -44425,13 +44476,6 @@ class hT { // 反向剖切 reverseBox() { } - /** - * 设置剖切盒范围(百分比) - * @param percent 百分比范围 { x: {min, max}, y: {min, max}, z: {min, max} },值域 0-100 - */ - setboxPercent(e) { - console.log("[SectionBox] setboxPercent called with:", e); - } // 重写鼠标按下事件 handleMouseDown(e) { this.isDrag = !0; @@ -44500,7 +44544,7 @@ class hT { ]; c(n, new P(0, 0, -1), "前"), c(i, new P(0, 0, 1), "后"), c(r, new P(1, 0, 0), "右"), c(o, new P(-1, 0, 0), "左"), c(a, new P(0, 1, 0), "顶"), c(l, new P(0, -1, 0), "底"); function c(h, u, d) { - const f = new ut(), p = new Float32Array([ + const f = new ut(), g = new Float32Array([ h[0].x, h[0].y, h[0].z, @@ -44517,7 +44561,7 @@ class hT { h[3].y, h[3].z // 点4 - ]), g = [ + ]), p = [ 0, 1, 2, @@ -44527,12 +44571,12 @@ class hT { 3 // 第二个三角形 ]; - f.setAttribute("position", new at(p, 3)), f.setIndex(g); + f.setAttribute("position", new at(g, 3)), f.setIndex(p); let x = t.engine.scene.children.find((E) => E.type == "Group" && E.name == "ClippingBox"); x == null && (x = new vn(), x.name = "ClippingBox", t.engine.scene.add(x)); let m = t.meshs.find((E) => E.name == d); if (m == null) { - const E = new Zt({ + const E = new qt({ color: 65280, // 绿色 transparent: !0, @@ -44565,7 +44609,7 @@ class hT { h[0].z // 点1 ]); - let v = new Cs({ color: 255 }), y = new ut(); + let v = new Ps({ color: 255 }), y = new ut(); y.setAttribute("position", new at(b, 3)); let M = t.meshs.find((E) => E.name == d + "Line"); M == null && (M = new es(y, v), M.name = d + "Line", x.add(M), t.meshs.push(M)), M.geometry = y, M.material = v, d == "前" || d == "左" || d == "底" ? t.engine.sectionPlane.find((E) => E.name == d).setFromNormalAndCoplanarPoint(u.clone().setLength(-1), e.min) : t.engine.sectionPlane.find((E) => E.name == d).setFromNormalAndCoplanarPoint(u.clone().setLength(-1), e.max), t.engine.scene.children.filter((E) => E.type == "Mesh" && E.url).forEach((E) => { @@ -44700,10 +44744,10 @@ class pT { name: o.categorys[d], children: [] }; - c.push(f), h.filter((p) => p[0] === d).forEach((p) => { + c.push(f), h.filter((g) => g[0] === d).forEach((g) => { f.children.push({ - name: o.names[p[1]], - value: o.values[p[2]] + name: o.names[g[1]], + value: o.values[g[2]] }); }); }), l?.({ @@ -44800,7 +44844,7 @@ class gT { material; indexes = /* @__PURE__ */ new Map(); constructor(e) { - this.engine = e, this.groupEdge = this.engine.scene.getObjectByName("groupEdge"), this.material = new Cs({ + this.engine = e, this.groupEdge = this.engine.scene.getObjectByName("groupEdge"), this.material = new Ps({ color: "#000000", depthTest: !0 }); @@ -44869,8 +44913,8 @@ class gT { for (let u = r; u < o; u += 3) { const d = Math.floor(h / 6), f = h % 6 >= 3; if (a[d] && a[d].length === 2) { - const p = f ? a[d][1] : a[d][0]; - c[u] = p.X, c[u + 1] = p.Z, c[u + 2] = -p.Y; + const g = f ? a[d][1] : a[d][0]; + c[u] = g.X, c[u + 1] = g.Z, c[u + 2] = -g.Y; } h += 3; } @@ -44885,8 +44929,8 @@ class xT { constructor(e) { this.config = { temperature: 0.7, - maxTokens: 2e3, - timeout: 3e4, + maxTokens: 2e4, + timeout: 3e5, ...e }; } @@ -44970,13 +45014,13 @@ class xT { for (const d of u) { const f = d.trim(); if (!f || !f.startsWith("data: ")) continue; - const p = f.slice(6); - if (p !== "[DONE]") + const g = f.slice(6); + if (g !== "[DONE]") try { - const g = JSON.parse(p).choices?.[0]?.delta?.content; - g && t(g, !1); - } catch (g) { - console.warn("解析流式数据失败:", g); + const p = JSON.parse(g).choices?.[0]?.delta?.content; + p && t(p, !1); + } catch (p) { + console.warn("解析流式数据失败:", p); } } } @@ -45033,9 +45077,9 @@ class vT { this._callback_message = e, this._callback_question = t, this._callback_content = n, this.conversationHistory = []; let i = { llmConfig: { - baseURL: "https://api.deepseek.com/v1", - apiKey: "sk-4677b153277a40b096c6716686c29ac4", - model: "deepseek-chat", + baseURL: "https://open.bigmodel.cn/api/coding/paas/v4", + apiKey: "4041336a72f14d8fa3800bd651a80fec.vZWUxssXOXB37vlV", + model: "GLM-4.5-Air", temperature: 0.7, maxTokens: 2e3 }, @@ -45053,11 +45097,11 @@ class vT { try { this.config = i, this.llmApi = new xT(i.llmConfig); try { - const r = await Promise.resolve().then(() => xA); + const r = await Promise.resolve().then(() => mA); this.prompts.main = r.default; - const o = await Promise.resolve().then(() => bA); + const o = await Promise.resolve().then(() => xA); this.prompts.step = o.default; - const a = await Promise.resolve().then(() => _A); + const a = await Promise.resolve().then(() => bA); this.prompts.apiDoc = a.default; } catch (r) { throw console.error("[AI Manager] 提示词文件加载失败:", r), new Error(`提示词文件加载失败: ${r.message || "未知错误"}`); @@ -45422,7 +45466,7 @@ class bT { constructor(e) { if (this.options = e, this.container = document.getElementById(e.containerId), !this.container) throw new Error(`Container ${e.containerId} not found`); - this.ai = new vT(this), this.ai.init(), this.deviceModule = new W2(this), this.DeviceType = this.deviceModule.getDeviceType(), this.cameraModule = new G2(this), this.sceneModule = new V2(this), this.scene = this.sceneModule.scene, this.renderModule = new X2(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.orthographicCamera, this.scene.camera = this.camera, this.controlModule = new oM(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.composerModule = new _M(this), this.composerModule.init(), this.events = new jw(), this.engineStatus = new Xw(this), this.engineStatus.init(), this.loaderModule = new Ww(this), this.lightModule = new qw(this), this.lightModule.init(), this.viewCube = new rS(this), this.viewCube.init(), this.octreeBox = oS(this), this.rangeScale = new aS(this), this.rangeScale.init(), this.clipping = new uT(this), this.clipping.init(), this.setting = new lS(this), this.setting.init(), this.handelBehaved = Wu(this), this.modelMapperBatch = new mT(this), this.measure = new xS(this), this.modelToolModule = new Yw(this), this.modelProperties = new pT(this), this.interactionModule = new Zw(this), this.interactionModule.init(), this.interactionModule.active(), this.modelEdge = new gT(this), this.modelTree = new dT(this), this.engineInfo = new fT(this), this.worldToScreen = new Dn(this.camera, this.renderer, this.scene), this.reactBoundingClientRect = this.container.getBoundingClientRect(), this.stats = new Qw(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom); + this.ai = new vT(this), this.deviceModule = new W2(this), this.DeviceType = this.deviceModule.getDeviceType(), this.cameraModule = new G2(this), this.sceneModule = new V2(this), this.scene = this.sceneModule.scene, this.renderModule = new X2(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.orthographicCamera, this.scene.camera = this.camera, this.controlModule = new oM(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.composerModule = new _M(this), this.composerModule.init(), this.events = new jw(), this.engineStatus = new Xw(this), this.engineStatus.init(), this.loaderModule = new Ww(this), this.lightModule = new Zw(this), this.lightModule.init(), this.viewCube = new rS(this), this.viewCube.init(), this.octreeBox = oS(this), this.rangeScale = new aS(this), this.rangeScale.init(), this.clipping = new uT(this), this.clipping.init(), this.setting = new lS(this), this.setting.init(), this.handelBehaved = Gu(this), this.modelMapperBatch = new mT(this), this.measure = new xS(this), this.modelToolModule = new Yw(this), this.modelProperties = new pT(this), this.interactionModule = new qw(this), this.interactionModule.init(), this.interactionModule.active(), this.modelEdge = new gT(this), this.modelTree = new dT(this), this.engineInfo = new fT(this), this.worldToScreen = new Dn(this.camera, this.renderer, this.scene), this.stats = new Qw(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom); let t = document.createElementNS("http://www.w3.org/2000/svg", "svg"); t.style.position = "absolute", t.style.width = "100%", t.style.height = "100%", t.style.zIndex = "1000", t.style.left = "0px", t.style.top = "0px", t.style.pointerEvents = "none"; const n = this.renderer?.domElement.width || 1920, i = this.renderer?.domElement.height || 1080; @@ -45467,18 +45511,28 @@ class bT { /** * 处理窗口大小变化 */ - handleWindowResize() { + handleWindowResize(e, t) { if (!this.container || !this.renderer || !this.camera) return; - this.reactBoundingClientRect = this.container.getBoundingClientRect(); - const { width: e, height: t } = this.deviceModule.getContainerSize(); - this.renderer.setSize(e, t); + if (e === void 0 || t === void 0) { + const i = this.deviceModule.getContainerSize(); + e = e ?? i.width, t = t ?? i.height; + } + if (!e || !t) + return; + this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(e, t); const n = e / t; - if (this.camera === this.cameraModule.perspectiveCamera ? (this.cameraModule.perspectiveCamera.aspect = n, this.cameraModule.perspectiveCamera.updateProjectionMatrix()) : this.camera === this.cameraModule.orthographicCamera && (this.cameraModule.orthographicCamera.left = 50 * n / -2, this.cameraModule.orthographicCamera.right = 50 * n / 2, this.cameraModule.orthographicCamera.top = 50 / 2, this.cameraModule.orthographicCamera.bottom = 50 / -2, this.cameraModule.orthographicCamera.updateProjectionMatrix()), this.composerModule && this.composerModule.composer && this.composerModule.composer.setSize(e, t), this.catchSvg) { + if (this.camera === this.cameraModule.perspectiveCamera) + this.cameraModule.perspectiveCamera.aspect = n, this.cameraModule.perspectiveCamera.updateProjectionMatrix(), this.camera = this.cameraModule.perspectiveCamera; + else if (this.camera === this.cameraModule.orthographicCamera) { + const i = this.cameraModule.orthographicCamera, r = 50, o = this.container.clientWidth / this.container.clientHeight; + i.left = r * o / -2, i.right = r * o / 2, i.top = r / 2, i.bottom = r / -2, i.updateProjectionMatrix(); + } + if (this.catchSvg) { const i = this.renderer.domElement.width, r = this.renderer.domElement.height; this.catchSvg.setAttribute("viewBox", `0 0 ${i} ${r}`); } - this.events && this.events.trigger(Dr.ViewportResize, { width: e, height: t }); + this.events && this.events.trigger(Ir.ViewportResize, { width: e, height: t }); } /** * 销毁引擎,释放资源 @@ -45526,7 +45580,7 @@ class bT { clearScene(e) { e && ([...e.children].forEach((t) => { this.clearScene(t); - }), e.parent && e.parent.remove(e), e instanceof dt && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((t) => this.disposeMaterial(t)) : this.disposeMaterial(e.material))), e instanceof es && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof Dm && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof No && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((t) => this.disposeMaterial(t)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof Rx && e.material && this.disposeMaterial(e.material)); + }), e.parent && e.parent.remove(e), e instanceof dt && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((t) => this.disposeMaterial(t)) : this.disposeMaterial(e.material))), e instanceof es && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof Dm && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof ws && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((t) => this.disposeMaterial(t)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof Rx && e.material && this.disposeMaterial(e.material)); } /** * 清理材质及其纹理 @@ -45634,7 +45688,7 @@ class _T { this._isInitialized = !0, this.unsubscribeTheme = ot.subscribe((t) => { this.setTheme(t); }), this.setTheme(ot.getTheme()), this.engine.events.on("click", (t) => { - const n = wt.getInstance(); + const n = Tt.getInstance(); t && t.object ? (this.selectedComponent = { url: t.object.url, id: t.object.name @@ -46166,7 +46220,7 @@ class MT { this.isVisible && (this.element.contains(e.target) || this.hide()); }; } -class td { +class ed { element; options; unsubscribeLocale = null; @@ -46281,7 +46335,7 @@ class td { i.style.position = "fixed", i.style.zIndex = "10001"; const r = t.getBoundingClientRect(); i.style.top = `${r.top}px`, i.style.left = `${r.right}px`, i.addEventListener("mousedown", (l) => l.stopPropagation()); - const o = new td({ items: n }); + const o = new ed({ items: n }); o.init(), i.appendChild(o.element), document.body.appendChild(i), this.activeSubMenu = { menu: o, container: i }; const a = i.getBoundingClientRect(); a.right > window.innerWidth && (i.style.left = `${r.left - a.width}px`); @@ -46327,7 +46381,7 @@ class X0 extends Ii { */ showMenu(e, t, n, i) { if (!n || n.length === 0) return; - const r = new td({ items: n, groupOrder: i }); + const r = new ed({ items: n, groupOrder: i }); r.init(), this.rightKeyPanel.mount(r), this.rightKeyPanel.show(e, t); } /** 隐藏菜单 */ @@ -46374,7 +46428,7 @@ class wT extends Ii { order: 1, divider: !0, onClick: () => { - wt.getInstance().componentDetail?.show(), this.rightKey?.hide(); + Tt.getInstance().componentDetail?.show(), this.rightKey?.hide(); } }), i.push({ id: "hideSelected", @@ -46664,13 +46718,13 @@ class wT extends Ii { this.engineInstance && (this.engineInstance.destroy(), this.engineInstance = null), this.rightKey && (this.rightKey.destroy(), this.rightKey = null), super.destroy(); } } -var Dt = /* @__PURE__ */ ((s) => (s[s.Unchecked = 0] = "Unchecked", s[s.Checked = 1] = "Checked", s[s.Indeterminate = 2] = "Indeterminate", s))(Dt || {}); +var Lt = /* @__PURE__ */ ((s) => (s[s.Unchecked = 0] = "Unchecked", s[s.Checked = 1] = "Checked", s[s.Indeterminate = 2] = "Indeterminate", s))(Lt || {}); class ST { config; element; children = []; parent = null; - checkState = Dt.Unchecked; + checkState = Lt.Unchecked; // UI Elements contentEl; switcherEl; @@ -46685,7 +46739,7 @@ class ST { onNodeClick; renderActions; constructor(e, t, n) { - this.config = e, this.onExpandChange = n.onExpand, this.onCheckChange = n.onCheck, this.onNodeClick = n.onClick, this.renderActions = t.renderActions, this.checkState = e.checked ? Dt.Checked : Dt.Unchecked, this.element = this.createDom(t); + this.config = e, this.onExpandChange = n.onExpand, this.onCheckChange = n.onCheck, this.onNodeClick = n.onClick, this.renderActions = t.renderActions, this.checkState = e.checked ? Lt.Checked : Lt.Unchecked, this.element = this.createDom(t); } /** * 创建节点 DOM @@ -46741,8 +46795,8 @@ class ST { * 切换选中状态 (用户点击) */ toggleCheck() { - const e = this.checkState !== Dt.Checked; - this.setChecked(e ? Dt.Checked : Dt.Unchecked, !0); + const e = this.checkState !== Lt.Checked; + this.setChecked(e ? Lt.Checked : Lt.Unchecked, !0); } /** * 设置选中状态 (API调用或联动) @@ -46750,13 +46804,13 @@ class ST { * @param fireEvent 是否触发事件 */ setChecked(e, t = !1) { - this.checkState !== e && (this.checkState = e, this.config.checked = e === Dt.Checked, this.updateCheckboxUI(), t && this.onCheckChange(this)); + this.checkState !== e && (this.checkState = e, this.config.checked = e === Lt.Checked, this.updateCheckboxUI(), t && this.onCheckChange(this)); } /** * 更新复选框 UI 样式 */ updateCheckboxUI() { - this.checkboxEl && (this.checkboxEl.classList.remove("is-checked", "is-indeterminate"), this.checkState === Dt.Checked ? this.checkboxEl.classList.add("is-checked") : this.checkState === Dt.Indeterminate && this.checkboxEl.classList.add("is-indeterminate")); + this.checkboxEl && (this.checkboxEl.classList.remove("is-checked", "is-indeterminate"), this.checkState === Lt.Checked ? this.checkboxEl.classList.add("is-checked") : this.checkState === Lt.Indeterminate && this.checkboxEl.classList.add("is-indeterminate")); } /** * 添加子节点实例 @@ -46930,22 +46984,22 @@ class ET { * 处理节点勾选逻辑 (核心算法) */ handleNodeCheck(e) { - const t = e.checkState === Dt.Checked; + const t = e.checkState === Lt.Checked; if (this.onNodeCheck && this.onNodeCheck(e), this.options.checkStrictly === !1) return; const n = (r, o) => { r.children.forEach((a) => { a.config.disabled || (a.setChecked(o, !1), n(a, o)); }); }; - t ? n(e, Dt.Checked) : n(e, Dt.Unchecked); + t ? n(e, Lt.Checked) : n(e, Lt.Unchecked); let i = e.parent; for (; i; ) { if (i.config.disabled) { i = i.parent; continue; } - const r = i.children, o = r.every((l) => l.checkState === Dt.Checked), a = r.every((l) => l.checkState === Dt.Unchecked); - o ? i.setChecked(Dt.Checked, !1) : a ? i.setChecked(Dt.Unchecked, !1) : i.setChecked(Dt.Indeterminate, !1), i = i.parent; + const r = i.children, o = r.every((l) => l.checkState === Lt.Checked), a = r.every((l) => l.checkState === Lt.Unchecked); + o ? i.setChecked(Lt.Checked, !1) : a ? i.setChecked(Lt.Unchecked, !1) : i.setChecked(Lt.Indeterminate, !1), i = i.parent; } } // ================== Public APIs ================== @@ -46954,7 +47008,7 @@ class ET { } checkNode(e, t) { const n = this.nodeMap.get(e); - n && n.setChecked(t ? Dt.Checked : Dt.Unchecked, !0); + n && n.setChecked(t ? Lt.Checked : Lt.Unchecked, !0); } expandAll(e) { this.nodeMap.forEach((t) => t.toggleExpand(e)); @@ -46962,7 +47016,7 @@ class ET { getCheckedNodes(e = !1) { const t = []; return this.nodeMap.forEach((n) => { - (n.checkState === Dt.Checked || e && n.checkState === Dt.Indeterminate) && t.push(n.config); + (n.checkState === Lt.Checked || e && n.checkState === Lt.Indeterminate) && t.push(n.config); }), t; } } @@ -47128,7 +47182,7 @@ const Kp = { // ========== 默认图标 ========== default: '' }; -function Pt(s) { +function Bt(s) { const e = Kp[s]; return e || (console.warn(`[IconManager] Icon "${s}" not found, using default icon`), Kp.default); } @@ -47168,7 +47222,7 @@ class AT extends Ii { } /** 初始化按钮 */ init() { - this.toolbarContainer = document.createElement("div"), this.toolbarContainer.id = "bim-construct-tree", this.container.appendChild(this.toolbarContainer), this.toolbar = new yu({ + this.toolbarContainer = document.createElement("div"), this.toolbarContainer.id = "bim-construct-tree", this.container.appendChild(this.toolbarContainer), this.toolbar = new bu({ container: this.toolbarContainer, showLabel: !1, direction: "column", @@ -47180,7 +47234,7 @@ class AT extends Ii { groupId: "construct-tree", type: "button", label: "construct-tree", - icon: Pt("目录树"), + icon: Bt("目录树"), onClick: () => { this.openConstructTreeDialog(); } @@ -47191,24 +47245,24 @@ class AT extends Ii { const e = this.registry.engine3d?.getLevelTreeData() ?? [], t = this.registry.engine3d?.getTypeTreeData() ?? [], n = this.registry.engine3d?.getMajorTreeData() ?? []; console.log("[ConstructTree] 构件树数据 (Level):", e), console.log("[ConstructTree] 类型树数据 (Type):", t), console.log("[ConstructTree] 专业树数据 (Major):", n); const i = (f) => { - const p = new ET({ + const g = new ET({ data: TT(f), checkable: !0, indent: 0, enableSearch: !0, checkStrictly: !0, defaultExpandAll: !0, - onNodeCheck: (g) => { - console.log("onNodeCheck", g); + onNodeCheck: (p) => { + console.log("onNodeCheck", p); }, - onNodeSelect: (g) => { - console.log("onNodeSelect", g); + onNodeSelect: (p) => { + console.log("onNodeSelect", p); }, onNodeExpand: () => { this.dialog?.fitWidth(); } }); - return p.init(), p; + return g.init(), g; }, r = i(e), o = i(t), a = i(n), l = document.createElement("div"); l.className = "construct-tab__panel-content", l.appendChild(r.element); const c = document.createElement("div"); @@ -47301,7 +47355,7 @@ class AT extends Ii { this.toolbar?.setColors(e); } } -class Or extends Ii { +class Fr extends Ii { /** 对话框实例 */ dialog = null; /** 对话框是否可见 */ @@ -47393,7 +47447,7 @@ const CT = { slope: '', spaceVolume: '' }; -class Mo { +class wo { element; options; activeMode; @@ -47447,7 +47501,7 @@ class Mo { * @param options 组件配置 */ constructor(e = {}) { - this.options = e, this.activeMode = e.defaultMode ?? "distance", this.isExpanded = e.defaultExpanded ?? !1, this.config = this.loadConfigFromCache() ?? { ...Mo.DEFAULT_CONFIG }, this.element = this.createDom(); + this.options = e, this.activeMode = e.defaultMode ?? "distance", this.isExpanded = e.defaultExpanded ?? !1, this.config = this.loadConfigFromCache() ?? { ...wo.DEFAULT_CONFIG }, this.element = this.createDom(); } /** * 初始化组件(实现 IBimComponent) @@ -47581,8 +47635,8 @@ class Mo { `; - for (let g = 0; g < i.length; g++) { - const x = i[g], m = document.createElement("button"); + for (let p = 0; p < i.length; p++) { + const x = i[p], m = document.createElement("button"); m.type = "button", m.className = "bim-measure-tool-btn", m.dataset.mode = x; const b = document.createElement("span"); b.className = "bim-measure-tool-icon", b.innerHTML = CT[x] || r, m.appendChild(b), m.addEventListener("click", () => { @@ -47610,17 +47664,17 @@ class Mo { u.className = "value", this.mainValueValueEl = u, this.mainNumberEl = document.createElement("span"), this.mainNumberEl.className = "bim-measure-main-number", this.mainUnitEl = document.createElement("span"), this.mainUnitEl.className = "bim-measure-main-unit", this.mainValueValueEl.appendChild(this.mainNumberEl), this.mainValueValueEl.appendChild(document.createTextNode(" ")), this.mainValueValueEl.appendChild(this.mainUnitEl), c.appendChild(h), c.appendChild(u), l.appendChild(c); const d = document.createElement("div"); d.className = "bim-measure-xyz", this.xyzBoxEl = d; - const f = (g, x, m) => { + const f = (p, x, m) => { const b = document.createElement("div"); b.className = "bim-measure-row"; const v = document.createElement("span"); - v.className = "label", v.dataset.i18nKey = g; + v.className = "label", v.dataset.i18nKey = p; const y = document.createElement("span"); return y.className = `value ${x}`, m(y), b.appendChild(v), b.appendChild(y), b; }; - d.appendChild(f("measure.labels.x", "bim-measure-xyz-x", (g) => this.xyzXEl = g)), d.appendChild(f("measure.labels.y", "bim-measure-xyz-y", (g) => this.xyzYEl = g)), d.appendChild(f("measure.labels.z", "bim-measure-xyz-z", (g) => this.xyzZEl = g)), l.appendChild(d), this.mainViewEl.appendChild(l); - const p = document.createElement("div"); - return p.className = "bim-measure-footer", this.clearBtn = document.createElement("button"), this.clearBtn.type = "button", this.clearBtn.className = "bim-measure-clear-btn", this.clearBtn.addEventListener("click", () => { + d.appendChild(f("measure.labels.x", "bim-measure-xyz-x", (p) => this.xyzXEl = p)), d.appendChild(f("measure.labels.y", "bim-measure-xyz-y", (p) => this.xyzYEl = p)), d.appendChild(f("measure.labels.z", "bim-measure-xyz-z", (p) => this.xyzZEl = p)), l.appendChild(d), this.mainViewEl.appendChild(l); + const g = document.createElement("div"); + return g.className = "bim-measure-footer", this.clearBtn = document.createElement("button"), this.clearBtn.type = "button", this.clearBtn.className = "bim-measure-clear-btn", this.clearBtn.addEventListener("click", () => { this.clearAll(); }), this.settingsBtn = document.createElement("button"), this.settingsBtn.type = "button", this.settingsBtn.className = "bim-measure-settings-btn", this.settingsBtn.innerHTML = ` `, this.settingsBtn.addEventListener("click", () => { this.openSettings(); - }), p.appendChild(this.clearBtn), p.appendChild(this.settingsBtn), this.mainViewEl.appendChild(p), this.settingsViewEl = this.createSettingsDom(), e.appendChild(this.mainViewEl), e.appendChild(this.settingsViewEl), e; + }), g.appendChild(this.clearBtn), g.appendChild(this.settingsBtn), this.mainViewEl.appendChild(g), this.settingsViewEl = this.createSettingsDom(), e.appendChild(this.mainViewEl), e.appendChild(this.settingsViewEl), e; } /** * 创建“设置面板”DOM @@ -47698,7 +47752,7 @@ class Mo { */ loadConfigFromCache() { try { - const e = localStorage.getItem(Mo.CONFIG_CACHE_KEY); + const e = localStorage.getItem(wo.CONFIG_CACHE_KEY); if (!e) return null; const t = JSON.parse(e); if (!t || typeof t != "object") return null; @@ -47716,7 +47770,7 @@ class Mo { */ saveConfigToCache(e) { try { - localStorage.setItem(Mo.CONFIG_CACHE_KEY, JSON.stringify(e)); + localStorage.setItem(wo.CONFIG_CACHE_KEY, JSON.stringify(e)); } catch { } } @@ -47891,7 +47945,7 @@ class Mo { return { numberText: this.formatNumberWithPrecision(n, this.config.precision), unitText: t }; } } -class PT extends Or { +class PT extends Fr { /** 测量面板实例 */ panel = null; /** 测量配置(单位、精度等) */ @@ -47913,7 +47967,7 @@ class PT extends Or { * 初始化测量面板并设置回调 */ createContent() { - this.panel = new Mo({ + this.panel = new wo({ defaultMode: "distance", defaultExpanded: !1, onModeChange: (t) => { @@ -48049,19 +48103,19 @@ class RT { const e = document.createElement("div"); return e.className = "section-plane-panel", this.hideBtn = this.createButton( "hide", - Pt("隐藏"), + Bt("隐藏"), () => { this.options.onHide && this.options.onHide(); } ), this.reverseBtn = this.createButton( "reverse", - Pt("反向"), + Bt("反向"), () => { this.options.onReverse && this.options.onReverse(); } ), this.resetBtn = this.createButton( "reset", - Pt("重置"), + Bt("重置"), () => { this.options.onReset && this.options.onReset(); } @@ -48079,7 +48133,7 @@ class RT { return o.className = "section-plane-btn-label", i.appendChild(o), e === "hide" ? this.hideLabelEl = o : e === "reverse" ? this.reverseLabelEl = o : this.resetLabelEl = o, i.addEventListener("click", n), i; } } -class LT extends Or { +class LT extends Fr { /** 剖切面板实例 */ panel = null; /** 对话框唯一标识 */ @@ -48220,11 +48274,11 @@ class DT { const t = document.createElement("div"); t.className = "section-axis-row-1", this.hideBtn = this.createButton( "hide", - Pt("隐藏"), + Bt("隐藏"), () => this.handleHideToggle() ), this.reverseBtn = this.createButton( "reverse", - Pt("反向"), + Bt("反向"), () => this.handleReverse() ), t.appendChild(this.hideBtn), t.appendChild(this.reverseBtn); const n = document.createElement("div"); @@ -48281,7 +48335,7 @@ class DT { this.axisXBtn.classList.toggle("active", this.activeAxis === "x"), this.axisYBtn.classList.toggle("active", this.activeAxis === "y"), this.axisZBtn.classList.toggle("active", this.activeAxis === "z"); } } -class IT extends Or { +class IT extends Fr { /** 轴向剖切面板实例 */ panel = null; /** 对话框唯一标识 */ @@ -48464,7 +48518,7 @@ class BT { fit: "适应到模型", reset: "重置" }, a = document.createElement("div"); - a.className = "section-box-btn-icon", a.innerHTML = Pt(o[e] || e); + a.className = "section-box-btn-icon", a.innerHTML = Bt(o[e] || e); const l = document.createElement("div"); return l.className = "section-box-btn-label", l.textContent = t, i === "hide" ? this.hideLabelEl = l : i === "reverse" ? this.reverseLabelEl = l : i === "fit" ? this.fitLabelEl = l : i === "reset" && (this.resetLabelEl = l), r.appendChild(a), r.appendChild(l), r.addEventListener("click", n), r; } @@ -48531,7 +48585,7 @@ class BT { this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element); } } -class NT extends Or { +class NT extends Fr { /** 剖切盒面板实例 */ panel = null; /** 对话框唯一标识 */ @@ -48639,7 +48693,7 @@ class NT extends Or { this.panel?.setRange(e); } } -class kT { +class UT { element; options; // 状态 @@ -48778,9 +48832,9 @@ class kT { } getIconSVG(e) { return { - "plan-view": Pt("地图"), - path: Pt("路径漫游"), - walk: Pt("第一人称漫游") + "plan-view": Bt("地图"), + path: Bt("路径漫游"), + walk: Bt("第一人称漫游") }[e] || ""; } setLocales() { @@ -48804,7 +48858,7 @@ class kT { this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element); } } -class UT { +class OT { element; unsubscribeLocale = null; unsubscribeTheme = null; @@ -48825,7 +48879,7 @@ class UT { this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element); } } -class OT extends Or { +class kT extends Fr { /** 漫游路径面板实例 */ panel = null; /** 对话框唯一标识 */ @@ -48862,7 +48916,7 @@ class OT extends Or { } /** 创建对话框内容 */ createContent() { - return this.panel = new UT(), this.panel.init(), this.panel.element; + return this.panel = new OT(), this.panel.init(), this.panel.element; } /** 对话框关闭时的回调 */ onDialogClose() { @@ -48883,7 +48937,7 @@ class FT extends Ii { } /** 初始化管理器 */ init() { - this.pathManager = new OT(), this.pathManager.init(); + this.pathManager = new kT(), this.pathManager.init(); } /** 显示漫游控制面板 */ show() { @@ -48891,7 +48945,7 @@ class FT extends Ii { console.warn("Toolbar not initialized"); return; } - this.registry.toolbar.hide(), console.log("[WalkControl] 打开漫游面板,激活第一人称模式"), this.registry.engine3d?.activateFirstPersonMode(), this.panel = new kT({ + this.registry.toolbar.hide(), console.log("[WalkControl] 打开漫游面板,激活第一人称模式"), this.registry.engine3d?.activateFirstPersonMode(), this.panel = new UT({ onPlanViewToggle: (e) => { console.log("[WalkControl] 地图:", e), e ? this.registry.map?.show() : this.registry.map?.hide(), this.emit("walk:plan-view-toggle", { isActive: e }); }, @@ -48957,7 +49011,7 @@ class zT { this.unsubscribeLocale?.(), this.unsubscribeTheme?.(), this.element && this.element.parentElement && this.element.parentElement.removeChild(this.element); } } -class HT extends Or { +class HT extends Fr { /** 地图面板实例 */ panel = null; /** 对话框唯一标识 */ @@ -49264,7 +49318,7 @@ class GT extends Ii { this.unsubscribeSelected && (this.unsubscribeSelected(), this.unsubscribeSelected = null), this.unsubscribeDeselected && (this.unsubscribeDeselected(), this.unsubscribeDeselected = null), this.hide(), super.destroy(); } } -class OA { +class UA { container; wrapper = null; registry; @@ -49284,7 +49338,7 @@ class OA { constructor(e, t) { const n = typeof e == "string" ? document.getElementById(e) : e; if (!n) throw new Error("Container not found"); - this.container = n, this.registry = wt.getInstance(), t?.locale && Jt.setLocale(t.locale), t?.theme && (t.theme === "custom" ? console.warn("Custom theme should be set via setCustomTheme().") : ot.setTheme(t.theme)), this.init(); + this.container = n, this.registry = Tt.getInstance(), t?.locale && Jt.setLocale(t.locale), t?.theme && (t.theme === "custom" ? console.warn("Custom theme should be set via setCustomTheme().") : ot.setTheme(t.theme)), this.init(); } emit(e, t) { this.registry.emit(e, t); @@ -49313,7 +49367,7 @@ class OA { this.wrapper && (this.wrapper.style.color = e.textPrimary); } destroy() { - this.toolbar?.destroy(), this.buttonGroup?.destroy(), this.engine?.destroy(), this.dialog?.destroy(), this.rightKey?.destroy(), this.measure?.destroy(), this.sectionPlane?.destroy(), this.sectionAxis?.destroy(), this.sectionBox?.destroy(), this.walkControl?.destroy(), this.container.innerHTML = "", wt.reset(); + this.toolbar?.destroy(), this.buttonGroup?.destroy(), this.engine?.destroy(), this.dialog?.destroy(), this.rightKey?.destroy(), this.measure?.destroy(), this.sectionPlane?.destroy(), this.sectionAxis?.destroy(), this.sectionBox?.destroy(), this.walkControl?.destroy(), this.container.innerHTML = "", Tt.reset(); } } const WT = () => ({ @@ -49321,10 +49375,10 @@ const WT = () => ({ groupId: "group-1", type: "button", label: "toolbar.home", - icon: Pt("主视角"), + icon: Bt("主视角"), keepActive: !1, onClick: (s) => { - console.log("首页按钮被点击:", s.id), wt.getInstance().engine3d?.CameraGoHome(); + console.log("首页按钮被点击:", s.id), Tt.getInstance().engine3d?.CameraGoHome(); } }), XT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, @@ -49335,93 +49389,72 @@ const WT = () => ({ keepActive: !1, type: "button", label: "toolbar.zoomBox", - icon: Pt("框选放大"), + icon: Bt("框选放大"), onClick: () => { - wt.getInstance().engine3d?.activateZoomBox(); + Tt.getInstance().engine3d?.activateZoomBox(); } -}), qT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), ZT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, createZoomBoxButton: jT -}, Symbol.toStringTag, { value: "Module" })), ZT = () => ({ +}, Symbol.toStringTag, { value: "Module" })), qT = () => ({ id: "walk", groupId: "group-1", type: "button", label: "toolbar.walk", align: "vertical", - icon: Pt("漫游"), + icon: Bt("漫游"), onClick: () => { - console.log("漫游按钮被点击"), wt.getInstance().walkControl?.show(); + console.log("漫游按钮被点击"), Tt.getInstance().walkControl?.show(); } }), YT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createWalkMenuButton: ZT -}, Symbol.toStringTag, { value: "Module" })), KT = () => { - const s = wt.getInstance(); - return s.on("map:opened", () => { - s.toolbar?.setBtnActive("map", !0); - }), s.on("map:closed", () => { - s.toolbar?.setBtnActive("map", !1); - }), { - id: "map", - groupId: "group-1", - type: "button", - label: "toolbar.map", - align: "vertical", - keepActive: !0, - icon: Pt("地图"), - onClick: () => { - s.map?.isOpen() ? s.map?.hide() : s.map?.show(); - } - }; -}, $T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - createMapButton: KT -}, Symbol.toStringTag, { value: "Module" })), JT = () => ({ + createWalkMenuButton: qT +}, Symbol.toStringTag, { value: "Module" })), KT = () => ({ id: "property", groupId: "group-1", type: "button", label: "toolbar.property", align: "vertical", - icon: Pt("文档"), + icon: Bt("文档"), onClick: () => { - console.log("构件详情按钮被点击"), wt.getInstance().componentDetail?.show(); + console.log("构件详情按钮被点击"), Tt.getInstance().componentDetail?.show(); } -}), QT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), $T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createPropertyButton: JT -}, Symbol.toStringTag, { value: "Module" })), eA = () => ({ + createPropertyButton: KT +}, Symbol.toStringTag, { value: "Module" })), JT = () => ({ id: "setting", groupId: "group-2", type: "button", label: "toolbar.setting", - icon: Pt("设置"), + icon: Bt("设置"), keepActive: !1, onClick: (s) => { console.log("设置按钮被点击:", s.id); } -}), tA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), QT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createSettingButton: eA -}, Symbol.toStringTag, { value: "Module" })), nA = () => ({ + createSettingButton: JT +}, Symbol.toStringTag, { value: "Module" })), eA = () => ({ id: "info", groupId: "group-2", type: "button", label: "toolbar.info", - icon: Pt("信息"), + icon: Bt("信息"), keepActive: !1, onClick: () => { - wt.getInstance().emit("ui:open-dialog", { id: "info" }); + Tt.getInstance().emit("ui:open-dialog", { id: "info" }); } -}), iA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), tA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createInfoButton: nA -}, Symbol.toStringTag, { value: "Module" })), sA = () => ({ + createInfoButton: eA +}, Symbol.toStringTag, { value: "Module" })), nA = () => ({ id: "fullscreen", groupId: "group-2", type: "button", label: "toolbar.fullscreen", align: "vertical", - icon: Pt("全屏"), + icon: Bt("全屏"), onClick: async () => { console.log("全屏按钮被点击"), window.self !== window.top && console.warn('检测到在 Iframe 中运行,请确保父级 iframe 标签拥有 allow="fullscreen" 属性'); try { @@ -49441,38 +49474,38 @@ const WT = () => ({ console.error("全屏操作失败:", e), e && e.message && e.message.includes("denied") && console.error('全屏请求被拒绝。如果是 Iframe,请检查 allow="fullscreen"。如果是自动触发,请确保由用户点击触发。'); } } -}), rA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), iA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createFullscreenButton: sA -}, Symbol.toStringTag, { value: "Module" })), oA = () => ({ + createFullscreenButton: nA +}, Symbol.toStringTag, { value: "Module" })), sA = () => ({ id: "measure", groupId: "group-1", type: "button", label: "toolbar.measure", - icon: Pt("测量"), + icon: Bt("测量"), keepActive: !0, onClick: (s) => { - const e = wt.getInstance(); + const e = Tt.getInstance(); s.isActive ? e.measure?.show() : e.measure?.destroy(); } -}), aA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), rA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createMeasureButton: oA -}, Symbol.toStringTag, { value: "Module" })), lA = () => ({ + createMeasureButton: sA +}, Symbol.toStringTag, { value: "Module" })), oA = () => ({ id: "section", groupId: "group-1", type: "menu", label: "toolbar.section", align: "vertical", - icon: Pt("剖切"), + icon: Bt("剖切"), keepActive: !0, onClick: (s) => { console.log("剖切按钮被点击:", s.id); } -}), cA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), aA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createSectionMenuButton: lA -}, Symbol.toStringTag, { value: "Module" })), hA = () => ({ + createSectionMenuButton: oA +}, Symbol.toStringTag, { value: "Module" })), lA = () => ({ id: "section-plane", groupId: "group-1", parentId: "section", @@ -49481,16 +49514,16 @@ const WT = () => ({ exclusive: !0, align: "vertical", label: "toolbar.sectionPlane", - icon: Pt("拾曲面剖切"), + icon: Bt("拾曲面剖切"), onClick: (s) => { console.log("拾取面剖切被点击:", s.id, "激活状态:", s.isActive); - const e = wt.getInstance(); + const e = Tt.getInstance(); s.isActive ? e.sectionPlane?.show() : e.sectionPlane?.hide(); } -}), uA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), cA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createSectionPlaneButton: hA -}, Symbol.toStringTag, { value: "Module" })), dA = () => ({ + createSectionPlaneButton: lA +}, Symbol.toStringTag, { value: "Module" })), hA = () => ({ id: "section-axis", groupId: "group-1", parentId: "section", @@ -49499,15 +49532,15 @@ const WT = () => ({ exclusive: !0, align: "vertical", label: "toolbar.sectionAxis", - icon: Pt("轴向剖切"), + icon: Bt("轴向剖切"), onClick: (s) => { - const e = wt.getInstance(); + const e = Tt.getInstance(); s.isActive ? e.sectionAxis?.show() : e.sectionAxis?.destroy(); } -}), fA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), uA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createSectionAxisButton: dA -}, Symbol.toStringTag, { value: "Module" })), pA = () => ({ + createSectionAxisButton: hA +}, Symbol.toStringTag, { value: "Module" })), dA = () => ({ id: "section-box", groupId: "group-1", parentId: "section", @@ -49516,16 +49549,16 @@ const WT = () => ({ exclusive: !0, align: "vertical", label: "toolbar.sectionBox", - icon: Pt("剖切盒"), + icon: Bt("剖切盒"), onClick: (s) => { console.log("剖切盒被点击:", s.id, "激活状态:", s.isActive); - const e = wt.getInstance(); + const e = Tt.getInstance(); s.isActive ? e.sectionBox?.show() : e.sectionBox?.hide(); } -}), mA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +}), fA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - createSectionBoxButton: pA -}, Symbol.toStringTag, { value: "Module" })), gA = `# BIM引擎AI助手 - 需求分析与步骤规划专家 + createSectionBoxButton: dA +}, Symbol.toStringTag, { value: "Module" })), pA = `# BIM引擎AI助手 - 需求分析与步骤规划专家 ## 角色定位 @@ -49695,10 +49728,10 @@ json内容 5. **用户友好**:步骤描述要清晰易懂,便于用户理解整个执行流程 -''`, xA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +''`, mA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - default: gA -}, Symbol.toStringTag, { value: "Module" })), vA = `# BIM引擎AI助手 - 代码生成专家 + default: pA +}, Symbol.toStringTag, { value: "Module" })), gA = `# BIM引擎AI助手 - 代码生成专家 ## 角色定位 @@ -49944,10 +49977,10 @@ try { 5. **代码可读性**:优先保证代码的可读性,而不是追求"高级"写法 6. **注释清晰**:关键逻辑要有注释,但不要过度注释 7. **性能考虑**:对于大量数据的处理,考虑性能优化 -8. **测试友好**:生成的代码应该便于测试和调试 `, bA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +8. **测试友好**:生成的代码应该便于测试和调试 `, xA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - default: vA -}, Symbol.toStringTag, { value: "Module" })), yA = `# BIM Engine SDK API 文档 + default: gA +}, Symbol.toStringTag, { value: "Module" })), vA = `# BIM Engine SDK API 文档 本文档为 BIM Engine SDK 的完整 API 参考,适合大模型阅读和理解引擎的功能结构。 @@ -51451,11 +51484,11 @@ BIM Engine SDK 提供了完整的 3D BIM 模型渲染和交互能力,主要特 - 施工模拟 - 运维管理 - AI 辅助设计 -`, _A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ +`, bA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - default: yA + default: vA }, Symbol.toStringTag, { value: "Module" })); export { - OA as BimEngine + UA as BimEngine }; //# sourceMappingURL=iflow-engine.es.js.map