Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
milady
nirholasfdece48976fc
diff --git a/api/_lib/avatars.js b/api/_lib/avatars.jsindex bc9337383..a3bbff92f 100644--- a/api/_lib/avatars.js+++ b/api/_lib/avatars.js@@ -53,12 +53,13 @@ export async function createAvatar({ userId, input, storageKey }) {const [row] = await sql`insert into avatars (owner_id, slug, name, description, storage_key, size_bytes, content_type,- source, source_meta, visibility, tags, checksum_sha256+ source, source_meta, visibility, tags, checksum_sha256, parent_avatar_id) values (${userId}, ${finalSlug}, ${input.name}, ${input.description ?? null},${storageKey}, ${input.size_bytes}, ${input.content_type},${input.source}, ${JSON.stringify(input.source_meta)}::jsonb,- ${input.visibility}, ${input.tags}, ${input.checksum_sha256 ?? null}+ ${input.visibility}, ${input.tags}, ${input.checksum_sha256 ?? null},+ ${input.parent_avatar_id ?? null}) returning *`;return decorate(row);@@ -179,6 +180,7 @@ function decorate(row) {model_url: row.visibility === 'public' || row.visibility === 'unlisted'? publicUrl(row.storage_key): null,+ parent_avatar_id: row.parent_avatar_id || null,thumbnail_url: row.thumbnail_key ? publicUrl(row.thumbnail_key) : null,};}diff --git a/api/_lib/validate.js b/api/_lib/validate.jsindex 2b20b465a..18ce2fc6c 100644--- a/api/_lib/validate.js+++ b/api/_lib/validate.js@@ -39,7 +39,8 @@ export const createAvatarBody = z.object({description: z.string().trim().max(2000).optional(),visibility: avatarVisibility.default('private'),tags: z.array(z.string().trim().min(1).max(40)).max(20).default([]),- source: z.enum(['upload', 'avaturn', 'import']).default('upload'),+ source: z.enum(['upload', 'avaturn', 'import', 'direct-upload']).default('upload'),+ parent_avatar_id: z.string().uuid().optional(),source_meta: z.record(z.any()).default({}),content_type: avatarContentType.default('model/gltf-binary'),size_bytes: z.number().int().positive().max(500 * 1024 * 1024),diff --git a/api/avatars/index.js b/api/avatars/index.jsindex d892f9c07..eacb794ca 100644--- a/api/avatars/index.js+++ b/api/avatars/index.js@@ -4,6 +4,7 @@import { getSessionUser, authenticateBearer, extractBearer, hasScope } from '../_lib/auth.js';import { listAvatars, createAvatar } from '../_lib/avatars.js';import { headObject } from '../_lib/r2.js';+import { sql } from '../_lib/db.js';import { cors, json, method, readJson, wrap, error } from '../_lib/http.js';import { parse, createAvatarBody } from '../_lib/validate.js';import { recordEvent } from '../_lib/usage.js';@@ -55,11 +56,34 @@ async function handleCreate(req, res) {return error(res, 400, 'size_mismatch', 'size_bytes does not match uploaded object');}+ // Validate parent_avatar_id ownership — prevents user B from pointing at user A's avatar chain.+ if (body.parent_avatar_id) {+ const rows = await sql`+ select 1 from avatars+ where id = ${body.parent_avatar_id} and owner_id = ${auth.userId} and deleted_at is null+ limit 1+ `;+ if (!rows[0]) return error(res, 404, 'not_found', 'parent_avatar_id not found');+ }+const avatar = await createAvatar({userId: auth.userId,input: body,storageKey: body.storage_key,});++ // Re-point any agent identity that currently uses the parent avatar.+ // agentId, wallet_address, chain_id, and erc8004_agent_id are unchanged.+ if (body.parent_avatar_id) {+ await sql`+ update agent_identities+ set avatar_id = ${avatar.id}+ where user_id = ${auth.userId}+ and avatar_id = ${body.parent_avatar_id}+ and deleted_at is null+ `;+ }+recordEvent({userId: auth.userId,apiKeyId: auth.apiKeyId,diff --git a/dist-lib/agent-3d.js b/dist-lib/agent-3d.jsindex 3adf2da14..d3222e73c 100644--- a/dist-lib/agent-3d.js+++ b/dist-lib/agent-3d.js@@ -1,5 +1,5 @@-const oa = { ROTATE: 0, DOLLY: 1, PAN: 2 }, $r = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, jx = 0, Zf = 1, Jx = 2, _m = 1, Zx = 2, qi = 3, hs = 0, Ln = 1, Bi = 2, Fs = 0, ca = 1, $f = 2, ep = 3, tp = 4, $x = 5, ir = 100, eE = 101, tE = 102, nE = 103, iE = 104, sE = 200, rE = 201, aE = 202, oE = 203, Iu = 204, Mu = 205, cE = 206, lE = 207, hE = 208, uE = 209, dE = 210, fE = 211, pE = 212, AE = 213, gE = 214, Bu = 0, Tu = 1, Ru = 2, ma = 3, Nu = 4, Fu = 5, Du = 6, Lu = 7, ym = 0, mE = 1, bE = 2, Ds = 0, Pu = 1, xE = 2, EE = 3, wm = 4, _E = 5, yE = 6, wE = 7, np = "attached", CE = "detached", Cm = 300, gr = 301, ba = 302, ku = 303, Uu = 304, Pl = 306, xa = 1e3, bi = 1001, hl = 1002, Pn = 1003, vm = 1004, ro = 1005, qt = 1006, el = 1007, ni = 1008, rn = 1009, Sm = 1010, Im = 1011, wo = 1012, Zd = 1013, mr = 1014, an = 1015, Rn = 1016, $d = 1017, ef = 1018, Co = 1020, Mm = 35902, Bm = 1021, Tm = 1022, on = 1023, vo = 1026, So = 1027, ts = 1028, tf = 1029, cr = 1030, nf = 1031, sf = 1033, tl = 33776, uo = 33777, nl = 33778, fo = 33779, ul = 35840, Ou = 35841, dl = 35842, Qu = 35843, fl = 36196, pl = 37492, Al = 37496, Io = 37808, Gu = 37809, Hu = 37810, zu = 37811, Mo = 37812, Vu = 37813, Wu = 37814, qu = 37815, Ku = 37816, Xu = 37817, Yu = 37818, ju = 37819, Ju = 37820, Zu = 37821, po = 36492, $u = 36494, gl = 36495, Rm = 36283, ed = 36284, td = 36285, nd = 36286, Nm = 2200, Fm = 2201, vE = 2202, Bo = 2300, To = 2301, ah = 2302, ea = 2400, ta = 2401, ml = 2402, rf = 2500, SE = 2501, IE = 0, Dm = 1, id = 2, ME = 3200, BE = 3201, Lm = 0, TE = 1, pi = "", Kt = "srgb", ln = "srgb-linear", bl = "linear", Mt = "srgb", Rr = 7680, ip = 519, RE = 512, NE = 513, FE = 514, Pm = 515, DE = 516, LE = 517, PE = 518, kE = 519, sd = 35044, sp = "300 es", ns = 2e3, xl = 2001;-class Qs {+const la = { ROTATE: 0, DOLLY: 1, PAN: 2 }, ta = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, sE = 0, sp = 1, rE = 2, Mm = 1, aE = 2, Ki = 3, us = 0, Ln = 1, Ti = 2, Ds = 0, ha = 1, rp = 2, ap = 3, op = 4, oE = 5, rr = 100, cE = 101, lE = 102, hE = 103, uE = 104, dE = 200, fE = 201, pE = 202, AE = 203, Fu = 204, Du = 205, gE = 206, mE = 207, bE = 208, xE = 209, EE = 210, _E = 211, yE = 212, wE = 213, vE = 214, Lu = 0, Pu = 1, ku = 2, _a = 3, Uu = 4, Ou = 5, Qu = 6, Gu = 7, Bm = 0, CE = 1, SE = 2, Ls = 0, Hu = 1, IE = 2, ME = 3, Tm = 4, BE = 5, TE = 6, RE = 7, cp = "attached", NE = "detached", Rm = 300, br = 301, ya = 302, zu = 303, Vu = 304, Gl = 306, wa = 1e3, xi = 1001, Al = 1002, Pn = 1003, Nm = 1004, lo = 1005, qt = 1006, rl = 1007, ii = 1008, rn = 1009, Fm = 1010, Dm = 1011, Io = 1012, rf = 1013, xr = 1014, an = 1015, Rn = 1016, af = 1017, of = 1018, Mo = 1020, Lm = 35902, Pm = 1021, km = 1022, on = 1023, Bo = 1026, To = 1027, ns = 1028, cf = 1029, hr = 1030, lf = 1031, hf = 1033, al = 33776, go = 33777, ol = 33778, mo = 33779, gl = 35840, Wu = 35841, ml = 35842, qu = 35843, bl = 36196, xl = 37492, El = 37496, Ro = 37808, Ku = 37809, ju = 37810, Xu = 37811, No = 37812, Yu = 37813, Ju = 37814, Zu = 37815, $u = 37816, ed = 37817, td = 37818, nd = 37819, id = 37820, sd = 37821, bo = 36492, rd = 36494, _l = 36495, Um = 36283, ad = 36284, od = 36285, cd = 36286, Om = 2200, Qm = 2201, FE = 2202, Fo = 2300, Do = 2301, dh = 2302, na = 2400, ia = 2401, yl = 2402, uf = 2500, DE = 2501, LE = 0, Gm = 1, ld = 2, PE = 3200, kE = 3201, Hm = 0, UE = 1, Ai = "", Kt = "srgb", ln = "srgb-linear", wl = "linear", Mt = "srgb", Fr = 7680, lp = 519, OE = 512, QE = 513, GE = 514, zm = 515, HE = 516, zE = 517, VE = 518, WE = 519, hd = 35044, hp = "300 es", is = 2e3, vl = 2001;+class Hs {/*** Adds the given event listener to the given event type.*@@ -56,69 +56,69 @@ class Qs {}}const yn = ["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 rp = 1234567;-const Ao = Math.PI / 180, Ea = 180 / Math.PI;-function xi() {+let up = 1234567;+const xo = Math.PI / 180, va = 180 / Math.PI;+function Ei() {const i = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0;return (yn[i & 255] + yn[i >> 8 & 255] + yn[i >> 16 & 255] + yn[i >> 24 & 255] + "-" + yn[e & 255] + yn[e >> 8 & 255] + "-" + yn[e >> 16 & 15 | 64] + yn[e >> 24 & 255] + "-" + yn[t & 63 | 128] + yn[t >> 8 & 255] + "-" + yn[t >> 16 & 255] + yn[t >> 24 & 255] + yn[n & 255] + yn[n >> 8 & 255] + yn[n >> 16 & 255] + yn[n >> 24 & 255]).toLowerCase();}function ct(i, e, t) {return Math.max(e, Math.min(t, i));}-function af(i, e) {+function df(i, e) {return (i % e + e) % e;}-function UE(i, e, t, n, s) {+function qE(i, e, t, n, s) {return n + (i - e) * (s - n) / (t - e);}-function OE(i, e, t) {+function KE(i, e, t) {return i !== e ? (t - i) / (e - i) : 0;}-function go(i, e, t) {+function Eo(i, e, t) {return (1 - t) * i + t * e;}-function QE(i, e, t, n) {- return go(i, e, 1 - Math.exp(-t * n));+function jE(i, e, t, n) {+ return Eo(i, e, 1 - Math.exp(-t * n));}-function GE(i, e = 1) {- return e - Math.abs(af(i, e * 2) - e);+function XE(i, e = 1) {+ return e - Math.abs(df(i, e * 2) - e);}-function HE(i, e, t) {+function YE(i, e, t) {return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * (3 - 2 * i));}-function zE(i, e, t) {+function JE(i, e, t) {return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * i * (i * (i * 6 - 15) + 10));}-function VE(i, e) {+function ZE(i, e) {return i + Math.floor(Math.random() * (e - i + 1));}-function WE(i, e) {+function $E(i, e) {return i + Math.random() * (e - i);}-function qE(i) {+function e_(i) {return i * (0.5 - Math.random());}-function KE(i) {- i !== void 0 && (rp = i);- let e = rp += 1831565813;+function t_(i) {+ i !== void 0 && (up = i);+ let e = up += 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 XE(i) {- return i * Ao;+function n_(i) {+ return i * xo;}-function YE(i) {- return i * Ea;+function i_(i) {+ return i * va;}-function jE(i) {+function s_(i) {return (i & i - 1) === 0 && i !== 0;}-function JE(i) {+function r_(i) {return Math.pow(2, Math.ceil(Math.log(i) / Math.LN2));}-function ZE(i) {+function a_(i) {return Math.pow(2, Math.floor(Math.log(i) / Math.LN2));}-function $E(i, e, t, n, s) {+function o_(i, e, t, n, s) {const r = Math.cos, a = Math.sin, o = r(t / 2), c = a(t / 2), l = r((e + n) / 2), h = a((e + n) / 2), u = r((e - n) / 2), d = a((e - n) / 2), f = r((n - e) / 2), m = a((n - e) / 2);switch (s) {case "XYX":@@ -143,7 +143,7 @@ function $E(i, e, t, n, s) {console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + s);}}-function Ai(i, e) {+function gi(i, e) {switch (e.constructor) {case Float32Array:return i;@@ -183,9 +183,9 @@ function It(i, e) {throw new Error("Invalid component type.");}}-const km = {- DEG2RAD: Ao,- RAD2DEG: Ea,+const Vm = {+ DEG2RAD: xo,+ RAD2DEG: va,/*** Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}* (universally unique identifier).@@ -194,7 +194,7 @@ const km = {* @method* @return {string} The UUID.*/- generateUUID: xi,+ generateUUID: Ei,/*** Clamps the given value between min and max.*@@ -216,7 +216,7 @@ const km = {* @param {number} m - The second parameter.* @return {number} The Euclidean modulo.*/- euclideanModulo: af,+ euclideanModulo: df,/*** Performs a linear mapping from range `<a1, a2>` to range `<b1, b2>`* for the given value.@@ -230,7 +230,7 @@ const km = {* @param {number} b2 - Maximum value for range B.* @return {number} The mapped value.*/- mapLinear: UE,+ mapLinear: qE,/*** Returns the percentage in the closed interval `[0, 1]` of the given value* between the start and end point.@@ -242,7 +242,7 @@ const km = {* @param {number} value - A value between start and end.* @return {number} The interpolation factor.*/- inverseLerp: OE,+ inverseLerp: KE,/*** Returns a value linearly interpolated from two known points based on the given interval -* `t = 0` will return `x` and `t = 1` will return `y`.@@ -254,7 +254,7 @@ const km = {* @param {number} t - The interpolation factor in the closed interval `[0, 1]`.* @return {number} The interpolated value.*/- lerp: go,+ lerp: Eo,/*** 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@@ -269,7 +269,7 @@ const km = {* @param {number} dt - Delta time in seconds.* @return {number} The interpolated value.*/- damp: QE,+ damp: jE,/*** Returns a value that alternates between `0` and the given `length` parameter.*@@ -279,7 +279,7 @@ const km = {* @param {number} [length=1] - The positive value the function will pingpong to.* @return {number} The alternated value.*/- pingpong: GE,+ pingpong: XE,/*** 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@@ -294,7 +294,7 @@ const km = {* @param {number} max - The max value. Any x value above max will be `1`.* @return {number} The alternated value.*/- smoothstep: HE,+ smoothstep: YE,/*** A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}* that has zero 1st and 2nd order derivatives at x=0 and x=1.@@ -306,7 +306,7 @@ const km = {* @param {number} max - The max value. Any x value above max will be `1`.* @return {number} The alternated value.*/- smootherstep: zE,+ smootherstep: JE,/*** Returns a random integer from `<low, high>` interval.*@@ -316,7 +316,7 @@ const km = {* @param {number} high - The upper value boundary* @return {number} A random integer.*/- randInt: VE,+ randInt: ZE,/*** Returns a random float from `<low, high>` interval.*@@ -326,7 +326,7 @@ const km = {* @param {number} high - The upper value boundary* @return {number} A random float.*/- randFloat: WE,+ randFloat: $E,/*** Returns a random integer from `<-range/2, range/2>` interval.*@@ -335,7 +335,7 @@ const km = {* @param {number} range - Defines the value range.* @return {number} A random float.*/- randFloatSpread: qE,+ randFloatSpread: e_,/*** Returns a deterministic pseudo-random float in the interval `[0, 1]`.*@@ -344,7 +344,7 @@ const km = {* @param {number} [s] - The integer seed.* @return {number} A random float.*/- seededRandom: KE,+ seededRandom: t_,/*** Converts degrees to radians.*@@ -353,7 +353,7 @@ const km = {* @param {number} degrees - A value in degrees.* @return {number} The converted value in radians.*/- degToRad: XE,+ degToRad: n_,/*** Converts radians to degrees.*@@ -362,7 +362,7 @@ const km = {* @param {number} radians - A value in radians.* @return {number} The converted value in degrees.*/- radToDeg: YE,+ radToDeg: i_,/*** Returns `true` if the given number is a power of two.*@@ -371,7 +371,7 @@ const km = {* @param {number} value - The value to check.* @return {boolean} Whether the given number is a power of two or not.*/- isPowerOfTwo: jE,+ isPowerOfTwo: s_,/*** Returns the smallest power of two that is greater than or equal to the given number.*@@ -380,7 +380,7 @@ const km = {* @param {number} value - The value to find a POT for.* @return {number} The smallest power of two that is greater than or equal to the given number.*/- ceilPowerOfTwo: JE,+ ceilPowerOfTwo: r_,/*** Returns the largest power of two that is less than or equal to the given number.*@@ -389,7 +389,7 @@ const km = {* @param {number} value - The value to find a POT for.* @return {number} The largest power of two that is less than or equal to the given number.*/- floorPowerOfTwo: ZE,+ floorPowerOfTwo: a_,/*** Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}* defined by the given angles and order.@@ -405,7 +405,7 @@ const km = {* @param {number} c - The rotation applied to the third axis, in radians.* @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.*/- setQuaternionFromProperEuler: $E,+ setQuaternionFromProperEuler: o_,/*** Normalizes the given value according to the given typed array.*@@ -425,7 +425,7 @@ const km = {* @param {TypedArray} array - The typed array that defines the data type of the value.* @return {number} The denormalize (float) value in the range `[0,1]`.*/- denormalize: Ai+ denormalize: gi};class Ze {/**@@ -1199,7 +1199,7 @@ class rt {* @return {Matrix3} A reference to this matrix.*/scale(e, t) {- return this.premultiply(oh.makeScale(e, t)), this;+ return this.premultiply(fh.makeScale(e, t)), this;}/*** Rotates this matrix by the given angle.@@ -1208,7 +1208,7 @@ class rt {* @return {Matrix3} A reference to this matrix.*/rotate(e) {- return this.premultiply(oh.makeRotation(-e)), this;+ return this.premultiply(fh.makeRotation(-e)), this;}/*** Translates this matrix by the given scalar values.@@ -1218,7 +1218,7 @@ class rt {* @return {Matrix3} A reference to this matrix.*/translate(e, t) {- return this.premultiply(oh.makeTranslation(e, t)), this;+ return this.premultiply(fh.makeTranslation(e, t)), this;}// for 2D Transforms/**@@ -1336,24 +1336,24 @@ class rt {return new this.constructor().fromArray(this.elements);}}-const oh = /* @__PURE__ */ new rt();-function Um(i) {+const fh = /* @__PURE__ */ new rt();+function Wm(i) {for (let e = i.length - 1; e >= 0; --e)if (i[e] >= 65535) return !0;return !1;}-function Ro(i) {+function Lo(i) {return document.createElementNS("http://www.w3.org/1999/xhtml", i);}-function e_() {- const i = Ro("canvas");+function c_() {+ const i = Lo("canvas");return i.style.display = "block", i;}-const ap = {};-function il(i) {- i in ap || (ap[i] = !0, console.warn(i));+const dp = {};+function cl(i) {+ i in dp || (dp[i] = !0, console.warn(i));}-function t_(i, e, t) {+function l_(i, e, t) {return new Promise(function(n, s) {function r() {switch (i.clientWaitSync(e, i.SYNC_FLUSH_COMMANDS_BIT, 0)) {@@ -1370,15 +1370,15 @@ function t_(i, e, t) {setTimeout(r, t);});}-function n_(i) {+function h_(i) {const e = i.elements;e[2] = 0.5 * e[2] + 0.5 * e[3], e[6] = 0.5 * e[6] + 0.5 * e[7], e[10] = 0.5 * e[10] + 0.5 * e[11], e[14] = 0.5 * e[14] + 0.5 * e[15];}-function i_(i) {+function u_(i) {const e = i.elements;e[11] === -1 ? (e[10] = -e[10] - 1, e[14] = -e[14]) : (e[10] = -e[10], e[14] = -e[14] + 1);}-const op = /* @__PURE__ */ new rt().set(+const fp = /* @__PURE__ */ new rt().set(0.4123908,0.3575843,0.1804808,@@ -1388,7 +1388,7 @@ const op = /* @__PURE__ */ new rt().set(0.0193308,0.1191948,0.9505322-), cp = /* @__PURE__ */ new rt().set(+), pp = /* @__PURE__ */ new rt().set(3.2409699,-1.5373832,-0.4986108,@@ -1399,7 +1399,7 @@ const op = /* @__PURE__ */ new rt().set(-0.203977,1.0569715);-function s_() {+function d_() {const i = {enabled: !0,workingColorSpace: ln,@@ -1423,7 +1423,7 @@ function s_() {*/spaces: {},convert: function(s, r, a) {- return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === Mt && (s.r = as(s.r), s.g = as(s.g), s.b = as(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === Mt && (s.r = la(s.r), s.g = la(s.g), s.b = la(s.b))), s;+ return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === Mt && (s.r = os(s.r), s.g = os(s.g), s.b = os(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === Mt && (s.r = ua(s.r), s.g = ua(s.g), s.b = ua(s.b))), s;},fromWorkingColorSpace: function(s, r) {return this.convert(s, this.workingColorSpace, r);@@ -1435,7 +1435,7 @@ function s_() {return this.spaces[s].primaries;},getTransfer: function(s) {- return s === pi ? bl : this.spaces[s].transfer;+ return s === Ai ? wl : this.spaces[s].transfer;},getLuminanceCoefficients: function(s, r = this.workingColorSpace) {return s.fromArray(this.spaces[r].luminanceCoefficients);@@ -1458,9 +1458,9 @@ function s_() {[ln]: {primaries: e,whitePoint: n,- transfer: bl,- toXYZ: op,- fromXYZ: cp,+ transfer: wl,+ toXYZ: fp,+ fromXYZ: pp,luminanceCoefficients: t,workingColorSpaceConfig: { unpackColorSpace: Kt },outputColorSpaceConfig: { drawingBufferColorSpace: Kt }@@ -1469,22 +1469,22 @@ function s_() {primaries: e,whitePoint: n,transfer: Mt,- toXYZ: op,- fromXYZ: cp,+ toXYZ: fp,+ fromXYZ: pp,luminanceCoefficients: t,outputColorSpaceConfig: { drawingBufferColorSpace: Kt }}}), i;}-const mt = /* @__PURE__ */ s_();-function as(i) {+const mt = /* @__PURE__ */ d_();+function os(i) {return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4);}-function la(i) {+function ua(i) {return i < 31308e-7 ? i * 12.92 : 1.055 * Math.pow(i, 0.41666) - 0.055;}-let Nr;-class r_ {+let Dr;+class f_ {/*** Returns a data URI containing a representation of the given image.*@@ -1499,9 +1499,9 @@ class r_ {if (e instanceof HTMLCanvasElement)n = e;else {- Nr === void 0 && (Nr = Ro("canvas")), Nr.width = e.width, Nr.height = e.height;- const s = Nr.getContext("2d");- e instanceof ImageData ? s.putImageData(e, 0, 0) : s.drawImage(e, 0, 0, e.width, e.height), n = Nr;+ Dr === void 0 && (Dr = Lo("canvas")), Dr.width = e.width, Dr.height = e.height;+ const s = Dr.getContext("2d");+ e instanceof ImageData ? s.putImageData(e, 0, 0) : s.drawImage(e, 0, 0, e.width, e.height), n = Dr;}return n.toDataURL(t);}@@ -1513,18 +1513,18 @@ class r_ {*/static sRGBToLinear(e) {if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap) {- const t = Ro("canvas");+ const t = Lo("canvas");t.width = e.width, t.height = e.height;const n = t.getContext("2d");n.drawImage(e, 0, 0, e.width, e.height);const s = n.getImageData(0, 0, e.width, e.height), r = s.data;for (let a = 0; a < r.length; a++)- r[a] = as(r[a] / 255) * 255;+ r[a] = os(r[a] / 255) * 255;return n.putImageData(s, 0, 0), t;} else if (e.data) {const t = e.data.slice(0);for (let n = 0; n < t.length; n++)- t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(as(t[n] / 255) * 255) : t[n] = as(t[n]);+ t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(os(t[n] / 255) * 255) : t[n] = os(t[n]);return {data: t,width: e.width,@@ -1534,15 +1534,15 @@ class r_ {return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."), e;}}-let a_ = 0;-class of {+let p_ = 0;+class ff {/*** 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: a_++ }), this.uuid = xi(), this.data = e, this.dataReady = !0, this.version = 0;+ this.isSource = !0, Object.defineProperty(this, "id", { value: p_++ }), this.uuid = Ei(), this.data = e, this.dataReady = !0, this.version = 0;}/*** When the property is set to `true`, the engine allocates the memory@@ -1576,24 +1576,24 @@ class of {if (Array.isArray(s)) {r = [];for (let a = 0, o = s.length; a < o; a++)- s[a].isDataTexture ? r.push(ch(s[a].image)) : r.push(ch(s[a]));+ s[a].isDataTexture ? r.push(ph(s[a].image)) : r.push(ph(s[a]));} else- r = ch(s);+ r = ph(s);n.url = r;}return t || (e.images[this.uuid] = n), n;}}-function ch(i) {- return typeof HTMLImageElement < "u" && i instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && i instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && i instanceof ImageBitmap ? r_.getDataURL(i) : i.data ? {+function ph(i) {+ return typeof HTMLImageElement < "u" && i instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && i instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && i instanceof ImageBitmap ? f_.getDataURL(i) : i.data ? {data: Array.from(i.data),width: i.width,height: i.height,type: i.data.constructor.name} : (console.warn("THREE.Texture: Unable to serialize Texture."), {});}-let o_ = 0;-class cn extends Qs {+let A_ = 0;+class cn extends Hs {/*** Constructs a new texture.*@@ -1608,8 +1608,8 @@ class cn extends Qs {* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.* @param {string} [colorSpace=NoColorSpace] - The color space.*/- constructor(e = cn.DEFAULT_IMAGE, t = cn.DEFAULT_MAPPING, n = bi, s = bi, r = qt, a = ni, o = on, c = rn, l = cn.DEFAULT_ANISOTROPY, h = pi) {- super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: o_++ }), this.uuid = xi(), this.name = "", this.source = new of(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = s, this.magFilter = r, this.minFilter = a, this.anisotropy = l, this.format = o, this.internalFormat = null, this.type = c, this.offset = new Ze(0, 0), this.repeat = new Ze(1, 1), this.center = new Ze(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new rt(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isTextureArray = !1, this.pmremVersion = 0;+ constructor(e = cn.DEFAULT_IMAGE, t = cn.DEFAULT_MAPPING, n = xi, s = xi, r = qt, a = ii, o = on, c = rn, l = cn.DEFAULT_ANISOTROPY, h = Ai) {+ super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: A_++ }), this.uuid = Ei(), this.name = "", this.source = new ff(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = s, this.magFilter = r, this.minFilter = a, this.anisotropy = l, this.format = o, this.internalFormat = null, this.type = c, this.offset = new Ze(0, 0), this.repeat = new Ze(1, 1), this.center = new Ze(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new rt(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = h, this.userData = {}, this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isTextureArray = !1, this.pmremVersion = 0;}/*** The image object holding the texture data.@@ -1703,28 +1703,28 @@ class cn extends Qs {* @return {Vector2} The transformed uv vector.*/transformUv(e) {- if (this.mapping !== Cm) return e;+ if (this.mapping !== Rm) return e;if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)switch (this.wrapS) {- case xa:+ case wa:e.x = e.x - Math.floor(e.x);break;- case bi:+ case xi:e.x = e.x < 0 ? 0 : 1;break;- case hl:+ case Al:Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x);break;}if (e.y < 0 || e.y > 1)switch (this.wrapT) {- case xa:+ case wa:e.y = e.y - Math.floor(e.y);break;- case bi:+ case xi:e.y = e.y < 0 ? 0 : 1;break;- case hl:+ case Al: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;}@@ -1755,7 +1755,7 @@ class cn extends Qs {}}cn.DEFAULT_IMAGE = null;-cn.DEFAULT_MAPPING = Cm;+cn.DEFAULT_MAPPING = Rm;cn.DEFAULT_ANISOTROPY = 1;class wt {/**@@ -2302,7 +2302,7 @@ class wt {yield this.x, yield this.y, yield this.z, yield this.w;}}-class c_ extends Qs {+class g_ extends Hs {/*** Render target options.*@@ -2418,7 +2418,7 @@ class c_ extends Qs {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 s = Object.assign({}, e.textures[t].image);- this.textures[t].source = new of(s);+ this.textures[t].source = new ff(s);}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;}@@ -2432,7 +2432,7 @@ class c_ extends Qs {this.dispatchEvent({ type: "dispose" });}}-class br extends c_ {+class Er extends g_ {/*** Constructs a new 3D render target.*@@ -2444,7 +2444,7 @@ class br extends c_ {super(e, t, n), this.isWebGLRenderTarget = !0;}}-class Om extends cn {+class qm extends cn {/*** Constructs a new data array texture.*@@ -2454,7 +2454,7 @@ class Om extends cn {* @param {number} [depth=1] - The depth of the texture.*/constructor(e = null, t = 1, n = 1, s = 1) {- super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Pn, this.minFilter = Pn, this.wrapR = bi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();+ super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Pn, this.minFilter = Pn, this.wrapR = xi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();}/*** Describes that a specific layer of the texture needs to be updated.@@ -2475,7 +2475,7 @@ class Om extends cn {this.layerUpdates.clear();}}-class Qm extends cn {+class Km extends cn {/*** Constructs a new data array texture.*@@ -2485,10 +2485,10 @@ class Qm extends cn {* @param {number} [depth=1] - The depth of the texture.*/constructor(e = null, t = 1, n = 1, s = 1) {- super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Pn, this.minFilter = Pn, this.wrapR = bi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;+ super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Pn, this.minFilter = Pn, this.wrapR = xi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;}}-class Yn {+class Xn {/*** Constructs a new quaternion.*@@ -3155,7 +3155,7 @@ class H {* @return {Vector3} A reference to this vector.*/applyEuler(e) {- return this.applyQuaternion(lp.setFromEuler(e));+ return this.applyQuaternion(Ap.setFromEuler(e));}/*** Applies a rotation specified by an axis and an angle to this vector.@@ -3165,7 +3165,7 @@ class H {* @return {Vector3} A reference to this vector.*/applyAxisAngle(e, t) {- return this.applyQuaternion(lp.setFromAxisAngle(e, t));+ return this.applyQuaternion(Ap.setFromAxisAngle(e, t));}/*** Multiplies this vector with the given 3x3 matrix.@@ -3479,7 +3479,7 @@ class H {* @return {Vector3} A reference to this vector.*/projectOnPlane(e) {- return lh.copy(this).projectOnVector(e), this.sub(lh);+ return Ah.copy(this).projectOnVector(e), this.sub(Ah);}/*** Reflects this vector off a plane orthogonal to the given normal vector.@@ -3488,7 +3488,7 @@ class H {* @return {Vector3} A reference to this vector.*/reflect(e) {- return this.sub(lh.copy(e).multiplyScalar(2 * this.dot(e)));+ return this.sub(Ah.copy(e).multiplyScalar(2 * this.dot(e)));}/*** Returns the angle between the given vector and this instance in radians.@@ -3697,8 +3697,8 @@ class H {yield this.x, yield this.y, yield this.z;}}-const lh = /* @__PURE__ */ new H(), lp = /* @__PURE__ */ new Yn();-class Li {+const Ah = /* @__PURE__ */ new H(), Ap = /* @__PURE__ */ new Xn();+class Pi {/*** Constructs a new bounding box.*@@ -3729,7 +3729,7 @@ class Li {setFromArray(e) {this.makeEmpty();for (let t = 0, n = e.length; t < n; t += 3)- this.expandByPoint(ai.fromArray(e, t));+ this.expandByPoint(oi.fromArray(e, t));return this;}/**@@ -3742,7 +3742,7 @@ class Li {setFromBufferAttribute(e) {this.makeEmpty();for (let t = 0, n = e.count; t < n; t++)- this.expandByPoint(ai.fromBufferAttribute(e, t));+ this.expandByPoint(oi.fromBufferAttribute(e, t));return this;}/**@@ -3767,7 +3767,7 @@ class Li {* @return {Box3} A reference to this bounding box.*/setFromCenterAndSize(e, t) {- const n = ai.copy(t).multiplyScalar(0.5);+ const n = oi.copy(t).multiplyScalar(0.5);return this.min.copy(e).sub(n), this.max.copy(e).add(n), this;}/**@@ -3886,9 +3886,9 @@ class Li {const r = n.getAttribute("position");if (t === !0 && r !== void 0 && e.isInstancedMesh !== !0)for (let a = 0, o = r.count; a < o; a++)- e.isMesh === !0 ? e.getVertexPosition(a, ai) : ai.fromBufferAttribute(r, a), ai.applyMatrix4(e.matrixWorld), this.expandByPoint(ai);+ e.isMesh === !0 ? e.getVertexPosition(a, oi) : oi.fromBufferAttribute(r, a), oi.applyMatrix4(e.matrixWorld), this.expandByPoint(oi);else- e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), rc.copy(e.boundingBox)) : (n.boundingBox === null && n.computeBoundingBox(), rc.copy(n.boundingBox)), rc.applyMatrix4(e.matrixWorld), this.union(rc);+ e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), hc.copy(e.boundingBox)) : (n.boundingBox === null && n.computeBoundingBox(), hc.copy(n.boundingBox)), hc.applyMatrix4(e.matrixWorld), this.union(hc);}const s = e.children;for (let r = 0, a = s.length; r < a; r++)@@ -3944,7 +3944,7 @@ class Li {* @return {boolean} Whether the given bounding sphere intersects with this bounding box.*/intersectsSphere(e) {- return this.clampPoint(e.center, ai), ai.distanceToSquared(e.center) <= e.radius * e.radius;+ return this.clampPoint(e.center, oi), oi.distanceToSquared(e.center) <= e.radius * e.radius;}/*** Returns `true` if the given plane intersects with this bounding box.@@ -3965,37 +3965,37 @@ class Li {intersectsTriangle(e) {if (this.isEmpty())return !1;- this.getCenter(za), ac.subVectors(this.max, za), Fr.subVectors(e.a, za), Dr.subVectors(e.b, za), Lr.subVectors(e.c, za), gs.subVectors(Dr, Fr), ms.subVectors(Lr, Dr), Ws.subVectors(Fr, Lr);+ this.getCenter(Ka), uc.subVectors(this.max, Ka), Lr.subVectors(e.a, Ka), Pr.subVectors(e.b, Ka), kr.subVectors(e.c, Ka), ms.subVectors(Pr, Lr), bs.subVectors(kr, Pr), Ks.subVectors(Lr, kr);let t = [- 0,- -gs.z,- gs.y,0,-ms.z,ms.y,0,- -Ws.z,- Ws.y,- gs.z,+ -bs.z,+ bs.y,0,- -gs.x,+ -Ks.z,+ Ks.y,ms.z,0,-ms.x,- Ws.z,+ bs.z,0,- -Ws.x,- -gs.y,- gs.x,+ -bs.x,+ Ks.z,0,+ -Ks.x,-ms.y,ms.x,0,- -Ws.y,- Ws.x,+ -bs.y,+ bs.x,+ 0,+ -Ks.y,+ Ks.x,0];- return !hh(t, Fr, Dr, Lr, ac) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !hh(t, Fr, Dr, Lr, ac)) ? !1 : (oc.crossVectors(gs, ms), t = [oc.x, oc.y, oc.z], hh(t, Fr, Dr, Lr, ac));+ return !gh(t, Lr, Pr, kr, uc) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !gh(t, Lr, Pr, kr, uc)) ? !1 : (dc.crossVectors(ms, bs), t = [dc.x, dc.y, dc.z], gh(t, Lr, Pr, kr, uc));}/*** Clamps the given point within the bounds of this box.@@ -4015,7 +4015,7 @@ class Li {* @return {number} The euclidean distance.*/distanceToPoint(e) {- return this.clampPoint(e, ai).distanceTo(e);+ return this.clampPoint(e, oi).distanceTo(e);}/*** Returns a bounding sphere that encloses this bounding box.@@ -4024,7 +4024,7 @@ class Li {* @return {Sphere} The bounding sphere that encloses this bounding box.*/getBoundingSphere(e) {- return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(ai).length() * 0.5), e;+ return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(oi).length() * 0.5), e;}/*** Computes the intersection of this bounding box and the given one, setting the upper@@ -4056,7 +4056,7 @@ class Li {* @return {Box3} A reference to this bounding box.*/applyMatrix4(e) {- return this.isEmpty() ? this : (Qi[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Qi[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Qi[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Qi[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Qi[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Qi[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Qi[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Qi[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Qi), this);+ return this.isEmpty() ? this : (Gi[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Gi[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Gi[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Gi[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Gi[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Gi[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Gi[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Gi[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Gi), this);}/*** Adds the given offset to both the upper and lower bounds of this bounding box,@@ -4078,7 +4078,7 @@ class Li {return e.min.equals(this.min) && e.max.equals(this.max);}}-const Qi = [+const Gi = [/* @__PURE__ */ new H(),/* @__PURE__ */ new H(),/* @__PURE__ */ new H(),@@ -4087,18 +4087,18 @@ const Qi = [/* @__PURE__ */ new H(),/* @__PURE__ */ new H(),/* @__PURE__ */ new H()-], ai = /* @__PURE__ */ new H(), rc = /* @__PURE__ */ new Li(), Fr = /* @__PURE__ */ new H(), Dr = /* @__PURE__ */ new H(), Lr = /* @__PURE__ */ new H(), gs = /* @__PURE__ */ new H(), ms = /* @__PURE__ */ new H(), Ws = /* @__PURE__ */ new H(), za = /* @__PURE__ */ new H(), ac = /* @__PURE__ */ new H(), oc = /* @__PURE__ */ new H(), qs = /* @__PURE__ */ new H();-function hh(i, e, t, n, s) {+], oi = /* @__PURE__ */ new H(), hc = /* @__PURE__ */ new Pi(), Lr = /* @__PURE__ */ new H(), Pr = /* @__PURE__ */ new H(), kr = /* @__PURE__ */ new H(), ms = /* @__PURE__ */ new H(), bs = /* @__PURE__ */ new H(), Ks = /* @__PURE__ */ new H(), Ka = /* @__PURE__ */ new H(), uc = /* @__PURE__ */ new H(), dc = /* @__PURE__ */ new H(), js = /* @__PURE__ */ new H();+function gh(i, e, t, n, s) {for (let r = 0, a = i.length - 3; r <= a; r += 3) {- qs.fromArray(i, r);- const o = s.x * Math.abs(qs.x) + s.y * Math.abs(qs.y) + s.z * Math.abs(qs.z), c = e.dot(qs), l = t.dot(qs), h = n.dot(qs);+ js.fromArray(i, r);+ const o = s.x * Math.abs(js.x) + s.y * Math.abs(js.y) + s.z * Math.abs(js.z), c = e.dot(js), l = t.dot(js), h = n.dot(js);if (Math.max(-Math.max(c, l, h), Math.min(c, l, h)) > o)return !1;}return !0;}-const l_ = /* @__PURE__ */ new Li(), Va = /* @__PURE__ */ new H(), uh = /* @__PURE__ */ new H();-class Pi {+const m_ = /* @__PURE__ */ new Pi(), ja = /* @__PURE__ */ new H(), mh = /* @__PURE__ */ new H();+class ki {/*** Constructs a new sphere.*@@ -4130,7 +4130,7 @@ class Pi {*/setFromPoints(e, t) {const n = this.center;- t !== void 0 ? n.copy(t) : l_.setFromPoints(e).getCenter(n);+ t !== void 0 ? n.copy(t) : m_.setFromPoints(e).getCenter(n);let s = 0;for (let r = 0, a = e.length; r < a; r++)s = Math.max(s, n.distanceToSquared(e[r]));@@ -4262,11 +4262,11 @@ class Pi {expandByPoint(e) {if (this.isEmpty())return this.center.copy(e), this.radius = 0, this;- Va.subVectors(e, this.center);- const t = Va.lengthSq();+ ja.subVectors(e, this.center);+ const t = ja.lengthSq();if (t > this.radius * this.radius) {const n = Math.sqrt(t), s = (n - this.radius) * 0.5;- this.center.addScaledVector(Va, s / n), this.radius += s;+ this.center.addScaledVector(ja, s / n), this.radius += s;}return this;}@@ -4277,7 +4277,7 @@ class Pi {* @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) : (uh.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(Va.copy(e.center).add(uh)), this.expandByPoint(Va.copy(e.center).sub(uh))), 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) : (mh.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(ja.copy(e.center).add(mh)), this.expandByPoint(ja.copy(e.center).sub(mh))), this);}/*** Returns `true` if this sphere is equal with the given one.@@ -4297,8 +4297,8 @@ class Pi {return new this.constructor().copy(this);}}-const Gi = /* @__PURE__ */ new H(), dh = /* @__PURE__ */ new H(), cc = /* @__PURE__ */ new H(), bs = /* @__PURE__ */ new H(), fh = /* @__PURE__ */ new H(), lc = /* @__PURE__ */ new H(), ph = /* @__PURE__ */ new H();-class zo {+const Hi = /* @__PURE__ */ new H(), bh = /* @__PURE__ */ new H(), fc = /* @__PURE__ */ new H(), xs = /* @__PURE__ */ new H(), xh = /* @__PURE__ */ new H(), pc = /* @__PURE__ */ new H(), Eh = /* @__PURE__ */ new H();+class jo {/*** Constructs a new ray.*@@ -4353,7 +4353,7 @@ class zo {* @return {Ray} A reference to this ray.*/recast(e) {- return this.origin.copy(this.at(e, Gi)), this;+ return this.origin.copy(this.at(e, Hi)), this;}/*** Returns the point along this ray that is closest to the given point.@@ -4383,8 +4383,8 @@ class zo {* @return {number} The squared distance.*/distanceSqToPoint(e) {- const t = Gi.subVectors(e, this.origin).dot(this.direction);- return t < 0 ? this.origin.distanceToSquared(e) : (Gi.copy(this.origin).addScaledVector(this.direction, t), Gi.distanceToSquared(e));+ const t = Hi.subVectors(e, this.origin).dot(this.direction);+ return t < 0 ? this.origin.distanceToSquared(e) : (Hi.copy(this.origin).addScaledVector(this.direction, t), Hi.distanceToSquared(e));}/*** Returns the squared distance between this ray and the given line segment.@@ -4396,8 +4396,8 @@ class zo {* @return {number} The squared distance.*/distanceSqToSegment(e, t, n, s) {- dh.copy(e).add(t).multiplyScalar(0.5), cc.copy(t).sub(e).normalize(), bs.copy(this.origin).sub(dh);- const r = e.distanceTo(t) * 0.5, a = -this.direction.dot(cc), o = bs.dot(this.direction), c = -bs.dot(cc), l = bs.lengthSq(), h = Math.abs(1 - a * a);+ bh.copy(e).add(t).multiplyScalar(0.5), fc.copy(t).sub(e).normalize(), xs.copy(this.origin).sub(bh);+ const r = e.distanceTo(t) * 0.5, a = -this.direction.dot(fc), o = xs.dot(this.direction), c = -xs.dot(fc), l = xs.lengthSq(), h = Math.abs(1 - a * a);let u, d, f, m;if (h > 0)if (u = a * c - o, d = a * o - c, m = r * h, u >= 0)@@ -4413,7 +4413,7 @@ class zo {d <= -m ? (u = Math.max(0, -(-a * r + o)), d = u > 0 ? -r : Math.min(Math.max(-r, -c), r), f = -u * u + d * (d + 2 * c) + l) : d <= m ? (u = 0, d = Math.min(Math.max(-r, -c), r), f = d * (d + 2 * c) + l) : (u = Math.max(0, -(a * r + o)), d = u > 0 ? r : Math.min(Math.max(-r, -c), r), f = -u * u + d * (d + 2 * c) + l);elsed = a > 0 ? -r : r, u = Math.max(0, -(a * d + o)), f = -u * u + d * (d + 2 * c) + l;- return n && n.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(dh).addScaledVector(cc, d), f;+ return n && n.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(bh).addScaledVector(fc, d), f;}/*** Intersects this ray with the given sphere, returning the intersection@@ -4424,8 +4424,8 @@ class zo {* @return {?Vector3} The intersection point.*/intersectSphere(e, t) {- Gi.subVectors(e.center, this.origin);- const n = Gi.dot(this.direction), s = Gi.dot(Gi) - n * n, r = e.radius * e.radius;+ Hi.subVectors(e.center, this.origin);+ const n = Hi.dot(this.direction), s = Hi.dot(Hi) - n * n, r = e.radius * e.radius;if (s > r) return null;const a = Math.sqrt(r - s), o = n - a, c = n + a;return c < 0 ? null : o < 0 ? this.at(c, t) : this.at(o, t);@@ -4495,7 +4495,7 @@ class zo {* @return {boolean} Whether this ray intersects with the given box or not.*/intersectsBox(e) {- return this.intersectBox(e, Gi) !== null;+ return this.intersectBox(e, Hi) !== null;}/*** Intersects this ray with the given triangle, returning the intersection@@ -4509,8 +4509,8 @@ class zo {* @return {?Vector3} The intersection point.*/intersectTriangle(e, t, n, s, r) {- fh.subVectors(t, e), lc.subVectors(n, e), ph.crossVectors(fh, lc);- let a = this.direction.dot(ph), o;+ xh.subVectors(t, e), pc.subVectors(n, e), Eh.crossVectors(xh, pc);+ let a = this.direction.dot(Eh), o;if (a > 0) {if (s) return null;o = 1;@@ -4518,14 +4518,14 @@ class zo {o = -1, a = -a;elsereturn null;- bs.subVectors(this.origin, e);- const c = o * this.direction.dot(lc.crossVectors(bs, lc));+ xs.subVectors(this.origin, e);+ const c = o * this.direction.dot(pc.crossVectors(xs, pc));if (c < 0)return null;- const l = o * this.direction.dot(fh.cross(bs));+ const l = o * this.direction.dot(xh.cross(xs));if (l < 0 || c + l > a)return null;- const h = -o * bs.dot(ph);+ const h = -o * xs.dot(Eh);return h < 0 ? null : this.at(h / a, r);}/**@@ -4754,7 +4754,7 @@ class st {* @return {Matrix4} A reference to this matrix.*/extractRotation(e) {- const t = this.elements, n = e.elements, s = 1 / Pr.setFromMatrixColumn(e, 0).length(), r = 1 / Pr.setFromMatrixColumn(e, 1).length(), a = 1 / Pr.setFromMatrixColumn(e, 2).length();+ const t = this.elements, n = e.elements, s = 1 / Ur.setFromMatrixColumn(e, 0).length(), r = 1 / Ur.setFromMatrixColumn(e, 1).length(), a = 1 / Ur.setFromMatrixColumn(e, 2).length();return t[0] = n[0] * s, t[1] = n[1] * s, t[2] = n[2] * s, 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] * a, t[9] = n[9] * a, t[10] = n[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;}/**@@ -4799,7 +4799,7 @@ class st {* @return {Matrix4} A reference to this matrix.*/makeRotationFromQuaternion(e) {- return this.compose(h_, e, u_);+ return this.compose(b_, e, x_);}/*** Sets the rotation component of the transformation matrix, looking from `eye` towards@@ -4812,7 +4812,7 @@ class st {*/lookAt(e, t, n) {const s = this.elements;- return Vn.subVectors(e, t), Vn.lengthSq() === 0 && (Vn.z = 1), Vn.normalize(), xs.crossVectors(n, Vn), xs.lengthSq() === 0 && (Math.abs(n.z) === 1 ? Vn.x += 1e-4 : Vn.z += 1e-4, Vn.normalize(), xs.crossVectors(n, Vn)), xs.normalize(), hc.crossVectors(Vn, xs), s[0] = xs.x, s[4] = hc.x, s[8] = Vn.x, s[1] = xs.y, s[5] = hc.y, s[9] = Vn.y, s[2] = xs.z, s[6] = hc.z, s[10] = Vn.z, this;+ return Vn.subVectors(e, t), Vn.lengthSq() === 0 && (Vn.z = 1), Vn.normalize(), Es.crossVectors(n, Vn), Es.lengthSq() === 0 && (Math.abs(n.z) === 1 ? Vn.x += 1e-4 : Vn.z += 1e-4, Vn.normalize(), Es.crossVectors(n, Vn)), Es.normalize(), Ac.crossVectors(Vn, Es), s[0] = Es.x, s[4] = Ac.x, s[8] = Vn.x, s[1] = Es.y, s[5] = Ac.y, s[9] = Vn.y, s[2] = Es.z, s[6] = Ac.z, s[10] = Vn.z, this;}/*** Post-multiplies this matrix by the given 4x4 matrix.@@ -4841,8 +4841,8 @@ class st {* @return {Matrix4} A reference to this matrix.*/multiplyMatrices(e, t) {- const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[4], c = n[8], l = n[12], h = n[1], u = n[5], d = n[9], f = n[13], m = n[2], g = n[6], A = n[10], p = n[14], y = n[3], b = n[7], _ = n[11], M = n[15], w = s[0], S = s[4], T = s[8], v = s[12], C = s[1], F = s[5], K = s[9], q = s[13], $ = s[2], D = s[6], O = s[10], j = s[14], Q = s[3], J = s[7], ee = s[11], ae = s[15];- return r[0] = a * w + o * C + c * $ + l * Q, r[4] = a * S + o * F + c * D + l * J, r[8] = a * T + o * K + c * O + l * ee, r[12] = a * v + o * q + c * j + l * ae, r[1] = h * w + u * C + d * $ + f * Q, r[5] = h * S + u * F + d * D + f * J, r[9] = h * T + u * K + d * O + f * ee, r[13] = h * v + u * q + d * j + f * ae, r[2] = m * w + g * C + A * $ + p * Q, r[6] = m * S + g * F + A * D + p * J, r[10] = m * T + g * K + A * O + p * ee, r[14] = m * v + g * q + A * j + p * ae, r[3] = y * w + b * C + _ * $ + M * Q, r[7] = y * S + b * F + _ * D + M * J, r[11] = y * T + b * K + _ * O + M * ee, r[15] = y * v + b * q + _ * j + M * ae, this;+ const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[4], c = n[8], l = n[12], h = n[1], u = n[5], d = n[9], f = n[13], m = n[2], g = n[6], A = n[10], p = n[14], y = n[3], b = n[7], _ = n[11], M = n[15], w = s[0], S = s[4], T = s[8], C = s[12], v = s[1], F = s[5], K = s[9], q = s[13], $ = s[2], D = s[6], O = s[10], Y = s[14], Q = s[3], J = s[7], ee = s[11], ae = s[15];+ return r[0] = a * w + o * v + c * $ + l * Q, r[4] = a * S + o * F + c * D + l * J, r[8] = a * T + o * K + c * O + l * ee, r[12] = a * C + o * q + c * Y + l * ae, r[1] = h * w + u * v + d * $ + f * Q, r[5] = h * S + u * F + d * D + f * J, r[9] = h * T + u * K + d * O + f * ee, r[13] = h * C + u * q + d * Y + f * ae, r[2] = m * w + g * v + A * $ + p * Q, r[6] = m * S + g * F + A * D + p * J, r[10] = m * T + g * K + A * O + p * ee, r[14] = m * C + g * q + A * Y + p * ae, r[3] = y * w + b * v + _ * $ + M * Q, r[7] = y * S + b * F + _ * D + M * J, r[11] = y * T + b * K + _ * O + M * ee, r[15] = y * C + b * q + _ * Y + M * ae, this;}/*** Multiplies every component of the matrix by the given scalar.@@ -5168,11 +5168,11 @@ class st {*/decompose(e, t, n) {const s = this.elements;- let r = Pr.set(s[0], s[1], s[2]).length();- const a = Pr.set(s[4], s[5], s[6]).length(), o = Pr.set(s[8], s[9], s[10]).length();- this.determinant() < 0 && (r = -r), e.x = s[12], e.y = s[13], e.z = s[14], oi.copy(this);+ let r = Ur.set(s[0], s[1], s[2]).length();+ const a = Ur.set(s[4], s[5], s[6]).length(), o = Ur.set(s[8], s[9], s[10]).length();+ this.determinant() < 0 && (r = -r), e.x = s[12], e.y = s[13], e.z = s[14], ci.copy(this);const l = 1 / r, h = 1 / a, u = 1 / o;- return oi.elements[0] *= l, oi.elements[1] *= l, oi.elements[2] *= l, oi.elements[4] *= h, oi.elements[5] *= h, oi.elements[6] *= h, oi.elements[8] *= u, oi.elements[9] *= u, oi.elements[10] *= u, t.setFromRotationMatrix(oi), n.x = r, n.y = a, n.z = o, this;+ return ci.elements[0] *= l, ci.elements[1] *= l, ci.elements[2] *= l, ci.elements[4] *= h, ci.elements[5] *= h, ci.elements[6] *= h, ci.elements[8] *= u, ci.elements[9] *= u, ci.elements[10] *= u, t.setFromRotationMatrix(ci), n.x = r, n.y = a, n.z = o, this;}/*** Creates a perspective projection matrix. This is used internally by@@ -5187,12 +5187,12 @@ class st {* @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.* @return {Matrix4} A reference to this matrix.*/- makePerspective(e, t, n, s, r, a, o = ns) {+ makePerspective(e, t, n, s, r, a, o = is) {const c = this.elements, l = 2 * r / (t - e), h = 2 * r / (n - s), u = (t + e) / (t - e), d = (n + s) / (n - s);let f, m;- if (o === ns)+ if (o === is)f = -(a + r) / (a - r), m = -2 * a * r / (a - r);- else if (o === xl)+ else if (o === vl)f = -a / (a - r), m = -a * r / (a - r);elsethrow new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + o);@@ -5211,12 +5211,12 @@ class st {* @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.* @return {Matrix4} A reference to this matrix.*/- makeOrthographic(e, t, n, s, r, a, o = ns) {+ makeOrthographic(e, t, n, s, r, a, o = is) {const c = this.elements, l = 1 / (t - e), h = 1 / (n - s), u = 1 / (a - r), d = (t + e) * l, f = (n + s) * h;let m, g;- if (o === ns)+ if (o === is)m = (a + r) * u, g = -2 * u;- else if (o === xl)+ else if (o === vl)m = r * u, g = -1 * u;elsethrow new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + o);@@ -5259,8 +5259,8 @@ class st {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 Pr = /* @__PURE__ */ new H(), oi = /* @__PURE__ */ new st(), h_ = /* @__PURE__ */ new H(0, 0, 0), u_ = /* @__PURE__ */ new H(1, 1, 1), xs = /* @__PURE__ */ new H(), hc = /* @__PURE__ */ new H(), Vn = /* @__PURE__ */ new H(), hp = /* @__PURE__ */ new st(), up = /* @__PURE__ */ new Yn();-class Fi {+const Ur = /* @__PURE__ */ new H(), ci = /* @__PURE__ */ new st(), b_ = /* @__PURE__ */ new H(0, 0, 0), x_ = /* @__PURE__ */ new H(1, 1, 1), Es = /* @__PURE__ */ new H(), Ac = /* @__PURE__ */ new H(), Vn = /* @__PURE__ */ new H(), gp = /* @__PURE__ */ new st(), mp = /* @__PURE__ */ new Xn();+class Di {/*** Constructs a new euler instance.*@@ -5269,7 +5269,7 @@ class Fi {* @param {number} [z=0] - The angle of the z axis in radians.* @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.*/- constructor(e = 0, t = 0, n = 0, s = Fi.DEFAULT_ORDER) {+ constructor(e = 0, t = 0, n = 0, s = Di.DEFAULT_ORDER) {this.isEuler = !0, this._x = e, this._y = t, this._z = n, this._order = s;}/**@@ -5392,7 +5392,7 @@ class Fi {* @return {Euler} A reference to this Euler instance.*/setFromQuaternion(e, t, n) {- return hp.makeRotationFromQuaternion(e), this.setFromRotationMatrix(hp, t, n);+ return gp.makeRotationFromQuaternion(e), this.setFromRotationMatrix(gp, t, n);}/*** Sets the angles of this Euler instance from the given vector.@@ -5415,7 +5415,7 @@ class Fi {* @return {Euler} A reference to this Euler instance.*/reorder(e) {- return up.setFromEuler(this), this.setFromQuaternion(up, e);+ return mp.setFromEuler(this), this.setFromQuaternion(mp, e);}/*** Returns `true` if this Euler instance is equal with the given one.@@ -5457,8 +5457,8 @@ class Fi {yield this._x, yield this._y, yield this._z, yield this._order;}}-Fi.DEFAULT_ORDER = "XYZ";-class Gm {+Di.DEFAULT_ORDER = "XYZ";+class jm {/*** Constructs a new layers instance, with membership* initially set to layer `0`.@@ -5530,15 +5530,15 @@ class Gm {return (this.mask & (1 << e | 0)) !== 0;}}-let d_ = 0;-const dp = /* @__PURE__ */ new H(), kr = /* @__PURE__ */ new Yn(), Hi = /* @__PURE__ */ new st(), uc = /* @__PURE__ */ new H(), Wa = /* @__PURE__ */ new H(), f_ = /* @__PURE__ */ new H(), p_ = /* @__PURE__ */ new Yn(), fp = /* @__PURE__ */ new H(1, 0, 0), pp = /* @__PURE__ */ new H(0, 1, 0), Ap = /* @__PURE__ */ new H(0, 0, 1), gp = { type: "added" }, A_ = { type: "removed" }, Ur = { type: "childadded", child: null }, Ah = { type: "childremoved", child: null };-class kt extends Qs {+let E_ = 0;+const bp = /* @__PURE__ */ new H(), Or = /* @__PURE__ */ new Xn(), zi = /* @__PURE__ */ new st(), gc = /* @__PURE__ */ new H(), Xa = /* @__PURE__ */ new H(), __ = /* @__PURE__ */ new H(), y_ = /* @__PURE__ */ new Xn(), xp = /* @__PURE__ */ new H(1, 0, 0), Ep = /* @__PURE__ */ new H(0, 1, 0), _p = /* @__PURE__ */ new H(0, 0, 1), yp = { type: "added" }, w_ = { type: "removed" }, Qr = { type: "childadded", child: null }, _h = { type: "childremoved", child: null };+class kt extends Hs {/*** Constructs a new 3D object.*/constructor() {- super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: d_++ }), this.uuid = xi(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = kt.DEFAULT_UP.clone();- const e = new H(), t = new Fi(), n = new Yn(), s = new H(1, 1, 1);+ super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: E_++ }), this.uuid = Ei(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = kt.DEFAULT_UP.clone();+ const e = new H(), t = new Di(), n = new Xn(), s = new H(1, 1, 1);function r() {n.setFromEuler(t, !1);}@@ -5611,7 +5611,7 @@ class kt extends Qs {normalMatrix: {value: new rt()}- }), this.matrix = new st(), this.matrixWorld = new st(), this.matrixAutoUpdate = kt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = kt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new Gm(), 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 st(), this.matrixWorld = new st(), this.matrixAutoUpdate = kt.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = kt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new jm(), 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.@@ -5723,7 +5723,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/rotateOnAxis(e, t) {- return kr.setFromAxisAngle(e, t), this.quaternion.multiply(kr), this;+ return Or.setFromAxisAngle(e, t), this.quaternion.multiply(Or), this;}/*** Rotates the 3D object along an axis in world space.@@ -5733,7 +5733,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/rotateOnWorldAxis(e, t) {- return kr.setFromAxisAngle(e, t), this.quaternion.premultiply(kr), this;+ return Or.setFromAxisAngle(e, t), this.quaternion.premultiply(Or), this;}/*** Rotates the 3D object around its X axis in local space.@@ -5742,7 +5742,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/rotateX(e) {- return this.rotateOnAxis(fp, e);+ return this.rotateOnAxis(xp, e);}/*** Rotates the 3D object around its Y axis in local space.@@ -5751,7 +5751,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/rotateY(e) {- return this.rotateOnAxis(pp, e);+ return this.rotateOnAxis(Ep, e);}/*** Rotates the 3D object around its Z axis in local space.@@ -5760,7 +5760,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/rotateZ(e) {- return this.rotateOnAxis(Ap, e);+ return this.rotateOnAxis(_p, e);}/*** Translate the 3D object by a distance along the given axis in local space.@@ -5770,7 +5770,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/translateOnAxis(e, t) {- return dp.copy(e).applyQuaternion(this.quaternion), this.position.add(dp.multiplyScalar(t)), this;+ return bp.copy(e).applyQuaternion(this.quaternion), this.position.add(bp.multiplyScalar(t)), this;}/*** Translate the 3D object by a distance along its X-axis in local space.@@ -5779,7 +5779,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/translateX(e) {- return this.translateOnAxis(fp, e);+ return this.translateOnAxis(xp, e);}/*** Translate the 3D object by a distance along its Y-axis in local space.@@ -5788,7 +5788,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/translateY(e) {- return this.translateOnAxis(pp, e);+ return this.translateOnAxis(Ep, e);}/*** Translate the 3D object by a distance along its Z-axis in local space.@@ -5797,7 +5797,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/translateZ(e) {- return this.translateOnAxis(Ap, e);+ return this.translateOnAxis(_p, e);}/*** Converts the given vector from this 3D object's local space to world space.@@ -5815,7 +5815,7 @@ class kt extends Qs {* @return {Vector3} The converted vector.*/worldToLocal(e) {- return this.updateWorldMatrix(!0, !1), e.applyMatrix4(Hi.copy(this.matrixWorld).invert());+ return this.updateWorldMatrix(!0, !1), e.applyMatrix4(zi.copy(this.matrixWorld).invert());}/*** Rotates the object to face a point in world space.@@ -5827,9 +5827,9 @@ class kt extends Qs {* @param {number} [z] - The z coordinate in world space.*/lookAt(e, t, n) {- e.isVector3 ? uc.copy(e) : uc.set(e, t, n);+ e.isVector3 ? gc.copy(e) : gc.set(e, t, n);const s = this.parent;- this.updateWorldMatrix(!0, !1), Wa.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Hi.lookAt(Wa, uc, this.up) : Hi.lookAt(uc, Wa, this.up), this.quaternion.setFromRotationMatrix(Hi), s && (Hi.extractRotation(s.matrixWorld), kr.setFromRotationMatrix(Hi), this.quaternion.premultiply(kr.invert()));+ this.updateWorldMatrix(!0, !1), Xa.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? zi.lookAt(Xa, gc, this.up) : zi.lookAt(gc, Xa, this.up), this.quaternion.setFromRotationMatrix(zi), s && (zi.extractRotation(s.matrixWorld), Or.setFromRotationMatrix(zi), this.quaternion.premultiply(Or.invert()));}/*** Adds the given 3D object as a child to this 3D object. An arbitrary number of@@ -5847,7 +5847,7 @@ class kt extends Qs {this.add(arguments[t]);return this;}- return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.removeFromParent(), e.parent = this, this.children.push(e), e.dispatchEvent(gp), Ur.child = e, this.dispatchEvent(Ur), Ur.child = null) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this);+ return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.removeFromParent(), e.parent = this, this.children.push(e), e.dispatchEvent(yp), Qr.child = e, this.dispatchEvent(Qr), Qr.child = null) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this);}/*** Removes the given 3D object as child from this 3D object.@@ -5865,7 +5865,7 @@ class kt extends Qs {return this;}const t = this.children.indexOf(e);- return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(A_), Ah.child = e, this.dispatchEvent(Ah), Ah.child = null), this;+ return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(w_), _h.child = e, this.dispatchEvent(_h), _h.child = null), this;}/*** Removes this 3D object from its current parent.@@ -5898,7 +5898,7 @@ class kt extends Qs {* @return {Object3D} A reference to this instance.*/attach(e) {- return this.updateWorldMatrix(!0, !1), Hi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Hi.multiply(e.parent.matrixWorld)), e.applyMatrix4(Hi), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(gp), Ur.child = e, this.dispatchEvent(Ur), Ur.child = null, this;+ return this.updateWorldMatrix(!0, !1), zi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), zi.multiply(e.parent.matrixWorld)), e.applyMatrix4(zi), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(yp), Qr.child = e, this.dispatchEvent(Qr), Qr.child = null, this;}/*** Searches through the 3D object and its children, starting with the 3D object@@ -5968,7 +5968,7 @@ class kt extends Qs {* @return {Quaternion} The 3D object's rotation in world space.*/getWorldQuaternion(e) {- return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Wa, e, f_), e;+ return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Xa, e, __), e;}/*** Returns a vector representing the scale of the 3D object in world space.@@ -5977,7 +5977,7 @@ class kt extends Qs {* @return {Vector3} The 3D object's scale in world space.*/getWorldScale(e) {- return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Wa, p_, e), e;+ return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Xa, y_, e), e;}/*** Returns a vector representing the ("look") direction of the 3D object in world space.@@ -6201,8 +6201,8 @@ class kt extends Qs {kt.DEFAULT_UP = /* @__PURE__ */ new H(0, 1, 0);kt.DEFAULT_MATRIX_AUTO_UPDATE = !0;kt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;-const ci = /* @__PURE__ */ new H(), zi = /* @__PURE__ */ new H(), gh = /* @__PURE__ */ new H(), Vi = /* @__PURE__ */ new H(), Or = /* @__PURE__ */ new H(), Qr = /* @__PURE__ */ new H(), mp = /* @__PURE__ */ new H(), mh = /* @__PURE__ */ new H(), bh = /* @__PURE__ */ new H(), xh = /* @__PURE__ */ new H(), Eh = /* @__PURE__ */ new wt(), _h = /* @__PURE__ */ new wt(), yh = /* @__PURE__ */ new wt();-class gi {+const li = /* @__PURE__ */ new H(), Vi = /* @__PURE__ */ new H(), yh = /* @__PURE__ */ new H(), Wi = /* @__PURE__ */ new H(), Gr = /* @__PURE__ */ new H(), Hr = /* @__PURE__ */ new H(), wp = /* @__PURE__ */ new H(), wh = /* @__PURE__ */ new H(), vh = /* @__PURE__ */ new H(), Ch = /* @__PURE__ */ new H(), Sh = /* @__PURE__ */ new wt(), Ih = /* @__PURE__ */ new wt(), Mh = /* @__PURE__ */ new wt();+class mi {/*** Constructs a new triangle.*@@ -6223,7 +6223,7 @@ class gi {* @return {Vector3} The triangle's normal.*/static getNormal(e, t, n, s) {- s.subVectors(n, t), ci.subVectors(e, t), s.cross(ci);+ s.subVectors(n, t), li.subVectors(e, t), s.cross(li);const r = s.lengthSq();return r > 0 ? s.multiplyScalar(1 / Math.sqrt(r)) : s.set(0, 0, 0);}@@ -6239,8 +6239,8 @@ class gi {* @return {?Vector3} The barycentric coordinates for the given point*/static getBarycoord(e, t, n, s, r) {- ci.subVectors(s, t), zi.subVectors(n, t), gh.subVectors(e, t);- const a = ci.dot(ci), o = ci.dot(zi), c = ci.dot(gh), l = zi.dot(zi), h = zi.dot(gh), u = a * l - o * o;+ li.subVectors(s, t), Vi.subVectors(n, t), yh.subVectors(e, t);+ const a = li.dot(li), o = li.dot(Vi), c = li.dot(yh), l = Vi.dot(Vi), h = Vi.dot(yh), u = a * l - o * o;if (u === 0)return r.set(0, 0, 0), null;const d = 1 / u, f = (l * c - o * h) * d, m = (a * h - o * c) * d;@@ -6258,7 +6258,7 @@ class gi {* triangle, lies within the triangle or not.*/static containsPoint(e, t, n, s) {- return this.getBarycoord(e, t, n, s, Vi) === null ? !1 : Vi.x >= 0 && Vi.y >= 0 && Vi.x + Vi.y <= 1;+ return this.getBarycoord(e, t, n, s, Wi) === null ? !1 : Wi.x >= 0 && Wi.y >= 0 && Wi.x + Wi.y <= 1;}/*** Computes the value barycentrically interpolated for the given point on the@@ -6275,7 +6275,7 @@ class gi {* @return {?Vector3} The interpolated value.*/static getInterpolation(e, t, n, s, r, a, o, c) {- return this.getBarycoord(e, t, n, s, Vi) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, Vi.x), c.addScaledVector(a, Vi.y), c.addScaledVector(o, Vi.z), c);+ return this.getBarycoord(e, t, n, s, Wi) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, Wi.x), c.addScaledVector(a, Wi.y), c.addScaledVector(o, Wi.z), c);}/*** Computes the value barycentrically interpolated for the given attribute and indices.@@ -6289,7 +6289,7 @@ class gi {* @return {Vector3} The interpolated attribute value.*/static getInterpolatedAttribute(e, t, n, s, r, a) {- return Eh.setScalar(0), _h.setScalar(0), yh.setScalar(0), Eh.fromBufferAttribute(e, t), _h.fromBufferAttribute(e, n), yh.fromBufferAttribute(e, s), a.setScalar(0), a.addScaledVector(Eh, r.x), a.addScaledVector(_h, r.y), a.addScaledVector(yh, r.z), a;+ return Sh.setScalar(0), Ih.setScalar(0), Mh.setScalar(0), Sh.fromBufferAttribute(e, t), Ih.fromBufferAttribute(e, n), Mh.fromBufferAttribute(e, s), a.setScalar(0), a.addScaledVector(Sh, r.x), a.addScaledVector(Ih, r.y), a.addScaledVector(Mh, r.z), a;}/*** Returns `true` if the triangle is oriented towards the given direction.@@ -6301,7 +6301,7 @@ class gi {* @return {boolean} Whether the triangle is oriented towards the given direction or not.*/static isFrontFacing(e, t, n, s) {- return ci.subVectors(n, t), zi.subVectors(e, t), ci.cross(zi).dot(s) < 0;+ return li.subVectors(n, t), Vi.subVectors(e, t), li.cross(Vi).dot(s) < 0;}/*** Sets the triangle's vertices by copying the given values.@@ -6361,7 +6361,7 @@ class gi {* @return {number} The triangle's area.*/getArea() {- return ci.subVectors(this.c, this.b), zi.subVectors(this.a, this.b), ci.cross(zi).length() * 0.5;+ return li.subVectors(this.c, this.b), Vi.subVectors(this.a, this.b), li.cross(Vi).length() * 0.5;}/*** Computes the midpoint of the triangle.@@ -6379,7 +6379,7 @@ class gi {* @return {Vector3} The triangle's normal.*/getNormal(e) {- return gi.getNormal(this.a, this.b, this.c, e);+ return mi.getNormal(this.a, this.b, this.c, e);}/*** Computes a plane the triangle lies within.@@ -6399,7 +6399,7 @@ class gi {* @return {?Vector3} The barycentric coordinates for the given point*/getBarycoord(e, t) {- return gi.getBarycoord(e, this.a, this.b, this.c, t);+ return mi.getBarycoord(e, this.a, this.b, this.c, t);}/*** Computes the value barycentrically interpolated for the given point on the@@ -6413,7 +6413,7 @@ class gi {* @return {?Vector3} The interpolated value.*/getInterpolation(e, t, n, s, r) {- return gi.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);+ return mi.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);}/*** Returns `true` if the given point, when projected onto the plane of the@@ -6424,7 +6424,7 @@ class gi {* triangle, lies within the triangle or not.*/containsPoint(e) {- return gi.containsPoint(e, this.a, this.b, this.c);+ return mi.containsPoint(e, this.a, this.b, this.c);}/*** Returns `true` if the triangle is oriented towards the given direction.@@ -6433,7 +6433,7 @@ class gi {* @return {boolean} Whether the triangle is oriented towards the given direction or not.*/isFrontFacing(e) {- return gi.isFrontFacing(this.a, this.b, this.c, e);+ return mi.isFrontFacing(this.a, this.b, this.c, e);}/*** Returns `true` if this triangle intersects with the given box.@@ -6454,29 +6454,29 @@ class gi {closestPointToPoint(e, t) {const n = this.a, s = this.b, r = this.c;let a, o;- Or.subVectors(s, n), Qr.subVectors(r, n), mh.subVectors(e, n);- const c = Or.dot(mh), l = Qr.dot(mh);+ Gr.subVectors(s, n), Hr.subVectors(r, n), wh.subVectors(e, n);+ const c = Gr.dot(wh), l = Hr.dot(wh);if (c <= 0 && l <= 0)return t.copy(n);- bh.subVectors(e, s);- const h = Or.dot(bh), u = Qr.dot(bh);+ vh.subVectors(e, s);+ const h = Gr.dot(vh), u = Hr.dot(vh);if (h >= 0 && u <= h)return t.copy(s);const d = c * u - h * l;if (d <= 0 && c >= 0 && h <= 0)- return a = c / (c - h), t.copy(n).addScaledVector(Or, a);- xh.subVectors(e, r);- const f = Or.dot(xh), m = Qr.dot(xh);+ return a = c / (c - h), t.copy(n).addScaledVector(Gr, a);+ Ch.subVectors(e, r);+ const f = Gr.dot(Ch), m = Hr.dot(Ch);if (m >= 0 && f <= m)return t.copy(r);const g = f * l - c * m;if (g <= 0 && l >= 0 && m <= 0)- return o = l / (l - m), t.copy(n).addScaledVector(Qr, o);+ return o = l / (l - m), t.copy(n).addScaledVector(Hr, o);const A = h * m - f * u;if (A <= 0 && u - h >= 0 && f - m >= 0)- return mp.subVectors(r, s), o = (u - h) / (u - h + (f - m)), t.copy(s).addScaledVector(mp, o);+ return wp.subVectors(r, s), o = (u - h) / (u - h + (f - m)), t.copy(s).addScaledVector(wp, o);const p = 1 / (A + g + d);- return a = g * p, o = d * p, t.copy(n).addScaledVector(Or, a).addScaledVector(Qr, o);+ return a = g * p, o = d * p, t.copy(n).addScaledVector(Gr, a).addScaledVector(Hr, o);}/*** Returns `true` if this triangle is equal with the given one.@@ -6488,7 +6488,7 @@ class gi {return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);}}-const Hm = {+const Xm = {aliceblue: 15792383,antiquewhite: 16444375,aqua: 65535,@@ -6637,11 +6637,11 @@ const Hm = {whitesmoke: 16119285,yellow: 16776960,yellowgreen: 10145074-}, Es = { h: 0, s: 0, l: 0 }, dc = { h: 0, s: 0, l: 0 };-function wh(i, e, t) {+}, _s = { h: 0, s: 0, l: 0 }, mc = { h: 0, s: 0, l: 0 };+function Bh(i, e, t) {return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * 6 * (2 / 3 - t) : i;}-let Xe = class {+let je = class {/*** Constructs a new color.*@@ -6714,11 +6714,11 @@ let Xe = class {* @return {Color} A reference to this color.*/setHSL(e, t, n, s = mt.workingColorSpace) {- if (e = af(e, 1), t = ct(t, 0, 1), n = ct(n, 0, 1), t === 0)+ if (e = df(e, 1), t = ct(t, 0, 1), n = ct(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, a = 2 * n - r;- this.r = wh(a, r, e + 1 / 3), this.g = wh(a, r, e), this.b = wh(a, r, e - 1 / 3);+ this.r = Bh(a, r, e + 1 / 3), this.g = Bh(a, r, e), this.b = Bh(a, r, e - 1 / 3);}return mt.toWorkingColorSpace(this, s), this;}@@ -6801,7 +6801,7 @@ let Xe = class {* @return {Color} A reference to this color.*/setColorName(e, t = Kt) {- const n = Hm[e.toLowerCase()];+ const n = Xm[e.toLowerCase()];return n !== void 0 ? this.setHex(n, t) : console.warn("THREE.Color: Unknown color " + e), this;}/**@@ -6829,7 +6829,7 @@ let Xe = class {* @return {Color} A reference to this color.*/copySRGBToLinear(e) {- return this.r = as(e.r), this.g = as(e.g), this.b = as(e.b), this;+ return this.r = os(e.r), this.g = os(e.g), this.b = os(e.b), this;}/*** Copies the given color into this color, and then converts this color from@@ -6839,7 +6839,7 @@ let Xe = class {* @return {Color} A reference to this color.*/copyLinearToSRGB(e) {- return this.r = la(e.r), this.g = la(e.g), this.b = la(e.b), this;+ return this.r = ua(e.r), this.g = ua(e.g), this.b = ua(e.b), this;}/*** Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.@@ -6939,7 +6939,7 @@ let Xe = class {* @return {Color} A reference to this color.*/offsetHSL(e, t, n) {- return this.getHSL(Es), this.setHSL(Es.h + e, Es.s + t, Es.l + n);+ return this.getHSL(_s), this.setHSL(_s.h + e, _s.s + t, _s.l + n);}/*** Adds the RGB values of the given color to the RGB values of this color.@@ -7033,8 +7033,8 @@ let Xe = class {* @return {Color} A reference to this color.*/lerpHSL(e, t) {- this.getHSL(Es), e.getHSL(dc);- const n = go(Es.h, dc.h, t), s = go(Es.s, dc.s, t), r = go(Es.l, dc.l, t);+ this.getHSL(_s), e.getHSL(mc);+ const n = Eo(_s.h, mc.h, t), s = Eo(_s.s, mc.s, t), r = Eo(_s.l, mc.l, t);return this.setHSL(n, s, r), this;}/**@@ -7109,15 +7109,15 @@ let Xe = class {yield this.r, yield this.g, yield this.b;}};-const wn = /* @__PURE__ */ new Xe();-Xe.NAMES = Hm;-let g_ = 0;-class Ni extends Qs {+const wn = /* @__PURE__ */ new je();+je.NAMES = Xm;+let v_ = 0;+class Fi extends Hs {/*** Constructs a new material.*/constructor() {- super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: g_++ }), this.uuid = xi(), this.name = "", this.type = "Material", this.blending = ca, this.side = hs, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = Iu, this.blendDst = Mu, this.blendEquation = ir, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Xe(0, 0, 0), this.blendAlpha = 0, this.depthFunc = ma, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = ip, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Rr, this.stencilZFail = Rr, this.stencilZPass = Rr, 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: v_++ }), this.uuid = Ei(), this.name = "", this.type = "Material", this.blending = ha, this.side = us, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = Fu, this.blendDst = Du, this.blendEquation = rr, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new je(0, 0, 0), this.blendAlpha = 0, this.depthFunc = _a, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = lp, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Fr, this.stencilZFail = Fr, this.stencilZPass = Fr, 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@@ -7216,7 +7216,7 @@ class Ni extends Qs {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.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 !== ca && (n.blending = this.blending), this.side !== hs && (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 !== Iu && (n.blendSrc = this.blendSrc), this.blendDst !== Mu && (n.blendDst = this.blendDst), this.blendEquation !== ir && (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 !== ma && (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 !== ip && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Rr && (n.stencilFail = this.stencilFail), this.stencilZFail !== Rr && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Rr && (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.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 !== ha && (n.blending = this.blending), this.side !== us && (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 !== Fu && (n.blendSrc = this.blendSrc), this.blendDst !== Du && (n.blendDst = this.blendDst), this.blendEquation !== rr && (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 !== _a && (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 !== lp && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Fr && (n.stencilFail = this.stencilFail), this.stencilZFail !== Fr && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Fr && (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 s(r) {const a = [];for (const o in r) {@@ -7278,7 +7278,7 @@ class Ni extends Qs {e === !0 && this.version++;}}-class Rs extends Ni {+class Ns extends Fi {/*** Constructs a new mesh basic material.*@@ -7289,14 +7289,14 @@ class Rs extends Ni {* by {@link Color#set}.*/constructor(e) {- super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Xe(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 Fi(), this.combine = ym, 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 je(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 Di(), this.combine = Bm, 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 Ji = /* @__PURE__ */ m_();-function m_() {+const Zi = /* @__PURE__ */ C_();+function C_() {const i = new ArrayBuffer(4), e = new Float32Array(i), t = new Uint32Array(i), n = new Uint32Array(512), s = new Uint32Array(512);for (let c = 0; c < 256; ++c) {const l = c - 127;@@ -7329,16 +7329,16 @@ function m_() {offsetTable: o};}-function b_(i) {- Math.abs(i) > 65504 && console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."), i = ct(i, -65504, 65504), Ji.floatView[0] = i;- const e = Ji.uint32View[0], t = e >> 23 & 511;- return Ji.baseTable[t] + ((e & 8388607) >> Ji.shiftTable[t]);+function S_(i) {+ Math.abs(i) > 65504 && console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."), i = ct(i, -65504, 65504), Zi.floatView[0] = i;+ const e = Zi.uint32View[0], t = e >> 23 & 511;+ return Zi.baseTable[t] + ((e & 8388607) >> Zi.shiftTable[t]);}-function x_(i) {+function I_(i) {const e = i >> 10;- return Ji.uint32View[0] = Ji.mantissaTable[Ji.offsetTable[e] + (i & 1023)] + Ji.exponentTable[e], Ji.floatView[0];+ return Zi.uint32View[0] = Zi.mantissaTable[Zi.offsetTable[e] + (i & 1023)] + Zi.exponentTable[e], Zi.floatView[0];}-class bp {+class vp {/*** Returns a half precision floating point value (FP16) from the given single* precision floating point value (FP32).@@ -7347,7 +7347,7 @@ class bp {* @return {number} The FP16 value.*/static toHalfFloat(e) {- return b_(e);+ return S_(e);}/*** Returns a single precision floating point value (FP32) from the given half@@ -7357,11 +7357,11 @@ class bp {* @return {number} The FP32 value.*/static fromHalfFloat(e) {- return x_(e);+ return I_(e);}}-const jt = /* @__PURE__ */ new H(), fc = /* @__PURE__ */ new Ze();-let E_ = 0;+const Yt = /* @__PURE__ */ new H(), bc = /* @__PURE__ */ new Ze();+let M_ = 0;class _n {/*** Constructs a new buffer attribute.@@ -7373,7 +7373,7 @@ class _n {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: E_++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = sd, this.updateRanges = [], this.gpuType = an, this.version = 0;+ this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: M_++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = hd, this.updateRanges = [], this.gpuType = an, this.version = 0;}/*** A callback function that is executed after the renderer has transferred the attribute@@ -7460,10 +7460,10 @@ class _n {applyMatrix3(e) {if (this.itemSize === 2)for (let t = 0, n = this.count; t < n; t++)- fc.fromBufferAttribute(this, t), fc.applyMatrix3(e), this.setXY(t, fc.x, fc.y);+ bc.fromBufferAttribute(this, t), bc.applyMatrix3(e), this.setXY(t, bc.x, bc.y);else if (this.itemSize === 3)for (let t = 0, n = this.count; t < n; t++)- jt.fromBufferAttribute(this, t), jt.applyMatrix3(e), this.setXYZ(t, jt.x, jt.y, jt.z);+ Yt.fromBufferAttribute(this, t), Yt.applyMatrix3(e), this.setXYZ(t, Yt.x, Yt.y, Yt.z);return this;}/**@@ -7475,7 +7475,7 @@ class _n {*/applyMatrix4(e) {for (let t = 0, n = this.count; t < n; t++)- jt.fromBufferAttribute(this, t), jt.applyMatrix4(e), this.setXYZ(t, jt.x, jt.y, jt.z);+ Yt.fromBufferAttribute(this, t), Yt.applyMatrix4(e), this.setXYZ(t, Yt.x, Yt.y, Yt.z);return this;}/**@@ -7487,7 +7487,7 @@ class _n {*/applyNormalMatrix(e) {for (let t = 0, n = this.count; t < n; t++)- jt.fromBufferAttribute(this, t), jt.applyNormalMatrix(e), this.setXYZ(t, jt.x, jt.y, jt.z);+ Yt.fromBufferAttribute(this, t), Yt.applyNormalMatrix(e), this.setXYZ(t, Yt.x, Yt.y, Yt.z);return this;}/**@@ -7499,7 +7499,7 @@ class _n {*/transformDirection(e) {for (let t = 0, n = this.count; t < n; t++)- jt.fromBufferAttribute(this, t), jt.transformDirection(e), this.setXYZ(t, jt.x, jt.y, jt.z);+ Yt.fromBufferAttribute(this, t), Yt.transformDirection(e), this.setXYZ(t, Yt.x, Yt.y, Yt.z);return this;}/**@@ -7521,7 +7521,7 @@ class _n {*/getComponent(e, t) {let n = this.array[e * this.itemSize + t];- return this.normalized && (n = Ai(n, this.array)), n;+ return this.normalized && (n = gi(n, this.array)), n;}/*** Sets the given value to the given component of the vector at the given index.@@ -7542,7 +7542,7 @@ class _n {*/getX(e) {let t = this.array[e * this.itemSize];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Sets the x component of the vector at the given index.@@ -7562,7 +7562,7 @@ class _n {*/getY(e) {let t = this.array[e * this.itemSize + 1];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Sets the y component of the vector at the given index.@@ -7582,7 +7582,7 @@ class _n {*/getZ(e) {let t = this.array[e * this.itemSize + 2];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Sets the z component of the vector at the given index.@@ -7602,7 +7602,7 @@ class _n {*/getW(e) {let t = this.array[e * this.itemSize + 3];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Sets the w component of the vector at the given index.@@ -7681,10 +7681,10 @@ class _n {array: Array.from(this.array),normalized: this.normalized};- return this.name !== "" && (e.name = this.name), this.usage !== sd && (e.usage = this.usage), e;+ return this.name !== "" && (e.name = this.name), this.usage !== hd && (e.usage = this.usage), e;}}-class zm extends _n {+class Ym extends _n {/*** Constructs a new buffer attribute.*@@ -7696,7 +7696,7 @@ class zm extends _n {super(new Uint16Array(e), t, n);}}-class Vm extends _n {+class Jm extends _n {/*** Constructs a new buffer attribute.*@@ -7720,14 +7720,14 @@ class kn extends _n {super(new Float32Array(e), t, n);}}-let __ = 0;-const jn = /* @__PURE__ */ new st(), Ch = /* @__PURE__ */ new kt(), Gr = /* @__PURE__ */ new H(), Wn = /* @__PURE__ */ new Li(), qa = /* @__PURE__ */ new Li(), An = /* @__PURE__ */ new H();-class Hn extends Qs {+let B_ = 0;+const Yn = /* @__PURE__ */ new st(), Th = /* @__PURE__ */ new kt(), zr = /* @__PURE__ */ new H(), Wn = /* @__PURE__ */ new Pi(), Ya = /* @__PURE__ */ new Pi(), An = /* @__PURE__ */ new H();+class Hn extends Hs {/*** Constructs a new geometry.*/constructor() {- super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: __++ }), this.uuid = xi(), 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: B_++ }), this.uuid = Ei(), 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.@@ -7744,7 +7744,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/setIndex(e) {- return Array.isArray(e) ? this.index = new (Um(e) ? Vm : zm)(e, 1) : this.index = e, this;+ return Array.isArray(e) ? this.index = new (Wm(e) ? Jm : Ym)(e, 1) : this.index = e, this;}/*** Sets the given indirect attribute to this geometry.@@ -7856,7 +7856,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/applyQuaternion(e) {- return jn.makeRotationFromQuaternion(e), this.applyMatrix4(jn), this;+ return Yn.makeRotationFromQuaternion(e), this.applyMatrix4(Yn), this;}/*** Rotates the geometry about the X axis. This is typically done as a one time@@ -7867,7 +7867,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/rotateX(e) {- return jn.makeRotationX(e), this.applyMatrix4(jn), this;+ return Yn.makeRotationX(e), this.applyMatrix4(Yn), this;}/*** Rotates the geometry about the Y axis. This is typically done as a one time@@ -7878,7 +7878,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/rotateY(e) {- return jn.makeRotationY(e), this.applyMatrix4(jn), this;+ return Yn.makeRotationY(e), this.applyMatrix4(Yn), this;}/*** Rotates the geometry about the Z axis. This is typically done as a one time@@ -7889,7 +7889,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/rotateZ(e) {- return jn.makeRotationZ(e), this.applyMatrix4(jn), this;+ return Yn.makeRotationZ(e), this.applyMatrix4(Yn), this;}/*** Translates the geometry. This is typically done as a one time@@ -7902,7 +7902,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/translate(e, t, n) {- return jn.makeTranslation(e, t, n), this.applyMatrix4(jn), this;+ return Yn.makeTranslation(e, t, n), this.applyMatrix4(Yn), this;}/*** Scales the geometry. This is typically done as a one time@@ -7915,7 +7915,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/scale(e, t, n) {- return jn.makeScale(e, t, n), this.applyMatrix4(jn), this;+ return Yn.makeScale(e, t, n), this.applyMatrix4(Yn), this;}/*** Rotates the geometry to face a point in 3D space. This is typically done as a one time@@ -7926,7 +7926,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/lookAt(e) {- return Ch.lookAt(e), Ch.updateMatrix(), this.applyMatrix4(Ch.matrix), this;+ return Th.lookAt(e), Th.updateMatrix(), this.applyMatrix4(Th.matrix), this;}/*** Center the geometry based on its bounding box.@@ -7934,7 +7934,7 @@ class Hn extends Qs {* @return {BufferGeometry} A reference to this instance.*/center() {- return this.computeBoundingBox(), this.boundingBox.getCenter(Gr).negate(), this.translate(Gr.x, Gr.y, Gr.z), this;+ return this.computeBoundingBox(), this.boundingBox.getCenter(zr).negate(), this.translate(zr.x, zr.y, zr.z), this;}/*** Defines a geometry by creating a `position` attribute based on the given array of points. The array@@ -7972,7 +7972,7 @@ class Hn extends Qs {* You may need to recompute the bounding box if the geometry vertices are modified.*/computeBoundingBox() {- this.boundingBox === null && (this.boundingBox = new Li());+ this.boundingBox === null && (this.boundingBox = new Pi());const e = this.attributes.position, t = this.morphAttributes.position;if (e && e.isGLBufferAttribute) {console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this), this.boundingBox.set(@@ -7997,7 +7997,7 @@ class Hn extends Qs {* You may need to recompute the bounding sphere if the geometry vertices are modified.*/computeBoundingSphere() {- this.boundingSphere === null && (this.boundingSphere = new Pi());+ this.boundingSphere === null && (this.boundingSphere = new ki());const e = this.attributes.position, t = this.morphAttributes.position;if (e && e.isGLBufferAttribute) {console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this), this.boundingSphere.set(new H(), 1 / 0);@@ -8008,7 +8008,7 @@ class Hn extends Qs {if (Wn.setFromBufferAttribute(e), t)for (let r = 0, a = t.length; r < a; r++) {const o = t[r];- qa.setFromBufferAttribute(o), this.morphTargetsRelative ? (An.addVectors(Wn.min, qa.min), Wn.expandByPoint(An), An.addVectors(Wn.max, qa.max), Wn.expandByPoint(An)) : (Wn.expandByPoint(qa.min), Wn.expandByPoint(qa.max));+ Ya.setFromBufferAttribute(o), this.morphTargetsRelative ? (An.addVectors(Wn.min, Ya.min), Wn.expandByPoint(An), An.addVectors(Wn.max, Ya.max), Wn.expandByPoint(An)) : (Wn.expandByPoint(Ya.min), Wn.expandByPoint(Ya.max));}Wn.getCenter(n);let s = 0;@@ -8018,7 +8018,7 @@ class Hn extends Qs {for (let r = 0, a = t.length; r < a; r++) {const o = t[r], c = this.morphTargetsRelative;for (let l = 0, h = o.count; l < h; l++)- An.fromBufferAttribute(o, l), c && (Gr.fromBufferAttribute(e, l), An.add(Gr)), s = Math.max(s, n.distanceToSquared(An));+ An.fromBufferAttribute(o, l), c && (zr.fromBufferAttribute(e, l), An.add(zr)), s = Math.max(s, n.distanceToSquared(An));}this.boundingSphere.radius = Math.sqrt(s), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);}@@ -8042,18 +8042,18 @@ class Hn extends Qs {for (let T = 0; T < n.count; T++)o[T] = new H(), c[T] = new H();const l = new H(), h = new H(), u = new H(), d = new Ze(), f = new Ze(), m = new Ze(), g = new H(), A = new H();- function p(T, v, C) {- l.fromBufferAttribute(n, T), h.fromBufferAttribute(n, v), u.fromBufferAttribute(n, C), d.fromBufferAttribute(r, T), f.fromBufferAttribute(r, v), m.fromBufferAttribute(r, C), h.sub(l), u.sub(l), f.sub(d), m.sub(d);+ function p(T, C, v) {+ l.fromBufferAttribute(n, T), h.fromBufferAttribute(n, C), u.fromBufferAttribute(n, v), d.fromBufferAttribute(r, T), f.fromBufferAttribute(r, C), m.fromBufferAttribute(r, v), h.sub(l), u.sub(l), f.sub(d), m.sub(d);const F = 1 / (f.x * m.y - m.x * f.y);- isFinite(F) && (g.copy(h).multiplyScalar(m.y).addScaledVector(u, -f.y).multiplyScalar(F), A.copy(u).multiplyScalar(f.x).addScaledVector(h, -m.x).multiplyScalar(F), o[T].add(g), o[v].add(g), o[C].add(g), c[T].add(A), c[v].add(A), c[C].add(A));+ isFinite(F) && (g.copy(h).multiplyScalar(m.y).addScaledVector(u, -f.y).multiplyScalar(F), A.copy(u).multiplyScalar(f.x).addScaledVector(h, -m.x).multiplyScalar(F), o[T].add(g), o[C].add(g), o[v].add(g), c[T].add(A), c[C].add(A), c[v].add(A));}let y = this.groups;y.length === 0 && (y = [{start: 0,count: e.count}]);- for (let T = 0, v = y.length; T < v; ++T) {- const C = y[T], F = C.start, K = C.count;+ for (let T = 0, C = y.length; T < C; ++T) {+ const v = y[T], F = v.start, K = v.count;for (let q = F, $ = F + K; q < $; q += 3)p(e.getX(q + 0),@@ -8064,13 +8064,13 @@ class Hn extends Qs {const b = new H(), _ = new H(), M = new H(), w = new H();function S(T) {M.fromBufferAttribute(s, T), w.copy(M);- const v = o[T];- b.copy(v), b.sub(M.multiplyScalar(M.dot(v))).normalize(), _.crossVectors(w, v);+ const C = o[T];+ b.copy(C), b.sub(M.multiplyScalar(M.dot(C))).normalize(), _.crossVectors(w, C);const F = _.dot(c[T]) < 0 ? -1 : 1;a.setXYZW(T, b.x, b.y, b.z, F);}- for (let T = 0, v = y.length; T < v; ++T) {- const C = y[T], F = C.start, K = C.count;+ for (let T = 0, C = y.length; T < C; ++T) {+ const v = y[T], F = v.start, K = v.count;for (let q = F, $ = F + K; q < $; q += 3)S(e.getX(q + 0)), S(e.getX(q + 1)), S(e.getX(q + 2));}@@ -8254,7 +8254,7 @@ class Hn extends Qs {this.dispatchEvent({ type: "dispose" });}}-const xp = /* @__PURE__ */ new st(), Ks = /* @__PURE__ */ new zo(), pc = /* @__PURE__ */ new Pi(), Ep = /* @__PURE__ */ new H(), Ac = /* @__PURE__ */ new H(), gc = /* @__PURE__ */ new H(), mc = /* @__PURE__ */ new H(), vh = /* @__PURE__ */ new H(), bc = /* @__PURE__ */ new H(), _p = /* @__PURE__ */ new H(), xc = /* @__PURE__ */ new H();+const Cp = /* @__PURE__ */ new st(), Xs = /* @__PURE__ */ new jo(), xc = /* @__PURE__ */ new ki(), Sp = /* @__PURE__ */ new H(), Ec = /* @__PURE__ */ new H(), _c = /* @__PURE__ */ new H(), yc = /* @__PURE__ */ new H(), Rh = /* @__PURE__ */ new H(), wc = /* @__PURE__ */ new H(), Ip = /* @__PURE__ */ new H(), vc = /* @__PURE__ */ new H();class Jt extends kt {/*** Constructs a new mesh.@@ -8262,7 +8262,7 @@ class Jt extends kt {* @param {BufferGeometry} [geometry] - The mesh geometry.* @param {Material|Array<Material>} [material] - The mesh material.*/- constructor(e = new Hn(), t = new Rs()) {+ constructor(e = new Hn(), t = new Ns()) {super(), this.isMesh = !0, this.type = "Mesh", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();}copy(e, t) {@@ -8298,12 +8298,12 @@ class Jt extends kt {t.fromBufferAttribute(s, e);const o = this.morphTargetInfluences;if (r && o) {- bc.set(0, 0, 0);+ wc.set(0, 0, 0);for (let c = 0, l = r.length; c < l; c++) {const h = o[c], u = r[c];- h !== 0 && (vh.fromBufferAttribute(u, e), a ? bc.addScaledVector(vh, h) : bc.addScaledVector(vh.sub(t), h));+ h !== 0 && (Rh.fromBufferAttribute(u, e), a ? wc.addScaledVector(Rh, h) : wc.addScaledVector(Rh.sub(t), h));}- t.add(bc);+ t.add(wc);}return t;}@@ -8315,7 +8315,7 @@ class Jt extends kt {*/raycast(e, t) {const n = this.geometry, s = this.material, r = this.matrixWorld;- s !== void 0 && (n.boundingSphere === null && n.computeBoundingSphere(), pc.copy(n.boundingSphere), pc.applyMatrix4(r), Ks.copy(e.ray).recast(e.near), !(pc.containsPoint(Ks.origin) === !1 && (Ks.intersectSphere(pc, Ep) === null || Ks.origin.distanceToSquared(Ep) > (e.far - e.near) ** 2)) && (xp.copy(r).invert(), Ks.copy(e.ray).applyMatrix4(xp), !(n.boundingBox !== null && Ks.intersectsBox(n.boundingBox) === !1) && this._computeIntersections(e, t, Ks)));+ s !== void 0 && (n.boundingSphere === null && n.computeBoundingSphere(), xc.copy(n.boundingSphere), xc.applyMatrix4(r), Xs.copy(e.ray).recast(e.near), !(xc.containsPoint(Xs.origin) === !1 && (Xs.intersectSphere(xc, Sp) === null || Xs.origin.distanceToSquared(Sp) > (e.far - e.near) ** 2)) && (Cp.copy(r).invert(), Xs.copy(e.ray).applyMatrix4(Cp), !(n.boundingBox !== null && Xs.intersectsBox(n.boundingBox) === !1) && this._computeIntersections(e, t, Xs)));}_computeIntersections(e, t, n) {let s;@@ -8326,14 +8326,14 @@ class Jt extends kt {const A = d[m], p = a[A.materialIndex], y = Math.max(A.start, f.start), b = Math.min(o.count, Math.min(A.start + A.count, f.start + f.count));for (let _ = y, M = b; _ < M; _ += 3) {const w = o.getX(_), S = o.getX(_ + 1), T = o.getX(_ + 2);- s = Ec(this, p, e, n, l, h, u, w, S, T), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = A.materialIndex, t.push(s));+ s = Cc(this, p, e, n, l, h, u, w, S, T), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = A.materialIndex, t.push(s));}}else {const m = Math.max(0, f.start), g = Math.min(o.count, f.start + f.count);for (let A = m, p = g; A < p; A += 3) {const y = o.getX(A), b = o.getX(A + 1), _ = o.getX(A + 2);- s = Ec(this, a, e, n, l, h, u, y, b, _), s && (s.faceIndex = Math.floor(A / 3), t.push(s));+ s = Cc(this, a, e, n, l, h, u, y, b, _), s && (s.faceIndex = Math.floor(A / 3), t.push(s));}}else if (c !== void 0)@@ -8342,35 +8342,35 @@ class Jt extends kt {const A = d[m], p = a[A.materialIndex], y = Math.max(A.start, f.start), b = Math.min(c.count, Math.min(A.start + A.count, f.start + f.count));for (let _ = y, M = b; _ < M; _ += 3) {const w = _, S = _ + 1, T = _ + 2;- s = Ec(this, p, e, n, l, h, u, w, S, T), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = A.materialIndex, t.push(s));+ s = Cc(this, p, e, n, l, h, u, w, S, T), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = A.materialIndex, t.push(s));}}else {const m = Math.max(0, f.start), g = Math.min(c.count, f.start + f.count);for (let A = m, p = g; A < p; A += 3) {const y = A, b = A + 1, _ = A + 2;- s = Ec(this, a, e, n, l, h, u, y, b, _), s && (s.faceIndex = Math.floor(A / 3), t.push(s));+ s = Cc(this, a, e, n, l, h, u, y, b, _), s && (s.faceIndex = Math.floor(A / 3), t.push(s));}}}}-function y_(i, e, t, n, s, r, a, o) {+function T_(i, e, t, n, s, r, a, o) {let c;- if (e.side === Ln ? c = n.intersectTriangle(a, r, s, !0, o) : c = n.intersectTriangle(s, r, a, e.side === hs, o), c === null) return null;- xc.copy(o), xc.applyMatrix4(i.matrixWorld);- const l = t.ray.origin.distanceTo(xc);+ if (e.side === Ln ? c = n.intersectTriangle(a, r, s, !0, o) : c = n.intersectTriangle(s, r, a, e.side === us, o), c === null) return null;+ vc.copy(o), vc.applyMatrix4(i.matrixWorld);+ const l = t.ray.origin.distanceTo(vc);return l < t.near || l > t.far ? null : {distance: l,- point: xc.clone(),+ point: vc.clone(),object: i};}-function Ec(i, e, t, n, s, r, a, o, c, l) {- i.getVertexPosition(o, Ac), i.getVertexPosition(c, gc), i.getVertexPosition(l, mc);- const h = y_(i, e, t, n, Ac, gc, mc, _p);+function Cc(i, e, t, n, s, r, a, o, c, l) {+ i.getVertexPosition(o, Ec), i.getVertexPosition(c, _c), i.getVertexPosition(l, yc);+ const h = T_(i, e, t, n, Ec, _c, yc, Ip);if (h) {const u = new H();- gi.getBarycoord(_p, Ac, gc, mc, u), s && (h.uv = gi.getInterpolatedAttribute(s, o, c, l, u, new Ze())), r && (h.uv1 = gi.getInterpolatedAttribute(r, o, c, l, u, new Ze())), a && (h.normal = gi.getInterpolatedAttribute(a, o, c, l, u, new H()), h.normal.dot(n.direction) > 0 && h.normal.multiplyScalar(-1));+ mi.getBarycoord(Ip, Ec, _c, yc, u), s && (h.uv = mi.getInterpolatedAttribute(s, o, c, l, u, new Ze())), r && (h.uv1 = mi.getInterpolatedAttribute(r, o, c, l, u, new Ze())), a && (h.normal = mi.getInterpolatedAttribute(a, o, c, l, u, new H()), h.normal.dot(n.direction) > 0 && h.normal.multiplyScalar(-1));const d = {a: o,b: c,@@ -8378,11 +8378,11 @@ function Ec(i, e, t, n, s, r, a, o, c, l) {normal: new H(),materialIndex: 0};- gi.getNormal(Ac, gc, mc, d.normal), h.face = d, h.barycoord = u;+ mi.getNormal(Ec, _c, yc, d.normal), h.face = d, h.barycoord = u;}return h;}-class Na extends Hn {+class Pa extends Hn {/*** Constructs a new box geometry.*@@ -8407,15 +8407,15 @@ class Na extends Hn {const c = [], l = [], h = [], u = [];let d = 0, f = 0;m("z", "y", "x", -1, -1, n, t, e, a, r, 0), m("z", "y", "x", 1, -1, n, t, -e, a, r, 1), m("x", "z", "y", 1, 1, e, n, t, s, a, 2), m("x", "z", "y", 1, -1, e, n, -t, s, a, 3), m("x", "y", "z", 1, -1, e, t, n, s, r, 4), m("x", "y", "z", -1, -1, e, t, -n, s, r, 5), this.setIndex(c), this.setAttribute("position", new kn(l, 3)), this.setAttribute("normal", new kn(h, 3)), this.setAttribute("uv", new kn(u, 2));- function m(g, A, p, y, b, _, M, w, S, T, v) {- const C = _ / S, F = M / T, K = _ / 2, q = M / 2, $ = w / 2, D = S + 1, O = T + 1;- let j = 0, Q = 0;+ function m(g, A, p, y, b, _, M, w, S, T, C) {+ const v = _ / S, F = M / T, K = _ / 2, q = M / 2, $ = w / 2, D = S + 1, O = T + 1;+ let Y = 0, Q = 0;const J = new H();for (let ee = 0; ee < O; ee++) {const ae = ee * F - q;for (let ye = 0; ye < D; ye++) {- const Me = ye * C - K;- J[g] = Me * y, J[A] = ae * b, J[p] = $, l.push(J.x, J.y, J.z), J[g] = 0, J[A] = 0, J[p] = w > 0 ? 1 : -1, h.push(J.x, J.y, J.z), u.push(ye / S), u.push(1 - ee / T), j += 1;+ const Me = ye * v - K;+ J[g] = Me * y, J[A] = ae * b, J[p] = $, l.push(J.x, J.y, J.z), J[g] = 0, J[A] = 0, J[p] = w > 0 ? 1 : -1, h.push(J.x, J.y, J.z), u.push(ye / S), u.push(1 - ee / T), Y += 1;}}for (let ee = 0; ee < T; ee++)@@ -8423,7 +8423,7 @@ class Na extends Hn {const ye = d + ae + D * ee, Me = d + ae + D * (ee + 1), se = d + (ae + 1) + D * (ee + 1), me = d + (ae + 1) + D * ee;c.push(ye, Me, me), c.push(Me, se, me), Q += 6;}- o.addGroup(f, Q, v), f += Q, d += j;+ o.addGroup(f, Q, C), f += Q, d += Y;}}copy(e) {@@ -8437,10 +8437,10 @@ class Na extends Hn {* @return {BoxGeometry} A new instance.*/static fromJSON(e) {- return new Na(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);+ return new Pa(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);}}-function _a(i) {+function Ca(i) {const e = {};for (const t in i) {e[t] = {};@@ -8454,29 +8454,29 @@ function _a(i) {function Mn(i) {const e = {};for (let t = 0; t < i.length; t++) {- const n = _a(i[t]);+ const n = Ca(i[t]);for (const s in n)e[s] = n[s];}return e;}-function w_(i) {+function R_(i) {const e = [];for (let t = 0; t < i.length; t++)e.push(i[t].clone());return e;}-function Wm(i) {+function Zm(i) {const e = i.getRenderTarget();return e === null ? i.outputColorSpace : e.isXRRenderTarget === !0 ? e.texture.colorSpace : mt.workingColorSpace;}-const C_ = { clone: _a, merge: Mn };-var v_ = `void main() {+const N_ = { clone: Ca, merge: Mn };+var F_ = `void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );-}`, S_ = `void main() {+}`, D_ = `void main() {gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );}`;-class ks extends Ni {+class Os extends Fi {/*** Constructs a new shader material.*@@ -8487,7 +8487,7 @@ class ks extends Ni {* by {@link Color#set}.*/constructor(e) {- super(), this.isShaderMaterial = !0, this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.uniformsGroups = [], this.vertexShader = v_, this.fragmentShader = S_, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.forceSinglePass = !0, this.extensions = {+ super(), this.isShaderMaterial = !0, this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.uniformsGroups = [], this.vertexShader = F_, this.fragmentShader = D_, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.forceSinglePass = !0, this.extensions = {clipCullDistance: !1,// set to use vertex shader clippingmultiDraw: !1@@ -8499,7 +8499,7 @@ class ks extends Ni {}, 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 = _a(e.uniforms), this.uniformsGroups = w_(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 = Ca(e.uniforms), this.uniformsGroups = R_(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);@@ -8538,12 +8538,12 @@ class ks extends Ni {return Object.keys(n).length > 0 && (t.extensions = n), t;}}-class qm extends kt {+class $m extends kt {/*** Constructs a new camera.*/constructor() {- super(), this.isCamera = !0, this.type = "Camera", this.matrixWorldInverse = new st(), this.projectionMatrix = new st(), this.projectionMatrixInverse = new st(), this.coordinateSystem = ns;+ super(), this.isCamera = !0, this.type = "Camera", this.matrixWorldInverse = new st(), this.projectionMatrix = new st(), this.projectionMatrixInverse = new st(), this.coordinateSystem = is;}copy(e, t) {return super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this.coordinateSystem = e.coordinateSystem, this;@@ -8570,8 +8570,8 @@ class qm extends kt {return new this.constructor().copy(this);}}-const _s = /* @__PURE__ */ new H(), yp = /* @__PURE__ */ new Ze(), wp = /* @__PURE__ */ new Ze();-class Cn extends qm {+const ys = /* @__PURE__ */ new H(), Mp = /* @__PURE__ */ new Ze(), Bp = /* @__PURE__ */ new Ze();+class vn extends $m {/*** Constructs a new perspective camera.*@@ -8596,7 +8596,7 @@ class Cn extends qm {*/setFocalLength(e) {const t = 0.5 * this.getFilmHeight() / e;- this.fov = Ea * 2 * Math.atan(t), this.updateProjectionMatrix();+ this.fov = va * 2 * Math.atan(t), this.updateProjectionMatrix();}/*** Returns the focal length from the current {@link PerspectiveCamera#fov} and@@ -8605,7 +8605,7 @@ class Cn extends qm {* @return {number} The computed focal length.*/getFocalLength() {- const e = Math.tan(Ao * 0.5 * this.fov);+ const e = Math.tan(xo * 0.5 * this.fov);return 0.5 * this.getFilmHeight() / e;}/**@@ -8614,8 +8614,8 @@ class Cn extends qm {* @return {number} The effective FOV.*/getEffectiveFOV() {- return Ea * 2 * Math.atan(- Math.tan(Ao * 0.5 * this.fov) / this.zoom+ return va * 2 * Math.atan(+ Math.tan(xo * 0.5 * this.fov) / this.zoom);}/**@@ -8645,7 +8645,7 @@ class Cn extends qm {* @param {Vector2} maxTarget - The upper-right corner of the view rectangle is written into this vector.*/getViewBounds(e, t, n) {- _s.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse), t.set(_s.x, _s.y).multiplyScalar(-e / _s.z), _s.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse), n.set(_s.x, _s.y).multiplyScalar(-e / _s.z);+ ys.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse), t.set(ys.x, ys.y).multiplyScalar(-e / ys.z), ys.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse), n.set(ys.x, ys.y).multiplyScalar(-e / ys.z);}/*** Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.@@ -8655,7 +8655,7 @@ class Cn extends qm {* @returns {Vector2} The view size.*/getViewSize(e, t) {- return this.getViewBounds(e, yp, wp), t.subVectors(wp, yp);+ return this.getViewBounds(e, Mp, Bp), t.subVectors(Bp, Mp);}/*** Sets an offset in a larger frustum. This is useful for multi-window or@@ -8723,7 +8723,7 @@ class Cn extends qm {*/updateProjectionMatrix() {const e = this.near;- let t = e * Math.tan(Ao * 0.5 * this.fov) / this.zoom, n = 2 * t, s = this.aspect * n, r = -0.5 * s;+ let t = e * Math.tan(xo * 0.5 * this.fov) / this.zoom, n = 2 * t, s = this.aspect * n, r = -0.5 * s;const a = this.view;if (this.view !== null && this.view.enabled) {const c = a.fullWidth, l = a.fullHeight;@@ -8737,8 +8737,8 @@ class Cn extends qm {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 Hr = -90, zr = 1;-class I_ extends kt {+const Vr = -90, Wr = 1;+class L_ extends kt {/*** Constructs a new cube camera.*@@ -8748,17 +8748,17 @@ class I_ extends kt {*/constructor(e, t, n) {super(), this.type = "CubeCamera", this.renderTarget = n, this.coordinateSystem = null, this.activeMipmapLevel = 0;- const s = new Cn(Hr, zr, e, t);+ const s = new vn(Vr, Wr, e, t);s.layers = this.layers, this.add(s);- const r = new Cn(Hr, zr, e, t);+ const r = new vn(Vr, Wr, e, t);r.layers = this.layers, this.add(r);- const a = new Cn(Hr, zr, e, t);+ const a = new vn(Vr, Wr, e, t);a.layers = this.layers, this.add(a);- const o = new Cn(Hr, zr, e, t);+ const o = new vn(Vr, Wr, e, t);o.layers = this.layers, this.add(o);- const c = new Cn(Hr, zr, e, t);+ const c = new vn(Vr, Wr, e, t);c.layers = this.layers, this.add(c);- const l = new Cn(Hr, zr, e, t);+ const l = new vn(Vr, Wr, e, t);l.layers = this.layers, this.add(l);}/**@@ -8767,9 +8767,9 @@ class I_ extends kt {updateCoordinateSystem() {const e = this.coordinateSystem, t = this.children.concat(), [n, s, r, a, o, c] = t;for (const l of t) this.remove(l);- if (e === ns)+ if (e === is)n.up.set(0, 1, 0), n.lookAt(1, 0, 0), s.up.set(0, 1, 0), s.lookAt(-1, 0, 0), r.up.set(0, 0, -1), r.lookAt(0, 1, 0), a.up.set(0, 0, 1), a.lookAt(0, -1, 0), o.up.set(0, 1, 0), o.lookAt(0, 0, 1), c.up.set(0, 1, 0), c.lookAt(0, 0, -1);- else if (e === xl)+ else if (e === vl)n.up.set(0, -1, 0), n.lookAt(-1, 0, 0), s.up.set(0, -1, 0), s.lookAt(1, 0, 0), r.up.set(0, 0, 1), r.lookAt(0, 1, 0), a.up.set(0, 0, -1), a.lookAt(0, -1, 0), o.up.set(0, -1, 0), o.lookAt(0, 0, 1), c.up.set(0, -1, 0), c.lookAt(0, 0, -1);elsethrow new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: " + e);@@ -8793,7 +8793,7 @@ class I_ extends kt {n.texture.generateMipmaps = !1, e.setRenderTarget(n, 0, s), e.render(t, r), e.setRenderTarget(n, 1, s), e.render(t, a), e.setRenderTarget(n, 2, s), e.render(t, o), e.setRenderTarget(n, 3, s), e.render(t, c), e.setRenderTarget(n, 4, s), e.render(t, l), n.texture.generateMipmaps = g, e.setRenderTarget(n, 5, s), e.render(t, h), e.setRenderTarget(u, d, f), e.xr.enabled = m, n.texture.needsPMREMUpdate = !0;}}-class Km extends cn {+class e0 extends cn {/*** Constructs a new cube texture.*@@ -8808,7 +8808,7 @@ class Km extends cn {* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.* @param {string} [colorSpace=NoColorSpace] - The color space value.*/- constructor(e = [], t = gr, n, s, r, a, o, c, l, h) {+ constructor(e = [], t = br, n, s, r, a, o, c, l, h) {super(e, t, n, s, r, a, o, c, l, h), this.isCubeTexture = !0, this.flipY = !1;}/**@@ -8823,7 +8823,7 @@ class Km extends cn {this.image = e;}}-class M_ extends br {+class P_ extends Er {/*** Constructs a new cube render target.*@@ -8833,7 +8833,7 @@ class M_ extends br {constructor(e = 1, t = {}) {super(e, e, t), this.isWebGLCubeRenderTarget = !0;const n = { width: e, height: e, depth: 1 }, s = [n, n, n, n, n, n];- this.texture = new Km(s, t.mapping, t.wrapS, t.wrapT, t.magFilter, t.minFilter, t.format, t.type, t.anisotropy, t.colorSpace), this.texture.isRenderTargetTexture = !0, this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : !1, this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : qt;+ this.texture = new e0(s, t.mapping, t.wrapS, t.wrapT, t.magFilter, t.minFilter, t.format, t.type, t.anisotropy, t.colorSpace), this.texture.isRenderTargetTexture = !0, this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : !1, this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : qt;}/*** Converts the given equirectangular texture to a cube map.@@ -8891,17 +8891,17 @@ class M_ extends br {}`)- }, s = new Na(5, 5, 5), r = new ks({+ }, s = new Pa(5, 5, 5), r = new Os({name: "CubemapFromEquirect",- uniforms: _a(n.uniforms),+ uniforms: Ca(n.uniforms),vertexShader: n.vertexShader,fragmentShader: n.fragmentShader,side: Ln,- blending: Fs+ blending: Ds});r.uniforms.tEquirect.value = t;const a = new Jt(s, r), o = t.minFilter;- return t.minFilter === ni && (t.minFilter = qt), new I_(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;+ return t.minFilter === ii && (t.minFilter = qt), new L_(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;}/*** Clears this cube render target.@@ -8918,13 +8918,13 @@ class M_ extends br {e.setRenderTarget(r);}}-class lr extends kt {+class ur extends kt {constructor() {super(), this.isGroup = !0, this.type = "Group";}}-const B_ = { type: "move" };-class Sh {+const k_ = { type: "move" };+class Nh {/*** Constructs a new XR controller.*/@@ -8937,7 +8937,7 @@ class Sh {* @return {Group} A group representing the hand space of the XR controller.*/getHandSpace() {- return this._hand === null && (this._hand = new lr(), this._hand.matrixAutoUpdate = !1, this._hand.visible = !1, this._hand.joints = {}, this._hand.inputState = { pinching: !1 }), this._hand;+ return this._hand === null && (this._hand = new ur(), this._hand.matrixAutoUpdate = !1, this._hand.visible = !1, this._hand.joints = {}, this._hand.inputState = { pinching: !1 }), this._hand;}/*** Returns a group representing the target ray space of the XR controller.@@ -8945,7 +8945,7 @@ class Sh {* @return {Group} A group representing the target ray space of the XR controller.*/getTargetRaySpace() {- return this._targetRay === null && (this._targetRay = new lr(), this._targetRay.matrixAutoUpdate = !1, this._targetRay.visible = !1, this._targetRay.hasLinearVelocity = !1, this._targetRay.linearVelocity = new H(), this._targetRay.hasAngularVelocity = !1, this._targetRay.angularVelocity = new H()), this._targetRay;+ return this._targetRay === null && (this._targetRay = new ur(), this._targetRay.matrixAutoUpdate = !1, this._targetRay.visible = !1, this._targetRay.hasLinearVelocity = !1, this._targetRay.linearVelocity = new H(), this._targetRay.hasAngularVelocity = !1, this._targetRay.angularVelocity = new H()), this._targetRay;}/*** Returns a group representing the grip space of the XR controller.@@ -8953,7 +8953,7 @@ class Sh {* @return {Group} A group representing the grip space of the XR controller.*/getGripSpace() {- return this._grip === null && (this._grip = new lr(), this._grip.matrixAutoUpdate = !1, this._grip.visible = !1, this._grip.hasLinearVelocity = !1, this._grip.linearVelocity = new H(), this._grip.hasAngularVelocity = !1, this._grip.angularVelocity = new H()), this._grip;+ return this._grip === null && (this._grip = new ur(), this._grip.matrixAutoUpdate = !1, this._grip.visible = !1, this._grip.hasLinearVelocity = !1, this._grip.linearVelocity = new H(), this._grip.hasAngularVelocity = !1, this._grip.angularVelocity = new H()), this._grip;}/*** Dispatches the given event to the groups representing@@ -9021,7 +9021,7 @@ class Sh {}));} elsec !== null && e.gripSpace && (r = t.getPose(e.gripSpace, n), r !== null && (c.matrix.fromArray(r.transform.matrix), c.matrix.decompose(c.position, c.rotation, c.scale), c.matrixWorldNeedsUpdate = !0, r.linearVelocity ? (c.hasLinearVelocity = !0, c.linearVelocity.copy(r.linearVelocity)) : c.hasLinearVelocity = !1, r.angularVelocity ? (c.hasAngularVelocity = !0, c.angularVelocity.copy(r.angularVelocity)) : c.hasAngularVelocity = !1));- o !== null && (s = t.getPose(e.targetRaySpace, n), s === null && r !== null && (s = r), s !== null && (o.matrix.fromArray(s.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), o.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (o.hasLinearVelocity = !0, o.linearVelocity.copy(s.linearVelocity)) : o.hasLinearVelocity = !1, s.angularVelocity ? (o.hasAngularVelocity = !0, o.angularVelocity.copy(s.angularVelocity)) : o.hasAngularVelocity = !1, this.dispatchEvent(B_)));+ o !== null && (s = t.getPose(e.targetRaySpace, n), s === null && r !== null && (s = r), s !== null && (o.matrix.fromArray(s.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), o.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (o.hasLinearVelocity = !0, o.linearVelocity.copy(s.linearVelocity)) : o.hasLinearVelocity = !1, s.angularVelocity ? (o.hasAngularVelocity = !0, o.angularVelocity.copy(s.angularVelocity)) : o.hasAngularVelocity = !1, this.dispatchEvent(k_)));}return o !== null && (o.visible = s !== null), c !== null && (c.visible = r !== null), l !== null && (l.visible = a !== null), this;}@@ -9035,18 +9035,18 @@ class Sh {*/_getHandJoint(e, t) {if (e.joints[t.jointName] === void 0) {- const n = new lr();+ const n = new ur();n.matrixAutoUpdate = !1, n.visible = !1, e.joints[t.jointName] = n, e.add(n);}return e.joints[t.jointName];}}-class rd extends kt {+class ud extends kt {/*** Constructs a new scene.*/constructor() {- super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Fi(), this.environmentIntensity = 1, this.environmentRotation = new Fi(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));+ super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Di(), this.environmentIntensity = 1, this.environmentRotation = new Di(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));}copy(e, t) {return super.copy(e, t), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), this.backgroundBlurriness = e.backgroundBlurriness, this.backgroundIntensity = e.backgroundIntensity, this.backgroundRotation.copy(e.backgroundRotation), this.environmentIntensity = e.environmentIntensity, this.environmentRotation.copy(e.environmentRotation), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.matrixAutoUpdate = e.matrixAutoUpdate, this;@@ -9056,7 +9056,7 @@ class rd extends kt {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 T_ {+class U_ {/*** Constructs a new interleaved buffer.*@@ -9064,7 +9064,7 @@ class T_ {* @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 = sd, this.updateRanges = [], this.version = 0, this.uuid = xi();+ this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e !== void 0 ? e.length / t : 0, this.usage = hd, this.updateRanges = [], this.version = 0, this.uuid = Ei();}/*** A callback function that is executed after the renderer has transferred the attribute array@@ -9149,7 +9149,7 @@ class T_ {* @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 = xi()), 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 = Ei()), 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;}@@ -9171,7 +9171,7 @@ class T_ {* @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 = xi()), 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 = Ei()), 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,@@ -9179,8 +9179,8 @@ class T_ {};}}-const vn = /* @__PURE__ */ new H();-class cf {+const Cn = /* @__PURE__ */ new H();+class pf {/*** Constructs a new interleaved buffer attribute.*@@ -9229,7 +9229,7 @@ class cf {*/applyMatrix4(e) {for (let t = 0, n = this.data.count; t < n; t++)- vn.fromBufferAttribute(this, t), vn.applyMatrix4(e), this.setXYZ(t, vn.x, vn.y, vn.z);+ Cn.fromBufferAttribute(this, t), Cn.applyMatrix4(e), this.setXYZ(t, Cn.x, Cn.y, Cn.z);return this;}/**@@ -9241,7 +9241,7 @@ class cf {*/applyNormalMatrix(e) {for (let t = 0, n = this.count; t < n; t++)- vn.fromBufferAttribute(this, t), vn.applyNormalMatrix(e), this.setXYZ(t, vn.x, vn.y, vn.z);+ Cn.fromBufferAttribute(this, t), Cn.applyNormalMatrix(e), this.setXYZ(t, Cn.x, Cn.y, Cn.z);return this;}/**@@ -9253,7 +9253,7 @@ class cf {*/transformDirection(e) {for (let t = 0, n = this.count; t < n; t++)- vn.fromBufferAttribute(this, t), vn.transformDirection(e), this.setXYZ(t, vn.x, vn.y, vn.z);+ Cn.fromBufferAttribute(this, t), Cn.transformDirection(e), this.setXYZ(t, Cn.x, Cn.y, Cn.z);return this;}/**@@ -9265,7 +9265,7 @@ class cf {*/getComponent(e, t) {let n = this.array[e * this.data.stride + this.offset + t];- return this.normalized && (n = Ai(n, this.array)), n;+ return this.normalized && (n = gi(n, this.array)), n;}/*** Sets the given value to the given component of the vector at the given index.@@ -9326,7 +9326,7 @@ class cf {*/getX(e) {let t = this.data.array[e * this.data.stride + this.offset];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Returns the y component of the vector at the given index.@@ -9336,7 +9336,7 @@ class cf {*/getY(e) {let t = this.data.array[e * this.data.stride + this.offset + 1];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Returns the z component of the vector at the given index.@@ -9346,7 +9346,7 @@ class cf {*/getZ(e) {let t = this.data.array[e * this.data.stride + this.offset + 2];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Returns the w component of the vector at the given index.@@ -9356,7 +9356,7 @@ class cf {*/getW(e) {let t = this.data.array[e * this.data.stride + this.offset + 3];- return this.normalized && (t = Ai(t, this.array)), t;+ return this.normalized && (t = gi(t, this.array)), t;}/*** Sets the x and y component of the vector at the given index.@@ -9413,7 +9413,7 @@ class cf {}return new _n(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 cf(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 pf(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);}/*** Serializes the buffer attribute into JSON.@@ -9448,8 +9448,8 @@ class cf {};}}-const Cp = /* @__PURE__ */ new H(), vp = /* @__PURE__ */ new wt(), Sp = /* @__PURE__ */ new wt(), R_ = /* @__PURE__ */ new H(), Ip = /* @__PURE__ */ new st(), _c = /* @__PURE__ */ new H(), Ih = /* @__PURE__ */ new Pi(), Mp = /* @__PURE__ */ new st(), Mh = /* @__PURE__ */ new zo();-class N_ extends Jt {+const Tp = /* @__PURE__ */ new H(), Rp = /* @__PURE__ */ new wt(), Np = /* @__PURE__ */ new wt(), O_ = /* @__PURE__ */ new H(), Fp = /* @__PURE__ */ new st(), Sc = /* @__PURE__ */ new H(), Fh = /* @__PURE__ */ new ki(), Dp = /* @__PURE__ */ new st(), Dh = /* @__PURE__ */ new jo();+class Q_ extends Jt {/*** Constructs a new skinned mesh.*@@ -9457,7 +9457,7 @@ class N_ extends Jt {* @param {Material|Array<Material>} [material] - The mesh material.*/constructor(e, t) {- super(e, t), this.isSkinnedMesh = !0, this.type = "SkinnedMesh", this.bindMode = np, this.bindMatrix = new st(), this.bindMatrixInverse = new st(), this.boundingBox = null, this.boundingSphere = null;+ super(e, t), this.isSkinnedMesh = !0, this.type = "SkinnedMesh", this.bindMode = cp, this.bindMatrix = new st(), this.bindMatrixInverse = new st(), this.boundingBox = null, this.boundingSphere = null;}/*** Computes the bounding box of the skinned mesh, and updates {@link SkinnedMesh#boundingBox}.@@ -9467,10 +9467,10 @@ class N_ extends Jt {*/computeBoundingBox() {const e = this.geometry;- this.boundingBox === null && (this.boundingBox = new Li()), this.boundingBox.makeEmpty();+ this.boundingBox === null && (this.boundingBox = new Pi()), this.boundingBox.makeEmpty();const t = e.getAttribute("position");for (let n = 0; n < t.count; n++)- this.getVertexPosition(n, _c), this.boundingBox.expandByPoint(_c);+ this.getVertexPosition(n, Sc), this.boundingBox.expandByPoint(Sc);}/*** Computes the bounding sphere of the skinned mesh, and updates {@link SkinnedMesh#boundingSphere}.@@ -9480,17 +9480,17 @@ class N_ extends Jt {*/computeBoundingSphere() {const e = this.geometry;- this.boundingSphere === null && (this.boundingSphere = new Pi()), this.boundingSphere.makeEmpty();+ this.boundingSphere === null && (this.boundingSphere = new ki()), this.boundingSphere.makeEmpty();const t = e.getAttribute("position");for (let n = 0; n < t.count; n++)- this.getVertexPosition(n, _c), this.boundingSphere.expandByPoint(_c);+ this.getVertexPosition(n, Sc), this.boundingSphere.expandByPoint(Sc);}copy(e, t) {return super.copy(e, t), this.bindMode = e.bindMode, this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), this.skeleton = e.skeleton, e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this;}raycast(e, t) {const n = this.material, s = this.matrixWorld;- n !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), Ih.copy(this.boundingSphere), Ih.applyMatrix4(s), e.ray.intersectsSphere(Ih) !== !1 && (Mp.copy(s).invert(), Mh.copy(e.ray).applyMatrix4(Mp), !(this.boundingBox !== null && Mh.intersectsBox(this.boundingBox) === !1) && this._computeIntersections(e, t, Mh)));+ n !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), Fh.copy(this.boundingSphere), Fh.applyMatrix4(s), e.ray.intersectsSphere(Fh) !== !1 && (Dp.copy(s).invert(), Dh.copy(e.ray).applyMatrix4(Dp), !(this.boundingBox !== null && Dh.intersectsBox(this.boundingBox) === !1) && this._computeIntersections(e, t, Dh)));}getVertexPosition(e, t) {return super.getVertexPosition(e, t), this.applyBoneTransform(e, t), t;@@ -9524,7 +9524,7 @@ class N_ extends Jt {}}updateMatrixWorld(e) {- super.updateMatrixWorld(e), this.bindMode === np ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === CE ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode);+ super.updateMatrixWorld(e), this.bindMode === cp ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === NE ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode);}/*** Applies the bone transform associated with the given index to the given@@ -9537,18 +9537,18 @@ class N_ extends Jt {*/applyBoneTransform(e, t) {const n = this.skeleton, s = this.geometry;- vp.fromBufferAttribute(s.attributes.skinIndex, e), Sp.fromBufferAttribute(s.attributes.skinWeight, e), Cp.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0);+ Rp.fromBufferAttribute(s.attributes.skinIndex, e), Np.fromBufferAttribute(s.attributes.skinWeight, e), Tp.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0);for (let r = 0; r < 4; r++) {- const a = Sp.getComponent(r);+ const a = Np.getComponent(r);if (a !== 0) {- const o = vp.getComponent(r);- Ip.multiplyMatrices(n.bones[o].matrixWorld, n.boneInverses[o]), t.addScaledVector(R_.copy(Cp).applyMatrix4(Ip), a);+ const o = Rp.getComponent(r);+ Fp.multiplyMatrices(n.bones[o].matrixWorld, n.boneInverses[o]), t.addScaledVector(O_.copy(Tp).applyMatrix4(Fp), a);}}return t.applyMatrix4(this.bindMatrixInverse);}}-class Xm extends kt {+class t0 extends kt {/*** Constructs a new bone.*/@@ -9556,7 +9556,7 @@ class Xm extends kt {super(), this.isBone = !0, this.type = "Bone";}}-class kl extends cn {+class Hl extends cn {/*** Constructs a new data texture.*@@ -9577,8 +9577,8 @@ class kl extends cn {super(null, a, o, c, l, h, s, r, u, d), this.isDataTexture = !0, this.image = { data: e, width: t, height: n }, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;}}-const Bp = /* @__PURE__ */ new st(), F_ = /* @__PURE__ */ new st();-class lf {+const Lp = /* @__PURE__ */ new st(), G_ = /* @__PURE__ */ new st();+class Af {/*** Constructs a new skeleton.*@@ -9587,7 +9587,7 @@ class lf {* If not provided, these matrices will be computed automatically via {@link Skeleton#calculateInverses}.*/constructor(e = [], t = []) {- this.uuid = xi(), this.bones = e.slice(0), this.boneInverses = t, this.boneMatrices = null, this.boneTexture = null, this.init();+ this.uuid = Ei(), 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@@ -9634,8 +9634,8 @@ class lf {update() {const e = this.bones, t = this.boneInverses, n = this.boneMatrices, s = this.boneTexture;for (let r = 0, a = e.length; r < a; r++) {- const o = e[r] ? e[r].matrixWorld : F_;- Bp.multiplyMatrices(o, t[r]), Bp.toArray(n, r * 16);+ const o = e[r] ? e[r].matrixWorld : G_;+ Lp.multiplyMatrices(o, t[r]), Lp.toArray(n, r * 16);}s !== null && (s.needsUpdate = !0);}@@ -9645,7 +9645,7 @@ class lf {* @return {Skeleton} A clone of this instance.*/clone() {- return new lf(this.bones, this.boneInverses);+ return new Af(this.bones, this.boneInverses);}/*** Computes a data texture for passing bone data to the vertex shader.@@ -9657,7 +9657,7 @@ class lf {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 kl(t, e, e, on, an);+ const n = new Hl(t, e, e, on, an);return n.needsUpdate = !0, this.boneMatrices = t, this.boneTexture = n, this;}/**@@ -9693,7 +9693,7 @@ class lf {for (let n = 0, s = e.bones.length; n < s; n++) {const r = e.bones[n];let a = t[r];- a === void 0 && (console.warn("THREE.Skeleton: No bone found with UUID:", r), a = new Xm()), this.bones.push(a), this.boneInverses.push(new st().fromArray(e.boneInverses[n]));+ a === void 0 && (console.warn("THREE.Skeleton: No bone found with UUID:", r), a = new t0()), this.bones.push(a), this.boneInverses.push(new st().fromArray(e.boneInverses[n]));}return this.init(), this;}@@ -9724,7 +9724,7 @@ class lf {return e;}}-class ad extends _n {+class dd extends _n {/*** Constructs a new instanced buffer attribute.*@@ -9744,8 +9744,8 @@ class ad extends _n {return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = !0, e;}}-const Vr = /* @__PURE__ */ new st(), Tp = /* @__PURE__ */ new st(), yc = [], Rp = /* @__PURE__ */ new Li(), D_ = /* @__PURE__ */ new st(), Ka = /* @__PURE__ */ new Jt(), Xa = /* @__PURE__ */ new Pi();-class Ym extends Jt {+const qr = /* @__PURE__ */ new st(), Pp = /* @__PURE__ */ new st(), Ic = [], kp = /* @__PURE__ */ new Pi(), H_ = /* @__PURE__ */ new st(), Ja = /* @__PURE__ */ new Jt(), Za = /* @__PURE__ */ new ki();+class n0 extends Jt {/*** Constructs a new instanced mesh.*@@ -9754,9 +9754,9 @@ class Ym extends Jt {* @param {number} count - The number of instances.*/constructor(e, t, n) {- super(e, t), this.isInstancedMesh = !0, this.instanceMatrix = new ad(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 dd(new Float32Array(n * 16), 16), this.instanceColor = null, this.morphTexture = null, this.count = n, this.boundingBox = null, this.boundingSphere = null;for (let s = 0; s < n; s++)- this.setMatrixAt(s, D_);+ this.setMatrixAt(s, H_);}/*** Computes the bounding box of the instanced mesh, and updates {@link InstancedMesh#boundingBox}.@@ -9765,9 +9765,9 @@ class Ym extends Jt {*/computeBoundingBox() {const e = this.geometry, t = this.count;- this.boundingBox === null && (this.boundingBox = new Li()), e.boundingBox === null && e.computeBoundingBox(), this.boundingBox.makeEmpty();+ this.boundingBox === null && (this.boundingBox = new Pi()), e.boundingBox === null && e.computeBoundingBox(), this.boundingBox.makeEmpty();for (let n = 0; n < t; n++)- this.getMatrixAt(n, Vr), Rp.copy(e.boundingBox).applyMatrix4(Vr), this.boundingBox.union(Rp);+ this.getMatrixAt(n, qr), kp.copy(e.boundingBox).applyMatrix4(qr), this.boundingBox.union(kp);}/*** Computes the bounding sphere of the instanced mesh, and updates {@link InstancedMesh#boundingSphere}@@ -9776,9 +9776,9 @@ class Ym extends Jt {*/computeBoundingSphere() {const e = this.geometry, t = this.count;- this.boundingSphere === null && (this.boundingSphere = new Pi()), e.boundingSphere === null && e.computeBoundingSphere(), this.boundingSphere.makeEmpty();+ this.boundingSphere === null && (this.boundingSphere = new ki()), e.boundingSphere === null && e.computeBoundingSphere(), this.boundingSphere.makeEmpty();for (let n = 0; n < t; n++)- this.getMatrixAt(n, Vr), Xa.copy(e.boundingSphere).applyMatrix4(Vr), this.boundingSphere.union(Xa);+ this.getMatrixAt(n, qr), Za.copy(e.boundingSphere).applyMatrix4(qr), this.boundingSphere.union(Za);}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;@@ -9814,14 +9814,14 @@ class Ym extends Jt {}raycast(e, t) {const n = this.matrixWorld, s = this.count;- if (Ka.geometry = this.geometry, Ka.material = this.material, Ka.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), Xa.copy(this.boundingSphere), Xa.applyMatrix4(n), e.ray.intersectsSphere(Xa) !== !1))+ if (Ja.geometry = this.geometry, Ja.material = this.material, Ja.material !== void 0 && (this.boundingSphere === null && this.computeBoundingSphere(), Za.copy(this.boundingSphere), Za.applyMatrix4(n), e.ray.intersectsSphere(Za) !== !1))for (let r = 0; r < s; r++) {- this.getMatrixAt(r, Vr), Tp.multiplyMatrices(n, Vr), Ka.matrixWorld = Tp, Ka.raycast(e, yc);- for (let a = 0, o = yc.length; a < o; a++) {- const c = yc[a];+ this.getMatrixAt(r, qr), Pp.multiplyMatrices(n, qr), Ja.matrixWorld = Pp, Ja.raycast(e, Ic);+ for (let a = 0, o = Ic.length; a < o; a++) {+ const c = Ic[a];c.instanceId = r, c.object = this, t.push(c);}- yc.length = 0;+ Ic.length = 0;}}/**@@ -9832,7 +9832,7 @@ class Ym extends Jt {* @param {Color} color - The instance color.*/setColorAt(e, t) {- this.instanceColor === null && (this.instanceColor = new ad(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3)), t.toArray(this.instanceColor.array, e * 3);+ this.instanceColor === null && (this.instanceColor = new dd(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@@ -9854,7 +9854,7 @@ class Ym extends Jt {*/setMorphAt(e, t) {const n = t.morphTargetInfluences, s = n.length + 1;- this.morphTexture === null && (this.morphTexture = new kl(new Float32Array(s * this.count), s, this.count, ts, an));+ this.morphTexture === null && (this.morphTexture = new Hl(new Float32Array(s * this.count), s, this.count, ns, an));const r = this.morphTexture.source.data.data;let a = 0;for (let l = 0; l < n.length; l++)@@ -9872,8 +9872,8 @@ class Ym extends Jt {this.dispatchEvent({ type: "dispose" }), this.morphTexture !== null && (this.morphTexture.dispose(), this.morphTexture = null);}}-const Bh = /* @__PURE__ */ new H(), L_ = /* @__PURE__ */ new H(), P_ = /* @__PURE__ */ new rt();-class Ts {+const Lh = /* @__PURE__ */ new H(), z_ = /* @__PURE__ */ new H(), V_ = /* @__PURE__ */ new rt();+class Rs {/*** Constructs a new plane.*@@ -9928,7 +9928,7 @@ class Ts {* @return {Plane} A reference to this plane.*/setFromCoplanarPoints(e, t, n) {- const s = Bh.subVectors(n, t).cross(L_.subVectors(e, t)).normalize();+ const s = Lh.subVectors(n, t).cross(z_.subVectors(e, t)).normalize();return this.setFromNormalAndCoplanarPoint(s, e), this;}/**@@ -9995,7 +9995,7 @@ class Ts {* @return {?Vector3} The intersection point.*/intersectLine(e, t) {- const n = e.delta(Bh), s = this.normal.dot(n);+ const n = e.delta(Lh), s = this.normal.dot(n);if (s === 0)return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;const r = -(e.start.dot(this.normal) + this.constant) / s;@@ -10052,7 +10052,7 @@ class Ts {* @return {Plane} A reference to this plane.*/applyMatrix4(e, t) {- const n = t || P_.getNormalMatrix(e), s = this.coplanarPoint(Bh).applyMatrix4(e), r = this.normal.applyMatrix3(n).normalize();+ const n = t || V_.getNormalMatrix(e), s = this.coplanarPoint(Lh).applyMatrix4(e), r = this.normal.applyMatrix3(n).normalize();return this.constant = -s.dot(r), this;}/**@@ -10083,8 +10083,8 @@ class Ts {return new this.constructor().copy(this);}}-const Xs = /* @__PURE__ */ new Pi(), wc = /* @__PURE__ */ new H();-class hf {+const Ys = /* @__PURE__ */ new ki(), Mc = /* @__PURE__ */ new H();+class gf {/*** Constructs a new frustum.*@@ -10095,7 +10095,7 @@ class hf {* @param {Plane} [p4] - The fifth plane that encloses the frustum.* @param {Plane} [p5] - The sixth plane that encloses the frustum.*/- constructor(e = new Ts(), t = new Ts(), n = new Ts(), s = new Ts(), r = new Ts(), a = new Ts()) {+ constructor(e = new Rs(), t = new Rs(), n = new Rs(), s = new Rs(), r = new Rs(), a = new Rs()) {this.planes = [e, t, n, s, r, a];}/**@@ -10132,11 +10132,11 @@ class hf {* @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system.* @return {Frustum} A reference to this frustum.*/- setFromProjectionMatrix(e, t = ns) {+ setFromProjectionMatrix(e, t = is) {const n = this.planes, s = e.elements, r = s[0], a = s[1], o = s[2], c = s[3], l = s[4], h = s[5], u = s[6], d = s[7], f = s[8], m = s[9], g = s[10], A = s[11], p = s[12], y = s[13], b = s[14], _ = s[15];- if (n[0].setComponents(c - r, d - l, A - f, _ - p).normalize(), n[1].setComponents(c + r, d + l, A + f, _ + p).normalize(), n[2].setComponents(c + a, d + h, A + m, _ + y).normalize(), n[3].setComponents(c - a, d - h, A - m, _ - y).normalize(), n[4].setComponents(c - o, d - u, A - g, _ - b).normalize(), t === ns)+ if (n[0].setComponents(c - r, d - l, A - f, _ - p).normalize(), n[1].setComponents(c + r, d + l, A + f, _ + p).normalize(), n[2].setComponents(c + a, d + h, A + m, _ + y).normalize(), n[3].setComponents(c - a, d - h, A - m, _ - y).normalize(), n[4].setComponents(c - o, d - u, A - g, _ - b).normalize(), t === is)n[5].setComponents(c + o, d + u, A + g, _ + b).normalize();- else if (t === xl)+ else if (t === vl)n[5].setComponents(o, u, g, b).normalize();elsethrow new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + t);@@ -10152,12 +10152,12 @@ class hf {*/intersectsObject(e) {if (e.boundingSphere !== void 0)- e.boundingSphere === null && e.computeBoundingSphere(), Xs.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);+ e.boundingSphere === null && e.computeBoundingSphere(), Ys.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else {const t = e.geometry;- t.boundingSphere === null && t.computeBoundingSphere(), Xs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld);+ t.boundingSphere === null && t.computeBoundingSphere(), Ys.copy(t.boundingSphere).applyMatrix4(e.matrixWorld);}- return this.intersectsSphere(Xs);+ return this.intersectsSphere(Ys);}/*** Returns `true` if the given sprite is intersecting this frustum.@@ -10166,7 +10166,7 @@ class hf {* @return {boolean} Whether the sprite is intersecting this frustum or not.*/intersectsSprite(e) {- return Xs.center.set(0, 0, 0), Xs.radius = 0.7071067811865476, Xs.applyMatrix4(e.matrixWorld), this.intersectsSphere(Xs);+ return Ys.center.set(0, 0, 0), Ys.radius = 0.7071067811865476, Ys.applyMatrix4(e.matrixWorld), this.intersectsSphere(Ys);}/*** Returns `true` if the given bounding sphere is intersecting this frustum.@@ -10191,7 +10191,7 @@ class hf {const t = this.planes;for (let n = 0; n < 6; n++) {const s = t[n];- if (wc.x = s.normal.x > 0 ? e.max.x : e.min.x, wc.y = s.normal.y > 0 ? e.max.y : e.min.y, wc.z = s.normal.z > 0 ? e.max.z : e.min.z, s.distanceToPoint(wc) < 0)+ if (Mc.x = s.normal.x > 0 ? e.max.x : e.min.x, Mc.y = s.normal.y > 0 ? e.max.y : e.min.y, Mc.z = s.normal.z > 0 ? e.max.z : e.min.z, s.distanceToPoint(Mc) < 0)return !1;}return !0;@@ -10218,7 +10218,7 @@ class hf {return new this.constructor().copy(this);}}-class Vo extends Ni {+class Xo extends Fi {/*** Constructs a new line basic material.*@@ -10229,21 +10229,21 @@ class Vo extends Ni {* by {@link Color#set}.*/constructor(e) {- super(), this.isLineBasicMaterial = !0, this.type = "LineBasicMaterial", this.color = new Xe(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 je(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 El = /* @__PURE__ */ new H(), _l = /* @__PURE__ */ new H(), Np = /* @__PURE__ */ new st(), Ya = /* @__PURE__ */ new zo(), Cc = /* @__PURE__ */ new Pi(), Th = /* @__PURE__ */ new H(), Fp = /* @__PURE__ */ new H();-class uf extends kt {+const Cl = /* @__PURE__ */ new H(), Sl = /* @__PURE__ */ new H(), Up = /* @__PURE__ */ new st(), $a = /* @__PURE__ */ new jo(), Bc = /* @__PURE__ */ new ki(), Ph = /* @__PURE__ */ new H(), Op = /* @__PURE__ */ new H();+class mf extends kt {/*** Constructs a new line.** @param {BufferGeometry} [geometry] - The line geometry.* @param {Material|Array<Material>} [material] - The line material.*/- constructor(e = new Hn(), t = new Vo()) {+ constructor(e = new Hn(), t = new Xo()) {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) {@@ -10261,7 +10261,7 @@ class uf extends kt {if (e.index === null) {const t = e.attributes.position, n = [0];for (let s = 1, r = t.count; s < r; s++)- El.fromBufferAttribute(t, s - 1), _l.fromBufferAttribute(t, s), n[s] = n[s - 1], n[s] += El.distanceTo(_l);+ Cl.fromBufferAttribute(t, s - 1), Sl.fromBufferAttribute(t, s), n[s] = n[s - 1], n[s] += Cl.distanceTo(Sl);e.setAttribute("lineDistance", new kn(n, 1));} elseconsole.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");@@ -10275,27 +10275,27 @@ class uf extends kt {*/raycast(e, t) {const n = this.geometry, s = this.matrixWorld, r = e.params.Line.threshold, a = n.drawRange;- if (n.boundingSphere === null && n.computeBoundingSphere(), Cc.copy(n.boundingSphere), Cc.applyMatrix4(s), Cc.radius += r, e.ray.intersectsSphere(Cc) === !1) return;- Np.copy(s).invert(), Ya.copy(e.ray).applyMatrix4(Np);+ if (n.boundingSphere === null && n.computeBoundingSphere(), Bc.copy(n.boundingSphere), Bc.applyMatrix4(s), Bc.radius += r, e.ray.intersectsSphere(Bc) === !1) return;+ Up.copy(s).invert(), $a.copy(e.ray).applyMatrix4(Up);const o = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = o * o, l = this.isLineSegments ? 2 : 1, h = n.index, d = n.attributes.position;if (h !== null) {const f = Math.max(0, a.start), m = Math.min(h.count, a.start + a.count);for (let g = f, A = m - 1; g < A; g += l) {- const p = h.getX(g), y = h.getX(g + 1), b = vc(this, e, Ya, c, p, y, g);+ const p = h.getX(g), y = h.getX(g + 1), b = Tc(this, e, $a, c, p, y, g);b && t.push(b);}if (this.isLineLoop) {- const g = h.getX(m - 1), A = h.getX(f), p = vc(this, e, Ya, c, g, A, m - 1);+ const g = h.getX(m - 1), A = h.getX(f), p = Tc(this, e, $a, c, g, A, m - 1);p && t.push(p);}} else {const f = Math.max(0, a.start), m = Math.min(d.count, a.start + a.count);for (let g = f, A = m - 1; g < A; g += l) {- const p = vc(this, e, Ya, c, g, g + 1, g);+ const p = Tc(this, e, $a, c, g, g + 1, g);p && t.push(p);}if (this.isLineLoop) {- const g = vc(this, e, Ya, c, m - 1, f, m - 1);+ const g = Tc(this, e, $a, c, m - 1, f, m - 1);g && t.push(g);}}@@ -10318,17 +10318,17 @@ class uf extends kt {}}}-function vc(i, e, t, n, s, r, a) {+function Tc(i, e, t, n, s, r, a) {const o = i.geometry.attributes.position;- if (El.fromBufferAttribute(o, s), _l.fromBufferAttribute(o, r), t.distanceSqToSegment(El, _l, Th, Fp) > n) return;- Th.applyMatrix4(i.matrixWorld);- const l = e.ray.origin.distanceTo(Th);+ if (Cl.fromBufferAttribute(o, s), Sl.fromBufferAttribute(o, r), t.distanceSqToSegment(Cl, Sl, Ph, Op) > n) return;+ Ph.applyMatrix4(i.matrixWorld);+ const l = e.ray.origin.distanceTo(Ph);if (!(l < e.near || l > e.far))return {distance: l,// What do we want? intersection point on the ray or on the segment??// point: raycaster.ray.at( distance ),- point: Fp.clone().applyMatrix4(i.matrixWorld),+ point: Op.clone().applyMatrix4(i.matrixWorld),index: a,face: null,faceIndex: null,@@ -10336,8 +10336,8 @@ function vc(i, e, t, n, s, r, a) {object: i};}-const Dp = /* @__PURE__ */ new H(), Lp = /* @__PURE__ */ new H();-class Ul extends uf {+const Qp = /* @__PURE__ */ new H(), Gp = /* @__PURE__ */ new H();+class zl extends mf {/*** Constructs a new line segments.*@@ -10352,14 +10352,14 @@ class Ul extends uf {if (e.index === null) {const t = e.attributes.position, n = [];for (let s = 0, r = t.count; s < r; s += 2)- Dp.fromBufferAttribute(t, s), Lp.fromBufferAttribute(t, s + 1), n[s] = s === 0 ? 0 : n[s - 1], n[s + 1] = n[s] + Dp.distanceTo(Lp);+ Qp.fromBufferAttribute(t, s), Gp.fromBufferAttribute(t, s + 1), n[s] = s === 0 ? 0 : n[s - 1], n[s + 1] = n[s] + Qp.distanceTo(Gp);e.setAttribute("lineDistance", new kn(n, 1));} elseconsole.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this;}}-class k_ extends uf {+class W_ extends mf {/*** Constructs a new line loop.*@@ -10370,7 +10370,7 @@ class k_ extends uf {super(e, t), this.isLineLoop = !0, this.type = "LineLoop";}}-class df extends Ni {+class bf extends Fi {/*** Constructs a new points material.*@@ -10381,21 +10381,21 @@ class df extends Ni {* by {@link Color#set}.*/constructor(e) {- super(), this.isPointsMaterial = !0, this.type = "PointsMaterial", this.color = new Xe(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 je(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 Pp = /* @__PURE__ */ new st(), od = /* @__PURE__ */ new zo(), Sc = /* @__PURE__ */ new Pi(), Ic = /* @__PURE__ */ new H();-class U_ extends kt {+const Hp = /* @__PURE__ */ new st(), fd = /* @__PURE__ */ new jo(), Rc = /* @__PURE__ */ new ki(), Nc = /* @__PURE__ */ new H();+class q_ extends kt {/*** Constructs a new point cloud.** @param {BufferGeometry} [geometry] - The points geometry.* @param {Material|Array<Material>} [material] - The points material.*/- constructor(e = new Hn(), t = new df()) {+ constructor(e = new Hn(), t = new bf()) {super(), this.isPoints = !0, this.type = "Points", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();}copy(e, t) {@@ -10409,19 +10409,19 @@ class U_ extends kt {*/raycast(e, t) {const n = this.geometry, s = this.matrixWorld, r = e.params.Points.threshold, a = n.drawRange;- if (n.boundingSphere === null && n.computeBoundingSphere(), Sc.copy(n.boundingSphere), Sc.applyMatrix4(s), Sc.radius += r, e.ray.intersectsSphere(Sc) === !1) return;- Pp.copy(s).invert(), od.copy(e.ray).applyMatrix4(Pp);+ if (n.boundingSphere === null && n.computeBoundingSphere(), Rc.copy(n.boundingSphere), Rc.applyMatrix4(s), Rc.radius += r, e.ray.intersectsSphere(Rc) === !1) return;+ Hp.copy(s).invert(), fd.copy(e.ray).applyMatrix4(Hp);const o = r / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = o * o, l = n.index, u = n.attributes.position;if (l !== null) {const d = Math.max(0, a.start), f = Math.min(l.count, a.start + a.count);for (let m = d, g = f; m < g; m++) {const A = l.getX(m);- Ic.fromBufferAttribute(u, A), kp(Ic, A, c, s, e, t, this);+ Nc.fromBufferAttribute(u, A), zp(Nc, A, c, s, e, t, this);}} else {const d = Math.max(0, a.start), f = Math.min(u.count, a.start + a.count);for (let m = d, g = f; m < g; m++)- Ic.fromBufferAttribute(u, m), kp(Ic, m, c, s, e, t, this);+ Nc.fromBufferAttribute(u, m), zp(Nc, m, c, s, e, t, this);}}/**@@ -10442,11 +10442,11 @@ class U_ extends kt {}}}-function kp(i, e, t, n, s, r, a) {- const o = od.distanceSqToPoint(i);+function zp(i, e, t, n, s, r, a) {+ const o = fd.distanceSqToPoint(i);if (o < t) {const c = new H();- od.closestPointToPoint(i, c), c.applyMatrix4(n);+ fd.closestPointToPoint(i, c), c.applyMatrix4(n);const l = s.ray.origin.distanceTo(c);if (l < s.near || l > s.far) return;r.push({@@ -10461,7 +10461,7 @@ function kp(i, e, t, n, s, r, a) {});}}-class Ol extends cn {+class Vl extends cn {/*** Constructs a new compressed texture.*@@ -10483,7 +10483,7 @@ class Ol extends cn {super(null, a, o, c, l, h, s, r, u, d), this.isCompressedTexture = !0, this.image = { width: t, height: n }, this.mipmaps = e, this.flipY = !1, this.generateMipmaps = !1;}}-class O_ extends Ol {+class K_ extends Vl {/*** Constructs a new compressed array texture.*@@ -10496,7 +10496,7 @@ class O_ extends Ol {* @param {number} [type=UnsignedByteType] - The min filter value.*/constructor(e, t, n, s, r, a) {- super(e, t, n, r, a), this.isCompressedArrayTexture = !0, this.image.depth = s, this.wrapR = bi, this.layerUpdates = /* @__PURE__ */ new Set();+ super(e, t, n, r, a), this.isCompressedArrayTexture = !0, this.image.depth = s, this.wrapR = xi, this.layerUpdates = /* @__PURE__ */ new Set();}/*** Describes that a specific layer of the texture needs to be updated.@@ -10517,7 +10517,7 @@ class O_ extends Ol {this.layerUpdates.clear();}}-class Q_ extends Ol {+class j_ extends Vl {/*** Constructs a new compressed texture.*@@ -10526,10 +10526,10 @@ class Q_ extends Ol {* @param {number} [type=UnsignedByteType] - The texture type.*/constructor(e, t, n) {- super(void 0, e[0].width, e[0].height, t, n, gr), this.isCompressedCubeTexture = !0, this.isCubeTexture = !0, this.image = e;+ super(void 0, e[0].width, e[0].height, t, n, br), this.isCompressedCubeTexture = !0, this.isCubeTexture = !0, this.image = e;}}-class jm extends cn {+class i0 extends cn {/*** Constructs a new depth texture.*@@ -10544,20 +10544,20 @@ class jm extends cn {* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.* @param {number} [format=DepthFormat] - The texture format.*/- constructor(e, t, n = mr, s, r, a, o = Pn, c = Pn, l, h = vo) {- if (h !== vo && h !== So)+ constructor(e, t, n = xr, s, r, a, o = Pn, c = Pn, l, h = Bo) {+ if (h !== Bo && h !== To)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null, s, r, a, o, c, h, n, l), this.isDepthTexture = !0, this.image = { width: e, height: t }, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;}copy(e) {- return super.copy(e), this.source = new of(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this;+ return super.copy(e), this.source = new ff(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this;}toJSON(e) {const t = super.toJSON(e);return this.compareFunction !== null && (t.compareFunction = this.compareFunction), t;}}-class Ql extends Hn {+class Wl extends Hn {/*** Constructs a new plane geometry.*@@ -10599,10 +10599,10 @@ class Ql extends Hn {* @return {PlaneGeometry} A new instance.*/static fromJSON(e) {- return new Ql(e.width, e.height, e.widthSegments, e.heightSegments);+ return new Wl(e.width, e.height, e.widthSegments, e.heightSegments);}}-class No extends Ni {+class Po extends Fi {/*** Constructs a new mesh standard material.*@@ -10613,13 +10613,13 @@ class No extends Ni {* by {@link Color#set}.*/constructor(e) {- super(), this.isMeshStandardMaterial = !0, this.type = "MeshStandardMaterial", this.defines = { STANDARD: "" }, this.color = new Xe(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 Xe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Lm, this.normalScale = new Ze(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 Fi(), 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 je(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 je(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Hm, this.normalScale = new Ze(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 Di(), 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 ki extends No {+class Ui extends Po {/*** Constructs a new mesh physical material.*@@ -10640,7 +10640,7 @@ class ki extends No {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 Xe(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 Xe(1, 1, 1), this.specularIntensity = 1, this.specularIntensityMap = null, this.specularColor = new Xe(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 je(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 je(1, 1, 1), this.specularIntensity = 1, this.specularIntensityMap = null, this.specularColor = new je(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.@@ -10732,7 +10732,7 @@ class ki extends No {}, this.anisotropy = e.anisotropy, this.anisotropyRotation = e.anisotropyRotation, this.anisotropyMap = e.anisotropyMap, this.clearcoat = e.clearcoat, this.clearcoatMap = e.clearcoatMap, this.clearcoatRoughness = e.clearcoatRoughness, this.clearcoatRoughnessMap = e.clearcoatRoughnessMap, this.clearcoatNormalMap = e.clearcoatNormalMap, this.clearcoatNormalScale.copy(e.clearcoatNormalScale), this.dispersion = e.dispersion, this.ior = e.ior, this.iridescence = e.iridescence, this.iridescenceMap = e.iridescenceMap, this.iridescenceIOR = e.iridescenceIOR, this.iridescenceThicknessRange = [...e.iridescenceThicknessRange], this.iridescenceThicknessMap = e.iridescenceThicknessMap, this.sheen = e.sheen, this.sheenColor.copy(e.sheenColor), this.sheenColorMap = e.sheenColorMap, this.sheenRoughness = e.sheenRoughness, this.sheenRoughnessMap = e.sheenRoughnessMap, this.transmission = e.transmission, this.transmissionMap = e.transmissionMap, this.thickness = e.thickness, this.thicknessMap = e.thicknessMap, this.attenuationDistance = e.attenuationDistance, this.attenuationColor.copy(e.attenuationColor), this.specularIntensity = e.specularIntensity, this.specularIntensityMap = e.specularIntensityMap, this.specularColor.copy(e.specularColor), this.specularColorMap = e.specularColorMap, this;}}-class G_ extends Ni {+class X_ extends Fi {/*** Constructs a new mesh depth material.*@@ -10743,13 +10743,13 @@ class G_ extends Ni {* by {@link Color#set}.*/constructor(e) {- super(), this.isMeshDepthMaterial = !0, this.type = "MeshDepthMaterial", this.depthPacking = ME, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.setValues(e);+ super(), this.isMeshDepthMaterial = !0, this.type = "MeshDepthMaterial", this.depthPacking = PE, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.setValues(e);}copy(e) {return super.copy(e), this.depthPacking = e.depthPacking, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this;}}-class H_ extends Ni {+class Y_ extends Fi {/*** Constructs a new mesh distance material.*@@ -10766,13 +10766,13 @@ class H_ extends Ni {return super.copy(e), this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this;}}-function Mc(i, e) {+function Fc(i, e) {return !i || i.constructor === e ? i : typeof e.BYTES_PER_ELEMENT == "number" ? new e(i) : Array.prototype.slice.call(i);}-function z_(i) {+function J_(i) {return ArrayBuffer.isView(i) && !(i instanceof DataView);}-function V_(i) {+function Z_(i) {function e(s, r) {return i[s] - i[r];}@@ -10780,7 +10780,7 @@ function V_(i) {for (let s = 0; s !== t; ++s) n[s] = s;return n.sort(e), n;}-function Up(i, e, t) {+function Vp(i, e, t) {const n = i.length, s = new i.constructor(n);for (let r = 0, a = 0; a !== n; ++r) {const o = t[r] * e;@@ -10789,7 +10789,7 @@ function Up(i, e, t) {}return s;}-function Jm(i, e, t, n) {+function s0(i, e, t, n) {let s = 1, r = i[0];for (; r !== void 0 && r[n] === void 0; )r = i[s++];@@ -10809,7 +10809,7 @@ function Jm(i, e, t, n) {a = r[n], a !== void 0 && (e.push(r.time), t.push(a)), r = i[s++];while (r !== void 0);}-class Wo {+class Yo {/*** Constructs a new interpolant.*@@ -10918,7 +10918,7 @@ class Wo {intervalChanged_() {}}-class W_ extends Wo {+class $_ extends Yo {/*** Constructs a new cubic interpolant.*@@ -10929,8 +10929,8 @@ class W_ extends Wo {*/constructor(e, t, n, s) {super(e, t, n, s), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = {- endingStart: ea,- endingEnd: ea+ endingStart: na,+ endingEnd: na};}intervalChanged_(e, t, n) {@@ -10938,10 +10938,10 @@ class W_ extends Wo {let r = e - 2, a = e + 1, o = s[r], c = s[a];if (o === void 0)switch (this.getSettings_().endingStart) {- case ta:+ case ia:r = e, o = 2 * t - n;break;- case ml:+ case yl:r = s.length - 2, o = t + s[r] - s[r + 1];break;default:@@ -10949,10 +10949,10 @@ class W_ extends Wo {}if (c === void 0)switch (this.getSettings_().endingEnd) {- case ta:+ case ia:a = e, c = 2 * n - t;break;- case ml:+ case yl:a = 1, c = n + s[1] - s[0];break;default:@@ -10968,7 +10968,7 @@ class W_ extends Wo {return r;}}-class Zm extends Wo {+class r0 extends Yo {/*** Constructs a new linear interpolant.*@@ -10987,7 +10987,7 @@ class Zm extends Wo {return r;}}-class q_ extends Wo {+class ey extends Yo {/*** Constructs a new discrete interpolant.*@@ -11003,7 +11003,7 @@ class q_ extends Wo {return this.copySampleValue_(e - 1);}}-class Ei {+class _i {/*** Constructs a new keyframe track.*@@ -11015,7 +11015,7 @@ class Ei {constructor(e, t, n, s) {if (e === void 0) throw new Error("THREE.KeyframeTrack: track name is undefined");if (t === void 0 || t.length === 0) throw new Error("THREE.KeyframeTrack: no keyframes in track named " + e);- this.name = e, this.times = Mc(t, this.TimeBufferType), this.values = Mc(n, this.ValueBufferType), this.setInterpolation(s || this.DefaultInterpolation);+ this.name = e, this.times = Fc(t, this.TimeBufferType), this.values = Fc(n, this.ValueBufferType), this.setInterpolation(s || this.DefaultInterpolation);}/*** Converts the keyframe track to JSON.@@ -11032,8 +11032,8 @@ class Ei {else {n = {name: e.name,- times: Mc(e.times, Array),- values: Mc(e.values, Array)+ times: Fc(e.times, Array),+ values: Fc(e.values, Array)};const s = e.getInterpolation();s !== e.DefaultInterpolation && (n.interpolation = s);@@ -11048,7 +11048,7 @@ class Ei {* @return {DiscreteInterpolant} The new interpolant.*/InterpolantFactoryMethodDiscrete(e) {- return new q_(this.times, this.values, this.getValueSize(), e);+ return new ey(this.times, this.values, this.getValueSize(), e);}/*** Factory method for creating a new linear interpolant.@@ -11058,7 +11058,7 @@ class Ei {* @return {LinearInterpolant} The new interpolant.*/InterpolantFactoryMethodLinear(e) {- return new Zm(this.times, this.values, this.getValueSize(), e);+ return new r0(this.times, this.values, this.getValueSize(), e);}/*** Factory method for creating a new smooth interpolant.@@ -11068,7 +11068,7 @@ class Ei {* @return {CubicInterpolant} The new interpolant.*/InterpolantFactoryMethodSmooth(e) {- return new W_(this.times, this.values, this.getValueSize(), e);+ return new $_(this.times, this.values, this.getValueSize(), e);}/*** Defines the interpolation factor method for this keyframe track.@@ -11079,13 +11079,13 @@ class Ei {setInterpolation(e) {let t;switch (e) {- case Bo:+ case Fo:t = this.InterpolantFactoryMethodDiscrete;break;- case To:+ case Do:t = this.InterpolantFactoryMethodLinear;break;- case ah:+ case dh:t = this.InterpolantFactoryMethodSmooth;break;}@@ -11108,11 +11108,11 @@ class Ei {getInterpolation() {switch (this.createInterpolant) {case this.InterpolantFactoryMethodDiscrete:- return Bo;+ return Fo;case this.InterpolantFactoryMethodLinear:- return To;+ return Do;case this.InterpolantFactoryMethodSmooth:- return ah;+ return dh;}}/**@@ -11200,7 +11200,7 @@ class Ei {}a = c;}- if (s !== void 0 && z_(s))+ if (s !== void 0 && J_(s))for (let o = 0, c = s.length; o !== c; ++o) {const l = s[o];if (isNaN(l)) {@@ -11217,7 +11217,7 @@ class Ei {* @return {AnimationClip} A reference to this animation clip.*/optimize() {- const e = this.times.slice(), t = this.values.slice(), n = this.getValueSize(), s = this.getInterpolation() === ah, r = e.length - 1;+ const e = this.times.slice(), t = this.values.slice(), n = this.getValueSize(), s = this.getInterpolation() === dh, r = e.length - 1;let a = 1;for (let o = 1; o < r; ++o) {let c = !1;@@ -11263,11 +11263,11 @@ class Ei {return s.createInterpolant = this.createInterpolant, s;}}-Ei.prototype.ValueTypeName = "";-Ei.prototype.TimeBufferType = Float32Array;-Ei.prototype.ValueBufferType = Float32Array;-Ei.prototype.DefaultInterpolation = To;-class Fa extends Ei {+_i.prototype.ValueTypeName = "";+_i.prototype.TimeBufferType = Float32Array;+_i.prototype.ValueBufferType = Float32Array;+_i.prototype.DefaultInterpolation = Do;+class ka extends _i {/*** Constructs a new boolean keyframe track.*@@ -11282,12 +11282,12 @@ class Fa extends Ei {super(e, t, n);}}-Fa.prototype.ValueTypeName = "bool";-Fa.prototype.ValueBufferType = Array;-Fa.prototype.DefaultInterpolation = Bo;-Fa.prototype.InterpolantFactoryMethodLinear = void 0;-Fa.prototype.InterpolantFactoryMethodSmooth = void 0;-class $m extends Ei {+ka.prototype.ValueTypeName = "bool";+ka.prototype.ValueBufferType = Array;+ka.prototype.DefaultInterpolation = Fo;+ka.prototype.InterpolantFactoryMethodLinear = void 0;+ka.prototype.InterpolantFactoryMethodSmooth = void 0;+class a0 extends _i {/*** Constructs a new color keyframe track.*@@ -11300,8 +11300,8 @@ class $m extends Ei {super(e, t, n, s);}}-$m.prototype.ValueTypeName = "color";-class ya extends Ei {+a0.prototype.ValueTypeName = "color";+class Sa extends _i {/*** Constructs a new number keyframe track.*@@ -11314,8 +11314,8 @@ class ya extends Ei {super(e, t, n, s);}}-ya.prototype.ValueTypeName = "number";-class K_ extends Wo {+Sa.prototype.ValueTypeName = "number";+class ty extends Yo {/*** Constructs a new SLERP interpolant.*@@ -11331,11 +11331,11 @@ class K_ extends Wo {const r = this.resultBuffer, a = this.sampleValues, o = this.valueSize, c = (n - t) / (s - t);let l = e * o;for (let h = l + o; l !== h; l += 4)- Yn.slerpFlat(r, 0, a, l - o, a, l, c);+ Xn.slerpFlat(r, 0, a, l - o, a, l, c);return r;}}-class wa extends Ei {+class Ia extends _i {/*** Constructs a new Quaternion keyframe track.*@@ -11355,12 +11355,12 @@ class wa extends Ei {* @return {QuaternionLinearInterpolant} The new interpolant.*/InterpolantFactoryMethodLinear(e) {- return new K_(this.times, this.values, this.getValueSize(), e);+ return new ty(this.times, this.values, this.getValueSize(), e);}}-wa.prototype.ValueTypeName = "quaternion";-wa.prototype.InterpolantFactoryMethodSmooth = void 0;-class Da extends Ei {+Ia.prototype.ValueTypeName = "quaternion";+Ia.prototype.InterpolantFactoryMethodSmooth = void 0;+class Ua extends _i {/*** Constructs a new string keyframe track.*@@ -11375,12 +11375,12 @@ class Da extends Ei {super(e, t, n);}}-Da.prototype.ValueTypeName = "string";-Da.prototype.ValueBufferType = Array;-Da.prototype.DefaultInterpolation = Bo;-Da.prototype.InterpolantFactoryMethodLinear = void 0;-Da.prototype.InterpolantFactoryMethodSmooth = void 0;-class Ca extends Ei {+Ua.prototype.ValueTypeName = "string";+Ua.prototype.ValueBufferType = Array;+Ua.prototype.DefaultInterpolation = Fo;+Ua.prototype.InterpolantFactoryMethodLinear = void 0;+Ua.prototype.InterpolantFactoryMethodSmooth = void 0;+class Ma extends _i {/*** Constructs a new vector keyframe track.*@@ -11393,8 +11393,8 @@ class Ca extends Ei {super(e, t, n, s);}}-Ca.prototype.ValueTypeName = "vector";-class cd {+Ma.prototype.ValueTypeName = "vector";+class pd {/*** Constructs a new animation clip.*@@ -11409,8 +11409,8 @@ class cd {* @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode=NormalAnimationBlendMode] - Defines how the animation* is blended/combined when two or more animations are simultaneously played.*/- constructor(e = "", t = -1, n = [], s = rf) {- this.name = e, this.tracks = n, this.duration = t, this.blendMode = s, this.uuid = xi(), this.duration < 0 && this.resetDuration();+ constructor(e = "", t = -1, n = [], s = uf) {+ this.name = e, this.tracks = n, this.duration = t, this.blendMode = s, this.uuid = Ei(), this.duration < 0 && this.resetDuration();}/*** Factory method for creating an animation clip from the given JSON.@@ -11422,7 +11422,7 @@ class cd {static parse(e) {const t = [], n = e.tracks, s = 1 / (e.fps || 1);for (let a = 0, o = n.length; a !== o; ++a)- t.push(Y_(n[a]).scale(s));+ t.push(iy(n[a]).scale(s));const r = new this(e.name, e.duration, t, e.blendMode);return r.uuid = e.uuid, r;}@@ -11442,7 +11442,7 @@ class cd {blendMode: e.blendMode};for (let r = 0, a = n.length; r !== a; ++r)- t.push(Ei.toJSON(n[r]));+ t.push(_i.toJSON(n[r]));return s;}/**@@ -11468,9 +11468,9 @@ class cd {o,(o + 1) % r), l.push(0, 1, 0);- const h = V_(c);- c = Up(c, 1, h), l = Up(l, 1, h), !s && c[0] === 0 && (c.push(r), l.push(l[0])), a.push(- new ya(+ const h = Z_(c);+ c = Vp(c, 1, h), l = Vp(l, 1, h), !s && c[0] === 0 && (c.push(r), l.push(l[0])), a.push(+ new Sa(".morphTargetInfluences[" + t[o].name + "]",c,l@@ -11543,7 +11543,7 @@ class cd {const n = function(u, d, f, m, g) {if (f.length !== 0) {const A = [], p = [];- Jm(f, A, p, m), A.length !== 0 && g.push(new u(d, A, p));+ s0(f, A, p, m), A.length !== 0 && g.push(new u(d, A, p));}}, s = [], r = e.name || "default", a = e.fps || 30, o = e.blendMode;let c = e.length || -1;@@ -11564,25 +11564,25 @@ class cd {const b = d[m];A.push(b.time), p.push(b.morphTarget === g ? 1 : 0);}- s.push(new ya(".morphTargetInfluence[" + g + "]", A, p));+ s.push(new Sa(".morphTargetInfluence[" + g + "]", A, p));}c = f.length * a;} else {const f = ".bones[" + t[u].name + "]";n(- Ca,+ Ma,f + ".position",d,"pos",s), n(- wa,+ Ia,f + ".quaternion",d,"rot",s), n(- Ca,+ Ma,f + ".scale",d,"scl",@@ -11659,42 +11659,42 @@ class cd {return this.constructor.toJSON(this);}}-function X_(i) {+function ny(i) {switch (i.toLowerCase()) {case "scalar":case "double":case "float":case "number":case "integer":- return ya;+ return Sa;case "vector":case "vector2":case "vector3":case "vector4":- return Ca;+ return Ma;case "color":- return $m;+ return a0;case "quaternion":- return wa;+ return Ia;case "bool":case "boolean":- return Fa;+ return ka;case "string":- return Da;+ return Ua;}throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + i);}-function Y_(i) {+function iy(i) {if (i.type === void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");- const e = X_(i.type);+ const e = ny(i.type);if (i.times === void 0) {const t = [], n = [];- Jm(i.keys, t, n, "value"), i.times = t, i.values = n;+ s0(i.keys, t, n, "value"), i.times = t, i.values = n;}return e.parse !== void 0 ? e.parse(i) : new e(i.name, i.times, i.values, i.interpolation);}-const is = {+const ss = {/*** Whether caching is enabled or not.*@@ -11750,7 +11750,7 @@ const is = {this.files = {};}};-class e0 {+class o0 {/*** Constructs a new loading manager.*@@ -11787,15 +11787,15 @@ class e0 {};}}-const j_ = /* @__PURE__ */ new e0();-class fs {+const sy = /* @__PURE__ */ new o0();+class ps {/*** Constructs a new loader.** @param {LoadingManager} [manager] - The loading manager.*/constructor(e) {- this.manager = e !== void 0 ? e : j_, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {};+ this.manager = e !== void 0 ? e : sy, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {};}/*** This method needs to be implemented by all concrete loaders. It holds the@@ -11880,14 +11880,14 @@ class fs {return this.requestHeader = e, this;}}-fs.DEFAULT_MATERIAL_NAME = "__DEFAULT";-const Wi = {};-class J_ extends Error {+ps.DEFAULT_MATERIAL_NAME = "__DEFAULT";+const qi = {};+class ry extends Error {constructor(e, t) {super(e), this.response = t;}}-class Ls extends fs {+class Ps extends ps {/*** Constructs a new file loader.*@@ -11907,20 +11907,20 @@ class Ls extends fs {*/load(e, t, n, s) {e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);- const r = is.get(e);+ const r = ss.get(e);if (r !== void 0)return this.manager.itemStart(e), setTimeout(() => {t && t(r), this.manager.itemEnd(e);}, 0), r;- if (Wi[e] !== void 0) {- Wi[e].push({+ if (qi[e] !== void 0) {+ qi[e].push({onLoad: t,onProgress: n,onError: s});return;}- Wi[e] = [], Wi[e].push({+ qi[e] = [], qi[e].push({onLoad: t,onProgress: n,onError: s@@ -11934,7 +11934,7 @@ class Ls extends fs {if (l.status === 200 || l.status === 0) {if (l.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || l.body === void 0 || l.body.getReader === void 0)return l;- const h = Wi[e], u = l.body.getReader(), d = l.headers.get("X-File-Size") || l.headers.get("Content-Length"), f = d ? parseInt(d) : 0, m = f !== 0;+ const h = qi[e], u = l.body.getReader(), d = l.headers.get("X-File-Size") || l.headers.get("Content-Length"), f = d ? parseInt(d) : 0, m = f !== 0;let g = 0;const A = new ReadableStream({start(p) {@@ -11960,7 +11960,7 @@ class Ls extends fs {});return new Response(A);} else- throw new J_(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`, l);+ throw new ry(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`, l);}).then((l) => {switch (c) {case "arraybuffer":@@ -11980,18 +11980,18 @@ class Ls extends fs {}}}).then((l) => {- is.add(e, l);- const h = Wi[e];- delete Wi[e];+ ss.add(e, l);+ const h = qi[e];+ delete qi[e];for (let u = 0, d = h.length; u < d; u++) {const f = h[u];f.onLoad && f.onLoad(l);}}).catch((l) => {- const h = Wi[e];+ const h = qi[e];if (h === void 0)throw this.manager.itemError(e), l;- delete Wi[e];+ delete qi[e];for (let u = 0, d = h.length; u < d; u++) {const f = h[u];f.onError && f.onError(l);@@ -12020,7 +12020,7 @@ class Ls extends fs {return this.mimeType = e, this;}}-class Z_ extends fs {+class ay extends ps {/*** Constructs a new image loader.*@@ -12043,14 +12043,14 @@ class Z_ extends fs {*/load(e, t, n, s) {this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);- const r = this, a = is.get(e);+ const r = this, a = ss.get(e);if (a !== void 0)return r.manager.itemStart(e), setTimeout(function() {t && t(a), r.manager.itemEnd(e);}, 0), a;- const o = Ro("img");+ const o = Lo("img");function c() {- h(), is.add(e, this), t && t(this), r.manager.itemEnd(e);+ h(), ss.add(e, this), t && t(this), r.manager.itemEnd(e);}function l(u) {h(), s && s(u), r.manager.itemError(e), r.manager.itemEnd(e);@@ -12061,7 +12061,7 @@ class Z_ extends fs {return o.addEventListener("load", c, !1), o.addEventListener("error", l, !1), e.slice(0, 5) !== "data:" && this.crossOrigin !== void 0 && (o.crossOrigin = this.crossOrigin), r.manager.itemStart(e), o.src = e, o;}}-class $_ extends fs {+class oy extends ps {/*** Constructs a new data texture loader.*@@ -12083,7 +12083,7 @@ class $_ extends fs {* @return {DataTexture} The data texture.*/load(e, t, n, s) {- const r = this, a = new kl(), o = new Ls(this.manager);+ const r = this, a = new Hl(), o = new Ps(this.manager);return o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(r.withCredentials), o.load(e, function(c) {let l;try {@@ -12096,11 +12096,11 @@ class $_ extends fs {return;}}- l.image !== void 0 ? a.image = l.image : l.data !== void 0 && (a.image.width = l.width, a.image.height = l.height, a.image.data = l.data), a.wrapS = l.wrapS !== void 0 ? l.wrapS : bi, a.wrapT = l.wrapT !== void 0 ? l.wrapT : bi, a.magFilter = l.magFilter !== void 0 ? l.magFilter : qt, a.minFilter = l.minFilter !== void 0 ? l.minFilter : qt, a.anisotropy = l.anisotropy !== void 0 ? l.anisotropy : 1, l.colorSpace !== void 0 && (a.colorSpace = l.colorSpace), l.flipY !== void 0 && (a.flipY = l.flipY), l.format !== void 0 && (a.format = l.format), l.type !== void 0 && (a.type = l.type), l.mipmaps !== void 0 && (a.mipmaps = l.mipmaps, a.minFilter = ni), l.mipmapCount === 1 && (a.minFilter = qt), l.generateMipmaps !== void 0 && (a.generateMipmaps = l.generateMipmaps), a.needsUpdate = !0, t && t(a, l);+ l.image !== void 0 ? a.image = l.image : l.data !== void 0 && (a.image.width = l.width, a.image.height = l.height, a.image.data = l.data), a.wrapS = l.wrapS !== void 0 ? l.wrapS : xi, a.wrapT = l.wrapT !== void 0 ? l.wrapT : xi, a.magFilter = l.magFilter !== void 0 ? l.magFilter : qt, a.minFilter = l.minFilter !== void 0 ? l.minFilter : qt, a.anisotropy = l.anisotropy !== void 0 ? l.anisotropy : 1, l.colorSpace !== void 0 && (a.colorSpace = l.colorSpace), l.flipY !== void 0 && (a.flipY = l.flipY), l.format !== void 0 && (a.format = l.format), l.type !== void 0 && (a.type = l.type), l.mipmaps !== void 0 && (a.mipmaps = l.mipmaps, a.minFilter = ii), l.mipmapCount === 1 && (a.minFilter = qt), l.generateMipmaps !== void 0 && (a.generateMipmaps = l.generateMipmaps), a.needsUpdate = !0, t && t(a, l);}, n, s), a;}}-class ey extends fs {+class cy extends ps {/*** Constructs a new texture loader.*@@ -12122,13 +12122,13 @@ class ey extends fs {* @return {Texture} The texture.*/load(e, t, n, s) {- const r = new cn(), a = new Z_(this.manager);+ const r = new cn(), a = new ay(this.manager);return a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load(e, function(o) {r.image = o, r.needsUpdate = !0, t !== void 0 && t(r);}, n, s), r;}}-class qo extends kt {+class Jo extends kt {/*** Constructs a new light.*@@ -12136,7 +12136,7 @@ class qo extends kt {* @param {number} [intensity=1] - The light's strength/intensity.*/constructor(e, t = 1) {- super(), this.isLight = !0, this.type = "Light", this.color = new Xe(e), this.intensity = t;+ super(), this.isLight = !0, this.type = "Light", this.color = new je(e), this.intensity = t;}/*** Frees the GPU-related resources allocated by this instance. Call this@@ -12152,7 +12152,7 @@ class qo extends kt {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;}}-class ty extends qo {+class ly extends Jo {/*** Constructs a new hemisphere light.*@@ -12161,21 +12161,21 @@ class ty extends qo {* @param {number} [intensity=1] - The light's strength/intensity.*/constructor(e, t, n) {- super(e, n), this.isHemisphereLight = !0, this.type = "HemisphereLight", this.position.copy(kt.DEFAULT_UP), this.updateMatrix(), this.groundColor = new Xe(t);+ super(e, n), this.isHemisphereLight = !0, this.type = "HemisphereLight", this.position.copy(kt.DEFAULT_UP), this.updateMatrix(), this.groundColor = new je(t);}copy(e, t) {return super.copy(e, t), this.groundColor.copy(e.groundColor), this;}}-const Rh = /* @__PURE__ */ new st(), Op = /* @__PURE__ */ new H(), Qp = /* @__PURE__ */ new H();-class ff {+const kh = /* @__PURE__ */ new st(), Wp = /* @__PURE__ */ new H(), qp = /* @__PURE__ */ new H();+class xf {/*** 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 Ze(512, 512), this.mapType = rn, this.map = null, this.mapPass = null, this.matrix = new st(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new hf(), this._frameExtents = new Ze(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 Ze(512, 512), this.mapType = rn, this.map = null, this.mapPass = null, this.matrix = new st(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new gf(), this._frameExtents = new Ze(1, 1), this._viewportCount = 1, this._viewports = [new wt(0, 0, 1, 1)];}@@ -12203,7 +12203,7 @@ class ff {*/updateMatrices(e) {const t = this.camera, n = this.matrix;- Op.setFromMatrixPosition(e.matrixWorld), t.position.copy(Op), Qp.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(Qp), t.updateMatrixWorld(), Rh.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Rh), n.set(+ Wp.setFromMatrixPosition(e.matrixWorld), t.position.copy(Wp), qp.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(qp), t.updateMatrixWorld(), kh.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(kh), n.set(0.5,0,0,@@ -12220,7 +12220,7 @@ class ff {0,0,1- ), n.multiply(Rh);+ ), n.multiply(kh);}/*** Returns a viewport definition for the given viewport index.@@ -12274,22 +12274,22 @@ class ff {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 ny extends ff {+class hy extends xf {/*** Constructs a new spot light shadow.*/constructor() {- super(new Cn(50, 1, 0.5, 500)), this.isSpotLightShadow = !0, this.focus = 1;+ super(new vn(50, 1, 0.5, 500)), this.isSpotLightShadow = !0, this.focus = 1;}updateMatrices(e) {- const t = this.camera, n = Ea * 2 * e.angle * this.focus, s = this.mapSize.width / this.mapSize.height, r = e.distance || t.far;+ const t = this.camera, n = va * 2 * e.angle * this.focus, s = this.mapSize.width / this.mapSize.height, r = e.distance || t.far;(n !== t.fov || s !== t.aspect || r !== t.far) && (t.fov = n, t.aspect = s, t.far = r, t.updateProjectionMatrix()), super.updateMatrices(e);}copy(e) {return super.copy(e), this.focus = e.focus, this;}}-class iy extends qo {+class uy extends Jo {/*** Constructs a new spot light.*@@ -12301,7 +12301,7 @@ class iy extends qo {* @param {number} [decay=2] - The amount the light dims along the distance of the light.*/constructor(e, t, n = 0, s = Math.PI / 3, r = 0, a = 2) {- super(e, t), this.isSpotLight = !0, this.type = "SpotLight", this.position.copy(kt.DEFAULT_UP), this.updateMatrix(), this.target = new kt(), this.distance = n, this.angle = s, this.penumbra = r, this.decay = a, this.map = null, this.shadow = new ny();+ super(e, t), this.isSpotLight = !0, this.type = "SpotLight", this.position.copy(kt.DEFAULT_UP), this.updateMatrix(), this.target = new kt(), this.distance = n, this.angle = s, this.penumbra = r, this.decay = a, this.map = null, this.shadow = new hy();}/*** The light's power. Power is the luminous power of the light measured in lumens (lm).@@ -12322,13 +12322,13 @@ class iy extends qo {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 Gp = /* @__PURE__ */ new st(), ja = /* @__PURE__ */ new H(), Nh = /* @__PURE__ */ new H();-class sy extends ff {+const Kp = /* @__PURE__ */ new st(), eo = /* @__PURE__ */ new H(), Uh = /* @__PURE__ */ new H();+class dy extends xf {/*** Constructs a new point light shadow.*/constructor() {- super(new Cn(90, 1, 0.5, 500)), this.isPointLightShadow = !0, this._frameExtents = new Ze(4, 2), this._viewportCount = 6, this._viewports = [+ super(new vn(90, 1, 0.5, 500)), this.isPointLightShadow = !0, this._frameExtents = new Ze(4, 2), this._viewportCount = 6, this._viewports = [// These viewports map a cube-map onto a 2D texture with the// following orientation://@@ -12377,10 +12377,10 @@ class sy extends ff {*/updateMatrices(e, t = 0) {const n = this.camera, s = this.matrix, r = e.distance || n.far;- r !== n.far && (n.far = r, n.updateProjectionMatrix()), ja.setFromMatrixPosition(e.matrixWorld), n.position.copy(ja), Nh.copy(n.position), Nh.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(Nh), n.updateMatrixWorld(), s.makeTranslation(-ja.x, -ja.y, -ja.z), Gp.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Gp);+ r !== n.far && (n.far = r, n.updateProjectionMatrix()), eo.setFromMatrixPosition(e.matrixWorld), n.position.copy(eo), Uh.copy(n.position), Uh.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(Uh), n.updateMatrixWorld(), s.makeTranslation(-eo.x, -eo.y, -eo.z), Kp.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Kp);}}-class t0 extends qo {+class c0 extends Jo {/*** Constructs a new point light.*@@ -12390,7 +12390,7 @@ class t0 extends qo {* @param {number} [decay=2] - The amount the light dims along the distance of the light.*/constructor(e, t, n = 0, s = 2) {- super(e, t), this.isPointLight = !0, this.type = "PointLight", this.distance = n, this.decay = s, this.shadow = new sy();+ super(e, t), this.isPointLight = !0, this.type = "PointLight", this.distance = n, this.decay = s, this.shadow = new dy();}/*** The light's power. Power is the luminous power of the light measured in lumens (lm).@@ -12411,7 +12411,7 @@ class t0 extends qo {return super.copy(e, t), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this;}}-class pf extends qm {+class Ef extends $m {/*** Constructs a new orthographic camera.*@@ -12475,15 +12475,15 @@ class pf extends qm {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 ry extends ff {+class fy extends xf {/*** Constructs a new directional light shadow.*/constructor() {- super(new pf(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = !0;+ super(new Ef(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = !0;}}-class n0 extends qo {+class l0 extends Jo {/*** Constructs a new directional light.*@@ -12491,7 +12491,7 @@ class n0 extends qo {* @param {number} [intensity=1] - The light's strength/intensity.*/constructor(e, t) {- super(e, t), this.isDirectionalLight = !0, this.type = "DirectionalLight", this.position.copy(kt.DEFAULT_UP), this.updateMatrix(), this.target = new kt(), this.shadow = new ry();+ super(e, t), this.isDirectionalLight = !0, this.type = "DirectionalLight", this.position.copy(kt.DEFAULT_UP), this.updateMatrix(), this.target = new kt(), this.shadow = new fy();}dispose() {this.shadow.dispose();@@ -12500,7 +12500,7 @@ class n0 extends qo {return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this;}}-class ay extends qo {+class py extends Jo {/*** Constructs a new ambient light.*@@ -12511,7 +12511,7 @@ class ay extends qo {super(e, t), this.isAmbientLight = !0, this.type = "AmbientLight";}}-class ha {+class da {/*** Extracts the base URL from the given URL.*@@ -12535,7 +12535,7 @@ class ha {return typeof e != "string" || e === "" ? "" : (/^https?:\/\//i.test(t) && /^\//.test(e) && (t = t.replace(/(^https?:\/\/[^\/]+).*/i, "$1")), /^(https?:)?\/\//i.test(e) || /^data:.*,.*$/i.test(e) || /^blob:.*$/i.test(e) ? e : t + e);}}-class oy extends fs {+class Ay extends ps {/*** Constructs a new image bitmap loader.*@@ -12565,7 +12565,7 @@ class oy extends fs {*/load(e, t, n, s) {e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);- const r = this, a = is.get(e);+ const r = this, a = ss.get(e);if (a !== void 0) {if (r.manager.itemStart(e), a.then) {a.then((l) => {@@ -12586,14 +12586,14 @@ class oy extends fs {}).then(function(l) {return createImageBitmap(l, Object.assign(r.options, { colorSpaceConversion: "none" }));}).then(function(l) {- return is.add(e, l), t && t(l), r.manager.itemEnd(e), l;+ return ss.add(e, l), t && t(l), r.manager.itemEnd(e), l;}).catch(function(l) {- s && s(l), is.remove(e), r.manager.itemError(e), r.manager.itemEnd(e);+ s && s(l), ss.remove(e), r.manager.itemError(e), r.manager.itemEnd(e);});- is.add(e, c), r.manager.itemStart(e);+ ss.add(e, c), r.manager.itemStart(e);}}-class cy extends Cn {+class gy extends vn {/*** Constructs a new array camera.*@@ -12603,7 +12603,7 @@ class cy extends Cn {super(), this.isArrayCamera = !0, this.isMultiViewCamera = !1, this.cameras = e;}}-class ly {+class my {/*** Constructs a new property mixer.*@@ -12718,11 +12718,11 @@ class ly {e[t + a] = e[n + a];}_slerp(e, t, n, s) {- Yn.slerpFlat(e, t, e, t, e, n, s);+ Xn.slerpFlat(e, t, e, t, e, n, s);}_slerpAdditive(e, t, n, s, r) {const a = this._workIndex * r;- Yn.multiplyQuaternionsFlat(e, a, e, t, e, n), Yn.slerpFlat(e, t, e, t, e, a, s);+ Xn.multiplyQuaternionsFlat(e, a, e, t, e, n), Xn.slerpFlat(e, t, e, t, e, a, s);}_lerp(e, t, n, s, r) {const a = 1 - s;@@ -12738,12 +12738,12 @@ class ly {}}}-const Af = "\\[\\]\\.:\\/", hy = new RegExp("[" + Af + "]", "g"), gf = "[^" + Af + "]", uy = "[^" + Af.replace("\\.", "") + "]", dy = /* @__PURE__ */ /((?:WC+[\/:])*)/.source.replace("WC", gf), fy = /* @__PURE__ */ /(WCOD+)?/.source.replace("WCOD", uy), py = /* @__PURE__ */ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", gf), Ay = /* @__PURE__ */ /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", gf), gy = new RegExp(- "^" + dy + fy + py + Ay + "$"-), my = ["material", "materials", "bones", "map"];-class by {+const _f = "\\[\\]\\.:\\/", by = new RegExp("[" + _f + "]", "g"), yf = "[^" + _f + "]", xy = "[^" + _f.replace("\\.", "") + "]", Ey = /* @__PURE__ */ /((?:WC+[\/:])*)/.source.replace("WC", yf), _y = /* @__PURE__ */ /(WCOD+)?/.source.replace("WCOD", xy), yy = /* @__PURE__ */ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", yf), wy = /* @__PURE__ */ /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", yf), vy = new RegExp(+ "^" + Ey + _y + yy + wy + "$"+), Cy = ["material", "materials", "bones", "map"];+class Sy {constructor(e, t, n) {- const s = n || vt.parseTrackName(t);+ const s = n || Ct.parseTrackName(t);this._targetGroup = e, this._bindings = e.subscribe_(t, s);}getValue(e, t) {@@ -12767,7 +12767,7 @@ class by {e[t].unbind();}}-class vt {+class Ct {/*** Constructs a new property binding.*@@ -12776,7 +12776,7 @@ class vt {* @param {?Object} [parsedPath] - The parsed path.*/constructor(e, t, n) {- this.path = t, this.parsedPath = n || vt.parseTrackName(t), this.node = vt.findNode(e, this.parsedPath.nodeName), this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;+ this.path = t, this.parsedPath = n || Ct.parseTrackName(t), this.node = Ct.findNode(e, this.parsedPath.nodeName), this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;}/*** Factory method for creating a property binding from the given parameters.@@ -12788,7 +12788,7 @@ class vt {* @return {PropertyBinding|Composite} The created property binding or composite.*/static create(e, t, n) {- return e && e.isAnimationObjectGroup ? new vt.Composite(e, t, n) : new vt(e, t, n);+ return e && e.isAnimationObjectGroup ? new Ct.Composite(e, t, n) : new Ct(e, t, n);}/*** Replaces spaces with underscores and removes unsupported characters from@@ -12798,7 +12798,7 @@ class vt {* @return {string} The sanitized node name.*/static sanitizeNodeName(e) {- return e.replace(/\s/g, "_").replace(hy, "");+ return e.replace(/\s/g, "_").replace(by, "");}/*** Parses the given track name (an object path to an animated property) and@@ -12819,7 +12819,7 @@ class vt {* @return {Object} The parsed track name as an object.*/static parseTrackName(e) {- const t = gy.exec(e);+ const t = vy.exec(e);if (t === null)throw new Error("PropertyBinding: Cannot parse trackName: " + e);const n = {@@ -12833,7 +12833,7 @@ class vt {}, s = n.nodeName && n.nodeName.lastIndexOf(".");if (s !== void 0 && s !== -1) {const r = n.nodeName.substring(s + 1);- my.indexOf(r) !== -1 && (n.nodeName = n.nodeName.substring(0, s), n.objectName = r);+ Cy.indexOf(r) !== -1 && (n.nodeName = n.nodeName.substring(0, s), n.objectName = r);}if (n.propertyName === null || n.propertyName.length === 0)throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e);@@ -12953,7 +12953,7 @@ class vt {let e = this.node;const t = this.parsedPath, n = t.objectName, s = t.propertyName;let r = t.propertyIndex;- if (e || (e = vt.findNode(this.rootNode, t.nodeName), this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) {+ if (e || (e = Ct.findNode(this.rootNode, t.nodeName), this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) {console.warn("THREE.PropertyBinding: No target node found for track: " + this.path + ".");return;}@@ -13045,51 +13045,51 @@ class vt {this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;}}-vt.Composite = by;-vt.prototype.BindingType = {+Ct.Composite = Sy;+Ct.prototype.BindingType = {Direct: 0,EntireArray: 1,ArrayElement: 2,HasFromToArray: 3};-vt.prototype.Versioning = {+Ct.prototype.Versioning = {None: 0,NeedsUpdate: 1,MatrixWorldNeedsUpdate: 2};-vt.prototype.GetterByBindingType = [- vt.prototype._getValue_direct,- vt.prototype._getValue_array,- vt.prototype._getValue_arrayElement,- vt.prototype._getValue_toArray+Ct.prototype.GetterByBindingType = [+ Ct.prototype._getValue_direct,+ Ct.prototype._getValue_array,+ Ct.prototype._getValue_arrayElement,+ Ct.prototype._getValue_toArray];-vt.prototype.SetterByBindingTypeAndVersioning = [+Ct.prototype.SetterByBindingTypeAndVersioning = [[// Direct- vt.prototype._setValue_direct,- vt.prototype._setValue_direct_setNeedsUpdate,- vt.prototype._setValue_direct_setMatrixWorldNeedsUpdate+ Ct.prototype._setValue_direct,+ Ct.prototype._setValue_direct_setNeedsUpdate,+ Ct.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[// EntireArray- vt.prototype._setValue_array,- vt.prototype._setValue_array_setNeedsUpdate,- vt.prototype._setValue_array_setMatrixWorldNeedsUpdate+ Ct.prototype._setValue_array,+ Ct.prototype._setValue_array_setNeedsUpdate,+ Ct.prototype._setValue_array_setMatrixWorldNeedsUpdate],[// ArrayElement- vt.prototype._setValue_arrayElement,- vt.prototype._setValue_arrayElement_setNeedsUpdate,- vt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate+ Ct.prototype._setValue_arrayElement,+ Ct.prototype._setValue_arrayElement_setNeedsUpdate,+ Ct.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[// HasToFromArray- vt.prototype._setValue_fromArray,- vt.prototype._setValue_fromArray_setNeedsUpdate,- vt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate+ Ct.prototype._setValue_fromArray,+ Ct.prototype._setValue_fromArray_setNeedsUpdate,+ Ct.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];-class xy {+class Iy {/*** Constructs a new animation action.*@@ -13101,14 +13101,14 @@ class xy {constructor(e, t, n = null, s = t.blendMode) {this._mixer = e, this._clip = t, this._localRoot = n, this.blendMode = s;const r = t.tracks, a = r.length, o = new Array(a), c = {- endingStart: ea,- endingEnd: ea+ endingStart: na,+ endingEnd: na};for (let l = 0; l !== a; ++l) {const h = r[l].createInterpolant(null);o[l] = h, h.settings = c;}- this._interpolantSettings = c, this._interpolants = o, this._propertyBindings = new Array(a), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = Fm, this._loopCount = -1, this._startTime = null, this.time = 0, this.timeScale = 1, this._effectiveTimeScale = 1, this.weight = 1, this._effectiveWeight = 1, this.repetitions = 1 / 0, this.paused = !1, this.enabled = !0, this.clampWhenFinished = !1, this.zeroSlopeAtStart = !0, this.zeroSlopeAtEnd = !0;+ this._interpolantSettings = c, this._interpolants = o, this._propertyBindings = new Array(a), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = Qm, this._loopCount = -1, this._startTime = null, this.time = 0, this.timeScale = 1, this._effectiveTimeScale = 1, this.weight = 1, this._effectiveWeight = 1, this.repetitions = 1 / 0, this.paused = !1, this.enabled = !0, this.clampWhenFinished = !1, this.zeroSlopeAtStart = !0, this.zeroSlopeAtEnd = !0;}/*** Starts the playback of the animation.@@ -13359,11 +13359,11 @@ class xy {if (o > 0) {const c = this._interpolants, l = this._propertyBindings;switch (this.blendMode) {- case SE:+ case DE:for (let h = 0, u = c.length; h !== u; ++h)c[h].evaluate(a), l[h].accumulateAdditive(o);break;- case rf:+ case uf:default:for (let h = 0, u = c.length; h !== u; ++h)c[h].evaluate(a), l[h].accumulate(s, o);@@ -13397,10 +13397,10 @@ class xy {_updateTime(e) {const t = this._clip.duration, n = this.loop;let s = this.time + e, r = this._loopCount;- const a = n === vE;+ const a = n === FE;if (e === 0)return r === -1 ? s : a && (r & 1) === 1 ? t - s : s;- if (n === Nm) {+ if (n === Om) {r === -1 && (this._loopCount = 0, this._setEndings(!0, !0, !1));e: {if (s >= t)@@ -13449,7 +13449,7 @@ class xy {}_setEndings(e, t, n) {const s = this._interpolantSettings;- n ? (s.endingStart = ta, s.endingEnd = ta) : (e ? s.endingStart = this.zeroSlopeAtStart ? ta : ea : s.endingStart = ml, t ? s.endingEnd = this.zeroSlopeAtEnd ? ta : ea : s.endingEnd = ml);+ n ? (s.endingStart = ia, s.endingEnd = ia) : (e ? s.endingStart = this.zeroSlopeAtStart ? ia : na : s.endingStart = yl, t ? s.endingEnd = this.zeroSlopeAtEnd ? ia : na : s.endingEnd = yl);}_scheduleFading(e, t, n) {const s = this._mixer, r = s.time;@@ -13459,8 +13459,8 @@ class xy {return o[0] = r, c[0] = t, o[1] = r + e, c[1] = n, this;}}-const Ey = new Float32Array(1);-class i0 extends Qs {+const My = new Float32Array(1);+class h0 extends Hs {/*** Constructs a new animation mixer.*@@ -13484,8 +13484,8 @@ class i0 extends Qs {continue;}const g = t && t._propertyBindings[u].binding.parsedPath;- m = new ly(- vt.create(n, f, g),+ m = new my(+ Ct.create(n, f, g),d.ValueTypeName,d.getValueSize()), ++m.referenceCount, this._addInactiveBinding(m, c, f), a[u] = m;@@ -13615,11 +13615,11 @@ class i0 extends Qs {_lendControlInterpolant() {const e = this._controlInterpolants, t = this._nActiveControlInterpolants++;let n = e[t];- return n === void 0 && (n = new Zm(+ return n === void 0 && (n = new r0(new Float32Array(2),new Float32Array(2),1,- Ey+ My), n.__cacheIndex = t, e[t] = n), n;}_takeBackControlInterpolant(e) {@@ -13640,17 +13640,17 @@ class i0 extends Qs {*/clipAction(e, t, n) {const s = t || this._root, r = s.uuid;- let a = typeof e == "string" ? cd.findByName(s, e) : e;+ let a = typeof e == "string" ? pd.findByName(s, e) : e;const o = a !== null ? a.uuid : e, c = this._actionsByClip[o];let l = null;- if (n === void 0 && (a !== null ? n = a.blendMode : n = rf), c !== void 0) {+ if (n === void 0 && (a !== null ? n = a.blendMode : n = uf), c !== void 0) {const u = c.actionByRoot[r];if (u !== void 0 && u.blendMode === n)return u;l = c.knownActions[0], a === null && (a = l._clip);}if (a === null) return null;- const h = new xy(this, a, t, n);+ const h = new Iy(this, a, t, n);return this._bindAction(h, l), this._addInactiveAction(h, o, r), h;}/**@@ -13661,7 +13661,7 @@ class i0 extends Qs {* @return {?AnimationAction} The animation action. Returns `null` if no action was found.*/existingAction(e, t) {- const n = t || this._root, s = n.uuid, r = typeof e == "string" ? cd.findByName(n, e) : e, a = r ? r.uuid : e, o = this._actionsByClip[a];+ const n = t || this._root, s = n.uuid, r = typeof e == "string" ? pd.findByName(n, e) : e, a = r ? r.uuid : e, o = this._actionsByClip[a];return o !== void 0 && o.actionByRoot[s] || null;}/**@@ -13770,7 +13770,7 @@ class i0 extends Qs {n !== null && (this._deactivateAction(n), this._removeInactiveAction(n));}}-class Hp {+class jp {/*** Constructs a new spherical.*@@ -13840,8 +13840,8 @@ class Hp {return new this.constructor().copy(this);}}-const ys = /* @__PURE__ */ new H(), Bc = /* @__PURE__ */ new st(), Fh = /* @__PURE__ */ new st();-class _y extends Ul {+const ws = /* @__PURE__ */ new H(), Dc = /* @__PURE__ */ new st(), Oh = /* @__PURE__ */ new st();+class By extends zl {/*** Constructs a new hemisphere light helper.*@@ -13849,21 +13849,21 @@ class _y extends Ul {* can be used if it represents a hierarchy of bones (see {@link Bone}).*/constructor(e) {- const t = s0(e), n = new Hn(), s = [], r = [], a = new Xe(0, 0, 1), o = new Xe(0, 1, 0);+ const t = u0(e), n = new Hn(), s = [], r = [], a = new je(0, 0, 1), o = new je(0, 1, 0);for (let l = 0; l < t.length; l++) {const h = t[l];h.parent && h.parent.isBone && (s.push(0, 0, 0), s.push(0, 0, 0), r.push(a.r, a.g, a.b), r.push(o.r, o.g, o.b));}n.setAttribute("position", new kn(s, 3)), n.setAttribute("color", new kn(r, 3));- const c = new Vo({ vertexColors: !0, depthTest: !1, depthWrite: !1, toneMapped: !1, transparent: !0 });+ const c = new Xo({ vertexColors: !0, depthTest: !1, depthWrite: !1, toneMapped: !1, transparent: !0 });super(n, c), this.isSkeletonHelper = !0, this.type = "SkeletonHelper", this.root = e, this.bones = t, this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1;}updateMatrixWorld(e) {const t = this.bones, n = this.geometry, s = n.getAttribute("position");- Fh.copy(this.root.matrixWorld).invert();+ Oh.copy(this.root.matrixWorld).invert();for (let r = 0, a = 0; r < t.length; r++) {const o = t[r];- o.parent && o.parent.isBone && (Bc.multiplyMatrices(Fh, o.matrixWorld), ys.setFromMatrixPosition(Bc), s.setXYZ(a, ys.x, ys.y, ys.z), Bc.multiplyMatrices(Fh, o.parent.matrixWorld), ys.setFromMatrixPosition(Bc), s.setXYZ(a + 1, ys.x, ys.y, ys.z), a += 2);+ o.parent && o.parent.isBone && (Dc.multiplyMatrices(Oh, o.matrixWorld), ws.setFromMatrixPosition(Dc), s.setXYZ(a, ws.x, ws.y, ws.z), Dc.multiplyMatrices(Oh, o.parent.matrixWorld), ws.setFromMatrixPosition(Dc), s.setXYZ(a + 1, ws.x, ws.y, ws.z), a += 2);}n.getAttribute("position").needsUpdate = !0, super.updateMatrixWorld(e);}@@ -13875,14 +13875,14 @@ class _y extends Ul {this.geometry.dispose(), this.material.dispose();}}-function s0(i) {+function u0(i) {const e = [];i.isBone === !0 && e.push(i);for (let t = 0; t < i.children.length; t++)- e.push(...s0(i.children[t]));+ e.push(...u0(i.children[t]));return e;}-class yy extends Ul {+class Ty extends zl {/*** Constructs a new grid helper.*@@ -13892,7 +13892,7 @@ class yy extends Ul {* @param {number|Color|string} [color2=0x888888] - The color of the lines of the grid.*/constructor(e = 10, t = 10, n = 4473924, s = 8947848) {- n = new Xe(n), s = new Xe(s);+ n = new je(n), s = new je(s);const r = t / 2, a = e / t, o = e / 2, c = [], l = [];for (let d = 0, f = 0, m = -o; d <= t; d++, m += a) {c.push(-o, 0, m, o, 0, m), c.push(m, 0, -o, m, 0, o);@@ -13901,7 +13901,7 @@ class yy extends Ul {}const h = new Hn();h.setAttribute("position", new kn(c, 3)), h.setAttribute("color", new kn(l, 3));- const u = new Vo({ vertexColors: !0, toneMapped: !1 });+ const u = new Xo({ vertexColors: !0, toneMapped: !1 });super(h, u), this.type = "GridHelper";}/**@@ -13912,7 +13912,7 @@ class yy extends Ul {this.geometry.dispose(), this.material.dispose();}}-class zp extends Ul {+class Xp extends zl {/*** Constructs a new axes helper.*@@ -13959,7 +13959,7 @@ class zp extends Ul {1], s = new Hn();s.setAttribute("position", new kn(t, 3)), s.setAttribute("color", new kn(n, 3));- const r = new Vo({ vertexColors: !0, toneMapped: !1 });+ const r = new Xo({ vertexColors: !0, toneMapped: !1 });super(s, r), this.type = "AxesHelper";}/**@@ -13971,7 +13971,7 @@ class zp extends Ul {* @return {AxesHelper} A reference to this axes helper.*/setColors(e, t, n) {- const s = new Xe(), r = this.geometry.attributes.color.array;+ const s = new je(), r = this.geometry.attributes.color.array;return s.set(e), s.toArray(r, 0), s.toArray(r, 3), s.set(t), s.toArray(r, 6), s.toArray(r, 9), s.set(n), s.toArray(r, 12), s.toArray(r, 15), this.geometry.attributes.color.needsUpdate = !0, this;}/**@@ -13982,7 +13982,7 @@ class zp extends Ul {this.geometry.dispose(), this.material.dispose();}}-class wy extends Qs {+class Ry extends Hs {/*** Constructs a new controls instance.*@@ -14025,109 +14025,109 @@ class wy extends Qs {update() {}}-function Vp(i, e, t, n) {- const s = Cy(n);+function Yp(i, e, t, n) {+ const s = Ny(n);switch (t) {// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml- case Bm:+ case Pm:return i * e;- case ts:+ case ns:return i * e / s.components * s.byteLength;- case tf:+ case cf:return i * e / s.components * s.byteLength;- case cr:+ case hr:return i * e * 2 / s.components * s.byteLength;- case nf:+ case lf:return i * e * 2 / s.components * s.byteLength;- case Tm:+ case km:return i * e * 3 / s.components * s.byteLength;case on:return i * e * 4 / s.components * s.byteLength;- case sf:+ case hf:return i * e * 4 / s.components * s.byteLength;// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/- case tl:- case uo:+ case al:+ case go:return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 8;- case nl:- case fo:+ case ol:+ case mo:return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 16;// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/- case Ou:- case Qu:+ case Wu:+ case qu:return Math.max(i, 16) * Math.max(e, 8) / 4;- case ul:- case dl:+ case gl:+ case ml:return Math.max(i, 8) * Math.max(e, 8) / 2;// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/- case fl:- case pl:+ case bl:+ case xl:return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 8;- case Al:+ case El:return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 16;// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/- case Io:+ case Ro:return Math.floor((i + 3) / 4) * Math.floor((e + 3) / 4) * 16;- case Gu:+ case Ku:return Math.floor((i + 4) / 5) * Math.floor((e + 3) / 4) * 16;- case Hu:+ case ju:return Math.floor((i + 4) / 5) * Math.floor((e + 4) / 5) * 16;- case zu:+ case Xu:return Math.floor((i + 5) / 6) * Math.floor((e + 4) / 5) * 16;- case Mo:+ case No:return Math.floor((i + 5) / 6) * Math.floor((e + 5) / 6) * 16;- case Vu:+ case Yu:return Math.floor((i + 7) / 8) * Math.floor((e + 4) / 5) * 16;- case Wu:+ case Ju:return Math.floor((i + 7) / 8) * Math.floor((e + 5) / 6) * 16;- case qu:+ case Zu:return Math.floor((i + 7) / 8) * Math.floor((e + 7) / 8) * 16;- case Ku:+ case $u:return Math.floor((i + 9) / 10) * Math.floor((e + 4) / 5) * 16;- case Xu:+ case ed:return Math.floor((i + 9) / 10) * Math.floor((e + 5) / 6) * 16;- case Yu:+ case td:return Math.floor((i + 9) / 10) * Math.floor((e + 7) / 8) * 16;- case ju:+ case nd:return Math.floor((i + 9) / 10) * Math.floor((e + 9) / 10) * 16;- case Ju:+ case id:return Math.floor((i + 11) / 12) * Math.floor((e + 9) / 10) * 16;- case Zu:+ case sd:return Math.floor((i + 11) / 12) * Math.floor((e + 11) / 12) * 16;// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/- case po:- case $u:- case gl:+ case bo:+ case rd:+ case _l:return Math.ceil(i / 4) * Math.ceil(e / 4) * 16;// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/- case Rm:- case ed:+ case Um:+ case ad:return Math.ceil(i / 4) * Math.ceil(e / 4) * 8;- case td:- case nd:+ case od:+ case cd:return Math.ceil(i / 4) * Math.ceil(e / 4) * 16;}throw new Error(`Unable to determine texture byte length for ${t} format.`);}-function Cy(i) {+function Ny(i) {switch (i) {case rn:- case Sm:+ case Fm:return { byteLength: 1, components: 1 };- case wo:- case Im:+ case Io:+ case Dm:case Rn:return { byteLength: 2, components: 1 };- case $d:- case ef:+ case af:+ case of:return { byteLength: 2, components: 4 };- case mr:- case Zd:+ case xr:+ case rf:case an:return { byteLength: 4, components: 1 };- case Mm:+ case Lm:return { byteLength: 4, components: 3 };}throw new Error(`Unknown texture type ${i}.`);@@ -14136,7 +14136,7 @@ typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvrevision: "176"} }));typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "176");-function r0() {+function d0() {let i = null, e = !1, t = null, n = null;function s(r, a) {t(r, a), n = i.requestAnimationFrame(s);@@ -14156,7 +14156,7 @@ function r0() {}};}-function vy(i) {+function Fy(i) {const e = /* @__PURE__ */ new WeakMap();function t(o, c) {const l = o.array, h = o.usage, u = l.byteLength, d = i.createBuffer();@@ -14251,9 +14251,9 @@ function vy(i) {update: a};}-var Sy = `#ifdef USE_ALPHAHASH+var Dy = `#ifdef USE_ALPHAHASHif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;-#endif`, Iy = `#ifdef USE_ALPHAHASH+#endif`, Ly = `#ifdef USE_ALPHAHASHconst float ALPHA_HASH_SCALE = 0.05;float hash2D( vec2 value ) {return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );@@ -14288,20 +14288,20 @@ var Sy = `#ifdef USE_ALPHAHASH: cases.z;return clamp( threshold , 1.0e-6, 1.0 );}-#endif`, My = `#ifdef USE_ALPHAMAP+#endif`, Py = `#ifdef USE_ALPHAMAPdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;-#endif`, By = `#ifdef USE_ALPHAMAP+#endif`, ky = `#ifdef USE_ALPHAMAPuniform sampler2D alphaMap;-#endif`, Ty = `#ifdef USE_ALPHATEST+#endif`, Uy = `#ifdef USE_ALPHATEST#ifdef ALPHA_TO_COVERAGEdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );if ( diffuseColor.a == 0.0 ) discard;#elseif ( diffuseColor.a < alphaTest ) discard;#endif-#endif`, Ry = `#ifdef USE_ALPHATEST+#endif`, Oy = `#ifdef USE_ALPHATESTuniform float alphaTest;-#endif`, Ny = `#ifdef USE_AOMAP+#endif`, Qy = `#ifdef USE_AOMAPfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;reflectedLight.indirectDiffuse *= ambientOcclusion;#if defined( USE_CLEARCOAT )@@ -14314,10 +14314,10 @@ var Sy = `#ifdef USE_ALPHAHASHfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );#endif-#endif`, Fy = `#ifdef USE_AOMAP+#endif`, Gy = `#ifdef USE_AOMAPuniform sampler2D aoMap;uniform float aoMapIntensity;-#endif`, Dy = `#ifdef USE_BATCHING+#endif`, Hy = `#ifdef USE_BATCHING#if ! defined( GL_ANGLE_multi_draw )#define gl_DrawID _gl_DrawIDuniform int _gl_DrawID;@@ -14351,15 +14351,15 @@ var Sy = `#ifdef USE_ALPHAHASHint y = j / size;return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;}-#endif`, Ly = `#ifdef USE_BATCHING+#endif`, zy = `#ifdef USE_BATCHINGmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );-#endif`, Py = `vec3 transformed = vec3( position );+#endif`, Vy = `vec3 transformed = vec3( position );#ifdef USE_ALPHAHASHvPosition = vec3( position );-#endif`, ky = `vec3 objectNormal = vec3( normal );+#endif`, Wy = `vec3 objectNormal = vec3( normal );#ifdef USE_TANGENTvec3 objectTangent = vec3( tangent.xyz );-#endif`, Uy = `float G_BlinnPhong_Implicit( ) {+#endif`, qy = `float G_BlinnPhong_Implicit( ) {return 0.25;}float D_BlinnPhong( const in float shininess, const in float dotNH ) {@@ -14373,7 +14373,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vefloat G = G_BlinnPhong_Implicit( );float D = D_BlinnPhong( shininess, dotNH );return F * ( G * D );-} // validated`, Oy = `#ifdef USE_IRIDESCENCE+} // validated`, Ky = `#ifdef USE_IRIDESCENCEconst mat3 XYZ_TO_REC709 = mat3(3.2404542, -0.9692660, 0.0556434,-1.5371385, 1.8760108, -0.2040259,@@ -14436,7 +14436,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve}return max( I, vec3( 0.0 ) );}-#endif`, Qy = `#ifdef USE_BUMPMAP+#endif`, jy = `#ifdef USE_BUMPMAPuniform sampler2D bumpMap;uniform float bumpScale;vec2 dHdxy_fwd() {@@ -14457,7 +14457,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vevec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );return normalize( abs( fDet ) * surf_norm - vGrad );}-#endif`, Gy = `#if NUM_CLIPPING_PLANES > 0+#endif`, Xy = `#if NUM_CLIPPING_PLANES > 0vec4 plane;#ifdef ALPHA_TO_COVERAGEfloat distanceToPlane, distanceGradient;@@ -14503,26 +14503,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in veif ( clipped ) discard;#endif#endif-#endif`, Hy = `#if NUM_CLIPPING_PLANES > 0+#endif`, Yy = `#if NUM_CLIPPING_PLANES > 0varying vec3 vClipPosition;uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];-#endif`, zy = `#if NUM_CLIPPING_PLANES > 0+#endif`, Jy = `#if NUM_CLIPPING_PLANES > 0varying vec3 vClipPosition;-#endif`, Vy = `#if NUM_CLIPPING_PLANES > 0+#endif`, Zy = `#if NUM_CLIPPING_PLANES > 0vClipPosition = - mvPosition.xyz;-#endif`, Wy = `#if defined( USE_COLOR_ALPHA )+#endif`, $y = `#if defined( USE_COLOR_ALPHA )diffuseColor *= vColor;#elif defined( USE_COLOR )diffuseColor.rgb *= vColor;-#endif`, qy = `#if defined( USE_COLOR_ALPHA )+#endif`, ew = `#if defined( USE_COLOR_ALPHA )varying vec4 vColor;#elif defined( USE_COLOR )varying vec3 vColor;-#endif`, Ky = `#if defined( USE_COLOR_ALPHA )+#endif`, tw = `#if defined( USE_COLOR_ALPHA )varying vec4 vColor;#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )varying vec3 vColor;-#endif`, Xy = `#if defined( USE_COLOR_ALPHA )+#endif`, nw = `#if defined( USE_COLOR_ALPHA )vColor = vec4( 1.0 );#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )vColor = vec3( 1.0 );@@ -14536,7 +14536,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve#ifdef USE_BATCHING_COLORvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );vColor.xyz *= batchingColor.xyz;-#endif`, Yy = `#define PI 3.141592653589793+#endif`, iw = `#define PI 3.141592653589793#define PI2 6.283185307179586#define PI_HALF 1.5707963267948966#define RECIPROCAL_PI 0.3183098861837907@@ -14610,7 +14610,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );-} // validated`, jy = `#ifdef ENVMAP_TYPE_CUBE_UV+} // validated`, sw = `#ifdef ENVMAP_TYPE_CUBE_UV#define cubeUV_minMipLevel 4.0#define cubeUV_minTileSize 16.0float getFace( vec3 direction ) {@@ -14703,7 +14703,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {return vec4( mix( color0, color1, mipF ), 1.0 );}}-#endif`, Jy = `vec3 transformedNormal = objectNormal;+#endif`, rw = `vec3 transformedNormal = objectNormal;#ifdef USE_TANGENTvec3 transformedTangent = objectTangent;#endif@@ -14732,21 +14732,21 @@ transformedNormal = normalMatrix * transformedNormal;#ifdef FLIP_SIDEDtransformedTangent = - transformedTangent;#endif-#endif`, Zy = `#ifdef USE_DISPLACEMENTMAP+#endif`, aw = `#ifdef USE_DISPLACEMENTMAPuniform sampler2D displacementMap;uniform float displacementScale;uniform float displacementBias;-#endif`, $y = `#ifdef USE_DISPLACEMENTMAP+#endif`, ow = `#ifdef USE_DISPLACEMENTMAPtransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );-#endif`, ew = `#ifdef USE_EMISSIVEMAP+#endif`, cw = `#ifdef USE_EMISSIVEMAPvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );#ifdef DECODE_VIDEO_TEXTURE_EMISSIVEemissiveColor = sRGBTransferEOTF( emissiveColor );#endiftotalEmissiveRadiance *= emissiveColor.rgb;-#endif`, tw = `#ifdef USE_EMISSIVEMAP+#endif`, lw = `#ifdef USE_EMISSIVEMAPuniform sampler2D emissiveMap;-#endif`, nw = "gl_FragColor = linearToOutputTexel( gl_FragColor );", iw = `vec4 LinearTransferOETF( in vec4 value ) {+#endif`, hw = "gl_FragColor = linearToOutputTexel( gl_FragColor );", uw = `vec4 LinearTransferOETF( in vec4 value ) {return value;}vec4 sRGBTransferEOTF( in vec4 value ) {@@ -14754,7 +14754,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 );-}`, sw = `#ifdef USE_ENVMAP+}`, dw = `#ifdef USE_ENVMAP#ifdef ENV_WORLDPOSvec3 cameraToFrag;if ( isOrthographic ) {@@ -14783,7 +14783,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {#elif defined( ENVMAP_BLENDING_ADD )outgoingLight += envColor.xyz * specularStrength * reflectivity;#endif-#endif`, rw = `#ifdef USE_ENVMAP+#endif`, fw = `#ifdef USE_ENVMAPuniform float envMapIntensity;uniform float flipEnvMap;uniform mat3 envMapRotation;@@ -14793,7 +14793,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {uniform sampler2D envMap;#endif-#endif`, aw = `#ifdef USE_ENVMAP+#endif`, pw = `#ifdef USE_ENVMAPuniform float reflectivity;#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )#define ENV_WORLDPOS@@ -14804,7 +14804,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {#elsevarying vec3 vReflect;#endif-#endif`, ow = `#ifdef USE_ENVMAP+#endif`, Aw = `#ifdef USE_ENVMAP#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )#define ENV_WORLDPOS#endif@@ -14815,7 +14815,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {varying vec3 vReflect;uniform float refractionRatio;#endif-#endif`, cw = `#ifdef USE_ENVMAP+#endif`, gw = `#ifdef USE_ENVMAP#ifdef ENV_WORLDPOSvWorldPosition = worldPosition.xyz;#else@@ -14832,18 +14832,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {vReflect = refract( cameraToVertex, worldNormal, refractionRatio );#endif#endif-#endif`, lw = `#ifdef USE_FOG+#endif`, mw = `#ifdef USE_FOGvFogDepth = - mvPosition.z;-#endif`, hw = `#ifdef USE_FOG+#endif`, bw = `#ifdef USE_FOGvarying float vFogDepth;-#endif`, uw = `#ifdef USE_FOG+#endif`, xw = `#ifdef USE_FOG#ifdef FOG_EXP2float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );#elsefloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );#endifgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );-#endif`, dw = `#ifdef USE_FOG+#endif`, Ew = `#ifdef USE_FOGuniform vec3 fogColor;varying float vFogDepth;#ifdef FOG_EXP2@@ -14852,7 +14852,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {uniform float fogNear;uniform float fogFar;#endif-#endif`, fw = `#ifdef USE_GRADIENTMAP+#endif`, _w = `#ifdef USE_GRADIENTMAPuniform sampler2D gradientMap;#endifvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {@@ -14864,12 +14864,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {vec2 fw = fwidth( coord ) * 0.5;return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );#endif-}`, pw = `#ifdef USE_LIGHTMAP+}`, yw = `#ifdef USE_LIGHTMAPuniform sampler2D lightMap;uniform float lightMapIntensity;-#endif`, Aw = `LambertMaterial material;+#endif`, ww = `LambertMaterial material;material.diffuseColor = diffuseColor.rgb;-material.specularStrength = specularStrength;`, gw = `varying vec3 vViewPosition;+material.specularStrength = specularStrength;`, vw = `varying vec3 vViewPosition;struct LambertMaterial {vec3 diffuseColor;float specularStrength;@@ -14883,7 +14883,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometrreflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );}#define RE_Direct RE_Direct_Lambert-#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`, mw = `uniform bool receiveShadow;+#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`, Cw = `uniform bool receiveShadow;uniform vec3 ambientLightColor;#if defined( USE_LIGHT_PROBES )uniform vec3 lightProbe[ 9 ];@@ -14999,7 +14999,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosivec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );return irradiance;}-#endif`, bw = `#ifdef USE_ENVMAP+#endif`, Sw = `#ifdef USE_ENVMAPvec3 getIBLIrradiance( const in vec3 normal ) {#ifdef ENVMAP_TYPE_CUBE_UVvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );@@ -15032,8 +15032,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi#endif}#endif-#endif`, xw = `ToonMaterial material;-material.diffuseColor = diffuseColor.rgb;`, Ew = `varying vec3 vViewPosition;+#endif`, Iw = `ToonMaterial material;+material.diffuseColor = diffuseColor.rgb;`, Mw = `varying vec3 vViewPosition;struct ToonMaterial {vec3 diffuseColor;};@@ -15045,11 +15045,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPoreflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );}#define RE_Direct RE_Direct_Toon-#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`, _w = `BlinnPhongMaterial material;+#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`, Bw = `BlinnPhongMaterial material;material.diffuseColor = diffuseColor.rgb;material.specularColor = specular;material.specularShininess = shininess;-material.specularStrength = specularStrength;`, yw = `varying vec3 vViewPosition;+material.specularStrength = specularStrength;`, Tw = `varying vec3 vViewPosition;struct BlinnPhongMaterial {vec3 diffuseColor;vec3 specularColor;@@ -15066,7 +15066,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geomreflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );}#define RE_Direct RE_Direct_BlinnPhong-#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`, ww = `PhysicalMaterial material;+#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`, Rw = `PhysicalMaterial material;material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );@@ -15152,7 +15152,7 @@ material.roughness = min( material.roughness, 1.0 );material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;-#endif`, Cw = `struct PhysicalMaterial {+#endif`, Nw = `struct PhysicalMaterial {vec3 diffuseColor;float roughness;vec3 specularColor;@@ -15453,7 +15453,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia#define RE_IndirectSpecular RE_IndirectSpecular_Physicalfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );-}`, vw = `+}`, Fw = `vec3 geometryPosition = - vViewPosition;vec3 geometryNormal = normal;vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );@@ -15568,7 +15568,7 @@ IncidentLight directLight;#if defined( RE_IndirectSpecular )vec3 radiance = vec3( 0.0 );vec3 clearcoatRadiance = vec3( 0.0 );-#endif`, Sw = `#if defined( RE_IndirectDiffuse )+#endif`, Dw = `#if defined( RE_IndirectDiffuse )#ifdef USE_LIGHTMAPvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;@@ -15587,32 +15587,32 @@ IncidentLight directLight;#ifdef USE_CLEARCOATclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );#endif-#endif`, Iw = `#if defined( RE_IndirectDiffuse )+#endif`, Lw = `#if defined( RE_IndirectDiffuse )RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );#endif#if defined( RE_IndirectSpecular )RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );-#endif`, Mw = `#if defined( USE_LOGDEPTHBUF )+#endif`, Pw = `#if defined( USE_LOGDEPTHBUF )gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;-#endif`, Bw = `#if defined( USE_LOGDEPTHBUF )+#endif`, kw = `#if defined( USE_LOGDEPTHBUF )uniform float logDepthBufFC;varying float vFragDepth;varying float vIsPerspective;-#endif`, Tw = `#ifdef USE_LOGDEPTHBUF+#endif`, Uw = `#ifdef USE_LOGDEPTHBUFvarying float vFragDepth;varying float vIsPerspective;-#endif`, Rw = `#ifdef USE_LOGDEPTHBUF+#endif`, Ow = `#ifdef USE_LOGDEPTHBUFvFragDepth = 1.0 + gl_Position.w;vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );-#endif`, Nw = `#ifdef USE_MAP+#endif`, Qw = `#ifdef USE_MAPvec4 sampledDiffuseColor = texture2D( map, vMapUv );#ifdef DECODE_VIDEO_TEXTUREsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );#endifdiffuseColor *= sampledDiffuseColor;-#endif`, Fw = `#ifdef USE_MAP+#endif`, Gw = `#ifdef USE_MAPuniform sampler2D map;-#endif`, Dw = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )+#endif`, Hw = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )#if defined( USE_POINTS_UV )vec2 uv = vUv;#else@@ -15624,7 +15624,7 @@ IncidentLight directLight;#endif#ifdef USE_ALPHAMAPdiffuseColor.a *= texture2D( alphaMap, uv ).g;-#endif`, Lw = `#if defined( USE_POINTS_UV )+#endif`, zw = `#if defined( USE_POINTS_UV )varying vec2 vUv;#else#if defined( USE_MAP ) || defined( USE_ALPHAMAP )@@ -15636,19 +15636,19 @@ IncidentLight directLight;#endif#ifdef USE_ALPHAMAPuniform sampler2D alphaMap;-#endif`, Pw = `float metalnessFactor = metalness;+#endif`, Vw = `float metalnessFactor = metalness;#ifdef USE_METALNESSMAPvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );metalnessFactor *= texelMetalness.b;-#endif`, kw = `#ifdef USE_METALNESSMAP+#endif`, Ww = `#ifdef USE_METALNESSMAPuniform sampler2D metalnessMap;-#endif`, Uw = `#ifdef USE_INSTANCING_MORPH+#endif`, qw = `#ifdef USE_INSTANCING_MORPHfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;}-#endif`, Ow = `#if defined( USE_MORPHCOLORS )+#endif`, Kw = `#if defined( USE_MORPHCOLORS )vColor *= morphTargetBaseInfluence;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {#if defined( USE_COLOR_ALPHA )@@ -15657,12 +15657,12 @@ IncidentLight directLight;if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];#endif}-#endif`, Qw = `#ifdef USE_MORPHNORMALS+#endif`, jw = `#ifdef USE_MORPHNORMALSobjectNormal *= morphTargetBaseInfluence;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];}-#endif`, Gw = `#ifdef USE_MORPHTARGETS+#endif`, Xw = `#ifdef USE_MORPHTARGETS#ifndef USE_INSTANCING_MORPHuniform float morphTargetBaseInfluence;uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];@@ -15676,12 +15676,12 @@ IncidentLight directLight;ivec3 morphUV = ivec3( x, y, morphTargetIndex );return texelFetch( morphTargetsTexture, morphUV, 0 );}-#endif`, Hw = `#ifdef USE_MORPHTARGETS+#endif`, Yw = `#ifdef USE_MORPHTARGETStransformed *= morphTargetBaseInfluence;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];}-#endif`, zw = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;+#endif`, Jw = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;#ifdef FLAT_SHADEDvec3 fdx = dFdx( vViewPosition );vec3 fdy = dFdy( vViewPosition );@@ -15722,7 +15722,7 @@ IncidentLight directLight;tbn2[1] *= faceDirection;#endif#endif-vec3 nonPerturbedNormal = normal;`, Vw = `#ifdef USE_NORMALMAP_OBJECTSPACE+vec3 nonPerturbedNormal = normal;`, Zw = `#ifdef USE_NORMALMAP_OBJECTSPACEnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;#ifdef FLIP_SIDEDnormal = - normal;@@ -15737,25 +15737,25 @@ vec3 nonPerturbedNormal = normal;`, Vw = `#ifdef USE_NORMALMAP_OBJECTSPACEnormal = normalize( tbn * mapN );#elif defined( USE_BUMPMAP )normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );-#endif`, Ww = `#ifndef FLAT_SHADED+#endif`, $w = `#ifndef FLAT_SHADEDvarying vec3 vNormal;#ifdef USE_TANGENTvarying vec3 vTangent;varying vec3 vBitangent;#endif-#endif`, qw = `#ifndef FLAT_SHADED+#endif`, ev = `#ifndef FLAT_SHADEDvarying vec3 vNormal;#ifdef USE_TANGENTvarying vec3 vTangent;varying vec3 vBitangent;#endif-#endif`, Kw = `#ifndef FLAT_SHADED+#endif`, tv = `#ifndef FLAT_SHADEDvNormal = normalize( transformedNormal );#ifdef USE_TANGENTvTangent = normalize( transformedTangent );vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );#endif-#endif`, Xw = `#ifdef USE_NORMALMAP+#endif`, nv = `#ifdef USE_NORMALMAPuniform sampler2D normalMap;uniform vec2 normalScale;#endif@@ -15777,13 +15777,13 @@ vec3 nonPerturbedNormal = normal;`, Vw = `#ifdef USE_NORMALMAP_OBJECTSPACEfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );return mat3( T * scale, B * scale, N );}-#endif`, Yw = `#ifdef USE_CLEARCOAT+#endif`, iv = `#ifdef USE_CLEARCOATvec3 clearcoatNormal = nonPerturbedNormal;-#endif`, jw = `#ifdef USE_CLEARCOAT_NORMALMAP+#endif`, sv = `#ifdef USE_CLEARCOAT_NORMALMAPvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;clearcoatMapN.xy *= clearcoatNormalScale;clearcoatNormal = normalize( tbn2 * clearcoatMapN );-#endif`, Jw = `#ifdef USE_CLEARCOATMAP+#endif`, rv = `#ifdef USE_CLEARCOATMAPuniform sampler2D clearcoatMap;#endif#ifdef USE_CLEARCOAT_NORMALMAP@@ -15792,18 +15792,18 @@ vec3 nonPerturbedNormal = normal;`, Vw = `#ifdef USE_NORMALMAP_OBJECTSPACE#endif#ifdef USE_CLEARCOAT_ROUGHNESSMAPuniform sampler2D clearcoatRoughnessMap;-#endif`, Zw = `#ifdef USE_IRIDESCENCEMAP+#endif`, av = `#ifdef USE_IRIDESCENCEMAPuniform sampler2D iridescenceMap;#endif#ifdef USE_IRIDESCENCE_THICKNESSMAPuniform sampler2D iridescenceThicknessMap;-#endif`, $w = `#ifdef OPAQUE+#endif`, ov = `#ifdef OPAQUEdiffuseColor.a = 1.0;#endif#ifdef USE_TRANSMISSIONdiffuseColor.a *= material.transmissionAlpha;#endif-gl_FragColor = vec4( outgoingLight, diffuseColor.a );`, eC = `vec3 packNormalToRGB( const in vec3 normal ) {+gl_FragColor = vec4( outgoingLight, diffuseColor.a );`, cv = `vec3 packNormalToRGB( const in vec3 normal ) {return normalize( normal ) * 0.5 + 0.5;}vec3 unpackRGBToNormal( const in vec3 rgb ) {@@ -15872,9 +15872,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const}float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {return ( near * far ) / ( ( far - near ) * depth - far );-}`, tC = `#ifdef PREMULTIPLIED_ALPHA+}`, lv = `#ifdef PREMULTIPLIED_ALPHAgl_FragColor.rgb *= gl_FragColor.a;-#endif`, nC = `vec4 mvPosition = vec4( transformed, 1.0 );+#endif`, hv = `vec4 mvPosition = vec4( transformed, 1.0 );#ifdef USE_BATCHINGmvPosition = batchingMatrix * mvPosition;#endif@@ -15882,22 +15882,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, constmvPosition = instanceMatrix * mvPosition;#endifmvPosition = modelViewMatrix * mvPosition;-gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERING+gl_Position = projectionMatrix * mvPosition;`, uv = `#ifdef DITHERINGgl_FragColor.rgb = dithering( gl_FragColor.rgb );-#endif`, sC = `#ifdef DITHERING+#endif`, dv = `#ifdef DITHERINGvec3 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`, rC = `float roughnessFactor = roughness;+#endif`, fv = `float roughnessFactor = roughness;#ifdef USE_ROUGHNESSMAPvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );roughnessFactor *= texelRoughness.g;-#endif`, aC = `#ifdef USE_ROUGHNESSMAP+#endif`, pv = `#ifdef USE_ROUGHNESSMAPuniform sampler2D roughnessMap;-#endif`, oC = `#if NUM_SPOT_LIGHT_COORDS > 0+#endif`, Av = `#if NUM_SPOT_LIGHT_COORDS > 0varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];#endif#if NUM_SPOT_LIGHT_MAPS > 0@@ -16083,7 +16083,7 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERING}return mix( 1.0, shadow, shadowIntensity );}-#endif`, cC = `#if NUM_SPOT_LIGHT_COORDS > 0+#endif`, gv = `#if NUM_SPOT_LIGHT_COORDS > 0uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];#endif@@ -16124,7 +16124,7 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERING};uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];#endif-#endif`, lC = `#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )+#endif`, mv = `#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );vec4 shadowWorldPosition;#endif@@ -16156,7 +16156,7 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERINGvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;}#pragma unroll_loop_end-#endif`, hC = `float getShadowMask() {+#endif`, bv = `float getShadowMask() {float shadow = 1.0;#ifdef USE_SHADOWMAP#if NUM_DIR_LIGHT_SHADOWS > 0@@ -16188,12 +16188,12 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERING#endif#endifreturn shadow;-}`, uC = `#ifdef USE_SKINNING+}`, xv = `#ifdef USE_SKINNINGmat4 boneMatX = getBoneMatrix( skinIndex.x );mat4 boneMatY = getBoneMatrix( skinIndex.y );mat4 boneMatZ = getBoneMatrix( skinIndex.z );mat4 boneMatW = getBoneMatrix( skinIndex.w );-#endif`, dC = `#ifdef USE_SKINNING+#endif`, Ev = `#ifdef USE_SKINNINGuniform mat4 bindMatrix;uniform mat4 bindMatrixInverse;uniform highp sampler2D boneTexture;@@ -16208,7 +16208,7 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERINGvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );return mat4( v1, v2, v3, v4 );}-#endif`, fC = `#ifdef USE_SKINNING+#endif`, _v = `#ifdef USE_SKINNINGvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );vec4 skinned = vec4( 0.0 );skinned += boneMatX * skinVertex * skinWeight.x;@@ -16216,7 +16216,7 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERINGskinned += boneMatZ * skinVertex * skinWeight.z;skinned += boneMatW * skinVertex * skinWeight.w;transformed = ( bindMatrixInverse * skinned ).xyz;-#endif`, pC = `#ifdef USE_SKINNING+#endif`, yv = `#ifdef USE_SKINNINGmat4 skinMatrix = mat4( 0.0 );skinMatrix += skinWeight.x * boneMatX;skinMatrix += skinWeight.y * boneMatY;@@ -16227,17 +16227,17 @@ gl_Position = projectionMatrix * mvPosition;`, iC = `#ifdef DITHERING#ifdef USE_TANGENTobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;#endif-#endif`, AC = `float specularStrength;+#endif`, wv = `float specularStrength;#ifdef USE_SPECULARMAPvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );specularStrength = texelSpecular.r;#elsespecularStrength = 1.0;-#endif`, gC = `#ifdef USE_SPECULARMAP+#endif`, vv = `#ifdef USE_SPECULARMAPuniform sampler2D specularMap;-#endif`, mC = `#if defined( TONE_MAPPING )+#endif`, Cv = `#if defined( TONE_MAPPING )gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );-#endif`, bC = `#ifndef saturate+#endif`, Sv = `#ifndef saturate#define saturate( a ) clamp( a, 0.0, 1.0 )#endifuniform float toneMappingExposure;@@ -16334,7 +16334,7 @@ vec3 NeutralToneMapping( vec3 color ) {float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );return mix( color, vec3( newPeak ), g );}-vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSMISSION+vec3 CustomToneMapping( vec3 color ) { return color; }`, Iv = `#ifdef USE_TRANSMISSIONmaterial.transmission = transmission;material.transmissionAlpha = 1.0;material.thickness = thickness;@@ -16355,7 +16355,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSMmaterial.attenuationColor, material.attenuationDistance );material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );-#endif`, EC = `#ifdef USE_TRANSMISSION+#endif`, Mv = `#ifdef USE_TRANSMISSIONuniform float transmission;uniform float thickness;uniform float attenuationDistance;@@ -16481,7 +16481,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSMfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );}-#endif`, _C = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )+#endif`, Bv = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )varying vec2 vUv;#endif#ifdef USE_MAP@@ -16551,7 +16551,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSM#ifdef USE_THICKNESSMAPuniform mat3 thicknessMapTransform;varying vec2 vThicknessMapUv;-#endif`, yC = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )+#endif`, Tv = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )varying vec2 vUv;#endif#ifdef USE_MAP@@ -16645,7 +16645,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSM#ifdef USE_THICKNESSMAPuniform mat3 thicknessMapTransform;varying vec2 vThicknessMapUv;-#endif`, wC = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )+#endif`, Rv = `#if defined( USE_UV ) || defined( USE_ANISOTROPY )vUv = vec3( uv, 1 ).xy;#endif#ifdef USE_MAP@@ -16716,7 +16716,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSM#endif#ifdef USE_THICKNESSMAPvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;-#endif`, CC = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0+#endif`, Nv = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0vec4 worldPosition = vec4( transformed, 1.0 );#ifdef USE_BATCHINGworldPosition = batchingMatrix * worldPosition;@@ -16726,12 +16726,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`, xC = `#ifdef USE_TRANSM#endifworldPosition = modelMatrix * worldPosition;#endif`;-const vC = `varying vec2 vUv;+const Fv = `varying vec2 vUv;uniform mat3 uvTransform;void main() {vUv = ( uvTransform * vec3( uv, 1 ) ).xy;gl_Position = vec4( position.xy, 1.0, 1.0 );-}`, SC = `uniform sampler2D t2D;+}`, Dv = `uniform sampler2D t2D;uniform float backgroundIntensity;varying vec2 vUv;void main() {@@ -16743,14 +16743,14 @@ void main() {gl_FragColor = texColor;#include <tonemapping_fragment>#include <colorspace_fragment>-}`, IC = `varying vec3 vWorldDirection;+}`, Lv = `varying vec3 vWorldDirection;#include <common>void main() {vWorldDirection = transformDirection( position, modelMatrix );#include <begin_vertex>#include <project_vertex>gl_Position.z = gl_Position.w;-}`, MC = `#ifdef ENVMAP_TYPE_CUBE+}`, Pv = `#ifdef ENVMAP_TYPE_CUBEuniform samplerCube envMap;#elif defined( ENVMAP_TYPE_CUBE_UV )uniform sampler2D envMap;@@ -16773,14 +16773,14 @@ void main() {gl_FragColor = texColor;#include <tonemapping_fragment>#include <colorspace_fragment>-}`, BC = `varying vec3 vWorldDirection;+}`, kv = `varying vec3 vWorldDirection;#include <common>void main() {vWorldDirection = transformDirection( position, modelMatrix );#include <begin_vertex>#include <project_vertex>gl_Position.z = gl_Position.w;-}`, TC = `uniform samplerCube tCube;+}`, Uv = `uniform samplerCube tCube;uniform float tFlip;uniform float opacity;varying vec3 vWorldDirection;@@ -16790,7 +16790,7 @@ void main() {gl_FragColor.a *= opacity;#include <tonemapping_fragment>#include <colorspace_fragment>-}`, RC = `#include <common>+}`, Ov = `#include <common>#include <batching_pars_vertex>#include <uv_pars_vertex>#include <displacementmap_pars_vertex>@@ -16817,7 +16817,7 @@ void main() {#include <logdepthbuf_vertex>#include <clipping_planes_vertex>vHighPrecisionZW = gl_Position.zw;-}`, NC = `#if DEPTH_PACKING == 3200+}`, Qv = `#if DEPTH_PACKING == 3200uniform float opacity;#endif#include <common>@@ -16851,7 +16851,7 @@ void main() {#elif DEPTH_PACKING == 3203gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );#endif-}`, FC = `#define DISTANCE+}`, Gv = `#define DISTANCEvarying vec3 vWorldPosition;#include <common>#include <batching_pars_vertex>@@ -16878,7 +16878,7 @@ void main() {#include <worldpos_vertex>#include <clipping_planes_vertex>vWorldPosition = worldPosition.xyz;-}`, DC = `#define DISTANCE+}`, Hv = `#define DISTANCEuniform vec3 referencePosition;uniform float nearDistance;uniform float farDistance;@@ -16902,13 +16902,13 @@ void main () {dist = ( dist - nearDistance ) / ( farDistance - nearDistance );dist = saturate( dist );gl_FragColor = packDepthToRGBA( dist );-}`, LC = `varying vec3 vWorldDirection;+}`, zv = `varying vec3 vWorldDirection;#include <common>void main() {vWorldDirection = transformDirection( position, modelMatrix );#include <begin_vertex>#include <project_vertex>-}`, PC = `uniform sampler2D tEquirect;+}`, Vv = `uniform sampler2D tEquirect;varying vec3 vWorldDirection;#include <common>void main() {@@ -16917,7 +16917,7 @@ void main() {gl_FragColor = texture2D( tEquirect, sampleUV );#include <tonemapping_fragment>#include <colorspace_fragment>-}`, kC = `uniform float scale;+}`, Wv = `uniform float scale;attribute float lineDistance;varying float vLineDistance;#include <common>@@ -16939,7 +16939,7 @@ void main() {#include <logdepthbuf_vertex>#include <clipping_planes_vertex>#include <fog_vertex>-}`, UC = `uniform vec3 diffuse;+}`, qv = `uniform vec3 diffuse;uniform float opacity;uniform float dashSize;uniform float totalSize;@@ -16967,7 +16967,7 @@ void main() {#include <colorspace_fragment>#include <fog_fragment>#include <premultiplied_alpha_fragment>-}`, OC = `#include <common>+}`, Kv = `#include <common>#include <batching_pars_vertex>#include <uv_pars_vertex>#include <envmap_pars_vertex>@@ -16999,7 +16999,7 @@ void main() {#include <worldpos_vertex>#include <envmap_vertex>#include <fog_vertex>-}`, QC = `uniform vec3 diffuse;+}`, jv = `uniform vec3 diffuse;uniform float opacity;#ifndef FLAT_SHADEDvarying vec3 vNormal;@@ -17047,7 +17047,7 @@ void main() {#include <fog_fragment>#include <premultiplied_alpha_fragment>#include <dithering_fragment>-}`, GC = `#define LAMBERT+}`, Xv = `#define LAMBERTvarying vec3 vViewPosition;#include <common>#include <batching_pars_vertex>@@ -17086,7 +17086,7 @@ void main() {#include <envmap_vertex>#include <shadowmap_vertex>#include <fog_vertex>-}`, HC = `#define LAMBERT+}`, Yv = `#define LAMBERTuniform vec3 diffuse;uniform vec3 emissive;uniform float opacity;@@ -17143,7 +17143,7 @@ void main() {#include <fog_fragment>#include <premultiplied_alpha_fragment>#include <dithering_fragment>-}`, zC = `#define MATCAP+}`, Jv = `#define MATCAPvarying vec3 vViewPosition;#include <common>#include <batching_pars_vertex>@@ -17177,7 +17177,7 @@ void main() {#include <clipping_planes_vertex>#include <fog_vertex>vViewPosition = - mvPosition.xyz;-}`, VC = `#define MATCAP+}`, Zv = `#define MATCAPuniform vec3 diffuse;uniform float opacity;uniform sampler2D matcap;@@ -17223,7 +17223,7 @@ void main() {#include <fog_fragment>#include <premultiplied_alpha_fragment>#include <dithering_fragment>-}`, WC = `#define NORMAL+}`, $v = `#define NORMAL#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )varying vec3 vViewPosition;#endif@@ -17256,7 +17256,7 @@ void main() {#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )vViewPosition = - mvPosition.xyz;#endif-}`, qC = `#define NORMAL+}`, eC = `#define NORMALuniform float opacity;#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )varying vec3 vViewPosition;@@ -17278,7 +17278,7 @@ void main() {#ifdef OPAQUEgl_FragColor.a = 1.0;#endif-}`, KC = `#define PHONG+}`, tC = `#define PHONGvarying vec3 vViewPosition;#include <common>#include <batching_pars_vertex>@@ -17317,7 +17317,7 @@ void main() {#include <envmap_vertex>#include <shadowmap_vertex>#include <fog_vertex>-}`, XC = `#define PHONG+}`, nC = `#define PHONGuniform vec3 diffuse;uniform vec3 emissive;uniform vec3 specular;@@ -17376,7 +17376,7 @@ void main() {#include <fog_fragment>#include <premultiplied_alpha_fragment>#include <dithering_fragment>-}`, YC = `#define STANDARD+}`, iC = `#define STANDARDvarying vec3 vViewPosition;#ifdef USE_TRANSMISSIONvarying vec3 vWorldPosition;@@ -17419,7 +17419,7 @@ void main() {#ifdef USE_TRANSMISSIONvWorldPosition = worldPosition.xyz;#endif-}`, jC = `#define STANDARD+}`, sC = `#define STANDARD#ifdef PHYSICAL#define IOR#define USE_SPECULAR@@ -17544,7 +17544,7 @@ void main() {#include <fog_fragment>#include <premultiplied_alpha_fragment>#include <dithering_fragment>-}`, JC = `#define TOON+}`, rC = `#define TOONvarying vec3 vViewPosition;#include <common>#include <batching_pars_vertex>@@ -17581,7 +17581,7 @@ void main() {#include <worldpos_vertex>#include <shadowmap_vertex>#include <fog_vertex>-}`, ZC = `#define TOON+}`, aC = `#define TOONuniform vec3 diffuse;uniform vec3 emissive;uniform float opacity;@@ -17634,7 +17634,7 @@ void main() {#include <fog_fragment>#include <premultiplied_alpha_fragment>#include <dithering_fragment>-}`, $C = `uniform float size;+}`, oC = `uniform float size;uniform float scale;#include <common>#include <color_pars_vertex>@@ -17665,7 +17665,7 @@ void main() {#include <clipping_planes_vertex>#include <worldpos_vertex>#include <fog_vertex>-}`, ev = `uniform vec3 diffuse;+}`, cC = `uniform vec3 diffuse;uniform float opacity;#include <common>#include <color_pars_fragment>@@ -17690,7 +17690,7 @@ void main() {#include <colorspace_fragment>#include <fog_fragment>#include <premultiplied_alpha_fragment>-}`, tv = `#include <common>+}`, lC = `#include <common>#include <batching_pars_vertex>#include <fog_pars_vertex>#include <morphtarget_pars_vertex>@@ -17713,7 +17713,7 @@ void main() {#include <worldpos_vertex>#include <shadowmap_vertex>#include <fog_vertex>-}`, nv = `uniform vec3 color;+}`, hC = `uniform vec3 color;uniform float opacity;#include <common>#include <packing>@@ -17729,7 +17729,7 @@ void main() {#include <tonemapping_fragment>#include <colorspace_fragment>#include <fog_fragment>-}`, iv = `uniform float rotation;+}`, uC = `uniform float rotation;uniform vec2 center;#include <common>#include <uv_pars_vertex>@@ -17753,7 +17753,7 @@ void main() {#include <logdepthbuf_vertex>#include <clipping_planes_vertex>#include <fog_vertex>-}`, sv = `uniform vec3 diffuse;+}`, dC = `uniform vec3 diffuse;uniform float opacity;#include <common>#include <uv_pars_fragment>@@ -17779,150 +17779,150 @@ void main() {#include <colorspace_fragment>#include <fog_fragment>}`, ot = {- alphahash_fragment: Sy,- alphahash_pars_fragment: Iy,- alphamap_fragment: My,- alphamap_pars_fragment: By,- alphatest_fragment: Ty,- alphatest_pars_fragment: Ry,- aomap_fragment: Ny,- aomap_pars_fragment: Fy,- batching_pars_vertex: Dy,- batching_vertex: Ly,- begin_vertex: Py,- beginnormal_vertex: ky,- bsdfs: Uy,- iridescence_fragment: Oy,- bumpmap_pars_fragment: Qy,- clipping_planes_fragment: Gy,- clipping_planes_pars_fragment: Hy,- clipping_planes_pars_vertex: zy,- clipping_planes_vertex: Vy,- color_fragment: Wy,- color_pars_fragment: qy,- color_pars_vertex: Ky,- color_vertex: Xy,- common: Yy,- cube_uv_reflection_fragment: jy,- defaultnormal_vertex: Jy,- displacementmap_pars_vertex: Zy,- displacementmap_vertex: $y,- emissivemap_fragment: ew,- emissivemap_pars_fragment: tw,- colorspace_fragment: nw,- colorspace_pars_fragment: iw,- envmap_fragment: sw,- envmap_common_pars_fragment: rw,- envmap_pars_fragment: aw,- envmap_pars_vertex: ow,- envmap_physical_pars_fragment: bw,- envmap_vertex: cw,- fog_vertex: lw,- fog_pars_vertex: hw,- fog_fragment: uw,- fog_pars_fragment: dw,- gradientmap_pars_fragment: fw,- lightmap_pars_fragment: pw,- lights_lambert_fragment: Aw,- lights_lambert_pars_fragment: gw,- lights_pars_begin: mw,- lights_toon_fragment: xw,- lights_toon_pars_fragment: Ew,- lights_phong_fragment: _w,- lights_phong_pars_fragment: yw,- lights_physical_fragment: ww,- lights_physical_pars_fragment: Cw,- lights_fragment_begin: vw,- lights_fragment_maps: Sw,- lights_fragment_end: Iw,- logdepthbuf_fragment: Mw,- logdepthbuf_pars_fragment: Bw,- logdepthbuf_pars_vertex: Tw,- logdepthbuf_vertex: Rw,- map_fragment: Nw,- map_pars_fragment: Fw,- map_particle_fragment: Dw,- map_particle_pars_fragment: Lw,- metalnessmap_fragment: Pw,- metalnessmap_pars_fragment: kw,- morphinstance_vertex: Uw,- morphcolor_vertex: Ow,- morphnormal_vertex: Qw,- morphtarget_pars_vertex: Gw,- morphtarget_vertex: Hw,- normal_fragment_begin: zw,- normal_fragment_maps: Vw,- normal_pars_fragment: Ww,- normal_pars_vertex: qw,- normal_vertex: Kw,- normalmap_pars_fragment: Xw,- clearcoat_normal_fragment_begin: Yw,- clearcoat_normal_fragment_maps: jw,- clearcoat_pars_fragment: Jw,- iridescence_pars_fragment: Zw,- opaque_fragment: $w,- packing: eC,- premultiplied_alpha_fragment: tC,- project_vertex: nC,- dithering_fragment: iC,- dithering_pars_fragment: sC,- roughnessmap_fragment: rC,- roughnessmap_pars_fragment: aC,- shadowmap_pars_fragment: oC,- shadowmap_pars_vertex: cC,- shadowmap_vertex: lC,- shadowmask_pars_fragment: hC,- skinbase_vertex: uC,- skinning_pars_vertex: dC,- skinning_vertex: fC,- skinnormal_vertex: pC,- specularmap_fragment: AC,- specularmap_pars_fragment: gC,- tonemapping_fragment: mC,- tonemapping_pars_fragment: bC,- transmission_fragment: xC,- transmission_pars_fragment: EC,- uv_pars_fragment: _C,- uv_pars_vertex: yC,- uv_vertex: wC,- worldpos_vertex: CC,- background_vert: vC,- background_frag: SC,- backgroundCube_vert: IC,- backgroundCube_frag: MC,- cube_vert: BC,- cube_frag: TC,- depth_vert: RC,- depth_frag: NC,- distanceRGBA_vert: FC,- distanceRGBA_frag: DC,- equirect_vert: LC,- equirect_frag: PC,- linedashed_vert: kC,- linedashed_frag: UC,- meshbasic_vert: OC,- meshbasic_frag: QC,- meshlambert_vert: GC,- meshlambert_frag: HC,- meshmatcap_vert: zC,- meshmatcap_frag: VC,- meshnormal_vert: WC,- meshnormal_frag: qC,- meshphong_vert: KC,- meshphong_frag: XC,- meshphysical_vert: YC,- meshphysical_frag: jC,- meshtoon_vert: JC,- meshtoon_frag: ZC,- points_vert: $C,- points_frag: ev,- shadow_vert: tv,- shadow_frag: nv,- sprite_vert: iv,- sprite_frag: sv+ alphahash_fragment: Dy,+ alphahash_pars_fragment: Ly,+ alphamap_fragment: Py,+ alphamap_pars_fragment: ky,+ alphatest_fragment: Uy,+ alphatest_pars_fragment: Oy,+ aomap_fragment: Qy,+ aomap_pars_fragment: Gy,+ batching_pars_vertex: Hy,+ batching_vertex: zy,+ begin_vertex: Vy,+ beginnormal_vertex: Wy,+ bsdfs: qy,+ iridescence_fragment: Ky,+ bumpmap_pars_fragment: jy,+ clipping_planes_fragment: Xy,+ clipping_planes_pars_fragment: Yy,+ clipping_planes_pars_vertex: Jy,+ clipping_planes_vertex: Zy,+ color_fragment: $y,+ color_pars_fragment: ew,+ color_pars_vertex: tw,+ color_vertex: nw,+ common: iw,+ cube_uv_reflection_fragment: sw,+ defaultnormal_vertex: rw,+ displacementmap_pars_vertex: aw,+ displacementmap_vertex: ow,+ emissivemap_fragment: cw,+ emissivemap_pars_fragment: lw,+ colorspace_fragment: hw,+ colorspace_pars_fragment: uw,+ envmap_fragment: dw,+ envmap_common_pars_fragment: fw,+ envmap_pars_fragment: pw,+ envmap_pars_vertex: Aw,+ envmap_physical_pars_fragment: Sw,+ envmap_vertex: gw,+ fog_vertex: mw,+ fog_pars_vertex: bw,+ fog_fragment: xw,+ fog_pars_fragment: Ew,+ gradientmap_pars_fragment: _w,+ lightmap_pars_fragment: yw,+ lights_lambert_fragment: ww,+ lights_lambert_pars_fragment: vw,+ lights_pars_begin: Cw,+ lights_toon_fragment: Iw,+ lights_toon_pars_fragment: Mw,+ lights_phong_fragment: Bw,+ lights_phong_pars_fragment: Tw,+ lights_physical_fragment: Rw,+ lights_physical_pars_fragment: Nw,+ lights_fragment_begin: Fw,+ lights_fragment_maps: Dw,+ lights_fragment_end: Lw,+ logdepthbuf_fragment: Pw,+ logdepthbuf_pars_fragment: kw,+ logdepthbuf_pars_vertex: Uw,+ logdepthbuf_vertex: Ow,+ map_fragment: Qw,+ map_pars_fragment: Gw,+ map_particle_fragment: Hw,+ map_particle_pars_fragment: zw,+ metalnessmap_fragment: Vw,+ metalnessmap_pars_fragment: Ww,+ morphinstance_vertex: qw,+ morphcolor_vertex: Kw,+ morphnormal_vertex: jw,+ morphtarget_pars_vertex: Xw,+ morphtarget_vertex: Yw,+ normal_fragment_begin: Jw,+ normal_fragment_maps: Zw,+ normal_pars_fragment: $w,+ normal_pars_vertex: ev,+ normal_vertex: tv,+ normalmap_pars_fragment: nv,+ clearcoat_normal_fragment_begin: iv,+ clearcoat_normal_fragment_maps: sv,+ clearcoat_pars_fragment: rv,+ iridescence_pars_fragment: av,+ opaque_fragment: ov,+ packing: cv,+ premultiplied_alpha_fragment: lv,+ project_vertex: hv,+ dithering_fragment: uv,+ dithering_pars_fragment: dv,+ roughnessmap_fragment: fv,+ roughnessmap_pars_fragment: pv,+ shadowmap_pars_fragment: Av,+ shadowmap_pars_vertex: gv,+ shadowmap_vertex: mv,+ shadowmask_pars_fragment: bv,+ skinbase_vertex: xv,+ skinning_pars_vertex: Ev,+ skinning_vertex: _v,+ skinnormal_vertex: yv,+ specularmap_fragment: wv,+ specularmap_pars_fragment: vv,+ tonemapping_fragment: Cv,+ tonemapping_pars_fragment: Sv,+ transmission_fragment: Iv,+ transmission_pars_fragment: Mv,+ uv_pars_fragment: Bv,+ uv_pars_vertex: Tv,+ uv_vertex: Rv,+ worldpos_vertex: Nv,+ background_vert: Fv,+ background_frag: Dv,+ backgroundCube_vert: Lv,+ backgroundCube_frag: Pv,+ cube_vert: kv,+ cube_frag: Uv,+ depth_vert: Ov,+ depth_frag: Qv,+ distanceRGBA_vert: Gv,+ distanceRGBA_frag: Hv,+ equirect_vert: zv,+ equirect_frag: Vv,+ linedashed_vert: Wv,+ linedashed_frag: qv,+ meshbasic_vert: Kv,+ meshbasic_frag: jv,+ meshlambert_vert: Xv,+ meshlambert_frag: Yv,+ meshmatcap_vert: Jv,+ meshmatcap_frag: Zv,+ meshnormal_vert: $v,+ meshnormal_frag: eC,+ meshphong_vert: tC,+ meshphong_frag: nC,+ meshphysical_vert: iC,+ meshphysical_frag: sC,+ meshtoon_vert: rC,+ meshtoon_frag: aC,+ points_vert: oC,+ points_frag: cC,+ shadow_vert: lC,+ shadow_frag: hC,+ sprite_vert: uC,+ sprite_frag: dC}, we = {common: {- diffuse: { value: /* @__PURE__ */ new Xe(16777215) },+ diffuse: { value: /* @__PURE__ */ new je(16777215) },opacity: { value: 1 },map: { value: null },mapTransform: { value: /* @__PURE__ */ new rt() },@@ -17990,7 +17990,7 @@ void main() {fogDensity: { value: 25e-5 },fogNear: { value: 1 },fogFar: { value: 2e3 },- fogColor: { value: /* @__PURE__ */ new Xe(16777215) }+ fogColor: { value: /* @__PURE__ */ new je(16777215) }},lights: {ambientLightColor: { value: [] },@@ -18060,7 +18060,7 @@ void main() {ltc_2: { value: null }},points: {- diffuse: { value: /* @__PURE__ */ new Xe(16777215) },+ diffuse: { value: /* @__PURE__ */ new je(16777215) },opacity: { value: 1 },size: { value: 1 },scale: { value: 1 },@@ -18071,7 +18071,7 @@ void main() {uvTransform: { value: /* @__PURE__ */ new rt() }},sprite: {- diffuse: { value: /* @__PURE__ */ new Xe(16777215) },+ diffuse: { value: /* @__PURE__ */ new je(16777215) },opacity: { value: 1 },center: { value: /* @__PURE__ */ new Ze(0.5, 0.5) },rotation: { value: 0 },@@ -18081,7 +18081,7 @@ void main() {alphaMapTransform: { value: /* @__PURE__ */ new rt() },alphaTest: { value: 0 }}-}, Mi = {+}, Bi = {basic: {uniforms: /* @__PURE__ */ Mn([we.common,@@ -18108,7 +18108,7 @@ void main() {we.fog,we.lights,{- emissive: { value: /* @__PURE__ */ new Xe(0) }+ emissive: { value: /* @__PURE__ */ new je(0) }}]),vertexShader: ot.meshlambert_vert,@@ -18128,8 +18128,8 @@ void main() {we.fog,we.lights,{- emissive: { value: /* @__PURE__ */ new Xe(0) },- specular: { value: /* @__PURE__ */ new Xe(1118481) },+ emissive: { value: /* @__PURE__ */ new je(0) },+ specular: { value: /* @__PURE__ */ new je(1118481) },shininess: { value: 30 }}]),@@ -18151,7 +18151,7 @@ void main() {we.fog,we.lights,{- emissive: { value: /* @__PURE__ */ new Xe(0) },+ emissive: { value: /* @__PURE__ */ new je(0) },roughness: { value: 1 },metalness: { value: 0 },envMapIntensity: { value: 1 }@@ -18173,7 +18173,7 @@ void main() {we.fog,we.lights,{- emissive: { value: /* @__PURE__ */ new Xe(0) }+ emissive: { value: /* @__PURE__ */ new je(0) }}]),vertexShader: ot.meshtoon_vert,@@ -18297,7 +18297,7 @@ void main() {we.lights,we.fog,{- color: { value: /* @__PURE__ */ new Xe(0) },+ color: { value: /* @__PURE__ */ new je(0) },opacity: { value: 1 }}]),@@ -18305,9 +18305,9 @@ void main() {fragmentShader: ot.shadow_frag}};-Mi.physical = {+Bi.physical = {uniforms: /* @__PURE__ */ Mn([- Mi.standard.uniforms,+ Bi.standard.uniforms,{clearcoat: { value: 0 },clearcoatMap: { value: null },@@ -18328,7 +18328,7 @@ Mi.physical = {iridescenceThicknessMap: { value: null },iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new rt() },sheen: { value: 0 },- sheenColor: { value: /* @__PURE__ */ new Xe(0) },+ sheenColor: { value: /* @__PURE__ */ new je(0) },sheenColorMap: { value: null },sheenColorMapTransform: { value: /* @__PURE__ */ new rt() },sheenRoughness: { value: 1 },@@ -18343,8 +18343,8 @@ Mi.physical = {thicknessMap: { value: null },thicknessMapTransform: { value: /* @__PURE__ */ new rt() },attenuationDistance: { value: 0 },- attenuationColor: { value: /* @__PURE__ */ new Xe(0) },- specularColor: { value: /* @__PURE__ */ new Xe(1, 1, 1) },+ attenuationColor: { value: /* @__PURE__ */ new je(0) },+ specularColor: { value: /* @__PURE__ */ new je(1, 1, 1) },specularColorMap: { value: null },specularColorMapTransform: { value: /* @__PURE__ */ new rt() },specularIntensity: { value: 1 },@@ -18358,9 +18358,9 @@ Mi.physical = {vertexShader: ot.meshphysical_vert,fragmentShader: ot.meshphysical_frag};-const Tc = { r: 0, b: 0, g: 0 }, Ys = /* @__PURE__ */ new Fi(), rv = /* @__PURE__ */ new st();-function av(i, e, t, n, s, r, a) {- const o = new Xe(0);+const Lc = { r: 0, b: 0, g: 0 }, Js = /* @__PURE__ */ new Di(), fC = /* @__PURE__ */ new st();+function pC(i, e, t, n, s, r, a) {+ const o = new je(0);let c = r === !0 ? 0 : 1, l, h, u = null, d = 0, f = null;function m(b) {let _ = b.isScene === !0 ? b.background : null;@@ -18375,13 +18375,13 @@ function av(i, e, t, n, s, r, a) {}function A(b, _) {const M = m(_);- M && (M.isCubeTexture || M.mapping === Pl) ? (h === void 0 && (h = new Jt(- new Na(1, 1, 1),- new ks({+ M && (M.isCubeTexture || M.mapping === Gl) ? (h === void 0 && (h = new Jt(+ new Pa(1, 1, 1),+ new Os({name: "BackgroundCubeMaterial",- uniforms: _a(Mi.backgroundCube.uniforms),- vertexShader: Mi.backgroundCube.vertexShader,- fragmentShader: Mi.backgroundCube.fragmentShader,+ uniforms: Ca(Bi.backgroundCube.uniforms),+ vertexShader: Bi.backgroundCube.vertexShader,+ fragmentShader: Bi.backgroundCube.fragmentShader,side: Ln,depthTest: !1,depthWrite: !1,@@ -18394,14 +18394,14 @@ function av(i, e, t, n, s, r, a) {get: function() {return this.uniforms.envMap.value;}- }), s.update(h)), Ys.copy(_.backgroundRotation), Ys.x *= -1, Ys.y *= -1, Ys.z *= -1, M.isCubeTexture && M.isRenderTargetTexture === !1 && (Ys.y *= -1, Ys.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 = _.backgroundBlurriness, h.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, h.material.uniforms.backgroundRotation.value.setFromMatrix4(rv.makeRotationFromEuler(Ys)), h.material.toneMapped = mt.getTransfer(M.colorSpace) !== Mt, (u !== M || d !== M.version || f !== i.toneMapping) && (h.material.needsUpdate = !0, u = M, d = M.version, f = i.toneMapping), h.layers.enableAll(), b.unshift(h, h.geometry, h.material, 0, 0, null)) : M && M.isTexture && (l === void 0 && (l = new Jt(- new Ql(2, 2),- new ks({+ }), s.update(h)), Js.copy(_.backgroundRotation), Js.x *= -1, Js.y *= -1, Js.z *= -1, M.isCubeTexture && M.isRenderTargetTexture === !1 && (Js.y *= -1, Js.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 = _.backgroundBlurriness, h.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, h.material.uniforms.backgroundRotation.value.setFromMatrix4(fC.makeRotationFromEuler(Js)), h.material.toneMapped = mt.getTransfer(M.colorSpace) !== Mt, (u !== M || d !== M.version || f !== i.toneMapping) && (h.material.needsUpdate = !0, u = M, d = M.version, f = i.toneMapping), h.layers.enableAll(), b.unshift(h, h.geometry, h.material, 0, 0, null)) : M && M.isTexture && (l === void 0 && (l = new Jt(+ new Wl(2, 2),+ new Os({name: "BackgroundMaterial",- uniforms: _a(Mi.background.uniforms),- vertexShader: Mi.background.vertexShader,- fragmentShader: Mi.background.fragmentShader,- side: hs,+ uniforms: Ca(Bi.background.uniforms),+ vertexShader: Bi.background.vertexShader,+ fragmentShader: Bi.background.fragmentShader,+ side: us,depthTest: !1,depthWrite: !1,fog: !1,@@ -18414,7 +18414,7 @@ function av(i, e, t, n, s, r, a) {}), s.update(l)), l.material.uniforms.t2D.value = M, l.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, l.material.toneMapped = mt.getTransfer(M.colorSpace) !== Mt, M.matrixAutoUpdate === !0 && M.updateMatrix(), l.material.uniforms.uvTransform.value.copy(M.matrix), (u !== M || d !== M.version || f !== i.toneMapping) && (l.material.needsUpdate = !0, u = M, d = M.version, f = i.toneMapping), l.layers.enableAll(), b.unshift(l, l.geometry, l.material, 0, 0, null));}function p(b, _) {- b.getRGB(Tc, Wm(i)), n.buffers.color.setClear(Tc.r, Tc.g, Tc.b, _, a);+ b.getRGB(Lc, Zm(i)), n.buffers.color.setClear(Lc.r, Lc.g, Lc.b, _, a);}function y() {h !== void 0 && (h.geometry.dispose(), h.material.dispose(), h = void 0), l !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0);@@ -18437,33 +18437,33 @@ function av(i, e, t, n, s, r, a) {dispose: y};}-function ov(i, e) {+function AC(i, e) {const t = i.getParameter(i.MAX_VERTEX_ATTRIBS), n = {}, s = d(null);let r = s, a = !1;- function o(C, F, K, q, $) {+ function o(v, F, K, q, $) {let D = !1;const O = u(q, K, F);- r !== O && (r = O, l(r.object)), D = f(C, q, K, $), D && m(C, q, K, $), $ !== null && e.update($, i.ELEMENT_ARRAY_BUFFER), (D || a) && (a = !1, _(C, F, K, q), $ !== null && i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, e.get($).buffer));+ r !== O && (r = O, l(r.object)), D = f(v, q, K, $), D && m(v, q, K, $), $ !== null && e.update($, i.ELEMENT_ARRAY_BUFFER), (D || a) && (a = !1, _(v, F, K, q), $ !== null && i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, e.get($).buffer));}function c() {return i.createVertexArray();}- function l(C) {- return i.bindVertexArray(C);+ function l(v) {+ return i.bindVertexArray(v);}- function h(C) {- return i.deleteVertexArray(C);+ function h(v) {+ return i.deleteVertexArray(v);}- function u(C, F, K) {+ function u(v, F, K) {const q = K.wireframe === !0;- let $ = n[C.id];- $ === void 0 && ($ = {}, n[C.id] = $);+ let $ = n[v.id];+ $ === void 0 && ($ = {}, n[v.id] = $);let D = $[F.id];D === void 0 && (D = {}, $[F.id] = D);let O = D[q];return O === void 0 && (O = d(c()), D[q] = O), O;}- function d(C) {+ function d(v) {const F = [], K = [], q = [];for (let $ = 0; $ < t; $++)F[$] = 0, K[$] = 0, q[$] = 0;@@ -18475,74 +18475,74 @@ function ov(i, e) {newAttributes: F,enabledAttributes: K,attributeDivisors: q,- object: C,+ object: v,attributes: {},index: null};}- function f(C, F, K, q) {+ function f(v, F, K, q) {const $ = r.attributes, D = F.attributes;let O = 0;- const j = K.getAttributes();- for (const Q in j)- if (j[Q].location >= 0) {+ const Y = K.getAttributes();+ for (const Q in Y)+ if (Y[Q].location >= 0) {const ee = $[Q];let ae = D[Q];- if (ae === void 0 && (Q === "instanceMatrix" && C.instanceMatrix && (ae = C.instanceMatrix), Q === "instanceColor" && C.instanceColor && (ae = C.instanceColor)), ee === void 0 || ee.attribute !== ae || ae && ee.data !== ae.data) return !0;+ if (ae === void 0 && (Q === "instanceMatrix" && v.instanceMatrix && (ae = v.instanceMatrix), Q === "instanceColor" && v.instanceColor && (ae = v.instanceColor)), ee === void 0 || ee.attribute !== ae || ae && ee.data !== ae.data) return !0;O++;}return r.attributesNum !== O || r.index !== q;}- function m(C, F, K, q) {+ function m(v, F, K, q) {const $ = {}, D = F.attributes;let O = 0;- const j = K.getAttributes();- for (const Q in j)- if (j[Q].location >= 0) {+ const Y = K.getAttributes();+ for (const Q in Y)+ if (Y[Q].location >= 0) {let ee = D[Q];- ee === void 0 && (Q === "instanceMatrix" && C.instanceMatrix && (ee = C.instanceMatrix), Q === "instanceColor" && C.instanceColor && (ee = C.instanceColor));+ ee === void 0 && (Q === "instanceMatrix" && v.instanceMatrix && (ee = v.instanceMatrix), Q === "instanceColor" && v.instanceColor && (ee = v.instanceColor));const ae = {};ae.attribute = ee, ee && ee.data && (ae.data = ee.data), $[Q] = ae, O++;}r.attributes = $, r.attributesNum = O, r.index = q;}function g() {- const C = r.newAttributes;- for (let F = 0, K = C.length; F < K; F++)- C[F] = 0;+ const v = r.newAttributes;+ for (let F = 0, K = v.length; F < K; F++)+ v[F] = 0;}- function A(C) {- p(C, 0);+ function A(v) {+ p(v, 0);}- function p(C, F) {+ function p(v, F) {const K = r.newAttributes, q = r.enabledAttributes, $ = r.attributeDivisors;- K[C] = 1, q[C] === 0 && (i.enableVertexAttribArray(C), q[C] = 1), $[C] !== F && (i.vertexAttribDivisor(C, F), $[C] = F);+ K[v] = 1, q[v] === 0 && (i.enableVertexAttribArray(v), q[v] = 1), $[v] !== F && (i.vertexAttribDivisor(v, F), $[v] = F);}function y() {- const C = r.newAttributes, F = r.enabledAttributes;+ const v = r.newAttributes, F = r.enabledAttributes;for (let K = 0, q = F.length; K < q; K++)- F[K] !== C[K] && (i.disableVertexAttribArray(K), F[K] = 0);+ F[K] !== v[K] && (i.disableVertexAttribArray(K), F[K] = 0);}- function b(C, F, K, q, $, D, O) {- O === !0 ? i.vertexAttribIPointer(C, F, K, $, D) : i.vertexAttribPointer(C, F, K, q, $, D);+ function b(v, F, K, q, $, D, O) {+ O === !0 ? i.vertexAttribIPointer(v, F, K, $, D) : i.vertexAttribPointer(v, F, K, q, $, D);}- function _(C, F, K, q) {+ function _(v, F, K, q) {g();const $ = q.attributes, D = K.getAttributes(), O = F.defaultAttributeValues;- for (const j in D) {- const Q = D[j];+ for (const Y in D) {+ const Q = D[Y];if (Q.location >= 0) {- let J = $[j];- if (J === void 0 && (j === "instanceMatrix" && C.instanceMatrix && (J = C.instanceMatrix), j === "instanceColor" && C.instanceColor && (J = C.instanceColor)), J !== void 0) {+ let J = $[Y];+ if (J === void 0 && (Y === "instanceMatrix" && v.instanceMatrix && (J = v.instanceMatrix), Y === "instanceColor" && v.instanceColor && (J = v.instanceColor)), J !== void 0) {const ee = J.normalized, ae = J.itemSize, ye = e.get(J);if (ye === void 0) continue;- const Me = ye.buffer, se = ye.type, me = ye.bytesPerElement, be = se === i.INT || se === i.UNSIGNED_INT || J.gpuType === Zd;+ const Me = ye.buffer, se = ye.type, me = ye.bytesPerElement, be = se === i.INT || se === i.UNSIGNED_INT || J.gpuType === rf;if (J.isInterleavedBufferAttribute) {const xe = J.data, Pe = xe.stride, $e = J.offset;if (xe.isInstancedInterleavedBuffer) {for (let Qe = 0; Qe < Q.locationSize; Qe++)p(Q.location + Qe, xe.meshPerAttribute);- C.isInstancedMesh !== !0 && q._maxInstanceCount === void 0 && (q._maxInstanceCount = xe.meshPerAttribute * xe.count);+ v.isInstancedMesh !== !0 && q._maxInstanceCount === void 0 && (q._maxInstanceCount = xe.meshPerAttribute * xe.count);} elsefor (let Qe = 0; Qe < Q.locationSize; Qe++)A(Q.location + Qe);@@ -18561,7 +18561,7 @@ function ov(i, e) {if (J.isInstancedBufferAttribute) {for (let xe = 0; xe < Q.locationSize; xe++)p(Q.location + xe, J.meshPerAttribute);- C.isInstancedMesh !== !0 && q._maxInstanceCount === void 0 && (q._maxInstanceCount = J.meshPerAttribute * J.count);+ v.isInstancedMesh !== !0 && q._maxInstanceCount === void 0 && (q._maxInstanceCount = J.meshPerAttribute * J.count);} elsefor (let xe = 0; xe < Q.locationSize; xe++)A(Q.location + xe);@@ -18578,7 +18578,7 @@ function ov(i, e) {);}} else if (O !== void 0) {- const ee = O[j];+ const ee = O[Y];if (ee !== void 0)switch (ee.length) {case 2:@@ -18600,48 +18600,48 @@ function ov(i, e) {}function M() {T();- for (const C in n) {- const F = n[C];+ for (const v in n) {+ const F = n[v];for (const K in F) {const q = F[K];for (const $ in q)h(q[$].object), delete q[$];delete F[K];}- delete n[C];+ delete n[v];}}- function w(C) {- if (n[C.id] === void 0) return;- const F = n[C.id];+ function w(v) {+ if (n[v.id] === void 0) return;+ const F = n[v.id];for (const K in F) {const q = F[K];for (const $ in q)h(q[$].object), delete q[$];delete F[K];}- delete n[C.id];+ delete n[v.id];}- function S(C) {+ function S(v) {for (const F in n) {const K = n[F];- if (K[C.id] === void 0) continue;- const q = K[C.id];+ if (K[v.id] === void 0) continue;+ const q = K[v.id];for (const $ in q)h(q[$].object), delete q[$];- delete K[C.id];+ delete K[v.id];}}function T() {- v(), a = !0, r !== s && (r = s, l(r.object));+ C(), a = !0, r !== s && (r = s, l(r.object));}- function v() {+ function C() {s.geometry = null, s.program = null, s.wireframe = !1;}return {setup: o,reset: T,- resetDefaultState: v,+ resetDefaultState: C,dispose: M,releaseStatesOfGeometry: w,releaseStatesOfProgram: S,@@ -18650,7 +18650,7 @@ function ov(i, e) {disableUnusedAttributes: y};}-function cv(i, e, t) {+function gC(i, e, t) {let n;function s(l) {n = l;@@ -18685,7 +18685,7 @@ function cv(i, e, t) {}this.setMode = s, this.render = r, this.renderInstances = a, this.renderMultiDraw = o, this.renderMultiDrawInstances = c;}-function lv(i, e, t, n) {+function mC(i, e, t, n) {let s;function r() {if (s !== void 0) return s;@@ -18738,10 +18738,10 @@ function lv(i, e, t, n) {maxSamples: w};}-function hv(i) {+function bC(i) {const e = this;let t = null, n = 0, s = !1, r = !1;- const a = new Ts(), o = new rt(), c = { value: null, needsUpdate: !1 };+ const a = new Rs(), o = new rt(), c = { value: null, needsUpdate: !1 };this.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(u, d) {const f = u.length !== 0 || d || // enable state of previous frame - the clipping code has to// run another frame in order to reset the state:@@ -18784,22 +18784,22 @@ function hv(i) {return e.numPlanes = g, e.numIntersection = 0, A;}}-function uv(i) {+function xC(i) {let e = /* @__PURE__ */ new WeakMap();function t(a, o) {- return o === ku ? a.mapping = gr : o === Uu && (a.mapping = ba), a;+ return o === zu ? a.mapping = br : o === Vu && (a.mapping = ya), a;}function n(a) {if (a && a.isTexture) {const o = a.mapping;- if (o === ku || o === Uu)+ if (o === zu || o === Vu)if (e.has(a)) {const c = e.get(a).texture;return t(c, a.mapping);} else {const c = a.image;if (c && c.height > 0) {- const l = new M_(c.height);+ const l = new P_(c.height);return l.fromEquirectangularTexture(i, a), e.set(a, l), a.addEventListener("dispose", s), t(l.texture, a.mapping);} elsereturn null;@@ -18821,21 +18821,21 @@ function uv(i) {dispose: r};}-const na = 4, Wp = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], sr = 20, Dh = /* @__PURE__ */ new pf(), qp = /* @__PURE__ */ new Xe();-let Lh = null, Ph = 0, kh = 0, Uh = !1;-const tr = (1 + Math.sqrt(5)) / 2, Wr = 1 / tr, Kp = [- /* @__PURE__ */ new H(-tr, Wr, 0),- /* @__PURE__ */ new H(tr, Wr, 0),- /* @__PURE__ */ new H(-Wr, 0, tr),- /* @__PURE__ */ new H(Wr, 0, tr),- /* @__PURE__ */ new H(0, tr, -Wr),- /* @__PURE__ */ new H(0, tr, Wr),+const sa = 4, Jp = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], ar = 20, Qh = /* @__PURE__ */ new Ef(), Zp = /* @__PURE__ */ new je();+let Gh = null, Hh = 0, zh = 0, Vh = !1;+const ir = (1 + Math.sqrt(5)) / 2, Kr = 1 / ir, $p = [+ /* @__PURE__ */ new H(-ir, Kr, 0),+ /* @__PURE__ */ new H(ir, Kr, 0),+ /* @__PURE__ */ new H(-Kr, 0, ir),+ /* @__PURE__ */ new H(Kr, 0, ir),+ /* @__PURE__ */ new H(0, ir, -Kr),+ /* @__PURE__ */ new H(0, ir, Kr),/* @__PURE__ */ new H(-1, 1, -1),/* @__PURE__ */ new H(1, 1, -1),/* @__PURE__ */ new H(-1, 1, 1),/* @__PURE__ */ new H(1, 1, 1)-], dv = /* @__PURE__ */ new H();-class ld {+], EC = /* @__PURE__ */ new H();+class Ad {/*** Constructs a new PMREM generator.*@@ -18862,9 +18862,9 @@ class ld {fromScene(e, t = 0, n = 0.1, s = 100, r = {}) {const {size: a = 256,- position: o = dv+ position: o = EC} = r;- Lh = this._renderer.getRenderTarget(), Ph = this._renderer.getActiveCubeFace(), kh = this._renderer.getActiveMipmapLevel(), Uh = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);+ Gh = this._renderer.getRenderTarget(), Hh = this._renderer.getActiveCubeFace(), zh = this._renderer.getActiveMipmapLevel(), Vh = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);const c = this._allocateTargets();return c.depthBuffer = !0, this._sceneToCubeUV(e, n, s, c, o), t > 0 && this._blur(c, 0, 0, t), this._applyPMREM(c), this._cleanup(c), c;}@@ -18897,14 +18897,14 @@ class ld {* your texture's network fetch for increased concurrency.*/compileCubemapShader() {- this._cubemapMaterial === null && (this._cubemapMaterial = jp(), this._compileMaterial(this._cubemapMaterial));+ this._cubemapMaterial === null && (this._cubemapMaterial = nA(), 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 = Yp(), this._compileMaterial(this._equirectMaterial));+ this._equirectMaterial === null && (this._equirectMaterial = tA(), this._compileMaterial(this._equirectMaterial));}/*** Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,@@ -18924,10 +18924,10 @@ class ld {this._lodPlanes[e].dispose();}_cleanup(e) {- this._renderer.setRenderTarget(Lh, Ph, kh), this._renderer.xr.enabled = Uh, e.scissorTest = !1, Rc(e, 0, 0, e.width, e.height);+ this._renderer.setRenderTarget(Gh, Hh, zh), this._renderer.xr.enabled = Vh, e.scissorTest = !1, Pc(e, 0, 0, e.width, e.height);}_fromTexture(e, t) {- e.mapping === gr || e.mapping === ba ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), Lh = this._renderer.getRenderTarget(), Ph = this._renderer.getActiveCubeFace(), kh = this._renderer.getActiveMipmapLevel(), Uh = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;+ e.mapping === br || e.mapping === ya ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), Gh = this._renderer.getRenderTarget(), Hh = this._renderer.getActiveCubeFace(), zh = this._renderer.getActiveMipmapLevel(), Vh = 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;}@@ -18940,52 +18940,52 @@ class ld {format: on,colorSpace: ln,depthBuffer: !1- }, s = Xp(e, t, n);+ }, s = eA(e, t, n);if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {- this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = Xp(e, t, n);+ this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = eA(e, t, n);const { _lodMax: r } = this;- ({ sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = fv(r)), this._blurMaterial = pv(r, e, t);+ ({ sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _C(r)), this._blurMaterial = yC(r, e, t);}return s;}_compileMaterial(e) {const t = new Jt(this._lodPlanes[0], e);- this._renderer.compile(t, Dh);+ this._renderer.compile(t, Qh);}_sceneToCubeUV(e, t, n, s, r) {- const c = new Cn(90, 1, t, n), l = [1, -1, 1, 1, 1, 1], h = [1, 1, 1, -1, -1, -1], u = this._renderer, d = u.autoClear, f = u.toneMapping;- u.getClearColor(qp), u.toneMapping = Ds, u.autoClear = !1;- const m = new Rs({+ const c = new vn(90, 1, t, n), l = [1, -1, 1, 1, 1, 1], h = [1, 1, 1, -1, -1, -1], u = this._renderer, d = u.autoClear, f = u.toneMapping;+ u.getClearColor(Zp), u.toneMapping = Ls, u.autoClear = !1;+ const m = new Ns({name: "PMREM.Background",side: Ln,depthWrite: !1,depthTest: !1- }), g = new Jt(new Na(), m);+ }), g = new Jt(new Pa(), m);let A = !1;const p = e.background;- p ? p.isColor && (m.color.copy(p), e.background = null, A = !0) : (m.color.copy(qp), A = !0);+ p ? p.isColor && (m.color.copy(p), e.background = null, A = !0) : (m.color.copy(Zp), A = !0);for (let y = 0; y < 6; y++) {const b = y % 3;b === 0 ? (c.up.set(0, l[y], 0), c.position.set(r.x, r.y, r.z), c.lookAt(r.x + h[y], r.y, r.z)) : b === 1 ? (c.up.set(0, 0, l[y]), c.position.set(r.x, r.y, r.z), c.lookAt(r.x, r.y + h[y], r.z)) : (c.up.set(0, l[y], 0), c.position.set(r.x, r.y, r.z), c.lookAt(r.x, r.y, r.z + h[y]));const _ = this._cubeSize;- Rc(s, b * _, y > 2 ? _ : 0, _, _), u.setRenderTarget(s), A && u.render(g, c), u.render(e, c);+ Pc(s, b * _, y > 2 ? _ : 0, _, _), u.setRenderTarget(s), A && u.render(g, c), u.render(e, c);}g.geometry.dispose(), g.material.dispose(), u.toneMapping = f, u.autoClear = d, e.background = p;}_textureToCubeUV(e, t) {- const n = this._renderer, s = e.mapping === gr || e.mapping === ba;- s ? (this._cubemapMaterial === null && (this._cubemapMaterial = jp()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = Yp());+ const n = this._renderer, s = e.mapping === br || e.mapping === ya;+ s ? (this._cubemapMaterial === null && (this._cubemapMaterial = nA()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = tA());const r = s ? this._cubemapMaterial : this._equirectMaterial, a = new Jt(this._lodPlanes[0], r), o = r.uniforms;o.envMap.value = e;const c = this._cubeSize;- Rc(t, 0, 0, 3 * c, 2 * c), n.setRenderTarget(t), n.render(a, Dh);+ Pc(t, 0, 0, 3 * c, 2 * c), n.setRenderTarget(t), n.render(a, Qh);}_applyPMREM(e) {const t = this._renderer, n = t.autoClear;t.autoClear = !1;const s = this._lodPlanes.length;for (let r = 1; r < s; r++) {- const a = Math.sqrt(this._sigmas[r] * this._sigmas[r] - this._sigmas[r - 1] * this._sigmas[r - 1]), o = Kp[(s - r - 1) % Kp.length];+ const a = Math.sqrt(this._sigmas[r] * this._sigmas[r] - this._sigmas[r - 1] * this._sigmas[r - 1]), o = $p[(s - r - 1) % $p.length];this._blur(e, r - 1, r, a, o);}t.autoClear = n;@@ -19029,35 +19029,35 @@ class ld {a !== "latitudinal" && a !== "longitudinal" && console.error("blur direction must be either latitudinal or longitudinal!");- const h = 3, u = new Jt(this._lodPlanes[s], l), d = l.uniforms, f = this._sizeLods[n] - 1, m = isFinite(r) ? Math.PI / (2 * f) : 2 * Math.PI / (2 * sr - 1), g = r / m, A = isFinite(r) ? 1 + Math.floor(h * g) : sr;- A > sr && console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${sr}`);+ const h = 3, u = new Jt(this._lodPlanes[s], l), d = l.uniforms, f = this._sizeLods[n] - 1, m = isFinite(r) ? Math.PI / (2 * f) : 2 * Math.PI / (2 * ar - 1), g = r / m, A = isFinite(r) ? 1 + Math.floor(h * g) : ar;+ A > ar && console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${ar}`);const p = [];let y = 0;- for (let S = 0; S < sr; ++S) {- const T = S / g, v = Math.exp(-T * T / 2);- p.push(v), S === 0 ? y += v : S < A && (y += 2 * v);+ for (let S = 0; S < ar; ++S) {+ const T = S / g, C = Math.exp(-T * T / 2);+ p.push(C), S === 0 ? y += C : S < A && (y += 2 * C);}for (let S = 0; S < p.length; S++)p[S] = p[S] / y;d.envMap.value = e.texture, d.samples.value = A, d.weights.value = p, d.latitudinal.value = a === "latitudinal", o && (d.poleAxis.value = o);const { _lodMax: b } = this;d.dTheta.value = m, d.mipInt.value = b - n;- const _ = this._sizeLods[s], M = 3 * _ * (s > b - na ? s - b + na : 0), w = 4 * (this._cubeSize - _);- Rc(t, M, w, 3 * _, 2 * _), c.setRenderTarget(t), c.render(u, Dh);+ const _ = this._sizeLods[s], M = 3 * _ * (s > b - sa ? s - b + sa : 0), w = 4 * (this._cubeSize - _);+ Pc(t, M, w, 3 * _, 2 * _), c.setRenderTarget(t), c.render(u, Qh);}}-function fv(i) {+function _C(i) {const e = [], t = [], n = [];let s = i;- const r = i - na + 1 + Wp.length;+ const r = i - sa + 1 + Jp.length;for (let a = 0; a < r; a++) {const o = Math.pow(2, s);t.push(o);let c = 1 / o;- a > i - na ? c = Wp[a - i + na - 1] : a === 0 && (c = 0), n.push(c);+ a > i - sa ? c = Jp[a - i + sa - 1] : a === 0 && (c = 0), n.push(c);const l = 1 / (o - 2), h = -l, u = 1 + l, d = [h, h, u, h, u, u, h, h, u, u, h, u], f = 6, m = 6, g = 3, A = 2, p = 1, y = new Float32Array(g * m * f), b = new Float32Array(A * m * f), _ = new Float32Array(p * m * f);for (let w = 0; w < f; w++) {- const S = w % 3 * 2 / 3 - 1, T = w > 2 ? 0 : -1, v = [+ const S = w % 3 * 2 / 3 - 1, T = w > 2 ? 0 : -1, C = [S,T,0,@@ -19077,28 +19077,28 @@ function fv(i) {T + 1,0];- y.set(v, g * m * w), b.set(d, A * m * w);- const C = [w, w, w, w, w, w];- _.set(C, p * m * w);+ y.set(C, g * m * w), b.set(d, A * m * w);+ const v = [w, w, w, w, w, w];+ _.set(v, p * m * w);}const M = new Hn();- M.setAttribute("position", new _n(y, g)), M.setAttribute("uv", new _n(b, A)), M.setAttribute("faceIndex", new _n(_, p)), e.push(M), s > na && s--;+ M.setAttribute("position", new _n(y, g)), M.setAttribute("uv", new _n(b, A)), M.setAttribute("faceIndex", new _n(_, p)), e.push(M), s > sa && s--;}return { lodPlanes: e, sizeLods: t, sigmas: n };}-function Xp(i, e, t) {- const n = new br(i, e, t);- return n.texture.mapping = Pl, n.texture.name = "PMREM.cubeUv", n.scissorTest = !0, n;+function eA(i, e, t) {+ const n = new Er(i, e, t);+ return n.texture.mapping = Gl, n.texture.name = "PMREM.cubeUv", n.scissorTest = !0, n;}-function Rc(i, e, t, n, s) {+function Pc(i, e, t, n, s) {i.viewport.set(e, t, n, s), i.scissor.set(e, t, n, s);}-function pv(i, e, t) {- const n = new Float32Array(sr), s = new H(0, 1, 0);- return new ks({+function yC(i, e, t) {+ const n = new Float32Array(ar), s = new H(0, 1, 0);+ return new Os({name: "SphericalGaussianBlur",defines: {- n: sr,+ n: ar,CUBEUV_TEXEL_WIDTH: 1 / e,CUBEUV_TEXEL_HEIGHT: 1 / t,CUBEUV_MAX_MIP: `${i}.0`@@ -19112,7 +19112,7 @@ function pv(i, e, t) {mipInt: { value: 0 },poleAxis: { value: s }},- vertexShader: mf(),+ vertexShader: wf(),fragmentShader: (/* glsl */`@@ -19177,18 +19177,18 @@ function pv(i, e, t) {}`),- blending: Fs,+ blending: Ds,depthTest: !1,depthWrite: !1});}-function Yp() {- return new ks({+function tA() {+ return new Os({name: "EquirectangularToCubeUV",uniforms: {envMap: { value: null }},- vertexShader: mf(),+ vertexShader: wf(),fragmentShader: (/* glsl */`@@ -19212,19 +19212,19 @@ function Yp() {}`),- blending: Fs,+ blending: Ds,depthTest: !1,depthWrite: !1});}-function jp() {- return new ks({+function nA() {+ return new Os({name: "CubemapToCubeUV",uniforms: {envMap: { value: null },flipEnvMap: { value: -1 }},- vertexShader: mf(),+ vertexShader: wf(),fragmentShader: (/* glsl */`@@ -19245,12 +19245,12 @@ function jp() {}`),- blending: Fs,+ blending: Ds,depthTest: !1,depthWrite: !1});}-function mf() {+function wf() {return (/* glsl */`@@ -19311,21 +19311,21 @@ function mf() {`);}-function Av(i) {+function wC(i) {let e = /* @__PURE__ */ new WeakMap(), t = null;function n(o) {if (o && o.isTexture) {- const c = o.mapping, l = c === ku || c === Uu, h = c === gr || c === ba;+ const c = o.mapping, l = c === zu || c === Vu, h = c === br || c === ya;if (l || h) {let u = e.get(o);const d = u !== void 0 ? u.texture.pmremVersion : 0;if (o.isRenderTargetTexture && o.pmremVersion !== d)- return t === null && (t = new ld(i)), u = l ? t.fromEquirectangular(o, u) : t.fromCubemap(o, u), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), u.texture;+ return t === null && (t = new Ad(i)), u = l ? t.fromEquirectangular(o, u) : t.fromCubemap(o, u), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), u.texture;if (u !== void 0)return u.texture;{const f = o.image;- return l && f && f.height > 0 || h && f && s(f) ? (t === null && (t = new ld(i)), u = l ? t.fromEquirectangular(o) : t.fromCubemap(o), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), o.addEventListener("dispose", r), u.texture) : null;+ return l && f && f.height > 0 || h && f && s(f) ? (t === null && (t = new Ad(i)), u = l ? t.fromEquirectangular(o) : t.fromCubemap(o), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), o.addEventListener("dispose", r), u.texture) : null;}}}@@ -19352,7 +19352,7 @@ function Av(i) {dispose: a};}-function gv(i) {+function vC(i) {const e = {};function t(n) {if (e[n] !== void 0)@@ -19385,11 +19385,11 @@ function gv(i) {},get: function(n) {const s = t(n);- return s === null && il("THREE.WebGLRenderer: " + n + " extension not supported."), s;+ return s === null && cl("THREE.WebGLRenderer: " + n + " extension not supported."), s;}};}-function mv(i, e, t, n) {+function CC(i, e, t, n) {const s = {}, r = /* @__PURE__ */ new WeakMap();function a(u) {const d = u.target;@@ -19427,7 +19427,7 @@ function mv(i, e, t, n) {}} elsereturn;- const A = new (Um(d) ? Vm : zm)(d, 1);+ const A = new (Wm(d) ? Jm : Ym)(d, 1);A.version = g;const p = r.get(u);p && e.remove(p), r.set(u, A);@@ -19447,7 +19447,7 @@ function mv(i, e, t, n) {getWireframeAttribute: h};}-function bv(i, e, t) {+function SC(i, e, t) {let n;function s(d) {n = d;@@ -19486,7 +19486,7 @@ function bv(i, e, t) {}this.setMode = s, this.setIndex = o, this.render = c, this.renderInstances = l, this.renderMultiDraw = h, this.renderMultiDrawInstances = u;}-function xv(i) {+function IC(i) {const e = {geometries: 0,textures: 0@@ -19531,14 +19531,14 @@ function xv(i) {update: n};}-function Ev(i, e, t) {+function MC(i, e, t) {const n = /* @__PURE__ */ new WeakMap(), s = new wt();function r(a, o, c) {const l = a.morphTargetInfluences, h = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, u = h !== void 0 ? h.length : 0;let d = n.get(o);if (d === void 0 || d.count !== u) {- let v = function() {- S.dispose(), n.delete(o), o.removeEventListener("dispose", v);+ let C = function() {+ S.dispose(), n.delete(o), o.removeEventListener("dispose", C);};d !== void 0 && d.texture.dispose();const f = o.morphAttributes.position !== void 0, m = o.morphAttributes.normal !== void 0, g = o.morphAttributes.color !== void 0, A = o.morphAttributes.position || [], p = o.morphAttributes.normal || [], y = o.morphAttributes.color || [];@@ -19546,11 +19546,11 @@ function Ev(i, e, t) {f === !0 && (b = 1), m === !0 && (b = 2), g === !0 && (b = 3);let _ = o.attributes.position.count * b, M = 1;_ > e.maxTextureSize && (M = Math.ceil(_ / e.maxTextureSize), _ = e.maxTextureSize);- const w = new Float32Array(_ * M * 4 * u), S = new Om(w, _, M, u);+ const w = new Float32Array(_ * M * 4 * u), S = new qm(w, _, M, u);S.type = an, S.needsUpdate = !0;const T = b * 4;- for (let C = 0; C < u; C++) {- const F = A[C], K = p[C], q = y[C], $ = _ * M * 4 * C;+ for (let v = 0; v < u; v++) {+ const F = A[v], K = p[v], q = y[v], $ = _ * M * 4 * v;for (let D = 0; D < F.count; D++) {const O = D * T;f === !0 && (s.fromBufferAttribute(F, D), w[$ + O + 0] = s.x, w[$ + O + 1] = s.y, w[$ + O + 2] = s.z, w[$ + O + 3] = 0), m === !0 && (s.fromBufferAttribute(K, D), w[$ + O + 4] = s.x, w[$ + O + 5] = s.y, w[$ + O + 6] = s.z, w[$ + O + 7] = 0), g === !0 && (s.fromBufferAttribute(q, D), w[$ + O + 8] = s.x, w[$ + O + 9] = s.y, w[$ + O + 10] = s.z, w[$ + O + 11] = q.itemSize === 4 ? s.w : 1);@@ -19560,7 +19560,7 @@ function Ev(i, e, t) {count: u,texture: S,size: new Ze(_, M)- }, n.set(o, d), o.addEventListener("dispose", v);+ }, n.set(o, d), o.addEventListener("dispose", C);}if (a.isInstancedMesh === !0 && a.morphTexture !== null)c.getUniforms().setValue(i, "morphTexture", a.morphTexture, t);@@ -19577,7 +19577,7 @@ function Ev(i, e, t) {update: r};}-function _v(i, e, t, n) {+function BC(i, e, t, n) {let s = /* @__PURE__ */ new WeakMap();function r(c) {const l = n.render.frame, h = c.geometry, u = e.get(c, h);@@ -19599,13 +19599,13 @@ function _v(i, e, t, n) {dispose: a};}-const a0 = /* @__PURE__ */ new cn(), Jp = /* @__PURE__ */ new jm(1, 1), o0 = /* @__PURE__ */ new Om(), c0 = /* @__PURE__ */ new Qm(), l0 = /* @__PURE__ */ new Km(), Zp = [], $p = [], eA = new Float32Array(16), tA = new Float32Array(9), nA = new Float32Array(4);-function La(i, e, t) {+const f0 = /* @__PURE__ */ new cn(), iA = /* @__PURE__ */ new i0(1, 1), p0 = /* @__PURE__ */ new qm(), A0 = /* @__PURE__ */ new Km(), g0 = /* @__PURE__ */ new e0(), sA = [], rA = [], aA = new Float32Array(16), oA = new Float32Array(9), cA = new Float32Array(4);+function Oa(i, e, t) {const n = i[0];if (n <= 0 || n > 0) return i;const s = e * t;- let r = Zp[s];- if (r === void 0 && (r = new Float32Array(s), Zp[s] = r), e !== 0) {+ let r = sA[s];+ if (r === void 0 && (r = new Float32Array(s), sA[s] = r), e !== 0) {n.toArray(r, 0);for (let a = 1, o = 0; a !== e; ++a)o += t, i[a].toArray(r, o);@@ -19622,18 +19622,18 @@ function un(i, e) {for (let t = 0, n = e.length; t < n; t++)i[t] = e[t];}-function Gl(i, e) {- let t = $p[e];- t === void 0 && (t = new Int32Array(e), $p[e] = t);+function ql(i, e) {+ let t = rA[e];+ t === void 0 && (t = new Int32Array(e), rA[e] = t);for (let n = 0; n !== e; ++n)t[n] = i.allocateTextureUnit();return t;}-function yv(i, e) {+function TC(i, e) {const t = this.cache;t[0] !== e && (i.uniform1f(this.addr, e), t[0] = e);}-function wv(i, e) {+function RC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y) && (i.uniform2f(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);@@ -19642,7 +19642,7 @@ function wv(i, e) {i.uniform2fv(this.addr, e), un(t, e);}}-function Cv(i, e) {+function NC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (i.uniform3f(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);@@ -19653,7 +19653,7 @@ function Cv(i, e) {i.uniform3fv(this.addr, e), un(t, e);}}-function vv(i, e) {+function FC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (i.uniform4f(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);@@ -19662,41 +19662,41 @@ function vv(i, e) {i.uniform4fv(this.addr, e), un(t, e);}}-function Sv(i, e) {+function DC(i, e) {const t = this.cache, n = e.elements;if (n === void 0) {if (hn(t, e)) return;i.uniformMatrix2fv(this.addr, !1, e), un(t, e);} else {if (hn(t, n)) return;- nA.set(n), i.uniformMatrix2fv(this.addr, !1, nA), un(t, n);+ cA.set(n), i.uniformMatrix2fv(this.addr, !1, cA), un(t, n);}}-function Iv(i, e) {+function LC(i, e) {const t = this.cache, n = e.elements;if (n === void 0) {if (hn(t, e)) return;i.uniformMatrix3fv(this.addr, !1, e), un(t, e);} else {if (hn(t, n)) return;- tA.set(n), i.uniformMatrix3fv(this.addr, !1, tA), un(t, n);+ oA.set(n), i.uniformMatrix3fv(this.addr, !1, oA), un(t, n);}}-function Mv(i, e) {+function PC(i, e) {const t = this.cache, n = e.elements;if (n === void 0) {if (hn(t, e)) return;i.uniformMatrix4fv(this.addr, !1, e), un(t, e);} else {if (hn(t, n)) return;- eA.set(n), i.uniformMatrix4fv(this.addr, !1, eA), un(t, n);+ aA.set(n), i.uniformMatrix4fv(this.addr, !1, aA), un(t, n);}}-function Bv(i, e) {+function kC(i, e) {const t = this.cache;t[0] !== e && (i.uniform1i(this.addr, e), t[0] = e);}-function Tv(i, e) {+function UC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y) && (i.uniform2i(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);@@ -19705,7 +19705,7 @@ function Tv(i, e) {i.uniform2iv(this.addr, e), un(t, e);}}-function Rv(i, e) {+function OC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (i.uniform3i(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);@@ -19714,7 +19714,7 @@ function Rv(i, e) {i.uniform3iv(this.addr, e), un(t, e);}}-function Nv(i, e) {+function QC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (i.uniform4i(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);@@ -19723,11 +19723,11 @@ function Nv(i, e) {i.uniform4iv(this.addr, e), un(t, e);}}-function Fv(i, e) {+function GC(i, e) {const t = this.cache;t[0] !== e && (i.uniform1ui(this.addr, e), t[0] = e);}-function Dv(i, e) {+function HC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y) && (i.uniform2ui(this.addr, e.x, e.y), t[0] = e.x, t[1] = e.y);@@ -19736,7 +19736,7 @@ function Dv(i, e) {i.uniform2uiv(this.addr, e), un(t, e);}}-function Lv(i, e) {+function zC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y || t[2] !== e.z) && (i.uniform3ui(this.addr, e.x, e.y, e.z), t[0] = e.x, t[1] = e.y, t[2] = e.z);@@ -19745,7 +19745,7 @@ function Lv(i, e) {i.uniform3uiv(this.addr, e), un(t, e);}}-function Pv(i, e) {+function VC(i, e) {const t = this.cache;if (e.x !== void 0)(t[0] !== e.x || t[1] !== e.y || t[2] !== e.z || t[3] !== e.w) && (i.uniform4ui(this.addr, e.x, e.y, e.z, e.w), t[0] = e.x, t[1] = e.y, t[2] = e.z, t[3] = e.w);@@ -19754,74 +19754,74 @@ function Pv(i, e) {i.uniform4uiv(this.addr, e), un(t, e);}}-function kv(i, e, t) {+function WC(i, e, t) {const n = this.cache, s = t.allocateTextureUnit();n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s);let r;- this.type === i.SAMPLER_2D_SHADOW ? (Jp.compareFunction = Pm, r = Jp) : r = a0, t.setTexture2D(e || r, s);+ this.type === i.SAMPLER_2D_SHADOW ? (iA.compareFunction = zm, r = iA) : r = f0, t.setTexture2D(e || r, s);}-function Uv(i, e, t) {+function qC(i, e, t) {const n = this.cache, s = t.allocateTextureUnit();- n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s), t.setTexture3D(e || c0, s);+ n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s), t.setTexture3D(e || A0, s);}-function Ov(i, e, t) {+function KC(i, e, t) {const n = this.cache, s = t.allocateTextureUnit();- n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s), t.setTextureCube(e || l0, s);+ n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s), t.setTextureCube(e || g0, s);}-function Qv(i, e, t) {+function jC(i, e, t) {const n = this.cache, s = t.allocateTextureUnit();- n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s), t.setTexture2DArray(e || o0, s);+ n[0] !== s && (i.uniform1i(this.addr, s), n[0] = s), t.setTexture2DArray(e || p0, s);}-function Gv(i) {+function XC(i) {switch (i) {case 5126:- return yv;+ return TC;// FLOATcase 35664:- return wv;+ return RC;// _VEC2case 35665:- return Cv;+ return NC;// _VEC3case 35666:- return vv;+ return FC;// _VEC4case 35674:- return Sv;+ return DC;// _MAT2case 35675:- return Iv;+ return LC;// _MAT3case 35676:- return Mv;+ return PC;// _MAT4case 5124:case 35670:- return Bv;+ return kC;// INT, BOOLcase 35667:case 35671:- return Tv;+ return UC;// _VEC2case 35668:case 35672:- return Rv;+ return OC;// _VEC3case 35669:case 35673:- return Nv;+ return QC;// _VEC4case 5125:- return Fv;+ return GC;// UINTcase 36294:- return Dv;+ return HC;// _VEC2case 36295:- return Lv;+ return zC;// _VEC3case 36296:- return Pv;+ return VC;// _VEC4case 35678:// SAMPLER_2D@@ -19832,13 +19832,13 @@ function Gv(i) {case 36306:// UNSIGNED_INT_SAMPLER_2Dcase 35682:- return kv;+ return WC;case 35679:// SAMPLER_3Dcase 36299:// INT_SAMPLER_3Dcase 36307:- return Uv;+ return qC;case 35680:// SAMPLER_CUBEcase 36300:@@ -19846,7 +19846,7 @@ function Gv(i) {case 36308:// UNSIGNED_INT_SAMPLER_CUBEcase 36293:- return Ov;+ return KC;case 36289:// SAMPLER_2D_ARRAYcase 36303:@@ -19854,134 +19854,134 @@ function Gv(i) {case 36311:// UNSIGNED_INT_SAMPLER_2D_ARRAYcase 36292:- return Qv;+ return jC;}}-function Hv(i, e) {+function YC(i, e) {i.uniform1fv(this.addr, e);}-function zv(i, e) {- const t = La(e, this.size, 2);+function JC(i, e) {+ const t = Oa(e, this.size, 2);i.uniform2fv(this.addr, t);}-function Vv(i, e) {- const t = La(e, this.size, 3);+function ZC(i, e) {+ const t = Oa(e, this.size, 3);i.uniform3fv(this.addr, t);}-function Wv(i, e) {- const t = La(e, this.size, 4);+function $C(i, e) {+ const t = Oa(e, this.size, 4);i.uniform4fv(this.addr, t);}-function qv(i, e) {- const t = La(e, this.size, 4);+function eS(i, e) {+ const t = Oa(e, this.size, 4);i.uniformMatrix2fv(this.addr, !1, t);}-function Kv(i, e) {- const t = La(e, this.size, 9);+function tS(i, e) {+ const t = Oa(e, this.size, 9);i.uniformMatrix3fv(this.addr, !1, t);}-function Xv(i, e) {- const t = La(e, this.size, 16);+function nS(i, e) {+ const t = Oa(e, this.size, 16);i.uniformMatrix4fv(this.addr, !1, t);}-function Yv(i, e) {+function iS(i, e) {i.uniform1iv(this.addr, e);}-function jv(i, e) {+function sS(i, e) {i.uniform2iv(this.addr, e);}-function Jv(i, e) {+function rS(i, e) {i.uniform3iv(this.addr, e);}-function Zv(i, e) {+function aS(i, e) {i.uniform4iv(this.addr, e);}-function $v(i, e) {+function oS(i, e) {i.uniform1uiv(this.addr, e);}-function eS(i, e) {+function cS(i, e) {i.uniform2uiv(this.addr, e);}-function tS(i, e) {+function lS(i, e) {i.uniform3uiv(this.addr, e);}-function nS(i, e) {+function hS(i, e) {i.uniform4uiv(this.addr, e);}-function iS(i, e, t) {- const n = this.cache, s = e.length, r = Gl(t, s);+function uS(i, e, t) {+ const n = this.cache, s = e.length, r = ql(t, s);hn(n, r) || (i.uniform1iv(this.addr, r), un(n, r));for (let a = 0; a !== s; ++a)- t.setTexture2D(e[a] || a0, r[a]);+ t.setTexture2D(e[a] || f0, r[a]);}-function sS(i, e, t) {- const n = this.cache, s = e.length, r = Gl(t, s);+function dS(i, e, t) {+ const n = this.cache, s = e.length, r = ql(t, s);hn(n, r) || (i.uniform1iv(this.addr, r), un(n, r));for (let a = 0; a !== s; ++a)- t.setTexture3D(e[a] || c0, r[a]);+ t.setTexture3D(e[a] || A0, r[a]);}-function rS(i, e, t) {- const n = this.cache, s = e.length, r = Gl(t, s);+function fS(i, e, t) {+ const n = this.cache, s = e.length, r = ql(t, s);hn(n, r) || (i.uniform1iv(this.addr, r), un(n, r));for (let a = 0; a !== s; ++a)- t.setTextureCube(e[a] || l0, r[a]);+ t.setTextureCube(e[a] || g0, r[a]);}-function aS(i, e, t) {- const n = this.cache, s = e.length, r = Gl(t, s);+function pS(i, e, t) {+ const n = this.cache, s = e.length, r = ql(t, s);hn(n, r) || (i.uniform1iv(this.addr, r), un(n, r));for (let a = 0; a !== s; ++a)- t.setTexture2DArray(e[a] || o0, r[a]);+ t.setTexture2DArray(e[a] || p0, r[a]);}-function oS(i) {+function AS(i) {switch (i) {case 5126:- return Hv;+ return YC;// FLOATcase 35664:- return zv;+ return JC;// _VEC2case 35665:- return Vv;+ return ZC;// _VEC3case 35666:- return Wv;+ return $C;// _VEC4case 35674:- return qv;+ return eS;// _MAT2case 35675:- return Kv;+ return tS;// _MAT3case 35676:- return Xv;+ return nS;// _MAT4case 5124:case 35670:- return Yv;+ return iS;// INT, BOOLcase 35667:case 35671:- return jv;+ return sS;// _VEC2case 35668:case 35672:- return Jv;+ return rS;// _VEC3case 35669:case 35673:- return Zv;+ return aS;// _VEC4case 5125:- return $v;+ return oS;// UINTcase 36294:- return eS;+ return cS;// _VEC2case 36295:- return tS;+ return lS;// _VEC3case 36296:- return nS;+ return hS;// _VEC4case 35678:// SAMPLER_2D@@ -19992,13 +19992,13 @@ function oS(i) {case 36306:// UNSIGNED_INT_SAMPLER_2Dcase 35682:- return iS;+ return uS;case 35679:// SAMPLER_3Dcase 36299:// INT_SAMPLER_3Dcase 36307:- return sS;+ return dS;case 35680:// SAMPLER_CUBEcase 36300:@@ -20006,7 +20006,7 @@ function oS(i) {case 36308:// UNSIGNED_INT_SAMPLER_CUBEcase 36293:- return rS;+ return fS;case 36289:// SAMPLER_2D_ARRAYcase 36303:@@ -20014,20 +20014,20 @@ function oS(i) {case 36311:// UNSIGNED_INT_SAMPLER_2D_ARRAYcase 36292:- return aS;+ return pS;}}-class cS {+class gS {constructor(e, t, n) {- this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = Gv(t.type);+ this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = XC(t.type);}}-class lS {+class mS {constructor(e, t, n) {- this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = oS(t.type);+ this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = AS(t.type);}}-class hS {+class bS {constructor(e) {this.id = e, this.seq = [], this.map = {};}@@ -20039,32 +20039,32 @@ class hS {}}}-const Oh = /(\w+)(\])?(\[|\.)?/g;-function iA(i, e) {+const Wh = /(\w+)(\])?(\[|\.)?/g;+function lA(i, e) {i.seq.push(e), i.map[e.id] = e;}-function uS(i, e, t) {+function xS(i, e, t) {const n = i.name, s = n.length;- for (Oh.lastIndex = 0; ; ) {- const r = Oh.exec(n), a = Oh.lastIndex;+ for (Wh.lastIndex = 0; ; ) {+ const r = Wh.exec(n), a = Wh.lastIndex;let o = r[1];const c = r[2] === "]", l = r[3];if (c && (o = o | 0), l === void 0 || l === "[" && a + 2 === s) {- iA(t, l === void 0 ? new cS(o, i, e) : new lS(o, i, e));+ lA(t, l === void 0 ? new gS(o, i, e) : new mS(o, i, e));break;} else {let u = t.map[o];- u === void 0 && (u = new hS(o), iA(t, u)), t = u;+ u === void 0 && (u = new bS(o), lA(t, u)), t = u;}}}-class sl {+class ll {constructor(e, t) {this.seq = [], this.map = {};const n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);for (let s = 0; s < n; ++s) {const r = e.getActiveUniform(t, s), a = e.getUniformLocation(t, r.name);- uS(r, a, this);+ xS(r, a, this);}}setValue(e, t, n, s) {@@ -20090,13 +20090,13 @@ class sl {return n;}}-function sA(i, e, t) {+function hA(i, e, t) {const n = i.createShader(e);return i.shaderSource(n, t), i.compileShader(n), n;}-const dS = 37297;-let fS = 0;-function pS(i, e) {+const ES = 37297;+let _S = 0;+function yS(i, e) {const t = i.split(``), n = [], s = Math.max(e - 6, 0), r = Math.min(e + 6, t.length);for (let a = s; a < r; a++) {@@ -20106,12 +20106,12 @@ function pS(i, e) {return n.join(``);}-const rA = /* @__PURE__ */ new rt();-function AS(i) {- mt._getMatrix(rA, mt.workingColorSpace, i);- const e = `mat3( ${rA.elements.map((t) => t.toFixed(4))} )`;+const uA = /* @__PURE__ */ new rt();+function wS(i) {+ mt._getMatrix(uA, mt.workingColorSpace, i);+ const e = `mat3( ${uA.elements.map((t) => t.toFixed(4))} )`;switch (mt.getTransfer(i)) {- case bl:+ case wl:return [e, "LinearTransferOETF"];case Mt:return [e, "sRGBTransferOETF"];@@ -20119,7 +20119,7 @@ function AS(i) {return console.warn("THREE.WebGLProgram: Unsupported color space: ", i), [e, "LinearTransferOETF"];}}-function aA(i, e, t) {+function dA(i, e, t) {const n = i.getShaderParameter(e, i.COMPILE_STATUS), s = i.getShaderInfoLog(e).trim();if (n && s === "") return "";const r = /ERROR: 0:(\d+)/.exec(s);@@ -20129,12 +20129,12 @@ function aA(i, e, t) {` + s + `-` + pS(i.getShaderSource(e), a);+` + yS(i.getShaderSource(e), a);} elsereturn s;}-function gS(i, e) {- const t = AS(e);+function vS(i, e) {+ const t = wS(e);return [`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,@@ -20142,28 +20142,28 @@ function gS(i, e) {].join(``);}-function mS(i, e) {+function CS(i, e) {let t;switch (e) {- case Pu:+ case Hu:t = "Linear";break;- case xE:+ case IE:t = "Reinhard";break;- case EE:+ case ME:t = "Cineon";break;- case wm:+ case Tm:t = "ACESFilmic";break;- case yE:+ case TE:t = "AgX";break;- case wE:+ case RE:t = "Neutral";break;- case _E:+ case BE:t = "Custom";break;default:@@ -20171,10 +20171,10 @@ function mS(i, e) {}return "vec3 " + i + "( vec3 color ) { return " + t + "ToneMapping( color ); }";}-const Nc = /* @__PURE__ */ new H();-function bS() {- mt.getLuminanceCoefficients(Nc);- const i = Nc.x.toFixed(4), e = Nc.y.toFixed(4), t = Nc.z.toFixed(4);+const kc = /* @__PURE__ */ new H();+function SS() {+ mt.getLuminanceCoefficients(kc);+ const i = kc.x.toFixed(4), e = kc.y.toFixed(4), t = kc.z.toFixed(4);return ["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`,@@ -20183,14 +20183,14 @@ function bS() {].join(``);}-function xS(i) {+function IS(i) {return [i.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "",i.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""- ].filter(ao).join(`+ ].filter(ho).join(``);}-function ES(i) {+function MS(i) {const e = [];for (const t in i) {const n = i[t];@@ -20199,7 +20199,7 @@ function ES(i) {return e.join(``);}-function _S(i, e) {+function BS(i, e) {const t = {}, n = i.getProgramParameter(e, i.ACTIVE_ATTRIBUTES);for (let s = 0; s < n; s++) {const r = i.getActiveAttrib(e, s), a = r.name;@@ -20212,43 +20212,43 @@ function _S(i, e) {}return t;}-function ao(i) {+function ho(i) {return i !== "";}-function oA(i, e) {+function fA(i, e) {const t = e.numSpotLightShadows + e.numSpotLightMaps - e.numSpotLightShadowsWithMaps;return i.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 cA(i, e) {+function pA(i, e) {return i.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection);}-const yS = /^[ \t]*#include +<([\w\d./]+)>/gm;-function hd(i) {- return i.replace(yS, CS);+const TS = /^[ \t]*#include +<([\w\d./]+)>/gm;+function gd(i) {+ return i.replace(TS, NS);}-const wS = /* @__PURE__ */ new Map();-function CS(i, e) {+const RS = /* @__PURE__ */ new Map();+function NS(i, e) {let t = ot[e];if (t === void 0) {- const n = wS.get(e);+ const n = RS.get(e);if (n !== void 0)t = ot[n], console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', e, n);elsethrow new Error("Can not resolve #include <" + e + ">");}- return hd(t);+ return gd(t);}-const vS = /#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 lA(i) {- return i.replace(vS, SS);+const FS = /#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 AA(i) {+ return i.replace(FS, DS);}-function SS(i, e, t, n) {+function DS(i, e, t, n) {let s = "";for (let r = parseInt(e); r < parseInt(t); r++)s += n.replace(/\[\s*i\s*\]/g, "[ " + r + " ]").replace(/UNROLLED_LOOP_INDEX/g, r);return s;}-function hA(i) {+function gA(i) {let e = `precision ${i.precision} float;precision ${i.precision} int;precision ${i.precision} sampler2D;@@ -20272,70 +20272,70 @@ function hA(i) {#define MEDIUM_PRECISION` : i.precision === "lowp" && (e += `#define LOW_PRECISION`), e;}-function IS(i) {+function LS(i) {let e = "SHADOWMAP_TYPE_BASIC";- return i.shadowMapType === _m ? e = "SHADOWMAP_TYPE_PCF" : i.shadowMapType === Zx ? e = "SHADOWMAP_TYPE_PCF_SOFT" : i.shadowMapType === qi && (e = "SHADOWMAP_TYPE_VSM"), e;+ return i.shadowMapType === Mm ? e = "SHADOWMAP_TYPE_PCF" : i.shadowMapType === aE ? e = "SHADOWMAP_TYPE_PCF_SOFT" : i.shadowMapType === Ki && (e = "SHADOWMAP_TYPE_VSM"), e;}-function MS(i) {+function PS(i) {let e = "ENVMAP_TYPE_CUBE";if (i.envMap)switch (i.envMapMode) {- case gr:- case ba:+ case br:+ case ya:e = "ENVMAP_TYPE_CUBE";break;- case Pl:+ case Gl:e = "ENVMAP_TYPE_CUBE_UV";break;}return e;}-function BS(i) {+function kS(i) {let e = "ENVMAP_MODE_REFLECTION";- return i.envMap && i.envMapMode === ba && (e = "ENVMAP_MODE_REFRACTION"), e;+ return i.envMap && i.envMapMode === ya && (e = "ENVMAP_MODE_REFRACTION"), e;}-function TS(i) {+function US(i) {let e = "ENVMAP_BLENDING_NONE";if (i.envMap)switch (i.combine) {- case ym:+ case Bm:e = "ENVMAP_BLENDING_MULTIPLY";break;- case mE:+ case CE:e = "ENVMAP_BLENDING_MIX";break;- case bE:+ case SE:e = "ENVMAP_BLENDING_ADD";break;}return e;}-function RS(i) {+function OS(i) {const e = i.envMapCubeUVHeight;if (e === null) return null;const t = Math.log2(e) - 2, n = 1 / e;return { texelWidth: 1 / (3 * Math.max(Math.pow(2, t), 112)), texelHeight: n, maxMip: t };}-function NS(i, e, t, n) {+function QS(i, e, t, n) {const s = i.getContext(), r = t.defines;let a = t.vertexShader, o = t.fragmentShader;- const c = IS(t), l = MS(t), h = BS(t), u = TS(t), d = RS(t), f = xS(t), m = ES(r), g = s.createProgram();+ const c = LS(t), l = PS(t), h = kS(t), u = US(t), d = OS(t), f = IS(t), m = MS(r), g = s.createProgram();let A, p, y = t.glslVersion ? "#version " + t.glslVersion + `` : "";t.isRawShaderMaterial ? (A = ["#define SHADER_TYPE " + t.shaderType,"#define SHADER_NAME " + t.shaderName,m- ].filter(ao).join(`+ ].filter(ho).join(``), A.length > 0 && (A += ``), p = ["#define SHADER_TYPE " + t.shaderType,"#define SHADER_NAME " + t.shaderName,m- ].filter(ao).join(`+ ].filter(ho).join(``), p.length > 0 && (p += ``)) : (A = [- hA(t),+ gA(t),"#define SHADER_TYPE " + t.shaderType,"#define SHADER_NAME " + t.shaderName,m,@@ -20466,9 +20466,9 @@ function NS(i, e, t, n) {"#endif",``- ].filter(ao).join(`+ ].filter(ho).join(``), p = [- hA(t),+ gA(t),"#define SHADER_TYPE " + t.shaderType,"#define SHADER_NAME " + t.shaderName,m,@@ -20537,21 +20537,21 @@ function NS(i, e, t, n) {"uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",- t.toneMapping !== Ds ? "#define TONE_MAPPING" : "",- t.toneMapping !== Ds ? ot.tonemapping_pars_fragment : "",+ t.toneMapping !== Ls ? "#define TONE_MAPPING" : "",+ t.toneMapping !== Ls ? ot.tonemapping_pars_fragment : "",// this code is required here because it is used by the toneMapping() function defined below- t.toneMapping !== Ds ? mS("toneMapping", t.toneMapping) : "",+ t.toneMapping !== Ls ? CS("toneMapping", t.toneMapping) : "",t.dithering ? "#define DITHERING" : "",t.opaque ? "#define OPAQUE" : "",ot.colorspace_pars_fragment,// this code is required here because it is used by the various encoding/decoding function defined below- gS("linearToOutputTexel", t.outputColorSpace),- bS(),+ vS("linearToOutputTexel", t.outputColorSpace),+ SS(),t.useDepthPacking ? "#define DEPTH_PACKING " + t.depthPacking : "",``- ].filter(ao).join(`-`)), a = hd(a), a = oA(a, t), a = cA(a, t), o = hd(o), o = oA(o, t), o = cA(o, t), a = lA(a), o = lA(o), t.isRawShaderMaterial !== !0 && (y = `#version 300 es+ ].filter(ho).join(`+`)), a = gd(a), a = fA(a, t), a = pA(a, t), o = gd(o), o = fA(o, t), o = pA(o, t), a = AA(a), o = AA(o), t.isRawShaderMaterial !== !0 && (y = `#version 300 es`, A = [f,"#define attribute in",@@ -20561,8 +20561,8 @@ function NS(i, e, t, n) {`) + `` + A, p = ["#define varying in",- t.glslVersion === sp ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",- t.glslVersion === sp ? "" : "#define gl_FragColor pc_fragColor",+ t.glslVersion === hp ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",+ t.glslVersion === hp ? "" : "#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture",@@ -20576,7 +20576,7 @@ function NS(i, e, t, n) {].join(``) + `` + p);- const b = y + A + a, _ = y + p + o, M = sA(s, s.VERTEX_SHADER, b), w = sA(s, s.FRAGMENT_SHADER, _);+ const b = y + A + a, _ = y + p + o, M = hA(s, s.VERTEX_SHADER, b), w = hA(s, s.FRAGMENT_SHADER, _);s.attachShader(g, M), s.attachShader(g, w), t.index0AttributeName !== void 0 ? s.bindAttribLocation(g, 0, t.index0AttributeName) : t.morphTargets === !0 && s.bindAttribLocation(g, 0, "position"), s.linkProgram(g);function S(F) {if (i.debug.checkShaderErrors) {@@ -20586,7 +20586,7 @@ function NS(i, e, t, n) {if (D = !1, typeof i.debug.onShaderError == "function")i.debug.onShaderError(s, g, M, w);else {- const j = aA(s, M, "vertex"), Q = aA(s, w, "fragment");+ const Y = dA(s, M, "vertex"), Q = dA(s, w, "fragment");console.error("THREE.WebGLProgram: Shader Error " + s.getError() + " - VALIDATE_STATUS " + s.getProgramParameter(g, s.VALIDATE_STATUS) + `@@ -20594,7 +20594,7 @@ Material Name: ` + F.name + `Material Type: ` + F.type + `Program Info Log: ` + K + `-` + j + `+` + Y + `` + Q);}@@ -20612,25 +20612,25 @@ Program Info Log: ` + K + `}});}- s.deleteShader(M), s.deleteShader(w), T = new sl(s, g), v = _S(s, g);+ s.deleteShader(M), s.deleteShader(w), T = new ll(s, g), C = BS(s, g);}let T;this.getUniforms = function() {return T === void 0 && S(this), T;};- let v;+ let C;this.getAttributes = function() {- return v === void 0 && S(this), v;+ return C === void 0 && S(this), C;};- let C = t.rendererExtensionParallelShaderCompile === !1;+ let v = t.rendererExtensionParallelShaderCompile === !1;return this.isReady = function() {- return C === !1 && (C = s.getProgramParameter(g, dS)), C;+ return v === !1 && (v = s.getProgramParameter(g, ES)), v;}, this.destroy = function() {n.releaseStatesOfProgram(this), s.deleteProgram(g), this.program = void 0;- }, this.type = t.shaderType, this.name = t.shaderName, this.id = fS++, this.cacheKey = e, this.usedTimes = 1, this.program = g, this.vertexShader = M, this.fragmentShader = w, this;+ }, this.type = t.shaderType, this.name = t.shaderName, this.id = _S++, this.cacheKey = e, this.usedTimes = 1, this.program = g, this.vertexShader = M, this.fragmentShader = w, this;}-let FS = 0;-class DS {+let GS = 0;+class HS {constructor() {this.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();}@@ -20661,16 +20661,16 @@ class DS {_getShaderStage(e) {const t = this.shaderCache;let n = t.get(e);- return n === void 0 && (n = new LS(e), t.set(e, n)), n;+ return n === void 0 && (n = new zS(e), t.set(e, n)), n;}}-class LS {+class zS {constructor(e) {- this.id = FS++, this.code = e, this.usedTimes = 0;+ this.id = GS++, this.code = e, this.usedTimes = 0;}}-function PS(i, e, t, n, s, r, a) {- const o = new Gm(), c = new DS(), l = /* @__PURE__ */ new Set(), h = [], u = s.logarithmicDepthBuffer, d = s.vertexTextures;+function VS(i, e, t, n, s, r, a) {+ const o = new jm(), c = new HS(), l = /* @__PURE__ */ new Set(), h = [], u = s.logarithmicDepthBuffer, d = s.vertexTextures;let f = s.precision;const m = {MeshDepthMaterial: "depth",@@ -20689,35 +20689,35 @@ function PS(i, e, t, n, s, r, a) {ShadowMaterial: "shadow",SpriteMaterial: "sprite"};- function g(v) {- return l.add(v), v === 0 ? "uv" : `uv${v}`;+ function g(C) {+ return l.add(C), C === 0 ? "uv" : `uv${C}`;}- function A(v, C, F, K, q) {- const $ = K.fog, D = q.geometry, O = v.isMeshStandardMaterial ? K.environment : null, j = (v.isMeshStandardMaterial ? t : e).get(v.envMap || O), Q = j && j.mapping === Pl ? j.image.height : null, J = m[v.type];- v.precision !== null && (f = s.getMaxPrecision(v.precision), f !== v.precision && console.warn("THREE.WebGLProgram.getParameters:", v.precision, "not supported, using", f, "instead."));+ function A(C, v, F, K, q) {+ const $ = K.fog, D = q.geometry, O = C.isMeshStandardMaterial ? K.environment : null, Y = (C.isMeshStandardMaterial ? t : e).get(C.envMap || O), Q = Y && Y.mapping === Gl ? Y.image.height : null, J = m[C.type];+ C.precision !== null && (f = s.getMaxPrecision(C.precision), f !== C.precision && console.warn("THREE.WebGLProgram.getParameters:", C.precision, "not supported, using", f, "instead."));const ee = D.morphAttributes.position || D.morphAttributes.normal || D.morphAttributes.color, ae = ee !== void 0 ? ee.length : 0;let ye = 0;D.morphAttributes.position !== void 0 && (ye = 1), D.morphAttributes.normal !== void 0 && (ye = 2), D.morphAttributes.color !== void 0 && (ye = 3);let Me, se, me, be;if (J) {- const _t = Mi[J];+ const _t = Bi[J];Me = _t.vertexShader, se = _t.fragmentShader;} else- Me = v.vertexShader, se = v.fragmentShader, c.update(v), me = c.getVertexShaderID(v), be = c.getFragmentShaderID(v);- const xe = i.getRenderTarget(), Pe = i.state.buffers.depth.getReversed(), $e = q.isInstancedMesh === !0, Qe = q.isBatchedMesh === !0, Ct = !!v.map, lt = !!v.matcap, Je = !!j, G = !!v.aoMap, dn = !!v.lightMap, dt = !!v.bumpMap, pt = !!v.normalMap, ze = !!v.displacementMap, Rt = !!v.emissiveMap, Ge = !!v.metalnessMap, L = !!v.roughnessMap, I = v.anisotropy > 0, Z = v.clearcoat > 0, le = v.dispersion > 0, pe = v.iridescence > 0, oe = v.sheen > 0, Ue = v.transmission > 0, Ce = I && !!v.anisotropyMap, Ve = Z && !!v.clearcoatMap, je = Z && !!v.clearcoatNormalMap, Ee = Z && !!v.clearcoatRoughnessMap, Re = pe && !!v.iridescenceMap, ke = pe && !!v.iridescenceThicknessMap, Oe = oe && !!v.sheenColorMap, Be = oe && !!v.sheenRoughnessMap, et = !!v.specularMap, We = !!v.specularColorMap, tt = !!v.specularIntensityMap, W = Ue && !!v.transmissionMap, ne = Ue && !!v.thicknessMap, re = !!v.gradientMap, de = !!v.alphaMap, Ie = v.alphaTest > 0, ve = !!v.alphaHash, nt = !!v.extensions;- let Ut = Ds;- v.toneMapped && (xe === null || xe.isXRRenderTarget === !0) && (Ut = i.toneMapping);+ Me = C.vertexShader, se = C.fragmentShader, c.update(C), me = c.getVertexShaderID(C), be = c.getFragmentShaderID(C);+ const xe = i.getRenderTarget(), Pe = i.state.buffers.depth.getReversed(), $e = q.isInstancedMesh === !0, Qe = q.isBatchedMesh === !0, vt = !!C.map, lt = !!C.matcap, Je = !!Y, G = !!C.aoMap, dn = !!C.lightMap, dt = !!C.bumpMap, pt = !!C.normalMap, ze = !!C.displacementMap, Rt = !!C.emissiveMap, Ge = !!C.metalnessMap, L = !!C.roughnessMap, I = C.anisotropy > 0, Z = C.clearcoat > 0, le = C.dispersion > 0, pe = C.iridescence > 0, oe = C.sheen > 0, Ue = C.transmission > 0, ve = I && !!C.anisotropyMap, Ve = Z && !!C.clearcoatMap, Ye = Z && !!C.clearcoatNormalMap, Ee = Z && !!C.clearcoatRoughnessMap, Re = pe && !!C.iridescenceMap, ke = pe && !!C.iridescenceThicknessMap, Oe = oe && !!C.sheenColorMap, Be = oe && !!C.sheenRoughnessMap, et = !!C.specularMap, We = !!C.specularColorMap, tt = !!C.specularIntensityMap, W = Ue && !!C.transmissionMap, ne = Ue && !!C.thicknessMap, re = !!C.gradientMap, de = !!C.alphaMap, Ie = C.alphaTest > 0, Ce = !!C.alphaHash, nt = !!C.extensions;+ let Ut = Ls;+ C.toneMapped && (xe === null || xe.isXRRenderTarget === !0) && (Ut = i.toneMapping);const fn = {shaderID: J,- shaderType: v.type,- shaderName: v.name,+ shaderType: C.type,+ shaderName: C.name,vertexShader: Me,fragmentShader: se,- defines: v.defines,+ defines: C.defines,customVertexShaderID: me,customFragmentShaderID: be,- isRawShaderMaterial: v.isRawShaderMaterial === !0,- glslVersion: v.glslVersion,+ isRawShaderMaterial: C.isRawShaderMaterial === !0,+ glslVersion: C.glslVersion,precision: f,batching: Qe,batchingColor: Qe && q._colorsTexture !== null,@@ -20726,11 +20726,11 @@ function PS(i, e, t, n, s, r, a) {instancingMorph: $e && q.morphTexture !== null,supportsVertexTextures: d,outputColorSpace: xe === null ? i.outputColorSpace : xe.isXRRenderTarget === !0 ? xe.texture.colorSpace : ln,- alphaToCoverage: !!v.alphaToCoverage,- map: Ct,+ alphaToCoverage: !!C.alphaToCoverage,+ map: vt,matcap: lt,envMap: Je,- envMapMode: Je && j.mapping,+ envMapMode: Je && Y.mapping,envMapCubeUVHeight: Q,aoMap: G,lightMap: dn,@@ -20738,15 +20738,15 @@ function PS(i, e, t, n, s, r, a) {normalMap: pt,displacementMap: d && ze,emissiveMap: Rt,- normalMapObjectSpace: pt && v.normalMapType === TE,- normalMapTangentSpace: pt && v.normalMapType === Lm,+ normalMapObjectSpace: pt && C.normalMapType === UE,+ normalMapTangentSpace: pt && C.normalMapType === Hm,metalnessMap: Ge,roughnessMap: L,anisotropy: I,- anisotropyMap: Ce,+ anisotropyMap: ve,clearcoat: Z,clearcoatMap: Ve,- clearcoatNormalMap: je,+ clearcoatNormalMap: Ye,clearcoatRoughnessMap: Ee,dispersion: le,iridescence: pe,@@ -20762,45 +20762,45 @@ function PS(i, e, t, n, s, r, a) {transmissionMap: W,thicknessMap: ne,gradientMap: re,- opaque: v.transparent === !1 && v.blending === ca && v.alphaToCoverage === !1,+ opaque: C.transparent === !1 && C.blending === ha && C.alphaToCoverage === !1,alphaMap: de,alphaTest: Ie,- alphaHash: ve,- combine: v.combine,+ alphaHash: Ce,+ combine: C.combine,//- mapUv: Ct && g(v.map.channel),- aoMapUv: G && g(v.aoMap.channel),- lightMapUv: dn && g(v.lightMap.channel),- bumpMapUv: dt && g(v.bumpMap.channel),- normalMapUv: pt && g(v.normalMap.channel),- displacementMapUv: ze && g(v.displacementMap.channel),- emissiveMapUv: Rt && g(v.emissiveMap.channel),- metalnessMapUv: Ge && g(v.metalnessMap.channel),- roughnessMapUv: L && g(v.roughnessMap.channel),- anisotropyMapUv: Ce && g(v.anisotropyMap.channel),- clearcoatMapUv: Ve && g(v.clearcoatMap.channel),- clearcoatNormalMapUv: je && g(v.clearcoatNormalMap.channel),- clearcoatRoughnessMapUv: Ee && g(v.clearcoatRoughnessMap.channel),- iridescenceMapUv: Re && g(v.iridescenceMap.channel),- iridescenceThicknessMapUv: ke && g(v.iridescenceThicknessMap.channel),- sheenColorMapUv: Oe && g(v.sheenColorMap.channel),- sheenRoughnessMapUv: Be && g(v.sheenRoughnessMap.channel),- specularMapUv: et && g(v.specularMap.channel),- specularColorMapUv: We && g(v.specularColorMap.channel),- specularIntensityMapUv: tt && g(v.specularIntensityMap.channel),- transmissionMapUv: W && g(v.transmissionMap.channel),- thicknessMapUv: ne && g(v.thicknessMap.channel),- alphaMapUv: de && g(v.alphaMap.channel),+ mapUv: vt && g(C.map.channel),+ aoMapUv: G && g(C.aoMap.channel),+ lightMapUv: dn && g(C.lightMap.channel),+ bumpMapUv: dt && g(C.bumpMap.channel),+ normalMapUv: pt && g(C.normalMap.channel),+ displacementMapUv: ze && g(C.displacementMap.channel),+ emissiveMapUv: Rt && g(C.emissiveMap.channel),+ metalnessMapUv: Ge && g(C.metalnessMap.channel),+ roughnessMapUv: L && g(C.roughnessMap.channel),+ anisotropyMapUv: ve && g(C.anisotropyMap.channel),+ clearcoatMapUv: Ve && g(C.clearcoatMap.channel),+ clearcoatNormalMapUv: Ye && g(C.clearcoatNormalMap.channel),+ clearcoatRoughnessMapUv: Ee && g(C.clearcoatRoughnessMap.channel),+ iridescenceMapUv: Re && g(C.iridescenceMap.channel),+ iridescenceThicknessMapUv: ke && g(C.iridescenceThicknessMap.channel),+ sheenColorMapUv: Oe && g(C.sheenColorMap.channel),+ sheenRoughnessMapUv: Be && g(C.sheenRoughnessMap.channel),+ specularMapUv: et && g(C.specularMap.channel),+ specularColorMapUv: We && g(C.specularColorMap.channel),+ specularIntensityMapUv: tt && g(C.specularIntensityMap.channel),+ transmissionMapUv: W && g(C.transmissionMap.channel),+ thicknessMapUv: ne && g(C.thicknessMap.channel),+ alphaMapUv: de && g(C.alphaMap.channel),//vertexTangents: !!D.attributes.tangent && (pt || I),- vertexColors: v.vertexColors,- vertexAlphas: v.vertexColors === !0 && !!D.attributes.color && D.attributes.color.itemSize === 4,- pointsUvs: q.isPoints === !0 && !!D.attributes.uv && (Ct || de),+ vertexColors: C.vertexColors,+ vertexAlphas: C.vertexColors === !0 && !!D.attributes.color && D.attributes.color.itemSize === 4,+ pointsUvs: q.isPoints === !0 && !!D.attributes.uv && (vt || de),fog: !!$,- useFog: v.fog === !0,+ useFog: C.fog === !0,fogExp2: !!$ && $.isFogExp2,- flatShading: v.flatShading === !0,- sizeAttenuation: v.sizeAttenuation === !0,+ flatShading: C.flatShading === !0,+ sizeAttenuation: C.sizeAttenuation === !0,logarithmicDepthBuffer: u,reverseDepthBuffer: Pe,skinning: q.isSkinnedMesh === !0,@@ -20809,80 +20809,80 @@ function PS(i, e, t, n, s, r, a) {morphColors: D.morphAttributes.color !== void 0,morphTargetsCount: ae,morphTextureStride: ye,- numDirLights: C.directional.length,- numPointLights: C.point.length,- numSpotLights: C.spot.length,- numSpotLightMaps: C.spotLightMap.length,- numRectAreaLights: C.rectArea.length,- numHemiLights: C.hemi.length,- numDirLightShadows: C.directionalShadowMap.length,- numPointLightShadows: C.pointShadowMap.length,- numSpotLightShadows: C.spotShadowMap.length,- numSpotLightShadowsWithMaps: C.numSpotLightShadowsWithMaps,- numLightProbes: C.numLightProbes,+ numDirLights: v.directional.length,+ numPointLights: v.point.length,+ numSpotLights: v.spot.length,+ numSpotLightMaps: v.spotLightMap.length,+ numRectAreaLights: v.rectArea.length,+ numHemiLights: v.hemi.length,+ numDirLightShadows: v.directionalShadowMap.length,+ numPointLightShadows: v.pointShadowMap.length,+ numSpotLightShadows: v.spotShadowMap.length,+ numSpotLightShadowsWithMaps: v.numSpotLightShadowsWithMaps,+ numLightProbes: v.numLightProbes,numClippingPlanes: a.numPlanes,numClipIntersection: a.numIntersection,- dithering: v.dithering,+ dithering: C.dithering,shadowMapEnabled: i.shadowMap.enabled && F.length > 0,shadowMapType: i.shadowMap.type,toneMapping: Ut,- decodeVideoTexture: Ct && v.map.isVideoTexture === !0 && mt.getTransfer(v.map.colorSpace) === Mt,- decodeVideoTextureEmissive: Rt && v.emissiveMap.isVideoTexture === !0 && mt.getTransfer(v.emissiveMap.colorSpace) === Mt,- premultipliedAlpha: v.premultipliedAlpha,- doubleSided: v.side === Bi,- flipSided: v.side === Ln,- useDepthPacking: v.depthPacking >= 0,- depthPacking: v.depthPacking || 0,- index0AttributeName: v.index0AttributeName,- extensionClipCullDistance: nt && v.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"),- extensionMultiDraw: (nt && v.extensions.multiDraw === !0 || Qe) && n.has("WEBGL_multi_draw"),+ decodeVideoTexture: vt && C.map.isVideoTexture === !0 && mt.getTransfer(C.map.colorSpace) === Mt,+ decodeVideoTextureEmissive: Rt && C.emissiveMap.isVideoTexture === !0 && mt.getTransfer(C.emissiveMap.colorSpace) === Mt,+ premultipliedAlpha: C.premultipliedAlpha,+ doubleSided: C.side === Ti,+ flipSided: C.side === Ln,+ useDepthPacking: C.depthPacking >= 0,+ depthPacking: C.depthPacking || 0,+ index0AttributeName: C.index0AttributeName,+ extensionClipCullDistance: nt && C.extensions.clipCullDistance === !0 && n.has("WEBGL_clip_cull_distance"),+ extensionMultiDraw: (nt && C.extensions.multiDraw === !0 || Qe) && n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile: n.has("KHR_parallel_shader_compile"),- customProgramCacheKey: v.customProgramCacheKey()+ customProgramCacheKey: C.customProgramCacheKey()};return fn.vertexUv1s = l.has(1), fn.vertexUv2s = l.has(2), fn.vertexUv3s = l.has(3), l.clear(), fn;}- function p(v) {- const C = [];- if (v.shaderID ? C.push(v.shaderID) : (C.push(v.customVertexShaderID), C.push(v.customFragmentShaderID)), v.defines !== void 0)- for (const F in v.defines)- C.push(F), C.push(v.defines[F]);- return v.isRawShaderMaterial === !1 && (y(C, v), b(C, v), C.push(i.outputColorSpace)), C.push(v.customProgramCacheKey), C.join();+ function p(C) {+ const v = [];+ if (C.shaderID ? v.push(C.shaderID) : (v.push(C.customVertexShaderID), v.push(C.customFragmentShaderID)), C.defines !== void 0)+ for (const F in C.defines)+ v.push(F), v.push(C.defines[F]);+ return C.isRawShaderMaterial === !1 && (y(v, C), b(v, C), v.push(i.outputColorSpace)), v.push(C.customProgramCacheKey), v.join();}- function y(v, C) {- v.push(C.precision), v.push(C.outputColorSpace), v.push(C.envMapMode), v.push(C.envMapCubeUVHeight), v.push(C.mapUv), v.push(C.alphaMapUv), v.push(C.lightMapUv), v.push(C.aoMapUv), v.push(C.bumpMapUv), v.push(C.normalMapUv), v.push(C.displacementMapUv), v.push(C.emissiveMapUv), v.push(C.metalnessMapUv), v.push(C.roughnessMapUv), v.push(C.anisotropyMapUv), v.push(C.clearcoatMapUv), v.push(C.clearcoatNormalMapUv), v.push(C.clearcoatRoughnessMapUv), v.push(C.iridescenceMapUv), v.push(C.iridescenceThicknessMapUv), v.push(C.sheenColorMapUv), v.push(C.sheenRoughnessMapUv), v.push(C.specularMapUv), v.push(C.specularColorMapUv), v.push(C.specularIntensityMapUv), v.push(C.transmissionMapUv), v.push(C.thicknessMapUv), v.push(C.combine), v.push(C.fogExp2), v.push(C.sizeAttenuation), v.push(C.morphTargetsCount), v.push(C.morphAttributeCount), v.push(C.numDirLights), v.push(C.numPointLights), v.push(C.numSpotLights), v.push(C.numSpotLightMaps), v.push(C.numHemiLights), v.push(C.numRectAreaLights), v.push(C.numDirLightShadows), v.push(C.numPointLightShadows), v.push(C.numSpotLightShadows), v.push(C.numSpotLightShadowsWithMaps), v.push(C.numLightProbes), v.push(C.shadowMapType), v.push(C.toneMapping), v.push(C.numClippingPlanes), v.push(C.numClipIntersection), v.push(C.depthPacking);+ function y(C, v) {+ C.push(v.precision), C.push(v.outputColorSpace), C.push(v.envMapMode), C.push(v.envMapCubeUVHeight), C.push(v.mapUv), C.push(v.alphaMapUv), C.push(v.lightMapUv), C.push(v.aoMapUv), C.push(v.bumpMapUv), C.push(v.normalMapUv), C.push(v.displacementMapUv), C.push(v.emissiveMapUv), C.push(v.metalnessMapUv), C.push(v.roughnessMapUv), C.push(v.anisotropyMapUv), C.push(v.clearcoatMapUv), C.push(v.clearcoatNormalMapUv), C.push(v.clearcoatRoughnessMapUv), C.push(v.iridescenceMapUv), C.push(v.iridescenceThicknessMapUv), C.push(v.sheenColorMapUv), C.push(v.sheenRoughnessMapUv), C.push(v.specularMapUv), C.push(v.specularColorMapUv), C.push(v.specularIntensityMapUv), C.push(v.transmissionMapUv), C.push(v.thicknessMapUv), C.push(v.combine), C.push(v.fogExp2), C.push(v.sizeAttenuation), C.push(v.morphTargetsCount), C.push(v.morphAttributeCount), C.push(v.numDirLights), C.push(v.numPointLights), C.push(v.numSpotLights), C.push(v.numSpotLightMaps), C.push(v.numHemiLights), C.push(v.numRectAreaLights), C.push(v.numDirLightShadows), C.push(v.numPointLightShadows), C.push(v.numSpotLightShadows), C.push(v.numSpotLightShadowsWithMaps), C.push(v.numLightProbes), C.push(v.shadowMapType), C.push(v.toneMapping), C.push(v.numClippingPlanes), C.push(v.numClipIntersection), C.push(v.depthPacking);}- function b(v, C) {- o.disableAll(), C.supportsVertexTextures && o.enable(0), C.instancing && o.enable(1), C.instancingColor && o.enable(2), C.instancingMorph && o.enable(3), C.matcap && o.enable(4), C.envMap && o.enable(5), C.normalMapObjectSpace && o.enable(6), C.normalMapTangentSpace && o.enable(7), C.clearcoat && o.enable(8), C.iridescence && o.enable(9), C.alphaTest && o.enable(10), C.vertexColors && o.enable(11), C.vertexAlphas && o.enable(12), C.vertexUv1s && o.enable(13), C.vertexUv2s && o.enable(14), C.vertexUv3s && o.enable(15), C.vertexTangents && o.enable(16), C.anisotropy && o.enable(17), C.alphaHash && o.enable(18), C.batching && o.enable(19), C.dispersion && o.enable(20), C.batchingColor && o.enable(21), v.push(o.mask), o.disableAll(), C.fog && o.enable(0), C.useFog && o.enable(1), C.flatShading && o.enable(2), C.logarithmicDepthBuffer && o.enable(3), C.reverseDepthBuffer && o.enable(4), C.skinning && o.enable(5), C.morphTargets && o.enable(6), C.morphNormals && o.enable(7), C.morphColors && o.enable(8), C.premultipliedAlpha && o.enable(9), C.shadowMapEnabled && o.enable(10), C.doubleSided && o.enable(11), C.flipSided && o.enable(12), C.useDepthPacking && o.enable(13), C.dithering && o.enable(14), C.transmission && o.enable(15), C.sheen && o.enable(16), C.opaque && o.enable(17), C.pointsUvs && o.enable(18), C.decodeVideoTexture && o.enable(19), C.decodeVideoTextureEmissive && o.enable(20), C.alphaToCoverage && o.enable(21), v.push(o.mask);+ function b(C, v) {+ o.disableAll(), v.supportsVertexTextures && o.enable(0), v.instancing && o.enable(1), v.instancingColor && o.enable(2), v.instancingMorph && o.enable(3), v.matcap && o.enable(4), v.envMap && o.enable(5), v.normalMapObjectSpace && o.enable(6), v.normalMapTangentSpace && o.enable(7), v.clearcoat && o.enable(8), v.iridescence && o.enable(9), v.alphaTest && o.enable(10), v.vertexColors && o.enable(11), v.vertexAlphas && o.enable(12), v.vertexUv1s && o.enable(13), v.vertexUv2s && o.enable(14), v.vertexUv3s && o.enable(15), v.vertexTangents && o.enable(16), v.anisotropy && o.enable(17), v.alphaHash && o.enable(18), v.batching && o.enable(19), v.dispersion && o.enable(20), v.batchingColor && o.enable(21), C.push(o.mask), o.disableAll(), v.fog && o.enable(0), v.useFog && o.enable(1), v.flatShading && o.enable(2), v.logarithmicDepthBuffer && o.enable(3), v.reverseDepthBuffer && o.enable(4), v.skinning && o.enable(5), v.morphTargets && o.enable(6), v.morphNormals && o.enable(7), v.morphColors && o.enable(8), v.premultipliedAlpha && o.enable(9), v.shadowMapEnabled && o.enable(10), v.doubleSided && o.enable(11), v.flipSided && o.enable(12), v.useDepthPacking && o.enable(13), v.dithering && o.enable(14), v.transmission && o.enable(15), v.sheen && o.enable(16), v.opaque && o.enable(17), v.pointsUvs && o.enable(18), v.decodeVideoTexture && o.enable(19), v.decodeVideoTextureEmissive && o.enable(20), v.alphaToCoverage && o.enable(21), C.push(o.mask);}- function _(v) {- const C = m[v.type];+ function _(C) {+ const v = m[C.type];let F;- if (C) {- const K = Mi[C];- F = C_.clone(K.uniforms);+ if (v) {+ const K = Bi[v];+ F = N_.clone(K.uniforms);} else- F = v.uniforms;+ F = C.uniforms;return F;}- function M(v, C) {+ function M(C, v) {let F;for (let K = 0, q = h.length; K < q; K++) {const $ = h[K];- if ($.cacheKey === C) {+ if ($.cacheKey === v) {F = $, ++F.usedTimes;break;}}- return F === void 0 && (F = new NS(i, C, v, r), h.push(F)), F;+ return F === void 0 && (F = new QS(i, v, C, r), h.push(F)), F;}- function w(v) {- if (--v.usedTimes === 0) {- const C = h.indexOf(v);- h[C] = h[h.length - 1], h.pop(), v.destroy();+ function w(C) {+ if (--C.usedTimes === 0) {+ const v = h.indexOf(C);+ h[v] = h[h.length - 1], h.pop(), C.destroy();}}- function S(v) {- c.remove(v);+ function S(C) {+ c.remove(C);}function T() {c.dispose();@@ -20899,7 +20899,7 @@ function PS(i, e, t, n, s, r, a) {dispose: T};}-function kS() {+function WS() {let i = /* @__PURE__ */ new WeakMap();function e(a) {return i.has(a);@@ -20925,13 +20925,13 @@ function kS() {dispose: r};}-function US(i, e) {+function qS(i, e) {return i.groupOrder !== e.groupOrder ? i.groupOrder - e.groupOrder : i.renderOrder !== e.renderOrder ? i.renderOrder - e.renderOrder : i.material.id !== e.material.id ? i.material.id - e.material.id : i.z !== e.z ? i.z - e.z : i.id - e.id;}-function uA(i, e) {+function mA(i, e) {return i.groupOrder !== e.groupOrder ? i.groupOrder - e.groupOrder : i.renderOrder !== e.renderOrder ? i.renderOrder - e.renderOrder : i.z !== e.z ? e.z - i.z : i.id - e.id;}-function dA() {+function bA() {const i = [];let e = 0;const t = [], n = [], s = [];@@ -20960,7 +20960,7 @@ function dA() {f.transmission > 0 ? n.unshift(p) : f.transparent === !0 ? s.unshift(p) : t.unshift(p);}function l(u, d) {- t.length > 1 && t.sort(u || US), n.length > 1 && n.sort(d || uA), s.length > 1 && s.sort(d || uA);+ t.length > 1 && t.sort(u || qS), n.length > 1 && n.sort(d || mA), s.length > 1 && s.sort(d || mA);}function h() {for (let u = e, d = i.length; u < d; u++) {@@ -20980,12 +20980,12 @@ function dA() {sort: l};}-function OS() {+function KS() {let i = /* @__PURE__ */ new WeakMap();function e(n, s) {const r = i.get(n);let a;- return r === void 0 ? (a = new dA(), i.set(n, [a])) : s >= r.length ? (a = new dA(), r.push(a)) : a = r[s], a;+ return r === void 0 ? (a = new bA(), i.set(n, [a])) : s >= r.length ? (a = new bA(), r.push(a)) : a = r[s], a;}function t() {i = /* @__PURE__ */ new WeakMap();@@ -20995,7 +20995,7 @@ function OS() {dispose: t};}-function QS() {+function jS() {const i = {};return {get: function(e) {@@ -21006,14 +21006,14 @@ function QS() {case "DirectionalLight":t = {direction: new H(),- color: new Xe()+ color: new je()};break;case "SpotLight":t = {position: new H(),direction: new H(),- color: new Xe(),+ color: new je(),distance: 0,coneCos: 0,penumbraCos: 0,@@ -21023,7 +21023,7 @@ function QS() {case "PointLight":t = {position: new H(),- color: new Xe(),+ color: new je(),distance: 0,decay: 0};@@ -21031,13 +21031,13 @@ function QS() {case "HemisphereLight":t = {direction: new H(),- skyColor: new Xe(),- groundColor: new Xe()+ skyColor: new je(),+ groundColor: new je()};break;case "RectAreaLight":t = {- color: new Xe(),+ color: new je(),position: new H(),halfWidth: new H(),halfHeight: new H()@@ -21048,7 +21048,7 @@ function QS() {}};}-function GS() {+function XS() {const i = {};return {get: function(e) {@@ -21090,12 +21090,12 @@ function GS() {}};}-let HS = 0;-function zS(i, e) {+let YS = 0;+function JS(i, e) {return (e.castShadow ? 2 : 0) - (i.castShadow ? 2 : 0) + (e.map ? 1 : 0) - (i.map ? 1 : 0);}-function VS(i) {- const e = new QS(), t = GS(), n = {+function ZS(i) {+ const e = new jS(), t = XS(), n = {version: 0,hash: {directionalLength: -1,@@ -21135,11 +21135,11 @@ function VS(i) {const s = new H(), r = new st(), a = new st();function o(l) {let h = 0, u = 0, d = 0;- for (let v = 0; v < 9; v++) n.probe[v].set(0, 0, 0);+ for (let C = 0; C < 9; C++) n.probe[C].set(0, 0, 0);let f = 0, m = 0, g = 0, A = 0, p = 0, y = 0, b = 0, _ = 0, M = 0, w = 0, S = 0;- l.sort(zS);- for (let v = 0, C = l.length; v < C; v++) {- const F = l[v], K = F.color, q = F.intensity, $ = F.distance, D = F.shadow && F.shadow.map ? F.shadow.map.texture : null;+ l.sort(JS);+ for (let C = 0, v = l.length; C < v; C++) {+ const F = l[C], K = F.color, q = F.intensity, $ = F.distance, D = F.shadow && F.shadow.map ? F.shadow.map.texture : null;if (F.isAmbientLight)h += K.r * q, u += K.g * q, d += K.b * q;else if (F.isLightProbe) {@@ -21149,17 +21149,17 @@ function VS(i) {} else if (F.isDirectionalLight) {const O = e.get(F);if (O.color.copy(F.color).multiplyScalar(F.intensity), F.castShadow) {- const j = F.shadow, Q = t.get(F);- Q.shadowIntensity = j.intensity, Q.shadowBias = j.bias, Q.shadowNormalBias = j.normalBias, Q.shadowRadius = j.radius, Q.shadowMapSize = j.mapSize, n.directionalShadow[f] = Q, n.directionalShadowMap[f] = D, n.directionalShadowMatrix[f] = F.shadow.matrix, y++;+ const Y = F.shadow, Q = t.get(F);+ Q.shadowIntensity = Y.intensity, Q.shadowBias = Y.bias, Q.shadowNormalBias = Y.normalBias, Q.shadowRadius = Y.radius, Q.shadowMapSize = Y.mapSize, n.directionalShadow[f] = Q, n.directionalShadowMap[f] = D, n.directionalShadowMatrix[f] = F.shadow.matrix, y++;}n.directional[f] = O, f++;} else if (F.isSpotLight) {const O = e.get(F);O.position.setFromMatrixPosition(F.matrixWorld), O.color.copy(K).multiplyScalar(q), O.distance = $, O.coneCos = Math.cos(F.angle), O.penumbraCos = Math.cos(F.angle * (1 - F.penumbra)), O.decay = F.decay, n.spot[g] = O;- const j = F.shadow;- if (F.map && (n.spotLightMap[M] = F.map, M++, j.updateMatrices(F), F.castShadow && w++), n.spotLightMatrix[g] = j.matrix, F.castShadow) {+ const Y = F.shadow;+ if (F.map && (n.spotLightMap[M] = F.map, M++, Y.updateMatrices(F), F.castShadow && w++), n.spotLightMatrix[g] = Y.matrix, F.castShadow) {const Q = t.get(F);- Q.shadowIntensity = j.intensity, Q.shadowBias = j.bias, Q.shadowNormalBias = j.normalBias, Q.shadowRadius = j.radius, Q.shadowMapSize = j.mapSize, n.spotShadow[g] = Q, n.spotShadowMap[g] = D, _++;+ Q.shadowIntensity = Y.intensity, Q.shadowBias = Y.bias, Q.shadowNormalBias = Y.normalBias, Q.shadowRadius = Y.radius, Q.shadowMapSize = Y.mapSize, n.spotShadow[g] = Q, n.spotShadowMap[g] = D, _++;}g++;} else if (F.isRectAreaLight) {@@ -21168,8 +21168,8 @@ function VS(i) {} else if (F.isPointLight) {const O = e.get(F);if (O.color.copy(F.color).multiplyScalar(F.intensity), O.distance = F.distance, O.decay = F.decay, F.castShadow) {- const j = F.shadow, Q = t.get(F);- Q.shadowIntensity = j.intensity, Q.shadowBias = j.bias, Q.shadowNormalBias = j.normalBias, Q.shadowRadius = j.radius, Q.shadowMapSize = j.mapSize, Q.shadowCameraNear = j.camera.near, Q.shadowCameraFar = j.camera.far, n.pointShadow[m] = Q, n.pointShadowMap[m] = D, n.pointShadowMatrix[m] = F.shadow.matrix, b++;+ const Y = F.shadow, Q = t.get(F);+ Q.shadowIntensity = Y.intensity, Q.shadowBias = Y.bias, Q.shadowNormalBias = Y.normalBias, Q.shadowRadius = Y.radius, Q.shadowMapSize = Y.mapSize, Q.shadowCameraNear = Y.camera.near, Q.shadowCameraFar = Y.camera.far, n.pointShadow[m] = Q, n.pointShadowMap[m] = D, n.pointShadowMatrix[m] = F.shadow.matrix, b++;}n.point[m] = O, m++;} else if (F.isHemisphereLight) {@@ -21179,7 +21179,7 @@ function VS(i) {}A > 0 && (i.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = we.LTC_FLOAT_1, n.rectAreaLTC2 = we.LTC_FLOAT_2) : (n.rectAreaLTC1 = we.LTC_HALF_1, n.rectAreaLTC2 = we.LTC_HALF_2)), n.ambient[0] = h, n.ambient[1] = u, n.ambient[2] = d;const T = n.hash;- (T.directionalLength !== f || T.pointLength !== m || T.spotLength !== g || T.rectAreaLength !== A || T.hemiLength !== p || T.numDirectionalShadows !== y || T.numPointShadows !== b || T.numSpotShadows !== _ || T.numSpotMaps !== M || T.numLightProbes !== S) && (n.directional.length = f, n.spot.length = g, n.rectArea.length = A, n.point.length = m, n.hemi.length = p, n.directionalShadow.length = y, n.directionalShadowMap.length = y, n.pointShadow.length = b, n.pointShadowMap.length = b, n.spotShadow.length = _, n.spotShadowMap.length = _, n.directionalShadowMatrix.length = y, n.pointShadowMatrix.length = b, n.spotLightMatrix.length = _ + M - w, n.spotLightMap.length = M, n.numSpotLightShadowsWithMaps = w, n.numLightProbes = S, T.directionalLength = f, T.pointLength = m, T.spotLength = g, T.rectAreaLength = A, T.hemiLength = p, T.numDirectionalShadows = y, T.numPointShadows = b, T.numSpotShadows = _, T.numSpotMaps = M, T.numLightProbes = S, n.version = HS++);+ (T.directionalLength !== f || T.pointLength !== m || T.spotLength !== g || T.rectAreaLength !== A || T.hemiLength !== p || T.numDirectionalShadows !== y || T.numPointShadows !== b || T.numSpotShadows !== _ || T.numSpotMaps !== M || T.numLightProbes !== S) && (n.directional.length = f, n.spot.length = g, n.rectArea.length = A, n.point.length = m, n.hemi.length = p, n.directionalShadow.length = y, n.directionalShadowMap.length = y, n.pointShadow.length = b, n.pointShadowMap.length = b, n.spotShadow.length = _, n.spotShadowMap.length = _, n.directionalShadowMatrix.length = y, n.pointShadowMatrix.length = b, n.spotLightMatrix.length = _ + M - w, n.spotLightMap.length = M, n.numSpotLightShadowsWithMaps = w, n.numLightProbes = S, T.directionalLength = f, T.pointLength = m, T.spotLength = g, T.rectAreaLength = A, T.hemiLength = p, T.numDirectionalShadows = y, T.numPointShadows = b, T.numSpotShadows = _, T.numSpotMaps = M, T.numLightProbes = S, n.version = YS++);}function c(l, h) {let u = 0, d = 0, f = 0, m = 0, g = 0;@@ -21210,8 +21210,8 @@ function VS(i) {state: n};}-function fA(i) {- const e = new VS(i), t = [], n = [];+function xA(i) {+ const e = new ZS(i), t = [], n = [];function s(h) {l.camera = h, t.length = 0, n.length = 0;}@@ -21243,12 +21243,12 @@ function fA(i) {pushShadow: a};}-function WS(i) {+function $S(i) {let e = /* @__PURE__ */ new WeakMap();function t(s, r = 0) {const a = e.get(s);let o;- return a === void 0 ? (o = new fA(i), e.set(s, [o])) : r >= a.length ? (o = new fA(i), a.push(o)) : o = a[r], o;+ return a === void 0 ? (o = new xA(i), e.set(s, [o])) : r >= a.length ? (o = new xA(i), a.push(o)) : o = a[r], o;}function n() {e = /* @__PURE__ */ new WeakMap();@@ -21258,9 +21258,9 @@ function WS(i) {dispose: n};}-const qS = `void main() {+const eI = `void main() {gl_Position = vec4( position, 1.0 );-}`, KS = `uniform sampler2D shadow_pass;+}`, tI = `uniform sampler2D shadow_pass;uniform vec2 resolution;uniform float radius;#include <packing>@@ -21287,9 +21287,9 @@ void main() {float std_dev = sqrt( squared_mean - mean * mean );gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );}`;-function XS(i, e, t) {- let n = new hf();- const s = new Ze(), r = new Ze(), a = new wt(), o = new G_({ depthPacking: BE }), c = new H_(), l = {}, h = t.maxTextureSize, u = { [hs]: Ln, [Ln]: hs, [Bi]: Bi }, d = new ks({+function nI(i, e, t) {+ let n = new gf();+ const s = new Ze(), r = new Ze(), a = new wt(), o = new X_({ depthPacking: kE }), c = new Y_(), l = {}, h = t.maxTextureSize, u = { [us]: Ln, [Ln]: us, [Ti]: Ti }, d = new Os({defines: {VSM_SAMPLES: 8},@@ -21298,8 +21298,8 @@ function XS(i, e, t) {resolution: { value: new Ze() },radius: { value: 4 }},- vertexShader: qS,- fragmentShader: KS+ vertexShader: eI,+ fragmentShader: tI}), f = d.clone();f.defines.HORIZONTAL_PASS = 1;const m = new Hn();@@ -21311,25 +21311,25 @@ function XS(i, e, t) {));const g = new Jt(m, d), A = this;- this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = _m;+ this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Mm;let p = this.type;this.render = function(w, S, T) {if (A.enabled === !1 || A.autoUpdate === !1 && A.needsUpdate === !1 || w.length === 0) return;- const v = i.getRenderTarget(), C = i.getActiveCubeFace(), F = i.getActiveMipmapLevel(), K = i.state;- K.setBlending(Fs), K.buffers.color.setClear(1, 1, 1, 1), K.buffers.depth.setTest(!0), K.setScissorTest(!1);- const q = p !== qi && this.type === qi, $ = p === qi && this.type !== qi;+ const C = i.getRenderTarget(), v = i.getActiveCubeFace(), F = i.getActiveMipmapLevel(), K = i.state;+ K.setBlending(Ds), K.buffers.color.setClear(1, 1, 1, 1), K.buffers.depth.setTest(!0), K.setScissorTest(!1);+ const q = p !== Ki && this.type === Ki, $ = p === Ki && this.type !== Ki;for (let D = 0, O = w.length; D < O; D++) {- const j = w[D], Q = j.shadow;+ const Y = w[D], Q = Y.shadow;if (Q === void 0) {- console.warn("THREE.WebGLShadowMap:", j, "has no shadow.");+ console.warn("THREE.WebGLShadowMap:", Y, "has no shadow.");continue;}if (Q.autoUpdate === !1 && Q.needsUpdate === !1) continue;s.copy(Q.mapSize);const J = Q.getFrameExtents();if (s.multiply(J), r.copy(Q.mapSize), (s.x > h || s.y > h) && (s.x > h && (r.x = Math.floor(h / J.x), s.x = r.x * J.x, Q.mapSize.x = r.x), s.y > h && (r.y = Math.floor(h / J.y), s.y = r.y * J.y, Q.mapSize.y = r.y)), Q.map === null || q === !0 || $ === !0) {- const ae = this.type !== qi ? { minFilter: Pn, magFilter: Pn } : {};- Q.map !== null && Q.map.dispose(), Q.map = new br(s.x, s.y, ae), Q.map.texture.name = j.name + ".shadowMap", Q.camera.updateProjectionMatrix();+ const ae = this.type !== Ki ? { minFilter: Pn, magFilter: Pn } : {};+ Q.map !== null && Q.map.dispose(), Q.map = new Er(s.x, s.y, ae), Q.map.texture.name = Y.name + ".shadowMap", Q.camera.updateProjectionMatrix();}i.setRenderTarget(Q.map), i.clear();const ee = Q.getViewportCount();@@ -21340,76 +21340,76 @@ function XS(i, e, t) {r.y * ye.y,r.x * ye.z,r.y * ye.w- ), K.viewport(a), Q.updateMatrices(j, ae), n = Q.getFrustum(), _(S, T, Q.camera, j, this.type);+ ), K.viewport(a), Q.updateMatrices(Y, ae), n = Q.getFrustum(), _(S, T, Q.camera, Y, this.type);}- Q.isPointLightShadow !== !0 && this.type === qi && y(Q, T), Q.needsUpdate = !1;+ Q.isPointLightShadow !== !0 && this.type === Ki && y(Q, T), Q.needsUpdate = !1;}- p = this.type, A.needsUpdate = !1, i.setRenderTarget(v, C, F);+ p = this.type, A.needsUpdate = !1, i.setRenderTarget(C, v, F);};function y(w, S) {const T = e.update(g);- d.defines.VSM_SAMPLES !== w.blurSamples && (d.defines.VSM_SAMPLES = w.blurSamples, f.defines.VSM_SAMPLES = w.blurSamples, d.needsUpdate = !0, f.needsUpdate = !0), w.mapPass === null && (w.mapPass = new br(s.x, s.y)), d.uniforms.shadow_pass.value = w.map.texture, d.uniforms.resolution.value = w.mapSize, d.uniforms.radius.value = w.radius, i.setRenderTarget(w.mapPass), i.clear(), i.renderBufferDirect(S, null, T, d, g, null), f.uniforms.shadow_pass.value = w.mapPass.texture, f.uniforms.resolution.value = w.mapSize, f.uniforms.radius.value = w.radius, i.setRenderTarget(w.map), i.clear(), i.renderBufferDirect(S, null, T, f, g, null);+ d.defines.VSM_SAMPLES !== w.blurSamples && (d.defines.VSM_SAMPLES = w.blurSamples, f.defines.VSM_SAMPLES = w.blurSamples, d.needsUpdate = !0, f.needsUpdate = !0), w.mapPass === null && (w.mapPass = new Er(s.x, s.y)), d.uniforms.shadow_pass.value = w.map.texture, d.uniforms.resolution.value = w.mapSize, d.uniforms.radius.value = w.radius, i.setRenderTarget(w.mapPass), i.clear(), i.renderBufferDirect(S, null, T, d, g, null), f.uniforms.shadow_pass.value = w.mapPass.texture, f.uniforms.resolution.value = w.mapSize, f.uniforms.radius.value = w.radius, i.setRenderTarget(w.map), i.clear(), i.renderBufferDirect(S, null, T, f, g, null);}- function b(w, S, T, v) {- let C = null;+ function b(w, S, T, C) {+ let v = null;const F = T.isPointLight === !0 ? w.customDistanceMaterial : w.customDepthMaterial;if (F !== void 0)- C = F;- else if (C = T.isPointLight === !0 ? c : o, i.localClippingEnabled && S.clipShadows === !0 && Array.isArray(S.clippingPlanes) && S.clippingPlanes.length !== 0 || S.displacementMap && S.displacementScale !== 0 || S.alphaMap && S.alphaTest > 0 || S.map && S.alphaTest > 0 || S.alphaToCoverage === !0) {- const K = C.uuid, q = S.uuid;+ v = F;+ else if (v = T.isPointLight === !0 ? c : o, i.localClippingEnabled && S.clipShadows === !0 && Array.isArray(S.clippingPlanes) && S.clippingPlanes.length !== 0 || S.displacementMap && S.displacementScale !== 0 || S.alphaMap && S.alphaTest > 0 || S.map && S.alphaTest > 0 || S.alphaToCoverage === !0) {+ const K = v.uuid, q = S.uuid;let $ = l[K];$ === void 0 && ($ = {}, l[K] = $);let D = $[q];- D === void 0 && (D = C.clone(), $[q] = D, S.addEventListener("dispose", M)), C = D;+ D === void 0 && (D = v.clone(), $[q] = D, S.addEventListener("dispose", M)), v = D;}- if (C.visible = S.visible, C.wireframe = S.wireframe, v === qi ? C.side = S.shadowSide !== null ? S.shadowSide : S.side : C.side = S.shadowSide !== null ? S.shadowSide : u[S.side], C.alphaMap = S.alphaMap, C.alphaTest = S.alphaToCoverage === !0 ? 0.5 : S.alphaTest, C.map = S.map, C.clipShadows = S.clipShadows, C.clippingPlanes = S.clippingPlanes, C.clipIntersection = S.clipIntersection, C.displacementMap = S.displacementMap, C.displacementScale = S.displacementScale, C.displacementBias = S.displacementBias, C.wireframeLinewidth = S.wireframeLinewidth, C.linewidth = S.linewidth, T.isPointLight === !0 && C.isMeshDistanceMaterial === !0) {- const K = i.properties.get(C);+ if (v.visible = S.visible, v.wireframe = S.wireframe, C === Ki ? v.side = S.shadowSide !== null ? S.shadowSide : S.side : v.side = S.shadowSide !== null ? S.shadowSide : u[S.side], v.alphaMap = S.alphaMap, v.alphaTest = S.alphaToCoverage === !0 ? 0.5 : S.alphaTest, v.map = S.map, v.clipShadows = S.clipShadows, v.clippingPlanes = S.clippingPlanes, v.clipIntersection = S.clipIntersection, v.displacementMap = S.displacementMap, v.displacementScale = S.displacementScale, v.displacementBias = S.displacementBias, v.wireframeLinewidth = S.wireframeLinewidth, v.linewidth = S.linewidth, T.isPointLight === !0 && v.isMeshDistanceMaterial === !0) {+ const K = i.properties.get(v);K.light = T;}- return C;+ return v;}- function _(w, S, T, v, C) {+ function _(w, S, T, C, v) {if (w.visible === !1) return;- if (w.layers.test(S.layers) && (w.isMesh || w.isLine || w.isPoints) && (w.castShadow || w.receiveShadow && C === qi) && (!w.frustumCulled || n.intersectsObject(w))) {+ if (w.layers.test(S.layers) && (w.isMesh || w.isLine || w.isPoints) && (w.castShadow || w.receiveShadow && v === Ki) && (!w.frustumCulled || n.intersectsObject(w))) {w.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse, w.matrixWorld);const q = e.update(w), $ = w.material;if (Array.isArray($)) {const D = q.groups;- for (let O = 0, j = D.length; O < j; O++) {+ for (let O = 0, Y = D.length; O < Y; O++) {const Q = D[O], J = $[Q.materialIndex];if (J && J.visible) {- const ee = b(w, J, v, C);+ const ee = b(w, J, C, v);w.onBeforeShadow(i, w, S, T, q, ee, Q), i.renderBufferDirect(T, null, q, ee, w, Q), w.onAfterShadow(i, w, S, T, q, ee, Q);}}} else if ($.visible) {- const D = b(w, $, v, C);+ const D = b(w, $, C, v);w.onBeforeShadow(i, w, S, T, q, D, null), i.renderBufferDirect(T, null, q, D, w, null), w.onAfterShadow(i, w, S, T, q, D, null);}}const K = w.children;for (let q = 0, $ = K.length; q < $; q++)- _(K[q], S, T, v, C);+ _(K[q], S, T, C, v);}function M(w) {w.target.removeEventListener("dispose", M);for (const T in l) {- const v = l[T], C = w.target.uuid;- C in v && (v[C].dispose(), delete v[C]);+ const C = l[T], v = w.target.uuid;+ v in C && (C[v].dispose(), delete C[v]);}}}-const YS = {- [Bu]: Tu,- [Ru]: Du,- [Nu]: Lu,- [ma]: Fu,- [Tu]: Bu,- [Du]: Ru,- [Lu]: Nu,- [Fu]: ma+const iI = {+ [Lu]: Pu,+ [ku]: Qu,+ [Uu]: Gu,+ [_a]: Ou,+ [Pu]: Lu,+ [Qu]: ku,+ [Gu]: Uu,+ [Ou]: _a};-function jS(i, e) {+function sI(i, e) {function t() {let W = !1;const ne = new wt();@@ -21422,8 +21422,8 @@ function jS(i, e) {setLocked: function(Ie) {W = Ie;},- setClear: function(Ie, ve, nt, Ut, fn) {- fn === !0 && (Ie *= Ut, ve *= Ut, nt *= Ut), ne.set(Ie, ve, nt, Ut), de.equals(ne) === !1 && (i.clearColor(Ie, ve, nt, Ut), de.copy(ne));+ setClear: function(Ie, Ce, nt, Ut, fn) {+ fn === !0 && (Ie *= Ut, Ce *= Ut, nt *= Ut), ne.set(Ie, Ce, nt, Ut), de.equals(ne) === !1 && (i.clearColor(Ie, Ce, nt, Ut), de.copy(ne));},reset: function() {W = !1, re = null, de.set(-1, 0, 0, 0);@@ -21433,10 +21433,10 @@ function jS(i, e) {function n() {let W = !1, ne = !1, re = null, de = null, Ie = null;return {- setReversed: function(ve) {- if (ne !== ve) {+ setReversed: function(Ce) {+ if (ne !== Ce) {const nt = e.get("EXT_clip_control");- ve ? nt.clipControlEXT(nt.LOWER_LEFT_EXT, nt.ZERO_TO_ONE_EXT) : nt.clipControlEXT(nt.LOWER_LEFT_EXT, nt.NEGATIVE_ONE_TO_ONE_EXT), ne = ve;+ Ce ? nt.clipControlEXT(nt.LOWER_LEFT_EXT, nt.ZERO_TO_ONE_EXT) : nt.clipControlEXT(nt.LOWER_LEFT_EXT, nt.NEGATIVE_ONE_TO_ONE_EXT), ne = Ce;const Ut = Ie;Ie = null, this.setClear(Ut);}@@ -21444,50 +21444,50 @@ function jS(i, e) {getReversed: function() {return ne;},- setTest: function(ve) {- ve ? xe(i.DEPTH_TEST) : Pe(i.DEPTH_TEST);+ setTest: function(Ce) {+ Ce ? xe(i.DEPTH_TEST) : Pe(i.DEPTH_TEST);},- setMask: function(ve) {- re !== ve && !W && (i.depthMask(ve), re = ve);+ setMask: function(Ce) {+ re !== Ce && !W && (i.depthMask(Ce), re = Ce);},- setFunc: function(ve) {- if (ne && (ve = YS[ve]), de !== ve) {- switch (ve) {- case Bu:+ setFunc: function(Ce) {+ if (ne && (Ce = iI[Ce]), de !== Ce) {+ switch (Ce) {+ case Lu:i.depthFunc(i.NEVER);break;- case Tu:+ case Pu:i.depthFunc(i.ALWAYS);break;- case Ru:+ case ku:i.depthFunc(i.LESS);break;- case ma:+ case _a:i.depthFunc(i.LEQUAL);break;- case Nu:+ case Uu:i.depthFunc(i.EQUAL);break;- case Fu:+ case Ou:i.depthFunc(i.GEQUAL);break;- case Du:+ case Qu:i.depthFunc(i.GREATER);break;- case Lu:+ case Gu:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL);}- de = ve;+ de = Ce;}},- setLocked: function(ve) {- W = ve;+ setLocked: function(Ce) {+ W = Ce;},- setClear: function(ve) {- Ie !== ve && (ne && (ve = 1 - ve), i.clearDepth(ve), Ie = ve);+ setClear: function(Ce) {+ Ie !== Ce && (ne && (Ce = 1 - Ce), i.clearDepth(Ce), Ie = Ce);},reset: function() {W = !1, re = null, de = null, Ie = null, ne = !1;@@ -21495,7 +21495,7 @@ function jS(i, e) {};}function s() {- let W = !1, ne = null, re = null, de = null, Ie = null, ve = null, nt = null, Ut = null, fn = null;+ let W = !1, ne = null, re = null, de = null, Ie = null, Ce = null, nt = null, Ut = null, fn = null;return {setTest: function(_t) {W || (_t ? xe(i.STENCIL_TEST) : Pe(i.STENCIL_TEST));@@ -21503,11 +21503,11 @@ function jS(i, e) {setMask: function(_t) {ne !== _t && !W && (i.stencilMask(_t), ne = _t);},- setFunc: function(_t, zn, ri) {- (re !== _t || de !== zn || Ie !== ri) && (i.stencilFunc(_t, zn, ri), re = _t, de = zn, Ie = ri);+ setFunc: function(_t, zn, ai) {+ (re !== _t || de !== zn || Ie !== ai) && (i.stencilFunc(_t, zn, ai), re = _t, de = zn, Ie = ai);},- setOp: function(_t, zn, ri) {- (ve !== _t || nt !== zn || Ut !== ri) && (i.stencilOp(_t, zn, ri), ve = _t, nt = zn, Ut = ri);+ setOp: function(_t, zn, ai) {+ (Ce !== _t || nt !== zn || Ut !== ai) && (i.stencilOp(_t, zn, ai), Ce = _t, nt = zn, Ut = ai);},setLocked: function(_t) {W = _t;@@ -21516,27 +21516,27 @@ function jS(i, e) {fn !== _t && (i.clearStencil(_t), fn = _t);},reset: function() {- W = !1, ne = null, re = null, de = null, Ie = null, ve = null, nt = null, Ut = null, fn = null;+ W = !1, ne = null, re = null, de = null, Ie = null, Ce = null, nt = null, Ut = null, fn = null;}};}const r = new t(), a = new n(), o = new s(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();- let h = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], m = null, g = !1, A = null, p = null, y = null, b = null, _ = null, M = null, w = null, S = new Xe(0, 0, 0), T = 0, v = !1, C = null, F = null, K = null, q = null, $ = null;+ let h = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], m = null, g = !1, A = null, p = null, y = null, b = null, _ = null, M = null, w = null, S = new je(0, 0, 0), T = 0, C = !1, v = null, F = null, K = null, q = null, $ = null;const D = i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);- let O = !1, j = 0;+ let O = !1, Y = 0;const Q = i.getParameter(i.VERSION);- Q.indexOf("WebGL") !== -1 ? (j = parseFloat(/^WebGL (\d)/.exec(Q)[1]), O = j >= 1) : Q.indexOf("OpenGL ES") !== -1 && (j = parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]), O = j >= 2);+ Q.indexOf("WebGL") !== -1 ? (Y = parseFloat(/^WebGL (\d)/.exec(Q)[1]), O = Y >= 1) : Q.indexOf("OpenGL ES") !== -1 && (Y = parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]), O = Y >= 2);let J = null, ee = {};const ae = i.getParameter(i.SCISSOR_BOX), ye = i.getParameter(i.VIEWPORT), Me = new wt().fromArray(ae), se = new wt().fromArray(ye);function me(W, ne, re, de) {- const Ie = new Uint8Array(4), ve = i.createTexture();- i.bindTexture(W, ve), i.texParameteri(W, i.TEXTURE_MIN_FILTER, i.NEAREST), i.texParameteri(W, i.TEXTURE_MAG_FILTER, i.NEAREST);+ const Ie = new Uint8Array(4), Ce = i.createTexture();+ i.bindTexture(W, Ce), i.texParameteri(W, i.TEXTURE_MIN_FILTER, i.NEAREST), i.texParameteri(W, i.TEXTURE_MAG_FILTER, i.NEAREST);for (let nt = 0; nt < re; nt++)W === i.TEXTURE_3D || W === i.TEXTURE_2D_ARRAY ? i.texImage3D(ne, 0, i.RGBA, 1, 1, de, 0, i.RGBA, i.UNSIGNED_BYTE, Ie) : i.texImage2D(ne + nt, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, Ie);- return ve;+ return Ce;}const be = {};- be[i.TEXTURE_2D] = me(i.TEXTURE_2D, i.TEXTURE_2D, 1), be[i.TEXTURE_CUBE_MAP] = me(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), be[i.TEXTURE_2D_ARRAY] = me(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), be[i.TEXTURE_3D] = me(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), xe(i.DEPTH_TEST), a.setFunc(ma), dt(!1), pt(Zf), xe(i.CULL_FACE), G(Fs);+ be[i.TEXTURE_2D] = me(i.TEXTURE_2D, i.TEXTURE_2D, 1), be[i.TEXTURE_CUBE_MAP] = me(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), be[i.TEXTURE_2D_ARRAY] = me(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), be[i.TEXTURE_3D] = me(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), xe(i.DEPTH_TEST), a.setFunc(_a), dt(!1), pt(sp), xe(i.CULL_FACE), G(Ds);function xe(W) {h[W] !== !0 && (i.enable(W), h[W] = !0);}@@ -21552,59 +21552,59 @@ function jS(i, e) {re = d.get(ne), re === void 0 && (re = [], d.set(ne, re));const Ie = W.textures;if (re.length !== Ie.length || re[0] !== i.COLOR_ATTACHMENT0) {- for (let ve = 0, nt = Ie.length; ve < nt; ve++)- re[ve] = i.COLOR_ATTACHMENT0 + ve;+ for (let Ce = 0, nt = Ie.length; Ce < nt; Ce++)+ re[Ce] = i.COLOR_ATTACHMENT0 + Ce;re.length = Ie.length, de = !0;}} elsere[0] !== i.BACK && (re[0] = i.BACK, de = !0);de && i.drawBuffers(re);}- function Ct(W) {+ function vt(W) {return m !== W ? (i.useProgram(W), m = W, !0) : !1;}const lt = {- [ir]: i.FUNC_ADD,- [eE]: i.FUNC_SUBTRACT,- [tE]: i.FUNC_REVERSE_SUBTRACT+ [rr]: i.FUNC_ADD,+ [cE]: i.FUNC_SUBTRACT,+ [lE]: i.FUNC_REVERSE_SUBTRACT};- lt[nE] = i.MIN, lt[iE] = i.MAX;+ lt[hE] = i.MIN, lt[uE] = i.MAX;const Je = {- [sE]: i.ZERO,- [rE]: i.ONE,- [aE]: i.SRC_COLOR,- [Iu]: i.SRC_ALPHA,- [dE]: i.SRC_ALPHA_SATURATE,- [hE]: i.DST_COLOR,- [cE]: i.DST_ALPHA,- [oE]: i.ONE_MINUS_SRC_COLOR,- [Mu]: i.ONE_MINUS_SRC_ALPHA,- [uE]: i.ONE_MINUS_DST_COLOR,- [lE]: i.ONE_MINUS_DST_ALPHA,- [fE]: i.CONSTANT_COLOR,- [pE]: i.ONE_MINUS_CONSTANT_COLOR,- [AE]: i.CONSTANT_ALPHA,- [gE]: i.ONE_MINUS_CONSTANT_ALPHA+ [dE]: i.ZERO,+ [fE]: i.ONE,+ [pE]: i.SRC_COLOR,+ [Fu]: i.SRC_ALPHA,+ [EE]: i.SRC_ALPHA_SATURATE,+ [bE]: i.DST_COLOR,+ [gE]: i.DST_ALPHA,+ [AE]: i.ONE_MINUS_SRC_COLOR,+ [Du]: i.ONE_MINUS_SRC_ALPHA,+ [xE]: i.ONE_MINUS_DST_COLOR,+ [mE]: i.ONE_MINUS_DST_ALPHA,+ [_E]: i.CONSTANT_COLOR,+ [yE]: i.ONE_MINUS_CONSTANT_COLOR,+ [wE]: i.CONSTANT_ALPHA,+ [vE]: i.ONE_MINUS_CONSTANT_ALPHA};- function G(W, ne, re, de, Ie, ve, nt, Ut, fn, _t) {- if (W === Fs) {+ function G(W, ne, re, de, Ie, Ce, nt, Ut, fn, _t) {+ if (W === Ds) {g === !0 && (Pe(i.BLEND), g = !1);return;}- if (g === !1 && (xe(i.BLEND), g = !0), W !== $x) {- if (W !== A || _t !== v) {- if ((p !== ir || _ !== ir) && (i.blendEquation(i.FUNC_ADD), p = ir, _ = ir), _t)+ if (g === !1 && (xe(i.BLEND), g = !0), W !== oE) {+ if (W !== A || _t !== C) {+ if ((p !== rr || _ !== rr) && (i.blendEquation(i.FUNC_ADD), p = rr, _ = rr), _t)switch (W) {- case ca:+ case ha:i.blendFuncSeparate(i.ONE, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);break;- case $f:+ case rp:i.blendFunc(i.ONE, i.ONE);break;- case ep:+ case ap:i.blendFuncSeparate(i.ZERO, i.ONE_MINUS_SRC_COLOR, i.ZERO, i.ONE);break;- case tp:+ case op:i.blendFuncSeparate(i.ZERO, i.SRC_COLOR, i.ZERO, i.SRC_ALPHA);break;default:@@ -21613,40 +21613,40 @@ function jS(i, e) {}elseswitch (W) {- case ca:+ case ha:i.blendFuncSeparate(i.SRC_ALPHA, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);break;- case $f:+ case rp:i.blendFunc(i.SRC_ALPHA, i.ONE);break;- case ep:+ case ap:i.blendFuncSeparate(i.ZERO, i.ONE_MINUS_SRC_COLOR, i.ZERO, i.ONE);break;- case tp:+ case op:i.blendFunc(i.ZERO, i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ", W);break;}- y = null, b = null, M = null, w = null, S.set(0, 0, 0), T = 0, A = W, v = _t;+ y = null, b = null, M = null, w = null, S.set(0, 0, 0), T = 0, A = W, C = _t;}return;}- Ie = Ie || ne, ve = ve || re, nt = nt || de, (ne !== p || Ie !== _) && (i.blendEquationSeparate(lt[ne], lt[Ie]), p = ne, _ = Ie), (re !== y || de !== b || ve !== M || nt !== w) && (i.blendFuncSeparate(Je[re], Je[de], Je[ve], Je[nt]), y = re, b = de, M = ve, w = nt), (Ut.equals(S) === !1 || fn !== T) && (i.blendColor(Ut.r, Ut.g, Ut.b, fn), S.copy(Ut), T = fn), A = W, v = !1;+ Ie = Ie || ne, Ce = Ce || re, nt = nt || de, (ne !== p || Ie !== _) && (i.blendEquationSeparate(lt[ne], lt[Ie]), p = ne, _ = Ie), (re !== y || de !== b || Ce !== M || nt !== w) && (i.blendFuncSeparate(Je[re], Je[de], Je[Ce], Je[nt]), y = re, b = de, M = Ce, w = nt), (Ut.equals(S) === !1 || fn !== T) && (i.blendColor(Ut.r, Ut.g, Ut.b, fn), S.copy(Ut), T = fn), A = W, C = !1;}function dn(W, ne) {- W.side === Bi ? Pe(i.CULL_FACE) : xe(i.CULL_FACE);+ W.side === Ti ? Pe(i.CULL_FACE) : xe(i.CULL_FACE);let re = W.side === Ln;- ne && (re = !re), dt(re), W.blending === ca && W.transparent === !1 ? G(Fs) : G(W.blending, W.blendEquation, W.blendSrc, W.blendDst, W.blendEquationAlpha, W.blendSrcAlpha, W.blendDstAlpha, W.blendColor, W.blendAlpha, W.premultipliedAlpha), a.setFunc(W.depthFunc), a.setTest(W.depthTest), a.setMask(W.depthWrite), r.setMask(W.colorWrite);+ ne && (re = !re), dt(re), W.blending === ha && W.transparent === !1 ? G(Ds) : G(W.blending, W.blendEquation, W.blendSrc, W.blendDst, W.blendEquationAlpha, W.blendSrcAlpha, W.blendDstAlpha, W.blendColor, W.blendAlpha, W.premultipliedAlpha), a.setFunc(W.depthFunc), a.setTest(W.depthTest), a.setMask(W.depthWrite), r.setMask(W.colorWrite);const de = W.stencilWrite;o.setTest(de), de && (o.setMask(W.stencilWriteMask), o.setFunc(W.stencilFunc, W.stencilRef, W.stencilFuncMask), o.setOp(W.stencilFail, W.stencilZFail, W.stencilZPass)), Rt(W.polygonOffset, W.polygonOffsetFactor, W.polygonOffsetUnits), W.alphaToCoverage === !0 ? xe(i.SAMPLE_ALPHA_TO_COVERAGE) : Pe(i.SAMPLE_ALPHA_TO_COVERAGE);}function dt(W) {- C !== W && (W ? i.frontFace(i.CW) : i.frontFace(i.CCW), C = W);+ v !== W && (W ? i.frontFace(i.CW) : i.frontFace(i.CCW), v = W);}function pt(W) {- W !== jx ? (xe(i.CULL_FACE), W !== F && (W === Zf ? i.cullFace(i.BACK) : W === Jx ? i.cullFace(i.FRONT) : i.cullFace(i.FRONT_AND_BACK))) : Pe(i.CULL_FACE), F = W;+ W !== sE ? (xe(i.CULL_FACE), W !== F && (W === sp ? i.cullFace(i.BACK) : W === rE ? i.cullFace(i.FRONT) : i.cullFace(i.FRONT_AND_BACK))) : Pe(i.CULL_FACE), F = W;}function ze(W) {W !== K && (O && i.lineWidth(W), K = W);@@ -21697,7 +21697,7 @@ function jS(i, e) {console.error("THREE.WebGLState:", W);}}- function Ce() {+ function ve() {try {i.compressedTexSubImage2D(...arguments);} catch (W) {@@ -21711,7 +21711,7 @@ function jS(i, e) {console.error("THREE.WebGLState:", W);}}- function je() {+ function Ye() {try {i.texStorage2D(...arguments);} catch (W) {@@ -21756,7 +21756,7 @@ function jS(i, e) {c.get(ne) !== de && (i.uniformBlockBinding(ne, de, W.__bindingPointIndex), c.set(ne, de));}function tt() {- i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), a.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), h = {}, J = null, ee = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], m = null, g = !1, A = null, p = null, y = null, b = null, _ = null, M = null, w = null, S = new Xe(0, 0, 0), T = 0, v = !1, C = null, F = null, K = null, q = null, $ = null, Me.set(0, 0, i.canvas.width, i.canvas.height), se.set(0, 0, i.canvas.width, i.canvas.height), r.reset(), a.reset(), o.reset();+ i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), a.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), h = {}, J = null, ee = {}, u = {}, d = /* @__PURE__ */ new WeakMap(), f = [], m = null, g = !1, A = null, p = null, y = null, b = null, _ = null, M = null, w = null, S = new je(0, 0, 0), T = 0, C = !1, v = null, F = null, K = null, q = null, $ = null, Me.set(0, 0, i.canvas.width, i.canvas.height), se.set(0, 0, i.canvas.width, i.canvas.height), r.reset(), a.reset(), o.reset();}return {buffers: {@@ -21768,7 +21768,7 @@ function jS(i, e) {disable: Pe,bindFramebuffer: $e,drawBuffers: Qe,- useProgram: Ct,+ useProgram: vt,setBlending: G,setMaterial: dn,setFlipSided: dt,@@ -21785,18 +21785,18 @@ function jS(i, e) {texImage3D: ke,updateUBOMapping: et,uniformBlockBinding: We,- texStorage2D: je,+ texStorage2D: Ye,texStorage3D: Ee,texSubImage2D: oe,texSubImage3D: Ue,- compressedTexSubImage2D: Ce,+ compressedTexSubImage2D: ve,compressedTexSubImage3D: Ve,scissor: Oe,viewport: Be,reset: tt};}-function JS(i, e, t, n, s, r, a) {+function rI(i, e, t, n, s, r, a) {const o = e.has("WEBGL_multisampled_render_to_texture") ? e.get("WEBGL_multisampled_render_to_texture") : null, c = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), l = new Ze(), h = /* @__PURE__ */ new WeakMap();let u;const d = /* @__PURE__ */ new WeakMap();@@ -21809,7 +21809,7 @@ function JS(i, e, t, n, s, r, a) {return f ? (// eslint-disable-next-line compat/compatnew OffscreenCanvas(L, I)- ) : Ro("canvas");+ ) : Lo("canvas");}function g(L, I, Z) {let le = 1;@@ -21818,8 +21818,8 @@ function JS(i, e, t, n, s, r, a) {if (typeof HTMLImageElement < "u" && L instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && L instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && L instanceof ImageBitmap || typeof VideoFrame < "u" && L instanceof VideoFrame) {const oe = Math.floor(le * pe.width), Ue = Math.floor(le * pe.height);u === void 0 && (u = m(oe, Ue));- const Ce = I ? m(oe, Ue) : u;- return Ce.width = oe, Ce.height = Ue, Ce.getContext("2d").drawImage(L, 0, 0, oe, Ue), console.warn("THREE.WebGLRenderer: Texture has been resized from (" + pe.width + "x" + pe.height + ") to (" + oe + "x" + Ue + ")."), Ce;+ const ve = I ? m(oe, Ue) : u;+ return ve.width = oe, ve.height = Ue, ve.getContext("2d").drawImage(L, 0, 0, oe, Ue), console.warn("THREE.WebGLRenderer: Texture has been resized from (" + pe.width + "x" + pe.height + ") to (" + oe + "x" + Ue + ")."), ve;} elsereturn "data" in L && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + pe.width + "x" + pe.height + ")."), L;return L;@@ -21840,14 +21840,14 @@ function JS(i, e, t, n, s, r, a) {}let oe = I;if (I === i.RED && (Z === i.FLOAT && (oe = i.R32F), Z === i.HALF_FLOAT && (oe = i.R16F), Z === i.UNSIGNED_BYTE && (oe = i.R8)), I === i.RED_INTEGER && (Z === i.UNSIGNED_BYTE && (oe = i.R8UI), Z === i.UNSIGNED_SHORT && (oe = i.R16UI), Z === i.UNSIGNED_INT && (oe = i.R32UI), Z === i.BYTE && (oe = i.R8I), Z === i.SHORT && (oe = i.R16I), Z === i.INT && (oe = i.R32I)), I === i.RG && (Z === i.FLOAT && (oe = i.RG32F), Z === i.HALF_FLOAT && (oe = i.RG16F), Z === i.UNSIGNED_BYTE && (oe = i.RG8)), I === i.RG_INTEGER && (Z === i.UNSIGNED_BYTE && (oe = i.RG8UI), Z === i.UNSIGNED_SHORT && (oe = i.RG16UI), Z === i.UNSIGNED_INT && (oe = i.RG32UI), Z === i.BYTE && (oe = i.RG8I), Z === i.SHORT && (oe = i.RG16I), Z === i.INT && (oe = i.RG32I)), I === i.RGB_INTEGER && (Z === i.UNSIGNED_BYTE && (oe = i.RGB8UI), Z === i.UNSIGNED_SHORT && (oe = i.RGB16UI), Z === i.UNSIGNED_INT && (oe = i.RGB32UI), Z === i.BYTE && (oe = i.RGB8I), Z === i.SHORT && (oe = i.RGB16I), Z === i.INT && (oe = i.RGB32I)), I === i.RGBA_INTEGER && (Z === i.UNSIGNED_BYTE && (oe = i.RGBA8UI), Z === i.UNSIGNED_SHORT && (oe = i.RGBA16UI), Z === i.UNSIGNED_INT && (oe = i.RGBA32UI), Z === i.BYTE && (oe = i.RGBA8I), Z === i.SHORT && (oe = i.RGBA16I), Z === i.INT && (oe = i.RGBA32I)), I === i.RGB && Z === i.UNSIGNED_INT_5_9_9_9_REV && (oe = i.RGB9_E5), I === i.RGBA) {- const Ue = pe ? bl : mt.getTransfer(le);+ const Ue = pe ? wl : mt.getTransfer(le);Z === i.FLOAT && (oe = i.RGBA32F), Z === i.HALF_FLOAT && (oe = i.RGBA16F), Z === i.UNSIGNED_BYTE && (oe = Ue === Mt ? i.SRGB8_ALPHA8 : i.RGBA8), Z === i.UNSIGNED_SHORT_4_4_4_4 && (oe = i.RGBA4), Z === i.UNSIGNED_SHORT_5_5_5_1 && (oe = i.RGB5_A1);}return (oe === i.R16F || oe === i.R32F || oe === i.RG16F || oe === i.RG32F || oe === i.RGBA16F || oe === i.RGBA32F) && e.get("EXT_color_buffer_float"), oe;}function _(L, I) {let Z;- return L ? I === null || I === mr || I === Co ? Z = i.DEPTH24_STENCIL8 : I === an ? Z = i.DEPTH32F_STENCIL8 : I === wo && (Z = i.DEPTH24_STENCIL8, console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : I === null || I === mr || I === Co ? Z = i.DEPTH_COMPONENT24 : I === an ? Z = i.DEPTH_COMPONENT32F : I === wo && (Z = i.DEPTH_COMPONENT16), Z;+ return L ? I === null || I === xr || I === Mo ? Z = i.DEPTH24_STENCIL8 : I === an ? Z = i.DEPTH32F_STENCIL8 : I === Io && (Z = i.DEPTH24_STENCIL8, console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : I === null || I === xr || I === Mo ? Z = i.DEPTH_COMPONENT24 : I === an ? Z = i.DEPTH_COMPONENT32F : I === Io && (Z = i.DEPTH_COMPONENT16), Z;}function M(L, I) {return A(L) === !0 || L.isFramebufferTexture && L.minFilter !== Pn && L.minFilter !== qt ? Math.log2(Math.max(I.width, I.height)) + 1 : L.mipmaps !== void 0 && L.mipmaps.length > 0 ? L.mipmaps.length : L.isCompressedTexture && Array.isArray(L.image) ? I.mipmaps.length : 1;@@ -21858,7 +21858,7 @@ function JS(i, e, t, n, s, r, a) {}function S(L) {const I = L.target;- I.removeEventListener("dispose", S), C(I);+ I.removeEventListener("dispose", S), v(I);}function T(L) {const I = n.get(L);@@ -21866,17 +21866,17 @@ function JS(i, e, t, n, s, r, a) {const Z = L.source, le = d.get(Z);if (le) {const pe = le[I.__cacheKey];- pe.usedTimes--, pe.usedTimes === 0 && v(L), Object.keys(le).length === 0 && d.delete(Z);+ pe.usedTimes--, pe.usedTimes === 0 && C(L), Object.keys(le).length === 0 && d.delete(Z);}n.remove(L);}- function v(L) {+ function C(L) {const I = n.get(L);i.deleteTexture(I.__webglTexture);const Z = L.source, le = d.get(Z);delete le[I.__cacheKey], a.memory.textures--;}- function C(L) {+ function v(L) {const I = n.get(L);if (L.depthTexture && (L.depthTexture.dispose(), n.remove(L.depthTexture)), L.isWebGLCubeRenderTarget)for (let le = 0; le < 6; le++) {@@ -21938,7 +21938,7 @@ function JS(i, e, t, n, s, r, a) {}t.bindTexture(i.TEXTURE_2D_ARRAY, Z.__webglTexture, i.TEXTURE0 + I);}- function j(L, I) {+ function Y(L, I) {const Z = n.get(L);if (L.version > 0 && Z.__version !== L.version) {se(Z, L, I);@@ -21955,29 +21955,29 @@ function JS(i, e, t, n, s, r, a) {t.bindTexture(i.TEXTURE_CUBE_MAP, Z.__webglTexture, i.TEXTURE0 + I);}const J = {- [xa]: i.REPEAT,- [bi]: i.CLAMP_TO_EDGE,- [hl]: i.MIRRORED_REPEAT+ [wa]: i.REPEAT,+ [xi]: i.CLAMP_TO_EDGE,+ [Al]: i.MIRRORED_REPEAT}, ee = {[Pn]: i.NEAREST,- [vm]: i.NEAREST_MIPMAP_NEAREST,- [ro]: i.NEAREST_MIPMAP_LINEAR,+ [Nm]: i.NEAREST_MIPMAP_NEAREST,+ [lo]: i.NEAREST_MIPMAP_LINEAR,[qt]: i.LINEAR,- [el]: i.LINEAR_MIPMAP_NEAREST,- [ni]: i.LINEAR_MIPMAP_LINEAR+ [rl]: i.LINEAR_MIPMAP_NEAREST,+ [ii]: i.LINEAR_MIPMAP_LINEAR}, ae = {- [RE]: i.NEVER,- [kE]: i.ALWAYS,- [NE]: i.LESS,- [Pm]: i.LEQUAL,- [FE]: i.EQUAL,- [PE]: i.GEQUAL,- [DE]: i.GREATER,- [LE]: i.NOTEQUAL+ [OE]: i.NEVER,+ [WE]: i.ALWAYS,+ [QE]: i.LESS,+ [zm]: i.LEQUAL,+ [GE]: i.EQUAL,+ [VE]: i.GEQUAL,+ [HE]: i.GREATER,+ [zE]: i.NOTEQUAL};function ye(L, I) {- if (I.type === an && e.has("OES_texture_float_linear") === !1 && (I.magFilter === qt || I.magFilter === el || I.magFilter === ro || I.magFilter === ni || I.minFilter === qt || I.minFilter === el || I.minFilter === ro || I.minFilter === ni) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), i.texParameteri(L, i.TEXTURE_WRAP_S, J[I.wrapS]), i.texParameteri(L, i.TEXTURE_WRAP_T, J[I.wrapT]), (L === i.TEXTURE_3D || L === i.TEXTURE_2D_ARRAY) && i.texParameteri(L, i.TEXTURE_WRAP_R, J[I.wrapR]), i.texParameteri(L, i.TEXTURE_MAG_FILTER, ee[I.magFilter]), i.texParameteri(L, i.TEXTURE_MIN_FILTER, ee[I.minFilter]), I.compareFunction && (i.texParameteri(L, i.TEXTURE_COMPARE_MODE, i.COMPARE_REF_TO_TEXTURE), i.texParameteri(L, i.TEXTURE_COMPARE_FUNC, ae[I.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {- if (I.magFilter === Pn || I.minFilter !== ro && I.minFilter !== ni || I.type === an && e.has("OES_texture_float_linear") === !1) return;+ if (I.type === an && e.has("OES_texture_float_linear") === !1 && (I.magFilter === qt || I.magFilter === rl || I.magFilter === lo || I.magFilter === ii || I.minFilter === qt || I.minFilter === rl || I.minFilter === lo || I.minFilter === ii) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), i.texParameteri(L, i.TEXTURE_WRAP_S, J[I.wrapS]), i.texParameteri(L, i.TEXTURE_WRAP_T, J[I.wrapT]), (L === i.TEXTURE_3D || L === i.TEXTURE_2D_ARRAY) && i.texParameteri(L, i.TEXTURE_WRAP_R, J[I.wrapR]), i.texParameteri(L, i.TEXTURE_MAG_FILTER, ee[I.magFilter]), i.texParameteri(L, i.TEXTURE_MIN_FILTER, ee[I.minFilter]), I.compareFunction && (i.texParameteri(L, i.TEXTURE_COMPARE_MODE, i.COMPARE_REF_TO_TEXTURE), i.texParameteri(L, i.TEXTURE_COMPARE_FUNC, ae[I.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {+ if (I.magFilter === Pn || I.minFilter !== lo && I.minFilter !== ii || I.type === an && e.has("OES_texture_float_linear") === !1) return;if (I.anisotropy > 1 || n.get(I).__currentAnisotropy) {const Z = e.get("EXT_texture_filter_anisotropic");i.texParameterf(L, Z.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(I.anisotropy, s.getMaxAnisotropy())), n.get(I).__currentAnisotropy = I.anisotropy;@@ -21997,7 +21997,7 @@ function JS(i, e, t, n, s, r, a) {usedTimes: 0}, a.memory.textures++, Z = !0), pe[oe].usedTimes++;const Ue = pe[L.__cacheKey];- Ue !== void 0 && (pe[L.__cacheKey].usedTimes--, Ue.usedTimes === 0 && v(I)), L.__cacheKey = oe, L.__webglTexture = pe[oe].texture;+ Ue !== void 0 && (pe[L.__cacheKey].usedTimes--, Ue.usedTimes === 0 && C(I)), L.__cacheKey = oe, L.__webglTexture = pe[oe].texture;}return Z;}@@ -22009,8 +22009,8 @@ function JS(i, e, t, n, s, r, a) {const Ue = n.get(oe);if (oe.version !== Ue.__version || pe === !0) {t.activeTexture(i.TEXTURE0 + Z);- const Ce = mt.getPrimaries(mt.workingColorSpace), Ve = I.colorSpace === pi ? null : mt.getPrimaries(I.colorSpace), je = I.colorSpace === pi || Ce === Ve ? i.NONE : i.BROWSER_DEFAULT_WEBGL;- i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, I.flipY), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, I.premultiplyAlpha), i.pixelStorei(i.UNPACK_ALIGNMENT, I.unpackAlignment), i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL, je);+ const ve = mt.getPrimaries(mt.workingColorSpace), Ve = I.colorSpace === Ai ? null : mt.getPrimaries(I.colorSpace), Ye = I.colorSpace === Ai || ve === Ve ? i.NONE : i.BROWSER_DEFAULT_WEBGL;+ i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, I.flipY), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, I.premultiplyAlpha), i.pixelStorei(i.UNPACK_ALIGNMENT, I.unpackAlignment), i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL, Ye);let Ee = g(I.image, !1, s.maxTextureSize);Ee = Rt(I, Ee);const Re = r.convert(I.format, I.colorSpace), ke = r.convert(I.type);@@ -22019,7 +22019,7 @@ function JS(i, e, t, n, s, r, a) {let Be;const et = I.mipmaps, We = I.isVideoTexture !== !0, tt = Ue.__version === void 0 || pe === !0, W = oe.dataReady, ne = M(I, Ee);if (I.isDepthTexture)- Oe = _(I.format === So, I.type), tt && (We ? t.texStorage2D(i.TEXTURE_2D, 1, Oe, Ee.width, Ee.height) : t.texImage2D(i.TEXTURE_2D, 0, Oe, Ee.width, Ee.height, 0, Re, ke, null));+ Oe = _(I.format === To, I.type), tt && (We ? t.texStorage2D(i.TEXTURE_2D, 1, Oe, Ee.width, Ee.height) : t.texImage2D(i.TEXTURE_2D, 0, Oe, Ee.width, Ee.height, 0, Re, ke, null));else if (I.isDataTexture)if (et.length > 0) {We && tt && t.texStorage2D(i.TEXTURE_2D, ne, Oe, et[0].width, et[0].height);@@ -22037,13 +22037,13 @@ function JS(i, e, t, n, s, r, a) {if (We) {if (W)if (I.layerUpdates.size > 0) {- const Ie = Vp(Be.width, Be.height, I.format, I.type);- for (const ve of I.layerUpdates) {+ const Ie = Yp(Be.width, Be.height, I.format, I.type);+ for (const Ce of I.layerUpdates) {const nt = Be.data.subarray(- ve * Ie / Be.data.BYTES_PER_ELEMENT,- (ve + 1) * Ie / Be.data.BYTES_PER_ELEMENT+ Ce * Ie / Be.data.BYTES_PER_ELEMENT,+ (Ce + 1) * Ie / Be.data.BYTES_PER_ELEMENT);- t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY, re, 0, 0, ve, Be.width, Be.height, 1, Re, nt);+ t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY, re, 0, 0, Ce, Be.width, Be.height, 1, Re, nt);}I.clearLayerUpdates();} else@@ -22063,7 +22063,7 @@ function JS(i, e, t, n, s, r, a) {if (We) {if (tt && t.texStorage3D(i.TEXTURE_2D_ARRAY, ne, Oe, Ee.width, Ee.height, Ee.depth), W)if (I.layerUpdates.size > 0) {- const re = Vp(Ee.width, Ee.height, I.format, I.type);+ const re = Yp(Ee.width, Ee.height, I.format, I.type);for (const de of I.layerUpdates) {const Ie = Ee.data.subarray(de * re / Ee.data.BYTES_PER_ELEMENT,@@ -22114,22 +22114,22 @@ function JS(i, e, t, n, s, r, a) {const oe = n.get(pe);if (pe.version !== oe.__version || le === !0) {t.activeTexture(i.TEXTURE0 + Z);- const Ue = mt.getPrimaries(mt.workingColorSpace), Ce = I.colorSpace === pi ? null : mt.getPrimaries(I.colorSpace), Ve = I.colorSpace === pi || Ue === Ce ? i.NONE : i.BROWSER_DEFAULT_WEBGL;+ const Ue = mt.getPrimaries(mt.workingColorSpace), ve = I.colorSpace === Ai ? null : mt.getPrimaries(I.colorSpace), Ve = I.colorSpace === Ai || Ue === ve ? i.NONE : i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, I.flipY), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, I.premultiplyAlpha), i.pixelStorei(i.UNPACK_ALIGNMENT, I.unpackAlignment), i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL, Ve);- const je = I.isCompressedTexture || I.image[0].isCompressedTexture, Ee = I.image[0] && I.image[0].isDataTexture, Re = [];+ const Ye = I.isCompressedTexture || I.image[0].isCompressedTexture, Ee = I.image[0] && I.image[0].isDataTexture, Re = [];for (let de = 0; de < 6; de++)- !je && !Ee ? Re[de] = g(I.image[de], !0, s.maxCubemapSize) : Re[de] = Ee ? I.image[de].image : I.image[de], Re[de] = Rt(I, Re[de]);+ !Ye && !Ee ? Re[de] = g(I.image[de], !0, s.maxCubemapSize) : Re[de] = Ee ? I.image[de].image : I.image[de], Re[de] = Rt(I, Re[de]);const ke = Re[0], Oe = r.convert(I.format, I.colorSpace), Be = r.convert(I.type), et = b(I.internalFormat, Oe, Be, I.colorSpace), We = I.isVideoTexture !== !0, tt = oe.__version === void 0 || le === !0, W = pe.dataReady;let ne = M(I, ke);ye(i.TEXTURE_CUBE_MAP, I);let re;- if (je) {+ if (Ye) {We && tt && t.texStorage2D(i.TEXTURE_CUBE_MAP, ne, et, ke.width, ke.height);for (let de = 0; de < 6; de++) {re = Re[de].mipmaps;for (let Ie = 0; Ie < re.length; Ie++) {- const ve = re[Ie];- I.format !== on ? Oe !== null ? We ? W && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, 0, 0, ve.width, ve.height, Oe, ve.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, et, ve.width, ve.height, 0, ve.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : We ? W && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, 0, 0, ve.width, ve.height, Oe, Be, ve.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, et, ve.width, ve.height, 0, Oe, Be, ve.data);+ const Ce = re[Ie];+ I.format !== on ? Oe !== null ? We ? W && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, 0, 0, Ce.width, Ce.height, Oe, Ce.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, et, Ce.width, Ce.height, 0, Ce.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : We ? W && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, 0, 0, Ce.width, Ce.height, Oe, Be, Ce.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie, et, Ce.width, Ce.height, 0, Oe, Be, Ce.data);}}} else {@@ -22148,8 +22148,8 @@ function JS(i, e, t, n, s, r, a) {} else {We ? W && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, 0, 0, 0, Oe, Be, Re[de]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, 0, et, Oe, Be, Re[de]);for (let Ie = 0; Ie < re.length; Ie++) {- const ve = re[Ie];- We ? W && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie + 1, 0, 0, Oe, Be, ve.image[de]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie + 1, et, Oe, Be, ve.image[de]);+ const Ce = re[Ie];+ We ? W && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie + 1, 0, 0, Oe, Be, Ce.image[de]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + de, Ie + 1, et, Oe, Be, Ce.image[de]);}}}@@ -22158,22 +22158,22 @@ function JS(i, e, t, n, s, r, a) {L.__version = I.version;}function be(L, I, Z, le, pe, oe) {- const Ue = r.convert(Z.format, Z.colorSpace), Ce = r.convert(Z.type), Ve = b(Z.internalFormat, Ue, Ce, Z.colorSpace), je = n.get(I), Ee = n.get(Z);- if (Ee.__renderTarget = I, !je.__hasExternalTextures) {+ const Ue = r.convert(Z.format, Z.colorSpace), ve = r.convert(Z.type), Ve = b(Z.internalFormat, Ue, ve, Z.colorSpace), Ye = n.get(I), Ee = n.get(Z);+ if (Ee.__renderTarget = I, !Ye.__hasExternalTextures) {const Re = Math.max(1, I.width >> oe), ke = Math.max(1, I.height >> oe);- pe === i.TEXTURE_3D || pe === i.TEXTURE_2D_ARRAY ? t.texImage3D(pe, oe, Ve, Re, ke, I.depth, 0, Ue, Ce, null) : t.texImage2D(pe, oe, Ve, Re, ke, 0, Ue, Ce, null);+ pe === i.TEXTURE_3D || pe === i.TEXTURE_2D_ARRAY ? t.texImage3D(pe, oe, Ve, Re, ke, I.depth, 0, Ue, ve, null) : t.texImage2D(pe, oe, Ve, Re, ke, 0, Ue, ve, null);}t.bindFramebuffer(i.FRAMEBUFFER, L), pt(I) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, le, pe, Ee.__webglTexture, 0, dt(I)) : (pe === i.TEXTURE_2D || pe >= i.TEXTURE_CUBE_MAP_POSITIVE_X && pe <= i.TEXTURE_CUBE_MAP_NEGATIVE_Z) && i.framebufferTexture2D(i.FRAMEBUFFER, le, pe, Ee.__webglTexture, oe), t.bindFramebuffer(i.FRAMEBUFFER, null);}function xe(L, I, Z) {if (i.bindRenderbuffer(i.RENDERBUFFER, L), I.depthBuffer) {- const le = I.depthTexture, pe = le && le.isDepthTexture ? le.type : null, oe = _(I.stencilBuffer, pe), Ue = I.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, Ce = dt(I);- pt(I) ? o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, Ce, oe, I.width, I.height) : Z ? i.renderbufferStorageMultisample(i.RENDERBUFFER, Ce, oe, I.width, I.height) : i.renderbufferStorage(i.RENDERBUFFER, oe, I.width, I.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, Ue, i.RENDERBUFFER, L);+ const le = I.depthTexture, pe = le && le.isDepthTexture ? le.type : null, oe = _(I.stencilBuffer, pe), Ue = I.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, ve = dt(I);+ pt(I) ? o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, ve, oe, I.width, I.height) : Z ? i.renderbufferStorageMultisample(i.RENDERBUFFER, ve, oe, I.width, I.height) : i.renderbufferStorage(i.RENDERBUFFER, oe, I.width, I.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, Ue, i.RENDERBUFFER, L);} else {const le = I.textures;for (let pe = 0; pe < le.length; pe++) {- const oe = le[pe], Ue = r.convert(oe.format, oe.colorSpace), Ce = r.convert(oe.type), Ve = b(oe.internalFormat, Ue, Ce, oe.colorSpace), je = dt(I);- Z && pt(I) === !1 ? i.renderbufferStorageMultisample(i.RENDERBUFFER, je, Ve, I.width, I.height) : pt(I) ? o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, je, Ve, I.width, I.height) : i.renderbufferStorage(i.RENDERBUFFER, Ve, I.width, I.height);+ const oe = le[pe], Ue = r.convert(oe.format, oe.colorSpace), ve = r.convert(oe.type), Ve = b(oe.internalFormat, Ue, ve, oe.colorSpace), Ye = dt(I);+ Z && pt(I) === !1 ? i.renderbufferStorageMultisample(i.RENDERBUFFER, Ye, Ve, I.width, I.height) : pt(I) ? o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, Ye, Ve, I.width, I.height) : i.renderbufferStorage(i.RENDERBUFFER, Ve, I.width, I.height);}}i.bindRenderbuffer(i.RENDERBUFFER, null);@@ -22185,9 +22185,9 @@ function JS(i, e, t, n, s, r, a) {const le = n.get(I.depthTexture);le.__renderTarget = I, (!le.__webglTexture || I.depthTexture.image.width !== I.width || I.depthTexture.image.height !== I.height) && (I.depthTexture.image.width = I.width, I.depthTexture.image.height = I.height, I.depthTexture.needsUpdate = !0), D(I.depthTexture, 0);const pe = le.__webglTexture, oe = dt(I);- if (I.depthTexture.format === vo)+ if (I.depthTexture.format === Bo)pt(I) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, i.DEPTH_ATTACHMENT, i.TEXTURE_2D, pe, 0, oe) : i.framebufferTexture2D(i.FRAMEBUFFER, i.DEPTH_ATTACHMENT, i.TEXTURE_2D, pe, 0);- else if (I.depthTexture.format === So)+ else if (I.depthTexture.format === To)pt(I) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, i.DEPTH_STENCIL_ATTACHMENT, i.TEXTURE_2D, pe, 0, oe) : i.framebufferTexture2D(i.FRAMEBUFFER, i.DEPTH_STENCIL_ATTACHMENT, i.TEXTURE_2D, pe, 0);elsethrow new Error("Unknown depthTexture format");@@ -22232,65 +22232,65 @@ function JS(i, e, t, n, s, r, a) {const le = n.get(L);I !== void 0 && be(le.__webglFramebuffer, L, L.texture, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, 0), Z !== void 0 && $e(L);}- function Ct(L) {+ function vt(L) {const I = L.texture, Z = n.get(L), le = n.get(I);L.addEventListener("dispose", S);const pe = L.textures, oe = L.isWebGLCubeRenderTarget === !0, Ue = pe.length > 1;if (Ue || (le.__webglTexture === void 0 && (le.__webglTexture = i.createTexture()), le.__version = I.version, a.memory.textures++), oe) {Z.__webglFramebuffer = [];- for (let Ce = 0; Ce < 6; Ce++)+ for (let ve = 0; ve < 6; ve++)if (I.mipmaps && I.mipmaps.length > 0) {- Z.__webglFramebuffer[Ce] = [];+ Z.__webglFramebuffer[ve] = [];for (let Ve = 0; Ve < I.mipmaps.length; Ve++)- Z.__webglFramebuffer[Ce][Ve] = i.createFramebuffer();+ Z.__webglFramebuffer[ve][Ve] = i.createFramebuffer();} else- Z.__webglFramebuffer[Ce] = i.createFramebuffer();+ Z.__webglFramebuffer[ve] = i.createFramebuffer();} else {if (I.mipmaps && I.mipmaps.length > 0) {Z.__webglFramebuffer = [];- for (let Ce = 0; Ce < I.mipmaps.length; Ce++)- Z.__webglFramebuffer[Ce] = i.createFramebuffer();+ for (let ve = 0; ve < I.mipmaps.length; ve++)+ Z.__webglFramebuffer[ve] = i.createFramebuffer();} elseZ.__webglFramebuffer = i.createFramebuffer();if (Ue)- for (let Ce = 0, Ve = pe.length; Ce < Ve; Ce++) {- const je = n.get(pe[Ce]);- je.__webglTexture === void 0 && (je.__webglTexture = i.createTexture(), a.memory.textures++);+ for (let ve = 0, Ve = pe.length; ve < Ve; ve++) {+ const Ye = n.get(pe[ve]);+ Ye.__webglTexture === void 0 && (Ye.__webglTexture = i.createTexture(), a.memory.textures++);}if (L.samples > 0 && pt(L) === !1) {Z.__webglMultisampledFramebuffer = i.createFramebuffer(), Z.__webglColorRenderbuffer = [], t.bindFramebuffer(i.FRAMEBUFFER, Z.__webglMultisampledFramebuffer);- for (let Ce = 0; Ce < pe.length; Ce++) {- const Ve = pe[Ce];- Z.__webglColorRenderbuffer[Ce] = i.createRenderbuffer(), i.bindRenderbuffer(i.RENDERBUFFER, Z.__webglColorRenderbuffer[Ce]);- const je = r.convert(Ve.format, Ve.colorSpace), Ee = r.convert(Ve.type), Re = b(Ve.internalFormat, je, Ee, Ve.colorSpace, L.isXRRenderTarget === !0), ke = dt(L);- i.renderbufferStorageMultisample(i.RENDERBUFFER, ke, Re, L.width, L.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + Ce, i.RENDERBUFFER, Z.__webglColorRenderbuffer[Ce]);+ for (let ve = 0; ve < pe.length; ve++) {+ const Ve = pe[ve];+ Z.__webglColorRenderbuffer[ve] = i.createRenderbuffer(), i.bindRenderbuffer(i.RENDERBUFFER, Z.__webglColorRenderbuffer[ve]);+ const Ye = r.convert(Ve.format, Ve.colorSpace), Ee = r.convert(Ve.type), Re = b(Ve.internalFormat, Ye, Ee, Ve.colorSpace, L.isXRRenderTarget === !0), ke = dt(L);+ i.renderbufferStorageMultisample(i.RENDERBUFFER, ke, Re, L.width, L.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + ve, i.RENDERBUFFER, Z.__webglColorRenderbuffer[ve]);}i.bindRenderbuffer(i.RENDERBUFFER, null), L.depthBuffer && (Z.__webglDepthRenderbuffer = i.createRenderbuffer(), xe(Z.__webglDepthRenderbuffer, L, !0)), t.bindFramebuffer(i.FRAMEBUFFER, null);}}if (oe) {t.bindTexture(i.TEXTURE_CUBE_MAP, le.__webglTexture), ye(i.TEXTURE_CUBE_MAP, I);- for (let Ce = 0; Ce < 6; Ce++)+ for (let ve = 0; ve < 6; ve++)if (I.mipmaps && I.mipmaps.length > 0)for (let Ve = 0; Ve < I.mipmaps.length; Ve++)- be(Z.__webglFramebuffer[Ce][Ve], L, I, i.COLOR_ATTACHMENT0, i.TEXTURE_CUBE_MAP_POSITIVE_X + Ce, Ve);+ be(Z.__webglFramebuffer[ve][Ve], L, I, i.COLOR_ATTACHMENT0, i.TEXTURE_CUBE_MAP_POSITIVE_X + ve, Ve);else- be(Z.__webglFramebuffer[Ce], L, I, i.COLOR_ATTACHMENT0, i.TEXTURE_CUBE_MAP_POSITIVE_X + Ce, 0);+ be(Z.__webglFramebuffer[ve], L, I, i.COLOR_ATTACHMENT0, i.TEXTURE_CUBE_MAP_POSITIVE_X + ve, 0);A(I) && p(i.TEXTURE_CUBE_MAP), t.unbindTexture();} else if (Ue) {- for (let Ce = 0, Ve = pe.length; Ce < Ve; Ce++) {- const je = pe[Ce], Ee = n.get(je);- t.bindTexture(i.TEXTURE_2D, Ee.__webglTexture), ye(i.TEXTURE_2D, je), be(Z.__webglFramebuffer, L, je, i.COLOR_ATTACHMENT0 + Ce, i.TEXTURE_2D, 0), A(je) && p(i.TEXTURE_2D);+ for (let ve = 0, Ve = pe.length; ve < Ve; ve++) {+ const Ye = pe[ve], Ee = n.get(Ye);+ t.bindTexture(i.TEXTURE_2D, Ee.__webglTexture), ye(i.TEXTURE_2D, Ye), be(Z.__webglFramebuffer, L, Ye, i.COLOR_ATTACHMENT0 + ve, i.TEXTURE_2D, 0), A(Ye) && p(i.TEXTURE_2D);}t.unbindTexture();} else {- let Ce = i.TEXTURE_2D;- if ((L.isWebGL3DRenderTarget || L.isWebGLArrayRenderTarget) && (Ce = L.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), t.bindTexture(Ce, le.__webglTexture), ye(Ce, I), I.mipmaps && I.mipmaps.length > 0)+ let ve = i.TEXTURE_2D;+ if ((L.isWebGL3DRenderTarget || L.isWebGLArrayRenderTarget) && (ve = L.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), t.bindTexture(ve, le.__webglTexture), ye(ve, I), I.mipmaps && I.mipmaps.length > 0)for (let Ve = 0; Ve < I.mipmaps.length; Ve++)- be(Z.__webglFramebuffer[Ve], L, I, i.COLOR_ATTACHMENT0, Ce, Ve);+ be(Z.__webglFramebuffer[Ve], L, I, i.COLOR_ATTACHMENT0, ve, Ve);else- be(Z.__webglFramebuffer, L, I, i.COLOR_ATTACHMENT0, Ce, 0);- A(I) && p(Ce), t.unbindTexture();+ be(Z.__webglFramebuffer, L, I, i.COLOR_ATTACHMENT0, ve, 0);+ A(I) && p(ve), t.unbindTexture();}L.depthBuffer && $e(L);}@@ -22310,26 +22310,26 @@ function JS(i, e, t, n, s, r, a) {if (pt(L) === !1) {const I = L.textures, Z = L.width, le = L.height;let pe = i.COLOR_BUFFER_BIT;- const oe = L.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, Ue = n.get(L), Ce = I.length > 1;- if (Ce)- for (let je = 0; je < I.length; je++)- t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglMultisampledFramebuffer), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + je, i.RENDERBUFFER, null), t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglFramebuffer), i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0 + je, i.TEXTURE_2D, null, 0);+ const oe = L.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, Ue = n.get(L), ve = I.length > 1;+ if (ve)+ for (let Ye = 0; Ye < I.length; Ye++)+ t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglMultisampledFramebuffer), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + Ye, i.RENDERBUFFER, null), t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglFramebuffer), i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0 + Ye, i.TEXTURE_2D, null, 0);t.bindFramebuffer(i.READ_FRAMEBUFFER, Ue.__webglMultisampledFramebuffer);const Ve = L.texture.mipmaps;Ve && Ve.length > 0 ? t.bindFramebuffer(i.DRAW_FRAMEBUFFER, Ue.__webglFramebuffer[0]) : t.bindFramebuffer(i.DRAW_FRAMEBUFFER, Ue.__webglFramebuffer);- for (let je = 0; je < I.length; je++) {- if (L.resolveDepthBuffer && (L.depthBuffer && (pe |= i.DEPTH_BUFFER_BIT), L.stencilBuffer && L.resolveStencilBuffer && (pe |= i.STENCIL_BUFFER_BIT)), Ce) {- i.framebufferRenderbuffer(i.READ_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.RENDERBUFFER, Ue.__webglColorRenderbuffer[je]);- const Ee = n.get(I[je]).__webglTexture;+ for (let Ye = 0; Ye < I.length; Ye++) {+ if (L.resolveDepthBuffer && (L.depthBuffer && (pe |= i.DEPTH_BUFFER_BIT), L.stencilBuffer && L.resolveStencilBuffer && (pe |= i.STENCIL_BUFFER_BIT)), ve) {+ i.framebufferRenderbuffer(i.READ_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.RENDERBUFFER, Ue.__webglColorRenderbuffer[Ye]);+ const Ee = n.get(I[Ye]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, Ee, 0);}- i.blitFramebuffer(0, 0, Z, le, 0, 0, Z, le, pe, i.NEAREST), c === !0 && (Je.length = 0, G.length = 0, Je.push(i.COLOR_ATTACHMENT0 + je), L.depthBuffer && L.resolveDepthBuffer === !1 && (Je.push(oe), G.push(oe), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, G)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, Je));+ i.blitFramebuffer(0, 0, Z, le, 0, 0, Z, le, pe, i.NEAREST), c === !0 && (Je.length = 0, G.length = 0, Je.push(i.COLOR_ATTACHMENT0 + Ye), L.depthBuffer && L.resolveDepthBuffer === !1 && (Je.push(oe), G.push(oe), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, G)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, Je));}- if (t.bindFramebuffer(i.READ_FRAMEBUFFER, null), t.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), Ce)- for (let je = 0; je < I.length; je++) {- t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglMultisampledFramebuffer), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + je, i.RENDERBUFFER, Ue.__webglColorRenderbuffer[je]);- const Ee = n.get(I[je]).__webglTexture;- t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglFramebuffer), i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0 + je, i.TEXTURE_2D, Ee, 0);+ if (t.bindFramebuffer(i.READ_FRAMEBUFFER, null), t.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), ve)+ for (let Ye = 0; Ye < I.length; Ye++) {+ t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglMultisampledFramebuffer), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + Ye, i.RENDERBUFFER, Ue.__webglColorRenderbuffer[Ye]);+ const Ee = n.get(I[Ye]).__webglTexture;+ t.bindFramebuffer(i.FRAMEBUFFER, Ue.__webglFramebuffer), i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0 + Ye, i.TEXTURE_2D, Ee, 0);}t.bindFramebuffer(i.DRAW_FRAMEBUFFER, Ue.__webglMultisampledFramebuffer);} else if (L.depthBuffer && L.resolveDepthBuffer === !1 && c) {@@ -22351,111 +22351,111 @@ function JS(i, e, t, n, s, r, a) {}function Rt(L, I) {const Z = L.colorSpace, le = L.format, pe = L.type;- return L.isCompressedTexture === !0 || L.isVideoTexture === !0 || Z !== ln && Z !== pi && (mt.getTransfer(Z) === Mt ? (le !== on || pe !== rn) && console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : console.error("THREE.WebGLTextures: Unsupported texture color space:", Z)), I;+ return L.isCompressedTexture === !0 || L.isVideoTexture === !0 || Z !== ln && Z !== Ai && (mt.getTransfer(Z) === Mt ? (le !== on || pe !== rn) && console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : console.error("THREE.WebGLTextures: Unsupported texture color space:", Z)), I;}function Ge(L) {return typeof HTMLImageElement < "u" && L instanceof HTMLImageElement ? (l.width = L.naturalWidth || L.width, l.height = L.naturalHeight || L.height) : typeof VideoFrame < "u" && L instanceof VideoFrame ? (l.width = L.displayWidth, l.height = L.displayHeight) : (l.width = L.width, l.height = L.height), l;}- this.allocateTextureUnit = q, this.resetTextureUnits = K, this.setTexture2D = D, this.setTexture2DArray = O, this.setTexture3D = j, this.setTextureCube = Q, this.rebindTextures = Qe, this.setupRenderTarget = Ct, this.updateRenderTargetMipmap = lt, this.updateMultisampleRenderTarget = dn, this.setupDepthRenderbuffer = $e, this.setupFrameBufferTexture = be, this.useMultisampledRTT = pt;+ this.allocateTextureUnit = q, this.resetTextureUnits = K, this.setTexture2D = D, this.setTexture2DArray = O, this.setTexture3D = Y, this.setTextureCube = Q, this.rebindTextures = Qe, this.setupRenderTarget = vt, this.updateRenderTargetMipmap = lt, this.updateMultisampleRenderTarget = dn, this.setupDepthRenderbuffer = $e, this.setupFrameBufferTexture = be, this.useMultisampledRTT = pt;}-function ZS(i, e) {- function t(n, s = pi) {+function aI(i, e) {+ function t(n, s = Ai) {let r;const a = mt.getTransfer(s);if (n === rn) return i.UNSIGNED_BYTE;- if (n === $d) return i.UNSIGNED_SHORT_4_4_4_4;- if (n === ef) return i.UNSIGNED_SHORT_5_5_5_1;- if (n === Mm) return i.UNSIGNED_INT_5_9_9_9_REV;- if (n === Sm) return i.BYTE;- if (n === Im) return i.SHORT;- if (n === wo) return i.UNSIGNED_SHORT;- if (n === Zd) return i.INT;- if (n === mr) return i.UNSIGNED_INT;+ if (n === af) return i.UNSIGNED_SHORT_4_4_4_4;+ if (n === of) return i.UNSIGNED_SHORT_5_5_5_1;+ if (n === Lm) return i.UNSIGNED_INT_5_9_9_9_REV;+ if (n === Fm) return i.BYTE;+ if (n === Dm) return i.SHORT;+ if (n === Io) return i.UNSIGNED_SHORT;+ if (n === rf) return i.INT;+ if (n === xr) return i.UNSIGNED_INT;if (n === an) return i.FLOAT;if (n === Rn) return i.HALF_FLOAT;- if (n === Bm) return i.ALPHA;- if (n === Tm) return i.RGB;+ if (n === Pm) return i.ALPHA;+ if (n === km) return i.RGB;if (n === on) return i.RGBA;- if (n === vo) return i.DEPTH_COMPONENT;- if (n === So) return i.DEPTH_STENCIL;- if (n === ts) return i.RED;- if (n === tf) return i.RED_INTEGER;- if (n === cr) return i.RG;- if (n === nf) return i.RG_INTEGER;- if (n === sf) return i.RGBA_INTEGER;- if (n === tl || n === uo || n === nl || n === fo)+ if (n === Bo) return i.DEPTH_COMPONENT;+ if (n === To) return i.DEPTH_STENCIL;+ if (n === ns) return i.RED;+ if (n === cf) return i.RED_INTEGER;+ if (n === hr) return i.RG;+ if (n === lf) return i.RG_INTEGER;+ if (n === hf) return i.RGBA_INTEGER;+ if (n === al || n === go || n === ol || n === mo)if (a === Mt)if (r = e.get("WEBGL_compressed_texture_s3tc_srgb"), r !== null) {- if (n === tl) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;- if (n === uo) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;- if (n === nl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;- if (n === fo) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;+ if (n === al) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;+ if (n === go) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;+ if (n === ol) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;+ if (n === mo) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;} elsereturn null;else if (r = e.get("WEBGL_compressed_texture_s3tc"), r !== null) {- if (n === tl) return r.COMPRESSED_RGB_S3TC_DXT1_EXT;- if (n === uo) return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;- if (n === nl) return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;- if (n === fo) return r.COMPRESSED_RGBA_S3TC_DXT5_EXT;+ if (n === al) return r.COMPRESSED_RGB_S3TC_DXT1_EXT;+ if (n === go) return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;+ if (n === ol) return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;+ if (n === mo) return r.COMPRESSED_RGBA_S3TC_DXT5_EXT;} elsereturn null;- if (n === ul || n === Ou || n === dl || n === Qu)+ if (n === gl || n === Wu || n === ml || n === qu)if (r = e.get("WEBGL_compressed_texture_pvrtc"), r !== null) {- if (n === ul) return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;- if (n === Ou) return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;- if (n === dl) return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;- if (n === Qu) return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;+ if (n === gl) return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;+ if (n === Wu) return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;+ if (n === ml) return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;+ if (n === qu) return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;} elsereturn null;- if (n === fl || n === pl || n === Al)+ if (n === bl || n === xl || n === El)if (r = e.get("WEBGL_compressed_texture_etc"), r !== null) {- if (n === fl || n === pl) return a === Mt ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;- if (n === Al) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;+ if (n === bl || n === xl) return a === Mt ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;+ if (n === El) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;} elsereturn null;- if (n === Io || n === Gu || n === Hu || n === zu || n === Mo || n === Vu || n === Wu || n === qu || n === Ku || n === Xu || n === Yu || n === ju || n === Ju || n === Zu)+ if (n === Ro || n === Ku || n === ju || n === Xu || n === No || n === Yu || n === Ju || n === Zu || n === $u || n === ed || n === td || n === nd || n === id || n === sd)if (r = e.get("WEBGL_compressed_texture_astc"), r !== null) {- if (n === Io) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;- if (n === Gu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;- if (n === Hu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;- if (n === zu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;- if (n === Mo) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;- if (n === Vu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;- if (n === Wu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;- if (n === qu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;- if (n === Ku) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;- if (n === Xu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;- if (n === Yu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;- if (n === ju) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;- if (n === Ju) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;- if (n === Zu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;+ if (n === Ro) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;+ if (n === Ku) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;+ if (n === ju) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;+ if (n === Xu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;+ if (n === No) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;+ if (n === Yu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;+ if (n === Ju) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;+ if (n === Zu) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;+ if (n === $u) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;+ if (n === ed) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;+ if (n === td) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;+ if (n === nd) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;+ if (n === id) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;+ if (n === sd) return a === Mt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;} elsereturn null;- if (n === po || n === $u || n === gl)+ if (n === bo || n === rd || n === _l)if (r = e.get("EXT_texture_compression_bptc"), r !== null) {- if (n === po) return a === Mt ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;- if (n === $u) return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;- if (n === gl) return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;+ if (n === bo) return a === Mt ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;+ if (n === rd) return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;+ if (n === _l) return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;} elsereturn null;- if (n === Rm || n === ed || n === td || n === nd)+ if (n === Um || n === ad || n === od || n === cd)if (r = e.get("EXT_texture_compression_rgtc"), r !== null) {- if (n === po) return r.COMPRESSED_RED_RGTC1_EXT;- if (n === ed) return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;- if (n === td) return r.COMPRESSED_RED_GREEN_RGTC2_EXT;- if (n === nd) return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;+ if (n === bo) return r.COMPRESSED_RED_RGTC1_EXT;+ if (n === ad) return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;+ if (n === od) return r.COMPRESSED_RED_GREEN_RGTC2_EXT;+ if (n === cd) return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;} elsereturn null;- return n === Co ? i.UNSIGNED_INT_24_8 : i[n] !== void 0 ? i[n] : null;+ return n === Mo ? i.UNSIGNED_INT_24_8 : i[n] !== void 0 ? i[n] : null;}return { convert: t };}-const $S = `+const oI = `void main() {gl_Position = vec4( position, 1.0 );-}`, eI = `+}`, cI = `uniform sampler2DArray depthColor;uniform float depthWidth;uniform float depthHeight;@@ -22475,7 +22475,7 @@ void main() {}}`;-class tI {+class lI {/*** Constructs a new depth sensing module.*/@@ -22503,16 +22503,16 @@ class tI {*/getMesh(e) {if (this.texture !== null && this.mesh === null) {- const t = e.cameras[0].viewport, n = new ks({- vertexShader: $S,- fragmentShader: eI,+ const t = e.cameras[0].viewport, n = new Os({+ vertexShader: oI,+ fragmentShader: cI,uniforms: {depthColor: { value: this.texture },depthWidth: { value: t.z },depthHeight: { value: t.w }}});- this.mesh = new Jt(new Ql(20, 20), n);+ this.mesh = new Jt(new Wl(20, 20), n);}return this.mesh;}@@ -22531,7 +22531,7 @@ class tI {return this.texture;}}-class nI extends Qs {+class hI extends Hs {/*** Constructs a new WebGL renderer.*@@ -22542,25 +22542,25 @@ class nI extends Qs {super();const n = this;let s = null, r = 1, a = null, o = "local-floor", c = 1, l = null, h = null, u = null, d = null, f = null, m = null;- const g = new tI(), A = t.getContextAttributes();+ const g = new lI(), A = t.getContextAttributes();let p = null, y = null;const b = [], _ = [], M = new Ze();let w = null;- const S = new Cn();+ const S = new vn();S.viewport = new wt();- const T = new Cn();+ const T = new vn();T.viewport = new wt();- const v = [S, T], C = new cy();+ const C = [S, T], v = new gy();let F = null, K = null;this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(se) {let me = b[se];- return me === void 0 && (me = new Sh(), b[se] = me), me.getTargetRaySpace();+ return me === void 0 && (me = new Nh(), b[se] = me), me.getTargetRaySpace();}, this.getControllerGrip = function(se) {let me = b[se];- return me === void 0 && (me = new Sh(), b[se] = me), me.getGripSpace();+ return me === void 0 && (me = new Nh(), b[se] = me), me.getGripSpace();}, this.getHand = function(se) {let me = b[se];- return me === void 0 && (me = new Sh(), b[se] = me), me.getHandSpace();+ return me === void 0 && (me = new Nh(), b[se] = me), me.getHandSpace();};function q(se) {const me = _.indexOf(se.inputSource);@@ -22597,19 +22597,19 @@ class nI extends Qs {if (s = se, s !== null) {if (p = e.getRenderTarget(), s.addEventListener("select", q), s.addEventListener("selectstart", q), s.addEventListener("selectend", q), s.addEventListener("squeeze", q), s.addEventListener("squeezestart", q), s.addEventListener("squeezeend", q), s.addEventListener("end", $), s.addEventListener("inputsourceschange", D), A.xrCompatible !== !0 && await t.makeXRCompatible(), w = e.getPixelRatio(), e.getSize(M), typeof XRWebGLBinding < "u" && "createProjectionLayer" in XRWebGLBinding.prototype) {let be = null, xe = null, Pe = null;- A.depth && (Pe = A.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, be = A.stencil ? So : vo, xe = A.stencil ? Co : mr);+ A.depth && (Pe = A.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, be = A.stencil ? To : Bo, xe = A.stencil ? Mo : xr);const $e = {colorFormat: t.RGBA8,depthFormat: Pe,scaleFactor: r};- u = new XRWebGLBinding(s, t), d = u.createProjectionLayer($e), s.updateRenderState({ layers: [d] }), e.setPixelRatio(1), e.setSize(d.textureWidth, d.textureHeight, !1), y = new br(+ u = new XRWebGLBinding(s, t), d = u.createProjectionLayer($e), s.updateRenderState({ layers: [d] }), e.setPixelRatio(1), e.setSize(d.textureWidth, d.textureHeight, !1), y = new Er(d.textureWidth,d.textureHeight,{format: on,type: rn,- depthTexture: new jm(d.textureWidth, d.textureHeight, xe, void 0, void 0, void 0, void 0, void 0, void 0, be),+ depthTexture: new i0(d.textureWidth, d.textureHeight, xe, void 0, void 0, void 0, void 0, void 0, void 0, be),stencilBuffer: A.stencil,colorSpace: e.outputColorSpace,samples: A.antialias ? 4 : 0,@@ -22625,7 +22625,7 @@ class nI extends Qs {stencil: A.stencil,framebufferScaleFactor: r};- f = new XRWebGLLayer(s, t, be), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), y = new br(+ f = new XRWebGLLayer(s, t, be), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), y = new Er(f.framebufferWidth,f.framebufferHeight,{@@ -22669,14 +22669,14 @@ class nI extends Qs {Pe && Pe.connect(be);}}- const O = new H(), j = new H();+ const O = new H(), Y = new H();function Q(se, me, be) {- O.setFromMatrixPosition(me.matrixWorld), j.setFromMatrixPosition(be.matrixWorld);- const xe = O.distanceTo(j), Pe = me.projectionMatrix.elements, $e = be.projectionMatrix.elements, Qe = Pe[14] / (Pe[10] - 1), Ct = Pe[14] / (Pe[10] + 1), lt = (Pe[9] + 1) / Pe[5], Je = (Pe[9] - 1) / Pe[5], G = (Pe[8] - 1) / Pe[0], dn = ($e[8] + 1) / $e[0], dt = Qe * G, pt = Qe * dn, ze = xe / (-G + dn), Rt = ze * -G;+ O.setFromMatrixPosition(me.matrixWorld), Y.setFromMatrixPosition(be.matrixWorld);+ const xe = O.distanceTo(Y), Pe = me.projectionMatrix.elements, $e = be.projectionMatrix.elements, Qe = Pe[14] / (Pe[10] - 1), vt = Pe[14] / (Pe[10] + 1), lt = (Pe[9] + 1) / Pe[5], Je = (Pe[9] - 1) / Pe[5], G = (Pe[8] - 1) / Pe[0], dn = ($e[8] + 1) / $e[0], dt = Qe * G, pt = Qe * dn, ze = xe / (-G + dn), Rt = ze * -G;if (me.matrixWorld.decompose(se.position, se.quaternion, se.scale), se.translateX(Rt), se.translateZ(ze), se.matrixWorld.compose(se.position, se.quaternion, se.scale), se.matrixWorldInverse.copy(se.matrixWorld).invert(), Pe[10] === -1)se.projectionMatrix.copy(me.projectionMatrix), se.projectionMatrixInverse.copy(me.projectionMatrixInverse);else {- const Ge = Qe + ze, L = Ct + ze, I = dt - Rt, Z = pt + (xe - Rt), le = lt * Ct / L * Ge, pe = Je * Ct / L * Ge;+ const Ge = Qe + ze, L = vt + ze, I = dt - Rt, Z = pt + (xe - Rt), le = lt * vt / L * Ge, pe = Je * vt / L * Ge;se.projectionMatrix.makePerspective(I, Z, le, pe, Ge, L), se.projectionMatrixInverse.copy(se.projectionMatrix).invert();}}@@ -22686,21 +22686,21 @@ class nI extends Qs {this.updateCamera = function(se) {if (s === null) return;let me = se.near, be = se.far;- g.texture !== null && (g.depthNear > 0 && (me = g.depthNear), g.depthFar > 0 && (be = g.depthFar)), C.near = T.near = S.near = me, C.far = T.far = S.far = be, (F !== C.near || K !== C.far) && (s.updateRenderState({- depthNear: C.near,- depthFar: C.far- }), F = C.near, K = C.far), S.layers.mask = se.layers.mask | 2, T.layers.mask = se.layers.mask | 4, C.layers.mask = S.layers.mask | T.layers.mask;- const xe = se.parent, Pe = C.cameras;- J(C, xe);+ g.texture !== null && (g.depthNear > 0 && (me = g.depthNear), g.depthFar > 0 && (be = g.depthFar)), v.near = T.near = S.near = me, v.far = T.far = S.far = be, (F !== v.near || K !== v.far) && (s.updateRenderState({+ depthNear: v.near,+ depthFar: v.far+ }), F = v.near, K = v.far), S.layers.mask = se.layers.mask | 2, T.layers.mask = se.layers.mask | 4, v.layers.mask = S.layers.mask | T.layers.mask;+ const xe = se.parent, Pe = v.cameras;+ J(v, xe);for (let $e = 0; $e < Pe.length; $e++)J(Pe[$e], xe);- Pe.length === 2 ? Q(C, S, T) : C.projectionMatrix.copy(S.projectionMatrix), ee(se, C, xe);+ Pe.length === 2 ? Q(v, S, T) : v.projectionMatrix.copy(S.projectionMatrix), ee(se, v, xe);};function ee(se, me, be) {- be === null ? se.matrix.copy(me.matrixWorld) : (se.matrix.copy(be.matrixWorld), se.matrix.invert(), se.matrix.multiply(me.matrixWorld)), se.matrix.decompose(se.position, se.quaternion, se.scale), se.updateMatrixWorld(!0), se.projectionMatrix.copy(me.projectionMatrix), se.projectionMatrixInverse.copy(me.projectionMatrixInverse), se.isPerspectiveCamera && (se.fov = Ea * 2 * Math.atan(1 / se.projectionMatrix.elements[5]), se.zoom = 1);+ be === null ? se.matrix.copy(me.matrixWorld) : (se.matrix.copy(be.matrixWorld), se.matrix.invert(), se.matrix.multiply(me.matrixWorld)), se.matrix.decompose(se.position, se.quaternion, se.scale), se.updateMatrixWorld(!0), se.projectionMatrix.copy(me.projectionMatrix), se.projectionMatrixInverse.copy(me.projectionMatrixInverse), se.isPerspectiveCamera && (se.fov = va * 2 * Math.atan(1 / se.projectionMatrix.elements[5]), se.zoom = 1);}this.getCamera = function() {- return C;+ return v;}, this.getFoveation = function() {if (!(d === null && f === null))return c;@@ -22709,7 +22709,7 @@ class nI extends Qs {}, this.hasDepthSensing = function() {return g.texture !== null;}, this.getDepthSensingMesh = function() {- return g.getMesh(C);+ return g.getMesh(v);};let ae = null;function ye(se, me) {@@ -22717,22 +22717,22 @@ class nI extends Qs {const be = h.views;f !== null && (e.setRenderTargetFramebuffer(y, f.framebuffer), e.setRenderTarget(y));let xe = !1;- be.length !== C.cameras.length && (C.cameras.length = 0, xe = !0);+ be.length !== v.cameras.length && (v.cameras.length = 0, xe = !0);for (let Qe = 0; Qe < be.length; Qe++) {- const Ct = be[Qe];+ const vt = be[Qe];let lt = null;if (f !== null)- lt = f.getViewport(Ct);+ lt = f.getViewport(vt);else {- const G = u.getViewSubImage(d, Ct);+ const G = u.getViewSubImage(d, vt);lt = G.viewport, Qe === 0 && (e.setRenderTargetTextures(y,G.colorTexture,G.depthStencilTexture), e.setRenderTarget(y));}- let Je = v[Qe];- Je === void 0 && (Je = new Cn(), Je.layers.enable(Qe), Je.viewport = new wt(), v[Qe] = Je), Je.matrix.fromArray(Ct.transform.matrix), Je.matrix.decompose(Je.position, Je.quaternion, Je.scale), Je.projectionMatrix.fromArray(Ct.projectionMatrix), Je.projectionMatrixInverse.copy(Je.projectionMatrix).invert(), Je.viewport.set(lt.x, lt.y, lt.width, lt.height), Qe === 0 && (C.matrix.copy(Je.matrix), C.matrix.decompose(C.position, C.quaternion, C.scale)), xe === !0 && C.cameras.push(Je);+ let Je = C[Qe];+ Je === void 0 && (Je = new vn(), Je.layers.enable(Qe), Je.viewport = new wt(), C[Qe] = Je), Je.matrix.fromArray(vt.transform.matrix), Je.matrix.decompose(Je.position, Je.quaternion, Je.scale), Je.projectionMatrix.fromArray(vt.projectionMatrix), Je.projectionMatrixInverse.copy(Je.projectionMatrix).invert(), Je.viewport.set(lt.x, lt.y, lt.width, lt.height), Qe === 0 && (v.matrix.copy(Je.matrix), v.matrix.decompose(v.position, v.quaternion, v.scale)), xe === !0 && v.cameras.push(Je);}const Pe = s.enabledFeatures;if (Pe && Pe.includes("depth-sensing") && s.depthUsage == "gpu-optimized" && u) {@@ -22746,20 +22746,20 @@ class nI extends Qs {}ae && ae(se, me), me.detectedPlanes && n.dispatchEvent({ type: "planesdetected", data: me }), m = null;}- const Me = new r0();+ const Me = new d0();Me.setAnimationLoop(ye), this.setAnimationLoop = function(se) {ae = se;}, this.dispose = function() {};}}-const js = /* @__PURE__ */ new Fi(), iI = /* @__PURE__ */ new st();-function sI(i, e) {+const Zs = /* @__PURE__ */ new Di(), uI = /* @__PURE__ */ new st();+function dI(i, e) {function t(A, p) {A.matrixAutoUpdate === !0 && A.updateMatrix(), p.value.copy(A.matrix);}function n(A, p) {- p.color.getRGB(A.fogColor.value, Wm(i)), p.isFog ? (A.fogNear.value = p.near, A.fogFar.value = p.far) : p.isFogExp2 && (A.fogDensity.value = p.density);+ p.color.getRGB(A.fogColor.value, Zm(i)), p.isFog ? (A.fogNear.value = p.near, A.fogFar.value = p.far) : p.isFogExp2 && (A.fogDensity.value = p.density);}function s(A, p, y, b, _) {p.isMeshBasicMaterial || p.isMeshLambertMaterial ? r(A, p) : p.isMeshToonMaterial ? (r(A, p), u(A, p)) : p.isMeshPhongMaterial ? (r(A, p), h(A, p)) : p.isMeshStandardMaterial ? (r(A, p), d(A, p), p.isMeshPhysicalMaterial && f(A, p, _)) : p.isMeshMatcapMaterial ? (r(A, p), m(A, p)) : p.isMeshDepthMaterial ? r(A, p) : p.isMeshDistanceMaterial ? (r(A, p), g(A, p)) : p.isMeshNormalMaterial ? r(A, p) : p.isLineBasicMaterial ? (a(A, p), p.isLineDashedMaterial && o(A, p)) : p.isPointsMaterial ? c(A, p, y, b) : p.isSpriteMaterial ? l(A, p) : p.isShadowMaterial ? (A.color.value.copy(p.color), A.opacity.value = p.opacity) : p.isShaderMaterial && (p.uniformsNeedUpdate = !1);@@ -22767,7 +22767,7 @@ function sI(i, e) {function r(A, p) {A.opacity.value = p.opacity, p.color && A.diffuse.value.copy(p.color), p.emissive && A.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity), p.map && (A.map.value = p.map, t(p.map, A.mapTransform)), p.alphaMap && (A.alphaMap.value = p.alphaMap, t(p.alphaMap, A.alphaMapTransform)), p.bumpMap && (A.bumpMap.value = p.bumpMap, t(p.bumpMap, A.bumpMapTransform), A.bumpScale.value = p.bumpScale, p.side === Ln && (A.bumpScale.value *= -1)), p.normalMap && (A.normalMap.value = p.normalMap, t(p.normalMap, A.normalMapTransform), A.normalScale.value.copy(p.normalScale), p.side === Ln && A.normalScale.value.negate()), p.displacementMap && (A.displacementMap.value = p.displacementMap, t(p.displacementMap, A.displacementMapTransform), A.displacementScale.value = p.displacementScale, A.displacementBias.value = p.displacementBias), p.emissiveMap && (A.emissiveMap.value = p.emissiveMap, t(p.emissiveMap, A.emissiveMapTransform)), p.specularMap && (A.specularMap.value = p.specularMap, t(p.specularMap, A.specularMapTransform)), p.alphaTest > 0 && (A.alphaTest.value = p.alphaTest);const y = e.get(p), b = y.envMap, _ = y.envMapRotation;- b && (A.envMap.value = b, js.copy(_), js.x *= -1, js.y *= -1, js.z *= -1, b.isCubeTexture && b.isRenderTargetTexture === !1 && (js.y *= -1, js.z *= -1), A.envMapRotation.value.setFromMatrix4(iI.makeRotationFromEuler(js)), A.flipEnvMap.value = b.isCubeTexture && b.isRenderTargetTexture === !1 ? -1 : 1, A.reflectivity.value = p.reflectivity, A.ior.value = p.ior, A.refractionRatio.value = p.refractionRatio), p.lightMap && (A.lightMap.value = p.lightMap, A.lightMapIntensity.value = p.lightMapIntensity, t(p.lightMap, A.lightMapTransform)), p.aoMap && (A.aoMap.value = p.aoMap, A.aoMapIntensity.value = p.aoMapIntensity, t(p.aoMap, A.aoMapTransform));+ b && (A.envMap.value = b, Zs.copy(_), Zs.x *= -1, Zs.y *= -1, Zs.z *= -1, b.isCubeTexture && b.isRenderTargetTexture === !1 && (Zs.y *= -1, Zs.z *= -1), A.envMapRotation.value.setFromMatrix4(uI.makeRotationFromEuler(Zs)), A.flipEnvMap.value = b.isCubeTexture && b.isRenderTargetTexture === !1 ? -1 : 1, A.reflectivity.value = p.reflectivity, A.ior.value = p.ior, A.refractionRatio.value = p.refractionRatio), p.lightMap && (A.lightMap.value = p.lightMap, A.lightMapIntensity.value = p.lightMapIntensity, t(p.lightMap, A.lightMapTransform)), p.aoMap && (A.aoMap.value = p.aoMap, A.aoMapIntensity.value = p.aoMapIntensity, t(p.aoMap, A.aoMapTransform));}function a(A, p) {A.diffuse.value.copy(p.color), A.opacity.value = p.opacity, p.map && (A.map.value = p.map, t(p.map, A.mapTransform));@@ -22805,7 +22805,7 @@ function sI(i, e) {refreshMaterialUniforms: s};}-function rI(i, e, t, n) {+function fI(i, e, t, n) {let s = {}, r = {}, a = [];const o = i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(y, b) {@@ -22837,14 +22837,14 @@ function rI(i, e, t, n) {i.bindBuffer(i.UNIFORM_BUFFER, b);for (let w = 0, S = _.length; w < S; w++) {const T = Array.isArray(_[w]) ? _[w] : [_[w]];- for (let v = 0, C = T.length; v < C; v++) {- const F = T[v];- if (f(F, w, v, M) === !0) {+ for (let C = 0, v = T.length; C < v; C++) {+ const F = T[C];+ if (f(F, w, C, M) === !0) {const K = F.__offset, q = Array.isArray(F.value) ? F.value : [F.value];let $ = 0;for (let D = 0; D < q.length; D++) {- const O = q[D], j = g(O);- typeof O == "number" || typeof O == "boolean" ? (F.__data[0] = O, i.bufferSubData(i.UNIFORM_BUFFER, K + $, F.__data)) : O.isMatrix3 ? (F.__data[0] = O.elements[0], F.__data[1] = O.elements[1], F.__data[2] = O.elements[2], F.__data[3] = 0, F.__data[4] = O.elements[3], F.__data[5] = O.elements[4], F.__data[6] = O.elements[5], F.__data[7] = 0, F.__data[8] = O.elements[6], F.__data[9] = O.elements[7], F.__data[10] = O.elements[8], F.__data[11] = 0) : (O.toArray(F.__data, $), $ += j.storage / Float32Array.BYTES_PER_ELEMENT);+ const O = q[D], Y = g(O);+ typeof O == "number" || typeof O == "boolean" ? (F.__data[0] = O, i.bufferSubData(i.UNIFORM_BUFFER, K + $, F.__data)) : O.isMatrix3 ? (F.__data[0] = O.elements[0], F.__data[1] = O.elements[1], F.__data[2] = O.elements[2], F.__data[3] = 0, F.__data[4] = O.elements[3], F.__data[5] = O.elements[4], F.__data[6] = O.elements[5], F.__data[7] = 0, F.__data[8] = O.elements[6], F.__data[9] = O.elements[7], F.__data[10] = O.elements[8], F.__data[11] = 0) : (O.toArray(F.__data, $), $ += Y.storage / Float32Array.BYTES_PER_ELEMENT);}i.bufferSubData(i.UNIFORM_BUFFER, K, F.__data);}@@ -22871,12 +22871,12 @@ function rI(i, e, t, n) {let _ = 0;const M = 16;for (let S = 0, T = b.length; S < T; S++) {- const v = Array.isArray(b[S]) ? b[S] : [b[S]];- for (let C = 0, F = v.length; C < F; C++) {- const K = v[C], q = Array.isArray(K.value) ? K.value : [K.value];+ const C = Array.isArray(b[S]) ? b[S] : [b[S]];+ for (let v = 0, F = C.length; v < F; v++) {+ const K = C[v], q = Array.isArray(K.value) ? K.value : [K.value];for (let $ = 0, D = q.length; $ < D; $++) {- const O = q[$], j = g(O), Q = _ % M, J = Q % j.boundary, ee = Q + J;- _ += J, ee !== 0 && M - ee < j.storage && (_ += M - ee), K.__data = new Float32Array(j.storage / Float32Array.BYTES_PER_ELEMENT), K.__offset = _, _ += j.storage;+ const O = q[$], Y = g(O), Q = _ % M, J = Q % Y.boundary, ee = Q + J;+ _ += J, ee !== 0 && M - ee < Y.storage && (_ += M - ee), K.__data = new Float32Array(Y.storage / Float32Array.BYTES_PER_ELEMENT), K.__offset = _, _ += Y.storage;}}}@@ -22909,7 +22909,7 @@ function rI(i, e, t, n) {dispose: p};}-class pA {+class EA {/*** Constructs a new WebGL renderer.*@@ -22917,7 +22917,7 @@ class pA {*/constructor(e = {}) {const {- canvas: t = e_(),+ canvas: t = c_(),context: n = null,depth: s = !0,stencil: r = !1,@@ -22951,20 +22951,20 @@ class pA {* @type {?Function}*/onShaderError: null- }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = Ds, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;+ }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = Ls, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;const _ = this;let M = !1;this._outputColorSpace = Kt;- let w = 0, S = 0, T = null, v = -1, C = null;+ let w = 0, S = 0, T = null, C = -1, v = null;const F = new wt(), K = new wt();let q = null;- const $ = new Xe(0);- let D = 0, O = t.width, j = t.height, Q = 1, J = null, ee = null;- const ae = new wt(0, 0, O, j), ye = new wt(0, 0, O, j);+ const $ = new je(0);+ let D = 0, O = t.width, Y = t.height, Q = 1, J = null, ee = null;+ const ae = new wt(0, 0, O, Y), ye = new wt(0, 0, O, Y);let Me = !1;- const se = new hf();+ const se = new gf();let me = !1, be = !1;- const xe = new st(), Pe = new st(), $e = new H(), Qe = new wt(), Ct = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };+ const xe = new st(), Pe = new st(), $e = new H(), Qe = new wt(), vt = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };let lt = !1;function Je() {return T === null ? Q : 1;@@ -22984,7 +22984,7 @@ class pA {powerPreference: h,failIfMajorPerformanceCaveat: u};- if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r176"), t.addEventListener("webglcontextlost", de, !1), t.addEventListener("webglcontextrestored", Ie, !1), t.addEventListener("webglcontextcreationerror", ve, !1), G === null) {+ if ("setAttribute" in t && t.setAttribute("data-engine", "three.js r176"), t.addEventListener("webglcontextlost", de, !1), t.addEventListener("webglcontextrestored", Ie, !1), t.addEventListener("webglcontextcreationerror", Ce, !1), G === null) {const R = "webgl2";if (G = dn(R, E), G === null)throw dn(R) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");@@ -22992,12 +22992,12 @@ class pA {} catch (E) {throw console.error("THREE.WebGLRenderer: " + E.message), E;}- let dt, pt, ze, Rt, Ge, L, I, Z, le, pe, oe, Ue, Ce, Ve, je, Ee, Re, ke, Oe, Be, et, We, tt, W;+ let dt, pt, ze, Rt, Ge, L, I, Z, le, pe, oe, Ue, ve, Ve, Ye, Ee, Re, ke, Oe, Be, et, We, tt, W;function ne() {- dt = new gv(G), dt.init(), We = new ZS(G, dt), pt = new lv(G, dt, e, We), ze = new jS(G, dt), pt.reverseDepthBuffer && d && ze.buffers.depth.setReversed(!0), Rt = new xv(G), Ge = new kS(), L = new JS(G, dt, ze, Ge, pt, We, Rt), I = new uv(_), Z = new Av(_), le = new vy(G), tt = new ov(G, le), pe = new mv(G, le, Rt, tt), oe = new _v(G, pe, le, Rt), Oe = new Ev(G, pt, L), Ee = new hv(Ge), Ue = new PS(_, I, Z, dt, pt, tt, Ee), Ce = new sI(_, Ge), Ve = new OS(), je = new WS(dt), ke = new av(_, I, Z, ze, oe, f, c), Re = new XS(_, oe, pt), W = new rI(G, Rt, pt, ze), Be = new cv(G, dt, Rt), et = new bv(G, dt, Rt), Rt.programs = Ue.programs, _.capabilities = pt, _.extensions = dt, _.properties = Ge, _.renderLists = Ve, _.shadowMap = Re, _.state = ze, _.info = Rt;+ dt = new vC(G), dt.init(), We = new aI(G, dt), pt = new mC(G, dt, e, We), ze = new sI(G, dt), pt.reverseDepthBuffer && d && ze.buffers.depth.setReversed(!0), Rt = new IC(G), Ge = new WS(), L = new rI(G, dt, ze, Ge, pt, We, Rt), I = new xC(_), Z = new wC(_), le = new Fy(G), tt = new AC(G, le), pe = new CC(G, le, Rt, tt), oe = new BC(G, pe, le, Rt), Oe = new MC(G, pt, L), Ee = new bC(Ge), Ue = new VS(_, I, Z, dt, pt, tt, Ee), ve = new dI(_, Ge), Ve = new KS(), Ye = new $S(dt), ke = new pC(_, I, Z, ze, oe, f, c), Re = new nI(_, oe, pt), W = new fI(G, Rt, pt, ze), Be = new gC(G, dt, Rt), et = new SC(G, dt, Rt), Rt.programs = Ue.programs, _.capabilities = pt, _.extensions = dt, _.properties = Ge, _.renderLists = Ve, _.shadowMap = Re, _.state = ze, _.info = Rt;}ne();- const re = new nI(_, G);+ const re = new hI(_, G);this.xr = re, this.getContext = function() {return G;}, this.getContextAttributes = function() {@@ -23011,19 +23011,19 @@ class pA {}, this.getPixelRatio = function() {return Q;}, this.setPixelRatio = function(E) {- E !== void 0 && (Q = E, this.setSize(O, j, !1));+ E !== void 0 && (Q = E, this.setSize(O, Y, !1));}, this.getSize = function(E) {- return E.set(O, j);+ return E.set(O, Y);}, this.setSize = function(E, R, N = !0) {if (re.isPresenting) {console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return;}- O = E, j = R, t.width = Math.floor(E * Q), t.height = Math.floor(R * Q), N === !0 && (t.style.width = E + "px", t.style.height = R + "px"), this.setViewport(0, 0, E, R);+ O = E, Y = R, t.width = Math.floor(E * Q), t.height = Math.floor(R * Q), N === !0 && (t.style.width = E + "px", t.style.height = R + "px"), this.setViewport(0, 0, E, R);}, this.getDrawingBufferSize = function(E) {- return E.set(O * Q, j * Q).floor();+ return E.set(O * Q, Y * Q).floor();}, this.setDrawingBufferSize = function(E, R, N) {- O = E, j = R, Q = N, t.width = Math.floor(E * N), t.height = Math.floor(R * N), this.setViewport(0, 0, E, R);+ O = E, Y = R, Q = N, t.width = Math.floor(E * N), t.height = Math.floor(R * N), this.setViewport(0, 0, E, R);}, this.getCurrentViewport = function(E) {return E.copy(F);}, this.getViewport = function(E) {@@ -23056,11 +23056,11 @@ class pA {let P = !1;if (T !== null) {const z = T.texture.format;- P = z === sf || z === nf || z === tf;+ P = z === hf || z === lf || z === cf;}if (P) {- const z = T.texture.type, X = z === rn || z === mr || z === wo || z === Co || z === $d || z === ef, Y = ke.getClearColor(), ie = ke.getClearAlpha(), he = Y.r, ce = Y.g, fe = Y.b;- X ? (m[0] = he, m[1] = ce, m[2] = fe, m[3] = ie, G.clearBufferuiv(G.COLOR, 0, m)) : (g[0] = he, g[1] = ce, g[2] = fe, g[3] = ie, G.clearBufferiv(G.COLOR, 0, g));+ const z = T.texture.type, j = z === rn || z === xr || z === Io || z === Mo || z === af || z === of, X = ke.getClearColor(), ie = ke.getClearAlpha(), he = X.r, ce = X.g, fe = X.b;+ j ? (m[0] = he, m[1] = ce, m[2] = fe, m[3] = ie, G.clearBufferuiv(G.COLOR, 0, m)) : (g[0] = he, g[1] = ce, g[2] = fe, g[3] = ie, G.clearBufferiv(G.COLOR, 0, g));} elseU |= G.COLOR_BUFFER_BIT;}@@ -23072,7 +23072,7 @@ class pA {}, this.clearStencil = function() {this.clear(!1, !1, !0);}, this.dispose = function() {- t.removeEventListener("webglcontextlost", de, !1), t.removeEventListener("webglcontextrestored", Ie, !1), t.removeEventListener("webglcontextcreationerror", ve, !1), ke.dispose(), Ve.dispose(), je.dispose(), Ge.dispose(), I.dispose(), Z.dispose(), oe.dispose(), tt.dispose(), W.dispose(), Ue.dispose(), re.dispose(), re.removeEventListener("sessionstart", tc), re.removeEventListener("sessionend", nc), Ui.stop();+ t.removeEventListener("webglcontextlost", de, !1), t.removeEventListener("webglcontextrestored", Ie, !1), t.removeEventListener("webglcontextcreationerror", Ce, !1), ke.dispose(), Ve.dispose(), Ye.dispose(), Ge.dispose(), I.dispose(), Z.dispose(), oe.dispose(), tt.dispose(), W.dispose(), Ue.dispose(), re.dispose(), re.removeEventListener("sessionstart", ac), re.removeEventListener("sessionend", oc), Oi.stop();};function de(E) {E.preventDefault(), console.log("THREE.WebGLRenderer: Context Lost."), M = !0;@@ -23082,7 +23082,7 @@ class pA {const E = Rt.autoReset, R = Re.enabled, N = Re.autoUpdate, U = Re.needsUpdate, P = Re.type;ne(), Rt.autoReset = E, Re.enabled = R, Re.autoUpdate = N, Re.needsUpdate = U, Re.type = P;}- function ve(E) {+ function Ce(E) {console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ", E.statusMessage);}function nt(E) {@@ -23099,9 +23099,9 @@ class pA {}), E.isShaderMaterial && Ue.releaseShaderCache(E));}this.renderBufferDirect = function(E, R, N, U, P, z) {- R === null && (R = Ct);- const X = P.isMesh && P.matrixWorld.determinant() < 0, Y = sh(E, R, N, U, P);- ze.setMaterial(U, X);+ R === null && (R = vt);+ const j = P.isMesh && P.matrixWorld.determinant() < 0, X = hh(E, R, N, U, P);+ ze.setMaterial(U, j);let ie = N.index, he = 1;if (U.wireframe === !0) {if (ie = pe.getWireframeAttribute(N), ie === void 0) return;@@ -23112,7 +23112,7 @@ class pA {z !== null && (Ae = Math.max(Ae, z.start * he), _e = Math.min(_e, (z.start + z.count) * he)), ie !== null ? (Ae = Math.max(Ae, 0), _e = Math.min(_e, ie.count)) : fe != null && (Ae = Math.max(Ae, 0), _e = Math.min(_e, fe.count));const De = _e - Ae;if (De < 0 || De === 1 / 0) return;- tt.setup(P, U, Y, N, ie);+ tt.setup(P, U, X, N, ie);let qe, He = Be;if (ie !== null && (qe = le.get(ie), He = et, He.setIndex(qe)), P.isMesh)U.wireframe === !0 ? (ze.setLineWidth(U.wireframeLinewidth * Je()), He.setMode(G.LINES)) : He.setMode(G.TRIANGLES);@@ -23122,7 +23122,7 @@ class pA {} else P.isPoints ? He.setMode(G.POINTS) : P.isSprite && He.setMode(G.TRIANGLES);if (P.isBatchedMesh)if (P._multiDrawInstances !== null)- il("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), He.renderMultiDrawInstances(P._multiDrawStarts, P._multiDrawCounts, P._multiDrawCount, P._multiDrawInstances);+ cl("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), He.renderMultiDrawInstances(P._multiDrawStarts, P._multiDrawCounts, P._multiDrawCount, P._multiDrawInstances);else if (dt.get("WEBGL_multi_draw"))He.renderMultiDraw(P._multiDrawStarts, P._multiDrawCounts, P._multiDrawCount);else {@@ -23139,10 +23139,10 @@ class pA {He.render(Ae, De);};function _t(E, R, N) {- E.transparent === !0 && E.side === Bi && E.forceSinglePass === !1 ? (E.side = Ln, E.needsUpdate = !0, Tr(E, R, N), E.side = hs, E.needsUpdate = !0, Tr(E, R, N), E.side = Bi) : Tr(E, R, N);+ E.transparent === !0 && E.side === Ti && E.forceSinglePass === !1 ? (E.side = Ln, E.needsUpdate = !0, Nr(E, R, N), E.side = us, E.needsUpdate = !0, Nr(E, R, N), E.side = Ti) : Nr(E, R, N);}this.compile = function(E, R, N = null) {- N === null && (N = E), p = je.get(N), p.init(R), b.push(p), N.traverseVisible(function(P) {+ N === null && (N = E), p = Ye.get(N), p.init(R), b.push(p), N.traverseVisible(function(P) {P.isLight && P.layers.test(R.layers) && (p.pushLight(P), P.castShadow && p.pushShadow(P));}), E !== N && E.traverseVisible(function(P) {P.isLight && P.layers.test(R.layers) && (p.pushLight(P), P.castShadow && p.pushShadow(P));@@ -23154,9 +23154,9 @@ class pA {const z = P.material;if (z)if (Array.isArray(z))- for (let X = 0; X < z.length; X++) {- const Y = z[X];- _t(Y, N, P), U.add(Y);+ for (let j = 0; j < z.length; j++) {+ const X = z[j];+ _t(X, N, P), U.add(X);}else_t(z, N, P), U.add(z);@@ -23165,8 +23165,8 @@ class pA {const U = this.compile(E, R, N);return new Promise((P) => {function z() {- if (U.forEach(function(X) {- Ge.get(X).currentProgram.isReady() && U.delete(X);+ if (U.forEach(function(j) {+ Ge.get(j).currentProgram.isReady() && U.delete(j);}), U.size === 0) {P(E);return;@@ -23177,49 +23177,49 @@ class pA {});};let zn = null;- function ri(E) {+ function ai(E) {zn && zn(E);}- function tc() {- Ui.stop();+ function ac() {+ Oi.stop();}- function nc() {- Ui.start();+ function oc() {+ Oi.start();}- const Ui = new r0();- Ui.setAnimationLoop(ri), typeof self < "u" && Ui.setContext(self), this.setAnimationLoop = function(E) {- zn = E, re.setAnimationLoop(E), E === null ? Ui.stop() : Ui.start();- }, re.addEventListener("sessionstart", tc), re.addEventListener("sessionend", nc), this.render = function(E, R) {+ const Oi = new d0();+ Oi.setAnimationLoop(ai), typeof self < "u" && Oi.setContext(self), this.setAnimationLoop = function(E) {+ zn = E, re.setAnimationLoop(E), E === null ? Oi.stop() : Oi.start();+ }, re.addEventListener("sessionstart", ac), re.addEventListener("sessionend", oc), this.render = function(E, R) {if (R !== void 0 && R.isCamera !== !0) {console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return;}if (M === !0) return;- if (E.matrixWorldAutoUpdate === !0 && E.updateMatrixWorld(), R.parent === null && R.matrixWorldAutoUpdate === !0 && R.updateMatrixWorld(), re.enabled === !0 && re.isPresenting === !0 && (re.cameraAutoUpdate === !0 && re.updateCamera(R), R = re.getCamera()), E.isScene === !0 && E.onBeforeRender(_, E, R, T), p = je.get(E, b.length), p.init(R), b.push(p), Pe.multiplyMatrices(R.projectionMatrix, R.matrixWorldInverse), se.setFromProjectionMatrix(Pe), be = this.localClippingEnabled, me = Ee.init(this.clippingPlanes, be), A = Ve.get(E, y.length), A.init(), y.push(A), re.enabled === !0 && re.isPresenting === !0) {+ if (E.matrixWorldAutoUpdate === !0 && E.updateMatrixWorld(), R.parent === null && R.matrixWorldAutoUpdate === !0 && R.updateMatrixWorld(), re.enabled === !0 && re.isPresenting === !0 && (re.cameraAutoUpdate === !0 && re.updateCamera(R), R = re.getCamera()), E.isScene === !0 && E.onBeforeRender(_, E, R, T), p = Ye.get(E, b.length), p.init(R), b.push(p), Pe.multiplyMatrices(R.projectionMatrix, R.matrixWorldInverse), se.setFromProjectionMatrix(Pe), be = this.localClippingEnabled, me = Ee.init(this.clippingPlanes, be), A = Ve.get(E, y.length), A.init(), y.push(A), re.enabled === !0 && re.isPresenting === !0) {const z = _.xr.getDepthSensingMesh();- z !== null && Oa(z, R, -1 / 0, _.sortObjects);+ z !== null && za(z, R, -1 / 0, _.sortObjects);}- Oa(E, R, 0, _.sortObjects), A.finish(), _.sortObjects === !0 && A.sort(J, ee), lt = re.enabled === !1 || re.isPresenting === !1 || re.hasDepthSensing() === !1, lt && ke.addToRenderList(A, E), this.info.render.frame++, me === !0 && Ee.beginShadows();+ za(E, R, 0, _.sortObjects), A.finish(), _.sortObjects === !0 && A.sort(J, ee), lt = re.enabled === !1 || re.isPresenting === !1 || re.hasDepthSensing() === !1, lt && ke.addToRenderList(A, E), this.info.render.frame++, me === !0 && Ee.beginShadows();const N = p.state.shadowsArray;Re.render(N, E, R), me === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();const U = A.opaque, P = A.transmissive;if (p.setupLights(), R.isArrayCamera) {const z = R.cameras;if (P.length > 0)- for (let X = 0, Y = z.length; X < Y; X++) {- const ie = z[X];- ic(U, P, E, ie);+ for (let j = 0, X = z.length; j < X; j++) {+ const ie = z[j];+ cc(U, P, E, ie);}lt && ke.render(E);- for (let X = 0, Y = z.length; X < Y; X++) {- const ie = z[X];- Qa(A, E, ie, ie.viewport);+ for (let j = 0, X = z.length; j < X; j++) {+ const ie = z[j];+ Va(A, E, ie, ie.viewport);}} else- P.length > 0 && ic(U, P, E, R), lt && ke.render(E), Qa(A, E, R);- T !== null && S === 0 && (L.updateMultisampleRenderTarget(T), L.updateRenderTargetMipmap(T)), E.isScene === !0 && E.onAfterRender(_, E, R), tt.resetDefaultState(), v = -1, C = null, b.pop(), b.length > 0 ? (p = b[b.length - 1], me === !0 && Ee.setGlobalState(_.clippingPlanes, p.state.camera)) : p = null, y.pop(), y.length > 0 ? A = y[y.length - 1] : A = null;+ P.length > 0 && cc(U, P, E, R), lt && ke.render(E), Va(A, E, R);+ T !== null && S === 0 && (L.updateMultisampleRenderTarget(T), L.updateRenderTargetMipmap(T)), E.isScene === !0 && E.onAfterRender(_, E, R), tt.resetDefaultState(), C = -1, v = null, b.pop(), b.length > 0 ? (p = b[b.length - 1], me === !0 && Ee.setGlobalState(_.clippingPlanes, p.state.camera)) : p = null, y.pop(), y.length > 0 ? A = y[y.length - 1] : A = null;};- function Oa(E, R, N, U) {+ function za(E, R, N, U) {if (E.visible === !1) return;if (E.layers.test(R.layers)) {if (E.isGroup)@@ -23231,121 +23231,121 @@ class pA {else if (E.isSprite) {if (!E.frustumCulled || se.intersectsSprite(E)) {U && Qe.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Pe);- const X = oe.update(E), Y = E.material;- Y.visible && A.push(E, X, Y, N, Qe.z, null);+ const j = oe.update(E), X = E.material;+ X.visible && A.push(E, j, X, N, Qe.z, null);}} else if ((E.isMesh || E.isLine || E.isPoints) && (!E.frustumCulled || se.intersectsObject(E))) {- const X = oe.update(E), Y = E.material;- if (U && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), Qe.copy(E.boundingSphere.center)) : (X.boundingSphere === null && X.computeBoundingSphere(), Qe.copy(X.boundingSphere.center)), Qe.applyMatrix4(E.matrixWorld).applyMatrix4(Pe)), Array.isArray(Y)) {- const ie = X.groups;+ const j = oe.update(E), X = E.material;+ if (U && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), Qe.copy(E.boundingSphere.center)) : (j.boundingSphere === null && j.computeBoundingSphere(), Qe.copy(j.boundingSphere.center)), Qe.applyMatrix4(E.matrixWorld).applyMatrix4(Pe)), Array.isArray(X)) {+ const ie = j.groups;for (let he = 0, ce = ie.length; he < ce; he++) {- const fe = ie[he], Ae = Y[fe.materialIndex];- Ae && Ae.visible && A.push(E, X, Ae, N, Qe.z, fe);+ const fe = ie[he], Ae = X[fe.materialIndex];+ Ae && Ae.visible && A.push(E, j, Ae, N, Qe.z, fe);}- } else Y.visible && A.push(E, X, Y, N, Qe.z, null);+ } else X.visible && A.push(E, j, X, N, Qe.z, null);}}const z = E.children;- for (let X = 0, Y = z.length; X < Y; X++)- Oa(z[X], R, N, U);+ for (let j = 0, X = z.length; j < X; j++)+ za(z[j], R, N, U);}- function Qa(E, R, N, U) {- const P = E.opaque, z = E.transmissive, X = E.transparent;- p.setupLightsView(N), me === !0 && Ee.setGlobalState(_.clippingPlanes, N), U && ze.viewport(F.copy(U)), P.length > 0 && Br(P, R, N), z.length > 0 && Br(z, R, N), X.length > 0 && Br(X, R, N), ze.buffers.depth.setTest(!0), ze.buffers.depth.setMask(!0), ze.buffers.color.setMask(!0), ze.setPolygonOffset(!1);+ function Va(E, R, N, U) {+ const P = E.opaque, z = E.transmissive, j = E.transparent;+ p.setupLightsView(N), me === !0 && Ee.setGlobalState(_.clippingPlanes, N), U && ze.viewport(F.copy(U)), P.length > 0 && Rr(P, R, N), z.length > 0 && Rr(z, R, N), j.length > 0 && Rr(j, R, N), ze.buffers.depth.setTest(!0), ze.buffers.depth.setMask(!0), ze.buffers.color.setMask(!0), ze.setPolygonOffset(!1);}- function ic(E, R, N, U) {+ function cc(E, R, N, U) {if ((N.isScene === !0 ? N.overrideMaterial : null) !== null)return;- p.state.transmissionRenderTarget[U.id] === void 0 && (p.state.transmissionRenderTarget[U.id] = new br(1, 1, {+ p.state.transmissionRenderTarget[U.id] === void 0 && (p.state.transmissionRenderTarget[U.id] = new Er(1, 1, {generateMipmaps: !0,type: dt.has("EXT_color_buffer_half_float") || dt.has("EXT_color_buffer_float") ? Rn : rn,- minFilter: ni,+ minFilter: ii,samples: 4,stencilBuffer: r,resolveDepthBuffer: !1,resolveStencilBuffer: !1,colorSpace: mt.workingColorSpace}));- const z = p.state.transmissionRenderTarget[U.id], X = U.viewport || F;- z.setSize(X.z * _.transmissionResolutionScale, X.w * _.transmissionResolutionScale);- const Y = _.getRenderTarget();+ const z = p.state.transmissionRenderTarget[U.id], j = U.viewport || F;+ z.setSize(j.z * _.transmissionResolutionScale, j.w * _.transmissionResolutionScale);+ const X = _.getRenderTarget();_.setRenderTarget(z), _.getClearColor($), D = _.getClearAlpha(), D < 1 && _.setClearColor(16777215, 0.5), _.clear(), lt && ke.render(N);const ie = _.toneMapping;- _.toneMapping = Ds;+ _.toneMapping = Ls;const he = U.viewport;- if (U.viewport !== void 0 && (U.viewport = void 0), p.setupLightsView(U), me === !0 && Ee.setGlobalState(_.clippingPlanes, U), Br(E, N, U), L.updateMultisampleRenderTarget(z), L.updateRenderTargetMipmap(z), dt.has("WEBGL_multisampled_render_to_texture") === !1) {+ if (U.viewport !== void 0 && (U.viewport = void 0), p.setupLightsView(U), me === !0 && Ee.setGlobalState(_.clippingPlanes, U), Rr(E, N, U), L.updateMultisampleRenderTarget(z), L.updateRenderTargetMipmap(z), dt.has("WEBGL_multisampled_render_to_texture") === !1) {let ce = !1;for (let fe = 0, Ae = R.length; fe < Ae; fe++) {const _e = R[fe], De = _e.object, qe = _e.geometry, He = _e.material, Ne = _e.group;- if (He.side === Bi && De.layers.test(U.layers)) {+ if (He.side === Ti && De.layers.test(U.layers)) {const it = He.side;- He.side = Ln, He.needsUpdate = !0, sc(De, N, U, qe, He, Ne), He.side = it, He.needsUpdate = !0, ce = !0;+ He.side = Ln, He.needsUpdate = !0, lc(De, N, U, qe, He, Ne), He.side = it, He.needsUpdate = !0, ce = !0;}}ce === !0 && (L.updateMultisampleRenderTarget(z), L.updateRenderTargetMipmap(z));}- _.setRenderTarget(Y), _.setClearColor($, D), he !== void 0 && (U.viewport = he), _.toneMapping = ie;+ _.setRenderTarget(X), _.setClearColor($, D), he !== void 0 && (U.viewport = he), _.toneMapping = ie;}- function Br(E, R, N) {+ function Rr(E, R, N) {const U = R.isScene === !0 ? R.overrideMaterial : null;for (let P = 0, z = E.length; P < z; P++) {- const X = E[P], Y = X.object, ie = X.geometry, he = X.group;- let ce = X.material;- ce.allowOverride === !0 && U !== null && (ce = U), Y.layers.test(N.layers) && sc(Y, R, N, ie, ce, he);+ const j = E[P], X = j.object, ie = j.geometry, he = j.group;+ let ce = j.material;+ ce.allowOverride === !0 && U !== null && (ce = U), X.layers.test(N.layers) && lc(X, R, N, ie, ce, he);}}- function sc(E, R, N, U, P, z) {- E.onBeforeRender(_, R, N, U, P, z), E.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse, E.matrixWorld), E.normalMatrix.getNormalMatrix(E.modelViewMatrix), P.onBeforeRender(_, R, N, U, E, z), P.transparent === !0 && P.side === Bi && P.forceSinglePass === !1 ? (P.side = Ln, P.needsUpdate = !0, _.renderBufferDirect(N, R, U, P, E, z), P.side = hs, P.needsUpdate = !0, _.renderBufferDirect(N, R, U, P, E, z), P.side = Bi) : _.renderBufferDirect(N, R, U, P, E, z), E.onAfterRender(_, R, N, U, P, z);+ function lc(E, R, N, U, P, z) {+ E.onBeforeRender(_, R, N, U, P, z), E.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse, E.matrixWorld), E.normalMatrix.getNormalMatrix(E.modelViewMatrix), P.onBeforeRender(_, R, N, U, E, z), P.transparent === !0 && P.side === Ti && P.forceSinglePass === !1 ? (P.side = Ln, P.needsUpdate = !0, _.renderBufferDirect(N, R, U, P, E, z), P.side = us, P.needsUpdate = !0, _.renderBufferDirect(N, R, U, P, E, z), P.side = Ti) : _.renderBufferDirect(N, R, U, P, E, z), E.onAfterRender(_, R, N, U, P, z);}- function Tr(E, R, N) {- R.isScene !== !0 && (R = Ct);- const U = Ge.get(E), P = p.state.lights, z = p.state.shadowsArray, X = P.state.version, Y = Ue.getParameters(E, P.state, z, R, N), ie = Ue.getProgramCacheKey(Y);+ function Nr(E, R, N) {+ R.isScene !== !0 && (R = vt);+ const U = Ge.get(E), P = p.state.lights, z = p.state.shadowsArray, j = P.state.version, X = Ue.getParameters(E, P.state, z, R, N), ie = Ue.getProgramCacheKey(X);let he = U.programs;U.environment = E.isMeshStandardMaterial ? R.environment : null, U.fog = R.fog, U.envMap = (E.isMeshStandardMaterial ? Z : I).get(E.envMap || U.environment), U.envMapRotation = U.environment !== null && E.envMap === null ? R.environmentRotation : E.envMapRotation, he === void 0 && (E.addEventListener("dispose", nt), he = /* @__PURE__ */ new Map(), U.programs = he);let ce = he.get(ie);if (ce !== void 0) {- if (U.currentProgram === ce && U.lightsStateVersion === X)- return Ha(E, Y), ce;+ if (U.currentProgram === ce && U.lightsStateVersion === j)+ return qa(E, X), ce;} else- Y.uniforms = Ue.getUniforms(E), E.onBeforeCompile(Y, _), ce = Ue.acquireProgram(Y, ie), he.set(ie, ce), U.uniforms = Y.uniforms;+ X.uniforms = Ue.getUniforms(E), E.onBeforeCompile(X, _), ce = Ue.acquireProgram(X, ie), he.set(ie, ce), U.uniforms = X.uniforms;const fe = U.uniforms;- return (!E.isShaderMaterial && !E.isRawShaderMaterial || E.clipping === !0) && (fe.clippingPlanes = Ee.uniform), Ha(E, Y), U.needsLights = As(E), U.lightsStateVersion = X, U.needsLights && (fe.ambientLightColor.value = P.state.ambient, fe.lightProbe.value = P.state.probe, fe.directionalLights.value = P.state.directional, fe.directionalLightShadows.value = P.state.directionalShadow, fe.spotLights.value = P.state.spot, fe.spotLightShadows.value = P.state.spotShadow, fe.rectAreaLights.value = P.state.rectArea, fe.ltc_1.value = P.state.rectAreaLTC1, fe.ltc_2.value = P.state.rectAreaLTC2, fe.pointLights.value = P.state.point, fe.pointLightShadows.value = P.state.pointShadow, fe.hemisphereLights.value = P.state.hemi, fe.directionalShadowMap.value = P.state.directionalShadowMap, fe.directionalShadowMatrix.value = P.state.directionalShadowMatrix, fe.spotShadowMap.value = P.state.spotShadowMap, fe.spotLightMatrix.value = P.state.spotLightMatrix, fe.spotLightMap.value = P.state.spotLightMap, fe.pointShadowMap.value = P.state.pointShadowMap, fe.pointShadowMatrix.value = P.state.pointShadowMatrix), U.currentProgram = ce, U.uniformsList = null, ce;+ return (!E.isShaderMaterial && !E.isRawShaderMaterial || E.clipping === !0) && (fe.clippingPlanes = Ee.uniform), qa(E, X), U.needsLights = gs(E), U.lightsStateVersion = j, U.needsLights && (fe.ambientLightColor.value = P.state.ambient, fe.lightProbe.value = P.state.probe, fe.directionalLights.value = P.state.directional, fe.directionalLightShadows.value = P.state.directionalShadow, fe.spotLights.value = P.state.spot, fe.spotLightShadows.value = P.state.spotShadow, fe.rectAreaLights.value = P.state.rectArea, fe.ltc_1.value = P.state.rectAreaLTC1, fe.ltc_2.value = P.state.rectAreaLTC2, fe.pointLights.value = P.state.point, fe.pointLightShadows.value = P.state.pointShadow, fe.hemisphereLights.value = P.state.hemi, fe.directionalShadowMap.value = P.state.directionalShadowMap, fe.directionalShadowMatrix.value = P.state.directionalShadowMatrix, fe.spotShadowMap.value = P.state.spotShadowMap, fe.spotLightMatrix.value = P.state.spotLightMatrix, fe.spotLightMap.value = P.state.spotLightMap, fe.pointShadowMap.value = P.state.pointShadowMap, fe.pointShadowMatrix.value = P.state.pointShadowMatrix), U.currentProgram = ce, U.uniformsList = null, ce;}- function Ga(E) {+ function Wa(E) {if (E.uniformsList === null) {const R = E.currentProgram.getUniforms();- E.uniformsList = sl.seqWithValue(R.seq, E.uniforms);+ E.uniformsList = ll.seqWithValue(R.seq, E.uniforms);}return E.uniformsList;}- function Ha(E, R) {+ function qa(E, R) {const N = Ge.get(E);N.outputColorSpace = R.outputColorSpace, N.batching = R.batching, N.batchingColor = R.batchingColor, N.instancing = R.instancing, N.instancingColor = R.instancingColor, N.instancingMorph = R.instancingMorph, N.skinning = R.skinning, N.morphTargets = R.morphTargets, N.morphNormals = R.morphNormals, N.morphColors = R.morphColors, N.morphTargetsCount = R.morphTargetsCount, N.numClippingPlanes = R.numClippingPlanes, N.numIntersection = R.numClipIntersection, N.vertexAlphas = R.vertexAlphas, N.vertexTangents = R.vertexTangents, N.toneMapping = R.toneMapping;}- function sh(E, R, N, U, P) {- R.isScene !== !0 && (R = Ct), L.resetTextureUnits();- const z = R.fog, X = U.isMeshStandardMaterial ? R.environment : null, Y = T === null ? _.outputColorSpace : T.isXRRenderTarget === !0 ? T.texture.colorSpace : ln, ie = (U.isMeshStandardMaterial ? Z : I).get(U.envMap || X), he = U.vertexColors === !0 && !!N.attributes.color && N.attributes.color.itemSize === 4, ce = !!N.attributes.tangent && (!!U.normalMap || U.anisotropy > 0), fe = !!N.morphAttributes.position, Ae = !!N.morphAttributes.normal, _e = !!N.morphAttributes.color;- let De = Ds;+ function hh(E, R, N, U, P) {+ R.isScene !== !0 && (R = vt), L.resetTextureUnits();+ const z = R.fog, j = U.isMeshStandardMaterial ? R.environment : null, X = T === null ? _.outputColorSpace : T.isXRRenderTarget === !0 ? T.texture.colorSpace : ln, ie = (U.isMeshStandardMaterial ? Z : I).get(U.envMap || j), he = U.vertexColors === !0 && !!N.attributes.color && N.attributes.color.itemSize === 4, ce = !!N.attributes.tangent && (!!U.normalMap || U.anisotropy > 0), fe = !!N.morphAttributes.position, Ae = !!N.morphAttributes.normal, _e = !!N.morphAttributes.color;+ let De = Ls;U.toneMapped && (T === null || T.isXRRenderTarget === !0) && (De = _.toneMapping);const qe = N.morphAttributes.position || N.morphAttributes.normal || N.morphAttributes.color, He = qe !== void 0 ? qe.length : 0, Ne = Ge.get(U), it = p.state.lights;- if (me === !0 && (be === !0 || E !== C)) {- const Nt = E === C && U.id === v;+ if (me === !0 && (be === !0 || E !== v)) {+ const Nt = E === v && U.id === C;Ee.setState(U, E, Nt);}let Le = !1;- U.version === Ne.__version ? (Ne.needsLights && Ne.lightsStateVersion !== it.state.version || Ne.outputColorSpace !== Y || P.isBatchedMesh && Ne.batching === !1 || !P.isBatchedMesh && Ne.batching === !0 || P.isBatchedMesh && Ne.batchingColor === !0 && P.colorTexture === null || P.isBatchedMesh && Ne.batchingColor === !1 && P.colorTexture !== null || P.isInstancedMesh && Ne.instancing === !1 || !P.isInstancedMesh && Ne.instancing === !0 || P.isSkinnedMesh && Ne.skinning === !1 || !P.isSkinnedMesh && Ne.skinning === !0 || P.isInstancedMesh && Ne.instancingColor === !0 && P.instanceColor === null || P.isInstancedMesh && Ne.instancingColor === !1 && P.instanceColor !== null || P.isInstancedMesh && Ne.instancingMorph === !0 && P.morphTexture === null || P.isInstancedMesh && Ne.instancingMorph === !1 && P.morphTexture !== null || Ne.envMap !== ie || U.fog === !0 && Ne.fog !== z || Ne.numClippingPlanes !== void 0 && (Ne.numClippingPlanes !== Ee.numPlanes || Ne.numIntersection !== Ee.numIntersection) || Ne.vertexAlphas !== he || Ne.vertexTangents !== ce || Ne.morphTargets !== fe || Ne.morphNormals !== Ae || Ne.morphColors !== _e || Ne.toneMapping !== De || Ne.morphTargetsCount !== He) && (Le = !0) : (Le = !0, Ne.__version = U.version);+ U.version === Ne.__version ? (Ne.needsLights && Ne.lightsStateVersion !== it.state.version || Ne.outputColorSpace !== X || P.isBatchedMesh && Ne.batching === !1 || !P.isBatchedMesh && Ne.batching === !0 || P.isBatchedMesh && Ne.batchingColor === !0 && P.colorTexture === null || P.isBatchedMesh && Ne.batchingColor === !1 && P.colorTexture !== null || P.isInstancedMesh && Ne.instancing === !1 || !P.isInstancedMesh && Ne.instancing === !0 || P.isSkinnedMesh && Ne.skinning === !1 || !P.isSkinnedMesh && Ne.skinning === !0 || P.isInstancedMesh && Ne.instancingColor === !0 && P.instanceColor === null || P.isInstancedMesh && Ne.instancingColor === !1 && P.instanceColor !== null || P.isInstancedMesh && Ne.instancingMorph === !0 && P.morphTexture === null || P.isInstancedMesh && Ne.instancingMorph === !1 && P.morphTexture !== null || Ne.envMap !== ie || U.fog === !0 && Ne.fog !== z || Ne.numClippingPlanes !== void 0 && (Ne.numClippingPlanes !== Ee.numPlanes || Ne.numIntersection !== Ee.numIntersection) || Ne.vertexAlphas !== he || Ne.vertexTangents !== ce || Ne.morphTargets !== fe || Ne.morphNormals !== Ae || Ne.morphColors !== _e || Ne.toneMapping !== De || Ne.morphTargetsCount !== He) && (Le = !0) : (Le = !0, Ne.__version = U.version);let yt = Ne.currentProgram;- Le === !0 && (yt = Tr(U, R, P));+ Le === !0 && (yt = Nr(U, R, P));let en = !1, xt = !1, At = !1;const Ke = yt.getUniforms(), zt = Ne.uniforms;- if (ze.useProgram(yt.program) && (en = !0, xt = !0, At = !0), U.id !== v && (v = U.id, xt = !0), en || C !== E) {- ze.buffers.depth.getReversed() ? (xe.copy(E.projectionMatrix), n_(xe), i_(xe), Ke.setValue(G, "projectionMatrix", xe)) : Ke.setValue(G, "projectionMatrix", E.projectionMatrix), Ke.setValue(G, "viewMatrix", E.matrixWorldInverse);+ if (ze.useProgram(yt.program) && (en = !0, xt = !0, At = !0), U.id !== C && (C = U.id, xt = !0), en || v !== E) {+ ze.buffers.depth.getReversed() ? (xe.copy(E.projectionMatrix), h_(xe), u_(xe), Ke.setValue(G, "projectionMatrix", xe)) : Ke.setValue(G, "projectionMatrix", E.projectionMatrix), Ke.setValue(G, "viewMatrix", E.matrixWorldInverse);const tn = Ke.map.cameraPosition;tn !== void 0 && tn.setValue(G, $e.setFromMatrixPosition(E.matrixWorld)), pt.logarithmicDepthBuffer && Ke.setValue(G,"logDepthBufFC",2 / (Math.log(E.far + 1) / Math.LN2)- ), (U.isMeshPhongMaterial || U.isMeshToonMaterial || U.isMeshLambertMaterial || U.isMeshBasicMaterial || U.isMeshStandardMaterial || U.isShaderMaterial) && Ke.setValue(G, "isOrthographic", E.isOrthographicCamera === !0), C !== E && (C = E, xt = !0, At = !0);+ ), (U.isMeshPhongMaterial || U.isMeshToonMaterial || U.isMeshLambertMaterial || U.isMeshBasicMaterial || U.isMeshStandardMaterial || U.isShaderMaterial) && Ke.setValue(G, "isOrthographic", E.isOrthographicCamera === !0), v !== E && (v = E, xt = !0, At = !0);}if (P.isSkinnedMesh) {Ke.setOptional(G, P, "bindMatrix"), Ke.setOptional(G, P, "bindMatrixInverse");@@ -23354,19 +23354,19 @@ class pA {}P.isBatchedMesh && (Ke.setOptional(G, P, "batchingTexture"), Ke.setValue(G, "batchingTexture", P._matricesTexture, L), Ke.setOptional(G, P, "batchingIdTexture"), Ke.setValue(G, "batchingIdTexture", P._indirectTexture, L), Ke.setOptional(G, P, "batchingColorTexture"), P._colorsTexture !== null && Ke.setValue(G, "batchingColorTexture", P._colorsTexture, L));const pn = N.morphAttributes;- if ((pn.position !== void 0 || pn.normal !== void 0 || pn.color !== void 0) && Oe.update(P, N, yt), (xt || Ne.receiveShadow !== P.receiveShadow) && (Ne.receiveShadow = P.receiveShadow, Ke.setValue(G, "receiveShadow", P.receiveShadow)), U.isMeshGouraudMaterial && U.envMap !== null && (zt.envMap.value = ie, zt.flipEnvMap.value = ie.isCubeTexture && ie.isRenderTargetTexture === !1 ? -1 : 1), U.isMeshStandardMaterial && U.envMap === null && R.environment !== null && (zt.envMapIntensity.value = R.environmentIntensity), xt && (Ke.setValue(G, "toneMappingExposure", _.toneMappingExposure), Ne.needsLights && Oi(zt, At), z && U.fog === !0 && Ce.refreshFogUniforms(zt, z), Ce.refreshMaterialUniforms(zt, U, Q, j, p.state.transmissionRenderTarget[E.id]), sl.upload(G, Ga(Ne), zt, L)), U.isShaderMaterial && U.uniformsNeedUpdate === !0 && (sl.upload(G, Ga(Ne), zt, L), U.uniformsNeedUpdate = !1), U.isSpriteMaterial && Ke.setValue(G, "center", P.center), Ke.setValue(G, "modelViewMatrix", P.modelViewMatrix), Ke.setValue(G, "normalMatrix", P.normalMatrix), Ke.setValue(G, "modelMatrix", P.matrixWorld), U.isShaderMaterial || U.isRawShaderMaterial) {+ if ((pn.position !== void 0 || pn.normal !== void 0 || pn.color !== void 0) && Oe.update(P, N, yt), (xt || Ne.receiveShadow !== P.receiveShadow) && (Ne.receiveShadow = P.receiveShadow, Ke.setValue(G, "receiveShadow", P.receiveShadow)), U.isMeshGouraudMaterial && U.envMap !== null && (zt.envMap.value = ie, zt.flipEnvMap.value = ie.isCubeTexture && ie.isRenderTargetTexture === !1 ? -1 : 1), U.isMeshStandardMaterial && U.envMap === null && R.environment !== null && (zt.envMapIntensity.value = R.environmentIntensity), xt && (Ke.setValue(G, "toneMappingExposure", _.toneMappingExposure), Ne.needsLights && Qi(zt, At), z && U.fog === !0 && ve.refreshFogUniforms(zt, z), ve.refreshMaterialUniforms(zt, U, Q, Y, p.state.transmissionRenderTarget[E.id]), ll.upload(G, Wa(Ne), zt, L)), U.isShaderMaterial && U.uniformsNeedUpdate === !0 && (ll.upload(G, Wa(Ne), zt, L), U.uniformsNeedUpdate = !1), U.isSpriteMaterial && Ke.setValue(G, "center", P.center), Ke.setValue(G, "modelViewMatrix", P.modelViewMatrix), Ke.setValue(G, "normalMatrix", P.normalMatrix), Ke.setValue(G, "modelMatrix", P.matrixWorld), U.isShaderMaterial || U.isRawShaderMaterial) {const Nt = U.uniformsGroups;- for (let tn = 0, rh = Nt.length; tn < rh; tn++) {- const Vs = Nt[tn];- W.update(Vs, yt), W.bind(Vs, yt);+ for (let tn = 0, uh = Nt.length; tn < uh; tn++) {+ const qs = Nt[tn];+ W.update(qs, yt), W.bind(qs, yt);}}return yt;}- function Oi(E, R) {+ function Qi(E, R) {E.ambientLightColor.needsUpdate = R, E.lightProbe.needsUpdate = R, E.directionalLights.needsUpdate = R, E.directionalLightShadows.needsUpdate = R, E.pointLights.needsUpdate = R, E.pointLightShadows.needsUpdate = R, E.spotLights.needsUpdate = R, E.spotLightShadows.needsUpdate = R, E.rectAreaLights.needsUpdate = R, E.hemisphereLights.needsUpdate = R;}- function As(E) {+ function gs(E) {return E.isMeshLambertMaterial || E.isMeshToonMaterial || E.isMeshPhongMaterial || E.isMeshStandardMaterial || E.isShadowMaterial || E.isShaderMaterial && E.lights === !0;}this.getActiveCubeFace = function() {@@ -23385,7 +23385,7 @@ class pA {const x = G.createFramebuffer();this.setRenderTarget = function(E, R = 0, N = 0) {T = E, w = R, S = N;- let U = !0, P = null, z = !1, X = !1;+ let U = !0, P = null, z = !1, j = !1;if (E) {const ie = Ge.get(E);if (ie.__useDefaultFramebuffer !== void 0)@@ -23403,7 +23403,7 @@ class pA {}}const he = E.texture;- (he.isData3DTexture || he.isDataArrayTexture || he.isCompressedArrayTexture) && (X = !0);+ (he.isData3DTexture || he.isDataArrayTexture || he.isCompressedArrayTexture) && (j = !0);const ce = Ge.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget ? (Array.isArray(ce[R]) ? P = ce[R][N] : P = ce[R], z = !0) : E.samples > 0 && L.useMultisampledRTT(E) === !1 ? P = Ge.get(E).__webglMultisampledFramebuffer : Array.isArray(ce) ? P = ce[N] : P = ce, F.copy(E.viewport), K.copy(E.scissor), q = E.scissorTest;} else@@ -23411,22 +23411,22 @@ class pA {if (N !== 0 && (P = x), ze.bindFramebuffer(G.FRAMEBUFFER, P) && U && ze.drawBuffers(E, P), ze.viewport(F), ze.scissor(K), ze.setScissorTest(q), z) {const ie = Ge.get(E.texture);G.framebufferTexture2D(G.FRAMEBUFFER, G.COLOR_ATTACHMENT0, G.TEXTURE_CUBE_MAP_POSITIVE_X + R, ie.__webglTexture, N);- } else if (X) {+ } else if (j) {const ie = Ge.get(E.texture), he = R;G.framebufferTextureLayer(G.FRAMEBUFFER, G.COLOR_ATTACHMENT0, ie.__webglTexture, N, he);} else if (E !== null && N !== 0) {const ie = Ge.get(E.texture);G.framebufferTexture2D(G.FRAMEBUFFER, G.COLOR_ATTACHMENT0, G.TEXTURE_2D, ie.__webglTexture, N);}- v = -1;- }, this.readRenderTargetPixels = function(E, R, N, U, P, z, X) {+ C = -1;+ }, this.readRenderTargetPixels = function(E, R, N, U, P, z, j) {if (!(E && E.isWebGLRenderTarget)) {console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return;}- let Y = Ge.get(E).__webglFramebuffer;- if (E.isWebGLCubeRenderTarget && X !== void 0 && (Y = Y[X]), Y) {- ze.bindFramebuffer(G.FRAMEBUFFER, Y);+ let X = Ge.get(E).__webglFramebuffer;+ if (E.isWebGLCubeRenderTarget && j !== void 0 && (X = X[j]), X) {+ ze.bindFramebuffer(G.FRAMEBUFFER, X);try {const ie = E.texture, he = ie.format, ce = ie.type;if (!pt.textureFormatReadable(he)) {@@ -23443,13 +23443,13 @@ class pA {ze.bindFramebuffer(G.FRAMEBUFFER, ie);}}- }, this.readRenderTargetPixelsAsync = async function(E, R, N, U, P, z, X) {+ }, this.readRenderTargetPixelsAsync = async function(E, R, N, U, P, z, j) {if (!(E && E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");- let Y = Ge.get(E).__webglFramebuffer;- if (E.isWebGLCubeRenderTarget && X !== void 0 && (Y = Y[X]), Y)+ let X = Ge.get(E).__webglFramebuffer;+ if (E.isWebGLCubeRenderTarget && j !== void 0 && (X = X[j]), X)if (R >= 0 && R <= E.width - U && N >= 0 && N <= E.height - P) {- ze.bindFramebuffer(G.FRAMEBUFFER, Y);+ ze.bindFramebuffer(G.FRAMEBUFFER, X);const ie = E.texture, he = ie.format, ce = ie.type;if (!pt.textureFormatReadable(he))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");@@ -23460,23 +23460,23 @@ class pA {const Ae = T !== null ? Ge.get(T).__webglFramebuffer : null;ze.bindFramebuffer(G.FRAMEBUFFER, Ae);const _e = G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE, 0);- return G.flush(), await t_(G, _e, 4), G.bindBuffer(G.PIXEL_PACK_BUFFER, fe), G.getBufferSubData(G.PIXEL_PACK_BUFFER, 0, z), G.deleteBuffer(fe), G.deleteSync(_e), z;+ return G.flush(), await l_(G, _e, 4), G.bindBuffer(G.PIXEL_PACK_BUFFER, fe), G.getBufferSubData(G.PIXEL_PACK_BUFFER, 0, z), G.deleteBuffer(fe), G.deleteSync(_e), z;} elsethrow new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");}, this.copyFramebufferToTexture = function(E, R = null, N = 0) {- const U = Math.pow(2, -N), P = Math.floor(E.image.width * U), z = Math.floor(E.image.height * U), X = R !== null ? R.x : 0, Y = R !== null ? R.y : 0;- L.setTexture2D(E, 0), G.copyTexSubImage2D(G.TEXTURE_2D, N, 0, 0, X, Y, P, z), ze.unbindTexture();+ const U = Math.pow(2, -N), P = Math.floor(E.image.width * U), z = Math.floor(E.image.height * U), j = R !== null ? R.x : 0, X = R !== null ? R.y : 0;+ L.setTexture2D(E, 0), G.copyTexSubImage2D(G.TEXTURE_2D, N, 0, 0, j, X, P, z), ze.unbindTexture();};const B = G.createFramebuffer(), k = G.createFramebuffer();this.copyTextureToTexture = function(E, R, N = null, U = null, P = 0, z = null) {- z === null && (P !== 0 ? (il("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), z = P, P = 0) : z = 0);- let X, Y, ie, he, ce, fe, Ae, _e, De;+ z === null && (P !== 0 ? (cl("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), z = P, P = 0) : z = 0);+ let j, X, ie, he, ce, fe, Ae, _e, De;const qe = E.isCompressedTexture ? E.mipmaps[z] : E.image;if (N !== null)- X = N.max.x - N.min.x, Y = N.max.y - N.min.y, ie = N.isBox3 ? N.max.z - N.min.z : 1, he = N.min.x, ce = N.min.y, fe = N.isBox3 ? N.min.z : 0;+ j = N.max.x - N.min.x, X = N.max.y - N.min.y, ie = N.isBox3 ? N.max.z - N.min.z : 1, he = N.min.x, ce = N.min.y, fe = N.isBox3 ? N.min.z : 0;else {const pn = Math.pow(2, -P);- X = Math.floor(qe.width * pn), Y = Math.floor(qe.height * pn), E.isDataArrayTexture ? ie = qe.depth : E.isData3DTexture ? ie = Math.floor(qe.depth * pn) : ie = 1, he = 0, ce = 0, fe = 0;+ j = Math.floor(qe.width * pn), X = Math.floor(qe.height * pn), E.isDataArrayTexture ? ie = qe.depth : E.isData3DTexture ? ie = Math.floor(qe.depth * pn) : ie = 1, he = 0, ce = 0, fe = 0;}U !== null ? (Ae = U.x, _e = U.y, De = U.z) : (Ae = 0, _e = 0, De = 0);const He = We.convert(R.format), Ne = We.convert(R.type);@@ -23486,22 +23486,22 @@ class pA {G.pixelStorei(G.UNPACK_ROW_LENGTH, qe.width), G.pixelStorei(G.UNPACK_IMAGE_HEIGHT, qe.height), G.pixelStorei(G.UNPACK_SKIP_PIXELS, he), G.pixelStorei(G.UNPACK_SKIP_ROWS, ce), G.pixelStorei(G.UNPACK_SKIP_IMAGES, fe);const Ke = E.isDataArrayTexture || E.isData3DTexture, zt = R.isDataArrayTexture || R.isData3DTexture;if (E.isDepthTexture) {- const pn = Ge.get(E), Nt = Ge.get(R), tn = Ge.get(pn.__renderTarget), rh = Ge.get(Nt.__renderTarget);- ze.bindFramebuffer(G.READ_FRAMEBUFFER, tn.__webglFramebuffer), ze.bindFramebuffer(G.DRAW_FRAMEBUFFER, rh.__webglFramebuffer);- for (let Vs = 0; Vs < ie; Vs++)- Ke && (G.framebufferTextureLayer(G.READ_FRAMEBUFFER, G.COLOR_ATTACHMENT0, Ge.get(E).__webglTexture, P, fe + Vs), G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER, G.COLOR_ATTACHMENT0, Ge.get(R).__webglTexture, z, De + Vs)), G.blitFramebuffer(he, ce, X, Y, Ae, _e, X, Y, G.DEPTH_BUFFER_BIT, G.NEAREST);+ const pn = Ge.get(E), Nt = Ge.get(R), tn = Ge.get(pn.__renderTarget), uh = Ge.get(Nt.__renderTarget);+ ze.bindFramebuffer(G.READ_FRAMEBUFFER, tn.__webglFramebuffer), ze.bindFramebuffer(G.DRAW_FRAMEBUFFER, uh.__webglFramebuffer);+ for (let qs = 0; qs < ie; qs++)+ Ke && (G.framebufferTextureLayer(G.READ_FRAMEBUFFER, G.COLOR_ATTACHMENT0, Ge.get(E).__webglTexture, P, fe + qs), G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER, G.COLOR_ATTACHMENT0, Ge.get(R).__webglTexture, z, De + qs)), G.blitFramebuffer(he, ce, j, X, Ae, _e, j, X, G.DEPTH_BUFFER_BIT, G.NEAREST);ze.bindFramebuffer(G.READ_FRAMEBUFFER, null), ze.bindFramebuffer(G.DRAW_FRAMEBUFFER, null);} else if (P !== 0 || E.isRenderTargetTexture || Ge.has(E)) {const pn = Ge.get(E), Nt = Ge.get(R);ze.bindFramebuffer(G.READ_FRAMEBUFFER, B), ze.bindFramebuffer(G.DRAW_FRAMEBUFFER, k);for (let tn = 0; tn < ie; tn++)- Ke ? G.framebufferTextureLayer(G.READ_FRAMEBUFFER, G.COLOR_ATTACHMENT0, pn.__webglTexture, P, fe + tn) : G.framebufferTexture2D(G.READ_FRAMEBUFFER, G.COLOR_ATTACHMENT0, G.TEXTURE_2D, pn.__webglTexture, P), zt ? G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER, G.COLOR_ATTACHMENT0, Nt.__webglTexture, z, De + tn) : G.framebufferTexture2D(G.DRAW_FRAMEBUFFER, G.COLOR_ATTACHMENT0, G.TEXTURE_2D, Nt.__webglTexture, z), P !== 0 ? G.blitFramebuffer(he, ce, X, Y, Ae, _e, X, Y, G.COLOR_BUFFER_BIT, G.NEAREST) : zt ? G.copyTexSubImage3D(it, z, Ae, _e, De + tn, he, ce, X, Y) : G.copyTexSubImage2D(it, z, Ae, _e, he, ce, X, Y);+ Ke ? G.framebufferTextureLayer(G.READ_FRAMEBUFFER, G.COLOR_ATTACHMENT0, pn.__webglTexture, P, fe + tn) : G.framebufferTexture2D(G.READ_FRAMEBUFFER, G.COLOR_ATTACHMENT0, G.TEXTURE_2D, pn.__webglTexture, P), zt ? G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER, G.COLOR_ATTACHMENT0, Nt.__webglTexture, z, De + tn) : G.framebufferTexture2D(G.DRAW_FRAMEBUFFER, G.COLOR_ATTACHMENT0, G.TEXTURE_2D, Nt.__webglTexture, z), P !== 0 ? G.blitFramebuffer(he, ce, j, X, Ae, _e, j, X, G.COLOR_BUFFER_BIT, G.NEAREST) : zt ? G.copyTexSubImage3D(it, z, Ae, _e, De + tn, he, ce, j, X) : G.copyTexSubImage2D(it, z, Ae, _e, he, ce, j, X);ze.bindFramebuffer(G.READ_FRAMEBUFFER, null), ze.bindFramebuffer(G.DRAW_FRAMEBUFFER, null);} else- zt ? E.isDataTexture || E.isData3DTexture ? G.texSubImage3D(it, z, Ae, _e, De, X, Y, ie, He, Ne, qe.data) : R.isCompressedArrayTexture ? G.compressedTexSubImage3D(it, z, Ae, _e, De, X, Y, ie, He, qe.data) : G.texSubImage3D(it, z, Ae, _e, De, X, Y, ie, He, Ne, qe) : E.isDataTexture ? G.texSubImage2D(G.TEXTURE_2D, z, Ae, _e, X, Y, He, Ne, qe.data) : E.isCompressedTexture ? G.compressedTexSubImage2D(G.TEXTURE_2D, z, Ae, _e, qe.width, qe.height, He, qe.data) : G.texSubImage2D(G.TEXTURE_2D, z, Ae, _e, X, Y, He, Ne, qe);+ zt ? E.isDataTexture || E.isData3DTexture ? G.texSubImage3D(it, z, Ae, _e, De, j, X, ie, He, Ne, qe.data) : R.isCompressedArrayTexture ? G.compressedTexSubImage3D(it, z, Ae, _e, De, j, X, ie, He, qe.data) : G.texSubImage3D(it, z, Ae, _e, De, j, X, ie, He, Ne, qe) : E.isDataTexture ? G.texSubImage2D(G.TEXTURE_2D, z, Ae, _e, j, X, He, Ne, qe.data) : E.isCompressedTexture ? G.compressedTexSubImage2D(G.TEXTURE_2D, z, Ae, _e, qe.width, qe.height, He, qe.data) : G.texSubImage2D(G.TEXTURE_2D, z, Ae, _e, j, X, He, Ne, qe);G.pixelStorei(G.UNPACK_ROW_LENGTH, Le), G.pixelStorei(G.UNPACK_IMAGE_HEIGHT, yt), G.pixelStorei(G.UNPACK_SKIP_PIXELS, en), G.pixelStorei(G.UNPACK_SKIP_ROWS, xt), G.pixelStorei(G.UNPACK_SKIP_IMAGES, At), z === 0 && R.generateMipmaps && G.generateMipmap(it), ze.unbindTexture();}, this.copyTextureToTexture3D = function(E, R, N = null, U = null, P = 0) {- return il('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'), this.copyTextureToTexture(E, R, N, U, P);+ return cl('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'), this.copyTextureToTexture(E, R, N, U, P);}, this.initRenderTarget = function(E) {Ge.get(E).__webglFramebuffer === void 0 && L.setupRenderTarget(E);}, this.initTexture = function(E) {@@ -23520,7 +23520,7 @@ class pA {* @readonly*/get coordinateSystem() {- return ns;+ return is;}/*** Defines the output color space of the renderer.@@ -23537,7 +23537,7 @@ class pA {t.drawingBufferColorSpace = mt._getDrawingBufferColorSpace(e), t.unpackColorSpace = mt._getUnpackColorSpace();}}-var mo = function() {+var _o = function() {var i = 0, e = document.createElement("div");e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener("click", function(h) {h.preventDefault(), n(++i % e.children.length);@@ -23550,9 +23550,9 @@ var mo = function() {e.children[u].style.display = u === h ? "block" : "none";i = h;}- var s = (performance || Date).now(), r = s, a = 0, o = t(new mo.Panel("FPS", "#0ff", "#002")), c = t(new mo.Panel("MS", "#0f0", "#020"));+ var s = (performance || Date).now(), r = s, a = 0, o = t(new _o.Panel("FPS", "#0ff", "#002")), c = t(new _o.Panel("MS", "#0f0", "#020"));if (self.performance && self.performance.memory)- var l = t(new mo.Panel("MB", "#f08", "#201"));+ var l = t(new _o.Panel("MB", "#f08", "#201"));return n(0), {REVISION: 16,dom: e,@@ -23578,7 +23578,7 @@ var mo = function() {setMode: n};};-mo.Panel = function(i, e, t) {+_o.Panel = function(i, e, t) {var n = 1 / 0, s = 0, r = Math.round, a = r(window.devicePixelRatio || 1), o = 80 * a, c = 48 * a, l = 3 * a, h = 2 * a, u = 3 * a, d = 15 * a, f = 74 * a, m = 30 * a, g = document.createElement("canvas");g.width = o, g.height = c, g.style.cssText = "width:80px;height:48px";var A = g.getContext("2d");@@ -23589,10 +23589,10 @@ mo.Panel = function(i, e, t) {}};};-function AA(i, e) {- if (e === IE)+function _A(i, e) {+ if (e === LE)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), i;- if (e === id || e === Dm) {+ if (e === ld || e === Gm) {let t = i.getIndex();if (t === null) {const a = [], o = i.getAttribute("position");@@ -23604,7 +23604,7 @@ function AA(i, e) {return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), i;}const n = t.count - 2, s = [];- if (e === id)+ if (e === ld)for (let a = 1; a <= n; a++)s.push(t.getX(0)), s.push(t.getX(a)), s.push(t.getX(a + 1));else@@ -23616,7 +23616,7 @@ function AA(i, e) {} elsereturn console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), i;}-class bf extends fs {+class vf extends ps {/*** Constructs a new glTF loader.*@@ -23624,39 +23624,39 @@ class bf extends fs {*/constructor(e) {super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {- return new hI(t);+ return new bI(t);}), this.register(function(t) {- return new uI(t);+ return new xI(t);}), this.register(function(t) {- return new EI(t);+ return new MI(t);}), this.register(function(t) {- return new _I(t);+ return new BI(t);}), this.register(function(t) {- return new yI(t);- }), this.register(function(t) {- return new fI(t);+ return new TI(t);}), this.register(function(t) {- return new pI(t);+ return new _I(t);}), this.register(function(t) {- return new AI(t);+ return new yI(t);}), this.register(function(t) {- return new gI(t);+ return new wI(t);}), this.register(function(t) {- return new lI(t);+ return new vI(t);}), this.register(function(t) {return new mI(t);}), this.register(function(t) {- return new dI(t);+ return new CI(t);+ }), this.register(function(t) {+ return new EI(t);}), this.register(function(t) {- return new xI(t);+ return new II(t);}), this.register(function(t) {- return new bI(t);+ return new SI(t);}), this.register(function(t) {- return new oI(t);+ return new AI(t);}), this.register(function(t) {- return new wI(t);+ return new RI(t);}), this.register(function(t) {- return new CI(t);+ return new NI(t);});}/**@@ -23674,14 +23674,14 @@ class bf extends fs {if (this.resourcePath !== "")a = this.resourcePath;else if (this.path !== "") {- const l = ha.extractUrlBase(e);- a = ha.resolveURL(l, this.path);+ const l = da.extractUrlBase(e);+ a = da.resolveURL(l, this.path);} else- a = ha.extractUrlBase(e);+ a = da.extractUrlBase(e);this.manager.itemStart(e);const o = function(l) {s ? s(l) : console.error(l), r.manager.itemError(e), r.manager.itemEnd(e);- }, c = new Ls(this.manager);+ }, c = new Ps(this.manager);c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) {try {r.parse(l, a, function(h) {@@ -23756,9 +23756,9 @@ class bf extends fs {if (typeof e == "string")r = JSON.parse(e);else if (e instanceof ArrayBuffer)- if (c.decode(new Uint8Array(e, 0, 4)) === h0) {+ if (c.decode(new Uint8Array(e, 0, 4)) === m0) {try {- a[ft.KHR_BINARY_GLTF] = new vI(e);+ a[ft.KHR_BINARY_GLTF] = new FI(e);} catch (u) {s && s(u);return;@@ -23772,7 +23772,7 @@ class bf extends fs {s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return;}- const l = new UI(r, {+ const l = new qI(r, {path: t || this.resourcePath || "",crossOrigin: this.crossOrigin,requestHeader: this.requestHeader,@@ -23790,16 +23790,16 @@ class bf extends fs {const u = r.extensionsUsed[h], d = r.extensionsRequired || [];switch (u) {case ft.KHR_MATERIALS_UNLIT:- a[u] = new cI();+ a[u] = new gI();break;case ft.KHR_DRACO_MESH_COMPRESSION:- a[u] = new SI(r, this.dracoLoader);+ a[u] = new DI(r, this.dracoLoader);break;case ft.KHR_TEXTURE_TRANSFORM:- a[u] = new II();+ a[u] = new LI();break;case ft.KHR_MESH_QUANTIZATION:- a[u] = new MI();+ a[u] = new PI();break;default:d.indexOf(u) >= 0 && o[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');@@ -23822,7 +23822,7 @@ class bf extends fs {});}}-function aI() {+function pI() {let i = {};return {get: function(e) {@@ -23863,7 +23863,7 @@ const ft = {EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"};-class oI {+class AI {constructor(e) {this.parser = e, this.name = ft.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };}@@ -23880,18 +23880,18 @@ class oI {if (s) return s;const r = t.json, c = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];let l;- const h = new Xe(16777215);+ const h = new je(16777215);c.color !== void 0 && h.setRGB(c.color[0], c.color[1], c.color[2], ln);const u = c.range !== void 0 ? c.range : 0;switch (c.type) {case "directional":- l = new n0(h), l.target.position.set(0, 0, -1), l.add(l.target);+ l = new l0(h), l.target.position.set(0, 0, -1), l.add(l.target);break;case "point":- l = new t0(h), l.distance = u;+ l = new c0(h), l.distance = u;break;case "spot":- l = new iy(h), l.distance = u, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, l.angle = c.spot.outerConeAngle, l.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);+ l = new uy(h), l.distance = u, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, l.angle = c.spot.outerConeAngle, l.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);@@ -23909,16 +23909,16 @@ class oI {});}}-class cI {+class gI {constructor() {this.name = ft.KHR_MATERIALS_UNLIT;}getMaterialType() {- return Rs;+ return Ns;}extendParams(e, t, n) {const s = [];- e.color = new Xe(1, 1, 1), e.opacity = 1;+ e.color = new je(1, 1, 1), e.opacity = 1;const r = t.pbrMetallicRoughness;if (r) {if (Array.isArray(r.baseColorFactor)) {@@ -23930,7 +23930,7 @@ class cI {return Promise.all(s);}}-class lI {+class mI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_EMISSIVE_STRENGTH;}@@ -23942,13 +23942,13 @@ class lI {return r !== void 0 && (t.emissiveIntensity = r), Promise.resolve();}}-class hI {+class bI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_CLEARCOAT;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -23962,13 +23962,13 @@ class hI {return Promise.all(r);}}-class uI {+class xI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_DISPERSION;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const s = this.parser.json.materials[e];@@ -23978,13 +23978,13 @@ class uI {return t.dispersion = r.dispersion !== void 0 ? r.dispersion : 0, Promise.resolve();}}-class dI {+class EI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_IRIDESCENCE;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -23994,20 +23994,20 @@ class dI {return a.iridescenceFactor !== void 0 && (t.iridescence = a.iridescenceFactor), a.iridescenceTexture !== void 0 && r.push(n.assignTexture(t, "iridescenceMap", a.iridescenceTexture)), a.iridescenceIor !== void 0 && (t.iridescenceIOR = a.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), a.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = a.iridescenceThicknessMinimum), a.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = a.iridescenceThicknessMaximum), a.iridescenceThicknessTexture !== void 0 && r.push(n.assignTexture(t, "iridescenceThicknessMap", a.iridescenceThicknessTexture)), Promise.all(r);}}-class fI {+class _I {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_SHEEN;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];if (!s.extensions || !s.extensions[this.name])return Promise.resolve();const r = [];- t.sheenColor = new Xe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;+ t.sheenColor = new je(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;const a = s.extensions[this.name];if (a.sheenColorFactor !== void 0) {const o = a.sheenColorFactor;@@ -24016,13 +24016,13 @@ class fI {return a.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = a.sheenRoughnessFactor), a.sheenColorTexture !== void 0 && r.push(n.assignTexture(t, "sheenColorMap", a.sheenColorTexture, Kt)), a.sheenRoughnessTexture !== void 0 && r.push(n.assignTexture(t, "sheenRoughnessMap", a.sheenRoughnessTexture)), Promise.all(r);}}-class pI {+class yI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_TRANSMISSION;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -24032,13 +24032,13 @@ class pI {return a.transmissionFactor !== void 0 && (t.transmission = a.transmissionFactor), a.transmissionTexture !== void 0 && r.push(n.assignTexture(t, "transmissionMap", a.transmissionTexture)), Promise.all(r);}}-class AI {+class wI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_VOLUME;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -24047,16 +24047,16 @@ class AI {const r = [], a = s.extensions[this.name];t.thickness = a.thicknessFactor !== void 0 ? a.thicknessFactor : 0, a.thicknessTexture !== void 0 && r.push(n.assignTexture(t, "thicknessMap", a.thicknessTexture)), t.attenuationDistance = a.attenuationDistance || 1 / 0;const o = a.attenuationColor || [1, 1, 1];- return t.attenuationColor = new Xe().setRGB(o[0], o[1], o[2], ln), Promise.all(r);+ return t.attenuationColor = new je().setRGB(o[0], o[1], o[2], ln), Promise.all(r);}}-class gI {+class vI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_IOR;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const s = this.parser.json.materials[e];@@ -24066,13 +24066,13 @@ class gI {return t.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();}}-class mI {+class CI {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_SPECULAR;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -24081,16 +24081,16 @@ class mI {const r = [], a = s.extensions[this.name];t.specularIntensity = a.specularFactor !== void 0 ? a.specularFactor : 1, a.specularTexture !== void 0 && r.push(n.assignTexture(t, "specularIntensityMap", a.specularTexture));const o = a.specularColorFactor || [1, 1, 1];- return t.specularColor = new Xe().setRGB(o[0], o[1], o[2], ln), a.specularColorTexture !== void 0 && r.push(n.assignTexture(t, "specularColorMap", a.specularColorTexture, Kt)), Promise.all(r);+ return t.specularColor = new je().setRGB(o[0], o[1], o[2], ln), a.specularColorTexture !== void 0 && r.push(n.assignTexture(t, "specularColorMap", a.specularColorTexture, Kt)), Promise.all(r);}}-class bI {+class SI {constructor(e) {this.parser = e, this.name = ft.EXT_MATERIALS_BUMP;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -24100,13 +24100,13 @@ class bI {return t.bumpScale = a.bumpFactor !== void 0 ? a.bumpFactor : 1, a.bumpTexture !== void 0 && r.push(n.assignTexture(t, "bumpMap", a.bumpTexture)), Promise.all(r);}}-class xI {+class II {constructor(e) {this.parser = e, this.name = ft.KHR_MATERIALS_ANISOTROPY;}getMaterialType(e) {const n = this.parser.json.materials[e];- return !n.extensions || !n.extensions[this.name] ? null : ki;+ return !n.extensions || !n.extensions[this.name] ? null : Ui;}extendMaterialParams(e, t) {const n = this.parser, s = n.json.materials[e];@@ -24116,7 +24116,7 @@ class xI {return a.anisotropyStrength !== void 0 && (t.anisotropy = a.anisotropyStrength), a.anisotropyRotation !== void 0 && (t.anisotropyRotation = a.anisotropyRotation), a.anisotropyTexture !== void 0 && r.push(n.assignTexture(t, "anisotropyMap", a.anisotropyTexture)), Promise.all(r);}}-class EI {+class MI {constructor(e) {this.parser = e, this.name = ft.KHR_TEXTURE_BASISU;}@@ -24133,7 +24133,7 @@ class EI {return t.loadTextureImage(e, r.source, a);}}-class _I {+class BI {constructor(e) {this.parser = e, this.name = ft.EXT_TEXTURE_WEBP;}@@ -24150,7 +24150,7 @@ class _I {return n.loadTextureImage(e, a.source, c);}}-class yI {+class TI {constructor(e) {this.parser = e, this.name = ft.EXT_TEXTURE_AVIF;}@@ -24167,7 +24167,7 @@ class yI {return n.loadTextureImage(e, a.source, c);}}-class wI {+class RI {constructor(e) {this.name = ft.EXT_MESHOPT_COMPRESSION, this.parser = e;}@@ -24193,7 +24193,7 @@ class wI {return null;}}-class CI {+class NI {constructor(e) {this.name = ft.EXT_MESH_GPU_INSTANCING, this.parser = e;}@@ -24211,13 +24211,13 @@ class CI {return o.length < 1 ? null : (o.push(this.parser.createNodeMesh(e)), Promise.all(o).then((l) => {const h = l.pop(), u = h.isGroup ? h.children : [h], d = l[0].count, f = [];for (const m of u) {- const g = new st(), A = new H(), p = new Yn(), y = new H(1, 1, 1), b = new Ym(m.geometry, m.material, d);+ const g = new st(), A = new H(), p = new Xn(), y = new H(1, 1, 1), b = new n0(m.geometry, m.material, d);for (let _ = 0; _ < d; _++)c.TRANSLATION && A.fromBufferAttribute(c.TRANSLATION, _), c.ROTATION && p.fromBufferAttribute(c.ROTATION, _), c.SCALE && y.fromBufferAttribute(c.SCALE, _), b.setMatrixAt(_, g.compose(A, p, y));for (const _ in c)if (_ === "_COLOR_0") {const M = c[_];- b.instanceColor = new ad(M.array, M.itemSize, M.normalized);+ b.instanceColor = new dd(M.array, M.itemSize, M.normalized);} else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && m.geometry.setAttribute(_, c[_]);kt.prototype.copy.call(b, m), this.parser.assignFinalMaterial(b), f.push(b);}@@ -24225,30 +24225,30 @@ class CI {}));}}-const h0 = "glTF", Ja = 12, gA = { JSON: 1313821514, BIN: 5130562 };-class vI {+const m0 = "glTF", to = 12, yA = { JSON: 1313821514, BIN: 5130562 };+class FI {constructor(e) {this.name = ft.KHR_BINARY_GLTF, this.content = null, this.body = null;- const t = new DataView(e, 0, Ja), n = new TextDecoder();+ const t = new DataView(e, 0, to), n = new TextDecoder();if (this.header = {magic: n.decode(new Uint8Array(e.slice(0, 4))),version: t.getUint32(4, !0),length: t.getUint32(8, !0)- }, this.header.magic !== h0)+ }, this.header.magic !== m0)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if (this.header.version < 2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");- const s = this.header.length - Ja, r = new DataView(e, Ja);+ const s = this.header.length - to, r = new DataView(e, to);let a = 0;for (; a < s; ) {const o = r.getUint32(a, !0);a += 4;const c = r.getUint32(a, !0);- if (a += 4, c === gA.JSON) {- const l = new Uint8Array(e, Ja + a, o);+ if (a += 4, c === yA.JSON) {+ const l = new Uint8Array(e, to + a, o);this.content = n.decode(l);- } else if (c === gA.BIN) {- const l = Ja + a;+ } else if (c === yA.BIN) {+ const l = to + a;this.body = e.slice(l, l + o);}a += o;@@ -24257,7 +24257,7 @@ class vI {throw new Error("THREE.GLTFLoader: JSON content not found.");}}-class SI {+class DI {constructor(e, t) {if (!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");@@ -24266,13 +24266,13 @@ class SI {decodePrimitive(e, t) {const n = this.json, s = this.dracoLoader, r = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, c = {}, l = {};for (const h in a) {- const u = ud[h] || h.toLowerCase();+ const u = md[h] || h.toLowerCase();o[u] = a[h];}for (const h in e.attributes) {- const u = ud[h] || h.toLowerCase();+ const u = md[h] || h.toLowerCase();if (a[h] !== void 0) {- const d = n.accessors[e.attributes[h]], f = ua[d.componentType];+ const d = n.accessors[e.attributes[h]], f = fa[d.componentType];l[u] = f.name, c[u] = d.normalized === !0;}}@@ -24289,7 +24289,7 @@ class SI {});}}-class II {+class LI {constructor() {this.name = ft.KHR_TEXTURE_TRANSFORM;}@@ -24297,12 +24297,12 @@ class II {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 MI {+class PI {constructor() {this.name = ft.KHR_MESH_QUANTIZATION;}}-class u0 extends Wo {+class b0 extends Yo {constructor(e, t, n, s) {super(e, t, n, s);}@@ -24321,11 +24321,11 @@ class u0 extends Wo {return r;}}-const BI = new Yn();-class TI extends u0 {+const kI = new Xn();+class UI extends b0 {interpolate_(e, t, n, s) {const r = super.interpolate_(e, t, n, s);- return BI.fromArray(r).normalize().toArray(r), r;+ return kI.fromArray(r).normalize().toArray(r), r;}}const Zn = {@@ -24336,25 +24336,25 @@ const Zn = {TRIANGLES: 4,TRIANGLE_STRIP: 5,TRIANGLE_FAN: 6-}, ua = {+}, fa = {5120: Int8Array,5121: Uint8Array,5122: Int16Array,5123: Uint16Array,5125: Uint32Array,5126: Float32Array-}, mA = {+}, wA = {9728: Pn,9729: qt,- 9984: vm,- 9985: el,- 9986: ro,- 9987: ni-}, bA = {- 33071: bi,- 33648: hl,- 10497: xa-}, Qh = {+ 9984: Nm,+ 9985: rl,+ 9986: lo,+ 9987: ii+}, vA = {+ 33071: xi,+ 33648: Al,+ 10497: wa+}, qh = {SCALAR: 1,VEC2: 2,VEC3: 3,@@ -24362,7 +24362,7 @@ const Zn = {MAT2: 4,MAT3: 9,MAT4: 16-}, ud = {+}, md = {POSITION: "position",NORMAL: "normal",TANGENT: "tangent",@@ -24373,41 +24373,41 @@ const Zn = {COLOR_0: "color",WEIGHTS_0: "skinWeight",JOINTS_0: "skinIndex"-}, ws = {+}, vs = {scale: "scale",translation: "position",rotation: "quaternion",weights: "morphTargetInfluences"-}, RI = {+}, OI = {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: Bo-}, Gh = {+ LINEAR: Do,+ STEP: Fo+}, Kh = {OPAQUE: "OPAQUE",MASK: "MASK",BLEND: "BLEND"};-function NI(i) {- return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new No({+function QI(i) {+ return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new Po({color: 16777215,emissive: 0,metalness: 1,roughness: 1,transparent: !1,depthTest: !0,- side: hs+ side: us})), i.DefaultMaterial;}-function Js(i, e, t) {+function $s(i, e, t) {for (const n in t.extensions)i[n] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[n] = t.extensions[n]);}function Xi(i, e) {e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(i.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));}-function FI(i, e, t) {+function GI(i, e, t) {let n = !1, s = !1, r = !1;for (let l = 0, h = e.length; l < h; l++) {const u = e[l];@@ -24439,7 +24439,7 @@ function FI(i, e, t) {return n && (i.morphAttributes.position = h), s && (i.morphAttributes.normal = u), r && (i.morphAttributes.color = d), i.morphTargetsRelative = !0, i;});}-function DI(i, e) {+function HI(i, e) {if (i.updateMorphTargets(), e.weights !== void 0)for (let t = 0, n = e.weights.length; t < n; t++)i.morphTargetInfluences[t] = e.weights[t];@@ -24453,22 +24453,22 @@ function DI(i, e) {console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");}}-function LI(i) {+function zI(i) {let e;const t = i.extensions && i.extensions[ft.KHR_DRACO_MESH_COMPRESSION];- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Hh(t.attributes) : e = i.indices + ":" + Hh(i.attributes) + ":" + i.mode, i.targets !== void 0)+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + jh(t.attributes) : e = i.indices + ":" + jh(i.attributes) + ":" + i.mode, i.targets !== void 0)for (let n = 0, s = i.targets.length; n < s; n++)- e += ":" + Hh(i.targets[n]);+ e += ":" + jh(i.targets[n]);return e;}-function Hh(i) {+function jh(i) {let e = "";const t = Object.keys(i).sort();for (let n = 0, s = t.length; n < s; n++)e += t[n] + ":" + i[t[n]] + ";";return e;}-function dd(i) {+function bd(i) {switch (i) {case Int8Array:return 1 / 127;@@ -24482,13 +24482,13 @@ function dd(i) {throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");}}-function PI(i) {+function VI(i) {return i.search(/\.jpe?g($|\?)/i) > 0 || i.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : i.search(/\.webp($|\?)/i) > 0 || i.search(/^data\:image\/webp/) === 0 ? "image/webp" : i.search(/\.ktx2($|\?)/i) > 0 || i.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";}-const kI = new st();-class UI {+const WI = new st();+class qI {constructor(e = {}, t = {}) {- this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new aI(), 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 pI(), 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, s = -1, r = !1, a = -1;if (typeof navigator < "u") {const o = navigator.userAgent;@@ -24496,7 +24496,7 @@ class UI {const c = o.match(/Version\/(\d+)/);s = n && c ? parseInt(c[1], 10) : -1, r = o.indexOf("Firefox") > -1, a = r ? o.match(/Firefox\/([0-9]+)\./)[1] : -1;}- typeof createImageBitmap > "u" || n && s < 17 || r && a < 98 ? this.textureLoader = new ey(this.options.manager) : this.textureLoader = new oy(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Ls(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);+ typeof createImageBitmap > "u" || n && s < 17 || r && a < 98 ? this.textureLoader = new cy(this.options.manager) : this.textureLoader = new Ay(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Ps(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);}setExtensions(e) {this.extensions = e;@@ -24526,7 +24526,7 @@ class UI {parser: n,userData: {}};- return Js(r, o, s), Xi(o, s), Promise.all(n._invokeAll(function(c) {+ return $s(r, o, s), Xi(o, s), Promise.all(n._invokeAll(function(c) {return c.afterRoot && c.afterRoot(o);})).then(function() {for (const c of o.scenes)@@ -24707,7 +24707,7 @@ class UI {return Promise.resolve(this.extensions[ft.KHR_BINARY_GLTF].body);const s = this.options;return new Promise(function(r, a) {- n.load(ha.resolveURL(t.uri, s.path), r, void 0, function() {+ n.load(da.resolveURL(t.uri, s.path), r, void 0, function() {a(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));});});@@ -24736,25 +24736,25 @@ class UI {loadAccessor(e) {const t = this, n = this.json, s = this.json.accessors[e];if (s.bufferView === void 0 && s.sparse === void 0) {- const a = Qh[s.type], o = ua[s.componentType], c = s.normalized === !0, l = new o(s.count * a);+ const a = qh[s.type], o = fa[s.componentType], c = s.normalized === !0, l = new o(s.count * a);return Promise.resolve(new _n(l, a, c));}const r = [];return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(a) {- const o = a[0], c = Qh[s.type], l = ua[s.componentType], h = l.BYTES_PER_ELEMENT, u = h * c, d = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, m = s.normalized === !0;+ const o = a[0], c = qh[s.type], l = fa[s.componentType], h = l.BYTES_PER_ELEMENT, u = h * c, d = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, m = s.normalized === !0;let g, A;if (f && f !== u) {const p = Math.floor(d / f), y = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + p + ":" + s.count;let b = t.cache.get(y);- b || (g = new l(o, p * f, s.count * f / h), b = new T_(g, f / h), t.cache.add(y, b)), A = new cf(b, c, d % f / h, m);+ b || (g = new l(o, p * f, s.count * f / h), b = new U_(g, f / h), t.cache.add(y, b)), A = new pf(b, c, d % f / h, m);} elseo === null ? g = new l(s.count * c) : g = new l(o, d, s.count * c), A = new _n(g, c, m);if (s.sparse !== void 0) {- const p = Qh.SCALAR, y = ua[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, _ = s.sparse.values.byteOffset || 0, M = new y(a[1], b, s.sparse.count * p), w = new l(a[2], _, s.sparse.count * c);+ const p = qh.SCALAR, y = fa[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, _ = s.sparse.values.byteOffset || 0, M = new y(a[1], b, s.sparse.count * p), w = new l(a[2], _, s.sparse.count * c);o !== null && (A = new _n(A.array.slice(), A.itemSize, A.normalized)), A.normalized = !1;for (let S = 0, T = M.length; S < T; S++) {- const v = M[S];- if (A.setX(v, w[S * c]), c >= 2 && A.setY(v, w[S * c + 1]), c >= 3 && A.setZ(v, w[S * c + 2]), c >= 4 && A.setW(v, w[S * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");+ const C = M[S];+ if (A.setX(C, w[S * c]), c >= 2 && A.setY(C, w[S * c + 1]), c >= 3 && A.setZ(C, w[S * c + 2]), c >= 4 && A.setW(C, w[S * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");}A.normalized = m;}@@ -24784,7 +24784,7 @@ class UI {const l = this.loadImageSource(t, n).then(function(h) {h.flipY = !1, h.name = a.name || o.name || "", h.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (h.name = o.uri);const d = (r.samplers || {})[a.sampler] || {};- return h.magFilter = mA[d.magFilter] || qt, h.minFilter = mA[d.minFilter] || ni, h.wrapS = bA[d.wrapS] || xa, h.wrapT = bA[d.wrapT] || xa, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Pn && h.minFilter !== qt, s.associations.set(h, { textures: e }), h;+ return h.magFilter = wA[d.magFilter] || qt, h.minFilter = wA[d.minFilter] || ii, h.wrapS = vA[d.wrapS] || wa, h.wrapT = vA[d.wrapT] || wa, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Pn && h.minFilter !== qt, s.associations.set(h, { textures: e }), h;}).catch(function() {return null;});@@ -24810,10 +24810,10 @@ class UI {t.isImageBitmapLoader === !0 && (m = function(g) {const A = new cn(g);A.needsUpdate = !0, d(A);- }), t.load(ha.resolveURL(u, r.path), m, void 0, f);+ }), t.load(da.resolveURL(u, r.path), m, void 0, f);});}).then(function(u) {- return l === !0 && o.revokeObjectURL(c), Xi(u, a), u.userData.mimeType = a.mimeType || PI(a.uri), u;+ return l === !0 && o.revokeObjectURL(c), Xi(u, a), u.userData.mimeType = a.mimeType || VI(a.uri), u;}).catch(function(u) {throw console.error("THREE.GLTFLoader: Couldn't load texture", c), u;});@@ -24860,11 +24860,11 @@ class UI {if (e.isPoints) {const o = "PointsMaterial:" + n.uuid;let c = this.cache.get(o);- c || (c = new df(), Ni.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, c.sizeAttenuation = !1, this.cache.add(o, c)), n = c;+ c || (c = new bf(), Fi.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, c.sizeAttenuation = !1, this.cache.add(o, c)), n = c;} else if (e.isLine) {const o = "LineBasicMaterial:" + n.uuid;let c = this.cache.get(o);- c || (c = new Vo(), Ni.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, this.cache.add(o, c)), n = c;+ c || (c = new Xo(), Fi.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, this.cache.add(o, c)), n = c;}if (s || r || a) {let o = "ClonedMaterial:" + n.uuid + ":";@@ -24875,7 +24875,7 @@ class UI {e.material = n;}getMaterialType() {- return No;+ return Po;}/*** Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials@@ -24893,7 +24893,7 @@ class UI {a = u.getMaterialType(), l.push(u.extendParams(o, r, t));} else {const u = r.pbrMetallicRoughness || {};- if (o.color = new Xe(1, 1, 1), o.opacity = 1, Array.isArray(u.baseColorFactor)) {+ if (o.color = new je(1, 1, 1), o.opacity = 1, Array.isArray(u.baseColorFactor)) {const d = u.baseColorFactor;o.color.setRGB(d[0], d[1], d[2], ln), o.opacity = d[3];}@@ -24903,19 +24903,19 @@ class UI {return d.extendMaterialParams && d.extendMaterialParams(e, o);})));}- r.doubleSided === !0 && (o.side = Bi);- const h = r.alphaMode || Gh.OPAQUE;- if (h === Gh.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, h === Gh.MASK && (o.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && a !== Rs && (l.push(t.assignTexture(o, "normalMap", r.normalTexture)), o.normalScale = new Ze(1, 1), r.normalTexture.scale !== void 0)) {+ r.doubleSided === !0 && (o.side = Ti);+ const h = r.alphaMode || Kh.OPAQUE;+ if (h === Kh.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, h === Kh.MASK && (o.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && a !== Ns && (l.push(t.assignTexture(o, "normalMap", r.normalTexture)), o.normalScale = new Ze(1, 1), r.normalTexture.scale !== void 0)) {const u = r.normalTexture.scale;o.normalScale.set(u, u);}- if (r.occlusionTexture !== void 0 && a !== Rs && (l.push(t.assignTexture(o, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && a !== Rs) {+ if (r.occlusionTexture !== void 0 && a !== Ns && (l.push(t.assignTexture(o, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (o.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && a !== Ns) {const u = r.emissiveFactor;- o.emissive = new Xe().setRGB(u[0], u[1], u[2], ln);+ o.emissive = new je().setRGB(u[0], u[1], u[2], ln);}- return r.emissiveTexture !== void 0 && a !== Rs && l.push(t.assignTexture(o, "emissiveMap", r.emissiveTexture, Kt)), Promise.all(l).then(function() {+ return r.emissiveTexture !== void 0 && a !== Ns && l.push(t.assignTexture(o, "emissiveMap", r.emissiveTexture, Kt)), Promise.all(l).then(function() {const u = new a(o);- return r.name && (u.name = r.name), Xi(u, r), t.associations.set(u, { materials: e }), r.extensions && Js(s, u, r), u;+ return r.name && (u.name = r.name), Xi(u, r), t.associations.set(u, { materials: e }), r.extensions && $s(s, u, r), u;});}/**@@ -24926,7 +24926,7 @@ class UI {* @return {string}*/createUniqueName(e) {- const t = vt.sanitizeNodeName(e || "");+ const t = Ct.sanitizeNodeName(e || "");return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);}/**@@ -24942,17 +24942,17 @@ class UI {const t = this, n = this.extensions, s = this.primitiveCache;function r(o) {return n[ft.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o, t).then(function(c) {- return xA(c, o, t);+ return CA(c, o, t);});}const a = [];for (let o = 0, c = e.length; o < c; o++) {- const l = e[o], h = LI(l), u = s[h];+ const l = e[o], h = zI(l), u = s[h];if (u)a.push(u.promise);else {let d;- l.extensions && l.extensions[ft.KHR_DRACO_MESH_COMPRESSION] ? d = r(l) : d = xA(new Hn(), l, t), s[h] = { primitive: l, promise: d }, a.push(d);+ l.extensions && l.extensions[ft.KHR_DRACO_MESH_COMPRESSION] ? d = r(l) : d = CA(new Hn(), l, t), s[h] = { primitive: l, promise: d }, a.push(d);}}return Promise.all(a);@@ -24967,7 +24967,7 @@ class UI {loadMesh(e) {const t = this, n = this.json, s = this.extensions, r = n.meshes[e], a = r.primitives, o = [];for (let c = 0, l = a.length; c < l; c++) {- const h = a[c].material === void 0 ? NI(this.cache) : this.getDependency("material", a[c].material);+ const h = a[c].material === void 0 ? QI(this.cache) : this.getDependency("material", a[c].material);o.push(h);}return o.push(t.loadGeometries(a)), Promise.all(o).then(function(c) {@@ -24977,18 +24977,18 @@ class UI {let p;const y = l[f];if (A.mode === Zn.TRIANGLES || A.mode === Zn.TRIANGLE_STRIP || A.mode === Zn.TRIANGLE_FAN || A.mode === void 0)- p = r.isSkinnedMesh === !0 ? new N_(g, y) : new Jt(g, y), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), A.mode === Zn.TRIANGLE_STRIP ? p.geometry = AA(p.geometry, Dm) : A.mode === Zn.TRIANGLE_FAN && (p.geometry = AA(p.geometry, id));+ p = r.isSkinnedMesh === !0 ? new Q_(g, y) : new Jt(g, y), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), A.mode === Zn.TRIANGLE_STRIP ? p.geometry = _A(p.geometry, Gm) : A.mode === Zn.TRIANGLE_FAN && (p.geometry = _A(p.geometry, ld));else if (A.mode === Zn.LINES)- p = new Ul(g, y);+ p = new zl(g, y);else if (A.mode === Zn.LINE_STRIP)- p = new uf(g, y);+ p = new mf(g, y);else if (A.mode === Zn.LINE_LOOP)- p = new k_(g, y);+ p = new W_(g, y);else if (A.mode === Zn.POINTS)- p = new U_(g, y);+ p = new q_(g, y);elsethrow new Error("THREE.GLTFLoader: Primitive mode unsupported: " + A.mode);- Object.keys(p.geometry.morphAttributes).length > 0 && DI(p, r), p.name = t.createUniqueName(r.name || "mesh_" + e), Xi(p, r), A.extensions && Js(s, p, A), t.assignFinalMaterial(p), u.push(p);+ Object.keys(p.geometry.morphAttributes).length > 0 && HI(p, r), p.name = t.createUniqueName(r.name || "mesh_" + e), Xi(p, r), A.extensions && $s(s, p, A), t.assignFinalMaterial(p), u.push(p);}for (let f = 0, m = u.length; f < m; f++)t.associations.set(u[f], {@@ -24996,9 +24996,9 @@ class UI {primitives: f});if (u.length === 1)- return r.extensions && Js(s, u[0], r), u[0];- const d = new lr();- r.extensions && Js(s, d, r), t.associations.set(d, { meshes: e });+ return r.extensions && $s(s, u[0], r), u[0];+ const d = new ur();+ r.extensions && $s(s, d, r), t.associations.set(d, { meshes: e });for (let f = 0, m = u.length; f < m; f++)d.add(u[f]);return d;@@ -25018,7 +25018,7 @@ class UI {console.warn("THREE.GLTFLoader: Missing camera parameters.");return;}- return n.type === "perspective" ? t = new Cn(km.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new pf(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Xi(t, n), Promise.resolve(t);+ return n.type === "perspective" ? t = new vn(Vm.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new Ef(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Xi(t, n), Promise.resolve(t);}/*** Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins@@ -25042,7 +25042,7 @@ class UI {} elseconsole.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);}- return new lf(o, c);+ return new Af(o, c);});}/**@@ -25070,12 +25070,12 @@ class UI {const _ = d[y], M = f[y], w = m[y], S = g[y], T = A[y];if (_ === void 0) continue;_.updateMatrix && _.updateMatrix();- const v = n._createAnimationTracks(_, M, w, S, T);- if (v)- for (let C = 0; C < v.length; C++)- p.push(v[C]);+ const C = n._createAnimationTracks(_, M, w, S, T);+ if (C)+ for (let v = 0; v < C.length; v++)+ p.push(C[v]);}- return new cd(r, void 0, p);+ return new pd(r, void 0, p);});}createNodeMesh(e) {@@ -25108,7 +25108,7 @@ class UI {]).then(function(l) {const h = l[0], u = l[1], d = l[2];d !== null && h.traverse(function(f) {- f.isSkinnedMesh && f.bind(d, kI);+ f.isSkinnedMesh && f.bind(d, WI);});for (let f = 0, m = u.length; f < m; f++)h.add(u[f]);@@ -25132,10 +25132,10 @@ class UI {o.push(l);}), this.nodeCache[e] = Promise.all(o).then(function(l) {let h;- if (r.isBone === !0 ? h = new Xm() : l.length > 1 ? h = new lr() : l.length === 1 ? h = l[0] : h = new kt(), h !== l[0])+ if (r.isBone === !0 ? h = new t0() : l.length > 1 ? h = new ur() : l.length === 1 ? h = l[0] : h = new kt(), h !== l[0])for (let u = 0, d = l.length; u < d; u++)h.add(l[u]);- if (r.name && (h.userData.name = r.name, h.name = a), Xi(h, r), r.extensions && Js(n, h, r), r.matrix !== void 0) {+ if (r.name && (h.userData.name = r.name, h.name = a), Xi(h, r), r.extensions && $s(n, h, r), r.matrix !== void 0) {const u = new st();u.fromArray(r.matrix), h.applyMatrix4(u);} else@@ -25151,8 +25151,8 @@ class UI {* @return {Promise<Group>}*/loadScene(e) {- const t = this.extensions, n = this.json.scenes[e], s = this, r = new lr();- n.name && (r.name = s.createUniqueName(n.name)), Xi(r, n), n.extensions && Js(t, r, n);+ const t = this.extensions, n = this.json.scenes[e], s = this, r = new ur();+ n.name && (r.name = s.createUniqueName(n.name)), Xi(r, n), n.extensions && $s(t, r, n);const a = n.nodes || [], o = [];for (let c = 0, l = a.length; c < l; c++)o.push(s.getDependency("node", a[c]));@@ -25162,7 +25162,7 @@ class UI {const l = (h) => {const u = /* @__PURE__ */ new Map();for (const [d, f] of s.associations)- (d instanceof Ni || d instanceof cn) && u.set(d, f);+ (d instanceof Fi || d instanceof cn) && u.set(d, f);return h.traverse((d) => {const f = s.associations.get(d);f != null && u.set(d, f);@@ -25173,29 +25173,29 @@ class UI {}_createAnimationTracks(e, t, n, s, r) {const a = [], o = e.name ? e.name : e.uuid, c = [];- ws[r.path] === ws.weights ? e.traverse(function(d) {+ vs[r.path] === vs.weights ? e.traverse(function(d) {d.morphTargetInfluences && c.push(d.name ? d.name : d.uuid);}) : c.push(o);let l;- switch (ws[r.path]) {- case ws.weights:- l = ya;+ switch (vs[r.path]) {+ case vs.weights:+ l = Sa;break;- case ws.rotation:- l = wa;+ case vs.rotation:+ l = Ia;break;- case ws.translation:- case ws.scale:- l = Ca;+ case vs.translation:+ case vs.scale:+ l = Ma;break;default:- n.itemSize === 1 ? l = ya : l = Ca;+ n.itemSize === 1 ? l = Sa : l = Ma;break;}- const h = s.interpolation !== void 0 ? RI[s.interpolation] : To, u = this._getArrayFromAccessor(n);+ const h = s.interpolation !== void 0 ? OI[s.interpolation] : Do, u = this._getArrayFromAccessor(n);for (let d = 0, f = c.length; d < f; d++) {const m = new l(- c[d] + "." + ws[r.path],+ c[d] + "." + vs[r.path],t.array,u,h@@ -25207,7 +25207,7 @@ class UI {_getArrayFromAccessor(e) {let t = e.array;if (e.normalized) {- const n = dd(t.constructor), s = new Float32Array(t.length);+ const n = bd(t.constructor), s = new Float32Array(t.length);for (let r = 0, a = t.length; r < a; r++)s[r] = t[r] * n;t = s;@@ -25216,13 +25216,13 @@ class UI {}_createCubicSplineTrackInterpolant(e) {e.createInterpolant = function(n) {- const s = this instanceof wa ? TI : u0;+ const s = this instanceof Ia ? UI : b0;return new s(this.times, this.values, this.getValueSize() / 3, n);}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;}}-function OI(i, e, t) {- const n = e.attributes, s = new Li();+function KI(i, e, t) {+ const n = e.attributes, s = new Pi();if (n.POSITION !== void 0) {const o = t.json.accessors[n.POSITION], c = o.min, l = o.max;if (c !== void 0 && l !== void 0) {@@ -25230,7 +25230,7 @@ function OI(i, e, t) {new H(c[0], c[1], c[2]),new H(l[0], l[1], l[2])), o.normalized) {- const h = dd(ua[o.componentType]);+ const h = bd(fa[o.componentType]);s.min.multiplyScalar(h), s.max.multiplyScalar(h);}} else {@@ -25248,7 +25248,7 @@ function OI(i, e, t) {const d = t.json.accessors[u.POSITION], f = d.min, m = d.max;if (f !== void 0 && m !== void 0) {if (c.setX(Math.max(Math.abs(f[0]), Math.abs(m[0]))), c.setY(Math.max(Math.abs(f[1]), Math.abs(m[1]))), c.setZ(Math.max(Math.abs(f[2]), Math.abs(m[2]))), d.normalized) {- const g = dd(ua[d.componentType]);+ const g = bd(fa[d.componentType]);c.multiplyScalar(g);}o.max(c);@@ -25259,10 +25259,10 @@ function OI(i, e, t) {s.expandByVector(o);}i.boundingBox = s;- const a = new Pi();+ const a = new ki();s.getCenter(a.center), a.radius = s.min.distanceTo(s.max) / 2, i.boundingSphere = a;}-function xA(i, e, t) {+function CA(i, e, t) {const n = e.attributes, s = [];function r(a, o) {return t.getDependency("accessor", a).then(function(c) {@@ -25270,7 +25270,7 @@ function xA(i, e, t) {});}for (const a in n) {- const o = ud[a] || a.toLowerCase();+ const o = md[a] || a.toLowerCase();o in i.attributes || s.push(r(n[a], o));}if (e.indices !== void 0 && !i.index) {@@ -25279,11 +25279,11 @@ function xA(i, e, t) {});s.push(a);}- return mt.workingColorSpace !== ln && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${mt.workingColorSpace}" not supported.`), Xi(i, e), OI(i, e, t), Promise.all(s).then(function() {- return e.targets !== void 0 ? FI(i, e.targets, t) : i;+ return mt.workingColorSpace !== ln && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${mt.workingColorSpace}" not supported.`), Xi(i, e), KI(i, e, t), Promise.all(s).then(function() {+ return e.targets !== void 0 ? GI(i, e.targets, t) : i;});}-var QI = (function() {+var jI = (function() {var i = "b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb", e = "b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLp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PsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb", t = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 3, 2, 0, 0, 5, 3, 1, 0, 1, 12, 1, 0, 10, 22, 2, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11, 7, 0, 65, 0, 253, 15, 26, 11]), n = new Uint8Array([32, 0, 65, 2, 1, 106, 34, 33, 3, 128, 11, 4, 13, 64, 6, 253, 10, 7, 15, 116, 127, 5, 8, 12, 40, 16, 19, 54, 20, 9, 27, 255, 113, 17, 42, 67, 24, 23, 146, 148, 18, 14, 22, 45, 70, 69, 56, 114, 101, 21, 25, 63, 75, 136, 108, 28, 118, 29, 73, 115]);if (typeof WebAssembly != "object")return {@@ -25302,10 +25302,10 @@ var QI = (function() {return y.buffer.slice(0, M);}function c(p, y, b, _, M, w) {- var S = r.exports.sbrk, T = b + 3 & -4, v = S(T * _), C = S(M.length), F = new Uint8Array(r.exports.memory.buffer);- F.set(M, C);- var K = p(v, b, _, C, M.length);- if (K == 0 && w && w(v, T, _), y.set(F.subarray(v, v + b * _)), S(v - S(0)), K != 0)+ var S = r.exports.sbrk, T = b + 3 & -4, C = S(T * _), v = S(M.length), F = new Uint8Array(r.exports.memory.buffer);+ F.set(M, v);+ var K = p(C, b, _, v, M.length);+ if (K == 0 && w && w(C, T, _), y.set(F.subarray(C, C + b * _)), S(C - S(0)), K != 0)throw new Error("Malformed buffer data: " + K);}var l = {@@ -25337,9 +25337,9 @@ var QI = (function() {function g(p, y, b, _, M) {for (var w = u[0], S = 1; S < u.length; ++S)u[S].pending < w.pending && (w = u[S]);- return new Promise(function(T, v) {- var C = new Uint8Array(b), F = d++;- w.pending += p, w.requests[F] = { resolve: T, reject: v }, w.object.postMessage({ id: F, count: p, size: y, source: C, mode: _, filter: M }, [C.buffer]);+ return new Promise(function(T, C) {+ var v = new Uint8Array(b), F = d++;+ w.pending += p, w.requests[F] = { resolve: T, reject: C }, w.object.postMessage({ id: F, count: p, size: y, source: v, mode: _, filter: M }, [v.buffer]);});}function A(p) {@@ -25379,7 +25379,7 @@ var QI = (function() {}};})();-const EA = { type: "change" }, xf = { type: "start" }, d0 = { type: "end" }, Fc = new zo(), _A = new Ts(), GI = Math.cos(70 * km.DEG2RAD), nn = new H(), Un = 2 * Math.PI, Bt = {+const SA = { type: "change" }, Cf = { type: "start" }, x0 = { type: "end" }, Uc = new jo(), IA = new Rs(), XI = Math.cos(70 * Vm.DEG2RAD), nn = new H(), Un = 2 * Math.PI, Bt = {NONE: -1,ROTATE: 0,DOLLY: 1,@@ -25388,8 +25388,8 @@ const EA = { type: "change" }, xf = { type: "start" }, d0 = { type: "end" }, FcTOUCH_PAN: 4,TOUCH_DOLLY_PAN: 5,TOUCH_DOLLY_ROTATE: 6-}, zh = 1e-6;-class HI extends wy {+}, Xh = 1e-6;+class YI extends Ry {/*** Constructs a new controls instance.*@@ -25397,7 +25397,7 @@ class HI extends wy {* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.*/constructor(e, t = null) {- super(e, t), this.state = Bt.NONE, this.target = new H(), this.cursor = new H(), 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: oa.ROTATE, MIDDLE: oa.DOLLY, RIGHT: oa.PAN }, this.touches = { ONE: $r.ROTATE, TWO: $r.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new H(), this._lastQuaternion = new Yn(), this._lastTargetPosition = new H(), this._quat = new Yn().setFromUnitVectors(e.up, new H(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Hp(), this._sphericalDelta = new Hp(), this._scale = 1, this._panOffset = new H(), this._rotateStart = new Ze(), this._rotateEnd = new Ze(), this._rotateDelta = new Ze(), this._panStart = new Ze(), this._panEnd = new Ze(), this._panDelta = new Ze(), this._dollyStart = new Ze(), this._dollyEnd = new Ze(), this._dollyDelta = new Ze(), this._dollyDirection = new H(), this._mouse = new Ze(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = VI.bind(this), this._onPointerDown = zI.bind(this), this._onPointerUp = WI.bind(this), this._onContextMenu = ZI.bind(this), this._onMouseWheel = XI.bind(this), this._onKeyDown = YI.bind(this), this._onTouchStart = jI.bind(this), this._onTouchMove = JI.bind(this), this._onMouseDown = qI.bind(this), this._onMouseMove = KI.bind(this), this._interceptControlDown = $I.bind(this), this._interceptControlUp = e1.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();+ super(e, t), this.state = Bt.NONE, this.target = new H(), this.cursor = new H(), 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: la.ROTATE, MIDDLE: la.DOLLY, RIGHT: la.PAN }, this.touches = { ONE: ta.ROTATE, TWO: ta.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new H(), this._lastQuaternion = new Xn(), this._lastTargetPosition = new H(), this._quat = new Xn().setFromUnitVectors(e.up, new H(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new jp(), this._sphericalDelta = new jp(), this._scale = 1, this._panOffset = new H(), this._rotateStart = new Ze(), this._rotateEnd = new Ze(), this._rotateDelta = new Ze(), this._panStart = new Ze(), this._panEnd = new Ze(), this._panDelta = new Ze(), this._dollyStart = new Ze(), this._dollyEnd = new Ze(), this._dollyDelta = new Ze(), this._dollyDirection = new H(), this._mouse = new Ze(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ZI.bind(this), this._onPointerDown = JI.bind(this), this._onPointerUp = $I.bind(this), this._onContextMenu = a1.bind(this), this._onMouseWheel = n1.bind(this), this._onKeyDown = i1.bind(this), this._onTouchStart = s1.bind(this), this._onTouchMove = r1.bind(this), this._onMouseDown = e1.bind(this), this._onMouseMove = t1.bind(this), this._interceptControlDown = o1.bind(this), this._interceptControlUp = c1.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";@@ -25458,7 +25458,7 @@ class HI extends wy {* was called, or the initial state.*/reset() {- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(EA), this.update(), this.state = Bt.NONE;+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(SA), this.update(), this.state = Bt.NONE;}update(e = null) {const t = this.object.position;@@ -25488,12 +25488,12 @@ class HI extends wy {l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), a = nn.length();} elseconsole.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;- a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (Fc.origin.copy(this.object.position), Fc.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Fc.direction)) < GI ? this.object.lookAt(this.target) : (_A.setFromNormalAndCoplanarPoint(this.object.up, this.target), Fc.intersectPlane(_A, this.target))));+ a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (Uc.origin.copy(this.object.position), Uc.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Uc.direction)) < XI ? this.object.lookAt(this.target) : (IA.setFromNormalAndCoplanarPoint(this.object.up, this.target), Uc.intersectPlane(IA, this.target))));} else if (this.object.isOrthographicCamera) {const a = this.object.zoom;this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), a !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);}- return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > zh || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > zh || this._lastTargetPosition.distanceToSquared(this.target) > zh ? (this.dispatchEvent(EA), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;+ return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > Xh || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Xh || this._lastTargetPosition.distanceToSquared(this.target) > Xh ? (this.dispatchEvent(SA), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;}_getAutoRotationAngle(e) {return e !== null ? Un / 60 * this.autoRotateSpeed * e : Un / 60 / 60 * this.autoRotateSpeed;@@ -25685,16 +25685,16 @@ class HI extends wy {return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;}}-function zI(i) {+function JI(i) {this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));}-function VI(i) {+function ZI(i) {this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));}-function WI(i) {+function $I(i) {switch (this._removePointer(i), this._pointers.length) {case 0:- this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(d0), this.state = Bt.NONE;+ this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(x0), this.state = Bt.NONE;break;case 1:const e = this._pointers[0], t = this._pointerPositions[e];@@ -25702,7 +25702,7 @@ function WI(i) {break;}}-function qI(i) {+function e1(i) {let e;switch (i.button) {case 0:@@ -25718,11 +25718,11 @@ function qI(i) {e = -1;}switch (e) {- case oa.DOLLY:+ case la.DOLLY:if (this.enableZoom === !1) return;this._handleMouseDownDolly(i), this.state = Bt.DOLLY;break;- case oa.ROTATE:+ case la.ROTATE:if (i.ctrlKey || i.metaKey || i.shiftKey) {if (this.enablePan === !1) return;this._handleMouseDownPan(i), this.state = Bt.PAN;@@ -25731,7 +25731,7 @@ function qI(i) {this._handleMouseDownRotate(i), this.state = Bt.ROTATE;}break;- case oa.PAN:+ case la.PAN:if (i.ctrlKey || i.metaKey || i.shiftKey) {if (this.enableRotate === !1) return;this._handleMouseDownRotate(i), this.state = Bt.ROTATE;@@ -25743,9 +25743,9 @@ function qI(i) {default:this.state = Bt.NONE;}- this.state !== Bt.NONE && this.dispatchEvent(xf);+ this.state !== Bt.NONE && this.dispatchEvent(Cf);}-function KI(i) {+function t1(i) {switch (this.state) {case Bt.ROTATE:if (this.enableRotate === !1) return;@@ -25761,21 +25761,21 @@ function KI(i) {break;}}-function XI(i) {- this.enabled === !1 || this.enableZoom === !1 || this.state !== Bt.NONE || (i.preventDefault(), this.dispatchEvent(xf), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(d0));+function n1(i) {+ this.enabled === !1 || this.enableZoom === !1 || this.state !== Bt.NONE || (i.preventDefault(), this.dispatchEvent(Cf), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(x0));}-function YI(i) {+function i1(i) {this.enabled !== !1 && this._handleKeyDown(i);}-function jI(i) {+function s1(i) {switch (this._trackPointer(i), this._pointers.length) {case 1:switch (this.touches.ONE) {- case $r.ROTATE:+ case ta.ROTATE:if (this.enableRotate === !1) return;this._handleTouchStartRotate(i), this.state = Bt.TOUCH_ROTATE;break;- case $r.PAN:+ case ta.PAN:if (this.enablePan === !1) return;this._handleTouchStartPan(i), this.state = Bt.TOUCH_PAN;break;@@ -25785,11 +25785,11 @@ function jI(i) {break;case 2:switch (this.touches.TWO) {- case $r.DOLLY_PAN:+ case ta.DOLLY_PAN:if (this.enableZoom === !1 && this.enablePan === !1) return;this._handleTouchStartDollyPan(i), this.state = Bt.TOUCH_DOLLY_PAN;break;- case $r.DOLLY_ROTATE:+ case ta.DOLLY_ROTATE:if (this.enableZoom === !1 && this.enableRotate === !1) return;this._handleTouchStartDollyRotate(i), this.state = Bt.TOUCH_DOLLY_ROTATE;break;@@ -25800,9 +25800,9 @@ function jI(i) {default:this.state = Bt.NONE;}- this.state !== Bt.NONE && this.dispatchEvent(xf);+ this.state !== Bt.NONE && this.dispatchEvent(Cf);}-function JI(i) {+function r1(i) {switch (this._trackPointer(i), this.state) {case Bt.TOUCH_ROTATE:if (this.enableRotate === !1) return;@@ -25824,37 +25824,37 @@ function JI(i) {this.state = Bt.NONE;}}-function ZI(i) {+function a1(i) {this.enabled !== !1 && i.preventDefault();}-function $I(i) {+function o1(i) {i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));}-function e1(i) {+function c1(i) {i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));}-class t1 extends rd {+class l1 extends ud {constructor() {super();- const e = new Na();+ const e = new Pa();e.deleteAttribute("uv");- const t = new No({ side: Ln }), n = new No(), s = new t0(16777215, 900, 28, 2);+ const t = new Po({ side: Ln }), n = new Po(), s = new c0(16777215, 900, 28, 2);s.position.set(0.418, 16.199, 0.3), this.add(s);const r = new Jt(e, t);r.position.set(-0.757, 13.219, 0.717), r.scale.set(31.713, 28.305, 28.591), this.add(r);- const a = new Ym(e, n, 6), o = new kt();+ const a = new n0(e, n, 6), o = new kt();o.position.set(-10.906, 2.009, 1.846), o.rotation.set(0, -0.195, 0), o.scale.set(2.328, 7.905, 4.651), o.updateMatrix(), a.setMatrixAt(0, o.matrix), o.position.set(-5.607, -0.754, -0.758), o.rotation.set(0, 0.994, 0), o.scale.set(1.97, 1.534, 3.955), o.updateMatrix(), a.setMatrixAt(1, o.matrix), o.position.set(6.167, 0.857, 7.803), o.rotation.set(0, 0.561, 0), o.scale.set(3.927, 6.285, 3.687), o.updateMatrix(), a.setMatrixAt(2, o.matrix), o.position.set(-2.017, 0.018, 6.124), o.rotation.set(0, 0.333, 0), o.scale.set(2.002, 4.566, 2.064), o.updateMatrix(), a.setMatrixAt(3, o.matrix), o.position.set(2.291, -0.756, -2.621), o.rotation.set(0, -0.286, 0), o.scale.set(1.546, 1.552, 1.496), o.updateMatrix(), a.setMatrixAt(4, o.matrix), o.position.set(-2.193, -0.369, -5.547), o.rotation.set(0, 0.516, 0), o.scale.set(3.875, 3.487, 2.986), o.updateMatrix(), a.setMatrixAt(5, o.matrix), this.add(a);- const c = new Jt(e, qr(50));+ const c = new Jt(e, jr(50));c.position.set(-16.116, 14.37, 8.208), c.scale.set(0.1, 2.428, 2.739), this.add(c);- const l = new Jt(e, qr(50));+ const l = new Jt(e, jr(50));l.position.set(-16.109, 18.021, -8.207), l.scale.set(0.1, 2.425, 2.751), this.add(l);- const h = new Jt(e, qr(17));+ const h = new Jt(e, jr(17));h.position.set(14.904, 12.198, -1.832), h.scale.set(0.15, 4.265, 6.331), this.add(h);- const u = new Jt(e, qr(43));+ const u = new Jt(e, jr(43));u.position.set(-0.462, 8.89, 14.52), u.scale.set(4.38, 5.441, 0.088), this.add(u);- const d = new Jt(e, qr(20));+ const d = new Jt(e, jr(20));d.position.set(3.235, 11.486, -12.541), d.scale.set(2.5, 2, 0.1), this.add(d);- const f = new Jt(e, qr(100));+ const f = new Jt(e, jr(100));f.position.set(0, 20, 0), f.scale.set(1, 0.1, 1), this.add(f);}/**@@ -25870,17 +25870,17 @@ class t1 extends rd {t.dispose();}}-function qr(i) {- const e = new Rs();+function jr(i) {+ const e = new Ns();return e.color.setScalar(i), e;}-function n1(i) {+function h1(i) {if (!(typeof window > "u")) {var e = document.createElement("style");return e.setAttribute("type", "text/css"), e.innerHTML = i, document.head.appendChild(e), i;}}-function ia(i, e) {+function ra(i, e) {var t = i.__state.conversionName.toString(), n = Math.round(i.r), s = Math.round(i.g), r = Math.round(i.b), a = i.a, o = Math.round(i.h), c = i.s.toFixed(1), l = i.v.toFixed(1);if (e || t === "THREE_CHAR_HEX" || t === "SIX_CHAR_HEX") {for (var h = i.hex.toString(16); h.length < 6; )@@ -25908,10 +25908,10 @@ function ia(i, e) {}return "unknown format";}-var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {+var MA = Array.prototype.forEach, no = Array.prototype.slice, ue = {BREAK: {},extend: function(e) {- return this.each(Za.call(arguments, 1), function(t) {+ return this.each(no.call(arguments, 1), function(t) {var n = this.isObject(t) ? Object.keys(t) : [];n.forEach((function(s) {this.isUndefined(t[s]) || (e[s] = t[s]);@@ -25919,7 +25919,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {}, this), e;},defaults: function(e) {- return this.each(Za.call(arguments, 1), function(t) {+ return this.each(no.call(arguments, 1), function(t) {var n = this.isObject(t) ? Object.keys(t) : [];n.forEach((function(s) {this.isUndefined(e[s]) && (e[s] = t[s]);@@ -25927,16 +25927,16 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {}, this), e;},compose: function() {- var e = Za.call(arguments);+ var e = no.call(arguments);return function() {- for (var t = Za.call(arguments), n = e.length - 1; n >= 0; n--)+ for (var t = no.call(arguments), n = e.length - 1; n >= 0; n--)t = [e[n].apply(this, t)];return t[0];};},each: function(e, t, n) {if (e) {- if (yA && e.forEach && e.forEach === yA)+ if (MA && e.forEach && e.forEach === MA)e.forEach(t, n);else if (e.length === e.length + 0) {var s = void 0, r = void 0;@@ -25964,7 +25964,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {};},toArray: function(e) {- return e.toArray ? e.toArray() : Za.call(e);+ return e.toArray ? e.toArray() : no.call(e);},isUndefined: function(e) {return e === void 0;@@ -26000,7 +26000,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {isFunction: function(e) {return e instanceof Function;}-}, i1 = [+}, u1 = [{litmus: ue.isString,conversions: {@@ -26012,7 +26012,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString(), 0)};},- write: ia+ write: ra},SIX_CHAR_HEX: {read: function(e) {@@ -26022,7 +26022,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {hex: parseInt("0x" + t[1].toString(), 0)};},- write: ia+ write: ra},CSS_RGB: {read: function(e) {@@ -26034,7 +26034,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {b: parseFloat(t[3])};},- write: ia+ write: ra},CSS_RGBA: {read: function(e) {@@ -26047,7 +26047,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {a: parseFloat(t[4])};},- write: ia+ write: ra}}},@@ -26177,17 +26177,17 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {}}}-], $a = void 0, Dc = void 0, fd = function() {- Dc = !1;+], io = void 0, Oc = void 0, xd = function() {+ Oc = !1;var e = arguments.length > 1 ? ue.toArray(arguments) : arguments[0];- return ue.each(i1, function(t) {+ return ue.each(u1, function(t) {if (t.litmus(e))return ue.each(t.conversions, function(n, s) {- if ($a = n.read(e), Dc === !1 && $a !== !1)- return Dc = $a, $a.conversionName = s, $a.conversion = n, ue.BREAK;+ if (io = n.read(e), Oc === !1 && io !== !1)+ return Oc = io, io.conversionName = s, io.conversion = n, ue.BREAK;}), ue.BREAK;- }), Dc;-}, wA = void 0, yl = {+ }), Oc;+}, BA = void 0, Il = {hsv_to_rgb: function(e, t, n) {var s = Math.floor(e / 60) % 6, r = e / 60 - Math.floor(e / 60), a = n * (1 - t), o = n * (1 - r * t), c = n * (1 - (1 - r) * t), l = [[n, c, a], [o, n, a], [a, n, c], [a, o, n], [c, a, n], [n, a, o]][s];return {@@ -26220,16 +26220,16 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {return e >> t * 8 & 255;},hex_with_component: function(e, t, n) {- return n << (wA = t * 8) | e & ~(255 << wA);+ return n << (BA = t * 8) | e & ~(255 << BA);}-}, s1 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {+}, d1 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {return typeof i;} : function(i) {return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;-}, _i = function(i, e) {+}, yi = function(i, e) {if (!(i instanceof e))throw new TypeError("Cannot call a class as a function");-}, yi = /* @__PURE__ */ (function() {+}, wi = /* @__PURE__ */ (function() {function i(e, t) {for (var n = 0; n < t.length; n++) {var s = t[n];@@ -26239,7 +26239,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {return function(e, t, n) {return t && i(e.prototype, t), n && i(e, n), e;};-})(), Us = function i(e, t, n) {+})(), Qs = function i(e, t, n) {e === null && (e = Function.prototype);var s = Object.getOwnPropertyDescriptor(e, t);if (s === void 0) {@@ -26251,7 +26251,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {var a = s.get;return a === void 0 ? void 0 : a.call(n);}-}, Gs = function(i, e) {+}, zs = function(i, e) {if (typeof e != "function" && e !== null)throw new TypeError("Super expression must either be null or a function, not " + typeof e);i.prototype = Object.create(e && e.prototype, {@@ -26262,25 +26262,25 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {configurable: !0}}), e && (Object.setPrototypeOf ? Object.setPrototypeOf(i, e) : i.__proto__ = e);-}, Hs = function(i, e) {+}, Vs = function(i, e) {if (!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e && (typeof e == "object" || typeof e == "function") ? e : i;}, bn = (function() {function i() {- if (_i(this, i), this.__state = fd.apply(this, arguments), this.__state === !1)+ if (yi(this, i), this.__state = xd.apply(this, arguments), this.__state === !1)throw new Error("Failed to interpret color arguments");this.__state.a = this.__state.a || 1;}- return yi(i, [{+ return wi(i, [{key: "toString",value: function() {- return ia(this);+ return ra(this);}}, {key: "toHexString",value: function() {- return ia(this, !0);+ return ra(this, !0);}}, {key: "toOriginal",@@ -26289,7 +26289,7 @@ var yA = Array.prototype.forEach, Za = Array.prototype.slice, ue = {}}]), i;})();-function Ef(i, e, t) {+function Sf(i, e, t) {Object.defineProperty(i, e, {get: function() {return this.__state.space === "RGB" ? this.__state[e] : (bn.recalculateRGB(this, e, t), this.__state[e]);@@ -26299,7 +26299,7 @@ function Ef(i, e, t) {}});}-function _f(i, e) {+function If(i, e) {Object.defineProperty(i, e, {get: function() {return this.__state.space === "HSV" ? this.__state[e] : (bn.recalculateHSV(this), this.__state[e]);@@ -26311,26 +26311,26 @@ function _f(i, e) {}bn.recalculateRGB = function(i, e, t) {if (i.__state.space === "HEX")- i.__state[e] = yl.component_from_hex(i.__state.hex, t);+ i.__state[e] = Il.component_from_hex(i.__state.hex, t);else if (i.__state.space === "HSV")- ue.extend(i.__state, yl.hsv_to_rgb(i.__state.h, i.__state.s, i.__state.v));+ ue.extend(i.__state, Il.hsv_to_rgb(i.__state.h, i.__state.s, i.__state.v));elsethrow new Error("Corrupted color state");};bn.recalculateHSV = function(i) {- var e = yl.rgb_to_hsv(i.r, i.g, i.b);+ var e = Il.rgb_to_hsv(i.r, i.g, i.b);ue.extend(i.__state, {s: e.s,v: e.v}), ue.isNaN(e.h) ? ue.isUndefined(i.__state.h) && (i.__state.h = 0) : i.__state.h = e.h;};bn.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"];-Ef(bn.prototype, "r", 2);-Ef(bn.prototype, "g", 1);-Ef(bn.prototype, "b", 0);-_f(bn.prototype, "h");-_f(bn.prototype, "s");-_f(bn.prototype, "v");+Sf(bn.prototype, "r", 2);+Sf(bn.prototype, "g", 1);+Sf(bn.prototype, "b", 0);+If(bn.prototype, "h");+If(bn.prototype, "s");+If(bn.prototype, "v");Object.defineProperty(bn.prototype, "a", {get: function() {return this.__state.a;@@ -26341,17 +26341,17 @@ Object.defineProperty(bn.prototype, "a", {});Object.defineProperty(bn.prototype, "hex", {get: function() {- return this.__state.space !== "HEX" && (this.__state.hex = yl.rgb_to_hex(this.r, this.g, this.b), this.__state.space = "HEX"), this.__state.hex;+ return this.__state.space !== "HEX" && (this.__state.hex = Il.rgb_to_hex(this.r, this.g, this.b), this.__state.space = "HEX"), this.__state.hex;},set: function(e) {this.__state.space = "HEX", this.__state.hex = e;}});-var Sr = (function() {+var Mr = (function() {function i(e, t) {- _i(this, i), this.initialValue = e[t], this.domElement = document.createElement("div"), this.object = e, this.property = t, this.__onChange = void 0, this.__onFinishChange = void 0;+ yi(this, i), this.initialValue = e[t], this.domElement = document.createElement("div"), this.object = e, this.property = t, this.__onChange = void 0, this.__onFinishChange = void 0;}- return yi(i, [{+ return wi(i, [{key: "onChange",value: function(t) {return this.__onChange = t, this;@@ -26382,21 +26382,21 @@ var Sr = (function() {return this.initialValue !== this.getValue();}}]), i;-})(), r1 = {+})(), f1 = {HTMLEvents: ["change"],MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],KeyboardEvents: ["keydown"]-}, f0 = {};-ue.each(r1, function(i, e) {+}, E0 = {};+ue.each(f1, function(i, e) {ue.each(i, function(t) {- f0[t] = e;+ E0[t] = e;});});-var a1 = /(\d+(\.\d+)?)px/;+var p1 = /(\d+(\.\d+)?)px/;function Ci(i) {if (i === "0" || ue.isUndefined(i))return 0;- var e = i.match(a1);+ var e = i.match(p1);return ue.isNull(e) ? 0 : parseFloat(e[1]);}var te = {@@ -26411,7 +26411,7 @@ var te = {ue.isUndefined(r) && (r = !0), ue.isUndefined(s) && (s = !0), e.style.position = "absolute", r && (e.style.left = 0, e.style.right = 0), s && (e.style.top = 0, e.style.bottom = 0);},fakeEvent: function(e, t, n, s) {- var r = n || {}, a = f0[t];+ var r = n || {}, a = E0[t];if (!a)throw new Error("Event type " + t + " not supported.");var o = document.createEvent(a);@@ -26508,34 +26508,34 @@ var te = {isActive: function(e) {return e === document.activeElement && (e.type || e.href);}-}, p0 = (function(i) {- Gs(e, i);+}, _0 = (function(i) {+ zs(e, i);function e(t, n) {- _i(this, e);- var s = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), r = s;+ yi(this, e);+ var s = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), r = s;s.__prev = s.getValue(), s.__checkbox = document.createElement("input"), s.__checkbox.setAttribute("type", "checkbox");function a() {r.setValue(!r.__prev);}return te.bind(s.__checkbox, "change", a, !1), s.domElement.appendChild(s.__checkbox), s.updateDisplay(), s;}- return yi(e, [{+ return wi(e, [{key: "setValue",value: function(n) {- var s = Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "setValue", this).call(this, n);+ var s = Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "setValue", this).call(this, n);return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), s;}}, {key: "updateDisplay",value: function() {- return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0, this.__prev = !0) : (this.__checkbox.checked = !1, this.__prev = !1), Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);+ return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0, this.__prev = !0) : (this.__checkbox.checked = !1, this.__prev = !1), Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);}}]), e;-})(Sr), o1 = (function(i) {- Gs(e, i);+})(Mr), A1 = (function(i) {+ zs(e, i);function e(t, n, s) {- _i(this, e);- var r = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), a = s, o = r;+ yi(this, e);+ var r = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), a = s, o = r;if (r.__select = document.createElement("select"), ue.isArray(a)) {var c = {};ue.each(a, function(l) {@@ -26550,23 +26550,23 @@ var te = {o.setValue(l);}), r.domElement.appendChild(r.__select), r;}- return yi(e, [{+ return wi(e, [{key: "setValue",value: function(n) {- var s = Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "setValue", this).call(this, n);+ var s = Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "setValue", this).call(this, n);return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), s;}}, {key: "updateDisplay",value: function() {- return te.isActive(this.__select) ? this : (this.__select.value = this.getValue(), Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this));+ return te.isActive(this.__select) ? this : (this.__select.value = this.getValue(), Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this));}}]), e;-})(Sr), c1 = (function(i) {- Gs(e, i);+})(Mr), g1 = (function(i) {+ zs(e, i);function e(t, n) {- _i(this, e);- var s = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), r = s;+ yi(this, e);+ var s = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), r = s;function a() {r.setValue(r.__input.value);}@@ -26577,29 +26577,29 @@ var te = {c.keyCode === 13 && this.blur();}), s.updateDisplay(), s.domElement.appendChild(s.__input), s;}- return yi(e, [{+ return wi(e, [{key: "updateDisplay",value: function() {- return te.isActive(this.__input) || (this.__input.value = this.getValue()), Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);+ return te.isActive(this.__input) || (this.__input.value = this.getValue()), Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);}}]), e;-})(Sr);-function CA(i) {+})(Mr);+function TA(i) {var e = i.toString();return e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0;}-var A0 = (function(i) {- Gs(e, i);+var y0 = (function(i) {+ zs(e, i);function e(t, n, s) {- _i(this, e);- var r = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), a = s || {};- return r.__min = a.min, r.__max = a.max, r.__step = a.step, ue.isUndefined(r.__step) ? r.initialValue === 0 ? r.__impliedStep = 1 : r.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(r.initialValue)) / Math.LN10)) / 10 : r.__impliedStep = r.__step, r.__precision = CA(r.__impliedStep), r;+ yi(this, e);+ var r = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), a = s || {};+ return r.__min = a.min, r.__max = a.max, r.__step = a.step, ue.isUndefined(r.__step) ? r.initialValue === 0 ? r.__impliedStep = 1 : r.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(r.initialValue)) / Math.LN10)) / 10 : r.__impliedStep = r.__step, r.__precision = TA(r.__impliedStep), r;}- return yi(e, [{+ return wi(e, [{key: "setValue",value: function(n) {var s = n;- return this.__min !== void 0 && s < this.__min ? s = this.__min : this.__max !== void 0 && s > this.__max && (s = this.__max), this.__step !== void 0 && s % this.__step !== 0 && (s = Math.round(s / this.__step) * this.__step), Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "setValue", this).call(this, s);+ return this.__min !== void 0 && s < this.__min ? s = this.__min : this.__max !== void 0 && s > this.__max && (s = this.__max), this.__step !== void 0 && s % this.__step !== 0 && (s = Math.round(s / this.__step) * this.__step), Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "setValue", this).call(this, s);}}, {key: "min",@@ -26614,19 +26614,19 @@ var A0 = (function(i) {}, {key: "step",value: function(n) {- return this.__step = n, this.__impliedStep = n, this.__precision = CA(n), this;+ return this.__step = n, this.__impliedStep = n, this.__precision = TA(n), this;}}]), e;-})(Sr);-function l1(i, e) {+})(Mr);+function m1(i, e) {var t = Math.pow(10, e);return Math.round(i * t) / t;}-var wl = (function(i) {- Gs(e, i);+var Ml = (function(i) {+ zs(e, i);function e(t, n, s) {- _i(this, e);- var r = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n, s));+ yi(this, e);+ var r = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n, s));r.__truncationSuspended = !1;var a = r, o = void 0;function c() {@@ -26653,21 +26653,21 @@ var wl = (function(i) {m.keyCode === 13 && (a.__truncationSuspended = !0, this.blur(), a.__truncationSuspended = !1, l());}), r.updateDisplay(), r.domElement.appendChild(r.__input), r;}- return yi(e, [{+ return wi(e, [{key: "updateDisplay",value: function() {- return this.__input.value = this.__truncationSuspended ? this.getValue() : l1(this.getValue(), this.__precision), Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);+ return this.__input.value = this.__truncationSuspended ? this.getValue() : m1(this.getValue(), this.__precision), Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);}}]), e;-})(A0);-function vA(i, e, t, n, s) {+})(y0);+function RA(i, e, t, n, s) {return n + (s - n) * ((i - e) / (t - e));}-var pd = (function(i) {- Gs(e, i);+var Ed = (function(i) {+ zs(e, i);function e(t, n, s, r, a) {- _i(this, e);- var o = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n, { min: s, max: r, step: a })), c = o;+ yi(this, e);+ var o = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n, { min: s, max: r, step: a })), c = o;o.__background = document.createElement("div"), o.__foreground = document.createElement("div"), te.bind(o.__background, "mousedown", l), te.bind(o.__background, "touchstart", d), te.addClass(o.__background, "slider"), te.addClass(o.__foreground, "slider-fg");function l(g) {document.activeElement.blur(), te.bind(window, "mousemove", h), te.bind(window, "mouseup", u), h(g);@@ -26675,7 +26675,7 @@ var pd = (function(i) {function h(g) {g.preventDefault();var A = c.__background.getBoundingClientRect();- return c.setValue(vA(g.clientX, A.left, A.right, c.__min, c.__max)), !1;+ return c.setValue(RA(g.clientX, A.left, A.right, c.__min, c.__max)), !1;}function u() {te.unbind(window, "mousemove", h), te.unbind(window, "mouseup", u), c.__onFinishChange && c.__onFinishChange.call(c, c.getValue());@@ -26685,40 +26685,40 @@ var pd = (function(i) {}function f(g) {var A = g.touches[0].clientX, p = c.__background.getBoundingClientRect();- c.setValue(vA(A, p.left, p.right, c.__min, c.__max));+ c.setValue(RA(A, p.left, p.right, c.__min, c.__max));}function m() {te.unbind(window, "touchmove", f), te.unbind(window, "touchend", m), c.__onFinishChange && c.__onFinishChange.call(c, c.getValue());}return o.updateDisplay(), o.__background.appendChild(o.__foreground), o.domElement.appendChild(o.__background), o;}- return yi(e, [{+ return wi(e, [{key: "updateDisplay",value: function() {var n = (this.getValue() - this.__min) / (this.__max - this.__min);- return this.__foreground.style.width = n * 100 + "%", Us(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);+ return this.__foreground.style.width = n * 100 + "%", Qs(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "updateDisplay", this).call(this);}}]), e;-})(A0), g0 = (function(i) {- Gs(e, i);+})(y0), w0 = (function(i) {+ zs(e, i);function e(t, n, s) {- _i(this, e);- var r = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), a = r;+ yi(this, e);+ var r = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n)), a = r;return r.__button = document.createElement("div"), r.__button.innerHTML = s === void 0 ? "Fire" : s, te.bind(r.__button, "click", function(o) {return o.preventDefault(), a.fire(), !1;}), te.addClass(r.__button, "button"), r.domElement.appendChild(r.__button), r;}- return yi(e, [{+ return wi(e, [{key: "fire",value: function() {this.__onChange && this.__onChange.call(this), this.getValue().call(this.object), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue());}}]), e;-})(Sr), Ad = (function(i) {- Gs(e, i);+})(Mr), _d = (function(i) {+ zs(e, i);function e(t, n) {- _i(this, e);- var s = Hs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n));+ yi(this, e);+ var s = Vs(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, n));s.__color = new bn(s.getValue()), s.__temp = new bn(0);var r = s;s.domElement = document.createElement("div"), te.makeSelectable(s.domElement, !1), s.__selector = document.createElement("div"), s.__selector.className = "selector", s.__saturation_field = document.createElement("div"), s.__saturation_field.className = "saturation-field", s.__field_knob = document.createElement("div"), s.__field_knob.className = "field-knob", s.__field_knob_border = "2px solid ", s.__hue_knob = document.createElement("div"), s.__hue_knob.className = "hue-knob", s.__hue_field = document.createElement("div"), s.__hue_field.className = "hue-field", s.__input = document.createElement("input"), s.__input.type = "text", s.__input_textShadow = "0 1px 1px ", te.bind(s.__input, "keydown", function(g) {@@ -26764,7 +26764,7 @@ var pd = (function(i) {width: "100%",height: "100%",background: "none"- }), SA(a, "top", "rgba(0,0,0,0)", "#000"), ue.extend(s.__hue_field.style, {+ }), NA(a, "top", "rgba(0,0,0,0)", "#000"), ue.extend(s.__hue_field.style, {width: "15px",height: "100px",border: "1px solid #555",@@ -26772,7 +26772,7 @@ var pd = (function(i) {position: "absolute",top: "3px",right: "3px"- }), u1(s.__hue_field), ue.extend(s.__input.style, {+ }), x1(s.__hue_field), ue.extend(s.__input.style, {outline: "none",textAlign: "center",color: "#fff",@@ -26793,7 +26793,7 @@ var pd = (function(i) {te.unbind(window, "mousemove", m), te.unbind(window, "touchmove", m), te.unbind(window, "mouseup", h), te.unbind(window, "touchend", h), d();}function u() {- var g = fd(this.value);+ var g = xd(this.value);g !== !1 ? (r.__color.__state = g, r.setValue(r.__color.toOriginal())) : this.value = r.__color.toString();}function d() {@@ -26812,10 +26812,10 @@ var pd = (function(i) {}return s;}- return yi(e, [{+ return wi(e, [{key: "updateDisplay",value: function() {- var n = fd(this.getValue());+ var n = xd(this.getValue());if (n !== !1) {var s = !1;ue.each(bn.COMPONENTS, function(o) {@@ -26830,23 +26830,23 @@ var pd = (function(i) {marginTop: 100 * (1 - this.__color.v) - 7 + "px",backgroundColor: this.__temp.toHexString(),border: this.__field_knob_border + "rgb(" + r + "," + r + "," + r + ")"- }), this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + "px", this.__temp.s = 1, this.__temp.v = 1, SA(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), ue.extend(this.__input.style, {+ }), this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + "px", this.__temp.s = 1, this.__temp.v = 1, NA(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), ue.extend(this.__input.style, {backgroundColor: this.__color.toHexString(),color: "rgb(" + r + "," + r + "," + r + ")",textShadow: this.__input_textShadow + "rgba(" + a + "," + a + "," + a + ",.7)"});}}]), e;-})(Sr), h1 = ["-moz-", "-o-", "-webkit-", "-ms-", ""];-function SA(i, e, t, n) {- i.style.background = "", ue.each(h1, function(s) {+})(Mr), b1 = ["-moz-", "-o-", "-webkit-", "-ms-", ""];+function NA(i, e, t, n) {+ i.style.background = "", ue.each(b1, function(s) {i.style.cssText += "background: " + s + "linear-gradient(" + e + ", " + t + " 0%, " + n + " 100%); ";});}-function u1(i) {+function x1(i) {i.style.background = "", i.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", i.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", i.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", i.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", i.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";}-var d1 = {+var E1 = {load: function(e, t) {var n = t || document, s = n.createElement("link");s.type = "text/css", s.rel = "stylesheet", s.href = e, n.getElementsByTagName("head")[0].appendChild(s);@@ -26860,7 +26860,7 @@ var d1 = {} catch {}}-}, f1 = `<div id="dg-save" class="dg dialogue">+}, _1 = `<div id="dg-save" class="dg dialogue">Here's the new load parameter for your <code>GUI</code>'s constructor:@@ -26880,16 +26880,16 @@ var d1 = {</div>-</div>`, p1 = function(e, t) {+</div>`, y1 = function(e, t) {var n = e[t];- return ue.isArray(arguments[2]) || ue.isObject(arguments[2]) ? new o1(e, t, arguments[2]) : ue.isNumber(n) ? ue.isNumber(arguments[2]) && ue.isNumber(arguments[3]) ? ue.isNumber(arguments[4]) ? new pd(e, t, arguments[2], arguments[3], arguments[4]) : new pd(e, t, arguments[2], arguments[3]) : ue.isNumber(arguments[4]) ? new wl(e, t, { min: arguments[2], max: arguments[3], step: arguments[4] }) : new wl(e, t, { min: arguments[2], max: arguments[3] }) : ue.isString(n) ? new c1(e, t) : ue.isFunction(n) ? new g0(e, t, "") : ue.isBoolean(n) ? new p0(e, t) : null;+ return ue.isArray(arguments[2]) || ue.isObject(arguments[2]) ? new A1(e, t, arguments[2]) : ue.isNumber(n) ? ue.isNumber(arguments[2]) && ue.isNumber(arguments[3]) ? ue.isNumber(arguments[4]) ? new Ed(e, t, arguments[2], arguments[3], arguments[4]) : new Ed(e, t, arguments[2], arguments[3]) : ue.isNumber(arguments[4]) ? new Ml(e, t, { min: arguments[2], max: arguments[3], step: arguments[4] }) : new Ml(e, t, { min: arguments[2], max: arguments[3] }) : ue.isString(n) ? new g1(e, t) : ue.isFunction(n) ? new w0(e, t, "") : ue.isBoolean(n) ? new _0(e, t) : null;};-function A1(i) {+function w1(i) {setTimeout(i, 1e3 / 60);}-var g1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || A1, m1 = (function() {+var v1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || w1, C1 = (function() {function i() {- _i(this, i), this.backgroundElement = document.createElement("div"), ue.extend(this.backgroundElement.style, {+ yi(this, i), this.backgroundElement = document.createElement("div"), ue.extend(this.backgroundElement.style, {backgroundColor: "rgba(0,0,0,0.8)",top: 0,left: 0,@@ -26911,7 +26911,7 @@ var g1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || we.hide();});}- return yi(i, [{+ return wi(i, [{key: "show",value: function() {var t = this;@@ -26933,26 +26933,26 @@ var g1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || wthis.domElement.style.left = window.innerWidth / 2 - te.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = window.innerHeight / 2 - te.getHeight(this.domElement) / 2 + "px";}}]), i;-})(), b1 = n1(`.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}+})(), S1 = h1(`.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}`);-d1.inject(b1);-var IA = "dg", MA = 72, BA = 20, Fo = "Default", oo = (function() {+E1.inject(S1);+var FA = "dg", DA = 72, LA = 20, ko = "Default", uo = (function() {try {return !!window.localStorage;} catch {return !1;}-})(), bo = void 0, TA = !0, jr = void 0, Vh = !1, m0 = [], Dt = function i(e) {+})(), yo = void 0, PA = !0, Zr = void 0, Yh = !1, v0 = [], Dt = function i(e) {var t = this, n = e || {};- this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), te.addClass(this.domElement, IA), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], n = ue.defaults(n, {+ this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), te.addClass(this.domElement, FA), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], n = ue.defaults(n, {closeOnTop: !1,autoPlace: !0,width: i.DEFAULT_WIDTH}), n = ue.defaults(n, {resizable: n.autoPlace,hideable: n.autoPlace- }), ue.isUndefined(n.load) ? n.load = { preset: Fo } : n.preset && (n.load.preset = n.preset), ue.isUndefined(n.parent) && n.hideable && m0.push(this), n.resizable = ue.isUndefined(n.parent) && n.resizable, n.autoPlace && ue.isUndefined(n.scrollable) && (n.scrollable = !0);- var s = oo && localStorage.getItem(Jr(this, "isLocal")) === "true", r = void 0, a = void 0;+ }), ue.isUndefined(n.load) ? n.load = { preset: ko } : n.preset && (n.load.preset = n.preset), ue.isUndefined(n.parent) && n.hideable && v0.push(this), n.resizable = ue.isUndefined(n.parent) && n.resizable, n.autoPlace && ue.isUndefined(n.scrollable) && (n.scrollable = !0);+ var s = uo && localStorage.getItem($r(this, "isLocal")) === "true", r = void 0, a = void 0;if (Object.defineProperties(this,{@@ -26981,7 +26981,7 @@ var IA = "dg", MA = 72, BA = 20, Fo = "Default", oo = (function() {return t.parent ? t.getRoot().preset : n.load.preset;},set: function(d) {- t.parent ? t.getRoot().preset = d : n.load.preset = d, y1(this), t.revert();+ t.parent ? t.getRoot().preset = d : n.load.preset = d, T1(this), t.revert();}},width: {@@ -26989,7 +26989,7 @@ var IA = "dg", MA = 72, BA = 20, Fo = "Default", oo = (function() {return n.width;},set: function(d) {- n.width = d, bd(t, d);+ n.width = d, vd(t, d);}},name: {@@ -27018,14 +27018,14 @@ var IA = "dg", MA = 72, BA = 20, Fo = "Default", oo = (function() {return s;},set: function(d) {- oo && (s = d, d ? te.bind(window, "unload", r) : te.unbind(window, "unload", r), localStorage.setItem(Jr(t, "isLocal"), d));+ uo && (s = d, d ? te.bind(window, "unload", r) : te.unbind(window, "unload", r), localStorage.setItem($r(t, "isLocal"), d));}}}), ue.isUndefined(n.parent)) {- if (this.closed = n.closed || !1, te.addClass(this.domElement, i.CLASS_MAIN), te.makeSelectable(this.domElement, !1), oo && s) {+ if (this.closed = n.closed || !1, te.addClass(this.domElement, i.CLASS_MAIN), te.makeSelectable(this.domElement, !1), uo && s) {t.useLocalStorage = !0;- var o = localStorage.getItem(Jr(this, "gui"));+ var o = localStorage.getItem($r(this, "gui"));o && (n.load = JSON.parse(o));}this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = i.TEXT_CLOSED, te.addClass(this.__closeButton, i.CLASS_CLOSE_BUTTON), n.closeOnTop ? (te.addClass(this.__closeButton, i.CLASS_CLOSE_TOP), this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0])) : (te.addClass(this.__closeButton, i.CLASS_CLOSE_BOTTOM), this.domElement.appendChild(this.__closeButton)), te.bind(this.__closeButton, "click", function() {@@ -27034,16 +27034,16 @@ var IA = "dg", MA = 72, BA = 20, Fo = "Default", oo = (function() {} else {n.closed === void 0 && (n.closed = !0);var c = document.createTextNode(n.name);- te.addClass(c, "controller-name"), a = yf(t, c);+ te.addClass(c, "controller-name"), a = Mf(t, c);var l = function(d) {return d.preventDefault(), t.closed = !t.closed, !1;};te.addClass(this.__ul, i.CLASS_CLOSED), te.addClass(a, "title"), te.bind(a, "click", l), n.closed || (this.closed = !1);}- n.autoPlace && (ue.isUndefined(n.parent) && (TA && (jr = document.createElement("div"), te.addClass(jr, IA), te.addClass(jr, i.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(jr), TA = !1), jr.appendChild(this.domElement), te.addClass(this.domElement, i.CLASS_AUTO_PLACE)), this.parent || bd(t, n.width)), this.__resizeHandler = function() {+ n.autoPlace && (ue.isUndefined(n.parent) && (PA && (Zr = document.createElement("div"), te.addClass(Zr, FA), te.addClass(Zr, i.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(Zr), PA = !1), Zr.appendChild(this.domElement), te.addClass(this.domElement, i.CLASS_AUTO_PLACE)), this.parent || vd(t, n.width)), this.__resizeHandler = function() {t.onResizeDebounced();- }, te.bind(window, "resize", this.__resizeHandler), te.bind(this.__ul, "webkitTransitionEnd", this.__resizeHandler), te.bind(this.__ul, "transitionend", this.__resizeHandler), te.bind(this.__ul, "oTransitionEnd", this.__resizeHandler), this.onResize(), n.resizable && _1(this), r = function() {- oo && localStorage.getItem(Jr(t, "isLocal")) === "true" && localStorage.setItem(Jr(t, "gui"), JSON.stringify(t.getSaveObject()));+ }, te.bind(window, "resize", this.__resizeHandler), te.bind(this.__ul, "webkitTransitionEnd", this.__resizeHandler), te.bind(this.__ul, "transitionend", this.__resizeHandler), te.bind(this.__ul, "oTransitionEnd", this.__resizeHandler), this.onResize(), n.resizable && B1(this), r = function() {+ uo && localStorage.getItem($r(t, "isLocal")) === "true" && localStorage.setItem($r(t, "gui"), JSON.stringify(t.getSaveObject()));}, this.saveToLocalStorageIfPossible = r;function h() {var u = t.getRoot();@@ -27054,8 +27054,8 @@ var IA = "dg", MA = 72, BA = 20, Fo = "Default", oo = (function() {n.parent || h();};Dt.toggleHide = function() {- Vh = !Vh, ue.each(m0, function(i) {- i.domElement.style.display = Vh ? "none" : "";+ Yh = !Yh, ue.each(v0, function(i) {+ i.domElement.style.display = Yh ? "none" : "";});};Dt.CLASS_AUTO_PLACE = "a";@@ -27072,19 +27072,19 @@ Dt.DEFAULT_WIDTH = 245;Dt.TEXT_CLOSED = "Close Controls";Dt.TEXT_OPEN = "Open Controls";Dt._keydownHandler = function(i) {- document.activeElement.type !== "text" && (i.which === MA || i.keyCode === MA) && Dt.toggleHide();+ document.activeElement.type !== "text" && (i.which === DA || i.keyCode === DA) && Dt.toggleHide();};te.bind(window, "keydown", Dt._keydownHandler, !1);ue.extend(Dt.prototype,{add: function(e, t) {- return xo(this, e, t, {+ return wo(this, e, t, {factoryArgs: Array.prototype.slice.call(arguments, 2)});},addColor: function(e, t) {- return xo(this, e, t, {+ return wo(this, e, t, {color: !0});},@@ -27098,11 +27098,11 @@ ue.extend(destroy: function() {if (this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");- this.autoPlace && jr.removeChild(this.domElement);+ this.autoPlace && Zr.removeChild(this.domElement);var e = this;ue.each(this.__folders, function(t) {e.removeFolder(t);- }), te.unbind(window, "keydown", Dt._keydownHandler, !1), RA(this);+ }), te.unbind(window, "keydown", Dt._keydownHandler, !1), kA(this);},addFolder: function(e) {if (this.__folders[e] !== void 0)@@ -27111,11 +27111,11 @@ ue.extend(t.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed, t.load = this.load.folders[e]);var n = new Dt(t);this.__folders[e] = n;- var s = yf(this, n.domElement);+ var s = Mf(this, n.domElement);return te.addClass(s, "folder"), n;},removeFolder: function(e) {- this.__ul.removeChild(e.domElement.parentElement), delete this.__folders[e.name], this.load && this.load.folders && this.load.folders[e.name] && delete this.load.folders[e.name], RA(e);+ this.__ul.removeChild(e.domElement.parentElement), delete this.__folders[e.name], this.load && this.load.folders && this.load.folders[e.name] && delete this.load.folders[e.name], kA(e);var t = this;ue.each(e.__folders, function(n) {e.removeFolder(n);@@ -27141,7 +27141,7 @@ ue.extend(var t = te.getOffset(e.__ul).top, n = 0;ue.each(e.__ul.childNodes, function(s) {e.autoPlace && s === e.__save_row || (n += te.getHeight(s));- }), window.innerHeight - t - BA < n ? (te.addClass(e.domElement, Dt.CLASS_TOO_TALL), e.__ul.style.height = window.innerHeight - t - BA + "px") : (te.removeClass(e.domElement, Dt.CLASS_TOO_TALL), e.__ul.style.height = "auto");+ }), window.innerHeight - t - LA < n ? (te.addClass(e.domElement, Dt.CLASS_TOO_TALL), e.__ul.style.height = window.innerHeight - t - LA + "px") : (te.removeClass(e.domElement, Dt.CLASS_TOO_TALL), e.__ul.style.height = "auto");}e.__resize_handle && ue.defer(function() {e.__resize_handle.style.height = e.__ul.offsetHeight + "px";@@ -27151,12 +27151,12 @@ ue.extend(this.onResize();}, 50),remember: function() {- if (ue.isUndefined(bo) && (bo = new m1(), bo.domElement.innerHTML = f1), this.parent)+ if (ue.isUndefined(yo) && (yo = new C1(), yo.domElement.innerHTML = _1), this.parent)throw new Error("You can only call remember on a top level GUI.");var e = this;ue.each(Array.prototype.slice.call(arguments), function(t) {- e.__rememberedObjects.length === 0 && E1(e), e.__rememberedObjects.indexOf(t) === -1 && e.__rememberedObjects.push(t);- }), this.autoPlace && bd(this, this.width);+ e.__rememberedObjects.length === 0 && M1(e), e.__rememberedObjects.indexOf(t) === -1 && e.__rememberedObjects.push(t);+ }), this.autoPlace && vd(this, this.width);},getRoot: function() {for (var e = this; e.parent; )@@ -27165,26 +27165,26 @@ ue.extend(},getSaveObject: function() {var e = this.load;- return e.closed = this.closed, this.__rememberedObjects.length > 0 && (e.preset = this.preset, e.remembered || (e.remembered = {}), e.remembered[this.preset] = Lc(this)), e.folders = {}, ue.each(this.__folders, function(t, n) {+ return e.closed = this.closed, this.__rememberedObjects.length > 0 && (e.preset = this.preset, e.remembered || (e.remembered = {}), e.remembered[this.preset] = Qc(this)), e.folders = {}, ue.each(this.__folders, function(t, n) {e.folders[n] = t.getSaveObject();}), e;},save: function() {- this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = Lc(this), gd(this, !1), this.saveToLocalStorageIfPossible();+ this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = Qc(this), yd(this, !1), this.saveToLocalStorageIfPossible();},saveAs: function(e) {- this.load.remembered || (this.load.remembered = {}, this.load.remembered[Fo] = Lc(this, !0)), this.load.remembered[e] = Lc(this), this.preset = e, md(this, e, !0), this.saveToLocalStorageIfPossible();+ this.load.remembered || (this.load.remembered = {}, this.load.remembered[ko] = Qc(this, !0)), this.load.remembered[e] = Qc(this), this.preset = e, wd(this, e, !0), this.saveToLocalStorageIfPossible();},revert: function(e) {ue.each(this.__controllers, function(t) {- this.getRoot().load.remembered ? b0(e || this.getRoot(), t) : t.setValue(t.initialValue), t.__onFinishChange && t.__onFinishChange.call(t, t.getValue());+ this.getRoot().load.remembered ? C0(e || this.getRoot(), t) : t.setValue(t.initialValue), t.__onFinishChange && t.__onFinishChange.call(t, t.getValue());}, this), ue.each(this.__folders, function(t) {t.revert(t);- }), e || gd(this.getRoot(), !1);+ }), e || yd(this.getRoot(), !1);},listen: function(e) {var t = this.__listening.length === 0;- this.__listening.push(e), t && x0(this.__listening);+ this.__listening.push(e), t && S0(this.__listening);},updateDisplay: function() {ue.each(this.__controllers, function(e) {@@ -27195,30 +27195,30 @@ ue.extend(}});-function yf(i, e, t) {+function Mf(i, e, t) {var n = document.createElement("li");return e && n.appendChild(e), t ? i.__ul.insertBefore(n, t) : i.__ul.appendChild(n), i.onResize(), n;}-function RA(i) {+function kA(i) {te.unbind(window, "resize", i.__resizeHandler), i.saveToLocalStorageIfPossible && te.unbind(window, "unload", i.saveToLocalStorageIfPossible);}-function gd(i, e) {+function yd(i, e) {var t = i.__preset_select[i.__preset_select.selectedIndex];e ? t.innerHTML = t.value + "*" : t.innerHTML = t.value;}-function x1(i, e, t) {+function I1(i, e, t) {if (t.__li = e, t.__gui = i, ue.extend(t, {options: function(a) {if (arguments.length > 1) {var o = t.__li.nextElementSibling;- return t.remove(), xo(i, t.object, t.property, {+ return t.remove(), wo(i, t.object, t.property, {before: o,factoryArgs: [ue.toArray(arguments)]});}if (ue.isArray(a) || ue.isObject(a)) {var c = t.__li.nextElementSibling;- return t.remove(), xo(i, t.object, t.property, {+ return t.remove(), wo(i, t.object, t.property, {before: c,factoryArgs: [a]});@@ -27233,8 +27233,8 @@ function x1(i, e, t) {remove: function() {return t.__gui.remove(t), t;}- }), t instanceof pd) {- var n = new wl(t.object, t.property, { min: t.__min, max: t.__max, step: t.__step });+ }), t instanceof Ed) {+ var n = new Ml(t.object, t.property, { min: t.__min, max: t.__max, step: t.__step });ue.each(["updateDisplay", "onChange", "onFinishChange", "step", "min", "max"], function(r) {var a = t[r], o = n[r];t[r] = n[r] = function() {@@ -27242,12 +27242,12 @@ function x1(i, e, t) {return o.apply(n, c), a.apply(t, c);};}), te.addClass(e, "has-slider"), t.domElement.insertBefore(n.domElement, t.domElement.firstElementChild);- } else if (t instanceof wl) {+ } else if (t instanceof Ml) {var s = function(a) {if (ue.isNumber(t.__min) && ue.isNumber(t.__max)) {var o = t.__li.firstElementChild.firstElementChild.innerHTML, c = t.__gui.__listening.indexOf(t) > -1;t.remove();- var l = xo(i, t.object, t.property, {+ var l = wo(i, t.object, t.property, {before: t.__li.nextElementSibling,factoryArgs: [t.__min, t.__max, t.__step]});@@ -27256,24 +27256,24 @@ function x1(i, e, t) {return a;};t.min = ue.compose(s, t.min), t.max = ue.compose(s, t.max);- } else t instanceof p0 ? (te.bind(e, "click", function() {+ } else t instanceof _0 ? (te.bind(e, "click", function() {te.fakeEvent(t.__checkbox, "click");}), te.bind(t.__checkbox, "click", function(r) {r.stopPropagation();- })) : t instanceof g0 ? (te.bind(e, "click", function() {+ })) : t instanceof w0 ? (te.bind(e, "click", function() {te.fakeEvent(t.__button, "click");}), te.bind(e, "mouseover", function() {te.addClass(t.__button, "hover");}), te.bind(e, "mouseout", function() {te.removeClass(t.__button, "hover");- })) : t instanceof Ad && (te.addClass(e, "color"), t.updateDisplay = ue.compose(function(r) {+ })) : t instanceof _d && (te.addClass(e, "color"), t.updateDisplay = ue.compose(function(r) {return e.style.borderLeftColor = t.__color.toString(), r;}, t.updateDisplay), t.updateDisplay());t.setValue = ue.compose(function(r) {- return i.getRoot().__preset_select && t.isModified() && gd(i.getRoot(), !0), r;+ return i.getRoot().__preset_select && t.isModified() && yd(i.getRoot(), !0), r;}, t.setValue);}-function b0(i, e) {+function C0(i, e) {var t = i.getRoot(), n = t.__rememberedObjects.indexOf(e.object);if (n !== -1) {var s = t.__rememberedObjectIndecesToControllers[n];@@ -27281,8 +27281,8 @@ function b0(i, e) {var r = t.load.remembered, a = void 0;if (r[i.preset])a = r[i.preset];- else if (r[Fo])- a = r[Fo];+ else if (r[ko])+ a = r[ko];elsereturn;if (a[n] && a[n][e.property] !== void 0) {@@ -27292,35 +27292,35 @@ function b0(i, e) {}}}-function xo(i, e, t, n) {+function wo(i, e, t, n) {if (e[t] === void 0)throw new Error('Object "' + e + '" has no property "' + t + '"');var s = void 0;if (n.color)- s = new Ad(e, t);+ s = new _d(e, t);else {var r = [e, t].concat(n.factoryArgs);- s = p1.apply(i, r);+ s = y1.apply(i, r);}- n.before instanceof Sr && (n.before = n.before.__li), b0(i, s), te.addClass(s.domElement, "c");+ n.before instanceof Mr && (n.before = n.before.__li), C0(i, s), te.addClass(s.domElement, "c");var a = document.createElement("span");te.addClass(a, "property-name"), a.innerHTML = s.property;var o = document.createElement("div");o.appendChild(a), o.appendChild(s.domElement);- var c = yf(i, o, n.before);- return te.addClass(c, Dt.CLASS_CONTROLLER_ROW), s instanceof Ad ? te.addClass(c, "color") : te.addClass(c, s1(s.getValue())), x1(i, c, s), i.__controllers.push(s), s;+ var c = Mf(i, o, n.before);+ return te.addClass(c, Dt.CLASS_CONTROLLER_ROW), s instanceof _d ? te.addClass(c, "color") : te.addClass(c, d1(s.getValue())), I1(i, c, s), i.__controllers.push(s), s;}-function Jr(i, e) {+function $r(i, e) {return document.location.href + "." + e;}-function md(i, e, t) {+function wd(i, e, t) {var n = document.createElement("option");n.innerHTML = e, n.value = e, i.__preset_select.appendChild(n), t && (i.__preset_select.selectedIndex = i.__preset_select.length - 1);}-function NA(i, e) {+function UA(i, e) {e.style.display = i.useLocalStorage ? "block" : "none";}-function E1(i) {+function M1(i) {var e = i.__save_row = document.createElement("li");te.addClass(i.domElement, "has-save"), i.__ul.insertBefore(e, i.__ul.firstChild), te.addClass(e, "save-row");var t = document.createElement("span");@@ -27333,22 +27333,22 @@ function E1(i) {r.innerHTML = "Revert", te.addClass(r, "button"), te.addClass(r, "revert");var a = i.__preset_select = document.createElement("select");if (i.load && i.load.remembered ? ue.each(i.load.remembered, function(u, d) {- md(i, d, d === i.preset);- }) : md(i, Fo, !1), te.bind(a, "change", function() {+ wd(i, d, d === i.preset);+ }) : wd(i, ko, !1), te.bind(a, "change", function() {for (var u = 0; u < i.__preset_select.length; u++)i.__preset_select[u].innerHTML = i.__preset_select[u].value;i.preset = this.value;- }), e.appendChild(a), e.appendChild(t), e.appendChild(n), e.appendChild(s), e.appendChild(r), oo) {+ }), e.appendChild(a), e.appendChild(t), e.appendChild(n), e.appendChild(s), e.appendChild(r), uo) {var o = document.getElementById("dg-local-explain"), c = document.getElementById("dg-local-storage"), l = document.getElementById("dg-save-locally");- l.style.display = "block", localStorage.getItem(Jr(i, "isLocal")) === "true" && c.setAttribute("checked", "checked"), NA(i, o), te.bind(c, "change", function() {- i.useLocalStorage = !i.useLocalStorage, NA(i, o);+ l.style.display = "block", localStorage.getItem($r(i, "isLocal")) === "true" && c.setAttribute("checked", "checked"), UA(i, o), te.bind(c, "change", function() {+ i.useLocalStorage = !i.useLocalStorage, UA(i, o);});}var h = document.getElementById("dg-new-constructor");te.bind(h, "keydown", function(u) {- u.metaKey && (u.which === 67 || u.keyCode === 67) && bo.hide();+ u.metaKey && (u.which === 67 || u.keyCode === 67) && yo.hide();}), te.bind(t, "click", function() {- h.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2), bo.show(), h.focus(), h.select();+ h.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2), yo.show(), h.focus(), h.select();}), te.bind(n, "click", function() {i.save();}), te.bind(s, "click", function() {@@ -27358,7 +27358,7 @@ function E1(i) {i.revert();});}-function _1(i) {+function B1(i) {var e = void 0;i.__resize_handle = document.createElement("div"), ue.extend(i.__resize_handle.style, {width: "6px",@@ -27378,10 +27378,10 @@ function _1(i) {}te.bind(i.__resize_handle, "mousedown", s), te.bind(i.__closeButton, "mousedown", s), i.domElement.insertBefore(i.__resize_handle, i.domElement.firstElementChild);}-function bd(i, e) {+function vd(i, e) {i.domElement.style.width = e + "px", i.__save_row && i.autoPlace && (i.__save_row.style.width = e + "px"), i.__closeButton && (i.__closeButton.style.width = e + "px");}-function Lc(i, e) {+function Qc(i, e) {var t = {};return ue.each(i.__rememberedObjects, function(n, s) {var r = {}, a = i.__rememberedObjectIndecesToControllers[s];@@ -27390,19 +27390,19 @@ function Lc(i, e) {}), t[s] = r;}), t;}-function y1(i) {+function T1(i) {for (var e = 0; e < i.__preset_select.length; e++)i.__preset_select[e].value === i.preset && (i.__preset_select.selectedIndex = e);}-function x0(i) {- i.length !== 0 && g1.call(window, function() {- x0(i);+function S0(i) {+ i.length !== 0 && v1.call(window, function() {+ S0(i);}), ue.each(i, function(e) {e.updateDisplay();});}-var w1 = Dt;-const Pc = [+var R1 = Dt;+const Gc = [{id: "",name: "None",@@ -27426,7 +27426,7 @@ const Pc = [path: "https://storage.googleapis.com/donmccurdy-static/footprint_court_2k.exr",format: ".exr"}-], C1 = [+], N1 = ["BN","BN","BN",@@ -27683,7 +27683,7 @@ const Pc = ["L","L","L"-], FA = [+], OA = [[697, 698, "ON"],[706, 719, "ON"],[722, 735, "ON"],@@ -28399,12 +28399,12 @@ const Pc = [[1048574, 1048575, "BN"],[1114110, 1114111, "BN"]];-function v1(i) {+function F1(i) {if (i <= 255)- return C1[i];- let e = 0, t = FA.length - 1;+ return N1[i];+ let e = 0, t = OA.length - 1;for (; e <= t; ) {- const n = e + t >> 1, s = FA[n];+ const n = e + t >> 1, s = OA[n];if (i < s[0]) {t = n - 1;continue;@@ -28417,7 +28417,7 @@ function v1(i) {}return "L";}-function S1(i) {+function D1(i) {const e = i.length;if (e === 0)return null;@@ -28430,7 +28430,7 @@ function S1(i) {const m = i.charCodeAt(l + 1);m >= 56320 && m <= 57343 && (u = (h - 55296 << 10) + (m - 56320) + 65536, d = 2);}- const f = v1(u);+ const f = F1(u);(f === "R" || f === "AL" || f === "AN") && (n = !0);for (let m = 0; m < d; m++)t[l + m] = f;@@ -28504,8 +28504,8 @@ function S1(i) {}return r;}-function I1(i, e) {- const t = S1(i);+function L1(i, e) {+ const t = D1(i);if (t === null)return null;const n = new Int8Array(e.length);@@ -28513,35 +28513,35 @@ function I1(i, e) {n[s] = t[e[s]];return n;}-const M1 = /[ \t\n\r\f]+/g, B1 = /[\t\n\r\f]| {2,}|^ | $/;-function T1(i) {+const P1 = /[ \t\n\r\f]+/g, k1 = /[\t\n\r\f]| {2,}|^ | $/;+function U1(i) {const e = i ?? "normal";return e === "pre-wrap" ? { mode: e, preserveOrdinarySpaces: !0, preserveHardBreaks: !0 } : { mode: e, preserveOrdinarySpaces: !1, preserveHardBreaks: !1 };}-function R1(i) {- if (!B1.test(i))+function O1(i) {+ if (!k1.test(i))return i;- let e = i.replace(M1, " ");+ let e = i.replace(P1, " ");return e.charCodeAt(0) === 32 && (e = e.slice(1)), e.length > 0 && e.charCodeAt(e.length - 1) === 32 && (e = e.slice(0, -1)), e;}-function N1(i) {+function Q1(i) {return /[\r\f]/.test(i) ? i.replace(/\r\n/g, ``).replace(/[\r\f]/g, ``) : i.replace(/\r\n/g, ``);}-let Wh = null, F1;-function D1() {- return Wh === null && (Wh = new Intl.Segmenter(F1, { granularity: "word" })), Wh;+let Jh = null, G1;+function H1() {+ return Jh === null && (Jh = new Intl.Segmenter(G1, { granularity: "word" })), Jh;}-const L1 = new RegExp("\\p{Script=Arabic}", "u"), Hl = new RegExp("\\p{M}", "u"), E0 = new RegExp("\\p{Nd}", "u");-function DA(i) {- return L1.test(i);+const z1 = new RegExp("\\p{Script=Arabic}", "u"), Kl = new RegExp("\\p{M}", "u"), I0 = new RegExp("\\p{Nd}", "u");+function QA(i) {+ return z1.test(i);}-function LA(i) {+function GA(i) {return i >= 19968 && i <= 40959 || i >= 13312 && i <= 19903 || i >= 131072 && i <= 173791 || i >= 173824 && i <= 177983 || i >= 177984 && i <= 178207 || i >= 178208 && i <= 183983 || i >= 183984 && i <= 191471 || i >= 191472 && i <= 192093 || i >= 194560 && i <= 195103 || i >= 196608 && i <= 201551 || i >= 201552 && i <= 205743 || i >= 205744 && i <= 210041 || i >= 63744 && i <= 64255 || i >= 12288 && i <= 12351 || i >= 12352 && i <= 12447 || i >= 12448 && i <= 12543 || i >= 44032 && i <= 55215 || i >= 65280 && i <= 65519;}-function xr(i) {+function _r(i) {for (let e = 0; e < i.length; e++) {const t = i.charCodeAt(e);if (!(t < 12288)) {@@ -28549,39 +28549,39 @@ function xr(i) {const n = i.charCodeAt(e + 1);if (n >= 56320 && n <= 57343) {const s = (t - 55296 << 10) + (n - 56320) + 65536;- if (LA(s))+ if (GA(s))return !0;e++;continue;}}- if (LA(t))+ if (GA(t))return !0;}}return !1;}-function P1(i) {- const e = Vl(i);- return e !== null && (wf.has(e) || Er.has(e));+function V1(i) {+ const e = Xl(i);+ return e !== null && (Bf.has(e) || yr.has(e));}-const k1 = /* @__PURE__ */ new Set([+const W1 = /* @__PURE__ */ new Set([" "," ","","\uFEFF"]);-function U1(i) {- return xr(i);+function q1(i) {+ return _r(i);}-function O1(i) {- const e = Vl(i);- return e !== null && k1.has(e);+function K1(i) {+ const e = Xl(i);+ return e !== null && W1.has(e);}-function Q1(i) {- return !P1(i) && !O1(i);+function j1(i) {+ return !V1(i) && !K1(i);}-const wf = /* @__PURE__ */ new Set([+const Bf = /* @__PURE__ */ new Set([",",".","!",@@ -28608,7 +28608,7 @@ const wf = /* @__PURE__ */ new Set(["ゞ","ヽ","ヾ"-]), zl = /* @__PURE__ */ new Set([+]), jl = /* @__PURE__ */ new Set(['"',"(","[",@@ -28627,10 +28627,10 @@ const wf = /* @__PURE__ */ new Set(["〖","〘","〚"-]), Cf = /* @__PURE__ */ new Set([+]), Tf = /* @__PURE__ */ new Set(["'","’"-]), Er = /* @__PURE__ */ new Set([+]), yr = /* @__PURE__ */ new Set([".",",","!",@@ -28657,14 +28657,14 @@ const wf = /* @__PURE__ */ new Set(["»","›","…"-]), G1 = /* @__PURE__ */ new Set([+]), X1 = /* @__PURE__ */ new Set([":",".","،","؛"-]), H1 = /* @__PURE__ */ new Set([+]), Y1 = /* @__PURE__ */ new Set(["၏"-]), z1 = /* @__PURE__ */ new Set([+]), J1 = /* @__PURE__ */ new Set(["”","’","»",@@ -28677,39 +28677,39 @@ const wf = /* @__PURE__ */ new Set(["〕",")"]);-function V1(i) {- if (vf(i))+function Z1(i) {+ if (Rf(i))return !0;let e = !1;for (const t of i) {- if (Er.has(t)) {+ if (yr.has(t)) {e = !0;continue;}- if (!(e && Hl.test(t)))+ if (!(e && Kl.test(t)))return !1;}return e;}-function W1(i) {+function $1(i) {for (const e of i)- if (!wf.has(e) && !Er.has(e))+ if (!Bf.has(e) && !yr.has(e))return !1;return i.length > 0;}-function q1(i) {- if (vf(i))+function eM(i) {+ if (Rf(i))return !0;for (const e of i)- if (!zl.has(e) && !Cf.has(e) && !Hl.test(e))+ if (!jl.has(e) && !Tf.has(e) && !Kl.test(e))return !1;return i.length > 0;}-function vf(i) {+function Rf(i) {let e = !1;for (const t of i)- if (!(t === "\\" || Hl.test(t))) {- if (zl.has(t) || Er.has(t) || Cf.has(t)) {+ if (!(t === "\\" || Kl.test(t))) {+ if (jl.has(t) || yr.has(t) || Tf.has(t)) {e = !0;continue;}@@ -28717,7 +28717,7 @@ function vf(i) {}return e;}-function _0(i, e) {+function M0(i, e) {const t = e - 1;if (t <= 0)return Math.max(t, 0);@@ -28730,22 +28730,22 @@ function _0(i, e) {const r = i.charCodeAt(s);return r >= 55296 && r <= 56319 ? s : t;}-function Vl(i) {+function Xl(i) {if (i.length === 0)return null;- const e = _0(i, i.length);+ const e = M0(i, i.length);return i.slice(e);}-function K1(i) {+function tM(i) {const e = Array.from(i);let t = e.length;for (; t > 0; ) {const n = e[t - 1];- if (Hl.test(n)) {+ if (Kl.test(n)) {t--;continue;}- if (zl.has(n) || Cf.has(n)) {+ if (jl.has(n) || Tf.has(n)) {t--;continue;}@@ -28756,10 +28756,10 @@ function K1(i) {tail: e.slice(t).join("")};}-function X1(i, e, t) {+function nM(i, e, t) {return t === "text" && !e && i.length === 1 && i !== "-" && i !== "—" ? i : null;}-function PA(i, e, t, n) {+function HA(i, e, t, n) {const s = e[n], r = i[n];if (s == null)return r;@@ -28769,32 +28769,32 @@ function PA(i, e, t, n) {const o = s.repeat(a);return i[n] = o, o;}-function kA(i, e) {- return i && e !== null && G1.has(e);+function zA(i, e) {+ return i && e !== null && X1.has(e);}-function Y1(i) {- const e = Vl(i);- return e !== null && H1.has(e);+function iM(i) {+ const e = Xl(i);+ return e !== null && Y1.has(e);}-function j1(i) {+function sM(i) {if (i.length < 2 || i[0] !== " ")return null;const e = i.slice(1);return new RegExp("^\\p{M}+$", "u").test(e) ? { space: " ", marks: e } : null;}-function xd(i) {+function Cd(i) {let e = i.length;for (; e > 0; ) {- const t = _0(i, e), n = i.slice(t, e);- if (z1.has(n))+ const t = M0(i, e), n = i.slice(t, e);+ if (J1.has(n))return !0;- if (!Er.has(n))+ if (!yr.has(n))return !1;e = t;}return !1;}-function J1(i, e) {+function rM(i, e) {if (e.preserveOrdinarySpaces || e.preserveHardBreaks) {if (i === " ")return "preserved-space";@@ -28806,66 +28806,66 @@ function J1(i, e) {}return i === " " ? "space" : i === " " || i === " " || i === "" || i === "\uFEFF" ? "glue" : i === "" ? "zero-width-break" : i === "" ? "soft-hyphen" : "text";}-const Z1 = /[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;-function ii(i) {+const aM = /[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;+function si(i) {return i.length === 1 ? i[0] : i.join("");}-function $1(i, e) {+function oM(i, e) {const t = [];for (let n = i.length - 1; n >= 0; n--)t.push(i[n]);- return t.push(e), ii(t);+ return t.push(e), si(t);}-function eM(i, e, t, n) {- if (!Z1.test(i))+function cM(i, e, t, n) {+ if (!aM.test(i))return [{ text: i, isWordLike: e, kind: "text", start: t }];const s = [];let r = null, a = [], o = t, c = !1, l = 0;for (const h of i) {- const u = J1(h, n), d = u === "text" && e;+ const u = rM(h, n), d = u === "text" && e;if (r !== null && u === r && d === c) {a.push(h), l += h.length;continue;}r !== null && s.push({- text: ii(a),+ text: si(a),isWordLike: c,kind: r,start: o}), r = u, a = [h], o = t + l, c = d, l += h.length;}return r !== null && s.push({- text: ii(a),+ text: si(a),isWordLike: c,kind: r,start: o}), s;}-function Ed(i) {+function Sd(i) {return i === "space" || i === "preserved-space" || i === "zero-width-break" || i === "hard-break";}-const tM = /^[A-Za-z][A-Za-z0-9+.-]*:$/;-function nM(i, e) {+const lM = /^[A-Za-z][A-Za-z0-9+.-]*:$/;+function hM(i, e) {const t = i.texts[e];- return t.startsWith("www.") ? !0 : tM.test(t) && e + 1 < i.len && i.kinds[e + 1] === "text" && i.texts[e + 1] === "//";+ return t.startsWith("www.") ? !0 : lM.test(t) && e + 1 < i.len && i.kinds[e + 1] === "text" && i.texts[e + 1] === "//";}-function iM(i) {+function uM(i) {return i.includes("?") && (i.includes("://") || i.startsWith("www."));}-function sM(i) {+function dM(i) {const e = i.texts.slice(), t = i.isWordLike.slice(), n = i.kinds.slice(), s = i.starts.slice();for (let a = 0; a < i.len; a++) {- if (n[a] !== "text" || !nM(i, a))+ if (n[a] !== "text" || !hM(i, a))continue;const o = [e[a]];let c = a + 1;- for (; c < i.len && !Ed(n[c]); ) {+ for (; c < i.len && !Sd(n[c]); ) {o.push(e[c]), t[a] = !0;const l = e[c].includes("?");if (n[c] = "text", e[c] = "", c++, l)break;}- e[a] = ii(o);+ e[a] = si(o);}let r = 0;for (let a = 0; a < e.length; a++) {@@ -28880,20 +28880,20 @@ function sM(i) {starts: s};}-function rM(i) {+function fM(i) {const e = [], t = [], n = [], s = [];for (let r = 0; r < i.len; r++) {const a = i.texts[r];- if (e.push(a), t.push(i.isWordLike[r]), n.push(i.kinds[r]), s.push(i.starts[r]), !iM(a))+ if (e.push(a), t.push(i.isWordLike[r]), n.push(i.kinds[r]), s.push(i.starts[r]), !uM(a))continue;const o = r + 1;- if (o >= i.len || Ed(i.kinds[o]))+ if (o >= i.len || Sd(i.kinds[o]))continue;const c = [], l = i.starts[o];let h = o;- for (; h < i.len && !Ed(i.kinds[h]); )+ for (; h < i.len && !Sd(i.kinds[h]); )c.push(i.texts[h]), h++;- c.length > 0 && (e.push(ii(c)), t.push(!0), n.push("text"), s.push(l), r = h - 1);+ c.length > 0 && (e.push(si(c)), t.push(!0), n.push("text"), s.push(l), r = h - 1);}return {len: e.length,@@ -28903,7 +28903,7 @@ function rM(i) {starts: s};}-const aM = /* @__PURE__ */ new Set([+const pM = /* @__PURE__ */ new Set([":","-","/",@@ -28913,31 +28913,31 @@ const aM = /* @__PURE__ */ new Set(["+","–","—"-]), UA = /^[A-Za-z0-9_]+[,:;]*$/, OA = /[,:;]+$/;-function y0(i) {+]), VA = /^[A-Za-z0-9_]+[,:;]*$/, WA = /[,:;]+$/;+function B0(i) {for (const e of i)- if (E0.test(e))+ if (I0.test(e))return !0;return !1;}-function Cl(i) {+function Bl(i) {if (i.length === 0)return !1;for (const e of i)- if (!(E0.test(e) || aM.has(e)))+ if (!(I0.test(e) || pM.has(e)))return !1;return !0;}-function oM(i) {+function AM(i) {const e = [], t = [], n = [], s = [];for (let r = 0; r < i.len; r++) {const a = i.texts[r], o = i.kinds[r];- if (o === "text" && Cl(a) && y0(a)) {+ if (o === "text" && Bl(a) && B0(a)) {const c = [a];let l = r + 1;- for (; l < i.len && i.kinds[l] === "text" && Cl(i.texts[l]); )+ for (; l < i.len && i.kinds[l] === "text" && Bl(i.texts[l]); )c.push(i.texts[l]), l++;- e.push(ii(c)), t.push(!0), n.push("text"), s.push(i.starts[r]), r = l - 1;+ e.push(si(c)), t.push(!0), n.push("text"), s.push(i.starts[r]), r = l - 1;continue;}e.push(a), t.push(i.isWordLike[r]), n.push(o), s.push(i.starts[r]);@@ -28950,18 +28950,18 @@ function oM(i) {starts: s};}-function cM(i) {+function gM(i) {const e = [], t = [], n = [], s = [];for (let r = 0; r < i.len; r++) {const a = i.texts[r], o = i.kinds[r], c = i.isWordLike[r];- if (o === "text" && c && UA.test(a)) {+ if (o === "text" && c && VA.test(a)) {const l = [a];- let h = OA.test(a), u = r + 1;- for (; h && u < i.len && i.kinds[u] === "text" && i.isWordLike[u] && UA.test(i.texts[u]); ) {+ let h = WA.test(a), u = r + 1;+ for (; h && u < i.len && i.kinds[u] === "text" && i.isWordLike[u] && VA.test(i.texts[u]); ) {const d = i.texts[u];- l.push(d), h = OA.test(d), u++;+ l.push(d), h = WA.test(d), u++;}- e.push(ii(l)), t.push(!0), n.push("text"), s.push(i.starts[r]), r = u - 1;+ e.push(si(l)), t.push(!0), n.push("text"), s.push(i.starts[r]), r = u - 1;continue;}e.push(a), t.push(c), n.push(o), s.push(i.starts[r]);@@ -28974,7 +28974,7 @@ function cM(i) {starts: s};}-function lM(i) {+function mM(i) {const e = [], t = [], n = [], s = [];for (let r = 0; r < i.len; r++) {const a = i.texts[r];@@ -28985,7 +28985,7 @@ function lM(i) {const h = o[l];if (!c)break;- (h.length === 0 || !y0(h) || !Cl(h)) && (c = !1);+ (h.length === 0 || !B0(h) || !Bl(h)) && (c = !1);}if (c) {let l = 0;@@ -29006,7 +29006,7 @@ function lM(i) {starts: s};}-function hM(i) {+function bM(i) {const e = [], t = [], n = [], s = [];let r = 0;for (; r < i.len; ) {@@ -29016,7 +29016,7 @@ function hM(i) {const h = [a[0]], u = l;for (r++; r < i.len && i.kinds[r] === "glue"; )h.push(i.texts[r]), r++;- const d = ii(h);+ const d = si(h);if (r < i.len && i.kinds[r] === "text")a[0] = d, a.push(i.texts[r]), o = i.isWordLike[r], c = "text", l = u, r++;else {@@ -29030,14 +29030,14 @@ function hM(i) {const h = [];for (; r < i.len && i.kinds[r] === "glue"; )h.push(i.texts[r]), r++;- const u = ii(h);+ const u = si(h);if (r < i.len && i.kinds[r] === "text") {a.push(u, i.texts[r]), o = o || i.isWordLike[r], r++;continue;}a.push(u);}- e.push(ii(a)), t.push(o), n.push(c), s.push(l);+ e.push(si(a)), t.push(o), n.push(c), s.push(l);}return {len: e.length,@@ -29047,12 +29047,12 @@ function hM(i) {starts: s};}-function uM(i) {+function xM(i) {const e = i.texts.slice(), t = i.isWordLike.slice(), n = i.kinds.slice(), s = i.starts.slice();for (let r = 0; r < e.length - 1; r++) {- if (n[r] !== "text" || n[r + 1] !== "text" || !xr(e[r]) || !xr(e[r + 1]))+ if (n[r] !== "text" || n[r + 1] !== "text" || !_r(e[r]) || !_r(e[r + 1]))continue;- const a = K1(e[r]);+ const a = tM(e[r]);a !== null && (e[r] = a.head, e[r + 1] = a.tail + e[r + 1], s[r + 1] = s[r] + a.head.length);}return {@@ -29063,35 +29063,35 @@ function uM(i) {starts: s};}-function QA(i, e, t) {- const n = D1();+function qA(i, e, t) {+ const n = H1();let s = 0;const r = [], a = [], o = [], c = [], l = [], h = [], u = [], d = [], f = [], m = [], g = [], A = [];for (const w of n.segment(i))- for (const S of eM(w.segment, w.isWordLike ?? !1, w.index, t)) {+ for (const S of cM(w.segment, w.isWordLike ?? !1, w.index, t)) {let O = function() {h[D] !== null && (a[D] = [- PA(r, h, u, D)- ], h[D] = null), a[D].push(S.text), o[D] = o[D] || S.isWordLike, d[D] = d[D] || C, f[D] = f[D] || F, m[D] = q, g[D] = $, A[D] = kA(f[D], K);+ HA(r, h, u, D)+ ], h[D] = null), a[D].push(S.text), o[D] = o[D] || S.isWordLike, d[D] = d[D] || v, f[D] = f[D] || F, m[D] = q, g[D] = $, A[D] = zA(f[D], K);};- const T = S.kind === "text", v = X1(S.text, S.isWordLike, S.kind), C = xr(S.text), F = DA(S.text), K = Vl(S.text), q = xd(S.text), $ = Y1(S.text), D = s - 1;- e.carryCJKAfterClosingQuote && T && s > 0 && c[D] === "text" && C && d[D] && m[D] || T && s > 0 && c[D] === "text" && W1(S.text) && d[D] || T && s > 0 && c[D] === "text" && g[D] ? O() : T && s > 0 && c[D] === "text" && S.isWordLike && F && A[D] ? (O(), o[D] = !0) : v !== null && s > 0 && c[D] === "text" && h[D] === v ? u[D] = (u[D] ?? 1) + 1 : T && !S.isWordLike && s > 0 && c[D] === "text" && (V1(S.text) || S.text === "-" && o[D]) ? O() : (r[s] = S.text, a[s] = [S.text], o[s] = S.isWordLike, c[s] = S.kind, l[s] = S.start, h[s] = v, u[s] = v === null ? 0 : 1, d[s] = C, f[s] = F, m[s] = q, g[s] = $, A[s] = kA(F, K), s++);+ const T = S.kind === "text", C = nM(S.text, S.isWordLike, S.kind), v = _r(S.text), F = QA(S.text), K = Xl(S.text), q = Cd(S.text), $ = iM(S.text), D = s - 1;+ e.carryCJKAfterClosingQuote && T && s > 0 && c[D] === "text" && v && d[D] && m[D] || T && s > 0 && c[D] === "text" && $1(S.text) && d[D] || T && s > 0 && c[D] === "text" && g[D] ? O() : T && s > 0 && c[D] === "text" && S.isWordLike && F && A[D] ? (O(), o[D] = !0) : C !== null && s > 0 && c[D] === "text" && h[D] === C ? u[D] = (u[D] ?? 1) + 1 : T && !S.isWordLike && s > 0 && c[D] === "text" && (Z1(S.text) || S.text === "-" && o[D]) ? O() : (r[s] = S.text, a[s] = [S.text], o[s] = S.isWordLike, c[s] = S.kind, l[s] = S.start, h[s] = C, u[s] = C === null ? 0 : 1, d[s] = v, f[s] = F, m[s] = q, g[s] = $, A[s] = zA(F, K), s++);}for (let w = 0; w < s; w++) {if (h[w] !== null) {- r[w] = PA(r, h, u, w);+ r[w] = HA(r, h, u, w);continue;}- r[w] = ii(a[w]);+ r[w] = si(a[w]);}for (let w = 1; w < s; w++)- c[w] === "text" && !o[w] && vf(r[w]) && c[w - 1] === "text" && (r[w - 1] += r[w], o[w - 1] = o[w - 1] || o[w], r[w] = "");+ c[w] === "text" && !o[w] && Rf(r[w]) && c[w - 1] === "text" && (r[w - 1] += r[w], o[w - 1] = o[w - 1] || o[w], r[w] = "");const p = Array.from({ length: s }, () => null);let y = -1;for (let w = s - 1; w >= 0; w--) {const S = r[w];if (S.length !== 0) {- if (c[w] === "text" && !o[w] && q1(S) && y >= 0 && c[y] === "text") {+ if (c[w] === "text" && !o[w] && eM(S) && y >= 0 && c[y] === "text") {const T = p[y] ?? [];T.push(S), p[y] = T, l[y] = l[w], r[w] = "";continue;@@ -29101,7 +29101,7 @@ function QA(i, e, t) {}for (let w = 0; w < s; w++) {const S = p[w];- S != null && (r[w] = $1(S, r[w]));+ S != null && (r[w] = oM(S, r[w]));}let b = 0;for (let w = 0; w < s; w++) {@@ -29109,20 +29109,20 @@ function QA(i, e, t) {S.length !== 0 && (b !== w && (r[b] = S, o[b] = o[w], c[b] = c[w], l[b] = l[w]), b++);}r.length = b, o.length = b, c.length = b, l.length = b;- const _ = hM({+ const _ = bM({len: b,texts: r,isWordLike: o,kinds: c,starts: l- }), M = uM(cM(lM(oM(rM(sM(_))))));+ }), M = xM(gM(mM(AM(fM(dM(_))))));for (let w = 0; w < M.len - 1; w++) {- const S = j1(M.texts[w]);- S !== null && (M.kinds[w] !== "space" && M.kinds[w] !== "preserved-space" || M.kinds[w + 1] !== "text" || !DA(M.texts[w + 1]) || (M.texts[w] = S.space, M.isWordLike[w] = !1, M.kinds[w] = M.kinds[w] === "preserved-space" ? "preserved-space" : "space", M.texts[w + 1] = S.marks + M.texts[w + 1], M.starts[w + 1] = M.starts[w] + S.space.length));+ const S = sM(M.texts[w]);+ S !== null && (M.kinds[w] !== "space" && M.kinds[w] !== "preserved-space" || M.kinds[w + 1] !== "text" || !QA(M.texts[w + 1]) || (M.texts[w] = S.space, M.isWordLike[w] = !1, M.kinds[w] = M.kinds[w] === "preserved-space" ? "preserved-space" : "space", M.texts[w + 1] = S.marks + M.texts[w + 1], M.starts[w + 1] = M.starts[w] + S.space.length));}return M;}-function dM(i, e) {+function EM(i, e) {if (i.len === 0)return [];if (!e.preserveHardBreaks)@@ -29145,18 +29145,18 @@ function dM(i, e) {consumedEndSegmentIndex: i.len}), t;}-function fM(i) {+function _M(i) {if (i.len <= 1)return i;const e = [], t = [], n = [], s = [];let r = null, a = !1, o = 0, c = !1, l = !1;function h() {- r !== null && (e.push(ii(r)), t.push(a), n.push("text"), s.push(o), r = null);+ r !== null && (e.push(si(r)), t.push(a), n.push("text"), s.push(o), r = null);}for (let u = 0; u < i.len; u++) {const d = i.texts[u], f = i.kinds[u], m = i.isWordLike[u], g = i.starts[u];if (f === "text") {- const A = U1(d), p = Q1(d);+ const A = q1(d), p = j1(d);if (r !== null && c && l) {r.push(d), a = a || m, c = c || A, l = p;continue;@@ -29174,8 +29174,8 @@ function fM(i) {starts: s};}-function pM(i, e, t = "normal", n = "normal") {- const s = T1(t), r = s.mode === "pre-wrap" ? N1(i) : R1(i);+function yM(i, e, t = "normal", n = "normal") {+ const s = U1(t), r = s.mode === "pre-wrap" ? Q1(i) : O1(i);if (r.length === 0)return {normalized: r,@@ -29186,75 +29186,75 @@ function pM(i, e, t = "normal", n = "normal") {kinds: [],starts: []};- const a = n === "keep-all" ? fM(QA(r, e, s)) : QA(r, e, s);+ const a = n === "keep-all" ? _M(qA(r, e, s)) : qA(r, e, s);return {normalized: r,- chunks: dM(a, s),+ chunks: EM(a, s),...a};}-let Kr = null;-const GA = /* @__PURE__ */ new Map();let Xr = null;-const AM = 96, gM = new RegExp("\\p{Emoji_Presentation}", "u"), mM = /[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;-let qh = null;-const HA = /* @__PURE__ */ new Map();-function Sf() {- if (Kr !== null)- return Kr;+const KA = /* @__PURE__ */ new Map();+let Yr = null;+const wM = 96, vM = new RegExp("\\p{Emoji_Presentation}", "u"), CM = /[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;+let Zh = null;+const jA = /* @__PURE__ */ new Map();+function Nf() {+ if (Xr !== null)+ return Xr;if (typeof OffscreenCanvas < "u")- return Kr = new OffscreenCanvas(1, 1).getContext("2d"), Kr;+ return Xr = new OffscreenCanvas(1, 1).getContext("2d"), Xr;if (typeof document < "u")- return Kr = document.createElement("canvas").getContext("2d"), Kr;+ return Xr = document.createElement("canvas").getContext("2d"), Xr;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.");}-function bM(i) {- let e = GA.get(i);- return e || (e = /* @__PURE__ */ new Map(), GA.set(i, e)), e;+function SM(i) {+ let e = KA.get(i);+ return e || (e = /* @__PURE__ */ new Map(), KA.set(i, e)), e;}-function Ns(i, e) {+function Fs(i, e) {let t = e.get(i);return t === void 0 && (t = {- width: Sf().measureText(i).width,- containsCJK: xr(i)+ width: Nf().measureText(i).width,+ containsCJK: _r(i)}, e.set(i, t)), t;}-function Pa() {- if (Xr !== null)- return Xr;+function Qa() {+ if (Yr !== null)+ return Yr;if (typeof navigator > "u")- return Xr = {+ return Yr = {lineFitEpsilon: 5e-3,carryCJKAfterClosingQuote: !1,preferPrefixWidthsForBreakableRuns: !1,preferEarlySoftHyphenBreak: !1- }, Xr;+ }, Yr;const i = navigator.userAgent, t = navigator.vendor === "Apple Computer, Inc." && i.includes("Safari/") && !i.includes("Chrome/") && !i.includes("Chromium/") && !i.includes("CriOS/") && !i.includes("FxiOS/") && !i.includes("EdgiOS/"), n = i.includes("Chrome/") || i.includes("Chromium/") || i.includes("CriOS/") || i.includes("Edg/");- return Xr = {+ return Yr = {lineFitEpsilon: t ? 1 / 64 : 5e-3,carryCJKAfterClosingQuote: n,preferPrefixWidthsForBreakableRuns: t,preferEarlySoftHyphenBreak: t- }, Xr;+ }, Yr;}-function xM(i) {+function IM(i) {const e = i.match(/(\d+(?:\.\d+)?)\s*px/);return e ? parseFloat(e[1]) : 16;}-function w0() {- return qh === null && (qh = new Intl.Segmenter(void 0, { granularity: "grapheme" })), qh;+function T0() {+ return Zh === null && (Zh = new Intl.Segmenter(void 0, { granularity: "grapheme" })), Zh;}-function EM(i) {- return gM.test(i) || i.includes("️");+function MM(i) {+ return vM.test(i) || i.includes("️");}-function _M(i) {- return mM.test(i);+function BM(i) {+ return CM.test(i);}-function yM(i, e) {- let t = HA.get(i);+function TM(i, e) {+ let t = jA.get(i);if (t !== void 0)return t;- const n = Sf();+ const n = Nf();n.font = i;const s = n.measureText("😀").width;if (t = 0, s > e + 0.5 && typeof document < "u" && document.body !== null) {@@ -29263,25 +29263,25 @@ function yM(i, e) {const a = r.getBoundingClientRect().width;document.body.removeChild(r), s - a > 0.5 && (t = s - a);}- return HA.set(i, t), t;+ return jA.set(i, t), t;}-function wM(i) {+function RM(i) {let e = 0;- const t = w0();+ const t = T0();for (const n of t.segment(i))- EM(n.segment) && e++;+ MM(n.segment) && e++;return e;}-function CM(i, e) {- return e.emojiCount === void 0 && (e.emojiCount = wM(i)), e.emojiCount;+function NM(i, e) {+ return e.emojiCount === void 0 && (e.emojiCount = RM(i)), e.emojiCount;}-function hr(i, e, t) {- return t === 0 ? e.width : e.width - CM(i, e) * t;+function dr(i, e, t) {+ return t === 0 ? e.width : e.width - NM(i, e) * t;}-function vM(i, e, t, n, s) {+function FM(i, e, t, n, s) {if (e.breakableFitAdvances !== void 0)return e.breakableFitAdvances;- const r = w0(), a = [];+ const r = T0(), a = [];for (const h of r.segment(i))a.push(h.segment);if (a.length <= 1)@@ -29289,21 +29289,21 @@ function vM(i, e, t, n, s) {if (s === "sum-graphemes") {const h = [];for (const u of a) {- const d = Ns(u, t);- h.push(hr(u, d, n));+ const d = Fs(u, t);+ h.push(dr(u, d, n));}return e.breakableFitAdvances = h, e.breakableFitAdvances;}- if (s === "pair-context" || a.length > AM) {+ if (s === "pair-context" || a.length > wM) {const h = [];let u = null, d = 0;for (const f of a) {- const m = Ns(f, t), g = hr(f, m, n);+ const m = Fs(f, t), g = dr(f, m, n);if (u === null)h.push(g);else {- const A = u + f, p = Ns(A, t);- h.push(hr(A, p, n) - d);+ const A = u + f, p = Fs(A, t);+ h.push(dr(A, p, n) - d);}u = f, d = g;}@@ -29313,18 +29313,18 @@ function vM(i, e, t, n, s) {let c = "", l = 0;for (const h of a) {c += h;- const u = Ns(c, t), d = hr(c, u, n);+ const u = Fs(c, t), d = dr(c, u, n);o.push(d - l), l = d;}return e.breakableFitAdvances = o, e.breakableFitAdvances;}-function SM(i, e) {- const t = Sf();+function DM(i, e) {+ const t = Nf();t.font = i;- const n = bM(i), s = xM(i), r = e ? yM(i, s) : 0;+ const n = SM(i), s = IM(i), r = e ? TM(i, s) : 0;return { cache: n, fontSize: s, emojiCorrection: r };}-function IM(i, e) {+function LM(i, e) {for (; e < i.widths.length; ) {const t = i.kinds[e];if (t !== "space" && t !== "zero-width-break" && t !== "soft-hyphen")@@ -29333,13 +29333,13 @@ function IM(i, e) {}return e;}-function C0(i, e) {+function R0(i, e) {if (e <= 0)return 0;const t = i % e;return Math.abs(t) <= 1e-6 ? e : e - t;}-function v0(i, e, t, n, s) {+function N0(i, e, t, n, s) {let r = 0, a = e;for (; r < i.length; ) {const o = a + i[r];@@ -29349,7 +29349,7 @@ function v0(i, e, t, n, s) {}return { fitCount: r, fittedWidth: a };}-function MM(i, e) {+function PM(i, e) {let t = 0, n = i.chunks.length;for (; t < n; ) {const s = Math.floor((t + n) / 2);@@ -29357,7 +29357,7 @@ function MM(i, e) {}return t < i.chunks.length ? t : -1;}-function S0(i, e, t) {+function F0(i, e, t) {let n = t.segmentIndex;if (t.graphemeIndex > 0)return e;@@ -29372,72 +29372,72 @@ function S0(i, e, t) {}return s.consumedEndSegmentIndex >= i.widths.length ? -1 : (t.segmentIndex = s.consumedEndSegmentIndex, t.graphemeIndex = 0, e + 1);}-function If(i, e) {+function Ff(i, e) {if (e.segmentIndex >= i.widths.length)return -1;- const t = MM(i, e.segmentIndex);- return t < 0 ? -1 : S0(i, t, e);+ const t = PM(i, e.segmentIndex);+ return t < 0 ? -1 : F0(i, t, e);}-function BM(i, e, t) {+function kM(i, e, t) {if (t.segmentIndex >= i.widths.length)return -1;let n = e;for (; n < i.chunks.length && t.segmentIndex >= i.chunks[n].consumedEndSegmentIndex; )n++;- return n >= i.chunks.length ? -1 : S0(i, n, t);+ return n >= i.chunks.length ? -1 : F0(i, n, t);}-function TM(i, e) {- return i.simpleLineWalkFastPath ? I0(i, e) : Mf(i, e);+function UM(i, e) {+ return i.simpleLineWalkFastPath ? D0(i, e) : Df(i, e);}-function I0(i, e, t) {+function D0(i, e, t) {const { widths: n, kinds: s, breakableFitAdvances: r } = i;if (n.length === 0)return 0;- const o = Pa().lineFitEpsilon, c = e + o;+ const o = Qa().lineFitEpsilon, c = e + o;let l = 0, h = 0, u = !1, d = 0, f = 0, m = 0, g = 0, A = -1, p = 0;function y() {A = -1, p = 0;}- function b(v = m, C = g, F = h) {+ function b(C = m, v = g, F = h) {l++, t?.({startSegmentIndex: d,startGraphemeIndex: f,- endSegmentIndex: v,- endGraphemeIndex: C,+ endSegmentIndex: C,+ endGraphemeIndex: v,width: F}), h = 0, u = !1, y();}- function _(v, C) {- u = !0, d = v, f = 0, m = v + 1, g = 0, h = C;+ function _(C, v) {+ u = !0, d = C, f = 0, m = C + 1, g = 0, h = v;}- function M(v, C, F) {- u = !0, d = v, f = C, m = v, g = C + 1, h = F;+ function M(C, v, F) {+ u = !0, d = C, f = v, m = C, g = v + 1, h = F;}- function w(v, C) {+ function w(C, v) {if (!u) {- _(v, C);+ _(C, v);return;}- h += C, m = v + 1, g = 0;+ h += v, m = C + 1, g = 0;}- function S(v, C) {- const F = r[v];- for (let K = C; K < F.length; K++) {+ function S(C, v) {+ const F = r[C];+ for (let K = v; K < F.length; K++) {const q = F[K];- u ? h + q > c ? (b(), M(v, K, q)) : (h += q, m = v, g = K + 1) : M(v, K, q);+ u ? h + q > c ? (b(), M(C, K, q)) : (h += q, m = C, g = K + 1) : M(C, K, q);}- u && m === v && g === F.length && (m = v + 1, g = 0);+ u && m === C && g === F.length && (m = C + 1, g = 0);}let T = 0;- for (; T < n.length && !(!u && (T = IM(i, T), T >= n.length)); ) {- const v = n[T], C = s[T], F = C === "space" || C === "preserved-space" || C === "tab" || C === "zero-width-break" || C === "soft-hyphen";+ for (; T < n.length && !(!u && (T = LM(i, T), T >= n.length)); ) {+ const C = n[T], v = s[T], F = v === "space" || v === "preserved-space" || v === "tab" || v === "zero-width-break" || v === "soft-hyphen";if (!u) {- v > e && r[T] !== null ? S(T, 0) : _(T, v), F && (A = T + 1, p = h - v), T++;+ C > e && r[T] !== null ? S(T, 0) : _(T, C), F && (A = T + 1, p = h - C), T++;continue;}- if (h + v > c) {+ if (h + C > c) {if (F) {- w(T, v), b(T + 1, 0, h - v), T++;+ w(T, C), b(T + 1, 0, h - C), T++;continue;}if (A >= 0) {@@ -29448,36 +29448,36 @@ function I0(i, e, t) {b(A, 0, p);continue;}- if (v > e && r[T] !== null) {+ if (C > e && r[T] !== null) {b(), S(T, 0), T++;continue;}b();continue;}- w(T, v), F && (A = T + 1, p = h - v), T++;+ w(T, C), F && (A = T + 1, p = h - C), T++;}return u && b(), l;}-function Mf(i, e, t) {+function Df(i, e, t) {if (i.simpleLineWalkFastPath)- return I0(i, e, t);+ return D0(i, e, t);const { widths: n, lineEndFitAdvances: s, lineEndPaintAdvances: r, kinds: a, breakableFitAdvances: o, discretionaryHyphenWidth: c, tabStopAdvance: l, chunks: h } = i;if (n.length === 0 || h.length === 0)return 0;- const u = Pa(), d = u.lineFitEpsilon, f = e + d;+ const u = Qa(), d = u.lineFitEpsilon, f = e + d;let m = 0, g = 0, A = !1, p = 0, y = 0, b = 0, _ = 0, M = -1, w = 0, S = 0, T = null;- function v() {+ function C() {M = -1, w = 0, S = 0, T = null;}- function C(Q = b, J = _, ee = g) {+ function v(Q = b, J = _, ee = g) {m++, t?.({startSegmentIndex: p,startGraphemeIndex: y,endSegmentIndex: Q,endGraphemeIndex: J,width: ee- }), g = 0, A = !1, v();+ }), g = 0, A = !1, C();}function F(Q, J) {A = !0, p = Q, y = 0, b = Q + 1, _ = 0, g = J;@@ -29502,7 +29502,7 @@ function Mf(i, e, t) {const ee = o[Q];for (let ae = J; ae < ee.length; ae++) {const ye = ee[ae];- A ? g + ye > f ? (C(), K(Q, ae, ye)) : (g += ye, b = Q, _ = ae + 1) : K(Q, ae, ye);+ A ? g + ye > f ? (v(), K(Q, ae, ye)) : (g += ye, b = Q, _ = ae + 1) : K(Q, ae, ye);}A && b === Q && _ === ee.length && (b = Q + 1, _ = 0);}@@ -29512,28 +29512,28 @@ function Mf(i, e, t) {const J = o[Q];if (J == null)return !1;- const { fitCount: ee, fittedWidth: ae } = v0(J, g, e, d, c);- return ee === 0 ? !1 : (g = ae, b = Q, _ = ee, v(), ee === J.length ? (b = Q + 1, _ = 0, !0) : (C(Q, ee, ae + c), D(Q, ee), !0));+ const { fitCount: ee, fittedWidth: ae } = N0(J, g, e, d, c);+ return ee === 0 ? !1 : (g = ae, b = Q, _ = ee, C(), ee === J.length ? (b = Q + 1, _ = 0, !0) : (v(Q, ee, ae + c), D(Q, ee), !0));}- function j(Q) {+ function Y(Q) {m++, t?.({startSegmentIndex: Q.startSegmentIndex,startGraphemeIndex: 0,endSegmentIndex: Q.consumedEndSegmentIndex,endGraphemeIndex: 0,width: 0- }), v();+ }), C();}for (let Q = 0; Q < h.length; Q++) {const J = h[Q];if (J.startSegmentIndex === J.endSegmentIndex) {- j(J);+ Y(J);continue;}- A = !1, g = 0, p = J.startSegmentIndex, y = 0, b = J.startSegmentIndex, _ = 0, v();+ A = !1, g = 0, p = J.startSegmentIndex, y = 0, b = J.startSegmentIndex, _ = 0, C();let ee = J.startSegmentIndex;for (; ee < J.endSegmentIndex; ) {- const ae = a[ee], ye = ae === "space" || ae === "preserved-space" || ae === "tab" || ae === "zero-width-break" || ae === "soft-hyphen", Me = ae === "tab" ? C0(g, l) : n[ee];+ const ae = a[ee], ye = ae === "space" || ae === "preserved-space" || ae === "tab" || ae === "zero-width-break" || ae === "soft-hyphen", Me = ae === "tab" ? R0(g, l) : n[ee];if (ae === "soft-hyphen") {A && (b = ee + 1, _ = 0, M = ee + 1, w = g + c, S = g + c, T = ae), ee++;continue;@@ -29545,7 +29545,7 @@ function Mf(i, e, t) {if (g + Me > f) {const me = g + (ae === "tab" ? 0 : s[ee]), be = g + (ae === "tab" ? Me : r[ee]);if (T === "soft-hyphen" && u.preferEarlySoftHyphenBreak && w <= f) {- C(M, 0, S);+ v(M, 0, S);continue;}if (T === "soft-hyphen" && O(ee)) {@@ -29553,94 +29553,94 @@ function Mf(i, e, t) {continue;}if (ye && me <= f) {- q(ee, Me), C(ee + 1, 0, be), ee++;+ q(ee, Me), v(ee + 1, 0, be), ee++;continue;}if (M >= 0 && w <= f) {if (b > M || b === M && _ > 0) {- C();+ v();continue;}const xe = M;- C(xe, 0, S), ee = xe;+ v(xe, 0, S), ee = xe;continue;}if (Me > e && o[ee] !== null) {- C(), D(ee, 0), ee++;+ v(), D(ee, 0), ee++;continue;}- C();+ v();continue;}q(ee, Me), $(ae, ye, ee, Me), ee++;}if (A) {const ae = M === J.consumedEndSegmentIndex ? S : g;- C(J.consumedEndSegmentIndex, 0, ae);+ v(J.consumedEndSegmentIndex, 0, ae);}}return m;}-function Bf(i, e, t, n) {+function Lf(i, e, t, n) {const s = i.chunks[t];if (s.startSegmentIndex === s.endSegmentIndex)return e.segmentIndex = s.consumedEndSegmentIndex, e.graphemeIndex = 0, 0;- const { widths: r, lineEndFitAdvances: a, lineEndPaintAdvances: o, kinds: c, breakableFitAdvances: l, discretionaryHyphenWidth: h, tabStopAdvance: u } = i, d = Pa(), f = d.lineFitEpsilon, m = n + f;+ const { widths: r, lineEndFitAdvances: a, lineEndPaintAdvances: o, kinds: c, breakableFitAdvances: l, discretionaryHyphenWidth: h, tabStopAdvance: u } = i, d = Qa(), f = d.lineFitEpsilon, m = n + f;let g = 0, A = !1, p = e.segmentIndex, y = e.graphemeIndex, b = -1, _ = 0, M = 0, w = null;function S() {b = -1, _ = 0, M = 0, w = null;}- function T(D = p, O = y, j = g) {- return A ? (e.segmentIndex = D, e.graphemeIndex = O, j) : null;+ function T(D = p, O = y, Y = g) {+ return A ? (e.segmentIndex = D, e.graphemeIndex = O, Y) : null;}- function v(D, O) {+ function C(D, O) {A = !0, p = D + 1, y = 0, g = O;}- function C(D, O, j) {- A = !0, p = D, y = O + 1, g = j;+ function v(D, O, Y) {+ A = !0, p = D, y = O + 1, g = Y;}function F(D, O) {if (!A) {- v(D, O);+ C(D, O);return;}g += O, p = D + 1, y = 0;}- function K(D, O, j, Q) {+ function K(D, O, Y, Q) {if (!O)return;- const J = D === "tab" ? 0 : a[j], ee = D === "tab" ? Q : o[j];- b = j + 1, _ = g - Q + J, M = g - Q + ee, w = D;+ const J = D === "tab" ? 0 : a[Y], ee = D === "tab" ? Q : o[Y];+ b = Y + 1, _ = g - Q + J, M = g - Q + ee, w = D;}function q(D, O) {- const j = l[D];- for (let Q = O; Q < j.length; Q++) {- const J = j[Q];+ const Y = l[D];+ for (let Q = O; Q < Y.length; Q++) {+ const J = Y[Q];if (!A)- C(D, Q, J);+ v(D, Q, J);else {if (g + J > m)return T();g += J, p = D, y = Q + 1;}}- return A && p === D && y === j.length && (p = D + 1, y = 0), null;+ return A && p === D && y === Y.length && (p = D + 1, y = 0), null;}function $(D) {if (w !== "soft-hyphen" || b < 0)return null;const O = l[D] ?? null;if (O !== null) {- const { fitCount: j, fittedWidth: Q } = v0(O, g, n, f, h);- if (j === O.length)+ const { fitCount: Y, fittedWidth: Q } = N0(O, g, n, f, h);+ if (Y === O.length)return g = Q, p = D + 1, y = 0, S(), null;- if (j > 0)- return T(D, j, Q + h);+ if (Y > 0)+ return T(D, Y, Q + h);}return _ <= m ? T(b, 0, M) : null;}for (let D = e.segmentIndex; D < s.endSegmentIndex; D++) {- const O = c[D], j = O === "space" || O === "preserved-space" || O === "tab" || O === "zero-width-break" || O === "soft-hyphen", Q = D === e.segmentIndex ? e.graphemeIndex : 0, J = O === "tab" ? C0(g, u) : r[D];+ const O = c[D], Y = O === "space" || O === "preserved-space" || O === "tab" || O === "zero-width-break" || O === "soft-hyphen", Q = D === e.segmentIndex ? e.graphemeIndex : 0, J = O === "tab" ? R0(g, u) : r[D];if (O === "soft-hyphen" && Q === 0) {A && (p = D + 1, y = 0, b = D + 1, _ = g + h, M = g + h, w = O);continue;@@ -29655,8 +29655,8 @@ function Bf(i, e, t, n) {if (ae !== null)return ae;} else- v(D, J);- K(O, j, D, J);+ C(D, J);+ K(O, Y, D, J);continue;}if (g + J > m) {@@ -29666,7 +29666,7 @@ function Bf(i, e, t, n) {const Me = $(D);if (Me !== null)return Me;- if (j && ae <= m)+ if (Y && ae <= m)return F(D, J), T(D + 1, 0, ye);if (b >= 0 && _ <= m)return p > b || p === b && y > 0 ? T() : T(b, 0, M);@@ -29680,12 +29680,12 @@ function Bf(i, e, t, n) {}return T();}- F(D, J), K(O, j, D, J);+ F(D, J), K(O, Y, D, J);}return b === s.consumedEndSegmentIndex && y === 0 ? T(s.consumedEndSegmentIndex, 0, M) : T(s.consumedEndSegmentIndex, 0, g);}-function M0(i, e, t) {- const { widths: n, kinds: s, breakableFitAdvances: r } = i, o = Pa().lineFitEpsilon, c = t + o;+function L0(i, e, t) {+ const { widths: n, kinds: s, breakableFitAdvances: r } = i, o = Qa().lineFitEpsilon, c = t + o;let l = 0, h = !1, u = e.segmentIndex, d = e.graphemeIndex, f = -1, m = 0;for (let g = e.segmentIndex; g < n.length; g++) {const A = n[g], p = s[g], y = p === "space" || p === "preserved-space" || p === "tab" || p === "zero-width-break" || p === "soft-hyphen", b = g === e.segmentIndex ? e.graphemeIndex : 0, _ = r[g];@@ -29711,14 +29711,14 @@ function M0(i, e, t) {}return h ? (e.segmentIndex = u, e.graphemeIndex = d, l) : null;}-function _d(i, e, t) {+function Id(i, e, t) {const n = {segmentIndex: e.segmentIndex,graphemeIndex: e.graphemeIndex- }, s = If(i, n);+ }, s = Ff(i, n);if (s < 0)return null;- const r = n.segmentIndex, a = n.graphemeIndex, o = i.simpleLineWalkFastPath ? M0(i, n, t) : Bf(i, n, s, t);+ const r = n.segmentIndex, a = n.graphemeIndex, o = i.simpleLineWalkFastPath ? L0(i, n, t) : Lf(i, n, s, t);return o === null ? null : {startSegmentIndex: r,startGraphemeIndex: a,@@ -29727,11 +29727,11 @@ function _d(i, e, t) {width: o};}-function RM(i, e, t) {- const n = If(i, e);- return n < 0 ? null : i.simpleLineWalkFastPath ? M0(i, e, t) : Bf(i, e, n, t);+function OM(i, e, t) {+ const n = Ff(i, e);+ return n < 0 ? null : i.simpleLineWalkFastPath ? L0(i, e, t) : Lf(i, e, n, t);}-function NM(i, e) {+function QM(i, e) {if (i.widths.length === 0)return {lineCount: 0,@@ -29743,15 +29743,15 @@ function NM(i, e) {};let n = 0, s = 0;if (!i.simpleLineWalkFastPath) {- let r = If(i, t);+ let r = Ff(i, t);for (; r >= 0; ) {- const a = Bf(i, t, r, e);+ const a = Lf(i, t, r, e);if (a === null)return {lineCount: n,maxLineWidth: s};- n++, a > s && (s = a), r = BM(i, r, t);+ n++, a > s && (s = a), r = kM(i, r, t);}return {lineCount: n,@@ -29759,7 +29759,7 @@ function NM(i, e) {};}for (; ; ) {- const r = RM(i, t, e);+ const r = OM(i, t, e);if (r === null)return {lineCount: n,@@ -29768,11 +29768,11 @@ function NM(i, e) {n++, r > s && (s = r);}}-let Kh = null, zA = /* @__PURE__ */ new WeakMap();-function B0() {- return Kh === null && (Kh = new Intl.Segmenter(void 0, { granularity: "grapheme" })), Kh;+let $h = null, XA = /* @__PURE__ */ new WeakMap();+function P0() {+ return $h === null && ($h = new Intl.Segmenter(void 0, { granularity: "grapheme" })), $h;}-function FM(i) {+function GM(i) {return i ? {widths: [],lineEndFitAdvances: [],@@ -29798,7 +29798,7 @@ function FM(i) {chunks: []};}-function DM(i, e) {+function HM(i, e) {const t = [];let n = [], s = 0, r = !1, a = !1, o = !1;function c() {@@ -29808,20 +29808,20 @@ function DM(i, e) {}), n = [], r = !1, a = !1, o = !1);}function l(u, d, f) {- n = [u], s = d, r = f, a = xd(u), o = zl.has(u);+ n = [u], s = d, r = f, a = Cd(u), o = jl.has(u);}function h(u, d) {n.push(u), r = r || d;- const f = xd(u);- u.length === 1 && Er.has(u) ? a = a || f : a = f, o = !1;+ const f = Cd(u);+ u.length === 1 && yr.has(u) ? a = a || f : a = f, o = !1;}- for (const u of B0().segment(i)) {- const d = u.segment, f = xr(d);+ for (const u of P0().segment(i)) {+ const d = u.segment, f = _r(d);if (n.length === 0) {l(d, u.index, f);continue;}- if (o || wf.has(d) || Er.has(d) || e.carryCJKAfterClosingQuote && f && a) {+ if (o || Bf.has(d) || yr.has(d) || e.carryCJKAfterClosingQuote && f && a) {h(d, f);continue;}@@ -29833,54 +29833,54 @@ function DM(i, e) {}return c(), t;}-function LM(i, e, t, n) {- const s = Pa(), { cache: r, emojiCorrection: a } = SM(e, _M(i.normalized)), o = hr("-", Ns("-", r), a), l = hr(" ", Ns(" ", r), a) * 8;+function zM(i, e, t, n) {+ const s = Qa(), { cache: r, emojiCorrection: a } = DM(e, BM(i.normalized)), o = dr("-", Fs("-", r), a), l = dr(" ", Fs(" ", r), a) * 8;if (i.len === 0)- return FM(t);+ return GM(t);const h = [], u = [], d = [], f = [];let m = i.chunks.length <= 1;const g = t ? [] : null, A = [], p = t ? [] : null, y = Array.from({ length: i.len });- function b(S, T, v, C, F, K, q) {- F !== "text" && F !== "space" && F !== "zero-width-break" && (m = !1), h.push(T), u.push(v), d.push(C), f.push(F), g?.push(K), A.push(q), p !== null && p.push(S);+ function b(S, T, C, v, F, K, q) {+ F !== "text" && F !== "space" && F !== "zero-width-break" && (m = !1), h.push(T), u.push(C), d.push(v), f.push(F), g?.push(K), A.push(q), p !== null && p.push(S);}- function _(S, T, v, C, F) {- const K = Ns(S, r), q = hr(S, K, a), $ = T === "space" || T === "preserved-space" || T === "zero-width-break" ? 0 : q, D = T === "space" || T === "zero-width-break" ? 0 : q;- if (F && C && S.length > 1) {+ function _(S, T, C, v, F) {+ const K = Fs(S, r), q = dr(S, K, a), $ = T === "space" || T === "preserved-space" || T === "zero-width-break" ? 0 : q, D = T === "space" || T === "zero-width-break" ? 0 : q;+ if (F && v && S.length > 1) {let O = "sum-graphemes";- Cl(S) ? O = "pair-context" : s.preferPrefixWidthsForBreakableRuns && (O = "segment-prefixes");- const j = vM(S, K, r, a, O);- b(S, q, $, D, T, v, j);+ Bl(S) ? O = "pair-context" : s.preferPrefixWidthsForBreakableRuns && (O = "segment-prefixes");+ const Y = FM(S, K, r, a, O);+ b(S, q, $, D, T, C, Y);return;}- b(S, q, $, D, T, v, null);+ b(S, q, $, D, T, C, null);}for (let S = 0; S < i.len; S++) {y[S] = h.length;- const T = i.texts[S], v = i.isWordLike[S], C = i.kinds[S], F = i.starts[S];- if (C === "soft-hyphen") {- b(T, 0, o, o, C, F, null);+ const T = i.texts[S], C = i.isWordLike[S], v = i.kinds[S], F = i.starts[S];+ if (v === "soft-hyphen") {+ b(T, 0, o, o, v, F, null);continue;}- if (C === "hard-break") {- b(T, 0, 0, 0, C, F, null);+ if (v === "hard-break") {+ b(T, 0, 0, 0, v, F, null);continue;}- if (C === "tab") {- b(T, 0, 0, 0, C, F, null);+ if (v === "tab") {+ b(T, 0, 0, 0, v, F, null);continue;}- const K = Ns(T, r);- if (C === "text" && K.containsCJK) {- const $ = DM(T, s);+ const K = Fs(T, r);+ if (v === "text" && K.containsCJK) {+ const $ = HM(T, s);for (let D = 0; D < $.length; D++) {const O = $[D];- _(O.text, "text", F + O.start, v, !xr(O.text));+ _(O.text, "text", F + O.start, C, !_r(O.text));}continue;}- _(T, C, F, v, !0);+ _(T, v, F, C, !0);}- const M = PM(i.chunks, y, h.length), w = g === null ? null : I1(i.normalized, g);+ const M = VM(i.chunks, y, h.length), w = g === null ? null : L1(i.normalized, g);return p !== null ? {widths: h,lineEndFitAdvances: u,@@ -29906,7 +29906,7 @@ function LM(i, e, t, n) {chunks: M};}-function PM(i, e, t) {+function VM(i, e, t) {const n = [];for (let s = 0; s < i.length; s++) {const r = i[s], a = r.startSegmentIndex < e.length ? e[r.startSegmentIndex] : t, o = r.endSegmentIndex < e.length ? e[r.endSegmentIndex] : t, c = r.consumedEndSegmentIndex < e.length ? e[r.consumedEndSegmentIndex] : t;@@ -29918,47 +29918,47 @@ function PM(i, e, t) {}return n;}-function T0(i, e, t, n) {- const r = pM(i, Pa(), n?.whiteSpace, "normal");- return LM(r, e, t);+function k0(i, e, t, n) {+ const r = yM(i, Qa(), n?.whiteSpace, "normal");+ return zM(r, e, t);}-function kc(i, e, t) {- return T0(i, e, !1, t);+function Hc(i, e, t) {+ return k0(i, e, !1, t);}-function vl(i, e, t) {- return T0(i, e, !0, t);+function Tl(i, e, t) {+ return k0(i, e, !0, t);}-function kM(i, e, t) {- const n = TM(i, e);+function WM(i, e, t) {+ const n = UM(i, e);return { lineCount: n, height: n * t };}-function VA(i, e, t) {+function YA(i, e, t) {let n = t.get(i);if (n !== void 0)return n;n = [];- const s = B0();+ const s = P0();for (const r of s.segment(e[i]))n.push(r.segment);return t.set(i, n), n;}-function R0(i) {- let e = zA.get(i);- return e !== void 0 || (e = /* @__PURE__ */ new Map(), zA.set(i, e)), e;+function U0(i) {+ let e = XA.get(i);+ return e !== void 0 || (e = /* @__PURE__ */ new Map(), XA.set(i, e)), e;}-function UM(i, e, t, n) {+function qM(i, e, t, n) {return n > 0 && i[n - 1] === "soft-hyphen" && !(e === n && t > 0);}-function OM(i, e, t, n, s, r, a) {+function KM(i, e, t, n, s, r, a) {let o = "";- const c = UM(e, n, s, r);+ const c = qM(e, n, s, r);for (let l = n; l < r; l++)- e[l] === "soft-hyphen" || e[l] === "hard-break" || (l === n && s > 0 ? o += VA(l, i, t).slice(s).join("") : o += i[l]);- return a > 0 ? (c && (o += "-"), o += VA(r, i, t).slice(n === r ? s : 0, a).join("")) : c && (o += "-"), o;+ e[l] === "soft-hyphen" || e[l] === "hard-break" || (l === n && s > 0 ? o += YA(l, i, t).slice(s).join("") : o += i[l]);+ return a > 0 ? (c && (o += "-"), o += YA(r, i, t).slice(n === r ? s : 0, a).join("")) : c && (o += "-"), o;}-function N0(i, e, t, n, s, r, a) {+function O0(i, e, t, n, s, r, a) {return {- text: OM(i.segments, i.kinds, e, n, s, r, a),+ text: KM(i.segments, i.kinds, e, n, s, r, a),width: t,start: {segmentIndex: n,@@ -29970,10 +29970,10 @@ function N0(i, e, t, n, s, r, a) {}};}-function QM(i, e, t) {- return N0(i, e, t.width, t.startSegmentIndex, t.startGraphemeIndex, t.endSegmentIndex, t.endGraphemeIndex);+function jM(i, e, t) {+ return O0(i, e, t.width, t.startSegmentIndex, t.startGraphemeIndex, t.endSegmentIndex, t.endGraphemeIndex);}-function GM(i) {+function XM(i) {return {width: i.width,start: {@@ -29986,76 +29986,76 @@ function GM(i) {}};}-function HM(i, e) {- return N0(i, R0(i), e.width, e.start.segmentIndex, e.start.graphemeIndex, e.end.segmentIndex, e.end.graphemeIndex);+function YM(i, e) {+ return O0(i, U0(i), e.width, e.start.segmentIndex, e.start.graphemeIndex, e.end.segmentIndex, e.end.graphemeIndex);}-function zM(i, e, t) {- return i.widths.length === 0 ? 0 : Mf(i, e, (n) => {- t(GM(n));+function JM(i, e, t) {+ return i.widths.length === 0 ? 0 : Df(i, e, (n) => {+ t(XM(n));});}-function Xh(i, e) {- return NM(i, e);+function eu(i, e) {+ return QM(i, e);}-function WA(i) {+function JA(i) {let e = 0;- return zM(i, Number.POSITIVE_INFINITY, (t) => {+ return JM(i, Number.POSITIVE_INFINITY, (t) => {t.width > e && (e = t.width);}), e;}-function VM(i, e, t) {+function ZM(i, e, t) {const n = [];if (i.widths.length === 0)return { lineCount: 0, height: 0, lines: n };- const s = R0(i), r = Mf(i, e, (a) => {- n.push(QM(i, s, a));+ const s = U0(i), r = Df(i, e, (a) => {+ n.push(jM(i, s, a));});return { lineCount: r, height: r * t, lines: n };}-const WM = /[ \t\n\f\r]+/, qA = /^[ \t\n\f\r]+/, KA = /[ \t\n\f\r]+$/, rl = { segmentIndex: 0, graphemeIndex: 0 }, F0 = {+const $M = /[ \t\n\f\r]+/, ZA = /^[ \t\n\f\r]+/, $A = /[ \t\n\f\r]+$/, hl = { segmentIndex: 0, graphemeIndex: 0 }, Q0 = {itemIndex: 0,segmentIndex: 0,graphemeIndex: 0};-function Yh(i) {+function tu(i) {return {segmentIndex: i.segmentIndex,graphemeIndex: i.graphemeIndex};}-function XA(i) {+function eg(i) {return i.segmentIndex === 0 && i.graphemeIndex === 0;}-function Uc(i, e) {+function zc(i, e) {const t = e.get(i);if (t !== void 0)return t;- const n = WA(vl("A A", i)), s = WA(vl("AA", i)), r = Math.max(0, n - s);+ const n = JA(Tl("A A", i)), s = JA(Tl("AA", i)), r = Math.max(0, n - s);return e.set(i, r), r;}-function qM(i) {- const e = _d(i, rl, Number.POSITIVE_INFINITY);+function eB(i) {+ const e = Id(i, hl, Number.POSITIVE_INFINITY);return e === null ? null : {endGraphemeIndex: e.endGraphemeIndex,endSegmentIndex: e.endSegmentIndex,width: e.width};}-function KM(i, e) {+function tB(i, e) {return i === 0 && e > 0;}-function D0(i) {+function G0(i) {const e = [], t = Array.from({ length: i.length }), n = /* @__PURE__ */ new Map();let s = 0;for (let r = 0; r < i.length; r++) {- const a = i[r], o = qA.test(a.text), c = KA.test(a.text), l = a.text.replace(qA, "").replace(KA, "");+ const a = i[r], o = ZA.test(a.text), c = $A.test(a.text), l = a.text.replace(ZA, "").replace($A, "");if (l.length === 0) {- WM.test(a.text) && s === 0 && (s = Uc(a.font, n));+ $M.test(a.text) && s === 0 && (s = zc(a.font, n));continue;}- const h = s > 0 ? s : o ? Uc(a.font, n) : 0, u = vl(l, a.font), d = qM(u);+ const h = s > 0 ? s : o ? zc(a.font, n) : 0, u = Tl(l, a.font), d = eB(u);if (d === null) {- s = c ? Uc(a.font, n) : 0;+ s = c ? zc(a.font, n) : 0;continue;}const f = {@@ -30068,14 +30068,14 @@ function D0(i) {prepared: u,sourceItemIndex: r};- e.push(f), t[r] = f, s = c ? Uc(a.font, n) : 0;+ e.push(f), t[r] = f, s = c ? zc(a.font, n) : 0;}return {items: e,itemsBySourceItemIndex: t};}-function XM(i, e, t, n) {+function nB(i, e, t, n) {if (i.items.length === 0 || t.itemIndex >= i.items.length)return null;const s = Math.max(1, e);@@ -30086,11 +30086,11 @@ function XM(i, e, t, n) {};e: for (; o < i.items.length; ) {const l = i.items[o];- if (!XA(c) && c.segmentIndex === l.endSegmentIndex && c.graphemeIndex === l.endGraphemeIndex) {+ if (!eg(c) && c.segmentIndex === l.endSegmentIndex && c.graphemeIndex === l.endGraphemeIndex) {o++, c.segmentIndex = 0, c.graphemeIndex = 0;continue;}- const h = r === 0 ? 0 : l.gapBefore, u = XA(c);+ const h = r === 0 ? 0 : l.gapBefore, u = eg(c);if (l.break === "never") {if (!u) {o++, c.segmentIndex = 0, c.graphemeIndex = 0;@@ -30099,7 +30099,7 @@ function XM(i, e, t, n) {const g = l.naturalWidth + l.extraWidth, A = h + g;if (r > 0 && A > a)break e;- n?.(l, h, g, Yh(rl), {+ n?.(l, h, g, tu(hl), {segmentIndex: l.endSegmentIndex,graphemeIndex: l.endGraphemeIndex}), r += A, a = Math.max(0, s - r), o++, c.segmentIndex = 0, c.graphemeIndex = 0;@@ -30111,14 +30111,14 @@ function XM(i, e, t, n) {if (u) {const g = d + l.naturalWidth;if (g <= a) {- n?.(l, h, l.naturalWidth + l.extraWidth, Yh(rl), {+ n?.(l, h, l.naturalWidth + l.extraWidth, tu(hl), {segmentIndex: l.endSegmentIndex,graphemeIndex: l.endGraphemeIndex}), r += g, a = Math.max(0, s - r), o++, c.segmentIndex = 0, c.graphemeIndex = 0;continue;}}- const f = Math.max(1, a - d), m = _d(l.prepared, c, f);+ const f = Math.max(1, a - d), m = Id(l.prepared, c, f);if (m === null) {o++, c.segmentIndex = 0, c.graphemeIndex = 0;continue;@@ -30127,12 +30127,12 @@ function XM(i, e, t, n) {o++, c.segmentIndex = 0, c.graphemeIndex = 0;continue;}- if (r > 0 && u && h > 0 && KM(m.endSegmentIndex, m.endGraphemeIndex)) {- const g = _d(l.prepared, rl, Math.max(1, s - l.extraWidth));+ if (r > 0 && u && h > 0 && tB(m.endSegmentIndex, m.endGraphemeIndex)) {+ const g = Id(l.prepared, hl, Math.max(1, s - l.extraWidth));if (g !== null && (g.endSegmentIndex > m.endSegmentIndex || g.endSegmentIndex === m.endSegmentIndex && g.endGraphemeIndex > m.endGraphemeIndex))break e;}- if (n?.(l, h, m.width + l.extraWidth, Yh(c), {+ if (n?.(l, h, m.width + l.extraWidth, tu(c), {segmentIndex: m.endSegmentIndex,graphemeIndex: m.endGraphemeIndex}), r += h + m.width + l.extraWidth, a = Math.max(0, s - r), m.endSegmentIndex === l.endSegmentIndex && m.endGraphemeIndex === l.endGraphemeIndex) {@@ -30144,12 +30144,12 @@ function XM(i, e, t, n) {}return r === 0 ? null : (t.itemIndex = o, t.segmentIndex = c.segmentIndex, t.graphemeIndex = c.graphemeIndex, r);}-function YM(i, e, t = F0) {+function iB(i, e, t = Q0) {const n = i, s = {itemIndex: t.itemIndex,segmentIndex: t.segmentIndex,graphemeIndex: t.graphemeIndex- }, r = [], a = XM(n, e, s, (o, c, l, h, u) => {+ }, r = [], a = nB(n, e, s, (o, c, l, h, u) => {r.push({itemIndex: o.sourceItemIndex,gapBefore: c,@@ -30164,14 +30164,14 @@ function YM(i, e, t = F0) {end: s};}-function jM(i, e) {- return HM(i.prepared, {+function sB(i, e) {+ return YM(i.prepared, {width: e.occupiedWidth - i.extraWidth,start: e.start,end: e.end}).text;}-function L0(i, e) {+function H0(i, e) {const t = i;return {fragments: e.fragments.map((n) => {@@ -30180,24 +30180,24 @@ function L0(i, e) {throw new Error("Missing rich-text inline item for fragment");return {...n,- text: jM(s, n)+ text: sB(s, n)};}),width: e.width,end: e.end};}-function P0(i, e, t) {- let n = 0, s = F0;+function z0(i, e, t) {+ let n = 0, s = Q0;for (; ; ) {- const r = YM(i, e, s);+ const r = iB(i, e, s);if (r === null)return n;t(r), n++, s = r.end;}}-const YA = "500 14px Inter, sans-serif", jh = "600 10px Inter, sans-serif", Jh = "300 13px Inter, sans-serif", jA = "600 10px Inter, sans-serif", JA = "300 12px Inter, sans-serif", eo = 18, Oc = 16, sn = 16, vi = 6, ZA = 12, Qc = Math.min(window.devicePixelRatio || 1, 2), JM = "rgba(0, 0, 0, 0.75)", ZM = "rgba(255, 255, 255, 0.08)", $M = "rgba(255, 255, 255, 0.9)", eB = "rgba(255, 255, 255, 0.30)", tB = "rgba(255, 255, 255, 0.85)", $A = "rgba(255, 255, 255, 0.08)", nB = "rgba(255, 255, 255, 0.45)", iB = "rgba(255, 255, 255, 0.08)", sB = "rgba(255, 255, 255, 0.7)";-function rB(i) {+const tg = "500 14px Inter, sans-serif", nu = "600 10px Inter, sans-serif", iu = "300 13px Inter, sans-serif", ng = "600 10px Inter, sans-serif", ig = "300 12px Inter, sans-serif", so = 18, Vc = 16, sn = 16, Si = 6, sg = 12, Wc = Math.min(window.devicePixelRatio || 1, 2), rB = "rgba(0, 0, 0, 0.75)", aB = "rgba(255, 255, 255, 0.08)", oB = "rgba(255, 255, 255, 0.9)", cB = "rgba(255, 255, 255, 0.30)", lB = "rgba(255, 255, 255, 0.85)", rg = "rgba(255, 255, 255, 0.08)", hB = "rgba(255, 255, 255, 0.45)", uB = "rgba(255, 255, 255, 0.08)", dB = "rgba(255, 255, 255, 0.7)";+function fB(i) {let e = 0, t = 0, n = 0;const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();let o = !1, c = !1;@@ -30224,42 +30224,42 @@ function rB(i) {hasMorphs: c};}-function to(i) {+function ro(i) {return i >= 1e6 ? (i / 1e6).toFixed(1) + "M" : i >= 1e3 ? (i / 1e3).toFixed(1) + "K" : i.toString();}-function aB(i, e) {+function pB(i, e) {const t = [];return i.hasSkinning && t.push("skinned"), i.hasMorphs && t.push("morph targets"), e && e.length > 0 && t.push(`${e.length} animation${e.length > 1 ? "s" : ""}`), i.materialTypes.length > 0 && t.push(i.materialTypes.join(", ")), t.length > 0 ? t.join(" · ") : "";}-function oB(i, e, t) {- const n = rB(e), s = aB(n, t), r = [- { label: "MESHES", value: to(n.meshes) },- { label: "VERTICES", value: to(n.vertices) },- { label: "TRIANGLES", value: to(n.triangles) },- { label: "MATERIALS", value: to(n.materials) },- { label: "TEXTURES", value: to(n.textures) }+function AB(i, e, t) {+ const n = fB(e), s = pB(n, t), r = [+ { label: "MESHES", value: ro(n.meshes) },+ { label: "VERTICES", value: ro(n.vertices) },+ { label: "TRIANGLES", value: ro(n.triangles) },+ { label: "MATERIALS", value: ro(n.materials) },+ { label: "TEXTURES", value: ro(n.textures) }];t && t.length > 0 && r.push({ label: "ANIMATIONS", value: t.length.toString() });const a = [];n.materialTypes.forEach((w) => a.push(w)), n.hasSkinning && a.push("Skinned"), n.hasMorphs && a.push("Morph"), t && t.length > 0 && a.push("Animated");- const o = 200, c = kc("Model Info", YA), l = kM(c, o, eo + 2), h = r.map((w) => {+ const o = 200, c = Hc("Model Info", tg), l = WM(c, o, so + 2), h = r.map((w) => {const S = [- { text: w.label + " ", font: jh },- { text: w.value, font: Jh }- ], T = D0(S), v = kc(w.label, jh), C = Xh(v, o), F = kc(w.value, Jh), K = Xh(F, o);+ { text: w.label + " ", font: nu },+ { text: w.value, font: iu }+ ], T = G0(S), C = Hc(w.label, nu), v = eu(C, o), F = Hc(w.value, iu), K = eu(F, o);return {...w,- labelWidth: C.maxLineWidth,+ labelWidth: v.maxLineWidth,valueWidth: K.maxLineWidth,richPrepared: T};}), u = a.map((w) => {- const S = kc(w, jA), T = Xh(S, 300);- return { text: w, width: T.maxLineWidth + ZA };+ const S = Hc(w, ng), T = eu(S, 300);+ return { text: w, width: T.maxLineWidth + sg };});let d = [], f = 0;if (s) {- const w = vl(s, JA), S = VM(w, o - sn, eo);+ const w = Tl(s, ig), S = ZM(w, o - sn, so);d = S.lines, f = S.height;}const m = Math.max(@@ -30271,28 +30271,28 @@ function oB(i, e, t) {let w = 0, S = 1;u.forEach((T) => {w > 0 && w + T.width > g - sn * 2 && (S++, w = 0), w += T.width + 6;- }), A = S * (Oc + 6) + vi;+ }), A = S * (Vc + 6) + Si;}- const p = sn + l.height + vi + // title- vi + // separator- h.length * (eo + vi) + // stat rows+ const p = sn + l.height + Si + // title+ Si + // separator+ h.length * (so + Si) + // stat rowsA + // chips- (f > 0 ? vi + f : 0) + // description+ (f > 0 ? Si + f : 0) + // descriptionsn, y = document.createElement("canvas");- y.width = g * Qc, y.height = p * Qc, y.style.width = g + "px", y.style.height = p + "px";+ y.width = g * Wc, y.height = p * Wc, y.style.width = g + "px", y.style.height = p + "px";const b = y.getContext("2d");- b.scale(Qc, Qc), b.fillStyle = JM, Zh(b, 0, 0, g, p, 10), b.fill(), b.strokeStyle = ZM, b.lineWidth = 1, Zh(b, 0.5, 0.5, g - 1, p - 1, 10), b.stroke();+ b.scale(Wc, Wc), b.fillStyle = rB, su(b, 0, 0, g, p, 10), b.fill(), b.strokeStyle = aB, b.lineWidth = 1, su(b, 0.5, 0.5, g - 1, p - 1, 10), b.stroke();let _ = sn;- if (b.font = YA, b.fillStyle = $M, b.textBaseline = "top", b.fillText("Model Info", sn, _), _ += l.height + vi, b.strokeStyle = $A, b.beginPath(), b.moveTo(sn, _), b.lineTo(g - sn, _), b.stroke(), _ += vi, h.forEach((w) => {- b.font = jh, b.fillStyle = eB, b.textAlign = "left", b.fillText(w.label, sn, _), b.font = Jh, b.fillStyle = tB, b.textAlign = "right", b.fillText(w.value, g - sn, _), b.textAlign = "left", _ += eo + vi;+ if (b.font = tg, b.fillStyle = oB, b.textBaseline = "top", b.fillText("Model Info", sn, _), _ += l.height + Si, b.strokeStyle = rg, b.beginPath(), b.moveTo(sn, _), b.lineTo(g - sn, _), b.stroke(), _ += Si, h.forEach((w) => {+ b.font = nu, b.fillStyle = cB, b.textAlign = "left", b.fillText(w.label, sn, _), b.font = iu, b.fillStyle = lB, b.textAlign = "right", b.fillText(w.value, g - sn, _), b.textAlign = "left", _ += so + Si;}), u.length > 0) {let w = sn;u.forEach((S) => {- w > sn && w + S.width > g - sn && (w = sn, _ += Oc + 6), b.fillStyle = iB, Zh(b, w, _, S.width, Oc, 4), b.fill(), b.font = jA, b.fillStyle = sB, b.textBaseline = "top", b.fillText(S.text, w + ZA / 2, _ + 3), w += S.width + 6;- }), _ += Oc + vi + 4;+ w > sn && w + S.width > g - sn && (w = sn, _ += Vc + 6), b.fillStyle = uB, su(b, w, _, S.width, Vc, 4), b.fill(), b.font = ng, b.fillStyle = dB, b.textBaseline = "top", b.fillText(S.text, w + sg / 2, _ + 3), w += S.width + 6;+ }), _ += Vc + Si + 4;}- d.length > 0 && (b.strokeStyle = $A, b.beginPath(), b.moveTo(sn, _), b.lineTo(g - sn, _), b.stroke(), _ += vi, b.font = JA, b.fillStyle = nB, b.textBaseline = "top", d.forEach((w) => {- b.fillText(w.text, sn, _), _ += eo;+ d.length > 0 && (b.strokeStyle = rg, b.beginPath(), b.moveTo(sn, _), b.lineTo(g - sn, _), b.stroke(), _ += Si, b.font = ig, b.fillStyle = hB, b.textBaseline = "top", d.forEach((w) => {+ b.fillText(w.text, sn, _), _ += so;}));const M = document.createElement("div");return M.classList.add("model-info"), M.appendChild(y), i.appendChild(M), {@@ -30303,25 +30303,25 @@ function oB(i, e, t) {}};}-function Zh(i, e, t, n, s, r) {+function su(i, e, t, n, s, r) {i.beginPath(), i.moveTo(e + r, t), i.lineTo(e + n - r, t), i.quadraticCurveTo(e + n, t, e + n, t + r), i.lineTo(e + n, t + s - r), i.quadraticCurveTo(e + n, t + s, e + n - r, t + s), i.lineTo(e + r, t + s), i.quadraticCurveTo(e, t + s, e, t + s - r), i.lineTo(e, t + r), i.quadraticCurveTo(e, t, e + r, t), i.closePath();}-const cB = "500 11px Inter, sans-serif", eg = "300 10px Inter, sans-serif", yd = 10, k0 = 6, U0 = 14, Gc = Math.min(window.devicePixelRatio || 1, 2), lB = 8;-function hB(i) {+const gB = "500 11px Inter, sans-serif", ag = "300 10px Inter, sans-serif", Md = 10, V0 = 6, W0 = 14, qc = Math.min(window.devicePixelRatio || 1, 2), mB = 8;+function bB(i) {const e = [];return i.traverse((t) => {- if (e.length >= lB || !t.isMesh || !t.name || t.name.startsWith("_")) return;+ if (e.length >= mB || !t.isMesh || !t.name || t.name.startsWith("_")) return;const n = t.geometry, s = Array.isArray(t.material) ? t.material[0] : t.material, r = n && n.attributes.position ? n.attributes.position.count : 0, a = s ? s.type.replace("Material", "") : "", o = [- { text: t.name, font: cB }+ { text: t.name, font: gB }];- r > 0 && o.push({ text: " " + dB(r) + " verts", font: eg }), a && o.push({ text: " " + a, font: eg });- const c = D0(o);+ r > 0 && o.push({ text: " " + EB(r) + " verts", font: ag }), a && o.push({ text: " " + a, font: ag });+ const c = G0(o);let l = 0, h = 0;- P0(c, 300, (g) => {- const A = L0(c, g);+ z0(c, 300, (g) => {+ const A = H0(c, g);l = Math.max(l, A.width), h++;});- const u = l + yd * 2, d = h * U0 + k0 * 2;+ const u = l + Md * 2, d = h * W0 + V0 * 2;n && n.computeBoundingBox();const f = n ? n.boundingBox : null, m = new H();f ? (f.getCenter(m), m.applyMatrix4(t.matrixWorld)) : t.getWorldPosition(m), e.push({@@ -30336,30 +30336,30 @@ function hB(i) {});}), e;}-function uB(i) {+function xB(i) {const { labelWidth: e, labelHeight: t, items: n, prepared: s } = i, r = document.createElement("canvas");- r.width = e * Gc, r.height = t * Gc, r.style.width = e + "px", r.style.height = t + "px";+ r.width = e * qc, r.height = t * qc, r.style.width = e + "px", r.style.height = t + "px";const a = r.getContext("2d");- a.scale(Gc, Gc), a.fillStyle = "rgba(0, 0, 0, 0.8)", tg(a, 0, 0, e, t, 6), a.fill(), a.strokeStyle = "rgba(255, 255, 255, 0.1)", a.lineWidth = 1, tg(a, 0.5, 0.5, e - 1, t - 1, 6), a.stroke(), a.textBaseline = "top";- let o = k0;- return P0(s, e - yd * 2, (c) => {- const l = L0(s, c);- let h = yd;+ a.scale(qc, qc), a.fillStyle = "rgba(0, 0, 0, 0.8)", og(a, 0, 0, e, t, 6), a.fill(), a.strokeStyle = "rgba(255, 255, 255, 0.1)", a.lineWidth = 1, og(a, 0.5, 0.5, e - 1, t - 1, 6), a.stroke(), a.textBaseline = "top";+ let o = V0;+ return z0(s, e - Md * 2, (c) => {+ const l = H0(s, c);+ let h = Md;l.fragments.forEach((u) => {h += u.gapBefore;const d = n[u.itemIndex];a.font = d.font, a.fillStyle = u.itemIndex === 0 ? "rgba(255, 255, 255, 0.9)" : "rgba(255, 255, 255, 0.45)", a.fillText(u.text, h, o), h += u.occupiedWidth;- }), o += U0;+ }), o += W0;}), r;}-function dB(i) {+function EB(i) {return i >= 1e6 ? (i / 1e6).toFixed(1) + "M" : i >= 1e3 ? (i / 1e3).toFixed(1) + "K" : i.toString();}-function tg(i, e, t, n, s, r) {+function og(i, e, t, n, s, r) {i.beginPath(), i.moveTo(e + r, t), i.lineTo(e + n - r, t), i.quadraticCurveTo(e + n, t, e + n, t + r), i.lineTo(e + n, t + s - r), i.quadraticCurveTo(e + n, t + s, e + n - r, t + s), i.lineTo(e + r, t + s), i.quadraticCurveTo(e, t + s, e, t + s - r), i.lineTo(e, t + r), i.quadraticCurveTo(e, t, e + r, t), i.closePath();}-const $h = /* @__PURE__ */ new WeakMap();-class fB extends fs {+const ru = /* @__PURE__ */ new WeakMap();+class _B extends ps {/*** Constructs a new Draco loader.*@@ -30416,7 +30416,7 @@ class fB extends fs {* @param {onErrorCallback} onError - Executed when errors occur.*/load(e, t, n, s) {- const r = new Ls(this.manager);+ const r = new Ps(this.manager);r.setPath(this.path), r.setResponseType("arraybuffer"), r.setRequestHeader(this.requestHeader), r.setWithCredentials(this.withCredentials), r.load(e, (a) => {this.parse(a, t, s);}, n, s);@@ -30445,8 +30445,8 @@ class fB extends fs {}decodeGeometry(e, t) {const n = JSON.stringify(t);- if ($h.has(e)) {- const c = $h.get(e);+ if (ru.has(e)) {+ const c = ru.get(e);if (c.key === n)return c.promise;if (e.byteLength === 0)@@ -30460,7 +30460,7 @@ class fB extends fs {}))).then((c) => this._createGeometry(c.geometry));return o.catch(() => !0).then(() => {s && r && this._releaseTask(s, r);- }), $h.set(e, {+ }), ru.set(e, {key: n,promise: o}), o;@@ -30476,12 +30476,12 @@ class fB extends fs {}_assignVertexColorSpace(e, t) {if (t !== Kt) return;- const n = new Xe();+ const n = new je();for (let s = 0, r = e.count; s < r; s++)n.fromBufferAttribute(e, s), mt.toWorkingColorSpace(n, Kt), e.setXYZ(s, n.r, n.g, n.b);}_loadLibrary(e, t) {- const n = new Ls(this.manager);+ const n = new Ps(this.manager);return n.setPath(this.decoderPath), n.setResponseType(t), n.setWithCredentials(this.withCredentials), new Promise((s, r) => {n.load(e, s, void 0, r);});@@ -30495,7 +30495,7 @@ class fB extends fs {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 s = n[0];e || (this.decoderConfig.wasmBinary = n[1]);- const r = pB.toString(), a = [+ const r = yB.toString(), a = ["/* draco decoder */",s,"",@@ -30543,7 +30543,7 @@ class fB extends fs {return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;}}-function pB() {+function yB() {let i, e;onmessage = function(a) {const o = a.data;@@ -30633,7 +30633,7 @@ function pB() {}}}-class AB {+class wB {/*** Constructs a new Worker pool.*@@ -30699,13 +30699,13 @@ class AB {this.workers.forEach((e) => e.terminate()), this.workersResolve.length = 0, this.workers.length = 0, this.queue.length = 0, this.workerStatus = 0;}}-const gB = 0, ng = 2, mB = 1, ig = 2, bB = 0, xB = 1, EB = 10, _B = 0, O0 = 9, Q0 = 15, G0 = 16, H0 = 22, z0 = 37, V0 = 43, W0 = 76, q0 = 83, K0 = 97, X0 = 100, Y0 = 103, j0 = 109, J0 = 165, Z0 = 166, Tf = 1000066e3;-class yB {+const vB = 0, cg = 2, CB = 1, lg = 2, SB = 0, IB = 1, MB = 10, BB = 0, q0 = 9, K0 = 15, j0 = 16, X0 = 22, Y0 = 37, J0 = 43, Z0 = 76, $0 = 83, eb = 97, tb = 100, nb = 103, ib = 109, sb = 165, rb = 166, Pf = 1000066e3;+class TB {constructor() {this.vkFormat = 0, this.typeSize = 1, this.pixelWidth = 0, this.pixelHeight = 0, this.pixelDepth = 0, this.layerCount = 0, this.faceCount = 1, this.supercompressionScheme = 0, this.levels = [], this.dataFormatDescriptor = [{ vendorId: 0, descriptorType: 0, descriptorBlockSize: 0, versionNumber: 2, colorModel: 0, colorPrimaries: 1, transferFunction: 2, flags: 0, texelBlockDimension: [0, 0, 0, 0], bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0], samples: [] }], this.keyValue = {}, this.globalData = null;}}-class no {+class ao {constructor(e, t, n, s) {this._dataView = void 0, this._littleEndian = void 0, this._offset = void 0, this._dataView = new DataView(e.buffer, e.byteOffset + t, n), this._littleEndian = s, this._offset = 0;}@@ -30745,68 +30745,68 @@ class no {}}const Sn = [171, 75, 84, 88, 32, 50, 48, 187, 13, 10, 26, 10];-function sg(i) {+function hg(i) {return new TextDecoder().decode(i);}-function wB(i) {+function RB(i) {const e = new Uint8Array(i.buffer, i.byteOffset, Sn.length);if (e[0] !== Sn[0] || e[1] !== Sn[1] || e[2] !== Sn[2] || e[3] !== Sn[3] || e[4] !== Sn[4] || e[5] !== Sn[5] || e[6] !== Sn[6] || e[7] !== Sn[7] || e[8] !== Sn[8] || e[9] !== Sn[9] || e[10] !== Sn[10] || e[11] !== Sn[11]) throw new Error("Missing KTX 2.0 identifier.");- const t = new yB(), n = 17 * Uint32Array.BYTES_PER_ELEMENT, s = new no(i, Sn.length, n, !0);+ const t = new TB(), n = 17 * Uint32Array.BYTES_PER_ELEMENT, s = new ao(i, Sn.length, n, !0);t.vkFormat = s._nextUint32(), t.typeSize = s._nextUint32(), t.pixelWidth = s._nextUint32(), t.pixelHeight = s._nextUint32(), t.pixelDepth = s._nextUint32(), t.layerCount = s._nextUint32(), t.faceCount = s._nextUint32();const r = s._nextUint32();t.supercompressionScheme = s._nextUint32();- const a = s._nextUint32(), o = s._nextUint32(), c = s._nextUint32(), l = s._nextUint32(), h = s._nextUint64(), u = s._nextUint64(), d = new no(i, Sn.length + n, 3 * r * 8, !0);- for (let j = 0; j < r; j++) t.levels.push({ levelData: new Uint8Array(i.buffer, i.byteOffset + d._nextUint64(), d._nextUint64()), uncompressedByteLength: d._nextUint64() });- const f = new no(i, a, o, !0), m = { vendorId: f._skip(4)._nextUint16(), descriptorType: f._nextUint16(), versionNumber: f._nextUint16(), descriptorBlockSize: f._nextUint16(), colorModel: f._nextUint8(), colorPrimaries: f._nextUint8(), transferFunction: f._nextUint8(), flags: f._nextUint8(), texelBlockDimension: [f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8()], bytesPlane: [f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8()], samples: [] }, g = (m.descriptorBlockSize / 4 - 6) / 4;- for (let j = 0; j < g; j++) {+ const a = s._nextUint32(), o = s._nextUint32(), c = s._nextUint32(), l = s._nextUint32(), h = s._nextUint64(), u = s._nextUint64(), d = new ao(i, Sn.length + n, 3 * r * 8, !0);+ for (let Y = 0; Y < r; Y++) t.levels.push({ levelData: new Uint8Array(i.buffer, i.byteOffset + d._nextUint64(), d._nextUint64()), uncompressedByteLength: d._nextUint64() });+ const f = new ao(i, a, o, !0), m = { vendorId: f._skip(4)._nextUint16(), descriptorType: f._nextUint16(), versionNumber: f._nextUint16(), descriptorBlockSize: f._nextUint16(), colorModel: f._nextUint8(), colorPrimaries: f._nextUint8(), transferFunction: f._nextUint8(), flags: f._nextUint8(), texelBlockDimension: [f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8()], bytesPlane: [f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8()], samples: [] }, g = (m.descriptorBlockSize / 4 - 6) / 4;+ for (let Y = 0; Y < g; Y++) {const Q = { bitOffset: f._nextUint16(), bitLength: f._nextUint8(), channelType: f._nextUint8(), samplePosition: [f._nextUint8(), f._nextUint8(), f._nextUint8(), f._nextUint8()], sampleLower: -1 / 0, sampleUpper: 1 / 0 };- 64 & Q.channelType ? (Q.sampleLower = f._nextInt32(), Q.sampleUpper = f._nextInt32()) : (Q.sampleLower = f._nextUint32(), Q.sampleUpper = f._nextUint32()), m.samples[j] = Q;+ 64 & Q.channelType ? (Q.sampleLower = f._nextInt32(), Q.sampleUpper = f._nextInt32()) : (Q.sampleLower = f._nextUint32(), Q.sampleUpper = f._nextUint32()), m.samples[Y] = Q;}t.dataFormatDescriptor.length = 0, t.dataFormatDescriptor.push(m);- const A = new no(i, c, l, !0);+ const A = new ao(i, c, l, !0);for (; A._offset < l; ) {- const j = A._nextUint32(), Q = A._scan(j), J = sg(Q);- if (t.keyValue[J] = A._nextUint8Array(j - Q.byteLength - 1), J.match(/^ktx/i)) {- const ee = sg(t.keyValue[J]);+ const Y = A._nextUint32(), Q = A._scan(Y), J = hg(Q);+ if (t.keyValue[J] = A._nextUint8Array(Y - Q.byteLength - 1), J.match(/^ktx/i)) {+ const ee = hg(t.keyValue[J]);t.keyValue[J] = ee.substring(0, ee.lastIndexOf("\0"));}- A._skip(j % 4 ? 4 - j % 4 : 0);+ A._skip(Y % 4 ? 4 - Y % 4 : 0);}if (u <= 0) return t;- const p = new no(i, h, u, !0), y = p._nextUint16(), b = p._nextUint16(), _ = p._nextUint32(), M = p._nextUint32(), w = p._nextUint32(), S = p._nextUint32(), T = [];- for (let j = 0; j < r; j++) T.push({ imageFlags: p._nextUint32(), rgbSliceByteOffset: p._nextUint32(), rgbSliceByteLength: p._nextUint32(), alphaSliceByteOffset: p._nextUint32(), alphaSliceByteLength: p._nextUint32() });- const v = h + p._offset, C = v + _, F = C + M, K = F + w, q = new Uint8Array(i.buffer, i.byteOffset + v, _), $ = new Uint8Array(i.buffer, i.byteOffset + C, M), D = new Uint8Array(i.buffer, i.byteOffset + F, w), O = new Uint8Array(i.buffer, i.byteOffset + K, S);+ const p = new ao(i, h, u, !0), y = p._nextUint16(), b = p._nextUint16(), _ = p._nextUint32(), M = p._nextUint32(), w = p._nextUint32(), S = p._nextUint32(), T = [];+ for (let Y = 0; Y < r; Y++) T.push({ imageFlags: p._nextUint32(), rgbSliceByteOffset: p._nextUint32(), rgbSliceByteLength: p._nextUint32(), alphaSliceByteOffset: p._nextUint32(), alphaSliceByteLength: p._nextUint32() });+ const C = h + p._offset, v = C + _, F = v + M, K = F + w, q = new Uint8Array(i.buffer, i.byteOffset + C, _), $ = new Uint8Array(i.buffer, i.byteOffset + v, M), D = new Uint8Array(i.buffer, i.byteOffset + F, w), O = new Uint8Array(i.buffer, i.byteOffset + K, S);return t.globalData = { endpointCount: y, selectorCount: b, imageDescs: T, endpointsData: q, selectorsData: $, tablesData: D, extendedData: O }, t;}-let eu, Ki, wd;-const tu = { env: { emscripten_notify_memory_growth: function(i) {- wd = new Uint8Array(Ki.exports.memory.buffer);+let au, ji, Bd;+const ou = { env: { emscripten_notify_memory_growth: function(i) {+ Bd = new Uint8Array(ji.exports.memory.buffer);} } };-class CB {+class NB {init() {- return eu || (eu = typeof fetch < "u" ? fetch("data:application/wasm;base64," + rg).then((e) => e.arrayBuffer()).then((e) => WebAssembly.instantiate(e, tu)).then(this._init) : WebAssembly.instantiate(Buffer.from(rg, "base64"), tu).then(this._init), eu);+ return au || (au = typeof fetch < "u" ? fetch("data:application/wasm;base64," + ug).then((e) => e.arrayBuffer()).then((e) => WebAssembly.instantiate(e, ou)).then(this._init) : WebAssembly.instantiate(Buffer.from(ug, "base64"), ou).then(this._init), au);}_init(e) {- Ki = e.instance, tu.env.emscripten_notify_memory_growth(0);+ ji = e.instance, ou.env.emscripten_notify_memory_growth(0);}decode(e, t = 0) {- if (!Ki) throw new Error("ZSTDDecoder: Await .init() before decoding.");- const n = e.byteLength, s = Ki.exports.malloc(n);- wd.set(e, s), t = t || Number(Ki.exports.ZSTD_findDecompressedSize(s, n));- const r = Ki.exports.malloc(t), a = Ki.exports.ZSTD_decompress(r, t, s, n), o = wd.slice(r, r + a);- return Ki.exports.free(s), Ki.exports.free(r), o;+ if (!ji) throw new Error("ZSTDDecoder: Await .init() before decoding.");+ const n = e.byteLength, s = ji.exports.malloc(n);+ Bd.set(e, s), t = t || Number(ji.exports.ZSTD_findDecompressedSize(s, n));+ const r = ji.exports.malloc(t), a = ji.exports.ZSTD_decompress(r, t, s, n), o = Bd.slice(r, r + a);+ return ji.exports.free(s), ji.exports.free(r), o;}}-const rg = "AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDA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kEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQC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wFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAW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EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqI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TQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/I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QYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ", vB = "display-p3", SB = "display-p3-linear", nu = /* @__PURE__ */ new WeakMap();-let iu = 0, su;-class ei extends fs {+const ug = "AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39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EgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJB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5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3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shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGoo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UGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ", FB = "display-p3", DB = "display-p3-linear", cu = /* @__PURE__ */ new WeakMap();+let lu = 0, hu;+class ei extends ps {/*** Constructs a new KTX2 loader.** @param {LoadingManager} [manager] - The loading manager.*/constructor(e) {- super(e), this.transcoderPath = "", this.transcoderBinary = null, this.transcoderPending = null, this.workerPool = new AB(), this.workerSourceURL = "", this.workerConfig = null, typeof MSC_TRANSCODER < "u" && console.warn(+ super(e), this.transcoderPath = "", this.transcoderBinary = null, this.transcoderPending = null, this.workerPool = new wB(), this.workerSourceURL = "", this.workerConfig = null, typeof MSC_TRANSCODER < "u" && console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.');}@@ -30879,9 +30879,9 @@ class ei extends fs {// TODO: Make this method privateinit() {if (!this.transcoderPending) {- const e = new Ls(this.manager);+ const e = new Ps(this.manager);e.setPath(this.transcoderPath), e.setWithCredentials(this.withCredentials);- const t = e.loadAsync("basis_transcoder.js"), n = new Ls(this.manager);+ const t = e.loadAsync("basis_transcoder.js"), n = new Ps(this.manager);n.setPath(this.transcoderPath), n.setResponseType("arraybuffer"), n.setWithCredentials(this.withCredentials);const s = n.loadAsync("basis_transcoder.wasm");this.transcoderPending = Promise.all([t, s]).then(([r, a]) => {@@ -30901,9 +30901,9 @@ class ei extends fs {const l = new Worker(this.workerSourceURL), h = this.transcoderBinary.slice(0);return l.postMessage({ type: "init", config: this.workerConfig, transcoderBinary: h }, [h]), l;});- }), iu > 0 && console.warn(+ }), lu > 0 && console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."- ), iu++;+ ), lu++;}return this.transcoderPending;}@@ -30919,7 +30919,7 @@ class ei extends fs {load(e, t, n, s) {if (this.workerConfig === null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");- const r = new Ls(this.manager);+ const r = new Ps(this.manager);r.setResponseType("arraybuffer"), r.setWithCredentials(this.withCredentials), r.load(e, (a) => {this.parse(a, t, s);}, n, s);@@ -30935,8 +30935,8 @@ class ei extends fs {parse(e, t, n) {if (this.workerConfig === null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");- if (nu.has(e))- return nu.get(e).promise.then(t).catch(n);+ if (cu.has(e))+ return cu.get(e).promise.then(t).catch(n);this._createTexture(e).then((s) => t ? t(s) : null).catch(n);}_createTextureFrom(e, t) {@@ -30944,12 +30944,12 @@ class ei extends fs {if (n === "error") return Promise.reject(s);let u;if (t.faceCount === 6)- u = new Q_(r, c, l);+ u = new j_(r, c, l);else {const d = r[0].mipmaps;- u = t.layerCount > 1 ? new O_(d, a, o, t.layerCount, c, l) : new Ol(d, a, o, c, l);+ u = t.layerCount > 1 ? new K_(d, a, o, t.layerCount, c, l) : new Vl(d, a, o, c, l);}- return u.minFilter = r[0].mipmaps.length === 1 ? qt : ni, u.magFilter = qt, u.generateMipmaps = !1, u.needsUpdate = !0, u.colorSpace = $0(t), u.premultiplyAlpha = !!(h & mB), u;+ return u.minFilter = r[0].mipmaps.length === 1 ? qt : ii, u.magFilter = qt, u.generateMipmaps = !1, u.needsUpdate = !0, u.colorSpace = ab(t), u.premultiplyAlpha = !!(h & CB), u;}/*** @private@@ -30958,18 +30958,18 @@ class ei extends fs {* @return {Promise<CompressedTexture|CompressedArrayTexture|DataTexture|Data3DTexture>}*/async _createTexture(e, t = {}) {- const n = wB(new Uint8Array(e)), s = n.vkFormat === Tf && n.dataFormatDescriptor[0].colorModel === 167;- if (!(n.vkFormat === _B || s && !this.workerConfig.astcHDRSupported))- return MB(n);+ const n = RB(new Uint8Array(e)), s = n.vkFormat === Pf && n.dataFormatDescriptor[0].colorModel === 167;+ if (!(n.vkFormat === BB || s && !this.workerConfig.astcHDRSupported))+ return PB(n);const a = t, o = this.init().then(() => this.workerPool.postMessage({ type: "transcode", buffer: e, taskConfig: a }, [e])).then((c) => this._createTextureFrom(c.data, n));- return nu.set(e, { promise: o }), o;+ return cu.set(e, { promise: o }), o;}/*** Frees internal resources. This method should be called* when the loader is no longer required.*/dispose() {- this.workerPool.dispose(), this.workerSourceURL && URL.revokeObjectURL(this.workerSourceURL), iu--;+ this.workerPool.dispose(), this.workerSourceURL && URL.revokeObjectURL(this.workerSourceURL), lu--;}}ei.BasisFormat = {@@ -31001,16 +31001,16 @@ ei.TranscoderFormat = {};ei.EngineFormat = {RGBAFormat: on,- RGBA_ASTC_4x4_Format: Io,- RGB_BPTC_UNSIGNED_Format: gl,- RGBA_BPTC_Format: po,- RGBA_ETC2_EAC_Format: Al,- RGBA_PVRTC_4BPPV1_Format: dl,- RGBA_S3TC_DXT5_Format: fo,- RGB_ETC1_Format: fl,- RGB_ETC2_Format: pl,- RGB_PVRTC_4BPPV1_Format: ul,- RGBA_S3TC_DXT1_Format: uo+ RGBA_ASTC_4x4_Format: Ro,+ RGB_BPTC_UNSIGNED_Format: _l,+ RGBA_BPTC_Format: bo,+ RGBA_ETC2_EAC_Format: El,+ RGBA_PVRTC_4BPPV1_Format: ml,+ RGBA_S3TC_DXT5_Format: mo,+ RGB_ETC1_Format: bl,+ RGB_ETC2_Format: xl,+ RGB_PVRTC_4BPPV1_Format: gl,+ RGBA_S3TC_DXT1_Format: go};ei.EngineType = {UnsignedByteType: rn,@@ -31061,7 +31061,7 @@ ei.BasisWorker = function() {p = a.UASTC_HDR;elsethrow new Error("THREE.KTX2Loader: Unknown Basis encoding");- const y = g.getWidth(), b = g.getHeight(), _ = g.getLayers() || 1, M = g.getLevels(), w = g.getFaces(), S = g.getHasAlpha(), T = g.getDFDFlags(), { transcoderFormat: v, engineFormat: C, engineType: F } = u(p, y, b, S);+ const y = g.getWidth(), b = g.getHeight(), _ = g.getLayers() || 1, M = g.getLevels(), w = g.getFaces(), S = g.getHasAlpha(), T = g.getDFDFlags(), { transcoderFormat: C, engineFormat: v, engineType: F } = u(p, y, b, S);if (!y || !b || !M)throw A(), new Error("THREE.KTX2Loader: Invalid texture");if (!g.startTranscoding())@@ -31070,23 +31070,23 @@ ei.BasisWorker = function() {for (let $ = 0; $ < w; $++) {const D = [];for (let O = 0; O < M; O++) {- const j = [];+ const Y = [];let Q, J;for (let ae = 0; ae < _; ae++) {const ye = g.getImageLevelInfo(O, ae, $);$ === 0 && O === 0 && ae === 0 && (ye.origWidth % 4 !== 0 || ye.origHeight % 4 !== 0) && console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."), M > 1 ? (Q = ye.origWidth, J = ye.origHeight) : (Q = ye.width, J = ye.height);- let Me = new Uint8Array(g.getImageTranscodedSizeInBytes(O, ae, 0, v));- const se = g.transcodeImage(Me, O, ae, $, v, 0, -1, -1);+ let Me = new Uint8Array(g.getImageTranscodedSizeInBytes(O, ae, 0, C));+ const se = g.transcodeImage(Me, O, ae, $, C, 0, -1, -1);if (F === s.HalfFloatType && (Me = new Uint16Array(Me.buffer, Me.byteOffset, Me.byteLength / Uint16Array.BYTES_PER_ELEMENT)), !se)throw A(), new Error("THREE.KTX2Loader: .transcodeImage failed.");- j.push(Me);+ Y.push(Me);}- const ee = f(j);+ const ee = f(Y);D.push({ data: ee, width: Q, height: J }), q.push(ee.buffer);}- K.push({ mipmaps: D, width: y, height: b, format: C, type: F });+ K.push({ mipmaps: D, width: y, height: b, format: v, type: F });}- return A(), { faces: K, buffers: q, width: y, height: b, hasAlpha: S, dfdFlags: T, format: C, type: F };+ return A(), { faces: K, buffers: q, width: y, height: b, hasAlpha: S, dfdFlags: T, format: v, type: F };}const l = [{@@ -31214,64 +31214,64 @@ ei.BasisWorker = function() {return A;}};-const IB = /* @__PURE__ */ new Set([on, cr, ts]), ru = {- [j0]: on,- [K0]: on,- [z0]: on,- [V0]: on,- [Y0]: cr,- [q0]: cr,- [G0]: cr,- [H0]: cr,- [X0]: ts,- [W0]: ts,- [Q0]: ts,- [O0]: ts,- [Tf]: Io,- [Z0]: Mo,- [J0]: Mo-}, au = {- [j0]: an,- [K0]: Rn,- [z0]: rn,- [V0]: rn,- [Y0]: an,- [q0]: Rn,- [G0]: rn,- [H0]: rn,- [X0]: an,- [W0]: Rn,- [Q0]: rn,- [O0]: rn,- [Tf]: Rn,- [Z0]: rn,- [J0]: rn+const LB = /* @__PURE__ */ new Set([on, hr, ns]), uu = {+ [ib]: on,+ [eb]: on,+ [Y0]: on,+ [J0]: on,+ [nb]: hr,+ [$0]: hr,+ [j0]: hr,+ [X0]: hr,+ [tb]: ns,+ [Z0]: ns,+ [K0]: ns,+ [q0]: ns,+ [Pf]: Ro,+ [rb]: No,+ [sb]: No+}, du = {+ [ib]: an,+ [eb]: Rn,+ [Y0]: rn,+ [J0]: rn,+ [nb]: an,+ [$0]: Rn,+ [j0]: rn,+ [X0]: rn,+ [tb]: an,+ [Z0]: Rn,+ [K0]: rn,+ [q0]: rn,+ [Pf]: Rn,+ [rb]: rn,+ [sb]: rn};-async function MB(i) {+async function PB(i) {const { vkFormat: e } = i;- if (ru[e] === void 0)+ if (uu[e] === void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;- i.supercompressionScheme === ng && (su || (su = new Promise(async (r) => {- const a = new CB();+ i.supercompressionScheme === cg && (hu || (hu = new Promise(async (r) => {+ const a = new NB();await a.init(), r(a);- })), t = await su);+ })), t = await hu);const n = [];for (let r = 0; r < i.levels.length; r++) {const a = Math.max(1, i.pixelWidth >> r), o = Math.max(1, i.pixelHeight >> r), c = i.pixelDepth ? Math.max(1, i.pixelDepth >> r) : 0, l = i.levels[r];let h;- if (i.supercompressionScheme === gB)+ if (i.supercompressionScheme === vB)h = l.levelData;- else if (i.supercompressionScheme === ng)+ else if (i.supercompressionScheme === cg)h = t.decode(l.levelData, l.uncompressedByteLength);elsethrow new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;- au[e] === an ? u = new Float32Array(+ du[e] === an ? u = new Float32Array(h.buffer,h.byteOffset,h.byteLength / Float32Array.BYTES_PER_ELEMENT- ) : au[e] === Rn ? u = new Uint16Array(+ ) : du[e] === Rn ? u = new Uint16Array(h.buffer,h.byteOffset,h.byteLength / Uint16Array.BYTES_PER_ELEMENT@@ -31283,24 +31283,24 @@ async function MB(i) {});}let s;- if (IB.has(ru[e]))- s = i.pixelDepth === 0 ? new kl(n[0].data, i.pixelWidth, i.pixelHeight) : new Qm(n[0].data, i.pixelWidth, i.pixelHeight, i.pixelDepth);+ if (LB.has(uu[e]))+ s = i.pixelDepth === 0 ? new Hl(n[0].data, i.pixelWidth, i.pixelHeight) : new Km(n[0].data, i.pixelWidth, i.pixelHeight, i.pixelDepth);else {if (i.pixelDepth > 0) throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");- s = new Ol(n, i.pixelWidth, i.pixelHeight), s.minFilter = n.length === 1 ? qt : ni, s.magFilter = qt;+ s = new Vl(n, i.pixelWidth, i.pixelHeight), s.minFilter = n.length === 1 ? qt : ii, s.magFilter = qt;}- return s.mipmaps = n, s.type = au[e], s.format = ru[e], s.colorSpace = $0(i), s.needsUpdate = !0, Promise.resolve(s);+ return s.mipmaps = n, s.type = du[e], s.format = uu[e], s.colorSpace = ab(i), s.needsUpdate = !0, Promise.resolve(s);}-function $0(i) {+function ab(i) {const e = i.dataFormatDescriptor[0];- return e.colorPrimaries === xB ? e.transferFunction === ig ? Kt : ln : e.colorPrimaries === EB ? e.transferFunction === ig ? vB : SB : (e.colorPrimaries === bB || console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`), pi);+ return e.colorPrimaries === IB ? e.transferFunction === lg ? Kt : ln : e.colorPrimaries === MB ? e.transferFunction === lg ? FB : DB : (e.colorPrimaries === SB || console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`), Ai);}-const Hc = "[default]", Cd = { ASSET_GENERATOR: "assetgenerator" }, Sl = new e0(), eb = "https://unpkg.com/[email protected]", BB = new fB(Sl).setDecoderPath(- `${eb}/examples/jsm/libs/draco/gltf/`-), TB = new ei(Sl).setTranscoderPath(- `${eb}/examples/jsm/libs/basis/`+const Kc = "[default]", Td = { ASSET_GENERATOR: "assetgenerator" }, Rl = new o0(), ob = "https://unpkg.com/[email protected]", kB = new _B(Rl).setDecoderPath(+ `${ob}/examples/jsm/libs/draco/gltf/`+), UB = new ei(Rl).setTranscoderPath(+ `${ob}/examples/jsm/libs/basis/`);-function ag(i, e) {+function dg(i, e) {const t = /* @__PURE__ */ new Set();i.traverse((n) => {if (!n.geometry) return;@@ -31309,22 +31309,22 @@ function ag(i, e) {});});}-function RB(i) {+function OB(i) {const { state: e, options: t } = i;- if (t.preset === Cd.ASSET_GENERATOR) {- const r = new ty();+ if (t.preset === Td.ASSET_GENERATOR) {+ const r = new ly();r.name = "hemi_light", i.scene.add(r), i.lights.push(r);return;}- const n = new ay(e.ambientColor, e.ambientIntensity);+ const n = new py(e.ambientColor, e.ambientIntensity);n.name = "ambient_light", i.defaultCamera.add(n);- const s = new n0(e.directColor, e.directIntensity);+ const s = new l0(e.directColor, e.directIntensity);s.position.set(0.5, 0, 0.866), s.name = "main_light", i.defaultCamera.add(s), i.lights.push(n, s);}-function NB(i) {+function QB(i) {i.lights.forEach((e) => e.parent.remove(e)), i.lights.length = 0;}-var ti = Uint8Array, sa = Uint16Array, FB = Int32Array, tb = new ti([+var ti = Uint8Array, aa = Uint16Array, GB = Int32Array, cb = new ti([0,0,0,@@ -31359,7 +31359,7 @@ var ti = Uint8Array, sa = Uint16Array, FB = Int32Array, tb = new ti([0,/* impossible */0-]), nb = new ti([+]), lb = new ti([0,0,0,@@ -31393,65 +31393,65 @@ var ti = Uint8Array, sa = Uint16Array, FB = Int32Array, tb = new ti([/* unused */0,0-]), DB = new ti([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), ib = function(i, e) {- for (var t = new sa(31), n = 0; n < 31; ++n)+]), HB = new ti([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), hb = function(i, e) {+ for (var t = new aa(31), n = 0; n < 31; ++n)t[n] = e += 1 << i[n - 1];- for (var s = new FB(t[30]), n = 1; n < 30; ++n)+ for (var s = new GB(t[30]), n = 1; n < 30; ++n)for (var r = t[n]; r < t[n + 1]; ++r)s[r] = r - t[n] << 5 | n;return { b: t, r: s };-}, sb = ib(tb, 2), rb = sb.b, LB = sb.r;-rb[28] = 258, LB[258] = 28;-var PB = ib(nb, 0), kB = PB.b, vd = new sa(32768);+}, ub = hb(cb, 2), db = ub.b, zB = ub.r;+db[28] = 258, zB[258] = 28;+var VB = hb(lb, 0), WB = VB.b, Rd = new aa(32768);for (var Pt = 0; Pt < 32768; ++Pt) {var Cs = (Pt & 43690) >> 1 | (Pt & 21845) << 1;- Cs = (Cs & 52428) >> 2 | (Cs & 13107) << 2, Cs = (Cs & 61680) >> 4 | (Cs & 3855) << 4, vd[Pt] = ((Cs & 65280) >> 8 | (Cs & 255) << 8) >> 1;+ Cs = (Cs & 52428) >> 2 | (Cs & 13107) << 2, Cs = (Cs & 61680) >> 4 | (Cs & 3855) << 4, Rd[Pt] = ((Cs & 65280) >> 8 | (Cs & 255) << 8) >> 1;}-var Eo = (function(i, e, t) {- for (var n = i.length, s = 0, r = new sa(e); s < n; ++s)+var vo = (function(i, e, t) {+ for (var n = i.length, s = 0, r = new aa(e); s < n; ++s)i[s] && ++r[i[s] - 1];- var a = new sa(e);+ var a = new aa(e);for (s = 1; s < e; ++s)a[s] = a[s - 1] + r[s - 1] << 1;var o;if (t) {- o = new sa(1 << e);+ o = new aa(1 << e);var c = 15 - e;for (s = 0; s < n; ++s)if (i[s])for (var l = s << 4 | i[s], h = e - i[s], u = a[i[s] - 1]++ << h, d = u | (1 << h) - 1; u <= d; ++u)- o[vd[u] >> c] = l;+ o[Rd[u] >> c] = l;} else- for (o = new sa(n), s = 0; s < n; ++s)- i[s] && (o[s] = vd[a[i[s] - 1]++] >> 15 - i[s]);+ for (o = new aa(n), s = 0; s < n; ++s)+ i[s] && (o[s] = Rd[a[i[s] - 1]++] >> 15 - i[s]);return o;-}), Ko = new ti(288);+}), Zo = new ti(288);for (var Pt = 0; Pt < 144; ++Pt)- Ko[Pt] = 8;+ Zo[Pt] = 8;for (var Pt = 144; Pt < 256; ++Pt)- Ko[Pt] = 9;+ Zo[Pt] = 9;for (var Pt = 256; Pt < 280; ++Pt)- Ko[Pt] = 7;+ Zo[Pt] = 7;for (var Pt = 280; Pt < 288; ++Pt)- Ko[Pt] = 8;-var ab = new ti(32);+ Zo[Pt] = 8;+var fb = new ti(32);for (var Pt = 0; Pt < 32; ++Pt)- ab[Pt] = 5;-var UB = /* @__PURE__ */ Eo(Ko, 9, 1), OB = /* @__PURE__ */ Eo(ab, 5, 1), ou = function(i) {+ fb[Pt] = 5;+var qB = /* @__PURE__ */ vo(Zo, 9, 1), KB = /* @__PURE__ */ vo(fb, 5, 1), fu = function(i) {for (var e = i[0], t = 1; t < i.length; ++t)i[t] > e && (e = i[t]);return e;-}, li = function(i, e, t) {+}, hi = function(i, e, t) {var n = e / 8 | 0;return (i[n] | i[n + 1] << 8) >> (e & 7) & t;-}, cu = function(i, e) {+}, pu = function(i, e) {var t = e / 8 | 0;return (i[t] | i[t + 1] << 8 | i[t + 2] << 16) >> (e & 7);-}, QB = function(i) {+}, jB = function(i) {return (i + 7) / 8 | 0;-}, GB = function(i, e, t) {+}, XB = function(i, e, t) {return (t == null || t > i.length) && (t = i.length), new ti(i.subarray(e, t));-}, HB = [+}, YB = ["unexpected EOF","invalid block type","invalid length/literal",@@ -31467,75 +31467,75 @@ var UB = /* @__PURE__ */ Eo(Ko, 9, 1), OB = /* @__PURE__ */ Eo(ab, 5, 1), ou = f"stream finishing","invalid zip data"// determined by unknown compression method-], hi = function(i, e, t) {- var n = new Error(e || HB[i]);- if (n.code = i, Error.captureStackTrace && Error.captureStackTrace(n, hi), !t)+], ui = function(i, e, t) {+ var n = new Error(e || YB[i]);+ if (n.code = i, Error.captureStackTrace && Error.captureStackTrace(n, ui), !t)throw n;return n;-}, zB = function(i, e, t, n) {+}, JB = function(i, e, t, n) {var s = i.length, r = 0;if (!s || e.f && !e.l)return t || new ti(0);var a = !t, o = a || e.i != 2, c = e.i;a && (t = new ti(s * 3));- var l = function(Ct) {+ var l = function(vt) {var lt = t.length;- if (Ct > lt) {- var Je = new ti(Math.max(lt * 2, Ct));+ if (vt > lt) {+ var Je = new ti(Math.max(lt * 2, vt));Je.set(t), t = Je;}}, h = e.f || 0, u = e.p || 0, d = e.b || 0, f = e.l, m = e.d, g = e.m, A = e.n, p = s * 8;do {if (!f) {- h = li(i, u, 1);- var y = li(i, u + 1, 3);+ h = hi(i, u, 1);+ var y = hi(i, u + 1, 3);if (u += 3, y)if (y == 1)- f = UB, m = OB, g = 9, A = 5;+ f = qB, m = KB, g = 9, A = 5;else if (y == 2) {- var w = li(i, u, 31) + 257, S = li(i, u + 10, 15) + 4, T = w + li(i, u + 5, 31) + 1;+ var w = hi(i, u, 31) + 257, S = hi(i, u + 10, 15) + 4, T = w + hi(i, u + 5, 31) + 1;u += 14;- for (var v = new ti(T), C = new ti(19), F = 0; F < S; ++F)- C[DB[F]] = li(i, u + F * 3, 7);+ for (var C = new ti(T), v = new ti(19), F = 0; F < S; ++F)+ v[HB[F]] = hi(i, u + F * 3, 7);u += S * 3;- for (var K = ou(C), q = (1 << K) - 1, $ = Eo(C, K, 1), F = 0; F < T; ) {- var D = $[li(i, u, q)];+ for (var K = fu(v), q = (1 << K) - 1, $ = vo(v, K, 1), F = 0; F < T; ) {+ var D = $[hi(i, u, q)];u += D & 15;var b = D >> 4;if (b < 16)- v[F++] = b;+ C[F++] = b;else {- var O = 0, j = 0;- for (b == 16 ? (j = 3 + li(i, u, 3), u += 2, O = v[F - 1]) : b == 17 ? (j = 3 + li(i, u, 7), u += 3) : b == 18 && (j = 11 + li(i, u, 127), u += 7); j--; )- v[F++] = O;+ var O = 0, Y = 0;+ for (b == 16 ? (Y = 3 + hi(i, u, 3), u += 2, O = C[F - 1]) : b == 17 ? (Y = 3 + hi(i, u, 7), u += 3) : b == 18 && (Y = 11 + hi(i, u, 127), u += 7); Y--; )+ C[F++] = O;}}- var Q = v.subarray(0, w), J = v.subarray(w);- g = ou(Q), A = ou(J), f = Eo(Q, g, 1), m = Eo(J, A, 1);+ var Q = C.subarray(0, w), J = C.subarray(w);+ g = fu(Q), A = fu(J), f = vo(Q, g, 1), m = vo(J, A, 1);} else- hi(1);+ ui(1);else {- var b = QB(u) + 4, _ = i[b - 4] | i[b - 3] << 8, M = b + _;+ var b = jB(u) + 4, _ = i[b - 4] | i[b - 3] << 8, M = b + _;if (M > s) {- c && hi(0);+ c && ui(0);break;}o && l(d + _), t.set(i.subarray(b, M), d), e.b = d += _, e.p = u = M * 8, e.f = h;continue;}if (u > p) {- c && hi(0);+ c && ui(0);break;}}o && l(d + 131072);for (var ee = (1 << g) - 1, ae = (1 << A) - 1, ye = u; ; ye = u) {- var O = f[cu(i, u) & ee], Me = O >> 4;+ var O = f[pu(i, u) & ee], Me = O >> 4;if (u += O & 15, u > p) {- c && hi(0);+ c && ui(0);break;}- if (O || hi(2), Me < 256)+ if (O || ui(2), Me < 256)t[d++] = Me;else if (Me == 256) {ye = u, f = null;@@ -31543,25 +31543,25 @@ var UB = /* @__PURE__ */ Eo(Ko, 9, 1), OB = /* @__PURE__ */ Eo(ab, 5, 1), ou = f} else {var se = Me - 254;if (Me > 264) {- var F = Me - 257, me = tb[F];- se = li(i, u, (1 << me) - 1) + rb[F], u += me;+ var F = Me - 257, me = cb[F];+ se = hi(i, u, (1 << me) - 1) + db[F], u += me;}- var be = m[cu(i, u) & ae], xe = be >> 4;- be || hi(3), u += be & 15;- var J = kB[xe];+ var be = m[pu(i, u) & ae], xe = be >> 4;+ be || ui(3), u += be & 15;+ var J = WB[xe];if (xe > 3) {- var me = nb[xe];- J += cu(i, u) & (1 << me) - 1, u += me;+ var me = lb[xe];+ J += pu(i, u) & (1 << me) - 1, u += me;}if (u > p) {- c && hi(0);+ c && ui(0);break;}o && l(d + 131072);var Pe = d + se;if (d < J) {var $e = r - J, Qe = Math.min(J, Pe);- for ($e + d < 0 && hi(3); d < Qe; ++d)+ for ($e + d < 0 && ui(3); d < Qe; ++d)t[d] = n[$e + d];}for (; d < Pe; ++d)@@ -31570,19 +31570,19 @@ var UB = /* @__PURE__ */ Eo(Ko, 9, 1), OB = /* @__PURE__ */ Eo(ab, 5, 1), ou = f}e.l = f, e.p = ye, e.b = d, e.f = h, f && (h = 1, e.m = g, e.d = m, e.n = A);} while (!h);- return d != t.length && a ? GB(t, 0, d) : t.subarray(0, d);-}, VB = /* @__PURE__ */ new ti(0), WB = function(i, e) {- return ((i[0] & 15) != 8 || i[0] >> 4 > 7 || (i[0] << 8 | i[1]) % 31) && hi(6, "invalid zlib data"), (i[1] >> 5 & 1) == 1 && hi(6, "invalid zlib data: " + (i[1] & 32 ? "need" : "unexpected") + " dictionary"), (i[1] >> 3 & 4) + 2;+ return d != t.length && a ? XB(t, 0, d) : t.subarray(0, d);+}, ZB = /* @__PURE__ */ new ti(0), $B = function(i, e) {+ return ((i[0] & 15) != 8 || i[0] >> 4 > 7 || (i[0] << 8 | i[1]) % 31) && ui(6, "invalid zlib data"), (i[1] >> 5 & 1) == 1 && ui(6, "invalid zlib data: " + (i[1] & 32 ? "need" : "unexpected") + " dictionary"), (i[1] >> 3 & 4) + 2;};-function zc(i, e) {- return zB(i.subarray(WB(i), -4), { i: 2 }, e, e);+function jc(i, e) {+ return JB(i.subarray($B(i), -4), { i: 2 }, e, e);}-var qB = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), KB = 0;+var eT = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), tT = 0;try {- qB.decode(VB, { stream: !0 }), KB = 1;+ eT.decode(ZB, { stream: !0 }), tT = 1;} catch {}-class XB extends $_ {+class nT extends oy {/*** Constructs a new EXR loader.*@@ -31598,8 +31598,8 @@ class XB extends $_ {* @return {DataTextureLoader~TexData} An object representing the parsed texture data.*/parse(e) {- const v = Math.pow(2.7182818, 2.2);- function C(x, B) {+ const C = Math.pow(2.7182818, 2.2);+ function v(x, B) {let k = 0;for (let R = 0; R < 65536; ++R)(R == 0 || x[R >> 3] & 1 << (R & 7)) && (B[k++] = R);@@ -31637,27 +31637,27 @@ class XB extends $_ {for (; E <= R; E++) {if (U.value - B.value > k) return !1;q(6, P, z, x, U);- const X = K.l;- if (P = K.c, z = K.lc, N[E] = X, X == 63) {+ const j = K.l;+ if (P = K.c, z = K.lc, N[E] = j, j == 63) {if (U.value - B.value > k)throw new Error("Something wrong with hufUnpackEncTable");q(8, P, z, x, U);- let Y = K.l + 6;- if (P = K.c, z = K.lc, E + Y > R + 1)+ let X = K.l + 6;+ if (P = K.c, z = K.lc, E + X > R + 1)throw new Error("Something wrong with hufUnpackEncTable");- for (; Y--; ) N[E++] = 0;+ for (; X--; ) N[E++] = 0;E--;- } else if (X >= 59) {- let Y = X - 59 + 2;- if (E + Y > R + 1)+ } else if (j >= 59) {+ let X = j - 59 + 2;+ if (E + X > R + 1)throw new Error("Something wrong with hufUnpackEncTable");- for (; Y--; ) N[E++] = 0;+ for (; X--; ) N[E++] = 0;E--;}}D(N);}- function j(x) {+ function Y(x) {return x & 63;}function Q(x) {@@ -31665,7 +31665,7 @@ class XB extends $_ {}function J(x, B, k, E) {for (; B <= k; B++) {- const R = Q(x[B]), N = j(x[B]);+ const R = Q(x[B]), N = Y(x[B]);if (R >> N)throw new Error("Invalid table entry");if (N > 14) {@@ -31700,12 +31700,12 @@ class XB extends $_ {function Me(x, B, k, E, R, N, U, P, z) {if (x == B) {E < 8 && (ae(k, E, R, N), k = ee.c, E = ee.lc), E -= 8;- let X = k >> E;- if (X = new Uint8Array([X])[0], P.value + X > z)+ let j = k >> E;+ if (j = new Uint8Array([j])[0], P.value + j > z)return !1;- const Y = U[P.value - 1];- for (; X-- > 0; )- U[P.value++] = Y;+ const X = U[P.value - 1];+ for (; j-- > 0; )+ U[P.value++] = X;} else if (P.value < z)U[P.value++] = x;else@@ -31730,54 +31730,54 @@ class XB extends $_ {}function $e(x, B, k, E, R, N, U) {const P = U < 16384, z = k > R ? R : k;- let X = 1, Y, ie;- for (; X <= z; ) X <<= 1;- for (X >>= 1, Y = X, X >>= 1; X >= 1; ) {+ let j = 1, X, ie;+ for (; j <= z; ) j <<= 1;+ for (j >>= 1, X = j, j >>= 1; j >= 1; ) {ie = 0;- const he = ie + N * (R - Y), ce = N * X, fe = N * Y, Ae = E * X, _e = E * Y;+ const he = ie + N * (R - X), ce = N * j, fe = N * X, Ae = E * j, _e = E * X;let De, qe, He, Ne;for (; ie <= he; ie += fe) {let it = ie;- const Le = ie + E * (k - Y);+ const Le = ie + E * (k - X);for (; it <= Le; it += _e) {const yt = it + Ae, en = it + ce, xt = en + Ae;P ? (xe(x[it + B], x[en + B]), De = be.a, He = be.b, xe(x[yt + B], x[xt + B]), qe = be.a, Ne = be.b, xe(De, qe), x[it + B] = be.a, x[yt + B] = be.b, xe(He, Ne), x[en + B] = be.a, x[xt + B] = be.b) : (Pe(x[it + B], x[en + B]), De = be.a, He = be.b, Pe(x[yt + B], x[xt + B]), qe = be.a, Ne = be.b, Pe(De, qe), x[it + B] = be.a, x[yt + B] = be.b, Pe(He, Ne), x[en + B] = be.a, x[xt + B] = be.b);}- if (k & X) {+ if (k & j) {const yt = it + ce;P ? xe(x[it + B], x[yt + B]) : Pe(x[it + B], x[yt + B]), De = be.a, x[yt + B] = be.b, x[it + B] = De;}}- if (R & X) {+ if (R & j) {let it = ie;- const Le = ie + E * (k - Y);+ const Le = ie + E * (k - X);for (; it <= Le; it += _e) {const yt = it + Ae;P ? xe(x[it + B], x[yt + B]) : Pe(x[it + B], x[yt + B]), De = be.a, x[yt + B] = be.b, x[it + B] = De;}}- Y = X, X >>= 1;+ X = j, j >>= 1;}return ie;}function Qe(x, B, k, E, R, N, U, P, z) {- let X = 0, Y = 0;+ let j = 0, X = 0;const ie = U, he = Math.trunc(E.value + (R + 7) / 8);for (; E.value < he; )- for (ae(X, Y, k, E), X = ee.c, Y = ee.lc; Y >= 14; ) {- const fe = X >> Y - 14 & 16383, Ae = B[fe];+ for (ae(j, X, k, E), j = ee.c, X = ee.lc; X >= 14; ) {+ const fe = j >> X - 14 & 16383, Ae = B[fe];if (Ae.len)- Y -= Ae.len, Me(Ae.lit, N, X, Y, k, E, P, z, ie), X = ye.c, Y = ye.lc;+ X -= Ae.len, Me(Ae.lit, N, j, X, k, E, P, z, ie), j = ye.c, X = ye.lc;else {if (!Ae.p)throw new Error("hufDecode issues");let _e;for (_e = 0; _e < Ae.lit; _e++) {- const De = j(x[Ae.p[_e]]);- for (; Y < De && E.value < he; )- ae(X, Y, k, E), X = ee.c, Y = ee.lc;- if (Y >= De && Q(x[Ae.p[_e]]) == (X >> Y - De & (1 << De) - 1)) {- Y -= De, Me(Ae.p[_e], N, X, Y, k, E, P, z, ie), X = ye.c, Y = ye.lc;+ const De = Y(x[Ae.p[_e]]);+ for (; X < De && E.value < he; )+ ae(j, X, k, E), j = ee.c, X = ee.lc;+ if (X >= De && Q(x[Ae.p[_e]]) == (j >> X - De & (1 << De) - 1)) {+ X -= De, Me(Ae.p[_e], N, j, X, k, E, P, z, ie), j = ye.c, X = ye.lc;break;}}@@ -31786,27 +31786,27 @@ class XB extends $_ {}}const ce = 8 - R & 7;- for (X >>= ce, Y -= ce; Y > 0; ) {- const fe = B[X << 14 - Y & 16383];+ for (j >>= ce, X -= ce; X > 0; ) {+ const fe = B[j << 14 - X & 16383];if (fe.len)- Y -= fe.len, Me(fe.lit, N, X, Y, k, E, P, z, ie), X = ye.c, Y = ye.lc;+ X -= fe.len, Me(fe.lit, N, j, X, k, E, P, z, ie), j = ye.c, X = ye.lc;elsethrow new Error("hufDecode issues");}return !0;}- function Ct(x, B, k, E, R, N) {- const U = { value: 0 }, P = k.value, z = Oe(B, k), X = Oe(B, k);+ function vt(x, B, k, E, R, N) {+ const U = { value: 0 }, P = k.value, z = Oe(B, k), j = Oe(B, k);k.value += 4;- const Y = Oe(B, k);- if (k.value += 4, z < 0 || z >= 65537 || X < 0 || X >= 65537)+ const X = Oe(B, k);+ if (k.value += 4, z < 0 || z >= 65537 || j < 0 || j >= 65537)throw new Error("Something wrong with HUF_ENCSIZE");const ie = new Array(65537), he = new Array(16384);F(he);const ce = E - (k.value - P);- if (O(x, k, ce, z, X, ie), Y > 8 * (E - (k.value - P)))+ if (O(x, k, ce, z, j, ie), X > 8 * (E - (k.value - P)))throw new Error("Something wrong with hufUncompress");- J(ie, z, X, he), Qe(ie, he, x, k, Y, X, N, R, U);+ J(ie, z, j, he), Qe(ie, he, x, k, X, j, N, R, U);}function lt(x, B, k) {for (let E = 0; E < k; ++E)@@ -31848,8 +31848,8 @@ class XB extends $_ {}function dt(x, B, k, E, R, N) {let U = new DataView(N.buffer);- const P = k[x.idx[0]].width, z = k[x.idx[0]].height, X = 3, Y = Math.floor(P / 8), ie = Math.ceil(P / 8), he = Math.ceil(z / 8), ce = P - (ie - 1) * 8, fe = z - (he - 1) * 8, Ae = { value: 0 }, _e = new Array(X), De = new Array(X), qe = new Array(X), He = new Array(X), Ne = new Array(X);- for (let Le = 0; Le < X; ++Le)+ const P = k[x.idx[0]].width, z = k[x.idx[0]].height, j = 3, X = Math.floor(P / 8), ie = Math.ceil(P / 8), he = Math.ceil(z / 8), ce = P - (ie - 1) * 8, fe = z - (he - 1) * 8, Ae = { value: 0 }, _e = new Array(j), De = new Array(j), qe = new Array(j), He = new Array(j), Ne = new Array(j);+ for (let Le = 0; Le < j; ++Le)Ne[Le] = B[x.idx[Le]], _e[Le] = Le < 1 ? 0 : _e[Le - 1] + ie * he, De[Le] = new Float32Array(64), qe[Le] = new Uint16Array(64), He[Le] = new Uint16Array(ie * 64);for (let Le = 0; Le < he; ++Le) {let yt = 8;@@ -31857,25 +31857,25 @@ class XB extends $_ {let en = 8;for (let At = 0; At < ie; ++At) {At == ie - 1 && (en = ce);- for (let Ke = 0; Ke < X; ++Ke)+ for (let Ke = 0; Ke < j; ++Ke)qe[Ke].fill(0), qe[Ke][0] = R[_e[Ke]++], pt(Ae, E, qe[Ke]), ze(qe[Ke], De[Ke]), Rt(De[Ke]);Ge(De);- for (let Ke = 0; Ke < X; ++Ke)+ for (let Ke = 0; Ke < j; ++Ke)L(De[Ke], He[Ke], At * 64);}let xt = 0;- for (let At = 0; At < X; ++At) {+ for (let At = 0; At < j; ++At) {const Ke = k[x.idx[At]].type;for (let zt = 8 * Le; zt < 8 * Le + yt; ++zt) {xt = Ne[At][zt];- for (let pn = 0; pn < Y; ++pn) {+ for (let pn = 0; pn < X; ++pn) {const Nt = pn * 64 + (zt & 7) * 8;U.setUint16(xt + 0 * Ke, He[At][Nt + 0], !0), U.setUint16(xt + 2 * Ke, He[At][Nt + 1], !0), U.setUint16(xt + 4 * Ke, He[At][Nt + 2], !0), U.setUint16(xt + 6 * Ke, He[At][Nt + 3], !0), U.setUint16(xt + 8 * Ke, He[At][Nt + 4], !0), U.setUint16(xt + 10 * Ke, He[At][Nt + 5], !0), U.setUint16(xt + 12 * Ke, He[At][Nt + 6], !0), U.setUint16(xt + 14 * Ke, He[At][Nt + 7], !0), xt += 16 * Ke;}}- if (Y != ie)+ if (X != ie)for (let zt = 8 * Le; zt < 8 * Le + yt; ++zt) {- const pn = Ne[At][zt] + 8 * Y * 2 * Ke, Nt = Y * 64 + (zt & 7) * 8;+ const pn = Ne[At][zt] + 8 * X * 2 * Ke, Nt = X * 64 + (zt & 7) * 8;for (let tn = 0; tn < en; ++tn)U.setUint16(pn + tn * 2 * Ke, He[At][Nt + tn], !0);}@@ -31883,7 +31883,7 @@ class XB extends $_ {}const it = new Uint16Array(P);U = new DataView(N.buffer);- for (let Le = 0; Le < X; ++Le) {+ for (let Le = 0; Le < j; ++Le) {k[x.idx[Le]].decoded = !0;const yt = k[x.idx[Le]].type;if (k[Le].type == 2)@@ -31905,13 +31905,13 @@ class XB extends $_ {B[0] = ne(x[0]), B[1] = ne(x[1]), B[2] = ne(x[5]), B[3] = ne(x[6]), B[4] = ne(x[14]), B[5] = ne(x[15]), B[6] = ne(x[27]), B[7] = ne(x[28]), B[8] = ne(x[2]), B[9] = ne(x[4]), B[10] = ne(x[7]), B[11] = ne(x[13]), B[12] = ne(x[16]), B[13] = ne(x[26]), B[14] = ne(x[29]), B[15] = ne(x[42]), B[16] = ne(x[3]), B[17] = ne(x[8]), B[18] = ne(x[12]), B[19] = ne(x[17]), B[20] = ne(x[25]), B[21] = ne(x[30]), B[22] = ne(x[41]), B[23] = ne(x[43]), B[24] = ne(x[9]), B[25] = ne(x[11]), B[26] = ne(x[18]), B[27] = ne(x[24]), B[28] = ne(x[31]), B[29] = ne(x[40]), B[30] = ne(x[44]), B[31] = ne(x[53]), B[32] = ne(x[10]), B[33] = ne(x[19]), B[34] = ne(x[23]), B[35] = ne(x[32]), B[36] = ne(x[39]), B[37] = ne(x[45]), B[38] = ne(x[52]), B[39] = ne(x[54]), B[40] = ne(x[20]), B[41] = ne(x[22]), B[42] = ne(x[33]), B[43] = ne(x[38]), B[44] = ne(x[46]), B[45] = ne(x[51]), B[46] = ne(x[55]), B[47] = ne(x[60]), B[48] = ne(x[21]), B[49] = ne(x[34]), B[50] = ne(x[37]), B[51] = ne(x[47]), B[52] = ne(x[50]), B[53] = ne(x[56]), B[54] = ne(x[59]), B[55] = ne(x[61]), B[56] = ne(x[35]), B[57] = ne(x[36]), B[58] = ne(x[48]), B[59] = ne(x[49]), B[60] = ne(x[57]), B[61] = ne(x[58]), B[62] = ne(x[62]), B[63] = ne(x[63]);}function Rt(x) {- const B = 0.5 * Math.cos(0.7853975), k = 0.5 * Math.cos(3.14159 / 16), E = 0.5 * Math.cos(3.14159 / 8), R = 0.5 * Math.cos(3 * 3.14159 / 16), N = 0.5 * Math.cos(5 * 3.14159 / 16), U = 0.5 * Math.cos(3 * 3.14159 / 8), P = 0.5 * Math.cos(7 * 3.14159 / 16), z = new Array(4), X = new Array(4), Y = new Array(4), ie = new Array(4);+ const B = 0.5 * Math.cos(0.7853975), k = 0.5 * Math.cos(3.14159 / 16), E = 0.5 * Math.cos(3.14159 / 8), R = 0.5 * Math.cos(3 * 3.14159 / 16), N = 0.5 * Math.cos(5 * 3.14159 / 16), U = 0.5 * Math.cos(3 * 3.14159 / 8), P = 0.5 * Math.cos(7 * 3.14159 / 16), z = new Array(4), j = new Array(4), X = new Array(4), ie = new Array(4);for (let he = 0; he < 8; ++he) {const ce = he * 8;- z[0] = E * x[ce + 2], z[1] = U * x[ce + 2], z[2] = E * x[ce + 6], z[3] = U * x[ce + 6], X[0] = k * x[ce + 1] + R * x[ce + 3] + N * x[ce + 5] + P * x[ce + 7], X[1] = R * x[ce + 1] - P * x[ce + 3] - k * x[ce + 5] - N * x[ce + 7], X[2] = N * x[ce + 1] - k * x[ce + 3] + P * x[ce + 5] + R * x[ce + 7], X[3] = P * x[ce + 1] - N * x[ce + 3] + R * x[ce + 5] - k * x[ce + 7], Y[0] = B * (x[ce + 0] + x[ce + 4]), Y[3] = B * (x[ce + 0] - x[ce + 4]), Y[1] = z[0] + z[3], Y[2] = z[1] - z[2], ie[0] = Y[0] + Y[1], ie[1] = Y[3] + Y[2], ie[2] = Y[3] - Y[2], ie[3] = Y[0] - Y[1], x[ce + 0] = ie[0] + X[0], x[ce + 1] = ie[1] + X[1], x[ce + 2] = ie[2] + X[2], x[ce + 3] = ie[3] + X[3], x[ce + 4] = ie[3] - X[3], x[ce + 5] = ie[2] - X[2], x[ce + 6] = ie[1] - X[1], x[ce + 7] = ie[0] - X[0];+ z[0] = E * x[ce + 2], z[1] = U * x[ce + 2], z[2] = E * x[ce + 6], z[3] = U * x[ce + 6], j[0] = k * x[ce + 1] + R * x[ce + 3] + N * x[ce + 5] + P * x[ce + 7], j[1] = R * x[ce + 1] - P * x[ce + 3] - k * x[ce + 5] - N * x[ce + 7], j[2] = N * x[ce + 1] - k * x[ce + 3] + P * x[ce + 5] + R * x[ce + 7], j[3] = P * x[ce + 1] - N * x[ce + 3] + R * x[ce + 5] - k * x[ce + 7], X[0] = B * (x[ce + 0] + x[ce + 4]), X[3] = B * (x[ce + 0] - x[ce + 4]), X[1] = z[0] + z[3], X[2] = z[1] - z[2], ie[0] = X[0] + X[1], ie[1] = X[3] + X[2], ie[2] = X[3] - X[2], ie[3] = X[0] - X[1], x[ce + 0] = ie[0] + j[0], x[ce + 1] = ie[1] + j[1], x[ce + 2] = ie[2] + j[2], x[ce + 3] = ie[3] + j[3], x[ce + 4] = ie[3] - j[3], x[ce + 5] = ie[2] - j[2], x[ce + 6] = ie[1] - j[1], x[ce + 7] = ie[0] - j[0];}for (let he = 0; he < 8; ++he)- z[0] = E * x[16 + he], z[1] = U * x[16 + he], z[2] = E * x[48 + he], z[3] = U * x[48 + he], X[0] = k * x[8 + he] + R * x[24 + he] + N * x[40 + he] + P * x[56 + he], X[1] = R * x[8 + he] - P * x[24 + he] - k * x[40 + he] - N * x[56 + he], X[2] = N * x[8 + he] - k * x[24 + he] + P * x[40 + he] + R * x[56 + he], X[3] = P * x[8 + he] - N * x[24 + he] + R * x[40 + he] - k * x[56 + he], Y[0] = B * (x[he] + x[32 + he]), Y[3] = B * (x[he] - x[32 + he]), Y[1] = z[0] + z[3], Y[2] = z[1] - z[2], ie[0] = Y[0] + Y[1], ie[1] = Y[3] + Y[2], ie[2] = Y[3] - Y[2], ie[3] = Y[0] - Y[1], x[0 + he] = ie[0] + X[0], x[8 + he] = ie[1] + X[1], x[16 + he] = ie[2] + X[2], x[24 + he] = ie[3] + X[3], x[32 + he] = ie[3] - X[3], x[40 + he] = ie[2] - X[2], x[48 + he] = ie[1] - X[1], x[56 + he] = ie[0] - X[0];+ z[0] = E * x[16 + he], z[1] = U * x[16 + he], z[2] = E * x[48 + he], z[3] = U * x[48 + he], j[0] = k * x[8 + he] + R * x[24 + he] + N * x[40 + he] + P * x[56 + he], j[1] = R * x[8 + he] - P * x[24 + he] - k * x[40 + he] - N * x[56 + he], j[2] = N * x[8 + he] - k * x[24 + he] + P * x[40 + he] + R * x[56 + he], j[3] = P * x[8 + he] - N * x[24 + he] + R * x[40 + he] - k * x[56 + he], X[0] = B * (x[he] + x[32 + he]), X[3] = B * (x[he] - x[32 + he]), X[1] = z[0] + z[3], X[2] = z[1] - z[2], ie[0] = X[0] + X[1], ie[1] = X[3] + X[2], ie[2] = X[3] - X[2], ie[3] = X[0] - X[1], x[0 + he] = ie[0] + j[0], x[8 + he] = ie[1] + j[1], x[16 + he] = ie[2] + j[2], x[24 + he] = ie[3] + j[3], x[32 + he] = ie[3] - j[3], x[40 + he] = ie[2] - j[2], x[48 + he] = ie[1] - j[1], x[56 + he] = ie[0] - j[0];}function Ge(x) {for (let B = 0; B < 64; ++B) {@@ -31921,10 +31921,10 @@ class XB extends $_ {}function L(x, B, k) {for (let E = 0; E < 64; ++E)- B[k + E] = bp.toHalfFloat(I(x[E]));+ B[k + E] = vp.toHalfFloat(I(x[E]));}function I(x) {- return x <= 1 ? Math.sign(x) * Math.pow(Math.abs(x), 2.2) : Math.sign(x) * Math.pow(v, Math.abs(x) - 1);+ return x <= 1 ? Math.sign(x) * Math.pow(Math.abs(x), 2.2) : Math.sign(x) * Math.pow(C, Math.abs(x) - 1);}function Z(x) {return new DataView(x.array.buffer, x.offset.value, x.size);@@ -31934,7 +31934,7 @@ class XB extends $_ {return Je(k), G(k, E), new DataView(E.buffer);}function pe(x) {- const B = x.array.slice(x.offset.value, x.offset.value + x.size), k = zc(B), E = new Uint8Array(k.length);+ const B = x.array.slice(x.offset.value, x.offset.value + x.size), k = jc(B), E = new Uint8Array(k.length);return Je(k), G(k, E), new DataView(E.buffer);}function oe(x) {@@ -31949,8 +31949,8 @@ class XB extends $_ {if (P <= z)for (let fe = 0; fe < z - P + 1; fe++)R[fe + P] = et(B, k);- const X = new Uint16Array(65536), Y = C(R, X), ie = Oe(B, k);- Ct(x.array, B, k, ie, E, N);+ const j = new Uint16Array(65536), X = v(R, j), ie = Oe(B, k);+ vt(x.array, B, k, ie, E, N);for (let fe = 0; fe < x.inputChannels.length; ++fe) {const Ae = U[fe];for (let _e = 0; _e < U[fe].size; ++_e)@@ -31961,10 +31961,10 @@ class XB extends $_ {Ae.size,Ae.ny,Ae.nx * Ae.size,- Y+ X);}- lt(X, E, N);+ lt(j, E, N);let he = 0;const ce = new Uint8Array(E.buffer.byteLength);for (let fe = 0; fe < x.lines; fe++)@@ -31975,13 +31975,13 @@ class XB extends $_ {return new DataView(ce.buffer);}function Ue(x) {- const B = x.array.slice(x.offset.value, x.offset.value + x.size), k = zc(B), E = x.inputChannels.length * x.lines * x.columns * x.totalBytes, R = new ArrayBuffer(E), N = new DataView(R);+ const B = x.array.slice(x.offset.value, x.offset.value + x.size), k = jc(B), E = x.inputChannels.length * x.lines * x.columns * x.totalBytes, R = new ArrayBuffer(E), N = new DataView(R);let U = 0, P = 0;const z = new Array(4);- for (let X = 0; X < x.lines; X++)- for (let Y = 0; Y < x.inputChannels.length; Y++) {+ for (let j = 0; j < x.lines; j++)+ for (let X = 0; X < x.inputChannels.length; X++) {let ie = 0;- switch (x.inputChannels[Y].pixelType) {+ switch (x.inputChannels[X].pixelType) {case 1:z[0] = U, z[1] = z[0] + x.columns, U = z[1] + x.columns;for (let ce = 0; ce < x.columns; ++ce) {@@ -32000,7 +32000,7 @@ class XB extends $_ {}return N;}- function Ce(x) {+ function ve(x) {const B = x.viewer, k = { value: x.offset.value }, E = new Uint8Array(x.columns * x.lines * (x.inputChannels.length * x.type * 2)), R = {version: We(B, k),unknownUncompressedSize: We(B, k),@@ -32015,7 +32015,7 @@ class XB extends $_ {acCompression: We(B, k)};if (R.version < 2)- throw new Error("EXRLoader.parse: " + Oi.compression + " version " + R.version + " is unsupported");+ throw new Error("EXRLoader.parse: " + Qi.compression + " version " + R.version + " is unsupported");const N = new Array();let U = re(B, k) - 2;for (; U > 0; ) {@@ -32027,30 +32027,30 @@ class XB extends $_ {compression: De}), U -= Ae.length + 3;}- const P = Oi.channels, z = new Array(x.inputChannels.length);+ const P = Qi.channels, z = new Array(x.inputChannels.length);for (let Ae = 0; Ae < x.inputChannels.length; ++Ae) {const _e = z[Ae] = {}, De = P[Ae];_e.name = De.name, _e.compression = 0, _e.decoded = !1, _e.type = De.pixelType, _e.pLinear = De.pLinear, _e.width = x.columns, _e.height = x.lines;}- const X = {+ const j = {idx: new Array(3)};for (let Ae = 0; Ae < x.inputChannels.length; ++Ae) {const _e = z[Ae];for (let De = 0; De < N.length; ++De) {const qe = N[De];- _e.name == qe.name && (_e.compression = qe.compression, qe.index >= 0 && (X.idx[qe.index] = Ae), _e.offset = Ae);+ _e.name == qe.name && (_e.compression = qe.compression, qe.index >= 0 && (j.idx[qe.index] = Ae), _e.offset = Ae);}}- let Y, ie, he;+ let X, ie, he;if (R.acCompressedSize > 0)switch (R.acCompression) {case 0:- Y = new Uint16Array(R.totalAcUncompressedCount), Ct(x.array, B, k, R.acCompressedSize, Y, R.totalAcUncompressedCount);+ X = new Uint16Array(R.totalAcUncompressedCount), vt(x.array, B, k, R.acCompressedSize, X, R.totalAcUncompressedCount);break;case 1:- const Ae = x.array.slice(k.value, k.value + R.totalAcUncompressedCount), _e = zc(Ae);- Y = new Uint16Array(_e.buffer), k.value += R.totalAcUncompressedCount;+ const Ae = x.array.slice(k.value, k.value + R.totalAcUncompressedCount), _e = jc(Ae);+ X = new Uint16Array(_e.buffer), k.value += R.totalAcUncompressedCount;break;}if (R.dcCompressedSize > 0) {@@ -32062,7 +32062,7 @@ class XB extends $_ {ie = new Uint16Array(pe(Ae).buffer), k.value += R.dcCompressedSize;}if (R.rleRawSize > 0) {- const Ae = x.array.slice(k.value, k.value + R.rleCompressedSize), _e = zc(Ae);+ const Ae = x.array.slice(k.value, k.value + R.rleCompressedSize), _e = jc(Ae);he = dn(_e.buffer), k.value += R.rleCompressedSize;}let ce = 0;@@ -32072,7 +32072,7 @@ class XB extends $_ {for (let Ae = 0; Ae < x.lines; ++Ae)for (let _e = 0; _e < z.length; ++_e)fe[_e].push(ce), ce += z[_e].width * x.type * 2;- dt(X, fe, z, Y, ie, E);+ dt(j, fe, z, X, ie, E);for (let Ae = 0; Ae < z.length; ++Ae) {const _e = z[Ae];if (!_e.decoded)@@ -32106,7 +32106,7 @@ class XB extends $_ {);return B.value = B.value + E + 1, R;}- function je(x, B, k) {+ function Ye(x, B, k) {const E = new TextDecoder().decode(new Uint8Array(x).slice(B.value, B.value + k));@@ -32145,7 +32145,7 @@ class XB extends $_ {return B.value += 4, k;}function W(x, B) {- return bp.toHalfFloat(tt(x, B));+ return vp.toHalfFloat(tt(x, B));}function ne(x) {const B = (x & 31744) >> 10, k = x & 1023;@@ -32163,20 +32163,20 @@ class XB extends $_ {for (; k.value < R + E - 1; ) {const U = Ve(B, k), P = ke(x, k), z = et(x, k);k.value += 3;- const X = ke(x, k), Y = ke(x, k);+ const j = ke(x, k), X = ke(x, k);N.push({name: U,pixelType: P,pLinear: z,- xSampling: X,- ySampling: Y+ xSampling: j,+ ySampling: X});}return k.value += 1, N;}- function ve(x, B) {- const k = tt(x, B), E = tt(x, B), R = tt(x, B), N = tt(x, B), U = tt(x, B), P = tt(x, B), z = tt(x, B), X = tt(x, B);- return { redX: k, redY: E, greenX: R, greenY: N, blueX: U, blueY: P, whiteX: z, whiteY: X };+ function Ce(x, B) {+ const k = tt(x, B), E = tt(x, B), R = tt(x, B), N = tt(x, B), U = tt(x, B), P = tt(x, B), z = tt(x, B), j = tt(x, B);+ return { redX: k, redY: E, greenX: R, greenY: N, blueX: U, blueY: P, whiteX: z, whiteY: j };}function nt(x, B) {const k = [@@ -32228,21 +32228,21 @@ class XB extends $_ {roundingMode: E[U >> 4]};}- function ri(x, B) {+ function ai(x, B) {const k = tt(x, B), E = tt(x, B);return [k, E];}- function tc(x, B) {+ function ac(x, B) {const k = tt(x, B), E = tt(x, B), R = tt(x, B);return [k, E, R];}- function nc(x, B, k, E, R) {+ function oc(x, B, k, E, R) {if (E === "string" || E === "stringvector" || E === "iccProfile")- return je(B, k, R);+ return Ye(B, k, R);if (E === "chlist")return Ie(x, B, k, R);if (E === "chromaticities")- return ve(x, k);+ return Ce(x, k);if (E === "compression")return nt(x, k);if (E === "box2i")@@ -32256,9 +32256,9 @@ class XB extends $_ {if (E === "float")return tt(x, k);if (E === "v2f")- return ri(x, k);+ return ai(x, k);if (E === "v3f")- return tc(x, k);+ return ac(x, k);if (E === "int")return ke(x, k);if (E === "rational")@@ -32269,25 +32269,25 @@ class XB extends $_ {return k.value += R, "skipped";k.value += R;}- function Ui(x, B) {+ function Oi(x, B) {const k = Math.log2(x);return B == "ROUND_DOWN" ? Math.floor(k) : Math.ceil(k);}- function Oa(x, B, k) {+ function za(x, B, k) {let E = 0;switch (x.levelMode) {case "ONE_LEVEL":E = 1;break;case "MIPMAP_LEVELS":- E = Ui(Math.max(B, k), x.roundingMode) + 1;+ E = Oi(Math.max(B, k), x.roundingMode) + 1;break;case "RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.");}return E;}- function Qa(x, B, k, E) {+ function Va(x, B, k, E) {const R = new Array(x);for (let N = 0; N < x; N++) {const U = 1 << N;@@ -32298,43 +32298,43 @@ class XB extends $_ {}return R;}- function ic() {+ function cc() {const x = this, B = x.offset, k = { value: 0 };for (let E = 0; E < x.tileCount; E++) {const R = ke(x.viewer, B), N = ke(x.viewer, B);B.value += 8, x.size = Oe(x.viewer, B);const U = R * x.blockWidth, P = N * x.blockHeight;x.columns = U + x.blockWidth > x.width ? x.width - U : x.blockWidth, x.lines = P + x.blockHeight > x.height ? x.height - P : x.blockHeight;- const z = x.columns * x.totalBytes, Y = x.size < x.lines * z ? x.uncompress(x) : Z(x);+ const z = x.columns * x.totalBytes, X = x.size < x.lines * z ? x.uncompress(x) : Z(x);B.value += x.size;for (let ie = 0; ie < x.lines; ie++) {const he = ie * x.columns * x.totalBytes;for (let ce = 0; ce < x.inputChannels.length; ce++) {- const fe = Oi.channels[ce].name, Ae = x.channelByteOffsets[fe] * x.columns, _e = x.decodeChannels[fe];+ const fe = Qi.channels[ce].name, Ae = x.channelByteOffsets[fe] * x.columns, _e = x.decodeChannels[fe];if (_e === void 0) continue;k.value = he + Ae;const De = (x.height - (1 + P + ie)) * x.outLineWidth;for (let qe = 0; qe < x.columns; qe++) {const He = De + (qe + U) * x.outputChannels + _e;- x.byteArray[He] = x.getter(Y, k);+ x.byteArray[He] = x.getter(X, k);}}}}}- function Br() {+ function Rr() {const x = this, B = x.offset, k = { value: 0 };for (let E = 0; E < x.height / x.blockHeight; E++) {- const R = ke(x.viewer, B) - Oi.dataWindow.yMin;+ const R = ke(x.viewer, B) - Qi.dataWindow.yMin;x.size = Oe(x.viewer, B), x.lines = R + x.blockHeight > x.height ? x.height - R : x.blockHeight;const N = x.columns * x.totalBytes, P = x.size < x.lines * N ? x.uncompress(x) : Z(x);B.value += x.size;for (let z = 0; z < x.blockHeight; z++) {- const X = E * x.blockHeight, Y = z + x.scanOrder(X);- if (Y >= x.height) continue;- const ie = z * N, he = (x.height - 1 - Y) * x.outLineWidth;+ const j = E * x.blockHeight, X = z + x.scanOrder(j);+ if (X >= x.height) continue;+ const ie = z * N, he = (x.height - 1 - X) * x.outLineWidth;for (let ce = 0; ce < x.inputChannels.length; ce++) {- const fe = Oi.channels[ce].name, Ae = x.channelByteOffsets[fe] * x.columns, _e = x.decodeChannels[fe];+ const fe = Qi.channels[ce].name, Ae = x.channelByteOffsets[fe] * x.columns, _e = x.decodeChannels[fe];if (_e !== void 0) {k.value = ie + Ae;for (let De = 0; De < x.columns; De++) {@@ -32346,7 +32346,7 @@ class XB extends $_ {}}}- function sc(x, B, k) {+ function lc(x, B, k) {const E = {};if (x.getUint32(0, !0) != 20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");@@ -32364,15 +32364,15 @@ class XB extends $_ {if (U === "")N = !1;else {- const P = Ve(B, k), z = Oe(x, k), X = nc(x, B, k, P, z);- X === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`) : E[U] = X;+ const P = Ve(B, k), z = Oe(x, k), j = oc(x, B, k, P, z);+ j === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`) : E[U] = j;}}if ((R & -7) != 0)throw console.error("THREE.EXRHeader:", E), new Error("THREE.EXRLoader: Provided file is currently unsupported.");return E;}- function Tr(x, B, k, E, R) {+ function Nr(x, B, k, E, R) {const N = {size: 0,viewer: B,@@ -32412,23 +32412,23 @@ class XB extends $_ {N.blockHeight = 16, N.uncompress = Ue;break;case "DWAA_COMPRESSION":- N.blockHeight = 32, N.uncompress = Ce;+ N.blockHeight = 32, N.uncompress = ve;break;case "DWAB_COMPRESSION":- N.blockHeight = 256, N.uncompress = Ce;+ N.blockHeight = 256, N.uncompress = ve;break;default:throw new Error("EXRLoader.parse: " + x.compression + " is unsupported");}const U = {};- for (const Y of x.channels)- switch (Y.name) {+ for (const X of x.channels)+ switch (X.name) {case "Y":case "R":case "G":case "B":case "A":- U[Y.name] = !0, N.type = Y.pixelType;+ U[X.name] = !0, N.type = X.pixelType;}let P = !1;if (U.R && U.G && U.B)@@ -32469,35 +32469,35 @@ class XB extends $_ {console.error("THREE.EXRLoader: unsupported type: ", R);break;}- let X = 0;- for (const Y of x.channels)- N.decodeChannels[Y.name] !== void 0 && (N.channelByteOffsets[Y.name] = X), X += Y.pixelType * 2;- if (N.totalBytes = X, N.outLineWidth = N.width * N.outputChannels, x.lineOrder === "INCREASING_Y" ? N.scanOrder = (Y) => Y : N.scanOrder = (Y) => N.height - 1 - Y, N.outputChannels == 4 ? (N.format = on, N.colorSpace = ln) : (N.format = ts, N.colorSpace = pi), x.spec.singleTile) {+ let j = 0;+ for (const X of x.channels)+ N.decodeChannels[X.name] !== void 0 && (N.channelByteOffsets[X.name] = j), j += X.pixelType * 2;+ if (N.totalBytes = j, N.outLineWidth = N.width * N.outputChannels, x.lineOrder === "INCREASING_Y" ? N.scanOrder = (X) => X : N.scanOrder = (X) => N.height - 1 - X, N.outputChannels == 4 ? (N.format = on, N.colorSpace = ln) : (N.format = ns, N.colorSpace = Ai), x.spec.singleTile) {N.blockHeight = x.tiles.ySize, N.blockWidth = x.tiles.xSize;- const Y = Oa(x.tiles, N.width, N.height), ie = Qa(Y, N.width, x.tiles.xSize, x.tiles.roundingMode), he = Qa(Y, N.height, x.tiles.ySize, x.tiles.roundingMode);+ const X = za(x.tiles, N.width, N.height), ie = Va(X, N.width, x.tiles.xSize, x.tiles.roundingMode), he = Va(X, N.height, x.tiles.ySize, x.tiles.roundingMode);N.tileCount = ie[0] * he[0];- for (let ce = 0; ce < Y; ce++)+ for (let ce = 0; ce < X; ce++)for (let fe = 0; fe < he[ce]; fe++)for (let Ae = 0; Ae < ie[ce]; Ae++)We(B, E);- N.decode = ic.bind(N);+ N.decode = cc.bind(N);} else {N.blockWidth = N.width;- const Y = Math.ceil(N.height / N.blockHeight);- for (let ie = 0; ie < Y; ie++)+ const X = Math.ceil(N.height / N.blockHeight);+ for (let ie = 0; ie < X; ie++)We(B, E);- N.decode = Br.bind(N);+ N.decode = Rr.bind(N);}return N;}- const Ga = { value: 0 }, Ha = new DataView(e), sh = new Uint8Array(e), Oi = sc(Ha, e, Ga), As = Tr(Oi, Ha, sh, Ga, this.type);- return As.decode(), {- header: Oi,- width: As.width,- height: As.height,- data: As.byteArray,- format: As.format,- colorSpace: As.colorSpace,+ const Wa = { value: 0 }, qa = new DataView(e), hh = new Uint8Array(e), Qi = lc(qa, e, Wa), gs = Nr(Qi, qa, hh, Wa, this.type);+ return gs.decode(), {+ header: Qi,+ width: gs.width,+ height: gs.height,+ data: gs.byteArray,+ format: gs.format,+ colorSpace: gs.colorSpace,type: this.type};}@@ -32517,10 +32517,10 @@ class XB extends $_ {return super.load(e, r, n, s);}}-function YB(i, e) {+function iT(i, e) {const { id: t, path: n } = e;return t === "neutral" ? Promise.resolve({ envMap: i.neutralEnvironment }) : t === "" ? Promise.resolve({ envMap: null }) : new Promise((s, r) => {- new XB().load(+ new nT().load(n,(a) => {const o = i.pmremGenerator.fromEquirectangular(a).texture;@@ -32531,29 +32531,29 @@ function YB(i, e) {);});}-function jB(i) {+function sT(i) {i.renderer.render(i.scene, i.activeCamera), i.renderer.domElement.toBlob((e) => {if (!e) return;const t = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), n = URL.createObjectURL(e), s = document.createElement("a");s.download = `3d-screenshot-${t}.png`, s.href = n, s.click(), URL.revokeObjectURL(n);- }, "image/png"), JB(i);+ }, "image/png"), rT(i);}-function JB(i) {+function rT(i) {const e = document.createElement("div");e.className = "screenshot-flash", i.el.appendChild(e), e.addEventListener("animationend", () => e.remove());}-function ZB(i, e) {- i.mixer && (i.mixer.stopAllAction(), i.mixer.uncacheRoot(i.mixer.getRoot()), i.mixer = null), i.clips = e, e.length && (i.mixer = new i0(i.content));+function aT(i, e) {+ i.mixer && (i.mixer.stopAllAction(), i.mixer.uncacheRoot(i.mixer.getRoot()), i.mixer = null), i.clips = e, e.length && (i.mixer = new h0(i.content));}-function $B(i) {+function oT(i) {i.clips.forEach((e) => {i.mixer.clipAction(e).reset().play(), i.state.actionStates[e.name] = !0;}), i.invalidate();}-const eT = 0.35;-class tT {+const cT = 0.35;+class lT {constructor() {- this.model = null, this.mixer = null, this.clips = /* @__PURE__ */ new Map(), this.actions = /* @__PURE__ */ new Map(), this.currentName = null, this.currentAction = null, this.loader = new bf(), this.onChange = null, this._gltfCache = /* @__PURE__ */ new Map(), this._animationDefs = [];+ this.model = null, this.mixer = null, this.clips = /* @__PURE__ */ new Map(), this.actions = /* @__PURE__ */ new Map(), this.currentName = null, this.currentAction = null, this.loader = new vf(), this.onChange = null, this._gltfCache = /* @__PURE__ */ new Map(), this._animationDefs = [];}/*** Attach the manager to a loaded model. Creates a new mixer.@@ -32561,7 +32561,7 @@ class tT {* @param {THREE.Object3D} model*/attach(e) {- this.detach(), this.model = e, this.mixer = new i0(e), this.actions.clear(), this.currentAction = null, this.currentName = null;+ this.detach(), this.model = e, this.mixer = new h0(e), this.actions.clear(), this.currentAction = null, this.currentName = null;for (const [t, n] of this.clips) {const s = this._retargetClip(n, t), r = this.mixer.clipAction(s);r.enabled = !0, this.actions.set(t, r);@@ -32609,7 +32609,7 @@ class tT {throw new Error(`No animation found in ${t}`);if (r = r.clone(), r.name = e, this.clips.set(e, r), this.model && this.mixer) {const a = this._retargetClip(r, e), o = this.mixer.clipAction(a);- o.enabled = !0, o.setLoop(n.loop === !1 ? Nm : Fm), n.loop === !1 && (o.clampWhenFinished = !0), this.actions.set(e, o);+ o.enabled = !0, o.setLoop(n.loop === !1 ? Om : Qm), n.loop === !1 && (o.clampWhenFinished = !0), this.actions.set(e, o);}return r;}@@ -32648,7 +32648,7 @@ class tT {* @param {string} name* @param {number} [duration] - Crossfade duration in seconds*/- crossfadeTo(e, t = eT) {+ crossfadeTo(e, t = cT) {if (e === this.currentName) return;const n = this.actions.get(e);if (!n) {@@ -32743,15 +32743,15 @@ class tT {this.detach(), this.clips.clear(), this._gltfCache.clear(), this._animationDefs = [];}}-is.enabled = !0;-class ob {+ss.enabled = !0;+class pb {constructor(e, t) {- this.el = e, this.options = t, this.lights = [], this.content = null, this.mixer = null, this.clips = [], this.gui = null, this.animationManager = new tT(), this._animPanelEl = null, this.state = {- environment: t.preset === Cd.ASSET_GENERATOR ? Pc.find((r) => r.id === "footprint-court").name : Pc[1].name,+ this.el = e, this.options = t, this.lights = [], this.content = null, this.mixer = null, this.clips = [], this.gui = null, this.animationManager = new lT(), this._animPanelEl = null, this.state = {+ environment: t.preset === Td.ASSET_GENERATOR ? Gc.find((r) => r.id === "footprint-court").name : Gc[1].name,background: !1,playbackSpeed: 1,actionStates: {},- camera: Hc,+ camera: Kc,wireframe: !1,skeleton: !1,grid: !1,@@ -32759,7 +32759,7 @@ class ob {// LightspunctualLights: !0,exposure: 0,- toneMapping: Pu,+ toneMapping: Hu,ambientIntensity: 0.3,ambientColor: "#FFFFFF",directIntensity: 0.8 * Math.PI,@@ -32773,9 +32773,9 @@ class ob {showLabels: !1,// Avatar follow modefollowMode: "mouse"- }, this.prevTime = 0, this.stats = new mo(), this.stats.dom.height = "48px", [].forEach.call(this.stats.dom.children, (r) => r.style.display = ""), this.backgroundColor = new Xe(this.state.bgColor), this.scene = new rd(), this.scene.background = this.backgroundColor;- const n = t.preset === Cd.ASSET_GENERATOR ? 0.8 * 180 / Math.PI : 60, s = e.clientWidth / e.clientHeight;- this.defaultCamera = new Cn(n, s, 0.01, 1e3), this.activeCamera = this.defaultCamera, this.scene.add(this.defaultCamera), this.renderer = window.renderer = new pA({ antialias: !0, alpha: !0 }), this.renderer.setClearColor(0, 1), this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)), this.renderer.setSize(e.clientWidth, e.clientHeight), this.pmremGenerator = new ld(this.renderer), this.pmremGenerator.compileEquirectangularShader(), this.neutralEnvironment = this.pmremGenerator.fromScene(new t1()).texture, this.controls = new HI(this.defaultCamera, this.renderer.domElement), this.controls.screenSpacePanning = !0, this._onControlsChange = () => this.invalidate(), this.controls.addEventListener("change", this._onControlsChange), this.el.appendChild(this.renderer.domElement), this.cameraCtrl = null, this.cameraFolder = null, this.animFolder = null, this.animCtrls = [], this.morphFolder = null, this.morphCtrls = [], this.skeletonHelpers = [], this.gridHelper = null, this.axesHelper = null, this.modelInfo = null, this.annotationEls = [], this._tempVec = new H(), this.addAxesHelper(), this.addGUI(), t.kiosk && this.gui.close(), this.animate = this.animate.bind(this), this._rafId = null, this._visible = !0, this._tabVisible = !document.hidden, this._disposed = !1, this._loadedEnvironment = null, this._guiWrap = null, this._needsRender = !0, this._animating = !1, this._onVisibilityChange = () => {+ }, this.prevTime = 0, this.stats = new _o(), this.stats.dom.height = "48px", [].forEach.call(this.stats.dom.children, (r) => r.style.display = ""), this.backgroundColor = new je(this.state.bgColor), this.scene = new ud(), this.scene.background = this.backgroundColor;+ const n = t.preset === Td.ASSET_GENERATOR ? 0.8 * 180 / Math.PI : 60, s = e.clientWidth / e.clientHeight;+ this.defaultCamera = new vn(n, s, 0.01, 1e3), this.activeCamera = this.defaultCamera, this.scene.add(this.defaultCamera), this.renderer = window.renderer = new EA({ antialias: !0, alpha: !0 }), this.renderer.setClearColor(0, 1), this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)), this.renderer.setSize(e.clientWidth, e.clientHeight), this.pmremGenerator = new Ad(this.renderer), this.pmremGenerator.compileEquirectangularShader(), this.neutralEnvironment = this.pmremGenerator.fromScene(new l1()).texture, this.controls = new YI(this.defaultCamera, this.renderer.domElement), this.controls.screenSpacePanning = !0, this._onControlsChange = () => this.invalidate(), this.controls.addEventListener("change", this._onControlsChange), this.el.appendChild(this.renderer.domElement), this.cameraCtrl = null, this.cameraFolder = null, this.animFolder = null, this.animCtrls = [], this.morphFolder = null, this.morphCtrls = [], this.skeletonHelpers = [], this.gridHelper = null, this.axesHelper = null, this.modelInfo = null, this.annotationEls = [], this._tempVec = new H(), this.addAxesHelper(), this.addGUI(), t.kiosk && this.gui.close(), this.animate = this.animate.bind(this), this._rafId = null, this._visible = !0, this._tabVisible = !document.hidden, this._disposed = !1, this._loadedEnvironment = null, this._guiWrap = null, this._needsRender = !0, this._animating = !1, this._onVisibilityChange = () => {const r = !this._tabVisible;this._tabVisible = !document.hidden, r && this._tabVisible && (this._needsRender = !0), this._updateRenderLoop();}, document.addEventListener("visibilitychange", this._onVisibilityChange), typeof IntersectionObserver < "u" && (this._intersectionObserver = new IntersectionObserver(@@ -32822,16 +32822,16 @@ class ob {this.renderer.render(this.scene, this.activeCamera), this.state.grid && (this.axesCamera.position.copy(this.defaultCamera.position), this.axesCamera.lookAt(this.axesScene.position), this.axesRenderer.render(this.axesScene, this.axesCamera)), this.projectAnnotations();}takeScreenshot() {- jB(this);+ sT(this);}resize() {const { clientHeight: e, clientWidth: t } = this.el;this.defaultCamera.aspect = t / e, this.defaultCamera.updateProjectionMatrix(), this.renderer.setSize(t, e), this.axesCamera.aspect = this.axesDiv.clientWidth / this.axesDiv.clientHeight, this.axesCamera.updateProjectionMatrix(), this.axesRenderer.setSize(this.axesDiv.clientWidth, this.axesDiv.clientHeight), this.invalidate();}load(e, t, n) {- const s = ha.extractUrlBase(e);+ const s = da.extractUrlBase(e);return new Promise((r, a) => {- Sl.setURLModifier((l, h) => {+ Rl.setURLModifier((l, h) => {const u = t + decodeURI(l).replace(s, "").replace(/^(\.?\/)/, "");if (n.has(u)) {const d = n.get(u), f = URL.createObjectURL(d);@@ -32839,7 +32839,7 @@ class ob {}return (h || "") + l;});- const o = new bf(Sl).setCrossOrigin("anonymous").setDRACOLoader(BB).setKTX2Loader(TB.detectSupport(this.renderer)).setMeshoptDecoder(QI), c = [];+ const o = new vf(Rl).setCrossOrigin("anonymous").setDRACOLoader(kB).setKTX2Loader(UB.detectSupport(this.renderer)).setMeshoptDecoder(jI), c = [];o.load(e,(l) => {@@ -32862,46 +32862,46 @@ class ob {*/setContent(e, t) {this.clear(), e.updateMatrixWorld();- const n = new Li().setFromObject(e), s = n.getSize(new H()).length(), r = n.getCenter(new H());- this.controls.reset(), e.position.x -= r.x, e.position.y -= r.y, e.position.z -= r.z, this.controls.maxDistance = s * 10, this.defaultCamera.near = s / 100, this.defaultCamera.far = s * 100, this.defaultCamera.updateProjectionMatrix(), this.options.cameraPosition ? (this.defaultCamera.position.fromArray(this.options.cameraPosition), this.defaultCamera.lookAt(new H())) : (this.defaultCamera.position.copy(r), this.defaultCamera.position.x += s / 2, this.defaultCamera.position.y += s / 5, this.defaultCamera.position.z += s / 2, this.defaultCamera.lookAt(r)), this.setCamera(Hc), this.axesCamera.position.copy(this.defaultCamera.position), this.axesCamera.lookAt(this.axesScene.position), this.axesCamera.near = s / 100, this.axesCamera.far = s * 100, this.axesCamera.updateProjectionMatrix(), this.axesCorner.scale.set(s, s, s), this.controls.saveState(), this.scene.add(e), this.content = e, this.state.punctualLights = !0, this.content.traverse((a) => {+ const n = new Pi().setFromObject(e), s = n.getSize(new H()).length(), r = n.getCenter(new H());+ this.controls.reset(), e.position.x -= r.x, e.position.y -= r.y, e.position.z -= r.z, this.controls.maxDistance = s * 10, this.defaultCamera.near = s / 100, this.defaultCamera.far = s * 100, this.defaultCamera.updateProjectionMatrix(), this.options.cameraPosition ? (this.defaultCamera.position.fromArray(this.options.cameraPosition), this.defaultCamera.lookAt(new H())) : (this.defaultCamera.position.copy(r), this.defaultCamera.position.x += s / 2, this.defaultCamera.position.y += s / 5, this.defaultCamera.position.z += s / 2, this.defaultCamera.lookAt(r)), this.setCamera(Kc), this.axesCamera.position.copy(this.defaultCamera.position), this.axesCamera.lookAt(this.axesScene.position), this.axesCamera.near = s / 100, this.axesCamera.far = s * 100, this.axesCamera.updateProjectionMatrix(), this.axesCorner.scale.set(s, s, s), this.controls.saveState(), this.scene.add(e), this.content = e, this.state.punctualLights = !0, this.content.traverse((a) => {a.isLight && (this.state.punctualLights = !1);}), this.setClips(t), this.animationManager.attach(this.content), this._setupAnimationPanel(), this.updateLights(), this.updateGUI(), this.updateEnvironment(), this.updateDisplay(), this.updateModelInfo(e, t), this.updateAnnotations(), window.VIEWER.scene = this.content, this.invalidate();}setClips(e) {- ZB(this, e);+ aT(this, e);}playAllClips() {- $B(this);+ oT(this);}/*** @param {string} name*/setCamera(e) {- e === Hc ? (this.controls.enabled = !0, this.activeCamera = this.defaultCamera) : (this.controls.enabled = !1, this.content.traverse((t) => {+ e === Kc ? (this.controls.enabled = !0, this.activeCamera = this.defaultCamera) : (this.controls.enabled = !1, this.content.traverse((t) => {t.isCamera && t.name === e && (this.activeCamera = t);})), this.invalidate();}updateLights() {const e = this.state, t = this.lights;- e.punctualLights && !t.length ? RB(this) : !e.punctualLights && t.length && NB(this), this.renderer.toneMapping = Number(e.toneMapping), this.renderer.toneMappingExposure = Math.pow(2, e.exposure), t.length === 2 && (t[0].intensity = e.ambientIntensity, t[0].color.set(e.ambientColor), t[1].intensity = e.directIntensity, t[1].color.set(e.directColor)), this.invalidate();+ e.punctualLights && !t.length ? OB(this) : !e.punctualLights && t.length && QB(this), this.renderer.toneMapping = Number(e.toneMapping), this.renderer.toneMappingExposure = Math.pow(2, e.exposure), t.length === 2 && (t[0].intensity = e.ambientIntensity, t[0].color.set(e.ambientColor), t[1].intensity = e.directIntensity, t[1].color.set(e.directColor)), this.invalidate();}updateEnvironment() {- const e = Pc.filter(+ const e = Gc.filter((t) => t.name === this.state.environment)[0];- YB(this, e).then(({ envMap: t }) => {+ iT(this, e).then(({ envMap: t }) => {this._disposed || !this.scene || (this.scene.environment = t, this.scene.background = this.state.transparentBg ? null : this.state.background ? t : this.backgroundColor, this.invalidate());});}updateDisplay() {- this.skeletonHelpers.length && this.skeletonHelpers.forEach((e) => this.scene.remove(e)), ag(this.content, (e) => {- e.wireframe = this.state.wireframe, e instanceof df && (e.size = this.state.pointSize);+ this.skeletonHelpers.length && this.skeletonHelpers.forEach((e) => this.scene.remove(e)), dg(this.content, (e) => {+ e.wireframe = this.state.wireframe, e instanceof bf && (e.size = this.state.pointSize);}), this.content.traverse((e) => {if (e.geometry && e.skeleton && this.state.skeleton) {- const t = new _y(e.skeleton.bones[0].parent);+ const t = new By(e.skeleton.bones[0].parent);t.material.linewidth = 3, this.scene.add(t), this.skeletonHelpers.push(t);}- }), this.state.grid !== !!this.gridHelper && (this.state.grid ? (this.gridHelper = new yy(), this.axesHelper = new zp(), this.axesHelper.renderOrder = 999, this.axesHelper.onBeforeRender = (e) => e.clearDepth(), this.scene.add(this.gridHelper), this.scene.add(this.axesHelper)) : (this.scene.remove(this.gridHelper), this.scene.remove(this.axesHelper), this.gridHelper = null, this.axesHelper = null, this.axesRenderer.clear())), this.controls.autoRotate = this.state.autoRotate, this.invalidate();+ }), this.state.grid !== !!this.gridHelper && (this.state.grid ? (this.gridHelper = new Ty(), this.axesHelper = new Xp(), this.axesHelper.renderOrder = 999, this.axesHelper.onBeforeRender = (e) => e.clearDepth(), this.scene.add(this.gridHelper), this.scene.add(this.axesHelper)) : (this.scene.remove(this.gridHelper), this.scene.remove(this.axesHelper), this.gridHelper = null, this.axesHelper = null, this.axesRenderer.clear())), this.controls.autoRotate = this.state.autoRotate, this.invalidate();}updateBackground() {this.backgroundColor.set(this.state.bgColor), this.state.transparentBg ? (this.scene.background = null, this.renderer.setClearColor(0, 0)) : (this.scene.background = this.backgroundColor, this.renderer.setClearColor(0, 1), this.updateEnvironment()), this.invalidate();@@ -32920,12 +32920,12 @@ class ob {* See: https://stackoverflow.com/q/16226693/1314762*/updateModelInfo(e, t) {- this.modelInfo && (this.modelInfo.remove(), this.modelInfo = null), this.state.showInfo && e && (this.modelInfo = oB(this.el, e, t));+ this.modelInfo && (this.modelInfo.remove(), this.modelInfo = null), this.state.showInfo && e && (this.modelInfo = AB(this.el, e, t));}updateAnnotations() {if (this.annotationEls.forEach((t) => t.el.remove()), this.annotationEls = [], !this.state.showLabels || !this.content) return;- hB(this.content).forEach((t) => {- const n = uB(t), s = document.createElement("div");+ bB(this.content).forEach((t) => {+ const n = xB(t), s = document.createElement("div");s.classList.add("annotation-label"), s.appendChild(n), this.el.appendChild(s), this.annotationEls.push({ el: s, position: t.position });}), this.invalidate();}@@ -32944,10 +32944,10 @@ class ob {addAxesHelper() {this.axesDiv = document.createElement("div"), this.el.appendChild(this.axesDiv), this.axesDiv.classList.add("axes");const { clientWidth: e, clientHeight: t } = this.axesDiv;- this.axesScene = new rd(), this.axesCamera = new Cn(50, e / t, 0.1, 10), this.axesScene.add(this.axesCamera), this.axesRenderer = new pA({ alpha: !0 }), this.axesRenderer.setPixelRatio(window.devicePixelRatio), this.axesRenderer.setSize(this.axesDiv.clientWidth, this.axesDiv.clientHeight), this.axesCamera.up = this.defaultCamera.up, this.axesCorner = new zp(5), this.axesScene.add(this.axesCorner), this.axesDiv.appendChild(this.axesRenderer.domElement);+ this.axesScene = new ud(), this.axesCamera = new vn(50, e / t, 0.1, 10), this.axesScene.add(this.axesCamera), this.axesRenderer = new EA({ alpha: !0 }), this.axesRenderer.setPixelRatio(window.devicePixelRatio), this.axesRenderer.setSize(this.axesDiv.clientWidth, this.axesDiv.clientHeight), this.axesCamera.up = this.defaultCamera.up, this.axesCorner = new Xp(5), this.axesScene.add(this.axesCorner), this.axesDiv.appendChild(this.axesRenderer.domElement);}addGUI() {- const e = window.innerWidth <= 700, t = this.gui = new w1({+ const e = window.innerWidth <= 700, t = this.gui = new R1({autoPlace: !1,width: e ? 220 : 260,hideable: !0@@ -32957,11 +32957,11 @@ class ob {m.add(this.state,"environment",- Pc.map((w) => w.name)+ Gc.map((w) => w.name)).onChange(() => this.updateEnvironment()), [m.add(this.state, "toneMapping", {- Linear: Pu,- "ACES Filmic": wm+ Linear: Hu,+ "ACES Filmic": Tm}),m.add(this.state, "exposure", -10, 10, 0.01),m.add(this.state, "punctualLights").listen(),@@ -32990,7 +32990,7 @@ class ob {n.geometry && n.morphTargetInfluences && t.push(n), n.isCamera && (n.name = n.name || `VIEWER__camera_${e.length + 1}`, e.push(n.name));}), e.length) {this.cameraFolder.domElement.style.display = "", this.cameraCtrl && this.cameraCtrl.remove();- const n = [Hc].concat(e);+ const n = [Kc].concat(e);this.cameraCtrl = this.cameraFolder.add(this.state, "camera", n), this.cameraCtrl.onChange((s) => this.setCamera(s));}if (t.length && (this.morphFolder.domElement.style.display = "", t.forEach((n) => {@@ -33103,7 +33103,7 @@ class ob {clear() {this.content && (this.animationManager.detach(), this._animPanelEl && (this._animPanelEl.remove(), this._animPanelEl = null), this.modelInfo && (this.modelInfo.remove(), this.modelInfo = null), this.annotationEls.forEach((e) => e.el.remove()), this.annotationEls = [], this.scene.remove(this.content), this.content.traverse((e) => {e.geometry && e.geometry.dispose();- }), ag(this.content, (e) => {+ }), dg(this.content, (e) => {for (const t in e)t !== "envMap" && e[t] && e[t].isTexture && e[t].dispose();}), this.content = null, this._disposed || this.invalidate());@@ -33121,7 +33121,7 @@ class ob {}}}-class nT {+class hT {constructor({ model: e = "claude-opus-4-6", proxyURL: t, apiKey: n, temperature: s = 0.7, maxTokens: r = 4096, thinking: a = "auto" } = {}) {this.model = e, this.proxyURL = t, this.apiKey = n, this.temperature = s, this.maxTokens = r, this.thinking = a;}@@ -33170,7 +33170,7 @@ class nT {return { role: "assistant", content: n };}}-class iT {+class uT {// Used when brain.provider === "none" — skills drive the agent.async complete() {return { text: "", toolCalls: [], stopReason: "end_turn" };@@ -33182,13 +33182,13 @@ class iT {return { role: "assistant", content: e || "" };}}-function sT(i = {}) {+function dT(i = {}) {const e = i.provider || "anthropic";- if (e === "anthropic") return new nT(i);- if (e === "none") return new iT();+ if (e === "anthropic") return new hT(i);+ if (e === "none") return new uT();throw new Error(`Unsupported provider: ${e}. Supported: anthropic, none`);}-class rT {+class fT {constructor({ voiceId: e = "default", rate: t = 1, pitch: n = 1, lang: s = "en-US" } = {}) {this.voiceId = e, this.rate = t, this.pitch = n, this.lang = s, this._queue = [], this._speaking = !1;}@@ -33223,7 +33223,7 @@ class rT {return e.find((t) => t.lang?.startsWith(this.lang.slice(0, 2))) || null;}}-class aT {+class pT {constructor({ language: e = "en-US", continuous: t = !1, interimResults: n = !0 } = {}) {this.language = e, this.continuous = t, this.interimResults = n, this._recognition = null, this._listening = !1;}@@ -33263,7 +33263,7 @@ class aT {return this._listening;}}-class oT {+class AT {constructor({voiceId: e,modelId: t = "eleven_turbo_v2_5",@@ -33420,20 +33420,20 @@ class oT {this._startedFired = !1;}}-function cT(i = {}) {+function gT(i = {}) {const e = i.provider || "browser";if (e === "none") return null;- if (e === "browser") return new rT(i);- if (e === "elevenlabs") return new oT(i);+ if (e === "browser") return new fT(i);+ if (e === "elevenlabs") return new AT(i);throw new Error(`TTS provider "${e}" not implemented yet`);}-function lT(i = {}) {+function mT(i = {}) {const e = i.provider || "browser";if (e === "none") return null;- if (e === "browser") return new aT(i);+ if (e === "browser") return new pT(i);throw new Error(`STT provider "${e}" not implemented yet`);}-const og = [+const fg = [{name: "wave",description: "Wave at the user. Use for greetings, farewells, or acknowledgments.",@@ -33508,7 +33508,7 @@ const og = [required: ["key", "name", "description", "type", "body"]}}-], hT = {+], bT = {async wave(i, e) {const t = i.duration_ms || 1500;return await e.viewer.playAnimationByHint?.("wave", { duration: t }), e.memory.note("waved", { duration_ms: t }), { ok: !0 };@@ -33518,8 +33518,8 @@ const og = [return e.viewer.lookAt?.(t), { ok: !0, target: t };},async play_clip(i, e) {- const { name: t, loop: n = !1, fade_ms: s = 200 } = i;- return e.viewer.playClipByName?.(t, { loop: n, fade_ms: s }) ? { ok: !0, name: t } : { ok: !1, error: `No clip named "${t}"` };+ const { name: t, loop: n = !1, fade_ms: s = 200 } = i, r = e.viewer.resolveAnimationSlot?.(t) ?? t;+ return e.viewer.playClipByName?.(r, { loop: n, fade_ms: s }) ? { ok: !0, name: t, resolved: r } : (r !== t && console.warn(`[play_clip] slot "${t}" → "${r}" not found in library`), { ok: !1, error: `No clip named "${r}"` });},async setExpression(i, e) {const { preset: t, intensity: n = 1 } = i;@@ -33542,13 +33542,13 @@ const og = [const s = e.agentId || "anon";return e.stage.broadcast(s, { kind: "direct", to: t, text: n }), e.stage.routeMessage(s, t, n);}-}, uT = 8;-class dT extends EventTarget {+}, xT = 8;+class ET extends EventTarget {constructor({ manifest: e, viewer: t, memory: n, skills: s, providerConfig: r = {}, voiceConfig: a = {} } = {}) {- super(), this.manifest = e || {}, this.viewer = t, this.memory = n, this.skills = s, this.provider = sT({+ super(), this.manifest = e || {}, this.viewer = t, this.memory = n, this.skills = s, this.provider = dT({...this.manifest.brain,...r- }), this.tts = cT({ ...this.manifest.voice?.tts, ...a.tts }), this.stt = lT({ ...this.manifest.voice?.stt, ...a.stt }), this.messages = [], this._busy = !1;+ }), this.tts = gT({ ...this.manifest.voice?.tts, ...a.tts }), this.stt = mT({ ...this.manifest.voice?.stt, ...a.stt }), this.messages = [], this._busy = !1;}get systemPrompt() {const e = [];@@ -33561,7 +33561,7 @@ class dT extends EventTarget {</memory>`), this.skills && e.push(this.skills.systemPrompt()), e.join("");}get tools() {- const e = new Set(this.manifest.tools || og.map((s) => s.name)), t = og.filter((s) => e.has(s.name)), n = this.skills ? this.skills.allTools() : [];+ const e = new Set(this.manifest.tools || fg.map((s) => s.name)), t = fg.filter((s) => e.has(s.name)), n = this.skills ? this.skills.allTools() : [];return [...t, ...n];}async send(e, { voice: t = !1 } = {}) {@@ -33580,7 +33580,7 @@ class dT extends EventTarget {}async _loop() {let e = 0, t = "";- for (; e++ < uT; ) {+ for (; e++ < xT; ) {const n = await this.provider.complete({system: this.systemPrompt,messages: this.messages,@@ -33616,7 +33616,7 @@ class dT extends EventTarget {async _dispatchTool(e) {const t = this._context(), n = this.skills?.findSkillForTool(e.name);if (n) return n.invoke(e.name, e.input, t);- const s = hT[e.name];+ const s = bT[e.name];if (!s) throw new Error(`Unknown tool: ${e.name}`);return s(e.input, t);}@@ -33663,23 +33663,23 @@ class dT extends EventTarget {this.pause(), this.messages = [];}}-const Sd = [+const Nd = ["https://dweb.link/ipfs/","https://cloudflare-ipfs.com/ipfs/","https://ipfs.io/ipfs/"-], fT = "https://arweave.net/";-function _r(i, e = 0) {+], _T = "https://arweave.net/";+function wr(i, e = 0) {if (!i) return i;const t = i.match(/^ipfs:\/\/(.+)$/i);if (t)- return Sd[e % Sd.length] + t[1];+ return Nd[e % Nd.length] + t[1];const n = i.match(/^ar:\/\/(.+)$/i);- return n ? fT + n[1] : i;+ return n ? _T + n[1] : i;}-async function pT(i) {+async function yT(i) {let e;- for (let t = 0; t < Sd.length; t++) {- const n = _r(i, t);+ for (let t = 0; t < Nd.length; t++) {+ const n = wr(i, t);try {const s = await fetch(n);if (s.ok) return s;@@ -33689,7 +33689,22 @@ async function pT(i) {}throw e || new Error("All IPFS gateways failed for " + i);}-const cg = {+const wT = {+ idle: "idle",+ wave: "wave",+ nod: "yes",+ shake: "no",+ think: "sitting",+ celebrate: "dance",+ concern: "standing",+ bow: "wave",+ point: "standing",+ shrug: "standing"+};+function vT(i, e) {+ return e && e[i] ? e[i] : wT[i] ?? i;+}+const pg = {neutral: {/* reset all */},@@ -33699,9 +33714,9 @@ const cg = {confused: { browInnerUp: 0.5, browOuterUpL: 0.4, mouthPressL: 0.3, mouthPressR: 0.3 },focused: { browDownL: 0.4, browDownR: 0.4, eyeSquintL: 0.3, eyeSquintR: 0.3 }};-class AT {+class CT {constructor(e) {- this.viewer = e, this._loader = new bf(), this._userTarget = new H(0, 1.6, 2);+ this.viewer = e, this._loader = new vf(), this._userTarget = new H(0, 1.6, 2), this._animationMap = {};}// Expose the underlying Three.js handles skills may needget scene() {@@ -33716,6 +33731,22 @@ class AT {get content() {return this.viewer.content;}+ /**+ * Set the agent's animation slot override map (from meta.edits.animations).+ * @param {Object|null} map — { slotName: clipName, … }+ */+ setAnimationMap(e) {+ this._animationMap = e || {};+ }+ /**+ * Resolve a slot name (e.g. 'celebrate') to the actual clip name.+ * Falls back to DEFAULT_ANIMATION_MAP, then the slot name itself.+ * @param {string} name+ * @returns {string}+ */+ resolveAnimationSlot(e) {+ return vT(e, this._animationMap);+ }// Delegate raw load for ad-hoc casesasync load(e, t = "", n = /* @__PURE__ */ new Map()) {return this.viewer.load(e, t, n);@@ -33723,16 +33754,26 @@ class AT {// --- Animation ---playClipByName(e, { loop: t = !1, fade_ms: n = 200 } = {}) {const s = this._findClip(e);- if (!s || !this.viewer.mixer) return !1;- const r = this.viewer.mixer.clipAction(s);- return r.reset(), r.setLoop(- t ? 2201 : 2200- /* LoopOnce */- ), r.clampWhenFinished = !t, r.fadeIn(n / 1e3), r.play(), this.viewer.state.actionStates[s.name] = !0, this.viewer.invalidate(), !0;+ if (s && this.viewer.mixer) {+ const a = this.viewer.mixer.clipAction(s);+ return a.reset(), a.setLoop(+ t ? 2201 : 2200+ /* LoopOnce */+ ), a.clampWhenFinished = !t, a.fadeIn(n / 1e3), a.play(), this.viewer.state.actionStates[s.name] = !0, this.viewer.invalidate(), !0;+ }+ const r = this.viewer?.animationManager;+ return r?.isLoaded(e) ? (t ? r.crossfadeTo(e, n / 1e3) : r.play(e), !0) : !1;}playAnimationByHint(e, t) {- const n = e.toLowerCase(), s = this.clips.find((r) => r.name.toLowerCase().includes(n));- return s ? this.playClipByName(s.name, t) : !1;+ const n = e.toLowerCase(), s = this.clips.find((a) => a.name.toLowerCase().includes(n));+ if (s) return this.playClipByName(s.name, t);+ const r = this.viewer?.animationManager;+ if (r) {+ for (const a of r.clips.keys())+ if (a.toLowerCase().includes(n))+ return this.playClipByName(a, t);+ }+ return !1;}stopClip(e) {if (!this.viewer.mixer) return;@@ -33753,7 +33794,7 @@ class AT {return n.reset(), n.fadeIn(t?.blend ?? 0.2), n.play(), this.viewer.invalidate(), !0;}async loadClip(e) {- const t = _r(e);+ const t = wr(e);return new Promise((n, s) => {this._loader.load(t,@@ -33764,7 +33805,7 @@ class AT {});}async loadGLB(e) {- const t = _r(e);+ const t = wr(e);return new Promise((n, s) => {this._loader.load(t, n, void 0, s);});@@ -33788,7 +33829,7 @@ class AT {}// --- Expression (morph targets) ---setExpression(e, t = 1) {- const n = cg[e] || cg.neutral;+ const n = pg[e] || pg.neutral;this.viewer.content && (this.viewer.content.traverse((s) => {if (!(!s.morphTargetDictionary || !s.morphTargetInfluences)) {for (let r = 0; r < s.morphTargetInfluences.length; r++)@@ -33828,19 +33869,324 @@ class AT {return this.clips.find((s) => s.name.toLowerCase() === n) || this.clips.find((s) => s.name.toLowerCase().includes(n));}}-function gT(i, e) {+const ST = `// Sandbox worker — executes skill handlers in an isolated Web Worker scope.+// No DOM, no window, no document. Only ctx.* and native worker APIs.++/** @type {Map<string, object>} skillURI → module exports */+const _skillHandlers = new Map();++/** @type {Map<number, { resolve: Function, reject: Function, timeoutId: number }>} */+const _pendingRequests = new Map();++/** @type {Map<string, Promise<void>>} skillURI → install promise (deduplication) */+const _installPromises = new Map();++/** @type {Map<string, { resolve: Function, reject: Function }>} */+const _installCallbacks = new Map();++let _requestId = 0;++self.onmessage = ({ data }) => {+ switch (data.type) {+ case 'install':+ _install(data);+ break;+ case 'invoke':+ _invoke(data);+ break;+ case 'response':+ _handleResponse(data);+ break;+ }+};++async function _install({ skillURI, handlersSrc }) {+ // Deduplicate concurrent install requests for the same skill+ if (_installPromises.has(skillURI)) return;++ const promise = new Promise((resolve, reject) => {+ _installCallbacks.set(skillURI, { resolve, reject });+ });+ _installPromises.set(skillURI, promise);++ let url;+ try {+ const blob = new Blob([handlersSrc], { type: 'text/javascript' });+ url = URL.createObjectURL(blob);+ // Dynamic import from blob URL — works in module workers+ const mod = await import(/* @vite-ignore */ url);+ _skillHandlers.set(skillURI, mod);+ _installCallbacks.get(skillURI)?.resolve();+ self.postMessage({ type: 'install-ack', skillURI, ok: true });+ } catch (err) {+ _installPromises.delete(skillURI);+ _installCallbacks.get(skillURI)?.reject(err);+ _installCallbacks.delete(skillURI);+ self.postMessage({ type: 'install-ack', skillURI, ok: false, error: err.message });+ } finally {+ if (url) URL.revokeObjectURL(url);+ }+}++function _makeCtx(invocationId, skillBaseURI) {+ // Each method sends a request to main thread and awaits a structured-cloneable response.+ // Non-serializable objects (AnimationClip, GLTF) are stored in the host's handle registry+ // and represented here as opaque "@h:N" strings.+ const proxy = (method, args) =>+ new Promise((resolve, reject) => {+ const id = ++_requestId;+ const timeoutId = setTimeout(() => {+ _pendingRequests.delete(id);+ reject(new Error(\`ctx.\${method} timed out after 30s\`));+ }, 30_000);+ _pendingRequests.set(id, { resolve, reject, timeoutId });+ self.postMessage({ type: 'request', invocationId, requestId: id, method, args });+ });++ return {+ viewer: {+ play: (clip, opts) => proxy('viewer.play', [clip, opts]),+ stop: (clipName) => proxy('viewer.stop', [clipName]),+ setExpression: (preset, intensity) => proxy('viewer.setExpression', [preset, intensity]),+ lookAt: (target) => proxy('viewer.lookAt', [target]),+ moveTo: (position, opts) => proxy('viewer.moveTo', [position, opts]),+ playAnimationByHint: (hint, opts) => proxy('viewer.playAnimationByHint', [hint, opts]),+ playClipByName: (name, opts) => proxy('viewer.playClipByName', [name, opts]),+ },+ llm: {+ complete: (prompt, opts) => proxy('llm.complete', [prompt, opts]),+ embed: (text) => proxy('llm.embed', [text]),+ },+ memory: {+ read: (key) => proxy('memory.read', [key]),+ write: (key, value) => proxy('memory.write', [key, value]),+ note: (type, data) => proxy('memory.note', [type, data]),+ recall: (query) => proxy('memory.recall', [query]),+ },+ // Asset loading — results are opaque handle strings; pass back to viewer.play etc.+ loadClip: (uri) => proxy('loadClip', [uri]),+ loadGLB: (uri) => proxy('loadGLB', [uri]),+ // fetch and loadJSON use native worker fetch — no proxy needed+ fetch: (uri, opts) => fetch(uri, opts),+ loadJSON: async (uri) => (await fetch(uri)).json(),+ call: (toolName, toolArgs) => proxy('call', [toolName, toolArgs]),+ speak: (text) => proxy('speak', [text]),+ listen: (opts) => proxy('listen', [opts]),+ skillBaseURI,+ };+}++async function _invoke({ invocationId, skillURI, toolName, args, skillBaseURI }) {+ // Wait for install to complete (handles the install→invoke race)+ const installPromise = _installPromises.get(skillURI);+ if (installPromise) {+ try {+ await installPromise;+ } catch (err) {+ self.postMessage({ type: 'invoke-result', invocationId, error: \`Install failed: \${err.message}\` });+ return;+ }+ }++ const mod = _skillHandlers.get(skillURI);+ if (!mod) {+ self.postMessage({ type: 'invoke-result', invocationId, error: \`Skill not installed: \${skillURI}\` });+ return;+ }++ const fn = mod[toolName];+ if (typeof fn !== 'function') {+ self.postMessage({+ type: 'invoke-result',+ invocationId,+ error: \`No handler "\${toolName}" in skill "\${skillURI}"\`,+ });+ return;+ }++ try {+ const ctx = _makeCtx(invocationId, skillBaseURI);+ const result = await fn(args, ctx);+ self.postMessage({ type: 'invoke-result', invocationId, result: result ?? null });+ } catch (err) {+ self.postMessage({ type: 'invoke-result', invocationId, error: err.message || String(err) });+ }+}++function _handleResponse({ requestId, result, error }) {+ const pending = _pendingRequests.get(requestId);+ if (!pending) return;+ clearTimeout(pending.timeoutId);+ _pendingRequests.delete(requestId);+ if (error !== undefined) {+ pending.reject(new Error(error));+ } else {+ pending.resolve(result);+ }+}+`;+let ni = null, pa = null;+const Aa = /* @__PURE__ */ new Map(), Uo = /* @__PURE__ */ new Map(), ks = /* @__PURE__ */ new Map(), Yl = /* @__PURE__ */ new Map();+let IT = 0, MT = 0;+function Ag(i) {+ if (i == null) return null;+ const e = `@h:${++IT}`;+ return Yl.set(e, i), e;+}+function BT(i) {+ return typeof i == "string" && i.startsWith("@h:") ? Yl.get(i) ?? i : i;+}+function TT(i) {+ return Array.isArray(i) ? i.map(BT) : i;+}+function Ab() {+ if (!ni) {+ if (!pa) {+ const i = new Blob([ST], { type: "text/javascript" });+ pa = URL.createObjectURL(i);+ }+ ni = new Worker(pa), ni.onmessage = NT, ni.onerror = RT;+ }+ return ni;+}+function RT(i) {+ console.error("[sandbox] worker crashed:", i), ni = null, Aa.clear(), Uo.clear(), Yl.clear();+ for (const [, e] of ks) e.reject(new Error("Sandbox worker crashed"));+ ks.clear();+}+function NT({ data: i }) {+ switch (i.type) {+ case "install-ack": {+ const e = Uo.get(i.skillURI);+ Uo.delete(i.skillURI), i.ok ? e?.resolve() : (Aa.delete(i.skillURI), e?.reject(new Error(i.error || "Install failed")));+ break;+ }+ case "request": {+ const { invocationId: e, requestId: t, method: n, args: s } = i, r = ks.get(e);+ if (!r) {+ ni?.postMessage({ type: "response", requestId: t, error: "No active invocation" });+ return;+ }+ FT(n, s, r.mainCtx).then(+ (a) => ni?.postMessage({ type: "response", requestId: t, result: a ?? null }),+ (a) => ni?.postMessage({+ type: "response",+ requestId: t,+ error: a.message || String(a)+ })+ );+ break;+ }+ case "invoke-result": {+ const { invocationId: e, result: t, error: n } = i, s = ks.get(e);+ if (!s) return;+ ks.delete(e), n !== void 0 ? s.reject(new Error(n)) : s.resolve(t);+ break;+ }+ }+}+async function FT(i, e, t) {+ const n = TT(e);+ switch (i) {+ // viewer+ case "viewer.play":+ return t.viewer?.play?.(n[0], n[1]);+ case "viewer.stop":+ return t.viewer?.stop?.(n[0]);+ case "viewer.setExpression":+ return t.viewer?.setExpression?.(n[0], n[1]);+ case "viewer.lookAt":+ return t.viewer?.lookAt?.(n[0]);+ case "viewer.moveTo":+ return t.viewer?.moveTo?.(n[0], n[1]);+ case "viewer.playAnimationByHint":+ return t.viewer?.playAnimationByHint?.(n[0], n[1]);+ case "viewer.playClipByName":+ return t.viewer?.playClipByName?.(n[0], n[1]);+ // memory+ case "memory.read":+ return t.memory?.read?.(n[0]);+ case "memory.write":+ return t.memory?.write?.(n[0], n[1]);+ case "memory.note":+ return t.memory?.note?.(n[0], n[1]);+ case "memory.recall":+ return t.memory?.recall?.(n[0]);+ // llm+ case "llm.complete":+ return t.llm?.complete?.(n[0], n[1]);+ case "llm.embed":+ return t.llm?.embed?.(n[0]);+ // asset loading — results stored as handles because they're non-serializable+ case "loadClip": {+ const s = await t.loadClip?.(n[0]);+ return Ag(s);+ }+ case "loadGLB": {+ const s = await t.loadGLB?.(n[0]);+ return Ag(s);+ }+ // speech+ case "speak":+ return t.speak?.(n[0]);+ case "listen":+ return t.listen?.(n[0]);+ // cross-skill call+ case "call":+ return t.call?.(n[0], n[1]);+ default:+ throw new Error(`Unknown ctx method: ${i}`);+ }+}+async function DT(i, e) {+ if (Aa.has(i)) return Aa.get(i);+ const t = new Promise((n, s) => {+ Uo.set(i, { resolve: n, reject: s });+ });+ return Aa.set(i, t), Ab().postMessage({ type: "install", skillURI: i, handlersSrc: e }), t;+}+async function LT(i, e, t, n, s) {+ await DT(i, n);+ const r = ++MT, a = Ab();+ return new Promise((o, c) => {+ ks.set(r, { resolve: o, reject: c, mainCtx: s }), a.postMessage({+ type: "invoke",+ invocationId: r,+ skillURI: i,+ toolName: e,+ args: t,+ skillBaseURI: s.skillBaseURI || i+ });+ });+}+function PT() {+ if (ni) {+ ni.terminate(), ni = null, pa && (URL.revokeObjectURL(pa), pa = null), Aa.clear(), Uo.clear(), Yl.clear();+ for (const [, i] of ks) i.reject(new Error("Sandbox terminated"));+ ks.clear();+ }+}+function kT() {+ return { invoke: LT, terminate: PT };+}+function UT(i, e) {return /^([a-z]+:|\/)/i.test(e) ? e : (i.endsWith("/") || (i += "/"), i + e);}-class mT {- constructor({ uri: e, manifest: t, instructions: n, tools: s, handlers: r }) {- this.uri = e, this.manifest = t, this.name = t.name, this.version = t.version, this.instructions = n, this.tools = s || [], this.handlers = r || {};+class OT {+ constructor({ uri: e, manifest: t, instructions: n, tools: s, handlers: r, handlersSrc: a }) {+ this.uri = e, this.manifest = t, this.name = t.name, this.version = t.version, this.instructions = n, this.tools = s || [], this.handlers = r || {}, this.handlersSrc = a || null;}async invoke(e, t, n) {- const s = this.handlers[e];- if (!s)- throw new Error(`Skill "${this.name}" has no handler for tool "${e}"`);- const r = { ...n, skillBaseURI: this.uri };- return s(t, r);+ const s = { ...n, skillBaseURI: this.uri };+ if (this.manifest.sandboxPolicy === "trusted-main-thread") {+ const r = this.handlers[e];+ if (!r)+ throw new Error(`Skill "${this.name}" has no handler for tool "${e}"`);+ return r(t, s);+ }+ if (!this.handlersSrc)+ throw new Error(`Skill "${this.name}" has no handler source for tool "${e}"`);+ return kT().invoke(this.uri, e, t, this.handlersSrc, s);}systemPromptFragment() {return this.instructions ? `@@ -33850,7 +34196,7 @@ ${this.instructions}</skill>` : "";}}-class bT {+class QT {constructor({ fetchFn: e = fetch.bind(globalThis), trust: t = "owned-only", ownerAddress: n } = {}) {this.fetchFn = e, this.trust = t, this.ownerAddress = n?.toLowerCase(), this.skills = /* @__PURE__ */ new Map();}@@ -33859,21 +34205,22 @@ class bT {if (this.skills.has(n)) return this.skills.get(n);const s = await this._fetchJSON(`${n}manifest.json`);this._enforceTrust(s);- const [r, a, o] = await Promise.all([+ const r = s.sandboxPolicy === "trusted-main-thread", [a, o, c] = await Promise.all([this._fetchText(`${n}SKILL.md`).catch(() => ""),this._fetchJSON(`${n}tools.json`).catch(() => ({ tools: [] })),- this._fetchHandlers(`${n}handlers.js`).catch(() => null)- ]), c = new mT({+ r ? this._fetchHandlers(`${n}handlers.js`).catch(() => null) : this._fetchHandlersSrc(`${n}handlers.js`).catch(() => null)+ ]), l = new OT({uri: n,manifest: s,- instructions: r,- tools: a.tools || [],- handlers: o || {}+ instructions: a,+ tools: o.tools || [],+ handlers: r ? c || {} : {},+ handlersSrc: r ? null : c});if (s.dependencies)- for (const [l, h] of Object.entries(s.dependencies))- await this.install({ uri: l, version: h });- return this.skills.set(n, c), c;+ for (const [h, u] of Object.entries(s.dependencies))+ await this.install({ uri: h, version: u });+ return this.skills.set(n, l), l;}uninstall(e) {for (const [t, n] of this.skills)@@ -33901,7 +34248,7 @@ class bT {}_resolveBundleURI(e, t) {let n = e;- return !/^([a-z]+:|\/)/i.test(e) && t && (n = gT(t, e)), n.endsWith("/") || (n += "/"), (n.startsWith("ipfs://") || n.startsWith("ar://")) && (n = _r(n)), n;+ return !/^([a-z]+:|\/)/i.test(e) && t && (n = UT(t, e)), n.endsWith("/") || (n += "/"), (n.startsWith("ipfs://") || n.startsWith("ar://")) && (n = wr(n)), n;}async _fetchJSON(e) {const t = await this.fetchFn(e);@@ -33923,6 +34270,11 @@ class bT {return console.warn(`[skills] handlers load failed: ${e}`, t), null;}}+ async _fetchHandlersSrc(e) {+ const t = await this.fetchFn(e);+ if (!t.ok) throw new Error(`Fetch failed: ${e} (${t.status})`);+ return t.text();+ }_enforceTrust(e) {if (this.trust !== "any") {if (this.trust === "owned-only") {@@ -33936,9 +34288,9 @@ class bT {}}}-const xT = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;-function Vc(i) {- const e = i.match(xT);+const GT = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;+function Xc(i) {+ const e = i.match(GT);if (!e) return { meta: {}, body: i };const t = {};for (const n of e[1].split(`@@ -33948,32 +34300,32 @@ function Vc(i) {}return { meta: t, body: e[2] };}-function ET(i, e) {+function HT(i, e) {const t = ["---"];for (const [n, s] of Object.entries(i)) t.push(`${n}: ${s}`);return t.push("---", "", e), t.join(``);}-class Ii {+class Mi {constructor({ mode: e = "local", namespace: t, index: n = {}, files: s = {}, timeline: r = [] } = {}) {this.mode = e, this.namespace = t, this.files = new Map(Object.entries(s)), this.timeline = r, this.indexText = n.text || "", this._dirty = !1;}static async load({ mode: e = "local", namespace: t, manifestURI: n, fetchFn: s }) {- if (e === "none") return new Ii({ mode: "none", namespace: t });- if (e === "local") return Ii._loadLocal(t);+ if (e === "none") return new Mi({ mode: "none", namespace: t });+ if (e === "local") return Mi._loadLocal(t);if (e === "ipfs" || e === "encrypted-ipfs")- return Ii._loadIPFS({ mode: e, namespace: t, manifestURI: n, fetchFn: s });+ return Mi._loadIPFS({ mode: e, namespace: t, manifestURI: n, fetchFn: s });throw new Error(`Unknown memory mode: ${e}`);}static _loadLocal(e) {const t = `agent:${e}:memory`;try {const n = localStorage.getItem(t);- if (!n) return new Ii({ mode: "local", namespace: e });+ if (!n) return new Mi({ mode: "local", namespace: e });const s = JSON.parse(n);- return new Ii({ mode: "local", namespace: e, ...s });+ return new Mi({ mode: "local", namespace: e, ...s });} catch {- return new Ii({ mode: "local", namespace: e });+ return new Mi({ mode: "local", namespace: e });}}static async _loadIPFS({ mode: e, namespace: t, manifestURI: n, fetchFn: s }) {@@ -33989,18 +34341,18 @@ class Ii {} catch {}}- return new Ii({ mode: e, namespace: t, index: { text: o }, files: c });+ return new Mi({ mode: e, namespace: t, index: { text: o }, files: c });} catch {- return new Ii({ mode: e, namespace: t });+ return new Mi({ mode: e, namespace: t });}}read(e) {const t = e.endsWith(".md") ? e : `${e}.md`, n = this.files.get(t);- return n ? Vc(n) : null;+ return n ? Xc(n) : null;}write(e, { name: t, description: n, type: s, body: r, decay: a }) {- const o = e.endsWith(".md") ? e : `${e}.md`, c = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), l = this.files.get(o), h = l && Vc(l).meta.created || c, u = { name: t, description: n, type: s, created: h, updated: c };- a && (u.decay = a), this.files.set(o, ET(u, r || "")), this._rebuildIndex(), this._dirty = !0, this._persist();+ const o = e.endsWith(".md") ? e : `${e}.md`, c = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), l = this.files.get(o), h = l && Xc(l).meta.created || c, u = { name: t, description: n, type: s, created: h, updated: c };+ a && (u.decay = a), this.files.set(o, HT(u, r || "")), this._rebuildIndex(), this._dirty = !0, this._persist();}note(e, t) {const n = { ts: (/* @__PURE__ */ new Date()).toISOString(), type: e, ...t };@@ -34009,7 +34361,7 @@ class Ii {async recall(e, { limit: t = 5 } = {}) {const n = e.toLowerCase(), s = [];for (const [r, a] of this.files) {- const { meta: o, body: c } = Vc(a), l = `${o.name || ""} ${o.description || ""} ${c}`.toLowerCase();+ const { meta: o, body: c } = Xc(a), l = `${o.name || ""} ${o.description || ""} ${c}`.toLowerCase();l.includes(n) && s.push({ file: r, meta: o, body: c, score: l.split(n).length - 1 });}return s.sort((r, a) => a.score - r.score).slice(0, t);@@ -34017,7 +34369,7 @@ class Ii {_rebuildIndex() {const e = { user: [], feedback: [], project: [], reference: [] };for (const [s, r] of this.files) {- const { meta: a } = Vc(r), o = a.type || "user";+ const { meta: a } = Xc(r), o = a.type || "user";e[o] || (e[o] = []), e[o].push({ file: s, name: a.name || s, description: a.description || "" });}const t = ["# Memory", ""], n = { user: "## User", feedback: "## Feedback", project: "## Project", reference: "## Reference" };@@ -34080,8 +34432,8 @@ class Ii {this._rebuildIndex(), this._persist();}}-const _T = "6.16.0";-function yT(i, e, t) {+const zT = "6.16.0";+function VT(i, e, t) {const n = e.split("|").map((r) => r.trim());for (let r = 0; r < n.length; r++)switch (e) {@@ -34101,14 +34453,14 @@ async function Bn(i) {const e = Object.keys(i);return (await Promise.all(e.map((n) => Promise.resolve(i[n])))).reduce((n, s, r) => (n[e[r]] = s, n), {});}-function Ye(i, e, t) {+function Xe(i, e, t) {for (let n in e) {let s = e[n];const r = t ? t[n] : null;- r && yT(s, r, n), Object.defineProperty(i, n, { enumerable: !0, value: s, writable: !1 });+ r && VT(s, r, n), Object.defineProperty(i, n, { enumerable: !0, value: s, writable: !1 });}}-function ra(i, e) {+function oa(i, e) {if (i == null)return "null";if (e == null && (e = /* @__PURE__ */ new Set()), typeof i == "object") {@@ -34117,7 +34469,7 @@ function ra(i, e) {e.add(i);}if (Array.isArray(i))- return "[ " + i.map((t) => ra(t, e)).join(", ") + " ]";+ return "[ " + i.map((t) => oa(t, e)).join(", ") + " ]";if (i instanceof Uint8Array) {const t = "0123456789abcdef";let n = "0x";@@ -34126,7 +34478,7 @@ function ra(i, e) {return n;}if (typeof i == "object" && typeof i.toJSON == "function")- return ra(i.toJSON(), e);+ return oa(i.toJSON(), e);switch (typeof i) {case "boolean":case "number":@@ -34138,7 +34490,7 @@ function ra(i, e) {return JSON.stringify(i);case "object": {const t = Object.keys(i);- return t.sort(), "{ " + t.map((n) => `${ra(n, e)}: ${ra(i[n], e)}`).join(", ") + " }";+ return t.sort(), "{ " + t.map((n) => `${oa(n, e)}: ${oa(i[n], e)}`).join(", ") + " }";}}return "[ COULD NOT SERIALIZE ]";@@ -34146,7 +34498,7 @@ function ra(i, e) {function En(i, e) {return i && i.code === e;}-function Rf(i) {+function kf(i) {return En(i, "CALL_EXCEPTION");}function Qt(i, e, t) {@@ -34155,15 +34507,15 @@ function Qt(i, e, t) {const r = [];if (t) {if ("message" in t || "code" in t || "name" in t)- throw new Error(`value will overwrite populated values: ${ra(t)}`);+ throw new Error(`value will overwrite populated values: ${oa(t)}`);for (const a in t) {if (a === "shortMessage")continue;const o = t[a];- r.push(a + "=" + ra(o));+ r.push(a + "=" + oa(o));}}- r.push(`code=${e}`), r.push(`version=${_T}`), r.length && (i += " (" + r.join(", ") + ")");+ r.push(`code=${e}`), r.push(`version=${zT}`), r.length && (i += " (" + r.join(", ") + ")");}let s;switch (e) {@@ -34177,7 +34529,7 @@ function Qt(i, e, t) {default:s = new Error(i);}- return Ye(s, { code: e }), t && Object.assign(s, t), s.shortMessage == null && Ye(s, { shortMessage: n }), s;+ return Xe(s, { code: e }), t && Object.assign(s, t), s.shortMessage == null && Xe(s, { shortMessage: n }), s;}function ge(i, e, t, n) {if (!i)@@ -34186,7 +34538,7 @@ function ge(i, e, t, n) {function V(i, e, t, n) {ge(i, e, "INVALID_ARGUMENT", { argument: t, value: n });}-function cb(i, e, t) {+function gb(i, e, t) {t == null && (t = ""), t && (t = ": " + t), ge(i >= e, "missing argument" + t, "MISSING_ARGUMENT", {count: i,expectedCount: e@@ -34206,7 +34558,7 @@ function cb(i, e, t) {}return i;}, []);-function Wl(i, e, t) {+function Jl(i, e, t) {if (t == null && (t = ""), i !== e) {let n = t, s = "new";t && (n += ".", s += " " + t), ge(!1, `private constructor; use ${n}from* methods`, "UNSUPPORTED_OPERATION", {@@ -34214,7 +34566,7 @@ function Wl(i, e, t) {});}}-function lb(i, e, t) {+function mb(i, e, t) {if (i instanceof Uint8Array)return t ? new Uint8Array(i) : i;if (typeof i == "string" && i.length % 2 === 0 && i.match(/^0x[0-9a-f]*$/i)) {@@ -34227,31 +34579,31 @@ function lb(i, e, t) {V(!1, "invalid BytesLike value", e || "value", i);}function ht(i, e) {- return lb(i, e, !1);+ return mb(i, e, !1);}function Tn(i, e) {- return lb(i, e, !0);+ return mb(i, e, !0);}function Lt(i, e) {return !(typeof i != "string" || !i.match(/^0x[0-9A-Fa-f]*$/) || typeof e == "number" && i.length !== 2 + 2 * e || e === !0 && i.length % 2 !== 0);}-function Nf(i) {+function Uf(i) {return Lt(i, !0) || i instanceof Uint8Array;}-const lg = "0123456789abcdef";+const gg = "0123456789abcdef";function Se(i) {const e = ht(i);let t = "0x";for (let n = 0; n < e.length; n++) {const s = e[n];- t += lg[(s & 240) >> 4] + lg[s & 15];+ t += gg[(s & 240) >> 4] + gg[s & 15];}return t;}function Ot(i) {return "0x" + i.map((e) => Se(e).substring(2)).join("");}-function da(i) {+function ga(i) {return Lt(i, !0) ? (i.length - 2) / 2 : ht(i).length;}function Vt(i, e, t) {@@ -34262,7 +34614,7 @@ function Vt(i, e, t) {offset: t}), Se(n.slice(e ?? 0, t ?? n.length));}-function hb(i, e, t) {+function bb(i, e, t) {const n = ht(i);ge(e >= n.length, "padding exceeds data length", "BUFFER_OVERRUN", {buffer: new Uint8Array(n),@@ -34272,36 +34624,36 @@ function hb(i, e, t) {const s = new Uint8Array(e);return s.fill(0), t ? s.set(n, e - n.length) : s.set(n, 0), Se(s);}-function us(i, e) {- return hb(i, e, !0);+function ds(i, e) {+ return bb(i, e, !0);}-function wT(i, e) {- return hb(i, e, !1);+function WT(i, e) {+ return bb(i, e, !1);}-const Xo = BigInt(0), mi = BigInt(1), aa = 9007199254740991;-function CT(i, e) {- const t = ql(i, "value"), n = BigInt(ut(e, "width"));- if (ge(t >> n === Xo, "overflow", "NUMERIC_FAULT", {+const $o = BigInt(0), bi = BigInt(1), ca = 9007199254740991;+function qT(i, e) {+ const t = Zl(i, "value"), n = BigInt(ut(e, "width"));+ if (ge(t >> n === $o, "overflow", "NUMERIC_FAULT", {operation: "fromTwos",fault: "overflow",value: i- }), t >> n - mi) {- const s = (mi << n) - mi;- return -((~t & s) + mi);+ }), t >> n - bi) {+ const s = (bi << n) - bi;+ return -((~t & s) + bi);}return t;}-function ub(i, e) {+function xb(i, e) {let t = Fe(i, "value");- const n = BigInt(ut(e, "width")), s = mi << n - mi;- if (t < Xo) {+ const n = BigInt(ut(e, "width")), s = bi << n - bi;+ if (t < $o) {t = -t, ge(t <= s, "too low", "NUMERIC_FAULT", {operation: "toTwos",fault: "overflow",value: i});- const r = (mi << n) - mi;- return (~t & r) + mi;+ const r = (bi << n) - bi;+ return (~t & r) + bi;} elsege(t < s, "too high", "NUMERIC_FAULT", {operation: "toTwos",@@ -34310,16 +34662,16 @@ function ub(i, e) {});return t;}-function co(i, e) {- const t = ql(i, "value"), n = BigInt(ut(e, "bits"));- return t & (mi << n) - mi;+function fo(i, e) {+ const t = Zl(i, "value"), n = BigInt(ut(e, "bits"));+ return t & (bi << n) - bi;}function Fe(i, e) {switch (typeof i) {case "bigint":return i;case "number":- return V(Number.isInteger(i), "underflow", e || "value", i), V(i >= -aa && i <= aa, "overflow", e || "value", i), BigInt(i);+ return V(Number.isInteger(i), "underflow", e || "value", i), V(i >= -ca && i <= ca, "overflow", e || "value", i), BigInt(i);case "string":try {if (i === "")@@ -34331,20 +34683,20 @@ function Fe(i, e) {}V(!1, "invalid BigNumberish value", e || "value", i);}-function ql(i, e) {+function Zl(i, e) {const t = Fe(i, e);- return ge(t >= Xo, "unsigned value cannot be negative", "NUMERIC_FAULT", {+ return ge(t >= $o, "unsigned value cannot be negative", "NUMERIC_FAULT", {fault: "overflow",operation: "getUint",value: i}), t;}-const hg = "0123456789abcdef";-function Ff(i) {+const mg = "0123456789abcdef";+function Of(i) {if (i instanceof Uint8Array) {let e = "0x0";for (const t of i)- e += hg[t >> 4], e += hg[t & 15];+ e += mg[t >> 4], e += mg[t & 15];return BigInt(e);}return Fe(i);@@ -34352,9 +34704,9 @@ function Ff(i) {function ut(i, e) {switch (typeof i) {case "bigint":- return V(i >= -aa && i <= aa, "overflow", e || "value", i), Number(i);+ return V(i >= -ca && i <= ca, "overflow", e || "value", i), Number(i);case "number":- return V(Number.isInteger(i), "underflow", e || "value", i), V(i >= -aa && i <= aa, "overflow", e || "value", i), i;+ return V(Number.isInteger(i), "underflow", e || "value", i), V(i >= -ca && i <= ca, "overflow", e || "value", i), i;case "string":try {if (i === "")@@ -34366,17 +34718,17 @@ function ut(i, e) {}V(!1, "invalid numeric value", e || "value", i);}-function vT(i) {- return ut(Ff(i));+function KT(i) {+ return ut(Of(i));}-function Os(i, e) {- const t = ql(i, "value");+function Gs(i, e) {+ const t = Zl(i, "value");let n = t.toString(16);if (e == null)n.length % 2 && (n = "0" + n);else {const s = ut(e, "width");- if (s === 0 && t === Xo)+ if (s === 0 && t === $o)return "0x";for (ge(s * 2 >= n.length, `value exceeds width (${s} bytes)`, "NUMERIC_FAULT", {operation: "toBeHex",@@ -34388,8 +34740,8 @@ function Os(i, e) {return "0x" + n;}function $t(i, e) {- const t = ql(i, "value");- if (t === Xo)+ const t = Zl(i, "value");+ if (t === $o)return new Uint8Array(0);let n = t.toString(16);n.length % 2 && (n = "0" + n);@@ -34400,39 +34752,39 @@ function $t(i, e) {}return s;}-function fi(i) {- let e = Se(Nf(i) ? i : $t(i)).substring(2);+function pi(i) {+ let e = Se(Uf(i) ? i : $t(i)).substring(2);for (; e.startsWith("0"); )e = e.substring(1);return e === "" && (e = "0"), "0x" + e;}-const ug = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";+const bg = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);-const dg = BigInt(58);-function ST(i) {+const xg = BigInt(58);+function jT(i) {const e = ht(i);- let t = Ff(e), n = "";+ let t = Of(e), n = "";for (; t; )- n = ug[Number(t % dg)] + n, t /= dg;+ n = bg[Number(t % xg)] + n, t /= xg;for (let s = 0; s < e.length && !e[s]; s++)- n = ug[0] + n;+ n = bg[0] + n;return n;}-function IT(i) {+function XT(i) {i = atob(i);const e = new Uint8Array(i.length);for (let t = 0; t < i.length; t++)e[t] = i.charCodeAt(t);return ht(e);}-function MT(i) {+function YT(i) {const e = ht(i);let t = "";for (let n = 0; n < e.length; n++)t += String.fromCharCode(e[n]);return btoa(t);}-class db {+class Eb {/*** The event filter.*/@@ -34447,7 +34799,7 @@ class db {* the %%listener%% and for %%filter%%.*/constructor(e, t, n) {- this.#e = t, Ye(this, { emitter: e, filter: n });+ this.#e = t, Xe(this, { emitter: e, filter: n });}/*** Unregister the triggered listener for future events.@@ -34456,10 +34808,10 @@ class db {this.#e != null && await this.emitter.off(this.filter, this.#e);}}-function BT(i, e, t, n, s) {+function JT(i, e, t, n, s) {V(!1, `invalid codepoint at offset ${e}; ${i}`, "bytes", t);}-function fb(i, e, t, n, s) {+function _b(i, e, t, n, s) {if (i === "BAD_PREFIX" || i === "UNEXPECTED_CONTINUE") {let r = 0;for (let a = e + 1; a < t.length && t[a] >> 6 === 2; a++)@@ -34468,16 +34820,16 @@ function fb(i, e, t, n, s) {}return i === "OVERRUN" ? t.length - e - 1 : 0;}-function TT(i, e, t, n, s) {- return i === "OVERLONG" ? (V(typeof s == "number", "invalid bad code point for replacement", "badCodepoint", s), n.push(s), 0) : (n.push(65533), fb(i, e, t));+function ZT(i, e, t, n, s) {+ return i === "OVERLONG" ? (V(typeof s == "number", "invalid bad code point for replacement", "badCodepoint", s), n.push(s), 0) : (n.push(65533), _b(i, e, t));}-const RT = Object.freeze({- error: BT,- ignore: fb,- replace: TT+const $T = Object.freeze({+ error: JT,+ ignore: _b,+ replace: ZT});-function NT(i, e) {- e == null && (e = RT.error);+function eR(i, e) {+ e == null && (e = $T.error);const t = ht(i, "bytes"), n = [];let s = 0;for (; s < t.length; ) {@@ -34528,7 +34880,7 @@ function NT(i, e) {}return n;}-function os(i, e) {+function cs(i, e) {V(typeof i == "string", "invalid string value", "str", i);let t = [];for (let n = 0; n < i.length; n++) {@@ -34548,13 +34900,13 @@ function os(i, e) {}return new Uint8Array(t);}-function FT(i) {+function tR(i) {return i.map((e) => e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10 & 1023) + 55296, (e & 1023) + 56320))).join("");}-function Il(i, e) {- return FT(NT(i, e));+function Nl(i, e) {+ return tR(eR(i, e));}-function pb(i) {+function yb(i) {async function e(t, n) {ge(n == null || !n.cancelled, "request cancelled before sending", "CANCELLED");const s = t.url.split(":")[0].toLowerCase();@@ -34598,44 +34950,44 @@ function pb(i) {}return e;}-const DT = 12, LT = 250;-let fg = pb();-const PT = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"), kT = new RegExp("^ipfs://(ipfs/)?(.*)$", "i");-let lu = !1;-async function Ab(i, e) {+const nR = 12, iR = 250;+let Eg = yb();+const sR = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"), rR = new RegExp("^ipfs://(ipfs/)?(.*)$", "i");+let Au = !1;+async function wb(i, e) {try {- const t = i.match(PT);+ const t = i.match(sR);if (!t)throw new Error("invalid data");- return new Ps(200, "OK", {+ return new Us(200, "OK", {"content-type": t[1] || "text/plain"- }, t[2] ? IT(t[3]) : OT(t[3]));+ }, t[2] ? XT(t[3]) : oR(t[3]));} catch {- return new Ps(599, "BAD REQUEST (invalid data: URI)", {}, null, new Di(i));+ return new Us(599, "BAD REQUEST (invalid data: URI)", {}, null, new Li(i));}}-function gb(i) {+function vb(i) {async function e(t, n) {try {- const s = t.match(kT);+ const s = t.match(rR);if (!s)throw new Error("invalid link");- return new Di(`${i}${s[2]}`);+ return new Li(`${i}${s[2]}`);} catch {- return new Ps(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new Di(t));+ return new Us(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new Li(t));}}return e;}-const Wc = {- data: Ab,- ipfs: gb("https://gateway.ipfs.io/ipfs/")-}, mb = /* @__PURE__ */ new WeakMap();-class UT {+const Yc = {+ data: wb,+ ipfs: vb("https://gateway.ipfs.io/ipfs/")+}, Cb = /* @__PURE__ */ new WeakMap();+class aR {#e;#t;constructor(e) {- this.#e = [], this.#t = !1, mb.set(e, () => {+ this.#e = [], this.#t = !1, Cb.set(e, () => {if (!this.#t) {this.#t = !0;for (const t of this.#e)@@ -34658,12 +35010,12 @@ class UT {ge(!this.cancelled, "cancelled", "CANCELLED", {});}}-function qc(i) {+function Jc(i) {if (i == null)throw new Error("missing signal; should not happen");return i.checkSignal(), i;}-class Di {+class Li {#e;#t;#n;@@ -34715,11 +35067,11 @@ class Di {if (e == null)this.#r = void 0, this.#o = void 0;else if (typeof e == "string")- this.#r = os(e), this.#o = "text/plain";+ this.#r = cs(e), this.#o = "text/plain";else if (e instanceof Uint8Array)this.#r = e, this.#o = "application/octet-stream";else if (typeof e == "object")- this.#r = os(JSON.stringify(e)), this.#o = "application/json";+ this.#r = cs(JSON.stringify(e)), this.#o = "application/json";elsethrow new Error("invalid body");}@@ -34751,7 +35103,7 @@ class Di {*/get headers() {const e = Object.assign({}, this.#n);- return this.#f && (e.authorization = `Basic ${MT(os(this.#f))}`), this.allowGzip && (e["accept-encoding"] = "gzip"), e["content-type"] == null && this.#o && (e["content-type"] = this.#o), this.body && (e["content-length"] = String(this.body.length)), e;+ return this.#f && (e.authorization = `Basic ${YT(cs(this.#f))}`), this.allowGzip && (e["accept-encoding"] = "gzip"), e["content-type"] == null && this.#o && (e["content-type"] = this.#o), this.body && (e["content-length"] = String(this.body.length)), e;}/*** Get the header for %%key%%, ignoring case.@@ -34886,7 +35238,7 @@ class Di {* configurege a proxy or other agent.*/get getUrlFunc() {- return this.#u || fg;+ return this.#u || Eg;}set getUrlFunc(e) {this.#u = e;@@ -34899,8 +35251,8 @@ class Di {*/constructor(e) {this.#a = String(e), this.#e = !1, this.#t = !0, this.#n = {}, this.#i = "", this.#s = 3e5, this.#h = {- slotInterval: LT,- maxAttempts: DT+ slotInterval: iR,+ maxAttempts: nR}, this.#u = null;}toString() {@@ -34916,19 +35268,19 @@ class Di {async #d(e, t, n, s, r) {if (e >= this.#h.maxAttempts)return r.makeServerError("exceeded maximum retry limit");- ge(pg() <= t, "timeout", "TIMEOUT", {+ ge(_g() <= t, "timeout", "TIMEOUT", {operation: "request.send",reason: "timeout",request: s- }), n > 0 && await QT(n);+ }), n > 0 && await cR(n);let a = this.clone();const o = (a.url.split(":")[0] || "").toLowerCase();- if (o in Wc) {- const h = await Wc[o](a.url, qc(s.#c));- if (h instanceof Ps) {+ if (o in Yc) {+ const h = await Yc[o](a.url, Jc(s.#c));+ if (h instanceof Us) {let u = h;if (this.processFunc) {- qc(s.#c);+ Jc(s.#c);try {u = await this.processFunc(a, u);} catch (d) {@@ -34940,8 +35292,8 @@ class Di {a = h;}this.preflightFunc && (a = await this.preflightFunc(a));- const c = await this.getUrlFunc(a, qc(s.#c));- let l = new Ps(c.statusCode, c.statusMessage, c.headers, c.body, s);+ const c = await this.getUrlFunc(a, Jc(s.#c));+ let l = new Us(c.statusCode, c.statusMessage, c.headers, c.body, s);if (l.statusCode === 301 || l.statusCode === 302) {try {const h = l.headers.location || "";@@ -34955,7 +35307,7 @@ class Di {return typeof h == "string" && h.match(/^[1-9][0-9]*$/) && (u = parseInt(h)), a.clone().#d(e + 1, t, u, s, l);}if (this.processFunc) {- qc(s.#c);+ Jc(s.#c);try {l = await this.processFunc(a, l);} catch (h) {@@ -34970,7 +35322,7 @@ class Di {* Resolves to the response by sending the request.*/send() {- return ge(this.#c == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }), this.#c = new UT(this), this.#d(0, pg() + this.timeout, 0, this, new Ps(0, "", {}, null, this));+ return ge(this.#c == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }), this.#c = new aR(this), this.#d(0, _g() + this.timeout, 0, this, new Us(0, "", {}, null, this));}/*** Cancels the inflight response, causing a ``CANCELLED``@@ -34978,7 +35330,7 @@ class Di {*/cancel() {ge(this.#c != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" });- const e = mb.get(this);+ const e = Cb.get(this);if (!e)throw new Error("missing signal; should not happen");e();@@ -34992,14 +35344,14 @@ class Di {ge(this.method === "GET" && (t !== "https" || n !== "http") && e.match(/^https?:/), "unsupported redirect", "UNSUPPORTED_OPERATION", {operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});- const s = new Di(e);+ const s = new Li(e);return s.method = "GET", s.allowGzip = this.allowGzip, s.timeout = this.timeout, s.#n = Object.assign({}, this.#n), this.#r && (s.#r = new Uint8Array(this.#r)), s.#o = this.#o, s;}/*** Create a new copy of this request.*/clone() {- const e = new Di(this.url);+ const e = new Li(this.url);return e.#i = this.#i, this.#r && (e.#r = this.#r), e.#o = this.#o, e.#n = Object.assign({}, this.#n), e.#f = this.#f, this.allowGzip && (e.allowGzip = !0), e.timeout = this.timeout, this.allowInsecureAuthentication && (e.allowInsecureAuthentication = !0), e.#l = this.#l, e.#p = this.#p, e.#A = this.#A, e.#h = Object.assign({}, this.#h), e.#u = this.#u, e;}/**@@ -35007,13 +35359,13 @@ class Di {* registration.*/static lockConfig() {- lu = !0;+ Au = !0;}/*** Get the current Gateway function for %%scheme%%.*/static getGateway(e) {- return Wc[e.toLowerCase()] || null;+ return Yc[e.toLowerCase()] || null;}/*** Use the %%func%% when fetching URIs using %%scheme%%.@@ -35026,9 +35378,9 @@ class Di {static registerGateway(e, t) {if (e = e.toLowerCase(), e === "http" || e === "https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);- if (lu)+ if (Au)throw new Error("gateways locked");- Wc[e] = t;+ Yc[e] = t;}/*** Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests.@@ -35039,9 +35391,9 @@ class Di {* throws.*/static registerGetUrl(e) {- if (lu)+ if (Au)throw new Error("gateways locked");- fg = e;+ Eg = e;}/*** Creates a getUrl function that fetches content from HTTP and@@ -35055,7 +35407,7 @@ class Di {* content.*/static createGetUrlFunc(e) {- return pb(e);+ return yb(e);}/*** Creates a function that can "fetch" data URIs.@@ -35067,7 +35419,7 @@ class Di {* be useful in a wrapper to perfom custom data URI functionality.*/static createDataGateway() {- return Ab;+ return wb;}/*** Creates a function that will fetch IPFS (unvalidated) from@@ -35077,10 +35429,10 @@ class Di {* ``"https:/\/gateway.ipfs.io/ipfs/"``.*/static createIpfsGatewayFunc(e) {- return gb(e);+ return vb(e);}}-class Ps {+class Us {#e;#t;#n;@@ -35122,7 +35474,7 @@ class Ps {*/get bodyText() {try {- return this.#i == null ? "" : Il(this.#i);+ return this.#i == null ? "" : Nl(this.#i);} catch {ge(!1, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", {operation: "bodyText",@@ -35173,7 +35525,7 @@ class Ps {makeServerError(e, t) {let n;e ? n = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})` : (e = `${this.statusCode} ${this.statusMessage}`, n = `CLIENT ESCALATED SERVER ERROR (${e})`);- const s = new Ps(599, n, this.headers, this.body, this.#s || void 0);+ const s = new Us(599, n, this.headers, this.body, this.#s || void 0);return s.#a = { message: e, error: t }, s;}/**@@ -35184,7 +35536,7 @@ class Ps {throwThrottleError(e, t) {t == null ? t = -1 : V(Number.isInteger(t) && t >= 0, "invalid stall timeout", "stall", t);const n = new Error(e || "throttling requests");- throw Ye(n, { stall: t, throttle: !0 }), n;+ throw Xe(n, { stall: t, throttle: !0 }), n;}/*** Get the header value for %%key%%, ignoring case.@@ -35222,7 +35574,7 @@ class Ps {this.request && (n = this.request.url);let s = null;try {- this.#i && (s = Il(this.#i));+ this.#i && (s = Nl(this.#i));} catch {}ge(!1, e, "SERVER_ERROR", {@@ -35237,31 +35589,31 @@ class Ps {});}}-function pg() {+function _g() {return (/* @__PURE__ */ new Date()).getTime();}-function OT(i) {- return os(i.replace(/%([0-9a-f][0-9a-f])/gi, (e, t) => String.fromCharCode(parseInt(t, 16))));+function oR(i) {+ return cs(i.replace(/%([0-9a-f][0-9a-f])/gi, (e, t) => String.fromCharCode(parseInt(t, 16))));}-function QT(i) {+function cR(i) {return new Promise((e) => setTimeout(e, i));}-function GT(i) {+function lR(i) {let e = i.toString(16);for (; e.length < 2; )e = "0" + e;return "0x" + e;}-function Ag(i, e, t) {+function yg(i, e, t) {let n = 0;for (let s = 0; s < t; s++)n = n * 256 + i[e + s];return n;}-function gg(i, e, t, n) {+function wg(i, e, t, n) {const s = [];for (; t < e + 1 + n; ) {- const r = bb(i, t);+ const r = Sb(i, t);s.push(r.result), t += r.consumed, ge(t <= e + 1 + n, "child data too short", "BUFFER_OVERRUN", {buffer: i,length: n,@@ -35270,7 +35622,7 @@ function gg(i, e, t, n) {}return { consumed: 1 + n, result: s };}-function bb(i, e) {+function Sb(i, e) {ge(i.length !== 0, "data too short", "BUFFER_OVERRUN", {buffer: i,length: 0,@@ -35286,15 +35638,15 @@ function bb(i, e) {if (i[e] >= 248) {const n = i[e] - 247;t(e + 1 + n);- const s = Ag(i, e + 1, n);- return t(e + 1 + n + s), gg(i, e, e + 1 + n, n + s);+ const s = yg(i, e + 1, n);+ return t(e + 1 + n + s), wg(i, e, e + 1 + n, n + s);} else if (i[e] >= 192) {const n = i[e] - 192;- return t(e + 1 + n), gg(i, e, e + 1, n);+ return t(e + 1 + n), wg(i, e, e + 1, n);} else if (i[e] >= 184) {const n = i[e] - 183;t(e + 1 + n);- const s = Ag(i, e + 1, n);+ const s = yg(i, e + 1, n);t(e + 1 + n + s);const r = Se(i.slice(e + 1 + n, e + 1 + n + s));return { consumed: 1 + n + s, result: r };@@ -35304,26 +35656,26 @@ function bb(i, e) {const s = Se(i.slice(e + 1, e + 1 + n));return { consumed: 1 + n, result: s };}- return { consumed: 1, result: GT(i[e]) };+ return { consumed: 1, result: lR(i[e]) };}-function Yo(i) {- const e = ht(i, "data"), t = bb(e, 0);+function ec(i) {+ const e = ht(i, "data"), t = Sb(e, 0);return V(t.consumed === e.length, "unexpected junk after rlp payload", "data", i), t.result;}-function mg(i) {+function vg(i) {const e = [];for (; i; )e.unshift(i & 255), i >>= 8;return e;}-function xb(i) {+function Ib(i) {if (Array.isArray(i)) {let n = [];if (i.forEach(function(r) {- n = n.concat(xb(r));+ n = n.concat(Ib(r));}), n.length <= 55)return n.unshift(192 + n.length), n;- const s = mg(n.length);+ const s = vg(n.length);return s.unshift(247 + s.length), s.concat(n);}const e = Array.prototype.slice.call(ht(i, "object"));@@ -35331,34 +35683,34 @@ function xb(i) {return e;if (e.length <= 55)return e.unshift(128 + e.length), e;- const t = mg(e.length);+ const t = vg(e.length);return t.unshift(183 + t.length), t.concat(e);}-const bg = "0123456789abcdef";-function cs(i) {+const Cg = "0123456789abcdef";+function ls(i) {let e = "0x";- for (const t of xb(i))- e += bg[t >> 4], e += bg[t & 15];+ for (const t of Ib(i))+ e += Cg[t >> 4], e += Cg[t & 15];return e;}-const Nn = 32, Id = new Uint8Array(Nn), HT = ["then"], Kc = {}, Eb = /* @__PURE__ */ new WeakMap();-function rr(i) {- return Eb.get(i);+const Nn = 32, Fd = new Uint8Array(Nn), hR = ["then"], Zc = {}, Mb = /* @__PURE__ */ new WeakMap();+function or(i) {+ return Mb.get(i);}-function xg(i, e) {- Eb.set(i, e);+function Sg(i, e) {+ Mb.set(i, e);}-function io(i, e) {+function oo(i, e) {const t = new Error(`deferred error during ABI decoding triggered accessing ${i}`);throw t.error = e, t;}-function Md(i, e, t) {- return i.indexOf(null) >= 0 ? e.map((n, s) => n instanceof ss ? Md(rr(n), n, t) : n) : i.reduce((n, s, r) => {+function Dd(i, e, t) {+ return i.indexOf(null) >= 0 ? e.map((n, s) => n instanceof rs ? Dd(or(n), n, t) : n) : i.reduce((n, s, r) => {let a = e.getValue(s);- return s in n || (t && a instanceof ss && (a = Md(rr(a), a, t)), n[s] = a), n;+ return s in n || (t && a instanceof rs && (a = Dd(or(a), a, t)), n[s] = a), n;}, {});}-class ss extends Array {+class rs extends Array {// No longer used; but cannot be removed as it will remove the// #private field from the .d.ts which may break backwards// compatibility@@ -35369,11 +35721,11 @@ class ss extends Array {constructor(...e) {const t = e[0];let n = e[1], s = (e[2] || []).slice(), r = !0;- t !== Kc && (n = e, s = [], r = !1), super(n.length), n.forEach((c, l) => {+ t !== Zc && (n = e, s = [], r = !1), super(n.length), n.forEach((c, l) => {this[l] = c;});const a = s.reduce((c, l) => (typeof l == "string" && c.set(l, (c.get(l) || 0) + 1), c), /* @__PURE__ */ new Map());- if (xg(this, Object.freeze(n.map((c, l) => {+ if (Sg(this, Object.freeze(n.map((c, l) => {const h = s[l];return h != null && a.get(h) === 1 ? h : null;}))), this.#e = [], this.#e == null && this.#e, !r)@@ -35387,9 +35739,9 @@ class ss extends Array {if (d < 0 || d >= this.length)throw new RangeError("out of result range");const f = c[d];- return f instanceof Error && io(`index ${d}`, f), f;+ return f instanceof Error && oo(`index ${d}`, f), f;}- if (HT.indexOf(l) >= 0)+ if (hR.indexOf(l) >= 0)return Reflect.get(c, l, h);const u = c[l];if (u instanceof Function)@@ -35402,7 +35754,7 @@ class ss extends Array {return Reflect.get(c, l, h);}});- return xg(o, rr(this)), o;+ return Sg(o, or(this)), o;}/*** Returns the Result as a normal Array. If %%deep%%, any children@@ -35414,7 +35766,7 @@ class ss extends Array {toArray(e) {const t = [];return this.forEach((n, s) => {- n instanceof Error && io(`index ${s}`, n), e && n instanceof ss && (n = n.toArray(e)), t.push(n);+ n instanceof Error && oo(`index ${s}`, n), e && n instanceof rs && (n = n.toArray(e)), t.push(n);}), t;}/**@@ -35426,31 +35778,31 @@ class ss extends Array {* any outstanding deferred errors.*/toObject(e) {- const t = rr(this);+ const t = or(this);return t.reduce((n, s, r) => (ge(s != null, `value at index ${r} unnamed`, "UNSUPPORTED_OPERATION", {operation: "toObject()"- }), Md(t, this, e)), {});+ }), Dd(t, this, e)), {});}/*** @_ignore*/slice(e, t) {e == null && (e = 0), e < 0 && (e += this.length, e < 0 && (e = 0)), t == null && (t = this.length), t < 0 && (t += this.length, t < 0 && (t = 0)), t > this.length && (t = this.length);- const n = rr(this), s = [], r = [];+ const n = or(this), s = [], r = [];for (let a = e; a < t; a++)s.push(this[a]), r.push(n[a]);- return new ss(Kc, s, r);+ return new rs(Zc, s, r);}/*** @_ignore*/filter(e, t) {- const n = rr(this), s = [], r = [];+ const n = or(this), s = [], r = [];for (let a = 0; a < this.length; a++) {const o = this[a];- o instanceof Error && io(`index ${a}`, o), e.call(t, o, a, this) && (s.push(o), r.push(n[a]));+ o instanceof Error && oo(`index ${a}`, o), e.call(t, o, a, this) && (s.push(o), r.push(n[a]));}- return new ss(Kc, s, r);+ return new rs(Zc, s, r);}/*** @_ignore@@ -35459,7 +35811,7 @@ class ss extends Array {const n = [];for (let s = 0; s < this.length; s++) {const r = this[s];- r instanceof Error && io(`index ${s}`, r), n.push(e.call(t, r, s, this));+ r instanceof Error && oo(`index ${s}`, r), n.push(e.call(t, r, s, this));}return n;}@@ -35472,25 +35824,25 @@ class ss extends Array {* accessible by name.*/getValue(e) {- const t = rr(this).indexOf(e);+ const t = or(this).indexOf(e);if (t === -1)return;const n = this[t];- return n instanceof Error && io(`property ${JSON.stringify(e)}`, n.error), n;+ return n instanceof Error && oo(`property ${JSON.stringify(e)}`, n.error), n;}/*** Creates a new [[Result]] for %%items%% with each entry* also accessible by its corresponding name in %%keys%%.*/static fromItems(e, t) {- return new ss(Kc, e, t);+ return new rs(Zc, e, t);}}-function Eg(i) {+function Ig(i) {let e = $t(i);- return ge(e.length <= Nn, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: e, length: Nn, offset: e.length }), e.length !== Nn && (e = Tn(Ot([Id.slice(e.length % Nn), e]))), e;+ return ge(e.length <= Nn, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: e, length: Nn, offset: e.length }), e.length !== Nn && (e = Tn(Ot([Fd.slice(e.length % Nn), e]))), e;}-class ps {+class As {// The coder name:// - address, uint256, tuple, array, etc.name;@@ -35505,7 +35857,7 @@ class ps {// - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)dynamic;constructor(e, t, n, s) {- Ye(this, { name: e, type: t, localName: n, dynamic: s }, {+ Xe(this, { name: e, type: t, localName: n, dynamic: s }, {name: "string",type: "string",localName: "string",@@ -35516,7 +35868,7 @@ class ps {V(!1, e, this.localName, t);}}-class Bd {+class Ld {// An array of WordSize lengthed objects to concatenation#e;#t;@@ -35539,22 +35891,22 @@ class Bd {writeBytes(e) {let t = Tn(e);const n = t.length % Nn;- return n && (t = Tn(Ot([t, Id.slice(n)]))), this.#n(t);+ return n && (t = Tn(Ot([t, Fd.slice(n)]))), this.#n(t);}// Numeric item; pad on the left *to* WordSizewriteValue(e) {- return this.#n(Eg(e));+ return this.#n(Ig(e));}// Inserts a numeric place-holder, returning a callback that can// be used to asjust the value laterwriteUpdatableValue() {const e = this.#e.length;- return this.#e.push(Id), this.#t += Nn, (t) => {- this.#e[e] = Eg(t);+ return this.#e.push(Fd), this.#t += Nn, (t) => {+ this.#e[e] = Ig(t);};}}-class Df {+class Qf {// Allows incomplete unpadded data to be read; otherwise an error// is raised if attempting to overrun the buffer. This is required// to deal with an old Solidity bug, in which event data for@@ -35566,7 +35918,7 @@ class Df {#i;#s;constructor(e, t, n) {- Ye(this, { allowLoose: !!t }), this.#e = Tn(e), this.#n = 0, this.#i = null, this.#s = n ?? 1024, this.#t = 0;+ Xe(this, { allowLoose: !!t }), this.#e = Tn(e), this.#n = 0, this.#i = null, this.#s = n ?? 1024, this.#t = 0;}get data() {return Se(this.#e);@@ -35603,7 +35955,7 @@ class Df {}// Create a sub-reader with the same underlying data, but offsetsubReader(e) {- const t = new Df(this.#e.slice(this.#t + e), this.allowLoose, this.#s);+ const t = new Qf(this.#e.slice(this.#t + e), this.allowLoose, this.#s);return t.#i = this, t;}// Read bytes@@ -35613,81 +35965,81 @@ class Df {}// Read a numeric valuesreadValue() {- return Ff(this.readBytes(Nn));+ return Of(this.readBytes(Nn));}readIndex() {- return vT(this.readBytes(Nn));+ return KT(this.readBytes(Nn));}}-function Ml(i) {+function Fl(i) {if (!Number.isSafeInteger(i) || i < 0)throw new Error(`Wrong positive integer: ${i}`);}-function Lf(i, ...e) {+function Gf(i, ...e) {if (!(i instanceof Uint8Array))throw new Error("Expected Uint8Array");if (e.length > 0 && !e.includes(i.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${i.length}`);}-function zT(i) {+function uR(i) {if (typeof i != "function" || typeof i.create != "function")throw new Error("Hash should be wrapped by utils.wrapConstructor");- Ml(i.outputLen), Ml(i.blockLen);+ Fl(i.outputLen), Fl(i.blockLen);}-function va(i, e = !0) {+function Ba(i, e = !0) {if (i.destroyed)throw new Error("Hash instance has been destroyed");if (e && i.finished)throw new Error("Hash#digest() has already been called");}-function _b(i, e) {- Lf(i);+function Bb(i, e) {+ Gf(i);const t = e.outputLen;if (i.length < t)throw new Error(`digestInto() expects output buffer of length at least ${t}`);}-const hu = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;-const yb = (i) => i instanceof Uint8Array, VT = (i) => new Uint32Array(i.buffer, i.byteOffset, Math.floor(i.byteLength / 4)), uu = (i) => new DataView(i.buffer, i.byteOffset, i.byteLength), Si = (i, e) => i << 32 - e | i >>> e, WT = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;-if (!WT)+const gu = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;+const Tb = (i) => i instanceof Uint8Array, dR = (i) => new Uint32Array(i.buffer, i.byteOffset, Math.floor(i.byteLength / 4)), mu = (i) => new DataView(i.buffer, i.byteOffset, i.byteLength), Ii = (i, e) => i << 32 - e | i >>> e, fR = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;+if (!fR)throw new Error("Non little-endian hardware is not supported");-function qT(i) {+function pR(i) {if (typeof i != "string")throw new Error(`utf8ToBytes expected string, got ${typeof i}`);return new Uint8Array(new TextEncoder().encode(i));}-function Kl(i) {- if (typeof i == "string" && (i = qT(i)), !yb(i))+function $l(i) {+ if (typeof i == "string" && (i = pR(i)), !Tb(i))throw new Error(`expected Uint8Array, got ${typeof i}`);return i;}-function KT(...i) {+function AR(...i) {const e = new Uint8Array(i.reduce((n, s) => n + s.length, 0));let t = 0;return i.forEach((n) => {- if (!yb(n))+ if (!Tb(n))throw new Error("Uint8Array expected");e.set(n, t), t += n.length;}), e;}-class Pf {+class Hf {// Safe version that clones internal stateclone() {return this._cloneInto();}}-function kf(i) {- const e = (n) => i().update(Kl(n)).digest(), t = i();+function zf(i) {+ const e = (n) => i().update($l(n)).digest(), t = i();return e.outputLen = t.outputLen, e.blockLen = t.blockLen, e.create = () => i(), e;}-function XT(i = 32) {- if (hu && typeof hu.getRandomValues == "function")- return hu.getRandomValues(new Uint8Array(i));+function gR(i = 32) {+ if (gu && typeof gu.getRandomValues == "function")+ return gu.getRandomValues(new Uint8Array(i));throw new Error("crypto.getRandomValues must be defined");}-class wb extends Pf {+class Rb extends Hf {constructor(e, t) {- super(), this.finished = !1, this.destroyed = !1, zT(e);- const n = Kl(t);+ super(), this.finished = !1, this.destroyed = !1, uR(e);+ const n = $l(t);if (this.iHash = e.create(), typeof this.iHash.update != "function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;@@ -35701,10 +36053,10 @@ class wb extends Pf {this.oHash.update(r), r.fill(0);}update(e) {- return va(this), this.iHash.update(e), this;+ return Ba(this), this.iHash.update(e), this;}digestInto(e) {- va(this), Lf(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();+ Ba(this), Gf(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();}digest() {const e = new Uint8Array(this.oHash.outputLen);@@ -35719,27 +36071,27 @@ class wb extends Pf {this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();}}-const Cb = (i, e, t) => new wb(i, e).update(t).digest();-Cb.create = (i, e) => new wb(i, e);-function YT(i, e, t, n) {+const Nb = (i, e, t) => new Rb(i, e).update(t).digest();+Nb.create = (i, e) => new Rb(i, e);+function mR(i, e, t, n) {if (typeof i.setBigUint64 == "function")return i.setBigUint64(e, t, n);const s = BigInt(32), r = BigInt(4294967295), a = Number(t >> s & r), o = Number(t & r), c = n ? 4 : 0, l = n ? 0 : 4;i.setUint32(e + c, a, n), i.setUint32(e + l, o, n);}-class vb extends Pf {+class Fb extends Hf {constructor(e, t, n, s) {- super(), this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(e), this.view = uu(this.buffer);+ super(), this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(e), this.view = mu(this.buffer);}update(e) {- va(this);+ Ba(this);const { view: t, buffer: n, blockLen: s } = this;- e = Kl(e);+ e = $l(e);const r = e.length;for (let a = 0; a < r; ) {const o = Math.min(s - this.pos, r - a);if (o === s) {- const c = uu(e);+ const c = mu(e);for (; s <= r - a; a += s)this.process(c, a);continue;@@ -35749,14 +36101,14 @@ class vb extends Pf {return this.length += e.length, this.roundClean(), this;}digestInto(e) {- va(this), _b(e, this), this.finished = !0;+ Ba(this), Bb(e, this), this.finished = !0;const { buffer: t, view: n, blockLen: s, isLE: r } = this;let { pos: a } = this;t[a++] = 128, this.buffer.subarray(a).fill(0), this.padOffset > s - a && (this.process(n, 0), a = 0);for (let u = a; u < s; u++)t[u] = 0;- YT(n, s - 8, BigInt(this.length * 8), r), this.process(n, 0);- const o = uu(e), c = this.outputLen;+ mR(n, s - 8, BigInt(this.length * 8), r), this.process(n, 0);+ const o = mu(e), c = this.outputLen;if (c % 4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l = c / 4, h = this.get();@@ -35777,7 +36129,7 @@ class vb extends Pf {return e.length = s, e.pos = o, e.finished = r, e.destroyed = a, s % t && e.buffer.set(n), e;}}-const jT = (i, e, t) => i & e ^ ~i & t, JT = (i, e, t) => i & e ^ i & t ^ e & t, ZT = /* @__PURE__ */ new Uint32Array([+const bR = (i, e, t) => i & e ^ ~i & t, xR = (i, e, t) => i & e ^ i & t ^ e & t, ER = /* @__PURE__ */ new Uint32Array([1116352408,1899447441,3049323471,@@ -35842,7 +36194,7 @@ const jT = (i, e, t) => i & e ^ ~i & t, JT = (i, e, t) => i & e ^ i & t ^ e & t,2756734187,3204031479,3329325298-]), vs = /* @__PURE__ */ new Uint32Array([+]), Ss = /* @__PURE__ */ new Uint32Array([1779033703,3144134277,1013904242,@@ -35851,10 +36203,10 @@ const jT = (i, e, t) => i & e ^ ~i & t, JT = (i, e, t) => i & e ^ i & t ^ e & t,2600822924,528734635,1541459225-]), Ss = /* @__PURE__ */ new Uint32Array(64);-class $T extends vb {+]), Is = /* @__PURE__ */ new Uint32Array(64);+class _R extends Fb {constructor() {- super(64, 32, 8, !1), this.A = vs[0] | 0, this.B = vs[1] | 0, this.C = vs[2] | 0, this.D = vs[3] | 0, this.E = vs[4] | 0, this.F = vs[5] | 0, this.G = vs[6] | 0, this.H = vs[7] | 0;+ super(64, 32, 8, !1), this.A = Ss[0] | 0, this.B = Ss[1] | 0, this.C = Ss[2] | 0, this.D = Ss[3] | 0, this.E = Ss[4] | 0, this.F = Ss[5] | 0, this.G = Ss[6] | 0, this.H = Ss[7] | 0;}get() {const { A: e, B: t, C: n, D: s, E: r, F: a, G: o, H: c } = this;@@ -35866,66 +36218,66 @@ class $T extends vb {}process(e, t) {for (let u = 0; u < 16; u++, t += 4)- Ss[u] = e.getUint32(t, !1);+ Is[u] = e.getUint32(t, !1);for (let u = 16; u < 64; u++) {- const d = Ss[u - 15], f = Ss[u - 2], m = Si(d, 7) ^ Si(d, 18) ^ d >>> 3, g = Si(f, 17) ^ Si(f, 19) ^ f >>> 10;- Ss[u] = g + Ss[u - 7] + m + Ss[u - 16] | 0;+ const d = Is[u - 15], f = Is[u - 2], m = Ii(d, 7) ^ Ii(d, 18) ^ d >>> 3, g = Ii(f, 17) ^ Ii(f, 19) ^ f >>> 10;+ Is[u] = g + Is[u - 7] + m + Is[u - 16] | 0;}let { A: n, B: s, C: r, D: a, E: o, F: c, G: l, H: h } = this;for (let u = 0; u < 64; u++) {- const d = Si(o, 6) ^ Si(o, 11) ^ Si(o, 25), f = h + d + jT(o, c, l) + ZT[u] + Ss[u] | 0, g = (Si(n, 2) ^ Si(n, 13) ^ Si(n, 22)) + JT(n, s, r) | 0;+ const d = Ii(o, 6) ^ Ii(o, 11) ^ Ii(o, 25), f = h + d + bR(o, c, l) + ER[u] + Is[u] | 0, g = (Ii(n, 2) ^ Ii(n, 13) ^ Ii(n, 22)) + xR(n, s, r) | 0;h = l, l = c, c = o, o = a + f | 0, a = r, r = s, s = n, n = f + g | 0;}n = n + this.A | 0, s = s + this.B | 0, r = r + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, h = h + this.H | 0, this.set(n, s, r, a, o, c, l, h);}roundClean() {- Ss.fill(0);+ Is.fill(0);}destroy() {this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);}}-const Sb = /* @__PURE__ */ kf(() => new $T()), Xc = /* @__PURE__ */ BigInt(2 ** 32 - 1), Td = /* @__PURE__ */ BigInt(32);-function Ib(i, e = !1) {- return e ? { h: Number(i & Xc), l: Number(i >> Td & Xc) } : { h: Number(i >> Td & Xc) | 0, l: Number(i & Xc) | 0 };+const Db = /* @__PURE__ */ zf(() => new _R()), $c = /* @__PURE__ */ BigInt(2 ** 32 - 1), Pd = /* @__PURE__ */ BigInt(32);+function Lb(i, e = !1) {+ return e ? { h: Number(i & $c), l: Number(i >> Pd & $c) } : { h: Number(i >> Pd & $c) | 0, l: Number(i & $c) | 0 };}-function Mb(i, e = !1) {+function Pb(i, e = !1) {let t = new Uint32Array(i.length), n = new Uint32Array(i.length);for (let s = 0; s < i.length; s++) {- const { h: r, l: a } = Ib(i[s], e);+ const { h: r, l: a } = Lb(i[s], e);[t[s], n[s]] = [r, a];}return [t, n];}-const eR = (i, e) => BigInt(i >>> 0) << Td | BigInt(e >>> 0), tR = (i, e, t) => i >>> t, nR = (i, e, t) => i << 32 - t | e >>> t, iR = (i, e, t) => i >>> t | e << 32 - t, sR = (i, e, t) => i << 32 - t | e >>> t, rR = (i, e, t) => i << 64 - t | e >>> t - 32, aR = (i, e, t) => i >>> t - 32 | e << 64 - t, oR = (i, e) => e, cR = (i, e) => i, Bb = (i, e, t) => i << t | e >>> 32 - t, Tb = (i, e, t) => e << t | i >>> 32 - t, Rb = (i, e, t) => e << t - 32 | i >>> 64 - t, Nb = (i, e, t) => i << t - 32 | e >>> 64 - t;-function lR(i, e, t, n) {+const yR = (i, e) => BigInt(i >>> 0) << Pd | BigInt(e >>> 0), wR = (i, e, t) => i >>> t, vR = (i, e, t) => i << 32 - t | e >>> t, CR = (i, e, t) => i >>> t | e << 32 - t, SR = (i, e, t) => i << 32 - t | e >>> t, IR = (i, e, t) => i << 64 - t | e >>> t - 32, MR = (i, e, t) => i >>> t - 32 | e << 64 - t, BR = (i, e) => e, TR = (i, e) => i, kb = (i, e, t) => i << t | e >>> 32 - t, Ub = (i, e, t) => e << t | i >>> 32 - t, Ob = (i, e, t) => e << t - 32 | i >>> 64 - t, Qb = (i, e, t) => i << t - 32 | e >>> 64 - t;+function RR(i, e, t, n) {const s = (e >>> 0) + (n >>> 0);return { h: i + t + (s / 2 ** 32 | 0) | 0, l: s | 0 };}-const hR = (i, e, t) => (i >>> 0) + (e >>> 0) + (t >>> 0), uR = (i, e, t, n) => e + t + n + (i / 2 ** 32 | 0) | 0, dR = (i, e, t, n) => (i >>> 0) + (e >>> 0) + (t >>> 0) + (n >>> 0), fR = (i, e, t, n, s) => e + t + n + s + (i / 2 ** 32 | 0) | 0, pR = (i, e, t, n, s) => (i >>> 0) + (e >>> 0) + (t >>> 0) + (n >>> 0) + (s >>> 0), AR = (i, e, t, n, s, r) => e + t + n + s + r + (i / 2 ** 32 | 0) | 0, at = {- fromBig: Ib,- split: Mb,- toBig: eR,- shrSH: tR,- shrSL: nR,- rotrSH: iR,- rotrSL: sR,- rotrBH: rR,- rotrBL: aR,- rotr32H: oR,- rotr32L: cR,- rotlSH: Bb,- rotlSL: Tb,- rotlBH: Rb,- rotlBL: Nb,- add: lR,- add3L: hR,- add3H: uR,- add4L: dR,- add4H: fR,- add5H: AR,- add5L: pR-}, [gR, mR] = at.split([+const NR = (i, e, t) => (i >>> 0) + (e >>> 0) + (t >>> 0), FR = (i, e, t, n) => e + t + n + (i / 2 ** 32 | 0) | 0, DR = (i, e, t, n) => (i >>> 0) + (e >>> 0) + (t >>> 0) + (n >>> 0), LR = (i, e, t, n, s) => e + t + n + s + (i / 2 ** 32 | 0) | 0, PR = (i, e, t, n, s) => (i >>> 0) + (e >>> 0) + (t >>> 0) + (n >>> 0) + (s >>> 0), kR = (i, e, t, n, s, r) => e + t + n + s + r + (i / 2 ** 32 | 0) | 0, at = {+ fromBig: Lb,+ split: Pb,+ toBig: yR,+ shrSH: wR,+ shrSL: vR,+ rotrSH: CR,+ rotrSL: SR,+ rotrBH: IR,+ rotrBL: MR,+ rotr32H: BR,+ rotr32L: TR,+ rotlSH: kb,+ rotlSL: Ub,+ rotlBH: Ob,+ rotlBL: Qb,+ add: RR,+ add3L: NR,+ add3H: FR,+ add4L: DR,+ add4H: LR,+ add5H: kR,+ add5L: PR+}, [UR, OR] = at.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f",@@ -36006,8 +36358,8 @@ const hR = (i, e, t) => (i >>> 0) + (e >>> 0) + (t >>> 0), uR = (i, e, t, n) =>"0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"-].map((i) => BigInt(i))), Is = /* @__PURE__ */ new Uint32Array(80), Ms = /* @__PURE__ */ new Uint32Array(80);-class bR extends vb {+].map((i) => BigInt(i))), Ms = /* @__PURE__ */ new Uint32Array(80), Bs = /* @__PURE__ */ new Uint32Array(80);+class QR extends Fb {constructor() {super(128, 64, 16, !1), this.Ah = 1779033703, this.Al = -205731576, this.Bh = -1150833019, this.Bl = -2067093701, this.Ch = 1013904242, this.Cl = -23791573, this.Dh = -1521486534, this.Dl = 1595750129, this.Eh = 1359893119, this.El = -1377402159, this.Fh = -1694144372, this.Fl = 725511199, this.Gh = 528734635, this.Gl = -79577749, this.Hh = 1541459225, this.Hl = 327033209;}@@ -36022,29 +36374,29 @@ class bR extends vb {}process(e, t) {for (let b = 0; b < 16; b++, t += 4)- Is[b] = e.getUint32(t), Ms[b] = e.getUint32(t += 4);+ Ms[b] = e.getUint32(t), Bs[b] = e.getUint32(t += 4);for (let b = 16; b < 80; b++) {- const _ = Is[b - 15] | 0, M = Ms[b - 15] | 0, w = at.rotrSH(_, M, 1) ^ at.rotrSH(_, M, 8) ^ at.shrSH(_, M, 7), S = at.rotrSL(_, M, 1) ^ at.rotrSL(_, M, 8) ^ at.shrSL(_, M, 7), T = Is[b - 2] | 0, v = Ms[b - 2] | 0, C = at.rotrSH(T, v, 19) ^ at.rotrBH(T, v, 61) ^ at.shrSH(T, v, 6), F = at.rotrSL(T, v, 19) ^ at.rotrBL(T, v, 61) ^ at.shrSL(T, v, 6), K = at.add4L(S, F, Ms[b - 7], Ms[b - 16]), q = at.add4H(K, w, C, Is[b - 7], Is[b - 16]);- Is[b] = q | 0, Ms[b] = K | 0;+ const _ = Ms[b - 15] | 0, M = Bs[b - 15] | 0, w = at.rotrSH(_, M, 1) ^ at.rotrSH(_, M, 8) ^ at.shrSH(_, M, 7), S = at.rotrSL(_, M, 1) ^ at.rotrSL(_, M, 8) ^ at.shrSL(_, M, 7), T = Ms[b - 2] | 0, C = Bs[b - 2] | 0, v = at.rotrSH(T, C, 19) ^ at.rotrBH(T, C, 61) ^ at.shrSH(T, C, 6), F = at.rotrSL(T, C, 19) ^ at.rotrBL(T, C, 61) ^ at.shrSL(T, C, 6), K = at.add4L(S, F, Bs[b - 7], Bs[b - 16]), q = at.add4H(K, w, v, Ms[b - 7], Ms[b - 16]);+ Ms[b] = q | 0, Bs[b] = K | 0;}let { Ah: n, Al: s, Bh: r, Bl: a, Ch: o, Cl: c, Dh: l, Dl: h, Eh: u, El: d, Fh: f, Fl: m, Gh: g, Gl: A, Hh: p, Hl: y } = this;for (let b = 0; b < 80; b++) {- const _ = at.rotrSH(u, d, 14) ^ at.rotrSH(u, d, 18) ^ at.rotrBH(u, d, 41), M = at.rotrSL(u, d, 14) ^ at.rotrSL(u, d, 18) ^ at.rotrBL(u, d, 41), w = u & f ^ ~u & g, S = d & m ^ ~d & A, T = at.add5L(y, M, S, mR[b], Ms[b]), v = at.add5H(T, p, _, w, gR[b], Is[b]), C = T | 0, F = at.rotrSH(n, s, 28) ^ at.rotrBH(n, s, 34) ^ at.rotrBH(n, s, 39), K = at.rotrSL(n, s, 28) ^ at.rotrBL(n, s, 34) ^ at.rotrBL(n, s, 39), q = n & r ^ n & o ^ r & o, $ = s & a ^ s & c ^ a & c;- p = g | 0, y = A | 0, g = f | 0, A = m | 0, f = u | 0, m = d | 0, { h: u, l: d } = at.add(l | 0, h | 0, v | 0, C | 0), l = o | 0, h = c | 0, o = r | 0, c = a | 0, r = n | 0, a = s | 0;- const D = at.add3L(C, K, $);- n = at.add3H(D, v, F, q), s = D | 0;+ const _ = at.rotrSH(u, d, 14) ^ at.rotrSH(u, d, 18) ^ at.rotrBH(u, d, 41), M = at.rotrSL(u, d, 14) ^ at.rotrSL(u, d, 18) ^ at.rotrBL(u, d, 41), w = u & f ^ ~u & g, S = d & m ^ ~d & A, T = at.add5L(y, M, S, OR[b], Bs[b]), C = at.add5H(T, p, _, w, UR[b], Ms[b]), v = T | 0, F = at.rotrSH(n, s, 28) ^ at.rotrBH(n, s, 34) ^ at.rotrBH(n, s, 39), K = at.rotrSL(n, s, 28) ^ at.rotrBL(n, s, 34) ^ at.rotrBL(n, s, 39), q = n & r ^ n & o ^ r & o, $ = s & a ^ s & c ^ a & c;+ p = g | 0, y = A | 0, g = f | 0, A = m | 0, f = u | 0, m = d | 0, { h: u, l: d } = at.add(l | 0, h | 0, C | 0, v | 0), l = o | 0, h = c | 0, o = r | 0, c = a | 0, r = n | 0, a = s | 0;+ const D = at.add3L(v, K, $);+ n = at.add3H(D, C, F, q), s = D | 0;}({ h: n, l: s } = at.add(this.Ah | 0, this.Al | 0, n | 0, s | 0)), { h: r, l: a } = at.add(this.Bh | 0, this.Bl | 0, r | 0, a | 0), { h: o, l: c } = at.add(this.Ch | 0, this.Cl | 0, o | 0, c | 0), { h: l, l: h } = at.add(this.Dh | 0, this.Dl | 0, l | 0, h | 0), { h: u, l: d } = at.add(this.Eh | 0, this.El | 0, u | 0, d | 0), { h: f, l: m } = at.add(this.Fh | 0, this.Fl | 0, f | 0, m | 0), { h: g, l: A } = at.add(this.Gh | 0, this.Gl | 0, g | 0, A | 0), { h: p, l: y } = at.add(this.Hh | 0, this.Hl | 0, p | 0, y | 0), this.set(n, s, r, a, o, c, l, h, u, d, f, m, g, A, p, y);}roundClean() {- Is.fill(0), Ms.fill(0);+ Ms.fill(0), Bs.fill(0);}destroy() {this.buffer.fill(0), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);}}-const xR = /* @__PURE__ */ kf(() => new bR());-function ER() {+const GR = /* @__PURE__ */ zf(() => new QR());+function HR() {if (typeof self < "u")return self;if (typeof window < "u")@@ -36053,39 +36405,39 @@ function ER() {return global;throw new Error("unable to locate global object");}-const _g = ER();-_g.crypto || _g.msCrypto;-function _R(i) {+const Mg = HR();+Mg.crypto || Mg.msCrypto;+function zR(i) {switch (i) {case "sha256":- return Sb.create();+ return Db.create();case "sha512":- return xR.create();+ return GR.create();}V(!1, "invalid hashing algorithm name", "algorithm", i);}-const [Fb, Db, Lb] = [[], [], []], yR = /* @__PURE__ */ BigInt(0), so = /* @__PURE__ */ BigInt(1), wR = /* @__PURE__ */ BigInt(2), CR = /* @__PURE__ */ BigInt(7), vR = /* @__PURE__ */ BigInt(256), SR = /* @__PURE__ */ BigInt(113);-for (let i = 0, e = so, t = 1, n = 0; i < 24; i++) {- [t, n] = [n, (2 * t + 3 * n) % 5], Fb.push(2 * (5 * n + t)), Db.push((i + 1) * (i + 2) / 2 % 64);- let s = yR;+const [Gb, Hb, zb] = [[], [], []], VR = /* @__PURE__ */ BigInt(0), co = /* @__PURE__ */ BigInt(1), WR = /* @__PURE__ */ BigInt(2), qR = /* @__PURE__ */ BigInt(7), KR = /* @__PURE__ */ BigInt(256), jR = /* @__PURE__ */ BigInt(113);+for (let i = 0, e = co, t = 1, n = 0; i < 24; i++) {+ [t, n] = [n, (2 * t + 3 * n) % 5], Gb.push(2 * (5 * n + t)), Hb.push((i + 1) * (i + 2) / 2 % 64);+ let s = VR;for (let r = 0; r < 7; r++)- e = (e << so ^ (e >> CR) * SR) % vR, e & wR && (s ^= so << (so << /* @__PURE__ */ BigInt(r)) - so);- Lb.push(s);+ e = (e << co ^ (e >> qR) * jR) % KR, e & WR && (s ^= co << (co << /* @__PURE__ */ BigInt(r)) - co);+ zb.push(s);}-const [IR, MR] = /* @__PURE__ */ Mb(Lb, !0), yg = (i, e, t) => t > 32 ? Rb(i, e, t) : Bb(i, e, t), wg = (i, e, t) => t > 32 ? Nb(i, e, t) : Tb(i, e, t);-function BR(i, e = 24) {+const [XR, YR] = /* @__PURE__ */ Pb(zb, !0), Bg = (i, e, t) => t > 32 ? Ob(i, e, t) : kb(i, e, t), Tg = (i, e, t) => t > 32 ? Qb(i, e, t) : Ub(i, e, t);+function JR(i, e = 24) {const t = new Uint32Array(10);for (let n = 24 - e; n < 24; n++) {for (let a = 0; a < 10; a++)t[a] = i[a] ^ i[a + 10] ^ i[a + 20] ^ i[a + 30] ^ i[a + 40];for (let a = 0; a < 10; a += 2) {- const o = (a + 8) % 10, c = (a + 2) % 10, l = t[c], h = t[c + 1], u = yg(l, h, 1) ^ t[o], d = wg(l, h, 1) ^ t[o + 1];+ const o = (a + 8) % 10, c = (a + 2) % 10, l = t[c], h = t[c + 1], u = Bg(l, h, 1) ^ t[o], d = Tg(l, h, 1) ^ t[o + 1];for (let f = 0; f < 50; f += 10)i[a + f] ^= u, i[a + f + 1] ^= d;}let s = i[2], r = i[3];for (let a = 0; a < 24; a++) {- const o = Db[a], c = yg(s, r, o), l = wg(s, r, o), h = Fb[a];+ const o = Hb[a], c = Bg(s, r, o), l = Tg(s, r, o), h = Gb[a];s = i[h], r = i[h + 1], i[h] = c, i[h + 1] = l;}for (let a = 0; a < 50; a += 10) {@@ -36094,24 +36446,24 @@ function BR(i, e = 24) {for (let o = 0; o < 10; o++)i[a + o] ^= ~t[(o + 2) % 10] & t[(o + 4) % 10];}- i[0] ^= IR[n], i[1] ^= MR[n];+ i[0] ^= XR[n], i[1] ^= YR[n];}t.fill(0);}-class Uf extends Pf {+class Vf extends Hf {// NOTE: we accept arguments in bytes instead of bits here.constructor(e, t, n, s = !1, r = 24) {- if (super(), this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, Ml(n), 0 >= this.blockLen || this.blockLen >= 200)+ if (super(), this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = s, this.rounds = r, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, Fl(n), 0 >= this.blockLen || this.blockLen >= 200)throw new Error("Sha3 supports only keccak-f1600 function");- this.state = new Uint8Array(200), this.state32 = VT(this.state);+ this.state = new Uint8Array(200), this.state32 = dR(this.state);}keccak() {- BR(this.state32, this.rounds), this.posOut = 0, this.pos = 0;+ JR(this.state32, this.rounds), this.posOut = 0, this.pos = 0;}update(e) {- va(this);+ Ba(this);const { blockLen: t, state: n } = this;- e = Kl(e);+ e = $l(e);const s = e.length;for (let r = 0; r < s; ) {const a = Math.min(t - this.pos, s - r);@@ -36129,7 +36481,7 @@ class Uf extends Pf {e[n] ^= t, (t & 128) !== 0 && n === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();}writeInto(e) {- va(this, !1), Lf(e), this.finish();+ Ba(this, !1), Gf(e), this.finish();const t = this.state, { blockLen: n } = this;for (let s = 0, r = e.length; s < r; ) {this.posOut >= n && this.keccak();@@ -36144,10 +36496,10 @@ class Uf extends Pf {return this.writeInto(e);}xof(e) {- return Ml(e), this.xofInto(new Uint8Array(e));+ return Fl(e), this.xofInto(new Uint8Array(e));}digestInto(e) {- if (_b(e, this), this.finished)+ if (Bb(e, this), this.finished)throw new Error("digest() was already called");return this.writeInto(e), this.destroy(), e;}@@ -36159,64 +36511,64 @@ class Uf extends Pf {}_cloneInto(e) {const { blockLen: t, suffix: n, outputLen: s, rounds: r, enableXOF: a } = this;- return e || (e = new Uf(t, n, s, a, r)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = n, e.outputLen = s, e.enableXOF = a, e.destroyed = this.destroyed, e;+ return e || (e = new Vf(t, n, s, a, r)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = n, e.outputLen = s, e.enableXOF = a, e.destroyed = this.destroyed, e;}}-const TR = (i, e, t) => kf(() => new Uf(e, i, t)), RR = /* @__PURE__ */ TR(1, 136, 256 / 8);-let Pb = !1;-const kb = function(i) {- return RR(i);+const ZR = (i, e, t) => zf(() => new Vf(e, i, t)), $R = /* @__PURE__ */ ZR(1, 136, 256 / 8);+let Vb = !1;+const Wb = function(i) {+ return $R(i);};-let Ub = kb;+let qb = Wb;function Zt(i) {const e = ht(i, "data");- return Se(Ub(e));+ return Se(qb(e));}-Zt._ = kb;+Zt._ = Wb;Zt.lock = function() {- Pb = !0;+ Vb = !0;};Zt.register = function(i) {- if (Pb)+ if (Vb)throw new TypeError("keccak256 is locked");- Ub = i;+ qb = i;};Object.freeze(Zt);-const Ob = function(i) {- return _R("sha256").update(i).digest();+const Kb = function(i) {+ return zR("sha256").update(i).digest();};-let Qb = Ob, Gb = !1;-function ka(i) {+let jb = Kb, Xb = !1;+function Ga(i) {const e = ht(i, "data");- return Se(Qb(e));+ return Se(jb(e));}-ka._ = Ob;-ka.lock = function() {- Gb = !0;+Ga._ = Kb;+Ga.lock = function() {+ Xb = !0;};-ka.register = function(i) {- if (Gb)+Ga.register = function(i) {+ if (Xb)throw new Error("sha256 is locked");- Qb = i;+ jb = i;};-Object.freeze(ka);-Object.freeze(ka);+Object.freeze(Ga);+Object.freeze(Ga);BigInt(0);-const NR = BigInt(1), FR = BigInt(2), Xl = (i) => i instanceof Uint8Array, DR = /* @__PURE__ */ Array.from({ length: 256 }, (i, e) => e.toString(16).padStart(2, "0"));-function Sa(i) {- if (!Xl(i))+const eN = BigInt(1), tN = BigInt(2), eh = (i) => i instanceof Uint8Array, nN = /* @__PURE__ */ Array.from({ length: 256 }, (i, e) => e.toString(16).padStart(2, "0"));+function Ta(i) {+ if (!eh(i))throw new Error("Uint8Array expected");let e = "";for (let t = 0; t < i.length; t++)- e += DR[i[t]];+ e += nN[i[t]];return e;}-function Of(i) {+function Wf(i) {if (typeof i != "string")throw new Error("hex string expected, got " + typeof i);return BigInt(i === "" ? "0" : `0x${i}`);}-function Do(i) {+function Oo(i) {if (typeof i != "string")throw new Error("hex string expected, got " + typeof i);const e = i.length;@@ -36231,29 +36583,29 @@ function Do(i) {}return t;}-function pr(i) {- return Of(Sa(i));+function gr(i) {+ return Wf(Ta(i));}-function Qf(i) {- if (!Xl(i))+function qf(i) {+ if (!eh(i))throw new Error("Uint8Array expected");- return Of(Sa(Uint8Array.from(i).reverse()));+ return Wf(Ta(Uint8Array.from(i).reverse()));}-function Ia(i, e) {- return Do(i.toString(16).padStart(e * 2, "0"));+function Ra(i, e) {+ return Oo(i.toString(16).padStart(e * 2, "0"));}-function Gf(i, e) {- return Ia(i, e).reverse();+function Kf(i, e) {+ return Ra(i, e).reverse();}-function ui(i, e, t) {+function di(i, e, t) {let n;if (typeof e == "string")try {- n = Do(e);+ n = Oo(e);} catch (r) {throw new Error(`${i} must be valid hex string, got "${e}". Cause: ${r}`);}- else if (Xl(e))+ else if (eh(e))n = Uint8Array.from(e);elsethrow new Error(`${i} must be hex string or Uint8Array`);@@ -36262,28 +36614,28 @@ function ui(i, e, t) {throw new Error(`${i} expected ${t} bytes, got ${s}`);return n;}-function Lo(...i) {+function Qo(...i) {const e = new Uint8Array(i.reduce((n, s) => n + s.length, 0));let t = 0;return i.forEach((n) => {- if (!Xl(n))+ if (!eh(n))throw new Error("Uint8Array expected");e.set(n, t), t += n.length;}), e;}-const Hf = (i) => (FR << BigInt(i - 1)) - NR, du = (i) => new Uint8Array(i), Cg = (i) => Uint8Array.from(i);-function Hb(i, e, t) {+const jf = (i) => (tN << BigInt(i - 1)) - eN, bu = (i) => new Uint8Array(i), Rg = (i) => Uint8Array.from(i);+function Yb(i, e, t) {if (typeof i != "number" || i < 2)throw new Error("hashLen must be a number");if (typeof e != "number" || e < 2)throw new Error("qByteLen must be a number");if (typeof t != "function")throw new Error("hmacFn must be a function");- let n = du(i), s = du(i), r = 0;+ let n = bu(i), s = bu(i), r = 0;const a = () => {n.fill(1), s.fill(0), r = 0;- }, o = (...u) => t(s, n, ...u), c = (u = du()) => {- s = o(Cg([0]), u), n = o(), u.length !== 0 && (s = o(Cg([1]), u), n = o());+ }, o = (...u) => t(s, n, ...u), c = (u = bu()) => {+ s = o(Rg([0]), u), n = o(), u.length !== 0 && (s = o(Rg([1]), u), n = o());}, l = () => {if (r++ >= 1e3)throw new Error("drbg: tried 1000 values");@@ -36294,7 +36646,7 @@ function Hb(i, e, t) {const f = n.slice();d.push(f), u += n.length;}- return Lo(...d);+ return Qo(...d);};return (u, d) => {a(), c(u);@@ -36304,7 +36656,7 @@ function Hb(i, e, t) {return a(), f;};}-const LR = {+const iN = {bigint: (i) => typeof i == "bigint",function: (i) => typeof i == "function",boolean: (i) => typeof i == "boolean",@@ -36315,9 +36667,9 @@ const LR = {field: (i, e) => e.Fp.isValid(i),hash: (i) => typeof i == "function" && Number.isSafeInteger(i.outputLen)};-function jo(i, e, t = {}) {+function tc(i, e, t = {}) {const n = (s, r, a) => {- const o = LR[r];+ const o = iN[r];if (typeof o != "function")throw new Error(`Invalid validator "${r}", expected function`);const c = i[s];@@ -36330,36 +36682,36 @@ function jo(i, e, t = {}) {n(s, r, !0);return i;}-const PR = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({+const sN = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__: null,- bitMask: Hf,- bytesToHex: Sa,- bytesToNumberBE: pr,- bytesToNumberLE: Qf,- concatBytes: Lo,- createHmacDrbg: Hb,- ensureBytes: ui,- hexToBytes: Do,- hexToNumber: Of,- numberToBytesBE: Ia,- numberToBytesLE: Gf,- validateObject: jo+ bitMask: jf,+ bytesToHex: Ta,+ bytesToNumberBE: gr,+ bytesToNumberLE: qf,+ concatBytes: Qo,+ createHmacDrbg: Yb,+ ensureBytes: di,+ hexToBytes: Oo,+ hexToNumber: Wf,+ numberToBytesBE: Ra,+ numberToBytesLE: Kf,+ validateObject: tc}, Symbol.toStringTag, { value: "Module" }));-const mn = BigInt(0), Yt = BigInt(1), ar = BigInt(2), kR = BigInt(3), Rd = BigInt(4), vg = BigInt(5), Sg = BigInt(8);+const mn = BigInt(0), Xt = BigInt(1), cr = BigInt(2), rN = BigInt(3), kd = BigInt(4), Ng = BigInt(5), Fg = BigInt(8);BigInt(9);BigInt(16);function On(i, e) {const t = i % e;return t >= mn ? t : e + t;}-function UR(i, e, t) {+function aN(i, e, t) {if (t <= mn || e < mn)throw new Error("Expected power/modulo > 0");- if (t === Yt)+ if (t === Xt)return mn;- let n = Yt;+ let n = Xt;for (; e > mn; )- e & Yt && (n = n * i % t), i = i * i % t, e >>= Yt;+ e & Xt && (n = n * i % t), i = i * i % t, e >>= Xt;return n;}function Jn(i, e, t) {@@ -36368,27 +36720,27 @@ function Jn(i, e, t) {n *= n, n %= t;return n;}-function Nd(i, e) {+function Ud(i, e) {if (i === mn || e <= mn)throw new Error(`invert: expected positive integers, got n=${i} mod=${e}`);- let t = On(i, e), n = e, s = mn, r = Yt;+ let t = On(i, e), n = e, s = mn, r = Xt;for (; t !== mn; ) {const o = n / t, c = n % t, l = s - r * o;n = t, t = c, s = r, r = l;}- if (n !== Yt)+ if (n !== Xt)throw new Error("invert: does not exist");return On(s, e);}-function OR(i) {- const e = (i - Yt) / ar;+function oN(i) {+ const e = (i - Xt) / cr;let t, n, s;- for (t = i - Yt, n = 0; t % ar === mn; t /= ar, n++)+ for (t = i - Xt, n = 0; t % cr === mn; t /= cr, n++);- for (s = ar; s < i && UR(s, e, i) !== i - Yt; s++)+ for (s = cr; s < i && aN(s, e, i) !== i - Xt; s++);if (n === 1) {- const a = (i + Yt) / Rd;+ const a = (i + Xt) / kd;return function(c, l) {const h = c.pow(l, a);if (!c.eql(c.sqr(h), l))@@ -36396,7 +36748,7 @@ function OR(i) {return h;};}- const r = (t + Yt) / ar;+ const r = (t + Xt) / cr;return function(o, c) {if (o.pow(c, e) === o.neg(o.ONE))throw new Error("Cannot find square root");@@ -36407,15 +36759,15 @@ function OR(i) {let f = 1;for (let g = o.sqr(d); f < l && !o.eql(g, o.ONE); f++)g = o.sqr(g);- const m = o.pow(h, Yt << BigInt(l - f - 1));+ const m = o.pow(h, Xt << BigInt(l - f - 1));h = o.sqr(m), u = o.mul(u, m), d = o.mul(d, h), l = f;}return u;};}-function QR(i) {- if (i % Rd === kR) {- const e = (i + Yt) / Rd;+function cN(i) {+ if (i % kd === rN) {+ const e = (i + Xt) / kd;return function(n, s) {const r = n.pow(s, e);if (!n.eql(n.sqr(r), s))@@ -36423,18 +36775,18 @@ function QR(i) {return r;};}- if (i % Sg === vg) {- const e = (i - vg) / Sg;+ if (i % Fg === Ng) {+ const e = (i - Ng) / Fg;return function(n, s) {- const r = n.mul(s, ar), a = n.pow(r, e), o = n.mul(s, a), c = n.mul(n.mul(o, ar), a), l = n.mul(o, n.sub(c, n.ONE));+ const r = n.mul(s, cr), a = n.pow(r, e), o = n.mul(s, a), c = n.mul(n.mul(o, cr), a), l = n.mul(o, n.sub(c, n.ONE));if (!n.eql(n.sqr(l), s))throw new Error("Cannot find square root");return l;};}- return OR(i);+ return oN(i);}-const GR = [+const lN = ["create","isValid","is0",@@ -36453,48 +36805,48 @@ const GR = ["mulN","sqrN"];-function HR(i) {+function hN(i) {const e = {ORDER: "bigint",MASK: "bigint",BYTES: "isSafeInteger",BITS: "isSafeInteger"- }, t = GR.reduce((n, s) => (n[s] = "function", n), e);- return jo(i, t);+ }, t = lN.reduce((n, s) => (n[s] = "function", n), e);+ return tc(i, t);}-function zR(i, e, t) {+function uN(i, e, t) {if (t < mn)throw new Error("Expected power > 0");if (t === mn)return i.ONE;- if (t === Yt)+ if (t === Xt)return e;let n = i.ONE, s = e;for (; t > mn; )- t & Yt && (n = i.mul(n, s)), s = i.sqr(s), t >>= Yt;+ t & Xt && (n = i.mul(n, s)), s = i.sqr(s), t >>= Xt;return n;}-function VR(i, e) {+function dN(i, e) {const t = new Array(e.length), n = e.reduce((r, a, o) => i.is0(a) ? r : (t[o] = r, i.mul(r, a)), i.ONE), s = i.inv(n);return e.reduceRight((r, a, o) => i.is0(a) ? r : (t[o] = i.mul(r, t[o]), i.mul(r, a)), s), t;}-function zb(i, e) {+function Jb(i, e) {const t = e !== void 0 ? e : i.toString(2).length, n = Math.ceil(t / 8);return { nBitLength: t, nByteLength: n };}-function WR(i, e, t = !1, n = {}) {+function fN(i, e, t = !1, n = {}) {if (i <= mn)throw new Error(`Expected Field ORDER > 0, got ${i}`);- const { nBitLength: s, nByteLength: r } = zb(i, e);+ const { nBitLength: s, nByteLength: r } = Jb(i, e);if (r > 2048)throw new Error("Field lengths over 2048 bytes are not supported");- const a = QR(i), o = Object.freeze({+ const a = cN(i), o = Object.freeze({ORDER: i,BITS: s,BYTES: r,- MASK: Hf(s),+ MASK: jf(s),ZERO: mn,- ONE: Yt,+ ONE: Xt,create: (c) => On(c, i),isValid: (c) => {if (typeof c != "bigint")@@ -36502,54 +36854,54 @@ function WR(i, e, t = !1, n = {}) {return mn <= c && c < i;},is0: (c) => c === mn,- isOdd: (c) => (c & Yt) === Yt,+ isOdd: (c) => (c & Xt) === Xt,neg: (c) => On(-c, i),eql: (c, l) => c === l,sqr: (c) => On(c * c, i),add: (c, l) => On(c + l, i),sub: (c, l) => On(c - l, i),mul: (c, l) => On(c * l, i),- pow: (c, l) => zR(o, c, l),- div: (c, l) => On(c * Nd(l, i), i),+ pow: (c, l) => uN(o, c, l),+ div: (c, l) => On(c * Ud(l, i), i),// Same as above, but doesn't normalizesqrN: (c) => c * c,addN: (c, l) => c + l,subN: (c, l) => c - l,mulN: (c, l) => c * l,- inv: (c) => Nd(c, i),+ inv: (c) => Ud(c, i),sqrt: n.sqrt || ((c) => a(o, c)),- invertBatch: (c) => VR(o, c),+ invertBatch: (c) => dN(o, c),// TODO: do we really need constant cmov?// We don't have const-time bigints anyway, so probably will be not very usefulcmov: (c, l, h) => h ? l : c,- toBytes: (c) => t ? Gf(c, r) : Ia(c, r),+ toBytes: (c) => t ? Kf(c, r) : Ra(c, r),fromBytes: (c) => {if (c.length !== r)throw new Error(`Fp.fromBytes: expected ${r}, got ${c.length}`);- return t ? Qf(c) : pr(c);+ return t ? qf(c) : gr(c);}});return Object.freeze(o);}-function Vb(i) {+function Zb(i) {if (typeof i != "bigint")throw new Error("field order must be bigint");const e = i.toString(2).length;return Math.ceil(e / 8);}-function Wb(i) {- const e = Vb(i);+function $b(i) {+ const e = Zb(i);return e + Math.ceil(e / 2);}-function qR(i, e, t = !1) {- const n = i.length, s = Vb(e), r = Wb(e);+function pN(i, e, t = !1) {+ const n = i.length, s = Zb(e), r = $b(e);if (n < 16 || n < r || n > 1024)throw new Error(`expected ${r}-1024 bytes of input, got ${n}`);- const a = t ? pr(i) : Qf(i), o = On(a, e - Yt) + Yt;- return t ? Gf(o, s) : Ia(o, s);+ const a = t ? gr(i) : qf(i), o = On(a, e - Xt) + Xt;+ return t ? Kf(o, s) : Ra(o, s);}-const KR = BigInt(0), fu = BigInt(1);-function XR(i, e) {+const AN = BigInt(0), xu = BigInt(1);+function gN(i, e) {const t = (s, r) => {const a = r.negate();return s ? a : r;@@ -36562,8 +36914,8 @@ function XR(i, e) {// non-const time multiplication ladderunsafeLadder(s, r) {let a = i.ZERO, o = s;- for (; r > KR; )- r & fu && (a = a.add(o)), o = o.double(), r >>= fu;+ for (; r > AN; )+ r & xu && (a = a.add(o)), o = o.double(), r >>= xu;return a;},/**@@ -36601,7 +36953,7 @@ function XR(i, e) {for (let m = 0; m < o; m++) {const g = m * c;let A = Number(a & u);- a >>= f, A > c && (A -= d, a += fu);+ a >>= f, A > c && (A -= d, a += xu);const p = g, y = g + Math.abs(A) - 1, b = m % 2 !== 0, _ = A < 0;A === 0 ? h = h.add(t(b, r[p])) : l = l.add(t(_, r[y]));}@@ -36614,8 +36966,8 @@ function XR(i, e) {}};}-function qb(i) {- return HR(i.Fp), jo(i, {+function ex(i) {+ return hN(i.Fp), tc(i, {n: "bigint",h: "bigint",Gx: "field",@@ -36624,14 +36976,14 @@ function qb(i) {nBitLength: "isSafeInteger",nByteLength: "isSafeInteger"}), Object.freeze({- ...zb(i.n, i.nBitLength),+ ...Jb(i.n, i.nBitLength),...i,p: i.Fp.ORDER});}-function YR(i) {- const e = qb(i);- jo(e, {+function mN(i) {+ const e = ex(i);+ tc(e, {a: "field",b: "field"}, {@@ -36652,7 +37004,7 @@ function YR(i) {}return Object.freeze({ ...e });}-const { bytesToNumberBE: jR, hexToBytes: JR } = PR, ur = {+const { bytesToNumberBE: bN, hexToBytes: xN } = sN, fr = {// asn.1 DER encoding utilsErr: class extends Error {constructor(e = "") {@@ -36660,7 +37012,7 @@ const { bytesToNumberBE: jR, hexToBytes: JR } = PR, ur = {}},_parseInt(i) {- const { Err: e } = ur;+ const { Err: e } = fr;if (i.length < 2 || i[0] !== 2)throw new e("Invalid signature integer tag");const t = i[1], n = i.subarray(2, t + 2);@@ -36670,10 +37022,10 @@ const { bytesToNumberBE: jR, hexToBytes: JR } = PR, ur = {throw new e("Invalid signature integer: negative");if (n[0] === 0 && !(n[1] & 128))throw new e("Invalid signature integer: unnecessary leading zero");- return { d: jR(n), l: i.subarray(t + 2) };+ return { d: bN(n), l: i.subarray(t + 2) };},toSig(i) {- const { Err: e } = ur, t = typeof i == "string" ? JR(i) : i;+ const { Err: e } = fr, t = typeof i == "string" ? xN(i) : i;if (!(t instanceof Uint8Array))throw new Error("ui8a expected");let n = t.length;@@ -36681,7 +37033,7 @@ const { bytesToNumberBE: jR, hexToBytes: JR } = PR, ur = {throw new e("Invalid signature tag");if (t[1] !== n - 2)throw new e("Invalid signature: incorrect length");- const { d: s, l: r } = ur._parseInt(t.subarray(2)), { d: a, l: o } = ur._parseInt(r);+ const { d: s, l: r } = fr._parseInt(t.subarray(2)), { d: a, l: o } = fr._parseInt(r);if (o.length)throw new e("Invalid signature: left bytes after parsing");return { r: s, s: a };@@ -36693,14 +37045,14 @@ const { bytesToNumberBE: jR, hexToBytes: JR } = PR, ur = {}, n = e(t(i.s)), s = e(t(i.r)), r = n.length / 2, a = s.length / 2, o = t(r), c = t(a);return `30${t(a + r + 4)}02${c}${s}02${o}${n}`;}-}, Zi = BigInt(0), $n = BigInt(1);+}, $i = BigInt(0), $n = BigInt(1);BigInt(2);-const Ig = BigInt(3);+const Dg = BigInt(3);BigInt(4);-function ZR(i) {- const e = YR(i), { Fp: t } = e, n = e.toBytes || ((m, g, A) => {+function EN(i) {+ const e = mN(i), { Fp: t } = e, n = e.toBytes || ((m, g, A) => {const p = g.toAffine();- return Lo(Uint8Array.from([4]), t.toBytes(p.x), t.toBytes(p.y));+ return Qo(Uint8Array.from([4]), t.toBytes(p.x), t.toBytes(p.y));}), s = e.fromBytes || ((m) => {const g = m.subarray(1), A = t.fromBytes(g.subarray(0, t.BYTES)), p = t.fromBytes(g.subarray(t.BYTES, 2 * t.BYTES));return { x: A, y: p };@@ -36712,7 +37064,7 @@ function ZR(i) {if (!t.eql(t.sqr(e.Gy), r(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m) {- return typeof m == "bigint" && Zi < m && m < e.n;+ return typeof m == "bigint" && $i < m && m < e.n;}function o(m) {if (!a(m))@@ -36721,13 +37073,13 @@ function ZR(i) {function c(m) {const { allowedPrivateKeyLengths: g, nByteLength: A, wrapPrivateKey: p, n: y } = e;if (g && typeof m != "bigint") {- if (m instanceof Uint8Array && (m = Sa(m)), typeof m != "string" || !g.includes(m.length))+ if (m instanceof Uint8Array && (m = Ta(m)), typeof m != "string" || !g.includes(m.length))throw new Error("Invalid key");m = m.padStart(A * 2, "0");}let b;try {- b = typeof m == "bigint" ? m : pr(ui("private key", m, A));+ b = typeof m == "bigint" ? m : gr(di("private key", m, A));} catch {throw new Error(`private key must be ${A} bytes, hex or bigint, not ${typeof m}`);}@@ -36779,7 +37131,7 @@ function ZR(i) {* @param hex short/long ECDSA hex*/static fromHex(g) {- const A = u.fromAffine(s(ui("pointHex", g)));+ const A = u.fromAffine(s(di("pointHex", g)));return A.assertValidity(), A;}// Multiplies generator point by privateKey.@@ -36831,9 +37183,9 @@ function ZR(i) {// https://eprint.iacr.org/2015/1060, algorithm 3// Cost: 8M + 3S + 3*a + 2*b3 + 15add.double() {- const { a: g, b: A } = e, p = t.mul(A, Ig), { px: y, py: b, pz: _ } = this;- let M = t.ZERO, w = t.ZERO, S = t.ZERO, T = t.mul(y, y), v = t.mul(b, b), C = t.mul(_, _), F = t.mul(y, b);- return F = t.add(F, F), S = t.mul(y, _), S = t.add(S, S), M = t.mul(g, S), w = t.mul(p, C), w = t.add(M, w), M = t.sub(v, w), w = t.add(v, w), w = t.mul(M, w), M = t.mul(F, M), S = t.mul(p, S), C = t.mul(g, C), F = t.sub(T, C), F = t.mul(g, F), F = t.add(F, S), S = t.add(T, T), T = t.add(S, T), T = t.add(T, C), T = t.mul(T, F), w = t.add(w, T), C = t.mul(b, _), C = t.add(C, C), T = t.mul(C, F), M = t.sub(M, T), S = t.mul(C, v), S = t.add(S, S), S = t.add(S, S), new u(M, w, S);+ const { a: g, b: A } = e, p = t.mul(A, Dg), { px: y, py: b, pz: _ } = this;+ let M = t.ZERO, w = t.ZERO, S = t.ZERO, T = t.mul(y, y), C = t.mul(b, b), v = t.mul(_, _), F = t.mul(y, b);+ return F = t.add(F, F), S = t.mul(y, _), S = t.add(S, S), M = t.mul(g, S), w = t.mul(p, v), w = t.add(M, w), M = t.sub(C, w), w = t.add(C, w), w = t.mul(M, w), M = t.mul(F, M), S = t.mul(p, S), v = t.mul(g, v), F = t.sub(T, v), F = t.mul(g, F), F = t.add(F, S), S = t.add(T, T), T = t.add(S, T), T = t.add(T, v), T = t.mul(T, F), w = t.add(w, T), v = t.mul(b, _), v = t.add(v, v), T = t.mul(v, F), M = t.sub(M, T), S = t.mul(v, C), S = t.add(S, S), S = t.add(S, S), new u(M, w, S);}// Renes-Costello-Batina exception-free addition formula.// There is 30% faster Jacobian formula, but it is not complete.@@ -36843,11 +37195,11 @@ function ZR(i) {h(g);const { px: A, py: p, pz: y } = this, { px: b, py: _, pz: M } = g;let w = t.ZERO, S = t.ZERO, T = t.ZERO;- const v = e.a, C = t.mul(e.b, Ig);+ const C = e.a, v = t.mul(e.b, Dg);let F = t.mul(A, b), K = t.mul(p, _), q = t.mul(y, M), $ = t.add(A, p), D = t.add(b, _);$ = t.mul($, D), D = t.add(F, K), $ = t.sub($, D), D = t.add(A, y);let O = t.add(b, M);- return D = t.mul(D, O), O = t.add(F, q), D = t.sub(D, O), O = t.add(p, y), w = t.add(_, M), O = t.mul(O, w), w = t.add(K, q), O = t.sub(O, w), T = t.mul(v, D), w = t.mul(C, q), T = t.add(w, T), w = t.sub(K, T), T = t.add(K, T), S = t.mul(w, T), K = t.add(F, F), K = t.add(K, F), q = t.mul(v, q), D = t.mul(C, D), K = t.add(K, q), q = t.sub(F, q), q = t.mul(v, q), D = t.add(D, q), F = t.mul(K, D), S = t.add(S, F), F = t.mul(O, D), w = t.mul($, w), w = t.sub(w, F), F = t.mul($, K), T = t.mul(O, T), T = t.add(T, F), new u(w, S, T);+ return D = t.mul(D, O), O = t.add(F, q), D = t.sub(D, O), O = t.add(p, y), w = t.add(_, M), O = t.mul(O, w), w = t.add(K, q), O = t.sub(O, w), T = t.mul(C, D), w = t.mul(v, q), T = t.add(w, T), w = t.sub(K, T), T = t.add(K, T), S = t.mul(w, T), K = t.add(F, F), K = t.add(K, F), q = t.mul(C, q), D = t.mul(v, D), K = t.add(K, q), q = t.sub(F, q), q = t.mul(C, q), D = t.add(D, q), F = t.mul(K, D), S = t.add(S, F), F = t.mul(O, D), w = t.mul($, w), w = t.sub(w, F), F = t.mul($, K), T = t.mul(O, T), T = t.add(T, F), new u(w, S, T);}subtract(g) {return this.add(g.negate());@@ -36868,7 +37220,7 @@ function ZR(i) {*/multiplyUnsafe(g) {const A = u.ZERO;- if (g === Zi)+ if (g === $i)return A;if (o(g), g === $n)return this;@@ -36876,7 +37228,7 @@ function ZR(i) {if (!p)return f.unsafeLadder(this, g);let { k1neg: y, k1: b, k2neg: _, k2: M } = p.splitScalar(g), w = A, S = A, T = this;- for (; b > Zi || M > Zi; )+ for (; b > $i || M > $i; )b & $n && (w = w.add(T)), M & $n && (S = S.add(T)), T = T.double(), b >>= $n, M >>= $n;return y && (w = w.negate()), _ && (S = S.negate()), S = new u(t.mul(S.px, p.beta), S.py, S.pz), w.add(S);}@@ -36895,8 +37247,8 @@ function ZR(i) {const { endo: b } = e;if (b) {const { k1neg: _, k1: M, k2neg: w, k2: S } = b.splitScalar(A);- let { p: T, f: v } = this.wNAF(M), { p: C, f: F } = this.wNAF(S);- T = f.constTimeNegate(_, T), C = f.constTimeNegate(w, C), C = new u(t.mul(C.px, b.beta), C.py, C.pz), p = T.add(C), y = v.add(F);+ let { p: T, f: C } = this.wNAF(M), { p: v, f: F } = this.wNAF(S);+ T = f.constTimeNegate(_, T), v = f.constTimeNegate(w, v), v = new u(t.mul(v.px, b.beta), v.py, v.pz), p = T.add(v), y = C.add(F);} else {const { p: _, f: M } = this.wNAF(A);p = _, y = M;@@ -36910,7 +37262,7 @@ function ZR(i) {* @returns non-zero affine point*/multiplyAndAddUnsafe(g, A, p) {- const y = u.BASE, b = (M, w) => w === Zi || w === $n || !M.equals(y) ? M.multiplyUnsafe(w) : M.multiply(w), _ = b(this, A).add(b(g, p));+ const y = u.BASE, b = (M, w) => w === $i || w === $n || !M.equals(y) ? M.multiplyUnsafe(w) : M.multiply(w), _ = b(this, A).add(b(g, p));return _.is0() ? void 0 : _;}// Converts Projective point to affine (x, y) coordinates.@@ -36942,11 +37294,11 @@ function ZR(i) {return this.assertValidity(), n(u, this, g);}toHex(g = !0) {- return Sa(this.toRawBytes(g));+ return Ta(this.toRawBytes(g));}}u.BASE = new u(e.Gx, e.Gy, t.ONE), u.ZERO = new u(t.ZERO, t.ONE, t.ZERO);- const d = e.nBitLength, f = XR(u, e.endo ? Math.ceil(d / 2) : d);+ const d = e.nBitLength, f = gN(u, e.endo ? Math.ceil(d / 2) : d);return {CURVE: e,ProjectivePoint: u,@@ -36955,9 +37307,9 @@ function ZR(i) {isWithinCurveOrder: a};}-function $R(i) {- const e = qb(i);- return jo(e, {+function _N(i) {+ const e = ex(i);+ return tc(e, {hash: "hash",hmac: "function",randomBytes: "function"@@ -36967,40 +37319,40 @@ function $R(i) {lowS: "boolean"}), Object.freeze({ lowS: !0, ...e });}-function eN(i) {- const e = $R(i), { Fp: t, n } = e, s = t.BYTES + 1, r = 2 * t.BYTES + 1;+function yN(i) {+ const e = _N(i), { Fp: t, n } = e, s = t.BYTES + 1, r = 2 * t.BYTES + 1;function a(D) {- return Zi < D && D < t.ORDER;+ return $i < D && D < t.ORDER;}function o(D) {return On(D, n);}function c(D) {- return Nd(D, n);+ return Ud(D, n);}- const { ProjectivePoint: l, normPrivateKeyToScalar: h, weierstrassEquation: u, isWithinCurveOrder: d } = ZR({+ const { ProjectivePoint: l, normPrivateKeyToScalar: h, weierstrassEquation: u, isWithinCurveOrder: d } = EN({...e,- toBytes(D, O, j) {- const Q = O.toAffine(), J = t.toBytes(Q.x), ee = Lo;- return j ? ee(Uint8Array.from([O.hasEvenY() ? 2 : 3]), J) : ee(Uint8Array.from([4]), J, t.toBytes(Q.y));+ toBytes(D, O, Y) {+ const Q = O.toAffine(), J = t.toBytes(Q.x), ee = Qo;+ return Y ? ee(Uint8Array.from([O.hasEvenY() ? 2 : 3]), J) : ee(Uint8Array.from([4]), J, t.toBytes(Q.y));},fromBytes(D) {- const O = D.length, j = D[0], Q = D.subarray(1);- if (O === s && (j === 2 || j === 3)) {- const J = pr(Q);+ const O = D.length, Y = D[0], Q = D.subarray(1);+ if (O === s && (Y === 2 || Y === 3)) {+ const J = gr(Q);if (!a(J))throw new Error("Point is not on curve");const ee = u(J);let ae = t.sqrt(ee);const ye = (ae & $n) === $n;- return (j & 1) === 1 !== ye && (ae = t.neg(ae)), { x: J, y: ae };- } else if (O === r && j === 4) {+ return (Y & 1) === 1 !== ye && (ae = t.neg(ae)), { x: J, y: ae };+ } else if (O === r && Y === 4) {const J = t.fromBytes(Q.subarray(0, t.BYTES)), ee = t.fromBytes(Q.subarray(t.BYTES, 2 * t.BYTES));return { x: J, y: ee };} elsethrow new Error(`Point of length ${O} was invalid. Expected ${s} compressed bytes or ${r} uncompressed bytes`);}- }), f = (D) => Sa(Ia(D, e.nByteLength));+ }), f = (D) => Ta(Ra(D, e.nByteLength));function m(D) {const O = n >> $n;return D > O;@@ -37008,21 +37360,21 @@ function eN(i) {function g(D) {return m(D) ? o(-D) : D;}- const A = (D, O, j) => pr(D.slice(O, j));+ const A = (D, O, Y) => gr(D.slice(O, Y));class p {- constructor(O, j, Q) {- this.r = O, this.s = j, this.recovery = Q, this.assertValidity();+ constructor(O, Y, Q) {+ this.r = O, this.s = Y, this.recovery = Q, this.assertValidity();}// pair (bytes of r, bytes of s)static fromCompact(O) {- const j = e.nByteLength;- return O = ui("compactSignature", O, j * 2), new p(A(O, 0, j), A(O, j, 2 * j));+ const Y = e.nByteLength;+ return O = di("compactSignature", O, Y * 2), new p(A(O, 0, Y), A(O, Y, 2 * Y));}// DER encoded ECDSA signature// https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-scriptstatic fromDER(O) {- const { r: j, s: Q } = ur.toSig(ui("DER", O));- return new p(j, Q);+ const { r: Y, s: Q } = fr.toSig(di("DER", O));+ return new p(Y, Q);}assertValidity() {if (!d(this.r))@@ -37034,10 +37386,10 @@ function eN(i) {return new p(this.r, this.s, O);}recoverPublicKey(O) {- const { r: j, s: Q, recovery: J } = this, ee = S(ui("msgHash", O));+ const { r: Y, s: Q, recovery: J } = this, ee = S(di("msgHash", O));if (J == null || ![0, 1, 2, 3].includes(J))throw new Error("recovery id invalid");- const ae = J === 2 || J === 3 ? j + e.n : j;+ const ae = J === 2 || J === 3 ? Y + e.n : Y;if (ae >= t.ORDER)throw new Error("recovery id 2 or 3 invalid");const ye = (J & 1) === 0 ? "02" : "03", Me = l.fromHex(ye + f(ae)), se = c(ae), me = o(-ee * se), be = o(Q * se), xe = l.BASE.multiplyAndAddUnsafe(Me, me, be);@@ -37054,14 +37406,14 @@ function eN(i) {}// DER-encodedtoDERRawBytes() {- return Do(this.toDERHex());+ return Oo(this.toDERHex());}toDERHex() {- return ur.hexFromSig({ r: this.r, s: this.s });+ return fr.hexFromSig({ r: this.r, s: this.s });}// padded bytes of r, then padded bytes of stoCompactRawBytes() {- return Do(this.toCompactHex());+ return Oo(this.toCompactHex());}toCompactHex() {return f(this.r) + f(this.s);@@ -37081,8 +37433,8 @@ function eN(i) {* (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.*/randomPrivateKey: () => {- const D = Wb(e.n);- return qR(e.randomBytes(D), e.n);+ const D = $b(e.n);+ return pN(e.randomBytes(D), e.n);},/*** Creates precompute table for an arbitrary EC point. Makes point "cached".@@ -37100,50 +37452,50 @@ function eN(i) {return l.fromPrivateKey(D).toRawBytes(O);}function _(D) {- const O = D instanceof Uint8Array, j = typeof D == "string", Q = (O || j) && D.length;- return O ? Q === s || Q === r : j ? Q === 2 * s || Q === 2 * r : D instanceof l;+ const O = D instanceof Uint8Array, Y = typeof D == "string", Q = (O || Y) && D.length;+ return O ? Q === s || Q === r : Y ? Q === 2 * s || Q === 2 * r : D instanceof l;}- function M(D, O, j = !0) {+ function M(D, O, Y = !0) {if (_(D))throw new Error("first arg must be private key");if (!_(O))throw new Error("second arg must be public key");- return l.fromHex(O).multiply(h(D)).toRawBytes(j);+ return l.fromHex(O).multiply(h(D)).toRawBytes(Y);}const w = e.bits2int || function(D) {- const O = pr(D), j = D.length * 8 - e.nBitLength;- return j > 0 ? O >> BigInt(j) : O;+ const O = gr(D), Y = D.length * 8 - e.nBitLength;+ return Y > 0 ? O >> BigInt(Y) : O;}, S = e.bits2int_modN || function(D) {return o(w(D));- }, T = Hf(e.nBitLength);- function v(D) {+ }, T = jf(e.nBitLength);+ function C(D) {if (typeof D != "bigint")throw new Error("bigint expected");- if (!(Zi <= D && D < T))+ if (!($i <= D && D < T))throw new Error(`bigint expected < 2^${e.nBitLength}`);- return Ia(D, e.nByteLength);+ return Ra(D, e.nByteLength);}- function C(D, O, j = F) {- if (["recovered", "canonical"].some(($e) => $e in j))+ function v(D, O, Y = F) {+ if (["recovered", "canonical"].some(($e) => $e in Y))throw new Error("sign() legacy options not supported");const { hash: Q, randomBytes: J } = e;- let { lowS: ee, prehash: ae, extraEntropy: ye } = j;- ee == null && (ee = !0), D = ui("msgHash", D), ae && (D = ui("prehashed msgHash", Q(D)));- const Me = S(D), se = h(O), me = [v(se), v(Me)];+ let { lowS: ee, prehash: ae, extraEntropy: ye } = Y;+ ee == null && (ee = !0), D = di("msgHash", D), ae && (D = di("prehashed msgHash", Q(D)));+ const Me = S(D), se = h(O), me = [C(se), C(Me)];if (ye != null) {const $e = ye === !0 ? J(t.BYTES) : ye;- me.push(ui("extraEntropy", $e));+ me.push(di("extraEntropy", $e));}- const be = Lo(...me), xe = Me;+ const be = Qo(...me), xe = Me;function Pe($e) {const Qe = w($e);if (!d(Qe))return;- const Ct = c(Qe), lt = l.BASE.multiply(Qe).toAffine(), Je = o(lt.x);- if (Je === Zi)+ const vt = c(Qe), lt = l.BASE.multiply(Qe).toAffine(), Je = o(lt.x);+ if (Je === $i)return;- const G = o(Ct * o(xe + Je * se));- if (G === Zi)+ const G = o(vt * o(xe + Je * se));+ if (G === $i)return;let dn = (lt.x === Je ? 0 : 2) | Number(lt.y & $n), dt = G;return ee && m(G) && (dt = g(G), dn ^= 1), new p(Je, dt, dn);@@ -37151,14 +37503,14 @@ function eN(i) {return { seed: be, k2sig: Pe };}const F = { lowS: e.lowS, prehash: !1 }, K = { lowS: e.lowS, prehash: !1 };- function q(D, O, j = F) {- const { seed: Q, k2sig: J } = C(D, O, j), ee = e;- return Hb(ee.hash.outputLen, ee.nByteLength, ee.hmac)(Q, J);+ function q(D, O, Y = F) {+ const { seed: Q, k2sig: J } = v(D, O, Y), ee = e;+ return Yb(ee.hash.outputLen, ee.nByteLength, ee.hmac)(Q, J);}l.BASE._setWindowSize(8);- function $(D, O, j, Q = K) {+ function $(D, O, Y, Q = K) {const J = D;- if (O = ui("msgHash", O), j = ui("publicKey", j), "strict" in Q)+ if (O = di("msgHash", O), Y = di("publicKey", Y), "strict" in Q)throw new Error("options.strict was renamed to lowS");const { lowS: ee, prehash: ae } = Q;let ye, Me;@@ -37167,7 +37519,7 @@ function eN(i) {try {ye = p.fromDER(J);} catch (lt) {- if (!(lt instanceof ur.Err))+ if (!(lt instanceof fr.Err))throw lt;ye = p.fromCompact(J);}@@ -37176,7 +37528,7 @@ function eN(i) {ye = new p(lt, Je);} elsethrow new Error("PARSE");- Me = l.fromHex(j);+ Me = l.fromHex(Y);} catch (lt) {if (lt.message === "PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");@@ -37199,29 +37551,29 @@ function eN(i) {utils: y};}-function tN(i) {+function wN(i) {return {hash: i,- hmac: (e, ...t) => Cb(i, e, KT(...t)),- randomBytes: XT+ hmac: (e, ...t) => Nb(i, e, AR(...t)),+ randomBytes: gR};}-function nN(i, e) {- const t = (n) => eN({ ...i, ...tN(n) });+function vN(i, e) {+ const t = (n) => yN({ ...i, ...wN(n) });return Object.freeze({ ...t(e), create: t });}-const Kb = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), Mg = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), iN = BigInt(1), Fd = BigInt(2), Bg = (i, e) => (i + e / Fd) / e;-function sN(i) {- const e = Kb, t = BigInt(3), n = BigInt(6), s = BigInt(11), r = BigInt(22), a = BigInt(23), o = BigInt(44), c = BigInt(88), l = i * i * i % e, h = l * l * i % e, u = Jn(h, t, e) * h % e, d = Jn(u, t, e) * h % e, f = Jn(d, Fd, e) * l % e, m = Jn(f, s, e) * f % e, g = Jn(m, r, e) * m % e, A = Jn(g, o, e) * g % e, p = Jn(A, c, e) * A % e, y = Jn(p, o, e) * g % e, b = Jn(y, t, e) * h % e, _ = Jn(b, a, e) * m % e, M = Jn(_, n, e) * l % e, w = Jn(M, Fd, e);- if (!Dd.eql(Dd.sqr(w), i))+const tx = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), Lg = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), CN = BigInt(1), Od = BigInt(2), Pg = (i, e) => (i + e / Od) / e;+function SN(i) {+ const e = tx, t = BigInt(3), n = BigInt(6), s = BigInt(11), r = BigInt(22), a = BigInt(23), o = BigInt(44), c = BigInt(88), l = i * i * i % e, h = l * l * i % e, u = Jn(h, t, e) * h % e, d = Jn(u, t, e) * h % e, f = Jn(d, Od, e) * l % e, m = Jn(f, s, e) * f % e, g = Jn(m, r, e) * m % e, A = Jn(g, o, e) * g % e, p = Jn(A, c, e) * A % e, y = Jn(p, o, e) * g % e, b = Jn(y, t, e) * h % e, _ = Jn(b, a, e) * m % e, M = Jn(_, n, e) * l % e, w = Jn(M, Od, e);+ if (!Qd.eql(Qd.sqr(w), i))throw new Error("Cannot find square root");return w;}-const Dd = WR(Kb, void 0, void 0, { sqrt: sN }), Bs = nN({+const Qd = fN(tx, void 0, void 0, { sqrt: SN }), Ts = vN({a: BigInt(0),b: BigInt(7),- Fp: Dd,- n: Mg,+ Fp: Qd,+ n: Lg,// Base point (x, y) aka generator pointGx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),@@ -37236,7 +37588,7 @@ const Dd = WR(Kb, void 0, void 0, { sqrt: sN }), Bs = nN({endo: {beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar: (i) => {- const e = Mg, t = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), n = -iN * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), s = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), r = t, a = BigInt("0x100000000000000000000000000000000"), o = Bg(r * i, e), c = Bg(-n * i, e);+ const e = Lg, t = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), n = -CN * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), s = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), r = t, a = BigInt("0x100000000000000000000000000000000"), o = Pg(r * i, e), c = Pg(-n * i, e);let l = On(i - o * t - c * s, e), h = On(-o * n - c * r, e);const u = l > a, d = h > a;if (u && (l = e - l), d && (h = e - h), l > a || h > a)@@ -37244,12 +37596,12 @@ const Dd = WR(Kb, void 0, void 0, { sqrt: sN }), Bs = nN({return { k1neg: u, k1: l, k2neg: d, k2: h };}}-}, Sb);+}, Db);BigInt(0);-Bs.ProjectivePoint;-const Po = "0x0000000000000000000000000000000000000000", Tg = "0x0000000000000000000000000000000000000000000000000000000000000000", Rg = BigInt(0), Ng = BigInt(1), Ld = BigInt(2), Fg = BigInt(27), Dg = BigInt(28), Yc = BigInt(35), Xb = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), rN = Xb / Ld, aN = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), Zs = {};-function pu(i) {- return us($t(i), 32);+Ts.ProjectivePoint;+const Go = "0x0000000000000000000000000000000000000000", kg = "0x0000000000000000000000000000000000000000000000000000000000000000", Ug = BigInt(0), Og = BigInt(1), Gd = BigInt(2), Qg = BigInt(27), Gg = BigInt(28), el = BigInt(35), nx = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), IN = nx / Gd, MN = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), er = {};+function Eu(i) {+ return ds($t(i), 32);}class Gt {#e;@@ -37266,7 +37618,7 @@ class Gt {return this.#e;}set r(e) {- V(da(e) === 32, "invalid r", "value", e), this.#e = Se(e);+ V(ga(e) === 32, "invalid r", "value", e), this.#e = Se(e);}/*** The ``s`` value for a signature.@@ -37275,7 +37627,7 @@ class Gt {return V(parseInt(this.#t.substring(0, 3)) < 8, "non-canonical s; use ._s", "s", this.#t), this.#t;}set s(e) {- V(da(e) === 32, "invalid s", "value", e), this.#t = Se(e);+ V(ga(e) === 32, "invalid s", "value", e), this.#t = Se(e);}/*** Return the s value, unchecked for EIP-2 compliance.@@ -37292,7 +37644,7 @@ class Gt {* Returns true if the Signature is valid for [[link-eip-2]] signatures.*/isValid() {- return BigInt(this.#t) <= rN;+ return BigInt(this.#t) <= IN;}/*** The ``v`` value for a signature.@@ -37358,7 +37710,7 @@ class Gt {* @private*/constructor(e, t, n, s) {- Wl(e, Zs, "Signature"), this.#e = t, this.#t = n, this.#n = s, this.#i = null;+ Jl(e, er, "Signature"), this.#e = t, this.#t = n, this.#n = s, this.#i = null;}/*** Returns the canonical signature.@@ -37370,14 +37722,14 @@ class Gt {getCanonical() {if (this.isValid())return this;- const e = Xb - BigInt(this._s), t = 55 - this.v, n = new Gt(Zs, this.r, pu(e), t);+ const e = nx - BigInt(this._s), t = 55 - this.v, n = new Gt(er, this.r, Eu(e), t);return this.networkV && (n.#i = this.networkV), n;}/*** Returns a new identical [[Signature]].*/clone() {- const e = new Gt(Zs, this.r, this._s, this.v);+ const e = new Gt(er, this.r, this._s, this.v);return this.networkV && (e.#i = this.networkV), e;}/**@@ -37393,7 +37745,7 @@ class Gt {v: this.v};}- [aN]() {+ [MN]() {return this.toString();}toString() {@@ -37411,7 +37763,7 @@ class Gt {*/static getChainId(e) {const t = Fe(e, "v");- return t == Fg || t == Dg ? Rg : (V(t >= Yc, "invalid EIP-155 v", "v", e), (t - Yc) / Ld);+ return t == Qg || t == Gg ? Ug : (V(t >= el, "invalid EIP-155 v", "v", e), (t - el) / Gd);}/*** Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.@@ -37428,7 +37780,7 @@ class Gt {**/static getChainIdV(e, t) {- return Fe(e) * Ld + BigInt(35 + t - 27);+ return Fe(e) * Gd + BigInt(35 + t - 27);}/*** Compute the normalized legacy transaction ``v`` from a ``yParirty``,@@ -37453,7 +37805,7 @@ class Gt {*/static getNormalizedV(e) {const t = Fe(e);- return t === Rg || t === Fg ? 27 : t === Ng || t === Dg ? 28 : (V(t >= Yc, "invalid v", "v", e), t & Ng ? 27 : 28);+ return t === Ug || t === Qg ? 27 : t === Og || t === Gg ? 28 : (V(t >= el, "invalid v", "v", e), t & Og ? 27 : 28);}/*** Creates a new [[Signature]].@@ -37468,16 +37820,16 @@ class Gt {V(l, h, "signature", e);}if (e == null)- return new Gt(Zs, Tg, Tg, 27);+ return new Gt(er, kg, kg, 27);if (typeof e == "string") {const l = ht(e, "signature");if (l.length === 64) {const h = Se(l.slice(0, 32)), u = l.slice(32, 64), d = u[0] & 128 ? 28 : 27;- return u[0] &= 127, new Gt(Zs, h, Se(u), d);+ return u[0] &= 127, new Gt(er, h, Se(u), d);}if (l.length === 65) {const h = Se(l.slice(0, 32)), u = Se(l.slice(32, 64)), d = Gt.getNormalizedV(l[64]);- return new Gt(Zs, h, u, d);+ return new Gt(er, h, u, d);}t(!1, "invalid raw signature length");}@@ -37485,9 +37837,9 @@ class Gt {return e.clone();const n = e.r;t(n != null, "missing r");- const s = pu(n), r = (function(l, h) {+ const s = Eu(n), r = (function(l, h) {if (l != null)- return pu(l);+ return Eu(l);if (h != null) {t(Lt(h, 32), "invalid yParityAndS");const u = ht(h);@@ -37498,7 +37850,7 @@ class Gt {if (l != null) {const d = Fe(l);return {- networkV: d >= Yc ? d : void 0,+ networkV: d >= el ? d : void 0,v: Gt.getNormalizedV(d)};}@@ -37514,17 +37866,17 @@ class Gt {t(!1, "invalid yParity");}t(!1, "missing v");- })(e.v, e.yParityAndS, e.yParity), c = new Gt(Zs, s, r, o);+ })(e.v, e.yParityAndS, e.yParity), c = new Gt(er, s, r, o);return a && (c.#i = a), t(e.yParity == null || ut(e.yParity, "sig.yParity") === c.yParity, "yParity mismatch"), t(e.yParityAndS == null || e.yParityAndS === c.yParityAndS, "yParityAndS mismatch"), c;}}-class $i {+class es {#e;/*** Creates a new **SigningKey** for %%privateKey%%.*/constructor(e) {- V(da(e) === 32, "invalid private key", "privateKey", "[REDACTED]"), this.#e = Se(e);+ V(ga(e) === 32, "invalid private key", "privateKey", "[REDACTED]"), this.#e = Se(e);}/*** The private key.@@ -37539,7 +37891,7 @@ class $i {* characters long (the ``0x`` prefix and 130 hexadecimal nibbles).*/get publicKey() {- return $i.computePublicKey(this.#e);+ return es.computePublicKey(this.#e);}/*** The compressed public key.@@ -37549,19 +37901,19 @@ class $i {* nibbles)*/get compressedPublicKey() {- return $i.computePublicKey(this.#e, !0);+ return es.computePublicKey(this.#e, !0);}/*** Return the signature of the signed %%digest%%.*/sign(e) {- V(da(e) === 32, "invalid digest length", "digest", e);- const t = Bs.sign(Tn(e), Tn(this.#e), {+ V(ga(e) === 32, "invalid digest length", "digest", e);+ const t = Ts.sign(Tn(e), Tn(this.#e), {lowS: !0});return Gt.from({- r: Os(t.r, 32),- s: Os(t.s, 32),+ r: Gs(t.r, 32),+ s: Gs(t.s, 32),v: t.recovery ? 28 : 27});}@@ -37588,8 +37940,8 @@ class $i {* //_result:*/computeSharedSecret(e) {- const t = $i.computePublicKey(e);- return Se(Bs.getSharedSecret(Tn(this.#e), ht(t), !1));+ const t = es.computePublicKey(e);+ return Se(Ts.getSharedSecret(Tn(this.#e), ht(t), !1));}/*** Compute the public key for %%key%%, optionally %%compressed%%.@@ -37619,14 +37971,14 @@ class $i {static computePublicKey(e, t) {let n = ht(e, "key");if (n.length === 32) {- const r = Bs.getPublicKey(n, !!t);+ const r = Ts.getPublicKey(n, !!t);return Se(r);}if (n.length === 64) {const r = new Uint8Array(65);r[0] = 4, r.set(n, 1), n = r;}- const s = Bs.ProjectivePoint.fromHex(n);+ const s = Ts.ProjectivePoint.fromHex(n);return Se(s.toRawBytes(t));}/**@@ -37648,9 +38000,9 @@ class $i {**/static recoverPublicKey(e, t) {- V(da(e) === 32, "invalid digest length", "digest", e);+ V(ga(e) === 32, "invalid digest length", "digest", e);const n = Gt.from(t);- let s = Bs.Signature.fromCompact(Tn(Ot([n.r, n.s])));+ let s = Ts.Signature.fromCompact(Tn(Ot([n.r, n.s])));s = s.addRecoveryBit(n.yParity);const r = s.recoverPublicKey(Tn(e));return V(r != null, "invalid signature for digest", "signature", t), "0x" + r.toHex(!1);@@ -37666,12 +38018,12 @@ class $i {* addresses from parent public keys and chain codes.*/static addPoints(e, t, n) {- const s = Bs.ProjectivePoint.fromHex($i.computePublicKey(e).substring(2)), r = Bs.ProjectivePoint.fromHex($i.computePublicKey(t).substring(2));+ const s = Ts.ProjectivePoint.fromHex(es.computePublicKey(e).substring(2)), r = Ts.ProjectivePoint.fromHex(es.computePublicKey(t).substring(2));return "0x" + s.add(r).toHex(!!n);}}-const oN = BigInt(0), cN = BigInt(36);-function Lg(i) {+const BN = BigInt(0), TN = BigInt(36);+function Hg(i) {i = i.toLowerCase();const e = i.substring(2).split(""), t = new Uint8Array(40);for (let s = 0; s < 40; s++)@@ -37681,17 +38033,17 @@ function Lg(i) {n[s >> 1] >> 4 >= 8 && (e[s] = e[s].toUpperCase()), (n[s >> 1] & 15) >= 8 && (e[s + 1] = e[s + 1].toUpperCase());return "0x" + e.join("");}-const zf = {};+const Xf = {};for (let i = 0; i < 10; i++)- zf[String(i)] = String(i);+ Xf[String(i)] = String(i);for (let i = 0; i < 26; i++)- zf[String.fromCharCode(65 + i)] = String(10 + i);-const Pg = 15;-function lN(i) {+ Xf[String.fromCharCode(65 + i)] = String(10 + i);+const zg = 15;+function RN(i) {i = i.toUpperCase(), i = i.substring(4) + i.substring(0, 2) + "00";- let e = i.split("").map((n) => zf[n]).join("");- for (; e.length >= Pg; ) {- let n = e.substring(0, Pg);+ let e = i.split("").map((n) => Xf[n]).join("");+ for (; e.length >= zg; ) {+ let n = e.substring(0, zg);e = parseInt(n, 10) % 97 + e.substring(n.length);}let t = String(98 - parseInt(e, 10) % 97);@@ -37699,7 +38051,7 @@ function lN(i) {t = "0" + t;return t;}-const hN = (function() {+const NN = (function() {const i = {};for (let e = 0; e < 36; e++) {const t = "0123456789abcdefghijklmnopqrstuvwxyz"[e];@@ -37707,47 +38059,47 @@ const hN = (function() {}return i;})();-function uN(i) {+function FN(i) {i = i.toLowerCase();- let e = oN;+ let e = BN;for (let t = 0; t < i.length; t++)- e = e * cN + hN[i[t]];+ e = e * TN + NN[i[t]];return e;}function St(i) {if (V(typeof i == "string", "invalid address", "address", i), i.match(/^(0x)?[0-9a-fA-F]{40}$/)) {i.startsWith("0x") || (i = "0x" + i);- const e = Lg(i);+ const e = Hg(i);return V(!i.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || e === i, "bad address checksum", "address", i), e;}if (i.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {- V(i.substring(2, 4) === lN(i), "bad icap checksum", "address", i);- let e = uN(i.substring(4)).toString(16);+ V(i.substring(2, 4) === RN(i), "bad icap checksum", "address", i);+ let e = FN(i.substring(4)).toString(16);for (; e.length < 40; )e = "0" + e;- return Lg("0x" + e);+ return Hg("0x" + e);}V(!1, "invalid address", "address", i);}-function dN(i) {+function DN(i) {const e = St(i.from);let n = Fe(i.nonce, "tx.nonce").toString(16);- return n === "0" ? n = "0x" : n.length % 2 ? n = "0x0" + n : n = "0x" + n, St(Vt(Zt(cs([e, n])), 12));+ return n === "0" ? n = "0x" : n.length % 2 ? n = "0x0" + n : n = "0x" + n, St(Vt(Zt(ls([e, n])), 12));}-function Yb(i) {+function ix(i) {return i && typeof i.getAddress == "function";}-async function Au(i, e) {+async function _u(i, e) {const t = await e;return (t == null || t === "0x0000000000000000000000000000000000000000") && (ge(typeof i != "string", "unconfigured name", "UNCONFIGURED_NAME", { value: i }), V(!1, "invalid AddressLike value; did not resolve to a value address", "target", i)), St(t);}function Fn(i, e) {if (typeof i == "string")- return i.match(/^0x[0-9a-f]{40}$/i) ? St(i) : (ge(e != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }), Au(i, e.resolveName(i)));- if (Yb(i))- return Au(i, i.getAddress());+ return i.match(/^0x[0-9a-f]{40}$/i) ? St(i) : (ge(e != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }), _u(i, e.resolveName(i)));+ if (ix(i))+ return _u(i, i.getAddress());if (i && typeof i.then == "function")- return Au(i, i);+ return _u(i, i);V(!1, "unsupported addressable value", "target", i);}const Yi = {};@@ -37758,7 +38110,7 @@ function Te(i, e) {function Et(i, e) {return new Wt(Yi, `bytes${e || ""}`, i, { size: e });}-const kg = /* @__PURE__ */ Symbol.for("_ethers_typed");+const Vg = /* @__PURE__ */ Symbol.for("_ethers_typed");class Wt {/*** The type, as a Solidity-compatible type.@@ -37777,7 +38129,7 @@ class Wt {* @_ignore:*/constructor(e, t, n, s) {- s == null && (s = null), Wl(Yi, e, "Typed"), Ye(this, { _typedSymbol: kg, type: t, value: n }), this.#e = s, this.format();+ s == null && (s = null), Jl(Yi, e, "Typed"), Xe(this, { _typedSymbol: Vg, type: t, value: n }), this.#e = s, this.format();}/*** Format the type as a Human-Readable type.@@ -38487,7 +38839,7 @@ class Wt {* Returns true only if %%value%% is a [[Typed]] instance.*/static isTyped(e) {- return e && typeof e == "object" && "_typedSymbol" in e && e._typedSymbol === kg;+ return e && typeof e == "object" && "_typedSymbol" in e && e._typedSymbol === Vg;}/*** If the value is a [[Typed]] instance, validates the underlying value@@ -38505,7 +38857,7 @@ class Wt {return e;}}-class fN extends ps {+class LN extends As {constructor(e) {super("address", "address", e, !1);}@@ -38522,10 +38874,10 @@ class fN extends ps {return e.writeValue(n);}decode(e) {- return St(Os(e.readValue(), 20));+ return St(Gs(e.readValue(), 20));}}-class pN extends ps {+class PN extends As {coder;constructor(e) {super(e.name, e.type, "_", e.dynamic), this.coder = e;@@ -38540,7 +38892,7 @@ class pN extends ps {return this.coder.decode(e);}}-function jb(i, e, t) {+function sx(i, e, t) {let n = [];if (Array.isArray(t))n = t;@@ -38553,7 +38905,7 @@ function jb(i, e, t) {} elseV(!1, "invalid tuple value", "tuple", t);V(e.length === n.length, "types/value length mismatch", "tuple", t);- let s = new Bd(), r = new Bd(), a = [];+ let s = new Ld(), r = new Ld(), a = [];e.forEach((c, l) => {let h = n[l];if (c.dynamic) {@@ -38571,7 +38923,7 @@ function jb(i, e, t) {let o = i.appendWriter(s);return o += i.appendWriter(r), o;}-function Jb(i, e) {+function rx(i, e) {let t = [], n = [], s = i.subReader(0);return e.forEach((r) => {let a = null;@@ -38595,14 +38947,14 @@ function Jb(i, e) {if (a == null)throw new Error("investigate");t.push(a), n.push(r.localName || null);- }), ss.fromItems(t, n);+ }), rs.fromItems(t, n);}-class AN extends ps {+class kN extends As {coder;length;constructor(e, t, n) {const s = e.type + "[" + (t >= 0 ? t : "") + "]", r = t === -1 || e.dynamic;- super("array", s, n, r), Ye(this, { coder: e, length: t });+ super("array", s, n, r), Xe(this, { coder: e, length: t });}defaultValue() {const e = this.coder.defaultValue(), t = [];@@ -38614,22 +38966,22 @@ class AN extends ps {const n = Wt.dereference(t, "array");Array.isArray(n) || this._throwError("expected array value", n);let s = this.length;- s === -1 && (s = n.length, e.writeValue(n.length)), cb(n.length, s, "coder array" + (this.localName ? " " + this.localName : ""));+ s === -1 && (s = n.length, e.writeValue(n.length)), gb(n.length, s, "coder array" + (this.localName ? " " + this.localName : ""));let r = [];for (let a = 0; a < n.length; a++)r.push(this.coder);- return jb(e, r, n);+ return sx(e, r, n);}decode(e) {let t = this.length;t === -1 && (t = e.readIndex(), ge(t * Nn <= e.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: e.bytes, offset: t * Nn, length: e.dataLength }));let n = [];for (let s = 0; s < t; s++)- n.push(new pN(this.coder));- return Jb(e, n);+ n.push(new PN(this.coder));+ return rx(e, n);}}-class gN extends ps {+class UN extends As {constructor(e) {super("bool", "bool", e, !1);}@@ -38644,7 +38996,7 @@ class gN extends ps {return !!e.readValue();}}-class Zb extends ps {+class ax extends As {constructor(e, t) {super(e, e, t, !0);}@@ -38660,7 +39012,7 @@ class Zb extends ps {return e.readBytes(e.readIndex(), !0);}}-class mN extends Zb {+class ON extends ax {constructor(e) {super("bytes", e);}@@ -38668,11 +39020,11 @@ class mN extends Zb {return Se(super.decode(e));}}-class bN extends ps {+class QN extends As {size;constructor(e, t) {let n = "bytes" + String(e);- super(n, n, t, !1), Ye(this, { size: e }, { size: "number" });+ super(n, n, t, !1), Xe(this, { size: e }, { size: "number" });}defaultValue() {return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2);@@ -38685,8 +39037,8 @@ class bN extends ps {return Se(e.readBytes(this.size));}}-const xN = new Uint8Array([]);-class EN extends ps {+const GN = new Uint8Array([]);+class HN extends As {constructor(e) {super("null", "", e, !1);}@@ -38694,37 +39046,37 @@ class EN extends ps {return null;}encode(e, t) {- return t != null && this._throwError("not null", t), e.writeBytes(xN);+ return t != null && this._throwError("not null", t), e.writeBytes(GN);}decode(e) {return e.readBytes(0), null;}}-const _N = BigInt(0), yN = BigInt(1), wN = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");-class CN extends ps {+const zN = BigInt(0), VN = BigInt(1), WN = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");+class qN extends As {size;signed;constructor(e, t, n) {const s = (t ? "int" : "uint") + e * 8;- super(s, s, n, !1), Ye(this, { size: e, signed: t }, { size: "number", signed: "boolean" });+ super(s, s, n, !1), Xe(this, { size: e, signed: t }, { size: "number", signed: "boolean" });}defaultValue() {return 0;}encode(e, t) {- let n = Fe(Wt.dereference(t, this.type)), s = co(wN, Nn * 8);+ let n = Fe(Wt.dereference(t, this.type)), s = fo(WN, Nn * 8);if (this.signed) {- let r = co(s, this.size * 8 - 1);- (n > r || n < -(r + yN)) && this._throwError("value out-of-bounds", t), n = ub(n, 8 * Nn);- } else (n < _N || n > co(s, this.size * 8)) && this._throwError("value out-of-bounds", t);+ let r = fo(s, this.size * 8 - 1);+ (n > r || n < -(r + VN)) && this._throwError("value out-of-bounds", t), n = xb(n, 8 * Nn);+ } else (n < zN || n > fo(s, this.size * 8)) && this._throwError("value out-of-bounds", t);return e.writeValue(n);}decode(e) {- let t = co(e.readValue(), this.size * 8);- return this.signed && (t = CT(t, this.size * 8)), t;+ let t = fo(e.readValue(), this.size * 8);+ return this.signed && (t = qT(t, this.size * 8)), t;}}-class vN extends Zb {+class KN extends ax {constructor(e) {super("string", e);}@@ -38732,13 +39084,13 @@ class vN extends Zb {return "";}encode(e, t) {- return super.encode(e, os(Wt.dereference(t, "string")));+ return super.encode(e, cs(Wt.dereference(t, "string")));}decode(e) {- return Il(super.decode(e));+ return Nl(super.decode(e));}}-class jc extends ps {+class tl extends As {coders;constructor(e, t) {let n = !1;@@ -38747,7 +39099,7 @@ class jc extends ps {a.dynamic && (n = !0), s.push(a.type);});const r = "tuple(" + s.join(",") + ")";- super("tuple", r, t, n), Ye(this, { coders: Object.freeze(e.slice()) });+ super("tuple", r, t, n), Xe(this, { coders: Object.freeze(e.slice()) });}defaultValue() {const e = [];@@ -38765,29 +39117,29 @@ class jc extends ps {}encode(e, t) {const n = Wt.dereference(t, "tuple");- return jb(e, this.coders, n);+ return sx(e, this.coders, n);}decode(e) {- return Jb(e, this.coders);+ return rx(e, this.coders);}}-function gu(i, e) {+function yu(i, e) {return {address: St(i),storageKeys: e.map((t, n) => (V(Lt(t, 32), "invalid slot", `storageKeys[${n}]`, t), t.toLowerCase()))};}-function Ir(i) {+function Br(i) {if (Array.isArray(i))- return i.map((t, n) => Array.isArray(t) ? (V(t.length === 2, "invalid slot set", `value[${n}]`, t), gu(t[0], t[1])) : (V(t != null && typeof t == "object", "invalid address-slot set", "value", i), gu(t.address, t.storageKeys)));+ return i.map((t, n) => Array.isArray(t) ? (V(t.length === 2, "invalid slot set", `value[${n}]`, t), yu(t[0], t[1])) : (V(t != null && typeof t == "object", "invalid address-slot set", "value", i), yu(t.address, t.storageKeys)));V(i != null && typeof i == "object", "invalid access list", "value", i);const e = Object.keys(i).map((t) => {const n = i[t].reduce((s, r) => (s[r] = !0, s), {});- return gu(t, Object.keys(n).sort());+ return yu(t, Object.keys(n).sort());});return e.sort((t, n) => t.address.localeCompare(n.address)), e;}-function $b(i) {+function ox(i) {return {address: St(i.address),nonce: Fe(i.nonce != null ? i.nonce : 0),@@ -38795,15 +39147,15 @@ function $b(i) {signature: Gt.from(i.signature)};}-function SN(i) {+function jN(i) {let e;- return typeof i == "string" ? e = $i.computePublicKey(i, !1) : e = i.publicKey, St(Zt("0x" + e.substring(4)).substring(26));+ return typeof i == "string" ? e = es.computePublicKey(i, !1) : e = i.publicKey, St(Zt("0x" + e.substring(4)).substring(26));}-function IN(i, e) {- return SN($i.recoverPublicKey(i, e));+function XN(i, e) {+ return jN(es.recoverPublicKey(i, e));}-const gn = BigInt(0), MN = BigInt(2), BN = BigInt(27), TN = BigInt(28), RN = BigInt(35), NN = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), FN = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), mu = 4096 * 32, al = 128;-function DN(i) {+const gn = BigInt(0), YN = BigInt(2), JN = BigInt(27), ZN = BigInt(28), $N = BigInt(35), eF = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), tF = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), wu = 4096 * 32, ul = 128;+function nF(i) {return { blobToKzgCommitment: (n) => {if ("computeBlobProof" in i) {if ("blobToKzgCommitment" in i && typeof i.blobToKzgCommitment == "function")@@ -38823,23 +39175,23 @@ function DN(i) {V(!1, "unsupported KZG library", "kzg", i);} };}-function Ug(i, e) {+function Wg(i, e) {let t = i.toString(16);for (; t.length < 2; )t = "0" + t;- return t += ka(e).substring(4), "0x" + t;+ return t += Ga(e).substring(4), "0x" + t;}-function Ua(i) {+function Ha(i) {return i === "0x" ? null : St(i);}-function Yl(i, e) {+function th(i, e) {try {- return Ir(i);+ return Br(i);} catch (t) {V(!1, t.message, e, i);}}-function LN(i, e) {+function iF(i, e) {try {if (!Array.isArray(i))throw new Error("authorizationList: invalid array");@@ -38853,13 +39205,13 @@ function LN(i, e) {if (!s[1])throw new Error(`authorization[${n}]: null address`);t.push({- address: Ua(s[1]),+ address: Ha(s[1]),nonce: Tt(s[2], "nonce"),chainId: Tt(s[0], "chainId"),signature: Gt.from({- yParity: Mr(s[3], "yParity"),- r: us(s[4], 32),- s: us(s[5], 32)+ yParity: Tr(s[3], "yParity"),+ r: ds(s[4], 32),+ s: ds(s[5], 32)})});}@@ -38868,23 +39220,23 @@ function LN(i, e) {V(!1, t.message, e, i);}}-function Mr(i, e) {+function Tr(i, e) {return i === "0x" ? 0 : ut(i, e);}function Tt(i, e) {if (i === "0x")return gn;const t = Fe(i, e);- return V(t <= NN, "value exceeds uint size", e, t), t;+ return V(t <= eF, "value exceeds uint size", e, t), t;}function bt(i, e) {const t = Fe(i, "value"), n = $t(t);return V(n.length <= 32, "value too large", `tx.${e}`, t), n;}-function jl(i) {- return Ir(i).map((e) => [e.address, e.storageKeys]);+function nh(i) {+ return Br(i).map((e) => [e.address, e.storageKeys]);}-function PN(i) {+function sF(i) {return i.map((e) => [bt(e.chainId, "chainId"),e.address,@@ -38894,21 +39246,21 @@ function PN(i) {$t(e.signature._s)]);}-function kN(i, e) {+function rF(i, e) {V(Array.isArray(i), `invalid ${e}`, "value", i);for (let t = 0; t < i.length; t++)V(Lt(i[t], 32), "invalid ${ param } hash", `value[${t}]`, i[t]);return i;}-function UN(i) {- const e = Yo(i);+function aF(i) {+ const e = ec(i);V(Array.isArray(e) && (e.length === 9 || e.length === 6), "invalid field count for legacy transaction", "data", i);const t = {type: 0,- nonce: Mr(e[0], "nonce"),+ nonce: Tr(e[0], "nonce"),gasPrice: Tt(e[1], "gasPrice"),gasLimit: Tt(e[2], "gasLimit"),- to: Ua(e[3]),+ to: Ha(e[3]),value: Tt(e[4], "value"),data: Se(e[5]),chainId: gn@@ -38919,16 +39271,16 @@ function UN(i) {if (s === gn && r === gn)t.chainId = n;else {- let a = (n - RN) / MN;- a < gn && (a = gn), t.chainId = a, V(a !== gn || n === BN || n === TN, "non-canonical legacy v", "v", e[6]), t.signature = Gt.from({- r: us(e[7], 32),- s: us(e[8], 32),+ let a = (n - $N) / YN;+ a < gn && (a = gn), t.chainId = a, V(a !== gn || n === JN || n === ZN, "non-canonical legacy v", "v", e[6]), t.signature = Gt.from({+ r: ds(e[7], 32),+ s: ds(e[8], 32),v: n});}return t;}-function ON(i, e) {+function oF(i, e) {const t = [bt(i.nonce, "nonce"),bt(i.gasPrice || 0, "gasPrice"),@@ -38945,40 +39297,40 @@ function ON(i, e) {r != null && (n = r);}if (!e)- return n !== gn && (t.push($t(n)), t.push("0x"), t.push("0x")), cs(t);+ return n !== gn && (t.push($t(n)), t.push("0x"), t.push("0x")), ls(t);let s = BigInt(27 + e.yParity);- return n !== gn ? s = Gt.getChainIdV(n, e.v) : BigInt(e.v) !== s && V(!1, "tx.chainId/sig.v mismatch", "sig", e), t.push($t(s)), t.push($t(e.r)), t.push($t(e._s)), cs(t);+ return n !== gn ? s = Gt.getChainIdV(n, e.v) : BigInt(e.v) !== s && V(!1, "tx.chainId/sig.v mismatch", "sig", e), t.push($t(s)), t.push($t(e.r)), t.push($t(e._s)), ls(t);}-function Jl(i, e) {+function ih(i, e) {let t;try {- if (t = Mr(e[0], "yParity"), t !== 0 && t !== 1)+ if (t = Tr(e[0], "yParity"), t !== 0 && t !== 1)throw new Error("bad yParity");} catch {V(!1, "invalid yParity", "yParity", e[0]);}- const n = us(e[1], 32), s = us(e[2], 32), r = Gt.from({ r: n, s, yParity: t });+ const n = ds(e[1], 32), s = ds(e[2], 32), r = Gt.from({ r: n, s, yParity: t });i.signature = r;}-function QN(i) {- const e = Yo(ht(i).slice(1));+function cF(i) {+ const e = ec(ht(i).slice(1));V(Array.isArray(e) && (e.length === 9 || e.length === 12), "invalid field count for transaction type: 2", "data", Se(i));const t = {type: 2,chainId: Tt(e[0], "chainId"),- nonce: Mr(e[1], "nonce"),+ nonce: Tr(e[1], "nonce"),maxPriorityFeePerGas: Tt(e[2], "maxPriorityFeePerGas"),maxFeePerGas: Tt(e[3], "maxFeePerGas"),gasPrice: null,gasLimit: Tt(e[4], "gasLimit"),- to: Ua(e[5]),+ to: Ha(e[5]),value: Tt(e[6], "value"),data: Se(e[7]),- accessList: Yl(e[8], "accessList")+ accessList: th(e[8], "accessList")};- return e.length === 9 || Jl(t, e.slice(9)), t;+ return e.length === 9 || ih(t, e.slice(9)), t;}-function GN(i, e) {+function lF(i, e) {const t = [bt(i.chainId, "chainId"),bt(i.nonce, "nonce"),@@ -38988,27 +39340,27 @@ function GN(i, e) {i.to || "0x",bt(i.value, "value"),i.data,- jl(i.accessList || [])+ nh(i.accessList || [])];- return e && (t.push(bt(e.yParity, "yParity")), t.push($t(e.r)), t.push($t(e.s))), Ot(["0x02", cs(t)]);+ return e && (t.push(bt(e.yParity, "yParity")), t.push($t(e.r)), t.push($t(e.s))), Ot(["0x02", ls(t)]);}-function HN(i) {- const e = Yo(ht(i).slice(1));+function hF(i) {+ const e = ec(ht(i).slice(1));V(Array.isArray(e) && (e.length === 8 || e.length === 11), "invalid field count for transaction type: 1", "data", Se(i));const t = {type: 1,chainId: Tt(e[0], "chainId"),- nonce: Mr(e[1], "nonce"),+ nonce: Tr(e[1], "nonce"),gasPrice: Tt(e[2], "gasPrice"),gasLimit: Tt(e[3], "gasLimit"),- to: Ua(e[4]),+ to: Ha(e[4]),value: Tt(e[5], "value"),data: Se(e[6]),- accessList: Yl(e[7], "accessList")+ accessList: th(e[7], "accessList")};- return e.length === 8 || Jl(t, e.slice(8)), t;+ return e.length === 8 || ih(t, e.slice(8)), t;}-function zN(i, e) {+function uF(i, e) {const t = [bt(i.chainId, "chainId"),bt(i.nonce, "nonce"),@@ -39017,12 +39369,12 @@ function zN(i, e) {i.to || "0x",bt(i.value, "value"),i.data,- jl(i.accessList || [])+ nh(i.accessList || [])];- return e && (t.push(bt(e.yParity, "recoveryParam")), t.push($t(e.r)), t.push($t(e.s))), Ot(["0x01", cs(t)]);+ return e && (t.push(bt(e.yParity, "recoveryParam")), t.push($t(e.r)), t.push($t(e.s))), Ot(["0x01", ls(t)]);}-function VN(i) {- let e = Yo(ht(i).slice(1)), t = "3", n = null, s = null;+function dF(i) {+ let e = ec(ht(i).slice(1)), t = "3", n = null, s = null;if (e.length === 4 && Array.isArray(e[0])) {t = "3 (network format)";const a = e[1], o = e[2], c = e[3];@@ -39037,11 +39389,11 @@ function VN(i) {} else if (e.length === 5 && Array.isArray(e[0])) {t = "3 (EIP-7594 network format)", n = ut(e[1]);const a = e[2], o = e[3], c = e[4];- V(n === 1, `unsupported EIP-7594 network format version: ${n}`, "fields[1]", n), V(Array.isArray(a), "invalid EIP-7594 network format: blobs not an array", "fields[2]", a), V(Array.isArray(o), "invalid EIP-7594 network format: commitments not an array", "fields[3]", o), V(Array.isArray(c), "invalid EIP-7594 network format: proofs not an array", "fields[4]", c), V(a.length === o.length, "invalid network format: blobs/commitments length mismatch", "fields", e), V(a.length * al === c.length, "invalid network format: blobs/proofs length mismatch", "fields", e), s = [];+ V(n === 1, `unsupported EIP-7594 network format version: ${n}`, "fields[1]", n), V(Array.isArray(a), "invalid EIP-7594 network format: blobs not an array", "fields[2]", a), V(Array.isArray(o), "invalid EIP-7594 network format: commitments not an array", "fields[3]", o), V(Array.isArray(c), "invalid EIP-7594 network format: proofs not an array", "fields[4]", c), V(a.length === o.length, "invalid network format: blobs/commitments length mismatch", "fields", e), V(a.length * ul === c.length, "invalid network format: blobs/proofs length mismatch", "fields", e), s = [];for (let l = 0; l < a.length; l++) {const h = [];- for (let u = 0; u < al; u++)- h.push(c[l * al + u]);+ for (let u = 0; u < ul; u++)+ h.push(c[l * ul + u]);s.push({data: a[l],commitment: o[l],@@ -39054,15 +39406,15 @@ function VN(i) {const r = {type: 3,chainId: Tt(e[0], "chainId"),- nonce: Mr(e[1], "nonce"),+ nonce: Tr(e[1], "nonce"),maxPriorityFeePerGas: Tt(e[2], "maxPriorityFeePerGas"),maxFeePerGas: Tt(e[3], "maxFeePerGas"),gasPrice: null,gasLimit: Tt(e[4], "gasLimit"),- to: Ua(e[5]),+ to: Ha(e[5]),value: Tt(e[6], "value"),data: Se(e[7]),- accessList: Yl(e[8], "accessList"),+ accessList: th(e[8], "accessList"),maxFeePerBlobGas: Tt(e[9], "maxFeePerBlobGas"),blobVersionedHashes: e[10],blobWrapperVersion: n@@ -39070,33 +39422,33 @@ function VN(i) {s && (r.blobs = s), V(r.to != null, `invalid address for transaction type: ${t}`, "data", i), V(Array.isArray(r.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", i);for (let a = 0; a < r.blobVersionedHashes.length; a++)V(Lt(r.blobVersionedHashes[a], 32), `invalid blobVersionedHash at index ${a}: must be length 32`, "data", i);- return e.length === 11 || Jl(r, e.slice(11)), r;+ return e.length === 11 || ih(r, e.slice(11)), r;}-function WN(i, e, t) {+function fF(i, e, t) {const n = [bt(i.chainId, "chainId"),bt(i.nonce, "nonce"),bt(i.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),bt(i.maxFeePerGas || 0, "maxFeePerGas"),bt(i.gasLimit, "gasLimit"),- i.to || Po,+ i.to || Go,bt(i.value, "value"),i.data,- jl(i.accessList || []),+ nh(i.accessList || []),bt(i.maxFeePerBlobGas || 0, "maxFeePerBlobGas"),- kN(i.blobVersionedHashes || [], "blobVersionedHashes")+ rF(i.blobVersionedHashes || [], "blobVersionedHashes")];if (e && (n.push(bt(e.yParity, "yParity")), n.push($t(e.r)), n.push($t(e.s)), t)) {if (i.blobWrapperVersion != null) {const s = $t(i.blobWrapperVersion), r = [];for (const { proof: a } of t) {- const o = ht(a), c = o.length / al;+ const o = ht(a), c = o.length / ul;for (let l = 0; l < o.length; l += c)r.push(o.subarray(l, l + c));}return Ot(["0x03",- cs([+ ls([n,s,t.map((a) => a.data),@@ -39107,7 +39459,7 @@ function WN(i, e, t) {}return Ot(["0x03",- cs([+ ls([n,t.map((s) => s.data),t.map((s) => s.commitment),@@ -39115,28 +39467,28 @@ function WN(i, e, t) {])]);}- return Ot(["0x03", cs(n)]);+ return Ot(["0x03", ls(n)]);}-function qN(i) {- const e = Yo(ht(i).slice(1));+function pF(i) {+ const e = ec(ht(i).slice(1));V(Array.isArray(e) && (e.length === 10 || e.length === 13), "invalid field count for transaction type: 4", "data", Se(i));const t = {type: 4,chainId: Tt(e[0], "chainId"),- nonce: Mr(e[1], "nonce"),+ nonce: Tr(e[1], "nonce"),maxPriorityFeePerGas: Tt(e[2], "maxPriorityFeePerGas"),maxFeePerGas: Tt(e[3], "maxFeePerGas"),gasPrice: null,gasLimit: Tt(e[4], "gasLimit"),- to: Ua(e[5]),+ to: Ha(e[5]),value: Tt(e[6], "value"),data: Se(e[7]),- accessList: Yl(e[8], "accessList"),- authorizationList: LN(e[9], "authorizationList")+ accessList: th(e[8], "accessList"),+ authorizationList: iF(e[9], "authorizationList")};- return e.length === 10 || Jl(t, e.slice(10)), t;+ return e.length === 10 || ih(t, e.slice(10)), t;}-function KN(i, e) {+function AF(i, e) {const t = [bt(i.chainId, "chainId"),bt(i.nonce, "nonce"),@@ -39146,12 +39498,12 @@ function KN(i, e) {i.to || "0x",bt(i.value, "value"),i.data,- jl(i.accessList || []),- PN(i.authorizationList || [])+ nh(i.accessList || []),+ sF(i.authorizationList || [])];- return e && (t.push(bt(e.yParity, "yParity")), t.push($t(e.r)), t.push($t(e.s))), Ot(["0x04", cs(t)]);+ return e && (t.push(bt(e.yParity, "yParity")), t.push($t(e.r)), t.push($t(e.s))), Ot(["0x04", ls(t)]);}-class di {+class fi {#e;#t;#n;@@ -39236,7 +39588,7 @@ class di {*/get to() {const e = this.#t;- return e == null && this.type === 3 ? Po : e;+ return e == null && this.type === 3 ? Go : e;}set to(e) {this.#t = e == null ? null : St(e);@@ -39354,14 +39706,14 @@ class di {return e ?? (this.type === 1 || this.type === 2 || this.type === 3 ? [] : null);}set accessList(e) {- this.#A = e == null ? null : Ir(e);+ this.#A = e == null ? null : Br(e);}get authorizationList() {const e = this.#b || null;return e == null && this.type === 4 ? [] : e;}set authorizationList(e) {- this.#b = e == null ? null : e.map((t) => $b(t));+ this.#b = e == null ? null : e.map((t) => ox(t));}/*** The max fee per blob gas for Cancun transactions.@@ -39427,13 +39779,13 @@ class di {const t = [], n = [];for (let s = 0; s < e.length; s++) {const r = e[s];- if (Nf(r)) {+ if (Uf(r)) {ge(this.#u, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", {operation: "set blobs()"});let a = ht(r);- if (V(a.length <= mu, "blob is too large", `blobs[${s}]`, r), a.length !== mu) {- const l = new Uint8Array(mu);+ if (V(a.length <= wu, "blob is too large", `blobs[${s}]`, r), a.length !== wu) {+ const l = new Uint8Array(wu);l.set(a), a = l;}const o = this.#u.blobToKzgCommitment(a), c = Se(this.#u.computeBlobKzgProof(a, o));@@ -39441,10 +39793,10 @@ class di {data: Se(a),commitment: Se(o),proof: c- }), n.push(Ug(1, o));+ }), n.push(Wg(1, o));} else {const a = Se(r.data), o = Se(r.commitment), c = Se(r.proof);- t.push({ data: a, commitment: o, proof: c }), n.push(Ug(1, o));+ t.push({ data: a, commitment: o, proof: c }), n.push(Wg(1, o));}}this.#d = t, this.#h = n;@@ -39453,7 +39805,7 @@ class di {return this.#u;}set kzg(e) {- e == null ? this.#u = null : this.#u = DN(e);+ e == null ? this.#u = null : this.#u = nF(e);}get blobWrapperVersion() {return this.#g;@@ -39486,13 +39838,13 @@ class di {* The sending address, if signed. Otherwise, ``null``.*/get from() {- return this.signature == null ? null : IN(this.unsignedHash, this.signature.getCanonical());+ return this.signature == null ? null : XN(this.unsignedHash, this.signature.getCanonical());}/*** The public key of the sender, if signed. Otherwise, ``null``.*/get fromPublicKey() {- return this.signature == null ? null : $i.recoverPublicKey(this.unsignedHash, this.signature.getCanonical());+ return this.signature == null ? null : es.recoverPublicKey(this.unsignedHash, this.signature.getCanonical());}/*** Returns true if signed.@@ -39508,15 +39860,15 @@ class di {const n = e ? this.signature : null;switch (this.inferType()) {case 0:- return ON(this, n);+ return oF(this, n);case 1:- return zN(this, n);+ return uF(this, n);case 2:- return GN(this, n);+ return lF(this, n);case 3:- return WN(this, n, t ? this.blobs : null);+ return fF(this, n, t ? this.blobs : null);case 4:- return KN(this, n);+ return AF(this, n);}ge(!1, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" });}@@ -39600,7 +39952,7 @@ class di {* Create a copy of this transaciton.*/clone() {- return di.from(this);+ return fi.from(this);}/*** Return a JSON-friendly object.@@ -39623,7 +39975,7 @@ class di {accessList: this.accessList};}- [FN]() {+ [tF]() {return this.toString();}toString() {@@ -39649,33 +40001,33 @@ class di {*/static from(e) {if (e == null)- return new di();+ return new fi();if (typeof e == "string") {const n = ht(e);if (n[0] >= 127)- return di.from(UN(n));+ return fi.from(aF(n));switch (n[0]) {case 1:- return di.from(HN(n));+ return fi.from(hF(n));case 2:- return di.from(QN(n));+ return fi.from(cF(n));case 3:- return di.from(VN(n));+ return fi.from(dF(n));case 4:- return di.from(qN(n));+ return fi.from(pF(n));}ge(!1, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" });}- const t = new di();+ const t = new fi();return e.type != null && (t.type = e.type), e.to != null && (t.to = e.to), e.nonce != null && (t.nonce = e.nonce), e.gasLimit != null && (t.gasLimit = e.gasLimit), e.gasPrice != null && (t.gasPrice = e.gasPrice), e.maxPriorityFeePerGas != null && (t.maxPriorityFeePerGas = e.maxPriorityFeePerGas), e.maxFeePerGas != null && (t.maxFeePerGas = e.maxFeePerGas), e.maxFeePerBlobGas != null && (t.maxFeePerBlobGas = e.maxFeePerBlobGas), e.data != null && (t.data = e.data), e.value != null && (t.value = e.value), e.chainId != null && (t.chainId = e.chainId), e.signature != null && (t.signature = Gt.from(e.signature)), e.accessList != null && (t.accessList = e.accessList), e.authorizationList != null && (t.authorizationList = e.authorizationList), e.blobVersionedHashes != null && (t.blobVersionedHashes = e.blobVersionedHashes), e.kzg != null && (t.kzg = e.kzg), e.blobWrapperVersion != null && (t.blobWrapperVersion = e.blobWrapperVersion), e.blobs != null && (t.blobs = e.blobs), e.hash != null && (V(t.isSigned(), "unsigned transaction cannot define '.hash'", "tx", e), V(t.hash === e.hash, "hash mismatch", "tx", e)), e.from != null && (V(t.isSigned(), "unsigned transaction cannot define '.from'", "tx", e), V(t.from.toLowerCase() === (e.from || "").toLowerCase(), "from mismatch", "tx", e)), t;}}-function yr(i) {- return Zt(os(i));+function vr(i) {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WdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";-const Og = /* @__PURE__ */ new Map([[8217, "apostrophe"], [8260, "fraction slash"], [12539, "middle dot"]]), Qg = 4;-function YN(i) {+var gF = "AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3f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uGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";+const qg = /* @__PURE__ */ new Map([[8217, "apostrophe"], [8260, "fraction slash"], [12539, "middle dot"]]), Kg = 4;+function mF(i) {let e = 0;function t() {return i[e++] << 8 | i[e++];@@ -39696,17 +40048,17 @@ function YN(i) {for (; ; ) {let M = Math.floor(((A - y + 1) * s - 1) / b), w = 0, S = n;for (; S - w > 1; ) {- let C = w + S >>> 1;- M < r[C] ? S = C : w = C;+ let v = w + S >>> 1;+ M < r[v] ? S = v : w = v;}if (w == 0) break;p.push(w);- let T = y + Math.floor(b * r[w] / s), v = y + Math.floor(b * r[w + 1] / s) - 1;- for (; ((T ^ v) & f) == 0; )- A = A << 1 & g | h(), T = T << 1 & g, v = v << 1 & g | 1;- for (; T & ~v & m; )- A = A & f | A << 1 & g >>> 1 | h(), T = T << 1 ^ f, v = (v ^ f) << 1 | f | 1;- y = T, b = 1 + v - T;+ let T = y + Math.floor(b * r[w] / s), C = y + Math.floor(b * r[w + 1] / s) - 1;+ for (; ((T ^ C) & f) == 0; )+ A = A << 1 & g | h(), T = T << 1 & g, C = C << 1 & g | 1;+ for (; T & ~C & m; )+ A = A & f | A << 1 & g >>> 1 | h(), T = T << 1 ^ f, C = (C ^ f) << 1 | f | 1;+ y = T, b = 1 + C - T;}let _ = n - 4;return p.map((M) => {@@ -39722,14 +40074,14 @@ function YN(i) {}});}-function jN(i) {+function bF(i) {let e = 0;return () => i[e++];}-function ex(i) {- return jN(YN(JN(i)));+function cx(i) {+ return bF(mF(xF(i)));}-function JN(i) {+function xF(i) {let e = [];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s, r) => e[s.charCodeAt(0)] = r);let t = i.length, n = new Uint8Array(6 * t >> 3);@@ -39737,15 +40089,15 @@ function JN(i) {o = o << 6 | e[i.charCodeAt(s)], a += 6, a >= 8 && (n[r++] = o >> (a -= 8));return n;}-function ZN(i) {+function EF(i) {return i & 1 ? ~i >> 1 : i >> 1;}-function $N(i, e) {+function _F(i, e) {let t = Array(i);- for (let n = 0, s = 0; n < i; n++) t[n] = s += ZN(e());+ for (let n = 0, s = 0; n < i; n++) t[n] = s += EF(e());return t;}-function ko(i, e = 0) {+function Ho(i, e = 0) {let t = [];for (; ; ) {let n = i(), s = i();@@ -39757,27 +40109,27 @@ function ko(i, e = 0) {}return t;}-function tx(i) {- return Uo(() => {- let e = ko(i);+function lx(i) {+ return zo(() => {+ let e = Ho(i);if (e.length) return e;});}-function nx(i) {+function hx(i) {let e = [];for (; ; ) {let t = i();if (t == 0) break;- e.push(eF(t, i));+ e.push(yF(t, i));}for (; ; ) {let t = i() - 1;if (t < 0) break;- e.push(tF(t, i));+ e.push(wF(t, i));}return e.flat();}-function Uo(i) {+function zo(i) {let e = [];for (; ; ) {let t = i(e.length);@@ -39786,15 +40138,15 @@ function Uo(i) {}return e;}-function ix(i, e, t) {+function ux(i, e, t) {let n = Array(i).fill().map(() => []);for (let s = 0; s < e; s++)- $N(i, t).forEach((r, a) => n[a].push(r));+ _F(i, t).forEach((r, a) => n[a].push(r));return n;}-function eF(i, e) {- let t = 1 + e(), n = e(), s = Uo(e);- return ix(s.length, 1 + i, e).flatMap((a, o) => {+function yF(i, e) {+ let t = 1 + e(), n = e(), s = zo(e);+ return ux(s.length, 1 + i, e).flatMap((a, o) => {let [c, ...l] = a;return Array(s[o]).fill().map((h, u) => {let d = u * n;@@ -39802,16 +40154,16 @@ function eF(i, e) {});});}-function tF(i, e) {+function wF(i, e) {let t = 1 + e();- return ix(t, 1 + i, e).map((s) => [s[0], s.slice(1)]);+ return ux(t, 1 + i, e).map((s) => [s[0], s.slice(1)]);}-function nF(i) {- let e = [], t = ko(i);+function vF(i) {+ let e = [], t = Ho(i);return s(n([]), []), e;function n(r) {- let a = i(), o = Uo(() => {- let c = ko(i).map((l) => t[l]);+ let a = i(), o = zo(() => {+ let c = Ho(i).map((l) => t[l]);if (c.length) return n(c);});return { S: a, B: o, Q: r };@@ -39825,13 +40177,13 @@ function nF(i) {}}}-function iF(i) {+function CF(i) {return i.toString(16).toUpperCase().padStart(2, "0");}-function sx(i) {- return `{${iF(i)}}`;+function dx(i) {+ return `{${CF(i)}}`;}-function sF(i) {+function SF(i) {let e = [];for (let t = 0, n = i.length; t < n; ) {let s = i.codePointAt(t);@@ -39839,7 +40191,7 @@ function sF(i) {}return e;}-function Ma(i) {+function Na(i) {let t = i.length;if (t < 4096) return String.fromCodePoint(...i);let n = [];@@ -39847,69 +40199,69 @@ function Ma(i) {n.push(String.fromCodePoint(...i.slice(s, s += 4096)));return n.join("");}-function rF(i, e) {+function IF(i, e) {let t = i.length, n = t - e.length;for (let s = 0; n == 0 && s < t; s++) n = i[s] - e[s];return n;}-var aF = "AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAI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U5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";+const Vo = 44032, Dl = 4352, Ll = 4449, Pl = 4519, fx = 19, px = 21, Fa = 28, kl = px * Fa, BF = fx * kl, TF = Vo + BF, RF = Dl + fx, NF = Ll + px, FF = Pl + Fa;+function po(i) {return i >> 24 & 255;}-function ox(i) {+function Ax(i) {return i & 16777215;}-let Pd, Gg, kd, ol;-function dF() {- let i = ex(aF);- Pd = new Map(tx(i).flatMap((e, t) => e.map((n) => [n, t + 1 << 24]))), Gg = new Set(ko(i)), kd = /* @__PURE__ */ new Map(), ol = /* @__PURE__ */ new Map();- for (let [e, t] of nx(i)) {- if (!Gg.has(e) && t.length == 2) {- let [n, s] = t, r = ol.get(n);- r || (r = /* @__PURE__ */ new Map(), ol.set(n, r)), r.set(s, e);+let Hd, jg, zd, dl;+function DF() {+ let i = cx(MF);+ Hd = new Map(lx(i).flatMap((e, t) => e.map((n) => [n, t + 1 << 24]))), jg = new Set(Ho(i)), zd = /* @__PURE__ */ new Map(), dl = /* @__PURE__ */ new Map();+ for (let [e, t] of hx(i)) {+ if (!jg.has(e) && t.length == 2) {+ let [n, s] = t, r = dl.get(n);+ r || (r = /* @__PURE__ */ new Map(), dl.set(n, r)), r.set(s, e);}- kd.set(e, t.reverse());+ zd.set(e, t.reverse());}}-function cx(i) {- return i >= Oo && i < cF;+function gx(i) {+ return i >= Vo && i < TF;}-function fF(i, e) {- if (i >= Bl && i < lF && e >= Tl && e < hF)- return Oo + (i - Bl) * Nl + (e - Tl) * Ba;- if (cx(i) && e > Rl && e < uF && (i - Oo) % Ba == 0)- return i + (e - Rl);+function LF(i, e) {+ if (i >= Dl && i < RF && e >= Ll && e < NF)+ return Vo + (i - Dl) * kl + (e - Ll) * Fa;+ if (gx(i) && e > Pl && e < FF && (i - Vo) % Fa == 0)+ return i + (e - Pl);{- let t = ol.get(i);+ let t = dl.get(i);return t && (t = t.get(e), t) ? t : -1;}}-function lx(i) {- Pd || dF();+function mx(i) {+ Hd || DF();let e = [], t = [], n = !1;function s(r) {- let a = Pd.get(r);+ let a = Hd.get(r);a && (n = !0, r |= a), e.push(r);}for (let r of i)for (; ; ) {if (r < 128)e.push(r);- else if (cx(r)) {- let a = r - Oo, o = a / Nl | 0, c = a % Nl / Ba | 0, l = a % Ba;- s(Bl + o), s(Tl + c), l > 0 && s(Rl + l);+ else if (gx(r)) {+ let a = r - Vo, o = a / kl | 0, c = a % kl / Fa | 0, l = a % Fa;+ s(Dl + o), s(Ll + c), l > 0 && s(Pl + l);} else {- let a = kd.get(r);+ let a = zd.get(r);a ? t.push(...a) : s(r);}if (!t.length) break;r = t.pop();}if (n && e.length > 1) {- let r = lo(e[0]);+ let r = po(e[0]);for (let a = 1; a < e.length; a++) {- let o = lo(e[a]);+ let o = po(e[a]);if (o == 0 || r <= o) {r = o;continue;@@ -39917,185 +40269,185 @@ function lx(i) {let c = a - 1;for (; ; ) {let l = e[c + 1];- if (e[c + 1] = e[c], e[c] = l, !c || (r = lo(e[--c]), r <= o)) break;+ if (e[c + 1] = e[c], e[c] = l, !c || (r = po(e[--c]), r <= o)) break;}- r = lo(e[a]);+ r = po(e[a]);}}return e;}-function pF(i) {+function PF(i) {let e = [], t = [], n = -1, s = 0;for (let r of i) {- let a = lo(r), o = ox(r);+ let a = po(r), o = Ax(r);if (n == -1)a == 0 ? n = o : e.push(o);else if (s > 0 && s >= a)a == 0 ? (e.push(n, ...t), t.length = 0, n = o) : t.push(o), s = a;else {- let c = fF(n, o);+ let c = LF(n, o);c >= 0 ? n = c : s == 0 && a == 0 ? (e.push(n), n = o) : (t.push(o), s = a);}}return n >= 0 && e.push(n, ...t), e;}-function hx(i) {- return lx(i).map(ox);+function bx(i) {+ return mx(i).map(Ax);}-function AF(i) {- return pF(lx(i));+function kF(i) {+ return PF(mx(i));}-const Hg = 45, ux = ".", dx = 65039, fx = 1, Fl = (i) => Array.from(i);-function Qo(i, e) {+const Xg = 45, xx = ".", Ex = 65039, _x = 1, Ul = (i) => Array.from(i);+function Wo(i, e) {return i.P.has(e) || i.Q.has(e);}-class gF extends Array {+class UF extends Array {get is_emoji() {return !0;}// free tagging system}-let Ud, px, dr, Od, Ax, fa, bu, Zr, nr, zg, Qd;-function Vf() {- if (Ud) return;- let i = ex(XN);- const e = () => ko(i), t = () => new Set(e()), n = (h, u) => u.forEach((d) => h.add(d));- Ud = new Map(nx(i)), px = t(), dr = e(), Od = new Set(e().map((h) => dr[h])), dr = new Set(dr), Ax = t(), t();- let s = tx(i), r = i();+let Vd, yx, pr, Wd, wx, ma, vu, ea, sr, Yg, qd;+function Yf() {+ if (Vd) return;+ let i = cx(gF);+ const e = () => Ho(i), t = () => new Set(e()), n = (h, u) => u.forEach((d) => h.add(d));+ Vd = new Map(hx(i)), yx = t(), pr = e(), Wd = new Set(e().map((h) => pr[h])), pr = new Set(pr), wx = t(), t();+ let s = lx(i), r = i();const a = () => {let h = /* @__PURE__ */ new Set();return e().forEach((u) => n(h, s[u])), n(h, e()), h;};- fa = Uo((h) => {- let u = Uo(i).map((d) => d + 96);+ ma = zo((h) => {+ let u = zo(i).map((d) => d + 96);if (u.length) {let d = h >= r;- u[0] -= 32, u = Ma(u), d && (u = `Restricted[${u}]`);+ u[0] -= 32, u = Na(u), d && (u = `Restricted[${u}]`);let f = a(), m = a(), g = !i();return { N: u, P: f, Q: m, M: g, R: d };}- }), bu = t(), Zr = /* @__PURE__ */ new Map();- let o = e().concat(Fl(bu)).sort((h, u) => h - u);+ }), vu = t(), ea = /* @__PURE__ */ new Map();+ let o = e().concat(Ul(vu)).sort((h, u) => h - u);o.forEach((h, u) => {let d = i(), f = o[u] = d ? o[u - d] : { V: [], M: /* @__PURE__ */ new Map() };- f.V.push(h), bu.has(h) || Zr.set(h, f);+ f.V.push(h), vu.has(h) || ea.set(h, f);});- for (let { V: h, M: u } of new Set(Zr.values())) {+ for (let { V: h, M: u } of new Set(ea.values())) {let d = [];for (let m of h) {- let g = fa.filter((p) => Qo(p, m)), A = d.find(({ G: p }) => g.some((y) => p.has(y)));+ let g = ma.filter((p) => Wo(p, m)), A = d.find(({ G: p }) => g.some((y) => p.has(y)));A || (A = { G: /* @__PURE__ */ new Set(), V: [] }, d.push(A)), A.V.push(m), n(A.G, g);}- let f = d.flatMap((m) => Fl(m.G));+ let f = d.flatMap((m) => Ul(m.G));for (let { G: m, V: g } of d) {let A = new Set(f.filter((p) => !m.has(p)));for (let p of g)u.set(p, A);}}- nr = /* @__PURE__ */ new Set();+ sr = /* @__PURE__ */ new Set();let c = /* @__PURE__ */ new Set();- const l = (h) => nr.has(h) ? c.add(h) : nr.add(h);- for (let h of fa) {+ const l = (h) => sr.has(h) ? c.add(h) : sr.add(h);+ for (let h of ma) {for (let u of h.P) l(u);for (let u of h.Q) l(u);}- for (let h of nr)- !Zr.has(h) && !c.has(h) && Zr.set(h, fx);- n(nr, hx(nr)), zg = nF(i).map((h) => gF.from(h)).sort(rF), Qd = /* @__PURE__ */ new Map();- for (let h of zg) {- let u = [Qd];+ for (let h of sr)+ !ea.has(h) && !c.has(h) && ea.set(h, _x);+ n(sr, bx(sr)), Yg = vF(i).map((h) => UF.from(h)).sort(IF), qd = /* @__PURE__ */ new Map();+ for (let h of Yg) {+ let u = [qd];for (let d of h) {let f = u.map((m) => {let g = m.get(d);return g || (g = /* @__PURE__ */ new Map(), m.set(d, g)), g;});- d === dx ? u.push(...f) : u = f;+ d === Ex ? u.push(...f) : u = f;}for (let d of u)d.V = h;}}-function Wf(i) {- return (gx(i) ? "" : `${qf(Zl([i]))} `) + sx(i);+function Jf(i) {+ return (vx(i) ? "" : `${Zf(sh([i]))} `) + dx(i);}-function qf(i) {+function Zf(i) {return `"${i}"`;}-function mF(i) {- if (i.length >= 4 && i[2] == Hg && i[3] == Hg)- throw new Error(`invalid label extension: "${Ma(i.slice(0, 4))}"`);+function OF(i) {+ if (i.length >= 4 && i[2] == Xg && i[3] == Xg)+ throw new Error(`invalid label extension: "${Na(i.slice(0, 4))}"`);}-function bF(i) {+function QF(i) {for (let t = i.lastIndexOf(95); t > 0; )if (i[--t] !== 95)throw new Error("underscore allowed only at start");}-function xF(i) {- let e = i[0], t = Og.get(e);- if (t) throw _o(`leading ${t}`);+function GF(i) {+ let e = i[0], t = qg.get(e);+ if (t) throw Co(`leading ${t}`);let n = i.length, s = -1;for (let r = 1; r < n; r++) {e = i[r];- let a = Og.get(e);+ let a = qg.get(e);if (a) {- if (s == r) throw _o(`${t} + ${a}`);+ if (s == r) throw Co(`${t} + ${a}`);s = r + 1, t = a;}}- if (s == n) throw _o(`trailing ${t}`);+ if (s == n) throw Co(`trailing ${t}`);}-function Zl(i, e = 1 / 0, t = sx) {+function sh(i, e = 1 / 0, t = dx) {let n = [];- EF(i[0]) && n.push("◌"), i.length > e && (e >>= 1, i = [...i.slice(0, e), 8230, ...i.slice(-e)]);+ HF(i[0]) && n.push("◌"), i.length > e && (e >>= 1, i = [...i.slice(0, e), 8230, ...i.slice(-e)]);let s = 0, r = i.length;for (let a = 0; a < r; a++) {let o = i[a];- gx(o) && (n.push(Ma(i.slice(s, a))), n.push(t(o)), s = a + 1);+ vx(o) && (n.push(Na(i.slice(s, a))), n.push(t(o)), s = a + 1);}- return n.push(Ma(i.slice(s, r))), n.join("");+ return n.push(Na(i.slice(s, r))), n.join("");}-function EF(i) {- return Vf(), dr.has(i);+function HF(i) {+ return Yf(), pr.has(i);}-function gx(i) {- return Vf(), Ax.has(i);+function vx(i) {+ return Yf(), wx.has(i);}-function _F(i) {- return vF(yF(i, AF, MF));+function zF(i) {+ return KF(VF(i, kF, YF));}-function yF(i, e, t) {+function VF(i, e, t) {if (!i) return [];- Vf();+ Yf();let n = 0;- return i.split(ux).map((s) => {- let r = sF(s), a = {+ return i.split(xx).map((s) => {+ let r = SF(s), a = {input: r,offset: n// codepoint, not substring!};n += r.length + 1;try {- let o = a.tokens = IF(r, e, t), c = o.length, l;+ let o = a.tokens = XF(r, e, t), c = o.length, l;if (!c)throw new Error("empty label");let h = a.output = o.flat();- if (bF(h), !(a.emoji = c > 1 || o[0].is_emoji) && h.every((d) => d < 128))- mF(h), l = "ASCII";+ if (QF(h), !(a.emoji = c > 1 || o[0].is_emoji) && h.every((d) => d < 128))+ OF(h), l = "ASCII";else {let d = o.flatMap((f) => f.is_emoji ? [] : f);if (!d.length)l = "Emoji";else {- if (dr.has(h[0])) throw _o("leading combining mark");+ if (pr.has(h[0])) throw Co("leading combining mark");for (let g = 1; g < c; g++) {let A = o[g];- if (!A.is_emoji && dr.has(A[0]))- throw _o(`emoji + combining mark: "${Ma(o[g - 1])} + ${Zl([A[0]])}"`);+ if (!A.is_emoji && pr.has(A[0]))+ throw Co(`emoji + combining mark: "${Na(o[g - 1])} + ${sh([A[0]])}"`);}- xF(h);- let f = Fl(new Set(d)), [m] = CF(f);- SF(m, d), wF(m, f), l = m.N;+ GF(h);+ let f = Ul(new Set(d)), [m] = qF(f);+ jF(m, d), WF(m, f), l = m.N;}}a.type = l;@@ -40105,173 +40457,173 @@ function yF(i, e, t) {return a;});}-function wF(i, e) {+function WF(i, e) {let t, n = [];for (let s of e) {- let r = Zr.get(s);- if (r === fx) return;+ let r = ea.get(s);+ if (r === _x) return;if (r) {let a = r.M.get(s);- if (t = t ? t.filter((o) => a.has(o)) : Fl(a), !t.length) return;+ if (t = t ? t.filter((o) => a.has(o)) : Ul(a), !t.length) return;} elsen.push(s);}if (t) {for (let s of t)- if (n.every((r) => Qo(s, r)))+ if (n.every((r) => Wo(s, r)))throw new Error(`whole-script confusable: ${i.N}/${s.N}`);}}-function CF(i) {- let e = fa;+function qF(i) {+ let e = ma;for (let t of i) {- let n = e.filter((s) => Qo(s, t));+ let n = e.filter((s) => Wo(s, t));if (!n.length)- throw fa.some((s) => Qo(s, t)) ? bx(e[0], t) : mx(t);+ throw ma.some((s) => Wo(s, t)) ? Sx(e[0], t) : Cx(t);if (e = n, n.length == 1) break;}return e;}-function vF(i) {+function KF(i) {return i.map(({ input: e, error: t, output: n }) => {if (t) {let s = t.message;- throw new Error(i.length == 1 ? s : `Invalid label ${qf(Zl(e, 63))}: ${s}`);+ throw new Error(i.length == 1 ? s : `Invalid label ${Zf(sh(e, 63))}: ${s}`);}- return Ma(n);- }).join(ux);+ return Na(n);+ }).join(xx);}-function mx(i) {- return new Error(`disallowed character: ${Wf(i)}`);+function Cx(i) {+ return new Error(`disallowed character: ${Jf(i)}`);}-function bx(i, e) {- let t = Wf(e), n = fa.find((s) => s.P.has(e));+function Sx(i, e) {+ let t = Jf(e), n = ma.find((s) => s.P.has(e));return n && (t = `${n.N} ${t}`), new Error(`illegal mixture: ${i.N} + ${t}`);}-function _o(i) {+function Co(i) {return new Error(`illegal placement: ${i}`);}-function SF(i, e) {+function jF(i, e) {for (let t of e)- if (!Qo(i, t))- throw bx(i, t);+ if (!Wo(i, t))+ throw Sx(i, t);if (i.M) {- let t = hx(e);+ let t = bx(e);for (let n = 1, s = t.length; n < s; n++)- if (Od.has(t[n])) {+ if (Wd.has(t[n])) {let r = n + 1;- for (let a; r < s && Od.has(a = t[r]); r++)+ for (let a; r < s && Wd.has(a = t[r]); r++)for (let o = n; o < r; o++)if (t[o] == a)- throw new Error(`duplicate non-spacing marks: ${Wf(a)}`);- if (r - n > Qg)- throw new Error(`excessive non-spacing marks: ${qf(Zl(t.slice(n - 1, r)))} (${r - n}/${Qg})`);+ throw new Error(`duplicate non-spacing marks: ${Jf(a)}`);+ if (r - n > Kg)+ throw new Error(`excessive non-spacing marks: ${Zf(sh(t.slice(n - 1, r)))} (${r - n}/${Kg})`);n = r;}}}-function IF(i, e, t) {+function XF(i, e, t) {let n = [], s = [];for (i = i.slice().reverse(); i.length; ) {- let r = BF(i);+ let r = JF(i);if (r)s.length && (n.push(e(s)), s = []), n.push(t(r));else {let a = i.pop();- if (nr.has(a))+ if (sr.has(a))s.push(a);else {- let o = Ud.get(a);+ let o = Vd.get(a);if (o)s.push(...o);- else if (!px.has(a))- throw mx(a);+ else if (!yx.has(a))+ throw Cx(a);}}}return s.length && n.push(e(s)), n;}-function MF(i) {- return i.filter((e) => e != dx);+function YF(i) {+ return i.filter((e) => e != Ex);}-function BF(i, e) {- let t = Qd, n, s = i.length;+function JF(i, e) {+ let t = qd, n, s = i.length;for (; s && (t = t.get(i[--s]), !!t); ) {let { V: r } = t;r && (n = r, i.length = s);}return n;}-const xx = new Uint8Array(32);-xx.fill(0);-function Vg(i) {+const Ix = new Uint8Array(32);+Ix.fill(0);+function Jg(i) {return V(i.length !== 0, "invalid ENS name; empty component", "comp", i), i;}-function Ex(i) {- const e = os(TF(i)), t = [];+function Mx(i) {+ const e = cs(ZF(i)), t = [];if (i.length === 0)return t;let n = 0;for (let s = 0; s < e.length; s++)- e[s] === 46 && (t.push(Vg(e.slice(n, s))), n = s + 1);- return V(n < e.length, "invalid ENS name; empty component", "name", i), t.push(Vg(e.slice(n))), t;+ e[s] === 46 && (t.push(Jg(e.slice(n, s))), n = s + 1);+ return V(n < e.length, "invalid ENS name; empty component", "name", i), t.push(Jg(e.slice(n))), t;}-function TF(i) {+function ZF(i) {try {if (i.length === 0)throw new Error("empty label");- return _F(i);+ return zF(i);} catch (e) {V(!1, `invalid ENS name (${e.message})`, "name", i);}}-function Gd(i) {+function Kd(i) {V(typeof i == "string", "invalid ENS name; not a string", "name", i), V(i.length, "invalid ENS name (empty label)", "name", i);- let e = xx;- const t = Ex(i);+ let e = Ix;+ const t = Mx(i);for (; t.length; )e = Zt(Ot([e, Zt(t.pop())]));return Se(e);}-function RF(i, e) {+function $F(i, e) {const t = e;- return V(t <= 255, "DNS encoded label cannot exceed 255", "length", t), Se(Ot(Ex(i).map((n) => {+ return V(t <= 255, "DNS encoded label cannot exceed 255", "length", t), Se(Ot(Mx(i).map((n) => {V(n.length <= t, `label ${JSON.stringify(i)} exceeds ${t} bytes`, "name", i);const s = new Uint8Array(n.length + 1);return s.set(n, 1), s[0] = s.length - 1, s;}))) + "00";}-const _x = new Uint8Array(32);-_x.fill(0);-const NF = BigInt(-1), yx = BigInt(0), wx = BigInt(1), FF = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");-function DF(i) {+const Bx = new Uint8Array(32);+Bx.fill(0);+const eD = BigInt(-1), Tx = BigInt(0), Rx = BigInt(1), tD = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");+function nD(i) {const e = ht(i), t = e.length % 32;- return t ? Ot([e, _x.slice(t)]) : Se(e);+ return t ? Ot([e, Bx.slice(t)]) : Se(e);}-const LF = Os(wx, 32), PF = Os(yx, 32), Wg = {+const iD = Gs(Rx, 32), sD = Gs(Tx, 32), Zg = {name: "string",version: "string",chainId: "uint256",verifyingContract: "address",salt: "bytes32"-}, xu = [+}, Cu = ["name","version","chainId","verifyingContract","salt"];-function qg(i) {+function $g(i) {return function(e) {return V(typeof e == "string", `invalid domain value for ${JSON.stringify(i)}`, `domain.${i}`, e), e;};}-const kF = {- name: qg("name"),- version: qg("version"),+const rD = {+ name: $g("name"),+ version: $g("version"),chainId: function(i) {const e = Fe(i, "domain.chainId");- return V(e >= 0, "invalid chain ID", "domain.chainId", i), Number.isSafeInteger(e) ? Number(e) : fi(e);+ return V(e >= 0, "invalid chain ID", "domain.chainId", i), Number.isSafeInteger(e) ? Number(e) : pi(e);},verifyingContract: function(i) {try {@@ -40285,16 +40637,16 @@ const kF = {return V(e.length === 32, 'invalid domain value "salt"', "domain.salt", i), Se(e);}};-function Eu(i) {+function Su(i) {{const e = i.match(/^(u?)int(\d+)$/);if (e) {const t = e[1] === "", n = parseInt(e[2]);V(n % 8 === 0 && n !== 0 && n <= 256 && e[2] === String(n), "invalid numeric width", "type", i);- const s = co(FF, t ? n - 1 : n), r = t ? (s + wx) * NF : yx;+ const s = fo(tD, t ? n - 1 : n), r = t ? (s + Rx) * eD : Tx;return function(a) {const o = Fe(a, "value");- return V(o >= r && o <= s, `value out-of-bounds for ${i}`, "value", o), Os(t ? ub(o, 256) : o, 32);+ return V(o >= r && o <= s, `value out-of-bounds for ${i}`, "value", o), Gs(t ? xb(o, 256) : o, 32);};}}@@ -40304,18 +40656,18 @@ function Eu(i) {const t = parseInt(e[1]);return V(t !== 0 && t <= 32 && e[1] === String(t), "invalid bytes width", "type", i), function(n) {const s = ht(n);- return V(s.length === t, `invalid length for ${i}`, "value", n), DF(n);+ return V(s.length === t, `invalid length for ${i}`, "value", n), nD(n);};}}switch (i) {case "address":return function(e) {- return us(St(e), 32);+ return ds(St(e), 32);};case "bool":return function(e) {- return e ? LF : PF;+ return e ? iD : sD;};case "bytes":return function(e) {@@ -40323,15 +40675,15 @@ function Eu(i) {};case "string":return function(e) {- return yr(e);+ return vr(e);};}return null;}-function Kg(i, e) {+function em(i, e) {return `${i}(${e.map(({ name: t, type: n }) => n + " " + t).join(",")})`;}-function Jc(i) {+function nl(i) {const e = i.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e ? {base: e[1],@@ -40374,7 +40726,7 @@ class qn {const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), r = {};Object.keys(e).forEach((c) => {r[c] = e[c].map(({ name: l, type: h }) => {- let { base: u, index: d } = Jc(h);+ let { base: u, index: d } = nl(h);return u === "int" && !e.int && (u = "int256"), u === "uint" && !e.uint && (u = "uint256"), { name: l, type: u + (d || "") };}), t.set(c, /* @__PURE__ */ new Set()), n.set(c, []), s.set(c, /* @__PURE__ */ new Set());}), this.#e = JSON.stringify(r);@@ -40382,12 +40734,12 @@ class qn {const l = /* @__PURE__ */ new Set();for (const h of r[c]) {V(!l.has(h.name), `duplicate variable name ${JSON.stringify(h.name)} in ${JSON.stringify(c)}`, "types", e), l.add(h.name);- const u = Jc(h.type).base;- V(u !== c, `circular type reference to ${JSON.stringify(u)}`, "types", e), !Eu(u) && (V(n.has(u), `unknown type ${JSON.stringify(u)}`, "types", e), n.get(u).push(c), t.get(c).add(u));+ const u = nl(h.type).base;+ V(u !== c, `circular type reference to ${JSON.stringify(u)}`, "types", e), !Su(u) && (V(n.has(u), `unknown type ${JSON.stringify(u)}`, "types", e), n.get(u).push(c), t.get(c).add(u));}}const a = Array.from(n.keys()).filter((c) => n.get(c).length === 0);- V(a.length !== 0, "missing primary type", "types", e), V(a.length === 1, `ambiguous primary types or unused types: ${a.map((c) => JSON.stringify(c)).join(", ")}`, "types", e), Ye(this, { primaryType: a[0] });+ V(a.length !== 0, "missing primary type", "types", e), V(a.length === 1, `ambiguous primary types or unused types: ${a.map((c) => JSON.stringify(c)).join(", ")}`, "types", e), Xe(this, { primaryType: a[0] });function o(c, l) {V(!l.has(c), `circular type reference to ${JSON.stringify(c)}`, "types", e), l.add(c);for (const h of t.get(c))@@ -40401,7 +40753,7 @@ class qn {o(this.primaryType, /* @__PURE__ */ new Set());for (const [c, l] of s) {const h = Array.from(l);- h.sort(), this.#t.set(c, Kg(c, r[c]) + h.map((u) => Kg(u, r[u])).join(""));+ h.sort(), this.#t.set(c, em(c, r[c]) + h.map((u) => em(u, r[u])).join(""));}}/**@@ -40413,11 +40765,11 @@ class qn {}#i(e) {{- const s = Eu(e);+ const s = Su(e);if (s)return s;}- const t = Jc(e).array;+ const t = nl(e).array;if (t) {const s = t.prefix, r = this.getEncoder(s);return (a) => {@@ -40428,7 +40780,7 @@ class qn {}const n = this.types[e];if (n) {- const s = yr(this.#t.get(e));+ const s = vr(this.#t.get(e));return (r) => {const a = n.map(({ name: o, type: c }) => {const l = this.getEncoder(c)(r[o]);@@ -40474,9 +40826,9 @@ class qn {* @_ignore:*/_visit(e, t, n) {- if (Eu(e))+ if (Su(e))return n(e, t);- const s = Jc(e).array;+ const s = nl(e).array;if (s)return V(s.count === -1 || s.count === t.length, `array length mismatch; expected length ${s.count}`, "value", t), t.map((a) => this._visit(s.prefix, a, n));const r = this.types[e];@@ -40520,10 +40872,10 @@ class qn {for (const n in e) {if (e[n] == null)continue;- const s = Wg[n];+ const s = Zg[n];V(s, `invalid typed-data domain key: ${JSON.stringify(n)}`, "domain", e), t.push({ name: n, type: s });}- return t.sort((n, s) => xu.indexOf(n.name) - xu.indexOf(s.name)), qn.hashStruct("EIP712Domain", { EIP712Domain: t }, e);+ return t.sort((n, s) => Cu.indexOf(n.name) - Cu.indexOf(s.name)), qn.hashStruct("EIP712Domain", { EIP712Domain: t }, e);}/*** Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.@@ -40565,9 +40917,9 @@ class qn {static getPayload(e, t, n) {qn.hashDomain(e);const s = {}, r = [];- xu.forEach((c) => {+ Cu.forEach((c) => {const l = e[c];- l != null && (s[c] = kF[c](l), r.push({ name: c, type: Wg[c] }));+ l != null && (s[c] = rD[c](l), r.push({ name: c, type: Zg[c] }));});const a = qn.from(t);t = a.types;@@ -40598,15 +40950,15 @@ function Dn(i) {const e = /* @__PURE__ */ new Set();return i.forEach((t) => e.add(t)), Object.freeze(e);}-const UF = "external public payable override", OF = Dn(UF.split(" ")), Cx = "constant external internal payable private public pure view override", QF = Dn(Cx.split(" ")), vx = "constructor error event fallback function receive struct", Sx = Dn(vx.split(" ")), Ix = "calldata memory storage payable indexed", GF = Dn(Ix.split(" ")), HF = "tuple returns", zF = [vx, Ix, HF, Cx].join(" "), VF = Dn(zF.split(" ")), WF = {+const aD = "external public payable override", oD = Dn(aD.split(" ")), Nx = "constant external internal payable private public pure view override", cD = Dn(Nx.split(" ")), Fx = "constructor error event fallback function receive struct", Dx = Dn(Fx.split(" ")), Lx = "calldata memory storage payable indexed", lD = Dn(Lx.split(" ")), hD = "tuple returns", uD = [Fx, Lx, hD, Nx].join(" "), dD = Dn(uD.split(" ")), fD = {"(": "OPEN_PAREN",")": "CLOSE_PAREN","[": "OPEN_BRACKET","]": "CLOSE_BRACKET",",": "COMMA","@": "AT"-}, qF = new RegExp("^(\\s*)"), KF = new RegExp("^([0-9]+)"), XF = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"), Mx = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"), Bx = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");-class si {+}, pD = new RegExp("^(\\s*)"), AD = new RegExp("^([0-9]+)"), gD = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"), Px = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"), kx = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");+class ri {#e;#t;get offset() {@@ -40619,13 +40971,13 @@ class si {this.#e = 0, this.#t = e.slice();}clone() {- return new si(this.#t);+ return new ri(this.#t);}reset() {this.#e = 0;}#n(e = 0, t = 0) {- return new si(this.#t.slice(e, t).map((n) => Object.freeze(Object.assign({}, n, {+ return new ri(this.#t.slice(e, t).map((n) => Object.freeze(Object.assign({}, n, {match: n.match - e,linkBack: n.linkBack - e,linkNext: n.linkNext - e@@ -40698,18 +41050,18 @@ class si {return `<TokenString ${e.join(" ")}>`;}}-function zs(i) {+function Ws(i) {const e = [], t = (a) => {const o = r < i.length ? JSON.stringify(i[r]) : "$EOI";throw new Error(`invalid token ${o} at ${r}: ${a}`);};let n = [], s = [], r = 0;for (; r < i.length; ) {- let a = i.substring(r), o = a.match(qF);+ let a = i.substring(r), o = a.match(pD);o && (r += o[1].length, a = i.substring(r));const c = { depth: n.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset: r, value: -1 };e.push(c);- let l = WF[a[0]] || "";+ let l = fD[a[0]] || "";if (l) {if (c.type = l, c.text = a[0], r++, l === "OPEN_PAREN")n.push(e.length - 1), s.push(e.length - 1);@@ -40731,42 +41083,42 @@ function zs(i) {}continue;}- if (o = a.match(XF), o) {- if (c.text = o[1], r += c.text.length, VF.has(c.text)) {+ if (o = a.match(gD), o) {+ if (c.text = o[1], r += c.text.length, dD.has(c.text)) {c.type = "KEYWORD";continue;}- if (c.text.match(Bx)) {+ if (c.text.match(kx)) {c.type = "TYPE";continue;}c.type = "ID";continue;}- if (o = a.match(KF), o) {+ if (o = a.match(AD), o) {c.text = o[1], c.type = "NUMBER", r += c.text.length;continue;}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${r}`);}- return new si(e.map((a) => Object.freeze(a)));+ return new ri(e.map((a) => Object.freeze(a)));}-function Xg(i, e) {+function tm(i, e) {let t = [];for (const n in e.keys())i.has(n) && t.push(n);if (t.length > 1)throw new Error(`conflicting types: ${t.join(", ")}`);}-function $l(i, e) {- if (e.peekKeyword(Sx)) {+function rh(i, e) {+ if (e.peekKeyword(Dx)) {const t = e.pop().text;if (t !== i)throw new Error(`expected ${i}, got ${t}`);}return e.popType("ID");}-function ds(i, e) {+function fs(i, e) {const t = /* @__PURE__ */ new Set();for (; ; ) {const n = i.peekType("KEYWORD");@@ -40778,14 +41130,14 @@ function ds(i, e) {}return Object.freeze(t);}-function Tx(i) {- let e = ds(i, QF);- return Xg(e, Dn("constant payable nonpayable".split(" "))), Xg(e, Dn("pure view payable nonpayable".split(" "))), e.has("view") ? "view" : e.has("pure") ? "pure" : e.has("payable") ? "payable" : e.has("nonpayable") ? "nonpayable" : e.has("constant") ? "view" : "nonpayable";+function Ux(i) {+ let e = fs(i, cD);+ return tm(e, Dn("constant payable nonpayable".split(" "))), tm(e, Dn("pure view payable nonpayable".split(" "))), e.has("view") ? "view" : e.has("pure") ? "pure" : e.has("payable") ? "payable" : e.has("nonpayable") ? "nonpayable" : e.has("constant") ? "view" : "nonpayable";}-function ls(i, e) {+function hs(i, e) {return i.popParams().map((t) => Ft.from(t, e));}-function Rx(i) {+function Ox(i) {if (i.peekType("AT")) {if (i.pop(), i.peekType("NUMBER"))return Fe(i.pop().text);@@ -40793,13 +41145,13 @@ function Rx(i) {}return null;}-function wr(i) {+function Cr(i) {if (i.length)throw new Error(`unexpected tokens at offset ${i.offset}: ${i.toString()}`);}-const YF = new RegExp(/^(.*)\[([0-9]*)\]$/);-function Yg(i) {- const e = i.match(Bx);+const mD = new RegExp(/^(.*)\[([0-9]*)\]$/);+function nm(i) {+ const e = i.match(kx);if (V(e, "invalid type", "type", i), i === "uint")return "uint256";if (i === "int")@@ -40813,7 +41165,7 @@ function Yg(i) {}return i;}-const Ht = {}, Gn = /* @__PURE__ */ Symbol.for("_ethers_internal"), jg = "_ParamTypeInternal", Jg = "_ErrorInternal", Zg = "_EventInternal", $g = "_ConstructorInternal", em = "_FallbackInternal", tm = "_FunctionInternal", nm = "_StructInternal";+const Ht = {}, Gn = /* @__PURE__ */ Symbol.for("_ethers_internal"), im = "_ParamTypeInternal", sm = "_ErrorInternal", rm = "_EventInternal", am = "_ConstructorInternal", om = "_FallbackInternal", cm = "_FunctionInternal", lm = "_StructInternal";class Ft {/*** The local name of the parameter (or ``""`` if unbound)@@ -40856,7 +41208,7 @@ class Ft {* @private*/constructor(e, t, n, s, r, a, o, c) {- if (Wl(e, Ht, "ParamType"), Object.defineProperty(this, Gn, { value: jg }), a && (a = Object.freeze(a.slice())), s === "array") {+ if (Jl(e, Ht, "ParamType"), Object.defineProperty(this, Gn, { value: im }), a && (a = Object.freeze(a.slice())), s === "array") {if (o == null || c == null)throw new Error("");} else if (o != null || c != null)@@ -40866,7 +41218,7 @@ class Ft {throw new Error("");} else if (a != null)throw new Error("");- Ye(this, {+ Xe(this, {name: t,type: n,baseType: s,@@ -41021,20 +41373,20 @@ class Ft {return e;if (typeof e == "string")try {- return Ft.from(zs(e), t);+ return Ft.from(Ws(e), t);} catch {V(!1, "invalid param type", "obj", e);}- else if (e instanceof si) {+ else if (e instanceof ri) {let o = "", c = "", l = null;- ds(e, Dn(["tuple"])).has("tuple") || e.peekType("OPEN_PAREN") ? (c = "tuple", l = e.popParams().map((g) => Ft.from(g)), o = `tuple(${l.map((g) => g.format()).join(",")})`) : (o = Yg(e.popType("TYPE")), c = o);+ fs(e, Dn(["tuple"])).has("tuple") || e.peekType("OPEN_PAREN") ? (c = "tuple", l = e.popParams().map((g) => Ft.from(g)), o = `tuple(${l.map((g) => g.format()).join(",")})`) : (o = nm(e.popType("TYPE")), c = o);let h = null, u = null;for (; e.length && e.peekType("BRACKET"); ) {const g = e.pop();h = new Ft(Ht, "", o, c, null, l, u, h), u = g.value, o += g.text, c = "array", l = null;}let d = null;- if (ds(e, GF).has("indexed")) {+ if (fs(e, lD).has("indexed")) {if (!t)throw new Error("");d = !0;@@ -41045,10 +41397,10 @@ class Ft {return new Ft(Ht, m, o, c, d, l, u, h);}const n = e.name;- V(!n || typeof n == "string" && n.match(Mx), "invalid name", "obj.name", n);+ V(!n || typeof n == "string" && n.match(Px), "invalid name", "obj.name", n);let s = e.indexed;s != null && (V(t, "parameter cannot be indexed", "obj.indexed", e.indexed), s = !!s);- let r = e.type, a = r.match(YF);+ let r = e.type, a = r.match(mD);if (a) {const o = parseInt(a[2] || "-1"), c = Ft.from({type: a[1],@@ -41066,16 +41418,16 @@ class Ft {const o = e.components != null ? e.components.map((l) => Ft.from(l)) : null;return new Ft(Ht, n || "", r, "tuple", s, o, null, null);}- return r = Yg(e.type), new Ft(Ht, n || "", r, r, s, null, null, null);+ return r = nm(e.type), new Ft(Ht, n || "", r, r, s, null, null, null);}/*** Returns true if %%value%% is a **ParamType**.*/static isParamType(e) {- return e && e[Gn] === jg;+ return e && e[Gn] === im;}}-class Cr {+class Sr {/*** The type of the fragment.*/@@ -41088,7 +41440,7 @@ class Cr {* @private*/constructor(e, t, n) {- Wl(e, Ht, "Fragment"), n = Object.freeze(n.slice()), Ye(this, { type: t, inputs: n });+ Jl(e, Ht, "Fragment"), n = Object.freeze(n.slice()), Xe(this, { type: t, inputs: n });}/*** Creates a new **Fragment** for %%obj%%, wich can be any supported@@ -41097,42 +41449,42 @@ class Cr {static from(e) {if (typeof e == "string") {try {- Cr.from(JSON.parse(e));+ Sr.from(JSON.parse(e));} catch {}- return Cr.from(zs(e));+ return Sr.from(Ws(e));}- if (e instanceof si)- switch (e.peekKeyword(Sx)) {+ if (e instanceof ri)+ switch (e.peekKeyword(Dx)) {case "constructor":- return rs.from(e);+ return as.from(e);case "error":return Qn.from(e);case "event":- return Ti.from(e);+ return Ri.from(e);case "fallback":case "receive":- return ji.from(e);+ return Ji.from(e);case "function":- return Ri.from(e);+ return Ni.from(e);case "struct":- return Ar.from(e);+ return mr.from(e);}else if (typeof e == "object") {switch (e.type) {case "constructor":- return rs.from(e);+ return as.from(e);case "error":return Qn.from(e);case "event":- return Ti.from(e);+ return Ri.from(e);case "fallback":case "receive":- return ji.from(e);+ return Ji.from(e);case "function":- return Ri.from(e);+ return Ni.from(e);case "struct":- return Ar.from(e);+ return mr.from(e);}ge(!1, `unsupported type: ${e.type}`, "UNSUPPORTED_OPERATION", {operation: "Fragment.from"@@ -41144,7 +41496,7 @@ class Cr {* Returns true if %%value%% is a [[ConstructorFragment]].*/static isConstructor(e) {- return rs.isFragment(e);+ return as.isFragment(e);}/*** Returns true if %%value%% is an [[ErrorFragment]].@@ -41156,22 +41508,22 @@ class Cr {* Returns true if %%value%% is an [[EventFragment]].*/static isEvent(e) {- return Ti.isFragment(e);+ return Ri.isFragment(e);}/*** Returns true if %%value%% is a [[FunctionFragment]].*/static isFunction(e) {- return Ri.isFragment(e);+ return Ni.isFragment(e);}/*** Returns true if %%value%% is a [[StructFragment]].*/static isStruct(e) {- return Ar.isFragment(e);+ return mr.isFragment(e);}}-class eh extends Cr {+class ah extends Sr {/*** The name of the fragment.*/@@ -41180,24 +41532,24 @@ class eh extends Cr {* @private*/constructor(e, t, n, s) {- super(e, t, s), V(typeof n == "string" && n.match(Mx), "invalid identifier", "name", n), s = Object.freeze(s.slice()), Ye(this, { name: n });+ super(e, t, s), V(typeof n == "string" && n.match(Px), "invalid identifier", "name", n), s = Object.freeze(s.slice()), Xe(this, { name: n });}}-function Go(i, e) {+function qo(i, e) {return "(" + e.map((t) => t.format(i)).join(i === "full" ? ", " : ",") + ")";}-class Qn extends eh {+class Qn extends ah {/*** @private*/constructor(e, t, n) {- super(e, "error", t, n), Object.defineProperty(this, Gn, { value: Jg });+ super(e, "error", t, n), Object.defineProperty(this, Gn, { value: sm });}/*** The Custom Error selector.*/get selector() {- return yr(this.format("sighash")).substring(0, 10);+ return vr(this.format("sighash")).substring(0, 10);}/*** Returns a string representation of this fragment as %%format%%.@@ -41210,7 +41562,7 @@ class Qn extends eh {inputs: this.inputs.map((n) => JSON.parse(n.format(e)))});const t = [];- return e !== "sighash" && t.push("error"), t.push(this.name + Go(e, this.inputs)), t.join(" ");+ return e !== "sighash" && t.push("error"), t.push(this.name + qo(e, this.inputs)), t.join(" ");}/*** Returns a new **ErrorFragment** for %%obj%%.@@ -41219,10 +41571,10 @@ class Qn extends eh {if (Qn.isFragment(e))return e;if (typeof e == "string")- return Qn.from(zs(e));- if (e instanceof si) {- const t = $l("error", e), n = ls(e);- return wr(e), new Qn(Ht, t, n);+ return Qn.from(Ws(e));+ if (e instanceof ri) {+ const t = rh("error", e), n = hs(e);+ return Cr(e), new Qn(Ht, t, n);}return new Qn(Ht, e.name, e.inputs ? e.inputs.map(Ft.from) : []);}@@ -41231,10 +41583,10 @@ class Qn extends eh {* **ErrorFragment**.*/static isFragment(e) {- return e && e[Gn] === Jg;+ return e && e[Gn] === sm;}}-class Ti extends eh {+class Ri extends ah {/*** Whether this event is anonymous.*/@@ -41243,13 +41595,13 @@ class Ti extends eh {* @private*/constructor(e, t, n, s) {- super(e, "event", t, n), Object.defineProperty(this, Gn, { value: Zg }), Ye(this, { anonymous: s });+ super(e, "event", t, n), Object.defineProperty(this, Gn, { value: rm }), Xe(this, { anonymous: s });}/*** The Event topic hash.*/get topicHash() {- return yr(this.format("sighash"));+ return vr(this.format("sighash"));}/*** Returns a string representation of this event as %%format%%.@@ -41263,41 +41615,41 @@ class Ti extends eh {inputs: this.inputs.map((n) => JSON.parse(n.format(e)))});const t = [];- return e !== "sighash" && t.push("event"), t.push(this.name + Go(e, this.inputs)), e !== "sighash" && this.anonymous && t.push("anonymous"), t.join(" ");+ return e !== "sighash" && t.push("event"), t.push(this.name + qo(e, this.inputs)), e !== "sighash" && this.anonymous && t.push("anonymous"), t.join(" ");}/*** Return the topic hash for an event with %%name%% and %%params%%.*/static getTopicHash(e, t) {- return t = (t || []).map((s) => Ft.from(s)), new Ti(Ht, e, t, !1).topicHash;+ return t = (t || []).map((s) => Ft.from(s)), new Ri(Ht, e, t, !1).topicHash;}/*** Returns a new **EventFragment** for %%obj%%.*/static from(e) {- if (Ti.isFragment(e))+ if (Ri.isFragment(e))return e;if (typeof e == "string")try {- return Ti.from(zs(e));+ return Ri.from(Ws(e));} catch {V(!1, "invalid event fragment", "obj", e);}- else if (e instanceof si) {- const t = $l("event", e), n = ls(e, !0), s = !!ds(e, Dn(["anonymous"])).has("anonymous");- return wr(e), new Ti(Ht, t, n, s);+ else if (e instanceof ri) {+ const t = rh("event", e), n = hs(e, !0), s = !!fs(e, Dn(["anonymous"])).has("anonymous");+ return Cr(e), new Ri(Ht, t, n, s);}- return new Ti(Ht, e.name, e.inputs ? e.inputs.map((t) => Ft.from(t, !0)) : [], !!e.anonymous);+ return new Ri(Ht, e.name, e.inputs ? e.inputs.map((t) => Ft.from(t, !0)) : [], !!e.anonymous);}/*** Returns ``true`` and provides a type guard if %%value%% is an* **EventFragment**.*/static isFragment(e) {- return e && e[Gn] === Zg;+ return e && e[Gn] === rm;}}-class rs extends Cr {+class as extends Sr {/*** Whether the constructor can receive an endowment.*/@@ -41310,7 +41662,7 @@ class rs extends Cr {* @private*/constructor(e, t, n, s, r) {- super(e, t, n), Object.defineProperty(this, Gn, { value: $g }), Ye(this, { payable: s, gas: r });+ super(e, t, n), Object.defineProperty(this, Gn, { value: am }), Xe(this, { payable: s, gas: r });}/*** Returns a string representation of this constructor as %%format%%.@@ -41324,43 +41676,43 @@ class rs extends Cr {gas: this.gas != null ? this.gas : void 0,inputs: this.inputs.map((n) => JSON.parse(n.format(e)))});- const t = [`constructor${Go(e, this.inputs)}`];+ const t = [`constructor${qo(e, this.inputs)}`];return this.payable && t.push("payable"), this.gas != null && t.push(`@${this.gas.toString()}`), t.join(" ");}/*** Returns a new **ConstructorFragment** for %%obj%%.*/static from(e) {- if (rs.isFragment(e))+ if (as.isFragment(e))return e;if (typeof e == "string")try {- return rs.from(zs(e));+ return as.from(Ws(e));} catch {V(!1, "invalid constuctor fragment", "obj", e);}- else if (e instanceof si) {- ds(e, Dn(["constructor"]));- const t = ls(e), n = !!ds(e, OF).has("payable"), s = Rx(e);- return wr(e), new rs(Ht, "constructor", t, n, s);+ else if (e instanceof ri) {+ fs(e, Dn(["constructor"]));+ const t = hs(e), n = !!fs(e, oD).has("payable"), s = Ox(e);+ return Cr(e), new as(Ht, "constructor", t, n, s);}- return new rs(Ht, "constructor", e.inputs ? e.inputs.map(Ft.from) : [], !!e.payable, e.gas != null ? e.gas : null);+ return new as(Ht, "constructor", e.inputs ? e.inputs.map(Ft.from) : [], !!e.payable, e.gas != null ? e.gas : null);}/*** Returns ``true`` and provides a type guard if %%value%% is a* **ConstructorFragment**.*/static isFragment(e) {- return e && e[Gn] === $g;+ return e && e[Gn] === am;}}-class ji extends Cr {+class Ji extends Sr {/*** If the function can be sent value during invocation.*/payable;constructor(e, t, n) {- super(e, "fallback", t), Object.defineProperty(this, Gn, { value: em }), Ye(this, { payable: n });+ super(e, "fallback", t), Object.defineProperty(this, Gn, { value: om }), Xe(this, { payable: n });}/*** Returns a string representation of this fallback as %%format%%.@@ -41377,34 +41729,34 @@ class ji extends Cr {* Returns a new **FallbackFragment** for %%obj%%.*/static from(e) {- if (ji.isFragment(e))+ if (Ji.isFragment(e))return e;if (typeof e == "string")try {- return ji.from(zs(e));+ return Ji.from(Ws(e));} catch {V(!1, "invalid fallback fragment", "obj", e);}- else if (e instanceof si) {+ else if (e instanceof ri) {const t = e.toString(), n = e.peekKeyword(Dn(["fallback", "receive"]));if (V(n, "type must be fallback or receive", "obj", t), e.popKeyword(Dn(["fallback", "receive"])) === "receive") {- const o = ls(e);- return V(o.length === 0, "receive cannot have arguments", "obj.inputs", o), ds(e, Dn(["payable"])), wr(e), new ji(Ht, [], !0);+ const o = hs(e);+ return V(o.length === 0, "receive cannot have arguments", "obj.inputs", o), fs(e, Dn(["payable"])), Cr(e), new Ji(Ht, [], !0);}- let r = ls(e);+ let r = hs(e);r.length ? V(r.length === 1 && r[0].type === "bytes", "invalid fallback inputs", "obj.inputs", r.map((o) => o.format("minimal")).join(", ")) : r = [Ft.from("bytes")];- const a = Tx(e);- if (V(a === "nonpayable" || a === "payable", "fallback cannot be constants", "obj.stateMutability", a), ds(e, Dn(["returns"])).has("returns")) {- const o = ls(e);+ const a = Ux(e);+ if (V(a === "nonpayable" || a === "payable", "fallback cannot be constants", "obj.stateMutability", a), fs(e, Dn(["returns"])).has("returns")) {+ const o = hs(e);V(o.length === 1 && o[0].type === "bytes", "invalid fallback outputs", "obj.outputs", o.map((c) => c.format("minimal")).join(", "));}- return wr(e), new ji(Ht, r, a === "payable");+ return Cr(e), new Ji(Ht, r, a === "payable");}if (e.type === "receive")- return new ji(Ht, [], !0);+ return new Ji(Ht, [], !0);if (e.type === "fallback") {const t = [Ft.from("bytes")], n = e.stateMutability === "payable";- return new ji(Ht, t, n);+ return new Ji(Ht, t, n);}V(!1, "invalid fallback description", "obj", e);}@@ -41413,10 +41765,10 @@ class ji extends Cr {* **FallbackFragment**.*/static isFragment(e) {- return e && e[Gn] === em;+ return e && e[Gn] === om;}}-class Ri extends eh {+class Ni extends ah {/*** If the function is constant (e.g. ``pure`` or ``view`` functions).*/@@ -41442,13 +41794,13 @@ class Ri extends eh {* @private*/constructor(e, t, n, s, r, a) {- super(e, "function", t, s), Object.defineProperty(this, Gn, { value: tm }), r = Object.freeze(r.slice()), Ye(this, { constant: n === "view" || n === "pure", gas: a, outputs: r, payable: n === "payable", stateMutability: n });+ super(e, "function", t, s), Object.defineProperty(this, Gn, { value: cm }), r = Object.freeze(r.slice()), Xe(this, { constant: n === "view" || n === "pure", gas: a, outputs: r, payable: n === "payable", stateMutability: n });}/*** The Function selector.*/get selector() {- return yr(this.format("sighash")).substring(0, 10);+ return vr(this.format("sighash")).substring(0, 10);}/*** Returns a string representation of this function as %%format%%.@@ -41466,50 +41818,50 @@ class Ri extends eh {outputs: this.outputs.map((n) => JSON.parse(n.format(e)))});const t = [];- return e !== "sighash" && t.push("function"), t.push(this.name + Go(e, this.inputs)), e !== "sighash" && (this.stateMutability !== "nonpayable" && t.push(this.stateMutability), this.outputs && this.outputs.length && (t.push("returns"), t.push(Go(e, this.outputs))), this.gas != null && t.push(`@${this.gas.toString()}`)), t.join(" ");+ return e !== "sighash" && t.push("function"), t.push(this.name + qo(e, this.inputs)), e !== "sighash" && (this.stateMutability !== "nonpayable" && t.push(this.stateMutability), this.outputs && this.outputs.length && (t.push("returns"), t.push(qo(e, this.outputs))), this.gas != null && t.push(`@${this.gas.toString()}`)), t.join(" ");}/*** Return the selector for a function with %%name%% and %%params%%.*/static getSelector(e, t) {- return t = (t || []).map((s) => Ft.from(s)), new Ri(Ht, e, "view", t, [], null).selector;+ return t = (t || []).map((s) => Ft.from(s)), new Ni(Ht, e, "view", t, [], null).selector;}/*** Returns a new **FunctionFragment** for %%obj%%.*/static from(e) {- if (Ri.isFragment(e))+ if (Ni.isFragment(e))return e;if (typeof e == "string")try {- return Ri.from(zs(e));+ return Ni.from(Ws(e));} catch {V(!1, "invalid function fragment", "obj", e);}- else if (e instanceof si) {- const n = $l("function", e), s = ls(e), r = Tx(e);+ else if (e instanceof ri) {+ const n = rh("function", e), s = hs(e), r = Ux(e);let a = [];- ds(e, Dn(["returns"])).has("returns") && (a = ls(e));- const o = Rx(e);- return wr(e), new Ri(Ht, n, r, s, a, o);+ fs(e, Dn(["returns"])).has("returns") && (a = hs(e));+ const o = Ox(e);+ return Cr(e), new Ni(Ht, n, r, s, a, o);}let t = e.stateMutability;- return t == null && (t = "payable", typeof e.constant == "boolean" ? (t = "view", e.constant || (t = "payable", typeof e.payable == "boolean" && !e.payable && (t = "nonpayable"))) : typeof e.payable == "boolean" && !e.payable && (t = "nonpayable")), new Ri(Ht, e.name, t, e.inputs ? e.inputs.map(Ft.from) : [], e.outputs ? e.outputs.map(Ft.from) : [], e.gas != null ? e.gas : null);+ return t == null && (t = "payable", typeof e.constant == "boolean" ? (t = "view", e.constant || (t = "payable", typeof e.payable == "boolean" && !e.payable && (t = "nonpayable"))) : typeof e.payable == "boolean" && !e.payable && (t = "nonpayable")), new Ni(Ht, e.name, t, e.inputs ? e.inputs.map(Ft.from) : [], e.outputs ? e.outputs.map(Ft.from) : [], e.gas != null ? e.gas : null);}/*** Returns ``true`` and provides a type guard if %%value%% is a* **FunctionFragment**.*/static isFragment(e) {- return e && e[Gn] === tm;+ return e && e[Gn] === cm;}}-class Ar extends eh {+class mr extends ah {/*** @private*/constructor(e, t, n) {- super(e, "struct", t, n), Object.defineProperty(this, Gn, { value: nm });+ super(e, "struct", t, n), Object.defineProperty(this, Gn, { value: lm });}/*** Returns a string representation of this struct as %%format%%.@@ -41523,15 +41875,15 @@ class Ar extends eh {static from(e) {if (typeof e == "string")try {- return Ar.from(zs(e));+ return mr.from(Ws(e));} catch {V(!1, "invalid struct fragment", "obj", e);}- else if (e instanceof si) {- const t = $l("struct", e), n = ls(e);- return wr(e), new Ar(Ht, t, n);+ else if (e instanceof ri) {+ const t = rh("struct", e), n = hs(e);+ return Cr(e), new mr(Ht, t, n);}- return new Ar(Ht, e.name, e.inputs ? e.inputs.map(Ft.from) : []);+ return new mr(Ht, e.name, e.inputs ? e.inputs.map(Ft.from) : []);}// @TODO: fix this return type/**@@ -41539,23 +41891,23 @@ class Ar extends eh {* **StructFragment**.*/static isFragment(e) {- return e && e[Gn] === nm;- }-}-const wi = /* @__PURE__ */ new Map();-wi.set(0, "GENERIC_PANIC");-wi.set(1, "ASSERT_FALSE");-wi.set(17, "OVERFLOW");-wi.set(18, "DIVIDE_BY_ZERO");-wi.set(33, "ENUM_RANGE_ERROR");-wi.set(34, "BAD_STORAGE_DATA");-wi.set(49, "STACK_UNDERFLOW");-wi.set(50, "ARRAY_RANGE_ERROR");-wi.set(65, "OUT_OF_MEMORY");-wi.set(81, "UNINITIALIZED_FUNCTION_CALL");-const jF = new RegExp(/^bytes([0-9]*)$/), JF = new RegExp(/^(u?int)([0-9]*)$/);-let _u = null, im = 1024;-function ZF(i, e, t, n) {+ return e && e[Gn] === lm;+ }+}+const vi = /* @__PURE__ */ new Map();+vi.set(0, "GENERIC_PANIC");+vi.set(1, "ASSERT_FALSE");+vi.set(17, "OVERFLOW");+vi.set(18, "DIVIDE_BY_ZERO");+vi.set(33, "ENUM_RANGE_ERROR");+vi.set(34, "BAD_STORAGE_DATA");+vi.set(49, "STACK_UNDERFLOW");+vi.set(50, "ARRAY_RANGE_ERROR");+vi.set(65, "OUT_OF_MEMORY");+vi.set(81, "UNINITIALIZED_FUNCTION_CALL");+const bD = new RegExp(/^bytes([0-9]*)$/), xD = new RegExp(/^(u?int)([0-9]*)$/);+let Iu = null, hm = 1024;+function ED(i, e, t, n) {let s = "missing revert data", r = null;const a = null;let o = null;@@ -41583,7 +41935,7 @@ function ZF(i, e, t, n) {signature: "Panic(uint256)",name: "Panic",args: [h]- }, r = `Panic due to ${wi.get(h) || "UNKNOWN"}(${h})`, s += `: ${r}`;+ }, r = `Panic due to ${vi.get(h) || "UNKNOWN"}(${h})`, s += `: ${r}`;} catch {s += " (could not decode panic code)";}@@ -41603,32 +41955,32 @@ function ZF(i, e, t, n) {revert: o});}-class Ta {+class Da {#e(e) {if (e.isArray())- return new AN(this.#e(e.arrayChildren), e.arrayLength, e.name);+ return new kN(this.#e(e.arrayChildren), e.arrayLength, e.name);if (e.isTuple())- return new jc(e.components.map((n) => this.#e(n)), e.name);+ return new tl(e.components.map((n) => this.#e(n)), e.name);switch (e.baseType) {case "address":- return new fN(e.name);+ return new LN(e.name);case "bool":- return new gN(e.name);+ return new UN(e.name);case "string":- return new vN(e.name);+ return new KN(e.name);case "bytes":- return new mN(e.name);+ return new ON(e.name);case "":- return new EN(e.name);+ return new HN(e.name);}- let t = e.type.match(JF);+ let t = e.type.match(xD);if (t) {let n = parseInt(t[2] || "256");- return V(n !== 0 && n <= 256 && n % 8 === 0, "invalid " + t[1] + " bit length", "param", e), new CN(n / 8, t[1] === "int", e.name);+ return V(n !== 0 && n <= 256 && n % 8 === 0, "invalid " + t[1] + " bit length", "param", e), new qN(n / 8, t[1] === "int", e.name);}- if (t = e.type.match(jF), t) {+ if (t = e.type.match(bD), t) {let n = parseInt(t[1]);- return V(n !== 0 && n <= 32, "invalid bytes length", "param", e), new bN(n, e.name);+ return V(n !== 0 && n <= 32, "invalid bytes length", "param", e), new QN(n, e.name);}V(!1, "invalid type", "type", e.type);}@@ -41640,7 +41992,7 @@ class Ta {*/getDefaultValue(e) {const t = e.map((s) => this.#e(Ft.from(s)));- return new jc(t, "_").defaultValue();+ return new tl(t, "_").defaultValue();}/*** Encode the %%values%% as the %%types%% into ABI data.@@ -41648,8 +42000,8 @@ class Ta {* @returns DataHexstring*/encode(e, t) {- cb(t.length, e.length, "types/values length mismatch");- const n = e.map((a) => this.#e(Ft.from(a))), s = new jc(n, "_"), r = new Bd();+ gb(t.length, e.length, "types/values length mismatch");+ const n = e.map((a) => this.#e(Ft.from(a))), s = new tl(n, "_"), r = new Ld();return s.encode(r, t), r.data;}/**@@ -41661,10 +42013,10 @@ class Ta {*/decode(e, t, n) {const s = e.map((a) => this.#e(Ft.from(a)));- return new jc(s, "_").decode(new Df(t, n, im));+ return new tl(s, "_").decode(new Qf(t, n, hm));}static _setDefaultMaxInflation(e) {- V(typeof e == "number" && Number.isInteger(e), "invalid defaultMaxInflation factor", "value", e), im = e;+ V(typeof e == "number" && Number.isInteger(e), "invalid defaultMaxInflation factor", "value", e), hm = e;}/*** Returns the shared singleton instance of a default [[AbiCoder]].@@ -41672,7 +42024,7 @@ class Ta {* On the first call, the instance is created internally.*/static defaultAbiCoder() {- return _u == null && (_u = new Ta()), _u;+ return Iu == null && (Iu = new Da()), Iu;}/*** Returns an ethers-compatible [[CallExceptionError]] Error for the given@@ -41680,10 +42032,10 @@ class Ta {* the Transaction %%tx%%.*/static getBuiltinCallException(e, t, n) {- return ZF(e, t, n, Ta.defaultAbiCoder());+ return ED(e, t, n, Da.defaultAbiCoder());}}-class $F {+class _D {/*** The matching fragment for the ``topic0``.*/@@ -41709,7 +42061,7 @@ class $F {*/constructor(e, t, n) {const s = e.name, r = e.format();- Ye(this, {+ Xe(this, {fragment: e,name: s,signature: r,@@ -41718,7 +42070,7 @@ class $F {});}}-class eD {+class yD {/*** The matching fragment from the transaction ``data``.*/@@ -41748,7 +42100,7 @@ class eD {*/constructor(e, t, n, s) {const r = e.name, a = e.format();- Ye(this, {+ Xe(this, {fragment: e,name: r,args: n,@@ -41758,7 +42110,7 @@ class eD {});}}-class tD {+class wD {/*** The matching fragment.*/@@ -41784,7 +42136,7 @@ class tD {*/constructor(e, t, n) {const s = e.name, r = e.format();- Ye(this, {+ Xe(this, {fragment: e,name: s,args: n,@@ -41793,7 +42145,7 @@ class tD {});}}-class sm {+class um {/*** The ``keccak256`` of the value logged.*/@@ -41814,10 +42166,10 @@ class sm {* @_ignore:*/constructor(e) {- Ye(this, { hash: e, _isIndexed: !0 });+ Xe(this, { hash: e, _isIndexed: !0 });}}-const rm = {+const dm = {0: "generic panic",1: "assert(false)",17: "arithmetic overflow",@@ -41828,7 +42180,7 @@ const rm = {50: "out-of-bounds access of an array or bytesN",65: "out of memory",81: "uninitialized function"-}, am = {+}, fm = {"0x08c379a0": {signature: "Error(string)",name: "Error",@@ -41841,11 +42193,11 @@ const rm = {inputs: ["uint256"],reason: (i) => {let e = "unknown panic code";- return i >= 0 && i <= 255 && rm[i.toString()] && (e = rm[i.toString()]), `reverted with panic code 0x${i.toString(16)} (${e})`;+ return i >= 0 && i <= 255 && dm[i.toString()] && (e = dm[i.toString()]), `reverted with panic code 0x${i.toString(16)} (${e})`;}}};-class or {+class lr {/*** All the Contract ABI members (i.e. methods, events, errors, etc).*/@@ -41876,11 +42228,11 @@ class or {const n = [];for (const a of t)try {- n.push(Cr.from(a));+ n.push(Sr.from(a));} catch (o) {console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, o.message);}- Ye(this, {+ Xe(this, {fragments: Object.freeze(n)});let s = null, r = !1;@@ -41892,7 +42244,7 @@ class or {console.log("duplicate definition - constructor");return;}- Ye(this, { deploy: a });+ Xe(this, { deploy: a });return;case "fallback":a.inputs.length === 0 ? r = !0 : (V(!s || a.payable !== s.payable, "conflicting fallback fragments", `fragments[${o}]`, a), s = a, r = s.payable);@@ -41911,9 +42263,9 @@ class or {}const l = a.format();c.has(l) || c.set(l, a);- }), this.deploy || Ye(this, {- deploy: rs.from("constructor()")- }), Ye(this, { fallback: s, receive: r });+ }), this.deploy || Xe(this, {+ deploy: as.from("constructor()")+ }), Xe(this, { fallback: s, receive: r });}/*** Returns the entire Human-Readable ABI, as an array of@@ -41937,7 +42289,7 @@ class or {* data.*/getAbiCoder() {- return Ta.defaultAbiCoder();+ return Da.defaultAbiCoder();}// Find a function definition by any means necessary (unless it is ambiguous)#s(e, t, n) {@@ -41992,7 +42344,7 @@ class or {}return r[0];}- const s = this.#n.get(Ri.from(e).format());+ const s = this.#n.get(Ni.from(e).format());return s || null;}/**@@ -42073,7 +42425,7 @@ class or {}return r[0];}- const s = this.#t.get(Ti.from(e).format());+ const s = this.#t.get(Ri.from(e).format());return s || null;}/**@@ -42131,8 +42483,8 @@ class or {getError(e, t) {if (Lt(e)) {const s = e.toLowerCase();- if (am[s])- return Qn.from(am[s].signature);+ if (fm[s])+ return Qn.from(fm[s].signature);for (const r of this.#e.values())if (s === r.selector)return r;@@ -42304,7 +42656,7 @@ class or {});}makeError(e, t) {- const n = ht(e, "data"), s = Ta.getBuiltinCallException("call", t, n);+ const n = ht(e, "data"), s = Da.getBuiltinCallException("call", t, n);if (s.message.startsWith("execution reverted (unknown custom error)")) {const o = Se(n.slice(0, 4)), c = this.getError(o);if (c)@@ -42380,7 +42732,7 @@ class or {ge(t.length <= e.inputs.length, `too many arguments for ${e.format()}`, "UNEXPECTED_ARGUMENT", { count: t.length, expectedCount: e.inputs.length });const n = [];e.anonymous || n.push(e.topicHash);- const s = (r, a) => r.type === "string" ? yr(a) : r.type === "bytes" ? Zt(Se(a)) : (r.type === "bool" && typeof a == "boolean" ? a = a ? "0x01" : "0x00" : r.type.match(/^u?int/) ? a = Os(a) : r.type.match(/^bytes/) ? a = wT(a, 32) : r.type === "address" && this.#i.encode(["address"], [a]), us(Se(a), 32));+ const s = (r, a) => r.type === "string" ? vr(a) : r.type === "bytes" ? Zt(Se(a)) : (r.type === "bool" && typeof a == "boolean" ? a = a ? "0x01" : "0x00" : r.type.match(/^u?int/) ? a = Gs(a) : r.type.match(/^bytes/) ? a = WT(a, 32) : r.type === "address" && this.#i.encode(["address"], [a]), ds(Se(a), 32));for (t.forEach((r, a) => {const o = e.inputs[a];if (!o.indexed) {@@ -42402,7 +42754,7 @@ class or {const c = t[o];if (a.indexed)if (a.type === "string")- n.push(yr(c));+ n.push(vr(c));else if (a.type === "bytes")n.push(Zt(c));else {@@ -42437,9 +42789,9 @@ class or {let g = null;if (f.indexed)if (o == null)- g = new sm(null);+ g = new um(null);else if (a[m])- g = new sm(o[d++]);+ g = new um(o[d++]);elsetry {g = o[d++];@@ -42453,7 +42805,7 @@ class or {g = A;}l.push(g), h.push(f.name || null);- }), ss.fromItems(l, h);+ }), rs.fromItems(l, h);}/*** Parses a transaction, finding the matching function and extracts@@ -42466,7 +42818,7 @@ class or {if (!s)return null;const r = this.#i.decode(s.inputs, t.slice(4));- return new eD(s, s.selector, r, n);+ return new yD(s, s.selector, r, n);}parseCallResult(e) {throw new Error("@TODO");@@ -42479,7 +42831,7 @@ class or {*/parseLog(e) {const t = this.getEvent(e.topics[0]);- return !t || t.anonymous ? null : new $F(t, t.topicHash, this.decodeEventLog(t, e.data, e.topics));+ return !t || t.anonymous ? null : new _D(t, t.topicHash, this.decodeEventLog(t, e.data, e.topics));}/*** Parses a revert data, finding the matching error and extracts@@ -42492,7 +42844,7 @@ class or {if (!n)return null;const s = this.#i.decode(n.inputs, Vt(t, 4));- return new tD(n, n.selector, s);+ return new wD(n, n.selector, s);}/*** Creates a new [[Interface]] from the ABI %%value%%.@@ -42501,17 +42853,17 @@ class or {* a JSON-encoded ABI or any Human-Readable ABI format.*/static from(e) {- return e instanceof or ? e : typeof e == "string" ? new or(JSON.parse(e)) : typeof e.formatJson == "function" ? new or(e.formatJson()) : typeof e.format == "function" ? new or(e.format("json")) : new or(e);+ return e instanceof lr ? e : typeof e == "string" ? new lr(JSON.parse(e)) : typeof e.formatJson == "function" ? new lr(e.formatJson()) : typeof e.format == "function" ? new lr(e.format("json")) : new lr(e);}}-const Nx = BigInt(0);-function pa(i) {+const Qx = BigInt(0);+function ba(i) {return i ?? null;}-function Xt(i) {+function jt(i) {return i == null ? null : i.toString();}-class om {+class pm {/*** The gas price for legacy networks.*/@@ -42544,10 +42896,10 @@ class om {* %%maxPriorityFeePerGas%%.*/constructor(e, t, n) {- Ye(this, {- gasPrice: pa(e),- maxFeePerGas: pa(t),- maxPriorityFeePerGas: pa(n)+ Xe(this, {+ gasPrice: ba(e),+ maxFeePerGas: ba(t),+ maxPriorityFeePerGas: ba(n)});}/**@@ -42557,13 +42909,13 @@ class om {const { gasPrice: e, maxFeePerGas: t, maxPriorityFeePerGas: n } = this;return {_type: "FeeData",- gasPrice: Xt(e),- maxFeePerGas: Xt(t),- maxPriorityFeePerGas: Xt(n)+ gasPrice: jt(e),+ maxFeePerGas: jt(t),+ maxPriorityFeePerGas: jt(n)};}}-function Dl(i) {+function Ol(i) {const e = {};i.to && (e.to = i.to), i.from && (e.from = i.from), i.data && (e.data = Se(i.data));const t = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);@@ -42572,9 +42924,9 @@ function Dl(i) {const n = "type,nonce".split(/,/);for (const s of n)!(s in i) || i[s] == null || (e[s] = ut(i[s], `request.${s}`));- return i.accessList && (e.accessList = Ir(i.accessList)), i.authorizationList && (e.authorizationList = i.authorizationList.slice()), "blockTag" in i && (e.blockTag = i.blockTag), "enableCcipRead" in i && (e.enableCcipRead = !!i.enableCcipRead), "customData" in i && (e.customData = i.customData), "blobVersionedHashes" in i && i.blobVersionedHashes && (e.blobVersionedHashes = i.blobVersionedHashes.slice()), "kzg" in i && (e.kzg = i.kzg), "blobWrapperVersion" in i && (e.blobWrapperVersion = i.blobWrapperVersion), "blobs" in i && i.blobs && (e.blobs = i.blobs.map((s) => Nf(s) ? Se(s) : Object.assign({}, s))), e;+ return i.accessList && (e.accessList = Br(i.accessList)), i.authorizationList && (e.authorizationList = i.authorizationList.slice()), "blockTag" in i && (e.blockTag = i.blockTag), "enableCcipRead" in i && (e.enableCcipRead = !!i.enableCcipRead), "customData" in i && (e.customData = i.customData), "blobVersionedHashes" in i && i.blobVersionedHashes && (e.blobVersionedHashes = i.blobVersionedHashes.slice()), "kzg" in i && (e.kzg = i.kzg), "blobWrapperVersion" in i && (e.blobWrapperVersion = i.blobWrapperVersion), "blobs" in i && i.blobs && (e.blobs = i.blobs.map((s) => Uf(s) ? Se(s) : Object.assign({}, s))), e;}-class nD {+class vD {/*** The provider connected to the block used to fetch additional details* if necessary.@@ -42680,9 +43032,9 @@ class nD {* low-level library.*/constructor(e, t) {- this.#e = e.transactions.map((n) => typeof n != "string" ? new Zo(n, t) : n), Ye(this, {+ this.#e = e.transactions.map((n) => typeof n != "string" ? new ic(n, t) : n), Xe(this, {provider: t,- hash: pa(e.hash),+ hash: ba(e.hash),number: e.number,timestamp: e.timestamp,parentHash: e.parentHash,@@ -42694,9 +43046,9 @@ class nD {blobGasUsed: e.blobGasUsed,excessBlobGas: e.excessBlobGas,miner: e.miner,- prevRandao: pa(e.prevRandao),+ prevRandao: ba(e.prevRandao),extraData: e.extraData,- baseFeePerGas: pa(e.baseFeePerGas),+ baseFeePerGas: ba(e.baseFeePerGas),stateRoot: e.stateRoot,receiptsRoot: e.receiptsRoot});@@ -42729,13 +43081,13 @@ class nD {const { baseFeePerGas: e, difficulty: t, extraData: n, gasLimit: s, gasUsed: r, hash: a, miner: o, prevRandao: c, nonce: l, number: h, parentHash: u, parentBeaconBlockRoot: d, stateRoot: f, receiptsRoot: m, timestamp: g, transactions: A } = this;return {_type: "Block",- baseFeePerGas: Xt(e),- difficulty: Xt(t),+ baseFeePerGas: jt(e),+ difficulty: jt(t),extraData: n,- gasLimit: Xt(s),- gasUsed: Xt(r),- blobGasUsed: Xt(this.blobGasUsed),- excessBlobGas: Xt(this.excessBlobGas),+ gasLimit: jt(s),+ gasUsed: jt(r),+ blobGasUsed: jt(this.blobGasUsed),+ excessBlobGas: jt(this.excessBlobGas),hash: a,miner: o,prevRandao: c,@@ -42832,10 +43184,10 @@ class nD {orphanedEvent() {if (!this.isMined())throw new Error("");- return iD(this);+ return CD(this);}}-class Jo {+class nc {/*** The provider connected to the log used to fetch additional details* if necessary.@@ -42896,7 +43248,7 @@ class Jo {constructor(e, t) {this.provider = t;const n = Object.freeze(e.topics.slice());- Ye(this, {+ Xe(this, {transactionHash: e.transactionHash,blockHash: e.blockHash,blockNumber: e.blockNumber,@@ -42952,10 +43304,10 @@ class Jo {* @_ignore:*/removedEvent() {- return sD(this);+ return SD(this);}}-class Fx {+class Gx {/*** The provider connected to the log used to fetch additional details* if necessary.@@ -43056,9 +43408,9 @@ class Fx {* @_ignore:*/constructor(e, t) {- this.#e = Object.freeze(e.logs.map((s) => new Jo(s, t)));- let n = Nx;- e.effectiveGasPrice != null ? n = e.effectiveGasPrice : e.gasPrice != null && (n = e.gasPrice), Ye(this, {+ this.#e = Object.freeze(e.logs.map((s) => new nc(s, t)));+ let n = Qx;+ e.effectiveGasPrice != null ? n = e.effectiveGasPrice : e.gasPrice != null && (n = e.gasPrice), Xe(this, {provider: t,to: e.to,from: e.from,@@ -43109,12 +43461,12 @@ class Fx {blockNumber: o,//byzantium,contractAddress: n,- cumulativeGasUsed: Xt(this.cumulativeGasUsed),+ cumulativeGasUsed: jt(this.cumulativeGasUsed),from: t,- gasPrice: Xt(this.gasPrice),- blobGasUsed: Xt(this.blobGasUsed),- blobGasPrice: Xt(this.blobGasPrice),- gasUsed: Xt(this.gasUsed),+ gasPrice: jt(this.gasPrice),+ blobGasUsed: jt(this.blobGasUsed),+ blobGasPrice: jt(this.blobGasPrice),+ gasUsed: jt(this.gasUsed),hash: s,index: r,logs: l,@@ -43179,16 +43531,16 @@ class Fx {* @_ignore:*/removedEvent() {- return Lx(this);+ return zx(this);}/*** @_ignore:*/reorderedEvent(e) {- return ge(!e || e.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }), Dx(this, e);+ return ge(!e || e.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }), Hx(this, e);}}-class Zo {+class ic {/*** The provider this is connected to, which will influence how its* methods will resolve its async inspection methods.@@ -43325,21 +43677,21 @@ class Zo {blockNumber: e,blockHash: t,blobVersionedHashes: d,- chainId: Xt(this.chainId),+ chainId: jt(this.chainId),data: l,from: o,- gasLimit: Xt(this.gasLimit),- gasPrice: Xt(this.gasPrice),+ gasLimit: jt(this.gasLimit),+ gasPrice: jt(this.gasPrice),hash: s,- maxFeePerGas: Xt(this.maxFeePerGas),- maxPriorityFeePerGas: Xt(this.maxPriorityFeePerGas),- maxFeePerBlobGas: Xt(this.maxFeePerBlobGas),+ maxFeePerGas: jt(this.maxFeePerGas),+ maxPriorityFeePerGas: jt(this.maxPriorityFeePerGas),+ maxFeePerBlobGas: jt(this.maxFeePerBlobGas),nonce: c,signature: h,to: a,index: n,type: r,- value: Xt(this.value)+ value: jt(this.value)};}/**@@ -43426,7 +43778,7 @@ class Zo {if (y == null || d - y.blockNumber + 1 < n)return;let b = "replaced";- p.data === this.data && p.to === this.to && p.value === this.value ? b = "repriced" : p.data === "0x" && p.from === p.to && p.value === Nx && (b = "cancelled"), ge(!1, "transaction was replaced", "TRANSACTION_REPLACED", {+ p.data === this.data && p.to === this.to && p.value === this.value ? b = "repriced" : p.data === "0x" && p.from === p.to && p.value === Qx && (b = "cancelled"), ge(!1, "transaction was replaced", "TRANSACTION_REPLACED", {cancelled: b === "replaced" || b === "cancelled",reason: b,replacement: p.replaceableTransaction(r),@@ -43562,14 +43914,14 @@ class Zo {* that evict this transaction.*/removedEvent() {- return ge(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Lx(this);+ return ge(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), zx(this);}/*** Returns a filter which can be used to listen for orphan events* that re-order this event against %%other%%.*/reorderedEvent(e) {- return ge(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), ge(!e || e.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Dx(this, e);+ return ge(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), ge(!e || e.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Hx(this, e);}/*** Returns a new TransactionResponse instance which has the ability to@@ -43582,20 +43934,20 @@ class Zo {*/replaceableTransaction(e) {V(Number.isInteger(e) && e >= 0, "invalid startBlock", "startBlock", e);- const t = new Zo(this, this.provider);+ const t = new ic(this, this.provider);return t.#e = e, t;}}-function iD(i) {+function CD(i) {return { orphan: "drop-block", hash: i.hash, number: i.number };}-function Dx(i, e) {+function Hx(i, e) {return { orphan: "reorder-transaction", tx: i, other: e };}-function Lx(i) {+function zx(i) {return { orphan: "drop-transaction", tx: i };}-function sD(i) {+function SD(i) {return { orphan: "drop-log", log: {transactionHash: i.transactionHash,blockHash: i.blockHash,@@ -43606,7 +43958,7 @@ function sD(i) {index: i.index} };}-class Kf extends Jo {+class $f extends nc {/*** The Contract Interface.*/@@ -43625,7 +43977,7 @@ class Kf extends Jo {constructor(e, t, n) {super(e, e.provider);const s = t.decodeEventLog(n, e.data, e.topics);- Ye(this, { args: s, fragment: n, interface: t });+ Xe(this, { args: s, fragment: n, interface: t });}/*** The name of the event.@@ -43640,7 +43992,7 @@ class Kf extends Jo {return this.fragment.format();}}-class Px extends Jo {+class Vx extends nc {/*** The error encounted when trying to decode the log.*/@@ -43649,10 +44001,10 @@ class Px extends Jo {* @_ignore:*/constructor(e, t) {- super(e, e.provider), Ye(this, { error: t });+ super(e, e.provider), Xe(this, { error: t });}}-class rD extends Fx {+class ID extends Gx {#e;/*** @_ignore:@@ -43669,15 +44021,15 @@ class rD extends Fx {const t = e.topics.length ? this.#e.getEvent(e.topics[0]) : null;if (t)try {- return new Kf(e, this.#e, t);+ return new $f(e, this.#e, t);} catch (n) {- return new Px(e, n);+ return new Vx(e, n);}return e;});}}-class Xf extends Zo {+class ep extends ic {#e;/*** @_ignore:@@ -43696,10 +44048,10 @@ class Xf extends Zo {*/async wait(e, t) {const n = await super.wait(e, t);- return n == null ? null : new rD(this.#e, this.provider, n);+ return n == null ? null : new ID(this.#e, this.provider, n);}}-class kx extends db {+class Wx extends Eb {/*** The log with no matching events.*/@@ -43708,7 +44060,7 @@ class kx extends db {* @_event:*/constructor(e, t, n, s) {- super(e, t, n), Ye(this, { log: s });+ super(e, t, n), Xe(this, { log: s });}/*** Resolves to the block the event occured in.@@ -43729,14 +44081,14 @@ class kx extends db {return await this.log.getTransactionReceipt();}}-class aD extends kx {+class MD extends Wx {/*** @_ignore:*/constructor(e, t, n, s, r) {- super(e, t, n, new Kf(r, e.interface, s));+ super(e, t, n, new $f(r, e.interface, s));const a = e.interface.decodeEventLog(s, this.log.data, this.log.topics);- Ye(this, { args: a, fragment: s });+ Xe(this, { args: a, fragment: s });}/*** The event name.@@ -43751,34 +44103,34 @@ class aD extends kx {return this.fragment.format();}}-const cm = BigInt(0);-function Ux(i) {+const Am = BigInt(0);+function qx(i) {return i && typeof i.call == "function";}-function Ox(i) {+function Kx(i) {return i && typeof i.estimateGas == "function";}-function th(i) {+function oh(i) {return i && typeof i.resolveName == "function";}-function Qx(i) {+function jx(i) {return i && typeof i.sendTransaction == "function";}-function Gx(i) {+function Xx(i) {if (i != null) {- if (th(i))+ if (oh(i))return i;if (i.provider)return i.provider;}}-class oD {+class BD {#e;fragment;constructor(e, t, n) {- if (Ye(this, { fragment: t }), t.inputs.length < n.length)+ if (Xe(this, { fragment: t }), t.inputs.length < n.length)throw new Error("too many arguments");- const s = vr(e.runner, "resolveName"), r = th(s) ? s : null;+ const s = Ir(e.runner, "resolveName"), r = oh(s) ? s : null;this.#e = (async function() {const a = await Promise.all(t.inputs.map((o, c) => n[c] == null ? null : o.walkAsync(n[c], (h, u) => h === "address" ? Array.isArray(u) ? Promise.all(u.map((d) => Fn(d, r))) : Fn(u, r) : u)));return e.interface.encodeFilterTopics(t, a);@@ -43788,49 +44140,49 @@ class oD {return this.#e;}}-function vr(i, e) {+function Ir(i, e) {return i == null ? null : typeof i[e] == "function" ? i : i.provider && typeof i.provider[e] == "function" ? i.provider : null;}-function fr(i) {+function Ar(i) {return i == null ? null : i.provider || null;}-async function Hx(i, e) {+async function Yx(i, e) {const t = Wt.dereference(i, "overrides");V(typeof t == "object", "invalid overrides parameter", "overrides", i);- const n = Dl(t);+ const n = Ol(t);return V(n.to == null || (e || []).indexOf("to") >= 0, "cannot override to", "overrides.to", n.to), V(n.data == null || (e || []).indexOf("data") >= 0, "cannot override data", "overrides.data", n.data), n.from && (n.from = n.from), n;}-async function cD(i, e, t) {- const n = vr(i, "resolveName"), s = th(n) ? n : null;+async function TD(i, e, t) {+ const n = Ir(i, "resolveName"), s = oh(n) ? n : null;return await Promise.all(e.map((r, a) => r.walkAsync(t[a], (o, c) => (c = Wt.dereference(c, o), o === "address" ? Fn(c, s) : c))));}-function lD(i) {+function RD(i) {const e = async function(a) {- const o = await Hx(a, ["data"]);- o.to = await i.getAddress(), o.from && (o.from = await Fn(o.from, Gx(i.runner)));- const c = i.interface, l = Fe(o.value || cm, "overrides.value") === cm, h = (o.data || "0x") === "0x";+ const o = await Yx(a, ["data"]);+ o.to = await i.getAddress(), o.from && (o.from = await Fn(o.from, Xx(i.runner)));+ const c = i.interface, l = Fe(o.value || Am, "overrides.value") === Am, h = (o.data || "0x") === "0x";c.fallback && !c.fallback.payable && c.receive && !h && !l && V(!1, "cannot send data to receive or send value to non-payable fallback", "overrides", a), V(c.fallback || h, "cannot send data to receive-only contract", "overrides.data", o.data);const u = c.receive || c.fallback && c.fallback.payable;return V(u || l, "cannot send value to non-payable fallback", "overrides.value", o.value), V(c.fallback || h, "cannot send data to receive-only contract", "overrides.data", o.data), o;}, t = async function(a) {- const o = vr(i.runner, "call");- ge(Ux(o), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });+ const o = Ir(i.runner, "call");+ ge(qx(o), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });const c = await e(a);try {return await o.call(c);} catch (l) {- throw Rf(l) && l.data ? i.interface.makeError(l.data, c) : l;+ throw kf(l) && l.data ? i.interface.makeError(l.data, c) : l;}}, n = async function(a) {const o = i.runner;- ge(Qx(o), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });- const c = await o.sendTransaction(await e(a)), l = fr(i.runner);- return new Xf(i.interface, l, c);+ ge(jx(o), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });+ const c = await o.sendTransaction(await e(a)), l = Ar(i.runner);+ return new ep(i.interface, l, c);}, s = async function(a) {- const o = vr(i.runner, "estimateGas");- return ge(Ox(o), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await o.estimateGas(await e(a));+ const o = Ir(i.runner, "estimateGas");+ return ge(Kx(o), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await o.estimateGas(await e(a));}, r = async (a) => await n(a);- return Ye(r, {+ return Xe(r, {_contract: i,estimateGas: s,populateTransaction: e,@@ -43838,7 +44190,7 @@ function lD(i) {staticCall: t}), r;}-function hD(i, e) {+function ND(i, e) {const t = function(...l) {const h = i.interface.getFunction(e, l);return ge(h, "no matching fragment", "UNSUPPORTED_OPERATION", {@@ -43848,9 +44200,9 @@ function hD(i, e) {}, n = async function(...l) {const h = t(...l);let u = {};- if (h.inputs.length + 1 === l.length && (u = await Hx(l.pop()), u.from && (u.from = await Fn(u.from, Gx(i.runner)))), h.inputs.length !== l.length)+ if (h.inputs.length + 1 === l.length && (u = await Yx(l.pop()), u.from && (u.from = await Fn(u.from, Xx(i.runner)))), h.inputs.length !== l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");- const d = await cD(i.runner, h.inputs, l);+ const d = await TD(i.runner, h.inputs, l);return Object.assign({}, u, await Bn({to: i.getAddress(),data: i.interface.encodeFunctionData(h, d)@@ -43860,26 +44212,26 @@ function hD(i, e) {return h.length === 1 ? h[0] : h;}, r = async function(...l) {const h = i.runner;- ge(Qx(h), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });- const u = await h.sendTransaction(await n(...l)), d = fr(i.runner);- return new Xf(i.interface, d, u);+ ge(jx(h), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });+ const u = await h.sendTransaction(await n(...l)), d = Ar(i.runner);+ return new ep(i.interface, d, u);}, a = async function(...l) {- const h = vr(i.runner, "estimateGas");- return ge(Ox(h), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await h.estimateGas(await n(...l));+ const h = Ir(i.runner, "estimateGas");+ return ge(Kx(h), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await h.estimateGas(await n(...l));}, o = async function(...l) {- const h = vr(i.runner, "call");- ge(Ux(h), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });+ const h = Ir(i.runner, "call");+ ge(qx(h), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });const u = await n(...l);let d = "0x";try {d = await h.call(u);} catch (m) {- throw Rf(m) && m.data ? i.interface.makeError(m.data, u) : m;+ throw kf(m) && m.data ? i.interface.makeError(m.data, u) : m;}const f = t(...l);return i.interface.decodeFunctionResult(f, d);}, c = async (...l) => t(...l).constant ? await s(...l) : await r(...l);- return Ye(c, {+ return Xe(c, {name: i.interface.getFunctionName(e),_contract: i,_key: e,@@ -43901,7 +44253,7 @@ function hD(i, e) {}}), c;}-function uD(i, e) {+function FD(i, e) {const t = function(...s) {const r = i.interface.getEvent(e, s);return ge(r, "no matching fragment", "UNSUPPORTED_OPERATION", {@@ -43909,9 +44261,9 @@ function uD(i, e) {info: { key: e, args: s }}), r;}, n = function(...s) {- return new oD(i, t(...s), s);+ return new BD(i, t(...s), s);};- return Ye(n, {+ return Xe(n, {name: i.interface.getEventName(e),_contract: i,_key: e,@@ -43928,17 +44280,17 @@ function uD(i, e) {}}), n;}-const Ll = /* @__PURE__ */ Symbol.for("_ethersInternal_contract"), zx = /* @__PURE__ */ new WeakMap();-function dD(i, e) {- zx.set(i[Ll], e);+const Ql = /* @__PURE__ */ Symbol.for("_ethersInternal_contract"), Jx = /* @__PURE__ */ new WeakMap();+function DD(i, e) {+ Jx.set(i[Ql], e);}function Kn(i) {- return zx.get(i[Ll]);+ return Jx.get(i[Ql]);}-function fD(i) {+function LD(i) {return i && typeof i == "object" && "getTopicFilter" in i && typeof i.getTopicFilter == "function" && i.fragment;}-async function Yf(i, e) {+async function tp(i, e) {let t, n = null;if (Array.isArray(e)) {const r = function(a) {@@ -43948,7 +44300,7 @@ async function Yf(i, e) {return V(o, "unknown fragment", "name", a), o.topicHash;};t = e.map((a) => a == null ? null : Array.isArray(a) ? a.map(r) : r(a));- } else e === "*" ? t = [null] : typeof e == "string" ? Lt(e, 32) ? t = [e] : (n = i.interface.getEvent(e), V(n, "unknown fragment", "event", e), t = [n.topicHash]) : fD(e) ? t = await e.getTopicFilter() : "fragment" in e ? (n = e.fragment, t = [n.topicHash]) : V(!1, "unknown event name", "event", e);+ } else e === "*" ? t = [null] : typeof e == "string" ? Lt(e, 32) ? t = [e] : (n = i.interface.getEvent(e), V(n, "unknown fragment", "event", e), t = [n.topicHash]) : LD(e) ? t = await e.getTopicFilter() : "fragment" in e ? (n = e.fragment, t = [n.topicHash]) : V(!1, "unknown event name", "event", e);t = t.map((r) => {if (r == null)return null;@@ -43961,14 +44313,14 @@ async function Yf(i, e) {const s = t.map((r) => r == null ? "null" : Array.isArray(r) ? r.join("|") : r).join("&");return { fragment: n, tag: s, topics: t };}-async function ho(i, e) {+async function Ao(i, e) {const { subs: t } = Kn(i);- return t.get((await Yf(i, e)).tag) || null;+ return t.get((await tp(i, e)).tag) || null;}-async function lm(i, e, t) {- const n = fr(i.runner);+async function gm(i, e, t) {+ const n = Ar(i.runner);ge(n, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation: e });- const { fragment: s, tag: r, topics: a } = await Yf(i, t), { addr: o, subs: c } = Kn(i);+ const { fragment: s, tag: r, topics: a } = await tp(i, t), { addr: o, subs: c } = Kn(i);let l = c.get(r);if (!l) {const u = { address: o || i, topics: a }, d = (A) => {@@ -43980,9 +44332,9 @@ async function lm(i, e, t) {}if (p) {const y = p, b = s ? i.interface.decodeEventLog(s, A.data, A.topics) : [];- zd(i, t, b, (_) => new aD(i, _, t, y, A));+ Xd(i, t, b, (_) => new MD(i, _, t, y, A));} else- zd(i, t, [], (y) => new kx(i, y, t, A));+ Xd(i, t, [], (y) => new Wx(i, y, t, A));};let f = [];l = { tag: r, listeners: [], start: () => {@@ -43996,10 +44348,10 @@ async function lm(i, e, t) {}return l;}-let Hd = Promise.resolve();-async function pD(i, e, t, n) {- await Hd;- const s = await ho(i, e);+let jd = Promise.resolve();+async function PD(i, e, t, n) {+ await jd;+ const s = await Ao(i, e);if (!s)return !1;const r = s.listeners.length;@@ -44013,16 +44365,16 @@ async function pD(i, e, t, n) {return !o;}), s.listeners.length === 0 && (s.stop(), Kn(i).subs.delete(s.tag)), r > 0;}-async function zd(i, e, t, n) {+async function Xd(i, e, t, n) {try {- await Hd;+ await jd;} catch {}- const s = pD(i, e, t, n);- return Hd = s, await s;+ const s = PD(i, e, t, n);+ return jd = s, await s;}-const Zc = ["then"];-class yo {+const il = ["then"];+class So {/*** The target to connect to.*@@ -44050,7 +44402,7 @@ class yo {/*** @_ignore:*/- [Ll];+ [Ql];/*** The fallback or receive function if any.*/@@ -44061,21 +44413,21 @@ class yo {* of.*/constructor(e, t, n, s) {- V(typeof e == "string" || Yb(e), "invalid value for Contract target", "target", e), n == null && (n = null);- const r = or.from(t);- Ye(this, { target: e, runner: n, interface: r }), Object.defineProperty(this, Ll, { value: {} });+ V(typeof e == "string" || ix(e), "invalid value for Contract target", "target", e), n == null && (n = null);+ const r = lr.from(t);+ Xe(this, { target: e, runner: n, interface: r }), Object.defineProperty(this, Ql, { value: {} });let a, o = null, c = null;if (s) {- const u = fr(n);- c = new Xf(this.interface, u, s);+ const u = Ar(n);+ c = new ep(this.interface, u, s);}let l = /* @__PURE__ */ new Map();if (typeof e == "string")if (Lt(e))o = e, a = Promise.resolve(e);else {- const u = vr(n, "resolveName");- if (!th(u))+ const u = Ir(n, "resolveName");+ if (!oh(u))throw Qt("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", {operation: "resolveName"});@@ -44093,10 +44445,10 @@ class yo {throw new Error("TODO");return Kn(this).addr = u, u;});- dD(this, { addrPromise: a, addr: o, deployTx: c, subs: l });+ DD(this, { addrPromise: a, addr: o, deployTx: c, subs: l });const h = new Proxy({}, {get: (u, d, f) => {- if (typeof d == "symbol" || Zc.indexOf(d) >= 0)+ if (typeof d == "symbol" || il.indexOf(d) >= 0)return Reflect.get(u, d, f);try {return this.getEvent(d);@@ -44105,13 +44457,13 @@ class yo {throw m;}},- has: (u, d) => Zc.indexOf(d) >= 0 ? Reflect.has(u, d) : Reflect.has(u, d) || this.interface.hasEvent(String(d))+ has: (u, d) => il.indexOf(d) >= 0 ? Reflect.has(u, d) : Reflect.has(u, d) || this.interface.hasEvent(String(d))});- return Ye(this, { filters: h }), Ye(this, {- fallback: r.receive || r.fallback ? lD(this) : null+ return Xe(this, { filters: h }), Xe(this, {+ fallback: r.receive || r.fallback ? RD(this) : null}), new Proxy(this, {get: (u, d, f) => {- if (typeof d == "symbol" || d in u || Zc.indexOf(d) >= 0)+ if (typeof d == "symbol" || d in u || il.indexOf(d) >= 0)return Reflect.get(u, d, f);try {return u.getFunction(d);@@ -44120,7 +44472,7 @@ class yo {throw m;}},- has: (u, d) => typeof d == "symbol" || d in u || Zc.indexOf(d) >= 0 ? Reflect.has(u, d) : u.interface.hasFunction(d)+ has: (u, d) => typeof d == "symbol" || d in u || il.indexOf(d) >= 0 ? Reflect.has(u, d) : u.interface.hasFunction(d)});}/**@@ -44128,14 +44480,14 @@ class yo {* a different %%runner%%.*/connect(e) {- return new yo(this.target, this.interface, e);+ return new So(this.target, this.interface, e);}/*** Return a new Contract instance with the same ABI and runner, but* a different %%target%%.*/attach(e) {- return new yo(e, this.interface, this.runner);+ return new So(e, this.interface, this.runner);}/*** Return the resolved address of this Contract.@@ -44147,7 +44499,7 @@ class yo {* Return the deployed bytecode or null if no bytecode is found.*/async getDeployedCode() {- const e = fr(this.runner);+ const e = Ar(this.runner);ge(e, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" });const t = await e.getCode(await this.getAddress());return t === "0x" ? null : t;@@ -44162,7 +44514,7 @@ class yo {return await e.wait(), this;if (await this.getDeployedCode() != null)return this;- const n = fr(this.runner);+ const n = Ar(this.runner);return ge(n != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }), new Promise((s, r) => {const a = async () => {try {@@ -44191,7 +44543,7 @@ class yo {* when using a Contract programmatically.*/getFunction(e) {- return typeof e != "string" && (e = e.format()), hD(this, e);+ return typeof e != "string" && (e = e.format()), ND(this, e);}/*** Return the event for a given name. This is useful when a contract@@ -44199,7 +44551,7 @@ class yo {* when using a Contract programmatically.*/getEvent(e) {- return typeof e != "string" && (e = e.format()), uD(this, e);+ return typeof e != "string" && (e = e.format()), FD(this, e);}/*** @_ignore:@@ -44229,7 +44581,7 @@ class yo {*/async queryFilter(e, t, n) {t == null && (t = 0), n == null && (n = "latest");- const { addr: s, addrPromise: r } = Kn(this), a = s || await r, { fragment: o, topics: c } = await Yf(this, e), l = { address: a, topics: c, fromBlock: t, toBlock: n }, h = fr(this.runner);+ const { addr: s, addrPromise: r } = Kn(this), a = s || await r, { fragment: o, topics: c } = await tp(this, e), l = { address: a, topics: c, fromBlock: t, toBlock: n }, h = Ar(this.runner);return ge(h, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }), (await h.getLogs(l)).map((u) => {let d = o;if (d == null)@@ -44239,18 +44591,18 @@ class yo {}if (d)try {- return new Kf(u, this.interface, d);+ return new $f(u, this.interface, d);} catch (f) {- return new Px(u, f);+ return new Vx(u, f);}- return new Jo(u, h);+ return new nc(u, h);});}/*** Add an event %%listener%% for the %%event%%.*/async on(e, t) {- const n = await lm(this, "on", e);+ const n = await gm(this, "on", e);return n.listeners.push({ listener: t, once: !1 }), n.start(), this;}/**@@ -44258,7 +44610,7 @@ class yo {* after it is fired once.*/async once(e, t) {- const n = await lm(this, "once", e);+ const n = await gm(this, "once", e);return n.listeners.push({ listener: t, once: !0 }), n.start(), this;}/**@@ -44267,7 +44619,7 @@ class yo {* Resolves to ``true`` if any listeners were called.*/async emit(e, ...t) {- return await zd(this, e, t, null);+ return await Xd(this, e, t, null);}/*** Resolves to the number of listeners of %%event%% or the total number@@ -44275,7 +44627,7 @@ class yo {*/async listenerCount(e) {if (e) {- const s = await ho(this, e);+ const s = await Ao(this, e);return s ? s.listeners.length : 0;}const { subs: t } = Kn(this);@@ -44290,7 +44642,7 @@ class yo {*/async listeners(e) {if (e) {- const s = await ho(this, e);+ const s = await Ao(this, e);return s ? s.listeners.map(({ listener: r }) => r) : [];}const { subs: t } = Kn(this);@@ -44304,7 +44656,7 @@ class yo {* all listeners if unspecified.*/async off(e, t) {- const n = await ho(this, e);+ const n = await Ao(this, e);if (!n)return this;if (t) {@@ -44319,7 +44671,7 @@ class yo {*/async removeAllListeners(e) {if (e) {- const t = await ho(this, e);+ const t = await Ao(this, e);if (!t)return this;t.stop(), Kn(this).subs.delete(t.tag);@@ -44346,7 +44698,7 @@ class yo {* Create a new Class for the %%abi%%.*/static buildClass(e) {- class t extends yo {+ class t extends So {constructor(s, r = null) {super(s, e, r);}@@ -44360,15 +44712,15 @@ class yo {return n == null && (n = null), new this(e, t, n);}}-function AD() {- return yo;+function kD() {+ return So;}-class Aa extends AD() {+class xa extends kD() {}-function yu(i) {+function Mu(i) {return i.match(/^ipfs:\/\/ipfs\//i) ? i = i.substring(12) : i.match(/^ipfs:\/\//i) ? i = i.substring(7) : V(!1, "unsupported IPFS format", "link", i), `https://gateway.ipfs.io/ipfs/${i}`;}-class gD {+class UD {/*** The name.*/@@ -44377,7 +44729,7 @@ class gD {* Creates a new **MulticoinProviderPluing** for %%name%%.*/constructor(e) {- Ye(this, { name: e });+ Xe(this, { name: e });}connect(e) {return this;@@ -44401,13 +44753,13 @@ class gD {throw new Error("unsupported coin");}}-const Vx = new RegExp("^(ipfs)://(.*)$", "i"), hm = [+const Zx = new RegExp("^(ipfs)://(.*)$", "i"), mm = [new RegExp("^(https)://(.*)$", "i"),new RegExp("^(data):(.*)$", "i"),- Vx,+ Zx,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i")];-class ga {+class Ea {/*** The connected provider.*/@@ -44424,7 +44776,7 @@ class ga {#e;#t;constructor(e, t, n) {- Ye(this, { provider: e, address: t, name: n }), this.#e = null, this.#t = new Aa(t, [+ Xe(this, { provider: e, address: t, name: n }), this.#e = null, this.#t = new xa(t, ["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)",@@ -44450,12 +44802,12 @@ class ga {async #n(e, t) {t = (t || []).slice();const n = this.#t.interface;- t.unshift(Gd(this.name));+ t.unshift(Kd(this.name));let s = null;await this.supportsWildcard() && (s = n.getFunction(e), ge(s, "missing fragment", "UNKNOWN_ERROR", {info: { funcName: e }}), t = [- RF(this.name, 255),+ $F(this.name, 255),n.encodeFunctionData(s, t)], e = "resolve(bytes,bytes)"), t.push({enableCcipRead: !0@@ -44477,7 +44829,7 @@ class ga {if (e == null && (e = 60), e === 60)try {const r = await this.#n("addr(bytes32)");- return r == null || r === Po ? null : r;+ return r == null || r === Go ? null : r;} catch (r) {if (En(r, "CALL_EXCEPTION"))return null;@@ -44491,7 +44843,7 @@ class ga {}let t = null;for (const r of this.provider.plugins)- if (r instanceof gD && r.supportsCoinType(e)) {+ if (r instanceof UD && r.supportsCoinType(e)) {t = r;break;}@@ -44527,7 +44879,7 @@ class ga {if (t) {const s = t[1] === "e3010170" ? "ipfs" : "ipns", r = parseInt(t[4], 16);if (t[5].length === r * 2)- return `${s}://${ST("0x" + t[2])}`;+ return `${s}://${jT("0x" + t[2])}`;}const n = e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if (n && n[1].length === 64)@@ -44563,8 +44915,8 @@ class ga {if (t == null)return e.push({ type: "!avatar", value: "" }), { url: null, linkage: e };e.push({ type: "avatar", value: t });- for (let n = 0; n < hm.length; n++) {- const s = t.match(hm[n]);+ for (let n = 0; n < mm.length; n++) {+ const s = t.match(mm[n]);if (s == null)continue;const r = s[1].toLowerCase();@@ -44573,7 +44925,7 @@ class ga {case "data":return e.push({ type: "url", value: t }), { linkage: e, url: t };case "ipfs": {- const a = yu(t);+ const a = Mu(t);return e.push({ type: "ipfs", value: t }), e.push({ type: "url", value: a }), { linkage: e, url: a };}case "erc721":@@ -44586,7 +44938,7 @@ class ga {const c = (s[2] || "").split("/");if (c.length !== 2)return e.push({ type: `!${r}caip`, value: s[2] || "" }), { url: null, linkage: e };- const l = c[1], h = new Aa(c[0], [+ const l = c[1], h = new xa(c[0], [// ERC-721"function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)",@@ -44608,9 +44960,9 @@ class ga {let u = await h[a](l);if (u == null || u === "0x")return e.push({ type: "!metadata-url", value: "" }), { url: null, linkage: e };- e.push({ type: "metadata-url-base", value: u }), r === "erc1155" && (u = u.replace("{id}", Os(l, 32).substring(2)), e.push({ type: "metadata-url-expanded", value: u })), u.match(/^ipfs:/i) && (u = yu(u)), e.push({ type: "metadata-url", value: u });+ e.push({ type: "metadata-url-base", value: u }), r === "erc1155" && (u = u.replace("{id}", Gs(l, 32).substring(2)), e.push({ type: "metadata-url-expanded", value: u })), u.match(/^ipfs:/i) && (u = Mu(u)), e.push({ type: "metadata-url", value: u });let d = {};- const f = await new Di(u).send();+ const f = await new Li(u).send();f.assertOk();try {d = f.bodyJson;@@ -44630,9 +44982,9 @@ class ga {if (typeof m != "string")return e.push({ type: "!imageUrl", value: "" }), { url: null, linkage: e };if (!m.match(/^(https:\/\/|data:)/i)) {- if (m.match(Vx) == null)+ if (m.match(Zx) == null)return e.push({ type: "!imageUrl-ipfs", value: m }), { url: null, linkage: e };- e.push({ type: "imageUrl-ipfs", value: m }), m = yu(m);+ e.push({ type: "imageUrl-ipfs", value: m }), m = Mu(m);}return e.push({ type: "url", value: m }), { linkage: e, url: m };}@@ -44650,14 +45002,14 @@ class ga {}), n.address;}static async #i(e, t) {- const n = await ga.getEnsAddress(e);+ const n = await Ea.getEnsAddress(e);try {- const r = await new Aa(n, [+ const r = await new xa(n, ["function resolver(bytes32) view returns (address)"- ], e).resolver(Gd(t), {+ ], e).resolver(Kd(t), {enableCcipRead: !0});- return r === Po ? null : r;+ return r === Go ? null : r;} catch (s) {throw s;}@@ -44672,22 +45024,22 @@ class ga {for (; ; ) {if (n === "" || n === "." || t !== "eth" && n === "eth")return null;- const s = await ga.#i(e, n);+ const s = await Ea.#i(e, n);if (s != null) {- const r = new ga(e, s, t);+ const r = new Ea(e, s, t);return n !== t && !await r.supportsWildcard() ? null : r;}n = n.split(".").slice(1).join(".");}}}-const um = BigInt(0);+const bm = BigInt(0);function gt(i, e) {return (function(t) {return t == null ? e : i(t);});}-function Ho(i, e) {+function Ko(i, e) {return ((t) => {if (e && t == null)return null;@@ -44696,7 +45048,7 @@ function Ho(i, e) {return t.map((n) => i(n));});}-function $o(i, e) {+function sc(i, e) {return ((t) => {const n = {};for (const s in i) {@@ -44719,7 +45071,7 @@ function $o(i, e) {return n;});}-function mD(i) {+function OD(i) {switch (i) {case !0:case "true":@@ -44730,35 +45082,35 @@ function mD(i) {}V(!1, `invalid boolean; ${JSON.stringify(i)}`, "value", i);}-function Ra(i) {+function La(i) {return V(Lt(i, !0), "invalid data", "value", i), i;}function xn(i) {return V(Lt(i, 32), "invalid hash", "value", i), i;}-const bD = $o({+const QD = sc({address: St,blockHash: xn,blockNumber: ut,- data: Ra,+ data: La,index: ut,- removed: gt(mD, !1),- topics: Ho(xn),+ removed: gt(OD, !1),+ topics: Ko(xn),transactionHash: xn,transactionIndex: ut}, {index: ["logIndex"]});-function xD(i) {- return bD(i);+function GD(i) {+ return QD(i);}-const ED = $o({+const HD = sc({hash: gt(xn),parentHash: xn,parentBeaconBlockRoot: gt(xn, null),number: ut,timestamp: ut,- nonce: gt(Ra),+ nonce: gt(La),difficulty: Fe,gasLimit: Fe,gasUsed: Fe,@@ -44768,31 +45120,31 @@ const ED = $o({excessBlobGas: gt(Fe, null),miner: gt(St),prevRandao: gt(xn, null),- extraData: Ra,+ extraData: La,baseFeePerGas: gt(Fe)}, {prevRandao: ["mixHash"]});-function _D(i) {- const e = ED(i);- return e.transactions = i.transactions.map((t) => typeof t == "string" ? t : Wx(t)), e;+function zD(i) {+ const e = HD(i);+ return e.transactions = i.transactions.map((t) => typeof t == "string" ? t : $x(t)), e;}-const yD = $o({+const VD = sc({transactionIndex: ut,blockNumber: ut,transactionHash: xn,address: St,- topics: Ho(xn),- data: Ra,+ topics: Ko(xn),+ data: La,index: ut,blockHash: xn}, {index: ["logIndex"]});-function wD(i) {- return yD(i);+function WD(i) {+ return VD(i);}-const CD = $o({+const qD = sc({to: gt(St, null),from: gt(St, null),contractAddress: gt(St, null),@@ -44801,10 +45153,10 @@ const CD = $o({root: gt(Se),gasUsed: Fe,blobGasUsed: gt(Fe, null),- logsBloom: gt(Ra),+ logsBloom: gt(La),blockHash: xn,hash: xn,- logs: Ho(wD),+ logs: Ko(WD),blockNumber: ut,//confirmations: allowNull(getNumber, null),cumulativeGasUsed: Fe,@@ -44817,19 +45169,19 @@ const CD = $o({hash: ["transactionHash"],index: ["transactionIndex"]});-function vD(i) {- return CD(i);+function KD(i) {+ return qD(i);}-function Wx(i) {- i.to && Fe(i.to) === um && (i.to = "0x0000000000000000000000000000000000000000");- const e = $o({+function $x(i) {+ i.to && Fe(i.to) === bm && (i.to = "0x0000000000000000000000000000000000000000");+ const e = sc({hash: xn,// Some nodes do not return this, usually test nodes (like Ganache)index: gt(ut, void 0),type: (t) => t === "0x" || t == null ? 0 : ut(t),- accessList: gt(Ir, null),- blobVersionedHashes: gt(Ho(xn, !0), null),- authorizationList: gt(Ho((t) => {+ accessList: gt(Br, null),+ blobVersionedHashes: gt(Ko(xn, !0), null),+ authorizationList: gt(Ko((t) => {let n;if (t.signature)n = t.signature;@@ -44857,7 +45209,7 @@ function Wx(i) {to: gt(St, null),value: Fe,nonce: ut,- data: Ra,+ data: La,creates: gt(St, null),chainId: gt(Fe, null)}, {@@ -44865,14 +45217,14 @@ function Wx(i) {gasLimit: ["gas"],index: ["transactionIndex"]})(i);- if (e.to == null && e.creates == null && (e.creates = dN(e)), (i.type === 1 || i.type === 2) && i.accessList == null && (e.accessList = []), i.signature ? e.signature = Gt.from(i.signature) : e.signature = Gt.from(i), e.chainId == null) {+ if (e.to == null && e.creates == null && (e.creates = DN(e)), (i.type === 1 || i.type === 2) && i.accessList == null && (e.accessList = []), i.signature ? e.signature = Gt.from(i.signature) : e.signature = Gt.from(i), e.chainId == null) {const t = e.signature.legacyChainId;t != null && (e.chainId = t);}- return e.blockHash && Fe(e.blockHash) === um && (e.blockHash = null), e;+ return e.blockHash && Fe(e.blockHash) === bm && (e.blockHash = null), e;}-const SD = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";-class ec {+const jD = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";+class rc {/*** The name of the plugin.*@@ -44884,16 +45236,16 @@ class ec {* Creates a new **NetworkPlugin**.*/constructor(e) {- Ye(this, { name: e });+ Xe(this, { name: e });}/*** Creates a copy of this plugin.*/clone() {- return new ec(this.name);+ return new rc(this.name);}}-class nh extends ec {+class ch extends rc {/*** The block number to treat these values as valid from.*@@ -44937,13 +45289,13 @@ class nh extends ec {let o = (t || {})[r];o == null && (o = a), V(typeof o == "number", `invalud value for ${r}`, "costs", t), n[r] = o;}- s("txBase", 21e3), s("txCreate", 32e3), s("txDataZero", 4), s("txDataNonzero", 16), s("txAccessListStorageKey", 1900), s("txAccessListAddress", 2400), Ye(this, n);+ s("txBase", 21e3), s("txCreate", 32e3), s("txDataZero", 4), s("txDataNonzero", 16), s("txAccessListStorageKey", 1900), s("txAccessListAddress", 2400), Xe(this, n);}clone() {- return new nh(this.effectiveBlock, this);+ return new ch(this.effectiveBlock, this);}}-class ih extends ec {+class lh extends rc {/*** The ENS Registrty Contract address.*/@@ -44958,16 +45310,16 @@ class ih extends ec {* if unspecified.*/constructor(e, t) {- super("org.ethers.plugins.network.Ens"), Ye(this, {- address: e || SD,+ super("org.ethers.plugins.network.Ens"), Xe(this, {+ address: e || jD,targetNetwork: t ?? 1});}clone() {- return new ih(this.address, this.targetNetwork);+ return new lh(this.address, this.targetNetwork);}}-class ID extends ec {+class XD extends rc {#e;#t;/**@@ -44994,8 +45346,8 @@ class ID extends ec {return this;}}-const wu = /* @__PURE__ */ new Map();-class Xn {+const Bu = /* @__PURE__ */ new Map();+class jn {#e;#t;#n;@@ -45102,7 +45454,7 @@ class Xn {* Create a copy of this Network.*/clone() {- const e = new Xn(this.name, this.chainId);+ const e = new jn(this.name, this.chainId);return this.plugins.forEach((t) => {e.attachPlugin(t.clone());}), e;@@ -45114,13 +45466,13 @@ class Xn {* values.*/computeIntrinsicGas(e) {- const t = this.getPlugin("org.ethers.plugins.network.GasCost") || new nh();+ const t = this.getPlugin("org.ethers.plugins.network.GasCost") || new ch();let n = t.txBase;if (e.to == null && (n += t.txCreate), e.data)for (let s = 2; s < e.data.length; s += 2)e.data.substring(s, s + 2) === "00" ? n += t.txDataZero : n += t.txDataNonzero;if (e.accessList) {- const s = Ir(e.accessList);+ const s = Br(e.accessList);for (const r in s)n += t.txAccessListAddress + t.txAccessListStorageKey * s[r].storageKeys.length;}@@ -45130,22 +45482,22 @@ class Xn {* Returns a new Network for the %%network%% name or chainId.*/static from(e) {- if (MD(), e == null)- return Xn.from("mainnet");+ if (YD(), e == null)+ return jn.from("mainnet");if (typeof e == "number" && (e = BigInt(e)), typeof e == "string" || typeof e == "bigint") {- const t = wu.get(e);+ const t = Bu.get(e);if (t)return t();if (typeof e == "bigint")- return new Xn("unknown", e);+ return new jn("unknown", e);V(!1, "unknown network", "network", e);}if (typeof e.clone == "function")return e.clone();if (typeof e == "object") {V(typeof e.name == "string" && typeof e.chainId == "number", "invalid network object name or chainId", "network", e);- const t = new Xn(e.name, e.chainId);- return (e.ensAddress || e.ensNetwork != null) && t.attachPlugin(new ih(e.ensAddress, e.ensNetwork)), t;+ const t = new jn(e.name, e.chainId);+ return (e.ensAddress || e.ensNetwork != null) && t.attachPlugin(new lh(e.ensAddress, e.ensNetwork)), t;}V(!1, "invalid network", "network", e);}@@ -45155,11 +45507,11 @@ class Xn {*/static register(e, t) {typeof e == "number" && (e = BigInt(e));- const n = wu.get(e);- n && V(!1, `conflicting network for ${JSON.stringify(n.name)}`, "nameOrChainId", e), wu.set(e, t);+ const n = Bu.get(e);+ n && V(!1, `conflicting network for ${JSON.stringify(n.name)}`, "nameOrChainId", e), Bu.set(e, t);}}-function dm(i, e) {+function xm(i, e) {const t = String(i);if (!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${i}`);@@ -45174,8 +45526,8 @@ function dm(i, e) {}return BigInt(n[0] + n[1]);}-function fm(i) {- return new ID(i, async (e, t, n) => {+function Em(i) {+ return new XD(i, async (e, t, n) => {n.setHeader("User-Agent", "ethers");let s;try {@@ -45187,28 +45539,28 @@ function fm(i) {const o = s.bodyJson.standard;return {gasPrice: a.gasPrice,- maxFeePerGas: dm(o.maxFee, 9),- maxPriorityFeePerGas: dm(o.maxPriorityFee, 9)+ maxFeePerGas: xm(o.maxFee, 9),+ maxPriorityFeePerGas: xm(o.maxPriorityFee, 9)};} catch (r) {ge(!1, `error encountered with polygon gas station (${JSON.stringify(n.url)})`, "SERVER_ERROR", { request: n, response: s, error: r });}});}-let pm = !1;-function MD() {- if (pm)+let _m = !1;+function YD() {+ if (_m)return;- pm = !0;+ _m = !0;function i(e, t, n) {const s = function() {- const r = new Xn(e, t);- return n.ensNetwork != null && r.attachPlugin(new ih(null, n.ensNetwork)), r.attachPlugin(new nh()), (n.plugins || []).forEach((a) => {+ const r = new jn(e, t);+ return n.ensNetwork != null && r.attachPlugin(new lh(null, n.ensNetwork)), r.attachPlugin(new ch()), (n.plugins || []).forEach((a) => {r.attachPlugin(a);}), r;};- Xn.register(e, s), Xn.register(t, s), n.altNames && n.altNames.forEach((r) => {- Xn.register(r, s);+ jn.register(e, s), jn.register(t, s), n.altNames && n.altNames.forEach((r) => {+ jn.register(r, s);});}i("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }), i("ropsten", 3, { ensNetwork: 3 }), i("rinkeby", 4, { ensNetwork: 4 }), i("goerli", 5, { ensNetwork: 5 }), i("kovan", 42, { ensNetwork: 42 }), i("sepolia", 11155111, { ensNetwork: 11155111 }), i("holesky", 17e3, { ensNetwork: 17e3 }), i("classic", 61, {}), i("classicKotti", 6, {}), i("arbitrum", 42161, {@@ -45216,22 +45568,22 @@ function MD() {}), i("arbitrum-goerli", 421613, {}), i("arbitrum-sepolia", 421614, {}), i("base", 8453, { ensNetwork: 1 }), i("base-goerli", 84531, {}), i("base-sepolia", 84532, {}), i("bnb", 56, { ensNetwork: 1 }), i("bnbt", 97, {}), i("filecoin", 314, {}), i("filecoin-calibration", 314159, {}), i("linea", 59144, { ensNetwork: 1 }), i("linea-goerli", 59140, {}), i("linea-sepolia", 59141, {}), i("matic", 137, {ensNetwork: 1,plugins: [- fm("https://gasstation.polygon.technology/v2")+ Em("https://gasstation.polygon.technology/v2")]}), i("matic-amoy", 80002, {}), i("matic-mumbai", 80001, {altNames: ["maticMumbai", "maticmum"],plugins: [- fm("https://gasstation-testnet.polygon.technology/v2")+ Em("https://gasstation-testnet.polygon.technology/v2")]}), i("optimism", 10, {ensNetwork: 1,plugins: []}), i("optimism-goerli", 420, {}), i("optimism-sepolia", 11155420, {}), i("xdai", 100, { ensNetwork: 1 });}-function Vd(i) {+function Yd(i) {return JSON.parse(JSON.stringify(i));}-class BD {+class JD {#e;#t;#n;@@ -45285,7 +45637,7 @@ class BD {this.start();}}-class jf {+class np {#e;#t;#n;@@ -45316,7 +45668,7 @@ class jf {this.start();}}-class TD extends jf {+class ZD extends np {#e;#t;constructor(e, t) {@@ -45330,16 +45682,16 @@ class TD extends jf {n != null && (this.#t === -2 ? this.#t = n.number : n.number > this.#t && (t.emit(this.#e, n.number), this.#t = n.number));}}-class RD extends jf {+class $D extends np {#e;constructor(e, t) {- super(e), this.#e = Vd(t);+ super(e), this.#e = Yd(t);}async _poll(e, t) {throw new Error("@TODO");}}-class ND extends jf {+class eL extends np {#e;/*** Create a new **PollingTransactionSubscriber** attached to@@ -45353,7 +45705,7 @@ class ND extends jf {n && t.emit(this.#e, n);}}-class Jf {+class ip {#e;#t;#n;@@ -45366,12 +45718,12 @@ class Jf {* %%provider%%, listening for %%filter%%.*/constructor(e, t) {- this.#e = e, this.#t = Vd(t), this.#n = this.#a.bind(this), this.#i = !1, this.#s = -2;+ this.#e = e, this.#t = Yd(t), this.#n = this.#a.bind(this), this.#i = !1, this.#s = -2;}async #a(e) {if (this.#s === -2)return;- const t = Vd(this.#t);+ const t = Yd(this.#t);t.fromBlock = this.#s + 1, t.toBlock = e;const n = await this.#e.getLogs(t);if (n.length === 0) {@@ -45396,11 +45748,11 @@ class Jf {this.start();}}-const FD = BigInt(2), DD = 10;-function $c(i) {+const tL = BigInt(2), nL = 10;+function sl(i) {return i && typeof i.then == "function";}-function cl(i, e) {+function fl(i, e) {return i + ":" + JSON.stringify(e, (t, n) => {if (n == null)return "null";@@ -45415,7 +45767,7 @@ function cl(i, e) {return n;});}-class qx {+class eE {/*** The name fof the event.*/@@ -45424,7 +45776,7 @@ class qx {* Create a new UnmanagedSubscriber with %%name%%.*/constructor(e) {- Ye(this, { name: e });+ Xe(this, { name: e });}start() {}@@ -45435,13 +45787,13 @@ class qx {resume() {}}-function LD(i) {+function iL(i) {return JSON.parse(JSON.stringify(i));}-function Wd(i) {+function Jd(i) {return i = Array.from(new Set(i).values()), i.sort(), i;}-async function Cu(i, e) {+async function Tu(i, e) {if (i == null)throw new Error("invalid event");if (Array.isArray(i) && (i = { topics: i }), typeof i == "string")@@ -45457,15 +45809,15 @@ async function Cu(i, e) {}if (Lt(i, 32)) {const t = i.toLowerCase();- return { type: "transaction", tag: cl("tx", { hash: t }), hash: t };+ return { type: "transaction", tag: fl("tx", { hash: t }), hash: t };}if (i.orphan) {const t = i;- return { type: "orphan", tag: cl("orphan", t), filter: LD(t) };+ return { type: "orphan", tag: fl("orphan", t), filter: iL(t) };}if (i.address || i.topics) {const t = i, n = {- topics: (t.topics || []).map((s) => s == null ? null : Array.isArray(s) ? Wd(s.map((r) => r.toLowerCase())) : s.toLowerCase())+ topics: (t.topics || []).map((s) => s == null ? null : Array.isArray(s) ? Jd(s.map((r) => r.toLowerCase())) : s.toLowerCase())};if (t.address) {const s = [], r = [], a = (o) => {@@ -45473,20 +45825,20 @@ async function Cu(i, e) {s.push(await Fn(o, e));})());};- Array.isArray(t.address) ? t.address.forEach(a) : a(t.address), r.length && await Promise.all(r), n.address = Wd(s.map((o) => o.toLowerCase()));+ Array.isArray(t.address) ? t.address.forEach(a) : a(t.address), r.length && await Promise.all(r), n.address = Jd(s.map((o) => o.toLowerCase()));}- return { filter: n, tag: cl("event", n), type: "event" };+ return { filter: n, tag: fl("event", n), type: "event" };}V(!1, "unknown ProviderEvent", "event", i);}-function vu() {+function Ru() {return (/* @__PURE__ */ new Date()).getTime();}-const PD = {+const sL = {cacheTimeout: 250,pollingInterval: 4e3};-class kD {+class rL {#e;#t;// null=unpaused, true=paused+dropWhilePaused, false=paused@@ -45507,10 +45859,10 @@ class kD {* [[Network]] if necessary.*/constructor(e, t) {- if (this.#A = Object.assign({}, PD, t || {}), e === "any")+ if (this.#A = Object.assign({}, sL, t || {}), e === "any")this.#a = !0, this.#s = null;else if (e) {- const n = Xn.from(e);+ const n = jn.from(e);this.#a = !1, this.#s = Promise.resolve(n), setTimeout(() => {this.emit("network", n, null);}, 0);@@ -45563,7 +45915,7 @@ class kD {const t = this.#A.cacheTimeout;if (t < 0)return await this._perform(e);- const n = cl(e.method, e);+ const n = fl(e.method, e);let s = this.#r.get(n);return s || (s = this._perform(e), this.#r.set(n, s), setTimeout(() => {this.#r.get(n) === s && this.#r.delete(n);@@ -45577,7 +45929,7 @@ class kD {return null;const s = e.to.toLowerCase(), r = t.toLowerCase(), a = [];for (let o = 0; o < n.length; o++) {- const c = n[o], l = c.replace("{sender}", s).replace("{data}", r), h = new Di(l);+ const c = n[o], l = c.replace("{sender}", s).replace("{data}", r), h = new Li(l);c.indexOf("{data}") === -1 && (h.body = { data: r, sender: s }), this.emit("debug", { action: "sendCcipReadFetchRequest", request: h, index: o, urls: n });let u = "unknown error", d;try {@@ -45607,7 +45959,7 @@ class kD {* sub-class of [[Block]].*/_wrapBlock(e, t) {- return new nD(_D(e), this);+ return new vD(zD(e), this);}/*** Provides the opportunity for a sub-class to wrap a log before@@ -45615,7 +45967,7 @@ class kD {* sub-class of [[Log]].*/_wrapLog(e, t) {- return new Jo(xD(e), this);+ return new nc(GD(e), this);}/*** Provides the opportunity for a sub-class to wrap a transaction@@ -45623,7 +45975,7 @@ class kD {* alternate sub-class of [[TransactionReceipt]].*/_wrapTransactionReceipt(e, t) {- return new Fx(vD(e), this);+ return new Gx(KD(e), this);}/*** Provides the opportunity for a sub-class to wrap a transaction@@ -45631,7 +45983,7 @@ class kD {* alternate sub-class of [[TransactionResponse]].*/_wrapTransactionResponse(e, t) {- return new Zo(Wx(e), this);+ return new ic($x(e), this);}/*** Resolves to the Network, forcing a network detection using whatever@@ -45686,9 +46038,9 @@ class kD {return e;}if (Lt(e))- return Lt(e, 32) ? e : fi(e);+ return Lt(e, 32) ? e : pi(e);if (typeof e == "bigint" && (e = ut(e, "blockTag")), typeof e == "number")- return e >= 0 ? fi(e) : this.#o >= 0 ? fi(this.#o + e) : this.getBlockNumber().then((t) => fi(t + e));+ return e >= 0 ? pi(e) : this.#o >= 0 ? pi(this.#o + e) : this.getBlockNumber().then((t) => pi(t + e));V(!1, "invalid blockTag", "blockTag", e);}/**@@ -45697,7 +46049,7 @@ class kD {* filter.*/_getFilter(e) {- const t = (e.topics || []).map((c) => c == null ? null : Array.isArray(c) ? Wd(c.map((l) => l.toLowerCase())) : c.toLowerCase()), n = "blockHash" in e ? e.blockHash : void 0, s = (c, l, h) => {+ const t = (e.topics || []).map((c) => c == null ? null : Array.isArray(c) ? Jd(c.map((l) => l.toLowerCase())) : c.toLowerCase()), n = "blockHash" in e ? e.blockHash : void 0, s = (c, l, h) => {let u;switch (c.length) {case 0:@@ -45731,17 +46083,17 @@ class kD {* transaction.*/_getTransactionRequest(e) {- const t = Dl(e), n = [];+ const t = Ol(e), n = [];if (["to", "from"].forEach((s) => {if (t[s] == null)return;const r = Fn(t[s], this);- $c(r) ? n.push((async function() {+ sl(r) ? n.push((async function() {t[s] = await r;})()) : t[s] = r;}), t.blockTag != null) {const s = this._getBlockTag(t.blockTag);- $c(s) ? n.push((async function() {+ sl(s) ? n.push((async function() {t.blockTag = await s;})()) : t.blockTag = s;}@@ -45793,35 +46145,35 @@ class kD {});let o = null, c = null;const l = this._wrapBlock(s, e);- return l && l.baseFeePerGas && (c = a ?? BigInt("1000000000"), o = l.baseFeePerGas * FD + c), new om(r, o, c);+ return l && l.baseFeePerGas && (c = a ?? BigInt("1000000000"), o = l.baseFeePerGas * tL + c), new pm(r, o, c);}, n = e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if (n) {- const s = new Di(n.url), r = await n.processFunc(t, this, s);- return new om(r.gasPrice, r.maxFeePerGas, r.maxPriorityFeePerGas);+ const s = new Li(n.url), r = await n.processFunc(t, this, s);+ return new pm(r.gasPrice, r.maxFeePerGas, r.maxPriorityFeePerGas);}return await t();}async estimateGas(e) {let t = this._getTransactionRequest(e);- return $c(t) && (t = await t), Fe(await this.#c({+ return sl(t) && (t = await t), Fe(await this.#c({method: "estimateGas",transaction: t}), "%response");}async #h(e, t, n) {- ge(n < DD, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", {+ ge(n < nL, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", {reason: "TOO_MANY_REDIRECTS",transaction: Object.assign({}, e, { blockTag: t, enableCcipRead: !0 })});- const s = Dl(e);+ const s = Ol(e);try {return Se(await this._perform({ method: "call", transaction: s, blockTag: t }));} catch (r) {- if (!this.disableCcipRead && Rf(r) && r.data && n >= 0 && t === "latest" && s.to != null && Vt(r.data, 0, 4) === "0x556f1830") {+ if (!this.disableCcipRead && kf(r) && r.data && n >= 0 && t === "latest" && s.to != null && Vt(r.data, 0, 4) === "0x556f1830") {const a = r.data, o = await Fn(s.to, this);let c;try {- c = HD(Vt(r.data, 4));+ c = hL(Vt(r.data, 4));} catch (u) {ge(!1, u.message, "OFFCHAIN_FAULT", {reason: "BAD_DATA",@@ -45849,7 +46201,7 @@ class kD {});const h = {to: o,- data: Ot([c.selector, GD([l, c.extraData])])+ data: Ot([c.selector, lL([l, c.extraData])])};this.emit("debug", { action: "sendCcipReadCall", transaction: h });try {@@ -45903,7 +46255,7 @@ class kD {signedTransaction: e}),network: this.getNetwork()- }), r = di.from(e);+ }), r = fi.from(e);if (r.hash !== n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(r, s).replaceableTransaction(t);@@ -45962,7 +46314,7 @@ class kD {// Bloom-filter Queriesasync getLogs(e) {let t = this._getFilter(e);- $c(t) && (t = await t);+ sl(t) && (t = await t);const { network: n, params: s } = await Bn({network: this.getNetwork(),params: this.#c({ method: "getLogs", filter: t })@@ -45976,7 +46328,7 @@ class kD {});}async getResolver(e) {- return await ga.fromName(this, e);+ return await Ea.fromName(this, e);}async getAvatar(e) {const t = await this.getResolver(e);@@ -45988,14 +46340,14 @@ class kD {}async lookupAddress(e) {e = St(e);- const t = Gd(e.substring(2).toLowerCase() + ".addr.reverse");+ const t = Kd(e.substring(2).toLowerCase() + ".addr.reverse");try {- const n = await ga.getEnsAddress(this), r = await new Aa(n, [+ const n = await Ea.getEnsAddress(this), r = await new xa(n, ["function resolver(bytes32) view returns (address)"], this).resolver(t);- if (r == null || r === Po)+ if (r == null || r === Go)return null;- const o = await new Aa(r, [+ const o = await new xa(r, ["function name(bytes32) view returns (string)"], this).name(t);return await this.resolveName(o) !== e ? null : o;@@ -46056,7 +46408,7 @@ class kD {this.#l.set(n, { timer: null, func: s, time: t });else {const r = setTimeout(s, t);- this.#l.set(n, { timer: r, func: s, time: vu() });+ this.#l.set(n, { timer: r, func: s, time: Ru() });}return n;}@@ -46076,20 +46428,20 @@ class kD {case "debug":case "error":case "network":- return new qx(e.type);+ return new eE(e.type);case "block": {- const t = new BD(this);+ const t = new JD(this);return t.pollingInterval = this.pollingInterval, t;}case "safe":case "finalized":- return new TD(this, e.type);+ return new ZD(this, e.type);case "event":- return new Jf(this, e.filter);+ return new ip(this, e.filter);case "transaction":- return new ND(this, e.hash);+ return new eL(this, e.hash);case "orphan":- return new RD(this, e.filter);+ return new $D(this, e.filter);}throw new Error(`unsupported event: ${e.type}`);}@@ -46110,11 +46462,11 @@ class kD {}}async #g(e, t) {- let n = await Cu(e, this);- return n.type === "event" && t && t.length > 0 && t[0].removed === !0 && (n = await Cu({ orphan: "drop-log", log: t[0] }, this)), this.#e.get(n.tag) || null;+ let n = await Tu(e, this);+ return n.type === "event" && t && t.length > 0 && t[0].removed === !0 && (n = await Tu({ orphan: "drop-log", log: t[0] }, this)), this.#e.get(n.tag) || null;}async #m(e) {- const t = await Cu(e, this), n = t.tag;+ const t = await Tu(e, this), n = t.tag;let s = this.#e.get(n);return s || (s = { subscriber: this._getSubscriber(t), tag: n, addressableMap: /* @__PURE__ */ new WeakMap(), nameMap: /* @__PURE__ */ new Map(), started: !1, listeners: [] }, this.#e.set(n, s)), s;}@@ -46132,7 +46484,7 @@ class kD {return !1;const s = n.listeners.length;return n.listeners = n.listeners.filter(({ listener: r, once: a }) => {- const o = new db(this, a ? null : r, e);+ const o = new Eb(this, a ? null : r, e);try {r.call(this, ...t, o);} catch {@@ -46241,7 +46593,7 @@ class kD {}this._forEachSubscriber((t) => t.pause(e)), this.#n = !!e;for (const t of this.#l.values())- t.timer && clearTimeout(t.timer), t.time = vu() - t.time;+ t.timer && clearTimeout(t.timer), t.time = Ru() - t.time;}/*** Resume the provider.@@ -46251,21 +46603,21 @@ class kD {this._forEachSubscriber((e) => e.resume()), this.#n = null;for (const e of this.#l.values()) {let t = e.time;- t < 0 && (t = 0), e.time = vu(), setTimeout(e.func, t);+ t < 0 && (t = 0), e.time = Ru(), setTimeout(e.func, t);}}}}-function UD(i, e) {+function aL(i, e) {try {- const t = qd(i, e);+ const t = Zd(i, e);if (t)- return Il(t);+ return Nl(t);} catch {}return null;}-function qd(i, e) {+function Zd(i, e) {if (i === "0x")return null;try {@@ -46275,33 +46627,33 @@ function qd(i, e) {}return null;}-function Am(i) {+function ym(i) {const e = $t(i);if (e.length > 32)throw new Error("internal; should not happen");const t = new Uint8Array(32);return t.set(e, 32 - e.length), t;}-function OD(i) {+function oL(i) {if (i.length % 32 === 0)return i;const e = new Uint8Array(Math.ceil(i.length / 32) * 32);return e.set(i), e;}-const QD = new Uint8Array([]);-function GD(i) {+const cL = new Uint8Array([]);+function lL(i) {const e = [];let t = 0;for (let n = 0; n < i.length; n++)- e.push(QD), t += 32;+ e.push(cL), t += 32;for (let n = 0; n < i.length; n++) {const s = ht(i[n]);- e[n] = Am(t), e.push(Am(s.length)), e.push(OD(s)), t += 32 + Math.ceil(s.length / 32) * 32;+ e[n] = ym(t), e.push(ym(s.length)), e.push(oL(s)), t += 32 + Math.ceil(s.length / 32) * 32;}return Ot(e);}-const gm = "0x0000000000000000000000000000000000000000000000000000000000000000";-function HD(i) {+const wm = "0x0000000000000000000000000000000000000000000000000000000000000000";+function hL(i) {const e = {sender: "",urls: [],@@ -46310,17 +46662,17 @@ function HD(i) {extraData: "",errorArgs: []};- ge(da(i) >= 160, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", {+ ge(ga(i) >= 160, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", {reason: "insufficient OffchainLookup data"});const t = Vt(i, 0, 32);- ge(Vt(t, 0, 12) === Vt(gm, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", {+ ge(Vt(t, 0, 12) === Vt(wm, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", {reason: "corrupt OffchainLookup sender"}), e.sender = Vt(t, 12);try {const n = [], s = ut(Vt(i, 32, 64)), r = ut(Vt(i, s, s + 32)), a = Vt(i, s + 32);for (let o = 0; o < r; o++) {- const c = UD(a, o * 32);+ const c = aL(a, o * 32);if (c == null)throw new Error("abort");n.push(c);@@ -46332,7 +46684,7 @@ function HD(i) {});}try {- const n = qd(i, 64);+ const n = Zd(i, 64);if (n == null)throw new Error("abort");e.calldata = n;@@ -46341,11 +46693,11 @@ function HD(i) {reason: "corrupt OffchainLookup calldata"});}- ge(Vt(i, 100, 128) === Vt(gm, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", {+ ge(Vt(i, 100, 128) === Vt(wm, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", {reason: "corrupt OffchainLookup callbaackSelector"}), e.selector = Vt(i, 96, 100);try {- const n = qd(i, 128);+ const n = Zd(i, 128);if (n == null)throw new Error("abort");e.extraData = n;@@ -46356,13 +46708,13 @@ function HD(i) {}return e.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((n) => e[n]), e;}-function $s(i, e) {+function tr(i, e) {if (i.provider)return i.provider;ge(!1, "missing provider", "UNSUPPORTED_OPERATION", { operation: e });}-async function mm(i, e) {- let t = Dl(e);+async function vm(i, e) {+ let t = Ol(e);if (t.to != null && (t.to = Fn(t.to, i)), t.from != null) {const n = t.from;t.from = Promise.all([@@ -46373,7 +46725,7 @@ async function mm(i, e) {t.from = i.getAddress();return await Bn(t);}-class zD {+class uL {/*** The provider this signer is connected to.*/@@ -46382,16 +46734,16 @@ class zD {* Creates a new Signer connected to %%provider%%.*/constructor(e) {- Ye(this, { provider: e || null });+ Xe(this, { provider: e || null });}async getNonce(e) {- return $s(this, "getTransactionCount").getTransactionCount(await this.getAddress(), e);+ return tr(this, "getTransactionCount").getTransactionCount(await this.getAddress(), e);}async populateCall(e) {- return await mm(this, e);+ return await vm(this, e);}async populateTransaction(e) {- const t = $s(this, "populateTransaction"), n = await mm(this, e);+ const t = tr(this, "populateTransaction"), n = await vm(this, e);n.nonce == null && (n.nonce = await this.getNonce("pending")), n.gasLimit == null && (n.gasLimit = await this.estimateGas(n));const s = await this.provider.getNetwork();if (n.chainId != null) {@@ -46427,21 +46779,21 @@ class zD {}async populateAuthorization(e) {const t = Object.assign({}, e);- return t.chainId == null && (t.chainId = (await $s(this, "getNetwork").getNetwork()).chainId), t.nonce == null && (t.nonce = await this.getNonce()), t;+ return t.chainId == null && (t.chainId = (await tr(this, "getNetwork").getNetwork()).chainId), t.nonce == null && (t.nonce = await this.getNonce()), t;}async estimateGas(e) {- return $s(this, "estimateGas").estimateGas(await this.populateCall(e));+ return tr(this, "estimateGas").estimateGas(await this.populateCall(e));}async call(e) {- return $s(this, "call").call(await this.populateCall(e));+ return tr(this, "call").call(await this.populateCall(e));}async resolveName(e) {- return await $s(this, "resolveName").resolveName(e);+ return await tr(this, "resolveName").resolveName(e);}async sendTransaction(e) {- const t = $s(this, "sendTransaction"), n = await this.populateTransaction(e);+ const t = tr(this, "sendTransaction"), n = await this.populateTransaction(e);delete n.from;- const s = di.from(n);+ const s = fi.from(n);return await t.broadcastTransaction(await this.signTransaction(s));}// @TODO: in v7 move this to be abstract@@ -46449,10 +46801,10 @@ class zD {ge(!1, "authorization not implemented for this signer", "UNSUPPORTED_OPERATION", { operation: "authorize" });}}-function VD(i) {+function dL(i) {return JSON.parse(JSON.stringify(i));}-class Kx {+class tE {#e;#t;#n;@@ -46530,17 +46882,17 @@ class Kx {this.start();}}-class WD extends Kx {+class fL extends tE {#e;/*** Creates a new **FilterIdEventSubscriber** attached to %%provider%%* listening for %%filter%%.*/constructor(e, t) {- super(e), this.#e = VD(t);+ super(e), this.#e = dL(t);}_recover(e) {- return new Jf(e, this.#e);+ return new ip(e, this.#e);}async _subscribe(e) {return await e.send("eth_newFilter", [this.#e]);@@ -46550,7 +46902,7 @@ class WD extends Kx {e.emit(this.#e, e._wrapLog(n, e._network));}}-class qD extends Kx {+class pL extends tE {async _subscribe(e) {return await e.send("eth_newPendingTransactionFilter", []);}@@ -46559,28 +46911,28 @@ class qD extends Kx {e.emit("pending", n);}}-const KD = "bigint,boolean,function,number,string,symbol".split(/,/g);-function ll(i) {- if (i == null || KD.indexOf(typeof i) >= 0 || typeof i.getAddress == "function")+const AL = "bigint,boolean,function,number,string,symbol".split(/,/g);+function pl(i) {+ if (i == null || AL.indexOf(typeof i) >= 0 || typeof i.getAddress == "function")return i;if (Array.isArray(i))- return i.map(ll);+ return i.map(pl);if (typeof i == "object")return Object.keys(i).reduce((e, t) => (e[t] = i[t], e), {});throw new Error(`should not happen: ${i} (${typeof i})`);}-function XD(i) {+function gL(i) {return new Promise((e) => {setTimeout(e, i);});}-function Yr(i) {+function Jr(i) {return i && i.toLowerCase();}-function bm(i) {+function Cm(i) {return i && typeof i.pollingInterval == "number";}-const Xx = {+const nE = {polling: !1,staticNetwork: null,batchStallTime: 10,@@ -46589,10 +46941,10 @@ const Xx = {cacheTimeout: 250,pollingInterval: 4e3};-class Su extends zD {+class Nu extends uL {address;constructor(e, t) {- super(e), t = St(t), Ye(this, { address: t });+ super(e), t = St(t), Xe(this, { address: t });}connect(e) {ge(!1, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", {@@ -46609,7 +46961,7 @@ class Su extends zD {// Returns just the hash of the transaction after sent, which is what// the bare JSON-RPC API does;async sendUncheckedTransaction(e) {- const t = ll(e), n = [];+ const t = pl(e), n = [];if (t.from) {const r = t.from;n.push((async () => {@@ -46661,7 +47013,7 @@ class Su extends zD {});}async signTransaction(e) {- const t = ll(e);+ const t = pl(e);if (t.from) {const s = await Fn(t.from, this.provider);V(s != null && s.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", e), t.from = s;@@ -46671,14 +47023,14 @@ class Su extends zD {return await this.provider.send("eth_signTransaction", [n]);}async signMessage(e) {- const t = typeof e == "string" ? os(e) : e;+ const t = typeof e == "string" ? cs(e) : e;return await this.provider.send("personal_sign", [Se(t),this.address.toLowerCase()]);}async signTypedData(e, t, n) {- const s = ll(n), r = await qn.resolveNames(e, t, s, async (a) => {+ const s = pl(n), r = await qn.resolveNames(e, t, s, async (a) => {const o = await Fn(a);return V(o != null, "TypedData does not support null address", "value", a), o;});@@ -46696,14 +47048,14 @@ class Su extends zD {}// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_signasync _legacySignMessage(e) {- const t = typeof e == "string" ? os(e) : e;+ const t = typeof e == "string" ? cs(e) : e;return await this.provider.send("eth_sign", [this.address.toLowerCase(),Se(t)]);}}-class YD extends kD {+class mL extends rL {#e;// The next ID to use for the JSON-RPC ID field#t;@@ -46763,7 +47115,7 @@ class YD extends kD {}, e);}constructor(e, t) {- super(e, t), this.#t = 1, this.#e = Object.assign({}, Xx, t || {}), this.#n = [], this.#i = null, this.#a = null, this.#r = null;+ super(e, t), this.#t = 1, this.#e = Object.assign({}, nE, t || {}), this.#n = [], this.#i = null, this.#a = null, this.#r = null;{let s = null;const r = new Promise((a) => {@@ -46772,7 +47124,7 @@ class YD extends kD {this.#s = { promise: r, resolve: s };}const n = this._getOption("staticNetwork");- typeof n == "boolean" ? (V(!n || e !== "any", "staticNetwork cannot be used on special network 'any'", "options", t), n && e != null && (this.#a = Xn.from(e))) : n && (V(e == null || n.matches(e), "staticNetwork MUST match network object", "options", t), this.#a = n);+ typeof n == "boolean" ? (V(!n || e !== "any", "staticNetwork cannot be used on special network 'any'", "options", t), n && e != null && (this.#a = jn.from(e))) : n && (V(e == null || n.matches(e), "staticNetwork MUST match network object", "options", t), this.#a = n);}/*** Returns the value associated with the option %%key%%.@@ -46825,7 +47177,7 @@ class YD extends kD {return e;return this.#r ? await this.#r : this.ready ? (this.#r = (async () => {try {- const t = Xn.from(Fe(await this.send("eth_chainId", [])));+ const t = jn.from(Fe(await this.send("eth_chainId", [])));return this.#r = null, t;} catch (t) {throw this.#r = null, t;@@ -46845,7 +47197,7 @@ class YD extends kD {throw this.#r = null, this.emit("debug", { action: "receiveRpcError", error: s }), s;}if (this.emit("debug", { action: "receiveRpcResult", result: n }), "result" in n)- return Xn.from(Fe(n.result));+ return jn.from(Fe(n.result));throw this.getRpcError(t, n);})(), await this.#r);}@@ -46864,7 +47216,7 @@ class YD extends kD {} catch (e) {if (this.destroyed)break;- console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"), this.emit("error", Qt("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error: e } })), await XD(1e3);+ console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"), this.emit("error", Qt("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error: e } })), await gL(1e3);}this.#o();})());@@ -46885,7 +47237,7 @@ class YD extends kD {* subscription management.*/_getSubscriber(e) {- return e.type === "pending" ? new qD(this) : e.type === "event" ? this._getOption("polling") ? new Jf(this, e.filter) : new WD(this, e.filter) : e.type === "orphan" && e.filter.orphan === "drop-log" ? new qx("orphan") : super._getSubscriber(e);+ return e.type === "pending" ? new pL(this) : e.type === "event" ? this._getOption("polling") ? new ip(this, e.filter) : new fL(this, e.filter) : e.type === "orphan" && e.filter.orphan === "drop-log" ? new eE("orphan") : super._getSubscriber(e);}/*** Returns true only if the [[_start]] has been called.@@ -46904,18 +47256,18 @@ class YD extends kD {if (e[n] == null)return;let s = n;- n === "gasLimit" && (s = "gas"), t[s] = fi(Fe(e[n], `tx.${n}`));+ n === "gasLimit" && (s = "gas"), t[s] = pi(Fe(e[n], `tx.${n}`));}), ["from", "to", "data"].forEach((n) => {e[n] != null && (t[n] = Se(e[n]));- }), e.accessList && (t.accessList = Ir(e.accessList)), e.blobVersionedHashes && (t.blobVersionedHashes = e.blobVersionedHashes.map((n) => n.toLowerCase())), e.authorizationList && (t.authorizationList = e.authorizationList.map((n) => {- const s = $b(n);+ }), e.accessList && (t.accessList = Br(e.accessList)), e.blobVersionedHashes && (t.blobVersionedHashes = e.blobVersionedHashes.map((n) => n.toLowerCase())), e.authorizationList && (t.authorizationList = e.authorizationList.map((n) => {+ const s = ox(n);return {address: s.address,- nonce: fi(s.nonce),- chainId: fi(s.chainId),- yParity: fi(s.signature.yParity),- r: fi(s.signature.r),- s: fi(s.signature.s)+ nonce: pi(s.nonce),+ chainId: pi(s.chainId),+ yParity: pi(s.signature.yParity),+ r: pi(s.signature.r),+ s: pi(s.signature.s)};})), t;}@@ -46936,23 +47288,23 @@ class YD extends kD {case "getBalance":return {method: "eth_getBalance",- args: [Yr(e.address), e.blockTag]+ args: [Jr(e.address), e.blockTag]};case "getTransactionCount":return {method: "eth_getTransactionCount",- args: [Yr(e.address), e.blockTag]+ args: [Jr(e.address), e.blockTag]};case "getCode":return {method: "eth_getCode",- args: [Yr(e.address), e.blockTag]+ args: [Jr(e.address), e.blockTag]};case "getStorage":return {method: "eth_getStorageAt",args: [- Yr(e.address),+ Jr(e.address),"0x" + e.position.toString(16),e.blockTag]@@ -46995,7 +47347,7 @@ class YD extends kD {args: [this.getRpcTransaction(e.transaction)]};case "getLogs":- return e.filter && e.filter.address != null && (Array.isArray(e.filter.address) ? e.filter.address = e.filter.address.map(Yr) : e.filter.address = Yr(e.filter.address)), { method: "eth_getLogs", args: [e.filter] };+ return e.filter && e.filter.address != null && (Array.isArray(e.filter.address) ? e.filter.address = e.filter.address.map(Jr) : e.filter.address = Jr(e.filter.address)), { method: "eth_getLogs", args: [e.filter] };}return null;}@@ -47021,10 +47373,10 @@ class YD extends kD {});}if (n === "eth_call" || n === "eth_estimateGas") {- const o = Kd(s), c = Ta.getBuiltinCallException(n === "eth_call" ? "call" : "estimateGas", e.params[0], o ? o.data : null);+ const o = $d(s), c = Da.getBuiltinCallException(n === "eth_call" ? "call" : "estimateGas", e.params[0], o ? o.data : null);return c.info = { error: s, payload: e }, c;}- const r = JSON.stringify(ZD(s));+ const r = JSON.stringify(EL(s));if (typeof s.message == "string" && s.message.match(/user denied|ethers-user-denied/i))return Qt("user rejected action", "ACTION_REJECTED", {action: {@@ -47106,7 +47458,7 @@ class YD extends kD {const s = await t;if (e >= s.length)throw new Error("no such account");- return new Su(this, s[e]);+ return new Nu(this, s[e]);}const { accounts: n } = await Bn({network: this.getNetwork(),@@ -47115,11 +47467,11 @@ class YD extends kD {e = St(e);for (const s of n)if (St(s) === e)- return new Su(this, e);+ return new Nu(this, e);throw new Error("invalid account");}async listAccounts() {- return (await this.send("eth_accounts", [])).map((t) => new Su(this, t));+ return (await this.send("eth_accounts", [])).map((t) => new Nu(this, t));}destroy() {this.#i && (clearTimeout(this.#i), this.#i = null);@@ -47128,16 +47480,16 @@ class YD extends kD {this.#n = [], super.destroy();}}-class jD extends YD {+class bL extends mL {#e;constructor(e, t) {super(e, t);let n = this._getOption("pollingInterval");- n == null && (n = Xx.pollingInterval), this.#e = n;+ n == null && (n = nE.pollingInterval), this.#e = n;}_getSubscriber(e) {const t = super._getSubscriber(e);- return bm(t) && (t.pollingInterval = this.#e), t;+ return Cm(t) && (t.pollingInterval = this.#e), t;}/*** The polling interval (default: 4000 ms)@@ -47149,14 +47501,14 @@ class jD extends YD {if (!Number.isInteger(e) || e < 0)throw new Error("invalid interval");this.#e = e, this._forEachSubscriber((t) => {- bm(t) && (t.pollingInterval = this.#e);+ Cm(t) && (t.pollingInterval = this.#e);});}}-class JD extends jD {+class xL extends bL {#e;constructor(e, t, n) {- e == null && (e = "http://localhost:8545"), super(t, n), typeof e == "string" ? this.#e = new Di(e) : this.#e = e.clone();+ e == null && (e = "http://localhost:8545"), super(t, n), typeof e == "string" ? this.#e = new Li(e) : this.#e = e.clone();}_getConnection() {return this.#e.clone();@@ -47173,14 +47525,14 @@ class JD extends jD {return Array.isArray(s) || (s = [s]), s;}}-function Kd(i) {+function $d(i) {if (i == null)return null;if (typeof i.message == "string" && i.message.match(/revert/i) && Lt(i.data))return { message: i.message, data: i.data };if (typeof i == "object") {for (const e in i) {- const t = Kd(i[e]);+ const t = $d(i[e]);if (t)return t;}@@ -47188,28 +47540,28 @@ function Kd(i) {}if (typeof i == "string")try {- return Kd(JSON.parse(i));+ return $d(JSON.parse(i));} catch {}return null;}-function Xd(i, e) {+function ef(i, e) {if (i != null) {if (typeof i.message == "string" && e.push(i.message), typeof i == "object")for (const t in i)- Xd(i[t], e);+ ef(i[t], e);if (typeof i == "string")try {- return Xd(JSON.parse(i), e);+ return ef(JSON.parse(i), e);} catch {}}}-function ZD(i) {+function EL(i) {const e = [];- return Xd(i, e), e;+ return ef(i, e), e;}-const $D = [+const _L = [// --- Registration ---"function register() external returns (uint256 agentId)","function register(string agentURI) external returns (uint256 agentId)",@@ -47233,7 +47585,7 @@ const $D = [// --- Events ---"event Registered(uint256 indexed agentId, string agentURI, address indexed owner)","event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"-], er = {+], nr = {identityRegistry: "0x8004A818BFB912233c491871b3d84c89A494BD9e",reputationRegistry: "0x8004B663056A597Dffe9eCcC1965A193B7388713",validationRegistry: "0x8004Cb1BF31DAf7788923b405b754f57acEB4272"@@ -47242,7 +47594,7 @@ const $D = [reputationRegistry: "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",validationRegistry: ""// not yet deployed on mainnet-}, eL = {+}, yL = {// Mainnets1: In,// Ethereum@@ -47275,56 +47627,56 @@ const $D = [534352: In,// Scroll// Testnets- 97: er,+ 97: nr,// BSC Testnet- 11155111: er,+ 11155111: nr,// Ethereum Sepolia- 84532: er,+ 84532: nr,// Base Sepolia- 421614: er,+ 421614: nr,// Arbitrum Sepolia- 11155420: er,+ 11155420: nr,// Optimism Sepolia- 80002: er,+ 80002: nr,// Polygon Amoy- 43113: er+ 43113: nr// Avalanche Fuji-}, tL = {+}, wL = {base: 8453,"base-mainnet": 8453,"base-sepolia": 84532,ethereum: 1,mainnet: 1-}, nL = {+}, vL = {8453: "https://mainnet.base.org",84532: "https://sepolia.base.org",1: "https://eth.llamarpc.com"};-async function xm(i, { rpcURL: e, registry: t } = {}) {+async function Sm(i, { rpcURL: e, registry: t } = {}) {if (!i) throw new Error("loadManifest: source required");if (i.startsWith("agent://"))- return iL(i, { rpcURL: e, registryOverride: t });+ return CL(i, { rpcURL: e, registryOverride: t });if (i.startsWith("ipfs://") || i.startsWith("ar://")) {- const n = _r(i), s = await Yd(n);- return jd(s, { baseURI: Jd(n) });+ const n = wr(i), s = await tf(n);+ return nf(s, { baseURI: sf(n) });}if (i.startsWith("http")) {- const n = await Yd(i);- return jd(n, { baseURI: Jd(i) });+ const n = await tf(i);+ return nf(n, { baseURI: sf(i) });}throw new Error(`Unsupported manifest source: ${i}`);}-async function iL(i, { rpcURL: e, registryOverride: t }) {+async function CL(i, { rpcURL: e, registryOverride: t }) {const n = i.match(/^agent:\/\/([^/]+)\/(\d+)$/);if (!n) throw new Error(`Malformed agent URI: ${i}`);- const [, s, r] = n, a = tL[s.toLowerCase()] || Number(s);+ const [, s, r] = n, a = wL[s.toLowerCase()] || Number(s);if (!a) throw new Error(`Unknown chain: ${s}`);- const o = eL[a], c = t || o?.identityRegistry;+ const o = yL[a], c = t || o?.identityRegistry;if (!c)throw new Error(`No registry deployed on chain ${a}. Pass registry= override.`);- const l = new JD(e || nL[a]), h = new Aa(c, $D, l), u = BigInt(r), d = await h.tokenURI(u);+ const l = new xL(e || vL[a]), h = new xa(c, _L, l), u = BigInt(r), d = await h.tokenURI(u);if (!d) throw new Error(`Agent ${r} on chain ${a} has no URI`);- const f = _r(d), m = await Yd(f), g = jd(m, { baseURI: Jd(f) });+ const f = wr(d), m = await tf(f), g = nf(m, { baseURI: sf(f) });return g.id = {...g.id,chain: s,@@ -47333,17 +47685,17 @@ async function iL(i, { rpcURL: e, registryOverride: t }) {agentId: r}, g;}-async function Yd(i) {+async function tf(i) {let e;try {e = await fetch(i);} catch {- e = await pT(i);+ e = await yT(i);}if (!e.ok) throw new Error(`Manifest fetch failed: ${i} (${e.status})`);return e.json();}-function jd(i, { baseURI: e = "" } = {}) {+function nf(i, { baseURI: e = "" } = {}) {if (i.spec && i.spec.startsWith("agent-manifest/")) {const t = { ...i, _baseURI: e };return t.body = t.body || {}, !t.body.uri && t.image && (t.body.uri = t.image), t;@@ -47384,11 +47736,11 @@ function jd(i, { baseURI: e = "" } = {}) {version: i.version || "0.1.0"};}-function Jd(i) {+function sf(i) {const e = i.lastIndexOf("/");return e >= 0 ? i.slice(0, e + 1) : i;}-async function sL(i, e) {+async function SL(i, e) {if (!i._baseURI) return null;try {const t = new URL(e, i._baseURI).href, n = await fetch(t);@@ -47397,39 +47749,39 @@ async function sL(i, e) {return null;}}-class es extends Error {+class ts extends Error {constructor(e, t, { status: n } = {}) {super(t), this.name = "AgentResolveError", this.code = e, n !== void 0 && (this.status = n);}}-async function Em(i, { fetchFn: e }) {+async function Im(i, { fetchFn: e }) {let t;try {t = await e(i, { credentials: "include" });} catch (n) {- throw new es("network", `network error fetching ${i}: ${n.message || n}`);+ throw new ts("network", `network error fetching ${i}: ${n.message || n}`);}if (t.status === 401 || t.status === 403)- throw new es("unauthorized", `unauthorized fetching ${i} (${t.status})`, { status: t.status });+ throw new ts("unauthorized", `unauthorized fetching ${i} (${t.status})`, { status: t.status });if (t.status === 404)- throw new es("not_found", `resource not found: ${i}`, { status: 404 });+ throw new ts("not_found", `resource not found: ${i}`, { status: 404 });if (!t.ok)- throw new es("network", `request failed: ${i} (${t.status})`, { status: t.status });+ throw new ts("network", `request failed: ${i} (${t.status})`, { status: t.status });try {return await t.json();} catch (n) {- throw new es("network", `invalid JSON from ${i}: ${n.message || n}`);+ throw new ts("network", `invalid JSON from ${i}: ${n.message || n}`);}}-async function rL(i, { origin: e = typeof location < "u" ? location.origin : "", fetchFn: t = fetch } = {}) {- if (!i) throw new es("not_found", "agentId required");- const n = t.bind(typeof globalThis < "u" ? globalThis : void 0), r = (await Em(`${e}/api/agents/${encodeURIComponent(i)}`, { fetchFn: n }))?.agent;- if (!r) throw new es("not_found", `agent ${i} not found`);+async function IL(i, { origin: e = typeof location < "u" ? location.origin : "", fetchFn: t = fetch } = {}) {+ if (!i) throw new ts("not_found", "agentId required");+ const n = t.bind(typeof globalThis < "u" ? globalThis : void 0), r = (await Im(`${e}/api/agents/${encodeURIComponent(i)}`, { fetchFn: n }))?.agent;+ if (!r) throw new ts("not_found", `agent ${i} not found`);if (!r.avatar_id)- throw new es("no_avatar", `agent ${i} has no avatar bound`);- const o = (await Em(`${e}/api/avatars/${encodeURIComponent(r.avatar_id)}`, { fetchFn: n }))?.avatar;+ throw new ts("no_avatar", `agent ${i} has no avatar bound`);+ const o = (await Im(`${e}/api/avatars/${encodeURIComponent(r.avatar_id)}`, { fetchFn: n }))?.avatar;if (!o || !o.url)- throw new es("no_avatar", `avatar ${r.avatar_id} has no url`);+ throw new ts("no_avatar", `avatar ${r.avatar_id} has no url`);const c = Array.isArray(r.skills) ? r.skills.map((l) => typeof l == "string" ? { name: l } : l).filter(Boolean) : [];return {spec: "agent-manifest/0.1",@@ -47452,7 +47804,7 @@ async function rL(i, { origin: e = typeof location < "u" ? location.origin : "",_source: "agent-id"};}-const aL = ["inline", "floating", "section", "fullscreen"], oL = `+const ML = ["inline", "floating", "section", "fullscreen"], BL = `:host {display: block;position: relative;@@ -47475,6 +47827,18 @@ const aL = ["inline", "floating", "section", "fullscreen"], oL = `border-radius: var(--agent-bubble-radius);overflow: hidden;box-shadow: var(--agent-shadow);+ transition:+ width 0.3s cubic-bezier(0.4, 0, 0.2, 1),+ height 0.3s cubic-bezier(0.4, 0, 0.2, 1),+ border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);+ }+ @media (prefers-reduced-motion: reduce) {+ :host([mode="floating"]) { transition: none; }+ }+ /* Inline responsive: height follows width at a 3:4 portrait ratio */+ :host([mode="inline"][data-responsive]) {+ height: auto;+ aspect-ratio: var(--agent-aspect, 3/4);}:host([mode="fullscreen"]) {position: fixed;@@ -47491,6 +47855,33 @@ const aL = ["inline", "floating", "section", "fullscreen"], oL = `height: 100%;}.stage canvas { display: block; }+ /* Pill tap target — shown when collapsed to pill on narrow viewports */+ .pill-btn {+ display: none;+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ background: none;+ border: 0;+ cursor: pointer;+ border-radius: inherit;+ z-index: 10;+ }+ /* Swipe-down handle visible when bottom-sheet is expanded */+ .pill-drag {+ display: none;+ position: absolute;+ top: 8px;+ left: 50%;+ transform: translateX(-50%);+ width: 36px;+ height: 4px;+ border-radius: 2px;+ background: rgba(255,255,255,0.25);+ pointer-events: none;+ z-index: 20;+ }.chrome {position: absolute;left: 12px;@@ -47578,58 +47969,116 @@ const aL = ["inline", "floating", "section", "fullscreen"], oL = `font: 14px var(--agent-chat-font);}`;-class Yx extends HTMLElement {+class iE extends HTMLElement {static get observedAttributes() {- return ["src", "manifest", "body", "agent-id", "mode", "position", "width", "height", "voice", "api-key", "key-proxy"];+ return ["src", "manifest", "body", "agent-id", "mode", "position", "width", "height", "voice", "api-key", "key-proxy", "responsive"];}constructor() {- super(), this.attachShadow({ mode: "open" }), this._viewer = null, this._scene = null, this._runtime = null, this._memory = null, this._skills = null, this._manifest = null, this._mounted = !1, this._booting = !1, this._listening = !1;+ super(), this.attachShadow({ mode: "open" }), this._viewer = null, this._scene = null, this._runtime = null, this._memory = null, this._skills = null, this._manifest = null, this._mounted = !1, this._booting = !1, this._listening = !1, this._pillActive = !1, this._mqNarrow = null, this._mqNarrowHandler = null, this._ro = null, this._outsideTapHandler = null;}connectedCallback() {- this._renderShell(), this._applyLayout(), this._observeViewport(), this.hasAttribute("eager") && this._boot();+ this._renderShell(), this._applyLayout(), this._setupResponsive(), this._observeViewport(), this.hasAttribute("eager") && this._boot();}disconnectedCallback() {this._teardown();}attributeChangedCallback(e, t, n) {- this._mounted && (["mode", "position", "width", "height"].includes(e) && this._applyLayout(), ["src", "manifest", "body", "agent-id"].includes(e) && (this._teardown(), this._boot()));+ this._mounted && (["mode", "position", "width", "height", "responsive"].includes(e) && this._applyLayout(), ["src", "manifest", "body", "agent-id"].includes(e) && (this._teardown(), this._boot()));}_renderShell() {const e = document.createElement("style");- e.textContent = oL, this.shadowRoot.appendChild(e);+ e.textContent = BL, this.shadowRoot.appendChild(e);const t = document.createElement("div");t.className = "stage", t.part = "stage", this.shadowRoot.appendChild(t), this._stageEl = t;const n = document.createElement("div");n.className = "poster", this.getAttribute("poster") && (n.style.backgroundImage = `url(${this.getAttribute("poster")})`), this.shadowRoot.appendChild(n), this._posterEl = n;const s = document.createElement("div");- if (s.className = "loading", s.textContent = "Loading...", s.hidden = !0, this.shadowRoot.appendChild(s), this._loadingEl = s, !this.hasAttribute("kiosk")) {- const r = document.createElement("div");- r.className = "chrome", r.part = "chrome";- const a = document.createElement("div");- a.className = "chat", a.part = "chat";+ s.className = "loading", s.textContent = "Loading...", s.hidden = !0, this.shadowRoot.appendChild(s), this._loadingEl = s;+ const r = document.createElement("button");+ r.className = "pill-btn", r.setAttribute("aria-label", "Open agent"), r.addEventListener("click", () => this._expandPill()), r.addEventListener("keydown", (o) => {+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), this._expandPill());+ }), this.shadowRoot.appendChild(r), this._pillBtn = r;+ const a = document.createElement("div");+ if (a.className = "pill-drag", this.shadowRoot.appendChild(a), this._pillDrag = a, !this.hasAttribute("kiosk")) {const o = document.createElement("div");- o.className = "input-row";- const c = document.createElement("input");- c.type = "text", c.placeholder = "Say something...", c.addEventListener("keydown", (h) => {- if (h.key === "Enter" && c.value.trim()) {- const u = c.value.trim();- c.value = "", this.say(u);+ o.className = "chrome", o.part = "chrome";+ const c = document.createElement("div");+ c.className = "chat", c.part = "chat";+ const l = document.createElement("div");+ l.className = "input-row";+ const h = document.createElement("input");+ h.type = "text", h.placeholder = "Say something...", h.addEventListener("keydown", (d) => {+ if (d.key === "Enter" && h.value.trim()) {+ const f = h.value.trim();+ h.value = "", this.say(f);}});- const l = document.createElement("button");- l.className = "icon mic", l.title = "Push to talk", l.innerHTML = "🎙", l.addEventListener("click", () => this._toggleMic()), o.appendChild(c), o.appendChild(l), r.appendChild(a), r.appendChild(o), this.shadowRoot.appendChild(r), this._chatEl = a, this._inputEl = c, this._micEl = l;+ const u = document.createElement("button");+ u.className = "icon mic", u.title = "Push to talk", u.innerHTML = "🎙", u.addEventListener("click", () => this._toggleMic()), l.appendChild(h), l.appendChild(u), o.appendChild(c), o.appendChild(l), this.shadowRoot.appendChild(o), this._chatEl = c, this._inputEl = h, this._micEl = u;}}+ _isResponsive() {+ return this.getAttribute("responsive") !== "false";+ }+ _clampWidth(e) {+ const t = _parsePx(e);+ if (!t) return e;+ const n = Math.round(Math.max(160, t * 0.65)), s = Math.round(t / 1440 * 100);+ return `clamp(${n}px, ${s}vw, ${t}px)`;+ }+ _clampHeight(e) {+ const t = _parsePx(e);+ if (!t) return e;+ const n = Math.round(Math.max(200, t * 0.65)), s = Math.round(t / 900 * 100);+ return `clamp(${n}px, ${s}vh, ${t}px)`;+ }_applyLayout() {const e = this.getAttribute("mode") || "inline";- if (!aL.includes(e)) return;+ if (!ML.includes(e)) return;+ const t = this._isResponsive();if (e === "floating") {- const s = this.getAttribute("position") || "bottom-right", r = (this.getAttribute("offset") || "24px 24px").split(/\s+/), [a, o] = [r[0], r[1] || r[0]];- this.style.top = this.style.bottom = this.style.left = this.style.right = "", s.includes("top") ? this.style.top = a : this.style.bottom = a, s.includes("left") ? this.style.left = o : s.includes("right") ? this.style.right = o : s.includes("center") && (this.style.left = "50%", this.style.transform = "translateX(-50%)");- } else+ if (!this._pillActive) {+ const r = this.getAttribute("position") || "bottom-right", a = (this.getAttribute("offset") || "24px 24px").split(/\s+/), [o, c] = [a[0], a[1] || a[0]];+ this.style.top = this.style.bottom = this.style.left = this.style.right = "", r.includes("top") ? this.style.top = o : this.style.bottom = o, r.includes("left") ? this.style.left = c : r.includes("right") ? this.style.right = c : r.includes("center") && (this.style.left = "50%", this.style.transform = "translateX(-50%)");+ }+ const n = this.getAttribute("width") || "320px", s = this.getAttribute("height") || "420px";+ this.style.setProperty("--agent-width", t ? this._clampWidth(n) : n), this.style.setProperty("--agent-height", t ? this._clampHeight(s) : s);+ } else {this.style.top = this.style.bottom = this.style.left = this.style.right = this.style.transform = "";- const t = this.getAttribute("width"), n = this.getAttribute("height");- t && this.style.setProperty("--agent-width", t), n && this.style.setProperty("--agent-height", n), e === "inline" && (t && (this.style.width = t), n && (this.style.height = n));+ const n = this.getAttribute("width"), s = this.getAttribute("height");+ e === "inline" && (n && (this.style.width = t ? this._clampWidth(n) : n), s ? (this.style.height = s, this.removeAttribute("data-responsive")) : t && n && (this.style.height = "", this.setAttribute("data-responsive", ""))), n && this.style.setProperty("--agent-width", t ? this._clampWidth(n) : n), s && this.style.setProperty("--agent-height", t ? this._clampHeight(s) : s);+ }+ }+ _setupResponsive() {+ const e = this.getAttribute("mode") || "inline";+ e === "inline" && typeof ResizeObserver < "u" && (this._ro = new ResizeObserver(() => this._applyLayout()), this._ro.observe(this)), e === "floating" && this._isResponsive() && typeof window < "u" && (this._mqNarrow = window.matchMedia("(max-width: 479px)"), this._mqNarrowHandler = (n) => this._updatePillState(n.matches), this._mqNarrow.addEventListener("change", this._mqNarrowHandler), this._updatePillState(this._mqNarrow.matches));+ let t = 0;+ this.shadowRoot.addEventListener("touchstart", (n) => {+ t = n.touches[0].clientY;+ }, { passive: !0 }), this.shadowRoot.addEventListener("touchend", (n) => {+ n.changedTouches[0].clientY - t > 60 && this._pillActive && this.getAttribute("aria-expanded") === "true" && this._collapsePill();+ }, { passive: !0 });+ }+ _updatePillState(e) {+ e && !this._pillActive ? (this._pillActive = !0, this._collapsePill()) : !e && this._pillActive && (this._pillActive = !1, this._restoreFromPill());+ }+ _collapsePill() {+ this.style.width = "56px", this.style.height = "56px", this.style.borderRadius = "50%", this.setAttribute("aria-expanded", "false"), this._pillBtn.style.display = "block", this._pillDrag.style.display = "none";+ const e = this.shadowRoot.querySelector(".chrome");+ e && (e.style.display = "none"), this._stageEl.style.display = "none", this._outsideTapHandler && (document.removeEventListener("pointerdown", this._outsideTapHandler), this._outsideTapHandler = null);+ }+ _expandPill() {+ if (!this._pillActive) return;+ this.style.width = "100vw", this.style.height = "70vh", this.style.borderRadius = "16px 16px 0 0", this.style.bottom = "0", this.style.top = "auto", this.style.left = "0", this.style.right = "0", this.style.transform = "none", this.setAttribute("aria-expanded", "true"), this._pillBtn.style.display = "none", this._pillDrag.style.display = "block";+ const e = this.shadowRoot.querySelector(".chrome");+ e && (e.style.display = ""), this._stageEl.style.display = "", this._outsideTapHandler = (t) => {+ t.composedPath().includes(this) || this._collapsePill();+ }, setTimeout(() => document.addEventListener("pointerdown", this._outsideTapHandler), 0);+ }+ _restoreFromPill() {+ this.removeAttribute("aria-expanded"), this._pillBtn.style.display = "none", this._pillDrag.style.display = "none";+ const e = this.shadowRoot.querySelector(".chrome");+ e && (e.style.display = ""), this._stageEl.style.display = "", this.style.width = this.style.height = this.style.borderRadius = "", this.style.bottom = this.style.top = this.style.left = this.style.right = this.style.transform = "", this._applyLayout(), this._outsideTapHandler && (document.removeEventListener("pointerdown", this._outsideTapHandler), this._outsideTapHandler = null);}_observeViewport() {if (!this.hasAttribute("eager")) {@@ -47649,21 +48098,21 @@ class Yx extends HTMLElement {this._loadingEl.hidden = !1, this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "manifest", pct: 0.1 } }));const e = await this._resolveManifest();if (this._manifest = e, this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "manifest", pct: 0.3 } })), typeof e.brain?.instructions == "string" && e.brain.instructions.endsWith(".md")) {- const c = await sL(e, e.brain.instructions);- c && (e.instructions = cL(c));+ const c = await SL(e, e.brain.instructions);+ c && (e.instructions = TL(c));} else e.brain?.instructions && (e.instructions = e.brain.instructions);this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "body", pct: 0.45 } }));- const t = new ob(this._stageEl, { kiosk: this.hasAttribute("kiosk") });+ const t = new pb(this._stageEl, { kiosk: this.hasAttribute("kiosk") });this._viewer = t;- const n = _r(e.body?.uri);- n && await t.load(n, "", /* @__PURE__ */ new Map()), this._scene = new AT(t), this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "memory", pct: 0.6 } }));+ const n = wr(e.body?.uri);+ n && await t.load(n, "", /* @__PURE__ */ new Map()), this._scene = new CT(t), this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "memory", pct: 0.6 } }));const s = e.id?.agentId || this.getAttribute("memory-key") || e.name || "anon";- this._memory = await Ii.load({+ this._memory = await Mi.load({mode: this.getAttribute("memory") || e.memory?.mode || "local",namespace: s,manifestURI: e._baseURI + "manifest.json",fetchFn: fetch.bind(globalThis)- }), this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "skills", pct: 0.75 } })), this._skills = new bT({+ }), this.dispatchEvent(new CustomEvent("agent:load-progress", { detail: { phase: "skills", pct: 0.75 } })), this._skills = new QT({trust: this.getAttribute("skill-trust") || "owned-only",ownerAddress: e.id?.owner});@@ -47680,7 +48129,7 @@ class Yx extends HTMLElement {apiKey: this.getAttribute("api-key") || void 0,proxyURL: this.getAttribute("key-proxy") || void 0}, o = this._parseTTSAttribute();- o && (e.voice = e.voice || {}, e.voice.tts = { ...e.voice.tts || {}, ...o }), this._runtime = new dT({+ o && (e.voice = e.voice || {}, e.voice.tts = { ...e.voice.tts || {}, ...o }), this._runtime = new ET({manifest: e,viewer: this._scene,memory: this._memory,@@ -47691,7 +48140,7 @@ class Yx extends HTMLElement {this._runtime.addEventListener(c, (l) => {this.dispatchEvent(new CustomEvent(c, { detail: l.detail, bubbles: !0, composed: !0 })), c === "brain:message" && this._chatEl && this._renderMessage(l.detail);});- this._mounted = !0, this._loadingEl.hidden = !0, this._posterEl.style.opacity = "0", this.dispatchEvent(new CustomEvent("agent:ready", {+ this._mounted = !0, this._loadingEl.hidden = !0, this._pillActive || (this._posterEl.style.opacity = "0"), this.dispatchEvent(new CustomEvent("agent:ready", {detail: { agent: this, manifest: e },bubbles: !0,composed: !0@@ -47710,9 +48159,9 @@ class Yx extends HTMLElement {async _resolveManifest() {const e = this.getAttribute("src"), t = this.getAttribute("manifest"), n = this.getAttribute("body"), s = this.getAttribute("agent-id");if (e)- return s && console.warn("[agent-3d] both src and agent-id provided; using src"), xm(e, { rpcURL: this.getAttribute("rpc-url"), registry: this.getAttribute("registry") });- if (s) return rL(s);- if (t) return xm(t);+ return s && console.warn("[agent-3d] both src and agent-id provided; using src"), Sm(e, { rpcURL: this.getAttribute("rpc-url"), registry: this.getAttribute("registry") });+ if (s) return IL(s);+ if (t) return Sm(t);if (n) {const r = this.getAttribute("instructions");return {@@ -47766,6 +48215,15 @@ class Yx extends HTMLElement {this._io?.disconnect();} catch {}+ try {+ this._ro?.disconnect();+ } catch {+ }+ try {+ this._mqNarrow && this._mqNarrowHandler && this._mqNarrow.removeEventListener("change", this._mqNarrowHandler);+ } catch {+ }+ this._outsideTapHandler && (document.removeEventListener("pointerdown", this._outsideTapHandler), this._outsideTapHandler = null);try {this._runtime?.destroy();} catch {@@ -47774,7 +48232,7 @@ class Yx extends HTMLElement {this._viewer?.dispose?.();} catch {}- this._mounted = !1, this._runtime = this._viewer = this._scene = this._memory = this._skills = null;+ this._mounted = !1, this._pillActive = !1, this._runtime = this._viewer = this._scene = this._memory = this._skills = null;}// --- Public JS API ---async say(e, t = {}) {@@ -47840,12 +48298,12 @@ class Yx extends HTMLElement {});}}-function cL(i) {+function TL(i) {const e = i.match(/^---\n[\s\S]*?\n---\n?([\s\S]*)$/);return e ? e[1] : i;}-customElements.get("agent-3d") || customElements.define("agent-3d", Yx);-const lL = ["row", "circle", "freeform"], hL = `+customElements.get("agent-3d") || customElements.define("agent-3d", iE);+const RL = ["row", "circle", "freeform"], NL = `:host {display: block;position: relative;@@ -47866,7 +48324,7 @@ const lL = ["row", "circle", "freeform"], hL = `pointer-events: none;}`;-class uL extends HTMLElement {+class FL extends HTMLElement {static get observedAttributes() {return ["formation"];}@@ -47893,14 +48351,14 @@ class uL extends HTMLElement {}get formation() {const e = this.getAttribute("formation") || "row";- return lL.includes(e) ? e : "row";+ return RL.includes(e) ? e : "row";}get viewer() {return this._viewer;}_renderShell() {const e = document.createElement("style");- e.textContent = hL, this.shadowRoot.appendChild(e);+ e.textContent = NL, this.shadowRoot.appendChild(e);const t = document.createElement("div");t.className = "stage-canvas", t.part = "stage", this.shadowRoot.appendChild(t), this._canvasBox = t;const n = document.createElement("slot");@@ -47908,7 +48366,7 @@ class uL extends HTMLElement {}_initViewer() {if (!this._initialized) {- this._viewer = new ob(this._canvasBox, { kiosk: !0 }), this._viewer.defaultCamera.position.set(0, 1.55, 3.4), this._viewer.defaultCamera.lookAt(0, 1.2, 0), this._viewer.controls.target.set(0, 1.2, 0), this._viewer.controls.update();+ this._viewer = new pb(this._canvasBox, { kiosk: !0 }), this._viewer.defaultCamera.position.set(0, 1.55, 3.4), this._viewer.defaultCamera.lookAt(0, 1.2, 0), this._viewer.controls.target.set(0, 1.2, 0), this._viewer.controls.update();try {this._viewer.updateLights?.();} catch {@@ -47937,7 +48395,7 @@ class uL extends HTMLElement {this._viewer?.scene.remove(n.group);} catch {}- dL(n.group), this._repositionAll(), this.dispatchEvent(new CustomEvent("stage:agent-left", {+ DL(n.group), this._repositionAll(), this.dispatchEvent(new CustomEvent("stage:agent-left", {detail: { agentId: n.id, element: n.element },bubbles: !0,composed: !0@@ -48031,7 +48489,7 @@ class uL extends HTMLElement {};}}-function dL(i) {+function DL(i) {i.traverse((e) => {if (e.geometry)try {@@ -48057,23 +48515,23 @@ function dL(i) {}}), i.parent && i.parent.remove(i);}-customElements.get("agent-stage") || customElements.define("agent-stage", uL);-const AL = (i = "agent-3d") => {- customElements.get(i) || customElements.define(i, Yx);+customElements.get("agent-stage") || customElements.define("agent-stage", FL);+const kL = (i = "agent-3d") => {+ customElements.get(i) || customElements.define(i, iE);};export {- Yx as Agent3DElement,- uL as AgentStageElement,- Ii as Memory,- dT as Runtime,- AT as SceneController,- mT as Skill,- bT as SkillRegistry,- ob as Viewer,- AL as defineElement,- sL as fetchRelative,- pT as fetchWithFallback,- xm as loadManifest,- jd as normalize,- _r as resolveURI+ iE as Agent3DElement,+ FL as AgentStageElement,+ Mi as Memory,+ ET as Runtime,+ CT as SceneController,+ OT as Skill,+ QT as SkillRegistry,+ pb as Viewer,+ kL as defineElement,+ SL as fetchRelative,+ yT as fetchWithFallback,+ Sm as loadManifest,+ nf as normalize,+ wr as resolveURI};diff --git a/dist-lib/agent-3d.umd.cjs b/dist-lib/agent-3d.umd.cjsindex 869f32770..164fb9c0a 100644--- a/dist-lib/agent-3d.umd.cjs+++ b/dist-lib/agent-3d.umd.cjs@@ -1,8 +1,8 @@-(function(en,nc){typeof exports=="object"&&typeof module<"u"?nc(exports):typeof define=="function"&&define.amd?define(["exports"],nc):(en=typeof globalThis<"u"?globalThis:en||self,nc(en.Agent3D={}))})(this,(function(en){"use strict";const Tr={ROTATE:0,DOLLY:1,PAN:2},Rr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},rE=0,ip=1,aE=2,sp=1,oE=2,Oi=3,Qi=0,Sn=1,Si=2,gs=0,Nr=1,rp=2,ap=3,op=4,cE=5,qs=100,lE=101,hE=102,uE=103,dE=104,fE=200,pE=201,AE=202,gE=203,oh=204,ch=205,mE=206,bE=207,xE=208,EE=209,_E=210,yE=211,wE=212,CE=213,vE=214,lh=0,hh=1,uh=2,Fr=3,dh=4,fh=5,ph=6,Ah=7,cp=0,SE=1,IE=2,ms=0,gh=1,ME=2,BE=3,lp=4,TE=5,RE=6,NE=7,hp="attached",FE="detached",up=300,Ks=301,Dr=302,mh=303,bh=304,ic=306,Lr=1e3,ai=1001,sc=1002,In=1003,dp=1004,Qa=1005,zt=1006,rc=1007,Jn=1008,tn=1009,fp=1010,pp=1011,Ga=1012,xh=1013,Xs=1014,nn=1015,Mn=1016,Eh=1017,_h=1018,Ha=1020,Ap=35902,gp=1021,mp=1022,sn=1023,za=1026,Va=1027,Gi=1028,yh=1029,Ys=1030,wh=1031,Ch=1033,ac=33776,Wa=33777,oc=33778,qa=33779,cc=35840,vh=35841,lc=35842,Sh=35843,hc=36196,uc=37492,dc=37496,Ka=37808,Ih=37809,Mh=37810,Bh=37811,Xa=37812,Th=37813,Rh=37814,Nh=37815,Fh=37816,Dh=37817,Lh=37818,Ph=37819,kh=37820,Uh=37821,Ya=36492,Oh=36494,fc=36495,bp=36283,Qh=36284,Gh=36285,Hh=36286,xp=2200,Ep=2201,DE=2202,ja=2300,Ja=2301,zh=2302,Pr=2400,kr=2401,pc=2402,Vh=2500,LE=2501,PE=0,_p=1,Wh=2,kE=3200,UE=3201,yp=0,OE=1,oi="",Kt="srgb",rn="srgb-linear",Ac="linear",Mt="srgb",Ur=7680,wp=519,QE=512,GE=513,HE=514,Cp=515,zE=516,VE=517,WE=518,qE=519,qh=35044,vp="300 es",Hi=2e3,gc=2001;class bs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const s=n[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let r=0,a=s.length;r<a;r++)s[r].call(this,e);e.target=null}}}const wn=["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 Sp=1234567;const Za=Math.PI/180,Or=180/Math.PI;function ci(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(wn[i&255]+wn[i>>8&255]+wn[i>>16&255]+wn[i>>24&255]+"-"+wn[e&255]+wn[e>>8&255]+"-"+wn[e>>16&15|64]+wn[e>>24&255]+"-"+wn[t&63|128]+wn[t>>8&255]+"-"+wn[t>>16&255]+wn[t>>24&255]+wn[n&255]+wn[n>>8&255]+wn[n>>16&255]+wn[n>>24&255]).toLowerCase()}function at(i,e,t){return Math.max(e,Math.min(t,i))}function Kh(i,e){return(i%e+e)%e}function KE(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function XE(i,e,t){return i!==e?(t-i)/(e-i):0}function $a(i,e,t){return(1-t)*i+t*e}function YE(i,e,t,n){return $a(i,e,1-Math.exp(-t*n))}function jE(i,e=1){return e-Math.abs(Kh(i,e*2)-e)}function JE(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function ZE(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function $E(i,e){return i+Math.floor(Math.random()*(e-i+1))}function e_(i,e){return i+Math.random()*(e-i)}function t_(i){return i*(.5-Math.random())}function n_(i){i!==void 0&&(Sp=i);let e=Sp+=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 i_(i){return i*Za}function s_(i){return i*Or}function r_(i){return(i&i-1)===0&&i!==0}function a_(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function o_(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function c_(i,e,t,n,s){const r=Math.cos,a=Math.sin,o=r(t/2),c=a(t/2),l=r((e+n)/2),h=a((e+n)/2),u=r((e-n)/2),d=a((e-n)/2),f=r((n-e)/2),m=a((n-e)/2);switch(s){case"XYX":i.set(o*h,c*u,c*d,o*l);break;case"YZY":i.set(c*d,o*h,c*u,o*l);break;case"ZXZ":i.set(c*u,c*d,o*h,o*l);break;case"XZX":i.set(o*h,c*m,c*f,o*l);break;case"YXY":i.set(c*f,o*h,c*m,o*l);break;case"ZYZ":i.set(c*m,c*f,o*h,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function li(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function It(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const Ip={DEG2RAD:Za,RAD2DEG:Or,generateUUID:ci,clamp:at,euclideanModulo:Kh,mapLinear:KE,inverseLerp:XE,lerp:$a,damp:YE,pingpong:jE,smoothstep:JE,smootherstep:ZE,randInt:$E,randFloat:e_,randFloatSpread:t_,seededRandom:n_,degToRad:i_,radToDeg:s_,isPowerOfTwo:r_,ceilPowerOfTwo:a_,floorPowerOfTwo:o_,setQuaternionFromProperEuler:c_,normalize:It,denormalize:li};class Ze{constructor(e=0,t=0){Ze.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=at(this.x,e.x,t.x),this.y=at(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=at(this.x,e,t),this.y=at(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(at(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(at(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*s+e.x,this.y=r*s+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class rt{constructor(e,t,n,s,r,a,o,c,l){rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,a,o,c,l)}set(e,t,n,s,r,a,o,c,l){const h=this.elements;return h[0]=e,h[1]=s,h[2]=o,h[3]=t,h[4]=r,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],g=s[0],A=s[3],p=s[6],y=s[1],b=s[4],_=s[7],M=s[2],w=s[5],S=s[8];return r[0]=a*g+o*y+c*M,r[3]=a*A+o*b+c*w,r[6]=a*p+o*_+c*S,r[1]=l*g+h*y+u*M,r[4]=l*A+h*b+u*w,r[7]=l*p+h*_+u*S,r[2]=d*g+f*y+m*M,r[5]=d*A+f*b+m*w,r[8]=d*p+f*_+m*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8];return t*a*h-t*o*l-n*r*h+n*o*c+s*r*l-s*a*c}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8],u=h*a-o*l,d=o*c-h*r,f=l*r-a*c,m=t*u+n*d+s*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return e[0]=u*g,e[1]=(s*l-h*n)*g,e[2]=(o*n-s*a)*g,e[3]=d*g,e[4]=(h*t-s*c)*g,e[5]=(s*r-o*t)*g,e[6]=f*g,e[7]=(n*c-l*t)*g,e[8]=(a*t-n*r)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,r,a,o){const c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*a+l*o)+a+e,-s*l,s*c,-s*(-l*a+c*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Xh.makeScale(e,t)),this}rotate(e){return this.premultiply(Xh.makeRotation(-e)),this}translate(e,t){return this.premultiply(Xh.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;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}clone(){return new this.constructor().fromArray(this.elements)}}const Xh=new rt;function Mp(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function eo(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function l_(){const i=eo("canvas");return i.style.display="block",i}const Bp={};function mc(i){i in Bp||(Bp[i]=!0,console.warn(i))}function h_(i,e,t){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function u_(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function d_(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const Tp=new rt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Rp=new rt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function f_(){const i={enabled:!0,workingColorSpace:rn,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Mt&&(s.r=zi(s.r),s.g=zi(s.g),s.b=zi(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Mt&&(s.r=Qr(s.r),s.g=Qr(s.g),s.b=Qr(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===oi?Ac:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[rn]:{primaries:e,whitePoint:n,transfer:Ac,toXYZ:Tp,fromXYZ:Rp,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Kt},outputColorSpaceConfig:{drawingBufferColorSpace:Kt}},[Kt]:{primaries:e,whitePoint:n,transfer:Mt,toXYZ:Tp,fromXYZ:Rp,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Kt}}}),i}const At=f_();function zi(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Qr(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let Gr;class p_{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Gr===void 0&&(Gr=eo("canvas")),Gr.width=e.width,Gr.height=e.height;const s=Gr.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=Gr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=eo("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),r=s.data;for(let a=0;a<r.length;a++)r[a]=zi(r[a]/255)*255;return n.putImageData(s,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(zi(t[n]/255)*255):t[n]=zi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let A_=0;class Yh{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:A_++}),this.uuid=ci(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},s=this.data;if(s!==null){let r;if(Array.isArray(s)){r=[];for(let a=0,o=s.length;a<o;a++)s[a].isDataTexture?r.push(jh(s[a].image)):r.push(jh(s[a]))}else r=jh(s);n.url=r}return t||(e.images[this.uuid]=n),n}}function jh(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?p_.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let g_=0;class an extends bs{constructor(e=an.DEFAULT_IMAGE,t=an.DEFAULT_MAPPING,n=ai,s=ai,r=zt,a=Jn,o=sn,c=tn,l=an.DEFAULT_ANISOTROPY,h=oi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:g_++}),this.uuid=ci(),this.name="",this.source=new Yh(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=c,this.offset=new Ze(0,0),this.repeat=new Ze(1,1),this.center=new Ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new rt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==up)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Lr:e.x=e.x-Math.floor(e.x);break;case ai:e.x=e.x<0?0:1;break;case sc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Lr:e.y=e.y-Math.floor(e.y);break;case ai:e.y=e.y<0?0:1;break;case sc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}an.DEFAULT_IMAGE=null,an.DEFAULT_MAPPING=up,an.DEFAULT_ANISOTROPY=1;class _t{constructor(e=0,t=0,n=0,s=1){_t.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*s+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,r;const c=e.elements,l=c[0],h=c[4],u=c[8],d=c[1],f=c[5],m=c[9],g=c[2],A=c[6],p=c[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(m-A)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(m+A)<.1&&Math.abs(l+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(l+1)/2,_=(f+1)/2,M=(p+1)/2,w=(h+d)/4,S=(u+g)/4,T=(m+A)/4;return b>_&&b>M?b<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(b),s=w/n,r=S/n):_>M?_<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(_),n=w/s,r=T/s):M<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(M),n=S/r,s=T/r),this.set(n,s,r,t),this}let y=Math.sqrt((A-m)*(A-m)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(y)<.001&&(y=1),this.x=(A-m)/y,this.y=(u-g)/y,this.z=(d-h)/y,this.w=Math.acos((l+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=at(this.x,e.x,t.x),this.y=at(this.y,e.y,t.y),this.z=at(this.z,e.z,t.z),this.w=at(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=at(this.x,e,t),this.y=at(this.y,e,t),this.z=at(this.z,e,t),this.w=at(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(at(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class m_ extends bs{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth?n.depth:1,this.scissor=new _t(0,0,e,t),this.scissorTest=!1,this.viewport=new _t(0,0,e,t);const s={width:e,height:t,depth:this.depth};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},n);const r=new an(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let s=0,r=this.textures.length;s<r;s++)this.textures[s].image.width=e,this.textures[s].image.height=t,this.textures[s].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;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 s=Object.assign({},e.textures[t].image);this.textures[t].source=new Yh(s)}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}dispose(){this.dispatchEvent({type:"dispose"})}}class js extends m_{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Np extends an{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=In,this.minFilter=In,this.wrapR=ai,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Fp extends an{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=In,this.minFilter=In,this.wrapR=ai,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Vn{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,r,a,o){let c=n[s+0],l=n[s+1],h=n[s+2],u=n[s+3];const d=r[a+0],f=r[a+1],m=r[a+2],g=r[a+3];if(o===0){e[t+0]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=m,e[t+3]=g;return}if(u!==g||c!==d||l!==f||h!==m){let A=1-o;const p=c*d+l*f+h*m+u*g,y=p>=0?1:-1,b=1-p*p;if(b>Number.EPSILON){const M=Math.sqrt(b),w=Math.atan2(M,p*y);A=Math.sin(A*w)/M,o=Math.sin(o*w)/M}const _=o*y;if(c=c*A+d*_,l=l*A+f*_,h=h*A+m*_,u=u*A+g*_,A===1-o){const M=1/Math.sqrt(c*c+l*l+h*h+u*u);c*=M,l*=M,h*=M,u*=M}}e[t]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,s,r,a){const o=n[s],c=n[s+1],l=n[s+2],h=n[s+3],u=r[a],d=r[a+1],f=r[a+2],m=r[a+3];return e[t]=o*m+h*u+c*f-l*d,e[t+1]=c*m+h*d+l*u-o*f,e[t+2]=l*m+h*f+o*d-c*u,e[t+3]=h*m-o*u-c*d-l*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,r=e._z,a=e._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(s/2),u=o(r/2),d=c(n/2),f=c(s/2),m=c(r/2);switch(a){case"XYZ":this._x=d*h*u+l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u+d*f*m;break;case"YZX":this._x=d*h*u+l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u-d*f*m;break;case"XZY":this._x=d*h*u-l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],r=t[8],a=t[1],o=t[5],c=t[9],l=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-c)*f,this._y=(r-l)*f,this._z=(a-s)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-c)/f,this._x=.25*f,this._y=(s+a)/f,this._z=(r+l)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(r-l)/f,this._x=(s+a)/f,this._y=.25*f,this._z=(c+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-s)/f,this._x=(r+l)/f,this._y=(c+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(at(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,r=e._z,a=e._w,o=t._x,c=t._y,l=t._z,h=t._w;return this._x=n*h+a*o+s*l-r*c,this._y=s*h+a*c+r*o-n*l,this._z=r*h+a*l+n*c-s*o,this._w=a*h-n*o-s*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+s*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const c=1-o*o;if(c<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*n+t*this._x,this._y=f*s+t*this._y,this._z=f*r+t*this._z,this.normalize(),this}const l=Math.sqrt(c),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,d=Math.sin(t*h)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=s*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class H{constructor(e=0,t=0,n=0){H.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Dp.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Dp.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*s,this.y=r[1]*t+r[4]*n+r[7]*s,this.z=r[2]*t+r[5]*n+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,r=e.x,a=e.y,o=e.z,c=e.w,l=2*(a*s-o*n),h=2*(o*t-r*s),u=2*(r*n-a*t);return this.x=t+c*l+a*u-o*h,this.y=n+c*h+o*l-r*u,this.z=s+c*u+r*h-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s,this.y=r[1]*t+r[5]*n+r[9]*s,this.z=r[2]*t+r[6]*n+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=at(this.x,e.x,t.x),this.y=at(this.y,e.y,t.y),this.z=at(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=at(this.x,e,t),this.y=at(this.y,e,t),this.z=at(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(at(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,r=e.z,a=t.x,o=t.y,c=t.z;return this.x=s*c-r*o,this.y=r*a-n*c,this.z=n*o-s*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Jh.copy(this).projectOnVector(e),this.sub(Jh)}reflect(e){return this.sub(Jh.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(at(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Jh=new H,Dp=new Vn;class Ii{constructor(e=new H(1/0,1/0,1/0),t=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(hi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(hi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=hi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,hi):hi.fromBufferAttribute(r,a),hi.applyMatrix4(e.matrixWorld),this.expandByPoint(hi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),bc.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),bc.copy(n.boundingBox)),bc.applyMatrix4(e.matrixWorld),this.union(bc)}const s=e.children;for(let r=0,a=s.length;r<a;r++)this.expandByObject(s[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,hi),hi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(to),xc.subVectors(this.max,to),Hr.subVectors(e.a,to),zr.subVectors(e.b,to),Vr.subVectors(e.c,to),xs.subVectors(zr,Hr),Es.subVectors(Vr,zr),Js.subVectors(Hr,Vr);let t=[0,-xs.z,xs.y,0,-Es.z,Es.y,0,-Js.z,Js.y,xs.z,0,-xs.x,Es.z,0,-Es.x,Js.z,0,-Js.x,-xs.y,xs.x,0,-Es.y,Es.x,0,-Js.y,Js.x,0];return!Zh(t,Hr,zr,Vr,xc)||(t=[1,0,0,0,1,0,0,0,1],!Zh(t,Hr,zr,Vr,xc))?!1:(Ec.crossVectors(xs,Es),t=[Ec.x,Ec.y,Ec.z],Zh(t,Hr,zr,Vr,xc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,hi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(hi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Vi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Vi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Vi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Vi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Vi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Vi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Vi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Vi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Vi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Vi=[new H,new H,new H,new H,new H,new H,new H,new H],hi=new H,bc=new Ii,Hr=new H,zr=new H,Vr=new H,xs=new H,Es=new H,Js=new H,to=new H,xc=new H,Ec=new H,Zs=new H;function Zh(i,e,t,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){Zs.fromArray(i,r);const o=s.x*Math.abs(Zs.x)+s.y*Math.abs(Zs.y)+s.z*Math.abs(Zs.z),c=e.dot(Zs),l=t.dot(Zs),h=n.dot(Zs);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}const b_=new Ii,no=new H,$h=new H;class Mi{constructor(e=new H,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):b_.setFromPoints(e).getCenter(n);let s=0;for(let r=0,a=e.length;r<a;r++)s=Math.max(s,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(s),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;no.subVectors(e,this.center);const t=no.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(no,s/n),this.radius+=s}return this}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):($h.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(no.copy(e.center).add($h)),this.expandByPoint(no.copy(e.center).sub($h))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Wi=new H,eu=new H,_c=new H,_s=new H,tu=new H,yc=new H,nu=new H;class io{constructor(e=new H,t=new H(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Wi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Wi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Wi.copy(this.origin).addScaledVector(this.direction,t),Wi.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){eu.copy(e).add(t).multiplyScalar(.5),_c.copy(t).sub(e).normalize(),_s.copy(this.origin).sub(eu);const r=e.distanceTo(t)*.5,a=-this.direction.dot(_c),o=_s.dot(this.direction),c=-_s.dot(_c),l=_s.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*c-o,d=a*o-c,m=r*h,u>=0)if(d>=-m)if(d<=m){const g=1/h;u*=g,d*=g,f=u*(u+a*d+2*o)+d*(a*u+d+2*c)+l}else d=r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;else d=-r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;else d<=-m?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l):d<=m?(u=0,d=Math.min(Math.max(-r,-c),r),f=d*(d+2*c)+l):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy(eu).addScaledVector(_c,d),f}intersectSphere(e,t){Wi.subVectors(e.center,this.origin);const n=Wi.dot(this.direction),s=Wi.dot(Wi)-n*n,r=e.radius*e.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,c=n+a;return c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,r,a,o,c;const l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,s=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,s=(e.min.x-d.x)*l),h>=0?(r=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(r=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a<s||isNaN(s))&&(s=a),u>=0?(o=(e.min.z-d.z)*u,c=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,c=(e.min.z-d.z)*u),n>c||o>s)||((o>n||n!==n)&&(n=o),(c<s||s!==s)&&(s=c),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,Wi)!==null}intersectTriangle(e,t,n,s,r){tu.subVectors(t,e),yc.subVectors(n,e),nu.crossVectors(tu,yc);let a=this.direction.dot(nu),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_s.subVectors(this.origin,e);const c=o*this.direction.dot(yc.crossVectors(_s,yc));if(c<0)return null;const l=o*this.direction.dot(tu.cross(_s));if(l<0||c+l>a)return null;const h=-o*_s.dot(nu);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class et{constructor(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A){et.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A)}set(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=s,p[1]=r,p[5]=a,p[9]=o,p[13]=c,p[2]=l,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=g,p[15]=A,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new et().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/Wr.setFromMatrixColumn(e,0).length(),r=1/Wr.setFromMatrixColumn(e,1).length(),a=1/Wr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,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]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(s),l=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(e.order==="XYZ"){const d=a*h,f=a*u,m=o*h,g=o*u;t[0]=c*h,t[4]=-c*u,t[8]=l,t[1]=f+m*l,t[5]=d-g*l,t[9]=-o*c,t[2]=g-d*l,t[6]=m+f*l,t[10]=a*c}else if(e.order==="YXZ"){const d=c*h,f=c*u,m=l*h,g=l*u;t[0]=d+g*o,t[4]=m*o-f,t[8]=a*l,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=g+d*o,t[10]=a*c}else if(e.order==="ZXY"){const d=c*h,f=c*u,m=l*h,g=l*u;t[0]=d-g*o,t[4]=-a*u,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=g-d*o,t[2]=-a*l,t[6]=o,t[10]=a*c}else if(e.order==="ZYX"){const d=a*h,f=a*u,m=o*h,g=o*u;t[0]=c*h,t[4]=m*l-f,t[8]=d*l+g,t[1]=c*u,t[5]=g*l+d,t[9]=f*l-m,t[2]=-l,t[6]=o*c,t[10]=a*c}else if(e.order==="YZX"){const d=a*c,f=a*l,m=o*c,g=o*l;t[0]=c*h,t[4]=g-d*u,t[8]=m*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-l*h,t[6]=f*u+m,t[10]=d-g*u}else if(e.order==="XZY"){const d=a*c,f=a*l,m=o*c,g=o*l;t[0]=c*h,t[4]=-u,t[8]=l*h,t[1]=d*u+g,t[5]=a*h,t[9]=f*u-m,t[2]=m*u-f,t[6]=o*h,t[10]=g*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}makeRotationFromQuaternion(e){return this.compose(x_,e,E_)}lookAt(e,t,n){const s=this.elements;return Wn.subVectors(e,t),Wn.lengthSq()===0&&(Wn.z=1),Wn.normalize(),ys.crossVectors(n,Wn),ys.lengthSq()===0&&(Math.abs(n.z)===1?Wn.x+=1e-4:Wn.z+=1e-4,Wn.normalize(),ys.crossVectors(n,Wn)),ys.normalize(),wc.crossVectors(Wn,ys),s[0]=ys.x,s[4]=wc.x,s[8]=Wn.x,s[1]=ys.y,s[5]=wc.y,s[9]=Wn.y,s[2]=ys.z,s[6]=wc.z,s[10]=Wn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],g=n[6],A=n[10],p=n[14],y=n[3],b=n[7],_=n[11],M=n[15],w=s[0],S=s[4],T=s[8],v=s[12],C=s[1],F=s[5],K=s[9],q=s[13],$=s[2],D=s[6],O=s[10],j=s[14],Q=s[3],J=s[7],ee=s[11],ae=s[15];return r[0]=a*w+o*C+c*$+l*Q,r[4]=a*S+o*F+c*D+l*J,r[8]=a*T+o*K+c*O+l*ee,r[12]=a*v+o*q+c*j+l*ae,r[1]=h*w+u*C+d*$+f*Q,r[5]=h*S+u*F+d*D+f*J,r[9]=h*T+u*K+d*O+f*ee,r[13]=h*v+u*q+d*j+f*ae,r[2]=m*w+g*C+A*$+p*Q,r[6]=m*S+g*F+A*D+p*J,r[10]=m*T+g*K+A*O+p*ee,r[14]=m*v+g*q+A*j+p*ae,r[3]=y*w+b*C+_*$+M*Q,r[7]=y*S+b*F+_*D+M*J,r[11]=y*T+b*K+_*O+M*ee,r[15]=y*v+b*q+_*j+M*ae,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],r=e[12],a=e[1],o=e[5],c=e[9],l=e[13],h=e[2],u=e[6],d=e[10],f=e[14],m=e[3],g=e[7],A=e[11],p=e[15];return m*(+r*c*u-s*l*u-r*o*d+n*l*d+s*o*f-n*c*f)+g*(+t*c*f-t*l*d+r*a*d-s*a*f+s*l*h-r*c*h)+A*(+t*l*u-t*o*f-r*a*u+n*a*f+r*o*h-n*l*h)+p*(-s*o*h-t*c*u+t*o*d+s*a*u-n*a*d+n*c*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],f=e[11],m=e[12],g=e[13],A=e[14],p=e[15],y=u*A*l-g*d*l+g*c*f-o*A*f-u*c*p+o*d*p,b=m*d*l-h*A*l-m*c*f+a*A*f+h*c*p-a*d*p,_=h*g*l-m*u*l+m*o*f-a*g*f-h*o*p+a*u*p,M=m*u*c-h*g*c-m*o*d+a*g*d+h*o*A-a*u*A,w=t*y+n*b+s*_+r*M;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/w;return e[0]=y*S,e[1]=(g*d*r-u*A*r-g*s*f+n*A*f+u*s*p-n*d*p)*S,e[2]=(o*A*r-g*c*r+g*s*l-n*A*l-o*s*p+n*c*p)*S,e[3]=(u*c*r-o*d*r-u*s*l+n*d*l+o*s*f-n*c*f)*S,e[4]=b*S,e[5]=(h*A*r-m*d*r+m*s*f-t*A*f-h*s*p+t*d*p)*S,e[6]=(m*c*r-a*A*r-m*s*l+t*A*l+a*s*p-t*c*p)*S,e[7]=(a*d*r-h*c*r+h*s*l-t*d*l-a*s*f+t*c*f)*S,e[8]=_*S,e[9]=(m*u*r-h*g*r-m*n*f+t*g*f+h*n*p-t*u*p)*S,e[10]=(a*g*r-m*o*r+m*n*l-t*g*l-a*n*p+t*o*p)*S,e[11]=(h*o*r-a*u*r-h*n*l+t*u*l+a*n*f-t*o*f)*S,e[12]=M*S,e[13]=(h*g*s-m*u*s+m*n*d-t*g*d-h*n*A+t*u*A)*S,e[14]=(m*o*s-a*g*s-m*n*c+t*g*c+a*n*A-t*o*A)*S,e[15]=(a*u*s-h*o*s+h*n*c-t*u*c-a*n*d+t*o*d)*S,this}scale(e){const t=this.elements,n=e.x,s=e.y,r=e.z;return t[0]*=n,t[4]*=s,t[8]*=r,t[1]*=n,t[5]*=s,t[9]*=r,t[2]*=n,t[6]*=s,t[10]*=r,t[3]*=n,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),r=1-n,a=e.x,o=e.y,c=e.z,l=r*a,h=r*o;return this.set(l*a+n,l*o-s*c,l*c+s*o,0,l*o+s*c,h*o+n,h*c-s*a,0,l*c-s*o,h*c+s*a,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,r,a){return this.set(1,n,r,0,e,1,a,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,r=t._x,a=t._y,o=t._z,c=t._w,l=r+r,h=a+a,u=o+o,d=r*l,f=r*h,m=r*u,g=a*h,A=a*u,p=o*u,y=c*l,b=c*h,_=c*u,M=n.x,w=n.y,S=n.z;return s[0]=(1-(g+p))*M,s[1]=(f+_)*M,s[2]=(m-b)*M,s[3]=0,s[4]=(f-_)*w,s[5]=(1-(d+p))*w,s[6]=(A+y)*w,s[7]=0,s[8]=(m+b)*S,s[9]=(A-y)*S,s[10]=(1-(d+g))*S,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let r=Wr.set(s[0],s[1],s[2]).length();const a=Wr.set(s[4],s[5],s[6]).length(),o=Wr.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],ui.copy(this);const l=1/r,h=1/a,u=1/o;return ui.elements[0]*=l,ui.elements[1]*=l,ui.elements[2]*=l,ui.elements[4]*=h,ui.elements[5]*=h,ui.elements[6]*=h,ui.elements[8]*=u,ui.elements[9]*=u,ui.elements[10]*=u,t.setFromRotationMatrix(ui),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,s,r,a,o=Hi){const c=this.elements,l=2*r/(t-e),h=2*r/(n-s),u=(t+e)/(t-e),d=(n+s)/(n-s);let f,m;if(o===Hi)f=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===gc)f=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=l,c[4]=0,c[8]=u,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,s,r,a,o=Hi){const c=this.elements,l=1/(t-e),h=1/(n-s),u=1/(a-r),d=(t+e)*l,f=(n+s)*h;let m,g;if(o===Hi)m=(a+r)*u,g=-2*u;else if(o===gc)m=r*u,g=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=g,c[14]=-m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;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 Wr=new H,ui=new et,x_=new H(0,0,0),E_=new H(1,1,1),ys=new H,wc=new H,Wn=new H,Lp=new et,Pp=new Vn;class Bi{constructor(e=0,t=0,n=0,s=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const s=e.elements,r=s[0],a=s[4],o=s[8],c=s[1],l=s[5],h=s[9],u=s[2],d=s[6],f=s[10];switch(t){case"XYZ":this._y=Math.asin(at(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-at(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(at(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-at(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(at(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-at(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Lp.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Lp,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Pp.setFromEuler(this),this.setFromQuaternion(Pp,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Bi.DEFAULT_ORDER="XYZ";class kp{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let __=0;const Up=new H,qr=new Vn,qi=new et,Cc=new H,so=new H,y_=new H,w_=new Vn,Op=new H(1,0,0),Qp=new H(0,1,0),Gp=new H(0,0,1),Hp={type:"added"},C_={type:"removed"},Kr={type:"childadded",child:null},iu={type:"childremoved",child:null};class Pt extends bs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:__++}),this.uuid=ci(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pt.DEFAULT_UP.clone();const e=new H,t=new Bi,n=new Vn,s=new H(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new et},normalMatrix:{value:new rt}}),this.matrix=new et,this.matrixWorld=new et,this.matrixAutoUpdate=Pt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new kp,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={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return qr.setFromAxisAngle(e,t),this.quaternion.multiply(qr),this}rotateOnWorldAxis(e,t){return qr.setFromAxisAngle(e,t),this.quaternion.premultiply(qr),this}rotateX(e){return this.rotateOnAxis(Op,e)}rotateY(e){return this.rotateOnAxis(Qp,e)}rotateZ(e){return this.rotateOnAxis(Gp,e)}translateOnAxis(e,t){return Up.copy(e).applyQuaternion(this.quaternion),this.position.add(Up.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Op,e)}translateY(e){return this.translateOnAxis(Qp,e)}translateZ(e){return this.translateOnAxis(Gp,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(qi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Cc.copy(e):Cc.set(e,t,n);const s=this.parent;this.updateWorldMatrix(!0,!1),so.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?qi.lookAt(so,Cc,this.up):qi.lookAt(Cc,so,this.up),this.quaternion.setFromRotationMatrix(qi),s&&(qi.extractRotation(s.matrixWorld),qr.setFromRotationMatrix(qi),this.quaternion.premultiply(qr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Hp),Kr.child=e,this.dispatchEvent(Kr),Kr.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(C_),iu.child=e,this.dispatchEvent(iu),iu.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),qi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),qi.multiply(e.parent.matrixWorld)),e.applyMatrix4(qi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Hp),Kr.child=e,this.dispatchEvent(Kr),Kr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,s=this.children.length;n<s;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(so,e,y_),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(so,w_,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?{min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}:void 0,boundingSphere:o.boundingSphere?{radius:o.boundingSphere.radius,center:o.boundingSphere.center.toArray()}:void 0})),s.instanceInfo=this._instanceInfo.map(o=>({...o})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){const u=c[l];r(e.shapes,u)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let c=0,l=this.material.length;c<l;c++)o.push(r(e.materials,this.material[c]));s.material=o}else s.material=r(e.materials,this.material);if(this.children.length>0){s.children=[];for(let o=0;o<this.children.length;o++)s.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let o=0;o<this.animations.length;o++){const c=this.animations[o];s.animations.push(r(e.animations,c))}}if(t){const o=a(e.geometries),c=a(e.materials),l=a(e.textures),h=a(e.images),u=a(e.shapes),d=a(e.skeletons),f=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=s,n;function a(o){const c=[];for(const l in o){const h=o[l];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const s=e.children[n];this.add(s.clone())}return this}}Pt.DEFAULT_UP=new H(0,1,0),Pt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const di=new H,Ki=new H,su=new H,Xi=new H,Xr=new H,Yr=new H,zp=new H,ru=new H,au=new H,ou=new H,cu=new _t,lu=new _t,hu=new _t;class fi{constructor(e=new H,t=new H,n=new H){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),di.subVectors(e,t),s.cross(di);const r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,n,s,r){di.subVectors(s,t),Ki.subVectors(n,t),su.subVectors(e,t);const a=di.dot(di),o=di.dot(Ki),c=di.dot(su),l=Ki.dot(Ki),h=Ki.dot(su),u=a*l-o*o;if(u===0)return r.set(0,0,0),null;const d=1/u,f=(l*c-o*h)*d,m=(a*h-o*c)*d;return r.set(1-f-m,m,f)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,Xi)===null?!1:Xi.x>=0&&Xi.y>=0&&Xi.x+Xi.y<=1}static getInterpolation(e,t,n,s,r,a,o,c){return this.getBarycoord(e,t,n,s,Xi)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,Xi.x),c.addScaledVector(a,Xi.y),c.addScaledVector(o,Xi.z),c)}static getInterpolatedAttribute(e,t,n,s,r,a){return cu.setScalar(0),lu.setScalar(0),hu.setScalar(0),cu.fromBufferAttribute(e,t),lu.fromBufferAttribute(e,n),hu.fromBufferAttribute(e,s),a.setScalar(0),a.addScaledVector(cu,r.x),a.addScaledVector(lu,r.y),a.addScaledVector(hu,r.z),a}static isFrontFacing(e,t,n,s){return di.subVectors(n,t),Ki.subVectors(e,t),di.cross(Ki).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return di.subVectors(this.c,this.b),Ki.subVectors(this.a,this.b),di.cross(Ki).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return fi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return fi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,r){return fi.getInterpolation(e,this.a,this.b,this.c,t,n,s,r)}containsPoint(e){return fi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return fi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,r=this.c;let a,o;Xr.subVectors(s,n),Yr.subVectors(r,n),ru.subVectors(e,n);const c=Xr.dot(ru),l=Yr.dot(ru);if(c<=0&&l<=0)return t.copy(n);au.subVectors(e,s);const h=Xr.dot(au),u=Yr.dot(au);if(h>=0&&u<=h)return t.copy(s);const d=c*u-h*l;if(d<=0&&c>=0&&h<=0)return a=c/(c-h),t.copy(n).addScaledVector(Xr,a);ou.subVectors(e,r);const f=Xr.dot(ou),m=Yr.dot(ou);if(m>=0&&f<=m)return t.copy(r);const g=f*l-c*m;if(g<=0&&l>=0&&m<=0)return o=l/(l-m),t.copy(n).addScaledVector(Yr,o);const A=h*m-f*u;if(A<=0&&u-h>=0&&f-m>=0)return zp.subVectors(r,s),o=(u-h)/(u-h+(f-m)),t.copy(s).addScaledVector(zp,o);const p=1/(A+g+d);return a=g*p,o=d*p,t.copy(n).addScaledVector(Xr,a).addScaledVector(Yr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Vp={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ws={h:0,s:0,l:0},vc={h:0,s:0,l:0};function uu(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}let qe=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Kt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,At.toWorkingColorSpace(this,t),this}setRGB(e,t,n,s=At.workingColorSpace){return this.r=e,this.g=t,this.b=n,At.toWorkingColorSpace(this,s),this}setHSL(e,t,n,s=At.workingColorSpace){if(e=Kh(e,1),t=at(t,0,1),n=at(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=uu(a,r,e+1/3),this.g=uu(a,r,e),this.b=uu(a,r,e-1/3)}return At.toWorkingColorSpace(this,s),this}setStyle(e,t=Kt){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Kt){const n=Vp[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zi(e.r),this.g=zi(e.g),this.b=zi(e.b),this}copyLinearToSRGB(e){return this.r=Qr(e.r),this.g=Qr(e.g),this.b=Qr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Kt){return At.fromWorkingColorSpace(Cn.copy(this),e),Math.round(at(Cn.r*255,0,255))*65536+Math.round(at(Cn.g*255,0,255))*256+Math.round(at(Cn.b*255,0,255))}getHexString(e=Kt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=At.workingColorSpace){At.fromWorkingColorSpace(Cn.copy(this),t);const n=Cn.r,s=Cn.g,r=Cn.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let c,l;const h=(o+a)/2;if(o===a)c=0,l=0;else{const u=a-o;switch(l=h<=.5?u/(a+o):u/(2-a-o),a){case n:c=(s-r)/u+(s<r?6:0);break;case s:c=(r-n)/u+2;break;case r:c=(n-s)/u+4;break}c/=6}return e.h=c,e.s=l,e.l=h,e}getRGB(e,t=At.workingColorSpace){return At.fromWorkingColorSpace(Cn.copy(this),t),e.r=Cn.r,e.g=Cn.g,e.b=Cn.b,e}getStyle(e=Kt){At.fromWorkingColorSpace(Cn.copy(this),e);const t=Cn.r,n=Cn.g,s=Cn.b;return e!==Kt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(s*255)})`}offsetHSL(e,t,n){return this.getHSL(ws),this.setHSL(ws.h+e,ws.s+t,ws.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(ws),e.getHSL(vc);const n=$a(ws.h,vc.h,t),s=$a(ws.s,vc.s,t),r=$a(ws.l,vc.l,t);return this.setHSL(n,s,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,s=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*s,this.g=r[1]*t+r[4]*n+r[7]*s,this.b=r[2]*t+r[5]*n+r[8]*s,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Cn=new qe;qe.NAMES=Vp;let v_=0;class Ti extends bs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:v_++}),this.uuid=ci(),this.name="",this.type="Material",this.blending=Nr,this.side=Qi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=oh,this.blendDst=ch,this.blendEquation=qs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new qe(0,0,0),this.blendAlpha=0,this.depthFunc=Fr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=wp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ur,this.stencilZFail=Ur,this.stencilZPass=Ur,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}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",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.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!==Nr&&(n.blending=this.blending),this.side!==Qi&&(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!==oh&&(n.blendSrc=this.blendSrc),this.blendDst!==ch&&(n.blendDst=this.blendDst),this.blendEquation!==qs&&(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!==Fr&&(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!==wp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ur&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ur&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ur&&(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 s(r){const a=[];for(const o in r){const c=r[o];delete c.metadata,a.push(c)}return a}if(t){const r=s(e.textures),a=s(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const s=t.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Cs extends Ti{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new qe(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 Bi,this.combine=cp,this.reflectivity=1,this.refractionRatio=.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 Yi=S_();function S_(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),s=new Uint32Array(512);for(let c=0;c<256;++c){const l=c-127;l<-27?(n[c]=0,n[c|256]=32768,s[c]=24,s[c|256]=24):l<-14?(n[c]=1024>>-l-14,n[c|256]=1024>>-l-14|32768,s[c]=-l-1,s[c|256]=-l-1):l<=15?(n[c]=l+15<<10,n[c|256]=l+15<<10|32768,s[c]=13,s[c|256]=13):l<128?(n[c]=31744,n[c|256]=64512,s[c]=24,s[c|256]=24):(n[c]=31744,n[c|256]=64512,s[c]=13,s[c|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let l=c<<13,h=0;for(;(l&8388608)===0;)l<<=1,h-=8388608;l&=-8388609,h+=947912704,r[c]=l|h}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)a[c]=c<<23;a[31]=1199570944,a[32]=2147483648;for(let c=33;c<63;++c)a[c]=2147483648+(c-32<<23);a[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:r,exponentTable:a,offsetTable:o}}function I_(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=at(i,-65504,65504),Yi.floatView[0]=i;const e=Yi.uint32View[0],t=e>>23&511;return Yi.baseTable[t]+((e&8388607)>>Yi.shiftTable[t])}function M_(i){const e=i>>10;return Yi.uint32View[0]=Yi.mantissaTable[Yi.offsetTable[e]+(i&1023)]+Yi.exponentTable[e],Yi.floatView[0]}class Wp{static toHalfFloat(e){return I_(e)}static fromHalfFloat(e){return M_(e)}}const jt=new H,Sc=new Ze;let B_=0;class En{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:B_++}),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=nn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[e+s]=t.array[n+s];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Sc.fromBufferAttribute(this,t),Sc.applyMatrix3(e),this.setXY(t,Sc.x,Sc.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)jt.fromBufferAttribute(this,t),jt.applyMatrix3(e),this.setXYZ(t,jt.x,jt.y,jt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)jt.fromBufferAttribute(this,t),jt.applyMatrix4(e),this.setXYZ(t,jt.x,jt.y,jt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)jt.fromBufferAttribute(this,t),jt.applyNormalMatrix(e),this.setXYZ(t,jt.x,jt.y,jt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)jt.fromBufferAttribute(this,t),jt.transformDirection(e),this.setXYZ(t,jt.x,jt.y,jt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=li(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=li(t,this.array)),t}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=li(t,this.array)),t}setY(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=li(t,this.array)),t}setZ(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=li(t,this.array)),t}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array),r=It(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==qh&&(e.usage=this.usage),e}}class qp extends En{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Kp extends En{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Bn extends En{constructor(e,t,n){super(new Float32Array(e),t,n)}}let T_=0;const Zn=new et,du=new Pt,jr=new H,qn=new Ii,ro=new Ii,fn=new H;class On extends bs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:T_++}),this.uuid=ci(),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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Mp(e)?Kp:qp)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new rt().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(e),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Zn.makeRotationFromQuaternion(e),this.applyMatrix4(Zn),this}rotateX(e){return Zn.makeRotationX(e),this.applyMatrix4(Zn),this}rotateY(e){return Zn.makeRotationY(e),this.applyMatrix4(Zn),this}rotateZ(e){return Zn.makeRotationZ(e),this.applyMatrix4(Zn),this}translate(e,t,n){return Zn.makeTranslation(e,t,n),this.applyMatrix4(Zn),this}scale(e,t,n){return Zn.makeScale(e,t,n),this.applyMatrix4(Zn),this}lookAt(e){return du.lookAt(e),du.updateMatrix(),this.applyMatrix4(du.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(jr).negate(),this.translate(jr.x,jr.y,jr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let s=0,r=e.length;s<r;s++){const a=e[s];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Bn(n,3))}else{const n=Math.min(e.length,t.count);for(let s=0;s<n;s++){const r=e[s];t.setXYZ(s,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ii);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new H(-1/0,-1/0,-1/0),new H(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n<s;n++){const r=t[n];qn.setFromBufferAttribute(r),this.morphTargetsRelative?(fn.addVectors(this.boundingBox.min,qn.min),this.boundingBox.expandByPoint(fn),fn.addVectors(this.boundingBox.max,qn.max),this.boundingBox.expandByPoint(fn)):(this.boundingBox.expandByPoint(qn.min),this.boundingBox.expandByPoint(qn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Mi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new H,1/0);return}if(e){const n=this.boundingSphere.center;if(qn.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];ro.setFromBufferAttribute(o),this.morphTargetsRelative?(fn.addVectors(qn.min,ro.min),qn.expandByPoint(fn),fn.addVectors(qn.max,ro.max),qn.expandByPoint(fn)):(qn.expandByPoint(ro.min),qn.expandByPoint(ro.max))}qn.getCenter(n);let s=0;for(let r=0,a=e.count;r<a;r++)fn.fromBufferAttribute(e,r),s=Math.max(s,n.distanceToSquared(fn));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],c=this.morphTargetsRelative;for(let l=0,h=o.count;l<h;l++)fn.fromBufferAttribute(o,l),c&&(jr.fromBufferAttribute(e,l),fn.add(jr)),s=Math.max(s,n.distanceToSquared(fn))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,s=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new En(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],c=[];for(let T=0;T<n.count;T++)o[T]=new H,c[T]=new H;const l=new H,h=new H,u=new H,d=new Ze,f=new Ze,m=new Ze,g=new H,A=new H;function p(T,v,C){l.fromBufferAttribute(n,T),h.fromBufferAttribute(n,v),u.fromBufferAttribute(n,C),d.fromBufferAttribute(r,T),f.fromBufferAttribute(r,v),m.fromBufferAttribute(r,C),h.sub(l),u.sub(l),f.sub(d),m.sub(d);const F=1/(f.x*m.y-m.x*f.y);isFinite(F)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(F),A.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(F),o[T].add(g),o[v].add(g),o[C].add(g),c[T].add(A),c[v].add(A),c[C].add(A))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let T=0,v=y.length;T<v;++T){const C=y[T],F=C.start,K=C.count;for(let q=F,$=F+K;q<$;q+=3)p(e.getX(q+0),e.getX(q+1),e.getX(q+2))}const b=new H,_=new H,M=new H,w=new H;function S(T){M.fromBufferAttribute(s,T),w.copy(M);const v=o[T];b.copy(v),b.sub(M.multiplyScalar(M.dot(v))).normalize(),_.crossVectors(w,v);const F=_.dot(c[T])<0?-1:1;a.setXYZW(T,b.x,b.y,b.z,F)}for(let T=0,v=y.length;T<v;++T){const C=y[T],F=C.start,K=C.count;for(let q=F,$=F+K;q<$;q+=3)S(e.getX(q+0)),S(e.getX(q+1)),S(e.getX(q+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new En(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const s=new H,r=new H,a=new H,o=new H,c=new H,l=new H,h=new H,u=new H;if(e)for(let d=0,f=e.count;d<f;d+=3){const m=e.getX(d+0),g=e.getX(d+1),A=e.getX(d+2);s.fromBufferAttribute(t,m),r.fromBufferAttribute(t,g),a.fromBufferAttribute(t,A),h.subVectors(a,r),u.subVectors(s,r),h.cross(u),o.fromBufferAttribute(n,m),c.fromBufferAttribute(n,g),l.fromBufferAttribute(n,A),o.add(h),c.add(h),l.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(g,c.x,c.y,c.z),n.setXYZ(A,l.x,l.y,l.z)}else for(let d=0,f=t.count;d<f;d+=3)s.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,r),u.subVectors(s,r),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)fn.fromBufferAttribute(e,t),fn.normalize(),e.setXYZ(t,fn.x,fn.y,fn.z)}toNonIndexed(){function e(o,c){const l=o.array,h=o.itemSize,u=o.normalized,d=new l.constructor(c.length*h);let f=0,m=0;for(let g=0,A=c.length;g<A;g++){o.isInterleavedBufferAttribute?f=c[g]*o.data.stride+o.offset:f=c[g]*h;for(let p=0;p<h;p++)d[m++]=l[f++]}return new En(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new On,n=this.index.array,s=this.attributes;for(const o in s){const c=s[o],l=e(c,n);t.setAttribute(o,l)}const r=this.morphAttributes;for(const o in r){const c=[],l=r[o];for(let h=0,u=l.length;h<u;h++){const d=l[h],f=e(d,n);c.push(f)}t.morphAttributes[o]=c}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,c=a.length;o<c;o++){const l=a[o];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n){const l=n[c];e.data.attributes[c]=l.toJSON(e.data)}const s={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],h=[];for(let u=0,d=l.length;u<d;u++){const f=l[u];h.push(f.toJSON(e.data))}h.length>0&&(s[c]=h,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const s=e.attributes;for(const l in s){const h=s[l];this.setAttribute(l,h.clone(t))}const r=e.morphAttributes;for(const l in r){const h=[],u=r[l];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(t));this.morphAttributes[l]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,h=a.length;l<h;l++){const u=a[l];this.addGroup(u.start,u.count,u.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Xp=new et,$s=new io,Ic=new Mi,Yp=new H,Mc=new H,Bc=new H,Tc=new H,fu=new H,Rc=new H,jp=new H,Nc=new H;class Jt extends Pt{constructor(e=new On,t=new Cs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,s=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(s,e);const o=this.morphTargetInfluences;if(r&&o){Rc.set(0,0,0);for(let c=0,l=r.length;c<l;c++){const h=o[c],u=r[c];h!==0&&(fu.fromBufferAttribute(u,e),a?Rc.addScaledVector(fu,h):Rc.addScaledVector(fu.sub(t),h))}t.add(Rc)}return t}raycast(e,t){const n=this.geometry,s=this.material,r=this.matrixWorld;s!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Ic.copy(n.boundingSphere),Ic.applyMatrix4(r),$s.copy(e.ray).recast(e.near),!(Ic.containsPoint($s.origin)===!1&&($s.intersectSphere(Ic,Yp)===null||$s.origin.distanceToSquared(Yp)>(e.far-e.near)**2))&&(Xp.copy(r).invert(),$s.copy(e.ray).applyMatrix4(Xp),!(n.boundingBox!==null&&$s.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,$s)))}_computeIntersections(e,t,n){let s;const r=this.geometry,a=this.material,o=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,d=r.groups,f=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,g=d.length;m<g;m++){const A=d[m],p=a[A.materialIndex],y=Math.max(A.start,f.start),b=Math.min(o.count,Math.min(A.start+A.count,f.start+f.count));for(let _=y,M=b;_<M;_+=3){const w=o.getX(_),S=o.getX(_+1),T=o.getX(_+2);s=Fc(this,p,e,n,l,h,u,w,S,T),s&&(s.faceIndex=Math.floor(_/3),s.face.materialIndex=A.materialIndex,t.push(s))}}else{const m=Math.max(0,f.start),g=Math.min(o.count,f.start+f.count);for(let A=m,p=g;A<p;A+=3){const y=o.getX(A),b=o.getX(A+1),_=o.getX(A+2);s=Fc(this,a,e,n,l,h,u,y,b,_),s&&(s.faceIndex=Math.floor(A/3),t.push(s))}}else if(c!==void 0)if(Array.isArray(a))for(let m=0,g=d.length;m<g;m++){const A=d[m],p=a[A.materialIndex],y=Math.max(A.start,f.start),b=Math.min(c.count,Math.min(A.start+A.count,f.start+f.count));for(let _=y,M=b;_<M;_+=3){const w=_,S=_+1,T=_+2;s=Fc(this,p,e,n,l,h,u,w,S,T),s&&(s.faceIndex=Math.floor(_/3),s.face.materialIndex=A.materialIndex,t.push(s))}}else{const m=Math.max(0,f.start),g=Math.min(c.count,f.start+f.count);for(let A=m,p=g;A<p;A+=3){const y=A,b=A+1,_=A+2;s=Fc(this,a,e,n,l,h,u,y,b,_),s&&(s.faceIndex=Math.floor(A/3),t.push(s))}}}}function R_(i,e,t,n,s,r,a,o){let c;if(e.side===Sn?c=n.intersectTriangle(a,r,s,!0,o):c=n.intersectTriangle(s,r,a,e.side===Qi,o),c===null)return null;Nc.copy(o),Nc.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(Nc);return l<t.near||l>t.far?null:{distance:l,point:Nc.clone(),object:i}}function Fc(i,e,t,n,s,r,a,o,c,l){i.getVertexPosition(o,Mc),i.getVertexPosition(c,Bc),i.getVertexPosition(l,Tc);const h=R_(i,e,t,n,Mc,Bc,Tc,jp);if(h){const u=new H;fi.getBarycoord(jp,Mc,Bc,Tc,u),s&&(h.uv=fi.getInterpolatedAttribute(s,o,c,l,u,new Ze)),r&&(h.uv1=fi.getInterpolatedAttribute(r,o,c,l,u,new Ze)),a&&(h.normal=fi.getInterpolatedAttribute(a,o,c,l,u,new H),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:c,c:l,normal:new H,materialIndex:0};fi.getNormal(Mc,Bc,Tc,d.normal),h.face=d,h.barycoord=u}return h}class Jr extends On{constructor(e=1,t=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const c=[],l=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,s,a,2),m("x","z","y",1,-1,e,n,-t,s,a,3),m("x","y","z",1,-1,e,t,n,s,r,4),m("x","y","z",-1,-1,e,t,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new Bn(l,3)),this.setAttribute("normal",new Bn(h,3)),this.setAttribute("uv",new Bn(u,2));function m(g,A,p,y,b,_,M,w,S,T,v){const C=_/S,F=M/T,K=_/2,q=M/2,$=w/2,D=S+1,O=T+1;let j=0,Q=0;const J=new H;for(let ee=0;ee<O;ee++){const ae=ee*F-q;for(let ye=0;ye<D;ye++){const Me=ye*C-K;J[g]=Me*y,J[A]=ae*b,J[p]=$,l.push(J.x,J.y,J.z),J[g]=0,J[A]=0,J[p]=w>0?1:-1,h.push(J.x,J.y,J.z),u.push(ye/S),u.push(1-ee/T),j+=1}}for(let ee=0;ee<T;ee++)for(let ae=0;ae<S;ae++){const ye=d+ae+D*ee,Me=d+ae+D*(ee+1),se=d+(ae+1)+D*(ee+1),me=d+(ae+1)+D*ee;c.push(ye,Me,me),c.push(Me,se,me),Q+=6}o.addGroup(f,Q,v),f+=Q,d+=j}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Zr(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const s=i[t][n];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=s.clone():Array.isArray(s)?e[t][n]=s.slice():e[t][n]=s}}return e}function Tn(i){const e={};for(let t=0;t<i.length;t++){const n=Zr(i[t]);for(const s in n)e[s]=n[s]}return e}function N_(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function Jp(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:At.workingColorSpace}const F_={clone:Zr,merge:Tn};var D_=`void main() {+(function(en,oc){typeof exports=="object"&&typeof module<"u"?oc(exports):typeof define=="function"&&define.amd?define(["exports"],oc):(en=typeof globalThis<"u"?globalThis:en||self,oc(en.Agent3D={}))})(this,(function(en){"use strict";const Nr={ROTATE:0,DOLLY:1,PAN:2},Fr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},fE=0,lp=1,pE=2,hp=1,AE=2,Qi=3,Gi=0,Sn=1,Ii=2,ms=0,Dr=1,up=2,dp=3,fp=4,gE=5,js=100,mE=101,bE=102,xE=103,EE=104,_E=200,yE=201,wE=202,vE=203,fh=204,ph=205,CE=206,SE=207,IE=208,ME=209,BE=210,TE=211,RE=212,NE=213,FE=214,Ah=0,gh=1,mh=2,Lr=3,bh=4,xh=5,Eh=6,_h=7,pp=0,DE=1,LE=2,bs=0,yh=1,PE=2,kE=3,Ap=4,UE=5,OE=6,QE=7,gp="attached",GE="detached",mp=300,Xs=301,Pr=302,wh=303,vh=304,cc=306,kr=1e3,oi=1001,lc=1002,In=1003,bp=1004,Va=1005,zt=1006,hc=1007,Jn=1008,tn=1009,xp=1010,Ep=1011,Wa=1012,Ch=1013,Ys=1014,nn=1015,Mn=1016,Sh=1017,Ih=1018,qa=1020,_p=35902,yp=1021,wp=1022,sn=1023,Ka=1026,ja=1027,Hi=1028,Mh=1029,Js=1030,Bh=1031,Th=1033,uc=33776,Xa=33777,dc=33778,Ya=33779,fc=35840,Rh=35841,pc=35842,Nh=35843,Ac=36196,gc=37492,mc=37496,Ja=37808,Fh=37809,Dh=37810,Lh=37811,Za=37812,Ph=37813,kh=37814,Uh=37815,Oh=37816,Qh=37817,Gh=37818,Hh=37819,zh=37820,Vh=37821,$a=36492,Wh=36494,bc=36495,vp=36283,qh=36284,Kh=36285,jh=36286,Cp=2200,Sp=2201,HE=2202,eo=2300,to=2301,Xh=2302,Ur=2400,Or=2401,xc=2402,Yh=2500,zE=2501,VE=0,Ip=1,Jh=2,WE=3200,qE=3201,Mp=0,KE=1,ci="",Kt="srgb",rn="srgb-linear",Ec="linear",Mt="srgb",Qr=7680,Bp=519,jE=512,XE=513,YE=514,Tp=515,JE=516,ZE=517,$E=518,e_=519,Zh=35044,Rp="300 es",zi=2e3,_c=2001;class xs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const s=n[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let r=0,a=s.length;r<a;r++)s[r].call(this,e);e.target=null}}}const wn=["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 Np=1234567;const no=Math.PI/180,Gr=180/Math.PI;function li(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(wn[i&255]+wn[i>>8&255]+wn[i>>16&255]+wn[i>>24&255]+"-"+wn[e&255]+wn[e>>8&255]+"-"+wn[e>>16&15|64]+wn[e>>24&255]+"-"+wn[t&63|128]+wn[t>>8&255]+"-"+wn[t>>16&255]+wn[t>>24&255]+wn[n&255]+wn[n>>8&255]+wn[n>>16&255]+wn[n>>24&255]).toLowerCase()}function at(i,e,t){return Math.max(e,Math.min(t,i))}function $h(i,e){return(i%e+e)%e}function t_(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function n_(i,e,t){return i!==e?(t-i)/(e-i):0}function io(i,e,t){return(1-t)*i+t*e}function i_(i,e,t,n){return io(i,e,1-Math.exp(-t*n))}function s_(i,e=1){return e-Math.abs($h(i,e*2)-e)}function r_(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function a_(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function o_(i,e){return i+Math.floor(Math.random()*(e-i+1))}function c_(i,e){return i+Math.random()*(e-i)}function l_(i){return i*(.5-Math.random())}function h_(i){i!==void 0&&(Np=i);let e=Np+=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 u_(i){return i*no}function d_(i){return i*Gr}function f_(i){return(i&i-1)===0&&i!==0}function p_(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function A_(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function g_(i,e,t,n,s){const r=Math.cos,a=Math.sin,o=r(t/2),c=a(t/2),l=r((e+n)/2),h=a((e+n)/2),u=r((e-n)/2),d=a((e-n)/2),f=r((n-e)/2),m=a((n-e)/2);switch(s){case"XYX":i.set(o*h,c*u,c*d,o*l);break;case"YZY":i.set(c*d,o*h,c*u,o*l);break;case"ZXZ":i.set(c*u,c*d,o*h,o*l);break;case"XZX":i.set(o*h,c*m,c*f,o*l);break;case"YXY":i.set(c*f,o*h,c*m,o*l);break;case"ZYZ":i.set(c*m,c*f,o*h,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function hi(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function It(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const Fp={DEG2RAD:no,RAD2DEG:Gr,generateUUID:li,clamp:at,euclideanModulo:$h,mapLinear:t_,inverseLerp:n_,lerp:io,damp:i_,pingpong:s_,smoothstep:r_,smootherstep:a_,randInt:o_,randFloat:c_,randFloatSpread:l_,seededRandom:h_,degToRad:u_,radToDeg:d_,isPowerOfTwo:f_,ceilPowerOfTwo:p_,floorPowerOfTwo:A_,setQuaternionFromProperEuler:g_,normalize:It,denormalize:hi};class Ze{constructor(e=0,t=0){Ze.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=at(this.x,e.x,t.x),this.y=at(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=at(this.x,e,t),this.y=at(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(at(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(at(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*s+e.x,this.y=r*s+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class rt{constructor(e,t,n,s,r,a,o,c,l){rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,a,o,c,l)}set(e,t,n,s,r,a,o,c,l){const h=this.elements;return h[0]=e,h[1]=s,h[2]=o,h[3]=t,h[4]=r,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],g=s[0],A=s[3],p=s[6],y=s[1],b=s[4],_=s[7],M=s[2],w=s[5],S=s[8];return r[0]=a*g+o*y+c*M,r[3]=a*A+o*b+c*w,r[6]=a*p+o*_+c*S,r[1]=l*g+h*y+u*M,r[4]=l*A+h*b+u*w,r[7]=l*p+h*_+u*S,r[2]=d*g+f*y+m*M,r[5]=d*A+f*b+m*w,r[8]=d*p+f*_+m*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8];return t*a*h-t*o*l-n*r*h+n*o*c+s*r*l-s*a*c}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8],u=h*a-o*l,d=o*c-h*r,f=l*r-a*c,m=t*u+n*d+s*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return e[0]=u*g,e[1]=(s*l-h*n)*g,e[2]=(o*n-s*a)*g,e[3]=d*g,e[4]=(h*t-s*c)*g,e[5]=(s*r-o*t)*g,e[6]=f*g,e[7]=(n*c-l*t)*g,e[8]=(a*t-n*r)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,r,a,o){const c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*a+l*o)+a+e,-s*l,s*c,-s*(-l*a+c*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(eu.makeScale(e,t)),this}rotate(e){return this.premultiply(eu.makeRotation(-e)),this}translate(e,t){return this.premultiply(eu.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;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}clone(){return new this.constructor().fromArray(this.elements)}}const eu=new rt;function Dp(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function so(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function m_(){const i=so("canvas");return i.style.display="block",i}const Lp={};function yc(i){i in Lp||(Lp[i]=!0,console.warn(i))}function b_(i,e,t){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function x_(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function E_(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const Pp=new rt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),kp=new rt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function __(){const i={enabled:!0,workingColorSpace:rn,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Mt&&(s.r=Vi(s.r),s.g=Vi(s.g),s.b=Vi(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Mt&&(s.r=Hr(s.r),s.g=Hr(s.g),s.b=Hr(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===ci?Ec:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[rn]:{primaries:e,whitePoint:n,transfer:Ec,toXYZ:Pp,fromXYZ:kp,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Kt},outputColorSpaceConfig:{drawingBufferColorSpace:Kt}},[Kt]:{primaries:e,whitePoint:n,transfer:Mt,toXYZ:Pp,fromXYZ:kp,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Kt}}}),i}const At=__();function Vi(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Hr(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let zr;class y_{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{zr===void 0&&(zr=so("canvas")),zr.width=e.width,zr.height=e.height;const s=zr.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=zr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=so("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),r=s.data;for(let a=0;a<r.length;a++)r[a]=Vi(r[a]/255)*255;return n.putImageData(s,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Vi(t[n]/255)*255):t[n]=Vi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let w_=0;class tu{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:w_++}),this.uuid=li(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},s=this.data;if(s!==null){let r;if(Array.isArray(s)){r=[];for(let a=0,o=s.length;a<o;a++)s[a].isDataTexture?r.push(nu(s[a].image)):r.push(nu(s[a]))}else r=nu(s);n.url=r}return t||(e.images[this.uuid]=n),n}}function nu(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?y_.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let v_=0;class an extends xs{constructor(e=an.DEFAULT_IMAGE,t=an.DEFAULT_MAPPING,n=oi,s=oi,r=zt,a=Jn,o=sn,c=tn,l=an.DEFAULT_ANISOTROPY,h=ci){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:v_++}),this.uuid=li(),this.name="",this.source=new tu(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=c,this.offset=new Ze(0,0),this.repeat=new Ze(1,1),this.center=new Ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new rt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==mp)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case kr:e.x=e.x-Math.floor(e.x);break;case oi:e.x=e.x<0?0:1;break;case lc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case kr:e.y=e.y-Math.floor(e.y);break;case oi:e.y=e.y<0?0:1;break;case lc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}an.DEFAULT_IMAGE=null,an.DEFAULT_MAPPING=mp,an.DEFAULT_ANISOTROPY=1;class _t{constructor(e=0,t=0,n=0,s=1){_t.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*s+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,r;const c=e.elements,l=c[0],h=c[4],u=c[8],d=c[1],f=c[5],m=c[9],g=c[2],A=c[6],p=c[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(m-A)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(m+A)<.1&&Math.abs(l+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(l+1)/2,_=(f+1)/2,M=(p+1)/2,w=(h+d)/4,S=(u+g)/4,T=(m+A)/4;return b>_&&b>M?b<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(b),s=w/n,r=S/n):_>M?_<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(_),n=w/s,r=T/s):M<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(M),n=S/r,s=T/r),this.set(n,s,r,t),this}let y=Math.sqrt((A-m)*(A-m)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(y)<.001&&(y=1),this.x=(A-m)/y,this.y=(u-g)/y,this.z=(d-h)/y,this.w=Math.acos((l+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=at(this.x,e.x,t.x),this.y=at(this.y,e.y,t.y),this.z=at(this.z,e.z,t.z),this.w=at(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=at(this.x,e,t),this.y=at(this.y,e,t),this.z=at(this.z,e,t),this.w=at(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(at(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class C_ extends xs{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth?n.depth:1,this.scissor=new _t(0,0,e,t),this.scissorTest=!1,this.viewport=new _t(0,0,e,t);const s={width:e,height:t,depth:this.depth};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},n);const r=new an(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let s=0,r=this.textures.length;s<r;s++)this.textures[s].image.width=e,this.textures[s].image.height=t,this.textures[s].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;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 s=Object.assign({},e.textures[t].image);this.textures[t].source=new tu(s)}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}dispose(){this.dispatchEvent({type:"dispose"})}}class Zs extends C_{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Up extends an{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=In,this.minFilter=In,this.wrapR=oi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Op extends an{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=In,this.minFilter=In,this.wrapR=oi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Vn{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,r,a,o){let c=n[s+0],l=n[s+1],h=n[s+2],u=n[s+3];const d=r[a+0],f=r[a+1],m=r[a+2],g=r[a+3];if(o===0){e[t+0]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=m,e[t+3]=g;return}if(u!==g||c!==d||l!==f||h!==m){let A=1-o;const p=c*d+l*f+h*m+u*g,y=p>=0?1:-1,b=1-p*p;if(b>Number.EPSILON){const M=Math.sqrt(b),w=Math.atan2(M,p*y);A=Math.sin(A*w)/M,o=Math.sin(o*w)/M}const _=o*y;if(c=c*A+d*_,l=l*A+f*_,h=h*A+m*_,u=u*A+g*_,A===1-o){const M=1/Math.sqrt(c*c+l*l+h*h+u*u);c*=M,l*=M,h*=M,u*=M}}e[t]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,s,r,a){const o=n[s],c=n[s+1],l=n[s+2],h=n[s+3],u=r[a],d=r[a+1],f=r[a+2],m=r[a+3];return e[t]=o*m+h*u+c*f-l*d,e[t+1]=c*m+h*d+l*u-o*f,e[t+2]=l*m+h*f+o*d-c*u,e[t+3]=h*m-o*u-c*d-l*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,r=e._z,a=e._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(s/2),u=o(r/2),d=c(n/2),f=c(s/2),m=c(r/2);switch(a){case"XYZ":this._x=d*h*u+l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u+d*f*m;break;case"YZX":this._x=d*h*u+l*f*m,this._y=l*f*u+d*h*m,this._z=l*h*m-d*f*u,this._w=l*h*u-d*f*m;break;case"XZY":this._x=d*h*u-l*f*m,this._y=l*f*u-d*h*m,this._z=l*h*m+d*f*u,this._w=l*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],r=t[8],a=t[1],o=t[5],c=t[9],l=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-c)*f,this._y=(r-l)*f,this._z=(a-s)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-c)/f,this._x=.25*f,this._y=(s+a)/f,this._z=(r+l)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(r-l)/f,this._x=(s+a)/f,this._y=.25*f,this._z=(c+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-s)/f,this._x=(r+l)/f,this._y=(c+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(at(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,r=e._z,a=e._w,o=t._x,c=t._y,l=t._z,h=t._w;return this._x=n*h+a*o+s*l-r*c,this._y=s*h+a*c+r*o-n*l,this._z=r*h+a*l+n*c-s*o,this._w=a*h-n*o-s*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+s*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const c=1-o*o;if(c<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*n+t*this._x,this._y=f*s+t*this._y,this._z=f*r+t*this._z,this.normalize(),this}const l=Math.sqrt(c),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,d=Math.sin(t*h)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=s*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class H{constructor(e=0,t=0,n=0){H.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Qp.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Qp.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*s,this.y=r[1]*t+r[4]*n+r[7]*s,this.z=r[2]*t+r[5]*n+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,r=e.x,a=e.y,o=e.z,c=e.w,l=2*(a*s-o*n),h=2*(o*t-r*s),u=2*(r*n-a*t);return this.x=t+c*l+a*u-o*h,this.y=n+c*h+o*l-r*u,this.z=s+c*u+r*h-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s,this.y=r[1]*t+r[5]*n+r[9]*s,this.z=r[2]*t+r[6]*n+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=at(this.x,e.x,t.x),this.y=at(this.y,e.y,t.y),this.z=at(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=at(this.x,e,t),this.y=at(this.y,e,t),this.z=at(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(at(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,r=e.z,a=t.x,o=t.y,c=t.z;return this.x=s*c-r*o,this.y=r*a-n*c,this.z=n*o-s*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return iu.copy(this).projectOnVector(e),this.sub(iu)}reflect(e){return this.sub(iu.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(at(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const iu=new H,Qp=new Vn;class Mi{constructor(e=new H(1/0,1/0,1/0),t=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(ui.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ui.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=ui.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,ui):ui.fromBufferAttribute(r,a),ui.applyMatrix4(e.matrixWorld),this.expandByPoint(ui);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),wc.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),wc.copy(n.boundingBox)),wc.applyMatrix4(e.matrixWorld),this.union(wc)}const s=e.children;for(let r=0,a=s.length;r<a;r++)this.expandByObject(s[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ui),ui.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ro),vc.subVectors(this.max,ro),Vr.subVectors(e.a,ro),Wr.subVectors(e.b,ro),qr.subVectors(e.c,ro),Es.subVectors(Wr,Vr),_s.subVectors(qr,Wr),$s.subVectors(Vr,qr);let t=[0,-Es.z,Es.y,0,-_s.z,_s.y,0,-$s.z,$s.y,Es.z,0,-Es.x,_s.z,0,-_s.x,$s.z,0,-$s.x,-Es.y,Es.x,0,-_s.y,_s.x,0,-$s.y,$s.x,0];return!su(t,Vr,Wr,qr,vc)||(t=[1,0,0,0,1,0,0,0,1],!su(t,Vr,Wr,qr,vc))?!1:(Cc.crossVectors(Es,_s),t=[Cc.x,Cc.y,Cc.z],su(t,Vr,Wr,qr,vc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ui).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ui).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Wi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Wi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Wi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Wi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Wi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Wi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Wi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Wi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Wi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Wi=[new H,new H,new H,new H,new H,new H,new H,new H],ui=new H,wc=new Mi,Vr=new H,Wr=new H,qr=new H,Es=new H,_s=new H,$s=new H,ro=new H,vc=new H,Cc=new H,er=new H;function su(i,e,t,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){er.fromArray(i,r);const o=s.x*Math.abs(er.x)+s.y*Math.abs(er.y)+s.z*Math.abs(er.z),c=e.dot(er),l=t.dot(er),h=n.dot(er);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}const S_=new Mi,ao=new H,ru=new H;class Bi{constructor(e=new H,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):S_.setFromPoints(e).getCenter(n);let s=0;for(let r=0,a=e.length;r<a;r++)s=Math.max(s,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(s),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ao.subVectors(e,this.center);const t=ao.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(ao,s/n),this.radius+=s}return this}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):(ru.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ao.copy(e.center).add(ru)),this.expandByPoint(ao.copy(e.center).sub(ru))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const qi=new H,au=new H,Sc=new H,ys=new H,ou=new H,Ic=new H,cu=new H;class oo{constructor(e=new H,t=new H(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,qi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=qi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(qi.copy(this.origin).addScaledVector(this.direction,t),qi.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){au.copy(e).add(t).multiplyScalar(.5),Sc.copy(t).sub(e).normalize(),ys.copy(this.origin).sub(au);const r=e.distanceTo(t)*.5,a=-this.direction.dot(Sc),o=ys.dot(this.direction),c=-ys.dot(Sc),l=ys.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*c-o,d=a*o-c,m=r*h,u>=0)if(d>=-m)if(d<=m){const g=1/h;u*=g,d*=g,f=u*(u+a*d+2*o)+d*(a*u+d+2*c)+l}else d=r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;else d=-r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;else d<=-m?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l):d<=m?(u=0,d=Math.min(Math.max(-r,-c),r),f=d*(d+2*c)+l):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy(au).addScaledVector(Sc,d),f}intersectSphere(e,t){qi.subVectors(e.center,this.origin);const n=qi.dot(this.direction),s=qi.dot(qi)-n*n,r=e.radius*e.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,c=n+a;return c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,r,a,o,c;const l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,s=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,s=(e.min.x-d.x)*l),h>=0?(r=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(r=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a<s||isNaN(s))&&(s=a),u>=0?(o=(e.min.z-d.z)*u,c=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,c=(e.min.z-d.z)*u),n>c||o>s)||((o>n||n!==n)&&(n=o),(c<s||s!==s)&&(s=c),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,qi)!==null}intersectTriangle(e,t,n,s,r){ou.subVectors(t,e),Ic.subVectors(n,e),cu.crossVectors(ou,Ic);let a=this.direction.dot(cu),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ys.subVectors(this.origin,e);const c=o*this.direction.dot(Ic.crossVectors(ys,Ic));if(c<0)return null;const l=o*this.direction.dot(ou.cross(ys));if(l<0||c+l>a)return null;const h=-o*ys.dot(cu);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class et{constructor(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A){et.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A)}set(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=s,p[1]=r,p[5]=a,p[9]=o,p[13]=c,p[2]=l,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=g,p[15]=A,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new et().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/Kr.setFromMatrixColumn(e,0).length(),r=1/Kr.setFromMatrixColumn(e,1).length(),a=1/Kr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,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]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(s),l=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(e.order==="XYZ"){const d=a*h,f=a*u,m=o*h,g=o*u;t[0]=c*h,t[4]=-c*u,t[8]=l,t[1]=f+m*l,t[5]=d-g*l,t[9]=-o*c,t[2]=g-d*l,t[6]=m+f*l,t[10]=a*c}else if(e.order==="YXZ"){const d=c*h,f=c*u,m=l*h,g=l*u;t[0]=d+g*o,t[4]=m*o-f,t[8]=a*l,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=g+d*o,t[10]=a*c}else if(e.order==="ZXY"){const d=c*h,f=c*u,m=l*h,g=l*u;t[0]=d-g*o,t[4]=-a*u,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=g-d*o,t[2]=-a*l,t[6]=o,t[10]=a*c}else if(e.order==="ZYX"){const d=a*h,f=a*u,m=o*h,g=o*u;t[0]=c*h,t[4]=m*l-f,t[8]=d*l+g,t[1]=c*u,t[5]=g*l+d,t[9]=f*l-m,t[2]=-l,t[6]=o*c,t[10]=a*c}else if(e.order==="YZX"){const d=a*c,f=a*l,m=o*c,g=o*l;t[0]=c*h,t[4]=g-d*u,t[8]=m*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-l*h,t[6]=f*u+m,t[10]=d-g*u}else if(e.order==="XZY"){const d=a*c,f=a*l,m=o*c,g=o*l;t[0]=c*h,t[4]=-u,t[8]=l*h,t[1]=d*u+g,t[5]=a*h,t[9]=f*u-m,t[2]=m*u-f,t[6]=o*h,t[10]=g*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}makeRotationFromQuaternion(e){return this.compose(I_,e,M_)}lookAt(e,t,n){const s=this.elements;return Wn.subVectors(e,t),Wn.lengthSq()===0&&(Wn.z=1),Wn.normalize(),ws.crossVectors(n,Wn),ws.lengthSq()===0&&(Math.abs(n.z)===1?Wn.x+=1e-4:Wn.z+=1e-4,Wn.normalize(),ws.crossVectors(n,Wn)),ws.normalize(),Mc.crossVectors(Wn,ws),s[0]=ws.x,s[4]=Mc.x,s[8]=Wn.x,s[1]=ws.y,s[5]=Mc.y,s[9]=Wn.y,s[2]=ws.z,s[6]=Mc.z,s[10]=Wn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],g=n[6],A=n[10],p=n[14],y=n[3],b=n[7],_=n[11],M=n[15],w=s[0],S=s[4],T=s[8],C=s[12],v=s[1],F=s[5],K=s[9],q=s[13],$=s[2],D=s[6],O=s[10],Y=s[14],Q=s[3],J=s[7],ee=s[11],ae=s[15];return r[0]=a*w+o*v+c*$+l*Q,r[4]=a*S+o*F+c*D+l*J,r[8]=a*T+o*K+c*O+l*ee,r[12]=a*C+o*q+c*Y+l*ae,r[1]=h*w+u*v+d*$+f*Q,r[5]=h*S+u*F+d*D+f*J,r[9]=h*T+u*K+d*O+f*ee,r[13]=h*C+u*q+d*Y+f*ae,r[2]=m*w+g*v+A*$+p*Q,r[6]=m*S+g*F+A*D+p*J,r[10]=m*T+g*K+A*O+p*ee,r[14]=m*C+g*q+A*Y+p*ae,r[3]=y*w+b*v+_*$+M*Q,r[7]=y*S+b*F+_*D+M*J,r[11]=y*T+b*K+_*O+M*ee,r[15]=y*C+b*q+_*Y+M*ae,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],r=e[12],a=e[1],o=e[5],c=e[9],l=e[13],h=e[2],u=e[6],d=e[10],f=e[14],m=e[3],g=e[7],A=e[11],p=e[15];return m*(+r*c*u-s*l*u-r*o*d+n*l*d+s*o*f-n*c*f)+g*(+t*c*f-t*l*d+r*a*d-s*a*f+s*l*h-r*c*h)+A*(+t*l*u-t*o*f-r*a*u+n*a*f+r*o*h-n*l*h)+p*(-s*o*h-t*c*u+t*o*d+s*a*u-n*a*d+n*c*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2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=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),r=1-n,a=e.x,o=e.y,c=e.z,l=r*a,h=r*o;return this.set(l*a+n,l*o-s*c,l*c+s*o,0,l*o+s*c,h*o+n,h*c-s*a,0,l*c-s*o,h*c+s*a,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,r,a){return this.set(1,n,r,0,e,1,a,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,r=t._x,a=t._y,o=t._z,c=t._w,l=r+r,h=a+a,u=o+o,d=r*l,f=r*h,m=r*u,g=a*h,A=a*u,p=o*u,y=c*l,b=c*h,_=c*u,M=n.x,w=n.y,S=n.z;return s[0]=(1-(g+p))*M,s[1]=(f+_)*M,s[2]=(m-b)*M,s[3]=0,s[4]=(f-_)*w,s[5]=(1-(d+p))*w,s[6]=(A+y)*w,s[7]=0,s[8]=(m+b)*S,s[9]=(A-y)*S,s[10]=(1-(d+g))*S,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let r=Kr.set(s[0],s[1],s[2]).length();const a=Kr.set(s[4],s[5],s[6]).length(),o=Kr.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],di.copy(this);const l=1/r,h=1/a,u=1/o;return di.elements[0]*=l,di.elements[1]*=l,di.elements[2]*=l,di.elements[4]*=h,di.elements[5]*=h,di.elements[6]*=h,di.elements[8]*=u,di.elements[9]*=u,di.elements[10]*=u,t.setFromRotationMatrix(di),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,s,r,a,o=zi){const c=this.elements,l=2*r/(t-e),h=2*r/(n-s),u=(t+e)/(t-e),d=(n+s)/(n-s);let f,m;if(o===zi)f=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===_c)f=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=l,c[4]=0,c[8]=u,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,s,r,a,o=zi){const c=this.elements,l=1/(t-e),h=1/(n-s),u=1/(a-r),d=(t+e)*l,f=(n+s)*h;let m,g;if(o===zi)m=(a+r)*u,g=-2*u;else if(o===_c)m=r*u,g=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=g,c[14]=-m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;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 Kr=new H,di=new et,I_=new H(0,0,0),M_=new H(1,1,1),ws=new H,Mc=new H,Wn=new H,Gp=new et,Hp=new Vn;class Ti{constructor(e=0,t=0,n=0,s=Ti.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const s=e.elements,r=s[0],a=s[4],o=s[8],c=s[1],l=s[5],h=s[9],u=s[2],d=s[6],f=s[10];switch(t){case"XYZ":this._y=Math.asin(at(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-at(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(at(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-at(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(at(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-at(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Gp.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Gp,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Hp.setFromEuler(this),this.setFromQuaternion(Hp,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ti.DEFAULT_ORDER="XYZ";class zp{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let B_=0;const Vp=new H,jr=new Vn,Ki=new et,Bc=new H,co=new H,T_=new H,R_=new Vn,Wp=new H(1,0,0),qp=new H(0,1,0),Kp=new H(0,0,1),jp={type:"added"},N_={type:"removed"},Xr={type:"childadded",child:null},lu={type:"childremoved",child:null};class Pt extends xs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:B_++}),this.uuid=li(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pt.DEFAULT_UP.clone();const e=new H,t=new Ti,n=new Vn,s=new H(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new et},normalMatrix:{value:new rt}}),this.matrix=new et,this.matrixWorld=new et,this.matrixAutoUpdate=Pt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new zp,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={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return jr.setFromAxisAngle(e,t),this.quaternion.multiply(jr),this}rotateOnWorldAxis(e,t){return jr.setFromAxisAngle(e,t),this.quaternion.premultiply(jr),this}rotateX(e){return this.rotateOnAxis(Wp,e)}rotateY(e){return this.rotateOnAxis(qp,e)}rotateZ(e){return this.rotateOnAxis(Kp,e)}translateOnAxis(e,t){return Vp.copy(e).applyQuaternion(this.quaternion),this.position.add(Vp.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Wp,e)}translateY(e){return this.translateOnAxis(qp,e)}translateZ(e){return this.translateOnAxis(Kp,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ki.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Bc.copy(e):Bc.set(e,t,n);const s=this.parent;this.updateWorldMatrix(!0,!1),co.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ki.lookAt(co,Bc,this.up):Ki.lookAt(Bc,co,this.up),this.quaternion.setFromRotationMatrix(Ki),s&&(Ki.extractRotation(s.matrixWorld),jr.setFromRotationMatrix(Ki),this.quaternion.premultiply(jr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(jp),Xr.child=e,this.dispatchEvent(Xr),Xr.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(N_),lu.child=e,this.dispatchEvent(lu),lu.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ki.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ki.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ki),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(jp),Xr.child=e,this.dispatchEvent(Xr),Xr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,s=this.children.length;n<s;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(co,e,T_),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(co,R_,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?{min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}:void 0,boundingSphere:o.boundingSphere?{radius:o.boundingSphere.radius,center:o.boundingSphere.center.toArray()}:void 0})),s.instanceInfo=this._instanceInfo.map(o=>({...o})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){const u=c[l];r(e.shapes,u)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let c=0,l=this.material.length;c<l;c++)o.push(r(e.materials,this.material[c]));s.material=o}else s.material=r(e.materials,this.material);if(this.children.length>0){s.children=[];for(let o=0;o<this.children.length;o++)s.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let o=0;o<this.animations.length;o++){const c=this.animations[o];s.animations.push(r(e.animations,c))}}if(t){const o=a(e.geometries),c=a(e.materials),l=a(e.textures),h=a(e.images),u=a(e.shapes),d=a(e.skeletons),f=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=s,n;function a(o){const c=[];for(const l in o){const h=o[l];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const s=e.children[n];this.add(s.clone())}return this}}Pt.DEFAULT_UP=new H(0,1,0),Pt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const fi=new H,ji=new H,hu=new H,Xi=new H,Yr=new H,Jr=new H,Xp=new H,uu=new H,du=new H,fu=new H,pu=new _t,Au=new _t,gu=new _t;class pi{constructor(e=new H,t=new H,n=new H){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),fi.subVectors(e,t),s.cross(fi);const r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,n,s,r){fi.subVectors(s,t),ji.subVectors(n,t),hu.subVectors(e,t);const a=fi.dot(fi),o=fi.dot(ji),c=fi.dot(hu),l=ji.dot(ji),h=ji.dot(hu),u=a*l-o*o;if(u===0)return r.set(0,0,0),null;const d=1/u,f=(l*c-o*h)*d,m=(a*h-o*c)*d;return r.set(1-f-m,m,f)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,Xi)===null?!1:Xi.x>=0&&Xi.y>=0&&Xi.x+Xi.y<=1}static getInterpolation(e,t,n,s,r,a,o,c){return this.getBarycoord(e,t,n,s,Xi)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,Xi.x),c.addScaledVector(a,Xi.y),c.addScaledVector(o,Xi.z),c)}static getInterpolatedAttribute(e,t,n,s,r,a){return pu.setScalar(0),Au.setScalar(0),gu.setScalar(0),pu.fromBufferAttribute(e,t),Au.fromBufferAttribute(e,n),gu.fromBufferAttribute(e,s),a.setScalar(0),a.addScaledVector(pu,r.x),a.addScaledVector(Au,r.y),a.addScaledVector(gu,r.z),a}static isFrontFacing(e,t,n,s){return fi.subVectors(n,t),ji.subVectors(e,t),fi.cross(ji).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return fi.subVectors(this.c,this.b),ji.subVectors(this.a,this.b),fi.cross(ji).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return pi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return pi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,r){return pi.getInterpolation(e,this.a,this.b,this.c,t,n,s,r)}containsPoint(e){return pi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return pi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,r=this.c;let a,o;Yr.subVectors(s,n),Jr.subVectors(r,n),uu.subVectors(e,n);const c=Yr.dot(uu),l=Jr.dot(uu);if(c<=0&&l<=0)return t.copy(n);du.subVectors(e,s);const h=Yr.dot(du),u=Jr.dot(du);if(h>=0&&u<=h)return t.copy(s);const d=c*u-h*l;if(d<=0&&c>=0&&h<=0)return a=c/(c-h),t.copy(n).addScaledVector(Yr,a);fu.subVectors(e,r);const f=Yr.dot(fu),m=Jr.dot(fu);if(m>=0&&f<=m)return t.copy(r);const g=f*l-c*m;if(g<=0&&l>=0&&m<=0)return o=l/(l-m),t.copy(n).addScaledVector(Jr,o);const A=h*m-f*u;if(A<=0&&u-h>=0&&f-m>=0)return Xp.subVectors(r,s),o=(u-h)/(u-h+(f-m)),t.copy(s).addScaledVector(Xp,o);const p=1/(A+g+d);return a=g*p,o=d*p,t.copy(n).addScaledVector(Yr,a).addScaledVector(Jr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Yp={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},vs={h:0,s:0,l:0},Tc={h:0,s:0,l:0};function mu(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}let qe=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Kt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,At.toWorkingColorSpace(this,t),this}setRGB(e,t,n,s=At.workingColorSpace){return this.r=e,this.g=t,this.b=n,At.toWorkingColorSpace(this,s),this}setHSL(e,t,n,s=At.workingColorSpace){if(e=$h(e,1),t=at(t,0,1),n=at(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=mu(a,r,e+1/3),this.g=mu(a,r,e),this.b=mu(a,r,e-1/3)}return At.toWorkingColorSpace(this,s),this}setStyle(e,t=Kt){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Kt){const n=Yp[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Vi(e.r),this.g=Vi(e.g),this.b=Vi(e.b),this}copyLinearToSRGB(e){return this.r=Hr(e.r),this.g=Hr(e.g),this.b=Hr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Kt){return At.fromWorkingColorSpace(vn.copy(this),e),Math.round(at(vn.r*255,0,255))*65536+Math.round(at(vn.g*255,0,255))*256+Math.round(at(vn.b*255,0,255))}getHexString(e=Kt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=At.workingColorSpace){At.fromWorkingColorSpace(vn.copy(this),t);const n=vn.r,s=vn.g,r=vn.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let c,l;const h=(o+a)/2;if(o===a)c=0,l=0;else{const u=a-o;switch(l=h<=.5?u/(a+o):u/(2-a-o),a){case n:c=(s-r)/u+(s<r?6:0);break;case s:c=(r-n)/u+2;break;case r:c=(n-s)/u+4;break}c/=6}return e.h=c,e.s=l,e.l=h,e}getRGB(e,t=At.workingColorSpace){return At.fromWorkingColorSpace(vn.copy(this),t),e.r=vn.r,e.g=vn.g,e.b=vn.b,e}getStyle(e=Kt){At.fromWorkingColorSpace(vn.copy(this),e);const t=vn.r,n=vn.g,s=vn.b;return e!==Kt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(s*255)})`}offsetHSL(e,t,n){return this.getHSL(vs),this.setHSL(vs.h+e,vs.s+t,vs.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(vs),e.getHSL(Tc);const n=io(vs.h,Tc.h,t),s=io(vs.s,Tc.s,t),r=io(vs.l,Tc.l,t);return this.setHSL(n,s,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,s=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*s,this.g=r[1]*t+r[4]*n+r[7]*s,this.b=r[2]*t+r[5]*n+r[8]*s,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const vn=new qe;qe.NAMES=Yp;let F_=0;class Ri extends xs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:F_++}),this.uuid=li(),this.name="",this.type="Material",this.blending=Dr,this.side=Gi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=fh,this.blendDst=ph,this.blendEquation=js,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new qe(0,0,0),this.blendAlpha=0,this.depthFunc=Lr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Bp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qr,this.stencilZFail=Qr,this.stencilZPass=Qr,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}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",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.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!==Dr&&(n.blending=this.blending),this.side!==Gi&&(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!==fh&&(n.blendSrc=this.blendSrc),this.blendDst!==ph&&(n.blendDst=this.blendDst),this.blendEquation!==js&&(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!==Lr&&(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!==Bp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Qr&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Qr&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Qr&&(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 s(r){const a=[];for(const o in r){const c=r[o];delete c.metadata,a.push(c)}return a}if(t){const r=s(e.textures),a=s(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const s=t.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Cs extends Ri{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new qe(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 Ti,this.combine=pp,this.reflectivity=1,this.refractionRatio=.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 Yi=D_();function D_(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),s=new Uint32Array(512);for(let c=0;c<256;++c){const l=c-127;l<-27?(n[c]=0,n[c|256]=32768,s[c]=24,s[c|256]=24):l<-14?(n[c]=1024>>-l-14,n[c|256]=1024>>-l-14|32768,s[c]=-l-1,s[c|256]=-l-1):l<=15?(n[c]=l+15<<10,n[c|256]=l+15<<10|32768,s[c]=13,s[c|256]=13):l<128?(n[c]=31744,n[c|256]=64512,s[c]=24,s[c|256]=24):(n[c]=31744,n[c|256]=64512,s[c]=13,s[c|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let l=c<<13,h=0;for(;(l&8388608)===0;)l<<=1,h-=8388608;l&=-8388609,h+=947912704,r[c]=l|h}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)a[c]=c<<23;a[31]=1199570944,a[32]=2147483648;for(let c=33;c<63;++c)a[c]=2147483648+(c-32<<23);a[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:r,exponentTable:a,offsetTable:o}}function L_(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=at(i,-65504,65504),Yi.floatView[0]=i;const e=Yi.uint32View[0],t=e>>23&511;return Yi.baseTable[t]+((e&8388607)>>Yi.shiftTable[t])}function P_(i){const e=i>>10;return Yi.uint32View[0]=Yi.mantissaTable[Yi.offsetTable[e]+(i&1023)]+Yi.exponentTable[e],Yi.floatView[0]}class Jp{static toHalfFloat(e){return L_(e)}static fromHalfFloat(e){return P_(e)}}const Yt=new H,Rc=new Ze;let k_=0;class En{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:k_++}),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=nn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[e+s]=t.array[n+s];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Rc.fromBufferAttribute(this,t),Rc.applyMatrix3(e),this.setXY(t,Rc.x,Rc.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Yt.fromBufferAttribute(this,t),Yt.applyMatrix3(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Yt.fromBufferAttribute(this,t),Yt.applyMatrix4(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Yt.fromBufferAttribute(this,t),Yt.applyNormalMatrix(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Yt.fromBufferAttribute(this,t),Yt.transformDirection(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=hi(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=hi(t,this.array)),t}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=hi(t,this.array)),t}setY(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=hi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=hi(t,this.array)),t}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array),r=It(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Zh&&(e.usage=this.usage),e}}class Zp extends En{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class $p extends En{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Bn extends En{constructor(e,t,n){super(new Float32Array(e),t,n)}}let U_=0;const Zn=new et,bu=new Pt,Zr=new H,qn=new Mi,lo=new Mi,fn=new H;class On extends xs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:U_++}),this.uuid=li(),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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Dp(e)?$p:Zp)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new rt().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(e),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Zn.makeRotationFromQuaternion(e),this.applyMatrix4(Zn),this}rotateX(e){return Zn.makeRotationX(e),this.applyMatrix4(Zn),this}rotateY(e){return Zn.makeRotationY(e),this.applyMatrix4(Zn),this}rotateZ(e){return Zn.makeRotationZ(e),this.applyMatrix4(Zn),this}translate(e,t,n){return Zn.makeTranslation(e,t,n),this.applyMatrix4(Zn),this}scale(e,t,n){return Zn.makeScale(e,t,n),this.applyMatrix4(Zn),this}lookAt(e){return bu.lookAt(e),bu.updateMatrix(),this.applyMatrix4(bu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Zr).negate(),this.translate(Zr.x,Zr.y,Zr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let s=0,r=e.length;s<r;s++){const a=e[s];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Bn(n,3))}else{const n=Math.min(e.length,t.count);for(let s=0;s<n;s++){const r=e[s];t.setXYZ(s,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Mi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new H(-1/0,-1/0,-1/0),new H(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n<s;n++){const r=t[n];qn.setFromBufferAttribute(r),this.morphTargetsRelative?(fn.addVectors(this.boundingBox.min,qn.min),this.boundingBox.expandByPoint(fn),fn.addVectors(this.boundingBox.max,qn.max),this.boundingBox.expandByPoint(fn)):(this.boundingBox.expandByPoint(qn.min),this.boundingBox.expandByPoint(qn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Bi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new H,1/0);return}if(e){const n=this.boundingSphere.center;if(qn.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];lo.setFromBufferAttribute(o),this.morphTargetsRelative?(fn.addVectors(qn.min,lo.min),qn.expandByPoint(fn),fn.addVectors(qn.max,lo.max),qn.expandByPoint(fn)):(qn.expandByPoint(lo.min),qn.expandByPoint(lo.max))}qn.getCenter(n);let s=0;for(let r=0,a=e.count;r<a;r++)fn.fromBufferAttribute(e,r),s=Math.max(s,n.distanceToSquared(fn));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],c=this.morphTargetsRelative;for(let l=0,h=o.count;l<h;l++)fn.fromBufferAttribute(o,l),c&&(Zr.fromBufferAttribute(e,l),fn.add(Zr)),s=Math.max(s,n.distanceToSquared(fn))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,s=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new En(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],c=[];for(let T=0;T<n.count;T++)o[T]=new H,c[T]=new H;const l=new H,h=new H,u=new H,d=new Ze,f=new Ze,m=new Ze,g=new H,A=new H;function p(T,C,v){l.fromBufferAttribute(n,T),h.fromBufferAttribute(n,C),u.fromBufferAttribute(n,v),d.fromBufferAttribute(r,T),f.fromBufferAttribute(r,C),m.fromBufferAttribute(r,v),h.sub(l),u.sub(l),f.sub(d),m.sub(d);const F=1/(f.x*m.y-m.x*f.y);isFinite(F)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(F),A.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(F),o[T].add(g),o[C].add(g),o[v].add(g),c[T].add(A),c[C].add(A),c[v].add(A))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let T=0,C=y.length;T<C;++T){const v=y[T],F=v.start,K=v.count;for(let q=F,$=F+K;q<$;q+=3)p(e.getX(q+0),e.getX(q+1),e.getX(q+2))}const b=new H,_=new H,M=new H,w=new H;function S(T){M.fromBufferAttribute(s,T),w.copy(M);const C=o[T];b.copy(C),b.sub(M.multiplyScalar(M.dot(C))).normalize(),_.crossVectors(w,C);const F=_.dot(c[T])<0?-1:1;a.setXYZW(T,b.x,b.y,b.z,F)}for(let T=0,C=y.length;T<C;++T){const v=y[T],F=v.start,K=v.count;for(let q=F,$=F+K;q<$;q+=3)S(e.getX(q+0)),S(e.getX(q+1)),S(e.getX(q+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new En(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const s=new H,r=new H,a=new H,o=new H,c=new H,l=new H,h=new H,u=new H;if(e)for(let d=0,f=e.count;d<f;d+=3){const m=e.getX(d+0),g=e.getX(d+1),A=e.getX(d+2);s.fromBufferAttribute(t,m),r.fromBufferAttribute(t,g),a.fromBufferAttribute(t,A),h.subVectors(a,r),u.subVectors(s,r),h.cross(u),o.fromBufferAttribute(n,m),c.fromBufferAttribute(n,g),l.fromBufferAttribute(n,A),o.add(h),c.add(h),l.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(g,c.x,c.y,c.z),n.setXYZ(A,l.x,l.y,l.z)}else for(let d=0,f=t.count;d<f;d+=3)s.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,r),u.subVectors(s,r),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)fn.fromBufferAttribute(e,t),fn.normalize(),e.setXYZ(t,fn.x,fn.y,fn.z)}toNonIndexed(){function e(o,c){const l=o.array,h=o.itemSize,u=o.normalized,d=new l.constructor(c.length*h);let f=0,m=0;for(let g=0,A=c.length;g<A;g++){o.isInterleavedBufferAttribute?f=c[g]*o.data.stride+o.offset:f=c[g]*h;for(let p=0;p<h;p++)d[m++]=l[f++]}return new En(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new On,n=this.index.array,s=this.attributes;for(const o in s){const c=s[o],l=e(c,n);t.setAttribute(o,l)}const r=this.morphAttributes;for(const o in r){const c=[],l=r[o];for(let h=0,u=l.length;h<u;h++){const d=l[h],f=e(d,n);c.push(f)}t.morphAttributes[o]=c}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,c=a.length;o<c;o++){const l=a[o];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n){const l=n[c];e.data.attributes[c]=l.toJSON(e.data)}const s={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],h=[];for(let u=0,d=l.length;u<d;u++){const f=l[u];h.push(f.toJSON(e.data))}h.length>0&&(s[c]=h,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const s=e.attributes;for(const l in s){const h=s[l];this.setAttribute(l,h.clone(t))}const r=e.morphAttributes;for(const l in r){const h=[],u=r[l];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(t));this.morphAttributes[l]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,h=a.length;l<h;l++){const u=a[l];this.addGroup(u.start,u.count,u.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const eA=new et,tr=new oo,Nc=new Bi,tA=new H,Fc=new H,Dc=new H,Lc=new H,xu=new H,Pc=new H,nA=new H,kc=new H;class Jt extends Pt{constructor(e=new On,t=new Cs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,s=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(s,e);const o=this.morphTargetInfluences;if(r&&o){Pc.set(0,0,0);for(let c=0,l=r.length;c<l;c++){const h=o[c],u=r[c];h!==0&&(xu.fromBufferAttribute(u,e),a?Pc.addScaledVector(xu,h):Pc.addScaledVector(xu.sub(t),h))}t.add(Pc)}return t}raycast(e,t){const n=this.geometry,s=this.material,r=this.matrixWorld;s!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Nc.copy(n.boundingSphere),Nc.applyMatrix4(r),tr.copy(e.ray).recast(e.near),!(Nc.containsPoint(tr.origin)===!1&&(tr.intersectSphere(Nc,tA)===null||tr.origin.distanceToSquared(tA)>(e.far-e.near)**2))&&(eA.copy(r).invert(),tr.copy(e.ray).applyMatrix4(eA),!(n.boundingBox!==null&&tr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,tr)))}_computeIntersections(e,t,n){let s;const r=this.geometry,a=this.material,o=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,d=r.groups,f=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,g=d.length;m<g;m++){const A=d[m],p=a[A.materialIndex],y=Math.max(A.start,f.start),b=Math.min(o.count,Math.min(A.start+A.count,f.start+f.count));for(let _=y,M=b;_<M;_+=3){const w=o.getX(_),S=o.getX(_+1),T=o.getX(_+2);s=Uc(this,p,e,n,l,h,u,w,S,T),s&&(s.faceIndex=Math.floor(_/3),s.face.materialIndex=A.materialIndex,t.push(s))}}else{const m=Math.max(0,f.start),g=Math.min(o.count,f.start+f.count);for(let A=m,p=g;A<p;A+=3){const y=o.getX(A),b=o.getX(A+1),_=o.getX(A+2);s=Uc(this,a,e,n,l,h,u,y,b,_),s&&(s.faceIndex=Math.floor(A/3),t.push(s))}}else if(c!==void 0)if(Array.isArray(a))for(let m=0,g=d.length;m<g;m++){const A=d[m],p=a[A.materialIndex],y=Math.max(A.start,f.start),b=Math.min(c.count,Math.min(A.start+A.count,f.start+f.count));for(let _=y,M=b;_<M;_+=3){const w=_,S=_+1,T=_+2;s=Uc(this,p,e,n,l,h,u,w,S,T),s&&(s.faceIndex=Math.floor(_/3),s.face.materialIndex=A.materialIndex,t.push(s))}}else{const m=Math.max(0,f.start),g=Math.min(c.count,f.start+f.count);for(let A=m,p=g;A<p;A+=3){const y=A,b=A+1,_=A+2;s=Uc(this,a,e,n,l,h,u,y,b,_),s&&(s.faceIndex=Math.floor(A/3),t.push(s))}}}}function O_(i,e,t,n,s,r,a,o){let c;if(e.side===Sn?c=n.intersectTriangle(a,r,s,!0,o):c=n.intersectTriangle(s,r,a,e.side===Gi,o),c===null)return null;kc.copy(o),kc.applyMatrix4(i.matrixWorld);const l=t.ray.origin.distanceTo(kc);return l<t.near||l>t.far?null:{distance:l,point:kc.clone(),object:i}}function Uc(i,e,t,n,s,r,a,o,c,l){i.getVertexPosition(o,Fc),i.getVertexPosition(c,Dc),i.getVertexPosition(l,Lc);const h=O_(i,e,t,n,Fc,Dc,Lc,nA);if(h){const u=new H;pi.getBarycoord(nA,Fc,Dc,Lc,u),s&&(h.uv=pi.getInterpolatedAttribute(s,o,c,l,u,new Ze)),r&&(h.uv1=pi.getInterpolatedAttribute(r,o,c,l,u,new Ze)),a&&(h.normal=pi.getInterpolatedAttribute(a,o,c,l,u,new H),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:c,c:l,normal:new H,materialIndex:0};pi.getNormal(Fc,Dc,Lc,d.normal),h.face=d,h.barycoord=u}return h}class $r extends On{constructor(e=1,t=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const c=[],l=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,s,a,2),m("x","z","y",1,-1,e,n,-t,s,a,3),m("x","y","z",1,-1,e,t,n,s,r,4),m("x","y","z",-1,-1,e,t,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new Bn(l,3)),this.setAttribute("normal",new Bn(h,3)),this.setAttribute("uv",new Bn(u,2));function m(g,A,p,y,b,_,M,w,S,T,C){const v=_/S,F=M/T,K=_/2,q=M/2,$=w/2,D=S+1,O=T+1;let Y=0,Q=0;const J=new H;for(let ee=0;ee<O;ee++){const ae=ee*F-q;for(let ye=0;ye<D;ye++){const Me=ye*v-K;J[g]=Me*y,J[A]=ae*b,J[p]=$,l.push(J.x,J.y,J.z),J[g]=0,J[A]=0,J[p]=w>0?1:-1,h.push(J.x,J.y,J.z),u.push(ye/S),u.push(1-ee/T),Y+=1}}for(let ee=0;ee<T;ee++)for(let ae=0;ae<S;ae++){const ye=d+ae+D*ee,Me=d+ae+D*(ee+1),se=d+(ae+1)+D*(ee+1),me=d+(ae+1)+D*ee;c.push(ye,Me,me),c.push(Me,se,me),Q+=6}o.addGroup(f,Q,C),f+=Q,d+=Y}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $r(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function ea(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const s=i[t][n];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=s.clone():Array.isArray(s)?e[t][n]=s.slice():e[t][n]=s}}return e}function Tn(i){const e={};for(let t=0;t<i.length;t++){const n=ea(i[t]);for(const s in n)e[s]=n[s]}return e}function Q_(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function iA(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:At.workingColorSpace}const G_={clone:ea,merge:Tn};var H_=`void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );-}`,L_=`void main() {+}`,z_=`void main() {gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );-}`;class vs extends Ti{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=D_,this.fragmentShader=L_,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},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=Zr(e.uniforms),this.uniformsGroups=N_(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);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const a=this.uniforms[s].value;a&&a.isTexture?t.uniforms[s]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[s]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[s]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[s]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[s]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[s]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[s]={type:"m4",value:a.toArray()}:t.uniforms[s]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Zp extends Pt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new et,this.projectionMatrix=new et,this.projectionMatrixInverse=new et,this.coordinateSystem=Hi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ss=new H,$p=new Ze,eA=new Ze;class vn extends Zp{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Or*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Za*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Or*2*Math.atan(Math.tan(Za*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Ss.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ss.x,Ss.y).multiplyScalar(-e/Ss.z),Ss.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ss.x,Ss.y).multiplyScalar(-e/Ss.z)}getViewSize(e,t){return this.getViewBounds(e,$p,eA),t.subVectors(eA,$p)}setViewOffset(e,t,n,s,r,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Za*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const c=a.fullWidth,l=a.fullHeight;r+=a.offsetX*s/c,t-=a.offsetY*n/l,s*=a.width/c,n*=a.height/l}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const $r=-90,ea=1;class P_ extends Pt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new vn($r,ea,e,t);s.layers=this.layers,this.add(s);const r=new vn($r,ea,e,t);r.layers=this.layers,this.add(r);const a=new vn($r,ea,e,t);a.layers=this.layers,this.add(a);const o=new vn($r,ea,e,t);o.layers=this.layers,this.add(o);const c=new vn($r,ea,e,t);c.layers=this.layers,this.add(c);const l=new vn($r,ea,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,r,a,o,c]=t;for(const l of t)this.remove(l);if(e===Hi)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===gc)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,c,l,h]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,r),e.setRenderTarget(n,1,s),e.render(t,a),e.setRenderTarget(n,2,s),e.render(t,o),e.setRenderTarget(n,3,s),e.render(t,c),e.setRenderTarget(n,4,s),e.render(t,l),n.texture.generateMipmaps=g,e.setRenderTarget(n,5,s),e.render(t,h),e.setRenderTarget(u,d,f),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class tA extends an{constructor(e=[],t=Ks,n,s,r,a,o,c,l,h){super(e,t,n,s,r,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class k_ extends js{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new tA(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`+}`;class Ss extends Ri{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=H_,this.fragmentShader=z_,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},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=ea(e.uniforms),this.uniformsGroups=Q_(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);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const a=this.uniforms[s].value;a&&a.isTexture?t.uniforms[s]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[s]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[s]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[s]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[s]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[s]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[s]={type:"m4",value:a.toArray()}:t.uniforms[s]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class sA extends Pt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new et,this.projectionMatrix=new et,this.projectionMatrixInverse=new et,this.coordinateSystem=zi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Is=new H,rA=new Ze,aA=new Ze;class Cn extends sA{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Gr*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(no*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Gr*2*Math.atan(Math.tan(no*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Is.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Is.x,Is.y).multiplyScalar(-e/Is.z),Is.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Is.x,Is.y).multiplyScalar(-e/Is.z)}getViewSize(e,t){return this.getViewBounds(e,rA,aA),t.subVectors(aA,rA)}setViewOffset(e,t,n,s,r,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(no*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,r=-.5*s;const a=this.view;if(this.view!==null&&this.view.enabled){const c=a.fullWidth,l=a.fullHeight;r+=a.offsetX*s/c,t-=a.offsetY*n/l,s*=a.width/c,n*=a.height/l}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ta=-90,na=1;class V_ extends Pt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Cn(ta,na,e,t);s.layers=this.layers,this.add(s);const r=new Cn(ta,na,e,t);r.layers=this.layers,this.add(r);const a=new Cn(ta,na,e,t);a.layers=this.layers,this.add(a);const o=new Cn(ta,na,e,t);o.layers=this.layers,this.add(o);const c=new Cn(ta,na,e,t);c.layers=this.layers,this.add(c);const l=new Cn(ta,na,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,r,a,o,c]=t;for(const l of t)this.remove(l);if(e===zi)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===_c)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,c,l,h]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,r),e.setRenderTarget(n,1,s),e.render(t,a),e.setRenderTarget(n,2,s),e.render(t,o),e.setRenderTarget(n,3,s),e.render(t,c),e.setRenderTarget(n,4,s),e.render(t,l),n.texture.generateMipmaps=g,e.setRenderTarget(n,5,s),e.render(t,h),e.setRenderTarget(u,d,f),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class oA extends an{constructor(e=[],t=Xs,n,s,r,a,o,c,l,h){super(e,t,n,s,r,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class W_ extends Zs{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new oA(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`varying vec3 vWorldDirection;@@ -37,9 +37,9 @@gl_FragColor = texture2D( tEquirect, sampleUV );}- `},s=new Jr(5,5,5),r=new vs({name:"CubemapFromEquirect",uniforms:Zr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Sn,blending:gs});r.uniforms.tEquirect.value=t;const a=new Jt(s,r),o=t.minFilter;return t.minFilter===Jn&&(t.minFilter=zt),new P_(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,s);e.setRenderTarget(r)}}class er extends Pt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const U_={type:"move"};class pu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new er,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new er,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new er,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let s=null,r=null,a=null;const o=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){a=!0;for(const g of e.hand.values()){const A=t.getJointPose(g,n),p=this._getHandJoint(l,g);A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=A.radius),p.visible=A!==null}const h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;l.inputState.pinching&&d>f+m?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=f-m&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(U_)))}return o!==null&&(o.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new er;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Au extends Pt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Bi,this.environmentIntensity=1,this.environmentRotation=new Bi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);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 O_{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=ci()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,r=this.stride;s<r;s++)this.array[e+s]=t.array[n+s];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ci()),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}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ci()),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,stride:this.stride}}}const Rn=new H;class gu{constructor(e,t,n,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Rn.fromBufferAttribute(this,t),Rn.applyMatrix4(e),this.setXYZ(t,Rn.x,Rn.y,Rn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Rn.fromBufferAttribute(this,t),Rn.applyNormalMatrix(e),this.setXYZ(t,Rn.x,Rn.y,Rn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Rn.fromBufferAttribute(this,t),Rn.transformDirection(e),this.setXYZ(t,Rn.x,Rn.y,Rn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=li(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=li(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=li(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=li(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=li(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array),r=It(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return new En(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 gu(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const nA=new H,iA=new _t,sA=new _t,Q_=new H,rA=new et,Dc=new H,mu=new Mi,aA=new et,bu=new io;class G_ extends Jt{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=hp,this.bindMatrix=new et,this.bindMatrixInverse=new et,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ii),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Dc),this.boundingBox.expandByPoint(Dc)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Mi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Dc),this.boundingSphere.expandByPoint(Dc)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,s=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),mu.copy(this.boundingSphere),mu.applyMatrix4(s),e.ray.intersectsSphere(mu)!==!1&&(aA.copy(s).invert(),bu.copy(e.ray).applyMatrix4(aA),!(this.boundingBox!==null&&bu.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,bu)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new _t,t=this.geometry.attributes.skinWeight;for(let n=0,s=t.count;n<s;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===hp?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===FE?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,s=this.geometry;iA.fromBufferAttribute(s.attributes.skinIndex,e),sA.fromBufferAttribute(s.attributes.skinWeight,e),nA.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=sA.getComponent(r);if(a!==0){const o=iA.getComponent(r);rA.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Q_.copy(nA).applyMatrix4(rA),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class oA extends Pt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Lc extends an{constructor(e=null,t=1,n=1,s,r,a,o,c,l=In,h=In,u,d){super(null,a,o,c,l,h,s,r,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const cA=new et,H_=new et;class xu{constructor(e=[],t=[]){this.uuid=ci(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,s=this.bones.length;n<s;n++)this.boneInverses.push(new et)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new et;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,s=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:H_;cA.multiplyMatrices(o,t[r]),cA.toArray(n,r*16)}s!==null&&(s.needsUpdate=!0)}clone(){return new xu(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);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 Lc(t,e,e,sn,nn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const s=this.bones[t];if(s.name===e)return s}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,s=e.bones.length;n<s;n++){const r=e.bones[n];let a=t[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new oA),this.bones.push(a),this.boneInverses.push(new et().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let s=0,r=t.length;s<r;s++){const a=t[s];e.bones.push(a.uuid);const o=n[s];e.boneInverses.push(o.toArray())}return e}}class Eu extends En{constructor(e,t,n,s=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const ta=new et,lA=new et,Pc=[],hA=new Ii,z_=new et,ao=new Jt,oo=new Mi;class uA extends Jt{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Eu(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s<n;s++)this.setMatrixAt(s,z_)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ii),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ta),hA.copy(e.boundingBox).applyMatrix4(ta),this.boundingBox.union(hA)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Mi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ta),oo.copy(e.boundingSphere).applyMatrix4(ta),this.boundingSphere.union(oo)}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}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,s=this.morphTexture.source.data.data,r=n.length+1,a=e*r+1;for(let o=0;o<n.length;o++)n[o]=s[a+o]}raycast(e,t){const n=this.matrixWorld,s=this.count;if(ao.geometry=this.geometry,ao.material=this.material,ao.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),oo.copy(this.boundingSphere),oo.applyMatrix4(n),e.ray.intersectsSphere(oo)!==!1))for(let r=0;r<s;r++){this.getMatrixAt(r,ta),lA.multiplyMatrices(n,ta),ao.matrixWorld=lA,ao.raycast(e,Pc);for(let a=0,o=Pc.length;a<o;a++){const c=Pc[a];c.instanceId=r,c.object=this,t.push(c)}Pc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Eu(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,s=n.length+1;this.morphTexture===null&&(this.morphTexture=new Lc(new Float32Array(s*this.count),s,this.count,Gi,nn));const r=this.morphTexture.source.data.data;let a=0;for(let l=0;l<n.length;l++)a+=n[l];const o=this.geometry.morphTargetsRelative?1:1-a,c=s*e;r[c]=o,r.set(n,c+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const _u=new H,V_=new H,W_=new rt;class Is{constructor(e=new H(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,s){return this.normal.set(e,t,n),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const s=_u.subVectors(n,t).cross(V_.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(_u),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||W_.getNormalMatrix(e),s=this.coplanarPoint(_u).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const tr=new Mi,kc=new H;class yu{constructor(e=new Is,t=new Is,n=new Is,s=new Is,r=new Is,a=new Is){this.planes=[e,t,n,s,r,a]}set(e,t,n,s,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Hi){const n=this.planes,s=e.elements,r=s[0],a=s[1],o=s[2],c=s[3],l=s[4],h=s[5],u=s[6],d=s[7],f=s[8],m=s[9],g=s[10],A=s[11],p=s[12],y=s[13],b=s[14],_=s[15];if(n[0].setComponents(c-r,d-l,A-f,_-p).normalize(),n[1].setComponents(c+r,d+l,A+f,_+p).normalize(),n[2].setComponents(c+a,d+h,A+m,_+y).normalize(),n[3].setComponents(c-a,d-h,A-m,_-y).normalize(),n[4].setComponents(c-o,d-u,A-g,_-b).normalize(),t===Hi)n[5].setComponents(c+o,d+u,A+g,_+b).normalize();else if(t===gc)n[5].setComponents(o,u,g,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),tr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),tr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(tr)}intersectsSprite(e){return tr.center.set(0,0,0),tr.radius=.7071067811865476,tr.applyMatrix4(e.matrixWorld),this.intersectsSphere(tr)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<s)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const s=t[n];if(kc.x=s.normal.x>0?e.max.x:e.min.x,kc.y=s.normal.y>0?e.max.y:e.min.y,kc.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(kc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class co extends Ti{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new qe(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 Uc=new H,Oc=new H,dA=new et,lo=new io,Qc=new Mi,wu=new H,fA=new H;class Cu extends Pt{constructor(e=new On,t=new co){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){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let s=1,r=t.count;s<r;s++)Uc.fromBufferAttribute(t,s-1),Oc.fromBufferAttribute(t,s),n[s]=n[s-1],n[s]+=Uc.distanceTo(Oc);e.setAttribute("lineDistance",new Bn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Qc.copy(n.boundingSphere),Qc.applyMatrix4(s),Qc.radius+=r,e.ray.intersectsSphere(Qc)===!1)return;dA.copy(s).invert(),lo.copy(e.ray).applyMatrix4(dA);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,l=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let g=f,A=m-1;g<A;g+=l){const p=h.getX(g),y=h.getX(g+1),b=Gc(this,e,lo,c,p,y,g);b&&t.push(b)}if(this.isLineLoop){const g=h.getX(m-1),A=h.getX(f),p=Gc(this,e,lo,c,g,A,m-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let g=f,A=m-1;g<A;g+=l){const p=Gc(this,e,lo,c,g,g+1,g);p&&t.push(p)}if(this.isLineLoop){const g=Gc(this,e,lo,c,m-1,f,m-1);g&&t.push(g)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Gc(i,e,t,n,s,r,a){const o=i.geometry.attributes.position;if(Uc.fromBufferAttribute(o,s),Oc.fromBufferAttribute(o,r),t.distanceSqToSegment(Uc,Oc,wu,fA)>n)return;wu.applyMatrix4(i.matrixWorld);const l=e.ray.origin.distanceTo(wu);if(!(l<e.near||l>e.far))return{distance:l,point:fA.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}const pA=new H,AA=new H;class Hc extends Cu{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let s=0,r=t.count;s<r;s+=2)pA.fromBufferAttribute(t,s),AA.fromBufferAttribute(t,s+1),n[s]=s===0?0:n[s-1],n[s+1]=n[s]+pA.distanceTo(AA);e.setAttribute("lineDistance",new Bn(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class q_ extends Cu{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class vu extends Ti{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new qe(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 gA=new et,Su=new io,zc=new Mi,Vc=new H;class K_ extends Pt{constructor(e=new On,t=new vu){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),zc.copy(n.boundingSphere),zc.applyMatrix4(s),zc.radius+=r,e.ray.intersectsSphere(zc)===!1)return;gA.copy(s).invert(),Su.copy(e.ray).applyMatrix4(gA);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,l=n.index,u=n.attributes.position;if(l!==null){const d=Math.max(0,a.start),f=Math.min(l.count,a.start+a.count);for(let m=d,g=f;m<g;m++){const A=l.getX(m);Vc.fromBufferAttribute(u,A),mA(Vc,A,c,s,e,t,this)}}else{const d=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let m=d,g=f;m<g;m++)Vc.fromBufferAttribute(u,m),mA(Vc,m,c,s,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function mA(i,e,t,n,s,r,a){const o=Su.distanceSqToPoint(i);if(o<t){const c=new H;Su.closestPointToPoint(i,c),c.applyMatrix4(n);const l=s.ray.origin.distanceTo(c);if(l<s.near||l>s.far)return;r.push({distance:l,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Wc extends an{constructor(e,t,n,s,r,a,o,c,l,h,u,d){super(null,a,o,c,l,h,s,r,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class X_ extends Wc{constructor(e,t,n,s,r,a){super(e,t,n,r,a),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=ai,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Y_ extends Wc{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Ks),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class bA extends an{constructor(e,t,n=Xs,s,r,a,o=In,c=In,l,h=za){if(h!==za&&h!==Va)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,r,a,o,c,h,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Yh(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class qc extends On{constructor(e=1,t=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:s};const r=e/2,a=t/2,o=Math.floor(n),c=Math.floor(s),l=o+1,h=c+1,u=e/o,d=t/c,f=[],m=[],g=[],A=[];for(let p=0;p<h;p++){const y=p*d-a;for(let b=0;b<l;b++){const _=b*u-r;m.push(_,-y,0),g.push(0,0,1),A.push(b/o),A.push(1-p/c)}}for(let p=0;p<c;p++)for(let y=0;y<o;y++){const b=y+l*p,_=y+l*(p+1),M=y+1+l*(p+1),w=y+1+l*p;f.push(b,_,w),f.push(_,M,w)}this.setIndex(f),this.setAttribute("position",new Bn(m,3)),this.setAttribute("normal",new Bn(g,3)),this.setAttribute("uv",new Bn(A,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qc(e.width,e.height,e.widthSegments,e.heightSegments)}}class ho extends Ti{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new qe(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 qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yp,this.normalScale=new Ze(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 Bi,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 Ri extends ho{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ze(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return at(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new qe(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 qe(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new qe(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)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class j_ extends Ti{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=kE,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class J_ extends Ti{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Kc(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function Z_(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function $_(i){function e(s,r){return i[s]-i[r]}const t=i.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function xA(i,e,t){const n=i.length,s=new i.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let c=0;c!==e;++c)s[a++]=i[o+c]}return s}function EA(i,e,t,n){let s=1,r=i[0];for(;r!==void 0&&r[n]===void 0;)r=i[s++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=i[s++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=i[s++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=i[s++];while(r!==void 0)}class uo{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,s=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<s)){for(let o=n+2;;){if(s===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=s,s=t[++n],e<s)break t}a=t.length;break n}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let c=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(s=r,r=t[--n-1],e>=r)break t}a=n,n=0;break n}break e}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(s=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,s)}return this.interpolate_(n,r,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s;for(let a=0;a!==s;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class ey extends uo{constructor(e,t,n,s){super(e,t,n,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Pr,endingEnd:Pr}}intervalChanged_(e,t,n){const s=this.parameterPositions;let r=e-2,a=e+1,o=s[r],c=s[a];if(o===void 0)switch(this.getSettings_().endingStart){case kr:r=e,o=2*t-n;break;case pc:r=s.length-2,o=t+s[r]-s[r+1];break;default:r=e,o=n}if(c===void 0)switch(this.getSettings_().endingEnd){case kr:a=e,c=2*n-t;break;case pc:a=1,c=n+s[1]-s[0];break;default:a=e-1,c=t}const l=(n-t)*.5,h=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(c-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,m=(n-t)/(s-t),g=m*m,A=g*m,p=-d*A+2*d*g-d*m,y=(1+d)*A+(-1.5-2*d)*g+(-.5+d)*m+1,b=(-1-f)*A+(1.5+f)*g+.5*m,_=f*A-f*g;for(let M=0;M!==o;++M)r[M]=p*a[h+M]+y*a[l+M]+b*a[c+M]+_*a[u+M];return r}}class _A extends uo{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=(n-t)/(s-t),u=1-h;for(let d=0;d!==o;++d)r[d]=a[l+d]*u+a[c+d]*h;return r}}class ty extends uo{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e){return this.copySampleValue_(e-1)}}class pi{constructor(e,t,n,s){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Kc(t,this.TimeBufferType),this.values=Kc(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Kc(e.times,Array),values:Kc(e.values,Array)};const s=e.getInterpolation();s!==e.DefaultInterpolation&&(n.interpolation=s)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new ty(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _A(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new ey(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ja:t=this.InterpolantFactoryMethodDiscrete;break;case Ja:t=this.InterpolantFactoryMethodLinear;break;case zh:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ja;case this.InterpolantFactoryMethodLinear:return Ja;case this.InterpolantFactoryMethodSmooth:return zh}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]*=e}return this}trim(e,t){const n=this.times,s=n.length;let r=0,a=s-1;for(;r!==s&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(a!==null&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,a),e=!1;break}a=c}if(s!==void 0&&Z_(s))for(let o=0,c=s.length;o!==c;++o){const l=s[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===zh,r=e.length-1;let a=1;for(let o=1;o<r;++o){let c=!1;const l=e[o],h=e[o+1];if(l!==h&&(o!==1||l!==e[0]))if(s)c=!0;else{const u=o*n,d=u-n,f=u+n;for(let m=0;m!==n;++m){const g=t[u+m];if(g!==t[d+m]||g!==t[f+m]){c=!0;break}}}if(c){if(o!==a){e[a]=e[o];const u=o*n,d=a*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,c=a*n,l=0;l!==n;++l)t[c+l]=t[o+l];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}pi.prototype.ValueTypeName="",pi.prototype.TimeBufferType=Float32Array,pi.prototype.ValueBufferType=Float32Array,pi.prototype.DefaultInterpolation=Ja;class na extends pi{constructor(e,t,n){super(e,t,n)}}na.prototype.ValueTypeName="bool",na.prototype.ValueBufferType=Array,na.prototype.DefaultInterpolation=ja,na.prototype.InterpolantFactoryMethodLinear=void 0,na.prototype.InterpolantFactoryMethodSmooth=void 0;class yA extends pi{constructor(e,t,n,s){super(e,t,n,s)}}yA.prototype.ValueTypeName="color";class ia extends pi{constructor(e,t,n,s){super(e,t,n,s)}}ia.prototype.ValueTypeName="number";class ny extends uo{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-t)/(s-t);let l=e*o;for(let h=l+o;l!==h;l+=4)Vn.slerpFlat(r,0,a,l-o,a,l,c);return r}}class sa extends pi{constructor(e,t,n,s){super(e,t,n,s)}InterpolantFactoryMethodLinear(e){return new ny(this.times,this.values,this.getValueSize(),e)}}sa.prototype.ValueTypeName="quaternion",sa.prototype.InterpolantFactoryMethodSmooth=void 0;class ra extends pi{constructor(e,t,n){super(e,t,n)}}ra.prototype.ValueTypeName="string",ra.prototype.ValueBufferType=Array,ra.prototype.DefaultInterpolation=ja,ra.prototype.InterpolantFactoryMethodLinear=void 0,ra.prototype.InterpolantFactoryMethodSmooth=void 0;class aa extends pi{constructor(e,t,n,s){super(e,t,n,s)}}aa.prototype.ValueTypeName="vector";class Iu{constructor(e="",t=-1,n=[],s=Vh){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=ci(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,s=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(sy(n[a]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=n.length;r!==a;++r)t.push(pi.toJSON(n[r]));return s}static CreateFromMorphTargetSequence(e,t,n,s){const r=t.length,a=[];for(let o=0;o<r;o++){let c=[],l=[];c.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);const h=$_(c);c=xA(c,1,h),l=xA(l,1,h),!s&&c[0]===0&&(c.push(r),l.push(l[0])),a.push(new ia(".morphTargetInfluences["+t[o].name+"]",c,l).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const s=e;n=s.geometry&&s.geometry.animations||s.animations}for(let s=0;s<n.length;s++)if(n[s].name===t)return n[s];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const s={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,c=e.length;o<c;o++){const l=e[o],h=l.name.match(r);if(h&&h.length>1){const u=h[1];let d=s[u];d||(s[u]=d=[]),d.push(l)}}const a=[];for(const o in s)a.push(this.CreateFromMorphTargetSequence(o,s[o],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,m,g){if(f.length!==0){const A=[],p=[];EA(f,A,p,m),A.length!==0&&g.push(new u(d,A,p))}},s=[],r=e.name||"default",a=e.fps||30,o=e.blendMode;let c=e.length||-1;const l=e.hierarchy||[];for(let u=0;u<l.length;u++){const d=l[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)f[d[m].morphTargets[g]]=-1;for(const g in f){const A=[],p=[];for(let y=0;y!==d[m].morphTargets.length;++y){const b=d[m];A.push(b.time),p.push(b.morphTarget===g?1:0)}s.push(new ia(".morphTargetInfluence["+g+"]",A,p))}c=f.length*a}else{const f=".bones["+t[u].name+"]";n(aa,f+".position",d,"pos",s),n(sa,f+".quaternion",d,"rot",s),n(aa,f+".scale",d,"scl",s)}}return s.length===0?null:new this(r,c,s,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,s=e.length;n!==s;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function iy(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ia;case"vector":case"vector2":case"vector3":case"vector4":return aa;case"color":return yA;case"quaternion":return sa;case"bool":case"boolean":return na;case"string":return ra}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function sy(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=iy(i.type);if(i.times===void 0){const t=[],n=[];EA(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const ji={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class wA{constructor(e,t,n){const s=this;let r=!1,a=0,o=0,c;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,r===!1&&s.onStart!==void 0&&s.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,s.onProgress!==void 0&&s.onProgress(h,a,o),a===o&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(h){s.onError!==void 0&&s.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,u){return l.push(h,u),this},this.removeHandler=function(h){const u=l.indexOf(h);return u!==-1&&l.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=l.length;u<d;u+=2){const f=l[u],m=l[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const ry=new wA;class Ji{constructor(e){this.manager=e!==void 0?e:ry,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(s,r){n.load(e,s,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Ji.DEFAULT_MATERIAL_NAME="__DEFAULT";const Zi={};class ay extends Error{constructor(e,t){super(e),this.response=t}}class Ms extends Ji{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=ji.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(Zi[e]!==void 0){Zi[e].push({onLoad:t,onProgress:n,onError:s});return}Zi[e]=[],Zi[e].push({onLoad:t,onProgress:n,onError:s});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,c=this.responseType;fetch(a).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const h=Zi[e],u=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0;let g=0;const A=new ReadableStream({start(p){y();function y(){u.read().then(({done:b,value:_})=>{if(b)p.close();else{g+=_.byteLength;const M=new ProgressEvent("progress",{lengthComputable:m,loaded:g,total:f});for(let w=0,S=h.length;w<S;w++){const T=h[w];T.onProgress&&T.onProgress(M)}p.enqueue(_),y()}},b=>{p.error(b)})}}});return new Response(A)}else throw new ay(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(c){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return l.json();default:if(o==="")return l.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return l.arrayBuffer().then(m=>f.decode(m))}}}).then(l=>{ji.add(e,l);const h=Zi[e];delete Zi[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(l)}}).catch(l=>{const h=Zi[e];if(h===void 0)throw this.manager.itemError(e),l;delete Zi[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onError&&f.onError(l)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class oy extends Ji{constructor(e){super(e)}load(e,t,n,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=ji.get(e);if(a!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;const o=eo("img");function c(){h(),ji.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(u){h(),s&&s(u),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",c,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",c,!1),o.addEventListener("error",l,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class cy extends Ji{constructor(e){super(e)}load(e,t,n,s){const r=this,a=new Lc,o=new Ms(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(c){let l;try{l=r.parse(c)}catch(h){if(s!==void 0)s(h);else{console.error(h);return}}l.image!==void 0?a.image=l.image:l.data!==void 0&&(a.image.width=l.width,a.image.height=l.height,a.image.data=l.data),a.wrapS=l.wrapS!==void 0?l.wrapS:ai,a.wrapT=l.wrapT!==void 0?l.wrapT:ai,a.magFilter=l.magFilter!==void 0?l.magFilter:zt,a.minFilter=l.minFilter!==void 0?l.minFilter:zt,a.anisotropy=l.anisotropy!==void 0?l.anisotropy:1,l.colorSpace!==void 0&&(a.colorSpace=l.colorSpace),l.flipY!==void 0&&(a.flipY=l.flipY),l.format!==void 0&&(a.format=l.format),l.type!==void 0&&(a.type=l.type),l.mipmaps!==void 0&&(a.mipmaps=l.mipmaps,a.minFilter=Jn),l.mipmapCount===1&&(a.minFilter=zt),l.generateMipmaps!==void 0&&(a.generateMipmaps=l.generateMipmaps),a.needsUpdate=!0,t&&t(a,l)},n,s),a}}class ly extends Ji{constructor(e){super(e)}load(e,t,n,s){const r=new an,a=new oy(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,s),r}}class fo extends Pt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new qe(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class hy extends fo{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Pt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new qe(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Mu=new et,CA=new H,vA=new H;class Bu{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ze(512,512),this.mapType=tn,this.map=null,this.mapPass=null,this.matrix=new et,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new yu,this._frameExtents=new Ze(1,1),this._viewportCount=1,this._viewports=[new _t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;CA.setFromMatrixPosition(e.matrixWorld),t.position.copy(CA),vA.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(vA),t.updateMatrixWorld(),Mu.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Mu),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Mu)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};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 uy extends Bu{constructor(){super(new vn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Or*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(n!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class dy extends fo{constructor(e,t,n=0,s=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Pt.DEFAULT_UP),this.updateMatrix(),this.target=new Pt,this.distance=n,this.angle=s,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new uy}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){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 SA=new et,po=new H,Tu=new H;class fy extends Bu{constructor(){super(new vn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ze(4,2),this._viewportCount=6,this._viewports=[new _t(2,1,1,1),new _t(0,1,1,1),new _t(3,1,1,1),new _t(1,1,1,1),new _t(3,0,1,1),new _t(1,0,1,1)],this._cubeDirections=[new H(1,0,0),new H(-1,0,0),new H(0,0,1),new H(0,0,-1),new H(0,1,0),new H(0,-1,0)],this._cubeUps=[new H(0,1,0),new H(0,1,0),new H(0,1,0),new H(0,1,0),new H(0,0,1),new H(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,s=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),po.setFromMatrixPosition(e.matrixWorld),n.position.copy(po),Tu.copy(n.position),Tu.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Tu),n.updateMatrixWorld(),s.makeTranslation(-po.x,-po.y,-po.z),SA.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(SA)}}class IA extends fo{constructor(e,t,n=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=s,this.shadow=new fy}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Ru extends Zp{constructor(e=-1,t=1,n=1,s=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=s,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,s,r,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=s+t,c=s-t;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,a=r+l*this.view.width,o-=h*this.view.offsetY,c=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class py extends Bu{constructor(){super(new Ru(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class MA extends fo{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Pt.DEFAULT_UP),this.updateMatrix(),this.target=new Pt,this.shadow=new py}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Ay extends fo{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class oa{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class gy extends Ji{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=ji.get(e);if(a!==void 0){if(r.manager.itemStart(e),a.then){a.then(l=>{t&&t(l),r.manager.itemEnd(e)}).catch(l=>{s&&s(l)});return}return setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const c=fetch(e,o).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){return ji.add(e,l),t&&t(l),r.manager.itemEnd(e),l}).catch(function(l){s&&s(l),ji.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});ji.add(e,c),r.manager.itemStart(e)}}class my extends vn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class by{constructor(e,t,n){this.binding=e,this.valueSize=n;let s,r,a;switch(t){case"quaternion":s=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":s=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:s=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,s=this.valueSize,r=e*s+s;let a=this.cumulativeWeight;if(a===0){for(let o=0;o!==s;++o)n[r+o]=n[o];a=t}else{a+=t;const o=t/a;this._mixBufferRegion(n,r,0,o,s)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,s=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,s,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,s=e*t+t,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const c=t*this._origIndex;this._mixBufferRegion(n,s,c,1-r,t)}a>0&&this._mixBufferRegionAdditive(n,s,this._addIndex*t,1,t);for(let c=t,l=t+t;c!==l;++c)if(n[c]!==n[c+t]){o.setValue(n,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,s=n*this._origIndex;e.getValue(t,s);for(let r=n,a=s;r!==a;++r)t[r]=t[s+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,s,r){if(s>=.5)for(let a=0;a!==r;++a)e[t+a]=e[n+a]}_slerp(e,t,n,s){Vn.slerpFlat(e,t,e,t,e,n,s)}_slerpAdditive(e,t,n,s,r){const a=this._workIndex*r;Vn.multiplyQuaternionsFlat(e,a,e,t,e,n),Vn.slerpFlat(e,t,e,t,e,a,s)}_lerp(e,t,n,s,r){const a=1-s;for(let o=0;o!==r;++o){const c=t+o;e[c]=e[c]*a+e[n+o]*s}}_lerpAdditive(e,t,n,s,r){for(let a=0;a!==r;++a){const o=t+a;e[o]=e[o]+e[n+a]*s}}}const Nu="\\[\\]\\.:\\/",xy=new RegExp("["+Nu+"]","g"),Fu="[^"+Nu+"]",Ey="[^"+Nu.replace("\\.","")+"]",_y=/((?:WC+[\/:])*)/.source.replace("WC",Fu),yy=/(WCOD+)?/.source.replace("WCOD",Ey),wy=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Fu),Cy=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Fu),vy=new RegExp("^"+_y+yy+wy+Cy+"$"),Sy=["material","materials","bones","map"];class Iy{constructor(e,t,n){const s=n||Ct.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=n.length;s!==r;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ct{constructor(e,t,n){this.path=t,this.parsedPath=n||Ct.parseTrackName(t),this.node=Ct.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ct.Composite(e,t,n):new Ct(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(xy,"")}static parseTrackName(e){const t=vy.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=n.nodeName.substring(s+1);Sy.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(r){for(let a=0;a<r.length;a++){const o=r[a];if(o.name===t||o.uuid===t)return o;const c=n(o.children);if(c)return c}return null},s=n(e.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)e[t++]=n[s]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,s=t.propertyName;let r=t.propertyIndex;if(e||(e=Ct.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let l=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===l){l=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}const a=e[s];if(a===void 0){const l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+s+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(r!==void 0){if(s==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}c=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else a.fromArray!==void 0&&a.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(c=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=s;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ct.Composite=Iy,Ct.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ct.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ct.prototype.GetterByBindingType=[Ct.prototype._getValue_direct,Ct.prototype._getValue_array,Ct.prototype._getValue_arrayElement,Ct.prototype._getValue_toArray],Ct.prototype.SetterByBindingTypeAndVersioning=[[Ct.prototype._setValue_direct,Ct.prototype._setValue_direct_setNeedsUpdate,Ct.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ct.prototype._setValue_array,Ct.prototype._setValue_array_setNeedsUpdate,Ct.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ct.prototype._setValue_arrayElement,Ct.prototype._setValue_arrayElement_setNeedsUpdate,Ct.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ct.prototype._setValue_fromArray,Ct.prototype._setValue_fromArray_setNeedsUpdate,Ct.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class My{constructor(e,t,n=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=s;const r=t.tracks,a=r.length,o=new Array(a),c={endingStart:Pr,endingEnd:Pr};for(let l=0;l!==a;++l){const h=r[l].createInterpolant(null);o[l]=h,h.settings=c}this._interpolantSettings=c,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ep,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const s=this._clip.duration,r=e._clip.duration,a=r/s,o=s/r;e.warp(1,a,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const s=this._mixer,r=s.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=s._lendControlInterpolant(),this._timeScaleInterpolant=o);const c=o.parameterPositions,l=o.sampleValues;return c[0]=r,c[1]=r+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const c=(e-r)*n;c<0||n===0?t=0:(this._startTime=null,t=n*c)}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case LE:for(let h=0,u=c.length;h!==u;++h)c[h].evaluate(a),l[h].accumulateAdditive(o);break;case Vh:default:for(let h=0,u=c.length;h!==u;++h)c[h].evaluate(a),l[h].accumulate(s,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let s=this.time+e,r=this._loopCount;const a=n===DE;if(e===0)return r===-1?s:a&&(r&1)===1?t-s:s;if(n===xp){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),s>=t||s<0){const o=Math.floor(s/t);s-=t*o,r+=Math.abs(o);const c=this.repetitions-r;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=s;if(a&&(r&1)===1)return t-s}return s}_setEndings(e,t,n){const s=this._interpolantSettings;n?(s.endingStart=kr,s.endingEnd=kr):(e?s.endingStart=this.zeroSlopeAtStart?kr:Pr:s.endingStart=pc,t?s.endingEnd=this.zeroSlopeAtEnd?kr:Pr:s.endingEnd=pc)}_scheduleFading(e,t,n){const s=this._mixer,r=s.time;let a=this._weightInterpolant;a===null&&(a=s._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,c=a.sampleValues;return o[0]=r,c[0]=t,o[1]=r+e,c[1]=n,this}}const By=new Float32Array(1);class BA extends bs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,s=e._clip.tracks,r=s.length,a=e._propertyBindings,o=e._interpolants,c=n.uuid,l=this._bindingsByRootAndName;let h=l[c];h===void 0&&(h={},l[c]=h);for(let u=0;u!==r;++u){const d=s[u],f=d.name;let m=h[f];if(m!==void 0)++m.referenceCount,a[u]=m;else{if(m=a[u],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,c,f));continue}const g=t&&t._propertyBindings[u].binding.parsedPath;m=new by(Ct.create(n,f,g),d.ValueTypeName,d.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,c,f),a[u]=m}o[u].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,n)}const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const r=t[n];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const r=t[n];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const s=this._actions,r=this._actionsByClip;let a=r[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{const o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=s.length,s.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],s=e._cacheIndex;n._cacheIndex=s,t[s]=n,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,a=this._actionsByClip,o=a[r],c=o.knownActions,l=c[c.length-1],h=e._byClipCacheIndex;l._byClipCacheIndex=h,c[h]=l,c.pop(),e._byClipCacheIndex=null;const u=o.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],c.length===0&&delete a[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const r=t[n];--r.referenceCount===0&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,s=this._nActiveActions++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,s=--this._nActiveActions,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){const s=this._bindingsByRootAndName,r=this._bindings;let a=s[t];a===void 0&&(a={},s[t]=a),a[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,s=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[s],c=t[t.length-1],l=e._cacheIndex;c._cacheIndex=l,t[l]=c,t.pop(),delete o[r],Object.keys(o).length===0&&delete a[s]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,s=this._nActiveBindings++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,s=--this._nActiveBindings,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new _A(new Float32Array(2),new Float32Array(2),1,By),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,s=--this._nActiveControlInterpolants,r=t[s];e.__cacheIndex=s,t[s]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){const s=t||this._root,r=s.uuid;let a=typeof e=="string"?Iu.findByName(s,e):e;const o=a!==null?a.uuid:e,c=this._actionsByClip[o];let l=null;if(n===void 0&&(a!==null?n=a.blendMode:n=Vh),c!==void 0){const u=c.actionByRoot[r];if(u!==void 0&&u.blendMode===n)return u;l=c.knownActions[0],a===null&&(a=l._clip)}if(a===null)return null;const h=new My(this,a,t,n);return this._bindAction(h,l),this._addInactiveAction(h,o,r),h}existingAction(e,t){const n=t||this._root,s=n.uuid,r=typeof e=="string"?Iu.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[s]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,s=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==n;++l)t[l]._update(s,e,r,a);const o=this._bindings,c=this._nActiveBindings;for(let l=0;l!==c;++l)o[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,s=this._actionsByClip,r=s[n];if(r!==void 0){const a=r.knownActions;for(let o=0,c=a.length;o!==c;++o){const l=a[o];this._deactivateAction(l);const h=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete s[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const a in n){const o=n[a].actionByRoot,c=o[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const s=this._bindingsByRootAndName,r=s[t];if(r!==void 0)for(const a in r){const o=r[a];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class TA{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=at(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}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(at(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Bs=new H,Xc=new et,Du=new et;class Ty extends Hc{constructor(e){const t=RA(e),n=new On,s=[],r=[],a=new qe(0,0,1),o=new qe(0,1,0);for(let l=0;l<t.length;l++){const h=t[l];h.parent&&h.parent.isBone&&(s.push(0,0,0),s.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new Bn(s,3)),n.setAttribute("color",new Bn(r,3));const c=new co({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,c),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,s=n.getAttribute("position");Du.copy(this.root.matrixWorld).invert();for(let r=0,a=0;r<t.length;r++){const o=t[r];o.parent&&o.parent.isBone&&(Xc.multiplyMatrices(Du,o.matrixWorld),Bs.setFromMatrixPosition(Xc),s.setXYZ(a,Bs.x,Bs.y,Bs.z),Xc.multiplyMatrices(Du,o.parent.matrixWorld),Bs.setFromMatrixPosition(Xc),s.setXYZ(a+1,Bs.x,Bs.y,Bs.z),a+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function RA(i){const e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push(...RA(i.children[t]));return e}class Ry extends Hc{constructor(e=10,t=10,n=4473924,s=8947848){n=new qe(n),s=new qe(s);const r=t/2,a=e/t,o=e/2,c=[],l=[];for(let d=0,f=0,m=-o;d<=t;d++,m+=a){c.push(-o,0,m,o,0,m),c.push(m,0,-o,m,0,o);const g=d===r?n:s;g.toArray(l,f),f+=3,g.toArray(l,f),f+=3,g.toArray(l,f),f+=3,g.toArray(l,f),f+=3}const h=new On;h.setAttribute("position",new Bn(c,3)),h.setAttribute("color",new Bn(l,3));const u=new co({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class NA extends Hc{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new On;s.setAttribute("position",new Bn(t,3)),s.setAttribute("color",new Bn(n,3));const r=new co({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,n){const s=new qe,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(n),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Ny extends bs{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function FA(i,e,t,n){const s=Fy(n);switch(t){case gp:return i*e;case Gi:return i*e/s.components*s.byteLength;case yh:return i*e/s.components*s.byteLength;case Ys:return i*e*2/s.components*s.byteLength;case wh:return i*e*2/s.components*s.byteLength;case mp:return i*e*3/s.components*s.byteLength;case sn:return i*e*4/s.components*s.byteLength;case Ch:return i*e*4/s.components*s.byteLength;case ac:case Wa:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case oc:case qa:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case vh:case Sh:return Math.max(i,16)*Math.max(e,8)/4;case cc:case lc:return Math.max(i,8)*Math.max(e,8)/2;case hc:case uc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case dc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Ka:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Ih:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case Mh:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Bh:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case Xa:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case Th:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Rh:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case Nh:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case Fh:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case Dh:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case Lh:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case Ph:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case kh:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case Uh:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case Ya:case Oh:case fc:return Math.ceil(i/4)*Math.ceil(e/4)*16;case bp:case Qh:return Math.ceil(i/4)*Math.ceil(e/4)*8;case Gh:case Hh:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Fy(i){switch(i){case tn:case fp:return{byteLength:1,components:1};case Ga:case pp:case Mn:return{byteLength:2,components:1};case Eh:case _h:return{byteLength:2,components:4};case Xs:case xh:case nn:return{byteLength:4,components:1};case Ap:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"176"}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="176");function DA(){let i=null,e=!1,t=null,n=null;function s(r,a){t(r,a),n=i.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){i=r}}}function Dy(i){const e=new WeakMap;function t(o,c){const l=o.array,h=o.usage,u=l.byteLength,d=i.createBuffer();i.bindBuffer(c,d),i.bufferData(c,l,h),o.onUploadCallback();let f;if(l instanceof Float32Array)f=i.FLOAT;else if(l instanceof Uint16Array)o.isFloat16BufferAttribute?f=i.HALF_FLOAT:f=i.UNSIGNED_SHORT;else if(l instanceof Int16Array)f=i.SHORT;else if(l instanceof Uint32Array)f=i.UNSIGNED_INT;else if(l instanceof Int32Array)f=i.INT;else if(l instanceof Int8Array)f=i.BYTE;else if(l instanceof Uint8Array)f=i.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)f=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:d,type:f,bytesPerElement:l.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,c,l){const h=c.array,u=c.updateRanges;if(i.bindBuffer(l,o),u.length===0)i.bufferSubData(l,0,h);else{u.sort((f,m)=>f.start-m.start);let d=0;for(let f=1;f<u.length;f++){const m=u[d],g=u[f];g.start<=m.start+m.count+1?m.count=Math.max(m.count,g.start+g.count-m.start):(++d,u[d]=g)}u.length=d+1;for(let f=0,m=u.length;f<m;f++){const g=u[f];i.bufferSubData(l,g.start*h.BYTES_PER_ELEMENT,h,g.start,g.count)}c.clearUpdateRanges()}c.onUploadCallback()}function s(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const c=e.get(o);c&&(i.deleteBuffer(c.buffer),e.delete(o))}function a(o,c){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const l=e.get(o);if(l===void 0)e.set(o,t(o,c));else if(l.version<o.version){if(l.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(l.buffer,o,c),l.version=o.version}}return{get:s,remove:r,update:a}}var Ly=`#ifdef USE_ALPHAHASH+ `},s=new $r(5,5,5),r=new Ss({name:"CubemapFromEquirect",uniforms:ea(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Sn,blending:ms});r.uniforms.tEquirect.value=t;const a=new Jt(s,r),o=t.minFilter;return t.minFilter===Jn&&(t.minFilter=zt),new V_(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,s);e.setRenderTarget(r)}}class nr extends Pt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const q_={type:"move"};class Eu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new nr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new nr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new nr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let s=null,r=null,a=null;const o=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){a=!0;for(const g of e.hand.values()){const A=t.getJointPose(g,n),p=this._getHandJoint(l,g);A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=A.radius),p.visible=A!==null}const h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;l.inputState.pinching&&d>f+m?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=f-m&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(q_)))}return o!==null&&(o.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new nr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class _u extends Pt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ti,this.environmentIntensity=1,this.environmentRotation=new Ti,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);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 K_{constructor(e,t){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=li()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,r=this.stride;s<r;s++)this.array[e+s]=t.array[n+s];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=li()),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}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=li()),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,stride:this.stride}}}const Rn=new H;class yu{constructor(e,t,n,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Rn.fromBufferAttribute(this,t),Rn.applyMatrix4(e),this.setXYZ(t,Rn.x,Rn.y,Rn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Rn.fromBufferAttribute(this,t),Rn.applyNormalMatrix(e),this.setXYZ(t,Rn.x,Rn.y,Rn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Rn.fromBufferAttribute(this,t),Rn.transformDirection(e),this.setXYZ(t,Rn.x,Rn.y,Rn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=hi(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=hi(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=hi(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=hi(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=hi(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=It(t,this.array),n=It(n,this.array),s=It(s,this.array),r=It(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return new En(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 yu(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const cA=new H,lA=new _t,hA=new _t,j_=new H,uA=new et,Oc=new H,wu=new Bi,dA=new et,vu=new oo;class X_ extends Jt{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=gp,this.bindMatrix=new et,this.bindMatrixInverse=new et,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Mi),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Oc),this.boundingBox.expandByPoint(Oc)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Bi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Oc),this.boundingSphere.expandByPoint(Oc)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,s=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),wu.copy(this.boundingSphere),wu.applyMatrix4(s),e.ray.intersectsSphere(wu)!==!1&&(dA.copy(s).invert(),vu.copy(e.ray).applyMatrix4(dA),!(this.boundingBox!==null&&vu.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,vu)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new _t,t=this.geometry.attributes.skinWeight;for(let n=0,s=t.count;n<s;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===gp?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===GE?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,s=this.geometry;lA.fromBufferAttribute(s.attributes.skinIndex,e),hA.fromBufferAttribute(s.attributes.skinWeight,e),cA.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=hA.getComponent(r);if(a!==0){const o=lA.getComponent(r);uA.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(j_.copy(cA).applyMatrix4(uA),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class fA extends Pt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Qc extends an{constructor(e=null,t=1,n=1,s,r,a,o,c,l=In,h=In,u,d){super(null,a,o,c,l,h,s,r,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const pA=new et,Y_=new et;class Cu{constructor(e=[],t=[]){this.uuid=li(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,s=this.bones.length;n<s;n++)this.boneInverses.push(new et)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new et;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,s=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:Y_;pA.multiplyMatrices(o,t[r]),pA.toArray(n,r*16)}s!==null&&(s.needsUpdate=!0)}clone(){return new Cu(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);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 Qc(t,e,e,sn,nn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const s=this.bones[t];if(s.name===e)return s}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,s=e.bones.length;n<s;n++){const r=e.bones[n];let a=t[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new fA),this.bones.push(a),this.boneInverses.push(new et().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let s=0,r=t.length;s<r;s++){const a=t[s];e.bones.push(a.uuid);const o=n[s];e.boneInverses.push(o.toArray())}return e}}class Su extends En{constructor(e,t,n,s=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const ia=new et,AA=new et,Gc=[],gA=new Mi,J_=new et,ho=new Jt,uo=new Bi;class mA extends Jt{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Su(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s<n;s++)this.setMatrixAt(s,J_)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Mi),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ia),gA.copy(e.boundingBox).applyMatrix4(ia),this.boundingBox.union(gA)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Bi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ia),uo.copy(e.boundingSphere).applyMatrix4(ia),this.boundingSphere.union(uo)}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}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,s=this.morphTexture.source.data.data,r=n.length+1,a=e*r+1;for(let o=0;o<n.length;o++)n[o]=s[a+o]}raycast(e,t){const n=this.matrixWorld,s=this.count;if(ho.geometry=this.geometry,ho.material=this.material,ho.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),uo.copy(this.boundingSphere),uo.applyMatrix4(n),e.ray.intersectsSphere(uo)!==!1))for(let r=0;r<s;r++){this.getMatrixAt(r,ia),AA.multiplyMatrices(n,ia),ho.matrixWorld=AA,ho.raycast(e,Gc);for(let a=0,o=Gc.length;a<o;a++){const c=Gc[a];c.instanceId=r,c.object=this,t.push(c)}Gc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Su(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,s=n.length+1;this.morphTexture===null&&(this.morphTexture=new Qc(new Float32Array(s*this.count),s,this.count,Hi,nn));const r=this.morphTexture.source.data.data;let a=0;for(let l=0;l<n.length;l++)a+=n[l];const o=this.geometry.morphTargetsRelative?1:1-a,c=s*e;r[c]=o,r.set(n,c+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Iu=new H,Z_=new H,$_=new rt;class Ms{constructor(e=new H(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,s){return this.normal.set(e,t,n),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const s=Iu.subVectors(n,t).cross(Z_.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Iu),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||$_.getNormalMatrix(e),s=this.coplanarPoint(Iu).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ir=new Bi,Hc=new H;class Mu{constructor(e=new Ms,t=new Ms,n=new Ms,s=new Ms,r=new Ms,a=new Ms){this.planes=[e,t,n,s,r,a]}set(e,t,n,s,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=zi){const n=this.planes,s=e.elements,r=s[0],a=s[1],o=s[2],c=s[3],l=s[4],h=s[5],u=s[6],d=s[7],f=s[8],m=s[9],g=s[10],A=s[11],p=s[12],y=s[13],b=s[14],_=s[15];if(n[0].setComponents(c-r,d-l,A-f,_-p).normalize(),n[1].setComponents(c+r,d+l,A+f,_+p).normalize(),n[2].setComponents(c+a,d+h,A+m,_+y).normalize(),n[3].setComponents(c-a,d-h,A-m,_-y).normalize(),n[4].setComponents(c-o,d-u,A-g,_-b).normalize(),t===zi)n[5].setComponents(c+o,d+u,A+g,_+b).normalize();else if(t===_c)n[5].setComponents(o,u,g,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ir.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ir.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ir)}intersectsSprite(e){return ir.center.set(0,0,0),ir.radius=.7071067811865476,ir.applyMatrix4(e.matrixWorld),this.intersectsSphere(ir)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<s)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const s=t[n];if(Hc.x=s.normal.x>0?e.max.x:e.min.x,Hc.y=s.normal.y>0?e.max.y:e.min.y,Hc.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Hc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class fo extends Ri{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new qe(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 zc=new H,Vc=new H,bA=new et,po=new oo,Wc=new Bi,Bu=new H,xA=new H;class Tu extends Pt{constructor(e=new On,t=new fo){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){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let s=1,r=t.count;s<r;s++)zc.fromBufferAttribute(t,s-1),Vc.fromBufferAttribute(t,s),n[s]=n[s-1],n[s]+=zc.distanceTo(Vc);e.setAttribute("lineDistance",new Bn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Wc.copy(n.boundingSphere),Wc.applyMatrix4(s),Wc.radius+=r,e.ray.intersectsSphere(Wc)===!1)return;bA.copy(s).invert(),po.copy(e.ray).applyMatrix4(bA);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,l=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let g=f,A=m-1;g<A;g+=l){const p=h.getX(g),y=h.getX(g+1),b=qc(this,e,po,c,p,y,g);b&&t.push(b)}if(this.isLineLoop){const g=h.getX(m-1),A=h.getX(f),p=qc(this,e,po,c,g,A,m-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let g=f,A=m-1;g<A;g+=l){const p=qc(this,e,po,c,g,g+1,g);p&&t.push(p)}if(this.isLineLoop){const g=qc(this,e,po,c,m-1,f,m-1);g&&t.push(g)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function qc(i,e,t,n,s,r,a){const o=i.geometry.attributes.position;if(zc.fromBufferAttribute(o,s),Vc.fromBufferAttribute(o,r),t.distanceSqToSegment(zc,Vc,Bu,xA)>n)return;Bu.applyMatrix4(i.matrixWorld);const l=e.ray.origin.distanceTo(Bu);if(!(l<e.near||l>e.far))return{distance:l,point:xA.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}const EA=new H,_A=new H;class Kc extends Tu{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let s=0,r=t.count;s<r;s+=2)EA.fromBufferAttribute(t,s),_A.fromBufferAttribute(t,s+1),n[s]=s===0?0:n[s-1],n[s+1]=n[s]+EA.distanceTo(_A);e.setAttribute("lineDistance",new Bn(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ey extends Tu{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Ru extends Ri{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new qe(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 yA=new et,Nu=new oo,jc=new Bi,Xc=new H;class ty extends Pt{constructor(e=new On,t=new Ru){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),jc.copy(n.boundingSphere),jc.applyMatrix4(s),jc.radius+=r,e.ray.intersectsSphere(jc)===!1)return;yA.copy(s).invert(),Nu.copy(e.ray).applyMatrix4(yA);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,l=n.index,u=n.attributes.position;if(l!==null){const d=Math.max(0,a.start),f=Math.min(l.count,a.start+a.count);for(let m=d,g=f;m<g;m++){const A=l.getX(m);Xc.fromBufferAttribute(u,A),wA(Xc,A,c,s,e,t,this)}}else{const d=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let m=d,g=f;m<g;m++)Xc.fromBufferAttribute(u,m),wA(Xc,m,c,s,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function wA(i,e,t,n,s,r,a){const o=Nu.distanceSqToPoint(i);if(o<t){const c=new H;Nu.closestPointToPoint(i,c),c.applyMatrix4(n);const l=s.ray.origin.distanceTo(c);if(l<s.near||l>s.far)return;r.push({distance:l,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Yc extends an{constructor(e,t,n,s,r,a,o,c,l,h,u,d){super(null,a,o,c,l,h,s,r,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class ny extends Yc{constructor(e,t,n,s,r,a){super(e,t,n,r,a),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=oi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class iy extends Yc{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Xs),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class vA extends an{constructor(e,t,n=Ys,s,r,a,o=In,c=In,l,h=Ka){if(h!==Ka&&h!==ja)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,r,a,o,c,h,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new tu(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Jc extends On{constructor(e=1,t=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:s};const r=e/2,a=t/2,o=Math.floor(n),c=Math.floor(s),l=o+1,h=c+1,u=e/o,d=t/c,f=[],m=[],g=[],A=[];for(let p=0;p<h;p++){const y=p*d-a;for(let b=0;b<l;b++){const _=b*u-r;m.push(_,-y,0),g.push(0,0,1),A.push(b/o),A.push(1-p/c)}}for(let p=0;p<c;p++)for(let y=0;y<o;y++){const b=y+l*p,_=y+l*(p+1),M=y+1+l*(p+1),w=y+1+l*p;f.push(b,_,w),f.push(_,M,w)}this.setIndex(f),this.setAttribute("position",new Bn(m,3)),this.setAttribute("normal",new Bn(g,3)),this.setAttribute("uv",new Bn(A,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jc(e.width,e.height,e.widthSegments,e.heightSegments)}}class Ao extends Ri{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new qe(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 qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mp,this.normalScale=new Ze(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 Ti,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 Ni extends Ao{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ze(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return at(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new qe(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 qe(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new qe(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)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class sy extends Ri{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=WE,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class ry extends Ri{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Zc(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function ay(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function oy(i){function e(s,r){return i[s]-i[r]}const t=i.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function CA(i,e,t){const n=i.length,s=new i.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let c=0;c!==e;++c)s[a++]=i[o+c]}return s}function SA(i,e,t,n){let s=1,r=i[0];for(;r!==void 0&&r[n]===void 0;)r=i[s++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=i[s++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=i[s++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=i[s++];while(r!==void 0)}class go{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,s=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<s)){for(let o=n+2;;){if(s===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=s,s=t[++n],e<s)break t}a=t.length;break n}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let c=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(s=r,r=t[--n-1],e>=r)break t}a=n,n=0;break n}break e}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(s=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,s)}return this.interpolate_(n,r,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s;for(let a=0;a!==s;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class cy extends go{constructor(e,t,n,s){super(e,t,n,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ur,endingEnd:Ur}}intervalChanged_(e,t,n){const s=this.parameterPositions;let r=e-2,a=e+1,o=s[r],c=s[a];if(o===void 0)switch(this.getSettings_().endingStart){case Or:r=e,o=2*t-n;break;case xc:r=s.length-2,o=t+s[r]-s[r+1];break;default:r=e,o=n}if(c===void 0)switch(this.getSettings_().endingEnd){case Or:a=e,c=2*n-t;break;case xc:a=1,c=n+s[1]-s[0];break;default:a=e-1,c=t}const l=(n-t)*.5,h=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(c-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,m=(n-t)/(s-t),g=m*m,A=g*m,p=-d*A+2*d*g-d*m,y=(1+d)*A+(-1.5-2*d)*g+(-.5+d)*m+1,b=(-1-f)*A+(1.5+f)*g+.5*m,_=f*A-f*g;for(let M=0;M!==o;++M)r[M]=p*a[h+M]+y*a[l+M]+b*a[c+M]+_*a[u+M];return r}}class IA extends go{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=(n-t)/(s-t),u=1-h;for(let d=0;d!==o;++d)r[d]=a[l+d]*u+a[c+d]*h;return r}}class ly extends go{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ai{constructor(e,t,n,s){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Zc(t,this.TimeBufferType),this.values=Zc(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Zc(e.times,Array),values:Zc(e.values,Array)};const s=e.getInterpolation();s!==e.DefaultInterpolation&&(n.interpolation=s)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new ly(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new IA(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new cy(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case eo:t=this.InterpolantFactoryMethodDiscrete;break;case to:t=this.InterpolantFactoryMethodLinear;break;case Xh:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return eo;case this.InterpolantFactoryMethodLinear:return to;case this.InterpolantFactoryMethodSmooth:return Xh}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]*=e}return this}trim(e,t){const n=this.times,s=n.length;let r=0,a=s-1;for(;r!==s&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(a!==null&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,a),e=!1;break}a=c}if(s!==void 0&&ay(s))for(let o=0,c=s.length;o!==c;++o){const l=s[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===Xh,r=e.length-1;let a=1;for(let o=1;o<r;++o){let c=!1;const l=e[o],h=e[o+1];if(l!==h&&(o!==1||l!==e[0]))if(s)c=!0;else{const u=o*n,d=u-n,f=u+n;for(let m=0;m!==n;++m){const g=t[u+m];if(g!==t[d+m]||g!==t[f+m]){c=!0;break}}}if(c){if(o!==a){e[a]=e[o];const u=o*n,d=a*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,c=a*n,l=0;l!==n;++l)t[c+l]=t[o+l];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Ai.prototype.ValueTypeName="",Ai.prototype.TimeBufferType=Float32Array,Ai.prototype.ValueBufferType=Float32Array,Ai.prototype.DefaultInterpolation=to;class sa extends Ai{constructor(e,t,n){super(e,t,n)}}sa.prototype.ValueTypeName="bool",sa.prototype.ValueBufferType=Array,sa.prototype.DefaultInterpolation=eo,sa.prototype.InterpolantFactoryMethodLinear=void 0,sa.prototype.InterpolantFactoryMethodSmooth=void 0;class MA extends Ai{constructor(e,t,n,s){super(e,t,n,s)}}MA.prototype.ValueTypeName="color";class ra extends Ai{constructor(e,t,n,s){super(e,t,n,s)}}ra.prototype.ValueTypeName="number";class hy extends go{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-t)/(s-t);let l=e*o;for(let h=l+o;l!==h;l+=4)Vn.slerpFlat(r,0,a,l-o,a,l,c);return r}}class aa extends Ai{constructor(e,t,n,s){super(e,t,n,s)}InterpolantFactoryMethodLinear(e){return new hy(this.times,this.values,this.getValueSize(),e)}}aa.prototype.ValueTypeName="quaternion",aa.prototype.InterpolantFactoryMethodSmooth=void 0;class oa extends Ai{constructor(e,t,n){super(e,t,n)}}oa.prototype.ValueTypeName="string",oa.prototype.ValueBufferType=Array,oa.prototype.DefaultInterpolation=eo,oa.prototype.InterpolantFactoryMethodLinear=void 0,oa.prototype.InterpolantFactoryMethodSmooth=void 0;class ca extends Ai{constructor(e,t,n,s){super(e,t,n,s)}}ca.prototype.ValueTypeName="vector";class Fu{constructor(e="",t=-1,n=[],s=Yh){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=li(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,s=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(dy(n[a]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=n.length;r!==a;++r)t.push(Ai.toJSON(n[r]));return s}static CreateFromMorphTargetSequence(e,t,n,s){const r=t.length,a=[];for(let o=0;o<r;o++){let c=[],l=[];c.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);const h=oy(c);c=CA(c,1,h),l=CA(l,1,h),!s&&c[0]===0&&(c.push(r),l.push(l[0])),a.push(new ra(".morphTargetInfluences["+t[o].name+"]",c,l).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const s=e;n=s.geometry&&s.geometry.animations||s.animations}for(let s=0;s<n.length;s++)if(n[s].name===t)return n[s];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const s={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,c=e.length;o<c;o++){const l=e[o],h=l.name.match(r);if(h&&h.length>1){const u=h[1];let d=s[u];d||(s[u]=d=[]),d.push(l)}}const a=[];for(const o in s)a.push(this.CreateFromMorphTargetSequence(o,s[o],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,m,g){if(f.length!==0){const A=[],p=[];SA(f,A,p,m),A.length!==0&&g.push(new u(d,A,p))}},s=[],r=e.name||"default",a=e.fps||30,o=e.blendMode;let c=e.length||-1;const l=e.hierarchy||[];for(let u=0;u<l.length;u++){const d=l[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let g=0;g<d[m].morphTargets.length;g++)f[d[m].morphTargets[g]]=-1;for(const g in f){const A=[],p=[];for(let y=0;y!==d[m].morphTargets.length;++y){const b=d[m];A.push(b.time),p.push(b.morphTarget===g?1:0)}s.push(new ra(".morphTargetInfluence["+g+"]",A,p))}c=f.length*a}else{const f=".bones["+t[u].name+"]";n(ca,f+".position",d,"pos",s),n(aa,f+".quaternion",d,"rot",s),n(ca,f+".scale",d,"scl",s)}}return s.length===0?null:new this(r,c,s,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,s=e.length;n!==s;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function uy(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ra;case"vector":case"vector2":case"vector3":case"vector4":return ca;case"color":return MA;case"quaternion":return aa;case"bool":case"boolean":return sa;case"string":return oa}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function dy(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=uy(i.type);if(i.times===void 0){const t=[],n=[];SA(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const Ji={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class BA{constructor(e,t,n){const s=this;let r=!1,a=0,o=0,c;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,r===!1&&s.onStart!==void 0&&s.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,s.onProgress!==void 0&&s.onProgress(h,a,o),a===o&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(h){s.onError!==void 0&&s.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,u){return l.push(h,u),this},this.removeHandler=function(h){const u=l.indexOf(h);return u!==-1&&l.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=l.length;u<d;u+=2){const f=l[u],m=l[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const fy=new BA;class Zi{constructor(e){this.manager=e!==void 0?e:fy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(s,r){n.load(e,s,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Zi.DEFAULT_MATERIAL_NAME="__DEFAULT";const $i={};class py extends Error{constructor(e,t){super(e),this.response=t}}class Bs extends Zi{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=Ji.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if($i[e]!==void 0){$i[e].push({onLoad:t,onProgress:n,onError:s});return}$i[e]=[],$i[e].push({onLoad:t,onProgress:n,onError:s});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,c=this.responseType;fetch(a).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const h=$i[e],u=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0;let g=0;const A=new ReadableStream({start(p){y();function y(){u.read().then(({done:b,value:_})=>{if(b)p.close();else{g+=_.byteLength;const M=new ProgressEvent("progress",{lengthComputable:m,loaded:g,total:f});for(let w=0,S=h.length;w<S;w++){const T=h[w];T.onProgress&&T.onProgress(M)}p.enqueue(_),y()}},b=>{p.error(b)})}}});return new Response(A)}else throw new py(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(c){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return l.json();default:if(o==="")return l.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return l.arrayBuffer().then(m=>f.decode(m))}}}).then(l=>{Ji.add(e,l);const h=$i[e];delete $i[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(l)}}).catch(l=>{const h=$i[e];if(h===void 0)throw this.manager.itemError(e),l;delete $i[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onError&&f.onError(l)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Ay extends Zi{constructor(e){super(e)}load(e,t,n,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Ji.get(e);if(a!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;const o=so("img");function c(){h(),Ji.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(u){h(),s&&s(u),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",c,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",c,!1),o.addEventListener("error",l,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class gy extends Zi{constructor(e){super(e)}load(e,t,n,s){const r=this,a=new Qc,o=new Bs(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(c){let l;try{l=r.parse(c)}catch(h){if(s!==void 0)s(h);else{console.error(h);return}}l.image!==void 0?a.image=l.image:l.data!==void 0&&(a.image.width=l.width,a.image.height=l.height,a.image.data=l.data),a.wrapS=l.wrapS!==void 0?l.wrapS:oi,a.wrapT=l.wrapT!==void 0?l.wrapT:oi,a.magFilter=l.magFilter!==void 0?l.magFilter:zt,a.minFilter=l.minFilter!==void 0?l.minFilter:zt,a.anisotropy=l.anisotropy!==void 0?l.anisotropy:1,l.colorSpace!==void 0&&(a.colorSpace=l.colorSpace),l.flipY!==void 0&&(a.flipY=l.flipY),l.format!==void 0&&(a.format=l.format),l.type!==void 0&&(a.type=l.type),l.mipmaps!==void 0&&(a.mipmaps=l.mipmaps,a.minFilter=Jn),l.mipmapCount===1&&(a.minFilter=zt),l.generateMipmaps!==void 0&&(a.generateMipmaps=l.generateMipmaps),a.needsUpdate=!0,t&&t(a,l)},n,s),a}}class my extends Zi{constructor(e){super(e)}load(e,t,n,s){const r=new an,a=new Ay(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,s),r}}class mo extends Pt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new qe(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class by extends mo{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Pt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new qe(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Du=new et,TA=new H,RA=new H;class Lu{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ze(512,512),this.mapType=tn,this.map=null,this.mapPass=null,this.matrix=new et,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Mu,this._frameExtents=new Ze(1,1),this._viewportCount=1,this._viewports=[new _t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;TA.setFromMatrixPosition(e.matrixWorld),t.position.copy(TA),RA.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(RA),t.updateMatrixWorld(),Du.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Du),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Du)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};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 xy extends Lu{constructor(){super(new Cn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Gr*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(n!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Ey extends mo{constructor(e,t,n=0,s=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Pt.DEFAULT_UP),this.updateMatrix(),this.target=new Pt,this.distance=n,this.angle=s,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new xy}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){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 NA=new et,bo=new H,Pu=new H;class _y extends Lu{constructor(){super(new Cn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ze(4,2),this._viewportCount=6,this._viewports=[new _t(2,1,1,1),new _t(0,1,1,1),new _t(3,1,1,1),new _t(1,1,1,1),new _t(3,0,1,1),new _t(1,0,1,1)],this._cubeDirections=[new H(1,0,0),new H(-1,0,0),new H(0,0,1),new H(0,0,-1),new H(0,1,0),new H(0,-1,0)],this._cubeUps=[new H(0,1,0),new H(0,1,0),new H(0,1,0),new H(0,1,0),new H(0,0,1),new H(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,s=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),bo.setFromMatrixPosition(e.matrixWorld),n.position.copy(bo),Pu.copy(n.position),Pu.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Pu),n.updateMatrixWorld(),s.makeTranslation(-bo.x,-bo.y,-bo.z),NA.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(NA)}}class FA extends mo{constructor(e,t,n=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=s,this.shadow=new _y}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class ku extends sA{constructor(e=-1,t=1,n=1,s=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=s,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,s,r,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=s+t,c=s-t;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,a=r+l*this.view.width,o-=h*this.view.offsetY,c=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class yy extends Lu{constructor(){super(new ku(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DA extends mo{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Pt.DEFAULT_UP),this.updateMatrix(),this.target=new Pt,this.shadow=new yy}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class wy extends mo{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class la{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class vy extends Zi{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Ji.get(e);if(a!==void 0){if(r.manager.itemStart(e),a.then){a.then(l=>{t&&t(l),r.manager.itemEnd(e)}).catch(l=>{s&&s(l)});return}return setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const c=fetch(e,o).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){return Ji.add(e,l),t&&t(l),r.manager.itemEnd(e),l}).catch(function(l){s&&s(l),Ji.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Ji.add(e,c),r.manager.itemStart(e)}}class Cy extends Cn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Sy{constructor(e,t,n){this.binding=e,this.valueSize=n;let s,r,a;switch(t){case"quaternion":s=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":s=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:s=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,s=this.valueSize,r=e*s+s;let a=this.cumulativeWeight;if(a===0){for(let o=0;o!==s;++o)n[r+o]=n[o];a=t}else{a+=t;const o=t/a;this._mixBufferRegion(n,r,0,o,s)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,s=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,s,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,s=e*t+t,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const c=t*this._origIndex;this._mixBufferRegion(n,s,c,1-r,t)}a>0&&this._mixBufferRegionAdditive(n,s,this._addIndex*t,1,t);for(let c=t,l=t+t;c!==l;++c)if(n[c]!==n[c+t]){o.setValue(n,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,s=n*this._origIndex;e.getValue(t,s);for(let r=n,a=s;r!==a;++r)t[r]=t[s+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,s,r){if(s>=.5)for(let a=0;a!==r;++a)e[t+a]=e[n+a]}_slerp(e,t,n,s){Vn.slerpFlat(e,t,e,t,e,n,s)}_slerpAdditive(e,t,n,s,r){const a=this._workIndex*r;Vn.multiplyQuaternionsFlat(e,a,e,t,e,n),Vn.slerpFlat(e,t,e,t,e,a,s)}_lerp(e,t,n,s,r){const a=1-s;for(let o=0;o!==r;++o){const c=t+o;e[c]=e[c]*a+e[n+o]*s}}_lerpAdditive(e,t,n,s,r){for(let a=0;a!==r;++a){const o=t+a;e[o]=e[o]+e[n+a]*s}}}const Uu="\\[\\]\\.:\\/",Iy=new RegExp("["+Uu+"]","g"),Ou="[^"+Uu+"]",My="[^"+Uu.replace("\\.","")+"]",By=/((?:WC+[\/:])*)/.source.replace("WC",Ou),Ty=/(WCOD+)?/.source.replace("WCOD",My),Ry=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ou),Ny=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ou),Fy=new RegExp("^"+By+Ty+Ry+Ny+"$"),Dy=["material","materials","bones","map"];class Ly{constructor(e,t,n){const s=n||vt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=n.length;s!==r;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class vt{constructor(e,t,n){this.path=t,this.parsedPath=n||vt.parseTrackName(t),this.node=vt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new vt.Composite(e,t,n):new vt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Iy,"")}static parseTrackName(e){const t=Fy.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=n.nodeName.substring(s+1);Dy.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(r){for(let a=0;a<r.length;a++){const o=r[a];if(o.name===t||o.uuid===t)return o;const c=n(o.children);if(c)return c}return null},s=n(e.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)e[t++]=n[s]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,s=t.propertyName;let r=t.propertyIndex;if(e||(e=vt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let l=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===l){l=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}const a=e[s];if(a===void 0){const l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+s+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(r!==void 0){if(s==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}c=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else a.fromArray!==void 0&&a.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(c=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=s;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}vt.Composite=Ly,vt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},vt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},vt.prototype.GetterByBindingType=[vt.prototype._getValue_direct,vt.prototype._getValue_array,vt.prototype._getValue_arrayElement,vt.prototype._getValue_toArray],vt.prototype.SetterByBindingTypeAndVersioning=[[vt.prototype._setValue_direct,vt.prototype._setValue_direct_setNeedsUpdate,vt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_array,vt.prototype._setValue_array_setNeedsUpdate,vt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_arrayElement,vt.prototype._setValue_arrayElement_setNeedsUpdate,vt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_fromArray,vt.prototype._setValue_fromArray_setNeedsUpdate,vt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Py{constructor(e,t,n=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=s;const r=t.tracks,a=r.length,o=new Array(a),c={endingStart:Ur,endingEnd:Ur};for(let l=0;l!==a;++l){const h=r[l].createInterpolant(null);o[l]=h,h.settings=c}this._interpolantSettings=c,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Sp,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const s=this._clip.duration,r=e._clip.duration,a=r/s,o=s/r;e.warp(1,a,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const s=this._mixer,r=s.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=s._lendControlInterpolant(),this._timeScaleInterpolant=o);const c=o.parameterPositions,l=o.sampleValues;return c[0]=r,c[1]=r+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const c=(e-r)*n;c<0||n===0?t=0:(this._startTime=null,t=n*c)}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case zE:for(let h=0,u=c.length;h!==u;++h)c[h].evaluate(a),l[h].accumulateAdditive(o);break;case Yh:default:for(let h=0,u=c.length;h!==u;++h)c[h].evaluate(a),l[h].accumulate(s,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let s=this.time+e,r=this._loopCount;const a=n===HE;if(e===0)return r===-1?s:a&&(r&1)===1?t-s:s;if(n===Cp){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),s>=t||s<0){const o=Math.floor(s/t);s-=t*o,r+=Math.abs(o);const c=this.repetitions-r;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=s;if(a&&(r&1)===1)return t-s}return s}_setEndings(e,t,n){const s=this._interpolantSettings;n?(s.endingStart=Or,s.endingEnd=Or):(e?s.endingStart=this.zeroSlopeAtStart?Or:Ur:s.endingStart=xc,t?s.endingEnd=this.zeroSlopeAtEnd?Or:Ur:s.endingEnd=xc)}_scheduleFading(e,t,n){const s=this._mixer,r=s.time;let a=this._weightInterpolant;a===null&&(a=s._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,c=a.sampleValues;return o[0]=r,c[0]=t,o[1]=r+e,c[1]=n,this}}const ky=new Float32Array(1);class LA extends xs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,s=e._clip.tracks,r=s.length,a=e._propertyBindings,o=e._interpolants,c=n.uuid,l=this._bindingsByRootAndName;let h=l[c];h===void 0&&(h={},l[c]=h);for(let u=0;u!==r;++u){const d=s[u],f=d.name;let m=h[f];if(m!==void 0)++m.referenceCount,a[u]=m;else{if(m=a[u],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,c,f));continue}const g=t&&t._propertyBindings[u].binding.parsedPath;m=new Sy(vt.create(n,f,g),d.ValueTypeName,d.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,c,f),a[u]=m}o[u].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,n)}const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const r=t[n];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const r=t[n];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const s=this._actions,r=this._actionsByClip;let a=r[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{const o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=s.length,s.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],s=e._cacheIndex;n._cacheIndex=s,t[s]=n,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,a=this._actionsByClip,o=a[r],c=o.knownActions,l=c[c.length-1],h=e._byClipCacheIndex;l._byClipCacheIndex=h,c[h]=l,c.pop(),e._byClipCacheIndex=null;const u=o.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],c.length===0&&delete a[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const r=t[n];--r.referenceCount===0&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,s=this._nActiveActions++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,s=--this._nActiveActions,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){const s=this._bindingsByRootAndName,r=this._bindings;let a=s[t];a===void 0&&(a={},s[t]=a),a[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,s=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[s],c=t[t.length-1],l=e._cacheIndex;c._cacheIndex=l,t[l]=c,t.pop(),delete o[r],Object.keys(o).length===0&&delete a[s]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,s=this._nActiveBindings++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,s=--this._nActiveBindings,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new IA(new Float32Array(2),new Float32Array(2),1,ky),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,s=--this._nActiveControlInterpolants,r=t[s];e.__cacheIndex=s,t[s]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){const s=t||this._root,r=s.uuid;let a=typeof e=="string"?Fu.findByName(s,e):e;const o=a!==null?a.uuid:e,c=this._actionsByClip[o];let l=null;if(n===void 0&&(a!==null?n=a.blendMode:n=Yh),c!==void 0){const u=c.actionByRoot[r];if(u!==void 0&&u.blendMode===n)return u;l=c.knownActions[0],a===null&&(a=l._clip)}if(a===null)return null;const h=new Py(this,a,t,n);return this._bindAction(h,l),this._addInactiveAction(h,o,r),h}existingAction(e,t){const n=t||this._root,s=n.uuid,r=typeof e=="string"?Fu.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[s]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,s=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==n;++l)t[l]._update(s,e,r,a);const o=this._bindings,c=this._nActiveBindings;for(let l=0;l!==c;++l)o[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,s=this._actionsByClip,r=s[n];if(r!==void 0){const a=r.knownActions;for(let o=0,c=a.length;o!==c;++o){const l=a[o];this._deactivateAction(l);const h=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete s[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const a in n){const o=n[a].actionByRoot,c=o[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const s=this._bindingsByRootAndName,r=s[t];if(r!==void 0)for(const a in r){const o=r[a];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class PA{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=at(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}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(at(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Ts=new H,$c=new et,Qu=new et;class Uy extends Kc{constructor(e){const t=kA(e),n=new On,s=[],r=[],a=new qe(0,0,1),o=new qe(0,1,0);for(let l=0;l<t.length;l++){const h=t[l];h.parent&&h.parent.isBone&&(s.push(0,0,0),s.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new Bn(s,3)),n.setAttribute("color",new Bn(r,3));const c=new fo({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,c),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,s=n.getAttribute("position");Qu.copy(this.root.matrixWorld).invert();for(let r=0,a=0;r<t.length;r++){const o=t[r];o.parent&&o.parent.isBone&&($c.multiplyMatrices(Qu,o.matrixWorld),Ts.setFromMatrixPosition($c),s.setXYZ(a,Ts.x,Ts.y,Ts.z),$c.multiplyMatrices(Qu,o.parent.matrixWorld),Ts.setFromMatrixPosition($c),s.setXYZ(a+1,Ts.x,Ts.y,Ts.z),a+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function kA(i){const e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push(...kA(i.children[t]));return e}class Oy extends Kc{constructor(e=10,t=10,n=4473924,s=8947848){n=new qe(n),s=new qe(s);const r=t/2,a=e/t,o=e/2,c=[],l=[];for(let d=0,f=0,m=-o;d<=t;d++,m+=a){c.push(-o,0,m,o,0,m),c.push(m,0,-o,m,0,o);const g=d===r?n:s;g.toArray(l,f),f+=3,g.toArray(l,f),f+=3,g.toArray(l,f),f+=3,g.toArray(l,f),f+=3}const h=new On;h.setAttribute("position",new Bn(c,3)),h.setAttribute("color",new Bn(l,3));const u=new fo({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class UA extends Kc{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new On;s.setAttribute("position",new Bn(t,3)),s.setAttribute("color",new Bn(n,3));const r=new fo({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,n){const s=new qe,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(n),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Qy extends xs{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function OA(i,e,t,n){const s=Gy(n);switch(t){case yp:return i*e;case Hi:return i*e/s.components*s.byteLength;case Mh:return i*e/s.components*s.byteLength;case Js:return i*e*2/s.components*s.byteLength;case Bh:return i*e*2/s.components*s.byteLength;case wp:return i*e*3/s.components*s.byteLength;case sn:return i*e*4/s.components*s.byteLength;case Th:return i*e*4/s.components*s.byteLength;case uc:case Xa:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case dc:case Ya:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Rh:case Nh:return Math.max(i,16)*Math.max(e,8)/4;case fc:case pc:return Math.max(i,8)*Math.max(e,8)/2;case Ac:case gc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case mc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Ja:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Fh:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case Dh:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Lh:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case Za:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case Ph:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case kh:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case Uh:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case Oh:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case Qh:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case Gh:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case Hh:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case zh:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case Vh:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case $a:case Wh:case bc:return Math.ceil(i/4)*Math.ceil(e/4)*16;case vp:case qh:return Math.ceil(i/4)*Math.ceil(e/4)*8;case Kh:case jh:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Gy(i){switch(i){case tn:case xp:return{byteLength:1,components:1};case Wa:case Ep:case Mn:return{byteLength:2,components:1};case Sh:case Ih:return{byteLength:2,components:4};case Ys:case Ch:case nn:return{byteLength:4,components:1};case _p:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"176"}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="176");function QA(){let i=null,e=!1,t=null,n=null;function s(r,a){t(r,a),n=i.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){i=r}}}function Hy(i){const e=new WeakMap;function t(o,c){const l=o.array,h=o.usage,u=l.byteLength,d=i.createBuffer();i.bindBuffer(c,d),i.bufferData(c,l,h),o.onUploadCallback();let f;if(l instanceof Float32Array)f=i.FLOAT;else if(l instanceof Uint16Array)o.isFloat16BufferAttribute?f=i.HALF_FLOAT:f=i.UNSIGNED_SHORT;else if(l instanceof Int16Array)f=i.SHORT;else if(l instanceof Uint32Array)f=i.UNSIGNED_INT;else if(l instanceof Int32Array)f=i.INT;else if(l instanceof Int8Array)f=i.BYTE;else if(l instanceof Uint8Array)f=i.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)f=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:d,type:f,bytesPerElement:l.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,c,l){const h=c.array,u=c.updateRanges;if(i.bindBuffer(l,o),u.length===0)i.bufferSubData(l,0,h);else{u.sort((f,m)=>f.start-m.start);let d=0;for(let f=1;f<u.length;f++){const m=u[d],g=u[f];g.start<=m.start+m.count+1?m.count=Math.max(m.count,g.start+g.count-m.start):(++d,u[d]=g)}u.length=d+1;for(let f=0,m=u.length;f<m;f++){const g=u[f];i.bufferSubData(l,g.start*h.BYTES_PER_ELEMENT,h,g.start,g.count)}c.clearUpdateRanges()}c.onUploadCallback()}function s(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const c=e.get(o);c&&(i.deleteBuffer(c.buffer),e.delete(o))}function a(o,c){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const l=e.get(o);if(l===void 0)e.set(o,t(o,c));else if(l.version<o.version){if(l.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(l.buffer,o,c),l.version=o.version}}return{get:s,remove:r,update:a}}var zy=`#ifdef USE_ALPHAHASHif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;-#endif`,Py=`#ifdef USE_ALPHAHASH+#endif`,Vy=`#ifdef USE_ALPHAHASHconst float ALPHA_HASH_SCALE = 0.05;float hash2D( vec2 value ) {return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );@@ -74,20 +74,20 @@: cases.z;return clamp( threshold , 1.0e-6, 1.0 );}-#endif`,ky=`#ifdef USE_ALPHAMAP+#endif`,Wy=`#ifdef USE_ALPHAMAPdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;-#endif`,Uy=`#ifdef USE_ALPHAMAP+#endif`,qy=`#ifdef USE_ALPHAMAPuniform sampler2D alphaMap;-#endif`,Oy=`#ifdef USE_ALPHATEST+#endif`,Ky=`#ifdef USE_ALPHATEST#ifdef ALPHA_TO_COVERAGEdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );if ( diffuseColor.a == 0.0 ) discard;#elseif ( diffuseColor.a < alphaTest ) discard;#endif-#endif`,Qy=`#ifdef USE_ALPHATEST+#endif`,jy=`#ifdef USE_ALPHATESTuniform float alphaTest;-#endif`,Gy=`#ifdef USE_AOMAP+#endif`,Xy=`#ifdef USE_AOMAPfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;reflectedLight.indirectDiffuse *= ambientOcclusion;#if defined( USE_CLEARCOAT )@@ -100,10 +100,10 @@float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );#endif-#endif`,Hy=`#ifdef USE_AOMAP+#endif`,Yy=`#ifdef USE_AOMAPuniform sampler2D aoMap;uniform float aoMapIntensity;-#endif`,zy=`#ifdef USE_BATCHING+#endif`,Jy=`#ifdef USE_BATCHING#if ! defined( GL_ANGLE_multi_draw )#define gl_DrawID _gl_DrawIDuniform int _gl_DrawID;@@ -137,15 +137,15 @@int y = j / size;return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;}-#endif`,Vy=`#ifdef USE_BATCHING+#endif`,Zy=`#ifdef USE_BATCHINGmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );-#endif`,Wy=`vec3 transformed = vec3( position );+#endif`,$y=`vec3 transformed = vec3( position );#ifdef USE_ALPHAHASHvPosition = vec3( position );-#endif`,qy=`vec3 objectNormal = vec3( normal );+#endif`,ew=`vec3 objectNormal = vec3( normal );#ifdef USE_TANGENTvec3 objectTangent = vec3( tangent.xyz );-#endif`,Ky=`float G_BlinnPhong_Implicit( ) {+#endif`,tw=`float G_BlinnPhong_Implicit( ) {return 0.25;}float D_BlinnPhong( const in float shininess, const in float dotNH ) {@@ -159,7 +159,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vefloat G = G_BlinnPhong_Implicit( );float D = D_BlinnPhong( shininess, dotNH );return F * ( G * D );-} // validated`,Xy=`#ifdef USE_IRIDESCENCE+} // validated`,nw=`#ifdef USE_IRIDESCENCEconst mat3 XYZ_TO_REC709 = mat3(3.2404542, -0.9692660, 0.0556434,-1.5371385, 1.8760108, -0.2040259,@@ -222,7 +222,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve}return max( I, vec3( 0.0 ) );}-#endif`,Yy=`#ifdef USE_BUMPMAP+#endif`,iw=`#ifdef USE_BUMPMAPuniform sampler2D bumpMap;uniform float bumpScale;vec2 dHdxy_fwd() {@@ -243,7 +243,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vevec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );return normalize( abs( fDet ) * surf_norm - vGrad );}-#endif`,jy=`#if NUM_CLIPPING_PLANES > 0+#endif`,sw=`#if NUM_CLIPPING_PLANES > 0vec4 plane;#ifdef ALPHA_TO_COVERAGEfloat distanceToPlane, distanceGradient;@@ -289,26 +289,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in veif ( clipped ) discard;#endif#endif-#endif`,Jy=`#if NUM_CLIPPING_PLANES > 0+#endif`,rw=`#if NUM_CLIPPING_PLANES > 0varying vec3 vClipPosition;uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];-#endif`,Zy=`#if NUM_CLIPPING_PLANES > 0+#endif`,aw=`#if NUM_CLIPPING_PLANES > 0varying vec3 vClipPosition;-#endif`,$y=`#if NUM_CLIPPING_PLANES > 0+#endif`,ow=`#if NUM_CLIPPING_PLANES > 0vClipPosition = - mvPosition.xyz;-#endif`,ew=`#if defined( USE_COLOR_ALPHA )+#endif`,cw=`#if defined( USE_COLOR_ALPHA )diffuseColor *= vColor;#elif defined( USE_COLOR )diffuseColor.rgb *= vColor;-#endif`,tw=`#if defined( USE_COLOR_ALPHA )+#endif`,lw=`#if defined( USE_COLOR_ALPHA )varying vec4 vColor;#elif defined( USE_COLOR )varying vec3 vColor;-#endif`,nw=`#if defined( USE_COLOR_ALPHA )+#endif`,hw=`#if defined( USE_COLOR_ALPHA )varying vec4 vColor;#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )varying vec3 vColor;-#endif`,iw=`#if defined( USE_COLOR_ALPHA )+#endif`,uw=`#if defined( USE_COLOR_ALPHA )vColor = vec4( 1.0 );#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )vColor = vec3( 1.0 );@@ -322,7 +322,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve#ifdef USE_BATCHING_COLORvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );vColor.xyz *= batchingColor.xyz;-#endif`,sw=`#define PI 3.141592653589793+#endif`,dw=`#define PI 3.141592653589793#define PI2 6.283185307179586#define PI_HALF 1.5707963267948966#define RECIPROCAL_PI 0.3183098861837907@@ -396,7 +396,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );-} // validated`,rw=`#ifdef ENVMAP_TYPE_CUBE_UV+} // validated`,fw=`#ifdef ENVMAP_TYPE_CUBE_UV#define cubeUV_minMipLevel 4.0#define cubeUV_minTileSize 16.0float getFace( vec3 direction ) {@@ -489,7 +489,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {return vec4( mix( color0, color1, mipF ), 1.0 );}}-#endif`,aw=`vec3 transformedNormal = objectNormal;+#endif`,pw=`vec3 transformedNormal = objectNormal;#ifdef USE_TANGENTvec3 transformedTangent = objectTangent;#endif@@ -518,21 +518,21 @@ transformedNormal = normalMatrix * transformedNormal;#ifdef FLIP_SIDEDtransformedTangent = - transformedTangent;#endif-#endif`,ow=`#ifdef USE_DISPLACEMENTMAP+#endif`,Aw=`#ifdef USE_DISPLACEMENTMAPuniform sampler2D displacementMap;uniform float displacementScale;uniform float displacementBias;-#endif`,cw=`#ifdef USE_DISPLACEMENTMAP+#endif`,gw=`#ifdef USE_DISPLACEMENTMAPtransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );-#endif`,lw=`#ifdef USE_EMISSIVEMAP+#endif`,mw=`#ifdef USE_EMISSIVEMAPvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );#ifdef DECODE_VIDEO_TEXTURE_EMISSIVEemissiveColor = sRGBTransferEOTF( emissiveColor );#endiftotalEmissiveRadiance *= emissiveColor.rgb;-#endif`,hw=`#ifdef USE_EMISSIVEMAP+#endif`,bw=`#ifdef USE_EMISSIVEMAPuniform sampler2D emissiveMap;-#endif`,uw="gl_FragColor = linearToOutputTexel( gl_FragColor );",dw=`vec4 LinearTransferOETF( in vec4 value ) {+#endif`,xw="gl_FragColor = linearToOutputTexel( gl_FragColor );",Ew=`vec4 LinearTransferOETF( in vec4 value ) {return value;}vec4 sRGBTransferEOTF( in vec4 value ) {@@ -540,7 +540,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 );-}`,fw=`#ifdef USE_ENVMAP+}`,_w=`#ifdef USE_ENVMAP#ifdef ENV_WORLDPOSvec3 cameraToFrag;if ( isOrthographic ) {@@ -569,7 +569,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {#elif defined( ENVMAP_BLENDING_ADD )outgoingLight += envColor.xyz * specularStrength * reflectivity;#endif-#endif`,pw=`#ifdef USE_ENVMAP+#endif`,yw=`#ifdef USE_ENVMAPuniform float envMapIntensity;uniform float flipEnvMap;uniform mat3 envMapRotation;@@ -579,7 +579,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {uniform sampler2D envMap;#endif-#endif`,Aw=`#ifdef USE_ENVMAP+#endif`,ww=`#ifdef USE_ENVMAPuniform float reflectivity;#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )#define ENV_WORLDPOS@@ -590,7 +590,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {#elsevarying vec3 vReflect;#endif-#endif`,gw=`#ifdef USE_ENVMAP+#endif`,vw=`#ifdef USE_ENVMAP#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )#define ENV_WORLDPOS#endif@@ -601,7 +601,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {varying vec3 vReflect;uniform float refractionRatio;#endif-#endif`,mw=`#ifdef USE_ENVMAP+#endif`,Cw=`#ifdef USE_ENVMAP#ifdef ENV_WORLDPOSvWorldPosition = worldPosition.xyz;#else@@ -618,18 +618,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {vReflect = refract( cameraToVertex, worldNormal, refractionRatio );#endif#endif-#endif`,bw=`#ifdef USE_FOG+#endif`,Sw=`#ifdef USE_FOGvFogDepth = - mvPosition.z;-#endif`,xw=`#ifdef USE_FOG+#endif`,Iw=`#ifdef USE_FOGvarying float vFogDepth;-#endif`,Ew=`#ifdef USE_FOG+#endif`,Mw=`#ifdef USE_FOG#ifdef FOG_EXP2float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );#elsefloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );#endifgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );-#endif`,_w=`#ifdef USE_FOG+#endif`,Bw=`#ifdef USE_FOGuniform vec3 fogColor;varying float vFogDepth;#ifdef FOG_EXP2@@ -638,7 +638,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {uniform float fogNear;uniform float fogFar;#endif-#endif`,yw=`#ifdef USE_GRADIENTMAP+#endif`,Tw=`#ifdef USE_GRADIENTMAPuniform sampler2D gradientMap;#endifvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {@@ -650,12 +650,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {vec2 fw = fwidth( coord ) * 0.5;return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );#endif-}`,ww=`#ifdef USE_LIGHTMAP+}`,Rw=`#ifdef USE_LIGHTMAPuniform sampler2D lightMap;uniform float lightMapIntensity;-#endif`,Cw=`LambertMaterial material;+#endif`,Nw=`LambertMaterial material;material.diffuseColor = diffuseColor.rgb;-material.specularStrength = specularStrength;`,vw=`varying vec3 vViewPosition;+material.specularStrength = specularStrength;`,Fw=`varying vec3 vViewPosition;struct LambertMaterial {vec3 diffuseColor;float specularStrength;@@ -669,7 +669,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometrreflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );}#define RE_Direct RE_Direct_Lambert-#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Sw=`uniform bool receiveShadow;+#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Dw=`uniform bool receiveShadow;uniform vec3 ambientLightColor;#if defined( USE_LIGHT_PROBES )uniform vec3 lightProbe[ 9 ];@@ -785,7 +785,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosivec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );return irradiance;}-#endif`,Iw=`#ifdef USE_ENVMAP+#endif`,Lw=`#ifdef USE_ENVMAPvec3 getIBLIrradiance( const in vec3 normal ) {#ifdef ENVMAP_TYPE_CUBE_UVvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );@@ -818,8 +818,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi#endif}#endif-#endif`,Mw=`ToonMaterial material;-material.diffuseColor = diffuseColor.rgb;`,Bw=`varying vec3 vViewPosition;+#endif`,Pw=`ToonMaterial material;+material.diffuseColor = diffuseColor.rgb;`,kw=`varying vec3 vViewPosition;struct ToonMaterial {vec3 diffuseColor;};@@ -831,11 +831,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPoreflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );}#define RE_Direct RE_Direct_Toon-#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Tw=`BlinnPhongMaterial material;+#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Uw=`BlinnPhongMaterial material;material.diffuseColor = diffuseColor.rgb;material.specularColor = specular;material.specularShininess = shininess;-material.specularStrength = specularStrength;`,Rw=`varying vec3 vViewPosition;+material.specularStrength = specularStrength;`,Ow=`varying vec3 vViewPosition;struct BlinnPhongMaterial {vec3 diffuseColor;vec3 specularColor;@@ -852,7 +852,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geomreflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );}#define RE_Direct RE_Direct_BlinnPhong-#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Nw=`PhysicalMaterial material;+#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Qw=`PhysicalMaterial material;material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );@@ -938,7 +938,7 @@ material.roughness = min( material.roughness, 1.0 );material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;-#endif`,Fw=`struct PhysicalMaterial {+#endif`,Gw=`struct PhysicalMaterial {vec3 diffuseColor;float roughness;vec3 specularColor;@@ -1239,7 +1239,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia#define RE_IndirectSpecular RE_IndirectSpecular_Physicalfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );-}`,Dw=`+}`,Hw=`vec3 geometryPosition = - vViewPosition;vec3 geometryNormal = normal;vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );@@ -1354,7 +1354,7 @@ IncidentLight directLight;#if defined( RE_IndirectSpecular )vec3 radiance = vec3( 0.0 );vec3 clearcoatRadiance = vec3( 0.0 );-#endif`,Lw=`#if defined( RE_IndirectDiffuse )+#endif`,zw=`#if defined( RE_IndirectDiffuse )#ifdef USE_LIGHTMAPvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;@@ -1373,32 +1373,32 @@ IncidentLight directLight;#ifdef USE_CLEARCOATclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );#endif-#endif`,Pw=`#if defined( RE_IndirectDiffuse )+#endif`,Vw=`#if defined( RE_IndirectDiffuse )RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );#endif#if defined( RE_IndirectSpecular )RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );-#endif`,kw=`#if defined( USE_LOGDEPTHBUF )+#endif`,Ww=`#if defined( USE_LOGDEPTHBUF )gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;-#endif`,Uw=`#if defined( USE_LOGDEPTHBUF )+#endif`,qw=`#if defined( USE_LOGDEPTHBUF )uniform float logDepthBufFC;varying float vFragDepth;varying float vIsPerspective;-#endif`,Ow=`#ifdef USE_LOGDEPTHBUF+#endif`,Kw=`#ifdef USE_LOGDEPTHBUFvarying float vFragDepth;varying float vIsPerspective;-#endif`,Qw=`#ifdef USE_LOGDEPTHBUF+#endif`,jw=`#ifdef USE_LOGDEPTHBUFvFragDepth = 1.0 + gl_Position.w;vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );-#endif`,Gw=`#ifdef USE_MAP+#endif`,Xw=`#ifdef USE_MAPvec4 sampledDiffuseColor = texture2D( map, vMapUv );#ifdef DECODE_VIDEO_TEXTUREsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );#endifdiffuseColor *= sampledDiffuseColor;-#endif`,Hw=`#ifdef USE_MAP+#endif`,Yw=`#ifdef USE_MAPuniform sampler2D map;-#endif`,zw=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )+#endif`,Jw=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )#if defined( USE_POINTS_UV )vec2 uv = vUv;#else@@ -1410,7 +1410,7 @@ IncidentLight directLight;#endif#ifdef USE_ALPHAMAPdiffuseColor.a *= texture2D( alphaMap, uv ).g;-#endif`,Vw=`#if defined( USE_POINTS_UV )+#endif`,Zw=`#if defined( USE_POINTS_UV )varying vec2 vUv;#else#if defined( USE_MAP ) || defined( USE_ALPHAMAP )@@ -1422,19 +1422,19 @@ IncidentLight directLight;#endif#ifdef USE_ALPHAMAPuniform sampler2D alphaMap;-#endif`,Ww=`float metalnessFactor = metalness;+#endif`,$w=`float metalnessFactor = metalness;#ifdef USE_METALNESSMAPvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );metalnessFactor *= texelMetalness.b;-#endif`,qw=`#ifdef USE_METALNESSMAP+#endif`,ev=`#ifdef USE_METALNESSMAPuniform sampler2D metalnessMap;-#endif`,Kw=`#ifdef USE_INSTANCING_MORPH+#endif`,tv=`#ifdef USE_INSTANCING_MORPHfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;}-#endif`,Xw=`#if defined( USE_MORPHCOLORS )+#endif`,nv=`#if defined( USE_MORPHCOLORS )vColor *= morphTargetBaseInfluence;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {#if defined( USE_COLOR_ALPHA )@@ -1443,12 +1443,12 @@ IncidentLight directLight;if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];#endif}-#endif`,Yw=`#ifdef USE_MORPHNORMALS+#endif`,iv=`#ifdef USE_MORPHNORMALSobjectNormal *= morphTargetBaseInfluence;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];}-#endif`,jw=`#ifdef USE_MORPHTARGETS+#endif`,sv=`#ifdef USE_MORPHTARGETS#ifndef USE_INSTANCING_MORPHuniform float morphTargetBaseInfluence;uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];@@ -1462,12 +1462,12 @@ IncidentLight directLight;ivec3 morphUV = ivec3( x, y, morphTargetIndex );return texelFetch( morphTargetsTexture, morphUV, 0 );}-#endif`,Jw=`#ifdef USE_MORPHTARGETS+#endif`,rv=`#ifdef USE_MORPHTARGETStransformed *= morphTargetBaseInfluence;for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];}-#endif`,Zw=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;+#endif`,av=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;#ifdef FLAT_SHADEDvec3 fdx = dFdx( vViewPosition );vec3 fdy = dFdy( vViewPosition );@@ -1508,7 +1508,7 @@ IncidentLight directLight;tbn2[1] *= faceDirection;#endif#endif-vec3 nonPerturbedNormal = normal;`,$w=`#ifdef USE_NORMALMAP_OBJECTSPACE+vec3 nonPerturbedNormal = normal;`,ov=`#ifdef USE_NORMALMAP_OBJECTSPACEnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;#ifdef FLIP_SIDEDnormal = - normal;@@ -1523,25 +1523,25 @@ vec3 nonPerturbedNormal = normal;`,$w=`#ifdef USE_NORMALMAP_OBJECTSPACEnormal = normalize( tbn * mapN );#elif defined( USE_BUMPMAP )normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );-#endif`,eC=`#ifndef FLAT_SHADED+#endif`,cv=`#ifndef FLAT_SHADEDvarying vec3 vNormal;#ifdef USE_TANGENTvarying vec3 vTangent;varying vec3 vBitangent;#endif-#endif`,tC=`#ifndef FLAT_SHADED+#endif`,lv=`#ifndef FLAT_SHADEDvarying vec3 vNormal;#ifdef USE_TANGENTvarying vec3 vTangent;varying vec3 vBitangent;#endif-#endif`,nC=`#ifndef FLAT_SHADED+#endif`,hv=`#ifndef FLAT_SHADEDvNormal = normalize( transformedNormal );#ifdef USE_TANGENTvTangent = normalize( transformedTangent );vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );#endif-#endif`,iC=`#ifdef USE_NORMALMAP+#endif`,uv=`#ifdef USE_NORMALMAPuniform sampler2D normalMap;uniform vec2 normalScale;#endif@@ -1563,13 +1563,13 @@ vec3 nonPerturbedNormal = normal;`,$w=`#ifdef USE_NORMALMAP_OBJECTSPACEfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );return mat3( T * scale, B * scale, N );}-#endif`,sC=`#ifdef USE_CLEARCOAT+#endif`,dv=`#ifdef USE_CLEARCOATvec3 clearcoatNormal = nonPerturbedNormal;-#endif`,rC=`#ifdef USE_CLEARCOAT_NORMALMAP+#endif`,fv=`#ifdef USE_CLEARCOAT_NORMALMAPvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;clearcoatMapN.xy *= clearcoatNormalScale;clearcoatNormal = normalize( tbn2 * clearcoatMapN );-#endif`,aC=`#ifdef USE_CLEARCOATMAP+#endif`,pv=`#ifdef USE_CLEARCOATMAPuniform sampler2D clearcoatMap;#endif#ifdef USE_CLEARCOAT_NORMALMAP@@ -1578,18 +1578,18 @@ vec3 nonPerturbedNormal = normal;`,$w=`#ifdef USE_NORMALMAP_OBJECTSPACE#endif#ifdef USE_CLEARCOAT_ROUGHNESSMAPuniform sampler2D clearcoatRoughnessMap;-#endif`,oC=`#ifdef USE_IRIDESCENCEMAP+#endif`,Av=`#ifdef USE_IRIDESCENCEMAPuniform sampler2D iridescenceMap;#endif#ifdef USE_IRIDESCENCE_THICKNESSMAPuniform sampler2D iridescenceThicknessMap;-#endif`,cC=`#ifdef OPAQUE+#endif`,gv=`#ifdef OPAQUEdiffuseColor.a = 1.0;#endif#ifdef USE_TRANSMISSIONdiffuseColor.a *= material.transmissionAlpha;#endif-gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,lC=`vec3 packNormalToRGB( const in vec3 normal ) {+gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,mv=`vec3 packNormalToRGB( const in vec3 normal ) {return normalize( normal ) * 0.5 + 0.5;}vec3 unpackRGBToNormal( const in vec3 rgb ) {@@ -1658,9 +1658,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const}float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {return ( near * far ) / ( ( far - near ) * depth - far );-}`,hC=`#ifdef PREMULTIPLIED_ALPHA+}`,bv=`#ifdef PREMULTIPLIED_ALPHAgl_FragColor.rgb *= gl_FragColor.a;-#endif`,uC=`vec4 mvPosition = vec4( transformed, 1.0 );+#endif`,xv=`vec4 mvPosition = vec4( transformed, 1.0 );#ifdef USE_BATCHINGmvPosition = batchingMatrix * mvPosition;#endif@@ -1668,22 +1668,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, constmvPosition = instanceMatrix * mvPosition;#endifmvPosition = modelViewMatrix * mvPosition;-gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERING+gl_Position = projectionMatrix * mvPosition;`,Ev=`#ifdef DITHERINGgl_FragColor.rgb = dithering( gl_FragColor.rgb );-#endif`,fC=`#ifdef DITHERING+#endif`,_v=`#ifdef DITHERINGvec3 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`,pC=`float roughnessFactor = roughness;+#endif`,yv=`float roughnessFactor = roughness;#ifdef USE_ROUGHNESSMAPvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );roughnessFactor *= texelRoughness.g;-#endif`,AC=`#ifdef USE_ROUGHNESSMAP+#endif`,wv=`#ifdef USE_ROUGHNESSMAPuniform sampler2D roughnessMap;-#endif`,gC=`#if NUM_SPOT_LIGHT_COORDS > 0+#endif`,vv=`#if NUM_SPOT_LIGHT_COORDS > 0varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];#endif#if NUM_SPOT_LIGHT_MAPS > 0@@ -1869,7 +1869,7 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERING}return mix( 1.0, shadow, shadowIntensity );}-#endif`,mC=`#if NUM_SPOT_LIGHT_COORDS > 0+#endif`,Cv=`#if NUM_SPOT_LIGHT_COORDS > 0uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];#endif@@ -1910,7 +1910,7 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERING};uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];#endif-#endif`,bC=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )+#endif`,Sv=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );vec4 shadowWorldPosition;#endif@@ -1942,7 +1942,7 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERINGvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;}#pragma unroll_loop_end-#endif`,xC=`float getShadowMask() {+#endif`,Iv=`float getShadowMask() {float shadow = 1.0;#ifdef USE_SHADOWMAP#if NUM_DIR_LIGHT_SHADOWS > 0@@ -1974,12 +1974,12 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERING#endif#endifreturn shadow;-}`,EC=`#ifdef USE_SKINNING+}`,Mv=`#ifdef USE_SKINNINGmat4 boneMatX = getBoneMatrix( skinIndex.x );mat4 boneMatY = getBoneMatrix( skinIndex.y );mat4 boneMatZ = getBoneMatrix( skinIndex.z );mat4 boneMatW = getBoneMatrix( skinIndex.w );-#endif`,_C=`#ifdef USE_SKINNING+#endif`,Bv=`#ifdef USE_SKINNINGuniform mat4 bindMatrix;uniform mat4 bindMatrixInverse;uniform highp sampler2D boneTexture;@@ -1994,7 +1994,7 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERINGvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );return mat4( v1, v2, v3, v4 );}-#endif`,yC=`#ifdef USE_SKINNING+#endif`,Tv=`#ifdef USE_SKINNINGvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );vec4 skinned = vec4( 0.0 );skinned += boneMatX * skinVertex * skinWeight.x;@@ -2002,7 +2002,7 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERINGskinned += boneMatZ * skinVertex * skinWeight.z;skinned += boneMatW * skinVertex * skinWeight.w;transformed = ( bindMatrixInverse * skinned ).xyz;-#endif`,wC=`#ifdef USE_SKINNING+#endif`,Rv=`#ifdef USE_SKINNINGmat4 skinMatrix = mat4( 0.0 );skinMatrix += skinWeight.x * boneMatX;skinMatrix += skinWeight.y * boneMatY;@@ -2013,17 +2013,17 @@ gl_Position = projectionMatrix * mvPosition;`,dC=`#ifdef DITHERING#ifdef USE_TANGENTobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;#endif-#endif`,CC=`float specularStrength;+#endif`,Nv=`float specularStrength;#ifdef USE_SPECULARMAPvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );specularStrength = texelSpecular.r;#elsespecularStrength = 1.0;-#endif`,vC=`#ifdef USE_SPECULARMAP+#endif`,Fv=`#ifdef USE_SPECULARMAPuniform sampler2D specularMap;-#endif`,SC=`#if defined( TONE_MAPPING )+#endif`,Dv=`#if defined( TONE_MAPPING )gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );-#endif`,IC=`#ifndef saturate+#endif`,Lv=`#ifndef saturate#define saturate( a ) clamp( a, 0.0, 1.0 )#endifuniform float toneMappingExposure;@@ -2120,7 +2120,7 @@ vec3 NeutralToneMapping( vec3 color ) {float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );return mix( color, vec3( newPeak ), g );}-vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISSION+vec3 CustomToneMapping( vec3 color ) { return color; }`,Pv=`#ifdef USE_TRANSMISSIONmaterial.transmission = transmission;material.transmissionAlpha = 1.0;material.thickness = thickness;@@ -2141,7 +2141,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISSmaterial.attenuationColor, material.attenuationDistance );material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );-#endif`,BC=`#ifdef USE_TRANSMISSION+#endif`,kv=`#ifdef USE_TRANSMISSIONuniform float transmission;uniform float thickness;uniform float attenuationDistance;@@ -2267,7 +2267,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISSfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );}-#endif`,TC=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )+#endif`,Uv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )varying vec2 vUv;#endif#ifdef USE_MAP@@ -2337,7 +2337,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISS#ifdef USE_THICKNESSMAPuniform mat3 thicknessMapTransform;varying vec2 vThicknessMapUv;-#endif`,RC=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )+#endif`,Ov=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )varying vec2 vUv;#endif#ifdef USE_MAP@@ -2431,7 +2431,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISS#ifdef USE_THICKNESSMAPuniform mat3 thicknessMapTransform;varying vec2 vThicknessMapUv;-#endif`,NC=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )+#endif`,Qv=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )vUv = vec3( uv, 1 ).xy;#endif#ifdef USE_MAP@@ -2502,7 +2502,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISS#endif#ifdef USE_THICKNESSMAPvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;-#endif`,FC=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0+#endif`,Gv=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0vec4 worldPosition = vec4( transformed, 1.0 );#ifdef USE_BATCHINGworldPosition = batchingMatrix * worldPosition;@@ -2511,7 +2511,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,MC=`#ifdef USE_TRANSMISSworldPosition = instanceMatrix * worldPosition;#endifworldPosition = modelMatrix * worldPosition;-#endif`;const ot={alphahash_fragment:Ly,alphahash_pars_fragment:Py,alphamap_fragment:ky,alphamap_pars_fragment:Uy,alphatest_fragment:Oy,alphatest_pars_fragment:Qy,aomap_fragment:Gy,aomap_pars_fragment:Hy,batching_pars_vertex:zy,batching_vertex:Vy,begin_vertex:Wy,beginnormal_vertex:qy,bsdfs:Ky,iridescence_fragment:Xy,bumpmap_pars_fragment:Yy,clipping_planes_fragment:jy,clipping_planes_pars_fragment:Jy,clipping_planes_pars_vertex:Zy,clipping_planes_vertex:$y,color_fragment:ew,color_pars_fragment:tw,color_pars_vertex:nw,color_vertex:iw,common:sw,cube_uv_reflection_fragment:rw,defaultnormal_vertex:aw,displacementmap_pars_vertex:ow,displacementmap_vertex:cw,emissivemap_fragment:lw,emissivemap_pars_fragment:hw,colorspace_fragment:uw,colorspace_pars_fragment:dw,envmap_fragment:fw,envmap_common_pars_fragment:pw,envmap_pars_fragment:Aw,envmap_pars_vertex:gw,envmap_physical_pars_fragment:Iw,envmap_vertex:mw,fog_vertex:bw,fog_pars_vertex:xw,fog_fragment:Ew,fog_pars_fragment:_w,gradientmap_pars_fragment:yw,lightmap_pars_fragment:ww,lights_lambert_fragment:Cw,lights_lambert_pars_fragment:vw,lights_pars_begin:Sw,lights_toon_fragment:Mw,lights_toon_pars_fragment:Bw,lights_phong_fragment:Tw,lights_phong_pars_fragment:Rw,lights_physical_fragment:Nw,lights_physical_pars_fragment:Fw,lights_fragment_begin:Dw,lights_fragment_maps:Lw,lights_fragment_end:Pw,logdepthbuf_fragment:kw,logdepthbuf_pars_fragment:Uw,logdepthbuf_pars_vertex:Ow,logdepthbuf_vertex:Qw,map_fragment:Gw,map_pars_fragment:Hw,map_particle_fragment:zw,map_particle_pars_fragment:Vw,metalnessmap_fragment:Ww,metalnessmap_pars_fragment:qw,morphinstance_vertex:Kw,morphcolor_vertex:Xw,morphnormal_vertex:Yw,morphtarget_pars_vertex:jw,morphtarget_vertex:Jw,normal_fragment_begin:Zw,normal_fragment_maps:$w,normal_pars_fragment:eC,normal_pars_vertex:tC,normal_vertex:nC,normalmap_pars_fragment:iC,clearcoat_normal_fragment_begin:sC,clearcoat_normal_fragment_maps:rC,clearcoat_pars_fragment:aC,iridescence_pars_fragment:oC,opaque_fragment:cC,packing:lC,premultiplied_alpha_fragment:hC,project_vertex:uC,dithering_fragment:dC,dithering_pars_fragment:fC,roughnessmap_fragment:pC,roughnessmap_pars_fragment:AC,shadowmap_pars_fragment:gC,shadowmap_pars_vertex:mC,shadowmap_vertex:bC,shadowmask_pars_fragment:xC,skinbase_vertex:EC,skinning_pars_vertex:_C,skinning_vertex:yC,skinnormal_vertex:wC,specularmap_fragment:CC,specularmap_pars_fragment:vC,tonemapping_fragment:SC,tonemapping_pars_fragment:IC,transmission_fragment:MC,transmission_pars_fragment:BC,uv_pars_fragment:TC,uv_pars_vertex:RC,uv_vertex:NC,worldpos_vertex:FC,background_vert:`varying vec2 vUv;+#endif`;const ot={alphahash_fragment:zy,alphahash_pars_fragment:Vy,alphamap_fragment:Wy,alphamap_pars_fragment:qy,alphatest_fragment:Ky,alphatest_pars_fragment:jy,aomap_fragment:Xy,aomap_pars_fragment:Yy,batching_pars_vertex:Jy,batching_vertex:Zy,begin_vertex:$y,beginnormal_vertex:ew,bsdfs:tw,iridescence_fragment:nw,bumpmap_pars_fragment:iw,clipping_planes_fragment:sw,clipping_planes_pars_fragment:rw,clipping_planes_pars_vertex:aw,clipping_planes_vertex:ow,color_fragment:cw,color_pars_fragment:lw,color_pars_vertex:hw,color_vertex:uw,common:dw,cube_uv_reflection_fragment:fw,defaultnormal_vertex:pw,displacementmap_pars_vertex:Aw,displacementmap_vertex:gw,emissivemap_fragment:mw,emissivemap_pars_fragment:bw,colorspace_fragment:xw,colorspace_pars_fragment:Ew,envmap_fragment:_w,envmap_common_pars_fragment:yw,envmap_pars_fragment:ww,envmap_pars_vertex:vw,envmap_physical_pars_fragment:Lw,envmap_vertex:Cw,fog_vertex:Sw,fog_pars_vertex:Iw,fog_fragment:Mw,fog_pars_fragment:Bw,gradientmap_pars_fragment:Tw,lightmap_pars_fragment:Rw,lights_lambert_fragment:Nw,lights_lambert_pars_fragment:Fw,lights_pars_begin:Dw,lights_toon_fragment:Pw,lights_toon_pars_fragment:kw,lights_phong_fragment:Uw,lights_phong_pars_fragment:Ow,lights_physical_fragment:Qw,lights_physical_pars_fragment:Gw,lights_fragment_begin:Hw,lights_fragment_maps:zw,lights_fragment_end:Vw,logdepthbuf_fragment:Ww,logdepthbuf_pars_fragment:qw,logdepthbuf_pars_vertex:Kw,logdepthbuf_vertex:jw,map_fragment:Xw,map_pars_fragment:Yw,map_particle_fragment:Jw,map_particle_pars_fragment:Zw,metalnessmap_fragment:$w,metalnessmap_pars_fragment:ev,morphinstance_vertex:tv,morphcolor_vertex:nv,morphnormal_vertex:iv,morphtarget_pars_vertex:sv,morphtarget_vertex:rv,normal_fragment_begin:av,normal_fragment_maps:ov,normal_pars_fragment:cv,normal_pars_vertex:lv,normal_vertex:hv,normalmap_pars_fragment:uv,clearcoat_normal_fragment_begin:dv,clearcoat_normal_fragment_maps:fv,clearcoat_pars_fragment:pv,iridescence_pars_fragment:Av,opaque_fragment:gv,packing:mv,premultiplied_alpha_fragment:bv,project_vertex:xv,dithering_fragment:Ev,dithering_pars_fragment:_v,roughnessmap_fragment:yv,roughnessmap_pars_fragment:wv,shadowmap_pars_fragment:vv,shadowmap_pars_vertex:Cv,shadowmap_vertex:Sv,shadowmask_pars_fragment:Iv,skinbase_vertex:Mv,skinning_pars_vertex:Bv,skinning_vertex:Tv,skinnormal_vertex:Rv,specularmap_fragment:Nv,specularmap_pars_fragment:Fv,tonemapping_fragment:Dv,tonemapping_pars_fragment:Lv,transmission_fragment:Pv,transmission_pars_fragment:kv,uv_pars_fragment:Uv,uv_pars_vertex:Ov,uv_vertex:Qv,worldpos_vertex:Gv,background_vert:`varying vec2 vUv;uniform mat3 uvTransform;void main() {vUv = ( uvTransform * vec3( uv, 1 ) ).xy;@@ -3563,7 +3563,7 @@ void main() {#include <tonemapping_fragment>#include <colorspace_fragment>#include <fog_fragment>-}`},we={common:{diffuse:{value:new qe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new rt},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new rt}},envmap:{envMap:{value:null},envMapRotation:{value:new rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new rt},normalScale:{value:new Ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new qe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new qe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0},uvTransform:{value:new rt}},sprite:{diffuse:{value:new qe(16777215)},opacity:{value:1},center:{value:new Ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new rt},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0}}},Ni={basic:{uniforms:Tn([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.fog]),vertexShader:ot.meshbasic_vert,fragmentShader:ot.meshbasic_frag},lambert:{uniforms:Tn([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new qe(0)}}]),vertexShader:ot.meshlambert_vert,fragmentShader:ot.meshlambert_frag},phong:{uniforms:Tn([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new qe(0)},specular:{value:new qe(1118481)},shininess:{value:30}}]),vertexShader:ot.meshphong_vert,fragmentShader:ot.meshphong_frag},standard:{uniforms:Tn([we.common,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.roughnessmap,we.metalnessmap,we.fog,we.lights,{emissive:{value:new qe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ot.meshphysical_vert,fragmentShader:ot.meshphysical_frag},toon:{uniforms:Tn([we.common,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.gradientmap,we.fog,we.lights,{emissive:{value:new qe(0)}}]),vertexShader:ot.meshtoon_vert,fragmentShader:ot.meshtoon_frag},matcap:{uniforms:Tn([we.common,we.bumpmap,we.normalmap,we.displacementmap,we.fog,{matcap:{value:null}}]),vertexShader:ot.meshmatcap_vert,fragmentShader:ot.meshmatcap_frag},points:{uniforms:Tn([we.points,we.fog]),vertexShader:ot.points_vert,fragmentShader:ot.points_frag},dashed:{uniforms:Tn([we.common,we.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ot.linedashed_vert,fragmentShader:ot.linedashed_frag},depth:{uniforms:Tn([we.common,we.displacementmap]),vertexShader:ot.depth_vert,fragmentShader:ot.depth_frag},normal:{uniforms:Tn([we.common,we.bumpmap,we.normalmap,we.displacementmap,{opacity:{value:1}}]),vertexShader:ot.meshnormal_vert,fragmentShader:ot.meshnormal_frag},sprite:{uniforms:Tn([we.sprite,we.fog]),vertexShader:ot.sprite_vert,fragmentShader:ot.sprite_frag},background:{uniforms:{uvTransform:{value:new rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ot.background_vert,fragmentShader:ot.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new rt}},vertexShader:ot.backgroundCube_vert,fragmentShader:ot.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ot.cube_vert,fragmentShader:ot.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ot.equirect_vert,fragmentShader:ot.equirect_frag},distanceRGBA:{uniforms:Tn([we.common,we.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ot.distanceRGBA_vert,fragmentShader:ot.distanceRGBA_frag},shadow:{uniforms:Tn([we.lights,we.fog,{color:{value:new qe(0)},opacity:{value:1}}]),vertexShader:ot.shadow_vert,fragmentShader:ot.shadow_frag}};Ni.physical={uniforms:Tn([Ni.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new rt},clearcoatNormalScale:{value:new Ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new rt},sheen:{value:0},sheenColor:{value:new qe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new rt},transmissionSamplerSize:{value:new Ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new rt},attenuationDistance:{value:0},attenuationColor:{value:new qe(0)},specularColor:{value:new qe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new rt},anisotropyVector:{value:new Ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new rt}}]),vertexShader:ot.meshphysical_vert,fragmentShader:ot.meshphysical_frag};const Yc={r:0,b:0,g:0},nr=new Bi,DC=new et;function LC(i,e,t,n,s,r,a){const o=new qe(0);let c=r===!0?0:1,l,h,u=null,d=0,f=null;function m(b){let _=b.isScene===!0?b.background:null;return _&&_.isTexture&&(_=(b.backgroundBlurriness>0?t:e).get(_)),_}function g(b){let _=!1;const M=m(b);M===null?p(o,c):M&&M.isColor&&(p(M,1),_=!0);const w=i.xr.getEnvironmentBlendMode();w==="additive"?n.buffers.color.setClear(0,0,0,1,a):w==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||_)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function A(b,_){const M=m(_);M&&(M.isCubeTexture||M.mapping===ic)?(h===void 0&&(h=new Jt(new Jr(1,1,1),new vs({name:"BackgroundCubeMaterial",uniforms:Zr(Ni.backgroundCube.uniforms),vertexShader:Ni.backgroundCube.vertexShader,fragmentShader:Ni.backgroundCube.fragmentShader,side:Sn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(w,S,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),nr.copy(_.backgroundRotation),nr.x*=-1,nr.y*=-1,nr.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(nr.y*=-1,nr.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=_.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(DC.makeRotationFromEuler(nr)),h.material.toneMapped=At.getTransfer(M.colorSpace)!==Mt,(u!==M||d!==M.version||f!==i.toneMapping)&&(h.material.needsUpdate=!0,u=M,d=M.version,f=i.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):M&&M.isTexture&&(l===void 0&&(l=new Jt(new qc(2,2),new vs({name:"BackgroundMaterial",uniforms:Zr(Ni.background.uniforms),vertexShader:Ni.background.vertexShader,fragmentShader:Ni.background.fragmentShader,side:Qi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=M,l.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,l.material.toneMapped=At.getTransfer(M.colorSpace)!==Mt,M.matrixAutoUpdate===!0&&M.updateMatrix(),l.material.uniforms.uvTransform.value.copy(M.matrix),(u!==M||d!==M.version||f!==i.toneMapping)&&(l.material.needsUpdate=!0,u=M,d=M.version,f=i.toneMapping),l.layers.enableAll(),b.unshift(l,l.geometry,l.material,0,0,null))}function p(b,_){b.getRGB(Yc,Jp(i)),n.buffers.color.setClear(Yc.r,Yc.g,Yc.b,_,a)}function y(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(b,_=1){o.set(b),c=_,p(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(b){c=b,p(o,c)},render:g,addToRenderList:A,dispose:y}}function PC(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=d(null);let r=s,a=!1;function o(C,F,K,q,$){let D=!1;const O=u(q,K,F);r!==O&&(r=O,l(r.object)),D=f(C,q,K,$),D&&m(C,q,K,$),$!==null&&e.update($,i.ELEMENT_ARRAY_BUFFER),(D||a)&&(a=!1,_(C,F,K,q),$!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function c(){return i.createVertexArray()}function l(C){return i.bindVertexArray(C)}function h(C){return i.deleteVertexArray(C)}function u(C,F,K){const q=K.wireframe===!0;let $=n[C.id];$===void 0&&($={},n[C.id]=$);let D=$[F.id];D===void 0&&(D={},$[F.id]=D);let O=D[q];return O===void 0&&(O=d(c()),D[q]=O),O}function d(C){const F=[],K=[],q=[];for(let $=0;$<t;$++)F[$]=0,K[$]=0,q[$]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:F,enabledAttributes:K,attributeDivisors:q,object:C,attributes:{},index:null}}function f(C,F,K,q){const $=r.attributes,D=F.attributes;let O=0;const j=K.getAttributes();for(const Q in j)if(j[Q].location>=0){const ee=$[Q];let ae=D[Q];if(ae===void 0&&(Q==="instanceMatrix"&&C.instanceMatrix&&(ae=C.instanceMatrix),Q==="instanceColor"&&C.instanceColor&&(ae=C.instanceColor)),ee===void 0||ee.attribute!==ae||ae&&ee.data!==ae.data)return!0;O++}return r.attributesNum!==O||r.index!==q}function m(C,F,K,q){const $={},D=F.attributes;let O=0;const j=K.getAttributes();for(const Q in j)if(j[Q].location>=0){let ee=D[Q];ee===void 0&&(Q==="instanceMatrix"&&C.instanceMatrix&&(ee=C.instanceMatrix),Q==="instanceColor"&&C.instanceColor&&(ee=C.instanceColor));const ae={};ae.attribute=ee,ee&&ee.data&&(ae.data=ee.data),$[Q]=ae,O++}r.attributes=$,r.attributesNum=O,r.index=q}function g(){const C=r.newAttributes;for(let F=0,K=C.length;F<K;F++)C[F]=0}function A(C){p(C,0)}function p(C,F){const K=r.newAttributes,q=r.enabledAttributes,$=r.attributeDivisors;K[C]=1,q[C]===0&&(i.enableVertexAttribArray(C),q[C]=1),$[C]!==F&&(i.vertexAttribDivisor(C,F),$[C]=F)}function y(){const C=r.newAttributes,F=r.enabledAttributes;for(let K=0,q=F.length;K<q;K++)F[K]!==C[K]&&(i.disableVertexAttribArray(K),F[K]=0)}function b(C,F,K,q,$,D,O){O===!0?i.vertexAttribIPointer(C,F,K,$,D):i.vertexAttribPointer(C,F,K,q,$,D)}function _(C,F,K,q){g();const $=q.attributes,D=K.getAttributes(),O=F.defaultAttributeValues;for(const j in D){const Q=D[j];if(Q.location>=0){let J=$[j];if(J===void 0&&(j==="instanceMatrix"&&C.instanceMatrix&&(J=C.instanceMatrix),j==="instanceColor"&&C.instanceColor&&(J=C.instanceColor)),J!==void 0){const ee=J.normalized,ae=J.itemSize,ye=e.get(J);if(ye===void 0)continue;const Me=ye.buffer,se=ye.type,me=ye.bytesPerElement,be=se===i.INT||se===i.UNSIGNED_INT||J.gpuType===xh;if(J.isInterleavedBufferAttribute){const xe=J.data,Pe=xe.stride,$e=J.offset;if(xe.isInstancedInterleavedBuffer){for(let Qe=0;Qe<Q.locationSize;Qe++)p(Q.location+Qe,xe.meshPerAttribute);C.isInstancedMesh!==!0&&q._maxInstanceCount===void 0&&(q._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let Qe=0;Qe<Q.locationSize;Qe++)A(Q.location+Qe);i.bindBuffer(i.ARRAY_BUFFER,Me);for(let Qe=0;Qe<Q.locationSize;Qe++)b(Q.location+Qe,ae/Q.locationSize,se,ee,Pe*me,($e+ae/Q.locationSize*Qe)*me,be)}else{if(J.isInstancedBufferAttribute){for(let xe=0;xe<Q.locationSize;xe++)p(Q.location+xe,J.meshPerAttribute);C.isInstancedMesh!==!0&&q._maxInstanceCount===void 0&&(q._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let xe=0;xe<Q.locationSize;xe++)A(Q.location+xe);i.bindBuffer(i.ARRAY_BUFFER,Me);for(let xe=0;xe<Q.locationSize;xe++)b(Q.location+xe,ae/Q.locationSize,se,ee,ae*me,ae/Q.locationSize*xe*me,be)}}else if(O!==void 0){const ee=O[j];if(ee!==void 0)switch(ee.length){case 2:i.vertexAttrib2fv(Q.location,ee);break;case 3:i.vertexAttrib3fv(Q.location,ee);break;case 4:i.vertexAttrib4fv(Q.location,ee);break;default:i.vertexAttrib1fv(Q.location,ee)}}}}y()}function M(){T();for(const C in n){const F=n[C];for(const K in F){const q=F[K];for(const $ in q)h(q[$].object),delete q[$];delete F[K]}delete n[C]}}function w(C){if(n[C.id]===void 0)return;const F=n[C.id];for(const K in F){const q=F[K];for(const $ in q)h(q[$].object),delete q[$];delete F[K]}delete n[C.id]}function S(C){for(const F in n){const K=n[F];if(K[C.id]===void 0)continue;const q=K[C.id];for(const $ in q)h(q[$].object),delete q[$];delete K[C.id]}}function T(){v(),a=!0,r!==s&&(r=s,l(r.object))}function v(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:o,reset:T,resetDefaultState:v,dispose:M,releaseStatesOfGeometry:w,releaseStatesOfProgram:S,initAttributes:g,enableAttribute:A,disableUnusedAttributes:y}}function kC(i,e,t){let n;function s(l){n=l}function r(l,h){i.drawArrays(n,l,h),t.update(h,n,1)}function a(l,h,u){u!==0&&(i.drawArraysInstanced(n,l,h,u),t.update(h,n,u))}function o(l,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];t.update(f,n,1)}function c(l,h,u,d){if(u===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<l.length;m++)a(l[m],h[m],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,l,0,h,0,d,0,u);let m=0;for(let g=0;g<u;g++)m+=h[g]*d[g];t.update(m,n,1)}}this.setMode=s,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=c}function UC(i,e,t,n){let s;function r(){if(s!==void 0)return s;if(e.has("EXT_texture_filter_anisotropic")===!0){const S=e.get("EXT_texture_filter_anisotropic");s=i.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else s=0;return s}function a(S){return!(S!==sn&&n.convert(S)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(S){const T=S===Mn&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(S!==tn&&n.convert(S)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&S!==nn&&!T)}function c(S){if(S==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=t.precision!==void 0?t.precision:"highp";const h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);const u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),m=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),A=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),p=i.getParameter(i.MAX_VERTEX_ATTRIBS),y=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),b=i.getParameter(i.MAX_VARYING_VECTORS),_=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),M=m>0,w=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:A,maxAttributes:p,maxVertexUniforms:y,maxVaryings:b,maxFragmentUniforms:_,vertexTextures:M,maxSamples:w}}function OC(i){const e=this;let t=null,n=0,s=!1,r=!1;const a=new Is,o=new rt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||s;return s=d,n=u.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,g=u.clipIntersection,A=u.clipShadows,p=i.get(u);if(!s||m===null||m.length===0||r&&!A)r?h(null):l();else{const y=r?0:n,b=y*4;let _=p.clippingState||null;c.value=_,_=h(m,d,b,f);for(let M=0;M!==b;++M)_[M]=t[M];p.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,m){const g=u!==null?u.length:0;let A=null;if(g!==0){if(A=c.value,m!==!0||A===null){const p=f+g*4,y=d.matrixWorldInverse;o.getNormalMatrix(y),(A===null||A.length<p)&&(A=new Float32Array(p));for(let b=0,_=f;b!==g;++b,_+=4)a.copy(u[b]).applyMatrix4(y,o),a.normal.toArray(A,_),A[_+3]=a.constant}c.value=A,c.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,A}}function QC(i){let e=new WeakMap;function t(a,o){return o===mh?a.mapping=Ks:o===bh&&(a.mapping=Dr),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===mh||o===bh)if(e.has(a)){const c=e.get(a).texture;return t(c,a.mapping)}else{const c=a.image;if(c&&c.height>0){const l=new k_(c.height);return l.fromEquirectangularTexture(i,a),e.set(a,l),a.addEventListener("dispose",s),t(l.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const ca=4,LA=[.125,.215,.35,.446,.526,.582],ir=20,Lu=new Ru,PA=new qe;let Pu=null,ku=0,Uu=0,Ou=!1;const sr=(1+Math.sqrt(5))/2,la=1/sr,kA=[new H(-sr,la,0),new H(sr,la,0),new H(-la,0,sr),new H(la,0,sr),new H(0,sr,-la),new H(0,sr,la),new H(-1,1,-1),new H(1,1,-1),new H(-1,1,1),new H(1,1,1)],GC=new H;class Qu{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,s=100,r={}){const{size:a=256,position:o=GC}=r;Pu=this._renderer.getRenderTarget(),ku=this._renderer.getActiveCubeFace(),Uu=this._renderer.getActiveMipmapLevel(),Ou=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,n,s,c,o),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=QA(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=OA(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Pu,ku,Uu),this._renderer.xr.enabled=Ou,e.scissorTest=!1,jc(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ks||e.mapping===Dr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Pu=this._renderer.getRenderTarget(),ku=this._renderer.getActiveCubeFace(),Uu=this._renderer.getActiveMipmapLevel(),Ou=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}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:zt,minFilter:zt,generateMipmaps:!1,type:Mn,format:sn,colorSpace:rn,depthBuffer:!1},s=UA(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=UA(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=HC(r)),this._blurMaterial=zC(r,e,t)}return s}_compileMaterial(e){const t=new Jt(this._lodPlanes[0],e);this._renderer.compile(t,Lu)}_sceneToCubeUV(e,t,n,s,r){const c=new vn(90,1,t,n),l=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(PA),u.toneMapping=ms,u.autoClear=!1;const m=new Cs({name:"PMREM.Background",side:Sn,depthWrite:!1,depthTest:!1}),g=new Jt(new Jr,m);let A=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,A=!0):(m.color.copy(PA),A=!0);for(let y=0;y<6;y++){const b=y%3;b===0?(c.up.set(0,l[y],0),c.position.set(r.x,r.y,r.z),c.lookAt(r.x+h[y],r.y,r.z)):b===1?(c.up.set(0,0,l[y]),c.position.set(r.x,r.y,r.z),c.lookAt(r.x,r.y+h[y],r.z)):(c.up.set(0,l[y],0),c.position.set(r.x,r.y,r.z),c.lookAt(r.x,r.y,r.z+h[y]));const _=this._cubeSize;jc(s,b*_,y>2?_:0,_,_),u.setRenderTarget(s),A&&u.render(g,c),u.render(e,c)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===Ks||e.mapping===Dr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=QA()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=OA());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new Jt(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=e;const c=this._cubeSize;jc(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(a,Lu)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;r<s;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=kA[(s-r-1)%kA.length];this._blur(e,r-1,r,a,o)}t.autoClear=n}_blur(e,t,n,s,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,s,"latitudinal",r),this._halfBlur(a,e,n,n,s,"longitudinal",r)}_halfBlur(e,t,n,s,r,a,o){const c=this._renderer,l=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new Jt(this._lodPlanes[s],l),d=l.uniforms,f=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*ir-1),g=r/m,A=isFinite(r)?1+Math.floor(h*g):ir;A>ir&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${ir}`);const p=[];let y=0;for(let S=0;S<ir;++S){const T=S/g,v=Math.exp(-T*T/2);p.push(v),S===0?y+=v:S<A&&(y+=2*v)}for(let S=0;S<p.length;S++)p[S]=p[S]/y;d.envMap.value=e.texture,d.samples.value=A,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:b}=this;d.dTheta.value=m,d.mipInt.value=b-n;const _=this._sizeLods[s],M=3*_*(s>b-ca?s-b+ca:0),w=4*(this._cubeSize-_);jc(t,M,w,3*_,2*_),c.setRenderTarget(t),c.render(u,Lu)}}function HC(i){const e=[],t=[],n=[];let s=i;const r=i-ca+1+LA.length;for(let a=0;a<r;a++){const o=Math.pow(2,s);t.push(o);let c=1/o;a>i-ca?c=LA[a-i+ca-1]:a===0&&(c=0),n.push(c);const l=1/(o-2),h=-l,u=1+l,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,g=3,A=2,p=1,y=new Float32Array(g*m*f),b=new Float32Array(A*m*f),_=new Float32Array(p*m*f);for(let w=0;w<f;w++){const S=w%3*2/3-1,T=w>2?0:-1,v=[S,T,0,S+2/3,T,0,S+2/3,T+1,0,S,T,0,S+2/3,T+1,0,S,T+1,0];y.set(v,g*m*w),b.set(d,A*m*w);const C=[w,w,w,w,w,w];_.set(C,p*m*w)}const M=new On;M.setAttribute("position",new En(y,g)),M.setAttribute("uv",new En(b,A)),M.setAttribute("faceIndex",new En(_,p)),e.push(M),s>ca&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function UA(i,e,t){const n=new js(i,e,t);return n.texture.mapping=ic,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function jc(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function zC(i,e,t){const n=new Float32Array(ir),s=new H(0,1,0);return new vs({name:"SphericalGaussianBlur",defines:{n:ir,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Gu(),fragmentShader:`+}`},we={common:{diffuse:{value:new qe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new rt},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new rt}},envmap:{envMap:{value:null},envMapRotation:{value:new rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new rt},normalScale:{value:new Ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new qe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new qe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0},uvTransform:{value:new rt}},sprite:{diffuse:{value:new qe(16777215)},opacity:{value:1},center:{value:new Ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new rt},alphaMap:{value:null},alphaMapTransform:{value:new rt},alphaTest:{value:0}}},Fi={basic:{uniforms:Tn([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.fog]),vertexShader:ot.meshbasic_vert,fragmentShader:ot.meshbasic_frag},lambert:{uniforms:Tn([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new qe(0)}}]),vertexShader:ot.meshlambert_vert,fragmentShader:ot.meshlambert_frag},phong:{uniforms:Tn([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new qe(0)},specular:{value:new qe(1118481)},shininess:{value:30}}]),vertexShader:ot.meshphong_vert,fragmentShader:ot.meshphong_frag},standard:{uniforms:Tn([we.common,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.roughnessmap,we.metalnessmap,we.fog,we.lights,{emissive:{value:new qe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ot.meshphysical_vert,fragmentShader:ot.meshphysical_frag},toon:{uniforms:Tn([we.common,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.gradientmap,we.fog,we.lights,{emissive:{value:new qe(0)}}]),vertexShader:ot.meshtoon_vert,fragmentShader:ot.meshtoon_frag},matcap:{uniforms:Tn([we.common,we.bumpmap,we.normalmap,we.displacementmap,we.fog,{matcap:{value:null}}]),vertexShader:ot.meshmatcap_vert,fragmentShader:ot.meshmatcap_frag},points:{uniforms:Tn([we.points,we.fog]),vertexShader:ot.points_vert,fragmentShader:ot.points_frag},dashed:{uniforms:Tn([we.common,we.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ot.linedashed_vert,fragmentShader:ot.linedashed_frag},depth:{uniforms:Tn([we.common,we.displacementmap]),vertexShader:ot.depth_vert,fragmentShader:ot.depth_frag},normal:{uniforms:Tn([we.common,we.bumpmap,we.normalmap,we.displacementmap,{opacity:{value:1}}]),vertexShader:ot.meshnormal_vert,fragmentShader:ot.meshnormal_frag},sprite:{uniforms:Tn([we.sprite,we.fog]),vertexShader:ot.sprite_vert,fragmentShader:ot.sprite_frag},background:{uniforms:{uvTransform:{value:new rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ot.background_vert,fragmentShader:ot.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new rt}},vertexShader:ot.backgroundCube_vert,fragmentShader:ot.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ot.cube_vert,fragmentShader:ot.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ot.equirect_vert,fragmentShader:ot.equirect_frag},distanceRGBA:{uniforms:Tn([we.common,we.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ot.distanceRGBA_vert,fragmentShader:ot.distanceRGBA_frag},shadow:{uniforms:Tn([we.lights,we.fog,{color:{value:new qe(0)},opacity:{value:1}}]),vertexShader:ot.shadow_vert,fragmentShader:ot.shadow_frag}};Fi.physical={uniforms:Tn([Fi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new rt},clearcoatNormalScale:{value:new Ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new rt},sheen:{value:0},sheenColor:{value:new qe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new rt},transmissionSamplerSize:{value:new Ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new rt},attenuationDistance:{value:0},attenuationColor:{value:new qe(0)},specularColor:{value:new qe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new rt},anisotropyVector:{value:new Ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new rt}}]),vertexShader:ot.meshphysical_vert,fragmentShader:ot.meshphysical_frag};const el={r:0,b:0,g:0},sr=new Ti,Hv=new et;function zv(i,e,t,n,s,r,a){const o=new qe(0);let c=r===!0?0:1,l,h,u=null,d=0,f=null;function m(b){let _=b.isScene===!0?b.background:null;return _&&_.isTexture&&(_=(b.backgroundBlurriness>0?t:e).get(_)),_}function g(b){let _=!1;const M=m(b);M===null?p(o,c):M&&M.isColor&&(p(M,1),_=!0);const w=i.xr.getEnvironmentBlendMode();w==="additive"?n.buffers.color.setClear(0,0,0,1,a):w==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||_)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function A(b,_){const M=m(_);M&&(M.isCubeTexture||M.mapping===cc)?(h===void 0&&(h=new Jt(new $r(1,1,1),new Ss({name:"BackgroundCubeMaterial",uniforms:ea(Fi.backgroundCube.uniforms),vertexShader:Fi.backgroundCube.vertexShader,fragmentShader:Fi.backgroundCube.fragmentShader,side:Sn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(w,S,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),sr.copy(_.backgroundRotation),sr.x*=-1,sr.y*=-1,sr.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(sr.y*=-1,sr.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=_.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Hv.makeRotationFromEuler(sr)),h.material.toneMapped=At.getTransfer(M.colorSpace)!==Mt,(u!==M||d!==M.version||f!==i.toneMapping)&&(h.material.needsUpdate=!0,u=M,d=M.version,f=i.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):M&&M.isTexture&&(l===void 0&&(l=new Jt(new Jc(2,2),new Ss({name:"BackgroundMaterial",uniforms:ea(Fi.background.uniforms),vertexShader:Fi.background.vertexShader,fragmentShader:Fi.background.fragmentShader,side:Gi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=M,l.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,l.material.toneMapped=At.getTransfer(M.colorSpace)!==Mt,M.matrixAutoUpdate===!0&&M.updateMatrix(),l.material.uniforms.uvTransform.value.copy(M.matrix),(u!==M||d!==M.version||f!==i.toneMapping)&&(l.material.needsUpdate=!0,u=M,d=M.version,f=i.toneMapping),l.layers.enableAll(),b.unshift(l,l.geometry,l.material,0,0,null))}function p(b,_){b.getRGB(el,iA(i)),n.buffers.color.setClear(el.r,el.g,el.b,_,a)}function y(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(b,_=1){o.set(b),c=_,p(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(b){c=b,p(o,c)},render:g,addToRenderList:A,dispose:y}}function Vv(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=d(null);let r=s,a=!1;function o(v,F,K,q,$){let D=!1;const O=u(q,K,F);r!==O&&(r=O,l(r.object)),D=f(v,q,K,$),D&&m(v,q,K,$),$!==null&&e.update($,i.ELEMENT_ARRAY_BUFFER),(D||a)&&(a=!1,_(v,F,K,q),$!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function c(){return i.createVertexArray()}function l(v){return i.bindVertexArray(v)}function h(v){return i.deleteVertexArray(v)}function u(v,F,K){const q=K.wireframe===!0;let $=n[v.id];$===void 0&&($={},n[v.id]=$);let D=$[F.id];D===void 0&&(D={},$[F.id]=D);let O=D[q];return O===void 0&&(O=d(c()),D[q]=O),O}function d(v){const F=[],K=[],q=[];for(let $=0;$<t;$++)F[$]=0,K[$]=0,q[$]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:F,enabledAttributes:K,attributeDivisors:q,object:v,attributes:{},index:null}}function f(v,F,K,q){const $=r.attributes,D=F.attributes;let O=0;const Y=K.getAttributes();for(const Q in Y)if(Y[Q].location>=0){const ee=$[Q];let ae=D[Q];if(ae===void 0&&(Q==="instanceMatrix"&&v.instanceMatrix&&(ae=v.instanceMatrix),Q==="instanceColor"&&v.instanceColor&&(ae=v.instanceColor)),ee===void 0||ee.attribute!==ae||ae&&ee.data!==ae.data)return!0;O++}return r.attributesNum!==O||r.index!==q}function m(v,F,K,q){const $={},D=F.attributes;let O=0;const Y=K.getAttributes();for(const Q in Y)if(Y[Q].location>=0){let ee=D[Q];ee===void 0&&(Q==="instanceMatrix"&&v.instanceMatrix&&(ee=v.instanceMatrix),Q==="instanceColor"&&v.instanceColor&&(ee=v.instanceColor));const ae={};ae.attribute=ee,ee&&ee.data&&(ae.data=ee.data),$[Q]=ae,O++}r.attributes=$,r.attributesNum=O,r.index=q}function g(){const v=r.newAttributes;for(let F=0,K=v.length;F<K;F++)v[F]=0}function A(v){p(v,0)}function p(v,F){const K=r.newAttributes,q=r.enabledAttributes,$=r.attributeDivisors;K[v]=1,q[v]===0&&(i.enableVertexAttribArray(v),q[v]=1),$[v]!==F&&(i.vertexAttribDivisor(v,F),$[v]=F)}function y(){const v=r.newAttributes,F=r.enabledAttributes;for(let K=0,q=F.length;K<q;K++)F[K]!==v[K]&&(i.disableVertexAttribArray(K),F[K]=0)}function b(v,F,K,q,$,D,O){O===!0?i.vertexAttribIPointer(v,F,K,$,D):i.vertexAttribPointer(v,F,K,q,$,D)}function _(v,F,K,q){g();const $=q.attributes,D=K.getAttributes(),O=F.defaultAttributeValues;for(const Y in D){const Q=D[Y];if(Q.location>=0){let J=$[Y];if(J===void 0&&(Y==="instanceMatrix"&&v.instanceMatrix&&(J=v.instanceMatrix),Y==="instanceColor"&&v.instanceColor&&(J=v.instanceColor)),J!==void 0){const ee=J.normalized,ae=J.itemSize,ye=e.get(J);if(ye===void 0)continue;const Me=ye.buffer,se=ye.type,me=ye.bytesPerElement,be=se===i.INT||se===i.UNSIGNED_INT||J.gpuType===Ch;if(J.isInterleavedBufferAttribute){const xe=J.data,Pe=xe.stride,$e=J.offset;if(xe.isInstancedInterleavedBuffer){for(let Qe=0;Qe<Q.locationSize;Qe++)p(Q.location+Qe,xe.meshPerAttribute);v.isInstancedMesh!==!0&&q._maxInstanceCount===void 0&&(q._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let Qe=0;Qe<Q.locationSize;Qe++)A(Q.location+Qe);i.bindBuffer(i.ARRAY_BUFFER,Me);for(let Qe=0;Qe<Q.locationSize;Qe++)b(Q.location+Qe,ae/Q.locationSize,se,ee,Pe*me,($e+ae/Q.locationSize*Qe)*me,be)}else{if(J.isInstancedBufferAttribute){for(let xe=0;xe<Q.locationSize;xe++)p(Q.location+xe,J.meshPerAttribute);v.isInstancedMesh!==!0&&q._maxInstanceCount===void 0&&(q._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let xe=0;xe<Q.locationSize;xe++)A(Q.location+xe);i.bindBuffer(i.ARRAY_BUFFER,Me);for(let xe=0;xe<Q.locationSize;xe++)b(Q.location+xe,ae/Q.locationSize,se,ee,ae*me,ae/Q.locationSize*xe*me,be)}}else if(O!==void 0){const ee=O[Y];if(ee!==void 0)switch(ee.length){case 2:i.vertexAttrib2fv(Q.location,ee);break;case 3:i.vertexAttrib3fv(Q.location,ee);break;case 4:i.vertexAttrib4fv(Q.location,ee);break;default:i.vertexAttrib1fv(Q.location,ee)}}}}y()}function M(){T();for(const v in n){const F=n[v];for(const K in F){const q=F[K];for(const $ in q)h(q[$].object),delete q[$];delete F[K]}delete n[v]}}function w(v){if(n[v.id]===void 0)return;const F=n[v.id];for(const K in F){const q=F[K];for(const $ in q)h(q[$].object),delete q[$];delete F[K]}delete n[v.id]}function S(v){for(const F in n){const K=n[F];if(K[v.id]===void 0)continue;const q=K[v.id];for(const $ in q)h(q[$].object),delete q[$];delete K[v.id]}}function T(){C(),a=!0,r!==s&&(r=s,l(r.object))}function C(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:o,reset:T,resetDefaultState:C,dispose:M,releaseStatesOfGeometry:w,releaseStatesOfProgram:S,initAttributes:g,enableAttribute:A,disableUnusedAttributes:y}}function Wv(i,e,t){let n;function s(l){n=l}function r(l,h){i.drawArrays(n,l,h),t.update(h,n,1)}function a(l,h,u){u!==0&&(i.drawArraysInstanced(n,l,h,u),t.update(h,n,u))}function o(l,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];t.update(f,n,1)}function c(l,h,u,d){if(u===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<l.length;m++)a(l[m],h[m],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,l,0,h,0,d,0,u);let m=0;for(let g=0;g<u;g++)m+=h[g]*d[g];t.update(m,n,1)}}this.setMode=s,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=c}function qv(i,e,t,n){let s;function r(){if(s!==void 0)return s;if(e.has("EXT_texture_filter_anisotropic")===!0){const S=e.get("EXT_texture_filter_anisotropic");s=i.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else s=0;return s}function a(S){return!(S!==sn&&n.convert(S)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(S){const T=S===Mn&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(S!==tn&&n.convert(S)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&S!==nn&&!T)}function c(S){if(S==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=t.precision!==void 0?t.precision:"highp";const h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);const u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),m=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),A=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),p=i.getParameter(i.MAX_VERTEX_ATTRIBS),y=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),b=i.getParameter(i.MAX_VARYING_VECTORS),_=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),M=m>0,w=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:A,maxAttributes:p,maxVertexUniforms:y,maxVaryings:b,maxFragmentUniforms:_,vertexTextures:M,maxSamples:w}}function Kv(i){const e=this;let t=null,n=0,s=!1,r=!1;const a=new Ms,o=new rt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||s;return s=d,n=u.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,g=u.clipIntersection,A=u.clipShadows,p=i.get(u);if(!s||m===null||m.length===0||r&&!A)r?h(null):l();else{const y=r?0:n,b=y*4;let _=p.clippingState||null;c.value=_,_=h(m,d,b,f);for(let M=0;M!==b;++M)_[M]=t[M];p.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,m){const g=u!==null?u.length:0;let A=null;if(g!==0){if(A=c.value,m!==!0||A===null){const p=f+g*4,y=d.matrixWorldInverse;o.getNormalMatrix(y),(A===null||A.length<p)&&(A=new Float32Array(p));for(let b=0,_=f;b!==g;++b,_+=4)a.copy(u[b]).applyMatrix4(y,o),a.normal.toArray(A,_),A[_+3]=a.constant}c.value=A,c.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,A}}function jv(i){let e=new WeakMap;function t(a,o){return o===wh?a.mapping=Xs:o===vh&&(a.mapping=Pr),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===wh||o===vh)if(e.has(a)){const c=e.get(a).texture;return t(c,a.mapping)}else{const c=a.image;if(c&&c.height>0){const l=new W_(c.height);return l.fromEquirectangularTexture(i,a),e.set(a,l),a.addEventListener("dispose",s),t(l.texture,a.mapping)}else return null}}return a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const ha=4,GA=[.125,.215,.35,.446,.526,.582],rr=20,Gu=new ku,HA=new qe;let Hu=null,zu=0,Vu=0,Wu=!1;const ar=(1+Math.sqrt(5))/2,ua=1/ar,zA=[new H(-ar,ua,0),new H(ar,ua,0),new H(-ua,0,ar),new H(ua,0,ar),new H(0,ar,-ua),new H(0,ar,ua),new H(-1,1,-1),new H(1,1,-1),new H(-1,1,1),new H(1,1,1)],Xv=new H;class qu{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,s=100,r={}){const{size:a=256,position:o=Xv}=r;Hu=this._renderer.getRenderTarget(),zu=this._renderer.getActiveCubeFace(),Vu=this._renderer.getActiveMipmapLevel(),Wu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,n,s,c,o),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=qA(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=WA(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Hu,zu,Vu),this._renderer.xr.enabled=Wu,e.scissorTest=!1,tl(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Xs||e.mapping===Pr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Hu=this._renderer.getRenderTarget(),zu=this._renderer.getActiveCubeFace(),Vu=this._renderer.getActiveMipmapLevel(),Wu=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}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:zt,minFilter:zt,generateMipmaps:!1,type:Mn,format:sn,colorSpace:rn,depthBuffer:!1},s=VA(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=VA(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Yv(r)),this._blurMaterial=Jv(r,e,t)}return s}_compileMaterial(e){const t=new Jt(this._lodPlanes[0],e);this._renderer.compile(t,Gu)}_sceneToCubeUV(e,t,n,s,r){const c=new Cn(90,1,t,n),l=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(HA),u.toneMapping=bs,u.autoClear=!1;const m=new Cs({name:"PMREM.Background",side:Sn,depthWrite:!1,depthTest:!1}),g=new Jt(new $r,m);let A=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,A=!0):(m.color.copy(HA),A=!0);for(let y=0;y<6;y++){const b=y%3;b===0?(c.up.set(0,l[y],0),c.position.set(r.x,r.y,r.z),c.lookAt(r.x+h[y],r.y,r.z)):b===1?(c.up.set(0,0,l[y]),c.position.set(r.x,r.y,r.z),c.lookAt(r.x,r.y+h[y],r.z)):(c.up.set(0,l[y],0),c.position.set(r.x,r.y,r.z),c.lookAt(r.x,r.y,r.z+h[y]));const _=this._cubeSize;tl(s,b*_,y>2?_:0,_,_),u.setRenderTarget(s),A&&u.render(g,c),u.render(e,c)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===Xs||e.mapping===Pr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=qA()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=WA());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new Jt(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=e;const c=this._cubeSize;tl(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(a,Gu)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;r<s;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=zA[(s-r-1)%zA.length];this._blur(e,r-1,r,a,o)}t.autoClear=n}_blur(e,t,n,s,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,s,"latitudinal",r),this._halfBlur(a,e,n,n,s,"longitudinal",r)}_halfBlur(e,t,n,s,r,a,o){const c=this._renderer,l=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new Jt(this._lodPlanes[s],l),d=l.uniforms,f=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*rr-1),g=r/m,A=isFinite(r)?1+Math.floor(h*g):rr;A>rr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${rr}`);const p=[];let y=0;for(let S=0;S<rr;++S){const T=S/g,C=Math.exp(-T*T/2);p.push(C),S===0?y+=C:S<A&&(y+=2*C)}for(let S=0;S<p.length;S++)p[S]=p[S]/y;d.envMap.value=e.texture,d.samples.value=A,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:b}=this;d.dTheta.value=m,d.mipInt.value=b-n;const _=this._sizeLods[s],M=3*_*(s>b-ha?s-b+ha:0),w=4*(this._cubeSize-_);tl(t,M,w,3*_,2*_),c.setRenderTarget(t),c.render(u,Gu)}}function Yv(i){const e=[],t=[],n=[];let s=i;const r=i-ha+1+GA.length;for(let a=0;a<r;a++){const o=Math.pow(2,s);t.push(o);let c=1/o;a>i-ha?c=GA[a-i+ha-1]:a===0&&(c=0),n.push(c);const l=1/(o-2),h=-l,u=1+l,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,g=3,A=2,p=1,y=new Float32Array(g*m*f),b=new Float32Array(A*m*f),_=new Float32Array(p*m*f);for(let w=0;w<f;w++){const S=w%3*2/3-1,T=w>2?0:-1,C=[S,T,0,S+2/3,T,0,S+2/3,T+1,0,S,T,0,S+2/3,T+1,0,S,T+1,0];y.set(C,g*m*w),b.set(d,A*m*w);const v=[w,w,w,w,w,w];_.set(v,p*m*w)}const M=new On;M.setAttribute("position",new En(y,g)),M.setAttribute("uv",new En(b,A)),M.setAttribute("faceIndex",new En(_,p)),e.push(M),s>ha&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function VA(i,e,t){const n=new Zs(i,e,t);return n.texture.mapping=cc,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function tl(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function Jv(i,e,t){const n=new Float32Array(rr),s=new H(0,1,0);return new Ss({name:"SphericalGaussianBlur",defines:{n:rr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Ku(),fragmentShader:`precision mediump float;precision mediump int;@@ -3623,7 +3623,7 @@ void main() {}}- `,blending:gs,depthTest:!1,depthWrite:!1})}function OA(){return new vs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Gu(),fragmentShader:`+ `,blending:ms,depthTest:!1,depthWrite:!1})}function WA(){return new Ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ku(),fragmentShader:`precision mediump float;precision mediump int;@@ -3642,7 +3642,7 @@ void main() {gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );}- `,blending:gs,depthTest:!1,depthWrite:!1})}function QA(){return new vs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Gu(),fragmentShader:`+ `,blending:ms,depthTest:!1,depthWrite:!1})}function qA(){return new Ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ku(),fragmentShader:`precision mediump float;precision mediump int;@@ -3658,7 +3658,7 @@ void main() {gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );}- `,blending:gs,depthTest:!1,depthWrite:!1})}function Gu(){return`+ `,blending:ms,depthTest:!1,depthWrite:!1})}function Ku(){return`precision mediump float;precision mediump int;@@ -3713,17 +3713,17 @@ void main() {gl_Position = vec4( position, 1.0 );}- `}function VC(i){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const c=o.mapping,l=c===mh||c===bh,h=c===Ks||c===Dr;if(l||h){let u=e.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return t===null&&(t=new Qu(i)),u=l?t.fromEquirectangular(o,u):t.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return l&&f&&f.height>0||h&&f&&s(f)?(t===null&&(t=new Qu(i)),u=l?t.fromEquirectangular(o):t.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),o.addEventListener("dispose",r),u.texture):null}}}return o}function s(o){let c=0;const l=6;for(let h=0;h<l;h++)o[h]!==void 0&&c++;return c===l}function r(o){const c=o.target;c.removeEventListener("dispose",r);const l=e.get(c);l!==void 0&&(e.delete(c),l.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function WC(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let s;switch(n){case"WEBGL_depth_texture":s=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":s=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":s=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":s=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:s=i.getExtension(n)}return e[n]=s,s}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const s=t(n);return s===null&&mc("THREE.WebGLRenderer: "+n+" extension not supported."),s}}}function qC(i,e,t,n){const s={},r=new WeakMap;function a(u){const d=u.target;d.index!==null&&e.remove(d.index);for(const m in d.attributes)e.remove(d.attributes[m]);d.removeEventListener("dispose",a),delete s[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--}function o(u,d){return s[d.id]===!0||(d.addEventListener("dispose",a),s[d.id]=!0,t.memory.geometries++),d}function c(u){const d=u.attributes;for(const f in d)e.update(d[f],i.ARRAY_BUFFER)}function l(u){const d=[],f=u.index,m=u.attributes.position;let g=0;if(f!==null){const y=f.array;g=f.version;for(let b=0,_=y.length;b<_;b+=3){const M=y[b+0],w=y[b+1],S=y[b+2];d.push(M,w,w,S,S,M)}}else if(m!==void 0){const y=m.array;g=m.version;for(let b=0,_=y.length/3-1;b<_;b+=3){const M=b+0,w=b+1,S=b+2;d.push(M,w,w,S,S,M)}}else return;const A=new(Mp(d)?Kp:qp)(d,1);A.version=g;const p=r.get(u);p&&e.remove(p),r.set(u,A)}function h(u){const d=r.get(u);if(d){const f=u.index;f!==null&&d.version<f.version&&l(u)}else l(u);return r.get(u)}return{get:o,update:c,getWireframeAttribute:h}}function KC(i,e,t){let n;function s(d){n=d}let r,a;function o(d){r=d.type,a=d.bytesPerElement}function c(d,f){i.drawElements(n,f,r,d*a),t.update(f,n,1)}function l(d,f,m){m!==0&&(i.drawElementsInstanced(n,f,r,d*a,m),t.update(f,n,m))}function h(d,f,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,r,d,0,m);let A=0;for(let p=0;p<m;p++)A+=f[p];t.update(A,n,1)}function u(d,f,m,g){if(m===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d.length;p++)l(d[p]/a,f[p],g[p]);else{A.multiDrawElementsInstancedWEBGL(n,f,0,r,d,0,g,0,m);let p=0;for(let y=0;y<m;y++)p+=f[y]*g[y];t.update(p,n,1)}}this.setMode=s,this.setIndex=o,this.render=c,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function XC(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=o*(r/3);break;case i.LINES:t.lines+=o*(r/2);break;case i.LINE_STRIP:t.lines+=o*(r-1);break;case i.LINE_LOOP:t.lines+=o*r;break;case i.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function s(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:s,update:n}}function YC(i,e,t){const n=new WeakMap,s=new _t;function r(a,o,c){const l=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let v=function(){S.dispose(),n.delete(o),o.removeEventListener("dispose",v)};d!==void 0&&d.texture.dispose();const f=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,A=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],y=o.morphAttributes.color||[];let b=0;f===!0&&(b=1),m===!0&&(b=2),g===!0&&(b=3);let _=o.attributes.position.count*b,M=1;_>e.maxTextureSize&&(M=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const w=new Float32Array(_*M*4*u),S=new Np(w,_,M,u);S.type=nn,S.needsUpdate=!0;const T=b*4;for(let C=0;C<u;C++){const F=A[C],K=p[C],q=y[C],$=_*M*4*C;for(let D=0;D<F.count;D++){const O=D*T;f===!0&&(s.fromBufferAttribute(F,D),w[$+O+0]=s.x,w[$+O+1]=s.y,w[$+O+2]=s.z,w[$+O+3]=0),m===!0&&(s.fromBufferAttribute(K,D),w[$+O+4]=s.x,w[$+O+5]=s.y,w[$+O+6]=s.z,w[$+O+7]=0),g===!0&&(s.fromBufferAttribute(q,D),w[$+O+8]=s.x,w[$+O+9]=s.y,w[$+O+10]=s.z,w[$+O+11]=q.itemSize===4?s.w:1)}}d={count:u,texture:S,size:new Ze(_,M)},n.set(o,d),o.addEventListener("dispose",v)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)c.getUniforms().setValue(i,"morphTexture",a.morphTexture,t);else{let f=0;for(let g=0;g<l.length;g++)f+=l[g];const m=o.morphTargetsRelative?1:1-f;c.getUniforms().setValue(i,"morphTargetBaseInfluence",m),c.getUniforms().setValue(i,"morphTargetInfluences",l)}c.getUniforms().setValue(i,"morphTargetsTexture",d.texture,t),c.getUniforms().setValue(i,"morphTargetsTextureSize",d.size)}return{update:r}}function jC(i,e,t,n){let s=new WeakMap;function r(c){const l=n.render.frame,h=c.geometry,u=e.get(c,h);if(s.get(u)!==l&&(e.update(u),s.set(u,l)),c.isInstancedMesh&&(c.hasEventListener("dispose",o)===!1&&c.addEventListener("dispose",o),s.get(c)!==l&&(t.update(c.instanceMatrix,i.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,i.ARRAY_BUFFER),s.set(c,l))),c.isSkinnedMesh){const d=c.skeleton;s.get(d)!==l&&(d.update(),s.set(d,l))}return u}function a(){s=new WeakMap}function o(c){const l=c.target;l.removeEventListener("dispose",o),t.remove(l.instanceMatrix),l.instanceColor!==null&&t.remove(l.instanceColor)}return{update:r,dispose:a}}const GA=new an,HA=new bA(1,1),zA=new Np,VA=new Fp,WA=new tA,qA=[],KA=[],XA=new Float32Array(16),YA=new Float32Array(9),jA=new Float32Array(4);function ha(i,e,t){const n=i[0];if(n<=0||n>0)return i;const s=e*t;let r=qA[s];if(r===void 0&&(r=new Float32Array(s),qA[s]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,i[a].toArray(r,o)}return r}function on(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function cn(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function Jc(i,e){let t=KA[e];t===void 0&&(t=new Int32Array(e),KA[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function JC(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function ZC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;i.uniform2fv(this.addr,e),cn(t,e)}}function $C(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(on(t,e))return;i.uniform3fv(this.addr,e),cn(t,e)}}function ev(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;i.uniform4fv(this.addr,e),cn(t,e)}}function tv(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(on(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),cn(t,e)}else{if(on(t,n))return;jA.set(n),i.uniformMatrix2fv(this.addr,!1,jA),cn(t,n)}}function nv(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(on(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),cn(t,e)}else{if(on(t,n))return;YA.set(n),i.uniformMatrix3fv(this.addr,!1,YA),cn(t,n)}}function iv(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(on(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),cn(t,e)}else{if(on(t,n))return;XA.set(n),i.uniformMatrix4fv(this.addr,!1,XA),cn(t,n)}}function sv(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function rv(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;i.uniform2iv(this.addr,e),cn(t,e)}}function av(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(on(t,e))return;i.uniform3iv(this.addr,e),cn(t,e)}}function ov(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;i.uniform4iv(this.addr,e),cn(t,e)}}function cv(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function lv(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;i.uniform2uiv(this.addr,e),cn(t,e)}}function hv(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(on(t,e))return;i.uniform3uiv(this.addr,e),cn(t,e)}}function uv(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;i.uniform4uiv(this.addr,e),cn(t,e)}}function dv(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s);let r;this.type===i.SAMPLER_2D_SHADOW?(HA.compareFunction=Cp,r=HA):r=GA,t.setTexture2D(e||r,s)}function fv(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture3D(e||VA,s)}function pv(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTextureCube(e||WA,s)}function Av(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2DArray(e||zA,s)}function gv(i){switch(i){case 5126:return JC;case 35664:return ZC;case 35665:return $C;case 35666:return ev;case 35674:return tv;case 35675:return nv;case 35676:return iv;case 5124:case 35670:return sv;case 35667:case 35671:return rv;case 35668:case 35672:return av;case 35669:case 35673:return ov;case 5125:return cv;case 36294:return lv;case 36295:return hv;case 36296:return uv;case 35678:case 36198:case 36298:case 36306:case 35682:return dv;case 35679:case 36299:case 36307:return fv;case 35680:case 36300:case 36308:case 36293:return pv;case 36289:case 36303:case 36311:case 36292:return Av}}function mv(i,e){i.uniform1fv(this.addr,e)}function bv(i,e){const t=ha(e,this.size,2);i.uniform2fv(this.addr,t)}function xv(i,e){const t=ha(e,this.size,3);i.uniform3fv(this.addr,t)}function Ev(i,e){const t=ha(e,this.size,4);i.uniform4fv(this.addr,t)}function _v(i,e){const t=ha(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function yv(i,e){const t=ha(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function wv(i,e){const t=ha(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function Cv(i,e){i.uniform1iv(this.addr,e)}function vv(i,e){i.uniform2iv(this.addr,e)}function Sv(i,e){i.uniform3iv(this.addr,e)}function Iv(i,e){i.uniform4iv(this.addr,e)}function Mv(i,e){i.uniform1uiv(this.addr,e)}function Bv(i,e){i.uniform2uiv(this.addr,e)}function Tv(i,e){i.uniform3uiv(this.addr,e)}function Rv(i,e){i.uniform4uiv(this.addr,e)}function Nv(i,e,t){const n=this.cache,s=e.length,r=Jc(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTexture2D(e[a]||GA,r[a])}function Fv(i,e,t){const n=this.cache,s=e.length,r=Jc(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTexture3D(e[a]||VA,r[a])}function Dv(i,e,t){const n=this.cache,s=e.length,r=Jc(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTextureCube(e[a]||WA,r[a])}function Lv(i,e,t){const n=this.cache,s=e.length,r=Jc(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTexture2DArray(e[a]||zA,r[a])}function Pv(i){switch(i){case 5126:return mv;case 35664:return bv;case 35665:return xv;case 35666:return Ev;case 35674:return _v;case 35675:return yv;case 35676:return wv;case 5124:case 35670:return Cv;case 35667:case 35671:return vv;case 35668:case 35672:return Sv;case 35669:case 35673:return Iv;case 5125:return Mv;case 36294:return Bv;case 36295:return Tv;case 36296:return Rv;case 35678:case 36198:case 36298:case 36306:case 35682:return Nv;case 35679:case 36299:case 36307:return Fv;case 35680:case 36300:case 36308:case 36293:return Dv;case 36289:case 36303:case 36311:case 36292:return Lv}}class kv{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=gv(t.type)}}class Uv{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Pv(t.type)}}class Ov{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const s=this.seq;for(let r=0,a=s.length;r!==a;++r){const o=s[r];o.setValue(e,t[o.id],n)}}}const Hu=/(\w+)(\])?(\[|\.)?/g;function JA(i,e){i.seq.push(e),i.map[e.id]=e}function Qv(i,e,t){const n=i.name,s=n.length;for(Hu.lastIndex=0;;){const r=Hu.exec(n),a=Hu.lastIndex;let o=r[1];const c=r[2]==="]",l=r[3];if(c&&(o=o|0),l===void 0||l==="["&&a+2===s){JA(t,l===void 0?new kv(o,i,e):new Uv(o,i,e));break}else{let u=t.map[o];u===void 0&&(u=new Ov(o),JA(t,u)),t=u}}}class Zc{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<n;++s){const r=e.getActiveUniform(t,s),a=e.getUniformLocation(t,r.name);Qv(r,a,this)}}setValue(e,t,n,s){const r=this.map[t];r!==void 0&&r.setValue(e,n,s)}setOptional(e,t,n){const s=t[n];s!==void 0&&this.setValue(e,n,s)}static upload(e,t,n,s){for(let r=0,a=t.length;r!==a;++r){const o=t[r],c=n[o.id];c.needsUpdate!==!1&&o.setValue(e,c.value,s)}}static seqWithValue(e,t){const n=[];for(let s=0,r=e.length;s!==r;++s){const a=e[s];a.id in t&&n.push(a)}return n}}function ZA(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const Gv=37297;let Hv=0;function zv(i,e){const t=i.split(`+ `}function Zv(i){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const c=o.mapping,l=c===wh||c===vh,h=c===Xs||c===Pr;if(l||h){let u=e.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return t===null&&(t=new qu(i)),u=l?t.fromEquirectangular(o,u):t.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return l&&f&&f.height>0||h&&f&&s(f)?(t===null&&(t=new qu(i)),u=l?t.fromEquirectangular(o):t.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,e.set(o,u),o.addEventListener("dispose",r),u.texture):null}}}return o}function s(o){let c=0;const l=6;for(let h=0;h<l;h++)o[h]!==void 0&&c++;return c===l}function r(o){const c=o.target;c.removeEventListener("dispose",r);const l=e.get(c);l!==void 0&&(e.delete(c),l.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function $v(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let s;switch(n){case"WEBGL_depth_texture":s=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":s=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":s=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":s=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:s=i.getExtension(n)}return e[n]=s,s}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const s=t(n);return s===null&&yc("THREE.WebGLRenderer: "+n+" extension not supported."),s}}}function eC(i,e,t,n){const s={},r=new WeakMap;function a(u){const d=u.target;d.index!==null&&e.remove(d.index);for(const m in d.attributes)e.remove(d.attributes[m]);d.removeEventListener("dispose",a),delete s[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--}function o(u,d){return s[d.id]===!0||(d.addEventListener("dispose",a),s[d.id]=!0,t.memory.geometries++),d}function c(u){const d=u.attributes;for(const f in d)e.update(d[f],i.ARRAY_BUFFER)}function l(u){const d=[],f=u.index,m=u.attributes.position;let g=0;if(f!==null){const y=f.array;g=f.version;for(let b=0,_=y.length;b<_;b+=3){const M=y[b+0],w=y[b+1],S=y[b+2];d.push(M,w,w,S,S,M)}}else if(m!==void 0){const y=m.array;g=m.version;for(let b=0,_=y.length/3-1;b<_;b+=3){const M=b+0,w=b+1,S=b+2;d.push(M,w,w,S,S,M)}}else return;const A=new(Dp(d)?$p:Zp)(d,1);A.version=g;const p=r.get(u);p&&e.remove(p),r.set(u,A)}function h(u){const d=r.get(u);if(d){const f=u.index;f!==null&&d.version<f.version&&l(u)}else l(u);return r.get(u)}return{get:o,update:c,getWireframeAttribute:h}}function tC(i,e,t){let n;function s(d){n=d}let r,a;function o(d){r=d.type,a=d.bytesPerElement}function c(d,f){i.drawElements(n,f,r,d*a),t.update(f,n,1)}function l(d,f,m){m!==0&&(i.drawElementsInstanced(n,f,r,d*a,m),t.update(f,n,m))}function h(d,f,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,r,d,0,m);let A=0;for(let p=0;p<m;p++)A+=f[p];t.update(A,n,1)}function u(d,f,m,g){if(m===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d.length;p++)l(d[p]/a,f[p],g[p]);else{A.multiDrawElementsInstancedWEBGL(n,f,0,r,d,0,g,0,m);let p=0;for(let y=0;y<m;y++)p+=f[y]*g[y];t.update(p,n,1)}}this.setMode=s,this.setIndex=o,this.render=c,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function nC(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=o*(r/3);break;case i.LINES:t.lines+=o*(r/2);break;case i.LINE_STRIP:t.lines+=o*(r-1);break;case i.LINE_LOOP:t.lines+=o*r;break;case i.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function s(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:s,update:n}}function iC(i,e,t){const n=new WeakMap,s=new _t;function r(a,o,c){const l=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let C=function(){S.dispose(),n.delete(o),o.removeEventListener("dispose",C)};d!==void 0&&d.texture.dispose();const f=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,A=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],y=o.morphAttributes.color||[];let b=0;f===!0&&(b=1),m===!0&&(b=2),g===!0&&(b=3);let _=o.attributes.position.count*b,M=1;_>e.maxTextureSize&&(M=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const w=new Float32Array(_*M*4*u),S=new Up(w,_,M,u);S.type=nn,S.needsUpdate=!0;const T=b*4;for(let v=0;v<u;v++){const F=A[v],K=p[v],q=y[v],$=_*M*4*v;for(let D=0;D<F.count;D++){const O=D*T;f===!0&&(s.fromBufferAttribute(F,D),w[$+O+0]=s.x,w[$+O+1]=s.y,w[$+O+2]=s.z,w[$+O+3]=0),m===!0&&(s.fromBufferAttribute(K,D),w[$+O+4]=s.x,w[$+O+5]=s.y,w[$+O+6]=s.z,w[$+O+7]=0),g===!0&&(s.fromBufferAttribute(q,D),w[$+O+8]=s.x,w[$+O+9]=s.y,w[$+O+10]=s.z,w[$+O+11]=q.itemSize===4?s.w:1)}}d={count:u,texture:S,size:new Ze(_,M)},n.set(o,d),o.addEventListener("dispose",C)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)c.getUniforms().setValue(i,"morphTexture",a.morphTexture,t);else{let f=0;for(let g=0;g<l.length;g++)f+=l[g];const m=o.morphTargetsRelative?1:1-f;c.getUniforms().setValue(i,"morphTargetBaseInfluence",m),c.getUniforms().setValue(i,"morphTargetInfluences",l)}c.getUniforms().setValue(i,"morphTargetsTexture",d.texture,t),c.getUniforms().setValue(i,"morphTargetsTextureSize",d.size)}return{update:r}}function sC(i,e,t,n){let s=new WeakMap;function r(c){const l=n.render.frame,h=c.geometry,u=e.get(c,h);if(s.get(u)!==l&&(e.update(u),s.set(u,l)),c.isInstancedMesh&&(c.hasEventListener("dispose",o)===!1&&c.addEventListener("dispose",o),s.get(c)!==l&&(t.update(c.instanceMatrix,i.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,i.ARRAY_BUFFER),s.set(c,l))),c.isSkinnedMesh){const d=c.skeleton;s.get(d)!==l&&(d.update(),s.set(d,l))}return u}function a(){s=new WeakMap}function o(c){const l=c.target;l.removeEventListener("dispose",o),t.remove(l.instanceMatrix),l.instanceColor!==null&&t.remove(l.instanceColor)}return{update:r,dispose:a}}const KA=new an,jA=new vA(1,1),XA=new Up,YA=new Op,JA=new oA,ZA=[],$A=[],eg=new Float32Array(16),tg=new Float32Array(9),ng=new Float32Array(4);function da(i,e,t){const n=i[0];if(n<=0||n>0)return i;const s=e*t;let r=ZA[s];if(r===void 0&&(r=new Float32Array(s),ZA[s]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,i[a].toArray(r,o)}return r}function on(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function cn(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function nl(i,e){let t=$A[e];t===void 0&&(t=new Int32Array(e),$A[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function rC(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function aC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;i.uniform2fv(this.addr,e),cn(t,e)}}function oC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(on(t,e))return;i.uniform3fv(this.addr,e),cn(t,e)}}function cC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;i.uniform4fv(this.addr,e),cn(t,e)}}function lC(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(on(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),cn(t,e)}else{if(on(t,n))return;ng.set(n),i.uniformMatrix2fv(this.addr,!1,ng),cn(t,n)}}function hC(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(on(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),cn(t,e)}else{if(on(t,n))return;tg.set(n),i.uniformMatrix3fv(this.addr,!1,tg),cn(t,n)}}function uC(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(on(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),cn(t,e)}else{if(on(t,n))return;eg.set(n),i.uniformMatrix4fv(this.addr,!1,eg),cn(t,n)}}function dC(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function fC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;i.uniform2iv(this.addr,e),cn(t,e)}}function pC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(on(t,e))return;i.uniform3iv(this.addr,e),cn(t,e)}}function AC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;i.uniform4iv(this.addr,e),cn(t,e)}}function gC(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function mC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;i.uniform2uiv(this.addr,e),cn(t,e)}}function bC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(on(t,e))return;i.uniform3uiv(this.addr,e),cn(t,e)}}function xC(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;i.uniform4uiv(this.addr,e),cn(t,e)}}function EC(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s);let r;this.type===i.SAMPLER_2D_SHADOW?(jA.compareFunction=Tp,r=jA):r=KA,t.setTexture2D(e||r,s)}function _C(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture3D(e||YA,s)}function yC(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTextureCube(e||JA,s)}function wC(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2DArray(e||XA,s)}function vC(i){switch(i){case 5126:return rC;case 35664:return aC;case 35665:return oC;case 35666:return cC;case 35674:return lC;case 35675:return hC;case 35676:return uC;case 5124:case 35670:return dC;case 35667:case 35671:return fC;case 35668:case 35672:return pC;case 35669:case 35673:return AC;case 5125:return gC;case 36294:return mC;case 36295:return bC;case 36296:return xC;case 35678:case 36198:case 36298:case 36306:case 35682:return EC;case 35679:case 36299:case 36307:return _C;case 35680:case 36300:case 36308:case 36293:return yC;case 36289:case 36303:case 36311:case 36292:return wC}}function CC(i,e){i.uniform1fv(this.addr,e)}function SC(i,e){const t=da(e,this.size,2);i.uniform2fv(this.addr,t)}function IC(i,e){const t=da(e,this.size,3);i.uniform3fv(this.addr,t)}function MC(i,e){const t=da(e,this.size,4);i.uniform4fv(this.addr,t)}function BC(i,e){const t=da(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function TC(i,e){const t=da(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function RC(i,e){const t=da(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function NC(i,e){i.uniform1iv(this.addr,e)}function FC(i,e){i.uniform2iv(this.addr,e)}function DC(i,e){i.uniform3iv(this.addr,e)}function LC(i,e){i.uniform4iv(this.addr,e)}function PC(i,e){i.uniform1uiv(this.addr,e)}function kC(i,e){i.uniform2uiv(this.addr,e)}function UC(i,e){i.uniform3uiv(this.addr,e)}function OC(i,e){i.uniform4uiv(this.addr,e)}function QC(i,e,t){const n=this.cache,s=e.length,r=nl(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTexture2D(e[a]||KA,r[a])}function GC(i,e,t){const n=this.cache,s=e.length,r=nl(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTexture3D(e[a]||YA,r[a])}function HC(i,e,t){const n=this.cache,s=e.length,r=nl(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTextureCube(e[a]||JA,r[a])}function zC(i,e,t){const n=this.cache,s=e.length,r=nl(t,s);on(n,r)||(i.uniform1iv(this.addr,r),cn(n,r));for(let a=0;a!==s;++a)t.setTexture2DArray(e[a]||XA,r[a])}function VC(i){switch(i){case 5126:return CC;case 35664:return SC;case 35665:return IC;case 35666:return MC;case 35674:return BC;case 35675:return TC;case 35676:return RC;case 5124:case 35670:return NC;case 35667:case 35671:return FC;case 35668:case 35672:return DC;case 35669:case 35673:return LC;case 5125:return PC;case 36294:return kC;case 36295:return UC;case 36296:return OC;case 35678:case 36198:case 36298:case 36306:case 35682:return QC;case 35679:case 36299:case 36307:return GC;case 35680:case 36300:case 36308:case 36293:return HC;case 36289:case 36303:case 36311:case 36292:return zC}}class WC{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=vC(t.type)}}class qC{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=VC(t.type)}}class KC{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const s=this.seq;for(let r=0,a=s.length;r!==a;++r){const o=s[r];o.setValue(e,t[o.id],n)}}}const ju=/(\w+)(\])?(\[|\.)?/g;function ig(i,e){i.seq.push(e),i.map[e.id]=e}function jC(i,e,t){const n=i.name,s=n.length;for(ju.lastIndex=0;;){const r=ju.exec(n),a=ju.lastIndex;let o=r[1];const c=r[2]==="]",l=r[3];if(c&&(o=o|0),l===void 0||l==="["&&a+2===s){ig(t,l===void 0?new WC(o,i,e):new qC(o,i,e));break}else{let u=t.map[o];u===void 0&&(u=new KC(o),ig(t,u)),t=u}}}class il{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<n;++s){const r=e.getActiveUniform(t,s),a=e.getUniformLocation(t,r.name);jC(r,a,this)}}setValue(e,t,n,s){const r=this.map[t];r!==void 0&&r.setValue(e,n,s)}setOptional(e,t,n){const s=t[n];s!==void 0&&this.setValue(e,n,s)}static upload(e,t,n,s){for(let r=0,a=t.length;r!==a;++r){const o=t[r],c=n[o.id];c.needsUpdate!==!1&&o.setValue(e,c.value,s)}}static seqWithValue(e,t){const n=[];for(let s=0,r=e.length;s!==r;++s){const a=e[s];a.id in t&&n.push(a)}return n}}function sg(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const XC=37297;let YC=0;function JC(i,e){const t=i.split(``),n=[],s=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let a=s;a<r;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`-`)}const $A=new rt;function Vv(i){At._getMatrix($A,At.workingColorSpace,i);const e=`mat3( ${$A.elements.map(t=>t.toFixed(4))} )`;switch(At.getTransfer(i)){case Ac:return[e,"LinearTransferOETF"];case Mt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function eg(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),s=i.getShaderInfoLog(e).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return t.toUpperCase()+`+`)}const rg=new rt;function ZC(i){At._getMatrix(rg,At.workingColorSpace,i);const e=`mat3( ${rg.elements.map(t=>t.toFixed(4))} )`;switch(At.getTransfer(i)){case Ec:return[e,"LinearTransferOETF"];case Mt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function ag(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),s=i.getShaderInfoLog(e).trim();if(n&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return t.toUpperCase()+``+s+`-`+zv(i.getShaderSource(e),a)}else return s}function Wv(i,e){const t=Vv(e);return[`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`-`)}function qv(i,e){let t;switch(e){case gh:t="Linear";break;case ME:t="Reinhard";break;case BE:t="Cineon";break;case lp:t="ACESFilmic";break;case RE:t="AgX";break;case NE:t="Neutral";break;case TE:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const $c=new H;function Kv(){At.getLuminanceCoefficients($c);const i=$c.x.toFixed(4),e=$c.y.toFixed(4),t=$c.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`-`)}function Xv(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ao).join(`-`)}function Yv(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`-`)}function jv(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const r=i.getActiveAttrib(e,s),a=r.name;let o=1;r.type===i.FLOAT_MAT2&&(o=2),r.type===i.FLOAT_MAT3&&(o=3),r.type===i.FLOAT_MAT4&&(o=4),t[a]={type:r.type,location:i.getAttribLocation(e,a),locationSize:o}}return t}function Ao(i){return i!==""}function tg(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.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 ng(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Jv=/^[ \t]*#include +<([\w\d./]+)>/gm;function zu(i){return i.replace(Jv,$v)}const Zv=new Map;function $v(i,e){let t=ot[e];if(t===void 0){const n=Zv.get(e);if(n!==void 0)t=ot[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return zu(t)}const eS=/#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 ig(i){return i.replace(eS,tS)}function tS(i,e,t,n){let s="";for(let r=parseInt(e);r<parseInt(t);r++)s+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return s}function sg(i){let e=`precision ${i.precision} float;+`+JC(i.getShaderSource(e),a)}else return s}function $C(i,e){const t=ZC(e);return[`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`+`)}function eS(i,e){let t;switch(e){case yh:t="Linear";break;case PE:t="Reinhard";break;case kE:t="Cineon";break;case Ap:t="ACESFilmic";break;case OE:t="AgX";break;case QE:t="Neutral";break;case UE:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const sl=new H;function tS(){At.getLuminanceCoefficients(sl);const i=sl.x.toFixed(4),e=sl.y.toFixed(4),t=sl.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`+`)}function nS(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(xo).join(`+`)}function iS(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`+`)}function sS(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const r=i.getActiveAttrib(e,s),a=r.name;let o=1;r.type===i.FLOAT_MAT2&&(o=2),r.type===i.FLOAT_MAT3&&(o=3),r.type===i.FLOAT_MAT4&&(o=4),t[a]={type:r.type,location:i.getAttribLocation(e,a),locationSize:o}}return t}function xo(i){return i!==""}function og(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.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 cg(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const rS=/^[ \t]*#include +<([\w\d./]+)>/gm;function Xu(i){return i.replace(rS,oS)}const aS=new Map;function oS(i,e){let t=ot[e];if(t===void 0){const n=aS.get(e);if(n!==void 0)t=ot[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Xu(t)}const cS=/#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 lg(i){return i.replace(cS,lS)}function lS(i,e,t,n){let s="";for(let r=parseInt(e);r<parseInt(t);r++)s+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return s}function hg(i){let e=`precision ${i.precision} float;precision ${i.precision} int;precision ${i.precision} sampler2D;precision ${i.precision} samplerCube;@@ -3743,30 +3743,30 @@ void main() {`;return i.precision==="highp"?e+=`#define HIGH_PRECISION`:i.precision==="mediump"?e+=`#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`-#define LOW_PRECISION`),e}function nS(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===sp?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===oE?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===Oi&&(e="SHADOWMAP_TYPE_VSM"),e}function iS(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Ks:case Dr:e="ENVMAP_TYPE_CUBE";break;case ic:e="ENVMAP_TYPE_CUBE_UV";break}return e}function sS(i){let e="ENVMAP_MODE_REFLECTION";return i.envMap&&i.envMapMode===Dr&&(e="ENVMAP_MODE_REFRACTION"),e}function rS(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case cp:e="ENVMAP_BLENDING_MULTIPLY";break;case SE:e="ENVMAP_BLENDING_MIX";break;case IE:e="ENVMAP_BLENDING_ADD";break}return e}function aS(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function oS(i,e,t,n){const s=i.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const c=nS(t),l=iS(t),h=sS(t),u=rS(t),d=aS(t),f=Xv(t),m=Yv(r),g=s.createProgram();let A,p,y=t.glslVersion?"#version "+t.glslVersion+`-`:"";t.isRawShaderMaterial?(A=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Ao).join(`+#define LOW_PRECISION`),e}function hS(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===hp?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===AE?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===Qi&&(e="SHADOWMAP_TYPE_VSM"),e}function uS(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Xs:case Pr:e="ENVMAP_TYPE_CUBE";break;case cc:e="ENVMAP_TYPE_CUBE_UV";break}return e}function dS(i){let e="ENVMAP_MODE_REFLECTION";return i.envMap&&i.envMapMode===Pr&&(e="ENVMAP_MODE_REFRACTION"),e}function fS(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case pp:e="ENVMAP_BLENDING_MULTIPLY";break;case DE:e="ENVMAP_BLENDING_MIX";break;case LE:e="ENVMAP_BLENDING_ADD";break}return e}function pS(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function AS(i,e,t,n){const s=i.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const c=hS(t),l=uS(t),h=dS(t),u=fS(t),d=pS(t),f=nS(t),m=iS(r),g=s.createProgram();let A,p,y=t.glslVersion?"#version "+t.glslVersion+`+`:"";t.isRawShaderMaterial?(A=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(xo).join(``),A.length>0&&(A+=`-`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Ao).join(`+`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(xo).join(``),p.length>0&&(p+=`-`)):(A=[sg(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`-`].filter(Ao).join(`-`),p=[sg(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ms?"#define TONE_MAPPING":"",t.toneMapping!==ms?ot.tonemapping_pars_fragment:"",t.toneMapping!==ms?qv("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ot.colorspace_pars_fragment,Wv("linearToOutputTexel",t.outputColorSpace),Kv(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`-`].filter(Ao).join(`-`)),a=zu(a),a=tg(a,t),a=ng(a,t),o=zu(o),o=tg(o,t),o=ng(o,t),a=ig(a),o=ig(o),t.isRawShaderMaterial!==!0&&(y=`#version 300 es+`)):(A=[hg(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`+`].filter(xo).join(`+`),p=[hg(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==bs?"#define TONE_MAPPING":"",t.toneMapping!==bs?ot.tonemapping_pars_fragment:"",t.toneMapping!==bs?eS("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ot.colorspace_pars_fragment,$C("linearToOutputTexel",t.outputColorSpace),tS(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`+`].filter(xo).join(`+`)),a=Xu(a),a=og(a,t),a=cg(a,t),o=Xu(o),o=og(o,t),o=cg(o,t),a=lg(a),o=lg(o),t.isRawShaderMaterial!==!0&&(y=`#version 300 es`,A=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(``)+`-`+A,p=["#define varying in",t.glslVersion===vp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===vp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`+`+A,p=["#define varying in",t.glslVersion===Rp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Rp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(``)+`-`+p);const b=y+A+a,_=y+p+o,M=ZA(s,s.VERTEX_SHADER,b),w=ZA(s,s.FRAGMENT_SHADER,_);s.attachShader(g,M),s.attachShader(g,w),t.index0AttributeName!==void 0?s.bindAttribLocation(g,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(g,0,"position"),s.linkProgram(g);function S(F){if(i.debug.checkShaderErrors){const K=s.getProgramInfoLog(g).trim(),q=s.getShaderInfoLog(M).trim(),$=s.getShaderInfoLog(w).trim();let D=!0,O=!0;if(s.getProgramParameter(g,s.LINK_STATUS)===!1)if(D=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,g,M,w);else{const j=eg(s,M,"vertex"),Q=eg(s,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(g,s.VALIDATE_STATUS)+`+`+p);const b=y+A+a,_=y+p+o,M=sg(s,s.VERTEX_SHADER,b),w=sg(s,s.FRAGMENT_SHADER,_);s.attachShader(g,M),s.attachShader(g,w),t.index0AttributeName!==void 0?s.bindAttribLocation(g,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(g,0,"position"),s.linkProgram(g);function S(F){if(i.debug.checkShaderErrors){const K=s.getProgramInfoLog(g).trim(),q=s.getShaderInfoLog(M).trim(),$=s.getShaderInfoLog(w).trim();let D=!0,O=!0;if(s.getProgramParameter(g,s.LINK_STATUS)===!1)if(D=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,g,M,w);else{const Y=ag(s,M,"vertex"),Q=ag(s,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(g,s.VALIDATE_STATUS)+`Material Name: `+F.name+`Material Type: `+F.type+`Program Info Log: `+K+`-`+j+`-`+Q)}else K!==""?console.warn("THREE.WebGLProgram: Program Info Log:",K):(q===""||$==="")&&(O=!1);O&&(F.diagnostics={runnable:D,programLog:K,vertexShader:{log:q,prefix:A},fragmentShader:{log:$,prefix:p}})}s.deleteShader(M),s.deleteShader(w),T=new Zc(s,g),v=jv(s,g)}let T;this.getUniforms=function(){return T===void 0&&S(this),T};let v;this.getAttributes=function(){return v===void 0&&S(this),v};let C=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=s.getProgramParameter(g,Gv)),C},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Hv++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=M,this.fragmentShader=w,this}let cS=0;class lS{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new hS(e),t.set(e,n)),n}}class hS{constructor(e){this.id=cS++,this.code=e,this.usedTimes=0}}function uS(i,e,t,n,s,r,a){const o=new kp,c=new lS,l=new Set,h=[],u=s.logarithmicDepthBuffer,d=s.vertexTextures;let f=s.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(v){return l.add(v),v===0?"uv":`uv${v}`}function A(v,C,F,K,q){const $=K.fog,D=q.geometry,O=v.isMeshStandardMaterial?K.environment:null,j=(v.isMeshStandardMaterial?t:e).get(v.envMap||O),Q=j&&j.mapping===ic?j.image.height:null,J=m[v.type];v.precision!==null&&(f=s.getMaxPrecision(v.precision),f!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",f,"instead."));const ee=D.morphAttributes.position||D.morphAttributes.normal||D.morphAttributes.color,ae=ee!==void 0?ee.length:0;let ye=0;D.morphAttributes.position!==void 0&&(ye=1),D.morphAttributes.normal!==void 0&&(ye=2),D.morphAttributes.color!==void 0&&(ye=3);let Me,se,me,be;if(J){const yt=Ni[J];Me=yt.vertexShader,se=yt.fragmentShader}else Me=v.vertexShader,se=v.fragmentShader,c.update(v),me=c.getVertexShaderID(v),be=c.getFragmentShaderID(v);const xe=i.getRenderTarget(),Pe=i.state.buffers.depth.getReversed(),$e=q.isInstancedMesh===!0,Qe=q.isBatchedMesh===!0,St=!!v.map,ut=!!v.matcap,Je=!!j,G=!!v.aoMap,mn=!!v.lightMap,dt=!!v.bumpMap,pt=!!v.normalMap,ze=!!v.displacementMap,Rt=!!v.emissiveMap,Ge=!!v.metalnessMap,L=!!v.roughnessMap,I=v.anisotropy>0,Z=v.clearcoat>0,le=v.dispersion>0,Ae=v.iridescence>0,oe=v.sheen>0,Ue=v.transmission>0,Ce=I&&!!v.anisotropyMap,Ve=Z&&!!v.clearcoatMap,je=Z&&!!v.clearcoatNormalMap,Ee=Z&&!!v.clearcoatRoughnessMap,Ne=Ae&&!!v.iridescenceMap,ke=Ae&&!!v.iridescenceThicknessMap,Oe=oe&&!!v.sheenColorMap,Te=oe&&!!v.sheenRoughnessMap,tt=!!v.specularMap,We=!!v.specularColorMap,nt=!!v.specularIntensityMap,W=Ue&&!!v.transmissionMap,ne=Ue&&!!v.thicknessMap,re=!!v.gradientMap,de=!!v.alphaMap,Ie=v.alphaTest>0,Se=!!v.alphaHash,it=!!v.extensions;let Ot=ms;v.toneMapped&&(xe===null||xe.isXRRenderTarget===!0)&&(Ot=i.toneMapping);const bn={shaderID:J,shaderType:v.type,shaderName:v.name,vertexShader:Me,fragmentShader:se,defines:v.defines,customVertexShaderID:me,customFragmentShaderID:be,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:f,batching:Qe,batchingColor:Qe&&q._colorsTexture!==null,instancing:$e,instancingColor:$e&&q.instanceColor!==null,instancingMorph:$e&&q.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:xe===null?i.outputColorSpace:xe.isXRRenderTarget===!0?xe.texture.colorSpace:rn,alphaToCoverage:!!v.alphaToCoverage,map:St,matcap:ut,envMap:Je,envMapMode:Je&&j.mapping,envMapCubeUVHeight:Q,aoMap:G,lightMap:mn,bumpMap:dt,normalMap:pt,displacementMap:d&&ze,emissiveMap:Rt,normalMapObjectSpace:pt&&v.normalMapType===OE,normalMapTangentSpace:pt&&v.normalMapType===yp,metalnessMap:Ge,roughnessMap:L,anisotropy:I,anisotropyMap:Ce,clearcoat:Z,clearcoatMap:Ve,clearcoatNormalMap:je,clearcoatRoughnessMap:Ee,dispersion:le,iridescence:Ae,iridescenceMap:Ne,iridescenceThicknessMap:ke,sheen:oe,sheenColorMap:Oe,sheenRoughnessMap:Te,specularMap:tt,specularColorMap:We,specularIntensityMap:nt,transmission:Ue,transmissionMap:W,thicknessMap:ne,gradientMap:re,opaque:v.transparent===!1&&v.blending===Nr&&v.alphaToCoverage===!1,alphaMap:de,alphaTest:Ie,alphaHash:Se,combine:v.combine,mapUv:St&&g(v.map.channel),aoMapUv:G&&g(v.aoMap.channel),lightMapUv:mn&&g(v.lightMap.channel),bumpMapUv:dt&&g(v.bumpMap.channel),normalMapUv:pt&&g(v.normalMap.channel),displacementMapUv:ze&&g(v.displacementMap.channel),emissiveMapUv:Rt&&g(v.emissiveMap.channel),metalnessMapUv:Ge&&g(v.metalnessMap.channel),roughnessMapUv:L&&g(v.roughnessMap.channel),anisotropyMapUv:Ce&&g(v.anisotropyMap.channel),clearcoatMapUv:Ve&&g(v.clearcoatMap.channel),clearcoatNormalMapUv:je&&g(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&g(v.clearcoatRoughnessMap.channel),iridescenceMapUv:Ne&&g(v.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&g(v.iridescenceThicknessMap.channel),sheenColorMapUv:Oe&&g(v.sheenColorMap.channel),sheenRoughnessMapUv:Te&&g(v.sheenRoughnessMap.channel),specularMapUv:tt&&g(v.specularMap.channel),specularColorMapUv:We&&g(v.specularColorMap.channel),specularIntensityMapUv:nt&&g(v.specularIntensityMap.channel),transmissionMapUv:W&&g(v.transmissionMap.channel),thicknessMapUv:ne&&g(v.thicknessMap.channel),alphaMapUv:de&&g(v.alphaMap.channel),vertexTangents:!!D.attributes.tangent&&(pt||I),vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!D.attributes.color&&D.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!D.attributes.uv&&(St||de),fog:!!$,useFog:v.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:v.flatShading===!0,sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Pe,skinning:q.isSkinnedMesh===!0,morphTargets:D.morphAttributes.position!==void 0,morphNormals:D.morphAttributes.normal!==void 0,morphColors:D.morphAttributes.color!==void 0,morphTargetsCount:ae,morphTextureStride:ye,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:v.dithering,shadowMapEnabled:i.shadowMap.enabled&&F.length>0,shadowMapType:i.shadowMap.type,toneMapping:Ot,decodeVideoTexture:St&&v.map.isVideoTexture===!0&&At.getTransfer(v.map.colorSpace)===Mt,decodeVideoTextureEmissive:Rt&&v.emissiveMap.isVideoTexture===!0&&At.getTransfer(v.emissiveMap.colorSpace)===Mt,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Si,flipSided:v.side===Sn,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionClipCullDistance:it&&v.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(it&&v.extensions.multiDraw===!0||Qe)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()};return bn.vertexUv1s=l.has(1),bn.vertexUv2s=l.has(2),bn.vertexUv3s=l.has(3),l.clear(),bn}function p(v){const C=[];if(v.shaderID?C.push(v.shaderID):(C.push(v.customVertexShaderID),C.push(v.customFragmentShaderID)),v.defines!==void 0)for(const F in v.defines)C.push(F),C.push(v.defines[F]);return v.isRawShaderMaterial===!1&&(y(C,v),b(C,v),C.push(i.outputColorSpace)),C.push(v.customProgramCacheKey),C.join()}function y(v,C){v.push(C.precision),v.push(C.outputColorSpace),v.push(C.envMapMode),v.push(C.envMapCubeUVHeight),v.push(C.mapUv),v.push(C.alphaMapUv),v.push(C.lightMapUv),v.push(C.aoMapUv),v.push(C.bumpMapUv),v.push(C.normalMapUv),v.push(C.displacementMapUv),v.push(C.emissiveMapUv),v.push(C.metalnessMapUv),v.push(C.roughnessMapUv),v.push(C.anisotropyMapUv),v.push(C.clearcoatMapUv),v.push(C.clearcoatNormalMapUv),v.push(C.clearcoatRoughnessMapUv),v.push(C.iridescenceMapUv),v.push(C.iridescenceThicknessMapUv),v.push(C.sheenColorMapUv),v.push(C.sheenRoughnessMapUv),v.push(C.specularMapUv),v.push(C.specularColorMapUv),v.push(C.specularIntensityMapUv),v.push(C.transmissionMapUv),v.push(C.thicknessMapUv),v.push(C.combine),v.push(C.fogExp2),v.push(C.sizeAttenuation),v.push(C.morphTargetsCount),v.push(C.morphAttributeCount),v.push(C.numDirLights),v.push(C.numPointLights),v.push(C.numSpotLights),v.push(C.numSpotLightMaps),v.push(C.numHemiLights),v.push(C.numRectAreaLights),v.push(C.numDirLightShadows),v.push(C.numPointLightShadows),v.push(C.numSpotLightShadows),v.push(C.numSpotLightShadowsWithMaps),v.push(C.numLightProbes),v.push(C.shadowMapType),v.push(C.toneMapping),v.push(C.numClippingPlanes),v.push(C.numClipIntersection),v.push(C.depthPacking)}function b(v,C){o.disableAll(),C.supportsVertexTextures&&o.enable(0),C.instancing&&o.enable(1),C.instancingColor&&o.enable(2),C.instancingMorph&&o.enable(3),C.matcap&&o.enable(4),C.envMap&&o.enable(5),C.normalMapObjectSpace&&o.enable(6),C.normalMapTangentSpace&&o.enable(7),C.clearcoat&&o.enable(8),C.iridescence&&o.enable(9),C.alphaTest&&o.enable(10),C.vertexColors&&o.enable(11),C.vertexAlphas&&o.enable(12),C.vertexUv1s&&o.enable(13),C.vertexUv2s&&o.enable(14),C.vertexUv3s&&o.enable(15),C.vertexTangents&&o.enable(16),C.anisotropy&&o.enable(17),C.alphaHash&&o.enable(18),C.batching&&o.enable(19),C.dispersion&&o.enable(20),C.batchingColor&&o.enable(21),v.push(o.mask),o.disableAll(),C.fog&&o.enable(0),C.useFog&&o.enable(1),C.flatShading&&o.enable(2),C.logarithmicDepthBuffer&&o.enable(3),C.reverseDepthBuffer&&o.enable(4),C.skinning&&o.enable(5),C.morphTargets&&o.enable(6),C.morphNormals&&o.enable(7),C.morphColors&&o.enable(8),C.premultipliedAlpha&&o.enable(9),C.shadowMapEnabled&&o.enable(10),C.doubleSided&&o.enable(11),C.flipSided&&o.enable(12),C.useDepthPacking&&o.enable(13),C.dithering&&o.enable(14),C.transmission&&o.enable(15),C.sheen&&o.enable(16),C.opaque&&o.enable(17),C.pointsUvs&&o.enable(18),C.decodeVideoTexture&&o.enable(19),C.decodeVideoTextureEmissive&&o.enable(20),C.alphaToCoverage&&o.enable(21),v.push(o.mask)}function _(v){const C=m[v.type];let F;if(C){const K=Ni[C];F=F_.clone(K.uniforms)}else F=v.uniforms;return F}function M(v,C){let F;for(let K=0,q=h.length;K<q;K++){const $=h[K];if($.cacheKey===C){F=$,++F.usedTimes;break}}return F===void 0&&(F=new oS(i,C,v,r),h.push(F)),F}function w(v){if(--v.usedTimes===0){const C=h.indexOf(v);h[C]=h[h.length-1],h.pop(),v.destroy()}}function S(v){c.remove(v)}function T(){c.dispose()}return{getParameters:A,getProgramCacheKey:p,getUniforms:_,acquireProgram:M,releaseProgram:w,releaseShaderCache:S,programs:h,dispose:T}}function dS(){let i=new WeakMap;function e(a){return i.has(a)}function t(a){let o=i.get(a);return o===void 0&&(o={},i.set(a,o)),o}function n(a){i.delete(a)}function s(a,o,c){i.get(a)[o]=c}function r(){i=new WeakMap}return{has:e,get:t,remove:n,update:s,dispose:r}}function fS(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function rg(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function ag(){const i=[];let e=0;const t=[],n=[],s=[];function r(){e=0,t.length=0,n.length=0,s.length=0}function a(u,d,f,m,g,A){let p=i[e];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:g,group:A},i[e]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=g,p.group=A),e++,p}function o(u,d,f,m,g,A){const p=a(u,d,f,m,g,A);f.transmission>0?n.push(p):f.transparent===!0?s.push(p):t.push(p)}function c(u,d,f,m,g,A){const p=a(u,d,f,m,g,A);f.transmission>0?n.unshift(p):f.transparent===!0?s.unshift(p):t.unshift(p)}function l(u,d){t.length>1&&t.sort(u||fS),n.length>1&&n.sort(d||rg),s.length>1&&s.sort(d||rg)}function h(){for(let u=e,d=i.length;u<d;u++){const f=i[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:s,init:r,push:o,unshift:c,finish:h,sort:l}}function pS(){let i=new WeakMap;function e(n,s){const r=i.get(n);let a;return r===void 0?(a=new ag,i.set(n,[a])):s>=r.length?(a=new ag,r.push(a)):a=r[s],a}function t(){i=new WeakMap}return{get:e,dispose:t}}function AS(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new H,color:new qe};break;case"SpotLight":t={position:new H,direction:new H,color:new qe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new H,color:new qe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new H,skyColor:new qe,groundColor:new qe};break;case"RectAreaLight":t={color:new qe,position:new H,halfWidth:new H,halfHeight:new H};break}return i[e.id]=t,t}}}function gS(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let mS=0;function bS(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function xS(i){const e=new AS,t=gS(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new H);const s=new H,r=new et,a=new et;function o(l){let h=0,u=0,d=0;for(let v=0;v<9;v++)n.probe[v].set(0,0,0);let f=0,m=0,g=0,A=0,p=0,y=0,b=0,_=0,M=0,w=0,S=0;l.sort(bS);for(let v=0,C=l.length;v<C;v++){const F=l[v],K=F.color,q=F.intensity,$=F.distance,D=F.shadow&&F.shadow.map?F.shadow.map.texture:null;if(F.isAmbientLight)h+=K.r*q,u+=K.g*q,d+=K.b*q;else if(F.isLightProbe){for(let O=0;O<9;O++)n.probe[O].addScaledVector(F.sh.coefficients[O],q);S++}else if(F.isDirectionalLight){const O=e.get(F);if(O.color.copy(F.color).multiplyScalar(F.intensity),F.castShadow){const j=F.shadow,Q=t.get(F);Q.shadowIntensity=j.intensity,Q.shadowBias=j.bias,Q.shadowNormalBias=j.normalBias,Q.shadowRadius=j.radius,Q.shadowMapSize=j.mapSize,n.directionalShadow[f]=Q,n.directionalShadowMap[f]=D,n.directionalShadowMatrix[f]=F.shadow.matrix,y++}n.directional[f]=O,f++}else if(F.isSpotLight){const O=e.get(F);O.position.setFromMatrixPosition(F.matrixWorld),O.color.copy(K).multiplyScalar(q),O.distance=$,O.coneCos=Math.cos(F.angle),O.penumbraCos=Math.cos(F.angle*(1-F.penumbra)),O.decay=F.decay,n.spot[g]=O;const j=F.shadow;if(F.map&&(n.spotLightMap[M]=F.map,M++,j.updateMatrices(F),F.castShadow&&w++),n.spotLightMatrix[g]=j.matrix,F.castShadow){const Q=t.get(F);Q.shadowIntensity=j.intensity,Q.shadowBias=j.bias,Q.shadowNormalBias=j.normalBias,Q.shadowRadius=j.radius,Q.shadowMapSize=j.mapSize,n.spotShadow[g]=Q,n.spotShadowMap[g]=D,_++}g++}else if(F.isRectAreaLight){const O=e.get(F);O.color.copy(K).multiplyScalar(q),O.halfWidth.set(F.width*.5,0,0),O.halfHeight.set(0,F.height*.5,0),n.rectArea[A]=O,A++}else if(F.isPointLight){const O=e.get(F);if(O.color.copy(F.color).multiplyScalar(F.intensity),O.distance=F.distance,O.decay=F.decay,F.castShadow){const j=F.shadow,Q=t.get(F);Q.shadowIntensity=j.intensity,Q.shadowBias=j.bias,Q.shadowNormalBias=j.normalBias,Q.shadowRadius=j.radius,Q.shadowMapSize=j.mapSize,Q.shadowCameraNear=j.camera.near,Q.shadowCameraFar=j.camera.far,n.pointShadow[m]=Q,n.pointShadowMap[m]=D,n.pointShadowMatrix[m]=F.shadow.matrix,b++}n.point[m]=O,m++}else if(F.isHemisphereLight){const O=e.get(F);O.skyColor.copy(F.color).multiplyScalar(q),O.groundColor.copy(F.groundColor).multiplyScalar(q),n.hemi[p]=O,p++}}A>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=we.LTC_FLOAT_1,n.rectAreaLTC2=we.LTC_FLOAT_2):(n.rectAreaLTC1=we.LTC_HALF_1,n.rectAreaLTC2=we.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const T=n.hash;(T.directionalLength!==f||T.pointLength!==m||T.spotLength!==g||T.rectAreaLength!==A||T.hemiLength!==p||T.numDirectionalShadows!==y||T.numPointShadows!==b||T.numSpotShadows!==_||T.numSpotMaps!==M||T.numLightProbes!==S)&&(n.directional.length=f,n.spot.length=g,n.rectArea.length=A,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=_,n.spotShadowMap.length=_,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=_+M-w,n.spotLightMap.length=M,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=S,T.directionalLength=f,T.pointLength=m,T.spotLength=g,T.rectAreaLength=A,T.hemiLength=p,T.numDirectionalShadows=y,T.numPointShadows=b,T.numSpotShadows=_,T.numSpotMaps=M,T.numLightProbes=S,n.version=mS++)}function c(l,h){let u=0,d=0,f=0,m=0,g=0;const A=h.matrixWorldInverse;for(let p=0,y=l.length;p<y;p++){const b=l[p];if(b.isDirectionalLight){const _=n.directional[u];_.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(s),_.direction.transformDirection(A),u++}else if(b.isSpotLight){const _=n.spot[f];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(A),_.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(s),_.direction.transformDirection(A),f++}else if(b.isRectAreaLight){const _=n.rectArea[m];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(A),a.identity(),r.copy(b.matrixWorld),r.premultiply(A),a.extractRotation(r),_.halfWidth.set(b.width*.5,0,0),_.halfHeight.set(0,b.height*.5,0),_.halfWidth.applyMatrix4(a),_.halfHeight.applyMatrix4(a),m++}else if(b.isPointLight){const _=n.point[d];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(A),d++}else if(b.isHemisphereLight){const _=n.hemi[g];_.direction.setFromMatrixPosition(b.matrixWorld),_.direction.transformDirection(A),g++}}}return{setup:o,setupView:c,state:n}}function og(i){const e=new xS(i),t=[],n=[];function s(h){l.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function c(h){e.setupView(t,h)}const l={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:s,state:l,setupLights:o,setupLightsView:c,pushLight:r,pushShadow:a}}function ES(i){let e=new WeakMap;function t(s,r=0){const a=e.get(s);let o;return a===void 0?(o=new og(i),e.set(s,[o])):r>=a.length?(o=new og(i),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const _S=`void main() {+`+Y+`+`+Q)}else K!==""?console.warn("THREE.WebGLProgram: Program Info Log:",K):(q===""||$==="")&&(O=!1);O&&(F.diagnostics={runnable:D,programLog:K,vertexShader:{log:q,prefix:A},fragmentShader:{log:$,prefix:p}})}s.deleteShader(M),s.deleteShader(w),T=new il(s,g),C=sS(s,g)}let T;this.getUniforms=function(){return T===void 0&&S(this),T};let C;this.getAttributes=function(){return C===void 0&&S(this),C};let v=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=s.getProgramParameter(g,XC)),v},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=YC++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=M,this.fragmentShader=w,this}let gS=0;class mS{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new bS(e),t.set(e,n)),n}}class bS{constructor(e){this.id=gS++,this.code=e,this.usedTimes=0}}function xS(i,e,t,n,s,r,a){const o=new zp,c=new mS,l=new Set,h=[],u=s.logarithmicDepthBuffer,d=s.vertexTextures;let f=s.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(C){return l.add(C),C===0?"uv":`uv${C}`}function A(C,v,F,K,q){const $=K.fog,D=q.geometry,O=C.isMeshStandardMaterial?K.environment:null,Y=(C.isMeshStandardMaterial?t:e).get(C.envMap||O),Q=Y&&Y.mapping===cc?Y.image.height:null,J=m[C.type];C.precision!==null&&(f=s.getMaxPrecision(C.precision),f!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",f,"instead."));const ee=D.morphAttributes.position||D.morphAttributes.normal||D.morphAttributes.color,ae=ee!==void 0?ee.length:0;let ye=0;D.morphAttributes.position!==void 0&&(ye=1),D.morphAttributes.normal!==void 0&&(ye=2),D.morphAttributes.color!==void 0&&(ye=3);let Me,se,me,be;if(J){const yt=Fi[J];Me=yt.vertexShader,se=yt.fragmentShader}else Me=C.vertexShader,se=C.fragmentShader,c.update(C),me=c.getVertexShaderID(C),be=c.getFragmentShaderID(C);const xe=i.getRenderTarget(),Pe=i.state.buffers.depth.getReversed(),$e=q.isInstancedMesh===!0,Qe=q.isBatchedMesh===!0,St=!!C.map,ut=!!C.matcap,Je=!!Y,G=!!C.aoMap,mn=!!C.lightMap,dt=!!C.bumpMap,pt=!!C.normalMap,ze=!!C.displacementMap,Rt=!!C.emissiveMap,Ge=!!C.metalnessMap,L=!!C.roughnessMap,I=C.anisotropy>0,Z=C.clearcoat>0,le=C.dispersion>0,Ae=C.iridescence>0,oe=C.sheen>0,Ue=C.transmission>0,ve=I&&!!C.anisotropyMap,Ve=Z&&!!C.clearcoatMap,Ye=Z&&!!C.clearcoatNormalMap,Ee=Z&&!!C.clearcoatRoughnessMap,Ne=Ae&&!!C.iridescenceMap,ke=Ae&&!!C.iridescenceThicknessMap,Oe=oe&&!!C.sheenColorMap,Te=oe&&!!C.sheenRoughnessMap,tt=!!C.specularMap,We=!!C.specularColorMap,nt=!!C.specularIntensityMap,W=Ue&&!!C.transmissionMap,ne=Ue&&!!C.thicknessMap,re=!!C.gradientMap,de=!!C.alphaMap,Ie=C.alphaTest>0,Se=!!C.alphaHash,it=!!C.extensions;let Ot=bs;C.toneMapped&&(xe===null||xe.isXRRenderTarget===!0)&&(Ot=i.toneMapping);const bn={shaderID:J,shaderType:C.type,shaderName:C.name,vertexShader:Me,fragmentShader:se,defines:C.defines,customVertexShaderID:me,customFragmentShaderID:be,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:f,batching:Qe,batchingColor:Qe&&q._colorsTexture!==null,instancing:$e,instancingColor:$e&&q.instanceColor!==null,instancingMorph:$e&&q.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:xe===null?i.outputColorSpace:xe.isXRRenderTarget===!0?xe.texture.colorSpace:rn,alphaToCoverage:!!C.alphaToCoverage,map:St,matcap:ut,envMap:Je,envMapMode:Je&&Y.mapping,envMapCubeUVHeight:Q,aoMap:G,lightMap:mn,bumpMap:dt,normalMap:pt,displacementMap:d&&ze,emissiveMap:Rt,normalMapObjectSpace:pt&&C.normalMapType===KE,normalMapTangentSpace:pt&&C.normalMapType===Mp,metalnessMap:Ge,roughnessMap:L,anisotropy:I,anisotropyMap:ve,clearcoat:Z,clearcoatMap:Ve,clearcoatNormalMap:Ye,clearcoatRoughnessMap:Ee,dispersion:le,iridescence:Ae,iridescenceMap:Ne,iridescenceThicknessMap:ke,sheen:oe,sheenColorMap:Oe,sheenRoughnessMap:Te,specularMap:tt,specularColorMap:We,specularIntensityMap:nt,transmission:Ue,transmissionMap:W,thicknessMap:ne,gradientMap:re,opaque:C.transparent===!1&&C.blending===Dr&&C.alphaToCoverage===!1,alphaMap:de,alphaTest:Ie,alphaHash:Se,combine:C.combine,mapUv:St&&g(C.map.channel),aoMapUv:G&&g(C.aoMap.channel),lightMapUv:mn&&g(C.lightMap.channel),bumpMapUv:dt&&g(C.bumpMap.channel),normalMapUv:pt&&g(C.normalMap.channel),displacementMapUv:ze&&g(C.displacementMap.channel),emissiveMapUv:Rt&&g(C.emissiveMap.channel),metalnessMapUv:Ge&&g(C.metalnessMap.channel),roughnessMapUv:L&&g(C.roughnessMap.channel),anisotropyMapUv:ve&&g(C.anisotropyMap.channel),clearcoatMapUv:Ve&&g(C.clearcoatMap.channel),clearcoatNormalMapUv:Ye&&g(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&g(C.clearcoatRoughnessMap.channel),iridescenceMapUv:Ne&&g(C.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&g(C.iridescenceThicknessMap.channel),sheenColorMapUv:Oe&&g(C.sheenColorMap.channel),sheenRoughnessMapUv:Te&&g(C.sheenRoughnessMap.channel),specularMapUv:tt&&g(C.specularMap.channel),specularColorMapUv:We&&g(C.specularColorMap.channel),specularIntensityMapUv:nt&&g(C.specularIntensityMap.channel),transmissionMapUv:W&&g(C.transmissionMap.channel),thicknessMapUv:ne&&g(C.thicknessMap.channel),alphaMapUv:de&&g(C.alphaMap.channel),vertexTangents:!!D.attributes.tangent&&(pt||I),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!D.attributes.color&&D.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!D.attributes.uv&&(St||de),fog:!!$,useFog:C.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Pe,skinning:q.isSkinnedMesh===!0,morphTargets:D.morphAttributes.position!==void 0,morphNormals:D.morphAttributes.normal!==void 0,morphColors:D.morphAttributes.color!==void 0,morphTargetsCount:ae,morphTextureStride:ye,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:C.dithering,shadowMapEnabled:i.shadowMap.enabled&&F.length>0,shadowMapType:i.shadowMap.type,toneMapping:Ot,decodeVideoTexture:St&&C.map.isVideoTexture===!0&&At.getTransfer(C.map.colorSpace)===Mt,decodeVideoTextureEmissive:Rt&&C.emissiveMap.isVideoTexture===!0&&At.getTransfer(C.emissiveMap.colorSpace)===Mt,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Ii,flipSided:C.side===Sn,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionClipCullDistance:it&&C.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(it&&C.extensions.multiDraw===!0||Qe)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:C.customProgramCacheKey()};return bn.vertexUv1s=l.has(1),bn.vertexUv2s=l.has(2),bn.vertexUv3s=l.has(3),l.clear(),bn}function p(C){const v=[];if(C.shaderID?v.push(C.shaderID):(v.push(C.customVertexShaderID),v.push(C.customFragmentShaderID)),C.defines!==void 0)for(const F in C.defines)v.push(F),v.push(C.defines[F]);return C.isRawShaderMaterial===!1&&(y(v,C),b(v,C),v.push(i.outputColorSpace)),v.push(C.customProgramCacheKey),v.join()}function y(C,v){C.push(v.precision),C.push(v.outputColorSpace),C.push(v.envMapMode),C.push(v.envMapCubeUVHeight),C.push(v.mapUv),C.push(v.alphaMapUv),C.push(v.lightMapUv),C.push(v.aoMapUv),C.push(v.bumpMapUv),C.push(v.normalMapUv),C.push(v.displacementMapUv),C.push(v.emissiveMapUv),C.push(v.metalnessMapUv),C.push(v.roughnessMapUv),C.push(v.anisotropyMapUv),C.push(v.clearcoatMapUv),C.push(v.clearcoatNormalMapUv),C.push(v.clearcoatRoughnessMapUv),C.push(v.iridescenceMapUv),C.push(v.iridescenceThicknessMapUv),C.push(v.sheenColorMapUv),C.push(v.sheenRoughnessMapUv),C.push(v.specularMapUv),C.push(v.specularColorMapUv),C.push(v.specularIntensityMapUv),C.push(v.transmissionMapUv),C.push(v.thicknessMapUv),C.push(v.combine),C.push(v.fogExp2),C.push(v.sizeAttenuation),C.push(v.morphTargetsCount),C.push(v.morphAttributeCount),C.push(v.numDirLights),C.push(v.numPointLights),C.push(v.numSpotLights),C.push(v.numSpotLightMaps),C.push(v.numHemiLights),C.push(v.numRectAreaLights),C.push(v.numDirLightShadows),C.push(v.numPointLightShadows),C.push(v.numSpotLightShadows),C.push(v.numSpotLightShadowsWithMaps),C.push(v.numLightProbes),C.push(v.shadowMapType),C.push(v.toneMapping),C.push(v.numClippingPlanes),C.push(v.numClipIntersection),C.push(v.depthPacking)}function b(C,v){o.disableAll(),v.supportsVertexTextures&&o.enable(0),v.instancing&&o.enable(1),v.instancingColor&&o.enable(2),v.instancingMorph&&o.enable(3),v.matcap&&o.enable(4),v.envMap&&o.enable(5),v.normalMapObjectSpace&&o.enable(6),v.normalMapTangentSpace&&o.enable(7),v.clearcoat&&o.enable(8),v.iridescence&&o.enable(9),v.alphaTest&&o.enable(10),v.vertexColors&&o.enable(11),v.vertexAlphas&&o.enable(12),v.vertexUv1s&&o.enable(13),v.vertexUv2s&&o.enable(14),v.vertexUv3s&&o.enable(15),v.vertexTangents&&o.enable(16),v.anisotropy&&o.enable(17),v.alphaHash&&o.enable(18),v.batching&&o.enable(19),v.dispersion&&o.enable(20),v.batchingColor&&o.enable(21),C.push(o.mask),o.disableAll(),v.fog&&o.enable(0),v.useFog&&o.enable(1),v.flatShading&&o.enable(2),v.logarithmicDepthBuffer&&o.enable(3),v.reverseDepthBuffer&&o.enable(4),v.skinning&&o.enable(5),v.morphTargets&&o.enable(6),v.morphNormals&&o.enable(7),v.morphColors&&o.enable(8),v.premultipliedAlpha&&o.enable(9),v.shadowMapEnabled&&o.enable(10),v.doubleSided&&o.enable(11),v.flipSided&&o.enable(12),v.useDepthPacking&&o.enable(13),v.dithering&&o.enable(14),v.transmission&&o.enable(15),v.sheen&&o.enable(16),v.opaque&&o.enable(17),v.pointsUvs&&o.enable(18),v.decodeVideoTexture&&o.enable(19),v.decodeVideoTextureEmissive&&o.enable(20),v.alphaToCoverage&&o.enable(21),C.push(o.mask)}function _(C){const v=m[C.type];let F;if(v){const K=Fi[v];F=G_.clone(K.uniforms)}else F=C.uniforms;return F}function M(C,v){let F;for(let K=0,q=h.length;K<q;K++){const $=h[K];if($.cacheKey===v){F=$,++F.usedTimes;break}}return F===void 0&&(F=new AS(i,v,C,r),h.push(F)),F}function w(C){if(--C.usedTimes===0){const v=h.indexOf(C);h[v]=h[h.length-1],h.pop(),C.destroy()}}function S(C){c.remove(C)}function T(){c.dispose()}return{getParameters:A,getProgramCacheKey:p,getUniforms:_,acquireProgram:M,releaseProgram:w,releaseShaderCache:S,programs:h,dispose:T}}function ES(){let i=new WeakMap;function e(a){return i.has(a)}function t(a){let o=i.get(a);return o===void 0&&(o={},i.set(a,o)),o}function n(a){i.delete(a)}function s(a,o,c){i.get(a)[o]=c}function r(){i=new WeakMap}return{has:e,get:t,remove:n,update:s,dispose:r}}function _S(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function ug(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function dg(){const i=[];let e=0;const t=[],n=[],s=[];function r(){e=0,t.length=0,n.length=0,s.length=0}function a(u,d,f,m,g,A){let p=i[e];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:g,group:A},i[e]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=g,p.group=A),e++,p}function o(u,d,f,m,g,A){const p=a(u,d,f,m,g,A);f.transmission>0?n.push(p):f.transparent===!0?s.push(p):t.push(p)}function c(u,d,f,m,g,A){const p=a(u,d,f,m,g,A);f.transmission>0?n.unshift(p):f.transparent===!0?s.unshift(p):t.unshift(p)}function l(u,d){t.length>1&&t.sort(u||_S),n.length>1&&n.sort(d||ug),s.length>1&&s.sort(d||ug)}function h(){for(let u=e,d=i.length;u<d;u++){const f=i[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:s,init:r,push:o,unshift:c,finish:h,sort:l}}function yS(){let i=new WeakMap;function e(n,s){const r=i.get(n);let a;return r===void 0?(a=new dg,i.set(n,[a])):s>=r.length?(a=new dg,r.push(a)):a=r[s],a}function t(){i=new WeakMap}return{get:e,dispose:t}}function wS(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new H,color:new qe};break;case"SpotLight":t={position:new H,direction:new H,color:new qe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new H,color:new qe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new H,skyColor:new qe,groundColor:new qe};break;case"RectAreaLight":t={color:new qe,position:new H,halfWidth:new H,halfHeight:new H};break}return i[e.id]=t,t}}}function vS(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let CS=0;function SS(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function IS(i){const e=new wS,t=vS(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new H);const s=new H,r=new et,a=new et;function o(l){let h=0,u=0,d=0;for(let C=0;C<9;C++)n.probe[C].set(0,0,0);let f=0,m=0,g=0,A=0,p=0,y=0,b=0,_=0,M=0,w=0,S=0;l.sort(SS);for(let C=0,v=l.length;C<v;C++){const F=l[C],K=F.color,q=F.intensity,$=F.distance,D=F.shadow&&F.shadow.map?F.shadow.map.texture:null;if(F.isAmbientLight)h+=K.r*q,u+=K.g*q,d+=K.b*q;else if(F.isLightProbe){for(let O=0;O<9;O++)n.probe[O].addScaledVector(F.sh.coefficients[O],q);S++}else if(F.isDirectionalLight){const O=e.get(F);if(O.color.copy(F.color).multiplyScalar(F.intensity),F.castShadow){const Y=F.shadow,Q=t.get(F);Q.shadowIntensity=Y.intensity,Q.shadowBias=Y.bias,Q.shadowNormalBias=Y.normalBias,Q.shadowRadius=Y.radius,Q.shadowMapSize=Y.mapSize,n.directionalShadow[f]=Q,n.directionalShadowMap[f]=D,n.directionalShadowMatrix[f]=F.shadow.matrix,y++}n.directional[f]=O,f++}else if(F.isSpotLight){const O=e.get(F);O.position.setFromMatrixPosition(F.matrixWorld),O.color.copy(K).multiplyScalar(q),O.distance=$,O.coneCos=Math.cos(F.angle),O.penumbraCos=Math.cos(F.angle*(1-F.penumbra)),O.decay=F.decay,n.spot[g]=O;const Y=F.shadow;if(F.map&&(n.spotLightMap[M]=F.map,M++,Y.updateMatrices(F),F.castShadow&&w++),n.spotLightMatrix[g]=Y.matrix,F.castShadow){const Q=t.get(F);Q.shadowIntensity=Y.intensity,Q.shadowBias=Y.bias,Q.shadowNormalBias=Y.normalBias,Q.shadowRadius=Y.radius,Q.shadowMapSize=Y.mapSize,n.spotShadow[g]=Q,n.spotShadowMap[g]=D,_++}g++}else if(F.isRectAreaLight){const O=e.get(F);O.color.copy(K).multiplyScalar(q),O.halfWidth.set(F.width*.5,0,0),O.halfHeight.set(0,F.height*.5,0),n.rectArea[A]=O,A++}else if(F.isPointLight){const O=e.get(F);if(O.color.copy(F.color).multiplyScalar(F.intensity),O.distance=F.distance,O.decay=F.decay,F.castShadow){const Y=F.shadow,Q=t.get(F);Q.shadowIntensity=Y.intensity,Q.shadowBias=Y.bias,Q.shadowNormalBias=Y.normalBias,Q.shadowRadius=Y.radius,Q.shadowMapSize=Y.mapSize,Q.shadowCameraNear=Y.camera.near,Q.shadowCameraFar=Y.camera.far,n.pointShadow[m]=Q,n.pointShadowMap[m]=D,n.pointShadowMatrix[m]=F.shadow.matrix,b++}n.point[m]=O,m++}else if(F.isHemisphereLight){const O=e.get(F);O.skyColor.copy(F.color).multiplyScalar(q),O.groundColor.copy(F.groundColor).multiplyScalar(q),n.hemi[p]=O,p++}}A>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=we.LTC_FLOAT_1,n.rectAreaLTC2=we.LTC_FLOAT_2):(n.rectAreaLTC1=we.LTC_HALF_1,n.rectAreaLTC2=we.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const T=n.hash;(T.directionalLength!==f||T.pointLength!==m||T.spotLength!==g||T.rectAreaLength!==A||T.hemiLength!==p||T.numDirectionalShadows!==y||T.numPointShadows!==b||T.numSpotShadows!==_||T.numSpotMaps!==M||T.numLightProbes!==S)&&(n.directional.length=f,n.spot.length=g,n.rectArea.length=A,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=_,n.spotShadowMap.length=_,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=_+M-w,n.spotLightMap.length=M,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=S,T.directionalLength=f,T.pointLength=m,T.spotLength=g,T.rectAreaLength=A,T.hemiLength=p,T.numDirectionalShadows=y,T.numPointShadows=b,T.numSpotShadows=_,T.numSpotMaps=M,T.numLightProbes=S,n.version=CS++)}function c(l,h){let u=0,d=0,f=0,m=0,g=0;const A=h.matrixWorldInverse;for(let p=0,y=l.length;p<y;p++){const b=l[p];if(b.isDirectionalLight){const _=n.directional[u];_.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(s),_.direction.transformDirection(A),u++}else if(b.isSpotLight){const _=n.spot[f];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(A),_.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(s),_.direction.transformDirection(A),f++}else if(b.isRectAreaLight){const _=n.rectArea[m];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(A),a.identity(),r.copy(b.matrixWorld),r.premultiply(A),a.extractRotation(r),_.halfWidth.set(b.width*.5,0,0),_.halfHeight.set(0,b.height*.5,0),_.halfWidth.applyMatrix4(a),_.halfHeight.applyMatrix4(a),m++}else if(b.isPointLight){const _=n.point[d];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(A),d++}else if(b.isHemisphereLight){const _=n.hemi[g];_.direction.setFromMatrixPosition(b.matrixWorld),_.direction.transformDirection(A),g++}}}return{setup:o,setupView:c,state:n}}function fg(i){const e=new IS(i),t=[],n=[];function s(h){l.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function c(h){e.setupView(t,h)}const l={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:s,state:l,setupLights:o,setupLightsView:c,pushLight:r,pushShadow:a}}function MS(i){let e=new WeakMap;function t(s,r=0){const a=e.get(s);let o;return a===void 0?(o=new fg(i),e.set(s,[o])):r>=a.length?(o=new fg(i),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const BS=`void main() {gl_Position = vec4( position, 1.0 );-}`,yS=`uniform sampler2D shadow_pass;+}`,TS=`uniform sampler2D shadow_pass;uniform vec2 resolution;uniform float radius;#include <packing>@@ -3792,12 +3792,12 @@ void main() {squared_mean = squared_mean / samples;float std_dev = sqrt( squared_mean - mean * mean );gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );-}`;function wS(i,e,t){let n=new yu;const s=new Ze,r=new Ze,a=new _t,o=new j_({depthPacking:UE}),c=new J_,l={},h=t.maxTextureSize,u={[Qi]:Sn,[Sn]:Qi,[Si]:Si},d=new vs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ze},radius:{value:4}},vertexShader:_S,fragmentShader:yS}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new On;m.setAttribute("position",new En(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Jt(m,d),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=sp;let p=this.type;this.render=function(w,S,T){if(A.enabled===!1||A.autoUpdate===!1&&A.needsUpdate===!1||w.length===0)return;const v=i.getRenderTarget(),C=i.getActiveCubeFace(),F=i.getActiveMipmapLevel(),K=i.state;K.setBlending(gs),K.buffers.color.setClear(1,1,1,1),K.buffers.depth.setTest(!0),K.setScissorTest(!1);const q=p!==Oi&&this.type===Oi,$=p===Oi&&this.type!==Oi;for(let D=0,O=w.length;D<O;D++){const j=w[D],Q=j.shadow;if(Q===void 0){console.warn("THREE.WebGLShadowMap:",j,"has no shadow.");continue}if(Q.autoUpdate===!1&&Q.needsUpdate===!1)continue;s.copy(Q.mapSize);const J=Q.getFrameExtents();if(s.multiply(J),r.copy(Q.mapSize),(s.x>h||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/J.x),s.x=r.x*J.x,Q.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/J.y),s.y=r.y*J.y,Q.mapSize.y=r.y)),Q.map===null||q===!0||$===!0){const ae=this.type!==Oi?{minFilter:In,magFilter:In}:{};Q.map!==null&&Q.map.dispose(),Q.map=new js(s.x,s.y,ae),Q.map.texture.name=j.name+".shadowMap",Q.camera.updateProjectionMatrix()}i.setRenderTarget(Q.map),i.clear();const ee=Q.getViewportCount();for(let ae=0;ae<ee;ae++){const ye=Q.getViewport(ae);a.set(r.x*ye.x,r.y*ye.y,r.x*ye.z,r.y*ye.w),K.viewport(a),Q.updateMatrices(j,ae),n=Q.getFrustum(),_(S,T,Q.camera,j,this.type)}Q.isPointLightShadow!==!0&&this.type===Oi&&y(Q,T),Q.needsUpdate=!1}p=this.type,A.needsUpdate=!1,i.setRenderTarget(v,C,F)};function y(w,S){const T=e.update(g);d.defines.VSM_SAMPLES!==w.blurSamples&&(d.defines.VSM_SAMPLES=w.blurSamples,f.defines.VSM_SAMPLES=w.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new js(s.x,s.y)),d.uniforms.shadow_pass.value=w.map.texture,d.uniforms.resolution.value=w.mapSize,d.uniforms.radius.value=w.radius,i.setRenderTarget(w.mapPass),i.clear(),i.renderBufferDirect(S,null,T,d,g,null),f.uniforms.shadow_pass.value=w.mapPass.texture,f.uniforms.resolution.value=w.mapSize,f.uniforms.radius.value=w.radius,i.setRenderTarget(w.map),i.clear(),i.renderBufferDirect(S,null,T,f,g,null)}function b(w,S,T,v){let C=null;const F=T.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(F!==void 0)C=F;else if(C=T.isPointLight===!0?c:o,i.localClippingEnabled&&S.clipShadows===!0&&Array.isArray(S.clippingPlanes)&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0||S.map&&S.alphaTest>0||S.alphaToCoverage===!0){const K=C.uuid,q=S.uuid;let $=l[K];$===void 0&&($={},l[K]=$);let D=$[q];D===void 0&&(D=C.clone(),$[q]=D,S.addEventListener("dispose",M)),C=D}if(C.visible=S.visible,C.wireframe=S.wireframe,v===Oi?C.side=S.shadowSide!==null?S.shadowSide:S.side:C.side=S.shadowSide!==null?S.shadowSide:u[S.side],C.alphaMap=S.alphaMap,C.alphaTest=S.alphaToCoverage===!0?.5:S.alphaTest,C.map=S.map,C.clipShadows=S.clipShadows,C.clippingPlanes=S.clippingPlanes,C.clipIntersection=S.clipIntersection,C.displacementMap=S.displacementMap,C.displacementScale=S.displacementScale,C.displacementBias=S.displacementBias,C.wireframeLinewidth=S.wireframeLinewidth,C.linewidth=S.linewidth,T.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const K=i.properties.get(C);K.light=T}return C}function _(w,S,T,v,C){if(w.visible===!1)return;if(w.layers.test(S.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&C===Oi)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,w.matrixWorld);const q=e.update(w),$=w.material;if(Array.isArray($)){const D=q.groups;for(let O=0,j=D.length;O<j;O++){const Q=D[O],J=$[Q.materialIndex];if(J&&J.visible){const ee=b(w,J,v,C);w.onBeforeShadow(i,w,S,T,q,ee,Q),i.renderBufferDirect(T,null,q,ee,w,Q),w.onAfterShadow(i,w,S,T,q,ee,Q)}}}else if($.visible){const D=b(w,$,v,C);w.onBeforeShadow(i,w,S,T,q,D,null),i.renderBufferDirect(T,null,q,D,w,null),w.onAfterShadow(i,w,S,T,q,D,null)}}const K=w.children;for(let q=0,$=K.length;q<$;q++)_(K[q],S,T,v,C)}function M(w){w.target.removeEventListener("dispose",M);for(const T in l){const v=l[T],C=w.target.uuid;C in v&&(v[C].dispose(),delete v[C])}}}const CS={[lh]:hh,[uh]:ph,[dh]:Ah,[Fr]:fh,[hh]:lh,[ph]:uh,[Ah]:dh,[fh]:Fr};function vS(i,e){function t(){let W=!1;const ne=new _t;let re=null;const de=new _t(0,0,0,0);return{setMask:function(Ie){re!==Ie&&!W&&(i.colorMask(Ie,Ie,Ie,Ie),re=Ie)},setLocked:function(Ie){W=Ie},setClear:function(Ie,Se,it,Ot,bn){bn===!0&&(Ie*=Ot,Se*=Ot,it*=Ot),ne.set(Ie,Se,it,Ot),de.equals(ne)===!1&&(i.clearColor(Ie,Se,it,Ot),de.copy(ne))},reset:function(){W=!1,re=null,de.set(-1,0,0,0)}}}function n(){let W=!1,ne=!1,re=null,de=null,Ie=null;return{setReversed:function(Se){if(ne!==Se){const it=e.get("EXT_clip_control");Se?it.clipControlEXT(it.LOWER_LEFT_EXT,it.ZERO_TO_ONE_EXT):it.clipControlEXT(it.LOWER_LEFT_EXT,it.NEGATIVE_ONE_TO_ONE_EXT),ne=Se;const Ot=Ie;Ie=null,this.setClear(Ot)}},getReversed:function(){return ne},setTest:function(Se){Se?xe(i.DEPTH_TEST):Pe(i.DEPTH_TEST)},setMask:function(Se){re!==Se&&!W&&(i.depthMask(Se),re=Se)},setFunc:function(Se){if(ne&&(Se=CS[Se]),de!==Se){switch(Se){case lh:i.depthFunc(i.NEVER);break;case hh:i.depthFunc(i.ALWAYS);break;case uh:i.depthFunc(i.LESS);break;case Fr:i.depthFunc(i.LEQUAL);break;case dh:i.depthFunc(i.EQUAL);break;case fh:i.depthFunc(i.GEQUAL);break;case ph:i.depthFunc(i.GREATER);break;case Ah:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}de=Se}},setLocked:function(Se){W=Se},setClear:function(Se){Ie!==Se&&(ne&&(Se=1-Se),i.clearDepth(Se),Ie=Se)},reset:function(){W=!1,re=null,de=null,Ie=null,ne=!1}}}function s(){let W=!1,ne=null,re=null,de=null,Ie=null,Se=null,it=null,Ot=null,bn=null;return{setTest:function(yt){W||(yt?xe(i.STENCIL_TEST):Pe(i.STENCIL_TEST))},setMask:function(yt){ne!==yt&&!W&&(i.stencilMask(yt),ne=yt)},setFunc:function(yt,jn,vi){(re!==yt||de!==jn||Ie!==vi)&&(i.stencilFunc(yt,jn,vi),re=yt,de=jn,Ie=vi)},setOp:function(yt,jn,vi){(Se!==yt||it!==jn||Ot!==vi)&&(i.stencilOp(yt,jn,vi),Se=yt,it=jn,Ot=vi)},setLocked:function(yt){W=yt},setClear:function(yt){bn!==yt&&(i.clearStencil(yt),bn=yt)},reset:function(){W=!1,ne=null,re=null,de=null,Ie=null,Se=null,it=null,Ot=null,bn=null}}}const r=new t,a=new n,o=new s,c=new WeakMap,l=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,g=!1,A=null,p=null,y=null,b=null,_=null,M=null,w=null,S=new qe(0,0,0),T=0,v=!1,C=null,F=null,K=null,q=null,$=null;const D=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,j=0;const Q=i.getParameter(i.VERSION);Q.indexOf("WebGL")!==-1?(j=parseFloat(/^WebGL (\d)/.exec(Q)[1]),O=j>=1):Q.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),O=j>=2);let J=null,ee={};const ae=i.getParameter(i.SCISSOR_BOX),ye=i.getParameter(i.VIEWPORT),Me=new _t().fromArray(ae),se=new _t().fromArray(ye);function me(W,ne,re,de){const Ie=new Uint8Array(4),Se=i.createTexture();i.bindTexture(W,Se),i.texParameteri(W,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(W,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let it=0;it<re;it++)W===i.TEXTURE_3D||W===i.TEXTURE_2D_ARRAY?i.texImage3D(ne,0,i.RGBA,1,1,de,0,i.RGBA,i.UNSIGNED_BYTE,Ie):i.texImage2D(ne+it,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,Ie);return Se}const be={};be[i.TEXTURE_2D]=me(i.TEXTURE_2D,i.TEXTURE_2D,1),be[i.TEXTURE_CUBE_MAP]=me(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),be[i.TEXTURE_2D_ARRAY]=me(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),be[i.TEXTURE_3D]=me(i.TEXTURE_3D,i.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),xe(i.DEPTH_TEST),a.setFunc(Fr),dt(!1),pt(ip),xe(i.CULL_FACE),G(gs);function xe(W){h[W]!==!0&&(i.enable(W),h[W]=!0)}function Pe(W){h[W]!==!1&&(i.disable(W),h[W]=!1)}function $e(W,ne){return u[W]!==ne?(i.bindFramebuffer(W,ne),u[W]=ne,W===i.DRAW_FRAMEBUFFER&&(u[i.FRAMEBUFFER]=ne),W===i.FRAMEBUFFER&&(u[i.DRAW_FRAMEBUFFER]=ne),!0):!1}function Qe(W,ne){let re=f,de=!1;if(W){re=d.get(ne),re===void 0&&(re=[],d.set(ne,re));const Ie=W.textures;if(re.length!==Ie.length||re[0]!==i.COLOR_ATTACHMENT0){for(let Se=0,it=Ie.length;Se<it;Se++)re[Se]=i.COLOR_ATTACHMENT0+Se;re.length=Ie.length,de=!0}}else re[0]!==i.BACK&&(re[0]=i.BACK,de=!0);de&&i.drawBuffers(re)}function St(W){return m!==W?(i.useProgram(W),m=W,!0):!1}const ut={[qs]:i.FUNC_ADD,[lE]:i.FUNC_SUBTRACT,[hE]:i.FUNC_REVERSE_SUBTRACT};ut[uE]=i.MIN,ut[dE]=i.MAX;const Je={[fE]:i.ZERO,[pE]:i.ONE,[AE]:i.SRC_COLOR,[oh]:i.SRC_ALPHA,[_E]:i.SRC_ALPHA_SATURATE,[xE]:i.DST_COLOR,[mE]:i.DST_ALPHA,[gE]:i.ONE_MINUS_SRC_COLOR,[ch]:i.ONE_MINUS_SRC_ALPHA,[EE]:i.ONE_MINUS_DST_COLOR,[bE]:i.ONE_MINUS_DST_ALPHA,[yE]:i.CONSTANT_COLOR,[wE]:i.ONE_MINUS_CONSTANT_COLOR,[CE]:i.CONSTANT_ALPHA,[vE]:i.ONE_MINUS_CONSTANT_ALPHA};function G(W,ne,re,de,Ie,Se,it,Ot,bn,yt){if(W===gs){g===!0&&(Pe(i.BLEND),g=!1);return}if(g===!1&&(xe(i.BLEND),g=!0),W!==cE){if(W!==A||yt!==v){if((p!==qs||_!==qs)&&(i.blendEquation(i.FUNC_ADD),p=qs,_=qs),yt)switch(W){case Nr:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case rp:i.blendFunc(i.ONE,i.ONE);break;case ap:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case op:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",W);break}else switch(W){case Nr:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case rp:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case ap:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case op:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",W);break}y=null,b=null,M=null,w=null,S.set(0,0,0),T=0,A=W,v=yt}return}Ie=Ie||ne,Se=Se||re,it=it||de,(ne!==p||Ie!==_)&&(i.blendEquationSeparate(ut[ne],ut[Ie]),p=ne,_=Ie),(re!==y||de!==b||Se!==M||it!==w)&&(i.blendFuncSeparate(Je[re],Je[de],Je[Se],Je[it]),y=re,b=de,M=Se,w=it),(Ot.equals(S)===!1||bn!==T)&&(i.blendColor(Ot.r,Ot.g,Ot.b,bn),S.copy(Ot),T=bn),A=W,v=!1}function mn(W,ne){W.side===Si?Pe(i.CULL_FACE):xe(i.CULL_FACE);let re=W.side===Sn;ne&&(re=!re),dt(re),W.blending===Nr&&W.transparent===!1?G(gs):G(W.blending,W.blendEquation,W.blendSrc,W.blendDst,W.blendEquationAlpha,W.blendSrcAlpha,W.blendDstAlpha,W.blendColor,W.blendAlpha,W.premultipliedAlpha),a.setFunc(W.depthFunc),a.setTest(W.depthTest),a.setMask(W.depthWrite),r.setMask(W.colorWrite);const de=W.stencilWrite;o.setTest(de),de&&(o.setMask(W.stencilWriteMask),o.setFunc(W.stencilFunc,W.stencilRef,W.stencilFuncMask),o.setOp(W.stencilFail,W.stencilZFail,W.stencilZPass)),Rt(W.polygonOffset,W.polygonOffsetFactor,W.polygonOffsetUnits),W.alphaToCoverage===!0?xe(i.SAMPLE_ALPHA_TO_COVERAGE):Pe(i.SAMPLE_ALPHA_TO_COVERAGE)}function dt(W){C!==W&&(W?i.frontFace(i.CW):i.frontFace(i.CCW),C=W)}function pt(W){W!==rE?(xe(i.CULL_FACE),W!==F&&(W===ip?i.cullFace(i.BACK):W===aE?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):Pe(i.CULL_FACE),F=W}function ze(W){W!==K&&(O&&i.lineWidth(W),K=W)}function Rt(W,ne,re){W?(xe(i.POLYGON_OFFSET_FILL),(q!==ne||$!==re)&&(i.polygonOffset(ne,re),q=ne,$=re)):Pe(i.POLYGON_OFFSET_FILL)}function Ge(W){W?xe(i.SCISSOR_TEST):Pe(i.SCISSOR_TEST)}function L(W){W===void 0&&(W=i.TEXTURE0+D-1),J!==W&&(i.activeTexture(W),J=W)}function I(W,ne,re){re===void 0&&(J===null?re=i.TEXTURE0+D-1:re=J);let de=ee[re];de===void 0&&(de={type:void 0,texture:void 0},ee[re]=de),(de.type!==W||de.texture!==ne)&&(J!==re&&(i.activeTexture(re),J=re),i.bindTexture(W,ne||be[W]),de.type=W,de.texture=ne)}function Z(){const W=ee[J];W!==void 0&&W.type!==void 0&&(i.bindTexture(W.type,null),W.type=void 0,W.texture=void 0)}function le(){try{i.compressedTexImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ae(){try{i.compressedTexImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function oe(){try{i.texSubImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ue(){try{i.texSubImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ce(){try{i.compressedTexSubImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ve(){try{i.compressedTexSubImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function je(){try{i.texStorage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ee(){try{i.texStorage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ne(){try{i.texImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function ke(){try{i.texImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Oe(W){Me.equals(W)===!1&&(i.scissor(W.x,W.y,W.z,W.w),Me.copy(W))}function Te(W){se.equals(W)===!1&&(i.viewport(W.x,W.y,W.z,W.w),se.copy(W))}function tt(W,ne){let re=l.get(ne);re===void 0&&(re=new WeakMap,l.set(ne,re));let de=re.get(W);de===void 0&&(de=i.getUniformBlockIndex(ne,W.name),re.set(W,de))}function We(W,ne){const de=l.get(ne).get(W);c.get(ne)!==de&&(i.uniformBlockBinding(ne,de,W.__bindingPointIndex),c.set(ne,de))}function nt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),a.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),h={},J=null,ee={},u={},d=new WeakMap,f=[],m=null,g=!1,A=null,p=null,y=null,b=null,_=null,M=null,w=null,S=new qe(0,0,0),T=0,v=!1,C=null,F=null,K=null,q=null,$=null,Me.set(0,0,i.canvas.width,i.canvas.height),se.set(0,0,i.canvas.width,i.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:xe,disable:Pe,bindFramebuffer:$e,drawBuffers:Qe,useProgram:St,setBlending:G,setMaterial:mn,setFlipSided:dt,setCullFace:pt,setLineWidth:ze,setPolygonOffset:Rt,setScissorTest:Ge,activeTexture:L,bindTexture:I,unbindTexture:Z,compressedTexImage2D:le,compressedTexImage3D:Ae,texImage2D:Ne,texImage3D:ke,updateUBOMapping:tt,uniformBlockBinding:We,texStorage2D:je,texStorage3D:Ee,texSubImage2D:oe,texSubImage3D:Ue,compressedTexSubImage2D:Ce,compressedTexSubImage3D:Ve,scissor:Oe,viewport:Te,reset:nt}}function SS(i,e,t,n,s,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Ze,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(L,I){return f?new OffscreenCanvas(L,I):eo("canvas")}function g(L,I,Z){let le=1;const Ae=Ge(L);if((Ae.width>Z||Ae.height>Z)&&(le=Z/Math.max(Ae.width,Ae.height)),le<1)if(typeof HTMLImageElement<"u"&&L instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&L instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&L instanceof ImageBitmap||typeof VideoFrame<"u"&&L instanceof VideoFrame){const oe=Math.floor(le*Ae.width),Ue=Math.floor(le*Ae.height);u===void 0&&(u=m(oe,Ue));const Ce=I?m(oe,Ue):u;return Ce.width=oe,Ce.height=Ue,Ce.getContext("2d").drawImage(L,0,0,oe,Ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ae.width+"x"+Ae.height+") to ("+oe+"x"+Ue+")."),Ce}else return"data"in L&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ae.width+"x"+Ae.height+")."),L;return L}function A(L){return L.generateMipmaps}function p(L){i.generateMipmap(L)}function y(L){return L.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:L.isWebGL3DRenderTarget?i.TEXTURE_3D:L.isWebGLArrayRenderTarget||L.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function b(L,I,Z,le,Ae=!1){if(L!==null){if(i[L]!==void 0)return i[L];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+L+"'")}let oe=I;if(I===i.RED&&(Z===i.FLOAT&&(oe=i.R32F),Z===i.HALF_FLOAT&&(oe=i.R16F),Z===i.UNSIGNED_BYTE&&(oe=i.R8)),I===i.RED_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.R8UI),Z===i.UNSIGNED_SHORT&&(oe=i.R16UI),Z===i.UNSIGNED_INT&&(oe=i.R32UI),Z===i.BYTE&&(oe=i.R8I),Z===i.SHORT&&(oe=i.R16I),Z===i.INT&&(oe=i.R32I)),I===i.RG&&(Z===i.FLOAT&&(oe=i.RG32F),Z===i.HALF_FLOAT&&(oe=i.RG16F),Z===i.UNSIGNED_BYTE&&(oe=i.RG8)),I===i.RG_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.RG8UI),Z===i.UNSIGNED_SHORT&&(oe=i.RG16UI),Z===i.UNSIGNED_INT&&(oe=i.RG32UI),Z===i.BYTE&&(oe=i.RG8I),Z===i.SHORT&&(oe=i.RG16I),Z===i.INT&&(oe=i.RG32I)),I===i.RGB_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.RGB8UI),Z===i.UNSIGNED_SHORT&&(oe=i.RGB16UI),Z===i.UNSIGNED_INT&&(oe=i.RGB32UI),Z===i.BYTE&&(oe=i.RGB8I),Z===i.SHORT&&(oe=i.RGB16I),Z===i.INT&&(oe=i.RGB32I)),I===i.RGBA_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.RGBA8UI),Z===i.UNSIGNED_SHORT&&(oe=i.RGBA16UI),Z===i.UNSIGNED_INT&&(oe=i.RGBA32UI),Z===i.BYTE&&(oe=i.RGBA8I),Z===i.SHORT&&(oe=i.RGBA16I),Z===i.INT&&(oe=i.RGBA32I)),I===i.RGB&&Z===i.UNSIGNED_INT_5_9_9_9_REV&&(oe=i.RGB9_E5),I===i.RGBA){const Ue=Ae?Ac:At.getTransfer(le);Z===i.FLOAT&&(oe=i.RGBA32F),Z===i.HALF_FLOAT&&(oe=i.RGBA16F),Z===i.UNSIGNED_BYTE&&(oe=Ue===Mt?i.SRGB8_ALPHA8:i.RGBA8),Z===i.UNSIGNED_SHORT_4_4_4_4&&(oe=i.RGBA4),Z===i.UNSIGNED_SHORT_5_5_5_1&&(oe=i.RGB5_A1)}return(oe===i.R16F||oe===i.R32F||oe===i.RG16F||oe===i.RG32F||oe===i.RGBA16F||oe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),oe}function _(L,I){let Z;return L?I===null||I===Xs||I===Ha?Z=i.DEPTH24_STENCIL8:I===nn?Z=i.DEPTH32F_STENCIL8:I===Ga&&(Z=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):I===null||I===Xs||I===Ha?Z=i.DEPTH_COMPONENT24:I===nn?Z=i.DEPTH_COMPONENT32F:I===Ga&&(Z=i.DEPTH_COMPONENT16),Z}function M(L,I){return A(L)===!0||L.isFramebufferTexture&&L.minFilter!==In&&L.minFilter!==zt?Math.log2(Math.max(I.width,I.height))+1:L.mipmaps!==void 0&&L.mipmaps.length>0?L.mipmaps.length:L.isCompressedTexture&&Array.isArray(L.image)?I.mipmaps.length:1}function w(L){const I=L.target;I.removeEventListener("dispose",w),T(I),I.isVideoTexture&&h.delete(I)}function S(L){const I=L.target;I.removeEventListener("dispose",S),C(I)}function T(L){const I=n.get(L);if(I.__webglInit===void 0)return;const Z=L.source,le=d.get(Z);if(le){const Ae=le[I.__cacheKey];Ae.usedTimes--,Ae.usedTimes===0&&v(L),Object.keys(le).length===0&&d.delete(Z)}n.remove(L)}function v(L){const I=n.get(L);i.deleteTexture(I.__webglTexture);const Z=L.source,le=d.get(Z);delete le[I.__cacheKey],a.memory.textures--}function C(L){const I=n.get(L);if(L.depthTexture&&(L.depthTexture.dispose(),n.remove(L.depthTexture)),L.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(I.__webglFramebuffer[le]))for(let Ae=0;Ae<I.__webglFramebuffer[le].length;Ae++)i.deleteFramebuffer(I.__webglFramebuffer[le][Ae]);else i.deleteFramebuffer(I.__webglFramebuffer[le]);I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer[le])}else{if(Array.isArray(I.__webglFramebuffer))for(let le=0;le<I.__webglFramebuffer.length;le++)i.deleteFramebuffer(I.__webglFramebuffer[le]);else i.deleteFramebuffer(I.__webglFramebuffer);if(I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer),I.__webglMultisampledFramebuffer&&i.deleteFramebuffer(I.__webglMultisampledFramebuffer),I.__webglColorRenderbuffer)for(let le=0;le<I.__webglColorRenderbuffer.length;le++)I.__webglColorRenderbuffer[le]&&i.deleteRenderbuffer(I.__webglColorRenderbuffer[le]);I.__webglDepthRenderbuffer&&i.deleteRenderbuffer(I.__webglDepthRenderbuffer)}const Z=L.textures;for(let le=0,Ae=Z.length;le<Ae;le++){const oe=n.get(Z[le]);oe.__webglTexture&&(i.deleteTexture(oe.__webglTexture),a.memory.textures--),n.remove(Z[le])}n.remove(L)}let F=0;function K(){F=0}function q(){const L=F;return L>=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+L+" texture units while this GPU supports only "+s.maxTextures),F+=1,L}function $(L){const I=[];return I.push(L.wrapS),I.push(L.wrapT),I.push(L.wrapR||0),I.push(L.magFilter),I.push(L.minFilter),I.push(L.anisotropy),I.push(L.internalFormat),I.push(L.format),I.push(L.type),I.push(L.generateMipmaps),I.push(L.premultiplyAlpha),I.push(L.flipY),I.push(L.unpackAlignment),I.push(L.colorSpace),I.join()}function D(L,I){const Z=n.get(L);if(L.isVideoTexture&&ze(L),L.isRenderTargetTexture===!1&&L.version>0&&Z.__version!==L.version){const le=L.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{se(Z,L,I);return}}t.bindTexture(i.TEXTURE_2D,Z.__webglTexture,i.TEXTURE0+I)}function O(L,I){const Z=n.get(L);if(L.version>0&&Z.__version!==L.version){se(Z,L,I);return}t.bindTexture(i.TEXTURE_2D_ARRAY,Z.__webglTexture,i.TEXTURE0+I)}function j(L,I){const Z=n.get(L);if(L.version>0&&Z.__version!==L.version){se(Z,L,I);return}t.bindTexture(i.TEXTURE_3D,Z.__webglTexture,i.TEXTURE0+I)}function Q(L,I){const Z=n.get(L);if(L.version>0&&Z.__version!==L.version){me(Z,L,I);return}t.bindTexture(i.TEXTURE_CUBE_MAP,Z.__webglTexture,i.TEXTURE0+I)}const J={[Lr]:i.REPEAT,[ai]:i.CLAMP_TO_EDGE,[sc]:i.MIRRORED_REPEAT},ee={[In]:i.NEAREST,[dp]:i.NEAREST_MIPMAP_NEAREST,[Qa]:i.NEAREST_MIPMAP_LINEAR,[zt]:i.LINEAR,[rc]:i.LINEAR_MIPMAP_NEAREST,[Jn]:i.LINEAR_MIPMAP_LINEAR},ae={[QE]:i.NEVER,[qE]:i.ALWAYS,[GE]:i.LESS,[Cp]:i.LEQUAL,[HE]:i.EQUAL,[WE]:i.GEQUAL,[zE]:i.GREATER,[VE]:i.NOTEQUAL};function ye(L,I){if(I.type===nn&&e.has("OES_texture_float_linear")===!1&&(I.magFilter===zt||I.magFilter===rc||I.magFilter===Qa||I.magFilter===Jn||I.minFilter===zt||I.minFilter===rc||I.minFilter===Qa||I.minFilter===Jn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(L,i.TEXTURE_WRAP_S,J[I.wrapS]),i.texParameteri(L,i.TEXTURE_WRAP_T,J[I.wrapT]),(L===i.TEXTURE_3D||L===i.TEXTURE_2D_ARRAY)&&i.texParameteri(L,i.TEXTURE_WRAP_R,J[I.wrapR]),i.texParameteri(L,i.TEXTURE_MAG_FILTER,ee[I.magFilter]),i.texParameteri(L,i.TEXTURE_MIN_FILTER,ee[I.minFilter]),I.compareFunction&&(i.texParameteri(L,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(L,i.TEXTURE_COMPARE_FUNC,ae[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(I.magFilter===In||I.minFilter!==Qa&&I.minFilter!==Jn||I.type===nn&&e.has("OES_texture_float_linear")===!1)return;if(I.anisotropy>1||n.get(I).__currentAnisotropy){const Z=e.get("EXT_texture_filter_anisotropic");i.texParameterf(L,Z.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,s.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy}}}function Me(L,I){let Z=!1;L.__webglInit===void 0&&(L.__webglInit=!0,I.addEventListener("dispose",w));const le=I.source;let Ae=d.get(le);Ae===void 0&&(Ae={},d.set(le,Ae));const oe=$(I);if(oe!==L.__cacheKey){Ae[oe]===void 0&&(Ae[oe]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,Z=!0),Ae[oe].usedTimes++;const Ue=Ae[L.__cacheKey];Ue!==void 0&&(Ae[L.__cacheKey].usedTimes--,Ue.usedTimes===0&&v(I)),L.__cacheKey=oe,L.__webglTexture=Ae[oe].texture}return Z}function se(L,I,Z){let le=i.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(le=i.TEXTURE_2D_ARRAY),I.isData3DTexture&&(le=i.TEXTURE_3D);const Ae=Me(L,I),oe=I.source;t.bindTexture(le,L.__webglTexture,i.TEXTURE0+Z);const Ue=n.get(oe);if(oe.version!==Ue.__version||Ae===!0){t.activeTexture(i.TEXTURE0+Z);const Ce=At.getPrimaries(At.workingColorSpace),Ve=I.colorSpace===oi?null:At.getPrimaries(I.colorSpace),je=I.colorSpace===oi||Ce===Ve?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,je);let Ee=g(I.image,!1,s.maxTextureSize);Ee=Rt(I,Ee);const Ne=r.convert(I.format,I.colorSpace),ke=r.convert(I.type);let Oe=b(I.internalFormat,Ne,ke,I.colorSpace,I.isVideoTexture);ye(le,I);let Te;const tt=I.mipmaps,We=I.isVideoTexture!==!0,nt=Ue.__version===void 0||Ae===!0,W=oe.dataReady,ne=M(I,Ee);if(I.isDepthTexture)Oe=_(I.format===Va,I.type),nt&&(We?t.texStorage2D(i.TEXTURE_2D,1,Oe,Ee.width,Ee.height):t.texImage2D(i.TEXTURE_2D,0,Oe,Ee.width,Ee.height,0,Ne,ke,null));else if(I.isDataTexture)if(tt.length>0){We&&nt&&t.texStorage2D(i.TEXTURE_2D,ne,Oe,tt[0].width,tt[0].height);for(let re=0,de=tt.length;re<de;re++)Te=tt[re],We?W&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Te.width,Te.height,Ne,ke,Te.data):t.texImage2D(i.TEXTURE_2D,re,Oe,Te.width,Te.height,0,Ne,ke,Te.data);I.generateMipmaps=!1}else We?(nt&&t.texStorage2D(i.TEXTURE_2D,ne,Oe,Ee.width,Ee.height),W&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Ee.width,Ee.height,Ne,ke,Ee.data)):t.texImage2D(i.TEXTURE_2D,0,Oe,Ee.width,Ee.height,0,Ne,ke,Ee.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){We&&nt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ne,Oe,tt[0].width,tt[0].height,Ee.depth);for(let re=0,de=tt.length;re<de;re++)if(Te=tt[re],I.format!==sn)if(Ne!==null)if(We){if(W)if(I.layerUpdates.size>0){const Ie=FA(Te.width,Te.height,I.format,I.type);for(const Se of I.layerUpdates){const it=Te.data.subarray(Se*Ie/Te.data.BYTES_PER_ELEMENT,(Se+1)*Ie/Te.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,Se,Te.width,Te.height,1,Ne,it)}I.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,0,Te.width,Te.height,Ee.depth,Ne,Te.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,re,Oe,Te.width,Te.height,Ee.depth,0,Te.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else We?W&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,0,Te.width,Te.height,Ee.depth,Ne,ke,Te.data):t.texImage3D(i.TEXTURE_2D_ARRAY,re,Oe,Te.width,Te.height,Ee.depth,0,Ne,ke,Te.data)}else{We&&nt&&t.texStorage2D(i.TEXTURE_2D,ne,Oe,tt[0].width,tt[0].height);for(let re=0,de=tt.length;re<de;re++)Te=tt[re],I.format!==sn?Ne!==null?We?W&&t.compressedTexSubImage2D(i.TEXTURE_2D,re,0,0,Te.width,Te.height,Ne,Te.data):t.compressedTexImage2D(i.TEXTURE_2D,re,Oe,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):We?W&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Te.width,Te.height,Ne,ke,Te.data):t.texImage2D(i.TEXTURE_2D,re,Oe,Te.width,Te.height,0,Ne,ke,Te.data)}else if(I.isDataArrayTexture)if(We){if(nt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ne,Oe,Ee.width,Ee.height,Ee.depth),W)if(I.layerUpdates.size>0){const re=FA(Ee.width,Ee.height,I.format,I.type);for(const de of I.layerUpdates){const Ie=Ee.data.subarray(de*re/Ee.data.BYTES_PER_ELEMENT,(de+1)*re/Ee.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,de,Ee.width,Ee.height,1,Ne,ke,Ie)}I.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Ne,ke,Ee.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Oe,Ee.width,Ee.height,Ee.depth,0,Ne,ke,Ee.data);else if(I.isData3DTexture)We?(nt&&t.texStorage3D(i.TEXTURE_3D,ne,Oe,Ee.width,Ee.height,Ee.depth),W&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Ne,ke,Ee.data)):t.texImage3D(i.TEXTURE_3D,0,Oe,Ee.width,Ee.height,Ee.depth,0,Ne,ke,Ee.data);else if(I.isFramebufferTexture){if(nt)if(We)t.texStorage2D(i.TEXTURE_2D,ne,Oe,Ee.width,Ee.height);else{let re=Ee.width,de=Ee.height;for(let Ie=0;Ie<ne;Ie++)t.texImage2D(i.TEXTURE_2D,Ie,Oe,re,de,0,Ne,ke,null),re>>=1,de>>=1}}else if(tt.length>0){if(We&&nt){const re=Ge(tt[0]);t.texStorage2D(i.TEXTURE_2D,ne,Oe,re.width,re.height)}for(let re=0,de=tt.length;re<de;re++)Te=tt[re],We?W&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Ne,ke,Te):t.texImage2D(i.TEXTURE_2D,re,Oe,Ne,ke,Te);I.generateMipmaps=!1}else if(We){if(nt){const re=Ge(Ee);t.texStorage2D(i.TEXTURE_2D,ne,Oe,re.width,re.height)}W&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Ne,ke,Ee)}else t.texImage2D(i.TEXTURE_2D,0,Oe,Ne,ke,Ee);A(I)&&p(le),Ue.__version=oe.version,I.onUpdate&&I.onUpdate(I)}L.__version=I.version}function me(L,I,Z){if(I.image.length!==6)return;const le=Me(L,I),Ae=I.source;t.bindTexture(i.TEXTURE_CUBE_MAP,L.__webglTexture,i.TEXTURE0+Z);const oe=n.get(Ae);if(Ae.version!==oe.__version||le===!0){t.activeTexture(i.TEXTURE0+Z);const Ue=At.getPrimaries(At.workingColorSpace),Ce=I.colorSpace===oi?null:At.getPrimaries(I.colorSpace),Ve=I.colorSpace===oi||Ue===Ce?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);const je=I.isCompressedTexture||I.image[0].isCompressedTexture,Ee=I.image[0]&&I.image[0].isDataTexture,Ne=[];for(let de=0;de<6;de++)!je&&!Ee?Ne[de]=g(I.image[de],!0,s.maxCubemapSize):Ne[de]=Ee?I.image[de].image:I.image[de],Ne[de]=Rt(I,Ne[de]);const ke=Ne[0],Oe=r.convert(I.format,I.colorSpace),Te=r.convert(I.type),tt=b(I.internalFormat,Oe,Te,I.colorSpace),We=I.isVideoTexture!==!0,nt=oe.__version===void 0||le===!0,W=Ae.dataReady;let ne=M(I,ke);ye(i.TEXTURE_CUBE_MAP,I);let re;if(je){We&&nt&&t.texStorage2D(i.TEXTURE_CUBE_MAP,ne,tt,ke.width,ke.height);for(let de=0;de<6;de++){re=Ne[de].mipmaps;for(let Ie=0;Ie<re.length;Ie++){const Se=re[Ie];I.format!==sn?Oe!==null?We?W&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,0,0,Se.width,Se.height,Oe,Se.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,tt,Se.width,Se.height,0,Se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,0,0,Se.width,Se.height,Oe,Te,Se.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,tt,Se.width,Se.height,0,Oe,Te,Se.data)}}}else{if(re=I.mipmaps,We&&nt){re.length>0&&ne++;const de=Ge(Ne[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,ne,tt,de.width,de.height)}for(let de=0;de<6;de++)if(Ee){We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Ne[de].width,Ne[de].height,Oe,Te,Ne[de].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,tt,Ne[de].width,Ne[de].height,0,Oe,Te,Ne[de].data);for(let Ie=0;Ie<re.length;Ie++){const it=re[Ie].image[de].image;We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,0,0,it.width,it.height,Oe,Te,it.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,tt,it.width,it.height,0,Oe,Te,it.data)}}else{We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Oe,Te,Ne[de]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,tt,Oe,Te,Ne[de]);for(let Ie=0;Ie<re.length;Ie++){const Se=re[Ie];We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,0,0,Oe,Te,Se.image[de]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,tt,Oe,Te,Se.image[de])}}}A(I)&&p(i.TEXTURE_CUBE_MAP),oe.__version=Ae.version,I.onUpdate&&I.onUpdate(I)}L.__version=I.version}function be(L,I,Z,le,Ae,oe){const Ue=r.convert(Z.format,Z.colorSpace),Ce=r.convert(Z.type),Ve=b(Z.internalFormat,Ue,Ce,Z.colorSpace),je=n.get(I),Ee=n.get(Z);if(Ee.__renderTarget=I,!je.__hasExternalTextures){const Ne=Math.max(1,I.width>>oe),ke=Math.max(1,I.height>>oe);Ae===i.TEXTURE_3D||Ae===i.TEXTURE_2D_ARRAY?t.texImage3D(Ae,oe,Ve,Ne,ke,I.depth,0,Ue,Ce,null):t.texImage2D(Ae,oe,Ve,Ne,ke,0,Ue,Ce,null)}t.bindFramebuffer(i.FRAMEBUFFER,L),pt(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,le,Ae,Ee.__webglTexture,0,dt(I)):(Ae===i.TEXTURE_2D||Ae>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&Ae<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,le,Ae,Ee.__webglTexture,oe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function xe(L,I,Z){if(i.bindRenderbuffer(i.RENDERBUFFER,L),I.depthBuffer){const le=I.depthTexture,Ae=le&&le.isDepthTexture?le.type:null,oe=_(I.stencilBuffer,Ae),Ue=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ce=dt(I);pt(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Ce,oe,I.width,I.height):Z?i.renderbufferStorageMultisample(i.RENDERBUFFER,Ce,oe,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,oe,I.width,I.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ue,i.RENDERBUFFER,L)}else{const le=I.textures;for(let Ae=0;Ae<le.length;Ae++){const oe=le[Ae],Ue=r.convert(oe.format,oe.colorSpace),Ce=r.convert(oe.type),Ve=b(oe.internalFormat,Ue,Ce,oe.colorSpace),je=dt(I);Z&&pt(I)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,je,Ve,I.width,I.height):pt(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,je,Ve,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,Ve,I.width,I.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Pe(L,I){if(I&&I.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,L),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const le=n.get(I.depthTexture);le.__renderTarget=I,(!le.__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),D(I.depthTexture,0);const Ae=le.__webglTexture,oe=dt(I);if(I.depthTexture.format===za)pt(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ae,0,oe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ae,0);else if(I.depthTexture.format===Va)pt(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ae,0,oe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ae,0);else throw new Error("Unknown depthTexture format")}function $e(L){const I=n.get(L),Z=L.isWebGLCubeRenderTarget===!0;if(I.__boundDepthTexture!==L.depthTexture){const le=L.depthTexture;if(I.__depthDisposeCallback&&I.__depthDisposeCallback(),le){const Ae=()=>{delete I.__boundDepthTexture,delete I.__depthDisposeCallback,le.removeEventListener("dispose",Ae)};le.addEventListener("dispose",Ae),I.__depthDisposeCallback=Ae}I.__boundDepthTexture=le}if(L.depthTexture&&!I.__autoAllocateDepthBuffer){if(Z)throw new Error("target.depthTexture not supported in Cube render targets");const le=L.texture.mipmaps;le&&le.length>0?Pe(I.__webglFramebuffer[0],L):Pe(I.__webglFramebuffer,L)}else if(Z){I.__webglDepthbuffer=[];for(let le=0;le<6;le++)if(t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[le]),I.__webglDepthbuffer[le]===void 0)I.__webglDepthbuffer[le]=i.createRenderbuffer(),xe(I.__webglDepthbuffer[le],L,!1);else{const Ae=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,oe=I.__webglDepthbuffer[le];i.bindRenderbuffer(i.RENDERBUFFER,oe),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ae,i.RENDERBUFFER,oe)}}else{const le=L.texture.mipmaps;if(le&&le.length>0?t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer),I.__webglDepthbuffer===void 0)I.__webglDepthbuffer=i.createRenderbuffer(),xe(I.__webglDepthbuffer,L,!1);else{const Ae=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,oe=I.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,oe),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ae,i.RENDERBUFFER,oe)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Qe(L,I,Z){const le=n.get(L);I!==void 0&&be(le.__webglFramebuffer,L,L.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),Z!==void 0&&$e(L)}function St(L){const I=L.texture,Z=n.get(L),le=n.get(I);L.addEventListener("dispose",S);const Ae=L.textures,oe=L.isWebGLCubeRenderTarget===!0,Ue=Ae.length>1;if(Ue||(le.__webglTexture===void 0&&(le.__webglTexture=i.createTexture()),le.__version=I.version,a.memory.textures++),oe){Z.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(I.mipmaps&&I.mipmaps.length>0){Z.__webglFramebuffer[Ce]=[];for(let Ve=0;Ve<I.mipmaps.length;Ve++)Z.__webglFramebuffer[Ce][Ve]=i.createFramebuffer()}else Z.__webglFramebuffer[Ce]=i.createFramebuffer()}else{if(I.mipmaps&&I.mipmaps.length>0){Z.__webglFramebuffer=[];for(let Ce=0;Ce<I.mipmaps.length;Ce++)Z.__webglFramebuffer[Ce]=i.createFramebuffer()}else Z.__webglFramebuffer=i.createFramebuffer();if(Ue)for(let Ce=0,Ve=Ae.length;Ce<Ve;Ce++){const je=n.get(Ae[Ce]);je.__webglTexture===void 0&&(je.__webglTexture=i.createTexture(),a.memory.textures++)}if(L.samples>0&&pt(L)===!1){Z.__webglMultisampledFramebuffer=i.createFramebuffer(),Z.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,Z.__webglMultisampledFramebuffer);for(let Ce=0;Ce<Ae.length;Ce++){const Ve=Ae[Ce];Z.__webglColorRenderbuffer[Ce]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,Z.__webglColorRenderbuffer[Ce]);const je=r.convert(Ve.format,Ve.colorSpace),Ee=r.convert(Ve.type),Ne=b(Ve.internalFormat,je,Ee,Ve.colorSpace,L.isXRRenderTarget===!0),ke=dt(L);i.renderbufferStorageMultisample(i.RENDERBUFFER,ke,Ne,L.width,L.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ce,i.RENDERBUFFER,Z.__webglColorRenderbuffer[Ce])}i.bindRenderbuffer(i.RENDERBUFFER,null),L.depthBuffer&&(Z.__webglDepthRenderbuffer=i.createRenderbuffer(),xe(Z.__webglDepthRenderbuffer,L,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(oe){t.bindTexture(i.TEXTURE_CUBE_MAP,le.__webglTexture),ye(i.TEXTURE_CUBE_MAP,I);for(let Ce=0;Ce<6;Ce++)if(I.mipmaps&&I.mipmaps.length>0)for(let Ve=0;Ve<I.mipmaps.length;Ve++)be(Z.__webglFramebuffer[Ce][Ve],L,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,Ve);else be(Z.__webglFramebuffer[Ce],L,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0);A(I)&&p(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ue){for(let Ce=0,Ve=Ae.length;Ce<Ve;Ce++){const je=Ae[Ce],Ee=n.get(je);t.bindTexture(i.TEXTURE_2D,Ee.__webglTexture),ye(i.TEXTURE_2D,je),be(Z.__webglFramebuffer,L,je,i.COLOR_ATTACHMENT0+Ce,i.TEXTURE_2D,0),A(je)&&p(i.TEXTURE_2D)}t.unbindTexture()}else{let Ce=i.TEXTURE_2D;if((L.isWebGL3DRenderTarget||L.isWebGLArrayRenderTarget)&&(Ce=L.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(Ce,le.__webglTexture),ye(Ce,I),I.mipmaps&&I.mipmaps.length>0)for(let Ve=0;Ve<I.mipmaps.length;Ve++)be(Z.__webglFramebuffer[Ve],L,I,i.COLOR_ATTACHMENT0,Ce,Ve);else be(Z.__webglFramebuffer,L,I,i.COLOR_ATTACHMENT0,Ce,0);A(I)&&p(Ce),t.unbindTexture()}L.depthBuffer&&$e(L)}function ut(L){const I=L.textures;for(let Z=0,le=I.length;Z<le;Z++){const Ae=I[Z];if(A(Ae)){const oe=y(L),Ue=n.get(Ae).__webglTexture;t.bindTexture(oe,Ue),p(oe),t.unbindTexture()}}}const Je=[],G=[];function mn(L){if(L.samples>0){if(pt(L)===!1){const I=L.textures,Z=L.width,le=L.height;let Ae=i.COLOR_BUFFER_BIT;const oe=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ue=n.get(L),Ce=I.length>1;if(Ce)for(let je=0;je<I.length;je++)t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+je,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+je,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Ue.__webglMultisampledFramebuffer);const Ve=L.texture.mipmaps;Ve&&Ve.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ue.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ue.__webglFramebuffer);for(let je=0;je<I.length;je++){if(L.resolveDepthBuffer&&(L.depthBuffer&&(Ae|=i.DEPTH_BUFFER_BIT),L.stencilBuffer&&L.resolveStencilBuffer&&(Ae|=i.STENCIL_BUFFER_BIT)),Ce){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Ue.__webglColorRenderbuffer[je]);const Ee=n.get(I[je]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Ee,0)}i.blitFramebuffer(0,0,Z,le,0,0,Z,le,Ae,i.NEAREST),c===!0&&(Je.length=0,G.length=0,Je.push(i.COLOR_ATTACHMENT0+je),L.depthBuffer&&L.resolveDepthBuffer===!1&&(Je.push(oe),G.push(oe),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,G)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Je))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),Ce)for(let je=0;je<I.length;je++){t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+je,i.RENDERBUFFER,Ue.__webglColorRenderbuffer[je]);const Ee=n.get(I[je]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+je,i.TEXTURE_2D,Ee,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ue.__webglMultisampledFramebuffer)}else if(L.depthBuffer&&L.resolveDepthBuffer===!1&&c){const I=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[I])}}}function dt(L){return Math.min(s.maxSamples,L.samples)}function pt(L){const I=n.get(L);return L.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ze(L){const I=a.render.frame;h.get(L)!==I&&(h.set(L,I),L.update())}function Rt(L,I){const Z=L.colorSpace,le=L.format,Ae=L.type;return L.isCompressedTexture===!0||L.isVideoTexture===!0||Z!==rn&&Z!==oi&&(At.getTransfer(Z)===Mt?(le!==sn||Ae!==tn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Z)),I}function Ge(L){return typeof HTMLImageElement<"u"&&L instanceof HTMLImageElement?(l.width=L.naturalWidth||L.width,l.height=L.naturalHeight||L.height):typeof VideoFrame<"u"&&L instanceof VideoFrame?(l.width=L.displayWidth,l.height=L.displayHeight):(l.width=L.width,l.height=L.height),l}this.allocateTextureUnit=q,this.resetTextureUnits=K,this.setTexture2D=D,this.setTexture2DArray=O,this.setTexture3D=j,this.setTextureCube=Q,this.rebindTextures=Qe,this.setupRenderTarget=St,this.updateRenderTargetMipmap=ut,this.updateMultisampleRenderTarget=mn,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=be,this.useMultisampledRTT=pt}function IS(i,e){function t(n,s=oi){let r;const a=At.getTransfer(s);if(n===tn)return i.UNSIGNED_BYTE;if(n===Eh)return i.UNSIGNED_SHORT_4_4_4_4;if(n===_h)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Ap)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===fp)return i.BYTE;if(n===pp)return i.SHORT;if(n===Ga)return i.UNSIGNED_SHORT;if(n===xh)return i.INT;if(n===Xs)return i.UNSIGNED_INT;if(n===nn)return i.FLOAT;if(n===Mn)return i.HALF_FLOAT;if(n===gp)return i.ALPHA;if(n===mp)return i.RGB;if(n===sn)return i.RGBA;if(n===za)return i.DEPTH_COMPONENT;if(n===Va)return i.DEPTH_STENCIL;if(n===Gi)return i.RED;if(n===yh)return i.RED_INTEGER;if(n===Ys)return i.RG;if(n===wh)return i.RG_INTEGER;if(n===Ch)return i.RGBA_INTEGER;if(n===ac||n===Wa||n===oc||n===qa)if(a===Mt)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===ac)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Wa)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===oc)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===qa)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===ac)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Wa)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===oc)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===qa)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===cc||n===vh||n===lc||n===Sh)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===cc)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===vh)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===lc)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Sh)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===hc||n===uc||n===dc)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===hc||n===uc)return a===Mt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===dc)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Ka||n===Ih||n===Mh||n===Bh||n===Xa||n===Th||n===Rh||n===Nh||n===Fh||n===Dh||n===Lh||n===Ph||n===kh||n===Uh)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Ka)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ih)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Mh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Bh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Xa)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Th)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Rh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Nh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Fh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Dh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Lh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Ph)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===kh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Uh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Ya||n===Oh||n===fc)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===Ya)return a===Mt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Oh)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===fc)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===bp||n===Qh||n===Gh||n===Hh)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===Ya)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Qh)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Gh)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Hh)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ha?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const MS=`+}`;function RS(i,e,t){let n=new Mu;const s=new Ze,r=new Ze,a=new _t,o=new sy({depthPacking:qE}),c=new ry,l={},h=t.maxTextureSize,u={[Gi]:Sn,[Sn]:Gi,[Ii]:Ii},d=new Ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ze},radius:{value:4}},vertexShader:BS,fragmentShader:TS}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new On;m.setAttribute("position",new En(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Jt(m,d),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hp;let p=this.type;this.render=function(w,S,T){if(A.enabled===!1||A.autoUpdate===!1&&A.needsUpdate===!1||w.length===0)return;const C=i.getRenderTarget(),v=i.getActiveCubeFace(),F=i.getActiveMipmapLevel(),K=i.state;K.setBlending(ms),K.buffers.color.setClear(1,1,1,1),K.buffers.depth.setTest(!0),K.setScissorTest(!1);const q=p!==Qi&&this.type===Qi,$=p===Qi&&this.type!==Qi;for(let D=0,O=w.length;D<O;D++){const Y=w[D],Q=Y.shadow;if(Q===void 0){console.warn("THREE.WebGLShadowMap:",Y,"has no shadow.");continue}if(Q.autoUpdate===!1&&Q.needsUpdate===!1)continue;s.copy(Q.mapSize);const J=Q.getFrameExtents();if(s.multiply(J),r.copy(Q.mapSize),(s.x>h||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/J.x),s.x=r.x*J.x,Q.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/J.y),s.y=r.y*J.y,Q.mapSize.y=r.y)),Q.map===null||q===!0||$===!0){const ae=this.type!==Qi?{minFilter:In,magFilter:In}:{};Q.map!==null&&Q.map.dispose(),Q.map=new Zs(s.x,s.y,ae),Q.map.texture.name=Y.name+".shadowMap",Q.camera.updateProjectionMatrix()}i.setRenderTarget(Q.map),i.clear();const ee=Q.getViewportCount();for(let ae=0;ae<ee;ae++){const ye=Q.getViewport(ae);a.set(r.x*ye.x,r.y*ye.y,r.x*ye.z,r.y*ye.w),K.viewport(a),Q.updateMatrices(Y,ae),n=Q.getFrustum(),_(S,T,Q.camera,Y,this.type)}Q.isPointLightShadow!==!0&&this.type===Qi&&y(Q,T),Q.needsUpdate=!1}p=this.type,A.needsUpdate=!1,i.setRenderTarget(C,v,F)};function y(w,S){const T=e.update(g);d.defines.VSM_SAMPLES!==w.blurSamples&&(d.defines.VSM_SAMPLES=w.blurSamples,f.defines.VSM_SAMPLES=w.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new Zs(s.x,s.y)),d.uniforms.shadow_pass.value=w.map.texture,d.uniforms.resolution.value=w.mapSize,d.uniforms.radius.value=w.radius,i.setRenderTarget(w.mapPass),i.clear(),i.renderBufferDirect(S,null,T,d,g,null),f.uniforms.shadow_pass.value=w.mapPass.texture,f.uniforms.resolution.value=w.mapSize,f.uniforms.radius.value=w.radius,i.setRenderTarget(w.map),i.clear(),i.renderBufferDirect(S,null,T,f,g,null)}function b(w,S,T,C){let v=null;const F=T.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(F!==void 0)v=F;else if(v=T.isPointLight===!0?c:o,i.localClippingEnabled&&S.clipShadows===!0&&Array.isArray(S.clippingPlanes)&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0||S.map&&S.alphaTest>0||S.alphaToCoverage===!0){const K=v.uuid,q=S.uuid;let $=l[K];$===void 0&&($={},l[K]=$);let D=$[q];D===void 0&&(D=v.clone(),$[q]=D,S.addEventListener("dispose",M)),v=D}if(v.visible=S.visible,v.wireframe=S.wireframe,C===Qi?v.side=S.shadowSide!==null?S.shadowSide:S.side:v.side=S.shadowSide!==null?S.shadowSide:u[S.side],v.alphaMap=S.alphaMap,v.alphaTest=S.alphaToCoverage===!0?.5:S.alphaTest,v.map=S.map,v.clipShadows=S.clipShadows,v.clippingPlanes=S.clippingPlanes,v.clipIntersection=S.clipIntersection,v.displacementMap=S.displacementMap,v.displacementScale=S.displacementScale,v.displacementBias=S.displacementBias,v.wireframeLinewidth=S.wireframeLinewidth,v.linewidth=S.linewidth,T.isPointLight===!0&&v.isMeshDistanceMaterial===!0){const K=i.properties.get(v);K.light=T}return v}function _(w,S,T,C,v){if(w.visible===!1)return;if(w.layers.test(S.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&v===Qi)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,w.matrixWorld);const q=e.update(w),$=w.material;if(Array.isArray($)){const D=q.groups;for(let O=0,Y=D.length;O<Y;O++){const Q=D[O],J=$[Q.materialIndex];if(J&&J.visible){const ee=b(w,J,C,v);w.onBeforeShadow(i,w,S,T,q,ee,Q),i.renderBufferDirect(T,null,q,ee,w,Q),w.onAfterShadow(i,w,S,T,q,ee,Q)}}}else if($.visible){const D=b(w,$,C,v);w.onBeforeShadow(i,w,S,T,q,D,null),i.renderBufferDirect(T,null,q,D,w,null),w.onAfterShadow(i,w,S,T,q,D,null)}}const K=w.children;for(let q=0,$=K.length;q<$;q++)_(K[q],S,T,C,v)}function M(w){w.target.removeEventListener("dispose",M);for(const T in l){const C=l[T],v=w.target.uuid;v in C&&(C[v].dispose(),delete C[v])}}}const NS={[Ah]:gh,[mh]:Eh,[bh]:_h,[Lr]:xh,[gh]:Ah,[Eh]:mh,[_h]:bh,[xh]:Lr};function FS(i,e){function t(){let W=!1;const ne=new _t;let re=null;const de=new _t(0,0,0,0);return{setMask:function(Ie){re!==Ie&&!W&&(i.colorMask(Ie,Ie,Ie,Ie),re=Ie)},setLocked:function(Ie){W=Ie},setClear:function(Ie,Se,it,Ot,bn){bn===!0&&(Ie*=Ot,Se*=Ot,it*=Ot),ne.set(Ie,Se,it,Ot),de.equals(ne)===!1&&(i.clearColor(Ie,Se,it,Ot),de.copy(ne))},reset:function(){W=!1,re=null,de.set(-1,0,0,0)}}}function n(){let W=!1,ne=!1,re=null,de=null,Ie=null;return{setReversed:function(Se){if(ne!==Se){const it=e.get("EXT_clip_control");Se?it.clipControlEXT(it.LOWER_LEFT_EXT,it.ZERO_TO_ONE_EXT):it.clipControlEXT(it.LOWER_LEFT_EXT,it.NEGATIVE_ONE_TO_ONE_EXT),ne=Se;const Ot=Ie;Ie=null,this.setClear(Ot)}},getReversed:function(){return ne},setTest:function(Se){Se?xe(i.DEPTH_TEST):Pe(i.DEPTH_TEST)},setMask:function(Se){re!==Se&&!W&&(i.depthMask(Se),re=Se)},setFunc:function(Se){if(ne&&(Se=NS[Se]),de!==Se){switch(Se){case Ah:i.depthFunc(i.NEVER);break;case gh:i.depthFunc(i.ALWAYS);break;case mh:i.depthFunc(i.LESS);break;case Lr:i.depthFunc(i.LEQUAL);break;case bh:i.depthFunc(i.EQUAL);break;case xh:i.depthFunc(i.GEQUAL);break;case Eh:i.depthFunc(i.GREATER);break;case _h:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}de=Se}},setLocked:function(Se){W=Se},setClear:function(Se){Ie!==Se&&(ne&&(Se=1-Se),i.clearDepth(Se),Ie=Se)},reset:function(){W=!1,re=null,de=null,Ie=null,ne=!1}}}function s(){let W=!1,ne=null,re=null,de=null,Ie=null,Se=null,it=null,Ot=null,bn=null;return{setTest:function(yt){W||(yt?xe(i.STENCIL_TEST):Pe(i.STENCIL_TEST))},setMask:function(yt){ne!==yt&&!W&&(i.stencilMask(yt),ne=yt)},setFunc:function(yt,Yn,Si){(re!==yt||de!==Yn||Ie!==Si)&&(i.stencilFunc(yt,Yn,Si),re=yt,de=Yn,Ie=Si)},setOp:function(yt,Yn,Si){(Se!==yt||it!==Yn||Ot!==Si)&&(i.stencilOp(yt,Yn,Si),Se=yt,it=Yn,Ot=Si)},setLocked:function(yt){W=yt},setClear:function(yt){bn!==yt&&(i.clearStencil(yt),bn=yt)},reset:function(){W=!1,ne=null,re=null,de=null,Ie=null,Se=null,it=null,Ot=null,bn=null}}}const r=new t,a=new n,o=new s,c=new WeakMap,l=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,g=!1,A=null,p=null,y=null,b=null,_=null,M=null,w=null,S=new qe(0,0,0),T=0,C=!1,v=null,F=null,K=null,q=null,$=null;const D=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,Y=0;const Q=i.getParameter(i.VERSION);Q.indexOf("WebGL")!==-1?(Y=parseFloat(/^WebGL (\d)/.exec(Q)[1]),O=Y>=1):Q.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),O=Y>=2);let J=null,ee={};const ae=i.getParameter(i.SCISSOR_BOX),ye=i.getParameter(i.VIEWPORT),Me=new _t().fromArray(ae),se=new _t().fromArray(ye);function me(W,ne,re,de){const Ie=new Uint8Array(4),Se=i.createTexture();i.bindTexture(W,Se),i.texParameteri(W,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(W,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let it=0;it<re;it++)W===i.TEXTURE_3D||W===i.TEXTURE_2D_ARRAY?i.texImage3D(ne,0,i.RGBA,1,1,de,0,i.RGBA,i.UNSIGNED_BYTE,Ie):i.texImage2D(ne+it,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,Ie);return Se}const be={};be[i.TEXTURE_2D]=me(i.TEXTURE_2D,i.TEXTURE_2D,1),be[i.TEXTURE_CUBE_MAP]=me(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),be[i.TEXTURE_2D_ARRAY]=me(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),be[i.TEXTURE_3D]=me(i.TEXTURE_3D,i.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),xe(i.DEPTH_TEST),a.setFunc(Lr),dt(!1),pt(lp),xe(i.CULL_FACE),G(ms);function xe(W){h[W]!==!0&&(i.enable(W),h[W]=!0)}function Pe(W){h[W]!==!1&&(i.disable(W),h[W]=!1)}function $e(W,ne){return u[W]!==ne?(i.bindFramebuffer(W,ne),u[W]=ne,W===i.DRAW_FRAMEBUFFER&&(u[i.FRAMEBUFFER]=ne),W===i.FRAMEBUFFER&&(u[i.DRAW_FRAMEBUFFER]=ne),!0):!1}function Qe(W,ne){let re=f,de=!1;if(W){re=d.get(ne),re===void 0&&(re=[],d.set(ne,re));const Ie=W.textures;if(re.length!==Ie.length||re[0]!==i.COLOR_ATTACHMENT0){for(let Se=0,it=Ie.length;Se<it;Se++)re[Se]=i.COLOR_ATTACHMENT0+Se;re.length=Ie.length,de=!0}}else re[0]!==i.BACK&&(re[0]=i.BACK,de=!0);de&&i.drawBuffers(re)}function St(W){return m!==W?(i.useProgram(W),m=W,!0):!1}const ut={[js]:i.FUNC_ADD,[mE]:i.FUNC_SUBTRACT,[bE]:i.FUNC_REVERSE_SUBTRACT};ut[xE]=i.MIN,ut[EE]=i.MAX;const Je={[_E]:i.ZERO,[yE]:i.ONE,[wE]:i.SRC_COLOR,[fh]:i.SRC_ALPHA,[BE]:i.SRC_ALPHA_SATURATE,[IE]:i.DST_COLOR,[CE]:i.DST_ALPHA,[vE]:i.ONE_MINUS_SRC_COLOR,[ph]:i.ONE_MINUS_SRC_ALPHA,[ME]:i.ONE_MINUS_DST_COLOR,[SE]:i.ONE_MINUS_DST_ALPHA,[TE]:i.CONSTANT_COLOR,[RE]:i.ONE_MINUS_CONSTANT_COLOR,[NE]:i.CONSTANT_ALPHA,[FE]:i.ONE_MINUS_CONSTANT_ALPHA};function G(W,ne,re,de,Ie,Se,it,Ot,bn,yt){if(W===ms){g===!0&&(Pe(i.BLEND),g=!1);return}if(g===!1&&(xe(i.BLEND),g=!0),W!==gE){if(W!==A||yt!==C){if((p!==js||_!==js)&&(i.blendEquation(i.FUNC_ADD),p=js,_=js),yt)switch(W){case Dr:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case up:i.blendFunc(i.ONE,i.ONE);break;case dp:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case fp:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",W);break}else switch(W){case Dr:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case up:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case dp:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case fp:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",W);break}y=null,b=null,M=null,w=null,S.set(0,0,0),T=0,A=W,C=yt}return}Ie=Ie||ne,Se=Se||re,it=it||de,(ne!==p||Ie!==_)&&(i.blendEquationSeparate(ut[ne],ut[Ie]),p=ne,_=Ie),(re!==y||de!==b||Se!==M||it!==w)&&(i.blendFuncSeparate(Je[re],Je[de],Je[Se],Je[it]),y=re,b=de,M=Se,w=it),(Ot.equals(S)===!1||bn!==T)&&(i.blendColor(Ot.r,Ot.g,Ot.b,bn),S.copy(Ot),T=bn),A=W,C=!1}function mn(W,ne){W.side===Ii?Pe(i.CULL_FACE):xe(i.CULL_FACE);let re=W.side===Sn;ne&&(re=!re),dt(re),W.blending===Dr&&W.transparent===!1?G(ms):G(W.blending,W.blendEquation,W.blendSrc,W.blendDst,W.blendEquationAlpha,W.blendSrcAlpha,W.blendDstAlpha,W.blendColor,W.blendAlpha,W.premultipliedAlpha),a.setFunc(W.depthFunc),a.setTest(W.depthTest),a.setMask(W.depthWrite),r.setMask(W.colorWrite);const de=W.stencilWrite;o.setTest(de),de&&(o.setMask(W.stencilWriteMask),o.setFunc(W.stencilFunc,W.stencilRef,W.stencilFuncMask),o.setOp(W.stencilFail,W.stencilZFail,W.stencilZPass)),Rt(W.polygonOffset,W.polygonOffsetFactor,W.polygonOffsetUnits),W.alphaToCoverage===!0?xe(i.SAMPLE_ALPHA_TO_COVERAGE):Pe(i.SAMPLE_ALPHA_TO_COVERAGE)}function dt(W){v!==W&&(W?i.frontFace(i.CW):i.frontFace(i.CCW),v=W)}function pt(W){W!==fE?(xe(i.CULL_FACE),W!==F&&(W===lp?i.cullFace(i.BACK):W===pE?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):Pe(i.CULL_FACE),F=W}function ze(W){W!==K&&(O&&i.lineWidth(W),K=W)}function Rt(W,ne,re){W?(xe(i.POLYGON_OFFSET_FILL),(q!==ne||$!==re)&&(i.polygonOffset(ne,re),q=ne,$=re)):Pe(i.POLYGON_OFFSET_FILL)}function Ge(W){W?xe(i.SCISSOR_TEST):Pe(i.SCISSOR_TEST)}function L(W){W===void 0&&(W=i.TEXTURE0+D-1),J!==W&&(i.activeTexture(W),J=W)}function I(W,ne,re){re===void 0&&(J===null?re=i.TEXTURE0+D-1:re=J);let de=ee[re];de===void 0&&(de={type:void 0,texture:void 0},ee[re]=de),(de.type!==W||de.texture!==ne)&&(J!==re&&(i.activeTexture(re),J=re),i.bindTexture(W,ne||be[W]),de.type=W,de.texture=ne)}function Z(){const W=ee[J];W!==void 0&&W.type!==void 0&&(i.bindTexture(W.type,null),W.type=void 0,W.texture=void 0)}function le(){try{i.compressedTexImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ae(){try{i.compressedTexImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function oe(){try{i.texSubImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ue(){try{i.texSubImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function ve(){try{i.compressedTexSubImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ve(){try{i.compressedTexSubImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ye(){try{i.texStorage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ee(){try{i.texStorage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Ne(){try{i.texImage2D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function ke(){try{i.texImage3D(...arguments)}catch(W){console.error("THREE.WebGLState:",W)}}function Oe(W){Me.equals(W)===!1&&(i.scissor(W.x,W.y,W.z,W.w),Me.copy(W))}function Te(W){se.equals(W)===!1&&(i.viewport(W.x,W.y,W.z,W.w),se.copy(W))}function tt(W,ne){let re=l.get(ne);re===void 0&&(re=new WeakMap,l.set(ne,re));let de=re.get(W);de===void 0&&(de=i.getUniformBlockIndex(ne,W.name),re.set(W,de))}function We(W,ne){const de=l.get(ne).get(W);c.get(ne)!==de&&(i.uniformBlockBinding(ne,de,W.__bindingPointIndex),c.set(ne,de))}function nt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),a.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),h={},J=null,ee={},u={},d=new WeakMap,f=[],m=null,g=!1,A=null,p=null,y=null,b=null,_=null,M=null,w=null,S=new qe(0,0,0),T=0,C=!1,v=null,F=null,K=null,q=null,$=null,Me.set(0,0,i.canvas.width,i.canvas.height),se.set(0,0,i.canvas.width,i.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:xe,disable:Pe,bindFramebuffer:$e,drawBuffers:Qe,useProgram:St,setBlending:G,setMaterial:mn,setFlipSided:dt,setCullFace:pt,setLineWidth:ze,setPolygonOffset:Rt,setScissorTest:Ge,activeTexture:L,bindTexture:I,unbindTexture:Z,compressedTexImage2D:le,compressedTexImage3D:Ae,texImage2D:Ne,texImage3D:ke,updateUBOMapping:tt,uniformBlockBinding:We,texStorage2D:Ye,texStorage3D:Ee,texSubImage2D:oe,texSubImage3D:Ue,compressedTexSubImage2D:ve,compressedTexSubImage3D:Ve,scissor:Oe,viewport:Te,reset:nt}}function DS(i,e,t,n,s,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Ze,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(L,I){return f?new OffscreenCanvas(L,I):so("canvas")}function g(L,I,Z){let le=1;const Ae=Ge(L);if((Ae.width>Z||Ae.height>Z)&&(le=Z/Math.max(Ae.width,Ae.height)),le<1)if(typeof HTMLImageElement<"u"&&L instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&L instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&L instanceof ImageBitmap||typeof VideoFrame<"u"&&L instanceof VideoFrame){const oe=Math.floor(le*Ae.width),Ue=Math.floor(le*Ae.height);u===void 0&&(u=m(oe,Ue));const ve=I?m(oe,Ue):u;return ve.width=oe,ve.height=Ue,ve.getContext("2d").drawImage(L,0,0,oe,Ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ae.width+"x"+Ae.height+") to ("+oe+"x"+Ue+")."),ve}else return"data"in L&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ae.width+"x"+Ae.height+")."),L;return L}function A(L){return L.generateMipmaps}function p(L){i.generateMipmap(L)}function y(L){return L.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:L.isWebGL3DRenderTarget?i.TEXTURE_3D:L.isWebGLArrayRenderTarget||L.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function b(L,I,Z,le,Ae=!1){if(L!==null){if(i[L]!==void 0)return i[L];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+L+"'")}let oe=I;if(I===i.RED&&(Z===i.FLOAT&&(oe=i.R32F),Z===i.HALF_FLOAT&&(oe=i.R16F),Z===i.UNSIGNED_BYTE&&(oe=i.R8)),I===i.RED_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.R8UI),Z===i.UNSIGNED_SHORT&&(oe=i.R16UI),Z===i.UNSIGNED_INT&&(oe=i.R32UI),Z===i.BYTE&&(oe=i.R8I),Z===i.SHORT&&(oe=i.R16I),Z===i.INT&&(oe=i.R32I)),I===i.RG&&(Z===i.FLOAT&&(oe=i.RG32F),Z===i.HALF_FLOAT&&(oe=i.RG16F),Z===i.UNSIGNED_BYTE&&(oe=i.RG8)),I===i.RG_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.RG8UI),Z===i.UNSIGNED_SHORT&&(oe=i.RG16UI),Z===i.UNSIGNED_INT&&(oe=i.RG32UI),Z===i.BYTE&&(oe=i.RG8I),Z===i.SHORT&&(oe=i.RG16I),Z===i.INT&&(oe=i.RG32I)),I===i.RGB_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.RGB8UI),Z===i.UNSIGNED_SHORT&&(oe=i.RGB16UI),Z===i.UNSIGNED_INT&&(oe=i.RGB32UI),Z===i.BYTE&&(oe=i.RGB8I),Z===i.SHORT&&(oe=i.RGB16I),Z===i.INT&&(oe=i.RGB32I)),I===i.RGBA_INTEGER&&(Z===i.UNSIGNED_BYTE&&(oe=i.RGBA8UI),Z===i.UNSIGNED_SHORT&&(oe=i.RGBA16UI),Z===i.UNSIGNED_INT&&(oe=i.RGBA32UI),Z===i.BYTE&&(oe=i.RGBA8I),Z===i.SHORT&&(oe=i.RGBA16I),Z===i.INT&&(oe=i.RGBA32I)),I===i.RGB&&Z===i.UNSIGNED_INT_5_9_9_9_REV&&(oe=i.RGB9_E5),I===i.RGBA){const Ue=Ae?Ec:At.getTransfer(le);Z===i.FLOAT&&(oe=i.RGBA32F),Z===i.HALF_FLOAT&&(oe=i.RGBA16F),Z===i.UNSIGNED_BYTE&&(oe=Ue===Mt?i.SRGB8_ALPHA8:i.RGBA8),Z===i.UNSIGNED_SHORT_4_4_4_4&&(oe=i.RGBA4),Z===i.UNSIGNED_SHORT_5_5_5_1&&(oe=i.RGB5_A1)}return(oe===i.R16F||oe===i.R32F||oe===i.RG16F||oe===i.RG32F||oe===i.RGBA16F||oe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),oe}function _(L,I){let Z;return L?I===null||I===Ys||I===qa?Z=i.DEPTH24_STENCIL8:I===nn?Z=i.DEPTH32F_STENCIL8:I===Wa&&(Z=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):I===null||I===Ys||I===qa?Z=i.DEPTH_COMPONENT24:I===nn?Z=i.DEPTH_COMPONENT32F:I===Wa&&(Z=i.DEPTH_COMPONENT16),Z}function M(L,I){return A(L)===!0||L.isFramebufferTexture&&L.minFilter!==In&&L.minFilter!==zt?Math.log2(Math.max(I.width,I.height))+1:L.mipmaps!==void 0&&L.mipmaps.length>0?L.mipmaps.length:L.isCompressedTexture&&Array.isArray(L.image)?I.mipmaps.length:1}function w(L){const I=L.target;I.removeEventListener("dispose",w),T(I),I.isVideoTexture&&h.delete(I)}function S(L){const I=L.target;I.removeEventListener("dispose",S),v(I)}function T(L){const I=n.get(L);if(I.__webglInit===void 0)return;const Z=L.source,le=d.get(Z);if(le){const Ae=le[I.__cacheKey];Ae.usedTimes--,Ae.usedTimes===0&&C(L),Object.keys(le).length===0&&d.delete(Z)}n.remove(L)}function C(L){const I=n.get(L);i.deleteTexture(I.__webglTexture);const Z=L.source,le=d.get(Z);delete le[I.__cacheKey],a.memory.textures--}function v(L){const I=n.get(L);if(L.depthTexture&&(L.depthTexture.dispose(),n.remove(L.depthTexture)),L.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(I.__webglFramebuffer[le]))for(let Ae=0;Ae<I.__webglFramebuffer[le].length;Ae++)i.deleteFramebuffer(I.__webglFramebuffer[le][Ae]);else i.deleteFramebuffer(I.__webglFramebuffer[le]);I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer[le])}else{if(Array.isArray(I.__webglFramebuffer))for(let le=0;le<I.__webglFramebuffer.length;le++)i.deleteFramebuffer(I.__webglFramebuffer[le]);else i.deleteFramebuffer(I.__webglFramebuffer);if(I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer),I.__webglMultisampledFramebuffer&&i.deleteFramebuffer(I.__webglMultisampledFramebuffer),I.__webglColorRenderbuffer)for(let le=0;le<I.__webglColorRenderbuffer.length;le++)I.__webglColorRenderbuffer[le]&&i.deleteRenderbuffer(I.__webglColorRenderbuffer[le]);I.__webglDepthRenderbuffer&&i.deleteRenderbuffer(I.__webglDepthRenderbuffer)}const Z=L.textures;for(let le=0,Ae=Z.length;le<Ae;le++){const oe=n.get(Z[le]);oe.__webglTexture&&(i.deleteTexture(oe.__webglTexture),a.memory.textures--),n.remove(Z[le])}n.remove(L)}let F=0;function K(){F=0}function q(){const L=F;return L>=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+L+" texture units while this GPU supports only "+s.maxTextures),F+=1,L}function $(L){const I=[];return I.push(L.wrapS),I.push(L.wrapT),I.push(L.wrapR||0),I.push(L.magFilter),I.push(L.minFilter),I.push(L.anisotropy),I.push(L.internalFormat),I.push(L.format),I.push(L.type),I.push(L.generateMipmaps),I.push(L.premultiplyAlpha),I.push(L.flipY),I.push(L.unpackAlignment),I.push(L.colorSpace),I.join()}function D(L,I){const Z=n.get(L);if(L.isVideoTexture&&ze(L),L.isRenderTargetTexture===!1&&L.version>0&&Z.__version!==L.version){const le=L.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{se(Z,L,I);return}}t.bindTexture(i.TEXTURE_2D,Z.__webglTexture,i.TEXTURE0+I)}function O(L,I){const Z=n.get(L);if(L.version>0&&Z.__version!==L.version){se(Z,L,I);return}t.bindTexture(i.TEXTURE_2D_ARRAY,Z.__webglTexture,i.TEXTURE0+I)}function Y(L,I){const Z=n.get(L);if(L.version>0&&Z.__version!==L.version){se(Z,L,I);return}t.bindTexture(i.TEXTURE_3D,Z.__webglTexture,i.TEXTURE0+I)}function Q(L,I){const Z=n.get(L);if(L.version>0&&Z.__version!==L.version){me(Z,L,I);return}t.bindTexture(i.TEXTURE_CUBE_MAP,Z.__webglTexture,i.TEXTURE0+I)}const J={[kr]:i.REPEAT,[oi]:i.CLAMP_TO_EDGE,[lc]:i.MIRRORED_REPEAT},ee={[In]:i.NEAREST,[bp]:i.NEAREST_MIPMAP_NEAREST,[Va]:i.NEAREST_MIPMAP_LINEAR,[zt]:i.LINEAR,[hc]:i.LINEAR_MIPMAP_NEAREST,[Jn]:i.LINEAR_MIPMAP_LINEAR},ae={[jE]:i.NEVER,[e_]:i.ALWAYS,[XE]:i.LESS,[Tp]:i.LEQUAL,[YE]:i.EQUAL,[$E]:i.GEQUAL,[JE]:i.GREATER,[ZE]:i.NOTEQUAL};function ye(L,I){if(I.type===nn&&e.has("OES_texture_float_linear")===!1&&(I.magFilter===zt||I.magFilter===hc||I.magFilter===Va||I.magFilter===Jn||I.minFilter===zt||I.minFilter===hc||I.minFilter===Va||I.minFilter===Jn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(L,i.TEXTURE_WRAP_S,J[I.wrapS]),i.texParameteri(L,i.TEXTURE_WRAP_T,J[I.wrapT]),(L===i.TEXTURE_3D||L===i.TEXTURE_2D_ARRAY)&&i.texParameteri(L,i.TEXTURE_WRAP_R,J[I.wrapR]),i.texParameteri(L,i.TEXTURE_MAG_FILTER,ee[I.magFilter]),i.texParameteri(L,i.TEXTURE_MIN_FILTER,ee[I.minFilter]),I.compareFunction&&(i.texParameteri(L,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(L,i.TEXTURE_COMPARE_FUNC,ae[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(I.magFilter===In||I.minFilter!==Va&&I.minFilter!==Jn||I.type===nn&&e.has("OES_texture_float_linear")===!1)return;if(I.anisotropy>1||n.get(I).__currentAnisotropy){const Z=e.get("EXT_texture_filter_anisotropic");i.texParameterf(L,Z.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,s.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy}}}function Me(L,I){let Z=!1;L.__webglInit===void 0&&(L.__webglInit=!0,I.addEventListener("dispose",w));const le=I.source;let Ae=d.get(le);Ae===void 0&&(Ae={},d.set(le,Ae));const oe=$(I);if(oe!==L.__cacheKey){Ae[oe]===void 0&&(Ae[oe]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,Z=!0),Ae[oe].usedTimes++;const Ue=Ae[L.__cacheKey];Ue!==void 0&&(Ae[L.__cacheKey].usedTimes--,Ue.usedTimes===0&&C(I)),L.__cacheKey=oe,L.__webglTexture=Ae[oe].texture}return Z}function se(L,I,Z){let le=i.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(le=i.TEXTURE_2D_ARRAY),I.isData3DTexture&&(le=i.TEXTURE_3D);const Ae=Me(L,I),oe=I.source;t.bindTexture(le,L.__webglTexture,i.TEXTURE0+Z);const Ue=n.get(oe);if(oe.version!==Ue.__version||Ae===!0){t.activeTexture(i.TEXTURE0+Z);const ve=At.getPrimaries(At.workingColorSpace),Ve=I.colorSpace===ci?null:At.getPrimaries(I.colorSpace),Ye=I.colorSpace===ci||ve===Ve?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ye);let Ee=g(I.image,!1,s.maxTextureSize);Ee=Rt(I,Ee);const Ne=r.convert(I.format,I.colorSpace),ke=r.convert(I.type);let Oe=b(I.internalFormat,Ne,ke,I.colorSpace,I.isVideoTexture);ye(le,I);let Te;const tt=I.mipmaps,We=I.isVideoTexture!==!0,nt=Ue.__version===void 0||Ae===!0,W=oe.dataReady,ne=M(I,Ee);if(I.isDepthTexture)Oe=_(I.format===ja,I.type),nt&&(We?t.texStorage2D(i.TEXTURE_2D,1,Oe,Ee.width,Ee.height):t.texImage2D(i.TEXTURE_2D,0,Oe,Ee.width,Ee.height,0,Ne,ke,null));else if(I.isDataTexture)if(tt.length>0){We&&nt&&t.texStorage2D(i.TEXTURE_2D,ne,Oe,tt[0].width,tt[0].height);for(let re=0,de=tt.length;re<de;re++)Te=tt[re],We?W&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Te.width,Te.height,Ne,ke,Te.data):t.texImage2D(i.TEXTURE_2D,re,Oe,Te.width,Te.height,0,Ne,ke,Te.data);I.generateMipmaps=!1}else We?(nt&&t.texStorage2D(i.TEXTURE_2D,ne,Oe,Ee.width,Ee.height),W&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Ee.width,Ee.height,Ne,ke,Ee.data)):t.texImage2D(i.TEXTURE_2D,0,Oe,Ee.width,Ee.height,0,Ne,ke,Ee.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){We&&nt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ne,Oe,tt[0].width,tt[0].height,Ee.depth);for(let re=0,de=tt.length;re<de;re++)if(Te=tt[re],I.format!==sn)if(Ne!==null)if(We){if(W)if(I.layerUpdates.size>0){const Ie=OA(Te.width,Te.height,I.format,I.type);for(const Se of I.layerUpdates){const it=Te.data.subarray(Se*Ie/Te.data.BYTES_PER_ELEMENT,(Se+1)*Ie/Te.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,Se,Te.width,Te.height,1,Ne,it)}I.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,0,Te.width,Te.height,Ee.depth,Ne,Te.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,re,Oe,Te.width,Te.height,Ee.depth,0,Te.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else We?W&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,0,Te.width,Te.height,Ee.depth,Ne,ke,Te.data):t.texImage3D(i.TEXTURE_2D_ARRAY,re,Oe,Te.width,Te.height,Ee.depth,0,Ne,ke,Te.data)}else{We&&nt&&t.texStorage2D(i.TEXTURE_2D,ne,Oe,tt[0].width,tt[0].height);for(let re=0,de=tt.length;re<de;re++)Te=tt[re],I.format!==sn?Ne!==null?We?W&&t.compressedTexSubImage2D(i.TEXTURE_2D,re,0,0,Te.width,Te.height,Ne,Te.data):t.compressedTexImage2D(i.TEXTURE_2D,re,Oe,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):We?W&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Te.width,Te.height,Ne,ke,Te.data):t.texImage2D(i.TEXTURE_2D,re,Oe,Te.width,Te.height,0,Ne,ke,Te.data)}else if(I.isDataArrayTexture)if(We){if(nt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ne,Oe,Ee.width,Ee.height,Ee.depth),W)if(I.layerUpdates.size>0){const re=OA(Ee.width,Ee.height,I.format,I.type);for(const de of I.layerUpdates){const Ie=Ee.data.subarray(de*re/Ee.data.BYTES_PER_ELEMENT,(de+1)*re/Ee.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,de,Ee.width,Ee.height,1,Ne,ke,Ie)}I.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Ne,ke,Ee.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Oe,Ee.width,Ee.height,Ee.depth,0,Ne,ke,Ee.data);else if(I.isData3DTexture)We?(nt&&t.texStorage3D(i.TEXTURE_3D,ne,Oe,Ee.width,Ee.height,Ee.depth),W&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Ne,ke,Ee.data)):t.texImage3D(i.TEXTURE_3D,0,Oe,Ee.width,Ee.height,Ee.depth,0,Ne,ke,Ee.data);else if(I.isFramebufferTexture){if(nt)if(We)t.texStorage2D(i.TEXTURE_2D,ne,Oe,Ee.width,Ee.height);else{let re=Ee.width,de=Ee.height;for(let Ie=0;Ie<ne;Ie++)t.texImage2D(i.TEXTURE_2D,Ie,Oe,re,de,0,Ne,ke,null),re>>=1,de>>=1}}else if(tt.length>0){if(We&&nt){const re=Ge(tt[0]);t.texStorage2D(i.TEXTURE_2D,ne,Oe,re.width,re.height)}for(let re=0,de=tt.length;re<de;re++)Te=tt[re],We?W&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Ne,ke,Te):t.texImage2D(i.TEXTURE_2D,re,Oe,Ne,ke,Te);I.generateMipmaps=!1}else if(We){if(nt){const re=Ge(Ee);t.texStorage2D(i.TEXTURE_2D,ne,Oe,re.width,re.height)}W&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Ne,ke,Ee)}else t.texImage2D(i.TEXTURE_2D,0,Oe,Ne,ke,Ee);A(I)&&p(le),Ue.__version=oe.version,I.onUpdate&&I.onUpdate(I)}L.__version=I.version}function me(L,I,Z){if(I.image.length!==6)return;const le=Me(L,I),Ae=I.source;t.bindTexture(i.TEXTURE_CUBE_MAP,L.__webglTexture,i.TEXTURE0+Z);const oe=n.get(Ae);if(Ae.version!==oe.__version||le===!0){t.activeTexture(i.TEXTURE0+Z);const Ue=At.getPrimaries(At.workingColorSpace),ve=I.colorSpace===ci?null:At.getPrimaries(I.colorSpace),Ve=I.colorSpace===ci||Ue===ve?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);const Ye=I.isCompressedTexture||I.image[0].isCompressedTexture,Ee=I.image[0]&&I.image[0].isDataTexture,Ne=[];for(let de=0;de<6;de++)!Ye&&!Ee?Ne[de]=g(I.image[de],!0,s.maxCubemapSize):Ne[de]=Ee?I.image[de].image:I.image[de],Ne[de]=Rt(I,Ne[de]);const ke=Ne[0],Oe=r.convert(I.format,I.colorSpace),Te=r.convert(I.type),tt=b(I.internalFormat,Oe,Te,I.colorSpace),We=I.isVideoTexture!==!0,nt=oe.__version===void 0||le===!0,W=Ae.dataReady;let ne=M(I,ke);ye(i.TEXTURE_CUBE_MAP,I);let re;if(Ye){We&&nt&&t.texStorage2D(i.TEXTURE_CUBE_MAP,ne,tt,ke.width,ke.height);for(let de=0;de<6;de++){re=Ne[de].mipmaps;for(let Ie=0;Ie<re.length;Ie++){const Se=re[Ie];I.format!==sn?Oe!==null?We?W&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,0,0,Se.width,Se.height,Oe,Se.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,tt,Se.width,Se.height,0,Se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,0,0,Se.width,Se.height,Oe,Te,Se.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie,tt,Se.width,Se.height,0,Oe,Te,Se.data)}}}else{if(re=I.mipmaps,We&&nt){re.length>0&&ne++;const de=Ge(Ne[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,ne,tt,de.width,de.height)}for(let de=0;de<6;de++)if(Ee){We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Ne[de].width,Ne[de].height,Oe,Te,Ne[de].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,tt,Ne[de].width,Ne[de].height,0,Oe,Te,Ne[de].data);for(let Ie=0;Ie<re.length;Ie++){const it=re[Ie].image[de].image;We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,0,0,it.width,it.height,Oe,Te,it.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,tt,it.width,it.height,0,Oe,Te,it.data)}}else{We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,0,0,Oe,Te,Ne[de]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,tt,Oe,Te,Ne[de]);for(let Ie=0;Ie<re.length;Ie++){const Se=re[Ie];We?W&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,0,0,Oe,Te,Se.image[de]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+de,Ie+1,tt,Oe,Te,Se.image[de])}}}A(I)&&p(i.TEXTURE_CUBE_MAP),oe.__version=Ae.version,I.onUpdate&&I.onUpdate(I)}L.__version=I.version}function be(L,I,Z,le,Ae,oe){const Ue=r.convert(Z.format,Z.colorSpace),ve=r.convert(Z.type),Ve=b(Z.internalFormat,Ue,ve,Z.colorSpace),Ye=n.get(I),Ee=n.get(Z);if(Ee.__renderTarget=I,!Ye.__hasExternalTextures){const Ne=Math.max(1,I.width>>oe),ke=Math.max(1,I.height>>oe);Ae===i.TEXTURE_3D||Ae===i.TEXTURE_2D_ARRAY?t.texImage3D(Ae,oe,Ve,Ne,ke,I.depth,0,Ue,ve,null):t.texImage2D(Ae,oe,Ve,Ne,ke,0,Ue,ve,null)}t.bindFramebuffer(i.FRAMEBUFFER,L),pt(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,le,Ae,Ee.__webglTexture,0,dt(I)):(Ae===i.TEXTURE_2D||Ae>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&Ae<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,le,Ae,Ee.__webglTexture,oe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function xe(L,I,Z){if(i.bindRenderbuffer(i.RENDERBUFFER,L),I.depthBuffer){const le=I.depthTexture,Ae=le&&le.isDepthTexture?le.type:null,oe=_(I.stencilBuffer,Ae),Ue=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ve=dt(I);pt(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ve,oe,I.width,I.height):Z?i.renderbufferStorageMultisample(i.RENDERBUFFER,ve,oe,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,oe,I.width,I.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ue,i.RENDERBUFFER,L)}else{const le=I.textures;for(let Ae=0;Ae<le.length;Ae++){const oe=le[Ae],Ue=r.convert(oe.format,oe.colorSpace),ve=r.convert(oe.type),Ve=b(oe.internalFormat,Ue,ve,oe.colorSpace),Ye=dt(I);Z&&pt(I)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,Ye,Ve,I.width,I.height):pt(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Ye,Ve,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,Ve,I.width,I.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Pe(L,I){if(I&&I.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,L),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const le=n.get(I.depthTexture);le.__renderTarget=I,(!le.__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),D(I.depthTexture,0);const Ae=le.__webglTexture,oe=dt(I);if(I.depthTexture.format===Ka)pt(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ae,0,oe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ae,0);else if(I.depthTexture.format===ja)pt(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ae,0,oe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ae,0);else throw new Error("Unknown depthTexture format")}function $e(L){const I=n.get(L),Z=L.isWebGLCubeRenderTarget===!0;if(I.__boundDepthTexture!==L.depthTexture){const le=L.depthTexture;if(I.__depthDisposeCallback&&I.__depthDisposeCallback(),le){const Ae=()=>{delete I.__boundDepthTexture,delete I.__depthDisposeCallback,le.removeEventListener("dispose",Ae)};le.addEventListener("dispose",Ae),I.__depthDisposeCallback=Ae}I.__boundDepthTexture=le}if(L.depthTexture&&!I.__autoAllocateDepthBuffer){if(Z)throw new Error("target.depthTexture not supported in Cube render targets");const le=L.texture.mipmaps;le&&le.length>0?Pe(I.__webglFramebuffer[0],L):Pe(I.__webglFramebuffer,L)}else if(Z){I.__webglDepthbuffer=[];for(let le=0;le<6;le++)if(t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[le]),I.__webglDepthbuffer[le]===void 0)I.__webglDepthbuffer[le]=i.createRenderbuffer(),xe(I.__webglDepthbuffer[le],L,!1);else{const Ae=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,oe=I.__webglDepthbuffer[le];i.bindRenderbuffer(i.RENDERBUFFER,oe),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ae,i.RENDERBUFFER,oe)}}else{const le=L.texture.mipmaps;if(le&&le.length>0?t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer),I.__webglDepthbuffer===void 0)I.__webglDepthbuffer=i.createRenderbuffer(),xe(I.__webglDepthbuffer,L,!1);else{const Ae=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,oe=I.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,oe),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ae,i.RENDERBUFFER,oe)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Qe(L,I,Z){const le=n.get(L);I!==void 0&&be(le.__webglFramebuffer,L,L.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),Z!==void 0&&$e(L)}function St(L){const I=L.texture,Z=n.get(L),le=n.get(I);L.addEventListener("dispose",S);const Ae=L.textures,oe=L.isWebGLCubeRenderTarget===!0,Ue=Ae.length>1;if(Ue||(le.__webglTexture===void 0&&(le.__webglTexture=i.createTexture()),le.__version=I.version,a.memory.textures++),oe){Z.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)if(I.mipmaps&&I.mipmaps.length>0){Z.__webglFramebuffer[ve]=[];for(let Ve=0;Ve<I.mipmaps.length;Ve++)Z.__webglFramebuffer[ve][Ve]=i.createFramebuffer()}else Z.__webglFramebuffer[ve]=i.createFramebuffer()}else{if(I.mipmaps&&I.mipmaps.length>0){Z.__webglFramebuffer=[];for(let ve=0;ve<I.mipmaps.length;ve++)Z.__webglFramebuffer[ve]=i.createFramebuffer()}else Z.__webglFramebuffer=i.createFramebuffer();if(Ue)for(let ve=0,Ve=Ae.length;ve<Ve;ve++){const Ye=n.get(Ae[ve]);Ye.__webglTexture===void 0&&(Ye.__webglTexture=i.createTexture(),a.memory.textures++)}if(L.samples>0&&pt(L)===!1){Z.__webglMultisampledFramebuffer=i.createFramebuffer(),Z.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,Z.__webglMultisampledFramebuffer);for(let ve=0;ve<Ae.length;ve++){const Ve=Ae[ve];Z.__webglColorRenderbuffer[ve]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,Z.__webglColorRenderbuffer[ve]);const Ye=r.convert(Ve.format,Ve.colorSpace),Ee=r.convert(Ve.type),Ne=b(Ve.internalFormat,Ye,Ee,Ve.colorSpace,L.isXRRenderTarget===!0),ke=dt(L);i.renderbufferStorageMultisample(i.RENDERBUFFER,ke,Ne,L.width,L.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ve,i.RENDERBUFFER,Z.__webglColorRenderbuffer[ve])}i.bindRenderbuffer(i.RENDERBUFFER,null),L.depthBuffer&&(Z.__webglDepthRenderbuffer=i.createRenderbuffer(),xe(Z.__webglDepthRenderbuffer,L,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(oe){t.bindTexture(i.TEXTURE_CUBE_MAP,le.__webglTexture),ye(i.TEXTURE_CUBE_MAP,I);for(let ve=0;ve<6;ve++)if(I.mipmaps&&I.mipmaps.length>0)for(let Ve=0;Ve<I.mipmaps.length;Ve++)be(Z.__webglFramebuffer[ve][Ve],L,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ve,Ve);else be(Z.__webglFramebuffer[ve],L,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0);A(I)&&p(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ue){for(let ve=0,Ve=Ae.length;ve<Ve;ve++){const Ye=Ae[ve],Ee=n.get(Ye);t.bindTexture(i.TEXTURE_2D,Ee.__webglTexture),ye(i.TEXTURE_2D,Ye),be(Z.__webglFramebuffer,L,Ye,i.COLOR_ATTACHMENT0+ve,i.TEXTURE_2D,0),A(Ye)&&p(i.TEXTURE_2D)}t.unbindTexture()}else{let ve=i.TEXTURE_2D;if((L.isWebGL3DRenderTarget||L.isWebGLArrayRenderTarget)&&(ve=L.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(ve,le.__webglTexture),ye(ve,I),I.mipmaps&&I.mipmaps.length>0)for(let Ve=0;Ve<I.mipmaps.length;Ve++)be(Z.__webglFramebuffer[Ve],L,I,i.COLOR_ATTACHMENT0,ve,Ve);else be(Z.__webglFramebuffer,L,I,i.COLOR_ATTACHMENT0,ve,0);A(I)&&p(ve),t.unbindTexture()}L.depthBuffer&&$e(L)}function ut(L){const I=L.textures;for(let Z=0,le=I.length;Z<le;Z++){const Ae=I[Z];if(A(Ae)){const oe=y(L),Ue=n.get(Ae).__webglTexture;t.bindTexture(oe,Ue),p(oe),t.unbindTexture()}}}const Je=[],G=[];function mn(L){if(L.samples>0){if(pt(L)===!1){const I=L.textures,Z=L.width,le=L.height;let Ae=i.COLOR_BUFFER_BIT;const oe=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ue=n.get(L),ve=I.length>1;if(ve)for(let Ye=0;Ye<I.length;Ye++)t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ye,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ye,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Ue.__webglMultisampledFramebuffer);const Ve=L.texture.mipmaps;Ve&&Ve.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ue.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ue.__webglFramebuffer);for(let Ye=0;Ye<I.length;Ye++){if(L.resolveDepthBuffer&&(L.depthBuffer&&(Ae|=i.DEPTH_BUFFER_BIT),L.stencilBuffer&&L.resolveStencilBuffer&&(Ae|=i.STENCIL_BUFFER_BIT)),ve){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Ue.__webglColorRenderbuffer[Ye]);const Ee=n.get(I[Ye]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Ee,0)}i.blitFramebuffer(0,0,Z,le,0,0,Z,le,Ae,i.NEAREST),c===!0&&(Je.length=0,G.length=0,Je.push(i.COLOR_ATTACHMENT0+Ye),L.depthBuffer&&L.resolveDepthBuffer===!1&&(Je.push(oe),G.push(oe),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,G)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Je))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),ve)for(let Ye=0;Ye<I.length;Ye++){t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ye,i.RENDERBUFFER,Ue.__webglColorRenderbuffer[Ye]);const Ee=n.get(I[Ye]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Ue.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ye,i.TEXTURE_2D,Ee,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ue.__webglMultisampledFramebuffer)}else if(L.depthBuffer&&L.resolveDepthBuffer===!1&&c){const I=L.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[I])}}}function dt(L){return Math.min(s.maxSamples,L.samples)}function pt(L){const I=n.get(L);return L.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ze(L){const I=a.render.frame;h.get(L)!==I&&(h.set(L,I),L.update())}function Rt(L,I){const Z=L.colorSpace,le=L.format,Ae=L.type;return L.isCompressedTexture===!0||L.isVideoTexture===!0||Z!==rn&&Z!==ci&&(At.getTransfer(Z)===Mt?(le!==sn||Ae!==tn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Z)),I}function Ge(L){return typeof HTMLImageElement<"u"&&L instanceof HTMLImageElement?(l.width=L.naturalWidth||L.width,l.height=L.naturalHeight||L.height):typeof VideoFrame<"u"&&L instanceof VideoFrame?(l.width=L.displayWidth,l.height=L.displayHeight):(l.width=L.width,l.height=L.height),l}this.allocateTextureUnit=q,this.resetTextureUnits=K,this.setTexture2D=D,this.setTexture2DArray=O,this.setTexture3D=Y,this.setTextureCube=Q,this.rebindTextures=Qe,this.setupRenderTarget=St,this.updateRenderTargetMipmap=ut,this.updateMultisampleRenderTarget=mn,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=be,this.useMultisampledRTT=pt}function LS(i,e){function t(n,s=ci){let r;const a=At.getTransfer(s);if(n===tn)return i.UNSIGNED_BYTE;if(n===Sh)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Ih)return i.UNSIGNED_SHORT_5_5_5_1;if(n===_p)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===xp)return i.BYTE;if(n===Ep)return i.SHORT;if(n===Wa)return i.UNSIGNED_SHORT;if(n===Ch)return i.INT;if(n===Ys)return i.UNSIGNED_INT;if(n===nn)return i.FLOAT;if(n===Mn)return i.HALF_FLOAT;if(n===yp)return i.ALPHA;if(n===wp)return i.RGB;if(n===sn)return i.RGBA;if(n===Ka)return i.DEPTH_COMPONENT;if(n===ja)return i.DEPTH_STENCIL;if(n===Hi)return i.RED;if(n===Mh)return i.RED_INTEGER;if(n===Js)return i.RG;if(n===Bh)return i.RG_INTEGER;if(n===Th)return i.RGBA_INTEGER;if(n===uc||n===Xa||n===dc||n===Ya)if(a===Mt)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===uc)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Xa)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===dc)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ya)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===uc)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Xa)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===dc)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ya)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===fc||n===Rh||n===pc||n===Nh)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===fc)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Rh)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===pc)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Nh)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ac||n===gc||n===mc)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Ac||n===gc)return a===Mt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===mc)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Ja||n===Fh||n===Dh||n===Lh||n===Za||n===Ph||n===kh||n===Uh||n===Oh||n===Qh||n===Gh||n===Hh||n===zh||n===Vh)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Ja)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Fh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Dh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Lh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Za)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Ph)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===kh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Uh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Oh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Qh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Gh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Hh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===zh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Vh)return a===Mt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===$a||n===Wh||n===bc)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===$a)return a===Mt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Wh)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===bc)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===vp||n===qh||n===Kh||n===jh)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===$a)return r.COMPRESSED_RED_RGTC1_EXT;if(n===qh)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Kh)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===jh)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===qa?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const PS=`void main() {gl_Position = vec4( position, 1.0 );-}`,BS=`+}`,kS=`uniform sampler2DArray depthColor;uniform float depthWidth;uniform float depthHeight;@@ -3816,7 +3816,7 @@ void main() {}-}`;class TS{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const s=new an,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new vs({vertexShader:MS,fragmentShader:BS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Jt(new qc(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class RS extends bs{constructor(e,t){super();const n=this;let s=null,r=1,a=null,o="local-floor",c=1,l=null,h=null,u=null,d=null,f=null,m=null;const g=new TS,A=t.getContextAttributes();let p=null,y=null;const b=[],_=[],M=new Ze;let w=null;const S=new vn;S.viewport=new _t;const T=new vn;T.viewport=new _t;const v=[S,T],C=new my;let F=null,K=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let me=b[se];return me===void 0&&(me=new pu,b[se]=me),me.getTargetRaySpace()},this.getControllerGrip=function(se){let me=b[se];return me===void 0&&(me=new pu,b[se]=me),me.getGripSpace()},this.getHand=function(se){let me=b[se];return me===void 0&&(me=new pu,b[se]=me),me.getHandSpace()};function q(se){const me=_.indexOf(se.inputSource);if(me===-1)return;const be=b[me];be!==void 0&&(be.update(se.inputSource,se.frame,l||a),be.dispatchEvent({type:se.type,data:se.inputSource}))}function $(){s.removeEventListener("select",q),s.removeEventListener("selectstart",q),s.removeEventListener("selectend",q),s.removeEventListener("squeeze",q),s.removeEventListener("squeezestart",q),s.removeEventListener("squeezeend",q),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",D);for(let se=0;se<b.length;se++){const me=_[se];me!==null&&(_[se]=null,b[se].disconnect(me))}F=null,K=null,g.reset(),e.setRenderTarget(p),f=null,d=null,u=null,s=null,y=null,Me.stop(),n.isPresenting=!1,e.setPixelRatio(w),e.setSize(M.width,M.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(se){r=se,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(se){o=se,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(se){l=se},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return s},this.setSession=async function(se){if(s=se,s!==null){if(p=e.getRenderTarget(),s.addEventListener("select",q),s.addEventListener("selectstart",q),s.addEventListener("selectend",q),s.addEventListener("squeeze",q),s.addEventListener("squeezestart",q),s.addEventListener("squeezeend",q),s.addEventListener("end",$),s.addEventListener("inputsourceschange",D),A.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(M),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let be=null,xe=null,Pe=null;A.depth&&(Pe=A.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,be=A.stencil?Va:za,xe=A.stencil?Ha:Xs);const $e={colorFormat:t.RGBA8,depthFormat:Pe,scaleFactor:r};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer($e),s.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new js(d.textureWidth,d.textureHeight,{format:sn,type:tn,depthTexture:new bA(d.textureWidth,d.textureHeight,xe,void 0,void 0,void 0,void 0,void 0,void 0,be),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const be={antialias:A.antialias,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(s,t,be),s.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new js(f.framebufferWidth,f.framebufferHeight,{format:sn,type:tn,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(c),l=null,a=await s.requestReferenceSpace(o),Me.setContext(s),Me.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function D(se){for(let me=0;me<se.removed.length;me++){const be=se.removed[me],xe=_.indexOf(be);xe>=0&&(_[xe]=null,b[xe].disconnect(be))}for(let me=0;me<se.added.length;me++){const be=se.added[me];let xe=_.indexOf(be);if(xe===-1){for(let $e=0;$e<b.length;$e++)if($e>=_.length){_.push(be),xe=$e;break}else if(_[$e]===null){_[$e]=be,xe=$e;break}if(xe===-1)break}const Pe=b[xe];Pe&&Pe.connect(be)}}const O=new H,j=new H;function Q(se,me,be){O.setFromMatrixPosition(me.matrixWorld),j.setFromMatrixPosition(be.matrixWorld);const xe=O.distanceTo(j),Pe=me.projectionMatrix.elements,$e=be.projectionMatrix.elements,Qe=Pe[14]/(Pe[10]-1),St=Pe[14]/(Pe[10]+1),ut=(Pe[9]+1)/Pe[5],Je=(Pe[9]-1)/Pe[5],G=(Pe[8]-1)/Pe[0],mn=($e[8]+1)/$e[0],dt=Qe*G,pt=Qe*mn,ze=xe/(-G+mn),Rt=ze*-G;if(me.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(Rt),se.translateZ(ze),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),Pe[10]===-1)se.projectionMatrix.copy(me.projectionMatrix),se.projectionMatrixInverse.copy(me.projectionMatrixInverse);else{const Ge=Qe+ze,L=St+ze,I=dt-Rt,Z=pt+(xe-Rt),le=ut*St/L*Ge,Ae=Je*St/L*Ge;se.projectionMatrix.makePerspective(I,Z,le,Ae,Ge,L),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function J(se,me){me===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(me.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(s===null)return;let me=se.near,be=se.far;g.texture!==null&&(g.depthNear>0&&(me=g.depthNear),g.depthFar>0&&(be=g.depthFar)),C.near=T.near=S.near=me,C.far=T.far=S.far=be,(F!==C.near||K!==C.far)&&(s.updateRenderState({depthNear:C.near,depthFar:C.far}),F=C.near,K=C.far),S.layers.mask=se.layers.mask|2,T.layers.mask=se.layers.mask|4,C.layers.mask=S.layers.mask|T.layers.mask;const xe=se.parent,Pe=C.cameras;J(C,xe);for(let $e=0;$e<Pe.length;$e++)J(Pe[$e],xe);Pe.length===2?Q(C,S,T):C.projectionMatrix.copy(S.projectionMatrix),ee(se,C,xe)};function ee(se,me,be){be===null?se.matrix.copy(me.matrixWorld):(se.matrix.copy(be.matrixWorld),se.matrix.invert(),se.matrix.multiply(me.matrixWorld)),se.matrix.decompose(se.position,se.quaternion,se.scale),se.updateMatrixWorld(!0),se.projectionMatrix.copy(me.projectionMatrix),se.projectionMatrixInverse.copy(me.projectionMatrixInverse),se.isPerspectiveCamera&&(se.fov=Or*2*Math.atan(1/se.projectionMatrix.elements[5]),se.zoom=1)}this.getCamera=function(){return C},this.getFoveation=function(){if(!(d===null&&f===null))return c},this.setFoveation=function(se){c=se,d!==null&&(d.fixedFoveation=se),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=se)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(C)};let ae=null;function ye(se,me){if(h=me.getViewerPose(l||a),m=me,h!==null){const be=h.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let xe=!1;be.length!==C.cameras.length&&(C.cameras.length=0,xe=!0);for(let Qe=0;Qe<be.length;Qe++){const St=be[Qe];let ut=null;if(f!==null)ut=f.getViewport(St);else{const G=u.getViewSubImage(d,St);ut=G.viewport,Qe===0&&(e.setRenderTargetTextures(y,G.colorTexture,G.depthStencilTexture),e.setRenderTarget(y))}let Je=v[Qe];Je===void 0&&(Je=new vn,Je.layers.enable(Qe),Je.viewport=new _t,v[Qe]=Je),Je.matrix.fromArray(St.transform.matrix),Je.matrix.decompose(Je.position,Je.quaternion,Je.scale),Je.projectionMatrix.fromArray(St.projectionMatrix),Je.projectionMatrixInverse.copy(Je.projectionMatrix).invert(),Je.viewport.set(ut.x,ut.y,ut.width,ut.height),Qe===0&&(C.matrix.copy(Je.matrix),C.matrix.decompose(C.position,C.quaternion,C.scale)),xe===!0&&C.cameras.push(Je)}const Pe=s.enabledFeatures;if(Pe&&Pe.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&u){const Qe=u.getDepthInformation(be[0]);Qe&&Qe.isValid&&Qe.texture&&g.init(e,Qe,s.renderState)}}for(let be=0;be<b.length;be++){const xe=_[be],Pe=b[be];xe!==null&&Pe!==void 0&&Pe.update(xe,me,l||a)}ae&&ae(se,me),me.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:me}),m=null}const Me=new DA;Me.setAnimationLoop(ye),this.setAnimationLoop=function(se){ae=se},this.dispose=function(){}}}const rr=new Bi,NS=new et;function FS(i,e){function t(A,p){A.matrixAutoUpdate===!0&&A.updateMatrix(),p.value.copy(A.matrix)}function n(A,p){p.color.getRGB(A.fogColor.value,Jp(i)),p.isFog?(A.fogNear.value=p.near,A.fogFar.value=p.far):p.isFogExp2&&(A.fogDensity.value=p.density)}function s(A,p,y,b,_){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(A,p):p.isMeshToonMaterial?(r(A,p),u(A,p)):p.isMeshPhongMaterial?(r(A,p),h(A,p)):p.isMeshStandardMaterial?(r(A,p),d(A,p),p.isMeshPhysicalMaterial&&f(A,p,_)):p.isMeshMatcapMaterial?(r(A,p),m(A,p)):p.isMeshDepthMaterial?r(A,p):p.isMeshDistanceMaterial?(r(A,p),g(A,p)):p.isMeshNormalMaterial?r(A,p):p.isLineBasicMaterial?(a(A,p),p.isLineDashedMaterial&&o(A,p)):p.isPointsMaterial?c(A,p,y,b):p.isSpriteMaterial?l(A,p):p.isShadowMaterial?(A.color.value.copy(p.color),A.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(A,p){A.opacity.value=p.opacity,p.color&&A.diffuse.value.copy(p.color),p.emissive&&A.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(A.map.value=p.map,t(p.map,A.mapTransform)),p.alphaMap&&(A.alphaMap.value=p.alphaMap,t(p.alphaMap,A.alphaMapTransform)),p.bumpMap&&(A.bumpMap.value=p.bumpMap,t(p.bumpMap,A.bumpMapTransform),A.bumpScale.value=p.bumpScale,p.side===Sn&&(A.bumpScale.value*=-1)),p.normalMap&&(A.normalMap.value=p.normalMap,t(p.normalMap,A.normalMapTransform),A.normalScale.value.copy(p.normalScale),p.side===Sn&&A.normalScale.value.negate()),p.displacementMap&&(A.displacementMap.value=p.displacementMap,t(p.displacementMap,A.displacementMapTransform),A.displacementScale.value=p.displacementScale,A.displacementBias.value=p.displacementBias),p.emissiveMap&&(A.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,A.emissiveMapTransform)),p.specularMap&&(A.specularMap.value=p.specularMap,t(p.specularMap,A.specularMapTransform)),p.alphaTest>0&&(A.alphaTest.value=p.alphaTest);const y=e.get(p),b=y.envMap,_=y.envMapRotation;b&&(A.envMap.value=b,rr.copy(_),rr.x*=-1,rr.y*=-1,rr.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(rr.y*=-1,rr.z*=-1),A.envMapRotation.value.setFromMatrix4(NS.makeRotationFromEuler(rr)),A.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,A.reflectivity.value=p.reflectivity,A.ior.value=p.ior,A.refractionRatio.value=p.refractionRatio),p.lightMap&&(A.lightMap.value=p.lightMap,A.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,A.lightMapTransform)),p.aoMap&&(A.aoMap.value=p.aoMap,A.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,A.aoMapTransform))}function a(A,p){A.diffuse.value.copy(p.color),A.opacity.value=p.opacity,p.map&&(A.map.value=p.map,t(p.map,A.mapTransform))}function o(A,p){A.dashSize.value=p.dashSize,A.totalSize.value=p.dashSize+p.gapSize,A.scale.value=p.scale}function c(A,p,y,b){A.diffuse.value.copy(p.color),A.opacity.value=p.opacity,A.size.value=p.size*y,A.scale.value=b*.5,p.map&&(A.map.value=p.map,t(p.map,A.uvTransform)),p.alphaMap&&(A.alphaMap.value=p.alphaMap,t(p.alphaMap,A.alphaMapTransform)),p.alphaTest>0&&(A.alphaTest.value=p.alphaTest)}function l(A,p){A.diffuse.value.copy(p.color),A.opacity.value=p.opacity,A.rotation.value=p.rotation,p.map&&(A.map.value=p.map,t(p.map,A.mapTransform)),p.alphaMap&&(A.alphaMap.value=p.alphaMap,t(p.alphaMap,A.alphaMapTransform)),p.alphaTest>0&&(A.alphaTest.value=p.alphaTest)}function h(A,p){A.specular.value.copy(p.specular),A.shininess.value=Math.max(p.shininess,1e-4)}function u(A,p){p.gradientMap&&(A.gradientMap.value=p.gradientMap)}function d(A,p){A.metalness.value=p.metalness,p.metalnessMap&&(A.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,A.metalnessMapTransform)),A.roughness.value=p.roughness,p.roughnessMap&&(A.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,A.roughnessMapTransform)),p.envMap&&(A.envMapIntensity.value=p.envMapIntensity)}function f(A,p,y){A.ior.value=p.ior,p.sheen>0&&(A.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),A.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(A.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,A.sheenColorMapTransform)),p.sheenRoughnessMap&&(A.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,A.sheenRoughnessMapTransform))),p.clearcoat>0&&(A.clearcoat.value=p.clearcoat,A.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(A.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,A.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(A.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,A.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(A.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,A.clearcoatNormalMapTransform),A.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Sn&&A.clearcoatNormalScale.value.negate())),p.dispersion>0&&(A.dispersion.value=p.dispersion),p.iridescence>0&&(A.iridescence.value=p.iridescence,A.iridescenceIOR.value=p.iridescenceIOR,A.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],A.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(A.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,A.iridescenceMapTransform)),p.iridescenceThicknessMap&&(A.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,A.iridescenceThicknessMapTransform))),p.transmission>0&&(A.transmission.value=p.transmission,A.transmissionSamplerMap.value=y.texture,A.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(A.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,A.transmissionMapTransform)),A.thickness.value=p.thickness,p.thicknessMap&&(A.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,A.thicknessMapTransform)),A.attenuationDistance.value=p.attenuationDistance,A.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(A.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(A.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,A.anisotropyMapTransform))),A.specularIntensity.value=p.specularIntensity,A.specularColor.value.copy(p.specularColor),p.specularColorMap&&(A.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,A.specularColorMapTransform)),p.specularIntensityMap&&(A.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,A.specularIntensityMapTransform))}function m(A,p){p.matcap&&(A.matcap.value=p.matcap)}function g(A,p){const y=e.get(p).light;A.referencePosition.value.setFromMatrixPosition(y.matrixWorld),A.nearDistance.value=y.shadow.camera.near,A.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function DS(i,e,t,n){let s={},r={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(y,b){const _=b.program;n.uniformBlockBinding(y,_)}function l(y,b){let _=s[y.id];_===void 0&&(m(y),_=h(y),s[y.id]=_,y.addEventListener("dispose",A));const M=b.program;n.updateUBOMapping(y,M);const w=e.render.frame;r[y.id]!==w&&(d(y),r[y.id]=w)}function h(y){const b=u();y.__bindingPointIndex=b;const _=i.createBuffer(),M=y.__size,w=y.usage;return i.bindBuffer(i.UNIFORM_BUFFER,_),i.bufferData(i.UNIFORM_BUFFER,M,w),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,b,_),_}function u(){for(let y=0;y<o;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){const b=s[y.id],_=y.uniforms,M=y.__cache;i.bindBuffer(i.UNIFORM_BUFFER,b);for(let w=0,S=_.length;w<S;w++){const T=Array.isArray(_[w])?_[w]:[_[w]];for(let v=0,C=T.length;v<C;v++){const F=T[v];if(f(F,w,v,M)===!0){const K=F.__offset,q=Array.isArray(F.value)?F.value:[F.value];let $=0;for(let D=0;D<q.length;D++){const O=q[D],j=g(O);typeof O=="number"||typeof O=="boolean"?(F.__data[0]=O,i.bufferSubData(i.UNIFORM_BUFFER,K+$,F.__data)):O.isMatrix3?(F.__data[0]=O.elements[0],F.__data[1]=O.elements[1],F.__data[2]=O.elements[2],F.__data[3]=0,F.__data[4]=O.elements[3],F.__data[5]=O.elements[4],F.__data[6]=O.elements[5],F.__data[7]=0,F.__data[8]=O.elements[6],F.__data[9]=O.elements[7],F.__data[10]=O.elements[8],F.__data[11]=0):(O.toArray(F.__data,$),$+=j.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,K,F.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function f(y,b,_,M){const w=y.value,S=b+"_"+_;if(M[S]===void 0)return typeof w=="number"||typeof w=="boolean"?M[S]=w:M[S]=w.clone(),!0;{const T=M[S];if(typeof w=="number"||typeof w=="boolean"){if(T!==w)return M[S]=w,!0}else if(T.equals(w)===!1)return T.copy(w),!0}return!1}function m(y){const b=y.uniforms;let _=0;const M=16;for(let S=0,T=b.length;S<T;S++){const v=Array.isArray(b[S])?b[S]:[b[S]];for(let C=0,F=v.length;C<F;C++){const K=v[C],q=Array.isArray(K.value)?K.value:[K.value];for(let $=0,D=q.length;$<D;$++){const O=q[$],j=g(O),Q=_%M,J=Q%j.boundary,ee=Q+J;_+=J,ee!==0&&M-ee<j.storage&&(_+=M-ee),K.__data=new Float32Array(j.storage/Float32Array.BYTES_PER_ELEMENT),K.__offset=_,_+=j.storage}}}const w=_%M;return w>0&&(_+=M-w),y.__size=_,y.__cache={},this}function g(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),b}function A(y){const b=y.target;b.removeEventListener("dispose",A);const _=a.indexOf(b.__bindingPointIndex);a.splice(_,1),i.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function p(){for(const y in s)i.deleteBuffer(s[y]);a=[],s={},r={}}return{bind:c,update:l,dispose:p}}class cg{constructor(e={}){const{canvas:t=l_(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),g=new Int32Array(4);let A=null,p=null;const y=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ms,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const _=this;let M=!1;this._outputColorSpace=Kt;let w=0,S=0,T=null,v=-1,C=null;const F=new _t,K=new _t;let q=null;const $=new qe(0);let D=0,O=t.width,j=t.height,Q=1,J=null,ee=null;const ae=new _t(0,0,O,j),ye=new _t(0,0,O,j);let Me=!1;const se=new yu;let me=!1,be=!1;const xe=new et,Pe=new et,$e=new H,Qe=new _t,St={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ut=!1;function Je(){return T===null?Q:1}let G=n;function mn(E,R){return t.getContext(E,R)}try{const E={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r176"),t.addEventListener("webglcontextlost",de,!1),t.addEventListener("webglcontextrestored",Ie,!1),t.addEventListener("webglcontextcreationerror",Se,!1),G===null){const R="webgl2";if(G=mn(R,E),G===null)throw mn(R)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let dt,pt,ze,Rt,Ge,L,I,Z,le,Ae,oe,Ue,Ce,Ve,je,Ee,Ne,ke,Oe,Te,tt,We,nt,W;function ne(){dt=new WC(G),dt.init(),We=new IS(G,dt),pt=new UC(G,dt,e,We),ze=new vS(G,dt),pt.reverseDepthBuffer&&d&&ze.buffers.depth.setReversed(!0),Rt=new XC(G),Ge=new dS,L=new SS(G,dt,ze,Ge,pt,We,Rt),I=new QC(_),Z=new VC(_),le=new Dy(G),nt=new PC(G,le),Ae=new qC(G,le,Rt,nt),oe=new jC(G,Ae,le,Rt),Oe=new YC(G,pt,L),Ee=new OC(Ge),Ue=new uS(_,I,Z,dt,pt,nt,Ee),Ce=new FS(_,Ge),Ve=new pS,je=new ES(dt),ke=new LC(_,I,Z,ze,oe,f,c),Ne=new wS(_,oe,pt),W=new DS(G,Rt,pt,ze),Te=new kC(G,dt,Rt),tt=new KC(G,dt,Rt),Rt.programs=Ue.programs,_.capabilities=pt,_.extensions=dt,_.properties=Ge,_.renderLists=Ve,_.shadowMap=Ne,_.state=ze,_.info=Rt}ne();const re=new RS(_,G);this.xr=re,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const E=dt.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=dt.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(E){E!==void 0&&(Q=E,this.setSize(O,j,!1))},this.getSize=function(E){return E.set(O,j)},this.setSize=function(E,R,N=!0){if(re.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=E,j=R,t.width=Math.floor(E*Q),t.height=Math.floor(R*Q),N===!0&&(t.style.width=E+"px",t.style.height=R+"px"),this.setViewport(0,0,E,R)},this.getDrawingBufferSize=function(E){return E.set(O*Q,j*Q).floor()},this.setDrawingBufferSize=function(E,R,N){O=E,j=R,Q=N,t.width=Math.floor(E*N),t.height=Math.floor(R*N),this.setViewport(0,0,E,R)},this.getCurrentViewport=function(E){return E.copy(F)},this.getViewport=function(E){return E.copy(ae)},this.setViewport=function(E,R,N,U){E.isVector4?ae.set(E.x,E.y,E.z,E.w):ae.set(E,R,N,U),ze.viewport(F.copy(ae).multiplyScalar(Q).round())},this.getScissor=function(E){return E.copy(ye)},this.setScissor=function(E,R,N,U){E.isVector4?ye.set(E.x,E.y,E.z,E.w):ye.set(E,R,N,U),ze.scissor(K.copy(ye).multiplyScalar(Q).round())},this.getScissorTest=function(){return Me},this.setScissorTest=function(E){ze.setScissorTest(Me=E)},this.setOpaqueSort=function(E){J=E},this.setTransparentSort=function(E){ee=E},this.getClearColor=function(E){return E.copy(ke.getClearColor())},this.setClearColor=function(){ke.setClearColor(...arguments)},this.getClearAlpha=function(){return ke.getClearAlpha()},this.setClearAlpha=function(){ke.setClearAlpha(...arguments)},this.clear=function(E=!0,R=!0,N=!0){let U=0;if(E){let P=!1;if(T!==null){const z=T.texture.format;P=z===Ch||z===wh||z===yh}if(P){const z=T.texture.type,X=z===tn||z===Xs||z===Ga||z===Ha||z===Eh||z===_h,Y=ke.getClearColor(),ie=ke.getClearAlpha(),he=Y.r,ce=Y.g,fe=Y.b;X?(m[0]=he,m[1]=ce,m[2]=fe,m[3]=ie,G.clearBufferuiv(G.COLOR,0,m)):(g[0]=he,g[1]=ce,g[2]=fe,g[3]=ie,G.clearBufferiv(G.COLOR,0,g))}else U|=G.COLOR_BUFFER_BIT}R&&(U|=G.DEPTH_BUFFER_BIT),N&&(U|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(U)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",de,!1),t.removeEventListener("webglcontextrestored",Ie,!1),t.removeEventListener("webglcontextcreationerror",Se,!1),ke.dispose(),Ve.dispose(),je.dispose(),Ge.dispose(),I.dispose(),Z.dispose(),oe.dispose(),nt.dispose(),W.dispose(),Ue.dispose(),re.dispose(),re.removeEventListener("sessionstart",ih),re.removeEventListener("sessionend",sh),ps.stop()};function de(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function Ie(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const E=Rt.autoReset,R=Ne.enabled,N=Ne.autoUpdate,U=Ne.needsUpdate,P=Ne.type;ne(),Rt.autoReset=E,Ne.enabled=R,Ne.autoUpdate=N,Ne.needsUpdate=U,Ne.type=P}function Se(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function it(E){const R=E.target;R.removeEventListener("dispose",it),Ot(R)}function Ot(E){bn(E),Ge.remove(E)}function bn(E){const R=Ge.get(E).programs;R!==void 0&&(R.forEach(function(N){Ue.releaseProgram(N)}),E.isShaderMaterial&&Ue.releaseShaderCache(E))}this.renderBufferDirect=function(E,R,N,U,P,z){R===null&&(R=St);const X=P.isMesh&&P.matrixWorld.determinant()<0,Y=tp(E,R,N,U,P);ze.setMaterial(U,X);let ie=N.index,he=1;if(U.wireframe===!0){if(ie=Ae.getWireframeAttribute(N),ie===void 0)return;he=2}const ce=N.drawRange,fe=N.attributes.position;let ge=ce.start*he,_e=(ce.start+ce.count)*he;z!==null&&(ge=Math.max(ge,z.start*he),_e=Math.min(_e,(z.start+z.count)*he)),ie!==null?(ge=Math.max(ge,0),_e=Math.min(_e,ie.count)):fe!=null&&(ge=Math.max(ge,0),_e=Math.min(_e,fe.count));const De=_e-ge;if(De<0||De===1/0)return;nt.setup(P,U,Y,N,ie);let Ke,He=Te;if(ie!==null&&(Ke=le.get(ie),He=tt,He.setIndex(Ke)),P.isMesh)U.wireframe===!0?(ze.setLineWidth(U.wireframeLinewidth*Je()),He.setMode(G.LINES)):He.setMode(G.TRIANGLES);else if(P.isLine){let Fe=U.linewidth;Fe===void 0&&(Fe=1),ze.setLineWidth(Fe*Je()),P.isLineSegments?He.setMode(G.LINES):P.isLineLoop?He.setMode(G.LINE_LOOP):He.setMode(G.LINE_STRIP)}else P.isPoints?He.setMode(G.POINTS):P.isSprite&&He.setMode(G.TRIANGLES);if(P.isBatchedMesh)if(P._multiDrawInstances!==null)mc("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),He.renderMultiDrawInstances(P._multiDrawStarts,P._multiDrawCounts,P._multiDrawCount,P._multiDrawInstances);else if(dt.get("WEBGL_multi_draw"))He.renderMultiDraw(P._multiDrawStarts,P._multiDrawCounts,P._multiDrawCount);else{const Fe=P._multiDrawStarts,st=P._multiDrawCounts,Le=P._multiDrawCount,wt=ie?le.get(ie).bytesPerElement:1,un=Ge.get(U).currentProgram.getUniforms();for(let Et=0;Et<Le;Et++)un.setValue(G,"_gl_DrawID",Et),He.render(Fe[Et]/wt,st[Et])}else if(P.isInstancedMesh)He.renderInstances(ge,De,P.count);else if(N.isInstancedBufferGeometry){const Fe=N._maxInstanceCount!==void 0?N._maxInstanceCount:1/0,st=Math.min(N.instanceCount,Fe);He.renderInstances(ge,De,st)}else He.render(ge,De)};function yt(E,R,N){E.transparent===!0&&E.side===Si&&E.forceSinglePass===!1?(E.side=Sn,E.needsUpdate=!0,Oa(E,R,N),E.side=Qi,E.needsUpdate=!0,Oa(E,R,N),E.side=Si):Oa(E,R,N)}this.compile=function(E,R,N=null){N===null&&(N=E),p=je.get(N),p.init(R),b.push(p),N.traverseVisible(function(P){P.isLight&&P.layers.test(R.layers)&&(p.pushLight(P),P.castShadow&&p.pushShadow(P))}),E!==N&&E.traverseVisible(function(P){P.isLight&&P.layers.test(R.layers)&&(p.pushLight(P),P.castShadow&&p.pushShadow(P))}),p.setupLights();const U=new Set;return E.traverse(function(P){if(!(P.isMesh||P.isPoints||P.isLine||P.isSprite))return;const z=P.material;if(z)if(Array.isArray(z))for(let X=0;X<z.length;X++){const Y=z[X];yt(Y,N,P),U.add(Y)}else yt(z,N,P),U.add(z)}),p=b.pop(),U},this.compileAsync=function(E,R,N=null){const U=this.compile(E,R,N);return new Promise(P=>{function z(){if(U.forEach(function(X){Ge.get(X).currentProgram.isReady()&&U.delete(X)}),U.size===0){P(E);return}setTimeout(z,10)}dt.get("KHR_parallel_shader_compile")!==null?z():setTimeout(z,10)})};let jn=null;function vi(E){jn&&jn(E)}function ih(){ps.stop()}function sh(){ps.start()}const ps=new DA;ps.setAnimationLoop(vi),typeof self<"u"&&ps.setContext(self),this.setAnimationLoop=function(E){jn=E,re.setAnimationLoop(E),E===null?ps.stop():ps.start()},re.addEventListener("sessionstart",ih),re.addEventListener("sessionend",sh),this.render=function(E,R){if(R!==void 0&&R.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),R.parent===null&&R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),re.enabled===!0&&re.isPresenting===!0&&(re.cameraAutoUpdate===!0&&re.updateCamera(R),R=re.getCamera()),E.isScene===!0&&E.onBeforeRender(_,E,R,T),p=je.get(E,b.length),p.init(R),b.push(p),Pe.multiplyMatrices(R.projectionMatrix,R.matrixWorldInverse),se.setFromProjectionMatrix(Pe),be=this.localClippingEnabled,me=Ee.init(this.clippingPlanes,be),A=Ve.get(E,y.length),A.init(),y.push(A),re.enabled===!0&&re.isPresenting===!0){const z=_.xr.getDepthSensingMesh();z!==null&&Zo(z,R,-1/0,_.sortObjects)}Zo(E,R,0,_.sortObjects),A.finish(),_.sortObjects===!0&&A.sort(J,ee),ut=re.enabled===!1||re.isPresenting===!1||re.hasDepthSensing()===!1,ut&&ke.addToRenderList(A,E),this.info.render.frame++,me===!0&&Ee.beginShadows();const N=p.state.shadowsArray;Ne.render(N,E,R),me===!0&&Ee.endShadows(),this.info.autoReset===!0&&this.info.reset();const U=A.opaque,P=A.transmissive;if(p.setupLights(),R.isArrayCamera){const z=R.cameras;if(P.length>0)for(let X=0,Y=z.length;X<Y;X++){const ie=z[X];rh(U,P,E,ie)}ut&&ke.render(E);for(let X=0,Y=z.length;X<Y;X++){const ie=z[X];$o(A,E,ie,ie.viewport)}}else P.length>0&&rh(U,P,E,R),ut&&ke.render(E),$o(A,E,R);T!==null&&S===0&&(L.updateMultisampleRenderTarget(T),L.updateRenderTargetMipmap(T)),E.isScene===!0&&E.onAfterRender(_,E,R),nt.resetDefaultState(),v=-1,C=null,b.pop(),b.length>0?(p=b[b.length-1],me===!0&&Ee.setGlobalState(_.clippingPlanes,p.state.camera)):p=null,y.pop(),y.length>0?A=y[y.length-1]:A=null};function Zo(E,R,N,U){if(E.visible===!1)return;if(E.layers.test(R.layers)){if(E.isGroup)N=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(R);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||se.intersectsSprite(E)){U&&Qe.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Pe);const X=oe.update(E),Y=E.material;Y.visible&&A.push(E,X,Y,N,Qe.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||se.intersectsObject(E))){const X=oe.update(E),Y=E.material;if(U&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),Qe.copy(E.boundingSphere.center)):(X.boundingSphere===null&&X.computeBoundingSphere(),Qe.copy(X.boundingSphere.center)),Qe.applyMatrix4(E.matrixWorld).applyMatrix4(Pe)),Array.isArray(Y)){const ie=X.groups;for(let he=0,ce=ie.length;he<ce;he++){const fe=ie[he],ge=Y[fe.materialIndex];ge&&ge.visible&&A.push(E,X,ge,N,Qe.z,fe)}}else Y.visible&&A.push(E,X,Y,N,Qe.z,null)}}const z=E.children;for(let X=0,Y=z.length;X<Y;X++)Zo(z[X],R,N,U)}function $o(E,R,N,U){const P=E.opaque,z=E.transmissive,X=E.transparent;p.setupLightsView(N),me===!0&&Ee.setGlobalState(_.clippingPlanes,N),U&&ze.viewport(F.copy(U)),P.length>0&&Ua(P,R,N),z.length>0&&Ua(z,R,N),X.length>0&&Ua(X,R,N),ze.buffers.depth.setTest(!0),ze.buffers.depth.setMask(!0),ze.buffers.color.setMask(!0),ze.setPolygonOffset(!1)}function rh(E,R,N,U){if((N.isScene===!0?N.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[U.id]===void 0&&(p.state.transmissionRenderTarget[U.id]=new js(1,1,{generateMipmaps:!0,type:dt.has("EXT_color_buffer_half_float")||dt.has("EXT_color_buffer_float")?Mn:tn,minFilter:Jn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:At.workingColorSpace}));const z=p.state.transmissionRenderTarget[U.id],X=U.viewport||F;z.setSize(X.z*_.transmissionResolutionScale,X.w*_.transmissionResolutionScale);const Y=_.getRenderTarget();_.setRenderTarget(z),_.getClearColor($),D=_.getClearAlpha(),D<1&&_.setClearColor(16777215,.5),_.clear(),ut&&ke.render(N);const ie=_.toneMapping;_.toneMapping=ms;const he=U.viewport;if(U.viewport!==void 0&&(U.viewport=void 0),p.setupLightsView(U),me===!0&&Ee.setGlobalState(_.clippingPlanes,U),Ua(E,N,U),L.updateMultisampleRenderTarget(z),L.updateRenderTargetMipmap(z),dt.has("WEBGL_multisampled_render_to_texture")===!1){let ce=!1;for(let fe=0,ge=R.length;fe<ge;fe++){const _e=R[fe],De=_e.object,Ke=_e.geometry,He=_e.material,Fe=_e.group;if(He.side===Si&&De.layers.test(U.layers)){const st=He.side;He.side=Sn,He.needsUpdate=!0,ah(De,N,U,Ke,He,Fe),He.side=st,He.needsUpdate=!0,ce=!0}}ce===!0&&(L.updateMultisampleRenderTarget(z),L.updateRenderTargetMipmap(z))}_.setRenderTarget(Y),_.setClearColor($,D),he!==void 0&&(U.viewport=he),_.toneMapping=ie}function Ua(E,R,N){const U=R.isScene===!0?R.overrideMaterial:null;for(let P=0,z=E.length;P<z;P++){const X=E[P],Y=X.object,ie=X.geometry,he=X.group;let ce=X.material;ce.allowOverride===!0&&U!==null&&(ce=U),Y.layers.test(N.layers)&&ah(Y,R,N,ie,ce,he)}}function ah(E,R,N,U,P,z){E.onBeforeRender(_,R,N,U,P,z),E.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),P.onBeforeRender(_,R,N,U,E,z),P.transparent===!0&&P.side===Si&&P.forceSinglePass===!1?(P.side=Sn,P.needsUpdate=!0,_.renderBufferDirect(N,R,U,P,E,z),P.side=Qi,P.needsUpdate=!0,_.renderBufferDirect(N,R,U,P,E,z),P.side=Si):_.renderBufferDirect(N,R,U,P,E,z),E.onAfterRender(_,R,N,U,P,z)}function Oa(E,R,N){R.isScene!==!0&&(R=St);const U=Ge.get(E),P=p.state.lights,z=p.state.shadowsArray,X=P.state.version,Y=Ue.getParameters(E,P.state,z,R,N),ie=Ue.getProgramCacheKey(Y);let he=U.programs;U.environment=E.isMeshStandardMaterial?R.environment:null,U.fog=R.fog,U.envMap=(E.isMeshStandardMaterial?Z:I).get(E.envMap||U.environment),U.envMapRotation=U.environment!==null&&E.envMap===null?R.environmentRotation:E.envMapRotation,he===void 0&&(E.addEventListener("dispose",it),he=new Map,U.programs=he);let ce=he.get(ie);if(ce!==void 0){if(U.currentProgram===ce&&U.lightsStateVersion===X)return tc(E,Y),ce}else Y.uniforms=Ue.getUniforms(E),E.onBeforeCompile(Y,_),ce=Ue.acquireProgram(Y,ie),he.set(ie,ce),U.uniforms=Y.uniforms;const fe=U.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(fe.clippingPlanes=Ee.uniform),tc(E,Y),U.needsLights=Ws(E),U.lightsStateVersion=X,U.needsLights&&(fe.ambientLightColor.value=P.state.ambient,fe.lightProbe.value=P.state.probe,fe.directionalLights.value=P.state.directional,fe.directionalLightShadows.value=P.state.directionalShadow,fe.spotLights.value=P.state.spot,fe.spotLightShadows.value=P.state.spotShadow,fe.rectAreaLights.value=P.state.rectArea,fe.ltc_1.value=P.state.rectAreaLTC1,fe.ltc_2.value=P.state.rectAreaLTC2,fe.pointLights.value=P.state.point,fe.pointLightShadows.value=P.state.pointShadow,fe.hemisphereLights.value=P.state.hemi,fe.directionalShadowMap.value=P.state.directionalShadowMap,fe.directionalShadowMatrix.value=P.state.directionalShadowMatrix,fe.spotShadowMap.value=P.state.spotShadowMap,fe.spotLightMatrix.value=P.state.spotLightMatrix,fe.spotLightMap.value=P.state.spotLightMap,fe.pointShadowMap.value=P.state.pointShadowMap,fe.pointShadowMatrix.value=P.state.pointShadowMatrix),U.currentProgram=ce,U.uniformsList=null,ce}function ec(E){if(E.uniformsList===null){const R=E.currentProgram.getUniforms();E.uniformsList=Zc.seqWithValue(R.seq,E.uniforms)}return E.uniformsList}function tc(E,R){const N=Ge.get(E);N.outputColorSpace=R.outputColorSpace,N.batching=R.batching,N.batchingColor=R.batchingColor,N.instancing=R.instancing,N.instancingColor=R.instancingColor,N.instancingMorph=R.instancingMorph,N.skinning=R.skinning,N.morphTargets=R.morphTargets,N.morphNormals=R.morphNormals,N.morphColors=R.morphColors,N.morphTargetsCount=R.morphTargetsCount,N.numClippingPlanes=R.numClippingPlanes,N.numIntersection=R.numClipIntersection,N.vertexAlphas=R.vertexAlphas,N.vertexTangents=R.vertexTangents,N.toneMapping=R.toneMapping}function tp(E,R,N,U,P){R.isScene!==!0&&(R=St),L.resetTextureUnits();const z=R.fog,X=U.isMeshStandardMaterial?R.environment:null,Y=T===null?_.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:rn,ie=(U.isMeshStandardMaterial?Z:I).get(U.envMap||X),he=U.vertexColors===!0&&!!N.attributes.color&&N.attributes.color.itemSize===4,ce=!!N.attributes.tangent&&(!!U.normalMap||U.anisotropy>0),fe=!!N.morphAttributes.position,ge=!!N.morphAttributes.normal,_e=!!N.morphAttributes.color;let De=ms;U.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(De=_.toneMapping);const Ke=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,He=Ke!==void 0?Ke.length:0,Fe=Ge.get(U),st=p.state.lights;if(me===!0&&(be===!0||E!==C)){const Lt=E===C&&U.id===v;Ee.setState(U,E,Lt)}let Le=!1;U.version===Fe.__version?(Fe.needsLights&&Fe.lightsStateVersion!==st.state.version||Fe.outputColorSpace!==Y||P.isBatchedMesh&&Fe.batching===!1||!P.isBatchedMesh&&Fe.batching===!0||P.isBatchedMesh&&Fe.batchingColor===!0&&P.colorTexture===null||P.isBatchedMesh&&Fe.batchingColor===!1&&P.colorTexture!==null||P.isInstancedMesh&&Fe.instancing===!1||!P.isInstancedMesh&&Fe.instancing===!0||P.isSkinnedMesh&&Fe.skinning===!1||!P.isSkinnedMesh&&Fe.skinning===!0||P.isInstancedMesh&&Fe.instancingColor===!0&&P.instanceColor===null||P.isInstancedMesh&&Fe.instancingColor===!1&&P.instanceColor!==null||P.isInstancedMesh&&Fe.instancingMorph===!0&&P.morphTexture===null||P.isInstancedMesh&&Fe.instancingMorph===!1&&P.morphTexture!==null||Fe.envMap!==ie||U.fog===!0&&Fe.fog!==z||Fe.numClippingPlanes!==void 0&&(Fe.numClippingPlanes!==Ee.numPlanes||Fe.numIntersection!==Ee.numIntersection)||Fe.vertexAlphas!==he||Fe.vertexTangents!==ce||Fe.morphTargets!==fe||Fe.morphNormals!==ge||Fe.morphColors!==_e||Fe.toneMapping!==De||Fe.morphTargetsCount!==He)&&(Le=!0):(Le=!0,Fe.__version=U.version);let wt=Fe.currentProgram;Le===!0&&(wt=Oa(U,R,P));let un=!1,Et=!1,bt=!1;const Xe=wt.getUniforms(),qt=Fe.uniforms;if(ze.useProgram(wt.program)&&(un=!0,Et=!0,bt=!0),U.id!==v&&(v=U.id,Et=!0),un||C!==E){ze.buffers.depth.getReversed()?(xe.copy(E.projectionMatrix),u_(xe),d_(xe),Xe.setValue(G,"projectionMatrix",xe)):Xe.setValue(G,"projectionMatrix",E.projectionMatrix),Xe.setValue(G,"viewMatrix",E.matrixWorldInverse);const dn=Xe.map.cameraPosition;dn!==void 0&&dn.setValue(G,$e.setFromMatrixPosition(E.matrixWorld)),pt.logarithmicDepthBuffer&&Xe.setValue(G,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(U.isMeshPhongMaterial||U.isMeshToonMaterial||U.isMeshLambertMaterial||U.isMeshBasicMaterial||U.isMeshStandardMaterial||U.isShaderMaterial)&&Xe.setValue(G,"isOrthographic",E.isOrthographicCamera===!0),C!==E&&(C=E,Et=!0,bt=!0)}if(P.isSkinnedMesh){Xe.setOptional(G,P,"bindMatrix"),Xe.setOptional(G,P,"bindMatrixInverse");const Lt=P.skeleton;Lt&&(Lt.boneTexture===null&&Lt.computeBoneTexture(),Xe.setValue(G,"boneTexture",Lt.boneTexture,L))}P.isBatchedMesh&&(Xe.setOptional(G,P,"batchingTexture"),Xe.setValue(G,"batchingTexture",P._matricesTexture,L),Xe.setOptional(G,P,"batchingIdTexture"),Xe.setValue(G,"batchingIdTexture",P._indirectTexture,L),Xe.setOptional(G,P,"batchingColorTexture"),P._colorsTexture!==null&&Xe.setValue(G,"batchingColorTexture",P._colorsTexture,L));const xn=N.morphAttributes;if((xn.position!==void 0||xn.normal!==void 0||xn.color!==void 0)&&Oe.update(P,N,wt),(Et||Fe.receiveShadow!==P.receiveShadow)&&(Fe.receiveShadow=P.receiveShadow,Xe.setValue(G,"receiveShadow",P.receiveShadow)),U.isMeshGouraudMaterial&&U.envMap!==null&&(qt.envMap.value=ie,qt.flipEnvMap.value=ie.isCubeTexture&&ie.isRenderTargetTexture===!1?-1:1),U.isMeshStandardMaterial&&U.envMap===null&&R.environment!==null&&(qt.envMapIntensity.value=R.environmentIntensity),Et&&(Xe.setValue(G,"toneMappingExposure",_.toneMappingExposure),Fe.needsLights&&As(qt,bt),z&&U.fog===!0&&Ce.refreshFogUniforms(qt,z),Ce.refreshMaterialUniforms(qt,U,Q,j,p.state.transmissionRenderTarget[E.id]),Zc.upload(G,ec(Fe),qt,L)),U.isShaderMaterial&&U.uniformsNeedUpdate===!0&&(Zc.upload(G,ec(Fe),qt,L),U.uniformsNeedUpdate=!1),U.isSpriteMaterial&&Xe.setValue(G,"center",P.center),Xe.setValue(G,"modelViewMatrix",P.modelViewMatrix),Xe.setValue(G,"normalMatrix",P.normalMatrix),Xe.setValue(G,"modelMatrix",P.matrixWorld),U.isShaderMaterial||U.isRawShaderMaterial){const Lt=U.uniformsGroups;for(let dn=0,np=Lt.length;dn<np;dn++){const Br=Lt[dn];W.update(Br,wt),W.bind(Br,wt)}}return wt}function As(E,R){E.ambientLightColor.needsUpdate=R,E.lightProbe.needsUpdate=R,E.directionalLights.needsUpdate=R,E.directionalLightShadows.needsUpdate=R,E.pointLights.needsUpdate=R,E.pointLightShadows.needsUpdate=R,E.spotLights.needsUpdate=R,E.spotLightShadows.needsUpdate=R,E.rectAreaLights.needsUpdate=R,E.hemisphereLights.needsUpdate=R}function Ws(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(E,R,N){const U=Ge.get(E);U.__autoAllocateDepthBuffer=E.resolveDepthBuffer===!1,U.__autoAllocateDepthBuffer===!1&&(U.__useRenderToTexture=!1),Ge.get(E.texture).__webglTexture=R,Ge.get(E.depthTexture).__webglTexture=U.__autoAllocateDepthBuffer?void 0:N,U.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(E,R){const N=Ge.get(E);N.__webglFramebuffer=R,N.__useDefaultFramebuffer=R===void 0};const x=G.createFramebuffer();this.setRenderTarget=function(E,R=0,N=0){T=E,w=R,S=N;let U=!0,P=null,z=!1,X=!1;if(E){const ie=Ge.get(E);if(ie.__useDefaultFramebuffer!==void 0)ze.bindFramebuffer(G.FRAMEBUFFER,null),U=!1;else if(ie.__webglFramebuffer===void 0)L.setupRenderTarget(E);else if(ie.__hasExternalTextures)L.rebindTextures(E,Ge.get(E.texture).__webglTexture,Ge.get(E.depthTexture).__webglTexture);else if(E.depthBuffer){const fe=E.depthTexture;if(ie.__boundDepthTexture!==fe){if(fe!==null&&Ge.has(fe)&&(E.width!==fe.image.width||E.height!==fe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");L.setupDepthRenderbuffer(E)}}const he=E.texture;(he.isData3DTexture||he.isDataArrayTexture||he.isCompressedArrayTexture)&&(X=!0);const ce=Ge.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(ce[R])?P=ce[R][N]:P=ce[R],z=!0):E.samples>0&&L.useMultisampledRTT(E)===!1?P=Ge.get(E).__webglMultisampledFramebuffer:Array.isArray(ce)?P=ce[N]:P=ce,F.copy(E.viewport),K.copy(E.scissor),q=E.scissorTest}else F.copy(ae).multiplyScalar(Q).floor(),K.copy(ye).multiplyScalar(Q).floor(),q=Me;if(N!==0&&(P=x),ze.bindFramebuffer(G.FRAMEBUFFER,P)&&U&&ze.drawBuffers(E,P),ze.viewport(F),ze.scissor(K),ze.setScissorTest(q),z){const ie=Ge.get(E.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+R,ie.__webglTexture,N)}else if(X){const ie=Ge.get(E.texture),he=R;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,ie.__webglTexture,N,he)}else if(E!==null&&N!==0){const ie=Ge.get(E.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,ie.__webglTexture,N)}v=-1},this.readRenderTargetPixels=function(E,R,N,U,P,z,X){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Y=Ge.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&X!==void 0&&(Y=Y[X]),Y){ze.bindFramebuffer(G.FRAMEBUFFER,Y);try{const ie=E.texture,he=ie.format,ce=ie.type;if(!pt.textureFormatReadable(he)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!pt.textureTypeReadable(ce)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}R>=0&&R<=E.width-U&&N>=0&&N<=E.height-P&&G.readPixels(R,N,U,P,We.convert(he),We.convert(ce),z)}finally{const ie=T!==null?Ge.get(T).__webglFramebuffer:null;ze.bindFramebuffer(G.FRAMEBUFFER,ie)}}},this.readRenderTargetPixelsAsync=async function(E,R,N,U,P,z,X){if(!(E&&E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Y=Ge.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&X!==void 0&&(Y=Y[X]),Y)if(R>=0&&R<=E.width-U&&N>=0&&N<=E.height-P){ze.bindFramebuffer(G.FRAMEBUFFER,Y);const ie=E.texture,he=ie.format,ce=ie.type;if(!pt.textureFormatReadable(he))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!pt.textureTypeReadable(ce))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const fe=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,fe),G.bufferData(G.PIXEL_PACK_BUFFER,z.byteLength,G.STREAM_READ),G.readPixels(R,N,U,P,We.convert(he),We.convert(ce),0);const ge=T!==null?Ge.get(T).__webglFramebuffer:null;ze.bindFramebuffer(G.FRAMEBUFFER,ge);const _e=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await h_(G,_e,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,fe),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,z),G.deleteBuffer(fe),G.deleteSync(_e),z}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(E,R=null,N=0){const U=Math.pow(2,-N),P=Math.floor(E.image.width*U),z=Math.floor(E.image.height*U),X=R!==null?R.x:0,Y=R!==null?R.y:0;L.setTexture2D(E,0),G.copyTexSubImage2D(G.TEXTURE_2D,N,0,0,X,Y,P,z),ze.unbindTexture()};const B=G.createFramebuffer(),k=G.createFramebuffer();this.copyTextureToTexture=function(E,R,N=null,U=null,P=0,z=null){z===null&&(P!==0?(mc("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),z=P,P=0):z=0);let X,Y,ie,he,ce,fe,ge,_e,De;const Ke=E.isCompressedTexture?E.mipmaps[z]:E.image;if(N!==null)X=N.max.x-N.min.x,Y=N.max.y-N.min.y,ie=N.isBox3?N.max.z-N.min.z:1,he=N.min.x,ce=N.min.y,fe=N.isBox3?N.min.z:0;else{const xn=Math.pow(2,-P);X=Math.floor(Ke.width*xn),Y=Math.floor(Ke.height*xn),E.isDataArrayTexture?ie=Ke.depth:E.isData3DTexture?ie=Math.floor(Ke.depth*xn):ie=1,he=0,ce=0,fe=0}U!==null?(ge=U.x,_e=U.y,De=U.z):(ge=0,_e=0,De=0);const He=We.convert(R.format),Fe=We.convert(R.type);let st;R.isData3DTexture?(L.setTexture3D(R,0),st=G.TEXTURE_3D):R.isDataArrayTexture||R.isCompressedArrayTexture?(L.setTexture2DArray(R,0),st=G.TEXTURE_2D_ARRAY):(L.setTexture2D(R,0),st=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,R.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,R.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,R.unpackAlignment);const Le=G.getParameter(G.UNPACK_ROW_LENGTH),wt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),un=G.getParameter(G.UNPACK_SKIP_PIXELS),Et=G.getParameter(G.UNPACK_SKIP_ROWS),bt=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,Ke.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Ke.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,he),G.pixelStorei(G.UNPACK_SKIP_ROWS,ce),G.pixelStorei(G.UNPACK_SKIP_IMAGES,fe);const Xe=E.isDataArrayTexture||E.isData3DTexture,qt=R.isDataArrayTexture||R.isData3DTexture;if(E.isDepthTexture){const xn=Ge.get(E),Lt=Ge.get(R),dn=Ge.get(xn.__renderTarget),np=Ge.get(Lt.__renderTarget);ze.bindFramebuffer(G.READ_FRAMEBUFFER,dn.__webglFramebuffer),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,np.__webglFramebuffer);for(let Br=0;Br<ie;Br++)Xe&&(G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ge.get(E).__webglTexture,P,fe+Br),G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ge.get(R).__webglTexture,z,De+Br)),G.blitFramebuffer(he,ce,X,Y,ge,_e,X,Y,G.DEPTH_BUFFER_BIT,G.NEAREST);ze.bindFramebuffer(G.READ_FRAMEBUFFER,null),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else if(P!==0||E.isRenderTargetTexture||Ge.has(E)){const xn=Ge.get(E),Lt=Ge.get(R);ze.bindFramebuffer(G.READ_FRAMEBUFFER,B),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,k);for(let dn=0;dn<ie;dn++)Xe?G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,xn.__webglTexture,P,fe+dn):G.framebufferTexture2D(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,xn.__webglTexture,P),qt?G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Lt.__webglTexture,z,De+dn):G.framebufferTexture2D(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Lt.__webglTexture,z),P!==0?G.blitFramebuffer(he,ce,X,Y,ge,_e,X,Y,G.COLOR_BUFFER_BIT,G.NEAREST):qt?G.copyTexSubImage3D(st,z,ge,_e,De+dn,he,ce,X,Y):G.copyTexSubImage2D(st,z,ge,_e,he,ce,X,Y);ze.bindFramebuffer(G.READ_FRAMEBUFFER,null),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else qt?E.isDataTexture||E.isData3DTexture?G.texSubImage3D(st,z,ge,_e,De,X,Y,ie,He,Fe,Ke.data):R.isCompressedArrayTexture?G.compressedTexSubImage3D(st,z,ge,_e,De,X,Y,ie,He,Ke.data):G.texSubImage3D(st,z,ge,_e,De,X,Y,ie,He,Fe,Ke):E.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,z,ge,_e,X,Y,He,Fe,Ke.data):E.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,z,ge,_e,Ke.width,Ke.height,He,Ke.data):G.texSubImage2D(G.TEXTURE_2D,z,ge,_e,X,Y,He,Fe,Ke);G.pixelStorei(G.UNPACK_ROW_LENGTH,Le),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,wt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,un),G.pixelStorei(G.UNPACK_SKIP_ROWS,Et),G.pixelStorei(G.UNPACK_SKIP_IMAGES,bt),z===0&&R.generateMipmaps&&G.generateMipmap(st),ze.unbindTexture()},this.copyTextureToTexture3D=function(E,R,N=null,U=null,P=0){return mc('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(E,R,N,U,P)},this.initRenderTarget=function(E){Ge.get(E).__webglFramebuffer===void 0&&L.setupRenderTarget(E)},this.initTexture=function(E){E.isCubeTexture?L.setTextureCube(E,0):E.isData3DTexture?L.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?L.setTexture2DArray(E,0):L.setTexture2D(E,0),ze.unbindTexture()},this.resetState=function(){w=0,S=0,T=null,ze.reset(),nt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Hi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=At._getDrawingBufferColorSpace(e),t.unpackColorSpace=At._getUnpackColorSpace()}}var go=function(){var i=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),n(++i%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function n(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";i=h}var s=(performance||Date).now(),r=s,a=0,o=t(new go.Panel("FPS","#0ff","#002")),c=t(new go.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new go.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:e,addPanel:t,showPanel:n,begin:function(){s=(performance||Date).now()},end:function(){a++;var h=(performance||Date).now();if(c.update(h-s,200),h>=r+1e3&&(o.update(a*1e3/(h-r),100),r=h,a=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){s=this.end()},domElement:e,setMode:n}};go.Panel=function(i,e,t){var n=1/0,s=0,r=Math.round,a=r(window.devicePixelRatio||1),o=80*a,c=48*a,l=3*a,h=2*a,u=3*a,d=15*a,f=74*a,m=30*a,g=document.createElement("canvas");g.width=o,g.height=c,g.style.cssText="width:80px;height:48px";var A=g.getContext("2d");return A.font="bold "+9*a+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=t,A.fillRect(0,0,o,c),A.fillStyle=e,A.fillText(i,l,h),A.fillRect(u,d,f,m),A.fillStyle=t,A.globalAlpha=.9,A.fillRect(u,d,f,m),{dom:g,update:function(p,y){n=Math.min(n,p),s=Math.max(s,p),A.fillStyle=t,A.globalAlpha=1,A.fillRect(0,0,o,d),A.fillStyle=e,A.fillText(r(p)+" "+i+" ("+r(n)+"-"+r(s)+")",l,h),A.drawImage(g,u+a,d,f-a,m,u,d,f-a,m),A.fillRect(u+f-a,d,a,m),A.fillStyle=t,A.globalAlpha=.9,A.fillRect(u+f-a,d,a,r((1-p/y)*m))}}};function lg(i,e){if(e===PE)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===Wh||e===_p){let t=i.getIndex();if(t===null){const a=[],o=i.getAttribute("position");if(o!==void 0){for(let c=0;c<o.count;c++)a.push(c);i.setIndex(a),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,s=[];if(e===Wh)for(let a=1;a<=n;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<n;a++)a%2===0?(s.push(t.getX(a)),s.push(t.getX(a+1)),s.push(t.getX(a+2))):(s.push(t.getX(a+2)),s.push(t.getX(a+1)),s.push(t.getX(a)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=i.clone();return r.setIndex(s),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Vu extends Ji{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new OS(t)}),this.register(function(t){return new QS(t)}),this.register(function(t){return new YS(t)}),this.register(function(t){return new jS(t)}),this.register(function(t){return new JS(t)}),this.register(function(t){return new HS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new VS(t)}),this.register(function(t){return new WS(t)}),this.register(function(t){return new US(t)}),this.register(function(t){return new qS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new XS(t)}),this.register(function(t){return new KS(t)}),this.register(function(t){return new PS(t)}),this.register(function(t){return new ZS(t)}),this.register(function(t){return new $S(t)})}load(e,t,n,s){const r=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const l=oa.extractUrlBase(e);a=oa.resolveURL(l,this.path)}else a=oa.extractUrlBase(e);this.manager.itemStart(e);const o=function(l){s?s(l):console.error(l),r.manager.itemError(e),r.manager.itemEnd(e)},c=new Ms(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{r.parse(l,a,function(h){t(h),r.manager.itemEnd(e)},o)}catch(h){o(h)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,s){let r;const a={},o={},c=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===hg){try{a[ft.KHR_BINARY_GLTF]=new eI(e)}catch(u){s&&s(u);return}r=JSON.parse(a[ft.KHR_BINARY_GLTF].content)}else r=JSON.parse(c.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new fI(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const u=this.pluginCallbacks[h](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[u.name]=u,a[u.name]=!0}if(r.extensionsUsed)for(let h=0;h<r.extensionsUsed.length;++h){const u=r.extensionsUsed[h],d=r.extensionsRequired||[];switch(u){case ft.KHR_MATERIALS_UNLIT:a[u]=new kS;break;case ft.KHR_DRACO_MESH_COMPRESSION:a[u]=new tI(r,this.dracoLoader);break;case ft.KHR_TEXTURE_TRANSFORM:a[u]=new nI;break;case ft.KHR_MESH_QUANTIZATION:a[u]=new iI;break;default:d.indexOf(u)>=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,r){n.parse(e,t,s,r)})}}function LS(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const ft={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class PS{constructor(e){this.parser=e,this.name=ft.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let s=t.cache.get(n);if(s)return s;const r=t.json,c=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let l;const h=new qe(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],rn);const u=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new MA(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new IA(h),l.distance=u;break;case"spot":l=new dy(h),l.distance=u,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),$i(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),s=Promise.resolve(l),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],o=(r.extensions&&r.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(c){return n._getNodeRef(t.cache,o,c)})}}class kS{constructor(){this.name=ft.KHR_MATERIALS_UNLIT}getMaterialType(){return Cs}extendParams(e,t,n){const s=[];e.color=new qe(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const a=r.baseColorFactor;e.color.setRGB(a[0],a[1],a[2],rn),e.opacity=a[3]}r.baseColorTexture!==void 0&&s.push(n.assignTexture(e,"map",r.baseColorTexture,Kt))}return Promise.all(s)}}class US{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}}class OS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];if(a.clearcoatFactor!==void 0&&(t.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(r.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){const o=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ze(o,o)}return Promise.all(r)}}class QS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class GS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return a.iridescenceFactor!==void 0&&(t.iridescence=a.iridescenceFactor),a.iridescenceTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),a.iridescenceIor!==void 0&&(t.iridescenceIOR=a.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),a.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),a.iridescenceThicknessTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(r)}}class HS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new qe(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=s.extensions[this.name];if(a.sheenColorFactor!==void 0){const o=a.sheenColorFactor;t.sheenColor.setRGB(o[0],o[1],o[2],rn)}return a.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=a.sheenRoughnessFactor),a.sheenColorTexture!==void 0&&r.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture,Kt)),a.sheenRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(r)}}class zS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return a.transmissionFactor!==void 0&&(t.transmission=a.transmissionFactor),a.transmissionTexture!==void 0&&r.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(r)}}class VS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];t.thickness=a.thicknessFactor!==void 0?a.thicknessFactor:0,a.thicknessTexture!==void 0&&r.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;const o=a.attenuationColor||[1,1,1];return t.attenuationColor=new qe().setRGB(o[0],o[1],o[2],rn),Promise.all(r)}}class WS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class qS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];t.specularIntensity=a.specularFactor!==void 0?a.specularFactor:1,a.specularTexture!==void 0&&r.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return t.specularColor=new qe().setRGB(o[0],o[1],o[2],rn),a.specularColorTexture!==void 0&&r.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture,Kt)),Promise.all(r)}}class KS{constructor(e){this.parser=e,this.name=ft.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return t.bumpScale=a.bumpFactor!==void 0?a.bumpFactor:1,a.bumpTexture!==void 0&&r.push(n.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(r)}}class XS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ri}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return a.anisotropyStrength!==void 0&&(t.anisotropy=a.anisotropyStrength),a.anisotropyRotation!==void 0&&(t.anisotropyRotation=a.anisotropyRotation),a.anisotropyTexture!==void 0&&r.push(n.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(r)}}class YS{constructor(e){this.parser=e,this.name=ft.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const r=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,a)}}class jS{constructor(e){this.parser=e,this.name=ft.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const a=r.extensions[t],o=s.images[a.source];let c=n.textureLoader;if(o.uri){const l=n.options.manager.getHandler(o.uri);l!==null&&(c=l)}return n.loadTextureImage(e,a.source,c)}}class JS{constructor(e){this.parser=e,this.name=ft.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const a=r.extensions[t],o=s.images[a.source];let c=n.textureLoader;if(o.uri){const l=n.options.manager.getHandler(o.uri);l!==null&&(c=l)}return n.loadTextureImage(e,a.source,c)}}class ZS{constructor(e){this.name=ft.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(o){const c=s.byteOffset||0,l=s.byteLength||0,h=s.count,u=s.byteStride,d=new Uint8Array(o,c,l);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,d,s.mode,s.filter).then(function(f){return f.buffer}):a.ready.then(function(){const f=new ArrayBuffer(h*u);return a.decodeGltfBuffer(new Uint8Array(f),h,u,d,s.mode,s.filter),f})})}else return null}}class $S{constructor(e){this.name=ft.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=t.meshes[n.mesh];for(const l of s.primitives)if(l.mode!==$n.TRIANGLES&&l.mode!==$n.TRIANGLE_STRIP&&l.mode!==$n.TRIANGLE_FAN&&l.mode!==void 0)return null;const a=n.extensions[this.name].attributes,o=[],c={};for(const l in a)o.push(this.parser.getDependency("accessor",a[l]).then(h=>(c[l]=h,c[l])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],d=l[0].count,f=[];for(const m of u){const g=new et,A=new H,p=new Vn,y=new H(1,1,1),b=new uA(m.geometry,m.material,d);for(let _=0;_<d;_++)c.TRANSLATION&&A.fromBufferAttribute(c.TRANSLATION,_),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,_),c.SCALE&&y.fromBufferAttribute(c.SCALE,_),b.setMatrixAt(_,g.compose(A,p,y));for(const _ in c)if(_==="_COLOR_0"){const M=c[_];b.instanceColor=new Eu(M.array,M.itemSize,M.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&m.geometry.setAttribute(_,c[_]);Pt.prototype.copy.call(b,m),this.parser.assignFinalMaterial(b),f.push(b)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}}const hg="glTF",mo=12,ug={JSON:1313821514,BIN:5130562};class eI{constructor(e){this.name=ft.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,mo),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==hg)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-mo,r=new DataView(e,mo);let a=0;for(;a<s;){const o=r.getUint32(a,!0);a+=4;const c=r.getUint32(a,!0);if(a+=4,c===ug.JSON){const l=new Uint8Array(e,mo+a,o);this.content=n.decode(l)}else if(c===ug.BIN){const l=mo+a;this.body=e.slice(l,l+o)}a+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class tI{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ft.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},c={},l={};for(const h in a){const u=qu[h]||h.toLowerCase();o[u]=a[h]}for(const h in e.attributes){const u=qu[h]||h.toLowerCase();if(a[h]!==void 0){const d=n.accessors[e.attributes[h]],f=ua[d.componentType];l[u]=f.name,c[u]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(h){return new Promise(function(u,d){s.decodeDracoFile(h,function(f){for(const m in f.attributes){const g=f.attributes[m],A=c[m];A!==void 0&&(g.normalized=A)}u(f)},o,l,rn,d)})})}}class nI{constructor(){this.name=ft.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){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 iI{constructor(){this.name=ft.KHR_MESH_QUANTIZATION}}class dg extends uo{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let a=0;a!==s;a++)t[a]=n[r+a];return t}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=o*2,l=o*3,h=s-t,u=(n-t)/h,d=u*u,f=d*u,m=e*l,g=m-l,A=-2*f+3*d,p=f-d,y=1-A,b=p-d+u;for(let _=0;_!==o;_++){const M=a[g+_+o],w=a[g+_+c]*h,S=a[m+_+o],T=a[m+_]*h;r[_]=y*M+b*w+A*S+p*T}return r}}const sI=new Vn;class rI extends dg{interpolate_(e,t,n,s){const r=super.interpolate_(e,t,n,s);return sI.fromArray(r).normalize().toArray(r),r}}const $n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ua={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},fg={9728:In,9729:zt,9984:dp,9985:rc,9986:Qa,9987:Jn},pg={33071:ai,33648:sc,10497:Lr},Wu={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qu={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Ts={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},aI={CUBICSPLINE:void 0,LINEAR:Ja,STEP:ja},Ku={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function oI(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new ho({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Qi})),i.DefaultMaterial}function ar(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function $i(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function cI(i,e,t){let n=!1,s=!1,r=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(s=!0),u.COLOR_0!==void 0&&(r=!0),n&&s&&r)break}if(!n&&!s&&!r)return Promise.resolve(i);const a=[],o=[],c=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(n){const d=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;a.push(d)}if(s){const d=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;o.push(d)}if(r){const d=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;c.push(d)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(c)]).then(function(l){const h=l[0],u=l[1],d=l[2];return n&&(i.morphAttributes.position=h),s&&(i.morphAttributes.normal=u),r&&(i.morphAttributes.color=d),i.morphTargetsRelative=!0,i})}function lI(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function hI(i){let e;const t=i.extensions&&i.extensions[ft.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Xu(t.attributes):e=i.indices+":"+Xu(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,s=i.targets.length;n<s;n++)e+=":"+Xu(i.targets[n]);return e}function Xu(i){let e="";const t=Object.keys(i).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+i[t[n]]+";";return e}function Yu(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function uI(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const dI=new et;class fI{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new LS,this.associations=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,s=-1,r=!1,a=-1;if(typeof navigator<"u"){const o=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(o)===!0;const c=o.match(/Version\/(\d+)/);s=n&&c?parseInt(c[1],10):-1,r=o.indexOf("Firefox")>-1,a=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||r&&a<98?this.textureLoader=new ly(this.options.manager):this.textureLoader=new gy(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ms(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(a){const o={scene:a[0][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:n,userData:{}};return ar(r,o,s),$i(o,s),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(o)})).then(function(){for(const c of o.scenes)c.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){const a=t[s].joints;for(let o=0,c=a.length;o<c;o++)e[a[o]].isBone=!0}for(let s=0,r=e.length;s<r;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(n[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const s=n.clone(),r=(a,o)=>{const c=this.associations.get(a);c!=null&&this.associations.set(o,c);for(const[l,h]of a.children.entries())r(h,o.children[l])};return r(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const s=e(t[n]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let s=0;s<t.length;s++){const r=e(t[s]);r&&n.push(r)}return n}getDependency(e,t){const n=e+":"+t;let s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":s=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(r,a){return n.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ft.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(r,a){n.load(oa.resolveURL(t.uri,s.path),r,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const s=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+s)})}loadAccessor(e){const t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Wu[s.type],o=ua[s.componentType],c=s.normalized===!0,l=new o(s.count*a);return Promise.resolve(new En(l,a,c))}const r=[];return s.bufferView!==void 0?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),s.sparse!==void 0&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(a){const o=a[0],c=Wu[s.type],l=ua[s.componentType],h=l.BYTES_PER_ELEMENT,u=h*c,d=s.byteOffset||0,f=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,m=s.normalized===!0;let g,A;if(f&&f!==u){const p=Math.floor(d/f),y="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+p+":"+s.count;let b=t.cache.get(y);b||(g=new l(o,p*f,s.count*f/h),b=new O_(g,f/h),t.cache.add(y,b)),A=new gu(b,c,d%f/h,m)}else o===null?g=new l(s.count*c):g=new l(o,d,s.count*c),A=new En(g,c,m);if(s.sparse!==void 0){const p=Wu.SCALAR,y=ua[s.sparse.indices.componentType],b=s.sparse.indices.byteOffset||0,_=s.sparse.values.byteOffset||0,M=new y(a[1],b,s.sparse.count*p),w=new l(a[2],_,s.sparse.count*c);o!==null&&(A=new En(A.array.slice(),A.itemSize,A.normalized)),A.normalized=!1;for(let S=0,T=M.length;S<T;S++){const v=M[S];if(A.setX(v,w[S*c]),c>=2&&A.setY(v,w[S*c+1]),c>=3&&A.setZ(v,w[S*c+2]),c>=4&&A.setW(v,w[S*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}A.normalized=m}return A})}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,a=t.images[r];let o=this.textureLoader;if(a.uri){const c=n.manager.getHandler(a.uri);c!==null&&(o=c)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,n){const s=this,r=this.json,a=r.textures[e],o=r.images[t],c=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=a.name||o.name||"",h.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(h.name=o.uri);const d=(r.samplers||{})[a.sampler]||{};return h.magFilter=fg[d.magFilter]||zt,h.minFilter=fg[d.minFilter]||Jn,h.wrapS=pg[d.wrapS]||Lr,h.wrapT=pg[d.wrapT]||Lr,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==In&&h.minFilter!==zt,s.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const n=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const a=s.images[e],o=self.URL||self.webkitURL;let c=a.uri||"",l=!1;if(a.bufferView!==void 0)c=n.getDependency("bufferView",a.bufferView).then(function(u){l=!0;const d=new Blob([u],{type:a.mimeType});return c=o.createObjectURL(d),c});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(c).then(function(u){return new Promise(function(d,f){let m=d;t.isImageBitmapLoader===!0&&(m=function(g){const A=new an(g);A.needsUpdate=!0,d(A)}),t.load(oa.resolveURL(u,r.path),m,void 0,f)})}).then(function(u){return l===!0&&o.revokeObjectURL(c),$i(u,a),u.userData.mimeType=a.mimeType||uI(a.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,s){const r=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),r.extensions[ft.KHR_TEXTURE_TRANSFORM]){const o=n.extensions!==void 0?n.extensions[ft.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const c=r.associations.get(a);a=r.extensions[ft.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,c)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+n.uuid;let c=this.cache.get(o);c||(c=new vu,Ti.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(o,c)),n=c}else if(e.isLine){const o="LineBasicMaterial:"+n.uuid;let c=this.cache.get(o);c||(c=new co,Ti.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(o,c)),n=c}if(s||r||a){let o="ClonedMaterial:"+n.uuid+":";s&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let c=this.cache.get(o);c||(c=n.clone(),r&&(c.vertexColors=!0),a&&(c.flatShading=!0),s&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(o,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return ho}loadMaterial(e){const t=this,n=this.json,s=this.extensions,r=n.materials[e];let a;const o={},c=r.extensions||{},l=[];if(c[ft.KHR_MATERIALS_UNLIT]){const u=s[ft.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),l.push(u.extendParams(o,r,t))}else{const u=r.pbrMetallicRoughness||{};if(o.color=new qe(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const d=u.baseColorFactor;o.color.setRGB(d[0],d[1],d[2],rn),o.opacity=d[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(o,"map",u.baseColorTexture,Kt)),o.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,o.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),a=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,o)})))}r.doubleSided===!0&&(o.side=Si);const h=r.alphaMode||Ku.OPAQUE;if(h===Ku.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===Ku.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&a!==Cs&&(l.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new Ze(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;o.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&a!==Cs&&(l.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&a!==Cs){const u=r.emissiveFactor;o.emissive=new qe().setRGB(u[0],u[1],u[2],rn)}return r.emissiveTexture!==void 0&&a!==Cs&&l.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture,Kt)),Promise.all(l).then(function(){const u=new a(o);return r.name&&(u.name=r.name),$i(u,r),t.associations.set(u,{materials:e}),r.extensions&&ar(s,u,r),u})}createUniqueName(e){const t=Ct.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function r(o){return n[ft.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(c){return Ag(c,o,t)})}const a=[];for(let o=0,c=e.length;o<c;o++){const l=e[o],h=hI(l),u=s[h];if(u)a.push(u.promise);else{let d;l.extensions&&l.extensions[ft.KHR_DRACO_MESH_COMPRESSION]?d=r(l):d=Ag(new On,l,t),s[h]={primitive:l,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,s=this.extensions,r=n.meshes[e],a=r.primitives,o=[];for(let c=0,l=a.length;c<l;c++){const h=a[c].material===void 0?oI(this.cache):this.getDependency("material",a[c].material);o.push(h)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(c){const l=c.slice(0,c.length-1),h=c[c.length-1],u=[];for(let f=0,m=h.length;f<m;f++){const g=h[f],A=a[f];let p;const y=l[f];if(A.mode===$n.TRIANGLES||A.mode===$n.TRIANGLE_STRIP||A.mode===$n.TRIANGLE_FAN||A.mode===void 0)p=r.isSkinnedMesh===!0?new G_(g,y):new Jt(g,y),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),A.mode===$n.TRIANGLE_STRIP?p.geometry=lg(p.geometry,_p):A.mode===$n.TRIANGLE_FAN&&(p.geometry=lg(p.geometry,Wh));else if(A.mode===$n.LINES)p=new Hc(g,y);else if(A.mode===$n.LINE_STRIP)p=new Cu(g,y);else if(A.mode===$n.LINE_LOOP)p=new q_(g,y);else if(A.mode===$n.POINTS)p=new K_(g,y);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+A.mode);Object.keys(p.geometry.morphAttributes).length>0&&lI(p,r),p.name=t.createUniqueName(r.name||"mesh_"+e),$i(p,r),A.extensions&&ar(s,p,A),t.assignFinalMaterial(p),u.push(p)}for(let f=0,m=u.length;f<m;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return r.extensions&&ar(s,u[0],r),u[0];const d=new er;r.extensions&&ar(s,d,r),t.associations.set(d,{meshes:e});for(let f=0,m=u.length;f<m;f++)d.add(u[f]);return d})}loadCamera(e){let t;const n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new vn(Ip.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new Ru(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),$i(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let s=0,r=t.joints.length;s<r;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const r=s.pop(),a=s,o=[],c=[];for(let l=0,h=a.length;l<h;l++){const u=a[l];if(u){o.push(u);const d=new et;r!==null&&d.fromArray(r.array,l*16),c.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new xu(o,c)})}loadAnimation(e){const t=this.json,n=this,s=t.animations[e],r=s.name?s.name:"animation_"+e,a=[],o=[],c=[],l=[],h=[];for(let u=0,d=s.channels.length;u<d;u++){const f=s.channels[u],m=s.samplers[f.sampler],g=f.target,A=g.node,p=s.parameters!==void 0?s.parameters[m.input]:m.input,y=s.parameters!==void 0?s.parameters[m.output]:m.output;g.node!==void 0&&(a.push(this.getDependency("node",A)),o.push(this.getDependency("accessor",p)),c.push(this.getDependency("accessor",y)),l.push(m),h.push(g))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(u){const d=u[0],f=u[1],m=u[2],g=u[3],A=u[4],p=[];for(let y=0,b=d.length;y<b;y++){const _=d[y],M=f[y],w=m[y],S=g[y],T=A[y];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();const v=n._createAnimationTracks(_,M,w,S,T);if(v)for(let C=0;C<v.length;C++)p.push(v[C])}return new Iu(r,void 0,p)})}createNodeMesh(e){const t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(r){const a=n._getNodeRef(n.meshCache,s.mesh,r);return s.weights!==void 0&&a.traverse(function(o){if(o.isMesh)for(let c=0,l=s.weights.length;c<l;c++)o.morphTargetInfluences[c]=s.weights[c]}),a})}loadNode(e){const t=this.json,n=this,s=t.nodes[e],r=n._loadNodeShallow(e),a=[],o=s.children||[];for(let l=0,h=o.length;l<h;l++)a.push(n.getDependency("node",o[l]));const c=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([r,Promise.all(a),c]).then(function(l){const h=l[0],u=l[1],d=l[2];d!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(d,dI)});for(let f=0,m=u.length;f<m;f++)h.add(u[f]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const r=t.nodes[e],a=r.name?s.createUniqueName(r.name):"",o=[],c=s._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&o.push(c),r.camera!==void 0&&o.push(s.getDependency("camera",r.camera).then(function(l){return s._getNodeRef(s.cameraCache,r.camera,l)})),s._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){o.push(l)}),this.nodeCache[e]=Promise.all(o).then(function(l){let h;if(r.isBone===!0?h=new oA:l.length>1?h=new er:l.length===1?h=l[0]:h=new Pt,h!==l[0])for(let u=0,d=l.length;u<d;u++)h.add(l[u]);if(r.name&&(h.userData.name=r.name,h.name=a),$i(h,r),r.extensions&&ar(n,h,r),r.matrix!==void 0){const u=new et;u.fromArray(r.matrix),h.applyMatrix4(u)}else r.translation!==void 0&&h.position.fromArray(r.translation),r.rotation!==void 0&&h.quaternion.fromArray(r.rotation),r.scale!==void 0&&h.scale.fromArray(r.scale);return s.associations.has(h)||s.associations.set(h,{}),s.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,r=new er;n.name&&(r.name=s.createUniqueName(n.name)),$i(r,n),n.extensions&&ar(t,r,n);const a=n.nodes||[],o=[];for(let c=0,l=a.length;c<l;c++)o.push(s.getDependency("node",a[c]));return Promise.all(o).then(function(c){for(let h=0,u=c.length;h<u;h++)r.add(c[h]);const l=h=>{const u=new Map;for(const[d,f]of s.associations)(d instanceof Ti||d instanceof an)&&u.set(d,f);return h.traverse(d=>{const f=s.associations.get(d);f!=null&&u.set(d,f)}),u};return s.associations=l(r),r})}_createAnimationTracks(e,t,n,s,r){const a=[],o=e.name?e.name:e.uuid,c=[];Ts[r.path]===Ts.weights?e.traverse(function(d){d.morphTargetInfluences&&c.push(d.name?d.name:d.uuid)}):c.push(o);let l;switch(Ts[r.path]){case Ts.weights:l=ia;break;case Ts.rotation:l=sa;break;case Ts.translation:case Ts.scale:l=aa;break;default:n.itemSize===1?l=ia:l=aa;break}const h=s.interpolation!==void 0?aI[s.interpolation]:Ja,u=this._getArrayFromAccessor(n);for(let d=0,f=c.length;d<f;d++){const m=new l(c[d]+"."+Ts[r.path],t.array,u,h);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),a.push(m)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Yu(t.constructor),s=new Float32Array(t.length);for(let r=0,a=t.length;r<a;r++)s[r]=t[r]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const s=this instanceof sa?rI:dg;return new s(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function pI(i,e,t){const n=e.attributes,s=new Ii;if(n.POSITION!==void 0){const o=t.json.accessors[n.POSITION],c=o.min,l=o.max;if(c!==void 0&&l!==void 0){if(s.set(new H(c[0],c[1],c[2]),new H(l[0],l[1],l[2])),o.normalized){const h=Yu(ua[o.componentType]);s.min.multiplyScalar(h),s.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=e.targets;if(r!==void 0){const o=new H,c=new H;for(let l=0,h=r.length;l<h;l++){const u=r[l];if(u.POSITION!==void 0){const d=t.json.accessors[u.POSITION],f=d.min,m=d.max;if(f!==void 0&&m!==void 0){if(c.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),c.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),c.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),d.normalized){const g=Yu(ua[d.componentType]);c.multiplyScalar(g)}o.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(o)}i.boundingBox=s;const a=new Mi;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,i.boundingSphere=a}function Ag(i,e,t){const n=e.attributes,s=[];function r(a,o){return t.getDependency("accessor",a).then(function(c){i.setAttribute(o,c)})}for(const a in n){const o=qu[a]||a.toLowerCase();o in i.attributes||s.push(r(n[a],o))}if(e.indices!==void 0&&!i.index){const a=t.getDependency("accessor",e.indices).then(function(o){i.setIndex(o)});s.push(a)}return At.workingColorSpace!==rn&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${At.workingColorSpace}" not supported.`),$i(i,e),pI(i,e,t),Promise.all(s).then(function(){return e.targets!==void 0?cI(i,e.targets,t):i})}var AI=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkal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avcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?e:i,r,a=WebAssembly.instantiate(o(s),{}).then(function(p){r=p.instance,r.exports.__wasm_call_ctors()});function o(p){for(var y=new Uint8Array(p.length),b=0;b<p.length;++b){var _=p.charCodeAt(b);y[b]=_>96?_-97:_>64?_-39:_+4}for(var M=0,b=0;b<p.length;++b)y[M++]=y[b]<60?n[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,M)}function c(p,y,b,_,M,w){var S=r.exports.sbrk,T=b+3&-4,v=S(T*_),C=S(M.length),F=new Uint8Array(r.exports.memory.buffer);F.set(M,C);var K=p(v,b,_,C,M.length);if(K==0&&w&&w(v,T,_),y.set(F.subarray(v,v+b*_)),S(v-S(0)),K!=0)throw new Error("Malformed buffer data: "+K)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],d=0;function f(p){var y={object:new Worker(p),pending:0,requests:{}};return y.object.onmessage=function(b){var _=b.data;y.pending-=_.count,y.requests[_.id][_.action](_.value),delete y.requests[_.id]},y}function m(p){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+A.toString(),b=new Blob([y],{type:"text/javascript"}),_=URL.createObjectURL(b),M=0;M<p;++M)u[M]=f(_);URL.revokeObjectURL(_)}function g(p,y,b,_,M){for(var w=u[0],S=1;S<u.length;++S)u[S].pending<w.pending&&(w=u[S]);return new Promise(function(T,v){var C=new Uint8Array(b),F=d++;w.pending+=p,w.requests[F]={resolve:T,reject:v},w.object.postMessage({id:F,count:p,size:y,source:C,mode:_,filter:M},[C.buffer])})}function A(p){a.then(function(){var y=p.data;try{var b=new Uint8Array(y.count*y.size);c(r.exports[y.mode],b,y.count,y.size,y.source,r.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(_){self.postMessage({id:y.id,count:y.count,action:"reject",value:_})}})}return{ready:a,supported:!0,useWorkers:function(p){m(p)},decodeVertexBuffer:function(p,y,b,_,M){c(r.exports.meshopt_decodeVertexBuffer,p,y,b,_,r.exports[l[M]])},decodeIndexBuffer:function(p,y,b,_){c(r.exports.meshopt_decodeIndexBuffer,p,y,b,_)},decodeIndexSequence:function(p,y,b,_){c(r.exports.meshopt_decodeIndexSequence,p,y,b,_)},decodeGltfBuffer:function(p,y,b,_,M,w){c(r.exports[h[M]],p,y,b,_,r.exports[l[w]])},decodeGltfBufferAsync:function(p,y,b,_,M){return u.length>0?g(p,y,b,h[_],l[M]):a.then(function(){var w=new Uint8Array(p*y);return c(r.exports[h[_]],w,p,y,b,r.exports[l[M]]),w})}}})();const gg={type:"change"},ju={type:"start"},mg={type:"end"},el=new io,bg=new Is,gI=Math.cos(70*Ip.DEG2RAD),ln=new H,Qn=2*Math.PI,Bt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Ju=1e-6;class mI extends Ny{constructor(e,t=null){super(e,t),this.state=Bt.NONE,this.target=new H,this.cursor=new H,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=.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:Tr.ROTATE,MIDDLE:Tr.DOLLY,RIGHT:Tr.PAN},this.touches={ONE:Rr.ROTATE,TWO:Rr.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new H,this._lastQuaternion=new Vn,this._lastTargetPosition=new H,this._quat=new Vn().setFromUnitVectors(e.up,new H(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new TA,this._sphericalDelta=new TA,this._scale=1,this._panOffset=new H,this._rotateStart=new Ze,this._rotateEnd=new Ze,this._rotateDelta=new Ze,this._panStart=new Ze,this._panEnd=new Ze,this._panDelta=new Ze,this._dollyStart=new Ze,this._dollyEnd=new Ze,this._dollyDelta=new Ze,this._dollyDirection=new H,this._mouse=new Ze,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=xI.bind(this),this._onPointerDown=bI.bind(this),this._onPointerUp=EI.bind(this),this._onContextMenu=II.bind(this),this._onMouseWheel=wI.bind(this),this._onKeyDown=CI.bind(this),this._onTouchStart=vI.bind(this),this._onTouchMove=SI.bind(this),this._onMouseDown=_I.bind(this),this._onMouseMove=yI.bind(this),this._interceptControlDown=MI.bind(this),this._interceptControlUp=BI.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"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(gg),this.update(),this.state=Bt.NONE}update(e=null){const t=this.object.position;ln.copy(t).sub(this.target),ln.applyQuaternion(this._quat),this._spherical.setFromVector3(ln),this.autoRotate&&this.state===Bt.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(n)&&isFinite(s)&&(n<-Math.PI?n+=Qn:n>Math.PI&&(n-=Qn),s<-Math.PI?s+=Qn:s>Math.PI&&(s-=Qn),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(ln.setFromSpherical(this._spherical),ln.applyQuaternion(this._quatInverse),t.copy(this.target).add(ln),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=ln.length();a=this._clampDistance(o*this._scale);const c=o-a;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),r=!!c}else if(this.object.isOrthographicCamera){const o=new H(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=c!==this.object.zoom;const l=new H(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=ln.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(el.origin.copy(this.object.position),el.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(el.direction))<gI?this.object.lookAt(this.target):(bg.setFromNormalAndCoplanarPoint(this.object.up,this.target),el.intersectPlane(bg,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>Ju||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ju||this._lastTargetPosition.distanceToSquared(this.target)>Ju?(this.dispatchEvent(gg),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?Qn/60*this.autoRotateSpeed*e:Qn/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){ln.setFromMatrixColumn(t,0),ln.multiplyScalar(-e),this._panOffset.add(ln)}_panUp(e,t){this.screenSpacePanning===!0?ln.setFromMatrixColumn(t,1):(ln.setFromMatrixColumn(t,0),ln.crossVectors(this.object.up,ln)),ln.multiplyScalar(e),this._panOffset.add(ln)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;ln.copy(s).sub(this.target);let r=ln.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*r/n.clientHeight,this.object.matrix),this._panUp(2*t*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),s=e-n.left,r=t-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Qn*this._rotateDelta.x/t.clientHeight),this._rotateUp(Qn*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._panStart.set(n,s)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,s=e.pageY-t.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),s=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Qn*this._rotateDelta.x/t.clientHeight),this._rotateUp(Qn*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,s=e.pageY-t.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Ze,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function bI(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function xI(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function EI(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(mg),this.state=Bt.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function _I(i){let e;switch(i.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case Tr.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=Bt.DOLLY;break;case Tr.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Bt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Bt.ROTATE}break;case Tr.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Bt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Bt.PAN}break;default:this.state=Bt.NONE}this.state!==Bt.NONE&&this.dispatchEvent(ju)}function yI(i){switch(this.state){case Bt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case Bt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case Bt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function wI(i){this.enabled===!1||this.enableZoom===!1||this.state!==Bt.NONE||(i.preventDefault(),this.dispatchEvent(ju),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(mg))}function CI(i){this.enabled!==!1&&this._handleKeyDown(i)}function vI(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case Rr.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=Bt.TOUCH_ROTATE;break;case Rr.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=Bt.TOUCH_PAN;break;default:this.state=Bt.NONE}break;case 2:switch(this.touches.TWO){case Rr.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=Bt.TOUCH_DOLLY_PAN;break;case Rr.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=Bt.TOUCH_DOLLY_ROTATE;break;default:this.state=Bt.NONE}break;default:this.state=Bt.NONE}this.state!==Bt.NONE&&this.dispatchEvent(ju)}function SI(i){switch(this._trackPointer(i),this.state){case Bt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case Bt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case Bt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case Bt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=Bt.NONE}}function II(i){this.enabled!==!1&&i.preventDefault()}function MI(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function BI(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class TI extends Au{constructor(){super();const e=new Jr;e.deleteAttribute("uv");const t=new ho({side:Sn}),n=new ho,s=new IA(16777215,900,28,2);s.position.set(.418,16.199,.3),this.add(s);const r=new Jt(e,t);r.position.set(-.757,13.219,.717),r.scale.set(31.713,28.305,28.591),this.add(r);const a=new uA(e,n,6),o=new Pt;o.position.set(-10.906,2.009,1.846),o.rotation.set(0,-.195,0),o.scale.set(2.328,7.905,4.651),o.updateMatrix(),a.setMatrixAt(0,o.matrix),o.position.set(-5.607,-.754,-.758),o.rotation.set(0,.994,0),o.scale.set(1.97,1.534,3.955),o.updateMatrix(),a.setMatrixAt(1,o.matrix),o.position.set(6.167,.857,7.803),o.rotation.set(0,.561,0),o.scale.set(3.927,6.285,3.687),o.updateMatrix(),a.setMatrixAt(2,o.matrix),o.position.set(-2.017,.018,6.124),o.rotation.set(0,.333,0),o.scale.set(2.002,4.566,2.064),o.updateMatrix(),a.setMatrixAt(3,o.matrix),o.position.set(2.291,-.756,-2.621),o.rotation.set(0,-.286,0),o.scale.set(1.546,1.552,1.496),o.updateMatrix(),a.setMatrixAt(4,o.matrix),o.position.set(-2.193,-.369,-5.547),o.rotation.set(0,.516,0),o.scale.set(3.875,3.487,2.986),o.updateMatrix(),a.setMatrixAt(5,o.matrix),this.add(a);const c=new Jt(e,da(50));c.position.set(-16.116,14.37,8.208),c.scale.set(.1,2.428,2.739),this.add(c);const l=new Jt(e,da(50));l.position.set(-16.109,18.021,-8.207),l.scale.set(.1,2.425,2.751),this.add(l);const h=new Jt(e,da(17));h.position.set(14.904,12.198,-1.832),h.scale.set(.15,4.265,6.331),this.add(h);const u=new Jt(e,da(43));u.position.set(-.462,8.89,14.52),u.scale.set(4.38,5.441,.088),this.add(u);const d=new Jt(e,da(20));d.position.set(3.235,11.486,-12.541),d.scale.set(2.5,2,.1),this.add(d);const f=new Jt(e,da(100));f.position.set(0,20,0),f.scale.set(1,.1,1),this.add(f)}dispose(){const e=new Set;this.traverse(t=>{t.isMesh&&(e.add(t.geometry),e.add(t.material))});for(const t of e)t.dispose()}}function da(i){const e=new Cs;return e.color.setScalar(i),e}function RI(i){if(!(typeof window>"u")){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=i,document.head.appendChild(e),i}}function fa(i,e){var t=i.__state.conversionName.toString(),n=Math.round(i.r),s=Math.round(i.g),r=Math.round(i.b),a=i.a,o=Math.round(i.h),c=i.s.toFixed(1),l=i.v.toFixed(1);if(e||t==="THREE_CHAR_HEX"||t==="SIX_CHAR_HEX"){for(var h=i.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}else{if(t==="CSS_RGB")return"rgb("+n+","+s+","+r+")";if(t==="CSS_RGBA")return"rgba("+n+","+s+","+r+","+a+")";if(t==="HEX")return"0x"+i.hex.toString(16);if(t==="RGB_ARRAY")return"["+n+","+s+","+r+"]";if(t==="RGBA_ARRAY")return"["+n+","+s+","+r+","+a+"]";if(t==="RGB_OBJ")return"{r:"+n+",g:"+s+",b:"+r+"}";if(t==="RGBA_OBJ")return"{r:"+n+",g:"+s+",b:"+r+",a:"+a+"}";if(t==="HSV_OBJ")return"{h:"+o+",s:"+c+",v:"+l+"}";if(t==="HSVA_OBJ")return"{h:"+o+",s:"+c+",v:"+l+",a:"+a+"}"}return"unknown format"}var xg=Array.prototype.forEach,bo=Array.prototype.slice,ue={BREAK:{},extend:function(e){return this.each(bo.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach((function(s){this.isUndefined(t[s])||(e[s]=t[s])}).bind(this))},this),e},defaults:function(e){return this.each(bo.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach((function(s){this.isUndefined(e[s])&&(e[s]=t[s])}).bind(this))},this),e},compose:function(){var e=bo.call(arguments);return function(){for(var t=bo.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e){if(xg&&e.forEach&&e.forEach===xg)e.forEach(t,n);else if(e.length===e.length+0){var s=void 0,r=void 0;for(s=0,r=e.length;s<r;s++)if(s in e&&t.call(n,e[s],s)===this.BREAK)return}else for(var a in e)if(t.call(n,e[a],a)===this.BREAK)return}},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var s=void 0;return function(){var r=this,a=arguments;function o(){s=null,n||e.apply(r,a)}var c=n||!s;clearTimeout(s),s=setTimeout(o,t),c&&e.apply(r,a)}},toArray:function(e){return e.toArray?e.toArray():bo.call(e)},isUndefined:function(e){return e===void 0},isNull:function(e){return e===null},isNaN:(function(i){function e(t){return i.apply(this,arguments)}return e.toString=function(){return i.toString()},e})(function(i){return isNaN(i)}),isArray:Array.isArray||function(i){return i.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return e===!1||e===!0},isFunction:function(e){return e instanceof Function}},NI=[{litmus:ue.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return t===null?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:fa},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return t===null?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:fa},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return t===null?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:fa},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return t===null?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:fa}}},{litmus:ue.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:ue.isArray,conversions:{RGB_ARRAY:{read:function(e){return e.length!==3?!1:{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return e.length!==4?!1:{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:ue.isObject,conversions:{RGBA_OBJ:{read:function(e){return ue.isNumber(e.r)&&ue.isNumber(e.g)&&ue.isNumber(e.b)&&ue.isNumber(e.a)?{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return ue.isNumber(e.r)&&ue.isNumber(e.g)&&ue.isNumber(e.b)?{space:"RGB",r:e.r,g:e.g,b:e.b}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return ue.isNumber(e.h)&&ue.isNumber(e.s)&&ue.isNumber(e.v)&&ue.isNumber(e.a)?{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return ue.isNumber(e.h)&&ue.isNumber(e.s)&&ue.isNumber(e.v)?{space:"HSV",h:e.h,s:e.s,v:e.v}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],xo=void 0,tl=void 0,Zu=function(){tl=!1;var e=arguments.length>1?ue.toArray(arguments):arguments[0];return ue.each(NI,function(t){if(t.litmus(e))return ue.each(t.conversions,function(n,s){if(xo=n.read(e),tl===!1&&xo!==!1)return tl=xo,xo.conversionName=s,xo.conversion=n,ue.BREAK}),ue.BREAK}),tl},Eg=void 0,nl={hsv_to_rgb:function(e,t,n){var s=Math.floor(e/60)%6,r=e/60-Math.floor(e/60),a=n*(1-t),o=n*(1-r*t),c=n*(1-(1-r)*t),l=[[n,c,a],[o,n,a],[a,n,c],[a,o,n],[c,a,n],[n,a,o]][s];return{r:l[0]*255,g:l[1]*255,b:l[2]*255}},rgb_to_hsv:function(e,t,n){var s=Math.min(e,t,n),r=Math.max(e,t,n),a=r-s,o=void 0,c=void 0;if(r!==0)c=a/r;else return{h:NaN,s:0,v:0};return e===r?o=(t-n)/a:t===r?o=2+(n-e)/a:o=4+(e-t)/a,o/=6,o<0&&(o+=1),{h:o*360,s:c,v:r/255}},rgb_to_hex:function(e,t,n){var s=this.hex_with_component(0,2,e);return s=this.hex_with_component(s,1,t),s=this.hex_with_component(s,0,n),s},component_from_hex:function(e,t){return e>>t*8&255},hex_with_component:function(e,t,n){return n<<(Eg=t*8)|e&~(255<<Eg)}},FI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Ai=function(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")},gi=(function(){function i(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),Rs=function i(e,t,n){e===null&&(e=Function.prototype);var s=Object.getOwnPropertyDescriptor(e,t);if(s===void 0){var r=Object.getPrototypeOf(e);return r===null?void 0:i(r,t,n)}else{if("value"in s)return s.value;var a=s.get;return a===void 0?void 0:a.call(n)}},Ns=function(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)},Fs=function(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i},pn=(function(){function i(){if(Ai(this,i),this.__state=Zu.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return gi(i,[{key:"toString",value:function(){return fa(this)}},{key:"toHexString",value:function(){return fa(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),i})();function $u(i,e,t){Object.defineProperty(i,e,{get:function(){return this.__state.space==="RGB"?this.__state[e]:(pn.recalculateRGB(this,e,t),this.__state[e])},set:function(s){this.__state.space!=="RGB"&&(pn.recalculateRGB(this,e,t),this.__state.space="RGB"),this.__state[e]=s}})}function ed(i,e){Object.defineProperty(i,e,{get:function(){return this.__state.space==="HSV"?this.__state[e]:(pn.recalculateHSV(this),this.__state[e])},set:function(n){this.__state.space!=="HSV"&&(pn.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=n}})}pn.recalculateRGB=function(i,e,t){if(i.__state.space==="HEX")i.__state[e]=nl.component_from_hex(i.__state.hex,t);else if(i.__state.space==="HSV")ue.extend(i.__state,nl.hsv_to_rgb(i.__state.h,i.__state.s,i.__state.v));else throw new Error("Corrupted color state")},pn.recalculateHSV=function(i){var e=nl.rgb_to_hsv(i.r,i.g,i.b);ue.extend(i.__state,{s:e.s,v:e.v}),ue.isNaN(e.h)?ue.isUndefined(i.__state.h)&&(i.__state.h=0):i.__state.h=e.h},pn.COMPONENTS=["r","g","b","h","s","v","hex","a"],$u(pn.prototype,"r",2),$u(pn.prototype,"g",1),$u(pn.prototype,"b",0),ed(pn.prototype,"h"),ed(pn.prototype,"s"),ed(pn.prototype,"v"),Object.defineProperty(pn.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(pn.prototype,"hex",{get:function(){return this.__state.space!=="HEX"&&(this.__state.hex=nl.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}});var or=(function(){function i(e,t){Ai(this,i),this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0}return gi(i,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),i})(),DI={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},_g={};ue.each(DI,function(i,e){ue.each(i,function(t){_g[t]=e})});var LI=/(\d+(\.\d+)?)px/;function Fi(i){if(i==="0"||ue.isUndefined(i))return 0;var e=i.match(LI);return ue.isNull(e)?0:parseFloat(e[1])}var te={makeSelectable:function(e,t){e===void 0||e.style===void 0||(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){var s=n,r=t;ue.isUndefined(r)&&(r=!0),ue.isUndefined(s)&&(s=!0),e.style.position="absolute",r&&(e.style.left=0,e.style.right=0),s&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,s){var r=n||{},a=_g[t];if(!a)throw new Error("Event type "+t+" not supported.");var o=document.createEvent(a);switch(a){case"MouseEvents":{var c=r.x||r.clientX||0,l=r.y||r.clientY||0;o.initMouseEvent(t,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,c,l,!1,!1,!1,!1,0,null);break}case"KeyboardEvents":{var h=o.initKeyboardEvent||o.initKeyEvent;ue.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),h(t,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break}default:{o.initEvent(t,r.bubbles||!1,r.cancelable||!0);break}}ue.defaults(o,s),e.dispatchEvent(o)},bind:function(e,t,n,s){var r=s||!1;return e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on"+t,n),te},unbind:function(e,t,n,s){var r=s||!1;return e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on"+t,n),te},addClass:function(e,t){if(e.className===void 0)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);n.indexOf(t)===-1&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return te},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),s=n.indexOf(t);s!==-1&&(n.splice(s,1),e.className=n.join(" "))}else e.className=void 0;return te},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return Fi(t["border-left-width"])+Fi(t["border-right-width"])+Fi(t["padding-left"])+Fi(t["padding-right"])+Fi(t.width)},getHeight:function(e){var t=getComputedStyle(e);return Fi(t["border-top-width"])+Fi(t["border-bottom-width"])+Fi(t["padding-top"])+Fi(t["padding-bottom"])+Fi(t.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)do n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;while(t);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},yg=(function(i){Ns(e,i);function e(t,n){Ai(this,e);var s=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=s;s.__prev=s.getValue(),s.__checkbox=document.createElement("input"),s.__checkbox.setAttribute("type","checkbox");function a(){r.setValue(!r.__prev)}return te.bind(s.__checkbox,"change",a,!1),s.domElement.appendChild(s.__checkbox),s.updateDisplay(),s}return gi(e,[{key:"setValue",value:function(n){var s=Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),s}},{key:"updateDisplay",value:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(or),PI=(function(i){Ns(e,i);function e(t,n,s){Ai(this,e);var r=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),a=s,o=r;if(r.__select=document.createElement("select"),ue.isArray(a)){var c={};ue.each(a,function(l){c[l]=l}),a=c}return ue.each(a,function(l,h){var u=document.createElement("option");u.innerHTML=h,u.setAttribute("value",l),o.__select.appendChild(u)}),r.updateDisplay(),te.bind(r.__select,"change",function(){var l=this.options[this.selectedIndex].value;o.setValue(l)}),r.domElement.appendChild(r.__select),r}return gi(e,[{key:"setValue",value:function(n){var s=Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),s}},{key:"updateDisplay",value:function(){return te.isActive(this.__select)?this:(this.__select.value=this.getValue(),Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e})(or),kI=(function(i){Ns(e,i);function e(t,n){Ai(this,e);var s=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=s;function a(){r.setValue(r.__input.value)}function o(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}return s.__input=document.createElement("input"),s.__input.setAttribute("type","text"),te.bind(s.__input,"keyup",a),te.bind(s.__input,"change",a),te.bind(s.__input,"blur",o),te.bind(s.__input,"keydown",function(c){c.keyCode===13&&this.blur()}),s.updateDisplay(),s.domElement.appendChild(s.__input),s}return gi(e,[{key:"updateDisplay",value:function(){return te.isActive(this.__input)||(this.__input.value=this.getValue()),Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(or);function wg(i){var e=i.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var Cg=(function(i){Ns(e,i);function e(t,n,s){Ai(this,e);var r=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),a=s||{};return r.__min=a.min,r.__max=a.max,r.__step=a.step,ue.isUndefined(r.__step)?r.initialValue===0?r.__impliedStep=1:r.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(r.initialValue))/Math.LN10))/10:r.__impliedStep=r.__step,r.__precision=wg(r.__impliedStep),r}return gi(e,[{key:"setValue",value:function(n){var s=n;return this.__min!==void 0&&s<this.__min?s=this.__min:this.__max!==void 0&&s>this.__max&&(s=this.__max),this.__step!==void 0&&s%this.__step!==0&&(s=Math.round(s/this.__step)*this.__step),Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,s)}},{key:"min",value:function(n){return this.__min=n,this}},{key:"max",value:function(n){return this.__max=n,this}},{key:"step",value:function(n){return this.__step=n,this.__impliedStep=n,this.__precision=wg(n),this}}]),e})(or);function UI(i,e){var t=Math.pow(10,e);return Math.round(i*t)/t}var il=(function(i){Ns(e,i);function e(t,n,s){Ai(this,e);var r=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,s));r.__truncationSuspended=!1;var a=r,o=void 0;function c(){var m=parseFloat(a.__input.value);ue.isNaN(m)||a.setValue(m)}function l(){a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}function h(){l()}function u(m){var g=o-m.clientY;a.setValue(a.getValue()+g*a.__impliedStep),o=m.clientY}function d(){te.unbind(window,"mousemove",u),te.unbind(window,"mouseup",d),l()}function f(m){te.bind(window,"mousemove",u),te.bind(window,"mouseup",d),o=m.clientY}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),te.bind(r.__input,"change",c),te.bind(r.__input,"blur",h),te.bind(r.__input,"mousedown",f),te.bind(r.__input,"keydown",function(m){m.keyCode===13&&(a.__truncationSuspended=!0,this.blur(),a.__truncationSuspended=!1,l())}),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return gi(e,[{key:"updateDisplay",value:function(){return this.__input.value=this.__truncationSuspended?this.getValue():UI(this.getValue(),this.__precision),Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(Cg);function vg(i,e,t,n,s){return n+(s-n)*((i-e)/(t-e))}var td=(function(i){Ns(e,i);function e(t,n,s,r,a){Ai(this,e);var o=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:s,max:r,step:a})),c=o;o.__background=document.createElement("div"),o.__foreground=document.createElement("div"),te.bind(o.__background,"mousedown",l),te.bind(o.__background,"touchstart",d),te.addClass(o.__background,"slider"),te.addClass(o.__foreground,"slider-fg");function l(g){document.activeElement.blur(),te.bind(window,"mousemove",h),te.bind(window,"mouseup",u),h(g)}function h(g){g.preventDefault();var A=c.__background.getBoundingClientRect();return c.setValue(vg(g.clientX,A.left,A.right,c.__min,c.__max)),!1}function u(){te.unbind(window,"mousemove",h),te.unbind(window,"mouseup",u),c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}function d(g){g.touches.length===1&&(te.bind(window,"touchmove",f),te.bind(window,"touchend",m),f(g))}function f(g){var A=g.touches[0].clientX,p=c.__background.getBoundingClientRect();c.setValue(vg(A,p.left,p.right,c.__min,c.__max))}function m(){te.unbind(window,"touchmove",f),te.unbind(window,"touchend",m),c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}return o.updateDisplay(),o.__background.appendChild(o.__foreground),o.domElement.appendChild(o.__background),o}return gi(e,[{key:"updateDisplay",value:function(){var n=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=n*100+"%",Rs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(Cg),Sg=(function(i){Ns(e,i);function e(t,n,s){Ai(this,e);var r=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),a=r;return r.__button=document.createElement("div"),r.__button.innerHTML=s===void 0?"Fire":s,te.bind(r.__button,"click",function(o){return o.preventDefault(),a.fire(),!1}),te.addClass(r.__button,"button"),r.domElement.appendChild(r.__button),r}return gi(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e})(or),nd=(function(i){Ns(e,i);function e(t,n){Ai(this,e);var s=Fs(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));s.__color=new pn(s.getValue()),s.__temp=new pn(0);var r=s;s.domElement=document.createElement("div"),te.makeSelectable(s.domElement,!1),s.__selector=document.createElement("div"),s.__selector.className="selector",s.__saturation_field=document.createElement("div"),s.__saturation_field.className="saturation-field",s.__field_knob=document.createElement("div"),s.__field_knob.className="field-knob",s.__field_knob_border="2px solid ",s.__hue_knob=document.createElement("div"),s.__hue_knob.className="hue-knob",s.__hue_field=document.createElement("div"),s.__hue_field.className="hue-field",s.__input=document.createElement("input"),s.__input.type="text",s.__input_textShadow="0 1px 1px ",te.bind(s.__input,"keydown",function(g){g.keyCode===13&&u.call(this)}),te.bind(s.__input,"blur",u),te.bind(s.__selector,"mousedown",function(){te.addClass(this,"drag").bind(window,"mouseup",function(){te.removeClass(r.__selector,"drag")})}),te.bind(s.__selector,"touchstart",function(){te.addClass(this,"drag").bind(window,"touchend",function(){te.removeClass(r.__selector,"drag")})});var a=document.createElement("div");ue.extend(s.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),ue.extend(s.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:s.__field_knob_border+(s.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),ue.extend(s.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),ue.extend(s.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),ue.extend(a.style,{width:"100%",height:"100%",background:"none"}),Ig(a,"top","rgba(0,0,0,0)","#000"),ue.extend(s.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),QI(s.__hue_field),ue.extend(s.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:s.__input_textShadow+"rgba(0,0,0,0.7)"}),te.bind(s.__saturation_field,"mousedown",o),te.bind(s.__saturation_field,"touchstart",o),te.bind(s.__field_knob,"mousedown",o),te.bind(s.__field_knob,"touchstart",o),te.bind(s.__hue_field,"mousedown",c),te.bind(s.__hue_field,"touchstart",c);function o(g){f(g),te.bind(window,"mousemove",f),te.bind(window,"touchmove",f),te.bind(window,"mouseup",l),te.bind(window,"touchend",l)}function c(g){m(g),te.bind(window,"mousemove",m),te.bind(window,"touchmove",m),te.bind(window,"mouseup",h),te.bind(window,"touchend",h)}function l(){te.unbind(window,"mousemove",f),te.unbind(window,"touchmove",f),te.unbind(window,"mouseup",l),te.unbind(window,"touchend",l),d()}function h(){te.unbind(window,"mousemove",m),te.unbind(window,"touchmove",m),te.unbind(window,"mouseup",h),te.unbind(window,"touchend",h),d()}function u(){var g=Zu(this.value);g!==!1?(r.__color.__state=g,r.setValue(r.__color.toOriginal())):this.value=r.__color.toString()}function d(){r.__onFinishChange&&r.__onFinishChange.call(r,r.__color.toOriginal())}s.__saturation_field.appendChild(a),s.__selector.appendChild(s.__field_knob),s.__selector.appendChild(s.__saturation_field),s.__selector.appendChild(s.__hue_field),s.__hue_field.appendChild(s.__hue_knob),s.domElement.appendChild(s.__input),s.domElement.appendChild(s.__selector),s.updateDisplay();function f(g){g.type.indexOf("touch")===-1&&g.preventDefault();var A=r.__saturation_field.getBoundingClientRect(),p=g.touches&&g.touches[0]||g,y=p.clientX,b=p.clientY,_=(y-A.left)/(A.right-A.left),M=1-(b-A.top)/(A.bottom-A.top);return M>1?M=1:M<0&&(M=0),_>1?_=1:_<0&&(_=0),r.__color.v=M,r.__color.s=_,r.setValue(r.__color.toOriginal()),!1}function m(g){g.type.indexOf("touch")===-1&&g.preventDefault();var A=r.__hue_field.getBoundingClientRect(),p=g.touches&&g.touches[0]||g,y=p.clientY,b=1-(y-A.top)/(A.bottom-A.top);return b>1?b=1:b<0&&(b=0),r.__color.h=b*360,r.setValue(r.__color.toOriginal()),!1}return s}return gi(e,[{key:"updateDisplay",value:function(){var n=Zu(this.getValue());if(n!==!1){var s=!1;ue.each(pn.COMPONENTS,function(o){if(!ue.isUndefined(n[o])&&!ue.isUndefined(this.__color.__state[o])&&n[o]!==this.__color.__state[o])return s=!0,{}},this),s&&ue.extend(this.__color.__state,n)}ue.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,a=255-r;ue.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px",this.__temp.s=1,this.__temp.v=1,Ig(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),ue.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+a+","+a+","+a+",.7)"})}}]),e})(or),OI=["-moz-","-o-","-webkit-","-ms-",""];function Ig(i,e,t,n){i.style.background="",ue.each(OI,function(s){i.style.cssText+="background: "+s+"linear-gradient("+e+", "+t+" 0%, "+n+" 100%); "})}function QI(i){i.style.background="",i.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",i.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var GI={load:function(e,t){var n=t||document,s=n.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=e,n.getElementsByTagName("head")[0].appendChild(s)},inject:function(e,t){var n=t||document,s=document.createElement("style");s.type="text/css",s.innerHTML=e;var r=n.getElementsByTagName("head")[0];try{r.appendChild(s)}catch{}}},HI=`<div id="dg-save" class="dg dialogue">+}`;class US{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const s=new an,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Ss({vertexShader:PS,fragmentShader:kS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Jt(new Jc(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class OS extends xs{constructor(e,t){super();const n=this;let s=null,r=1,a=null,o="local-floor",c=1,l=null,h=null,u=null,d=null,f=null,m=null;const g=new US,A=t.getContextAttributes();let p=null,y=null;const b=[],_=[],M=new Ze;let w=null;const S=new Cn;S.viewport=new _t;const T=new Cn;T.viewport=new _t;const C=[S,T],v=new Cy;let F=null,K=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let me=b[se];return me===void 0&&(me=new Eu,b[se]=me),me.getTargetRaySpace()},this.getControllerGrip=function(se){let me=b[se];return me===void 0&&(me=new Eu,b[se]=me),me.getGripSpace()},this.getHand=function(se){let me=b[se];return me===void 0&&(me=new Eu,b[se]=me),me.getHandSpace()};function q(se){const me=_.indexOf(se.inputSource);if(me===-1)return;const be=b[me];be!==void 0&&(be.update(se.inputSource,se.frame,l||a),be.dispatchEvent({type:se.type,data:se.inputSource}))}function $(){s.removeEventListener("select",q),s.removeEventListener("selectstart",q),s.removeEventListener("selectend",q),s.removeEventListener("squeeze",q),s.removeEventListener("squeezestart",q),s.removeEventListener("squeezeend",q),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",D);for(let se=0;se<b.length;se++){const me=_[se];me!==null&&(_[se]=null,b[se].disconnect(me))}F=null,K=null,g.reset(),e.setRenderTarget(p),f=null,d=null,u=null,s=null,y=null,Me.stop(),n.isPresenting=!1,e.setPixelRatio(w),e.setSize(M.width,M.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(se){r=se,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(se){o=se,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(se){l=se},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return s},this.setSession=async function(se){if(s=se,s!==null){if(p=e.getRenderTarget(),s.addEventListener("select",q),s.addEventListener("selectstart",q),s.addEventListener("selectend",q),s.addEventListener("squeeze",q),s.addEventListener("squeezestart",q),s.addEventListener("squeezeend",q),s.addEventListener("end",$),s.addEventListener("inputsourceschange",D),A.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(M),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let be=null,xe=null,Pe=null;A.depth&&(Pe=A.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,be=A.stencil?ja:Ka,xe=A.stencil?qa:Ys);const $e={colorFormat:t.RGBA8,depthFormat:Pe,scaleFactor:r};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer($e),s.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new Zs(d.textureWidth,d.textureHeight,{format:sn,type:tn,depthTexture:new vA(d.textureWidth,d.textureHeight,xe,void 0,void 0,void 0,void 0,void 0,void 0,be),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const be={antialias:A.antialias,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(s,t,be),s.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new Zs(f.framebufferWidth,f.framebufferHeight,{format:sn,type:tn,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(c),l=null,a=await s.requestReferenceSpace(o),Me.setContext(s),Me.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function D(se){for(let me=0;me<se.removed.length;me++){const be=se.removed[me],xe=_.indexOf(be);xe>=0&&(_[xe]=null,b[xe].disconnect(be))}for(let me=0;me<se.added.length;me++){const be=se.added[me];let xe=_.indexOf(be);if(xe===-1){for(let $e=0;$e<b.length;$e++)if($e>=_.length){_.push(be),xe=$e;break}else if(_[$e]===null){_[$e]=be,xe=$e;break}if(xe===-1)break}const Pe=b[xe];Pe&&Pe.connect(be)}}const O=new H,Y=new H;function Q(se,me,be){O.setFromMatrixPosition(me.matrixWorld),Y.setFromMatrixPosition(be.matrixWorld);const xe=O.distanceTo(Y),Pe=me.projectionMatrix.elements,$e=be.projectionMatrix.elements,Qe=Pe[14]/(Pe[10]-1),St=Pe[14]/(Pe[10]+1),ut=(Pe[9]+1)/Pe[5],Je=(Pe[9]-1)/Pe[5],G=(Pe[8]-1)/Pe[0],mn=($e[8]+1)/$e[0],dt=Qe*G,pt=Qe*mn,ze=xe/(-G+mn),Rt=ze*-G;if(me.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(Rt),se.translateZ(ze),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),Pe[10]===-1)se.projectionMatrix.copy(me.projectionMatrix),se.projectionMatrixInverse.copy(me.projectionMatrixInverse);else{const Ge=Qe+ze,L=St+ze,I=dt-Rt,Z=pt+(xe-Rt),le=ut*St/L*Ge,Ae=Je*St/L*Ge;se.projectionMatrix.makePerspective(I,Z,le,Ae,Ge,L),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function J(se,me){me===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(me.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(s===null)return;let me=se.near,be=se.far;g.texture!==null&&(g.depthNear>0&&(me=g.depthNear),g.depthFar>0&&(be=g.depthFar)),v.near=T.near=S.near=me,v.far=T.far=S.far=be,(F!==v.near||K!==v.far)&&(s.updateRenderState({depthNear:v.near,depthFar:v.far}),F=v.near,K=v.far),S.layers.mask=se.layers.mask|2,T.layers.mask=se.layers.mask|4,v.layers.mask=S.layers.mask|T.layers.mask;const xe=se.parent,Pe=v.cameras;J(v,xe);for(let $e=0;$e<Pe.length;$e++)J(Pe[$e],xe);Pe.length===2?Q(v,S,T):v.projectionMatrix.copy(S.projectionMatrix),ee(se,v,xe)};function ee(se,me,be){be===null?se.matrix.copy(me.matrixWorld):(se.matrix.copy(be.matrixWorld),se.matrix.invert(),se.matrix.multiply(me.matrixWorld)),se.matrix.decompose(se.position,se.quaternion,se.scale),se.updateMatrixWorld(!0),se.projectionMatrix.copy(me.projectionMatrix),se.projectionMatrixInverse.copy(me.projectionMatrixInverse),se.isPerspectiveCamera&&(se.fov=Gr*2*Math.atan(1/se.projectionMatrix.elements[5]),se.zoom=1)}this.getCamera=function(){return v},this.getFoveation=function(){if(!(d===null&&f===null))return c},this.setFoveation=function(se){c=se,d!==null&&(d.fixedFoveation=se),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=se)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(v)};let ae=null;function ye(se,me){if(h=me.getViewerPose(l||a),m=me,h!==null){const be=h.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let xe=!1;be.length!==v.cameras.length&&(v.cameras.length=0,xe=!0);for(let Qe=0;Qe<be.length;Qe++){const St=be[Qe];let ut=null;if(f!==null)ut=f.getViewport(St);else{const G=u.getViewSubImage(d,St);ut=G.viewport,Qe===0&&(e.setRenderTargetTextures(y,G.colorTexture,G.depthStencilTexture),e.setRenderTarget(y))}let Je=C[Qe];Je===void 0&&(Je=new Cn,Je.layers.enable(Qe),Je.viewport=new _t,C[Qe]=Je),Je.matrix.fromArray(St.transform.matrix),Je.matrix.decompose(Je.position,Je.quaternion,Je.scale),Je.projectionMatrix.fromArray(St.projectionMatrix),Je.projectionMatrixInverse.copy(Je.projectionMatrix).invert(),Je.viewport.set(ut.x,ut.y,ut.width,ut.height),Qe===0&&(v.matrix.copy(Je.matrix),v.matrix.decompose(v.position,v.quaternion,v.scale)),xe===!0&&v.cameras.push(Je)}const Pe=s.enabledFeatures;if(Pe&&Pe.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&u){const Qe=u.getDepthInformation(be[0]);Qe&&Qe.isValid&&Qe.texture&&g.init(e,Qe,s.renderState)}}for(let be=0;be<b.length;be++){const xe=_[be],Pe=b[be];xe!==null&&Pe!==void 0&&Pe.update(xe,me,l||a)}ae&&ae(se,me),me.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:me}),m=null}const Me=new QA;Me.setAnimationLoop(ye),this.setAnimationLoop=function(se){ae=se},this.dispose=function(){}}}const or=new Ti,QS=new et;function GS(i,e){function t(A,p){A.matrixAutoUpdate===!0&&A.updateMatrix(),p.value.copy(A.matrix)}function n(A,p){p.color.getRGB(A.fogColor.value,iA(i)),p.isFog?(A.fogNear.value=p.near,A.fogFar.value=p.far):p.isFogExp2&&(A.fogDensity.value=p.density)}function s(A,p,y,b,_){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(A,p):p.isMeshToonMaterial?(r(A,p),u(A,p)):p.isMeshPhongMaterial?(r(A,p),h(A,p)):p.isMeshStandardMaterial?(r(A,p),d(A,p),p.isMeshPhysicalMaterial&&f(A,p,_)):p.isMeshMatcapMaterial?(r(A,p),m(A,p)):p.isMeshDepthMaterial?r(A,p):p.isMeshDistanceMaterial?(r(A,p),g(A,p)):p.isMeshNormalMaterial?r(A,p):p.isLineBasicMaterial?(a(A,p),p.isLineDashedMaterial&&o(A,p)):p.isPointsMaterial?c(A,p,y,b):p.isSpriteMaterial?l(A,p):p.isShadowMaterial?(A.color.value.copy(p.color),A.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(A,p){A.opacity.value=p.opacity,p.color&&A.diffuse.value.copy(p.color),p.emissive&&A.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(A.map.value=p.map,t(p.map,A.mapTransform)),p.alphaMap&&(A.alphaMap.value=p.alphaMap,t(p.alphaMap,A.alphaMapTransform)),p.bumpMap&&(A.bumpMap.value=p.bumpMap,t(p.bumpMap,A.bumpMapTransform),A.bumpScale.value=p.bumpScale,p.side===Sn&&(A.bumpScale.value*=-1)),p.normalMap&&(A.normalMap.value=p.normalMap,t(p.normalMap,A.normalMapTransform),A.normalScale.value.copy(p.normalScale),p.side===Sn&&A.normalScale.value.negate()),p.displacementMap&&(A.displacementMap.value=p.displacementMap,t(p.displacementMap,A.displacementMapTransform),A.displacementScale.value=p.displacementScale,A.displacementBias.value=p.displacementBias),p.emissiveMap&&(A.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,A.emissiveMapTransform)),p.specularMap&&(A.specularMap.value=p.specularMap,t(p.specularMap,A.specularMapTransform)),p.alphaTest>0&&(A.alphaTest.value=p.alphaTest);const y=e.get(p),b=y.envMap,_=y.envMapRotation;b&&(A.envMap.value=b,or.copy(_),or.x*=-1,or.y*=-1,or.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(or.y*=-1,or.z*=-1),A.envMapRotation.value.setFromMatrix4(QS.makeRotationFromEuler(or)),A.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,A.reflectivity.value=p.reflectivity,A.ior.value=p.ior,A.refractionRatio.value=p.refractionRatio),p.lightMap&&(A.lightMap.value=p.lightMap,A.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,A.lightMapTransform)),p.aoMap&&(A.aoMap.value=p.aoMap,A.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,A.aoMapTransform))}function a(A,p){A.diffuse.value.copy(p.color),A.opacity.value=p.opacity,p.map&&(A.map.value=p.map,t(p.map,A.mapTransform))}function o(A,p){A.dashSize.value=p.dashSize,A.totalSize.value=p.dashSize+p.gapSize,A.scale.value=p.scale}function c(A,p,y,b){A.diffuse.value.copy(p.color),A.opacity.value=p.opacity,A.size.value=p.size*y,A.scale.value=b*.5,p.map&&(A.map.value=p.map,t(p.map,A.uvTransform)),p.alphaMap&&(A.alphaMap.value=p.alphaMap,t(p.alphaMap,A.alphaMapTransform)),p.alphaTest>0&&(A.alphaTest.value=p.alphaTest)}function l(A,p){A.diffuse.value.copy(p.color),A.opacity.value=p.opacity,A.rotation.value=p.rotation,p.map&&(A.map.value=p.map,t(p.map,A.mapTransform)),p.alphaMap&&(A.alphaMap.value=p.alphaMap,t(p.alphaMap,A.alphaMapTransform)),p.alphaTest>0&&(A.alphaTest.value=p.alphaTest)}function h(A,p){A.specular.value.copy(p.specular),A.shininess.value=Math.max(p.shininess,1e-4)}function u(A,p){p.gradientMap&&(A.gradientMap.value=p.gradientMap)}function d(A,p){A.metalness.value=p.metalness,p.metalnessMap&&(A.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,A.metalnessMapTransform)),A.roughness.value=p.roughness,p.roughnessMap&&(A.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,A.roughnessMapTransform)),p.envMap&&(A.envMapIntensity.value=p.envMapIntensity)}function f(A,p,y){A.ior.value=p.ior,p.sheen>0&&(A.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),A.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(A.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,A.sheenColorMapTransform)),p.sheenRoughnessMap&&(A.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,A.sheenRoughnessMapTransform))),p.clearcoat>0&&(A.clearcoat.value=p.clearcoat,A.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(A.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,A.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(A.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,A.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(A.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,A.clearcoatNormalMapTransform),A.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Sn&&A.clearcoatNormalScale.value.negate())),p.dispersion>0&&(A.dispersion.value=p.dispersion),p.iridescence>0&&(A.iridescence.value=p.iridescence,A.iridescenceIOR.value=p.iridescenceIOR,A.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],A.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(A.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,A.iridescenceMapTransform)),p.iridescenceThicknessMap&&(A.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,A.iridescenceThicknessMapTransform))),p.transmission>0&&(A.transmission.value=p.transmission,A.transmissionSamplerMap.value=y.texture,A.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(A.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,A.transmissionMapTransform)),A.thickness.value=p.thickness,p.thicknessMap&&(A.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,A.thicknessMapTransform)),A.attenuationDistance.value=p.attenuationDistance,A.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(A.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(A.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,A.anisotropyMapTransform))),A.specularIntensity.value=p.specularIntensity,A.specularColor.value.copy(p.specularColor),p.specularColorMap&&(A.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,A.specularColorMapTransform)),p.specularIntensityMap&&(A.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,A.specularIntensityMapTransform))}function m(A,p){p.matcap&&(A.matcap.value=p.matcap)}function g(A,p){const y=e.get(p).light;A.referencePosition.value.setFromMatrixPosition(y.matrixWorld),A.nearDistance.value=y.shadow.camera.near,A.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function HS(i,e,t,n){let s={},r={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(y,b){const _=b.program;n.uniformBlockBinding(y,_)}function l(y,b){let _=s[y.id];_===void 0&&(m(y),_=h(y),s[y.id]=_,y.addEventListener("dispose",A));const M=b.program;n.updateUBOMapping(y,M);const w=e.render.frame;r[y.id]!==w&&(d(y),r[y.id]=w)}function h(y){const b=u();y.__bindingPointIndex=b;const _=i.createBuffer(),M=y.__size,w=y.usage;return i.bindBuffer(i.UNIFORM_BUFFER,_),i.bufferData(i.UNIFORM_BUFFER,M,w),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,b,_),_}function u(){for(let y=0;y<o;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){const b=s[y.id],_=y.uniforms,M=y.__cache;i.bindBuffer(i.UNIFORM_BUFFER,b);for(let w=0,S=_.length;w<S;w++){const T=Array.isArray(_[w])?_[w]:[_[w]];for(let C=0,v=T.length;C<v;C++){const F=T[C];if(f(F,w,C,M)===!0){const K=F.__offset,q=Array.isArray(F.value)?F.value:[F.value];let $=0;for(let D=0;D<q.length;D++){const O=q[D],Y=g(O);typeof O=="number"||typeof O=="boolean"?(F.__data[0]=O,i.bufferSubData(i.UNIFORM_BUFFER,K+$,F.__data)):O.isMatrix3?(F.__data[0]=O.elements[0],F.__data[1]=O.elements[1],F.__data[2]=O.elements[2],F.__data[3]=0,F.__data[4]=O.elements[3],F.__data[5]=O.elements[4],F.__data[6]=O.elements[5],F.__data[7]=0,F.__data[8]=O.elements[6],F.__data[9]=O.elements[7],F.__data[10]=O.elements[8],F.__data[11]=0):(O.toArray(F.__data,$),$+=Y.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,K,F.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function f(y,b,_,M){const w=y.value,S=b+"_"+_;if(M[S]===void 0)return typeof w=="number"||typeof w=="boolean"?M[S]=w:M[S]=w.clone(),!0;{const T=M[S];if(typeof w=="number"||typeof w=="boolean"){if(T!==w)return M[S]=w,!0}else if(T.equals(w)===!1)return T.copy(w),!0}return!1}function m(y){const b=y.uniforms;let _=0;const M=16;for(let S=0,T=b.length;S<T;S++){const C=Array.isArray(b[S])?b[S]:[b[S]];for(let v=0,F=C.length;v<F;v++){const K=C[v],q=Array.isArray(K.value)?K.value:[K.value];for(let $=0,D=q.length;$<D;$++){const O=q[$],Y=g(O),Q=_%M,J=Q%Y.boundary,ee=Q+J;_+=J,ee!==0&&M-ee<Y.storage&&(_+=M-ee),K.__data=new Float32Array(Y.storage/Float32Array.BYTES_PER_ELEMENT),K.__offset=_,_+=Y.storage}}}const w=_%M;return w>0&&(_+=M-w),y.__size=_,y.__cache={},this}function g(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),b}function A(y){const b=y.target;b.removeEventListener("dispose",A);const _=a.indexOf(b.__bindingPointIndex);a.splice(_,1),i.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function p(){for(const y in s)i.deleteBuffer(s[y]);a=[],s={},r={}}return{bind:c,update:l,dispose:p}}class pg{constructor(e={}){const{canvas:t=m_(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),g=new Int32Array(4);let A=null,p=null;const y=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=bs,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const _=this;let M=!1;this._outputColorSpace=Kt;let w=0,S=0,T=null,C=-1,v=null;const F=new _t,K=new _t;let q=null;const $=new qe(0);let D=0,O=t.width,Y=t.height,Q=1,J=null,ee=null;const ae=new _t(0,0,O,Y),ye=new _t(0,0,O,Y);let Me=!1;const se=new Mu;let me=!1,be=!1;const xe=new et,Pe=new et,$e=new H,Qe=new _t,St={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ut=!1;function Je(){return T===null?Q:1}let G=n;function mn(E,R){return t.getContext(E,R)}try{const E={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r176"),t.addEventListener("webglcontextlost",de,!1),t.addEventListener("webglcontextrestored",Ie,!1),t.addEventListener("webglcontextcreationerror",Se,!1),G===null){const R="webgl2";if(G=mn(R,E),G===null)throw mn(R)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let dt,pt,ze,Rt,Ge,L,I,Z,le,Ae,oe,Ue,ve,Ve,Ye,Ee,Ne,ke,Oe,Te,tt,We,nt,W;function ne(){dt=new $v(G),dt.init(),We=new LS(G,dt),pt=new qv(G,dt,e,We),ze=new FS(G,dt),pt.reverseDepthBuffer&&d&&ze.buffers.depth.setReversed(!0),Rt=new nC(G),Ge=new ES,L=new DS(G,dt,ze,Ge,pt,We,Rt),I=new jv(_),Z=new Zv(_),le=new Hy(G),nt=new Vv(G,le),Ae=new eC(G,le,Rt,nt),oe=new sC(G,Ae,le,Rt),Oe=new iC(G,pt,L),Ee=new Kv(Ge),Ue=new xS(_,I,Z,dt,pt,nt,Ee),ve=new GS(_,Ge),Ve=new yS,Ye=new MS(dt),ke=new zv(_,I,Z,ze,oe,f,c),Ne=new RS(_,oe,pt),W=new HS(G,Rt,pt,ze),Te=new Wv(G,dt,Rt),tt=new tC(G,dt,Rt),Rt.programs=Ue.programs,_.capabilities=pt,_.extensions=dt,_.properties=Ge,_.renderLists=Ve,_.shadowMap=Ne,_.state=ze,_.info=Rt}ne();const re=new OS(_,G);this.xr=re,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const E=dt.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=dt.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(E){E!==void 0&&(Q=E,this.setSize(O,Y,!1))},this.getSize=function(E){return E.set(O,Y)},this.setSize=function(E,R,N=!0){if(re.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=E,Y=R,t.width=Math.floor(E*Q),t.height=Math.floor(R*Q),N===!0&&(t.style.width=E+"px",t.style.height=R+"px"),this.setViewport(0,0,E,R)},this.getDrawingBufferSize=function(E){return E.set(O*Q,Y*Q).floor()},this.setDrawingBufferSize=function(E,R,N){O=E,Y=R,Q=N,t.width=Math.floor(E*N),t.height=Math.floor(R*N),this.setViewport(0,0,E,R)},this.getCurrentViewport=function(E){return E.copy(F)},this.getViewport=function(E){return E.copy(ae)},this.setViewport=function(E,R,N,U){E.isVector4?ae.set(E.x,E.y,E.z,E.w):ae.set(E,R,N,U),ze.viewport(F.copy(ae).multiplyScalar(Q).round())},this.getScissor=function(E){return E.copy(ye)},this.setScissor=function(E,R,N,U){E.isVector4?ye.set(E.x,E.y,E.z,E.w):ye.set(E,R,N,U),ze.scissor(K.copy(ye).multiplyScalar(Q).round())},this.getScissorTest=function(){return Me},this.setScissorTest=function(E){ze.setScissorTest(Me=E)},this.setOpaqueSort=function(E){J=E},this.setTransparentSort=function(E){ee=E},this.getClearColor=function(E){return E.copy(ke.getClearColor())},this.setClearColor=function(){ke.setClearColor(...arguments)},this.getClearAlpha=function(){return ke.getClearAlpha()},this.setClearAlpha=function(){ke.setClearAlpha(...arguments)},this.clear=function(E=!0,R=!0,N=!0){let U=0;if(E){let P=!1;if(T!==null){const z=T.texture.format;P=z===Th||z===Bh||z===Mh}if(P){const z=T.texture.type,j=z===tn||z===Ys||z===Wa||z===qa||z===Sh||z===Ih,X=ke.getClearColor(),ie=ke.getClearAlpha(),he=X.r,ce=X.g,fe=X.b;j?(m[0]=he,m[1]=ce,m[2]=fe,m[3]=ie,G.clearBufferuiv(G.COLOR,0,m)):(g[0]=he,g[1]=ce,g[2]=fe,g[3]=ie,G.clearBufferiv(G.COLOR,0,g))}else U|=G.COLOR_BUFFER_BIT}R&&(U|=G.DEPTH_BUFFER_BIT),N&&(U|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(U)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",de,!1),t.removeEventListener("webglcontextrestored",Ie,!1),t.removeEventListener("webglcontextcreationerror",Se,!1),ke.dispose(),Ve.dispose(),Ye.dispose(),Ge.dispose(),I.dispose(),Z.dispose(),oe.dispose(),nt.dispose(),W.dispose(),Ue.dispose(),re.dispose(),re.removeEventListener("sessionstart",lh),re.removeEventListener("sessionend",hh),As.stop()};function de(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function Ie(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const E=Rt.autoReset,R=Ne.enabled,N=Ne.autoUpdate,U=Ne.needsUpdate,P=Ne.type;ne(),Rt.autoReset=E,Ne.enabled=R,Ne.autoUpdate=N,Ne.needsUpdate=U,Ne.type=P}function Se(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function it(E){const R=E.target;R.removeEventListener("dispose",it),Ot(R)}function Ot(E){bn(E),Ge.remove(E)}function bn(E){const R=Ge.get(E).programs;R!==void 0&&(R.forEach(function(N){Ue.releaseProgram(N)}),E.isShaderMaterial&&Ue.releaseShaderCache(E))}this.renderBufferDirect=function(E,R,N,U,P,z){R===null&&(R=St);const j=P.isMesh&&P.matrixWorld.determinant()<0,X=op(E,R,N,U,P);ze.setMaterial(U,j);let ie=N.index,he=1;if(U.wireframe===!0){if(ie=Ae.getWireframeAttribute(N),ie===void 0)return;he=2}const ce=N.drawRange,fe=N.attributes.position;let ge=ce.start*he,_e=(ce.start+ce.count)*he;z!==null&&(ge=Math.max(ge,z.start*he),_e=Math.min(_e,(z.start+z.count)*he)),ie!==null?(ge=Math.max(ge,0),_e=Math.min(_e,ie.count)):fe!=null&&(ge=Math.max(ge,0),_e=Math.min(_e,fe.count));const De=_e-ge;if(De<0||De===1/0)return;nt.setup(P,U,X,N,ie);let Ke,He=Te;if(ie!==null&&(Ke=le.get(ie),He=tt,He.setIndex(Ke)),P.isMesh)U.wireframe===!0?(ze.setLineWidth(U.wireframeLinewidth*Je()),He.setMode(G.LINES)):He.setMode(G.TRIANGLES);else if(P.isLine){let Fe=U.linewidth;Fe===void 0&&(Fe=1),ze.setLineWidth(Fe*Je()),P.isLineSegments?He.setMode(G.LINES):P.isLineLoop?He.setMode(G.LINE_LOOP):He.setMode(G.LINE_STRIP)}else P.isPoints?He.setMode(G.POINTS):P.isSprite&&He.setMode(G.TRIANGLES);if(P.isBatchedMesh)if(P._multiDrawInstances!==null)yc("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),He.renderMultiDrawInstances(P._multiDrawStarts,P._multiDrawCounts,P._multiDrawCount,P._multiDrawInstances);else if(dt.get("WEBGL_multi_draw"))He.renderMultiDraw(P._multiDrawStarts,P._multiDrawCounts,P._multiDrawCount);else{const Fe=P._multiDrawStarts,st=P._multiDrawCounts,Le=P._multiDrawCount,wt=ie?le.get(ie).bytesPerElement:1,un=Ge.get(U).currentProgram.getUniforms();for(let Et=0;Et<Le;Et++)un.setValue(G,"_gl_DrawID",Et),He.render(Fe[Et]/wt,st[Et])}else if(P.isInstancedMesh)He.renderInstances(ge,De,P.count);else if(N.isInstancedBufferGeometry){const Fe=N._maxInstanceCount!==void 0?N._maxInstanceCount:1/0,st=Math.min(N.instanceCount,Fe);He.renderInstances(ge,De,st)}else He.render(ge,De)};function yt(E,R,N){E.transparent===!0&&E.side===Ii&&E.forceSinglePass===!1?(E.side=Sn,E.needsUpdate=!0,za(E,R,N),E.side=Gi,E.needsUpdate=!0,za(E,R,N),E.side=Ii):za(E,R,N)}this.compile=function(E,R,N=null){N===null&&(N=E),p=Ye.get(N),p.init(R),b.push(p),N.traverseVisible(function(P){P.isLight&&P.layers.test(R.layers)&&(p.pushLight(P),P.castShadow&&p.pushShadow(P))}),E!==N&&E.traverseVisible(function(P){P.isLight&&P.layers.test(R.layers)&&(p.pushLight(P),P.castShadow&&p.pushShadow(P))}),p.setupLights();const U=new Set;return E.traverse(function(P){if(!(P.isMesh||P.isPoints||P.isLine||P.isSprite))return;const z=P.material;if(z)if(Array.isArray(z))for(let j=0;j<z.length;j++){const X=z[j];yt(X,N,P),U.add(X)}else yt(z,N,P),U.add(z)}),p=b.pop(),U},this.compileAsync=function(E,R,N=null){const U=this.compile(E,R,N);return new Promise(P=>{function z(){if(U.forEach(function(j){Ge.get(j).currentProgram.isReady()&&U.delete(j)}),U.size===0){P(E);return}setTimeout(z,10)}dt.get("KHR_parallel_shader_compile")!==null?z():setTimeout(z,10)})};let Yn=null;function Si(E){Yn&&Yn(E)}function lh(){As.stop()}function hh(){As.start()}const As=new QA;As.setAnimationLoop(Si),typeof self<"u"&&As.setContext(self),this.setAnimationLoop=function(E){Yn=E,re.setAnimationLoop(E),E===null?As.stop():As.start()},re.addEventListener("sessionstart",lh),re.addEventListener("sessionend",hh),this.render=function(E,R){if(R!==void 0&&R.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),R.parent===null&&R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),re.enabled===!0&&re.isPresenting===!0&&(re.cameraAutoUpdate===!0&&re.updateCamera(R),R=re.getCamera()),E.isScene===!0&&E.onBeforeRender(_,E,R,T),p=Ye.get(E,b.length),p.init(R),b.push(p),Pe.multiplyMatrices(R.projectionMatrix,R.matrixWorldInverse),se.setFromProjectionMatrix(Pe),be=this.localClippingEnabled,me=Ee.init(this.clippingPlanes,be),A=Ve.get(E,y.length),A.init(),y.push(A),re.enabled===!0&&re.isPresenting===!0){const z=_.xr.getDepthSensingMesh();z!==null&&ic(z,R,-1/0,_.sortObjects)}ic(E,R,0,_.sortObjects),A.finish(),_.sortObjects===!0&&A.sort(J,ee),ut=re.enabled===!1||re.isPresenting===!1||re.hasDepthSensing()===!1,ut&&ke.addToRenderList(A,E),this.info.render.frame++,me===!0&&Ee.beginShadows();const N=p.state.shadowsArray;Ne.render(N,E,R),me===!0&&Ee.endShadows(),this.info.autoReset===!0&&this.info.reset();const U=A.opaque,P=A.transmissive;if(p.setupLights(),R.isArrayCamera){const z=R.cameras;if(P.length>0)for(let j=0,X=z.length;j<X;j++){const ie=z[j];uh(U,P,E,ie)}ut&&ke.render(E);for(let j=0,X=z.length;j<X;j++){const ie=z[j];sc(A,E,ie,ie.viewport)}}else P.length>0&&uh(U,P,E,R),ut&&ke.render(E),sc(A,E,R);T!==null&&S===0&&(L.updateMultisampleRenderTarget(T),L.updateRenderTargetMipmap(T)),E.isScene===!0&&E.onAfterRender(_,E,R),nt.resetDefaultState(),C=-1,v=null,b.pop(),b.length>0?(p=b[b.length-1],me===!0&&Ee.setGlobalState(_.clippingPlanes,p.state.camera)):p=null,y.pop(),y.length>0?A=y[y.length-1]:A=null};function ic(E,R,N,U){if(E.visible===!1)return;if(E.layers.test(R.layers)){if(E.isGroup)N=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(R);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||se.intersectsSprite(E)){U&&Qe.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Pe);const j=oe.update(E),X=E.material;X.visible&&A.push(E,j,X,N,Qe.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||se.intersectsObject(E))){const j=oe.update(E),X=E.material;if(U&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),Qe.copy(E.boundingSphere.center)):(j.boundingSphere===null&&j.computeBoundingSphere(),Qe.copy(j.boundingSphere.center)),Qe.applyMatrix4(E.matrixWorld).applyMatrix4(Pe)),Array.isArray(X)){const ie=j.groups;for(let he=0,ce=ie.length;he<ce;he++){const fe=ie[he],ge=X[fe.materialIndex];ge&&ge.visible&&A.push(E,j,ge,N,Qe.z,fe)}}else X.visible&&A.push(E,j,X,N,Qe.z,null)}}const z=E.children;for(let j=0,X=z.length;j<X;j++)ic(z[j],R,N,U)}function sc(E,R,N,U){const P=E.opaque,z=E.transmissive,j=E.transparent;p.setupLightsView(N),me===!0&&Ee.setGlobalState(_.clippingPlanes,N),U&&ze.viewport(F.copy(U)),P.length>0&&Ha(P,R,N),z.length>0&&Ha(z,R,N),j.length>0&&Ha(j,R,N),ze.buffers.depth.setTest(!0),ze.buffers.depth.setMask(!0),ze.buffers.color.setMask(!0),ze.setPolygonOffset(!1)}function uh(E,R,N,U){if((N.isScene===!0?N.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[U.id]===void 0&&(p.state.transmissionRenderTarget[U.id]=new Zs(1,1,{generateMipmaps:!0,type:dt.has("EXT_color_buffer_half_float")||dt.has("EXT_color_buffer_float")?Mn:tn,minFilter:Jn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:At.workingColorSpace}));const z=p.state.transmissionRenderTarget[U.id],j=U.viewport||F;z.setSize(j.z*_.transmissionResolutionScale,j.w*_.transmissionResolutionScale);const X=_.getRenderTarget();_.setRenderTarget(z),_.getClearColor($),D=_.getClearAlpha(),D<1&&_.setClearColor(16777215,.5),_.clear(),ut&&ke.render(N);const ie=_.toneMapping;_.toneMapping=bs;const he=U.viewport;if(U.viewport!==void 0&&(U.viewport=void 0),p.setupLightsView(U),me===!0&&Ee.setGlobalState(_.clippingPlanes,U),Ha(E,N,U),L.updateMultisampleRenderTarget(z),L.updateRenderTargetMipmap(z),dt.has("WEBGL_multisampled_render_to_texture")===!1){let ce=!1;for(let fe=0,ge=R.length;fe<ge;fe++){const _e=R[fe],De=_e.object,Ke=_e.geometry,He=_e.material,Fe=_e.group;if(He.side===Ii&&De.layers.test(U.layers)){const st=He.side;He.side=Sn,He.needsUpdate=!0,dh(De,N,U,Ke,He,Fe),He.side=st,He.needsUpdate=!0,ce=!0}}ce===!0&&(L.updateMultisampleRenderTarget(z),L.updateRenderTargetMipmap(z))}_.setRenderTarget(X),_.setClearColor($,D),he!==void 0&&(U.viewport=he),_.toneMapping=ie}function Ha(E,R,N){const U=R.isScene===!0?R.overrideMaterial:null;for(let P=0,z=E.length;P<z;P++){const j=E[P],X=j.object,ie=j.geometry,he=j.group;let ce=j.material;ce.allowOverride===!0&&U!==null&&(ce=U),X.layers.test(N.layers)&&dh(X,R,N,ie,ce,he)}}function dh(E,R,N,U,P,z){E.onBeforeRender(_,R,N,U,P,z),E.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),P.onBeforeRender(_,R,N,U,E,z),P.transparent===!0&&P.side===Ii&&P.forceSinglePass===!1?(P.side=Sn,P.needsUpdate=!0,_.renderBufferDirect(N,R,U,P,E,z),P.side=Gi,P.needsUpdate=!0,_.renderBufferDirect(N,R,U,P,E,z),P.side=Ii):_.renderBufferDirect(N,R,U,P,E,z),E.onAfterRender(_,R,N,U,P,z)}function za(E,R,N){R.isScene!==!0&&(R=St);const U=Ge.get(E),P=p.state.lights,z=p.state.shadowsArray,j=P.state.version,X=Ue.getParameters(E,P.state,z,R,N),ie=Ue.getProgramCacheKey(X);let he=U.programs;U.environment=E.isMeshStandardMaterial?R.environment:null,U.fog=R.fog,U.envMap=(E.isMeshStandardMaterial?Z:I).get(E.envMap||U.environment),U.envMapRotation=U.environment!==null&&E.envMap===null?R.environmentRotation:E.envMapRotation,he===void 0&&(E.addEventListener("dispose",it),he=new Map,U.programs=he);let ce=he.get(ie);if(ce!==void 0){if(U.currentProgram===ce&&U.lightsStateVersion===j)return ac(E,X),ce}else X.uniforms=Ue.getUniforms(E),E.onBeforeCompile(X,_),ce=Ue.acquireProgram(X,ie),he.set(ie,ce),U.uniforms=X.uniforms;const fe=U.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(fe.clippingPlanes=Ee.uniform),ac(E,X),U.needsLights=Ks(E),U.lightsStateVersion=j,U.needsLights&&(fe.ambientLightColor.value=P.state.ambient,fe.lightProbe.value=P.state.probe,fe.directionalLights.value=P.state.directional,fe.directionalLightShadows.value=P.state.directionalShadow,fe.spotLights.value=P.state.spot,fe.spotLightShadows.value=P.state.spotShadow,fe.rectAreaLights.value=P.state.rectArea,fe.ltc_1.value=P.state.rectAreaLTC1,fe.ltc_2.value=P.state.rectAreaLTC2,fe.pointLights.value=P.state.point,fe.pointLightShadows.value=P.state.pointShadow,fe.hemisphereLights.value=P.state.hemi,fe.directionalShadowMap.value=P.state.directionalShadowMap,fe.directionalShadowMatrix.value=P.state.directionalShadowMatrix,fe.spotShadowMap.value=P.state.spotShadowMap,fe.spotLightMatrix.value=P.state.spotLightMatrix,fe.spotLightMap.value=P.state.spotLightMap,fe.pointShadowMap.value=P.state.pointShadowMap,fe.pointShadowMatrix.value=P.state.pointShadowMatrix),U.currentProgram=ce,U.uniformsList=null,ce}function rc(E){if(E.uniformsList===null){const R=E.currentProgram.getUniforms();E.uniformsList=il.seqWithValue(R.seq,E.uniforms)}return E.uniformsList}function ac(E,R){const N=Ge.get(E);N.outputColorSpace=R.outputColorSpace,N.batching=R.batching,N.batchingColor=R.batchingColor,N.instancing=R.instancing,N.instancingColor=R.instancingColor,N.instancingMorph=R.instancingMorph,N.skinning=R.skinning,N.morphTargets=R.morphTargets,N.morphNormals=R.morphNormals,N.morphColors=R.morphColors,N.morphTargetsCount=R.morphTargetsCount,N.numClippingPlanes=R.numClippingPlanes,N.numIntersection=R.numClipIntersection,N.vertexAlphas=R.vertexAlphas,N.vertexTangents=R.vertexTangents,N.toneMapping=R.toneMapping}function op(E,R,N,U,P){R.isScene!==!0&&(R=St),L.resetTextureUnits();const z=R.fog,j=U.isMeshStandardMaterial?R.environment:null,X=T===null?_.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:rn,ie=(U.isMeshStandardMaterial?Z:I).get(U.envMap||j),he=U.vertexColors===!0&&!!N.attributes.color&&N.attributes.color.itemSize===4,ce=!!N.attributes.tangent&&(!!U.normalMap||U.anisotropy>0),fe=!!N.morphAttributes.position,ge=!!N.morphAttributes.normal,_e=!!N.morphAttributes.color;let De=bs;U.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(De=_.toneMapping);const Ke=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,He=Ke!==void 0?Ke.length:0,Fe=Ge.get(U),st=p.state.lights;if(me===!0&&(be===!0||E!==v)){const Lt=E===v&&U.id===C;Ee.setState(U,E,Lt)}let Le=!1;U.version===Fe.__version?(Fe.needsLights&&Fe.lightsStateVersion!==st.state.version||Fe.outputColorSpace!==X||P.isBatchedMesh&&Fe.batching===!1||!P.isBatchedMesh&&Fe.batching===!0||P.isBatchedMesh&&Fe.batchingColor===!0&&P.colorTexture===null||P.isBatchedMesh&&Fe.batchingColor===!1&&P.colorTexture!==null||P.isInstancedMesh&&Fe.instancing===!1||!P.isInstancedMesh&&Fe.instancing===!0||P.isSkinnedMesh&&Fe.skinning===!1||!P.isSkinnedMesh&&Fe.skinning===!0||P.isInstancedMesh&&Fe.instancingColor===!0&&P.instanceColor===null||P.isInstancedMesh&&Fe.instancingColor===!1&&P.instanceColor!==null||P.isInstancedMesh&&Fe.instancingMorph===!0&&P.morphTexture===null||P.isInstancedMesh&&Fe.instancingMorph===!1&&P.morphTexture!==null||Fe.envMap!==ie||U.fog===!0&&Fe.fog!==z||Fe.numClippingPlanes!==void 0&&(Fe.numClippingPlanes!==Ee.numPlanes||Fe.numIntersection!==Ee.numIntersection)||Fe.vertexAlphas!==he||Fe.vertexTangents!==ce||Fe.morphTargets!==fe||Fe.morphNormals!==ge||Fe.morphColors!==_e||Fe.toneMapping!==De||Fe.morphTargetsCount!==He)&&(Le=!0):(Le=!0,Fe.__version=U.version);let wt=Fe.currentProgram;Le===!0&&(wt=za(U,R,P));let un=!1,Et=!1,bt=!1;const je=wt.getUniforms(),qt=Fe.uniforms;if(ze.useProgram(wt.program)&&(un=!0,Et=!0,bt=!0),U.id!==C&&(C=U.id,Et=!0),un||v!==E){ze.buffers.depth.getReversed()?(xe.copy(E.projectionMatrix),x_(xe),E_(xe),je.setValue(G,"projectionMatrix",xe)):je.setValue(G,"projectionMatrix",E.projectionMatrix),je.setValue(G,"viewMatrix",E.matrixWorldInverse);const dn=je.map.cameraPosition;dn!==void 0&&dn.setValue(G,$e.setFromMatrixPosition(E.matrixWorld)),pt.logarithmicDepthBuffer&&je.setValue(G,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(U.isMeshPhongMaterial||U.isMeshToonMaterial||U.isMeshLambertMaterial||U.isMeshBasicMaterial||U.isMeshStandardMaterial||U.isShaderMaterial)&&je.setValue(G,"isOrthographic",E.isOrthographicCamera===!0),v!==E&&(v=E,Et=!0,bt=!0)}if(P.isSkinnedMesh){je.setOptional(G,P,"bindMatrix"),je.setOptional(G,P,"bindMatrixInverse");const Lt=P.skeleton;Lt&&(Lt.boneTexture===null&&Lt.computeBoneTexture(),je.setValue(G,"boneTexture",Lt.boneTexture,L))}P.isBatchedMesh&&(je.setOptional(G,P,"batchingTexture"),je.setValue(G,"batchingTexture",P._matricesTexture,L),je.setOptional(G,P,"batchingIdTexture"),je.setValue(G,"batchingIdTexture",P._indirectTexture,L),je.setOptional(G,P,"batchingColorTexture"),P._colorsTexture!==null&&je.setValue(G,"batchingColorTexture",P._colorsTexture,L));const xn=N.morphAttributes;if((xn.position!==void 0||xn.normal!==void 0||xn.color!==void 0)&&Oe.update(P,N,wt),(Et||Fe.receiveShadow!==P.receiveShadow)&&(Fe.receiveShadow=P.receiveShadow,je.setValue(G,"receiveShadow",P.receiveShadow)),U.isMeshGouraudMaterial&&U.envMap!==null&&(qt.envMap.value=ie,qt.flipEnvMap.value=ie.isCubeTexture&&ie.isRenderTargetTexture===!1?-1:1),U.isMeshStandardMaterial&&U.envMap===null&&R.environment!==null&&(qt.envMapIntensity.value=R.environmentIntensity),Et&&(je.setValue(G,"toneMappingExposure",_.toneMappingExposure),Fe.needsLights&&gs(qt,bt),z&&U.fog===!0&&ve.refreshFogUniforms(qt,z),ve.refreshMaterialUniforms(qt,U,Q,Y,p.state.transmissionRenderTarget[E.id]),il.upload(G,rc(Fe),qt,L)),U.isShaderMaterial&&U.uniformsNeedUpdate===!0&&(il.upload(G,rc(Fe),qt,L),U.uniformsNeedUpdate=!1),U.isSpriteMaterial&&je.setValue(G,"center",P.center),je.setValue(G,"modelViewMatrix",P.modelViewMatrix),je.setValue(G,"normalMatrix",P.normalMatrix),je.setValue(G,"modelMatrix",P.matrixWorld),U.isShaderMaterial||U.isRawShaderMaterial){const Lt=U.uniformsGroups;for(let dn=0,cp=Lt.length;dn<cp;dn++){const Rr=Lt[dn];W.update(Rr,wt),W.bind(Rr,wt)}}return wt}function gs(E,R){E.ambientLightColor.needsUpdate=R,E.lightProbe.needsUpdate=R,E.directionalLights.needsUpdate=R,E.directionalLightShadows.needsUpdate=R,E.pointLights.needsUpdate=R,E.pointLightShadows.needsUpdate=R,E.spotLights.needsUpdate=R,E.spotLightShadows.needsUpdate=R,E.rectAreaLights.needsUpdate=R,E.hemisphereLights.needsUpdate=R}function Ks(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(E,R,N){const U=Ge.get(E);U.__autoAllocateDepthBuffer=E.resolveDepthBuffer===!1,U.__autoAllocateDepthBuffer===!1&&(U.__useRenderToTexture=!1),Ge.get(E.texture).__webglTexture=R,Ge.get(E.depthTexture).__webglTexture=U.__autoAllocateDepthBuffer?void 0:N,U.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(E,R){const N=Ge.get(E);N.__webglFramebuffer=R,N.__useDefaultFramebuffer=R===void 0};const x=G.createFramebuffer();this.setRenderTarget=function(E,R=0,N=0){T=E,w=R,S=N;let U=!0,P=null,z=!1,j=!1;if(E){const ie=Ge.get(E);if(ie.__useDefaultFramebuffer!==void 0)ze.bindFramebuffer(G.FRAMEBUFFER,null),U=!1;else if(ie.__webglFramebuffer===void 0)L.setupRenderTarget(E);else if(ie.__hasExternalTextures)L.rebindTextures(E,Ge.get(E.texture).__webglTexture,Ge.get(E.depthTexture).__webglTexture);else if(E.depthBuffer){const fe=E.depthTexture;if(ie.__boundDepthTexture!==fe){if(fe!==null&&Ge.has(fe)&&(E.width!==fe.image.width||E.height!==fe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");L.setupDepthRenderbuffer(E)}}const he=E.texture;(he.isData3DTexture||he.isDataArrayTexture||he.isCompressedArrayTexture)&&(j=!0);const ce=Ge.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(ce[R])?P=ce[R][N]:P=ce[R],z=!0):E.samples>0&&L.useMultisampledRTT(E)===!1?P=Ge.get(E).__webglMultisampledFramebuffer:Array.isArray(ce)?P=ce[N]:P=ce,F.copy(E.viewport),K.copy(E.scissor),q=E.scissorTest}else F.copy(ae).multiplyScalar(Q).floor(),K.copy(ye).multiplyScalar(Q).floor(),q=Me;if(N!==0&&(P=x),ze.bindFramebuffer(G.FRAMEBUFFER,P)&&U&&ze.drawBuffers(E,P),ze.viewport(F),ze.scissor(K),ze.setScissorTest(q),z){const ie=Ge.get(E.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+R,ie.__webglTexture,N)}else if(j){const ie=Ge.get(E.texture),he=R;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,ie.__webglTexture,N,he)}else if(E!==null&&N!==0){const ie=Ge.get(E.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,ie.__webglTexture,N)}C=-1},this.readRenderTargetPixels=function(E,R,N,U,P,z,j){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let X=Ge.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&j!==void 0&&(X=X[j]),X){ze.bindFramebuffer(G.FRAMEBUFFER,X);try{const ie=E.texture,he=ie.format,ce=ie.type;if(!pt.textureFormatReadable(he)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!pt.textureTypeReadable(ce)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}R>=0&&R<=E.width-U&&N>=0&&N<=E.height-P&&G.readPixels(R,N,U,P,We.convert(he),We.convert(ce),z)}finally{const ie=T!==null?Ge.get(T).__webglFramebuffer:null;ze.bindFramebuffer(G.FRAMEBUFFER,ie)}}},this.readRenderTargetPixelsAsync=async function(E,R,N,U,P,z,j){if(!(E&&E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let X=Ge.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&j!==void 0&&(X=X[j]),X)if(R>=0&&R<=E.width-U&&N>=0&&N<=E.height-P){ze.bindFramebuffer(G.FRAMEBUFFER,X);const ie=E.texture,he=ie.format,ce=ie.type;if(!pt.textureFormatReadable(he))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!pt.textureTypeReadable(ce))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const fe=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,fe),G.bufferData(G.PIXEL_PACK_BUFFER,z.byteLength,G.STREAM_READ),G.readPixels(R,N,U,P,We.convert(he),We.convert(ce),0);const ge=T!==null?Ge.get(T).__webglFramebuffer:null;ze.bindFramebuffer(G.FRAMEBUFFER,ge);const _e=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await b_(G,_e,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,fe),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,z),G.deleteBuffer(fe),G.deleteSync(_e),z}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(E,R=null,N=0){const U=Math.pow(2,-N),P=Math.floor(E.image.width*U),z=Math.floor(E.image.height*U),j=R!==null?R.x:0,X=R!==null?R.y:0;L.setTexture2D(E,0),G.copyTexSubImage2D(G.TEXTURE_2D,N,0,0,j,X,P,z),ze.unbindTexture()};const B=G.createFramebuffer(),k=G.createFramebuffer();this.copyTextureToTexture=function(E,R,N=null,U=null,P=0,z=null){z===null&&(P!==0?(yc("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),z=P,P=0):z=0);let j,X,ie,he,ce,fe,ge,_e,De;const Ke=E.isCompressedTexture?E.mipmaps[z]:E.image;if(N!==null)j=N.max.x-N.min.x,X=N.max.y-N.min.y,ie=N.isBox3?N.max.z-N.min.z:1,he=N.min.x,ce=N.min.y,fe=N.isBox3?N.min.z:0;else{const xn=Math.pow(2,-P);j=Math.floor(Ke.width*xn),X=Math.floor(Ke.height*xn),E.isDataArrayTexture?ie=Ke.depth:E.isData3DTexture?ie=Math.floor(Ke.depth*xn):ie=1,he=0,ce=0,fe=0}U!==null?(ge=U.x,_e=U.y,De=U.z):(ge=0,_e=0,De=0);const He=We.convert(R.format),Fe=We.convert(R.type);let st;R.isData3DTexture?(L.setTexture3D(R,0),st=G.TEXTURE_3D):R.isDataArrayTexture||R.isCompressedArrayTexture?(L.setTexture2DArray(R,0),st=G.TEXTURE_2D_ARRAY):(L.setTexture2D(R,0),st=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,R.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,R.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,R.unpackAlignment);const Le=G.getParameter(G.UNPACK_ROW_LENGTH),wt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),un=G.getParameter(G.UNPACK_SKIP_PIXELS),Et=G.getParameter(G.UNPACK_SKIP_ROWS),bt=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,Ke.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Ke.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,he),G.pixelStorei(G.UNPACK_SKIP_ROWS,ce),G.pixelStorei(G.UNPACK_SKIP_IMAGES,fe);const je=E.isDataArrayTexture||E.isData3DTexture,qt=R.isDataArrayTexture||R.isData3DTexture;if(E.isDepthTexture){const xn=Ge.get(E),Lt=Ge.get(R),dn=Ge.get(xn.__renderTarget),cp=Ge.get(Lt.__renderTarget);ze.bindFramebuffer(G.READ_FRAMEBUFFER,dn.__webglFramebuffer),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,cp.__webglFramebuffer);for(let Rr=0;Rr<ie;Rr++)je&&(G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ge.get(E).__webglTexture,P,fe+Rr),G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ge.get(R).__webglTexture,z,De+Rr)),G.blitFramebuffer(he,ce,j,X,ge,_e,j,X,G.DEPTH_BUFFER_BIT,G.NEAREST);ze.bindFramebuffer(G.READ_FRAMEBUFFER,null),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else if(P!==0||E.isRenderTargetTexture||Ge.has(E)){const xn=Ge.get(E),Lt=Ge.get(R);ze.bindFramebuffer(G.READ_FRAMEBUFFER,B),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,k);for(let dn=0;dn<ie;dn++)je?G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,xn.__webglTexture,P,fe+dn):G.framebufferTexture2D(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,xn.__webglTexture,P),qt?G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Lt.__webglTexture,z,De+dn):G.framebufferTexture2D(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Lt.__webglTexture,z),P!==0?G.blitFramebuffer(he,ce,j,X,ge,_e,j,X,G.COLOR_BUFFER_BIT,G.NEAREST):qt?G.copyTexSubImage3D(st,z,ge,_e,De+dn,he,ce,j,X):G.copyTexSubImage2D(st,z,ge,_e,he,ce,j,X);ze.bindFramebuffer(G.READ_FRAMEBUFFER,null),ze.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else qt?E.isDataTexture||E.isData3DTexture?G.texSubImage3D(st,z,ge,_e,De,j,X,ie,He,Fe,Ke.data):R.isCompressedArrayTexture?G.compressedTexSubImage3D(st,z,ge,_e,De,j,X,ie,He,Ke.data):G.texSubImage3D(st,z,ge,_e,De,j,X,ie,He,Fe,Ke):E.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,z,ge,_e,j,X,He,Fe,Ke.data):E.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,z,ge,_e,Ke.width,Ke.height,He,Ke.data):G.texSubImage2D(G.TEXTURE_2D,z,ge,_e,j,X,He,Fe,Ke);G.pixelStorei(G.UNPACK_ROW_LENGTH,Le),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,wt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,un),G.pixelStorei(G.UNPACK_SKIP_ROWS,Et),G.pixelStorei(G.UNPACK_SKIP_IMAGES,bt),z===0&&R.generateMipmaps&&G.generateMipmap(st),ze.unbindTexture()},this.copyTextureToTexture3D=function(E,R,N=null,U=null,P=0){return yc('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(E,R,N,U,P)},this.initRenderTarget=function(E){Ge.get(E).__webglFramebuffer===void 0&&L.setupRenderTarget(E)},this.initTexture=function(E){E.isCubeTexture?L.setTextureCube(E,0):E.isData3DTexture?L.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?L.setTexture2DArray(E,0):L.setTexture2D(E,0),ze.unbindTexture()},this.resetState=function(){w=0,S=0,T=null,ze.reset(),nt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return zi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=At._getDrawingBufferColorSpace(e),t.unpackColorSpace=At._getUnpackColorSpace()}}var Eo=function(){var i=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),n(++i%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function n(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";i=h}var s=(performance||Date).now(),r=s,a=0,o=t(new Eo.Panel("FPS","#0ff","#002")),c=t(new Eo.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new Eo.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:e,addPanel:t,showPanel:n,begin:function(){s=(performance||Date).now()},end:function(){a++;var h=(performance||Date).now();if(c.update(h-s,200),h>=r+1e3&&(o.update(a*1e3/(h-r),100),r=h,a=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){s=this.end()},domElement:e,setMode:n}};Eo.Panel=function(i,e,t){var n=1/0,s=0,r=Math.round,a=r(window.devicePixelRatio||1),o=80*a,c=48*a,l=3*a,h=2*a,u=3*a,d=15*a,f=74*a,m=30*a,g=document.createElement("canvas");g.width=o,g.height=c,g.style.cssText="width:80px;height:48px";var A=g.getContext("2d");return A.font="bold "+9*a+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=t,A.fillRect(0,0,o,c),A.fillStyle=e,A.fillText(i,l,h),A.fillRect(u,d,f,m),A.fillStyle=t,A.globalAlpha=.9,A.fillRect(u,d,f,m),{dom:g,update:function(p,y){n=Math.min(n,p),s=Math.max(s,p),A.fillStyle=t,A.globalAlpha=1,A.fillRect(0,0,o,d),A.fillStyle=e,A.fillText(r(p)+" "+i+" ("+r(n)+"-"+r(s)+")",l,h),A.drawImage(g,u+a,d,f-a,m,u,d,f-a,m),A.fillRect(u+f-a,d,a,m),A.fillStyle=t,A.globalAlpha=.9,A.fillRect(u+f-a,d,a,r((1-p/y)*m))}}};function Ag(i,e){if(e===VE)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===Jh||e===Ip){let t=i.getIndex();if(t===null){const a=[],o=i.getAttribute("position");if(o!==void 0){for(let c=0;c<o.count;c++)a.push(c);i.setIndex(a),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,s=[];if(e===Jh)for(let a=1;a<=n;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<n;a++)a%2===0?(s.push(t.getX(a)),s.push(t.getX(a+1)),s.push(t.getX(a+2))):(s.push(t.getX(a+2)),s.push(t.getX(a+1)),s.push(t.getX(a)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=i.clone();return r.setIndex(s),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Yu extends Zi{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new KS(t)}),this.register(function(t){return new jS(t)}),this.register(function(t){return new iI(t)}),this.register(function(t){return new sI(t)}),this.register(function(t){return new rI(t)}),this.register(function(t){return new YS(t)}),this.register(function(t){return new JS(t)}),this.register(function(t){return new ZS(t)}),this.register(function(t){return new $S(t)}),this.register(function(t){return new qS(t)}),this.register(function(t){return new eI(t)}),this.register(function(t){return new XS(t)}),this.register(function(t){return new nI(t)}),this.register(function(t){return new tI(t)}),this.register(function(t){return new VS(t)}),this.register(function(t){return new aI(t)}),this.register(function(t){return new oI(t)})}load(e,t,n,s){const r=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const l=la.extractUrlBase(e);a=la.resolveURL(l,this.path)}else a=la.extractUrlBase(e);this.manager.itemStart(e);const o=function(l){s?s(l):console.error(l),r.manager.itemError(e),r.manager.itemEnd(e)},c=new Bs(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{r.parse(l,a,function(h){t(h),r.manager.itemEnd(e)},o)}catch(h){o(h)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,s){let r;const a={},o={},c=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===gg){try{a[ft.KHR_BINARY_GLTF]=new cI(e)}catch(u){s&&s(u);return}r=JSON.parse(a[ft.KHR_BINARY_GLTF].content)}else r=JSON.parse(c.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new _I(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const u=this.pluginCallbacks[h](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[u.name]=u,a[u.name]=!0}if(r.extensionsUsed)for(let h=0;h<r.extensionsUsed.length;++h){const u=r.extensionsUsed[h],d=r.extensionsRequired||[];switch(u){case ft.KHR_MATERIALS_UNLIT:a[u]=new WS;break;case ft.KHR_DRACO_MESH_COMPRESSION:a[u]=new lI(r,this.dracoLoader);break;case ft.KHR_TEXTURE_TRANSFORM:a[u]=new hI;break;case ft.KHR_MESH_QUANTIZATION:a[u]=new uI;break;default:d.indexOf(u)>=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,r){n.parse(e,t,s,r)})}}function zS(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const ft={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class VS{constructor(e){this.parser=e,this.name=ft.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let s=t.cache.get(n);if(s)return s;const r=t.json,c=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let l;const h=new qe(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],rn);const u=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new DA(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new FA(h),l.distance=u;break;case"spot":l=new Ey(h),l.distance=u,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),es(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),s=Promise.resolve(l),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],o=(r.extensions&&r.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(c){return n._getNodeRef(t.cache,o,c)})}}class WS{constructor(){this.name=ft.KHR_MATERIALS_UNLIT}getMaterialType(){return Cs}extendParams(e,t,n){const s=[];e.color=new qe(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const a=r.baseColorFactor;e.color.setRGB(a[0],a[1],a[2],rn),e.opacity=a[3]}r.baseColorTexture!==void 0&&s.push(n.assignTexture(e,"map",r.baseColorTexture,Kt))}return Promise.all(s)}}class qS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}}class KS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];if(a.clearcoatFactor!==void 0&&(t.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(r.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){const o=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ze(o,o)}return Promise.all(r)}}class jS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class XS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return a.iridescenceFactor!==void 0&&(t.iridescence=a.iridescenceFactor),a.iridescenceTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),a.iridescenceIor!==void 0&&(t.iridescenceIOR=a.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),a.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),a.iridescenceThicknessTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(r)}}class YS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new qe(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=s.extensions[this.name];if(a.sheenColorFactor!==void 0){const o=a.sheenColorFactor;t.sheenColor.setRGB(o[0],o[1],o[2],rn)}return a.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=a.sheenRoughnessFactor),a.sheenColorTexture!==void 0&&r.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture,Kt)),a.sheenRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(r)}}class JS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return a.transmissionFactor!==void 0&&(t.transmission=a.transmissionFactor),a.transmissionTexture!==void 0&&r.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(r)}}class ZS{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];t.thickness=a.thicknessFactor!==void 0?a.thicknessFactor:0,a.thicknessTexture!==void 0&&r.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;const o=a.attenuationColor||[1,1,1];return t.attenuationColor=new qe().setRGB(o[0],o[1],o[2],rn),Promise.all(r)}}class $S{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=s.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class eI{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];t.specularIntensity=a.specularFactor!==void 0?a.specularFactor:1,a.specularTexture!==void 0&&r.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return t.specularColor=new qe().setRGB(o[0],o[1],o[2],rn),a.specularColorTexture!==void 0&&r.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture,Kt)),Promise.all(r)}}class tI{constructor(e){this.parser=e,this.name=ft.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return t.bumpScale=a.bumpFactor!==void 0?a.bumpFactor:1,a.bumpTexture!==void 0&&r.push(n.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(r)}}class nI{constructor(e){this.parser=e,this.name=ft.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const r=[],a=s.extensions[this.name];return a.anisotropyStrength!==void 0&&(t.anisotropy=a.anisotropyStrength),a.anisotropyRotation!==void 0&&(t.anisotropyRotation=a.anisotropyRotation),a.anisotropyTexture!==void 0&&r.push(n.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(r)}}class iI{constructor(e){this.parser=e,this.name=ft.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const r=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,a)}}class sI{constructor(e){this.parser=e,this.name=ft.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const a=r.extensions[t],o=s.images[a.source];let c=n.textureLoader;if(o.uri){const l=n.options.manager.getHandler(o.uri);l!==null&&(c=l)}return n.loadTextureImage(e,a.source,c)}}class rI{constructor(e){this.parser=e,this.name=ft.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const a=r.extensions[t],o=s.images[a.source];let c=n.textureLoader;if(o.uri){const l=n.options.manager.getHandler(o.uri);l!==null&&(c=l)}return n.loadTextureImage(e,a.source,c)}}class aI{constructor(e){this.name=ft.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(o){const c=s.byteOffset||0,l=s.byteLength||0,h=s.count,u=s.byteStride,d=new Uint8Array(o,c,l);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,d,s.mode,s.filter).then(function(f){return f.buffer}):a.ready.then(function(){const f=new ArrayBuffer(h*u);return a.decodeGltfBuffer(new Uint8Array(f),h,u,d,s.mode,s.filter),f})})}else return null}}class oI{constructor(e){this.name=ft.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=t.meshes[n.mesh];for(const l of s.primitives)if(l.mode!==$n.TRIANGLES&&l.mode!==$n.TRIANGLE_STRIP&&l.mode!==$n.TRIANGLE_FAN&&l.mode!==void 0)return null;const a=n.extensions[this.name].attributes,o=[],c={};for(const l in a)o.push(this.parser.getDependency("accessor",a[l]).then(h=>(c[l]=h,c[l])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],d=l[0].count,f=[];for(const m of u){const g=new et,A=new H,p=new Vn,y=new H(1,1,1),b=new mA(m.geometry,m.material,d);for(let _=0;_<d;_++)c.TRANSLATION&&A.fromBufferAttribute(c.TRANSLATION,_),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,_),c.SCALE&&y.fromBufferAttribute(c.SCALE,_),b.setMatrixAt(_,g.compose(A,p,y));for(const _ in c)if(_==="_COLOR_0"){const M=c[_];b.instanceColor=new Su(M.array,M.itemSize,M.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&m.geometry.setAttribute(_,c[_]);Pt.prototype.copy.call(b,m),this.parser.assignFinalMaterial(b),f.push(b)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}}const gg="glTF",_o=12,mg={JSON:1313821514,BIN:5130562};class cI{constructor(e){this.name=ft.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,_o),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==gg)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-_o,r=new DataView(e,_o);let a=0;for(;a<s;){const o=r.getUint32(a,!0);a+=4;const c=r.getUint32(a,!0);if(a+=4,c===mg.JSON){const l=new Uint8Array(e,_o+a,o);this.content=n.decode(l)}else if(c===mg.BIN){const l=_o+a;this.body=e.slice(l,l+o)}a+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class lI{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ft.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},c={},l={};for(const h in a){const u=Zu[h]||h.toLowerCase();o[u]=a[h]}for(const h in e.attributes){const u=Zu[h]||h.toLowerCase();if(a[h]!==void 0){const d=n.accessors[e.attributes[h]],f=fa[d.componentType];l[u]=f.name,c[u]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(h){return new Promise(function(u,d){s.decodeDracoFile(h,function(f){for(const m in f.attributes){const g=f.attributes[m],A=c[m];A!==void 0&&(g.normalized=A)}u(f)},o,l,rn,d)})})}}class hI{constructor(){this.name=ft.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){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 uI{constructor(){this.name=ft.KHR_MESH_QUANTIZATION}}class bg extends go{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let a=0;a!==s;a++)t[a]=n[r+a];return t}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=o*2,l=o*3,h=s-t,u=(n-t)/h,d=u*u,f=d*u,m=e*l,g=m-l,A=-2*f+3*d,p=f-d,y=1-A,b=p-d+u;for(let _=0;_!==o;_++){const M=a[g+_+o],w=a[g+_+c]*h,S=a[m+_+o],T=a[m+_]*h;r[_]=y*M+b*w+A*S+p*T}return r}}const dI=new Vn;class fI extends bg{interpolate_(e,t,n,s){const r=super.interpolate_(e,t,n,s);return dI.fromArray(r).normalize().toArray(r),r}}const $n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},fa={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},xg={9728:In,9729:zt,9984:bp,9985:hc,9986:Va,9987:Jn},Eg={33071:oi,33648:lc,10497:kr},Ju={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zu={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},pI={CUBICSPLINE:void 0,LINEAR:to,STEP:eo},$u={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function AI(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new Ao({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Gi})),i.DefaultMaterial}function cr(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function es(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function gI(i,e,t){let n=!1,s=!1,r=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(s=!0),u.COLOR_0!==void 0&&(r=!0),n&&s&&r)break}if(!n&&!s&&!r)return Promise.resolve(i);const a=[],o=[],c=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(n){const d=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;a.push(d)}if(s){const d=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;o.push(d)}if(r){const d=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;c.push(d)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(c)]).then(function(l){const h=l[0],u=l[1],d=l[2];return n&&(i.morphAttributes.position=h),s&&(i.morphAttributes.normal=u),r&&(i.morphAttributes.color=d),i.morphTargetsRelative=!0,i})}function mI(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function bI(i){let e;const t=i.extensions&&i.extensions[ft.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+ed(t.attributes):e=i.indices+":"+ed(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,s=i.targets.length;n<s;n++)e+=":"+ed(i.targets[n]);return e}function ed(i){let e="";const t=Object.keys(i).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+i[t[n]]+";";return e}function td(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function xI(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const EI=new et;class _I{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new zS,this.associations=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,s=-1,r=!1,a=-1;if(typeof navigator<"u"){const o=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(o)===!0;const c=o.match(/Version\/(\d+)/);s=n&&c?parseInt(c[1],10):-1,r=o.indexOf("Firefox")>-1,a=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||r&&a<98?this.textureLoader=new my(this.options.manager):this.textureLoader=new vy(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Bs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(a){const o={scene:a[0][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:n,userData:{}};return cr(r,o,s),es(o,s),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(o)})).then(function(){for(const c of o.scenes)c.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){const a=t[s].joints;for(let o=0,c=a.length;o<c;o++)e[a[o]].isBone=!0}for(let s=0,r=e.length;s<r;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(n[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const s=n.clone(),r=(a,o)=>{const c=this.associations.get(a);c!=null&&this.associations.set(o,c);for(const[l,h]of a.children.entries())r(h,o.children[l])};return r(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const s=e(t[n]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let s=0;s<t.length;s++){const r=e(t[s]);r&&n.push(r)}return n}getDependency(e,t){const n=e+":"+t;let s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":s=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(r,a){return n.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ft.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(r,a){n.load(la.resolveURL(t.uri,s.path),r,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const s=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+s)})}loadAccessor(e){const t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Ju[s.type],o=fa[s.componentType],c=s.normalized===!0,l=new o(s.count*a);return Promise.resolve(new En(l,a,c))}const r=[];return s.bufferView!==void 0?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),s.sparse!==void 0&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(a){const o=a[0],c=Ju[s.type],l=fa[s.componentType],h=l.BYTES_PER_ELEMENT,u=h*c,d=s.byteOffset||0,f=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,m=s.normalized===!0;let g,A;if(f&&f!==u){const p=Math.floor(d/f),y="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+p+":"+s.count;let b=t.cache.get(y);b||(g=new l(o,p*f,s.count*f/h),b=new K_(g,f/h),t.cache.add(y,b)),A=new yu(b,c,d%f/h,m)}else o===null?g=new l(s.count*c):g=new l(o,d,s.count*c),A=new En(g,c,m);if(s.sparse!==void 0){const p=Ju.SCALAR,y=fa[s.sparse.indices.componentType],b=s.sparse.indices.byteOffset||0,_=s.sparse.values.byteOffset||0,M=new y(a[1],b,s.sparse.count*p),w=new l(a[2],_,s.sparse.count*c);o!==null&&(A=new En(A.array.slice(),A.itemSize,A.normalized)),A.normalized=!1;for(let S=0,T=M.length;S<T;S++){const C=M[S];if(A.setX(C,w[S*c]),c>=2&&A.setY(C,w[S*c+1]),c>=3&&A.setZ(C,w[S*c+2]),c>=4&&A.setW(C,w[S*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}A.normalized=m}return A})}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,a=t.images[r];let o=this.textureLoader;if(a.uri){const c=n.manager.getHandler(a.uri);c!==null&&(o=c)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,n){const s=this,r=this.json,a=r.textures[e],o=r.images[t],c=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=a.name||o.name||"",h.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(h.name=o.uri);const d=(r.samplers||{})[a.sampler]||{};return h.magFilter=xg[d.magFilter]||zt,h.minFilter=xg[d.minFilter]||Jn,h.wrapS=Eg[d.wrapS]||kr,h.wrapT=Eg[d.wrapT]||kr,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==In&&h.minFilter!==zt,s.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const n=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const a=s.images[e],o=self.URL||self.webkitURL;let c=a.uri||"",l=!1;if(a.bufferView!==void 0)c=n.getDependency("bufferView",a.bufferView).then(function(u){l=!0;const d=new Blob([u],{type:a.mimeType});return c=o.createObjectURL(d),c});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(c).then(function(u){return new Promise(function(d,f){let m=d;t.isImageBitmapLoader===!0&&(m=function(g){const A=new an(g);A.needsUpdate=!0,d(A)}),t.load(la.resolveURL(u,r.path),m,void 0,f)})}).then(function(u){return l===!0&&o.revokeObjectURL(c),es(u,a),u.userData.mimeType=a.mimeType||xI(a.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,s){const r=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),r.extensions[ft.KHR_TEXTURE_TRANSFORM]){const o=n.extensions!==void 0?n.extensions[ft.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const c=r.associations.get(a);a=r.extensions[ft.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,c)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+n.uuid;let c=this.cache.get(o);c||(c=new Ru,Ri.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(o,c)),n=c}else if(e.isLine){const o="LineBasicMaterial:"+n.uuid;let c=this.cache.get(o);c||(c=new fo,Ri.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(o,c)),n=c}if(s||r||a){let o="ClonedMaterial:"+n.uuid+":";s&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let c=this.cache.get(o);c||(c=n.clone(),r&&(c.vertexColors=!0),a&&(c.flatShading=!0),s&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(o,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return Ao}loadMaterial(e){const t=this,n=this.json,s=this.extensions,r=n.materials[e];let a;const o={},c=r.extensions||{},l=[];if(c[ft.KHR_MATERIALS_UNLIT]){const u=s[ft.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),l.push(u.extendParams(o,r,t))}else{const u=r.pbrMetallicRoughness||{};if(o.color=new qe(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const d=u.baseColorFactor;o.color.setRGB(d[0],d[1],d[2],rn),o.opacity=d[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(o,"map",u.baseColorTexture,Kt)),o.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,o.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),a=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,o)})))}r.doubleSided===!0&&(o.side=Ii);const h=r.alphaMode||$u.OPAQUE;if(h===$u.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===$u.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&a!==Cs&&(l.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new Ze(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;o.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&a!==Cs&&(l.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&a!==Cs){const u=r.emissiveFactor;o.emissive=new qe().setRGB(u[0],u[1],u[2],rn)}return r.emissiveTexture!==void 0&&a!==Cs&&l.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture,Kt)),Promise.all(l).then(function(){const u=new a(o);return r.name&&(u.name=r.name),es(u,r),t.associations.set(u,{materials:e}),r.extensions&&cr(s,u,r),u})}createUniqueName(e){const t=vt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function r(o){return n[ft.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(c){return _g(c,o,t)})}const a=[];for(let o=0,c=e.length;o<c;o++){const l=e[o],h=bI(l),u=s[h];if(u)a.push(u.promise);else{let d;l.extensions&&l.extensions[ft.KHR_DRACO_MESH_COMPRESSION]?d=r(l):d=_g(new On,l,t),s[h]={primitive:l,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,s=this.extensions,r=n.meshes[e],a=r.primitives,o=[];for(let c=0,l=a.length;c<l;c++){const h=a[c].material===void 0?AI(this.cache):this.getDependency("material",a[c].material);o.push(h)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(c){const l=c.slice(0,c.length-1),h=c[c.length-1],u=[];for(let f=0,m=h.length;f<m;f++){const g=h[f],A=a[f];let p;const y=l[f];if(A.mode===$n.TRIANGLES||A.mode===$n.TRIANGLE_STRIP||A.mode===$n.TRIANGLE_FAN||A.mode===void 0)p=r.isSkinnedMesh===!0?new X_(g,y):new Jt(g,y),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),A.mode===$n.TRIANGLE_STRIP?p.geometry=Ag(p.geometry,Ip):A.mode===$n.TRIANGLE_FAN&&(p.geometry=Ag(p.geometry,Jh));else if(A.mode===$n.LINES)p=new Kc(g,y);else if(A.mode===$n.LINE_STRIP)p=new Tu(g,y);else if(A.mode===$n.LINE_LOOP)p=new ey(g,y);else if(A.mode===$n.POINTS)p=new ty(g,y);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+A.mode);Object.keys(p.geometry.morphAttributes).length>0&&mI(p,r),p.name=t.createUniqueName(r.name||"mesh_"+e),es(p,r),A.extensions&&cr(s,p,A),t.assignFinalMaterial(p),u.push(p)}for(let f=0,m=u.length;f<m;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return r.extensions&&cr(s,u[0],r),u[0];const d=new nr;r.extensions&&cr(s,d,r),t.associations.set(d,{meshes:e});for(let f=0,m=u.length;f<m;f++)d.add(u[f]);return d})}loadCamera(e){let t;const n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Cn(Fp.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new ku(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),es(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let s=0,r=t.joints.length;s<r;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const r=s.pop(),a=s,o=[],c=[];for(let l=0,h=a.length;l<h;l++){const u=a[l];if(u){o.push(u);const d=new et;r!==null&&d.fromArray(r.array,l*16),c.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new Cu(o,c)})}loadAnimation(e){const t=this.json,n=this,s=t.animations[e],r=s.name?s.name:"animation_"+e,a=[],o=[],c=[],l=[],h=[];for(let u=0,d=s.channels.length;u<d;u++){const f=s.channels[u],m=s.samplers[f.sampler],g=f.target,A=g.node,p=s.parameters!==void 0?s.parameters[m.input]:m.input,y=s.parameters!==void 0?s.parameters[m.output]:m.output;g.node!==void 0&&(a.push(this.getDependency("node",A)),o.push(this.getDependency("accessor",p)),c.push(this.getDependency("accessor",y)),l.push(m),h.push(g))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(u){const d=u[0],f=u[1],m=u[2],g=u[3],A=u[4],p=[];for(let y=0,b=d.length;y<b;y++){const _=d[y],M=f[y],w=m[y],S=g[y],T=A[y];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();const C=n._createAnimationTracks(_,M,w,S,T);if(C)for(let v=0;v<C.length;v++)p.push(C[v])}return new Fu(r,void 0,p)})}createNodeMesh(e){const t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(r){const a=n._getNodeRef(n.meshCache,s.mesh,r);return s.weights!==void 0&&a.traverse(function(o){if(o.isMesh)for(let c=0,l=s.weights.length;c<l;c++)o.morphTargetInfluences[c]=s.weights[c]}),a})}loadNode(e){const t=this.json,n=this,s=t.nodes[e],r=n._loadNodeShallow(e),a=[],o=s.children||[];for(let l=0,h=o.length;l<h;l++)a.push(n.getDependency("node",o[l]));const c=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([r,Promise.all(a),c]).then(function(l){const h=l[0],u=l[1],d=l[2];d!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(d,EI)});for(let f=0,m=u.length;f<m;f++)h.add(u[f]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const r=t.nodes[e],a=r.name?s.createUniqueName(r.name):"",o=[],c=s._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&o.push(c),r.camera!==void 0&&o.push(s.getDependency("camera",r.camera).then(function(l){return s._getNodeRef(s.cameraCache,r.camera,l)})),s._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){o.push(l)}),this.nodeCache[e]=Promise.all(o).then(function(l){let h;if(r.isBone===!0?h=new fA:l.length>1?h=new nr:l.length===1?h=l[0]:h=new Pt,h!==l[0])for(let u=0,d=l.length;u<d;u++)h.add(l[u]);if(r.name&&(h.userData.name=r.name,h.name=a),es(h,r),r.extensions&&cr(n,h,r),r.matrix!==void 0){const u=new et;u.fromArray(r.matrix),h.applyMatrix4(u)}else r.translation!==void 0&&h.position.fromArray(r.translation),r.rotation!==void 0&&h.quaternion.fromArray(r.rotation),r.scale!==void 0&&h.scale.fromArray(r.scale);return s.associations.has(h)||s.associations.set(h,{}),s.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,r=new nr;n.name&&(r.name=s.createUniqueName(n.name)),es(r,n),n.extensions&&cr(t,r,n);const a=n.nodes||[],o=[];for(let c=0,l=a.length;c<l;c++)o.push(s.getDependency("node",a[c]));return Promise.all(o).then(function(c){for(let h=0,u=c.length;h<u;h++)r.add(c[h]);const l=h=>{const u=new Map;for(const[d,f]of s.associations)(d instanceof Ri||d instanceof an)&&u.set(d,f);return h.traverse(d=>{const f=s.associations.get(d);f!=null&&u.set(d,f)}),u};return s.associations=l(r),r})}_createAnimationTracks(e,t,n,s,r){const a=[],o=e.name?e.name:e.uuid,c=[];Rs[r.path]===Rs.weights?e.traverse(function(d){d.morphTargetInfluences&&c.push(d.name?d.name:d.uuid)}):c.push(o);let l;switch(Rs[r.path]){case Rs.weights:l=ra;break;case Rs.rotation:l=aa;break;case Rs.translation:case Rs.scale:l=ca;break;default:n.itemSize===1?l=ra:l=ca;break}const h=s.interpolation!==void 0?pI[s.interpolation]:to,u=this._getArrayFromAccessor(n);for(let d=0,f=c.length;d<f;d++){const m=new l(c[d]+"."+Rs[r.path],t.array,u,h);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),a.push(m)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=td(t.constructor),s=new Float32Array(t.length);for(let r=0,a=t.length;r<a;r++)s[r]=t[r]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const s=this instanceof aa?fI:bg;return new s(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function yI(i,e,t){const n=e.attributes,s=new Mi;if(n.POSITION!==void 0){const o=t.json.accessors[n.POSITION],c=o.min,l=o.max;if(c!==void 0&&l!==void 0){if(s.set(new H(c[0],c[1],c[2]),new H(l[0],l[1],l[2])),o.normalized){const h=td(fa[o.componentType]);s.min.multiplyScalar(h),s.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=e.targets;if(r!==void 0){const o=new H,c=new H;for(let l=0,h=r.length;l<h;l++){const u=r[l];if(u.POSITION!==void 0){const d=t.json.accessors[u.POSITION],f=d.min,m=d.max;if(f!==void 0&&m!==void 0){if(c.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),c.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),c.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),d.normalized){const g=td(fa[d.componentType]);c.multiplyScalar(g)}o.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(o)}i.boundingBox=s;const a=new Bi;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,i.boundingSphere=a}function _g(i,e,t){const n=e.attributes,s=[];function r(a,o){return t.getDependency("accessor",a).then(function(c){i.setAttribute(o,c)})}for(const a in n){const o=Zu[a]||a.toLowerCase();o in i.attributes||s.push(r(n[a],o))}if(e.indices!==void 0&&!i.index){const a=t.getDependency("accessor",e.indices).then(function(o){i.setIndex(o)});s.push(a)}return At.workingColorSpace!==rn&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${At.workingColorSpace}" not supported.`),es(i,e),yI(i,e,t),Promise.all(s).then(function(){return e.targets!==void 0?gI(i,e.targets,t):i})}var wI=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbf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PsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?e:i,r,a=WebAssembly.instantiate(o(s),{}).then(function(p){r=p.instance,r.exports.__wasm_call_ctors()});function o(p){for(var y=new Uint8Array(p.length),b=0;b<p.length;++b){var _=p.charCodeAt(b);y[b]=_>96?_-97:_>64?_-39:_+4}for(var M=0,b=0;b<p.length;++b)y[M++]=y[b]<60?n[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,M)}function c(p,y,b,_,M,w){var S=r.exports.sbrk,T=b+3&-4,C=S(T*_),v=S(M.length),F=new Uint8Array(r.exports.memory.buffer);F.set(M,v);var K=p(C,b,_,v,M.length);if(K==0&&w&&w(C,T,_),y.set(F.subarray(C,C+b*_)),S(C-S(0)),K!=0)throw new Error("Malformed buffer data: "+K)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],d=0;function f(p){var y={object:new Worker(p),pending:0,requests:{}};return y.object.onmessage=function(b){var _=b.data;y.pending-=_.count,y.requests[_.id][_.action](_.value),delete y.requests[_.id]},y}function m(p){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+A.toString(),b=new Blob([y],{type:"text/javascript"}),_=URL.createObjectURL(b),M=0;M<p;++M)u[M]=f(_);URL.revokeObjectURL(_)}function g(p,y,b,_,M){for(var w=u[0],S=1;S<u.length;++S)u[S].pending<w.pending&&(w=u[S]);return new Promise(function(T,C){var v=new Uint8Array(b),F=d++;w.pending+=p,w.requests[F]={resolve:T,reject:C},w.object.postMessage({id:F,count:p,size:y,source:v,mode:_,filter:M},[v.buffer])})}function A(p){a.then(function(){var y=p.data;try{var b=new Uint8Array(y.count*y.size);c(r.exports[y.mode],b,y.count,y.size,y.source,r.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(_){self.postMessage({id:y.id,count:y.count,action:"reject",value:_})}})}return{ready:a,supported:!0,useWorkers:function(p){m(p)},decodeVertexBuffer:function(p,y,b,_,M){c(r.exports.meshopt_decodeVertexBuffer,p,y,b,_,r.exports[l[M]])},decodeIndexBuffer:function(p,y,b,_){c(r.exports.meshopt_decodeIndexBuffer,p,y,b,_)},decodeIndexSequence:function(p,y,b,_){c(r.exports.meshopt_decodeIndexSequence,p,y,b,_)},decodeGltfBuffer:function(p,y,b,_,M,w){c(r.exports[h[M]],p,y,b,_,r.exports[l[w]])},decodeGltfBufferAsync:function(p,y,b,_,M){return u.length>0?g(p,y,b,h[_],l[M]):a.then(function(){var w=new Uint8Array(p*y);return c(r.exports[h[_]],w,p,y,b,r.exports[l[M]]),w})}}})();const yg={type:"change"},nd={type:"start"},wg={type:"end"},rl=new oo,vg=new Ms,vI=Math.cos(70*Fp.DEG2RAD),ln=new H,Qn=2*Math.PI,Bt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},id=1e-6;class CI extends Qy{constructor(e,t=null){super(e,t),this.state=Bt.NONE,this.target=new H,this.cursor=new H,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=.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:Nr.ROTATE,MIDDLE:Nr.DOLLY,RIGHT:Nr.PAN},this.touches={ONE:Fr.ROTATE,TWO:Fr.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new H,this._lastQuaternion=new Vn,this._lastTargetPosition=new H,this._quat=new Vn().setFromUnitVectors(e.up,new H(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new PA,this._sphericalDelta=new PA,this._scale=1,this._panOffset=new H,this._rotateStart=new Ze,this._rotateEnd=new Ze,this._rotateDelta=new Ze,this._panStart=new Ze,this._panEnd=new Ze,this._panDelta=new Ze,this._dollyStart=new Ze,this._dollyEnd=new Ze,this._dollyDelta=new Ze,this._dollyDirection=new H,this._mouse=new Ze,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=II.bind(this),this._onPointerDown=SI.bind(this),this._onPointerUp=MI.bind(this),this._onContextMenu=LI.bind(this),this._onMouseWheel=RI.bind(this),this._onKeyDown=NI.bind(this),this._onTouchStart=FI.bind(this),this._onTouchMove=DI.bind(this),this._onMouseDown=BI.bind(this),this._onMouseMove=TI.bind(this),this._interceptControlDown=PI.bind(this),this._interceptControlUp=kI.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"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(yg),this.update(),this.state=Bt.NONE}update(e=null){const t=this.object.position;ln.copy(t).sub(this.target),ln.applyQuaternion(this._quat),this._spherical.setFromVector3(ln),this.autoRotate&&this.state===Bt.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(n)&&isFinite(s)&&(n<-Math.PI?n+=Qn:n>Math.PI&&(n-=Qn),s<-Math.PI?s+=Qn:s>Math.PI&&(s-=Qn),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(ln.setFromSpherical(this._spherical),ln.applyQuaternion(this._quatInverse),t.copy(this.target).add(ln),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=ln.length();a=this._clampDistance(o*this._scale);const c=o-a;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),r=!!c}else if(this.object.isOrthographicCamera){const o=new H(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=c!==this.object.zoom;const l=new H(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=ln.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(rl.origin.copy(this.object.position),rl.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(rl.direction))<vI?this.object.lookAt(this.target):(vg.setFromNormalAndCoplanarPoint(this.object.up,this.target),rl.intersectPlane(vg,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>id||8*(1-this._lastQuaternion.dot(this.object.quaternion))>id||this._lastTargetPosition.distanceToSquared(this.target)>id?(this.dispatchEvent(yg),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?Qn/60*this.autoRotateSpeed*e:Qn/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){ln.setFromMatrixColumn(t,0),ln.multiplyScalar(-e),this._panOffset.add(ln)}_panUp(e,t){this.screenSpacePanning===!0?ln.setFromMatrixColumn(t,1):(ln.setFromMatrixColumn(t,0),ln.crossVectors(this.object.up,ln)),ln.multiplyScalar(e),this._panOffset.add(ln)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const s=this.object.position;ln.copy(s).sub(this.target);let r=ln.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*r/n.clientHeight,this.object.matrix),this._panUp(2*t*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),s=e-n.left,r=t-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Qn*this._rotateDelta.x/t.clientHeight),this._rotateUp(Qn*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Qn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._panStart.set(n,s)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,s=e.pageY-t.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),s=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Qn*this._rotateDelta.x/t.clientHeight),this._rotateUp(Qn*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,s=e.pageY-t.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new Ze,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function SI(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function II(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function MI(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(wg),this.state=Bt.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function BI(i){let e;switch(i.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case Nr.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=Bt.DOLLY;break;case Nr.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Bt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Bt.ROTATE}break;case Nr.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=Bt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=Bt.PAN}break;default:this.state=Bt.NONE}this.state!==Bt.NONE&&this.dispatchEvent(nd)}function TI(i){switch(this.state){case Bt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case Bt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case Bt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function RI(i){this.enabled===!1||this.enableZoom===!1||this.state!==Bt.NONE||(i.preventDefault(),this.dispatchEvent(nd),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(wg))}function NI(i){this.enabled!==!1&&this._handleKeyDown(i)}function FI(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case Fr.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=Bt.TOUCH_ROTATE;break;case Fr.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=Bt.TOUCH_PAN;break;default:this.state=Bt.NONE}break;case 2:switch(this.touches.TWO){case Fr.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=Bt.TOUCH_DOLLY_PAN;break;case Fr.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=Bt.TOUCH_DOLLY_ROTATE;break;default:this.state=Bt.NONE}break;default:this.state=Bt.NONE}this.state!==Bt.NONE&&this.dispatchEvent(nd)}function DI(i){switch(this._trackPointer(i),this.state){case Bt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case Bt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case Bt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case Bt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=Bt.NONE}}function LI(i){this.enabled!==!1&&i.preventDefault()}function PI(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function kI(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class UI extends _u{constructor(){super();const e=new $r;e.deleteAttribute("uv");const t=new Ao({side:Sn}),n=new Ao,s=new FA(16777215,900,28,2);s.position.set(.418,16.199,.3),this.add(s);const r=new Jt(e,t);r.position.set(-.757,13.219,.717),r.scale.set(31.713,28.305,28.591),this.add(r);const a=new mA(e,n,6),o=new Pt;o.position.set(-10.906,2.009,1.846),o.rotation.set(0,-.195,0),o.scale.set(2.328,7.905,4.651),o.updateMatrix(),a.setMatrixAt(0,o.matrix),o.position.set(-5.607,-.754,-.758),o.rotation.set(0,.994,0),o.scale.set(1.97,1.534,3.955),o.updateMatrix(),a.setMatrixAt(1,o.matrix),o.position.set(6.167,.857,7.803),o.rotation.set(0,.561,0),o.scale.set(3.927,6.285,3.687),o.updateMatrix(),a.setMatrixAt(2,o.matrix),o.position.set(-2.017,.018,6.124),o.rotation.set(0,.333,0),o.scale.set(2.002,4.566,2.064),o.updateMatrix(),a.setMatrixAt(3,o.matrix),o.position.set(2.291,-.756,-2.621),o.rotation.set(0,-.286,0),o.scale.set(1.546,1.552,1.496),o.updateMatrix(),a.setMatrixAt(4,o.matrix),o.position.set(-2.193,-.369,-5.547),o.rotation.set(0,.516,0),o.scale.set(3.875,3.487,2.986),o.updateMatrix(),a.setMatrixAt(5,o.matrix),this.add(a);const c=new Jt(e,pa(50));c.position.set(-16.116,14.37,8.208),c.scale.set(.1,2.428,2.739),this.add(c);const l=new Jt(e,pa(50));l.position.set(-16.109,18.021,-8.207),l.scale.set(.1,2.425,2.751),this.add(l);const h=new Jt(e,pa(17));h.position.set(14.904,12.198,-1.832),h.scale.set(.15,4.265,6.331),this.add(h);const u=new Jt(e,pa(43));u.position.set(-.462,8.89,14.52),u.scale.set(4.38,5.441,.088),this.add(u);const d=new Jt(e,pa(20));d.position.set(3.235,11.486,-12.541),d.scale.set(2.5,2,.1),this.add(d);const f=new Jt(e,pa(100));f.position.set(0,20,0),f.scale.set(1,.1,1),this.add(f)}dispose(){const e=new Set;this.traverse(t=>{t.isMesh&&(e.add(t.geometry),e.add(t.material))});for(const t of e)t.dispose()}}function pa(i){const e=new Cs;return e.color.setScalar(i),e}function OI(i){if(!(typeof window>"u")){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=i,document.head.appendChild(e),i}}function Aa(i,e){var t=i.__state.conversionName.toString(),n=Math.round(i.r),s=Math.round(i.g),r=Math.round(i.b),a=i.a,o=Math.round(i.h),c=i.s.toFixed(1),l=i.v.toFixed(1);if(e||t==="THREE_CHAR_HEX"||t==="SIX_CHAR_HEX"){for(var h=i.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}else{if(t==="CSS_RGB")return"rgb("+n+","+s+","+r+")";if(t==="CSS_RGBA")return"rgba("+n+","+s+","+r+","+a+")";if(t==="HEX")return"0x"+i.hex.toString(16);if(t==="RGB_ARRAY")return"["+n+","+s+","+r+"]";if(t==="RGBA_ARRAY")return"["+n+","+s+","+r+","+a+"]";if(t==="RGB_OBJ")return"{r:"+n+",g:"+s+",b:"+r+"}";if(t==="RGBA_OBJ")return"{r:"+n+",g:"+s+",b:"+r+",a:"+a+"}";if(t==="HSV_OBJ")return"{h:"+o+",s:"+c+",v:"+l+"}";if(t==="HSVA_OBJ")return"{h:"+o+",s:"+c+",v:"+l+",a:"+a+"}"}return"unknown format"}var Cg=Array.prototype.forEach,yo=Array.prototype.slice,ue={BREAK:{},extend:function(e){return this.each(yo.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach((function(s){this.isUndefined(t[s])||(e[s]=t[s])}).bind(this))},this),e},defaults:function(e){return this.each(yo.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach((function(s){this.isUndefined(e[s])&&(e[s]=t[s])}).bind(this))},this),e},compose:function(){var e=yo.call(arguments);return function(){for(var t=yo.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e){if(Cg&&e.forEach&&e.forEach===Cg)e.forEach(t,n);else if(e.length===e.length+0){var s=void 0,r=void 0;for(s=0,r=e.length;s<r;s++)if(s in e&&t.call(n,e[s],s)===this.BREAK)return}else for(var a in e)if(t.call(n,e[a],a)===this.BREAK)return}},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var s=void 0;return function(){var r=this,a=arguments;function o(){s=null,n||e.apply(r,a)}var c=n||!s;clearTimeout(s),s=setTimeout(o,t),c&&e.apply(r,a)}},toArray:function(e){return e.toArray?e.toArray():yo.call(e)},isUndefined:function(e){return e===void 0},isNull:function(e){return e===null},isNaN:(function(i){function e(t){return i.apply(this,arguments)}return e.toString=function(){return i.toString()},e})(function(i){return isNaN(i)}),isArray:Array.isArray||function(i){return i.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return e===!1||e===!0},isFunction:function(e){return e instanceof Function}},QI=[{litmus:ue.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return t===null?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:Aa},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return t===null?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:Aa},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return t===null?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:Aa},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return t===null?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:Aa}}},{litmus:ue.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:ue.isArray,conversions:{RGB_ARRAY:{read:function(e){return e.length!==3?!1:{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return e.length!==4?!1:{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:ue.isObject,conversions:{RGBA_OBJ:{read:function(e){return ue.isNumber(e.r)&&ue.isNumber(e.g)&&ue.isNumber(e.b)&&ue.isNumber(e.a)?{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return ue.isNumber(e.r)&&ue.isNumber(e.g)&&ue.isNumber(e.b)?{space:"RGB",r:e.r,g:e.g,b:e.b}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return ue.isNumber(e.h)&&ue.isNumber(e.s)&&ue.isNumber(e.v)&&ue.isNumber(e.a)?{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return ue.isNumber(e.h)&&ue.isNumber(e.s)&&ue.isNumber(e.v)?{space:"HSV",h:e.h,s:e.s,v:e.v}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],wo=void 0,al=void 0,sd=function(){al=!1;var e=arguments.length>1?ue.toArray(arguments):arguments[0];return ue.each(QI,function(t){if(t.litmus(e))return ue.each(t.conversions,function(n,s){if(wo=n.read(e),al===!1&&wo!==!1)return al=wo,wo.conversionName=s,wo.conversion=n,ue.BREAK}),ue.BREAK}),al},Sg=void 0,ol={hsv_to_rgb:function(e,t,n){var s=Math.floor(e/60)%6,r=e/60-Math.floor(e/60),a=n*(1-t),o=n*(1-r*t),c=n*(1-(1-r)*t),l=[[n,c,a],[o,n,a],[a,n,c],[a,o,n],[c,a,n],[n,a,o]][s];return{r:l[0]*255,g:l[1]*255,b:l[2]*255}},rgb_to_hsv:function(e,t,n){var s=Math.min(e,t,n),r=Math.max(e,t,n),a=r-s,o=void 0,c=void 0;if(r!==0)c=a/r;else return{h:NaN,s:0,v:0};return e===r?o=(t-n)/a:t===r?o=2+(n-e)/a:o=4+(e-t)/a,o/=6,o<0&&(o+=1),{h:o*360,s:c,v:r/255}},rgb_to_hex:function(e,t,n){var s=this.hex_with_component(0,2,e);return s=this.hex_with_component(s,1,t),s=this.hex_with_component(s,0,n),s},component_from_hex:function(e,t){return e>>t*8&255},hex_with_component:function(e,t,n){return n<<(Sg=t*8)|e&~(255<<Sg)}},GI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},gi=function(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")},mi=(function(){function i(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}})(),Ns=function i(e,t,n){e===null&&(e=Function.prototype);var s=Object.getOwnPropertyDescriptor(e,t);if(s===void 0){var r=Object.getPrototypeOf(e);return r===null?void 0:i(r,t,n)}else{if("value"in s)return s.value;var a=s.get;return a===void 0?void 0:a.call(n)}},Fs=function(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)},Ds=function(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i},pn=(function(){function i(){if(gi(this,i),this.__state=sd.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return mi(i,[{key:"toString",value:function(){return Aa(this)}},{key:"toHexString",value:function(){return Aa(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),i})();function rd(i,e,t){Object.defineProperty(i,e,{get:function(){return this.__state.space==="RGB"?this.__state[e]:(pn.recalculateRGB(this,e,t),this.__state[e])},set:function(s){this.__state.space!=="RGB"&&(pn.recalculateRGB(this,e,t),this.__state.space="RGB"),this.__state[e]=s}})}function ad(i,e){Object.defineProperty(i,e,{get:function(){return this.__state.space==="HSV"?this.__state[e]:(pn.recalculateHSV(this),this.__state[e])},set:function(n){this.__state.space!=="HSV"&&(pn.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=n}})}pn.recalculateRGB=function(i,e,t){if(i.__state.space==="HEX")i.__state[e]=ol.component_from_hex(i.__state.hex,t);else if(i.__state.space==="HSV")ue.extend(i.__state,ol.hsv_to_rgb(i.__state.h,i.__state.s,i.__state.v));else throw new Error("Corrupted color state")},pn.recalculateHSV=function(i){var e=ol.rgb_to_hsv(i.r,i.g,i.b);ue.extend(i.__state,{s:e.s,v:e.v}),ue.isNaN(e.h)?ue.isUndefined(i.__state.h)&&(i.__state.h=0):i.__state.h=e.h},pn.COMPONENTS=["r","g","b","h","s","v","hex","a"],rd(pn.prototype,"r",2),rd(pn.prototype,"g",1),rd(pn.prototype,"b",0),ad(pn.prototype,"h"),ad(pn.prototype,"s"),ad(pn.prototype,"v"),Object.defineProperty(pn.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(pn.prototype,"hex",{get:function(){return this.__state.space!=="HEX"&&(this.__state.hex=ol.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}});var lr=(function(){function i(e,t){gi(this,i),this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0}return mi(i,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),i})(),HI={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},Ig={};ue.each(HI,function(i,e){ue.each(i,function(t){Ig[t]=e})});var zI=/(\d+(\.\d+)?)px/;function Di(i){if(i==="0"||ue.isUndefined(i))return 0;var e=i.match(zI);return ue.isNull(e)?0:parseFloat(e[1])}var te={makeSelectable:function(e,t){e===void 0||e.style===void 0||(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){var s=n,r=t;ue.isUndefined(r)&&(r=!0),ue.isUndefined(s)&&(s=!0),e.style.position="absolute",r&&(e.style.left=0,e.style.right=0),s&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,s){var r=n||{},a=Ig[t];if(!a)throw new Error("Event type "+t+" not supported.");var o=document.createEvent(a);switch(a){case"MouseEvents":{var c=r.x||r.clientX||0,l=r.y||r.clientY||0;o.initMouseEvent(t,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,c,l,!1,!1,!1,!1,0,null);break}case"KeyboardEvents":{var h=o.initKeyboardEvent||o.initKeyEvent;ue.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),h(t,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break}default:{o.initEvent(t,r.bubbles||!1,r.cancelable||!0);break}}ue.defaults(o,s),e.dispatchEvent(o)},bind:function(e,t,n,s){var r=s||!1;return e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on"+t,n),te},unbind:function(e,t,n,s){var r=s||!1;return e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on"+t,n),te},addClass:function(e,t){if(e.className===void 0)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);n.indexOf(t)===-1&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return te},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),s=n.indexOf(t);s!==-1&&(n.splice(s,1),e.className=n.join(" "))}else e.className=void 0;return te},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return Di(t["border-left-width"])+Di(t["border-right-width"])+Di(t["padding-left"])+Di(t["padding-right"])+Di(t.width)},getHeight:function(e){var t=getComputedStyle(e);return Di(t["border-top-width"])+Di(t["border-bottom-width"])+Di(t["padding-top"])+Di(t["padding-bottom"])+Di(t.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)do n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;while(t);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},Mg=(function(i){Fs(e,i);function e(t,n){gi(this,e);var s=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=s;s.__prev=s.getValue(),s.__checkbox=document.createElement("input"),s.__checkbox.setAttribute("type","checkbox");function a(){r.setValue(!r.__prev)}return te.bind(s.__checkbox,"change",a,!1),s.domElement.appendChild(s.__checkbox),s.updateDisplay(),s}return mi(e,[{key:"setValue",value:function(n){var s=Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),s}},{key:"updateDisplay",value:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(lr),VI=(function(i){Fs(e,i);function e(t,n,s){gi(this,e);var r=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),a=s,o=r;if(r.__select=document.createElement("select"),ue.isArray(a)){var c={};ue.each(a,function(l){c[l]=l}),a=c}return ue.each(a,function(l,h){var u=document.createElement("option");u.innerHTML=h,u.setAttribute("value",l),o.__select.appendChild(u)}),r.updateDisplay(),te.bind(r.__select,"change",function(){var l=this.options[this.selectedIndex].value;o.setValue(l)}),r.domElement.appendChild(r.__select),r}return mi(e,[{key:"setValue",value:function(n){var s=Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),s}},{key:"updateDisplay",value:function(){return te.isActive(this.__select)?this:(this.__select.value=this.getValue(),Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e})(lr),WI=(function(i){Fs(e,i);function e(t,n){gi(this,e);var s=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=s;function a(){r.setValue(r.__input.value)}function o(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}return s.__input=document.createElement("input"),s.__input.setAttribute("type","text"),te.bind(s.__input,"keyup",a),te.bind(s.__input,"change",a),te.bind(s.__input,"blur",o),te.bind(s.__input,"keydown",function(c){c.keyCode===13&&this.blur()}),s.updateDisplay(),s.domElement.appendChild(s.__input),s}return mi(e,[{key:"updateDisplay",value:function(){return te.isActive(this.__input)||(this.__input.value=this.getValue()),Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(lr);function Bg(i){var e=i.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var Tg=(function(i){Fs(e,i);function e(t,n,s){gi(this,e);var r=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),a=s||{};return r.__min=a.min,r.__max=a.max,r.__step=a.step,ue.isUndefined(r.__step)?r.initialValue===0?r.__impliedStep=1:r.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(r.initialValue))/Math.LN10))/10:r.__impliedStep=r.__step,r.__precision=Bg(r.__impliedStep),r}return mi(e,[{key:"setValue",value:function(n){var s=n;return this.__min!==void 0&&s<this.__min?s=this.__min:this.__max!==void 0&&s>this.__max&&(s=this.__max),this.__step!==void 0&&s%this.__step!==0&&(s=Math.round(s/this.__step)*this.__step),Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,s)}},{key:"min",value:function(n){return this.__min=n,this}},{key:"max",value:function(n){return this.__max=n,this}},{key:"step",value:function(n){return this.__step=n,this.__impliedStep=n,this.__precision=Bg(n),this}}]),e})(lr);function qI(i,e){var t=Math.pow(10,e);return Math.round(i*t)/t}var cl=(function(i){Fs(e,i);function e(t,n,s){gi(this,e);var r=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,s));r.__truncationSuspended=!1;var a=r,o=void 0;function c(){var m=parseFloat(a.__input.value);ue.isNaN(m)||a.setValue(m)}function l(){a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}function h(){l()}function u(m){var g=o-m.clientY;a.setValue(a.getValue()+g*a.__impliedStep),o=m.clientY}function d(){te.unbind(window,"mousemove",u),te.unbind(window,"mouseup",d),l()}function f(m){te.bind(window,"mousemove",u),te.bind(window,"mouseup",d),o=m.clientY}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),te.bind(r.__input,"change",c),te.bind(r.__input,"blur",h),te.bind(r.__input,"mousedown",f),te.bind(r.__input,"keydown",function(m){m.keyCode===13&&(a.__truncationSuspended=!0,this.blur(),a.__truncationSuspended=!1,l())}),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return mi(e,[{key:"updateDisplay",value:function(){return this.__input.value=this.__truncationSuspended?this.getValue():qI(this.getValue(),this.__precision),Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(Tg);function Rg(i,e,t,n,s){return n+(s-n)*((i-e)/(t-e))}var od=(function(i){Fs(e,i);function e(t,n,s,r,a){gi(this,e);var o=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:s,max:r,step:a})),c=o;o.__background=document.createElement("div"),o.__foreground=document.createElement("div"),te.bind(o.__background,"mousedown",l),te.bind(o.__background,"touchstart",d),te.addClass(o.__background,"slider"),te.addClass(o.__foreground,"slider-fg");function l(g){document.activeElement.blur(),te.bind(window,"mousemove",h),te.bind(window,"mouseup",u),h(g)}function h(g){g.preventDefault();var A=c.__background.getBoundingClientRect();return c.setValue(Rg(g.clientX,A.left,A.right,c.__min,c.__max)),!1}function u(){te.unbind(window,"mousemove",h),te.unbind(window,"mouseup",u),c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}function d(g){g.touches.length===1&&(te.bind(window,"touchmove",f),te.bind(window,"touchend",m),f(g))}function f(g){var A=g.touches[0].clientX,p=c.__background.getBoundingClientRect();c.setValue(Rg(A,p.left,p.right,c.__min,c.__max))}function m(){te.unbind(window,"touchmove",f),te.unbind(window,"touchend",m),c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}return o.updateDisplay(),o.__background.appendChild(o.__foreground),o.domElement.appendChild(o.__background),o}return mi(e,[{key:"updateDisplay",value:function(){var n=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=n*100+"%",Ns(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e})(Tg),Ng=(function(i){Fs(e,i);function e(t,n,s){gi(this,e);var r=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),a=r;return r.__button=document.createElement("div"),r.__button.innerHTML=s===void 0?"Fire":s,te.bind(r.__button,"click",function(o){return o.preventDefault(),a.fire(),!1}),te.addClass(r.__button,"button"),r.domElement.appendChild(r.__button),r}return mi(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e})(lr),cd=(function(i){Fs(e,i);function e(t,n){gi(this,e);var s=Ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));s.__color=new pn(s.getValue()),s.__temp=new pn(0);var r=s;s.domElement=document.createElement("div"),te.makeSelectable(s.domElement,!1),s.__selector=document.createElement("div"),s.__selector.className="selector",s.__saturation_field=document.createElement("div"),s.__saturation_field.className="saturation-field",s.__field_knob=document.createElement("div"),s.__field_knob.className="field-knob",s.__field_knob_border="2px solid ",s.__hue_knob=document.createElement("div"),s.__hue_knob.className="hue-knob",s.__hue_field=document.createElement("div"),s.__hue_field.className="hue-field",s.__input=document.createElement("input"),s.__input.type="text",s.__input_textShadow="0 1px 1px ",te.bind(s.__input,"keydown",function(g){g.keyCode===13&&u.call(this)}),te.bind(s.__input,"blur",u),te.bind(s.__selector,"mousedown",function(){te.addClass(this,"drag").bind(window,"mouseup",function(){te.removeClass(r.__selector,"drag")})}),te.bind(s.__selector,"touchstart",function(){te.addClass(this,"drag").bind(window,"touchend",function(){te.removeClass(r.__selector,"drag")})});var a=document.createElement("div");ue.extend(s.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),ue.extend(s.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:s.__field_knob_border+(s.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),ue.extend(s.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),ue.extend(s.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),ue.extend(a.style,{width:"100%",height:"100%",background:"none"}),Fg(a,"top","rgba(0,0,0,0)","#000"),ue.extend(s.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),jI(s.__hue_field),ue.extend(s.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:s.__input_textShadow+"rgba(0,0,0,0.7)"}),te.bind(s.__saturation_field,"mousedown",o),te.bind(s.__saturation_field,"touchstart",o),te.bind(s.__field_knob,"mousedown",o),te.bind(s.__field_knob,"touchstart",o),te.bind(s.__hue_field,"mousedown",c),te.bind(s.__hue_field,"touchstart",c);function o(g){f(g),te.bind(window,"mousemove",f),te.bind(window,"touchmove",f),te.bind(window,"mouseup",l),te.bind(window,"touchend",l)}function c(g){m(g),te.bind(window,"mousemove",m),te.bind(window,"touchmove",m),te.bind(window,"mouseup",h),te.bind(window,"touchend",h)}function l(){te.unbind(window,"mousemove",f),te.unbind(window,"touchmove",f),te.unbind(window,"mouseup",l),te.unbind(window,"touchend",l),d()}function h(){te.unbind(window,"mousemove",m),te.unbind(window,"touchmove",m),te.unbind(window,"mouseup",h),te.unbind(window,"touchend",h),d()}function u(){var g=sd(this.value);g!==!1?(r.__color.__state=g,r.setValue(r.__color.toOriginal())):this.value=r.__color.toString()}function d(){r.__onFinishChange&&r.__onFinishChange.call(r,r.__color.toOriginal())}s.__saturation_field.appendChild(a),s.__selector.appendChild(s.__field_knob),s.__selector.appendChild(s.__saturation_field),s.__selector.appendChild(s.__hue_field),s.__hue_field.appendChild(s.__hue_knob),s.domElement.appendChild(s.__input),s.domElement.appendChild(s.__selector),s.updateDisplay();function f(g){g.type.indexOf("touch")===-1&&g.preventDefault();var A=r.__saturation_field.getBoundingClientRect(),p=g.touches&&g.touches[0]||g,y=p.clientX,b=p.clientY,_=(y-A.left)/(A.right-A.left),M=1-(b-A.top)/(A.bottom-A.top);return M>1?M=1:M<0&&(M=0),_>1?_=1:_<0&&(_=0),r.__color.v=M,r.__color.s=_,r.setValue(r.__color.toOriginal()),!1}function m(g){g.type.indexOf("touch")===-1&&g.preventDefault();var A=r.__hue_field.getBoundingClientRect(),p=g.touches&&g.touches[0]||g,y=p.clientY,b=1-(y-A.top)/(A.bottom-A.top);return b>1?b=1:b<0&&(b=0),r.__color.h=b*360,r.setValue(r.__color.toOriginal()),!1}return s}return mi(e,[{key:"updateDisplay",value:function(){var n=sd(this.getValue());if(n!==!1){var s=!1;ue.each(pn.COMPONENTS,function(o){if(!ue.isUndefined(n[o])&&!ue.isUndefined(this.__color.__state[o])&&n[o]!==this.__color.__state[o])return s=!0,{}},this),s&&ue.extend(this.__color.__state,n)}ue.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,a=255-r;ue.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px",this.__temp.s=1,this.__temp.v=1,Fg(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),ue.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+a+","+a+","+a+",.7)"})}}]),e})(lr),KI=["-moz-","-o-","-webkit-","-ms-",""];function Fg(i,e,t,n){i.style.background="",ue.each(KI,function(s){i.style.cssText+="background: "+s+"linear-gradient("+e+", "+t+" 0%, "+n+" 100%); "})}function jI(i){i.style.background="",i.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",i.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var XI={load:function(e,t){var n=t||document,s=n.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=e,n.getElementsByTagName("head")[0].appendChild(s)},inject:function(e,t){var n=t||document,s=document.createElement("style");s.type="text/css",s.innerHTML=e;var r=n.getElementsByTagName("head")[0];try{r.appendChild(s)}catch{}}},YI=`<div id="dg-save" class="dg dialogue">Here's the new load parameter for your <code>GUI</code>'s constructor:@@ -3836,28 +3836,183 @@ void main() {</div>-</div>`,zI=function(e,t){var n=e[t];return ue.isArray(arguments[2])||ue.isObject(arguments[2])?new PI(e,t,arguments[2]):ue.isNumber(n)?ue.isNumber(arguments[2])&&ue.isNumber(arguments[3])?ue.isNumber(arguments[4])?new td(e,t,arguments[2],arguments[3],arguments[4]):new td(e,t,arguments[2],arguments[3]):ue.isNumber(arguments[4])?new il(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new il(e,t,{min:arguments[2],max:arguments[3]}):ue.isString(n)?new kI(e,t):ue.isFunction(n)?new Sg(e,t,""):ue.isBoolean(n)?new yg(e,t):null};function VI(i){setTimeout(i,1e3/60)}var WI=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||VI,qI=(function(){function i(){Ai(this,i),this.backgroundElement=document.createElement("div"),ue.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),te.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),ue.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;te.bind(this.backgroundElement,"click",function(){e.hide()})}return gi(i,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),ue.defer(function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"})}},{key:"hide",value:function(){var t=this,n=function s(){t.domElement.style.display="none",t.backgroundElement.style.display="none",te.unbind(t.domElement,"webkitTransitionEnd",s),te.unbind(t.domElement,"transitionend",s),te.unbind(t.domElement,"oTransitionEnd",s)};te.bind(this.domElement,"webkitTransitionEnd",n),te.bind(this.domElement,"transitionend",n),te.bind(this.domElement,"oTransitionEnd",n),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-te.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-te.getHeight(this.domElement)/2+"px"}}]),i})(),KI=RI(`.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}-`);GI.inject(KI);var Mg="dg",Bg=72,Tg=20,Eo="Default",_o=(function(){try{return!!window.localStorage}catch{return!1}})(),yo=void 0,Rg=!0,pa=void 0,id=!1,Ng=[],Nt=function i(e){var t=this,n=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),te.addClass(this.domElement,Mg),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=ue.defaults(n,{closeOnTop:!1,autoPlace:!0,width:i.DEFAULT_WIDTH}),n=ue.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),ue.isUndefined(n.load)?n.load={preset:Eo}:n.preset&&(n.load.preset=n.preset),ue.isUndefined(n.parent)&&n.hideable&&Ng.push(this),n.resizable=ue.isUndefined(n.parent)&&n.resizable,n.autoPlace&&ue.isUndefined(n.scrollable)&&(n.scrollable=!0);var s=_o&&localStorage.getItem(Aa(this,"isLocal"))==="true",r=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return t.parent?t.getRoot().preset:n.load.preset},set:function(d){t.parent?t.getRoot().preset=d:n.load.preset=d,JI(this),t.revert()}},width:{get:function(){return n.width},set:function(d){n.width=d,od(t,d)}},name:{get:function(){return n.name},set:function(d){n.name=d,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(d){n.closed=d,n.closed?te.addClass(t.__ul,i.CLASS_CLOSED):te.removeClass(t.__ul,i.CLASS_CLOSED),this.onResize(),t.__closeButton&&(t.__closeButton.innerHTML=d?i.TEXT_OPEN:i.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return s},set:function(d){_o&&(s=d,d?te.bind(window,"unload",r):te.unbind(window,"unload",r),localStorage.setItem(Aa(t,"isLocal"),d))}}}),ue.isUndefined(n.parent)){if(this.closed=n.closed||!1,te.addClass(this.domElement,i.CLASS_MAIN),te.makeSelectable(this.domElement,!1),_o&&s){t.useLocalStorage=!0;var o=localStorage.getItem(Aa(this,"gui"));o&&(n.load=JSON.parse(o))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=i.TEXT_CLOSED,te.addClass(this.__closeButton,i.CLASS_CLOSE_BUTTON),n.closeOnTop?(te.addClass(this.__closeButton,i.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(te.addClass(this.__closeButton,i.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),te.bind(this.__closeButton,"click",function(){t.closed=!t.closed})}else{n.closed===void 0&&(n.closed=!0);var c=document.createTextNode(n.name);te.addClass(c,"controller-name"),a=sd(t,c);var l=function(d){return d.preventDefault(),t.closed=!t.closed,!1};te.addClass(this.__ul,i.CLASS_CLOSED),te.addClass(a,"title"),te.bind(a,"click",l),n.closed||(this.closed=!1)}n.autoPlace&&(ue.isUndefined(n.parent)&&(Rg&&(pa=document.createElement("div"),te.addClass(pa,Mg),te.addClass(pa,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(pa),Rg=!1),pa.appendChild(this.domElement),te.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||od(t,n.width)),this.__resizeHandler=function(){t.onResizeDebounced()},te.bind(window,"resize",this.__resizeHandler),te.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),te.bind(this.__ul,"transitionend",this.__resizeHandler),te.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&jI(this),r=function(){_o&&localStorage.getItem(Aa(t,"isLocal"))==="true"&&localStorage.setItem(Aa(t,"gui"),JSON.stringify(t.getSaveObject()))},this.saveToLocalStorageIfPossible=r;function h(){var u=t.getRoot();u.width+=1,ue.defer(function(){u.width-=1})}n.parent||h()};Nt.toggleHide=function(){id=!id,ue.each(Ng,function(i){i.domElement.style.display=id?"none":""})},Nt.CLASS_AUTO_PLACE="a",Nt.CLASS_AUTO_PLACE_CONTAINER="ac",Nt.CLASS_MAIN="main",Nt.CLASS_CONTROLLER_ROW="cr",Nt.CLASS_TOO_TALL="taller-than-window",Nt.CLASS_CLOSED="closed",Nt.CLASS_CLOSE_BUTTON="close-button",Nt.CLASS_CLOSE_TOP="close-top",Nt.CLASS_CLOSE_BOTTOM="close-bottom",Nt.CLASS_DRAG="drag",Nt.DEFAULT_WIDTH=245,Nt.TEXT_CLOSED="Close Controls",Nt.TEXT_OPEN="Open Controls",Nt._keydownHandler=function(i){document.activeElement.type!=="text"&&(i.which===Bg||i.keyCode===Bg)&&Nt.toggleHide()},te.bind(window,"keydown",Nt._keydownHandler,!1),ue.extend(Nt.prototype,{add:function(e,t){return wo(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return wo(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;ue.defer(function(){t.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&pa.removeChild(this.domElement);var e=this;ue.each(this.__folders,function(t){e.removeFolder(t)}),te.unbind(window,"keydown",Nt._keydownHandler,!1),Fg(this)},addFolder:function(e){if(this.__folders[e]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new Nt(t);this.__folders[e]=n;var s=sd(this,n.domElement);return te.addClass(s,"folder"),n},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],Fg(e);var t=this;ue.each(e.__folders,function(n){e.removeFolder(n)}),ue.defer(function(){t.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=te.getOffset(e.__ul).top,n=0;ue.each(e.__ul.childNodes,function(s){e.autoPlace&&s===e.__save_row||(n+=te.getHeight(s))}),window.innerHeight-t-Tg<n?(te.addClass(e.domElement,Nt.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-Tg+"px"):(te.removeClass(e.domElement,Nt.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&ue.defer(function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"}),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:ue.debounce(function(){this.onResize()},50),remember:function(){if(ue.isUndefined(yo)&&(yo=new qI,yo.domElement.innerHTML=HI),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;ue.each(Array.prototype.slice.call(arguments),function(t){e.__rememberedObjects.length===0&&YI(e),e.__rememberedObjects.indexOf(t)===-1&&e.__rememberedObjects.push(t)}),this.autoPlace&&od(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=sl(this)),e.folders={},ue.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=sl(this),rd(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[Eo]=sl(this,!0)),this.load.remembered[e]=sl(this),this.preset=e,ad(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){ue.each(this.__controllers,function(t){this.getRoot().load.remembered?Dg(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),ue.each(this.__folders,function(t){t.revert(t)}),e||rd(this.getRoot(),!1)},listen:function(e){var t=this.__listening.length===0;this.__listening.push(e),t&&Pg(this.__listening)},updateDisplay:function(){ue.each(this.__controllers,function(e){e.updateDisplay()}),ue.each(this.__folders,function(e){e.updateDisplay()})}});function sd(i,e,t){var n=document.createElement("li");return e&&n.appendChild(e),t?i.__ul.insertBefore(n,t):i.__ul.appendChild(n),i.onResize(),n}function Fg(i){te.unbind(window,"resize",i.__resizeHandler),i.saveToLocalStorageIfPossible&&te.unbind(window,"unload",i.saveToLocalStorageIfPossible)}function rd(i,e){var t=i.__preset_select[i.__preset_select.selectedIndex];e?t.innerHTML=t.value+"*":t.innerHTML=t.value}function XI(i,e,t){if(t.__li=e,t.__gui=i,ue.extend(t,{options:function(a){if(arguments.length>1){var o=t.__li.nextElementSibling;return t.remove(),wo(i,t.object,t.property,{before:o,factoryArgs:[ue.toArray(arguments)]})}if(ue.isArray(a)||ue.isObject(a)){var c=t.__li.nextElementSibling;return t.remove(),wo(i,t.object,t.property,{before:c,factoryArgs:[a]})}},name:function(a){return t.__li.firstElementChild.firstElementChild.innerHTML=a,t},listen:function(){return t.__gui.listen(t),t},remove:function(){return t.__gui.remove(t),t}}),t instanceof td){var n=new il(t.object,t.property,{min:t.__min,max:t.__max,step:t.__step});ue.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(r){var a=t[r],o=n[r];t[r]=n[r]=function(){var c=Array.prototype.slice.call(arguments);return o.apply(n,c),a.apply(t,c)}}),te.addClass(e,"has-slider"),t.domElement.insertBefore(n.domElement,t.domElement.firstElementChild)}else if(t instanceof il){var s=function(a){if(ue.isNumber(t.__min)&&ue.isNumber(t.__max)){var o=t.__li.firstElementChild.firstElementChild.innerHTML,c=t.__gui.__listening.indexOf(t)>-1;t.remove();var l=wo(i,t.object,t.property,{before:t.__li.nextElementSibling,factoryArgs:[t.__min,t.__max,t.__step]});return l.name(o),c&&l.listen(),l}return a};t.min=ue.compose(s,t.min),t.max=ue.compose(s,t.max)}else t instanceof yg?(te.bind(e,"click",function(){te.fakeEvent(t.__checkbox,"click")}),te.bind(t.__checkbox,"click",function(r){r.stopPropagation()})):t instanceof Sg?(te.bind(e,"click",function(){te.fakeEvent(t.__button,"click")}),te.bind(e,"mouseover",function(){te.addClass(t.__button,"hover")}),te.bind(e,"mouseout",function(){te.removeClass(t.__button,"hover")})):t instanceof nd&&(te.addClass(e,"color"),t.updateDisplay=ue.compose(function(r){return e.style.borderLeftColor=t.__color.toString(),r},t.updateDisplay),t.updateDisplay());t.setValue=ue.compose(function(r){return i.getRoot().__preset_select&&t.isModified()&&rd(i.getRoot(),!0),r},t.setValue)}function Dg(i,e){var t=i.getRoot(),n=t.__rememberedObjects.indexOf(e.object);if(n!==-1){var s=t.__rememberedObjectIndecesToControllers[n];if(s===void 0&&(s={},t.__rememberedObjectIndecesToControllers[n]=s),s[e.property]=e,t.load&&t.load.remembered){var r=t.load.remembered,a=void 0;if(r[i.preset])a=r[i.preset];else if(r[Eo])a=r[Eo];else return;if(a[n]&&a[n][e.property]!==void 0){var o=a[n][e.property];e.initialValue=o,e.setValue(o)}}}}function wo(i,e,t,n){if(e[t]===void 0)throw new Error('Object "'+e+'" has no property "'+t+'"');var s=void 0;if(n.color)s=new nd(e,t);else{var r=[e,t].concat(n.factoryArgs);s=zI.apply(i,r)}n.before instanceof or&&(n.before=n.before.__li),Dg(i,s),te.addClass(s.domElement,"c");var a=document.createElement("span");te.addClass(a,"property-name"),a.innerHTML=s.property;var o=document.createElement("div");o.appendChild(a),o.appendChild(s.domElement);var c=sd(i,o,n.before);return te.addClass(c,Nt.CLASS_CONTROLLER_ROW),s instanceof nd?te.addClass(c,"color"):te.addClass(c,FI(s.getValue())),XI(i,c,s),i.__controllers.push(s),s}function Aa(i,e){return document.location.href+"."+e}function ad(i,e,t){var n=document.createElement("option");n.innerHTML=e,n.value=e,i.__preset_select.appendChild(n),t&&(i.__preset_select.selectedIndex=i.__preset_select.length-1)}function Lg(i,e){e.style.display=i.useLocalStorage?"block":"none"}function YI(i){var e=i.__save_row=document.createElement("li");te.addClass(i.domElement,"has-save"),i.__ul.insertBefore(e,i.__ul.firstChild),te.addClass(e,"save-row");var t=document.createElement("span");t.innerHTML=" ",te.addClass(t,"button gears");var n=document.createElement("span");n.innerHTML="Save",te.addClass(n,"button"),te.addClass(n,"save");var s=document.createElement("span");s.innerHTML="New",te.addClass(s,"button"),te.addClass(s,"save-as");var r=document.createElement("span");r.innerHTML="Revert",te.addClass(r,"button"),te.addClass(r,"revert");var a=i.__preset_select=document.createElement("select");if(i.load&&i.load.remembered?ue.each(i.load.remembered,function(u,d){ad(i,d,d===i.preset)}):ad(i,Eo,!1),te.bind(a,"change",function(){for(var u=0;u<i.__preset_select.length;u++)i.__preset_select[u].innerHTML=i.__preset_select[u].value;i.preset=this.value}),e.appendChild(a),e.appendChild(t),e.appendChild(n),e.appendChild(s),e.appendChild(r),_o){var o=document.getElementById("dg-local-explain"),c=document.getElementById("dg-local-storage"),l=document.getElementById("dg-save-locally");l.style.display="block",localStorage.getItem(Aa(i,"isLocal"))==="true"&&c.setAttribute("checked","checked"),Lg(i,o),te.bind(c,"change",function(){i.useLocalStorage=!i.useLocalStorage,Lg(i,o)})}var h=document.getElementById("dg-new-constructor");te.bind(h,"keydown",function(u){u.metaKey&&(u.which===67||u.keyCode===67)&&yo.hide()}),te.bind(t,"click",function(){h.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),yo.show(),h.focus(),h.select()}),te.bind(n,"click",function(){i.save()}),te.bind(s,"click",function(){var u=prompt("Enter a new preset name.");u&&i.saveAs(u)}),te.bind(r,"click",function(){i.revert()})}function jI(i){var e=void 0;i.__resize_handle=document.createElement("div"),ue.extend(i.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"});function t(r){return r.preventDefault(),i.width+=e-r.clientX,i.onResize(),e=r.clientX,!1}function n(){te.removeClass(i.__closeButton,Nt.CLASS_DRAG),te.unbind(window,"mousemove",t),te.unbind(window,"mouseup",n)}function s(r){return r.preventDefault(),e=r.clientX,te.addClass(i.__closeButton,Nt.CLASS_DRAG),te.bind(window,"mousemove",t),te.bind(window,"mouseup",n),!1}te.bind(i.__resize_handle,"mousedown",s),te.bind(i.__closeButton,"mousedown",s),i.domElement.insertBefore(i.__resize_handle,i.domElement.firstElementChild)}function od(i,e){i.domElement.style.width=e+"px",i.__save_row&&i.autoPlace&&(i.__save_row.style.width=e+"px"),i.__closeButton&&(i.__closeButton.style.width=e+"px")}function sl(i,e){var t={};return ue.each(i.__rememberedObjects,function(n,s){var r={},a=i.__rememberedObjectIndecesToControllers[s];ue.each(a,function(o,c){r[c]=e?o.initialValue:o.getValue()}),t[s]=r}),t}function JI(i){for(var e=0;e<i.__preset_select.length;e++)i.__preset_select[e].value===i.preset&&(i.__preset_select.selectedIndex=e)}function Pg(i){i.length!==0&&WI.call(window,function(){Pg(i)}),ue.each(i,function(e){e.updateDisplay()})}var ZI=Nt;const rl=[{id:"",name:"None",path:null},{id:"neutral",name:"Neutral",path:null},{id:"venice-sunset",name:"Venice Sunset",path:"https://storage.googleapis.com/donmccurdy-static/venice_sunset_1k.exr",format:".exr"},{id:"footprint-court",name:"Footprint Court (HDR Labs)",path:"https://storage.googleapis.com/donmccurdy-static/footprint_court_2k.exr",format:".exr"}],$I=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],kg=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function e1(i){if(i<=255)return $I[i];let e=0,t=kg.length-1;for(;e<=t;){const n=e+t>>1,s=kg[n];if(i<s[0]){t=n-1;continue}if(i>s[1]){e=n+1;continue}return s[2]}return"L"}function t1(i){const e=i.length;if(e===0)return null;const t=new Array(e);let n=!1;for(let l=0;l<e;){const h=i.charCodeAt(l);let u=h,d=1;if(h>=55296&&h<=56319&&l+1<e){const m=i.charCodeAt(l+1);m>=56320&&m<=57343&&(u=(h-55296<<10)+(m-56320)+65536,d=2)}const f=e1(u);(f==="R"||f==="AL"||f==="AN")&&(n=!0);for(let m=0;m<d;m++)t[l+m]=f;l+=d}if(!n)return null;let s=0;for(let l=0;l<e;l++){const h=t[l];if(h==="L"){s=0;break}if(h==="R"||h==="AL"){s=1;break}}const r=new Int8Array(e);for(let l=0;l<e;l++)r[l]=s;const a=s&1?"R":"L",o=a;let c=o;for(let l=0;l<e;l++)t[l]==="NSM"?t[l]=c:c=t[l];c=o;for(let l=0;l<e;l++){const h=t[l];h==="EN"?t[l]=c==="AL"?"AN":"EN":(h==="R"||h==="L"||h==="AL")&&(c=h)}for(let l=0;l<e;l++)t[l]==="AL"&&(t[l]="R");for(let l=1;l<e-1;l++)t[l]==="ES"&&t[l-1]==="EN"&&t[l+1]==="EN"&&(t[l]="EN"),t[l]==="CS"&&(t[l-1]==="EN"||t[l-1]==="AN")&&t[l+1]===t[l-1]&&(t[l]=t[l-1]);for(let l=0;l<e;l++){if(t[l]!=="EN")continue;let h;for(h=l-1;h>=0&&t[h]==="ET";h--)t[h]="EN";for(h=l+1;h<e&&t[h]==="ET";h++)t[h]="EN"}for(let l=0;l<e;l++){const h=t[l];(h==="WS"||h==="ES"||h==="ET"||h==="CS")&&(t[l]="ON")}c=o;for(let l=0;l<e;l++){const h=t[l];h==="EN"?t[l]=c==="L"?"L":"EN":(h==="R"||h==="L")&&(c=h)}for(let l=0;l<e;l++){if(t[l]!=="ON")continue;let h=l+1;for(;h<e&&t[h]==="ON";)h++;const u=l>0?t[l-1]:o,d=h<e?t[h]:o,f=u!=="L"?"R":"L";if(f===(d!=="L"?"R":"L"))for(let g=l;g<h;g++)t[g]=f;l=h-1}for(let l=0;l<e;l++)t[l]==="ON"&&(t[l]=a);for(let l=0;l<e;l++){const h=t[l];(r[l]&1)===0?h==="R"?r[l]++:(h==="AN"||h==="EN")&&(r[l]+=2):(h==="L"||h==="AN"||h==="EN")&&r[l]++}return r}function n1(i,e){const t=t1(i);if(t===null)return null;const n=new Int8Array(e.length);for(let s=0;s<e.length;s++)n[s]=t[e[s]];return n}const i1=/[ \t\n\r\f]+/g,s1=/[\t\n\r\f]| {2,}|^ | $/;function r1(i){const e=i??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function a1(i){if(!s1.test(i))return i;let e=i.replace(i1," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function o1(i){return/[\r\f]/.test(i)?i.replace(/\r\n/g,`+</div>`,JI=function(e,t){var n=e[t];return ue.isArray(arguments[2])||ue.isObject(arguments[2])?new VI(e,t,arguments[2]):ue.isNumber(n)?ue.isNumber(arguments[2])&&ue.isNumber(arguments[3])?ue.isNumber(arguments[4])?new od(e,t,arguments[2],arguments[3],arguments[4]):new od(e,t,arguments[2],arguments[3]):ue.isNumber(arguments[4])?new cl(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new cl(e,t,{min:arguments[2],max:arguments[3]}):ue.isString(n)?new WI(e,t):ue.isFunction(n)?new Ng(e,t,""):ue.isBoolean(n)?new Mg(e,t):null};function ZI(i){setTimeout(i,1e3/60)}var $I=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||ZI,e1=(function(){function i(){gi(this,i),this.backgroundElement=document.createElement("div"),ue.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),te.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),ue.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;te.bind(this.backgroundElement,"click",function(){e.hide()})}return mi(i,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),ue.defer(function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"})}},{key:"hide",value:function(){var t=this,n=function s(){t.domElement.style.display="none",t.backgroundElement.style.display="none",te.unbind(t.domElement,"webkitTransitionEnd",s),te.unbind(t.domElement,"transitionend",s),te.unbind(t.domElement,"oTransitionEnd",s)};te.bind(this.domElement,"webkitTransitionEnd",n),te.bind(this.domElement,"transitionend",n),te.bind(this.domElement,"oTransitionEnd",n),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-te.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-te.getHeight(this.domElement)/2+"px"}}]),i})(),t1=OI(`.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}+`);XI.inject(t1);var Dg="dg",Lg=72,Pg=20,vo="Default",Co=(function(){try{return!!window.localStorage}catch{return!1}})(),So=void 0,kg=!0,ga=void 0,ld=!1,Ug=[],Nt=function i(e){var t=this,n=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),te.addClass(this.domElement,Dg),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=ue.defaults(n,{closeOnTop:!1,autoPlace:!0,width:i.DEFAULT_WIDTH}),n=ue.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),ue.isUndefined(n.load)?n.load={preset:vo}:n.preset&&(n.load.preset=n.preset),ue.isUndefined(n.parent)&&n.hideable&&Ug.push(this),n.resizable=ue.isUndefined(n.parent)&&n.resizable,n.autoPlace&&ue.isUndefined(n.scrollable)&&(n.scrollable=!0);var s=Co&&localStorage.getItem(ma(this,"isLocal"))==="true",r=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return t.parent?t.getRoot().preset:n.load.preset},set:function(d){t.parent?t.getRoot().preset=d:n.load.preset=d,r1(this),t.revert()}},width:{get:function(){return n.width},set:function(d){n.width=d,fd(t,d)}},name:{get:function(){return n.name},set:function(d){n.name=d,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(d){n.closed=d,n.closed?te.addClass(t.__ul,i.CLASS_CLOSED):te.removeClass(t.__ul,i.CLASS_CLOSED),this.onResize(),t.__closeButton&&(t.__closeButton.innerHTML=d?i.TEXT_OPEN:i.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return s},set:function(d){Co&&(s=d,d?te.bind(window,"unload",r):te.unbind(window,"unload",r),localStorage.setItem(ma(t,"isLocal"),d))}}}),ue.isUndefined(n.parent)){if(this.closed=n.closed||!1,te.addClass(this.domElement,i.CLASS_MAIN),te.makeSelectable(this.domElement,!1),Co&&s){t.useLocalStorage=!0;var o=localStorage.getItem(ma(this,"gui"));o&&(n.load=JSON.parse(o))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=i.TEXT_CLOSED,te.addClass(this.__closeButton,i.CLASS_CLOSE_BUTTON),n.closeOnTop?(te.addClass(this.__closeButton,i.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(te.addClass(this.__closeButton,i.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),te.bind(this.__closeButton,"click",function(){t.closed=!t.closed})}else{n.closed===void 0&&(n.closed=!0);var c=document.createTextNode(n.name);te.addClass(c,"controller-name"),a=hd(t,c);var l=function(d){return d.preventDefault(),t.closed=!t.closed,!1};te.addClass(this.__ul,i.CLASS_CLOSED),te.addClass(a,"title"),te.bind(a,"click",l),n.closed||(this.closed=!1)}n.autoPlace&&(ue.isUndefined(n.parent)&&(kg&&(ga=document.createElement("div"),te.addClass(ga,Dg),te.addClass(ga,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(ga),kg=!1),ga.appendChild(this.domElement),te.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||fd(t,n.width)),this.__resizeHandler=function(){t.onResizeDebounced()},te.bind(window,"resize",this.__resizeHandler),te.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),te.bind(this.__ul,"transitionend",this.__resizeHandler),te.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&s1(this),r=function(){Co&&localStorage.getItem(ma(t,"isLocal"))==="true"&&localStorage.setItem(ma(t,"gui"),JSON.stringify(t.getSaveObject()))},this.saveToLocalStorageIfPossible=r;function h(){var u=t.getRoot();u.width+=1,ue.defer(function(){u.width-=1})}n.parent||h()};Nt.toggleHide=function(){ld=!ld,ue.each(Ug,function(i){i.domElement.style.display=ld?"none":""})},Nt.CLASS_AUTO_PLACE="a",Nt.CLASS_AUTO_PLACE_CONTAINER="ac",Nt.CLASS_MAIN="main",Nt.CLASS_CONTROLLER_ROW="cr",Nt.CLASS_TOO_TALL="taller-than-window",Nt.CLASS_CLOSED="closed",Nt.CLASS_CLOSE_BUTTON="close-button",Nt.CLASS_CLOSE_TOP="close-top",Nt.CLASS_CLOSE_BOTTOM="close-bottom",Nt.CLASS_DRAG="drag",Nt.DEFAULT_WIDTH=245,Nt.TEXT_CLOSED="Close Controls",Nt.TEXT_OPEN="Open Controls",Nt._keydownHandler=function(i){document.activeElement.type!=="text"&&(i.which===Lg||i.keyCode===Lg)&&Nt.toggleHide()},te.bind(window,"keydown",Nt._keydownHandler,!1),ue.extend(Nt.prototype,{add:function(e,t){return Io(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return Io(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;ue.defer(function(){t.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&ga.removeChild(this.domElement);var e=this;ue.each(this.__folders,function(t){e.removeFolder(t)}),te.unbind(window,"keydown",Nt._keydownHandler,!1),Og(this)},addFolder:function(e){if(this.__folders[e]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new Nt(t);this.__folders[e]=n;var s=hd(this,n.domElement);return te.addClass(s,"folder"),n},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],Og(e);var t=this;ue.each(e.__folders,function(n){e.removeFolder(n)}),ue.defer(function(){t.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=te.getOffset(e.__ul).top,n=0;ue.each(e.__ul.childNodes,function(s){e.autoPlace&&s===e.__save_row||(n+=te.getHeight(s))}),window.innerHeight-t-Pg<n?(te.addClass(e.domElement,Nt.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-Pg+"px"):(te.removeClass(e.domElement,Nt.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&ue.defer(function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"}),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:ue.debounce(function(){this.onResize()},50),remember:function(){if(ue.isUndefined(So)&&(So=new e1,So.domElement.innerHTML=YI),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;ue.each(Array.prototype.slice.call(arguments),function(t){e.__rememberedObjects.length===0&&i1(e),e.__rememberedObjects.indexOf(t)===-1&&e.__rememberedObjects.push(t)}),this.autoPlace&&fd(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=ll(this)),e.folders={},ue.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=ll(this),ud(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[vo]=ll(this,!0)),this.load.remembered[e]=ll(this),this.preset=e,dd(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){ue.each(this.__controllers,function(t){this.getRoot().load.remembered?Qg(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),ue.each(this.__folders,function(t){t.revert(t)}),e||ud(this.getRoot(),!1)},listen:function(e){var t=this.__listening.length===0;this.__listening.push(e),t&&Hg(this.__listening)},updateDisplay:function(){ue.each(this.__controllers,function(e){e.updateDisplay()}),ue.each(this.__folders,function(e){e.updateDisplay()})}});function hd(i,e,t){var n=document.createElement("li");return e&&n.appendChild(e),t?i.__ul.insertBefore(n,t):i.__ul.appendChild(n),i.onResize(),n}function Og(i){te.unbind(window,"resize",i.__resizeHandler),i.saveToLocalStorageIfPossible&&te.unbind(window,"unload",i.saveToLocalStorageIfPossible)}function ud(i,e){var t=i.__preset_select[i.__preset_select.selectedIndex];e?t.innerHTML=t.value+"*":t.innerHTML=t.value}function n1(i,e,t){if(t.__li=e,t.__gui=i,ue.extend(t,{options:function(a){if(arguments.length>1){var o=t.__li.nextElementSibling;return t.remove(),Io(i,t.object,t.property,{before:o,factoryArgs:[ue.toArray(arguments)]})}if(ue.isArray(a)||ue.isObject(a)){var c=t.__li.nextElementSibling;return t.remove(),Io(i,t.object,t.property,{before:c,factoryArgs:[a]})}},name:function(a){return t.__li.firstElementChild.firstElementChild.innerHTML=a,t},listen:function(){return t.__gui.listen(t),t},remove:function(){return t.__gui.remove(t),t}}),t instanceof od){var n=new cl(t.object,t.property,{min:t.__min,max:t.__max,step:t.__step});ue.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(r){var a=t[r],o=n[r];t[r]=n[r]=function(){var c=Array.prototype.slice.call(arguments);return o.apply(n,c),a.apply(t,c)}}),te.addClass(e,"has-slider"),t.domElement.insertBefore(n.domElement,t.domElement.firstElementChild)}else if(t instanceof cl){var s=function(a){if(ue.isNumber(t.__min)&&ue.isNumber(t.__max)){var o=t.__li.firstElementChild.firstElementChild.innerHTML,c=t.__gui.__listening.indexOf(t)>-1;t.remove();var l=Io(i,t.object,t.property,{before:t.__li.nextElementSibling,factoryArgs:[t.__min,t.__max,t.__step]});return l.name(o),c&&l.listen(),l}return a};t.min=ue.compose(s,t.min),t.max=ue.compose(s,t.max)}else t instanceof Mg?(te.bind(e,"click",function(){te.fakeEvent(t.__checkbox,"click")}),te.bind(t.__checkbox,"click",function(r){r.stopPropagation()})):t instanceof Ng?(te.bind(e,"click",function(){te.fakeEvent(t.__button,"click")}),te.bind(e,"mouseover",function(){te.addClass(t.__button,"hover")}),te.bind(e,"mouseout",function(){te.removeClass(t.__button,"hover")})):t instanceof cd&&(te.addClass(e,"color"),t.updateDisplay=ue.compose(function(r){return e.style.borderLeftColor=t.__color.toString(),r},t.updateDisplay),t.updateDisplay());t.setValue=ue.compose(function(r){return i.getRoot().__preset_select&&t.isModified()&&ud(i.getRoot(),!0),r},t.setValue)}function Qg(i,e){var t=i.getRoot(),n=t.__rememberedObjects.indexOf(e.object);if(n!==-1){var s=t.__rememberedObjectIndecesToControllers[n];if(s===void 0&&(s={},t.__rememberedObjectIndecesToControllers[n]=s),s[e.property]=e,t.load&&t.load.remembered){var r=t.load.remembered,a=void 0;if(r[i.preset])a=r[i.preset];else if(r[vo])a=r[vo];else return;if(a[n]&&a[n][e.property]!==void 0){var o=a[n][e.property];e.initialValue=o,e.setValue(o)}}}}function Io(i,e,t,n){if(e[t]===void 0)throw new Error('Object "'+e+'" has no property "'+t+'"');var s=void 0;if(n.color)s=new cd(e,t);else{var r=[e,t].concat(n.factoryArgs);s=JI.apply(i,r)}n.before instanceof lr&&(n.before=n.before.__li),Qg(i,s),te.addClass(s.domElement,"c");var a=document.createElement("span");te.addClass(a,"property-name"),a.innerHTML=s.property;var o=document.createElement("div");o.appendChild(a),o.appendChild(s.domElement);var c=hd(i,o,n.before);return te.addClass(c,Nt.CLASS_CONTROLLER_ROW),s instanceof cd?te.addClass(c,"color"):te.addClass(c,GI(s.getValue())),n1(i,c,s),i.__controllers.push(s),s}function ma(i,e){return document.location.href+"."+e}function dd(i,e,t){var n=document.createElement("option");n.innerHTML=e,n.value=e,i.__preset_select.appendChild(n),t&&(i.__preset_select.selectedIndex=i.__preset_select.length-1)}function Gg(i,e){e.style.display=i.useLocalStorage?"block":"none"}function i1(i){var e=i.__save_row=document.createElement("li");te.addClass(i.domElement,"has-save"),i.__ul.insertBefore(e,i.__ul.firstChild),te.addClass(e,"save-row");var t=document.createElement("span");t.innerHTML=" ",te.addClass(t,"button gears");var n=document.createElement("span");n.innerHTML="Save",te.addClass(n,"button"),te.addClass(n,"save");var s=document.createElement("span");s.innerHTML="New",te.addClass(s,"button"),te.addClass(s,"save-as");var r=document.createElement("span");r.innerHTML="Revert",te.addClass(r,"button"),te.addClass(r,"revert");var a=i.__preset_select=document.createElement("select");if(i.load&&i.load.remembered?ue.each(i.load.remembered,function(u,d){dd(i,d,d===i.preset)}):dd(i,vo,!1),te.bind(a,"change",function(){for(var u=0;u<i.__preset_select.length;u++)i.__preset_select[u].innerHTML=i.__preset_select[u].value;i.preset=this.value}),e.appendChild(a),e.appendChild(t),e.appendChild(n),e.appendChild(s),e.appendChild(r),Co){var o=document.getElementById("dg-local-explain"),c=document.getElementById("dg-local-storage"),l=document.getElementById("dg-save-locally");l.style.display="block",localStorage.getItem(ma(i,"isLocal"))==="true"&&c.setAttribute("checked","checked"),Gg(i,o),te.bind(c,"change",function(){i.useLocalStorage=!i.useLocalStorage,Gg(i,o)})}var h=document.getElementById("dg-new-constructor");te.bind(h,"keydown",function(u){u.metaKey&&(u.which===67||u.keyCode===67)&&So.hide()}),te.bind(t,"click",function(){h.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),So.show(),h.focus(),h.select()}),te.bind(n,"click",function(){i.save()}),te.bind(s,"click",function(){var u=prompt("Enter a new preset name.");u&&i.saveAs(u)}),te.bind(r,"click",function(){i.revert()})}function s1(i){var e=void 0;i.__resize_handle=document.createElement("div"),ue.extend(i.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"});function t(r){return r.preventDefault(),i.width+=e-r.clientX,i.onResize(),e=r.clientX,!1}function n(){te.removeClass(i.__closeButton,Nt.CLASS_DRAG),te.unbind(window,"mousemove",t),te.unbind(window,"mouseup",n)}function s(r){return r.preventDefault(),e=r.clientX,te.addClass(i.__closeButton,Nt.CLASS_DRAG),te.bind(window,"mousemove",t),te.bind(window,"mouseup",n),!1}te.bind(i.__resize_handle,"mousedown",s),te.bind(i.__closeButton,"mousedown",s),i.domElement.insertBefore(i.__resize_handle,i.domElement.firstElementChild)}function fd(i,e){i.domElement.style.width=e+"px",i.__save_row&&i.autoPlace&&(i.__save_row.style.width=e+"px"),i.__closeButton&&(i.__closeButton.style.width=e+"px")}function ll(i,e){var t={};return ue.each(i.__rememberedObjects,function(n,s){var r={},a=i.__rememberedObjectIndecesToControllers[s];ue.each(a,function(o,c){r[c]=e?o.initialValue:o.getValue()}),t[s]=r}),t}function r1(i){for(var e=0;e<i.__preset_select.length;e++)i.__preset_select[e].value===i.preset&&(i.__preset_select.selectedIndex=e)}function Hg(i){i.length!==0&&$I.call(window,function(){Hg(i)}),ue.each(i,function(e){e.updateDisplay()})}var a1=Nt;const hl=[{id:"",name:"None",path:null},{id:"neutral",name:"Neutral",path:null},{id:"venice-sunset",name:"Venice Sunset",path:"https://storage.googleapis.com/donmccurdy-static/venice_sunset_1k.exr",format:".exr"},{id:"footprint-court",name:"Footprint Court (HDR Labs)",path:"https://storage.googleapis.com/donmccurdy-static/footprint_court_2k.exr",format:".exr"}],o1=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],zg=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function c1(i){if(i<=255)return o1[i];let e=0,t=zg.length-1;for(;e<=t;){const n=e+t>>1,s=zg[n];if(i<s[0]){t=n-1;continue}if(i>s[1]){e=n+1;continue}return s[2]}return"L"}function l1(i){const e=i.length;if(e===0)return null;const t=new Array(e);let n=!1;for(let l=0;l<e;){const h=i.charCodeAt(l);let u=h,d=1;if(h>=55296&&h<=56319&&l+1<e){const m=i.charCodeAt(l+1);m>=56320&&m<=57343&&(u=(h-55296<<10)+(m-56320)+65536,d=2)}const f=c1(u);(f==="R"||f==="AL"||f==="AN")&&(n=!0);for(let m=0;m<d;m++)t[l+m]=f;l+=d}if(!n)return null;let s=0;for(let l=0;l<e;l++){const h=t[l];if(h==="L"){s=0;break}if(h==="R"||h==="AL"){s=1;break}}const r=new Int8Array(e);for(let l=0;l<e;l++)r[l]=s;const a=s&1?"R":"L",o=a;let c=o;for(let l=0;l<e;l++)t[l]==="NSM"?t[l]=c:c=t[l];c=o;for(let l=0;l<e;l++){const h=t[l];h==="EN"?t[l]=c==="AL"?"AN":"EN":(h==="R"||h==="L"||h==="AL")&&(c=h)}for(let l=0;l<e;l++)t[l]==="AL"&&(t[l]="R");for(let l=1;l<e-1;l++)t[l]==="ES"&&t[l-1]==="EN"&&t[l+1]==="EN"&&(t[l]="EN"),t[l]==="CS"&&(t[l-1]==="EN"||t[l-1]==="AN")&&t[l+1]===t[l-1]&&(t[l]=t[l-1]);for(let l=0;l<e;l++){if(t[l]!=="EN")continue;let h;for(h=l-1;h>=0&&t[h]==="ET";h--)t[h]="EN";for(h=l+1;h<e&&t[h]==="ET";h++)t[h]="EN"}for(let l=0;l<e;l++){const h=t[l];(h==="WS"||h==="ES"||h==="ET"||h==="CS")&&(t[l]="ON")}c=o;for(let l=0;l<e;l++){const h=t[l];h==="EN"?t[l]=c==="L"?"L":"EN":(h==="R"||h==="L")&&(c=h)}for(let l=0;l<e;l++){if(t[l]!=="ON")continue;let h=l+1;for(;h<e&&t[h]==="ON";)h++;const u=l>0?t[l-1]:o,d=h<e?t[h]:o,f=u!=="L"?"R":"L";if(f===(d!=="L"?"R":"L"))for(let g=l;g<h;g++)t[g]=f;l=h-1}for(let l=0;l<e;l++)t[l]==="ON"&&(t[l]=a);for(let l=0;l<e;l++){const h=t[l];(r[l]&1)===0?h==="R"?r[l]++:(h==="AN"||h==="EN")&&(r[l]+=2):(h==="L"||h==="AN"||h==="EN")&&r[l]++}return r}function h1(i,e){const t=l1(i);if(t===null)return null;const n=new Int8Array(e.length);for(let s=0;s<e.length;s++)n[s]=t[e[s]];return n}const u1=/[ \t\n\r\f]+/g,d1=/[\t\n\r\f]| {2,}|^ | $/;function f1(i){const e=i??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function p1(i){if(!d1.test(i))return i;let e=i.replace(u1," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function A1(i){return/[\r\f]/.test(i)?i.replace(/\r\n/g,``).replace(/[\r\f]/g,``):i.replace(/\r\n/g,`-`)}let cd=null,c1;function l1(){return cd===null&&(cd=new Intl.Segmenter(c1,{granularity:"word"})),cd}const h1=new RegExp("\\p{Script=Arabic}","u"),al=new RegExp("\\p{M}","u"),Ug=new RegExp("\\p{Nd}","u");function Og(i){return h1.test(i)}function Qg(i){return i>=19968&&i<=40959||i>=13312&&i<=19903||i>=131072&&i<=173791||i>=173824&&i<=177983||i>=177984&&i<=178207||i>=178208&&i<=183983||i>=183984&&i<=191471||i>=191472&&i<=192093||i>=194560&&i<=195103||i>=196608&&i<=201551||i>=201552&&i<=205743||i>=205744&&i<=210041||i>=63744&&i<=64255||i>=12288&&i<=12351||i>=12352&&i<=12447||i>=12448&&i<=12543||i>=44032&&i<=55215||i>=65280&&i<=65519}function cr(i){for(let e=0;e<i.length;e++){const t=i.charCodeAt(e);if(!(t<12288)){if(t>=55296&&t<=56319&&e+1<i.length){const n=i.charCodeAt(e+1);if(n>=56320&&n<=57343){const s=(t-55296<<10)+(n-56320)+65536;if(Qg(s))return!0;e++;continue}}if(Qg(t))return!0}}return!1}function u1(i){const e=cl(i);return e!==null&&(ld.has(e)||lr.has(e))}const d1=new Set([" "," ","","\uFEFF"]);function f1(i){return cr(i)}function p1(i){const e=cl(i);return e!==null&&d1.has(e)}function A1(i){return!u1(i)&&!p1(i)}const ld=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),ol=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),hd=new Set(["'","’"]),lr=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),g1=new Set([":",".","،","؛"]),m1=new Set(["၏"]),b1=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function x1(i){if(ud(i))return!0;let e=!1;for(const t of i){if(lr.has(t)){e=!0;continue}if(!(e&&al.test(t)))return!1}return e}function E1(i){for(const e of i)if(!ld.has(e)&&!lr.has(e))return!1;return i.length>0}function _1(i){if(ud(i))return!0;for(const e of i)if(!ol.has(e)&&!hd.has(e)&&!al.test(e))return!1;return i.length>0}function ud(i){let e=!1;for(const t of i)if(!(t==="\\"||al.test(t))){if(ol.has(t)||lr.has(t)||hd.has(t)){e=!0;continue}return!1}return e}function Gg(i,e){const t=e-1;if(t<=0)return Math.max(t,0);const n=i.charCodeAt(t);if(n<56320||n>57343)return t;const s=t-1;if(s<0)return t;const r=i.charCodeAt(s);return r>=55296&&r<=56319?s:t}function cl(i){if(i.length===0)return null;const e=Gg(i,i.length);return i.slice(e)}function y1(i){const e=Array.from(i);let t=e.length;for(;t>0;){const n=e[t-1];if(al.test(n)){t--;continue}if(ol.has(n)||hd.has(n)){t--;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t).join(""),tail:e.slice(t).join("")}}function w1(i,e,t){return t==="text"&&!e&&i.length===1&&i!=="-"&&i!=="—"?i:null}function Hg(i,e,t,n){const s=e[n],r=i[n];if(s==null)return r;const a=t[n];if(r.length===a)return r;const o=s.repeat(a);return i[n]=o,o}function zg(i,e){return i&&e!==null&&g1.has(e)}function C1(i){const e=cl(i);return e!==null&&m1.has(e)}function v1(i){if(i.length<2||i[0]!==" ")return null;const e=i.slice(1);return new RegExp("^\\p{M}+$","u").test(e)?{space:" ",marks:e}:null}function dd(i){let e=i.length;for(;e>0;){const t=Gg(i,e),n=i.slice(t,e);if(b1.has(n))return!0;if(!lr.has(n))return!1;e=t}return!1}function S1(i,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(i===" ")return"preserved-space";if(i===" ")return"tab";if(e.preserveHardBreaks&&i===`-`)return"hard-break"}return i===" "?"space":i===" "||i===" "||i===""||i==="\uFEFF"?"glue":i===""?"zero-width-break":i===""?"soft-hyphen":"text"}const I1=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ei(i){return i.length===1?i[0]:i.join("")}function M1(i,e){const t=[];for(let n=i.length-1;n>=0;n--)t.push(i[n]);return t.push(e),ei(t)}function B1(i,e,t,n){if(!I1.test(i))return[{text:i,isWordLike:e,kind:"text",start:t}];const s=[];let r=null,a=[],o=t,c=!1,l=0;for(const h of i){const u=S1(h,n),d=u==="text"&&e;if(r!==null&&u===r&&d===c){a.push(h),l+=h.length;continue}r!==null&&s.push({text:ei(a),isWordLike:c,kind:r,start:o}),r=u,a=[h],o=t+l,c=d,l+=h.length}return r!==null&&s.push({text:ei(a),isWordLike:c,kind:r,start:o}),s}function fd(i){return i==="space"||i==="preserved-space"||i==="zero-width-break"||i==="hard-break"}const T1=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function R1(i,e){const t=i.texts[e];return t.startsWith("www.")?!0:T1.test(t)&&e+1<i.len&&i.kinds[e+1]==="text"&&i.texts[e+1]==="//"}function N1(i){return i.includes("?")&&(i.includes("://")||i.startsWith("www."))}function F1(i){const e=i.texts.slice(),t=i.isWordLike.slice(),n=i.kinds.slice(),s=i.starts.slice();for(let a=0;a<i.len;a++){if(n[a]!=="text"||!R1(i,a))continue;const o=[e[a]];let c=a+1;for(;c<i.len&&!fd(n[c]);){o.push(e[c]),t[a]=!0;const l=e[c].includes("?");if(n[c]="text",e[c]="",c++,l)break}e[a]=ei(o)}let r=0;for(let a=0;a<e.length;a++){const o=e[a];o.length!==0&&(r!==a&&(e[r]=o,t[r]=t[a],n[r]=n[a],s[r]=s[a]),r++)}return e.length=r,t.length=r,n.length=r,s.length=r,{len:r,texts:e,isWordLike:t,kinds:n,starts:s}}function D1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r];if(e.push(a),t.push(i.isWordLike[r]),n.push(i.kinds[r]),s.push(i.starts[r]),!N1(a))continue;const o=r+1;if(o>=i.len||fd(i.kinds[o]))continue;const c=[],l=i.starts[o];let h=o;for(;h<i.len&&!fd(i.kinds[h]);)c.push(i.texts[h]),h++;c.length>0&&(e.push(ei(c)),t.push(!0),n.push("text"),s.push(l),r=h-1)}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}const L1=new Set([":","-","/","×",",",".","+","–","—"]),Vg=/^[A-Za-z0-9_]+[,:;]*$/,Wg=/[,:;]+$/;function qg(i){for(const e of i)if(Ug.test(e))return!0;return!1}function ll(i){if(i.length===0)return!1;for(const e of i)if(!(Ug.test(e)||L1.has(e)))return!1;return!0}function P1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r],o=i.kinds[r];if(o==="text"&&ll(a)&&qg(a)){const c=[a];let l=r+1;for(;l<i.len&&i.kinds[l]==="text"&&ll(i.texts[l]);)c.push(i.texts[l]),l++;e.push(ei(c)),t.push(!0),n.push("text"),s.push(i.starts[r]),r=l-1;continue}e.push(a),t.push(i.isWordLike[r]),n.push(o),s.push(i.starts[r])}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function k1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r],o=i.kinds[r],c=i.isWordLike[r];if(o==="text"&&c&&Vg.test(a)){const l=[a];let h=Wg.test(a),u=r+1;for(;h&&u<i.len&&i.kinds[u]==="text"&&i.isWordLike[u]&&Vg.test(i.texts[u]);){const d=i.texts[u];l.push(d),h=Wg.test(d),u++}e.push(ei(l)),t.push(!0),n.push("text"),s.push(i.starts[r]),r=u-1;continue}e.push(a),t.push(c),n.push(o),s.push(i.starts[r])}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function U1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r];if(i.kinds[r]==="text"&&a.includes("-")){const o=a.split("-");let c=o.length>1;for(let l=0;l<o.length;l++){const h=o[l];if(!c)break;(h.length===0||!qg(h)||!ll(h))&&(c=!1)}if(c){let l=0;for(let h=0;h<o.length;h++){const u=o[h],d=h<o.length-1?`${u}-`:u;e.push(d),t.push(!0),n.push("text"),s.push(i.starts[r]+l),l+=d.length}continue}}e.push(a),t.push(i.isWordLike[r]),n.push(i.kinds[r]),s.push(i.starts[r])}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function O1(i){const e=[],t=[],n=[],s=[];let r=0;for(;r<i.len;){const a=[i.texts[r]];let o=i.isWordLike[r],c=i.kinds[r],l=i.starts[r];if(c==="glue"){const h=[a[0]],u=l;for(r++;r<i.len&&i.kinds[r]==="glue";)h.push(i.texts[r]),r++;const d=ei(h);if(r<i.len&&i.kinds[r]==="text")a[0]=d,a.push(i.texts[r]),o=i.isWordLike[r],c="text",l=u,r++;else{e.push(d),t.push(!1),n.push("glue"),s.push(u);continue}}else r++;if(c==="text")for(;r<i.len&&i.kinds[r]==="glue";){const h=[];for(;r<i.len&&i.kinds[r]==="glue";)h.push(i.texts[r]),r++;const u=ei(h);if(r<i.len&&i.kinds[r]==="text"){a.push(u,i.texts[r]),o=o||i.isWordLike[r],r++;continue}a.push(u)}e.push(ei(a)),t.push(o),n.push(c),s.push(l)}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function Q1(i){const e=i.texts.slice(),t=i.isWordLike.slice(),n=i.kinds.slice(),s=i.starts.slice();for(let r=0;r<e.length-1;r++){if(n[r]!=="text"||n[r+1]!=="text"||!cr(e[r])||!cr(e[r+1]))continue;const a=y1(e[r]);a!==null&&(e[r]=a.head,e[r+1]=a.tail+e[r+1],s[r+1]=s[r]+a.head.length)}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function Kg(i,e,t){const n=l1();let s=0;const r=[],a=[],o=[],c=[],l=[],h=[],u=[],d=[],f=[],m=[],g=[],A=[];for(const w of n.segment(i))for(const S of B1(w.segment,w.isWordLike??!1,w.index,t)){let O=function(){h[D]!==null&&(a[D]=[Hg(r,h,u,D)],h[D]=null),a[D].push(S.text),o[D]=o[D]||S.isWordLike,d[D]=d[D]||C,f[D]=f[D]||F,m[D]=q,g[D]=$,A[D]=zg(f[D],K)};const T=S.kind==="text",v=w1(S.text,S.isWordLike,S.kind),C=cr(S.text),F=Og(S.text),K=cl(S.text),q=dd(S.text),$=C1(S.text),D=s-1;e.carryCJKAfterClosingQuote&&T&&s>0&&c[D]==="text"&&C&&d[D]&&m[D]||T&&s>0&&c[D]==="text"&&E1(S.text)&&d[D]||T&&s>0&&c[D]==="text"&&g[D]?O():T&&s>0&&c[D]==="text"&&S.isWordLike&&F&&A[D]?(O(),o[D]=!0):v!==null&&s>0&&c[D]==="text"&&h[D]===v?u[D]=(u[D]??1)+1:T&&!S.isWordLike&&s>0&&c[D]==="text"&&(x1(S.text)||S.text==="-"&&o[D])?O():(r[s]=S.text,a[s]=[S.text],o[s]=S.isWordLike,c[s]=S.kind,l[s]=S.start,h[s]=v,u[s]=v===null?0:1,d[s]=C,f[s]=F,m[s]=q,g[s]=$,A[s]=zg(F,K),s++)}for(let w=0;w<s;w++){if(h[w]!==null){r[w]=Hg(r,h,u,w);continue}r[w]=ei(a[w])}for(let w=1;w<s;w++)c[w]==="text"&&!o[w]&&ud(r[w])&&c[w-1]==="text"&&(r[w-1]+=r[w],o[w-1]=o[w-1]||o[w],r[w]="");const p=Array.from({length:s},()=>null);let y=-1;for(let w=s-1;w>=0;w--){const S=r[w];if(S.length!==0){if(c[w]==="text"&&!o[w]&&_1(S)&&y>=0&&c[y]==="text"){const T=p[y]??[];T.push(S),p[y]=T,l[y]=l[w],r[w]="";continue}y=w}}for(let w=0;w<s;w++){const S=p[w];S!=null&&(r[w]=M1(S,r[w]))}let b=0;for(let w=0;w<s;w++){const S=r[w];S.length!==0&&(b!==w&&(r[b]=S,o[b]=o[w],c[b]=c[w],l[b]=l[w]),b++)}r.length=b,o.length=b,c.length=b,l.length=b;const _=O1({len:b,texts:r,isWordLike:o,kinds:c,starts:l}),M=Q1(k1(U1(P1(D1(F1(_))))));for(let w=0;w<M.len-1;w++){const S=v1(M.texts[w]);S!==null&&(M.kinds[w]!=="space"&&M.kinds[w]!=="preserved-space"||M.kinds[w+1]!=="text"||!Og(M.texts[w+1])||(M.texts[w]=S.space,M.isWordLike[w]=!1,M.kinds[w]=M.kinds[w]==="preserved-space"?"preserved-space":"space",M.texts[w+1]=S.marks+M.texts[w+1],M.starts[w+1]=M.starts[w]+S.space.length))}return M}function G1(i,e){if(i.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:i.len,consumedEndSegmentIndex:i.len}];const t=[];let n=0;for(let s=0;s<i.len;s++)i.kinds[s]==="hard-break"&&(t.push({startSegmentIndex:n,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),n=s+1);return n<i.len&&t.push({startSegmentIndex:n,endSegmentIndex:i.len,consumedEndSegmentIndex:i.len}),t}function H1(i){if(i.len<=1)return i;const e=[],t=[],n=[],s=[];let r=null,a=!1,o=0,c=!1,l=!1;function h(){r!==null&&(e.push(ei(r)),t.push(a),n.push("text"),s.push(o),r=null)}for(let u=0;u<i.len;u++){const d=i.texts[u],f=i.kinds[u],m=i.isWordLike[u],g=i.starts[u];if(f==="text"){const A=f1(d),p=A1(d);if(r!==null&&c&&l){r.push(d),a=a||m,c=c||A,l=p;continue}h(),r=[d],a=m,o=g,c=A,l=p;continue}h(),e.push(d),t.push(m),n.push(f),s.push(g)}return h(),{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function z1(i,e,t="normal",n="normal"){const s=r1(t),r=s.mode==="pre-wrap"?o1(i):a1(i);if(r.length===0)return{normalized:r,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const a=n==="keep-all"?H1(Kg(r,e,s)):Kg(r,e,s);return{normalized:r,chunks:G1(a,s),...a}}let ga=null;const Xg=new Map;let ma=null;const V1=96,W1=new RegExp("\\p{Emoji_Presentation}","u"),q1=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let pd=null;const Yg=new Map;function Ad(){if(ga!==null)return ga;if(typeof OffscreenCanvas<"u")return ga=new OffscreenCanvas(1,1).getContext("2d"),ga;if(typeof document<"u")return ga=document.createElement("canvas").getContext("2d"),ga;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function K1(i){let e=Xg.get(i);return e||(e=new Map,Xg.set(i,e)),e}function Ds(i,e){let t=e.get(i);return t===void 0&&(t={width:Ad().measureText(i).width,containsCJK:cr(i)},e.set(i,t)),t}function ba(){if(ma!==null)return ma;if(typeof navigator>"u")return ma={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ma;const i=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&i.includes("Safari/")&&!i.includes("Chrome/")&&!i.includes("Chromium/")&&!i.includes("CriOS/")&&!i.includes("FxiOS/")&&!i.includes("EdgiOS/"),n=i.includes("Chrome/")||i.includes("Chromium/")||i.includes("CriOS/")||i.includes("Edg/");return ma={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ma}function X1(i){const e=i.match(/(\d+(?:\.\d+)?)\s*px/);return e?parseFloat(e[1]):16}function jg(){return pd===null&&(pd=new Intl.Segmenter(void 0,{granularity:"grapheme"})),pd}function Y1(i){return W1.test(i)||i.includes("️")}function j1(i){return q1.test(i)}function J1(i,e){let t=Yg.get(i);if(t!==void 0)return t;const n=Ad();n.font=i;const s=n.measureText("😀").width;if(t=0,s>e+.5&&typeof document<"u"&&document.body!==null){const r=document.createElement("span");r.style.font=i,r.style.display="inline-block",r.style.visibility="hidden",r.style.position="absolute",r.textContent="😀",document.body.appendChild(r);const a=r.getBoundingClientRect().width;document.body.removeChild(r),s-a>.5&&(t=s-a)}return Yg.set(i,t),t}function Z1(i){let e=0;const t=jg();for(const n of t.segment(i))Y1(n.segment)&&e++;return e}function $1(i,e){return e.emojiCount===void 0&&(e.emojiCount=Z1(i)),e.emojiCount}function hr(i,e,t){return t===0?e.width:e.width-$1(i,e)*t}function eM(i,e,t,n,s){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;const r=jg(),a=[];for(const h of r.segment(i))a.push(h.segment);if(a.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(s==="sum-graphemes"){const h=[];for(const u of a){const d=Ds(u,t);h.push(hr(u,d,n))}return e.breakableFitAdvances=h,e.breakableFitAdvances}if(s==="pair-context"||a.length>V1){const h=[];let u=null,d=0;for(const f of a){const m=Ds(f,t),g=hr(f,m,n);if(u===null)h.push(g);else{const A=u+f,p=Ds(A,t);h.push(hr(A,p,n)-d)}u=f,d=g}return e.breakableFitAdvances=h,e.breakableFitAdvances}const o=[];let c="",l=0;for(const h of a){c+=h;const u=Ds(c,t),d=hr(c,u,n);o.push(d-l),l=d}return e.breakableFitAdvances=o,e.breakableFitAdvances}function tM(i,e){const t=Ad();t.font=i;const n=K1(i),s=X1(i),r=e?J1(i,s):0;return{cache:n,fontSize:s,emojiCorrection:r}}function nM(i,e){for(;e<i.widths.length;){const t=i.kinds[e];if(t!=="space"&&t!=="zero-width-break"&&t!=="soft-hyphen")break;e++}return e}function Jg(i,e){if(e<=0)return 0;const t=i%e;return Math.abs(t)<=1e-6?e:e-t}function Zg(i,e,t,n,s){let r=0,a=e;for(;r<i.length;){const o=a+i[r];if((r+1<i.length?o+s:o)>t+n)break;a=o,r++}return{fitCount:r,fittedWidth:a}}function iM(i,e){let t=0,n=i.chunks.length;for(;t<n;){const s=Math.floor((t+n)/2);e<i.chunks[s].consumedEndSegmentIndex?n=s:t=s+1}return t<i.chunks.length?t:-1}function $g(i,e,t){let n=t.segmentIndex;if(t.graphemeIndex>0)return e;const s=i.chunks[e];if(s.startSegmentIndex===s.endSegmentIndex&&n===s.startSegmentIndex)return t.segmentIndex=n,t.graphemeIndex=0,e;for(n<s.startSegmentIndex&&(n=s.startSegmentIndex);n<s.endSegmentIndex;){const r=i.kinds[n];if(r!=="space"&&r!=="zero-width-break"&&r!=="soft-hyphen")return t.segmentIndex=n,t.graphemeIndex=0,e;n++}return s.consumedEndSegmentIndex>=i.widths.length?-1:(t.segmentIndex=s.consumedEndSegmentIndex,t.graphemeIndex=0,e+1)}function gd(i,e){if(e.segmentIndex>=i.widths.length)return-1;const t=iM(i,e.segmentIndex);return t<0?-1:$g(i,t,e)}function sM(i,e,t){if(t.segmentIndex>=i.widths.length)return-1;let n=e;for(;n<i.chunks.length&&t.segmentIndex>=i.chunks[n].consumedEndSegmentIndex;)n++;return n>=i.chunks.length?-1:$g(i,n,t)}function rM(i,e){return i.simpleLineWalkFastPath?em(i,e):md(i,e)}function em(i,e,t){const{widths:n,kinds:s,breakableFitAdvances:r}=i;if(n.length===0)return 0;const o=ba().lineFitEpsilon,c=e+o;let l=0,h=0,u=!1,d=0,f=0,m=0,g=0,A=-1,p=0;function y(){A=-1,p=0}function b(v=m,C=g,F=h){l++,t?.({startSegmentIndex:d,startGraphemeIndex:f,endSegmentIndex:v,endGraphemeIndex:C,width:F}),h=0,u=!1,y()}function _(v,C){u=!0,d=v,f=0,m=v+1,g=0,h=C}function M(v,C,F){u=!0,d=v,f=C,m=v,g=C+1,h=F}function w(v,C){if(!u){_(v,C);return}h+=C,m=v+1,g=0}function S(v,C){const F=r[v];for(let K=C;K<F.length;K++){const q=F[K];u?h+q>c?(b(),M(v,K,q)):(h+=q,m=v,g=K+1):M(v,K,q)}u&&m===v&&g===F.length&&(m=v+1,g=0)}let T=0;for(;T<n.length&&!(!u&&(T=nM(i,T),T>=n.length));){const v=n[T],C=s[T],F=C==="space"||C==="preserved-space"||C==="tab"||C==="zero-width-break"||C==="soft-hyphen";if(!u){v>e&&r[T]!==null?S(T,0):_(T,v),F&&(A=T+1,p=h-v),T++;continue}if(h+v>c){if(F){w(T,v),b(T+1,0,h-v),T++;continue}if(A>=0){if(m>A||m===A&&g>0){b();continue}b(A,0,p);continue}if(v>e&&r[T]!==null){b(),S(T,0),T++;continue}b();continue}w(T,v),F&&(A=T+1,p=h-v),T++}return u&&b(),l}function md(i,e,t){if(i.simpleLineWalkFastPath)return em(i,e,t);const{widths:n,lineEndFitAdvances:s,lineEndPaintAdvances:r,kinds:a,breakableFitAdvances:o,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:h}=i;if(n.length===0||h.length===0)return 0;const u=ba(),d=u.lineFitEpsilon,f=e+d;let m=0,g=0,A=!1,p=0,y=0,b=0,_=0,M=-1,w=0,S=0,T=null;function v(){M=-1,w=0,S=0,T=null}function C(Q=b,J=_,ee=g){m++,t?.({startSegmentIndex:p,startGraphemeIndex:y,endSegmentIndex:Q,endGraphemeIndex:J,width:ee}),g=0,A=!1,v()}function F(Q,J){A=!0,p=Q,y=0,b=Q+1,_=0,g=J}function K(Q,J,ee){A=!0,p=Q,y=J,b=Q,_=J+1,g=ee}function q(Q,J){if(!A){F(Q,J);return}g+=J,b=Q+1,_=0}function $(Q,J,ee,ae){if(!J)return;const ye=Q==="tab"?0:s[ee],Me=Q==="tab"?ae:r[ee];M=ee+1,w=g-ae+ye,S=g-ae+Me,T=Q}function D(Q,J){const ee=o[Q];for(let ae=J;ae<ee.length;ae++){const ye=ee[ae];A?g+ye>f?(C(),K(Q,ae,ye)):(g+=ye,b=Q,_=ae+1):K(Q,ae,ye)}A&&b===Q&&_===ee.length&&(b=Q+1,_=0)}function O(Q){if(T!=="soft-hyphen")return!1;const J=o[Q];if(J==null)return!1;const{fitCount:ee,fittedWidth:ae}=Zg(J,g,e,d,c);return ee===0?!1:(g=ae,b=Q,_=ee,v(),ee===J.length?(b=Q+1,_=0,!0):(C(Q,ee,ae+c),D(Q,ee),!0))}function j(Q){m++,t?.({startSegmentIndex:Q.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:Q.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),v()}for(let Q=0;Q<h.length;Q++){const J=h[Q];if(J.startSegmentIndex===J.endSegmentIndex){j(J);continue}A=!1,g=0,p=J.startSegmentIndex,y=0,b=J.startSegmentIndex,_=0,v();let ee=J.startSegmentIndex;for(;ee<J.endSegmentIndex;){const ae=a[ee],ye=ae==="space"||ae==="preserved-space"||ae==="tab"||ae==="zero-width-break"||ae==="soft-hyphen",Me=ae==="tab"?Jg(g,l):n[ee];if(ae==="soft-hyphen"){A&&(b=ee+1,_=0,M=ee+1,w=g+c,S=g+c,T=ae),ee++;continue}if(!A){Me>e&&o[ee]!==null?D(ee,0):F(ee,Me),$(ae,ye,ee,Me),ee++;continue}if(g+Me>f){const me=g+(ae==="tab"?0:s[ee]),be=g+(ae==="tab"?Me:r[ee]);if(T==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&w<=f){C(M,0,S);continue}if(T==="soft-hyphen"&&O(ee)){ee++;continue}if(ye&&me<=f){q(ee,Me),C(ee+1,0,be),ee++;continue}if(M>=0&&w<=f){if(b>M||b===M&&_>0){C();continue}const xe=M;C(xe,0,S),ee=xe;continue}if(Me>e&&o[ee]!==null){C(),D(ee,0),ee++;continue}C();continue}q(ee,Me),$(ae,ye,ee,Me),ee++}if(A){const ae=M===J.consumedEndSegmentIndex?S:g;C(J.consumedEndSegmentIndex,0,ae)}}return m}function bd(i,e,t,n){const s=i.chunks[t];if(s.startSegmentIndex===s.endSegmentIndex)return e.segmentIndex=s.consumedEndSegmentIndex,e.graphemeIndex=0,0;const{widths:r,lineEndFitAdvances:a,lineEndPaintAdvances:o,kinds:c,breakableFitAdvances:l,discretionaryHyphenWidth:h,tabStopAdvance:u}=i,d=ba(),f=d.lineFitEpsilon,m=n+f;let g=0,A=!1,p=e.segmentIndex,y=e.graphemeIndex,b=-1,_=0,M=0,w=null;function S(){b=-1,_=0,M=0,w=null}function T(D=p,O=y,j=g){return A?(e.segmentIndex=D,e.graphemeIndex=O,j):null}function v(D,O){A=!0,p=D+1,y=0,g=O}function C(D,O,j){A=!0,p=D,y=O+1,g=j}function F(D,O){if(!A){v(D,O);return}g+=O,p=D+1,y=0}function K(D,O,j,Q){if(!O)return;const J=D==="tab"?0:a[j],ee=D==="tab"?Q:o[j];b=j+1,_=g-Q+J,M=g-Q+ee,w=D}function q(D,O){const j=l[D];for(let Q=O;Q<j.length;Q++){const J=j[Q];if(!A)C(D,Q,J);else{if(g+J>m)return T();g+=J,p=D,y=Q+1}}return A&&p===D&&y===j.length&&(p=D+1,y=0),null}function $(D){if(w!=="soft-hyphen"||b<0)return null;const O=l[D]??null;if(O!==null){const{fitCount:j,fittedWidth:Q}=Zg(O,g,n,f,h);if(j===O.length)return g=Q,p=D+1,y=0,S(),null;if(j>0)return T(D,j,Q+h)}return _<=m?T(b,0,M):null}for(let D=e.segmentIndex;D<s.endSegmentIndex;D++){const O=c[D],j=O==="space"||O==="preserved-space"||O==="tab"||O==="zero-width-break"||O==="soft-hyphen",Q=D===e.segmentIndex?e.graphemeIndex:0,J=O==="tab"?Jg(g,u):r[D];if(O==="soft-hyphen"&&Q===0){A&&(p=D+1,y=0,b=D+1,_=g+h,M=g+h,w=O);continue}if(!A){if(Q>0){const ae=q(D,Q);if(ae!==null)return ae}else if(J>n&&l[D]!==null){const ae=q(D,0);if(ae!==null)return ae}else v(D,J);K(O,j,D,J);continue}if(g+J>m){const ae=g+(O==="tab"?0:a[D]),ye=g+(O==="tab"?J:o[D]);if(w==="soft-hyphen"&&d.preferEarlySoftHyphenBreak&&_<=m)return T(b,0,M);const Me=$(D);if(Me!==null)return Me;if(j&&ae<=m)return F(D,J),T(D+1,0,ye);if(b>=0&&_<=m)return p>b||p===b&&y>0?T():T(b,0,M);if(J>n&&l[D]!==null){const se=T();if(se!==null)return se;const me=q(D,0);if(me!==null)return me}return T()}F(D,J),K(O,j,D,J)}return b===s.consumedEndSegmentIndex&&y===0?T(s.consumedEndSegmentIndex,0,M):T(s.consumedEndSegmentIndex,0,g)}function tm(i,e,t){const{widths:n,kinds:s,breakableFitAdvances:r}=i,o=ba().lineFitEpsilon,c=t+o;let l=0,h=!1,u=e.segmentIndex,d=e.graphemeIndex,f=-1,m=0;for(let g=e.segmentIndex;g<n.length;g++){const A=n[g],p=s[g],y=p==="space"||p==="preserved-space"||p==="tab"||p==="zero-width-break"||p==="soft-hyphen",b=g===e.segmentIndex?e.graphemeIndex:0,_=r[g];if(!h){if(b>0||A>t&&_!==null){const M=_,w=M[b];h=!0,l=w,u=g,d=b+1;for(let S=b+1;S<M.length;S++){const T=M[S];if(l+T>c)return e.segmentIndex=u,e.graphemeIndex=d,l;l+=T,u=g,d=S+1}u===g&&d===M.length&&(u=g+1,d=0)}else h=!0,l=A,u=g+1,d=0;y&&(f=g+1,m=l-A);continue}if(l+A>c)return y?(e.segmentIndex=g+1,e.graphemeIndex=0,l):f>=0?u>f||u===f&&d>0?(e.segmentIndex=u,e.graphemeIndex=d,l):(e.segmentIndex=f,e.graphemeIndex=0,m):(e.segmentIndex=u,e.graphemeIndex=d,l);l+=A,u=g+1,d=0,y&&(f=g+1,m=l-A)}return h?(e.segmentIndex=u,e.graphemeIndex=d,l):null}function xd(i,e,t){const n={segmentIndex:e.segmentIndex,graphemeIndex:e.graphemeIndex},s=gd(i,n);if(s<0)return null;const r=n.segmentIndex,a=n.graphemeIndex,o=i.simpleLineWalkFastPath?tm(i,n,t):bd(i,n,s,t);return o===null?null:{startSegmentIndex:r,startGraphemeIndex:a,endSegmentIndex:n.segmentIndex,endGraphemeIndex:n.graphemeIndex,width:o}}function aM(i,e,t){const n=gd(i,e);return n<0?null:i.simpleLineWalkFastPath?tm(i,e,t):bd(i,e,n,t)}function oM(i,e){if(i.widths.length===0)return{lineCount:0,maxLineWidth:0};const t={segmentIndex:0,graphemeIndex:0};let n=0,s=0;if(!i.simpleLineWalkFastPath){let r=gd(i,t);for(;r>=0;){const a=bd(i,t,r,e);if(a===null)return{lineCount:n,maxLineWidth:s};n++,a>s&&(s=a),r=sM(i,r,t)}return{lineCount:n,maxLineWidth:s}}for(;;){const r=aM(i,t,e);if(r===null)return{lineCount:n,maxLineWidth:s};n++,r>s&&(s=r)}}let Ed=null,nm=new WeakMap;function im(){return Ed===null&&(Ed=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ed}function cM(i){return i?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function lM(i,e){const t=[];let n=[],s=0,r=!1,a=!1,o=!1;function c(){n.length!==0&&(t.push({text:n.length===1?n[0]:n.join(""),start:s}),n=[],r=!1,a=!1,o=!1)}function l(u,d,f){n=[u],s=d,r=f,a=dd(u),o=ol.has(u)}function h(u,d){n.push(u),r=r||d;const f=dd(u);u.length===1&&lr.has(u)?a=a||f:a=f,o=!1}for(const u of im().segment(i)){const d=u.segment,f=cr(d);if(n.length===0){l(d,u.index,f);continue}if(o||ld.has(d)||lr.has(d)||e.carryCJKAfterClosingQuote&&f&&a){h(d,f);continue}if(!r&&!f){h(d,f);continue}c(),l(d,u.index,f)}return c(),t}function hM(i,e,t,n){const s=ba(),{cache:r,emojiCorrection:a}=tM(e,j1(i.normalized)),o=hr("-",Ds("-",r),a),l=hr(" ",Ds(" ",r),a)*8;if(i.len===0)return cM(t);const h=[],u=[],d=[],f=[];let m=i.chunks.length<=1;const g=t?[]:null,A=[],p=t?[]:null,y=Array.from({length:i.len});function b(S,T,v,C,F,K,q){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(m=!1),h.push(T),u.push(v),d.push(C),f.push(F),g?.push(K),A.push(q),p!==null&&p.push(S)}function _(S,T,v,C,F){const K=Ds(S,r),q=hr(S,K,a),$=T==="space"||T==="preserved-space"||T==="zero-width-break"?0:q,D=T==="space"||T==="zero-width-break"?0:q;if(F&&C&&S.length>1){let O="sum-graphemes";ll(S)?O="pair-context":s.preferPrefixWidthsForBreakableRuns&&(O="segment-prefixes");const j=eM(S,K,r,a,O);b(S,q,$,D,T,v,j);return}b(S,q,$,D,T,v,null)}for(let S=0;S<i.len;S++){y[S]=h.length;const T=i.texts[S],v=i.isWordLike[S],C=i.kinds[S],F=i.starts[S];if(C==="soft-hyphen"){b(T,0,o,o,C,F,null);continue}if(C==="hard-break"){b(T,0,0,0,C,F,null);continue}if(C==="tab"){b(T,0,0,0,C,F,null);continue}const K=Ds(T,r);if(C==="text"&&K.containsCJK){const $=lM(T,s);for(let D=0;D<$.length;D++){const O=$[D];_(O.text,"text",F+O.start,v,!cr(O.text))}continue}_(T,C,F,v,!0)}const M=uM(i.chunks,y,h.length),w=g===null?null:n1(i.normalized,g);return p!==null?{widths:h,lineEndFitAdvances:u,lineEndPaintAdvances:d,kinds:f,simpleLineWalkFastPath:m,segLevels:w,breakableFitAdvances:A,discretionaryHyphenWidth:o,tabStopAdvance:l,chunks:M,segments:p}:{widths:h,lineEndFitAdvances:u,lineEndPaintAdvances:d,kinds:f,simpleLineWalkFastPath:m,segLevels:w,breakableFitAdvances:A,discretionaryHyphenWidth:o,tabStopAdvance:l,chunks:M}}function uM(i,e,t){const n=[];for(let s=0;s<i.length;s++){const r=i[s],a=r.startSegmentIndex<e.length?e[r.startSegmentIndex]:t,o=r.endSegmentIndex<e.length?e[r.endSegmentIndex]:t,c=r.consumedEndSegmentIndex<e.length?e[r.consumedEndSegmentIndex]:t;n.push({startSegmentIndex:a,endSegmentIndex:o,consumedEndSegmentIndex:c})}return n}function sm(i,e,t,n){const r=z1(i,ba(),n?.whiteSpace,"normal");return hM(r,e,t)}function hl(i,e,t){return sm(i,e,!1,t)}function ul(i,e,t){return sm(i,e,!0,t)}function aL(i){return i}function dM(i,e,t){const n=rM(i,e);return{lineCount:n,height:n*t}}function rm(i,e,t){let n=t.get(i);if(n!==void 0)return n;n=[];const s=im();for(const r of s.segment(e[i]))n.push(r.segment);return t.set(i,n),n}function am(i){let e=nm.get(i);return e!==void 0||(e=new Map,nm.set(i,e)),e}function fM(i,e,t,n){return n>0&&i[n-1]==="soft-hyphen"&&!(e===n&&t>0)}function pM(i,e,t,n,s,r,a){let o="";const c=fM(e,n,s,r);for(let l=n;l<r;l++)e[l]==="soft-hyphen"||e[l]==="hard-break"||(l===n&&s>0?o+=rm(l,i,t).slice(s).join(""):o+=i[l]);return a>0?(c&&(o+="-"),o+=rm(r,i,t).slice(n===r?s:0,a).join("")):c&&(o+="-"),o}function om(i,e,t,n,s,r,a){return{text:pM(i.segments,i.kinds,e,n,s,r,a),width:t,start:{segmentIndex:n,graphemeIndex:s},end:{segmentIndex:r,graphemeIndex:a}}}function AM(i,e,t){return om(i,e,t.width,t.startSegmentIndex,t.startGraphemeIndex,t.endSegmentIndex,t.endGraphemeIndex)}function gM(i){return{width:i.width,start:{segmentIndex:i.startSegmentIndex,graphemeIndex:i.startGraphemeIndex},end:{segmentIndex:i.endSegmentIndex,graphemeIndex:i.endGraphemeIndex}}}function mM(i,e){return om(i,am(i),e.width,e.start.segmentIndex,e.start.graphemeIndex,e.end.segmentIndex,e.end.graphemeIndex)}function bM(i,e,t){return i.widths.length===0?0:md(i,e,n=>{t(gM(n))})}function _d(i,e){return oM(i,e)}function cm(i){let e=0;return bM(i,Number.POSITIVE_INFINITY,t=>{t.width>e&&(e=t.width)}),e}function xM(i,e,t){const n=[];if(i.widths.length===0)return{lineCount:0,height:0,lines:n};const s=am(i),r=md(i,e,a=>{n.push(AM(i,s,a))});return{lineCount:r,height:r*t,lines:n}}const EM=/[ \t\n\f\r]+/,lm=/^[ \t\n\f\r]+/,hm=/[ \t\n\f\r]+$/,dl={segmentIndex:0,graphemeIndex:0},um={itemIndex:0,segmentIndex:0,graphemeIndex:0};function oL(i){return i}function yd(i){return{segmentIndex:i.segmentIndex,graphemeIndex:i.graphemeIndex}}function dm(i){return i.segmentIndex===0&&i.graphemeIndex===0}function fl(i,e){const t=e.get(i);if(t!==void 0)return t;const n=cm(ul("A A",i)),s=cm(ul("AA",i)),r=Math.max(0,n-s);return e.set(i,r),r}function _M(i){const e=xd(i,dl,Number.POSITIVE_INFINITY);return e===null?null:{endGraphemeIndex:e.endGraphemeIndex,endSegmentIndex:e.endSegmentIndex,width:e.width}}function yM(i,e){return i===0&&e>0}function fm(i){const e=[],t=Array.from({length:i.length}),n=new Map;let s=0;for(let r=0;r<i.length;r++){const a=i[r],o=lm.test(a.text),c=hm.test(a.text),l=a.text.replace(lm,"").replace(hm,"");if(l.length===0){EM.test(a.text)&&s===0&&(s=fl(a.font,n));continue}const h=s>0?s:o?fl(a.font,n):0,u=ul(l,a.font),d=_M(u);if(d===null){s=c?fl(a.font,n):0;continue}const f={break:a.break??"normal",endGraphemeIndex:d.endGraphemeIndex,endSegmentIndex:d.endSegmentIndex,extraWidth:a.extraWidth??0,gapBefore:h,naturalWidth:d.width,prepared:u,sourceItemIndex:r};e.push(f),t[r]=f,s=c?fl(a.font,n):0}return{items:e,itemsBySourceItemIndex:t}}function wM(i,e,t,n){if(i.items.length===0||t.itemIndex>=i.items.length)return null;const s=Math.max(1,e);let r=0,a=s,o=t.itemIndex;const c={segmentIndex:t.segmentIndex,graphemeIndex:t.graphemeIndex};e:for(;o<i.items.length;){const l=i.items[o];if(!dm(c)&&c.segmentIndex===l.endSegmentIndex&&c.graphemeIndex===l.endGraphemeIndex){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}const h=r===0?0:l.gapBefore,u=dm(c);if(l.break==="never"){if(!u){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}const g=l.naturalWidth+l.extraWidth,A=h+g;if(r>0&&A>a)break e;n?.(l,h,g,yd(dl),{segmentIndex:l.endSegmentIndex,graphemeIndex:l.endGraphemeIndex}),r+=A,a=Math.max(0,s-r),o++,c.segmentIndex=0,c.graphemeIndex=0;continue}const d=h+l.extraWidth;if(r>0&&d>=a)break e;if(u){const g=d+l.naturalWidth;if(g<=a){n?.(l,h,l.naturalWidth+l.extraWidth,yd(dl),{segmentIndex:l.endSegmentIndex,graphemeIndex:l.endGraphemeIndex}),r+=g,a=Math.max(0,s-r),o++,c.segmentIndex=0,c.graphemeIndex=0;continue}}const f=Math.max(1,a-d),m=xd(l.prepared,c,f);if(m===null){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}if(c.segmentIndex===m.endSegmentIndex&&c.graphemeIndex===m.endGraphemeIndex){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}if(r>0&&u&&h>0&&yM(m.endSegmentIndex,m.endGraphemeIndex)){const g=xd(l.prepared,dl,Math.max(1,s-l.extraWidth));if(g!==null&&(g.endSegmentIndex>m.endSegmentIndex||g.endSegmentIndex===m.endSegmentIndex&&g.endGraphemeIndex>m.endGraphemeIndex))break e}if(n?.(l,h,m.width+l.extraWidth,yd(c),{segmentIndex:m.endSegmentIndex,graphemeIndex:m.endGraphemeIndex}),r+=h+m.width+l.extraWidth,a=Math.max(0,s-r),m.endSegmentIndex===l.endSegmentIndex&&m.endGraphemeIndex===l.endGraphemeIndex){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}c.segmentIndex=m.endSegmentIndex,c.graphemeIndex=m.endGraphemeIndex;break}return r===0?null:(t.itemIndex=o,t.segmentIndex=c.segmentIndex,t.graphemeIndex=c.graphemeIndex,r)}function CM(i,e,t=um){const n=i,s={itemIndex:t.itemIndex,segmentIndex:t.segmentIndex,graphemeIndex:t.graphemeIndex},r=[],a=wM(n,e,s,(o,c,l,h,u)=>{r.push({itemIndex:o.sourceItemIndex,gapBefore:c,occupiedWidth:l,start:h,end:u})});return a===null?null:{fragments:r,width:a,end:s}}function vM(i,e){return mM(i.prepared,{width:e.occupiedWidth-i.extraWidth,start:e.start,end:e.end}).text}function pm(i,e){const t=i;return{fragments:e.fragments.map(n=>{const s=t.itemsBySourceItemIndex[n.itemIndex];if(s===void 0)throw new Error("Missing rich-text inline item for fragment");return{...n,text:vM(s,n)}}),width:e.width,end:e.end}}function Am(i,e,t){let n=0,s=um;for(;;){const r=CM(i,e,s);if(r===null)return n;t(r),n++,s=r.end}}const gm="500 14px Inter, sans-serif",wd="600 10px Inter, sans-serif",Cd="300 13px Inter, sans-serif",mm="600 10px Inter, sans-serif",bm="300 12px Inter, sans-serif",Co=18,pl=16,hn=16,Di=6,xm=12,Al=Math.min(window.devicePixelRatio||1,2),SM="rgba(0, 0, 0, 0.75)",IM="rgba(255, 255, 255, 0.08)",MM="rgba(255, 255, 255, 0.9)",BM="rgba(255, 255, 255, 0.30)",TM="rgba(255, 255, 255, 0.85)",Em="rgba(255, 255, 255, 0.08)",RM="rgba(255, 255, 255, 0.45)",NM="rgba(255, 255, 255, 0.08)",FM="rgba(255, 255, 255, 0.7)";function DM(i){let e=0,t=0,n=0;const s=new Set,r=new Set,a=new Set;let o=!1,c=!1;return i.traverse(l=>{if(l.isMesh||l.isPoints||l.isLine){n++;const h=l.geometry;h&&(h.index?t+=h.index.count/3:h.attributes.position&&(t+=h.attributes.position.count/3),h.attributes.position&&(e+=h.attributes.position.count)),l.skeleton&&(o=!0),l.morphTargetInfluences&&l.morphTargetInfluences.length>0&&(c=!0),(Array.isArray(l.material)?l.material:[l.material]).forEach(d=>{if(d){s.add(d.uuid),a.add(d.type.replace("Material",""));for(const f in d)d[f]&&d[f].isTexture&&r.add(d[f].uuid)}})}}),{vertices:e,triangles:Math.floor(t),meshes:n,materials:s.size,textures:r.size,materialTypes:Array.from(a),hasSkinning:o,hasMorphs:c}}function vo(i){return i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"K":i.toString()}function LM(i,e){const t=[];return i.hasSkinning&&t.push("skinned"),i.hasMorphs&&t.push("morph targets"),e&&e.length>0&&t.push(`${e.length} animation${e.length>1?"s":""}`),i.materialTypes.length>0&&t.push(i.materialTypes.join(", ")),t.length>0?t.join(" · "):""}function PM(i,e,t){const n=DM(e),s=LM(n,t),r=[{label:"MESHES",value:vo(n.meshes)},{label:"VERTICES",value:vo(n.vertices)},{label:"TRIANGLES",value:vo(n.triangles)},{label:"MATERIALS",value:vo(n.materials)},{label:"TEXTURES",value:vo(n.textures)}];t&&t.length>0&&r.push({label:"ANIMATIONS",value:t.length.toString()});const a=[];n.materialTypes.forEach(w=>a.push(w)),n.hasSkinning&&a.push("Skinned"),n.hasMorphs&&a.push("Morph"),t&&t.length>0&&a.push("Animated");const o=200,c=hl("Model Info",gm),l=dM(c,o,Co+2),h=r.map(w=>{const S=[{text:w.label+" ",font:wd},{text:w.value,font:Cd}],T=fm(S),v=hl(w.label,wd),C=_d(v,o),F=hl(w.value,Cd),K=_d(F,o);return{...w,labelWidth:C.maxLineWidth,valueWidth:K.maxLineWidth,richPrepared:T}}),u=a.map(w=>{const S=hl(w,mm),T=_d(S,300);return{text:w,width:T.maxLineWidth+xm}});let d=[],f=0;if(s){const w=ul(s,bm),S=xM(w,o-hn,Co);d=S.lines,f=S.height}const m=Math.max(l.width+hn*2,...h.map(w=>w.labelWidth+w.valueWidth+hn*3)),g=Math.max(m,180);let A=0;if(u.length>0){let w=0,S=1;u.forEach(T=>{w>0&&w+T.width>g-hn*2&&(S++,w=0),w+=T.width+6}),A=S*(pl+6)+Di}const p=hn+l.height+Di+Di+h.length*(Co+Di)+A+(f>0?Di+f:0)+hn,y=document.createElement("canvas");y.width=g*Al,y.height=p*Al,y.style.width=g+"px",y.style.height=p+"px";const b=y.getContext("2d");b.scale(Al,Al),b.fillStyle=SM,vd(b,0,0,g,p,10),b.fill(),b.strokeStyle=IM,b.lineWidth=1,vd(b,.5,.5,g-1,p-1,10),b.stroke();let _=hn;if(b.font=gm,b.fillStyle=MM,b.textBaseline="top",b.fillText("Model Info",hn,_),_+=l.height+Di,b.strokeStyle=Em,b.beginPath(),b.moveTo(hn,_),b.lineTo(g-hn,_),b.stroke(),_+=Di,h.forEach(w=>{b.font=wd,b.fillStyle=BM,b.textAlign="left",b.fillText(w.label,hn,_),b.font=Cd,b.fillStyle=TM,b.textAlign="right",b.fillText(w.value,g-hn,_),b.textAlign="left",_+=Co+Di}),u.length>0){let w=hn;u.forEach(S=>{w>hn&&w+S.width>g-hn&&(w=hn,_+=pl+6),b.fillStyle=NM,vd(b,w,_,S.width,pl,4),b.fill(),b.font=mm,b.fillStyle=FM,b.textBaseline="top",b.fillText(S.text,w+xm/2,_+3),w+=S.width+6}),_+=pl+Di+4}d.length>0&&(b.strokeStyle=Em,b.beginPath(),b.moveTo(hn,_),b.lineTo(g-hn,_),b.stroke(),_+=Di,b.font=bm,b.fillStyle=RM,b.textBaseline="top",d.forEach(w=>{b.fillText(w.text,hn,_),_+=Co}));const M=document.createElement("div");return M.classList.add("model-info"),M.appendChild(y),i.appendChild(M),{el:M,canvas:y,remove(){M.remove()}}}function vd(i,e,t,n,s,r){i.beginPath(),i.moveTo(e+r,t),i.lineTo(e+n-r,t),i.quadraticCurveTo(e+n,t,e+n,t+r),i.lineTo(e+n,t+s-r),i.quadraticCurveTo(e+n,t+s,e+n-r,t+s),i.lineTo(e+r,t+s),i.quadraticCurveTo(e,t+s,e,t+s-r),i.lineTo(e,t+r),i.quadraticCurveTo(e,t,e+r,t),i.closePath()}const kM="500 11px Inter, sans-serif",_m="300 10px Inter, sans-serif",Sd=10,ym=6,wm=14,gl=Math.min(window.devicePixelRatio||1,2),UM=8;function OM(i){const e=[];return i.traverse(t=>{if(e.length>=UM||!t.isMesh||!t.name||t.name.startsWith("_"))return;const n=t.geometry,s=Array.isArray(t.material)?t.material[0]:t.material,r=n&&n.attributes.position?n.attributes.position.count:0,a=s?s.type.replace("Material",""):"",o=[{text:t.name,font:kM}];r>0&&o.push({text:" "+GM(r)+" verts",font:_m}),a&&o.push({text:" "+a,font:_m});const c=fm(o);let l=0,h=0;Am(c,300,g=>{const A=pm(c,g);l=Math.max(l,A.width),h++});const u=l+Sd*2,d=h*wm+ym*2;n&&n.computeBoundingBox();const f=n?n.boundingBox:null,m=new H;f?(f.getCenter(m),m.applyMatrix4(t.matrixWorld)):t.getWorldPosition(m),e.push({name:t.name,items:o,prepared:c,labelWidth:u,labelHeight:d,position:m,vertCount:r,matType:a})}),e}function QM(i){const{labelWidth:e,labelHeight:t,items:n,prepared:s}=i,r=document.createElement("canvas");r.width=e*gl,r.height=t*gl,r.style.width=e+"px",r.style.height=t+"px";const a=r.getContext("2d");a.scale(gl,gl),a.fillStyle="rgba(0, 0, 0, 0.8)",Cm(a,0,0,e,t,6),a.fill(),a.strokeStyle="rgba(255, 255, 255, 0.1)",a.lineWidth=1,Cm(a,.5,.5,e-1,t-1,6),a.stroke(),a.textBaseline="top";let o=ym;return Am(s,e-Sd*2,c=>{const l=pm(s,c);let h=Sd;l.fragments.forEach(u=>{h+=u.gapBefore;const d=n[u.itemIndex];a.font=d.font,a.fillStyle=u.itemIndex===0?"rgba(255, 255, 255, 0.9)":"rgba(255, 255, 255, 0.45)",a.fillText(u.text,h,o),h+=u.occupiedWidth}),o+=wm}),r}function GM(i){return i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"K":i.toString()}function Cm(i,e,t,n,s,r){i.beginPath(),i.moveTo(e+r,t),i.lineTo(e+n-r,t),i.quadraticCurveTo(e+n,t,e+n,t+r),i.lineTo(e+n,t+s-r),i.quadraticCurveTo(e+n,t+s,e+n-r,t+s),i.lineTo(e+r,t+s),i.quadraticCurveTo(e,t+s,e,t+s-r),i.lineTo(e,t+r),i.quadraticCurveTo(e,t,e+r,t),i.closePath()}const Id=new WeakMap;class HM extends Ji{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,s){const r=new Ms(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,a=>{this.parse(a,t,s)},n,s)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,Kt,n).catch(n)}decodeDracoFile(e,t,n,s,r=rn,a=()=>{}){const o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:r};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Id.has(e)){const c=Id.get(e);if(c.key===n)return c.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const r=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(r,a).then(c=>(s=c,new Promise((l,h)=>{s._callbacks[r]={resolve:l,reject:h},s.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return o.catch(()=>!0).then(()=>{s&&r&&this._releaseTask(s,r)}),Id.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new On;e.index&&t.setIndex(new En(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const s=e.attributes[n],r=s.name,a=s.array,o=s.itemSize,c=new En(a,o);r==="color"&&(this._assignVertexColorSpace(c,s.vertexColorSpace),c.normalized=!(a instanceof Float32Array)),t.setAttribute(r,c)}return t}_assignVertexColorSpace(e,t){if(t!==Kt)return;const n=new qe;for(let s=0,r=e.count;s<r;s++)n.fromBufferAttribute(e,s),At.toWorkingColorSpace(n,Kt),e.setXYZ(s,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new Ms(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((s,r)=>{n.load(e,s,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];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 s=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const r=zM.toString(),a=["/* draco decoder */",s,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`-`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(r){const a=r.data;switch(a.type){case"decode":s._callbacks[a.id].resolve(a);break;case"error":s._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,r){return s._taskLoad>r._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function zM(){let i,e;onmessage=function(a){const o=a.data;switch(o.type){case"init":i=o.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":const c=o.buffer,l=o.taskConfig;e.then(h=>{const u=h.draco,d=new u.Decoder;try{const f=t(u,d,new Int8Array(c),l),m=f.attributes.map(g=>g.array.buffer);f.index&&m.push(f.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:f},m)}catch(f){console.error(f),self.postMessage({type:"error",id:o.id,error:f.message})}finally{u.destroy(d)}});break}};function t(a,o,c,l){const h=l.attributeIDs,u=l.attributeTypes;let d,f;const m=o.GetEncodedGeometryType(c);if(m===a.TRIANGULAR_MESH)d=new a.Mesh,f=o.DecodeArrayToMesh(c,c.byteLength,d);else if(m===a.POINT_CLOUD)d=new a.PointCloud,f=o.DecodeArrayToPointCloud(c,c.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:[]};for(const A in h){const p=self[u[A]];let y,b;if(l.useUniqueIDs)b=h[A],y=o.GetAttributeByUniqueId(d,b);else{if(b=o.GetAttributeId(d,a[h[A]]),b===-1)continue;y=o.GetAttribute(d,b)}const _=s(a,o,d,A,p,y);A==="color"&&(_.vertexColorSpace=l.vertexColorSpace),g.attributes.push(_)}return m===a.TRIANGULAR_MESH&&(g.index=n(a,o,d)),a.destroy(d),g}function n(a,o,c){const h=c.num_faces()*3,u=h*4,d=a._malloc(u);o.GetTrianglesUInt32Array(c,u,d);const f=new Uint32Array(a.HEAPF32.buffer,d,h).slice();return a._free(d),{array:f,itemSize:1}}function s(a,o,c,l,h,u){const d=u.num_components(),m=c.num_points()*d,g=m*h.BYTES_PER_ELEMENT,A=r(a,h),p=a._malloc(g);o.GetAttributeDataArrayForAllPoints(c,u,A,g,p);const y=new h(a.HEAPF32.buffer,p,m).slice();return a._free(p),{name:l,array:y,itemSize:d}}function r(a,o){switch(o){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class VM{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:s,msg:r,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(r,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=n,this.workers[s].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const WM=0,vm=2,qM=1,Sm=2,KM=0,XM=1,YM=10,jM=0,Im=9,Mm=15,Bm=16,Tm=22,Rm=37,Nm=43,Fm=76,Dm=83,Lm=97,Pm=100,km=103,Um=109,Om=165,Qm=166,Md=1000066e3;class JM{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class So{constructor(e,t,n,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){t===void 0&&(t=0);const n=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,s)}}const Nn=[171,75,84,88,32,50,48,187,13,10,26,10];function Gm(i){return new TextDecoder().decode(i)}function ZM(i){const e=new Uint8Array(i.buffer,i.byteOffset,Nn.length);if(e[0]!==Nn[0]||e[1]!==Nn[1]||e[2]!==Nn[2]||e[3]!==Nn[3]||e[4]!==Nn[4]||e[5]!==Nn[5]||e[6]!==Nn[6]||e[7]!==Nn[7]||e[8]!==Nn[8]||e[9]!==Nn[9]||e[10]!==Nn[10]||e[11]!==Nn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new JM,n=17*Uint32Array.BYTES_PER_ELEMENT,s=new So(i,Nn.length,n,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32();const r=s._nextUint32();t.supercompressionScheme=s._nextUint32();const a=s._nextUint32(),o=s._nextUint32(),c=s._nextUint32(),l=s._nextUint32(),h=s._nextUint64(),u=s._nextUint64(),d=new So(i,Nn.length+n,3*r*8,!0);for(let j=0;j<r;j++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const f=new So(i,a,o,!0),m={vendorId:f._skip(4)._nextUint16(),descriptorType:f._nextUint16(),versionNumber:f._nextUint16(),descriptorBlockSize:f._nextUint16(),colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},g=(m.descriptorBlockSize/4-6)/4;for(let j=0;j<g;j++){const Q={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&Q.channelType?(Q.sampleLower=f._nextInt32(),Q.sampleUpper=f._nextInt32()):(Q.sampleLower=f._nextUint32(),Q.sampleUpper=f._nextUint32()),m.samples[j]=Q}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(m);const A=new So(i,c,l,!0);for(;A._offset<l;){const j=A._nextUint32(),Q=A._scan(j),J=Gm(Q);if(t.keyValue[J]=A._nextUint8Array(j-Q.byteLength-1),J.match(/^ktx/i)){const ee=Gm(t.keyValue[J]);t.keyValue[J]=ee.substring(0,ee.lastIndexOf("\0"))}A._skip(j%4?4-j%4:0)}if(u<=0)return t;const p=new So(i,h,u,!0),y=p._nextUint16(),b=p._nextUint16(),_=p._nextUint32(),M=p._nextUint32(),w=p._nextUint32(),S=p._nextUint32(),T=[];for(let j=0;j<r;j++)T.push({imageFlags:p._nextUint32(),rgbSliceByteOffset:p._nextUint32(),rgbSliceByteLength:p._nextUint32(),alphaSliceByteOffset:p._nextUint32(),alphaSliceByteLength:p._nextUint32()});const v=h+p._offset,C=v+_,F=C+M,K=F+w,q=new Uint8Array(i.buffer,i.byteOffset+v,_),$=new Uint8Array(i.buffer,i.byteOffset+C,M),D=new Uint8Array(i.buffer,i.byteOffset+F,w),O=new Uint8Array(i.buffer,i.byteOffset+K,S);return t.globalData={endpointCount:y,selectorCount:b,imageDescs:T,endpointsData:q,selectorsData:$,tablesData:D,extendedData:O},t}let Bd,es,Td;const Rd={env:{emscripten_notify_memory_growth:function(i){Td=new Uint8Array(es.exports.memory.buffer)}}};class $M{init(){return Bd||(Bd=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Hm).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Rd)).then(this._init):WebAssembly.instantiate(Buffer.from(Hm,"base64"),Rd).then(this._init),Bd)}_init(e){es=e.instance,Rd.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!es)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,s=es.exports.malloc(n);Td.set(e,s),t=t||Number(es.exports.ZSTD_findDecompressedSize(s,n));const r=es.exports.malloc(t),a=es.exports.ZSTD_decompress(r,t,s,n),o=Td.slice(r,r+a);return es.exports.free(s),es.exports.free(r),o}}const Hm="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2Zp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6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQ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ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2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gsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0Igi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YCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgAS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EMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80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AAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",eB="display-p3",tB="display-p3-linear",Nd=new WeakMap;let Fd=0,Dd;class ti extends Ji{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new VM,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new Ms(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Ms(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const s=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([r,a])=>{const o=ti.BasisWorker.toString(),c=["/* constants */","let _EngineFormat = "+JSON.stringify(ti.EngineFormat),"let _EngineType = "+JSON.stringify(ti.EngineType),"let _TranscoderFormat = "+JSON.stringify(ti.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(ti.BasisFormat),"/* basis_transcoder.js */",r,"/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`-`);this.workerSourceURL=URL.createObjectURL(new Blob([c])),this.transcoderBinary=a,this.workerPool.setWorkerCreator(()=>{const l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),Fd>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Fd++}return this.transcoderPending}load(e,t,n,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const r=new Ms(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,a=>{this.parse(a,t,s)},n,s)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Nd.has(e))return Nd.get(e).promise.then(t).catch(n);this._createTexture(e).then(s=>t?t(s):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:s,data:{faces:r,width:a,height:o,format:c,type:l,dfdFlags:h}}=e;if(n==="error")return Promise.reject(s);let u;if(t.faceCount===6)u=new Y_(r,c,l);else{const d=r[0].mipmaps;u=t.layerCount>1?new X_(d,a,o,t.layerCount,c,l):new Wc(d,a,o,c,l)}return u.minFilter=r[0].mipmaps.length===1?zt:Jn,u.magFilter=zt,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=zm(t),u.premultiplyAlpha=!!(h&qM),u}async _createTexture(e,t={}){const n=ZM(new Uint8Array(e)),s=n.vkFormat===Md&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===jM||s&&!this.workerConfig.astcHDRSupported))return iB(n);const a=t,o=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:a},[e])).then(c=>this._createTextureFrom(c.data,n));return Nd.set(e,{promise:o}),o}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Fd--}}ti.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},ti.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},ti.EngineFormat={RGBAFormat:sn,RGBA_ASTC_4x4_Format:Ka,RGB_BPTC_UNSIGNED_Format:fc,RGBA_BPTC_Format:Ya,RGBA_ETC2_EAC_Format:dc,RGBA_PVRTC_4BPPV1_Format:lc,RGBA_S3TC_DXT5_Format:qa,RGB_ETC1_Format:hc,RGB_ETC2_Format:uc,RGB_PVRTC_4BPPV1_Format:cc,RGBA_S3TC_DXT1_Format:Wa},ti.EngineType={UnsignedByteType:tn,HalfFloatType:Mn,FloatType:nn},ti.BasisWorker=function(){let i,e,t;const n=_EngineFormat,s=_EngineType,r=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(m){const g=m.data;switch(g.type){case"init":i=g.config,o(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:A,buffers:p,width:y,height:b,hasAlpha:_,format:M,type:w,dfdFlags:S}=c(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:A,width:y,height:b,hasAlpha:_,format:M,type:w,dfdFlags:S}},p)}catch(A){console.error(A),self.postMessage({type:"error",id:g.id,error:A.message})}});break}});function o(m){e=new Promise(g=>{t={wasmBinary:m,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(m){const g=new t.KTX2File(new Uint8Array(m));function A(){g.close(),g.delete()}if(!g.isValid())throw A(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let p;if(g.isUASTC())p=a.UASTC;else if(g.isETC1S())p=a.ETC1S;else if(g.isHDR())p=a.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const y=g.getWidth(),b=g.getHeight(),_=g.getLayers()||1,M=g.getLevels(),w=g.getFaces(),S=g.getHasAlpha(),T=g.getDFDFlags(),{transcoderFormat:v,engineFormat:C,engineType:F}=u(p,y,b,S);if(!y||!b||!M)throw A(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw A(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],q=[];for(let $=0;$<w;$++){const D=[];for(let O=0;O<M;O++){const j=[];let Q,J;for(let ae=0;ae<_;ae++){const ye=g.getImageLevelInfo(O,ae,$);$===0&&O===0&&ae===0&&(ye.origWidth%4!==0||ye.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),M>1?(Q=ye.origWidth,J=ye.origHeight):(Q=ye.width,J=ye.height);let Me=new Uint8Array(g.getImageTranscodedSizeInBytes(O,ae,0,v));const se=g.transcodeImage(Me,O,ae,$,v,0,-1,-1);if(F===s.HalfFloatType&&(Me=new Uint16Array(Me.buffer,Me.byteOffset,Me.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!se)throw A(),new Error("THREE.KTX2Loader: .transcodeImage failed.");j.push(Me)}const ee=f(j);D.push({data:ee,width:Q,height:J}),q.push(ee.buffer)}K.push({mipmaps:D,width:y,height:b,format:C,type:F})}return A(),{faces:K,buffers:q,width:y,height:b,hasAlpha:S,dfdFlags:T,format:C,type:F}}const l=[{if:"astcSupported",basisFormat:[a.UASTC],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.BC1,r.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[a.UASTC_HDR],transcoderFormat:[r.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.RGBA32,r.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[a.UASTC_HDR],transcoderFormat:[r.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[a.ETC1S]:l.filter(m=>m.basisFormat.includes(a.ETC1S)).sort((m,g)=>m.priorityUASTC-g.priorityUASTC),[a.UASTC]:l.filter(m=>m.basisFormat.includes(a.UASTC)).sort((m,g)=>m.priorityUASTC-g.priorityUASTC),[a.UASTC_HDR]:l.filter(m=>m.basisFormat.includes(a.UASTC_HDR)).sort((m,g)=>m.priorityHDR-g.priorityHDR)};function u(m,g,A,p){const y=h[m];for(let b=0;b<y.length;b++){const _=y[b];if(_.if&&!i[_.if]||!_.basisFormat.includes(m)||p&&_.transcoderFormat.length<2||_.needsPowerOfTwo&&!(d(g)&&d(A)))continue;const M=_.transcoderFormat[p?1:0],w=_.engineFormat[p?1:0],S=_.engineType[0];return{transcoderFormat:M,engineFormat:w,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(m){return m<=2?!0:(m&m-1)===0&&m!==0}function f(m){if(m.length===1)return m[0];let g=0;for(let y=0;y<m.length;y++){const b=m[y];g+=b.byteLength}const A=new Uint8Array(g);let p=0;for(let y=0;y<m.length;y++){const b=m[y];A.set(b,p),p+=b.byteLength}return A}};const nB=new Set([sn,Ys,Gi]),Ld={[Um]:sn,[Lm]:sn,[Rm]:sn,[Nm]:sn,[km]:Ys,[Dm]:Ys,[Bm]:Ys,[Tm]:Ys,[Pm]:Gi,[Fm]:Gi,[Mm]:Gi,[Im]:Gi,[Md]:Ka,[Qm]:Xa,[Om]:Xa},Pd={[Um]:nn,[Lm]:Mn,[Rm]:tn,[Nm]:tn,[km]:nn,[Dm]:Mn,[Bm]:tn,[Tm]:tn,[Pm]:nn,[Fm]:Mn,[Mm]:tn,[Im]:tn,[Md]:Mn,[Qm]:tn,[Om]:tn};async function iB(i){const{vkFormat:e}=i;if(Ld[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;i.supercompressionScheme===vm&&(Dd||(Dd=new Promise(async r=>{const a=new $M;await a.init(),r(a)})),t=await Dd);const n=[];for(let r=0;r<i.levels.length;r++){const a=Math.max(1,i.pixelWidth>>r),o=Math.max(1,i.pixelHeight>>r),c=i.pixelDepth?Math.max(1,i.pixelDepth>>r):0,l=i.levels[r];let h;if(i.supercompressionScheme===WM)h=l.levelData;else if(i.supercompressionScheme===vm)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;Pd[e]===nn?u=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):Pd[e]===Mn?u=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):u=h,n.push({data:u,width:a,height:o,depth:c})}let s;if(nB.has(Ld[e]))s=i.pixelDepth===0?new Lc(n[0].data,i.pixelWidth,i.pixelHeight):new Fp(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth);else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new Wc(n,i.pixelWidth,i.pixelHeight),s.minFilter=n.length===1?zt:Jn,s.magFilter=zt}return s.mipmaps=n,s.type=Pd[e],s.format=Ld[e],s.colorSpace=zm(i),s.needsUpdate=!0,Promise.resolve(s)}function zm(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===XM?e.transferFunction===Sm?Kt:rn:e.colorPrimaries===YM?e.transferFunction===Sm?eB:tB:(e.colorPrimaries===KM||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),oi)}const ml="[default]",kd={ASSET_GENERATOR:"assetgenerator"},bl=new wA,Vm="https://unpkg.com/[email protected]",sB=new HM(bl).setDecoderPath(`${Vm}/examples/jsm/libs/draco/gltf/`),rB=new ti(bl).setTranscoderPath(`${Vm}/examples/jsm/libs/basis/`);function Wm(i,e){const t=new Set;i.traverse(n=>{if(!n.geometry)return;(Array.isArray(n.material)?n.material:[n.material]).forEach(r=>{r&&!t.has(r.uuid)&&(t.add(r.uuid),e(r))})})}function aB(i){const{state:e,options:t}=i;if(t.preset===kd.ASSET_GENERATOR){const r=new hy;r.name="hemi_light",i.scene.add(r),i.lights.push(r);return}const n=new Ay(e.ambientColor,e.ambientIntensity);n.name="ambient_light",i.defaultCamera.add(n);const s=new MA(e.directColor,e.directIntensity);s.position.set(.5,0,.866),s.name="main_light",i.defaultCamera.add(s),i.lights.push(n,s)}function oB(i){i.lights.forEach(e=>e.parent.remove(e)),i.lights.length=0}var ni=Uint8Array,xa=Uint16Array,cB=Int32Array,qm=new ni([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,0,0,0]),Km=new ni([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]),lB=new ni([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xm=function(i,e){for(var t=new xa(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var s=new cB(t[30]),n=1;n<30;++n)for(var r=t[n];r<t[n+1];++r)s[r]=r-t[n]<<5|n;return{b:t,r:s}},Ym=Xm(qm,2),jm=Ym.b,hB=Ym.r;jm[28]=258,hB[258]=28;for(var uB=Xm(Km,0),dB=uB.b,Ud=new xa(32768),kt=0;kt<32768;++kt){var Ls=(kt&43690)>>1|(kt&21845)<<1;Ls=(Ls&52428)>>2|(Ls&13107)<<2,Ls=(Ls&61680)>>4|(Ls&3855)<<4,Ud[kt]=((Ls&65280)>>8|(Ls&255)<<8)>>1}for(var Io=(function(i,e,t){for(var n=i.length,s=0,r=new xa(e);s<n;++s)i[s]&&++r[i[s]-1];var a=new xa(e);for(s=1;s<e;++s)a[s]=a[s-1]+r[s-1]<<1;var o;if(t){o=new xa(1<<e);var c=15-e;for(s=0;s<n;++s)if(i[s])for(var l=s<<4|i[s],h=e-i[s],u=a[i[s]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)o[Ud[u]>>c]=l}else for(o=new xa(n),s=0;s<n;++s)i[s]&&(o[s]=Ud[a[i[s]-1]++]>>15-i[s]);return o}),Mo=new ni(288),kt=0;kt<144;++kt)Mo[kt]=8;for(var kt=144;kt<256;++kt)Mo[kt]=9;for(var kt=256;kt<280;++kt)Mo[kt]=7;for(var kt=280;kt<288;++kt)Mo[kt]=8;for(var Jm=new ni(32),kt=0;kt<32;++kt)Jm[kt]=5;var fB=Io(Mo,9,1),pB=Io(Jm,5,1),Od=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},mi=function(i,e,t){var n=e/8|0;return(i[n]|i[n+1]<<8)>>(e&7)&t},Qd=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},AB=function(i){return(i+7)/8|0},gB=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new ni(i.subarray(e,t))},mB=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],bi=function(i,e,t){var n=new Error(e||mB[i]);if(n.code=i,Error.captureStackTrace&&Error.captureStackTrace(n,bi),!t)throw n;return n},bB=function(i,e,t,n){var s=i.length,r=0;if(!s||e.f&&!e.l)return t||new ni(0);var a=!t,o=a||e.i!=2,c=e.i;a&&(t=new ni(s*3));var l=function(St){var ut=t.length;if(St>ut){var Je=new ni(Math.max(ut*2,St));Je.set(t),t=Je}},h=e.f||0,u=e.p||0,d=e.b||0,f=e.l,m=e.d,g=e.m,A=e.n,p=s*8;do{if(!f){h=mi(i,u,1);var y=mi(i,u+1,3);if(u+=3,y)if(y==1)f=fB,m=pB,g=9,A=5;else if(y==2){var w=mi(i,u,31)+257,S=mi(i,u+10,15)+4,T=w+mi(i,u+5,31)+1;u+=14;for(var v=new ni(T),C=new ni(19),F=0;F<S;++F)C[lB[F]]=mi(i,u+F*3,7);u+=S*3;for(var K=Od(C),q=(1<<K)-1,$=Io(C,K,1),F=0;F<T;){var D=$[mi(i,u,q)];u+=D&15;var b=D>>4;if(b<16)v[F++]=b;else{var O=0,j=0;for(b==16?(j=3+mi(i,u,3),u+=2,O=v[F-1]):b==17?(j=3+mi(i,u,7),u+=3):b==18&&(j=11+mi(i,u,127),u+=7);j--;)v[F++]=O}}var Q=v.subarray(0,w),J=v.subarray(w);g=Od(Q),A=Od(J),f=Io(Q,g,1),m=Io(J,A,1)}else bi(1);else{var b=AB(u)+4,_=i[b-4]|i[b-3]<<8,M=b+_;if(M>s){c&&bi(0);break}o&&l(d+_),t.set(i.subarray(b,M),d),e.b=d+=_,e.p=u=M*8,e.f=h;continue}if(u>p){c&&bi(0);break}}o&&l(d+131072);for(var ee=(1<<g)-1,ae=(1<<A)-1,ye=u;;ye=u){var O=f[Qd(i,u)&ee],Me=O>>4;if(u+=O&15,u>p){c&&bi(0);break}if(O||bi(2),Me<256)t[d++]=Me;else if(Me==256){ye=u,f=null;break}else{var se=Me-254;if(Me>264){var F=Me-257,me=qm[F];se=mi(i,u,(1<<me)-1)+jm[F],u+=me}var be=m[Qd(i,u)&ae],xe=be>>4;be||bi(3),u+=be&15;var J=dB[xe];if(xe>3){var me=Km[xe];J+=Qd(i,u)&(1<<me)-1,u+=me}if(u>p){c&&bi(0);break}o&&l(d+131072);var Pe=d+se;if(d<J){var $e=r-J,Qe=Math.min(J,Pe);for($e+d<0&&bi(3);d<Qe;++d)t[d]=n[$e+d]}for(;d<Pe;++d)t[d]=t[d-J]}}e.l=f,e.p=ye,e.b=d,e.f=h,f&&(h=1,e.m=g,e.d=m,e.n=A)}while(!h);return d!=t.length&&a?gB(t,0,d):t.subarray(0,d)},xB=new ni(0),EB=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&bi(6,"invalid zlib data"),(i[1]>>5&1)==1&&bi(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function xl(i,e){return bB(i.subarray(EB(i),-4),{i:2},e,e)}var _B=typeof TextDecoder<"u"&&new TextDecoder,yB=0;try{_B.decode(xB,{stream:!0}),yB=1}catch{}class wB extends cy{constructor(e){super(e),this.type=Mn}parse(e){const v=Math.pow(2.7182818,2.2);function C(x,B){let k=0;for(let R=0;R<65536;++R)(R==0||x[R>>3]&1<<(R&7))&&(B[k++]=R);const E=k-1;for(;k<65536;)B[k++]=0;return E}function F(x){for(let B=0;B<16384;B++)x[B]={},x[B].len=0,x[B].lit=0,x[B].p=null}const K={l:0,c:0,lc:0};function q(x,B,k,E,R){for(;k<x;)B=B<<8|Te(E,R),k+=8;k-=x,K.l=B>>k&(1<<x)-1,K.c=B,K.lc=k}const $=new Array(59);function D(x){for(let k=0;k<=58;++k)$[k]=0;for(let k=0;k<65537;++k)$[x[k]]+=1;let B=0;for(let k=58;k>0;--k){const E=B+$[k]>>1;$[k]=B,B=E}for(let k=0;k<65537;++k){const E=x[k];E>0&&(x[k]=E|$[E]++<<6)}}function O(x,B,k,E,R,N){const U=B;let P=0,z=0;for(;E<=R;E++){if(U.value-B.value>k)return!1;q(6,P,z,x,U);const X=K.l;if(P=K.c,z=K.lc,N[E]=X,X==63){if(U.value-B.value>k)throw new Error("Something wrong with hufUnpackEncTable");q(8,P,z,x,U);let Y=K.l+6;if(P=K.c,z=K.lc,E+Y>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;Y--;)N[E++]=0;E--}else if(X>=59){let Y=X-59+2;if(E+Y>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;Y--;)N[E++]=0;E--}}D(N)}function j(x){return x&63}function Q(x){return x>>6}function J(x,B,k,E){for(;B<=k;B++){const R=Q(x[B]),N=j(x[B]);if(R>>N)throw new Error("Invalid table entry");if(N>14){const U=E[R>>N-14];if(U.len)throw new Error("Invalid table entry");if(U.lit++,U.p){const P=U.p;U.p=new Array(U.lit);for(let z=0;z<U.lit-1;++z)U.p[z]=P[z]}else U.p=new Array(1);U.p[U.lit-1]=B}else if(N){let U=0;for(let P=1<<14-N;P>0;P--){const z=E[(R<<14-N)+U];if(z.len||z.p)throw new Error("Invalid table entry");z.len=N,z.lit=B,U++}}}return!0}const ee={c:0,lc:0};function ae(x,B,k,E){x=x<<8|Te(k,E),B+=8,ee.c=x,ee.lc=B}const ye={c:0,lc:0};function Me(x,B,k,E,R,N,U,P,z){if(x==B){E<8&&(ae(k,E,R,N),k=ee.c,E=ee.lc),E-=8;let X=k>>E;if(X=new Uint8Array([X])[0],P.value+X>z)return!1;const Y=U[P.value-1];for(;X-- >0;)U[P.value++]=Y}else if(P.value<z)U[P.value++]=x;else return!1;ye.c=k,ye.lc=E}function se(x){return x&65535}function me(x){const B=se(x);return B>32767?B-65536:B}const be={a:0,b:0};function xe(x,B){const k=me(x),R=me(B),N=k+(R&1)+(R>>1),U=N,P=N-R;be.a=U,be.b=P}function Pe(x,B){const k=se(x),E=se(B),R=k-(E>>1)&65535,N=E+R-32768&65535;be.a=N,be.b=R}function $e(x,B,k,E,R,N,U){const P=U<16384,z=k>R?R:k;let X=1,Y,ie;for(;X<=z;)X<<=1;for(X>>=1,Y=X,X>>=1;X>=1;){ie=0;const he=ie+N*(R-Y),ce=N*X,fe=N*Y,ge=E*X,_e=E*Y;let De,Ke,He,Fe;for(;ie<=he;ie+=fe){let st=ie;const Le=ie+E*(k-Y);for(;st<=Le;st+=_e){const wt=st+ge,un=st+ce,Et=un+ge;P?(xe(x[st+B],x[un+B]),De=be.a,He=be.b,xe(x[wt+B],x[Et+B]),Ke=be.a,Fe=be.b,xe(De,Ke),x[st+B]=be.a,x[wt+B]=be.b,xe(He,Fe),x[un+B]=be.a,x[Et+B]=be.b):(Pe(x[st+B],x[un+B]),De=be.a,He=be.b,Pe(x[wt+B],x[Et+B]),Ke=be.a,Fe=be.b,Pe(De,Ke),x[st+B]=be.a,x[wt+B]=be.b,Pe(He,Fe),x[un+B]=be.a,x[Et+B]=be.b)}if(k&X){const wt=st+ce;P?xe(x[st+B],x[wt+B]):Pe(x[st+B],x[wt+B]),De=be.a,x[wt+B]=be.b,x[st+B]=De}}if(R&X){let st=ie;const Le=ie+E*(k-Y);for(;st<=Le;st+=_e){const wt=st+ge;P?xe(x[st+B],x[wt+B]):Pe(x[st+B],x[wt+B]),De=be.a,x[wt+B]=be.b,x[st+B]=De}}Y=X,X>>=1}return ie}function Qe(x,B,k,E,R,N,U,P,z){let X=0,Y=0;const ie=U,he=Math.trunc(E.value+(R+7)/8);for(;E.value<he;)for(ae(X,Y,k,E),X=ee.c,Y=ee.lc;Y>=14;){const fe=X>>Y-14&16383,ge=B[fe];if(ge.len)Y-=ge.len,Me(ge.lit,N,X,Y,k,E,P,z,ie),X=ye.c,Y=ye.lc;else{if(!ge.p)throw new Error("hufDecode issues");let _e;for(_e=0;_e<ge.lit;_e++){const De=j(x[ge.p[_e]]);for(;Y<De&&E.value<he;)ae(X,Y,k,E),X=ee.c,Y=ee.lc;if(Y>=De&&Q(x[ge.p[_e]])==(X>>Y-De&(1<<De)-1)){Y-=De,Me(ge.p[_e],N,X,Y,k,E,P,z,ie),X=ye.c,Y=ye.lc;break}}if(_e==ge.lit)throw new Error("hufDecode issues")}}const ce=8-R&7;for(X>>=ce,Y-=ce;Y>0;){const fe=B[X<<14-Y&16383];if(fe.len)Y-=fe.len,Me(fe.lit,N,X,Y,k,E,P,z,ie),X=ye.c,Y=ye.lc;else throw new Error("hufDecode issues")}return!0}function St(x,B,k,E,R,N){const U={value:0},P=k.value,z=Oe(B,k),X=Oe(B,k);k.value+=4;const Y=Oe(B,k);if(k.value+=4,z<0||z>=65537||X<0||X>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const ie=new Array(65537),he=new Array(16384);F(he);const ce=E-(k.value-P);if(O(x,k,ce,z,X,ie),Y>8*(E-(k.value-P)))throw new Error("Something wrong with hufUncompress");J(ie,z,X,he),Qe(ie,he,x,k,Y,X,N,R,U)}function ut(x,B,k){for(let E=0;E<k;++E)B[E]=x[B[E]]}function Je(x){for(let B=1;B<x.length;B++){const k=x[B-1]+x[B]-128;x[B]=k}}function G(x,B){let k=0,E=Math.floor((x.length+1)/2),R=0;const N=x.length-1;for(;!(R>N||(B[R++]=x[k++],R>N));)B[R++]=x[E++]}function mn(x){let B=x.byteLength;const k=new Array;let E=0;const R=new DataView(x);for(;B>0;){const N=R.getInt8(E++);if(N<0){const U=-N;B-=U+1;for(let P=0;P<U;P++)k.push(R.getUint8(E++))}else{const U=N;B-=2;const P=R.getUint8(E++);for(let z=0;z<U+1;z++)k.push(P)}}return k}function dt(x,B,k,E,R,N){let U=new DataView(N.buffer);const P=k[x.idx[0]].width,z=k[x.idx[0]].height,X=3,Y=Math.floor(P/8),ie=Math.ceil(P/8),he=Math.ceil(z/8),ce=P-(ie-1)*8,fe=z-(he-1)*8,ge={value:0},_e=new Array(X),De=new Array(X),Ke=new Array(X),He=new Array(X),Fe=new Array(X);for(let Le=0;Le<X;++Le)Fe[Le]=B[x.idx[Le]],_e[Le]=Le<1?0:_e[Le-1]+ie*he,De[Le]=new Float32Array(64),Ke[Le]=new Uint16Array(64),He[Le]=new Uint16Array(ie*64);for(let Le=0;Le<he;++Le){let wt=8;Le==he-1&&(wt=fe);let un=8;for(let bt=0;bt<ie;++bt){bt==ie-1&&(un=ce);for(let Xe=0;Xe<X;++Xe)Ke[Xe].fill(0),Ke[Xe][0]=R[_e[Xe]++],pt(ge,E,Ke[Xe]),ze(Ke[Xe],De[Xe]),Rt(De[Xe]);Ge(De);for(let Xe=0;Xe<X;++Xe)L(De[Xe],He[Xe],bt*64)}let Et=0;for(let bt=0;bt<X;++bt){const Xe=k[x.idx[bt]].type;for(let qt=8*Le;qt<8*Le+wt;++qt){Et=Fe[bt][qt];for(let xn=0;xn<Y;++xn){const Lt=xn*64+(qt&7)*8;U.setUint16(Et+0*Xe,He[bt][Lt+0],!0),U.setUint16(Et+2*Xe,He[bt][Lt+1],!0),U.setUint16(Et+4*Xe,He[bt][Lt+2],!0),U.setUint16(Et+6*Xe,He[bt][Lt+3],!0),U.setUint16(Et+8*Xe,He[bt][Lt+4],!0),U.setUint16(Et+10*Xe,He[bt][Lt+5],!0),U.setUint16(Et+12*Xe,He[bt][Lt+6],!0),U.setUint16(Et+14*Xe,He[bt][Lt+7],!0),Et+=16*Xe}}if(Y!=ie)for(let qt=8*Le;qt<8*Le+wt;++qt){const xn=Fe[bt][qt]+8*Y*2*Xe,Lt=Y*64+(qt&7)*8;for(let dn=0;dn<un;++dn)U.setUint16(xn+dn*2*Xe,He[bt][Lt+dn],!0)}}}const st=new Uint16Array(P);U=new DataView(N.buffer);for(let Le=0;Le<X;++Le){k[x.idx[Le]].decoded=!0;const wt=k[x.idx[Le]].type;if(k[Le].type==2)for(let un=0;un<z;++un){const Et=Fe[Le][un];for(let bt=0;bt<P;++bt)st[bt]=U.getUint16(Et+bt*2*wt,!0);for(let bt=0;bt<P;++bt)U.setFloat32(Et+bt*2*wt,ne(st[bt]),!0)}}}function pt(x,B,k){let E,R=1;for(;R<64;)E=B[x.value],E==65280?R=64:E>>8==255?R+=E&255:(k[R]=E,R++),x.value++}function ze(x,B){B[0]=ne(x[0]),B[1]=ne(x[1]),B[2]=ne(x[5]),B[3]=ne(x[6]),B[4]=ne(x[14]),B[5]=ne(x[15]),B[6]=ne(x[27]),B[7]=ne(x[28]),B[8]=ne(x[2]),B[9]=ne(x[4]),B[10]=ne(x[7]),B[11]=ne(x[13]),B[12]=ne(x[16]),B[13]=ne(x[26]),B[14]=ne(x[29]),B[15]=ne(x[42]),B[16]=ne(x[3]),B[17]=ne(x[8]),B[18]=ne(x[12]),B[19]=ne(x[17]),B[20]=ne(x[25]),B[21]=ne(x[30]),B[22]=ne(x[41]),B[23]=ne(x[43]),B[24]=ne(x[9]),B[25]=ne(x[11]),B[26]=ne(x[18]),B[27]=ne(x[24]),B[28]=ne(x[31]),B[29]=ne(x[40]),B[30]=ne(x[44]),B[31]=ne(x[53]),B[32]=ne(x[10]),B[33]=ne(x[19]),B[34]=ne(x[23]),B[35]=ne(x[32]),B[36]=ne(x[39]),B[37]=ne(x[45]),B[38]=ne(x[52]),B[39]=ne(x[54]),B[40]=ne(x[20]),B[41]=ne(x[22]),B[42]=ne(x[33]),B[43]=ne(x[38]),B[44]=ne(x[46]),B[45]=ne(x[51]),B[46]=ne(x[55]),B[47]=ne(x[60]),B[48]=ne(x[21]),B[49]=ne(x[34]),B[50]=ne(x[37]),B[51]=ne(x[47]),B[52]=ne(x[50]),B[53]=ne(x[56]),B[54]=ne(x[59]),B[55]=ne(x[61]),B[56]=ne(x[35]),B[57]=ne(x[36]),B[58]=ne(x[48]),B[59]=ne(x[49]),B[60]=ne(x[57]),B[61]=ne(x[58]),B[62]=ne(x[62]),B[63]=ne(x[63])}function Rt(x){const B=.5*Math.cos(.7853975),k=.5*Math.cos(3.14159/16),E=.5*Math.cos(3.14159/8),R=.5*Math.cos(3*3.14159/16),N=.5*Math.cos(5*3.14159/16),U=.5*Math.cos(3*3.14159/8),P=.5*Math.cos(7*3.14159/16),z=new Array(4),X=new Array(4),Y=new Array(4),ie=new Array(4);for(let he=0;he<8;++he){const ce=he*8;z[0]=E*x[ce+2],z[1]=U*x[ce+2],z[2]=E*x[ce+6],z[3]=U*x[ce+6],X[0]=k*x[ce+1]+R*x[ce+3]+N*x[ce+5]+P*x[ce+7],X[1]=R*x[ce+1]-P*x[ce+3]-k*x[ce+5]-N*x[ce+7],X[2]=N*x[ce+1]-k*x[ce+3]+P*x[ce+5]+R*x[ce+7],X[3]=P*x[ce+1]-N*x[ce+3]+R*x[ce+5]-k*x[ce+7],Y[0]=B*(x[ce+0]+x[ce+4]),Y[3]=B*(x[ce+0]-x[ce+4]),Y[1]=z[0]+z[3],Y[2]=z[1]-z[2],ie[0]=Y[0]+Y[1],ie[1]=Y[3]+Y[2],ie[2]=Y[3]-Y[2],ie[3]=Y[0]-Y[1],x[ce+0]=ie[0]+X[0],x[ce+1]=ie[1]+X[1],x[ce+2]=ie[2]+X[2],x[ce+3]=ie[3]+X[3],x[ce+4]=ie[3]-X[3],x[ce+5]=ie[2]-X[2],x[ce+6]=ie[1]-X[1],x[ce+7]=ie[0]-X[0]}for(let he=0;he<8;++he)z[0]=E*x[16+he],z[1]=U*x[16+he],z[2]=E*x[48+he],z[3]=U*x[48+he],X[0]=k*x[8+he]+R*x[24+he]+N*x[40+he]+P*x[56+he],X[1]=R*x[8+he]-P*x[24+he]-k*x[40+he]-N*x[56+he],X[2]=N*x[8+he]-k*x[24+he]+P*x[40+he]+R*x[56+he],X[3]=P*x[8+he]-N*x[24+he]+R*x[40+he]-k*x[56+he],Y[0]=B*(x[he]+x[32+he]),Y[3]=B*(x[he]-x[32+he]),Y[1]=z[0]+z[3],Y[2]=z[1]-z[2],ie[0]=Y[0]+Y[1],ie[1]=Y[3]+Y[2],ie[2]=Y[3]-Y[2],ie[3]=Y[0]-Y[1],x[0+he]=ie[0]+X[0],x[8+he]=ie[1]+X[1],x[16+he]=ie[2]+X[2],x[24+he]=ie[3]+X[3],x[32+he]=ie[3]-X[3],x[40+he]=ie[2]-X[2],x[48+he]=ie[1]-X[1],x[56+he]=ie[0]-X[0]}function Ge(x){for(let B=0;B<64;++B){const k=x[0][B],E=x[1][B],R=x[2][B];x[0][B]=k+1.5747*R,x[1][B]=k-.1873*E-.4682*R,x[2][B]=k+1.8556*E}}function L(x,B,k){for(let E=0;E<64;++E)B[k+E]=Wp.toHalfFloat(I(x[E]))}function I(x){return x<=1?Math.sign(x)*Math.pow(Math.abs(x),2.2):Math.sign(x)*Math.pow(v,Math.abs(x)-1)}function Z(x){return new DataView(x.array.buffer,x.offset.value,x.size)}function le(x){const B=x.viewer.buffer.slice(x.offset.value,x.offset.value+x.size),k=new Uint8Array(mn(B)),E=new Uint8Array(k.length);return Je(k),G(k,E),new DataView(E.buffer)}function Ae(x){const B=x.array.slice(x.offset.value,x.offset.value+x.size),k=xl(B),E=new Uint8Array(k.length);return Je(k),G(k,E),new DataView(E.buffer)}function oe(x){const B=x.viewer,k={value:x.offset.value},E=new Uint16Array(x.columns*x.lines*(x.inputChannels.length*x.type)),R=new Uint8Array(8192);let N=0;const U=new Array(x.inputChannels.length);for(let fe=0,ge=x.inputChannels.length;fe<ge;fe++)U[fe]={},U[fe].start=N,U[fe].end=U[fe].start,U[fe].nx=x.columns,U[fe].ny=x.lines,U[fe].size=x.type,N+=U[fe].nx*U[fe].ny*U[fe].size;const P=re(B,k),z=re(B,k);if(z>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(P<=z)for(let fe=0;fe<z-P+1;fe++)R[fe+P]=tt(B,k);const X=new Uint16Array(65536),Y=C(R,X),ie=Oe(B,k);St(x.array,B,k,ie,E,N);for(let fe=0;fe<x.inputChannels.length;++fe){const ge=U[fe];for(let _e=0;_e<U[fe].size;++_e)$e(E,ge.start+_e,ge.nx,ge.size,ge.ny,ge.nx*ge.size,Y)}ut(X,E,N);let he=0;const ce=new Uint8Array(E.buffer.byteLength);for(let fe=0;fe<x.lines;fe++)for(let ge=0;ge<x.inputChannels.length;ge++){const _e=U[ge],De=_e.nx*_e.size,Ke=new Uint8Array(E.buffer,_e.end*2,De*2);ce.set(Ke,he),he+=De*2,_e.end+=De}return new DataView(ce.buffer)}function Ue(x){const B=x.array.slice(x.offset.value,x.offset.value+x.size),k=xl(B),E=x.inputChannels.length*x.lines*x.columns*x.totalBytes,R=new ArrayBuffer(E),N=new DataView(R);let U=0,P=0;const z=new Array(4);for(let X=0;X<x.lines;X++)for(let Y=0;Y<x.inputChannels.length;Y++){let ie=0;switch(x.inputChannels[Y].pixelType){case 1:z[0]=U,z[1]=z[0]+x.columns,U=z[1]+x.columns;for(let ce=0;ce<x.columns;++ce){const fe=k[z[0]++]<<8|k[z[1]++];ie+=fe,N.setUint16(P,ie,!0),P+=2}break;case 2:z[0]=U,z[1]=z[0]+x.columns,z[2]=z[1]+x.columns,U=z[2]+x.columns;for(let ce=0;ce<x.columns;++ce){const fe=k[z[0]++]<<24|k[z[1]++]<<16|k[z[2]++]<<8;ie+=fe,N.setUint32(P,ie,!0),P+=4}break}}return N}function Ce(x){const B=x.viewer,k={value:x.offset.value},E=new Uint8Array(x.columns*x.lines*(x.inputChannels.length*x.type*2)),R={version:We(B,k),unknownUncompressedSize:We(B,k),unknownCompressedSize:We(B,k),acCompressedSize:We(B,k),dcCompressedSize:We(B,k),rleCompressedSize:We(B,k),rleUncompressedSize:We(B,k),rleRawSize:We(B,k),totalAcUncompressedCount:We(B,k),totalDcUncompressedCount:We(B,k),acCompression:We(B,k)};if(R.version<2)throw new Error("EXRLoader.parse: "+As.compression+" version "+R.version+" is unsupported");const N=new Array;let U=re(B,k)-2;for(;U>0;){const ge=Ve(B.buffer,k),_e=tt(B,k),De=_e>>2&3,Ke=(_e>>4)-1,He=new Int8Array([Ke])[0],Fe=tt(B,k);N.push({name:ge,index:He,type:Fe,compression:De}),U-=ge.length+3}const P=As.channels,z=new Array(x.inputChannels.length);for(let ge=0;ge<x.inputChannels.length;++ge){const _e=z[ge]={},De=P[ge];_e.name=De.name,_e.compression=0,_e.decoded=!1,_e.type=De.pixelType,_e.pLinear=De.pLinear,_e.width=x.columns,_e.height=x.lines}const X={idx:new Array(3)};for(let ge=0;ge<x.inputChannels.length;++ge){const _e=z[ge];for(let De=0;De<N.length;++De){const Ke=N[De];_e.name==Ke.name&&(_e.compression=Ke.compression,Ke.index>=0&&(X.idx[Ke.index]=ge),_e.offset=ge)}}let Y,ie,he;if(R.acCompressedSize>0)switch(R.acCompression){case 0:Y=new Uint16Array(R.totalAcUncompressedCount),St(x.array,B,k,R.acCompressedSize,Y,R.totalAcUncompressedCount);break;case 1:const ge=x.array.slice(k.value,k.value+R.totalAcUncompressedCount),_e=xl(ge);Y=new Uint16Array(_e.buffer),k.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const ge={array:x.array,offset:k,size:R.dcCompressedSize};ie=new Uint16Array(Ae(ge).buffer),k.value+=R.dcCompressedSize}if(R.rleRawSize>0){const ge=x.array.slice(k.value,k.value+R.rleCompressedSize),_e=xl(ge);he=mn(_e.buffer),k.value+=R.rleCompressedSize}let ce=0;const fe=new Array(z.length);for(let ge=0;ge<fe.length;++ge)fe[ge]=new Array;for(let ge=0;ge<x.lines;++ge)for(let _e=0;_e<z.length;++_e)fe[_e].push(ce),ce+=z[_e].width*x.type*2;dt(X,fe,z,Y,ie,E);for(let ge=0;ge<z.length;++ge){const _e=z[ge];if(!_e.decoded)switch(_e.compression){case 2:let De=0,Ke=0;for(let He=0;He<x.lines;++He){let Fe=fe[ge][De];for(let st=0;st<_e.width;++st){for(let Le=0;Le<2*_e.type;++Le)E[Fe++]=he[Ke+Le*_e.width*_e.height];Ke++}De++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(E.buffer)}function Ve(x,B){const k=new Uint8Array(x);let E=0;for(;k[B.value+E]!=0;)E+=1;const R=new TextDecoder().decode(k.slice(B.value,B.value+E));return B.value=B.value+E+1,R}function je(x,B,k){const E=new TextDecoder().decode(new Uint8Array(x).slice(B.value,B.value+k));return B.value=B.value+k,E}function Ee(x,B){const k=ke(x,B),E=Oe(x,B);return[k,E]}function Ne(x,B){const k=Oe(x,B),E=Oe(x,B);return[k,E]}function ke(x,B){const k=x.getInt32(B.value,!0);return B.value=B.value+4,k}function Oe(x,B){const k=x.getUint32(B.value,!0);return B.value=B.value+4,k}function Te(x,B){const k=x[B.value];return B.value=B.value+1,k}function tt(x,B){const k=x.getUint8(B.value);return B.value=B.value+1,k}const We=function(x,B){let k;return"getBigInt64"in DataView.prototype?k=Number(x.getBigInt64(B.value,!0)):k=x.getUint32(B.value+4,!0)+Number(x.getUint32(B.value,!0)<<32),B.value+=8,k};function nt(x,B){const k=x.getFloat32(B.value,!0);return B.value+=4,k}function W(x,B){return Wp.toHalfFloat(nt(x,B))}function ne(x){const B=(x&31744)>>10,k=x&1023;return(x>>15?-1:1)*(B?B===31?k?NaN:1/0:Math.pow(2,B-15)*(1+k/1024):6103515625e-14*(k/1024))}function re(x,B){const k=x.getUint16(B.value,!0);return B.value+=2,k}function de(x,B){return ne(re(x,B))}function Ie(x,B,k,E){const R=k.value,N=[];for(;k.value<R+E-1;){const U=Ve(B,k),P=ke(x,k),z=tt(x,k);k.value+=3;const X=ke(x,k),Y=ke(x,k);N.push({name:U,pixelType:P,pLinear:z,xSampling:X,ySampling:Y})}return k.value+=1,N}function Se(x,B){const k=nt(x,B),E=nt(x,B),R=nt(x,B),N=nt(x,B),U=nt(x,B),P=nt(x,B),z=nt(x,B),X=nt(x,B);return{redX:k,redY:E,greenX:R,greenY:N,blueX:U,blueY:P,whiteX:z,whiteY:X}}function it(x,B){const k=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],E=tt(x,B);return k[E]}function Ot(x,B){const k=ke(x,B),E=ke(x,B),R=ke(x,B),N=ke(x,B);return{xMin:k,yMin:E,xMax:R,yMax:N}}function bn(x,B){const k=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],E=tt(x,B);return k[E]}function yt(x,B){const k=["ENVMAP_LATLONG","ENVMAP_CUBE"],E=tt(x,B);return k[E]}function jn(x,B){const k=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],E=["ROUND_DOWN","ROUND_UP"],R=Oe(x,B),N=Oe(x,B),U=tt(x,B);return{xSize:R,ySize:N,levelMode:k[U&15],roundingMode:E[U>>4]}}function vi(x,B){const k=nt(x,B),E=nt(x,B);return[k,E]}function ih(x,B){const k=nt(x,B),E=nt(x,B),R=nt(x,B);return[k,E,R]}function sh(x,B,k,E,R){if(E==="string"||E==="stringvector"||E==="iccProfile")return je(B,k,R);if(E==="chlist")return Ie(x,B,k,R);if(E==="chromaticities")return Se(x,k);if(E==="compression")return it(x,k);if(E==="box2i")return Ot(x,k);if(E==="envmap")return yt(x,k);if(E==="tiledesc")return jn(x,k);if(E==="lineOrder")return bn(x,k);if(E==="float")return nt(x,k);if(E==="v2f")return vi(x,k);if(E==="v3f")return ih(x,k);if(E==="int")return ke(x,k);if(E==="rational")return Ee(x,k);if(E==="timecode")return Ne(x,k);if(E==="preview")return k.value+=R,"skipped";k.value+=R}function ps(x,B){const k=Math.log2(x);return B=="ROUND_DOWN"?Math.floor(k):Math.ceil(k)}function Zo(x,B,k){let E=0;switch(x.levelMode){case"ONE_LEVEL":E=1;break;case"MIPMAP_LEVELS":E=ps(Math.max(B,k),x.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return E}function $o(x,B,k,E){const R=new Array(x);for(let N=0;N<x;N++){const U=1<<N;let P=B/U|0;E=="ROUND_UP"&&P*U<B&&(P+=1);const z=Math.max(P,1);R[N]=(z+k-1)/k|0}return R}function rh(){const x=this,B=x.offset,k={value:0};for(let E=0;E<x.tileCount;E++){const R=ke(x.viewer,B),N=ke(x.viewer,B);B.value+=8,x.size=Oe(x.viewer,B);const U=R*x.blockWidth,P=N*x.blockHeight;x.columns=U+x.blockWidth>x.width?x.width-U:x.blockWidth,x.lines=P+x.blockHeight>x.height?x.height-P:x.blockHeight;const z=x.columns*x.totalBytes,Y=x.size<x.lines*z?x.uncompress(x):Z(x);B.value+=x.size;for(let ie=0;ie<x.lines;ie++){const he=ie*x.columns*x.totalBytes;for(let ce=0;ce<x.inputChannels.length;ce++){const fe=As.channels[ce].name,ge=x.channelByteOffsets[fe]*x.columns,_e=x.decodeChannels[fe];if(_e===void 0)continue;k.value=he+ge;const De=(x.height-(1+P+ie))*x.outLineWidth;for(let Ke=0;Ke<x.columns;Ke++){const He=De+(Ke+U)*x.outputChannels+_e;x.byteArray[He]=x.getter(Y,k)}}}}}function Ua(){const x=this,B=x.offset,k={value:0};for(let E=0;E<x.height/x.blockHeight;E++){const R=ke(x.viewer,B)-As.dataWindow.yMin;x.size=Oe(x.viewer,B),x.lines=R+x.blockHeight>x.height?x.height-R:x.blockHeight;const N=x.columns*x.totalBytes,P=x.size<x.lines*N?x.uncompress(x):Z(x);B.value+=x.size;for(let z=0;z<x.blockHeight;z++){const X=E*x.blockHeight,Y=z+x.scanOrder(X);if(Y>=x.height)continue;const ie=z*N,he=(x.height-1-Y)*x.outLineWidth;for(let ce=0;ce<x.inputChannels.length;ce++){const fe=As.channels[ce].name,ge=x.channelByteOffsets[fe]*x.columns,_e=x.decodeChannels[fe];if(_e!==void 0){k.value=ie+ge;for(let De=0;De<x.columns;De++){const Ke=he+De*x.outputChannels+_e;x.byteArray[Ke]=x.getter(P,k)}}}}}}function ah(x,B,k){const E={};if(x.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");E.version=x.getUint8(4);const R=x.getUint8(5);E.spec={singleTile:!!(R&2),longName:!!(R&4),deepFormat:!!(R&8),multiPart:!!(R&16)},k.value=8;let N=!0;for(;N;){const U=Ve(B,k);if(U==="")N=!1;else{const P=Ve(B,k),z=Oe(x,k),X=sh(x,B,k,P,z);X===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`):E[U]=X}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",E),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return E}function Oa(x,B,k,E,R){const N={size:0,viewer:B,array:k,offset:E,width:x.dataWindow.xMax-x.dataWindow.xMin+1,height:x.dataWindow.yMax-x.dataWindow.yMin+1,inputChannels:x.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:rn};switch(x.compression){case"NO_COMPRESSION":N.blockHeight=1,N.uncompress=Z;break;case"RLE_COMPRESSION":N.blockHeight=1,N.uncompress=le;break;case"ZIPS_COMPRESSION":N.blockHeight=1,N.uncompress=Ae;break;case"ZIP_COMPRESSION":N.blockHeight=16,N.uncompress=Ae;break;case"PIZ_COMPRESSION":N.blockHeight=32,N.uncompress=oe;break;case"PXR24_COMPRESSION":N.blockHeight=16,N.uncompress=Ue;break;case"DWAA_COMPRESSION":N.blockHeight=32,N.uncompress=Ce;break;case"DWAB_COMPRESSION":N.blockHeight=256,N.uncompress=Ce;break;default:throw new Error("EXRLoader.parse: "+x.compression+" is unsupported")}const U={};for(const Y of x.channels)switch(Y.name){case"Y":case"R":case"G":case"B":case"A":U[Y.name]=!0,N.type=Y.pixelType}let P=!1;if(U.R&&U.G&&U.B)P=!U.A,N.outputChannels=4,N.decodeChannels={R:0,G:1,B:2,A:3};else if(U.Y)N.outputChannels=1,N.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(N.type==1)switch(R){case nn:N.getter=de;break;case Mn:N.getter=re;break}else if(N.type==2)switch(R){case nn:N.getter=nt;break;case Mn:N.getter=W}else throw new Error("EXRLoader.parse: unsupported pixelType "+N.type+" for "+x.compression+".");N.columns=N.width;const z=N.width*N.height*N.outputChannels;switch(R){case nn:N.byteArray=new Float32Array(z),P&&N.byteArray.fill(1,0,z);break;case Mn:N.byteArray=new Uint16Array(z),P&&N.byteArray.fill(15360,0,z);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let X=0;for(const Y of x.channels)N.decodeChannels[Y.name]!==void 0&&(N.channelByteOffsets[Y.name]=X),X+=Y.pixelType*2;if(N.totalBytes=X,N.outLineWidth=N.width*N.outputChannels,x.lineOrder==="INCREASING_Y"?N.scanOrder=Y=>Y:N.scanOrder=Y=>N.height-1-Y,N.outputChannels==4?(N.format=sn,N.colorSpace=rn):(N.format=Gi,N.colorSpace=oi),x.spec.singleTile){N.blockHeight=x.tiles.ySize,N.blockWidth=x.tiles.xSize;const Y=Zo(x.tiles,N.width,N.height),ie=$o(Y,N.width,x.tiles.xSize,x.tiles.roundingMode),he=$o(Y,N.height,x.tiles.ySize,x.tiles.roundingMode);N.tileCount=ie[0]*he[0];for(let ce=0;ce<Y;ce++)for(let fe=0;fe<he[ce];fe++)for(let ge=0;ge<ie[ce];ge++)We(B,E);N.decode=rh.bind(N)}else{N.blockWidth=N.width;const Y=Math.ceil(N.height/N.blockHeight);for(let ie=0;ie<Y;ie++)We(B,E);N.decode=Ua.bind(N)}return N}const ec={value:0},tc=new DataView(e),tp=new Uint8Array(e),As=ah(tc,e,ec),Ws=Oa(As,tc,tp,ec,this.type);return Ws.decode(),{header:As,width:Ws.width,height:Ws.height,data:Ws.byteArray,format:Ws.format,colorSpace:Ws.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,s){function r(a,o){a.colorSpace=o.colorSpace,a.minFilter=zt,a.magFilter=zt,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,o)}return super.load(e,r,n,s)}}function CB(i,e){const{id:t,path:n}=e;return t==="neutral"?Promise.resolve({envMap:i.neutralEnvironment}):t===""?Promise.resolve({envMap:null}):new Promise((s,r)=>{new wB().load(n,a=>{const o=i.pmremGenerator.fromEquirectangular(a).texture;a.dispose(),i._loadedEnvironment&&i._loadedEnvironment!==o&&i._loadedEnvironment.dispose(),i._loadedEnvironment=o,s({envMap:o})},void 0,r)})}function vB(i){i.renderer.render(i.scene,i.activeCamera),i.renderer.domElement.toBlob(e=>{if(!e)return;const t=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),n=URL.createObjectURL(e),s=document.createElement("a");s.download=`3d-screenshot-${t}.png`,s.href=n,s.click(),URL.revokeObjectURL(n)},"image/png"),SB(i)}function SB(i){const e=document.createElement("div");e.className="screenshot-flash",i.el.appendChild(e),e.addEventListener("animationend",()=>e.remove())}function IB(i,e){i.mixer&&(i.mixer.stopAllAction(),i.mixer.uncacheRoot(i.mixer.getRoot()),i.mixer=null),i.clips=e,e.length&&(i.mixer=new BA(i.content))}function MB(i){i.clips.forEach(e=>{i.mixer.clipAction(e).reset().play(),i.state.actionStates[e.name]=!0}),i.invalidate()}const BB=.35;class TB{constructor(){this.model=null,this.mixer=null,this.clips=new Map,this.actions=new Map,this.currentName=null,this.currentAction=null,this.loader=new Vu,this.onChange=null,this._gltfCache=new Map,this._animationDefs=[]}attach(e){this.detach(),this.model=e,this.mixer=new BA(e),this.actions.clear(),this.currentAction=null,this.currentName=null;for(const[t,n]of this.clips){const s=this._retargetClip(n,t),r=this.mixer.clipAction(s);r.enabled=!0,this.actions.set(t,r)}}detach(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null),this.model=null,this.actions.clear(),this.currentAction=null,this.currentName=null}setAnimationDefs(e){this._animationDefs=e}getAnimationDefs(){return this._animationDefs}async loadAnimation(e,t,n={}){if(this.clips.has(e))return this.clips.get(e);let s;this._gltfCache.has(t)?s=this._gltfCache.get(t):(s=await new Promise((a,o)=>{this.loader.load(t,a,void 0,o)}),this._gltfCache.set(t,s));let r;if(n.clipName?(r=s.animations.find(a=>a.name===n.clipName),r||(console.warn(`[AnimationManager] Clip "${n.clipName}" not found in ${t}, using first clip`),r=s.animations[0])):r=s.animations[0],!r)throw new Error(`No animation found in ${t}`);if(r=r.clone(),r.name=e,this.clips.set(e,r),this.model&&this.mixer){const a=this._retargetClip(r,e),o=this.mixer.clipAction(a);o.enabled=!0,o.setLoop(n.loop===!1?xp:Ep),n.loop===!1&&(o.clampWhenFinished=!0),this.actions.set(e,o)}return r}async loadAll(){const e=this._animationDefs.map(async t=>{try{await this.loadAnimation(t.name,t.url,{loop:t.loop!==!1,clipName:t.clipName})}catch(n){console.warn(`[AnimationManager] Failed to load "${t.name}" from ${t.url}:`,n)}});await Promise.all(e)}play(e){const t=this.actions.get(e);if(!t){console.warn(`[AnimationManager] Animation "${e}" not loaded`);return}this.currentAction&&this.currentAction!==t&&this.currentAction.fadeOut(.01),t.reset().fadeIn(.01).play(),this.currentAction=t,this.currentName=e,this.onChange&&this.onChange(e)}crossfadeTo(e,t=BB){if(e===this.currentName)return;const n=this.actions.get(e);if(!n){console.warn(`[AnimationManager] Animation "${e}" not loaded`);return}n.reset(),n.play(),this.currentAction?this.currentAction.crossFadeTo(n,t,!0):n.fadeIn(t),this.currentAction=n,this.currentName=e,this.onChange&&this.onChange(e)}stopAll(){this.mixer&&this.mixer.stopAllAction(),this.currentAction=null,this.currentName=null,this.onChange&&this.onChange(null)}update(e){this.mixer&&this.mixer.update(e)}_retargetClip(e,t){if(!this.model)return e;const n=new Set;if(this.model.traverse(o=>{o.isBone&&n.add(o.name)}),n.size===0)return e;const s=new Set;for(const o of e.tracks){const c=o.name.split(".")[0];s.add(c)}let r=0;for(const o of s)n.has(o)&&r++;if(r/s.size>.5)return e;const a=this._buildBoneNameMap(n,s);return a?(e.tracks.map(o=>{const c=o.name.split("."),l=c[0],h=c.slice(1).join("."),u=a.get(l);if(!u)return null;const d=o.clone();return d.name=`${u}.${h}`,d}).filter(Boolean),e.clone().resetDuration()):e}_buildBoneNameMap(e,t){const n=new Map,s=[...e],r=[...t],a=h=>h.replace(/^mixamorig\d*[_:]?/i,"").replace(/^Armature[_/]?/i,""),o=new Map(s.map(h=>[a(h),h]));let c=0;for(const h of r){const u=a(h);o.has(u)&&(n.set(h,o.get(u)),c++)}if(c/r.length>.5)return n;const l=new Map(s.map(h=>[h.toLowerCase(),h]));n.clear(),c=0;for(const h of r)l.has(h.toLowerCase())&&(n.set(h,l.get(h.toLowerCase())),c++);return c/r.length>.5?n:null}getLoadedNames(){return[...this.clips.keys()]}isLoaded(e){return this.clips.has(e)}dispose(){this.detach(),this.clips.clear(),this._gltfCache.clear(),this._animationDefs=[]}}ji.enabled=!0;class Gd{constructor(e,t){this.el=e,this.options=t,this.lights=[],this.content=null,this.mixer=null,this.clips=[],this.gui=null,this.animationManager=new TB,this._animPanelEl=null,this.state={environment:t.preset===kd.ASSET_GENERATOR?rl.find(r=>r.id==="footprint-court").name:rl[1].name,background:!1,playbackSpeed:1,actionStates:{},camera:ml,wireframe:!1,skeleton:!1,grid:!1,autoRotate:!1,punctualLights:!0,exposure:0,toneMapping:gh,ambientIntensity:.3,ambientColor:"#FFFFFF",directIntensity:.8*Math.PI,directColor:"#FFFFFF",bgColor:"#000000",transparentBg:!1,pointSize:1,showInfo:!0,showLabels:!1,followMode:"mouse"},this.prevTime=0,this.stats=new go,this.stats.dom.height="48px",[].forEach.call(this.stats.dom.children,r=>r.style.display=""),this.backgroundColor=new qe(this.state.bgColor),this.scene=new Au,this.scene.background=this.backgroundColor;const n=t.preset===kd.ASSET_GENERATOR?.8*180/Math.PI:60,s=e.clientWidth/e.clientHeight;this.defaultCamera=new vn(n,s,.01,1e3),this.activeCamera=this.defaultCamera,this.scene.add(this.defaultCamera),this.renderer=window.renderer=new cg({antialias:!0,alpha:!0}),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.renderer.setSize(e.clientWidth,e.clientHeight),this.pmremGenerator=new Qu(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.neutralEnvironment=this.pmremGenerator.fromScene(new TI).texture,this.controls=new mI(this.defaultCamera,this.renderer.domElement),this.controls.screenSpacePanning=!0,this._onControlsChange=()=>this.invalidate(),this.controls.addEventListener("change",this._onControlsChange),this.el.appendChild(this.renderer.domElement),this.cameraCtrl=null,this.cameraFolder=null,this.animFolder=null,this.animCtrls=[],this.morphFolder=null,this.morphCtrls=[],this.skeletonHelpers=[],this.gridHelper=null,this.axesHelper=null,this.modelInfo=null,this.annotationEls=[],this._tempVec=new H,this.addAxesHelper(),this.addGUI(),t.kiosk&&this.gui.close(),this.animate=this.animate.bind(this),this._rafId=null,this._visible=!0,this._tabVisible=!document.hidden,this._disposed=!1,this._loadedEnvironment=null,this._guiWrap=null,this._needsRender=!0,this._animating=!1,this._onVisibilityChange=()=>{const r=!this._tabVisible;this._tabVisible=!document.hidden,r&&this._tabVisible&&(this._needsRender=!0),this._updateRenderLoop()},document.addEventListener("visibilitychange",this._onVisibilityChange),typeof IntersectionObserver<"u"&&(this._intersectionObserver=new IntersectionObserver(r=>{const a=!this._visible;this._visible=r[r.length-1].isIntersecting,a&&this._visible&&(this._needsRender=!0),this._updateRenderLoop()},{threshold:0}),this._intersectionObserver.observe(this.el)),this._onResize=this.resize.bind(this),this._onKeyDown=r=>{(r.key==="p"||r.key==="P")&&!this.isInputFocused()&&this.takeScreenshot()},this._updateRenderLoop(),window.addEventListener("resize",this._onResize,!1),window.addEventListener("keydown",this._onKeyDown)}invalidate(){this._disposed||(this._needsRender=!0,this._updateRenderLoop())}_recomputeAnimating(){let e=!1;if(this.state&&this.state.autoRotate&&(e=!0),!e&&this.mixer&&this.state){for(const t in this.state.actionStates)if(this.state.actionStates[t]){e=!0;break}}!e&&this.animationManager.currentAction&&(e=!0),this._animating=e}_updateRenderLoop(){if(this._disposed)return;const e=this._visible&&this._tabVisible;e&&(this._needsRender||this._animating)&&this._rafId===null?(this.prevTime=performance.now(),this._rafId=requestAnimationFrame(this.animate)):!e&&this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null)}animate(e){const t=(e-this.prevTime)/1e3;if(this.prevTime=e,this._recomputeAnimating(),this.controls.update(),this.stats.update(),this.mixer&&this.mixer.update(t),this.animationManager.update(t),this._afterAnimateHooks)for(let n=0;n<this._afterAnimateHooks.length;n++)this._afterAnimateHooks[n](t);this.render(),this._needsRender=!1,this._animating&&this._visible&&this._tabVisible&&!this._disposed?this._rafId=requestAnimationFrame(this.animate):this._rafId=null}isInputFocused(){const e=document.activeElement;return e&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}render(){this.renderer.render(this.scene,this.activeCamera),this.state.grid&&(this.axesCamera.position.copy(this.defaultCamera.position),this.axesCamera.lookAt(this.axesScene.position),this.axesRenderer.render(this.axesScene,this.axesCamera)),this.projectAnnotations()}takeScreenshot(){vB(this)}resize(){const{clientHeight:e,clientWidth:t}=this.el;this.defaultCamera.aspect=t/e,this.defaultCamera.updateProjectionMatrix(),this.renderer.setSize(t,e),this.axesCamera.aspect=this.axesDiv.clientWidth/this.axesDiv.clientHeight,this.axesCamera.updateProjectionMatrix(),this.axesRenderer.setSize(this.axesDiv.clientWidth,this.axesDiv.clientHeight),this.invalidate()}load(e,t,n){const s=oa.extractUrlBase(e);return new Promise((r,a)=>{bl.setURLModifier((l,h)=>{const u=t+decodeURI(l).replace(s,"").replace(/^(\.?\/)/,"");if(n.has(u)){const d=n.get(u),f=URL.createObjectURL(d);return c.push(f),f}return(h||"")+l});const o=new Vu(bl).setCrossOrigin("anonymous").setDRACOLoader(sB).setKTX2Loader(rB.detectSupport(this.renderer)).setMeshoptDecoder(AI),c=[];o.load(e,l=>{window.VIEWER.json=l;const h=l.scene||l.scenes[0],u=l.animations||[];if(!h)throw new Error("This model contains no scene, and cannot be viewed here. However, it may contain individual 3D resources.");this.setContent(h,u),c.forEach(URL.revokeObjectURL),r(l)},void 0,a)})}setContent(e,t){this.clear(),e.updateMatrixWorld();const n=new Ii().setFromObject(e),s=n.getSize(new H).length(),r=n.getCenter(new H);this.controls.reset(),e.position.x-=r.x,e.position.y-=r.y,e.position.z-=r.z,this.controls.maxDistance=s*10,this.defaultCamera.near=s/100,this.defaultCamera.far=s*100,this.defaultCamera.updateProjectionMatrix(),this.options.cameraPosition?(this.defaultCamera.position.fromArray(this.options.cameraPosition),this.defaultCamera.lookAt(new H)):(this.defaultCamera.position.copy(r),this.defaultCamera.position.x+=s/2,this.defaultCamera.position.y+=s/5,this.defaultCamera.position.z+=s/2,this.defaultCamera.lookAt(r)),this.setCamera(ml),this.axesCamera.position.copy(this.defaultCamera.position),this.axesCamera.lookAt(this.axesScene.position),this.axesCamera.near=s/100,this.axesCamera.far=s*100,this.axesCamera.updateProjectionMatrix(),this.axesCorner.scale.set(s,s,s),this.controls.saveState(),this.scene.add(e),this.content=e,this.state.punctualLights=!0,this.content.traverse(a=>{a.isLight&&(this.state.punctualLights=!1)}),this.setClips(t),this.animationManager.attach(this.content),this._setupAnimationPanel(),this.updateLights(),this.updateGUI(),this.updateEnvironment(),this.updateDisplay(),this.updateModelInfo(e,t),this.updateAnnotations(),window.VIEWER.scene=this.content,this.invalidate()}setClips(e){IB(this,e)}playAllClips(){MB(this)}setCamera(e){e===ml?(this.controls.enabled=!0,this.activeCamera=this.defaultCamera):(this.controls.enabled=!1,this.content.traverse(t=>{t.isCamera&&t.name===e&&(this.activeCamera=t)})),this.invalidate()}updateLights(){const e=this.state,t=this.lights;e.punctualLights&&!t.length?aB(this):!e.punctualLights&&t.length&&oB(this),this.renderer.toneMapping=Number(e.toneMapping),this.renderer.toneMappingExposure=Math.pow(2,e.exposure),t.length===2&&(t[0].intensity=e.ambientIntensity,t[0].color.set(e.ambientColor),t[1].intensity=e.directIntensity,t[1].color.set(e.directColor)),this.invalidate()}updateEnvironment(){const e=rl.filter(t=>t.name===this.state.environment)[0];CB(this,e).then(({envMap:t})=>{this._disposed||!this.scene||(this.scene.environment=t,this.scene.background=this.state.transparentBg?null:this.state.background?t:this.backgroundColor,this.invalidate())})}updateDisplay(){this.skeletonHelpers.length&&this.skeletonHelpers.forEach(e=>this.scene.remove(e)),Wm(this.content,e=>{e.wireframe=this.state.wireframe,e instanceof vu&&(e.size=this.state.pointSize)}),this.content.traverse(e=>{if(e.geometry&&e.skeleton&&this.state.skeleton){const t=new Ty(e.skeleton.bones[0].parent);t.material.linewidth=3,this.scene.add(t),this.skeletonHelpers.push(t)}}),this.state.grid!==!!this.gridHelper&&(this.state.grid?(this.gridHelper=new Ry,this.axesHelper=new NA,this.axesHelper.renderOrder=999,this.axesHelper.onBeforeRender=e=>e.clearDepth(),this.scene.add(this.gridHelper),this.scene.add(this.axesHelper)):(this.scene.remove(this.gridHelper),this.scene.remove(this.axesHelper),this.gridHelper=null,this.axesHelper=null,this.axesRenderer.clear())),this.controls.autoRotate=this.state.autoRotate,this.invalidate()}updateBackground(){this.backgroundColor.set(this.state.bgColor),this.state.transparentBg?(this.scene.background=null,this.renderer.setClearColor(0,0)):(this.scene.background=this.backgroundColor,this.renderer.setClearColor(0,1),this.updateEnvironment()),this.invalidate()}setBackgroundColor(e){this.state.bgColor=typeof e=="string"?e:"#"+e.toString(16).padStart(6,"0"),this.state.transparentBg=!1,this.updateBackground()}updateModelInfo(e,t){this.modelInfo&&(this.modelInfo.remove(),this.modelInfo=null),this.state.showInfo&&e&&(this.modelInfo=PM(this.el,e,t))}updateAnnotations(){if(this.annotationEls.forEach(t=>t.el.remove()),this.annotationEls=[],!this.state.showLabels||!this.content)return;OM(this.content).forEach(t=>{const n=QM(t),s=document.createElement("div");s.classList.add("annotation-label"),s.appendChild(n),this.el.appendChild(s),this.annotationEls.push({el:s,position:t.position})}),this.invalidate()}projectAnnotations(){if(this.annotationEls.length===0)return;const e=this.el.clientWidth,t=this.el.clientHeight,n=e/2,s=t/2,r=this._tempVec;this.annotationEls.forEach(({el:a,position:o})=>{if(r.copy(o),r.project(this.activeCamera),r.z>1){a.style.display="none";return}const c=r.x*n+n,l=-(r.y*s)+s;a.style.display="",a.style.left=c+"px",a.style.top=l+"px"})}addAxesHelper(){this.axesDiv=document.createElement("div"),this.el.appendChild(this.axesDiv),this.axesDiv.classList.add("axes");const{clientWidth:e,clientHeight:t}=this.axesDiv;this.axesScene=new Au,this.axesCamera=new vn(50,e/t,.1,10),this.axesScene.add(this.axesCamera),this.axesRenderer=new cg({alpha:!0}),this.axesRenderer.setPixelRatio(window.devicePixelRatio),this.axesRenderer.setSize(this.axesDiv.clientWidth,this.axesDiv.clientHeight),this.axesCamera.up=this.defaultCamera.up,this.axesCorner=new NA(5),this.axesScene.add(this.axesCorner),this.axesDiv.appendChild(this.axesRenderer.domElement)}addGUI(){const e=window.innerWidth<=700,t=this.gui=new ZI({autoPlace:!1,width:e?220:260,hideable:!0}),n=t.addFolder("Display");n.add(this.state,"background").onChange(()=>this.updateEnvironment()),n.add(this.state,"autoRotate").onChange(()=>this.updateDisplay()),n.add(this.state,"wireframe").onChange(()=>this.updateDisplay()),n.add(this.state,"skeleton").onChange(()=>this.updateDisplay()),n.add(this.state,"grid").onChange(()=>this.updateDisplay()),n.add(this.controls,"screenSpacePanning"),n.add(this.state,"pointSize",1,16).onChange(()=>this.updateDisplay()),n.add(this.state,"transparentBg").name("transparent bg").onChange(()=>this.updateBackground()),n.addColor(this.state,"bgColor").onChange(()=>this.updateBackground()),n.add({screenshot:()=>this.takeScreenshot()},"screenshot").name("Screenshot [P]"),n.add(this.state,"showInfo").name("model info").onChange(()=>this.updateModelInfo(this.content,this.clips)),n.add(this.state,"showLabels").name("mesh labels").onChange(()=>this.updateAnnotations());const m=t.addFolder("Lighting");m.add(this.state,"environment",rl.map(w=>w.name)).onChange(()=>this.updateEnvironment()),[m.add(this.state,"toneMapping",{Linear:gh,"ACES Filmic":lp}),m.add(this.state,"exposure",-10,10,.01),m.add(this.state,"punctualLights").listen(),m.add(this.state,"ambientIntensity",0,2),m.addColor(this.state,"ambientColor"),m.add(this.state,"directIntensity",0,4),m.addColor(this.state,"directColor")].forEach(w=>w.onChange(()=>this.updateLights())),this.animFolder=t.addFolder("Animation"),this.animFolder.domElement.style.display="none",this.animFolder.add(this.state,"playbackSpeed",0,1).onChange(w=>{this.mixer&&(this.mixer.timeScale=w)}),this.animFolder.add({playAll:()=>this.playAllClips()},"playAll"),this.morphFolder=t.addFolder("Morph Targets"),this.morphFolder.domElement.style.display="none",this.cameraFolder=t.addFolder("Cameras"),this.cameraFolder.domElement.style.display="none",t.addFolder("Agent").add(this.state,"followMode",{None:"none","Follow Mouse":"mouse","Follow Keystrokes":"keystrokes"}).name("follow mode");const y=t.addFolder("Performance"),b=document.createElement("li");this.stats.dom.style.position="static",b.appendChild(this.stats.dom),b.classList.add("gui-stats"),y.__ul.appendChild(b);const _=document.createElement("div");this.el.appendChild(_),_.classList.add("gui-wrap"),_.classList.add("gui-wrap--hidden"),_.appendChild(t.domElement),this._guiWrap=_;const M=document.createElement("button");M.className="gui-toggle",M.setAttribute("title","Toggle advanced controls"),M.setAttribute("aria-label","Toggle advanced controls"),M.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg><span class="gui-toggle__label">Controls</span>',M.addEventListener("click",()=>{const w=_.classList.toggle("gui-wrap--hidden");M.classList.toggle("gui-toggle--active",!w)}),this.el.appendChild(M),this._guiToggle=M,e?t.close():t.open()}updateGUI(){this.cameraFolder.domElement.style.display="none",this.morphCtrls.forEach(n=>n.remove()),this.morphCtrls.length=0,this.morphFolder.domElement.style.display="none",this.animCtrls.forEach(n=>n.remove()),this.animCtrls.length=0,this.animFolder.domElement.style.display="none";const e=[],t=[];if(this.content.traverse(n=>{n.geometry&&n.morphTargetInfluences&&t.push(n),n.isCamera&&(n.name=n.name||`VIEWER__camera_${e.length+1}`,e.push(n.name))}),e.length){this.cameraFolder.domElement.style.display="",this.cameraCtrl&&this.cameraCtrl.remove();const n=[ml].concat(e);this.cameraCtrl=this.cameraFolder.add(this.state,"camera",n),this.cameraCtrl.onChange(s=>this.setCamera(s))}if(t.length&&(this.morphFolder.domElement.style.display="",t.forEach(n=>{if(n.morphTargetInfluences.length){const s=this.morphFolder.add({name:n.name||"Untitled"},"name");this.morphCtrls.push(s)}for(let s=0;s<n.morphTargetInfluences.length;s++){const r=this.morphFolder.add(n.morphTargetInfluences,s,0,1,.01).listen();Object.keys(n.morphTargetDictionary).forEach(a=>{a&&n.morphTargetDictionary[a]===s&&r.name(a)}),this.morphCtrls.push(r)}})),this.clips.length){this.animFolder.domElement.style.display="";const n=this.state.actionStates={};this.clips.forEach((s,r)=>{s.name=`${r+1}. ${s.name}`;let a;r===0?(n[s.name]=!0,a=this.mixer.clipAction(s),a.play()):n[s.name]=!1;const o=this.animFolder.add(n,s.name).listen();o.onChange(c=>{a=a||this.mixer.clipAction(s),a.setEffectiveTimeScale(1),c?a.play():a.stop(),this.invalidate()}),this.animCtrls.push(o)})}}setAnimationDefs(e){this.animationManager.setAnimationDefs(e),this.content&&this._setupAnimationPanel()}_setupAnimationPanel(){this._animPanelEl&&(this._animPanelEl.remove(),this._animPanelEl=null);const e=this.animationManager.getAnimationDefs();if(e.length===0)return;let t=!1;if(this.content.traverse(s=>{s.isSkinnedMesh&&(t=!0)}),!t)return;const n=document.createElement("div");n.className="anim-panel",n.innerHTML='<div class="anim-panel__header"><span class="anim-panel__title">Animations</span><button class="anim-panel__stop" title="Stop all">⏹</button></div><div class="anim-panel__grid"></div>',this.el.appendChild(n),this._animPanelEl=n,this._renderAnimButtons(),this.animationManager.loadAll().then(()=>{if(this._renderAnimButtons(),!this.animationManager.currentName&&e.length>0){const s=e[0].name;this.animationManager.isLoaded(s)&&(this.animationManager.play(s),this._renderAnimButtons(),this.invalidate(),this._recomputeAnimating(),this._updateRenderLoop())}}),n.querySelector(".anim-panel__stop").addEventListener("click",()=>{this.animationManager.stopAll(),this._renderAnimButtons(),this.invalidate()}),this.animationManager.onChange=()=>{this._renderAnimButtons()}}_renderAnimButtons(){if(!this._animPanelEl)return;const e=this._animPanelEl.querySelector(".anim-panel__grid"),t=this.animationManager.getAnimationDefs(),n=this.animationManager.currentName,s={idle:"🧍",breathing:"🧍",standing:"🧍",walking:"🚶",walk:"🚶",running:"🏃",run:"🏃",waving:"👋",wave:"👋",dancing:"💃",dance:"💃",sitting:"🪑",sit:"🪑",jumping:"🦘",jump:"🦘",talking:"🗣️",talk:"🗣️",clapping:"👏",clap:"👏",punching:"👊",punch:"👊",kicking:"🦵",kick:"🦵"};e.innerHTML=t.map((r,a)=>{const o=this.animationManager.isLoaded(r.name),c=n===r.name,l=r.icon||s[r.name.toLowerCase()]||"▶",h=r.label||r.name.charAt(0).toUpperCase()+r.name.slice(1),u=a<9?a+1:"";return'<button class="anim-btn'+(c?" anim-btn--active":"")+(o?"":" anim-btn--loading")+'" data-anim="'+r.name+'" title="'+h+(u?" — press "+u:"")+'"'+(o?"":" disabled")+">"+(u?'<span class="anim-btn__key">'+u+"</span>":"")+'<span class="anim-btn__icon">'+l+'</span><span class="anim-btn__label">'+h+"</span></button>"}).join(""),e.querySelectorAll(".anim-btn:not([disabled])").forEach(r=>{r.addEventListener("click",()=>{const a=r.dataset.anim;this.animationManager.crossfadeTo(a),this.invalidate(),this._recomputeAnimating(),this._updateRenderLoop()})}),this._onAnimHotkey||(this._onAnimHotkey=r=>{if(r.target&&/INPUT|TEXTAREA|SELECT/.test(r.target.tagName)||r.metaKey||r.ctrlKey||r.altKey)return;const a=parseInt(r.key,10);if(!a||a<1||a>9)return;const c=this.animationManager.getAnimationDefs()[a-1];!c||!this.animationManager.isLoaded(c.name)||(this.animationManager.crossfadeTo(c.name),this.invalidate(),this._recomputeAnimating(),this._updateRenderLoop())},document.addEventListener("keydown",this._onAnimHotkey))}clear(){this.content&&(this.animationManager.detach(),this._animPanelEl&&(this._animPanelEl.remove(),this._animPanelEl=null),this.modelInfo&&(this.modelInfo.remove(),this.modelInfo=null),this.annotationEls.forEach(e=>e.el.remove()),this.annotationEls=[],this.scene.remove(this.content),this.content.traverse(e=>{e.geometry&&e.geometry.dispose()}),Wm(this.content,e=>{for(const t in e)t!=="envMap"&&e[t]&&e[t].isTexture&&e[t].dispose()}),this.content=null,this._disposed||this.invalidate())}dispose(){if(!this._disposed){if(this._disposed=!0,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._onResize,!1),window.removeEventListener("keydown",this._onKeyDown),this._onAnimHotkey&&(document.removeEventListener("keydown",this._onAnimHotkey),this._onAnimHotkey=null),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=null),this.clear(),this.mixer){this.mixer.stopAllAction();const e=this.mixer.getRoot();e&&this.mixer.uncacheRoot(e),this.mixer=null}this.clips=[],this.animationManager.dispose(),this._animPanelEl&&(this._animPanelEl.remove(),this._animPanelEl=null),this.skeletonHelpers.length&&(this.skeletonHelpers.forEach(e=>{this.scene.remove(e),e.dispose?.()}),this.skeletonHelpers.length=0),this.gridHelper&&(this.scene.remove(this.gridHelper),this.gridHelper.geometry?.dispose(),this.gridHelper.material?.dispose(),this.gridHelper=null),this.axesHelper&&(this.scene.remove(this.axesHelper),this.axesHelper.geometry?.dispose(),this.axesHelper.material?.dispose(),this.axesHelper=null),this.axesCorner&&(this.axesScene?.remove(this.axesCorner),this.axesCorner.geometry?.dispose(),this.axesCorner.material?.dispose(),this.axesCorner=null),this.lights.forEach(e=>e.parent?.remove(e)),this.lights=[],this.annotationEls.length&&(this.annotationEls.forEach(e=>e.el.remove()),this.annotationEls=[]),this.modelInfo&&(this.modelInfo.remove(),this.modelInfo=null),this.gui&&(this.gui.destroy(),this.gui=null),this._guiWrap&&(this._guiWrap.remove(),this._guiWrap=null),this._guiToggle&&(this._guiToggle.remove(),this._guiToggle=null),this.stats?.dom&&this.stats.dom.remove(),this.controls&&(this._onControlsChange&&(this.controls.removeEventListener("change",this._onControlsChange),this._onControlsChange=null),this.controls.dispose(),this.controls=null),this._loadedEnvironment&&(this._loadedEnvironment.dispose(),this._loadedEnvironment=null),this.neutralEnvironment&&(this.neutralEnvironment.dispose(),this.neutralEnvironment=null),this.scene&&(this.scene.environment=null,this.scene.background=null),this.pmremGenerator&&(this.pmremGenerator.dispose(),this.pmremGenerator=null),this.axesRenderer&&(this.axesRenderer.dispose(),this.axesRenderer.forceContextLoss?.(),this.axesRenderer.domElement?.remove(),this.axesRenderer=null),this.axesDiv&&(this.axesDiv.remove(),this.axesDiv=null),this.axesScene=null,this.axesCamera=null,this.renderer&&(this.renderer.dispose(),this.renderer.forceContextLoss?.(),this.renderer.domElement?.remove(),window.renderer===this.renderer&&(window.renderer=null),this.renderer=null),this.scene=null,this.content=null,this.activeCamera=null,this.defaultCamera=null,this._afterAnimateHooks=null}}}class RB{constructor({model:e="claude-opus-4-6",proxyURL:t,apiKey:n,temperature:s=.7,maxTokens:r=4096,thinking:a="auto"}={}){this.model=e,this.proxyURL=t,this.apiKey=n,this.temperature=s,this.maxTokens=r,this.thinking=a}async complete({system:e,messages:t,tools:n}){const s={model:this.model,max_tokens:this.maxTokens,temperature:this.temperature,system:e,messages:t};n&&n.length&&(s.tools=n),this.thinking==="always"&&(s.thinking={type:"enabled",budget_tokens:2048});const r=this.proxyURL||"https://api.anthropic.com/v1/messages",a={"content-type":"application/json"};this.apiKey&&(a["x-api-key"]=this.apiKey,a["anthropic-version"]="2023-06-01",a["anthropic-dangerous-direct-browser-access"]="true");const o=await fetch(r,{method:"POST",headers:a,body:JSON.stringify(s)});if(!o.ok){const l=await o.text();throw new Error(`Anthropic ${o.status}: ${l}`)}const c=await o.json();return this._normalize(c)}_normalize(e){const t={text:"",toolCalls:[],thinking:"",stopReason:e.stop_reason};for(const n of e.content||[])n.type==="text"?t.text+=n.text:n.type==="thinking"?t.thinking+=n.thinking||"":n.type==="tool_use"&&t.toolCalls.push({id:n.id,name:n.name,input:n.input});return t}formatToolResults(e){return{role:"user",content:e.map(t=>({type:"tool_result",tool_use_id:t.id,content:typeof t.output=="string"?t.output:JSON.stringify(t.output),is_error:!!t.isError}))}}formatAssistantWithToolCalls(e,t){const n=[];e&&n.push({type:"text",text:e});for(const s of t)n.push({type:"tool_use",id:s.id,name:s.name,input:s.input});return{role:"assistant",content:n}}}class NB{async complete(){return{text:"",toolCalls:[],stopReason:"end_turn"}}formatToolResults(){return{role:"user",content:[]}}formatAssistantWithToolCalls(e){return{role:"assistant",content:e||""}}}function FB(i={}){const e=i.provider||"anthropic";if(e==="anthropic")return new RB(i);if(e==="none")return new NB;throw new Error(`Unsupported provider: ${e}. Supported: anthropic, none`)}class DB{constructor({voiceId:e="default",rate:t=1,pitch:n=1,lang:s="en-US"}={}){this.voiceId=e,this.rate=t,this.pitch=n,this.lang=s,this._queue=[],this._speaking=!1}async speak(e,{onStart:t,onEnd:n}={}){if("speechSynthesis"in window)return new Promise(s=>{const r=new SpeechSynthesisUtterance(e);r.rate=this.rate,r.pitch=this.pitch,r.lang=this.lang;const a=this._pickVoice();a&&(r.voice=a),r.onstart=()=>{this._speaking=!0,t?.()},r.onend=()=>{this._speaking=!1,n?.(),s()},r.onerror=()=>{this._speaking=!1,s()},window.speechSynthesis.speak(r)})}cancel(){"speechSynthesis"in window&&window.speechSynthesis.cancel(),this._speaking=!1}get speaking(){return this._speaking}_pickVoice(){if(!("speechSynthesis"in window))return null;const e=window.speechSynthesis.getVoices();if(this.voiceId&&this.voiceId!=="default"){const t=e.find(n=>n.name===this.voiceId||n.voiceURI===this.voiceId);if(t)return t}return e.find(t=>t.lang?.startsWith(this.lang.slice(0,2)))||null}}class LB{constructor({language:e="en-US",continuous:t=!1,interimResults:n=!0}={}){this.language=e,this.continuous=t,this.interimResults=n,this._recognition=null,this._listening=!1}_ensure(){if(this._recognition)return this._recognition;const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(!e)return null;const t=new e;return t.lang=this.language,t.continuous=this.continuous,t.interimResults=this.interimResults,this._recognition=t,t}async listen({onInterim:e,onFinal:t}={}){const n=this._ensure();if(!n)throw new Error("SpeechRecognition unavailable in this browser");return new Promise((s,r)=>{let a="";n.onresult=o=>{for(let c=o.resultIndex;c<o.results.length;c++){const l=o.results[c],h=l[0].transcript;l.isFinal?(a+=h,t?.(h)):e?.(h)}},n.onerror=o=>{this._listening=!1,r(o.error)},n.onend=()=>{this._listening=!1,s(a.trim())},this._listening=!0;try{n.start()}catch(o){this._listening=!1,r(o)}})}stop(){this._recognition&&this._listening&&this._recognition.stop()}get listening(){return this._listening}}class PB{constructor({voiceId:e,modelId:t="eleven_turbo_v2_5",apiKey:n=null,proxyURL:s=null,rate:r=1,pitch:a=1,lang:o="en-US",stability:c=.5,similarityBoost:l=.75,useSpeakerBoost:h=!0}={}){if(!e)throw new Error("ElevenLabsTTS requires voiceId");this.voiceId=e,this.modelId=t,this.apiKey=n,this.proxyURL=s,this.rate=r,this.pitch=a,this.lang=o,this.stability=c,this.similarityBoost=l,this.useSpeakerBoost=h,this._speaking=!1,this._abort=null,this._audio=null,this._mediaSourceURL=null,this._onEnd=null}async speak(e,{onStart:t,onEnd:n}={}){if(this.cancel(),!e)return;this._abort=new AbortController,this._speaking=!0;const s=this.proxyURL||`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(this.voiceId)}/stream`,r={"content-type":"application/json",accept:"audio/mpeg"};!this.proxyURL&&this.apiKey&&(r["xi-api-key"]=this.apiKey);const a=Math.min(1.5,Math.max(.5,this.rate)),o=Math.min(1,Math.max(0,(a-.5)/1)),c=JSON.stringify({text:e,model_id:this.modelId,voice_settings:{stability:this.stability,similarity_boost:this.similarityBoost,style:o,use_speaker_boost:this.useSpeakerBoost},voiceId:this.voiceId,modelId:this.modelId});let l;try{l=await fetch(s,{method:"POST",headers:r,body:c,signal:this._abort.signal})}catch(d){if(this._speaking=!1,d.name==="AbortError")return;throw d}if(!l.ok)throw this._speaking=!1,new Error(`ElevenLabs TTS HTTP ${l.status}`);const h=typeof MediaSource<"u"&&MediaSource.isTypeSupported("audio/mpeg"),u=d=>{this._startedFired||(this._startedFired=!0,d?.())};return this._startedFired=!1,new Promise(d=>{this._onEnd=()=>{this._speaking=!1,this._cleanupAudio(),n?.(),this._onEnd=null,d()};const f=()=>{this._onEnd&&this._onEnd()};h&&l.body?this._playStreamingMSE(l.body,()=>u(t),f):this._playBuffered(l,()=>u(t),f)})}cancel(){if(this._abort){try{this._abort.abort()}catch{}this._abort=null}this._cleanupAudio(),this._speaking=!1,this._onEnd&&this._onEnd()}get speaking(){return this._speaking}_playStreamingMSE(e,t,n){const s=new MediaSource;this._mediaSourceURL=URL.createObjectURL(s);const r=new Audio(this._mediaSourceURL);this._audio=r,r.preload="auto",r.addEventListener("playing",t,{once:!0}),r.addEventListener("ended",()=>this._onEnd?.(),{once:!0}),r.addEventListener("error",()=>n?.(),{once:!0}),s.addEventListener("sourceopen",async()=>{let a;try{a=s.addSourceBuffer("audio/mpeg")}catch{n?.();return}const o=e.getReader(),c=[];let l=!0;const h=()=>{if(!l||a.updating)return;const u=c.shift();if(u)try{a.appendBuffer(u)}catch{l=!1;try{s.endOfStream()}catch{}}};a.addEventListener("updateend",h);try{for(;l;){const{value:u,done:d}=await o.read();if(d){l=!1;const f=()=>{if(a.updating||c.length)setTimeout(f,30);else try{s.endOfStream()}catch{}};f();break}c.push(u),h()}}catch(u){u.name!=="AbortError"&&n?.()}}),r.play().catch(n)}async _playBuffered(e,t,n){try{const s=await e.blob(),r=URL.createObjectURL(s);this._mediaSourceURL=r;const a=new Audio(r);this._audio=a,a.addEventListener("playing",t,{once:!0}),a.addEventListener("ended",()=>this._onEnd?.(),{once:!0}),a.addEventListener("error",()=>n?.(),{once:!0}),await a.play()}catch(s){s.name!=="AbortError"&&n?.()}}_cleanupAudio(){if(this._audio){try{this._audio.pause()}catch{}this._audio.src="",this._audio=null}if(this._mediaSourceURL){try{URL.revokeObjectURL(this._mediaSourceURL)}catch{}this._mediaSourceURL=null}this._startedFired=!1}}function kB(i={}){const e=i.provider||"browser";if(e==="none")return null;if(e==="browser")return new DB(i);if(e==="elevenlabs")return new PB(i);throw new Error(`TTS provider "${e}" not implemented yet`)}function UB(i={}){const e=i.provider||"browser";if(e==="none")return null;if(e==="browser")return new LB(i);throw new Error(`STT provider "${e}" not implemented yet`)}const Zm=[{name:"wave",description:"Wave at the user. Use for greetings, farewells, or acknowledgments.",input_schema:{type:"object",properties:{duration_ms:{type:"integer",minimum:500,maximum:5e3,default:1500}}}},{name:"lookAt",description:"Direct the agent's gaze toward a target.",input_schema:{type:"object",properties:{target:{type:"string",enum:["user","camera","center"],description:"Where to look"}},required:["target"]}},{name:"play_clip",description:"Play a named animation clip from the loaded body.",input_schema:{type:"object",properties:{name:{type:"string"},loop:{type:"boolean",default:!1},fade_ms:{type:"integer",default:200}},required:["name"]}},{name:"setExpression",description:"Set facial expression via morph target preset.",input_schema:{type:"object",properties:{preset:{type:"string",enum:["neutral","happy","sad","surprised","confused","focused"]},intensity:{type:"number",minimum:0,maximum:1,default:1}},required:["preset"]}},{name:"speak",description:"Say something out loud via TTS. Use this instead of plain text when voice is on.",input_schema:{type:"object",properties:{text:{type:"string"}},required:["text"]}},{name:"remember",description:"Save a durable memory about the user, a feedback rule, a project fact, or a reference.",input_schema:{type:"object",properties:{key:{type:"string",description:'short snake_case filename, e.g. "user_role"'},name:{type:"string"},description:{type:"string"},type:{type:"string",enum:["user","feedback","project","reference"]},body:{type:"string"}},required:["key","name","description","type","body"]}}],OB={async wave(i,e){const t=i.duration_ms||1500;return await e.viewer.playAnimationByHint?.("wave",{duration:t}),e.memory.note("waved",{duration_ms:t}),{ok:!0}},async lookAt(i,e){const t=i.target||"user";return e.viewer.lookAt?.(t),{ok:!0,target:t}},async play_clip(i,e){const{name:t,loop:n=!1,fade_ms:s=200}=i;return e.viewer.playClipByName?.(t,{loop:n,fade_ms:s})?{ok:!0,name:t}:{ok:!1,error:`No clip named "${t}"`}},async setExpression(i,e){const{preset:t,intensity:n=1}=i;return e.viewer.setExpression?.(t,n),{ok:!0,preset:t}},async speak(i,e){return await e.speak(i.text),{ok:!0}},async remember(i,e){const{key:t,name:n,description:s,type:r,body:a}=i;return e.memory.write(t,{name:n,description:s,type:r,body:a}),{ok:!0,saved:t}},async observe_agents(i,e){return e.stage?{ok:!0,agents:e.stage.getAgents().filter(n=>n.agentId!==e.agentId).map(({agentId:n,name:s,position:r})=>({agentId:n,name:s,position:r}))}:{ok:!1,error:"not on a stage"}},async say_to_agent(i,e){if(!e.stage)return{ok:!1,error:"not on a stage"};const{agentId:t,text:n}=i;if(!t||!n)return{ok:!1,error:"agentId and text required"};const s=e.agentId||"anon";return e.stage.broadcast(s,{kind:"direct",to:t,text:n}),e.stage.routeMessage(s,t,n)}},QB=8;class $m extends EventTarget{constructor({manifest:e,viewer:t,memory:n,skills:s,providerConfig:r={},voiceConfig:a={}}={}){super(),this.manifest=e||{},this.viewer=t,this.memory=n,this.skills=s,this.provider=FB({...this.manifest.brain,...r}),this.tts=kB({...this.manifest.voice?.tts,...a.tts}),this.stt=UB({...this.manifest.voice?.stt,...a.stt}),this.messages=[],this._busy=!1}get systemPrompt(){const e=[];return this.manifest.instructions&&e.push(this.manifest.instructions),this.memory&&e.push(`+`)}let pd=null,g1;function m1(){return pd===null&&(pd=new Intl.Segmenter(g1,{granularity:"word"})),pd}const b1=new RegExp("\\p{Script=Arabic}","u"),ul=new RegExp("\\p{M}","u"),Vg=new RegExp("\\p{Nd}","u");function Wg(i){return b1.test(i)}function qg(i){return i>=19968&&i<=40959||i>=13312&&i<=19903||i>=131072&&i<=173791||i>=173824&&i<=177983||i>=177984&&i<=178207||i>=178208&&i<=183983||i>=183984&&i<=191471||i>=191472&&i<=192093||i>=194560&&i<=195103||i>=196608&&i<=201551||i>=201552&&i<=205743||i>=205744&&i<=210041||i>=63744&&i<=64255||i>=12288&&i<=12351||i>=12352&&i<=12447||i>=12448&&i<=12543||i>=44032&&i<=55215||i>=65280&&i<=65519}function hr(i){for(let e=0;e<i.length;e++){const t=i.charCodeAt(e);if(!(t<12288)){if(t>=55296&&t<=56319&&e+1<i.length){const n=i.charCodeAt(e+1);if(n>=56320&&n<=57343){const s=(t-55296<<10)+(n-56320)+65536;if(qg(s))return!0;e++;continue}}if(qg(t))return!0}}return!1}function x1(i){const e=fl(i);return e!==null&&(Ad.has(e)||ur.has(e))}const E1=new Set([" "," ","","\uFEFF"]);function _1(i){return hr(i)}function y1(i){const e=fl(i);return e!==null&&E1.has(e)}function w1(i){return!x1(i)&&!y1(i)}const Ad=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),dl=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),gd=new Set(["'","’"]),ur=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),v1=new Set([":",".","،","؛"]),C1=new Set(["၏"]),S1=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function I1(i){if(md(i))return!0;let e=!1;for(const t of i){if(ur.has(t)){e=!0;continue}if(!(e&&ul.test(t)))return!1}return e}function M1(i){for(const e of i)if(!Ad.has(e)&&!ur.has(e))return!1;return i.length>0}function B1(i){if(md(i))return!0;for(const e of i)if(!dl.has(e)&&!gd.has(e)&&!ul.test(e))return!1;return i.length>0}function md(i){let e=!1;for(const t of i)if(!(t==="\\"||ul.test(t))){if(dl.has(t)||ur.has(t)||gd.has(t)){e=!0;continue}return!1}return e}function Kg(i,e){const t=e-1;if(t<=0)return Math.max(t,0);const n=i.charCodeAt(t);if(n<56320||n>57343)return t;const s=t-1;if(s<0)return t;const r=i.charCodeAt(s);return r>=55296&&r<=56319?s:t}function fl(i){if(i.length===0)return null;const e=Kg(i,i.length);return i.slice(e)}function T1(i){const e=Array.from(i);let t=e.length;for(;t>0;){const n=e[t-1];if(ul.test(n)){t--;continue}if(dl.has(n)||gd.has(n)){t--;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t).join(""),tail:e.slice(t).join("")}}function R1(i,e,t){return t==="text"&&!e&&i.length===1&&i!=="-"&&i!=="—"?i:null}function jg(i,e,t,n){const s=e[n],r=i[n];if(s==null)return r;const a=t[n];if(r.length===a)return r;const o=s.repeat(a);return i[n]=o,o}function Xg(i,e){return i&&e!==null&&v1.has(e)}function N1(i){const e=fl(i);return e!==null&&C1.has(e)}function F1(i){if(i.length<2||i[0]!==" ")return null;const e=i.slice(1);return new RegExp("^\\p{M}+$","u").test(e)?{space:" ",marks:e}:null}function bd(i){let e=i.length;for(;e>0;){const t=Kg(i,e),n=i.slice(t,e);if(S1.has(n))return!0;if(!ur.has(n))return!1;e=t}return!1}function D1(i,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(i===" ")return"preserved-space";if(i===" ")return"tab";if(e.preserveHardBreaks&&i===`+`)return"hard-break"}return i===" "?"space":i===" "||i===" "||i===""||i==="\uFEFF"?"glue":i===""?"zero-width-break":i===""?"soft-hyphen":"text"}const L1=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ei(i){return i.length===1?i[0]:i.join("")}function P1(i,e){const t=[];for(let n=i.length-1;n>=0;n--)t.push(i[n]);return t.push(e),ei(t)}function k1(i,e,t,n){if(!L1.test(i))return[{text:i,isWordLike:e,kind:"text",start:t}];const s=[];let r=null,a=[],o=t,c=!1,l=0;for(const h of i){const u=D1(h,n),d=u==="text"&&e;if(r!==null&&u===r&&d===c){a.push(h),l+=h.length;continue}r!==null&&s.push({text:ei(a),isWordLike:c,kind:r,start:o}),r=u,a=[h],o=t+l,c=d,l+=h.length}return r!==null&&s.push({text:ei(a),isWordLike:c,kind:r,start:o}),s}function xd(i){return i==="space"||i==="preserved-space"||i==="zero-width-break"||i==="hard-break"}const U1=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function O1(i,e){const t=i.texts[e];return t.startsWith("www.")?!0:U1.test(t)&&e+1<i.len&&i.kinds[e+1]==="text"&&i.texts[e+1]==="//"}function Q1(i){return i.includes("?")&&(i.includes("://")||i.startsWith("www."))}function G1(i){const e=i.texts.slice(),t=i.isWordLike.slice(),n=i.kinds.slice(),s=i.starts.slice();for(let a=0;a<i.len;a++){if(n[a]!=="text"||!O1(i,a))continue;const o=[e[a]];let c=a+1;for(;c<i.len&&!xd(n[c]);){o.push(e[c]),t[a]=!0;const l=e[c].includes("?");if(n[c]="text",e[c]="",c++,l)break}e[a]=ei(o)}let r=0;for(let a=0;a<e.length;a++){const o=e[a];o.length!==0&&(r!==a&&(e[r]=o,t[r]=t[a],n[r]=n[a],s[r]=s[a]),r++)}return e.length=r,t.length=r,n.length=r,s.length=r,{len:r,texts:e,isWordLike:t,kinds:n,starts:s}}function H1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r];if(e.push(a),t.push(i.isWordLike[r]),n.push(i.kinds[r]),s.push(i.starts[r]),!Q1(a))continue;const o=r+1;if(o>=i.len||xd(i.kinds[o]))continue;const c=[],l=i.starts[o];let h=o;for(;h<i.len&&!xd(i.kinds[h]);)c.push(i.texts[h]),h++;c.length>0&&(e.push(ei(c)),t.push(!0),n.push("text"),s.push(l),r=h-1)}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}const z1=new Set([":","-","/","×",",",".","+","–","—"]),Yg=/^[A-Za-z0-9_]+[,:;]*$/,Jg=/[,:;]+$/;function Zg(i){for(const e of i)if(Vg.test(e))return!0;return!1}function pl(i){if(i.length===0)return!1;for(const e of i)if(!(Vg.test(e)||z1.has(e)))return!1;return!0}function V1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r],o=i.kinds[r];if(o==="text"&&pl(a)&&Zg(a)){const c=[a];let l=r+1;for(;l<i.len&&i.kinds[l]==="text"&&pl(i.texts[l]);)c.push(i.texts[l]),l++;e.push(ei(c)),t.push(!0),n.push("text"),s.push(i.starts[r]),r=l-1;continue}e.push(a),t.push(i.isWordLike[r]),n.push(o),s.push(i.starts[r])}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function W1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r],o=i.kinds[r],c=i.isWordLike[r];if(o==="text"&&c&&Yg.test(a)){const l=[a];let h=Jg.test(a),u=r+1;for(;h&&u<i.len&&i.kinds[u]==="text"&&i.isWordLike[u]&&Yg.test(i.texts[u]);){const d=i.texts[u];l.push(d),h=Jg.test(d),u++}e.push(ei(l)),t.push(!0),n.push("text"),s.push(i.starts[r]),r=u-1;continue}e.push(a),t.push(c),n.push(o),s.push(i.starts[r])}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function q1(i){const e=[],t=[],n=[],s=[];for(let r=0;r<i.len;r++){const a=i.texts[r];if(i.kinds[r]==="text"&&a.includes("-")){const o=a.split("-");let c=o.length>1;for(let l=0;l<o.length;l++){const h=o[l];if(!c)break;(h.length===0||!Zg(h)||!pl(h))&&(c=!1)}if(c){let l=0;for(let h=0;h<o.length;h++){const u=o[h],d=h<o.length-1?`${u}-`:u;e.push(d),t.push(!0),n.push("text"),s.push(i.starts[r]+l),l+=d.length}continue}}e.push(a),t.push(i.isWordLike[r]),n.push(i.kinds[r]),s.push(i.starts[r])}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function K1(i){const e=[],t=[],n=[],s=[];let r=0;for(;r<i.len;){const a=[i.texts[r]];let o=i.isWordLike[r],c=i.kinds[r],l=i.starts[r];if(c==="glue"){const h=[a[0]],u=l;for(r++;r<i.len&&i.kinds[r]==="glue";)h.push(i.texts[r]),r++;const d=ei(h);if(r<i.len&&i.kinds[r]==="text")a[0]=d,a.push(i.texts[r]),o=i.isWordLike[r],c="text",l=u,r++;else{e.push(d),t.push(!1),n.push("glue"),s.push(u);continue}}else r++;if(c==="text")for(;r<i.len&&i.kinds[r]==="glue";){const h=[];for(;r<i.len&&i.kinds[r]==="glue";)h.push(i.texts[r]),r++;const u=ei(h);if(r<i.len&&i.kinds[r]==="text"){a.push(u,i.texts[r]),o=o||i.isWordLike[r],r++;continue}a.push(u)}e.push(ei(a)),t.push(o),n.push(c),s.push(l)}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function j1(i){const e=i.texts.slice(),t=i.isWordLike.slice(),n=i.kinds.slice(),s=i.starts.slice();for(let r=0;r<e.length-1;r++){if(n[r]!=="text"||n[r+1]!=="text"||!hr(e[r])||!hr(e[r+1]))continue;const a=T1(e[r]);a!==null&&(e[r]=a.head,e[r+1]=a.tail+e[r+1],s[r+1]=s[r]+a.head.length)}return{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function $g(i,e,t){const n=m1();let s=0;const r=[],a=[],o=[],c=[],l=[],h=[],u=[],d=[],f=[],m=[],g=[],A=[];for(const w of n.segment(i))for(const S of k1(w.segment,w.isWordLike??!1,w.index,t)){let O=function(){h[D]!==null&&(a[D]=[jg(r,h,u,D)],h[D]=null),a[D].push(S.text),o[D]=o[D]||S.isWordLike,d[D]=d[D]||v,f[D]=f[D]||F,m[D]=q,g[D]=$,A[D]=Xg(f[D],K)};const T=S.kind==="text",C=R1(S.text,S.isWordLike,S.kind),v=hr(S.text),F=Wg(S.text),K=fl(S.text),q=bd(S.text),$=N1(S.text),D=s-1;e.carryCJKAfterClosingQuote&&T&&s>0&&c[D]==="text"&&v&&d[D]&&m[D]||T&&s>0&&c[D]==="text"&&M1(S.text)&&d[D]||T&&s>0&&c[D]==="text"&&g[D]?O():T&&s>0&&c[D]==="text"&&S.isWordLike&&F&&A[D]?(O(),o[D]=!0):C!==null&&s>0&&c[D]==="text"&&h[D]===C?u[D]=(u[D]??1)+1:T&&!S.isWordLike&&s>0&&c[D]==="text"&&(I1(S.text)||S.text==="-"&&o[D])?O():(r[s]=S.text,a[s]=[S.text],o[s]=S.isWordLike,c[s]=S.kind,l[s]=S.start,h[s]=C,u[s]=C===null?0:1,d[s]=v,f[s]=F,m[s]=q,g[s]=$,A[s]=Xg(F,K),s++)}for(let w=0;w<s;w++){if(h[w]!==null){r[w]=jg(r,h,u,w);continue}r[w]=ei(a[w])}for(let w=1;w<s;w++)c[w]==="text"&&!o[w]&&md(r[w])&&c[w-1]==="text"&&(r[w-1]+=r[w],o[w-1]=o[w-1]||o[w],r[w]="");const p=Array.from({length:s},()=>null);let y=-1;for(let w=s-1;w>=0;w--){const S=r[w];if(S.length!==0){if(c[w]==="text"&&!o[w]&&B1(S)&&y>=0&&c[y]==="text"){const T=p[y]??[];T.push(S),p[y]=T,l[y]=l[w],r[w]="";continue}y=w}}for(let w=0;w<s;w++){const S=p[w];S!=null&&(r[w]=P1(S,r[w]))}let b=0;for(let w=0;w<s;w++){const S=r[w];S.length!==0&&(b!==w&&(r[b]=S,o[b]=o[w],c[b]=c[w],l[b]=l[w]),b++)}r.length=b,o.length=b,c.length=b,l.length=b;const _=K1({len:b,texts:r,isWordLike:o,kinds:c,starts:l}),M=j1(W1(q1(V1(H1(G1(_))))));for(let w=0;w<M.len-1;w++){const S=F1(M.texts[w]);S!==null&&(M.kinds[w]!=="space"&&M.kinds[w]!=="preserved-space"||M.kinds[w+1]!=="text"||!Wg(M.texts[w+1])||(M.texts[w]=S.space,M.isWordLike[w]=!1,M.kinds[w]=M.kinds[w]==="preserved-space"?"preserved-space":"space",M.texts[w+1]=S.marks+M.texts[w+1],M.starts[w+1]=M.starts[w]+S.space.length))}return M}function X1(i,e){if(i.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:i.len,consumedEndSegmentIndex:i.len}];const t=[];let n=0;for(let s=0;s<i.len;s++)i.kinds[s]==="hard-break"&&(t.push({startSegmentIndex:n,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),n=s+1);return n<i.len&&t.push({startSegmentIndex:n,endSegmentIndex:i.len,consumedEndSegmentIndex:i.len}),t}function Y1(i){if(i.len<=1)return i;const e=[],t=[],n=[],s=[];let r=null,a=!1,o=0,c=!1,l=!1;function h(){r!==null&&(e.push(ei(r)),t.push(a),n.push("text"),s.push(o),r=null)}for(let u=0;u<i.len;u++){const d=i.texts[u],f=i.kinds[u],m=i.isWordLike[u],g=i.starts[u];if(f==="text"){const A=_1(d),p=w1(d);if(r!==null&&c&&l){r.push(d),a=a||m,c=c||A,l=p;continue}h(),r=[d],a=m,o=g,c=A,l=p;continue}h(),e.push(d),t.push(m),n.push(f),s.push(g)}return h(),{len:e.length,texts:e,isWordLike:t,kinds:n,starts:s}}function J1(i,e,t="normal",n="normal"){const s=f1(t),r=s.mode==="pre-wrap"?A1(i):p1(i);if(r.length===0)return{normalized:r,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const a=n==="keep-all"?Y1($g(r,e,s)):$g(r,e,s);return{normalized:r,chunks:X1(a,s),...a}}let ba=null;const em=new Map;let xa=null;const Z1=96,$1=new RegExp("\\p{Emoji_Presentation}","u"),eM=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Ed=null;const tm=new Map;function _d(){if(ba!==null)return ba;if(typeof OffscreenCanvas<"u")return ba=new OffscreenCanvas(1,1).getContext("2d"),ba;if(typeof document<"u")return ba=document.createElement("canvas").getContext("2d"),ba;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function tM(i){let e=em.get(i);return e||(e=new Map,em.set(i,e)),e}function Ls(i,e){let t=e.get(i);return t===void 0&&(t={width:_d().measureText(i).width,containsCJK:hr(i)},e.set(i,t)),t}function Ea(){if(xa!==null)return xa;if(typeof navigator>"u")return xa={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},xa;const i=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&i.includes("Safari/")&&!i.includes("Chrome/")&&!i.includes("Chromium/")&&!i.includes("CriOS/")&&!i.includes("FxiOS/")&&!i.includes("EdgiOS/"),n=i.includes("Chrome/")||i.includes("Chromium/")||i.includes("CriOS/")||i.includes("Edg/");return xa={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},xa}function nM(i){const e=i.match(/(\d+(?:\.\d+)?)\s*px/);return e?parseFloat(e[1]):16}function nm(){return Ed===null&&(Ed=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ed}function iM(i){return $1.test(i)||i.includes("️")}function sM(i){return eM.test(i)}function rM(i,e){let t=tm.get(i);if(t!==void 0)return t;const n=_d();n.font=i;const s=n.measureText("😀").width;if(t=0,s>e+.5&&typeof document<"u"&&document.body!==null){const r=document.createElement("span");r.style.font=i,r.style.display="inline-block",r.style.visibility="hidden",r.style.position="absolute",r.textContent="😀",document.body.appendChild(r);const a=r.getBoundingClientRect().width;document.body.removeChild(r),s-a>.5&&(t=s-a)}return tm.set(i,t),t}function aM(i){let e=0;const t=nm();for(const n of t.segment(i))iM(n.segment)&&e++;return e}function oM(i,e){return e.emojiCount===void 0&&(e.emojiCount=aM(i)),e.emojiCount}function dr(i,e,t){return t===0?e.width:e.width-oM(i,e)*t}function cM(i,e,t,n,s){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;const r=nm(),a=[];for(const h of r.segment(i))a.push(h.segment);if(a.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(s==="sum-graphemes"){const h=[];for(const u of a){const d=Ls(u,t);h.push(dr(u,d,n))}return e.breakableFitAdvances=h,e.breakableFitAdvances}if(s==="pair-context"||a.length>Z1){const h=[];let u=null,d=0;for(const f of a){const m=Ls(f,t),g=dr(f,m,n);if(u===null)h.push(g);else{const A=u+f,p=Ls(A,t);h.push(dr(A,p,n)-d)}u=f,d=g}return e.breakableFitAdvances=h,e.breakableFitAdvances}const o=[];let c="",l=0;for(const h of a){c+=h;const u=Ls(c,t),d=dr(c,u,n);o.push(d-l),l=d}return e.breakableFitAdvances=o,e.breakableFitAdvances}function lM(i,e){const t=_d();t.font=i;const n=tM(i),s=nM(i),r=e?rM(i,s):0;return{cache:n,fontSize:s,emojiCorrection:r}}function hM(i,e){for(;e<i.widths.length;){const t=i.kinds[e];if(t!=="space"&&t!=="zero-width-break"&&t!=="soft-hyphen")break;e++}return e}function im(i,e){if(e<=0)return 0;const t=i%e;return Math.abs(t)<=1e-6?e:e-t}function sm(i,e,t,n,s){let r=0,a=e;for(;r<i.length;){const o=a+i[r];if((r+1<i.length?o+s:o)>t+n)break;a=o,r++}return{fitCount:r,fittedWidth:a}}function uM(i,e){let t=0,n=i.chunks.length;for(;t<n;){const s=Math.floor((t+n)/2);e<i.chunks[s].consumedEndSegmentIndex?n=s:t=s+1}return t<i.chunks.length?t:-1}function rm(i,e,t){let n=t.segmentIndex;if(t.graphemeIndex>0)return e;const s=i.chunks[e];if(s.startSegmentIndex===s.endSegmentIndex&&n===s.startSegmentIndex)return t.segmentIndex=n,t.graphemeIndex=0,e;for(n<s.startSegmentIndex&&(n=s.startSegmentIndex);n<s.endSegmentIndex;){const r=i.kinds[n];if(r!=="space"&&r!=="zero-width-break"&&r!=="soft-hyphen")return t.segmentIndex=n,t.graphemeIndex=0,e;n++}return s.consumedEndSegmentIndex>=i.widths.length?-1:(t.segmentIndex=s.consumedEndSegmentIndex,t.graphemeIndex=0,e+1)}function yd(i,e){if(e.segmentIndex>=i.widths.length)return-1;const t=uM(i,e.segmentIndex);return t<0?-1:rm(i,t,e)}function dM(i,e,t){if(t.segmentIndex>=i.widths.length)return-1;let n=e;for(;n<i.chunks.length&&t.segmentIndex>=i.chunks[n].consumedEndSegmentIndex;)n++;return n>=i.chunks.length?-1:rm(i,n,t)}function fM(i,e){return i.simpleLineWalkFastPath?am(i,e):wd(i,e)}function am(i,e,t){const{widths:n,kinds:s,breakableFitAdvances:r}=i;if(n.length===0)return 0;const o=Ea().lineFitEpsilon,c=e+o;let l=0,h=0,u=!1,d=0,f=0,m=0,g=0,A=-1,p=0;function y(){A=-1,p=0}function b(C=m,v=g,F=h){l++,t?.({startSegmentIndex:d,startGraphemeIndex:f,endSegmentIndex:C,endGraphemeIndex:v,width:F}),h=0,u=!1,y()}function _(C,v){u=!0,d=C,f=0,m=C+1,g=0,h=v}function M(C,v,F){u=!0,d=C,f=v,m=C,g=v+1,h=F}function w(C,v){if(!u){_(C,v);return}h+=v,m=C+1,g=0}function S(C,v){const F=r[C];for(let K=v;K<F.length;K++){const q=F[K];u?h+q>c?(b(),M(C,K,q)):(h+=q,m=C,g=K+1):M(C,K,q)}u&&m===C&&g===F.length&&(m=C+1,g=0)}let T=0;for(;T<n.length&&!(!u&&(T=hM(i,T),T>=n.length));){const C=n[T],v=s[T],F=v==="space"||v==="preserved-space"||v==="tab"||v==="zero-width-break"||v==="soft-hyphen";if(!u){C>e&&r[T]!==null?S(T,0):_(T,C),F&&(A=T+1,p=h-C),T++;continue}if(h+C>c){if(F){w(T,C),b(T+1,0,h-C),T++;continue}if(A>=0){if(m>A||m===A&&g>0){b();continue}b(A,0,p);continue}if(C>e&&r[T]!==null){b(),S(T,0),T++;continue}b();continue}w(T,C),F&&(A=T+1,p=h-C),T++}return u&&b(),l}function wd(i,e,t){if(i.simpleLineWalkFastPath)return am(i,e,t);const{widths:n,lineEndFitAdvances:s,lineEndPaintAdvances:r,kinds:a,breakableFitAdvances:o,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:h}=i;if(n.length===0||h.length===0)return 0;const u=Ea(),d=u.lineFitEpsilon,f=e+d;let m=0,g=0,A=!1,p=0,y=0,b=0,_=0,M=-1,w=0,S=0,T=null;function C(){M=-1,w=0,S=0,T=null}function v(Q=b,J=_,ee=g){m++,t?.({startSegmentIndex:p,startGraphemeIndex:y,endSegmentIndex:Q,endGraphemeIndex:J,width:ee}),g=0,A=!1,C()}function F(Q,J){A=!0,p=Q,y=0,b=Q+1,_=0,g=J}function K(Q,J,ee){A=!0,p=Q,y=J,b=Q,_=J+1,g=ee}function q(Q,J){if(!A){F(Q,J);return}g+=J,b=Q+1,_=0}function $(Q,J,ee,ae){if(!J)return;const ye=Q==="tab"?0:s[ee],Me=Q==="tab"?ae:r[ee];M=ee+1,w=g-ae+ye,S=g-ae+Me,T=Q}function D(Q,J){const ee=o[Q];for(let ae=J;ae<ee.length;ae++){const ye=ee[ae];A?g+ye>f?(v(),K(Q,ae,ye)):(g+=ye,b=Q,_=ae+1):K(Q,ae,ye)}A&&b===Q&&_===ee.length&&(b=Q+1,_=0)}function O(Q){if(T!=="soft-hyphen")return!1;const J=o[Q];if(J==null)return!1;const{fitCount:ee,fittedWidth:ae}=sm(J,g,e,d,c);return ee===0?!1:(g=ae,b=Q,_=ee,C(),ee===J.length?(b=Q+1,_=0,!0):(v(Q,ee,ae+c),D(Q,ee),!0))}function Y(Q){m++,t?.({startSegmentIndex:Q.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:Q.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let Q=0;Q<h.length;Q++){const J=h[Q];if(J.startSegmentIndex===J.endSegmentIndex){Y(J);continue}A=!1,g=0,p=J.startSegmentIndex,y=0,b=J.startSegmentIndex,_=0,C();let ee=J.startSegmentIndex;for(;ee<J.endSegmentIndex;){const ae=a[ee],ye=ae==="space"||ae==="preserved-space"||ae==="tab"||ae==="zero-width-break"||ae==="soft-hyphen",Me=ae==="tab"?im(g,l):n[ee];if(ae==="soft-hyphen"){A&&(b=ee+1,_=0,M=ee+1,w=g+c,S=g+c,T=ae),ee++;continue}if(!A){Me>e&&o[ee]!==null?D(ee,0):F(ee,Me),$(ae,ye,ee,Me),ee++;continue}if(g+Me>f){const me=g+(ae==="tab"?0:s[ee]),be=g+(ae==="tab"?Me:r[ee]);if(T==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&w<=f){v(M,0,S);continue}if(T==="soft-hyphen"&&O(ee)){ee++;continue}if(ye&&me<=f){q(ee,Me),v(ee+1,0,be),ee++;continue}if(M>=0&&w<=f){if(b>M||b===M&&_>0){v();continue}const xe=M;v(xe,0,S),ee=xe;continue}if(Me>e&&o[ee]!==null){v(),D(ee,0),ee++;continue}v();continue}q(ee,Me),$(ae,ye,ee,Me),ee++}if(A){const ae=M===J.consumedEndSegmentIndex?S:g;v(J.consumedEndSegmentIndex,0,ae)}}return m}function vd(i,e,t,n){const s=i.chunks[t];if(s.startSegmentIndex===s.endSegmentIndex)return e.segmentIndex=s.consumedEndSegmentIndex,e.graphemeIndex=0,0;const{widths:r,lineEndFitAdvances:a,lineEndPaintAdvances:o,kinds:c,breakableFitAdvances:l,discretionaryHyphenWidth:h,tabStopAdvance:u}=i,d=Ea(),f=d.lineFitEpsilon,m=n+f;let g=0,A=!1,p=e.segmentIndex,y=e.graphemeIndex,b=-1,_=0,M=0,w=null;function S(){b=-1,_=0,M=0,w=null}function T(D=p,O=y,Y=g){return A?(e.segmentIndex=D,e.graphemeIndex=O,Y):null}function C(D,O){A=!0,p=D+1,y=0,g=O}function v(D,O,Y){A=!0,p=D,y=O+1,g=Y}function F(D,O){if(!A){C(D,O);return}g+=O,p=D+1,y=0}function K(D,O,Y,Q){if(!O)return;const J=D==="tab"?0:a[Y],ee=D==="tab"?Q:o[Y];b=Y+1,_=g-Q+J,M=g-Q+ee,w=D}function q(D,O){const Y=l[D];for(let Q=O;Q<Y.length;Q++){const J=Y[Q];if(!A)v(D,Q,J);else{if(g+J>m)return T();g+=J,p=D,y=Q+1}}return A&&p===D&&y===Y.length&&(p=D+1,y=0),null}function $(D){if(w!=="soft-hyphen"||b<0)return null;const O=l[D]??null;if(O!==null){const{fitCount:Y,fittedWidth:Q}=sm(O,g,n,f,h);if(Y===O.length)return g=Q,p=D+1,y=0,S(),null;if(Y>0)return T(D,Y,Q+h)}return _<=m?T(b,0,M):null}for(let D=e.segmentIndex;D<s.endSegmentIndex;D++){const O=c[D],Y=O==="space"||O==="preserved-space"||O==="tab"||O==="zero-width-break"||O==="soft-hyphen",Q=D===e.segmentIndex?e.graphemeIndex:0,J=O==="tab"?im(g,u):r[D];if(O==="soft-hyphen"&&Q===0){A&&(p=D+1,y=0,b=D+1,_=g+h,M=g+h,w=O);continue}if(!A){if(Q>0){const ae=q(D,Q);if(ae!==null)return ae}else if(J>n&&l[D]!==null){const ae=q(D,0);if(ae!==null)return ae}else C(D,J);K(O,Y,D,J);continue}if(g+J>m){const ae=g+(O==="tab"?0:a[D]),ye=g+(O==="tab"?J:o[D]);if(w==="soft-hyphen"&&d.preferEarlySoftHyphenBreak&&_<=m)return T(b,0,M);const Me=$(D);if(Me!==null)return Me;if(Y&&ae<=m)return F(D,J),T(D+1,0,ye);if(b>=0&&_<=m)return p>b||p===b&&y>0?T():T(b,0,M);if(J>n&&l[D]!==null){const se=T();if(se!==null)return se;const me=q(D,0);if(me!==null)return me}return T()}F(D,J),K(O,Y,D,J)}return b===s.consumedEndSegmentIndex&&y===0?T(s.consumedEndSegmentIndex,0,M):T(s.consumedEndSegmentIndex,0,g)}function om(i,e,t){const{widths:n,kinds:s,breakableFitAdvances:r}=i,o=Ea().lineFitEpsilon,c=t+o;let l=0,h=!1,u=e.segmentIndex,d=e.graphemeIndex,f=-1,m=0;for(let g=e.segmentIndex;g<n.length;g++){const A=n[g],p=s[g],y=p==="space"||p==="preserved-space"||p==="tab"||p==="zero-width-break"||p==="soft-hyphen",b=g===e.segmentIndex?e.graphemeIndex:0,_=r[g];if(!h){if(b>0||A>t&&_!==null){const M=_,w=M[b];h=!0,l=w,u=g,d=b+1;for(let S=b+1;S<M.length;S++){const T=M[S];if(l+T>c)return e.segmentIndex=u,e.graphemeIndex=d,l;l+=T,u=g,d=S+1}u===g&&d===M.length&&(u=g+1,d=0)}else h=!0,l=A,u=g+1,d=0;y&&(f=g+1,m=l-A);continue}if(l+A>c)return y?(e.segmentIndex=g+1,e.graphemeIndex=0,l):f>=0?u>f||u===f&&d>0?(e.segmentIndex=u,e.graphemeIndex=d,l):(e.segmentIndex=f,e.graphemeIndex=0,m):(e.segmentIndex=u,e.graphemeIndex=d,l);l+=A,u=g+1,d=0,y&&(f=g+1,m=l-A)}return h?(e.segmentIndex=u,e.graphemeIndex=d,l):null}function Cd(i,e,t){const n={segmentIndex:e.segmentIndex,graphemeIndex:e.graphemeIndex},s=yd(i,n);if(s<0)return null;const r=n.segmentIndex,a=n.graphemeIndex,o=i.simpleLineWalkFastPath?om(i,n,t):vd(i,n,s,t);return o===null?null:{startSegmentIndex:r,startGraphemeIndex:a,endSegmentIndex:n.segmentIndex,endGraphemeIndex:n.graphemeIndex,width:o}}function pM(i,e,t){const n=yd(i,e);return n<0?null:i.simpleLineWalkFastPath?om(i,e,t):vd(i,e,n,t)}function AM(i,e){if(i.widths.length===0)return{lineCount:0,maxLineWidth:0};const t={segmentIndex:0,graphemeIndex:0};let n=0,s=0;if(!i.simpleLineWalkFastPath){let r=yd(i,t);for(;r>=0;){const a=vd(i,t,r,e);if(a===null)return{lineCount:n,maxLineWidth:s};n++,a>s&&(s=a),r=dM(i,r,t)}return{lineCount:n,maxLineWidth:s}}for(;;){const r=pM(i,t,e);if(r===null)return{lineCount:n,maxLineWidth:s};n++,r>s&&(s=r)}}let Sd=null,cm=new WeakMap;function lm(){return Sd===null&&(Sd=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Sd}function gM(i){return i?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function mM(i,e){const t=[];let n=[],s=0,r=!1,a=!1,o=!1;function c(){n.length!==0&&(t.push({text:n.length===1?n[0]:n.join(""),start:s}),n=[],r=!1,a=!1,o=!1)}function l(u,d,f){n=[u],s=d,r=f,a=bd(u),o=dl.has(u)}function h(u,d){n.push(u),r=r||d;const f=bd(u);u.length===1&&ur.has(u)?a=a||f:a=f,o=!1}for(const u of lm().segment(i)){const d=u.segment,f=hr(d);if(n.length===0){l(d,u.index,f);continue}if(o||Ad.has(d)||ur.has(d)||e.carryCJKAfterClosingQuote&&f&&a){h(d,f);continue}if(!r&&!f){h(d,f);continue}c(),l(d,u.index,f)}return c(),t}function bM(i,e,t,n){const s=Ea(),{cache:r,emojiCorrection:a}=lM(e,sM(i.normalized)),o=dr("-",Ls("-",r),a),l=dr(" ",Ls(" ",r),a)*8;if(i.len===0)return gM(t);const h=[],u=[],d=[],f=[];let m=i.chunks.length<=1;const g=t?[]:null,A=[],p=t?[]:null,y=Array.from({length:i.len});function b(S,T,C,v,F,K,q){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(m=!1),h.push(T),u.push(C),d.push(v),f.push(F),g?.push(K),A.push(q),p!==null&&p.push(S)}function _(S,T,C,v,F){const K=Ls(S,r),q=dr(S,K,a),$=T==="space"||T==="preserved-space"||T==="zero-width-break"?0:q,D=T==="space"||T==="zero-width-break"?0:q;if(F&&v&&S.length>1){let O="sum-graphemes";pl(S)?O="pair-context":s.preferPrefixWidthsForBreakableRuns&&(O="segment-prefixes");const Y=cM(S,K,r,a,O);b(S,q,$,D,T,C,Y);return}b(S,q,$,D,T,C,null)}for(let S=0;S<i.len;S++){y[S]=h.length;const T=i.texts[S],C=i.isWordLike[S],v=i.kinds[S],F=i.starts[S];if(v==="soft-hyphen"){b(T,0,o,o,v,F,null);continue}if(v==="hard-break"){b(T,0,0,0,v,F,null);continue}if(v==="tab"){b(T,0,0,0,v,F,null);continue}const K=Ls(T,r);if(v==="text"&&K.containsCJK){const $=mM(T,s);for(let D=0;D<$.length;D++){const O=$[D];_(O.text,"text",F+O.start,C,!hr(O.text))}continue}_(T,v,F,C,!0)}const M=xM(i.chunks,y,h.length),w=g===null?null:h1(i.normalized,g);return p!==null?{widths:h,lineEndFitAdvances:u,lineEndPaintAdvances:d,kinds:f,simpleLineWalkFastPath:m,segLevels:w,breakableFitAdvances:A,discretionaryHyphenWidth:o,tabStopAdvance:l,chunks:M,segments:p}:{widths:h,lineEndFitAdvances:u,lineEndPaintAdvances:d,kinds:f,simpleLineWalkFastPath:m,segLevels:w,breakableFitAdvances:A,discretionaryHyphenWidth:o,tabStopAdvance:l,chunks:M}}function xM(i,e,t){const n=[];for(let s=0;s<i.length;s++){const r=i[s],a=r.startSegmentIndex<e.length?e[r.startSegmentIndex]:t,o=r.endSegmentIndex<e.length?e[r.endSegmentIndex]:t,c=r.consumedEndSegmentIndex<e.length?e[r.consumedEndSegmentIndex]:t;n.push({startSegmentIndex:a,endSegmentIndex:o,consumedEndSegmentIndex:c})}return n}function hm(i,e,t,n){const r=J1(i,Ea(),n?.whiteSpace,"normal");return bM(r,e,t)}function Al(i,e,t){return hm(i,e,!1,t)}function gl(i,e,t){return hm(i,e,!0,t)}function ML(i){return i}function EM(i,e,t){const n=fM(i,e);return{lineCount:n,height:n*t}}function um(i,e,t){let n=t.get(i);if(n!==void 0)return n;n=[];const s=lm();for(const r of s.segment(e[i]))n.push(r.segment);return t.set(i,n),n}function dm(i){let e=cm.get(i);return e!==void 0||(e=new Map,cm.set(i,e)),e}function _M(i,e,t,n){return n>0&&i[n-1]==="soft-hyphen"&&!(e===n&&t>0)}function yM(i,e,t,n,s,r,a){let o="";const c=_M(e,n,s,r);for(let l=n;l<r;l++)e[l]==="soft-hyphen"||e[l]==="hard-break"||(l===n&&s>0?o+=um(l,i,t).slice(s).join(""):o+=i[l]);return a>0?(c&&(o+="-"),o+=um(r,i,t).slice(n===r?s:0,a).join("")):c&&(o+="-"),o}function fm(i,e,t,n,s,r,a){return{text:yM(i.segments,i.kinds,e,n,s,r,a),width:t,start:{segmentIndex:n,graphemeIndex:s},end:{segmentIndex:r,graphemeIndex:a}}}function wM(i,e,t){return fm(i,e,t.width,t.startSegmentIndex,t.startGraphemeIndex,t.endSegmentIndex,t.endGraphemeIndex)}function vM(i){return{width:i.width,start:{segmentIndex:i.startSegmentIndex,graphemeIndex:i.startGraphemeIndex},end:{segmentIndex:i.endSegmentIndex,graphemeIndex:i.endGraphemeIndex}}}function CM(i,e){return fm(i,dm(i),e.width,e.start.segmentIndex,e.start.graphemeIndex,e.end.segmentIndex,e.end.graphemeIndex)}function SM(i,e,t){return i.widths.length===0?0:wd(i,e,n=>{t(vM(n))})}function Id(i,e){return AM(i,e)}function pm(i){let e=0;return SM(i,Number.POSITIVE_INFINITY,t=>{t.width>e&&(e=t.width)}),e}function IM(i,e,t){const n=[];if(i.widths.length===0)return{lineCount:0,height:0,lines:n};const s=dm(i),r=wd(i,e,a=>{n.push(wM(i,s,a))});return{lineCount:r,height:r*t,lines:n}}const MM=/[ \t\n\f\r]+/,Am=/^[ \t\n\f\r]+/,gm=/[ \t\n\f\r]+$/,ml={segmentIndex:0,graphemeIndex:0},mm={itemIndex:0,segmentIndex:0,graphemeIndex:0};function BL(i){return i}function Md(i){return{segmentIndex:i.segmentIndex,graphemeIndex:i.graphemeIndex}}function bm(i){return i.segmentIndex===0&&i.graphemeIndex===0}function bl(i,e){const t=e.get(i);if(t!==void 0)return t;const n=pm(gl("A A",i)),s=pm(gl("AA",i)),r=Math.max(0,n-s);return e.set(i,r),r}function BM(i){const e=Cd(i,ml,Number.POSITIVE_INFINITY);return e===null?null:{endGraphemeIndex:e.endGraphemeIndex,endSegmentIndex:e.endSegmentIndex,width:e.width}}function TM(i,e){return i===0&&e>0}function xm(i){const e=[],t=Array.from({length:i.length}),n=new Map;let s=0;for(let r=0;r<i.length;r++){const a=i[r],o=Am.test(a.text),c=gm.test(a.text),l=a.text.replace(Am,"").replace(gm,"");if(l.length===0){MM.test(a.text)&&s===0&&(s=bl(a.font,n));continue}const h=s>0?s:o?bl(a.font,n):0,u=gl(l,a.font),d=BM(u);if(d===null){s=c?bl(a.font,n):0;continue}const f={break:a.break??"normal",endGraphemeIndex:d.endGraphemeIndex,endSegmentIndex:d.endSegmentIndex,extraWidth:a.extraWidth??0,gapBefore:h,naturalWidth:d.width,prepared:u,sourceItemIndex:r};e.push(f),t[r]=f,s=c?bl(a.font,n):0}return{items:e,itemsBySourceItemIndex:t}}function RM(i,e,t,n){if(i.items.length===0||t.itemIndex>=i.items.length)return null;const s=Math.max(1,e);let r=0,a=s,o=t.itemIndex;const c={segmentIndex:t.segmentIndex,graphemeIndex:t.graphemeIndex};e:for(;o<i.items.length;){const l=i.items[o];if(!bm(c)&&c.segmentIndex===l.endSegmentIndex&&c.graphemeIndex===l.endGraphemeIndex){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}const h=r===0?0:l.gapBefore,u=bm(c);if(l.break==="never"){if(!u){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}const g=l.naturalWidth+l.extraWidth,A=h+g;if(r>0&&A>a)break e;n?.(l,h,g,Md(ml),{segmentIndex:l.endSegmentIndex,graphemeIndex:l.endGraphemeIndex}),r+=A,a=Math.max(0,s-r),o++,c.segmentIndex=0,c.graphemeIndex=0;continue}const d=h+l.extraWidth;if(r>0&&d>=a)break e;if(u){const g=d+l.naturalWidth;if(g<=a){n?.(l,h,l.naturalWidth+l.extraWidth,Md(ml),{segmentIndex:l.endSegmentIndex,graphemeIndex:l.endGraphemeIndex}),r+=g,a=Math.max(0,s-r),o++,c.segmentIndex=0,c.graphemeIndex=0;continue}}const f=Math.max(1,a-d),m=Cd(l.prepared,c,f);if(m===null){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}if(c.segmentIndex===m.endSegmentIndex&&c.graphemeIndex===m.endGraphemeIndex){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}if(r>0&&u&&h>0&&TM(m.endSegmentIndex,m.endGraphemeIndex)){const g=Cd(l.prepared,ml,Math.max(1,s-l.extraWidth));if(g!==null&&(g.endSegmentIndex>m.endSegmentIndex||g.endSegmentIndex===m.endSegmentIndex&&g.endGraphemeIndex>m.endGraphemeIndex))break e}if(n?.(l,h,m.width+l.extraWidth,Md(c),{segmentIndex:m.endSegmentIndex,graphemeIndex:m.endGraphemeIndex}),r+=h+m.width+l.extraWidth,a=Math.max(0,s-r),m.endSegmentIndex===l.endSegmentIndex&&m.endGraphemeIndex===l.endGraphemeIndex){o++,c.segmentIndex=0,c.graphemeIndex=0;continue}c.segmentIndex=m.endSegmentIndex,c.graphemeIndex=m.endGraphemeIndex;break}return r===0?null:(t.itemIndex=o,t.segmentIndex=c.segmentIndex,t.graphemeIndex=c.graphemeIndex,r)}function NM(i,e,t=mm){const n=i,s={itemIndex:t.itemIndex,segmentIndex:t.segmentIndex,graphemeIndex:t.graphemeIndex},r=[],a=RM(n,e,s,(o,c,l,h,u)=>{r.push({itemIndex:o.sourceItemIndex,gapBefore:c,occupiedWidth:l,start:h,end:u})});return a===null?null:{fragments:r,width:a,end:s}}function FM(i,e){return CM(i.prepared,{width:e.occupiedWidth-i.extraWidth,start:e.start,end:e.end}).text}function Em(i,e){const t=i;return{fragments:e.fragments.map(n=>{const s=t.itemsBySourceItemIndex[n.itemIndex];if(s===void 0)throw new Error("Missing rich-text inline item for fragment");return{...n,text:FM(s,n)}}),width:e.width,end:e.end}}function _m(i,e,t){let n=0,s=mm;for(;;){const r=NM(i,e,s);if(r===null)return n;t(r),n++,s=r.end}}const ym="500 14px Inter, sans-serif",Bd="600 10px Inter, sans-serif",Td="300 13px Inter, sans-serif",wm="600 10px Inter, sans-serif",vm="300 12px Inter, sans-serif",Mo=18,xl=16,hn=16,Li=6,Cm=12,El=Math.min(window.devicePixelRatio||1,2),DM="rgba(0, 0, 0, 0.75)",LM="rgba(255, 255, 255, 0.08)",PM="rgba(255, 255, 255, 0.9)",kM="rgba(255, 255, 255, 0.30)",UM="rgba(255, 255, 255, 0.85)",Sm="rgba(255, 255, 255, 0.08)",OM="rgba(255, 255, 255, 0.45)",QM="rgba(255, 255, 255, 0.08)",GM="rgba(255, 255, 255, 0.7)";function HM(i){let e=0,t=0,n=0;const s=new Set,r=new Set,a=new Set;let o=!1,c=!1;return i.traverse(l=>{if(l.isMesh||l.isPoints||l.isLine){n++;const h=l.geometry;h&&(h.index?t+=h.index.count/3:h.attributes.position&&(t+=h.attributes.position.count/3),h.attributes.position&&(e+=h.attributes.position.count)),l.skeleton&&(o=!0),l.morphTargetInfluences&&l.morphTargetInfluences.length>0&&(c=!0),(Array.isArray(l.material)?l.material:[l.material]).forEach(d=>{if(d){s.add(d.uuid),a.add(d.type.replace("Material",""));for(const f in d)d[f]&&d[f].isTexture&&r.add(d[f].uuid)}})}}),{vertices:e,triangles:Math.floor(t),meshes:n,materials:s.size,textures:r.size,materialTypes:Array.from(a),hasSkinning:o,hasMorphs:c}}function Bo(i){return i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"K":i.toString()}function zM(i,e){const t=[];return i.hasSkinning&&t.push("skinned"),i.hasMorphs&&t.push("morph targets"),e&&e.length>0&&t.push(`${e.length} animation${e.length>1?"s":""}`),i.materialTypes.length>0&&t.push(i.materialTypes.join(", ")),t.length>0?t.join(" · "):""}function VM(i,e,t){const n=HM(e),s=zM(n,t),r=[{label:"MESHES",value:Bo(n.meshes)},{label:"VERTICES",value:Bo(n.vertices)},{label:"TRIANGLES",value:Bo(n.triangles)},{label:"MATERIALS",value:Bo(n.materials)},{label:"TEXTURES",value:Bo(n.textures)}];t&&t.length>0&&r.push({label:"ANIMATIONS",value:t.length.toString()});const a=[];n.materialTypes.forEach(w=>a.push(w)),n.hasSkinning&&a.push("Skinned"),n.hasMorphs&&a.push("Morph"),t&&t.length>0&&a.push("Animated");const o=200,c=Al("Model Info",ym),l=EM(c,o,Mo+2),h=r.map(w=>{const S=[{text:w.label+" ",font:Bd},{text:w.value,font:Td}],T=xm(S),C=Al(w.label,Bd),v=Id(C,o),F=Al(w.value,Td),K=Id(F,o);return{...w,labelWidth:v.maxLineWidth,valueWidth:K.maxLineWidth,richPrepared:T}}),u=a.map(w=>{const S=Al(w,wm),T=Id(S,300);return{text:w,width:T.maxLineWidth+Cm}});let d=[],f=0;if(s){const w=gl(s,vm),S=IM(w,o-hn,Mo);d=S.lines,f=S.height}const m=Math.max(l.width+hn*2,...h.map(w=>w.labelWidth+w.valueWidth+hn*3)),g=Math.max(m,180);let A=0;if(u.length>0){let w=0,S=1;u.forEach(T=>{w>0&&w+T.width>g-hn*2&&(S++,w=0),w+=T.width+6}),A=S*(xl+6)+Li}const p=hn+l.height+Li+Li+h.length*(Mo+Li)+A+(f>0?Li+f:0)+hn,y=document.createElement("canvas");y.width=g*El,y.height=p*El,y.style.width=g+"px",y.style.height=p+"px";const b=y.getContext("2d");b.scale(El,El),b.fillStyle=DM,Rd(b,0,0,g,p,10),b.fill(),b.strokeStyle=LM,b.lineWidth=1,Rd(b,.5,.5,g-1,p-1,10),b.stroke();let _=hn;if(b.font=ym,b.fillStyle=PM,b.textBaseline="top",b.fillText("Model Info",hn,_),_+=l.height+Li,b.strokeStyle=Sm,b.beginPath(),b.moveTo(hn,_),b.lineTo(g-hn,_),b.stroke(),_+=Li,h.forEach(w=>{b.font=Bd,b.fillStyle=kM,b.textAlign="left",b.fillText(w.label,hn,_),b.font=Td,b.fillStyle=UM,b.textAlign="right",b.fillText(w.value,g-hn,_),b.textAlign="left",_+=Mo+Li}),u.length>0){let w=hn;u.forEach(S=>{w>hn&&w+S.width>g-hn&&(w=hn,_+=xl+6),b.fillStyle=QM,Rd(b,w,_,S.width,xl,4),b.fill(),b.font=wm,b.fillStyle=GM,b.textBaseline="top",b.fillText(S.text,w+Cm/2,_+3),w+=S.width+6}),_+=xl+Li+4}d.length>0&&(b.strokeStyle=Sm,b.beginPath(),b.moveTo(hn,_),b.lineTo(g-hn,_),b.stroke(),_+=Li,b.font=vm,b.fillStyle=OM,b.textBaseline="top",d.forEach(w=>{b.fillText(w.text,hn,_),_+=Mo}));const M=document.createElement("div");return M.classList.add("model-info"),M.appendChild(y),i.appendChild(M),{el:M,canvas:y,remove(){M.remove()}}}function Rd(i,e,t,n,s,r){i.beginPath(),i.moveTo(e+r,t),i.lineTo(e+n-r,t),i.quadraticCurveTo(e+n,t,e+n,t+r),i.lineTo(e+n,t+s-r),i.quadraticCurveTo(e+n,t+s,e+n-r,t+s),i.lineTo(e+r,t+s),i.quadraticCurveTo(e,t+s,e,t+s-r),i.lineTo(e,t+r),i.quadraticCurveTo(e,t,e+r,t),i.closePath()}const WM="500 11px Inter, sans-serif",Im="300 10px Inter, sans-serif",Nd=10,Mm=6,Bm=14,_l=Math.min(window.devicePixelRatio||1,2),qM=8;function KM(i){const e=[];return i.traverse(t=>{if(e.length>=qM||!t.isMesh||!t.name||t.name.startsWith("_"))return;const n=t.geometry,s=Array.isArray(t.material)?t.material[0]:t.material,r=n&&n.attributes.position?n.attributes.position.count:0,a=s?s.type.replace("Material",""):"",o=[{text:t.name,font:WM}];r>0&&o.push({text:" "+XM(r)+" verts",font:Im}),a&&o.push({text:" "+a,font:Im});const c=xm(o);let l=0,h=0;_m(c,300,g=>{const A=Em(c,g);l=Math.max(l,A.width),h++});const u=l+Nd*2,d=h*Bm+Mm*2;n&&n.computeBoundingBox();const f=n?n.boundingBox:null,m=new H;f?(f.getCenter(m),m.applyMatrix4(t.matrixWorld)):t.getWorldPosition(m),e.push({name:t.name,items:o,prepared:c,labelWidth:u,labelHeight:d,position:m,vertCount:r,matType:a})}),e}function jM(i){const{labelWidth:e,labelHeight:t,items:n,prepared:s}=i,r=document.createElement("canvas");r.width=e*_l,r.height=t*_l,r.style.width=e+"px",r.style.height=t+"px";const a=r.getContext("2d");a.scale(_l,_l),a.fillStyle="rgba(0, 0, 0, 0.8)",Tm(a,0,0,e,t,6),a.fill(),a.strokeStyle="rgba(255, 255, 255, 0.1)",a.lineWidth=1,Tm(a,.5,.5,e-1,t-1,6),a.stroke(),a.textBaseline="top";let o=Mm;return _m(s,e-Nd*2,c=>{const l=Em(s,c);let h=Nd;l.fragments.forEach(u=>{h+=u.gapBefore;const d=n[u.itemIndex];a.font=d.font,a.fillStyle=u.itemIndex===0?"rgba(255, 255, 255, 0.9)":"rgba(255, 255, 255, 0.45)",a.fillText(u.text,h,o),h+=u.occupiedWidth}),o+=Bm}),r}function XM(i){return i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"K":i.toString()}function Tm(i,e,t,n,s,r){i.beginPath(),i.moveTo(e+r,t),i.lineTo(e+n-r,t),i.quadraticCurveTo(e+n,t,e+n,t+r),i.lineTo(e+n,t+s-r),i.quadraticCurveTo(e+n,t+s,e+n-r,t+s),i.lineTo(e+r,t+s),i.quadraticCurveTo(e,t+s,e,t+s-r),i.lineTo(e,t+r),i.quadraticCurveTo(e,t,e+r,t),i.closePath()}const Fd=new WeakMap;class YM extends Zi{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,s){const r=new Bs(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,a=>{this.parse(a,t,s)},n,s)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,Kt,n).catch(n)}decodeDracoFile(e,t,n,s,r=rn,a=()=>{}){const o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:r};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Fd.has(e)){const c=Fd.get(e);if(c.key===n)return c.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const r=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(r,a).then(c=>(s=c,new Promise((l,h)=>{s._callbacks[r]={resolve:l,reject:h},s.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return o.catch(()=>!0).then(()=>{s&&r&&this._releaseTask(s,r)}),Fd.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new On;e.index&&t.setIndex(new En(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const s=e.attributes[n],r=s.name,a=s.array,o=s.itemSize,c=new En(a,o);r==="color"&&(this._assignVertexColorSpace(c,s.vertexColorSpace),c.normalized=!(a instanceof Float32Array)),t.setAttribute(r,c)}return t}_assignVertexColorSpace(e,t){if(t!==Kt)return;const n=new qe;for(let s=0,r=e.count;s<r;s++)n.fromBufferAttribute(e,s),At.toWorkingColorSpace(n,Kt),e.setXYZ(s,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new Bs(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((s,r)=>{n.load(e,s,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];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 s=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const r=JM.toString(),a=["/* draco decoder */",s,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`+`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(r){const a=r.data;switch(a.type){case"decode":s._callbacks[a.id].resolve(a);break;case"error":s._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,r){return s._taskLoad>r._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function JM(){let i,e;onmessage=function(a){const o=a.data;switch(o.type){case"init":i=o.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":const c=o.buffer,l=o.taskConfig;e.then(h=>{const u=h.draco,d=new u.Decoder;try{const f=t(u,d,new Int8Array(c),l),m=f.attributes.map(g=>g.array.buffer);f.index&&m.push(f.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:f},m)}catch(f){console.error(f),self.postMessage({type:"error",id:o.id,error:f.message})}finally{u.destroy(d)}});break}};function t(a,o,c,l){const h=l.attributeIDs,u=l.attributeTypes;let d,f;const m=o.GetEncodedGeometryType(c);if(m===a.TRIANGULAR_MESH)d=new a.Mesh,f=o.DecodeArrayToMesh(c,c.byteLength,d);else if(m===a.POINT_CLOUD)d=new a.PointCloud,f=o.DecodeArrayToPointCloud(c,c.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:[]};for(const A in h){const p=self[u[A]];let y,b;if(l.useUniqueIDs)b=h[A],y=o.GetAttributeByUniqueId(d,b);else{if(b=o.GetAttributeId(d,a[h[A]]),b===-1)continue;y=o.GetAttribute(d,b)}const _=s(a,o,d,A,p,y);A==="color"&&(_.vertexColorSpace=l.vertexColorSpace),g.attributes.push(_)}return m===a.TRIANGULAR_MESH&&(g.index=n(a,o,d)),a.destroy(d),g}function n(a,o,c){const h=c.num_faces()*3,u=h*4,d=a._malloc(u);o.GetTrianglesUInt32Array(c,u,d);const f=new Uint32Array(a.HEAPF32.buffer,d,h).slice();return a._free(d),{array:f,itemSize:1}}function s(a,o,c,l,h,u){const d=u.num_components(),m=c.num_points()*d,g=m*h.BYTES_PER_ELEMENT,A=r(a,h),p=a._malloc(g);o.GetAttributeDataArrayForAllPoints(c,u,A,g,p);const y=new h(a.HEAPF32.buffer,p,m).slice();return a._free(p),{name:l,array:y,itemSize:d}}function r(a,o){switch(o){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class ZM{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:s,msg:r,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(r,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=n,this.workers[s].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const $M=0,Rm=2,eB=1,Nm=2,tB=0,nB=1,iB=10,sB=0,Fm=9,Dm=15,Lm=16,Pm=22,km=37,Um=43,Om=76,Qm=83,Gm=97,Hm=100,zm=103,Vm=109,Wm=165,qm=166,Dd=1000066e3;class rB{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class To{constructor(e,t,n,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){t===void 0&&(t=0);const n=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,s)}}const Nn=[171,75,84,88,32,50,48,187,13,10,26,10];function Km(i){return new TextDecoder().decode(i)}function aB(i){const e=new Uint8Array(i.buffer,i.byteOffset,Nn.length);if(e[0]!==Nn[0]||e[1]!==Nn[1]||e[2]!==Nn[2]||e[3]!==Nn[3]||e[4]!==Nn[4]||e[5]!==Nn[5]||e[6]!==Nn[6]||e[7]!==Nn[7]||e[8]!==Nn[8]||e[9]!==Nn[9]||e[10]!==Nn[10]||e[11]!==Nn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new rB,n=17*Uint32Array.BYTES_PER_ELEMENT,s=new To(i,Nn.length,n,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32();const r=s._nextUint32();t.supercompressionScheme=s._nextUint32();const a=s._nextUint32(),o=s._nextUint32(),c=s._nextUint32(),l=s._nextUint32(),h=s._nextUint64(),u=s._nextUint64(),d=new To(i,Nn.length+n,3*r*8,!0);for(let Y=0;Y<r;Y++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const f=new To(i,a,o,!0),m={vendorId:f._skip(4)._nextUint16(),descriptorType:f._nextUint16(),versionNumber:f._nextUint16(),descriptorBlockSize:f._nextUint16(),colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},g=(m.descriptorBlockSize/4-6)/4;for(let Y=0;Y<g;Y++){const Q={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&Q.channelType?(Q.sampleLower=f._nextInt32(),Q.sampleUpper=f._nextInt32()):(Q.sampleLower=f._nextUint32(),Q.sampleUpper=f._nextUint32()),m.samples[Y]=Q}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(m);const A=new To(i,c,l,!0);for(;A._offset<l;){const Y=A._nextUint32(),Q=A._scan(Y),J=Km(Q);if(t.keyValue[J]=A._nextUint8Array(Y-Q.byteLength-1),J.match(/^ktx/i)){const ee=Km(t.keyValue[J]);t.keyValue[J]=ee.substring(0,ee.lastIndexOf("\0"))}A._skip(Y%4?4-Y%4:0)}if(u<=0)return t;const p=new To(i,h,u,!0),y=p._nextUint16(),b=p._nextUint16(),_=p._nextUint32(),M=p._nextUint32(),w=p._nextUint32(),S=p._nextUint32(),T=[];for(let Y=0;Y<r;Y++)T.push({imageFlags:p._nextUint32(),rgbSliceByteOffset:p._nextUint32(),rgbSliceByteLength:p._nextUint32(),alphaSliceByteOffset:p._nextUint32(),alphaSliceByteLength:p._nextUint32()});const C=h+p._offset,v=C+_,F=v+M,K=F+w,q=new Uint8Array(i.buffer,i.byteOffset+C,_),$=new Uint8Array(i.buffer,i.byteOffset+v,M),D=new Uint8Array(i.buffer,i.byteOffset+F,w),O=new Uint8Array(i.buffer,i.byteOffset+K,S);return t.globalData={endpointCount:y,selectorCount:b,imageDescs:T,endpointsData:q,selectorsData:$,tablesData:D,extendedData:O},t}let Ld,ts,Pd;const kd={env:{emscripten_notify_memory_growth:function(i){Pd=new Uint8Array(ts.exports.memory.buffer)}}};class oB{init(){return Ld||(Ld=typeof fetch<"u"?fetch("data:application/wasm;base64,"+jm).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,kd)).then(this._init):WebAssembly.instantiate(Buffer.from(jm,"base64"),kd).then(this._init),Ld)}_init(e){ts=e.instance,kd.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!ts)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,s=ts.exports.malloc(n);Pd.set(e,s),t=t||Number(ts.exports.ZSTD_findDecompressedSize(s,n));const r=ts.exports.malloc(t),a=ts.exports.ZSTD_decompress(r,t,s,n),o=Pd.slice(r,r+a);return ts.exports.free(s),ts.exports.free(r),o}}const jm="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn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CCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpB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GBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQ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FwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiAD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akMap;let Od=0,Qd;class ti extends Zi{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ZM,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new Bs(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Bs(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const s=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([r,a])=>{const o=ti.BasisWorker.toString(),c=["/* constants */","let _EngineFormat = "+JSON.stringify(ti.EngineFormat),"let _EngineType = "+JSON.stringify(ti.EngineType),"let _TranscoderFormat = "+JSON.stringify(ti.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(ti.BasisFormat),"/* basis_transcoder.js */",r,"/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`+`);this.workerSourceURL=URL.createObjectURL(new Blob([c])),this.transcoderBinary=a,this.workerPool.setWorkerCreator(()=>{const l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),Od>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Od++}return this.transcoderPending}load(e,t,n,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const r=new Bs(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,a=>{this.parse(a,t,s)},n,s)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Ud.has(e))return Ud.get(e).promise.then(t).catch(n);this._createTexture(e).then(s=>t?t(s):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:s,data:{faces:r,width:a,height:o,format:c,type:l,dfdFlags:h}}=e;if(n==="error")return Promise.reject(s);let u;if(t.faceCount===6)u=new iy(r,c,l);else{const d=r[0].mipmaps;u=t.layerCount>1?new ny(d,a,o,t.layerCount,c,l):new Yc(d,a,o,c,l)}return u.minFilter=r[0].mipmaps.length===1?zt:Jn,u.magFilter=zt,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=Xm(t),u.premultiplyAlpha=!!(h&eB),u}async _createTexture(e,t={}){const n=aB(new Uint8Array(e)),s=n.vkFormat===Dd&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===sB||s&&!this.workerConfig.astcHDRSupported))return uB(n);const a=t,o=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:a},[e])).then(c=>this._createTextureFrom(c.data,n));return Ud.set(e,{promise:o}),o}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Od--}}ti.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},ti.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},ti.EngineFormat={RGBAFormat:sn,RGBA_ASTC_4x4_Format:Ja,RGB_BPTC_UNSIGNED_Format:bc,RGBA_BPTC_Format:$a,RGBA_ETC2_EAC_Format:mc,RGBA_PVRTC_4BPPV1_Format:pc,RGBA_S3TC_DXT5_Format:Ya,RGB_ETC1_Format:Ac,RGB_ETC2_Format:gc,RGB_PVRTC_4BPPV1_Format:fc,RGBA_S3TC_DXT1_Format:Xa},ti.EngineType={UnsignedByteType:tn,HalfFloatType:Mn,FloatType:nn},ti.BasisWorker=function(){let i,e,t;const n=_EngineFormat,s=_EngineType,r=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(m){const g=m.data;switch(g.type){case"init":i=g.config,o(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:A,buffers:p,width:y,height:b,hasAlpha:_,format:M,type:w,dfdFlags:S}=c(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:A,width:y,height:b,hasAlpha:_,format:M,type:w,dfdFlags:S}},p)}catch(A){console.error(A),self.postMessage({type:"error",id:g.id,error:A.message})}});break}});function o(m){e=new Promise(g=>{t={wasmBinary:m,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(m){const g=new t.KTX2File(new Uint8Array(m));function A(){g.close(),g.delete()}if(!g.isValid())throw A(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let p;if(g.isUASTC())p=a.UASTC;else if(g.isETC1S())p=a.ETC1S;else if(g.isHDR())p=a.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const y=g.getWidth(),b=g.getHeight(),_=g.getLayers()||1,M=g.getLevels(),w=g.getFaces(),S=g.getHasAlpha(),T=g.getDFDFlags(),{transcoderFormat:C,engineFormat:v,engineType:F}=u(p,y,b,S);if(!y||!b||!M)throw A(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw A(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],q=[];for(let $=0;$<w;$++){const D=[];for(let O=0;O<M;O++){const Y=[];let Q,J;for(let ae=0;ae<_;ae++){const ye=g.getImageLevelInfo(O,ae,$);$===0&&O===0&&ae===0&&(ye.origWidth%4!==0||ye.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),M>1?(Q=ye.origWidth,J=ye.origHeight):(Q=ye.width,J=ye.height);let Me=new Uint8Array(g.getImageTranscodedSizeInBytes(O,ae,0,C));const se=g.transcodeImage(Me,O,ae,$,C,0,-1,-1);if(F===s.HalfFloatType&&(Me=new Uint16Array(Me.buffer,Me.byteOffset,Me.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!se)throw A(),new Error("THREE.KTX2Loader: .transcodeImage failed.");Y.push(Me)}const ee=f(Y);D.push({data:ee,width:Q,height:J}),q.push(ee.buffer)}K.push({mipmaps:D,width:y,height:b,format:v,type:F})}return A(),{faces:K,buffers:q,width:y,height:b,hasAlpha:S,dfdFlags:T,format:v,type:F}}const l=[{if:"astcSupported",basisFormat:[a.UASTC],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.BC1,r.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[a.UASTC_HDR],transcoderFormat:[r.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[r.RGBA32,r.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[a.UASTC_HDR],transcoderFormat:[r.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[a.ETC1S]:l.filter(m=>m.basisFormat.includes(a.ETC1S)).sort((m,g)=>m.priorityUASTC-g.priorityUASTC),[a.UASTC]:l.filter(m=>m.basisFormat.includes(a.UASTC)).sort((m,g)=>m.priorityUASTC-g.priorityUASTC),[a.UASTC_HDR]:l.filter(m=>m.basisFormat.includes(a.UASTC_HDR)).sort((m,g)=>m.priorityHDR-g.priorityHDR)};function u(m,g,A,p){const y=h[m];for(let b=0;b<y.length;b++){const _=y[b];if(_.if&&!i[_.if]||!_.basisFormat.includes(m)||p&&_.transcoderFormat.length<2||_.needsPowerOfTwo&&!(d(g)&&d(A)))continue;const M=_.transcoderFormat[p?1:0],w=_.engineFormat[p?1:0],S=_.engineType[0];return{transcoderFormat:M,engineFormat:w,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(m){return m<=2?!0:(m&m-1)===0&&m!==0}function f(m){if(m.length===1)return m[0];let g=0;for(let y=0;y<m.length;y++){const b=m[y];g+=b.byteLength}const A=new Uint8Array(g);let p=0;for(let y=0;y<m.length;y++){const b=m[y];A.set(b,p),p+=b.byteLength}return A}};const hB=new Set([sn,Js,Hi]),Gd={[Vm]:sn,[Gm]:sn,[km]:sn,[Um]:sn,[zm]:Js,[Qm]:Js,[Lm]:Js,[Pm]:Js,[Hm]:Hi,[Om]:Hi,[Dm]:Hi,[Fm]:Hi,[Dd]:Ja,[qm]:Za,[Wm]:Za},Hd={[Vm]:nn,[Gm]:Mn,[km]:tn,[Um]:tn,[zm]:nn,[Qm]:Mn,[Lm]:tn,[Pm]:tn,[Hm]:nn,[Om]:Mn,[Dm]:tn,[Fm]:tn,[Dd]:Mn,[qm]:tn,[Wm]:tn};async function uB(i){const{vkFormat:e}=i;if(Gd[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;i.supercompressionScheme===Rm&&(Qd||(Qd=new Promise(async r=>{const a=new oB;await a.init(),r(a)})),t=await Qd);const n=[];for(let r=0;r<i.levels.length;r++){const a=Math.max(1,i.pixelWidth>>r),o=Math.max(1,i.pixelHeight>>r),c=i.pixelDepth?Math.max(1,i.pixelDepth>>r):0,l=i.levels[r];let h;if(i.supercompressionScheme===$M)h=l.levelData;else if(i.supercompressionScheme===Rm)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;Hd[e]===nn?u=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):Hd[e]===Mn?u=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):u=h,n.push({data:u,width:a,height:o,depth:c})}let s;if(hB.has(Gd[e]))s=i.pixelDepth===0?new Qc(n[0].data,i.pixelWidth,i.pixelHeight):new Op(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth);else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new Yc(n,i.pixelWidth,i.pixelHeight),s.minFilter=n.length===1?zt:Jn,s.magFilter=zt}return s.mipmaps=n,s.type=Hd[e],s.format=Gd[e],s.colorSpace=Xm(i),s.needsUpdate=!0,Promise.resolve(s)}function Xm(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===nB?e.transferFunction===Nm?Kt:rn:e.colorPrimaries===iB?e.transferFunction===Nm?cB:lB:(e.colorPrimaries===tB||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),ci)}const yl="[default]",zd={ASSET_GENERATOR:"assetgenerator"},wl=new BA,Ym="https://unpkg.com/[email protected]",dB=new YM(wl).setDecoderPath(`${Ym}/examples/jsm/libs/draco/gltf/`),fB=new ti(wl).setTranscoderPath(`${Ym}/examples/jsm/libs/basis/`);function Jm(i,e){const t=new Set;i.traverse(n=>{if(!n.geometry)return;(Array.isArray(n.material)?n.material:[n.material]).forEach(r=>{r&&!t.has(r.uuid)&&(t.add(r.uuid),e(r))})})}function pB(i){const{state:e,options:t}=i;if(t.preset===zd.ASSET_GENERATOR){const r=new by;r.name="hemi_light",i.scene.add(r),i.lights.push(r);return}const n=new wy(e.ambientColor,e.ambientIntensity);n.name="ambient_light",i.defaultCamera.add(n);const s=new DA(e.directColor,e.directIntensity);s.position.set(.5,0,.866),s.name="main_light",i.defaultCamera.add(s),i.lights.push(n,s)}function AB(i){i.lights.forEach(e=>e.parent.remove(e)),i.lights.length=0}var ni=Uint8Array,_a=Uint16Array,gB=Int32Array,Zm=new ni([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,0,0,0]),$m=new ni([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]),mB=new ni([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e0=function(i,e){for(var t=new _a(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var s=new gB(t[30]),n=1;n<30;++n)for(var r=t[n];r<t[n+1];++r)s[r]=r-t[n]<<5|n;return{b:t,r:s}},t0=e0(Zm,2),n0=t0.b,bB=t0.r;n0[28]=258,bB[258]=28;for(var xB=e0($m,0),EB=xB.b,Vd=new _a(32768),kt=0;kt<32768;++kt){var Ps=(kt&43690)>>1|(kt&21845)<<1;Ps=(Ps&52428)>>2|(Ps&13107)<<2,Ps=(Ps&61680)>>4|(Ps&3855)<<4,Vd[kt]=((Ps&65280)>>8|(Ps&255)<<8)>>1}for(var Ro=(function(i,e,t){for(var n=i.length,s=0,r=new _a(e);s<n;++s)i[s]&&++r[i[s]-1];var a=new _a(e);for(s=1;s<e;++s)a[s]=a[s-1]+r[s-1]<<1;var o;if(t){o=new _a(1<<e);var c=15-e;for(s=0;s<n;++s)if(i[s])for(var l=s<<4|i[s],h=e-i[s],u=a[i[s]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)o[Vd[u]>>c]=l}else for(o=new _a(n),s=0;s<n;++s)i[s]&&(o[s]=Vd[a[i[s]-1]++]>>15-i[s]);return o}),No=new ni(288),kt=0;kt<144;++kt)No[kt]=8;for(var kt=144;kt<256;++kt)No[kt]=9;for(var kt=256;kt<280;++kt)No[kt]=7;for(var kt=280;kt<288;++kt)No[kt]=8;for(var i0=new ni(32),kt=0;kt<32;++kt)i0[kt]=5;var _B=Ro(No,9,1),yB=Ro(i0,5,1),Wd=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},bi=function(i,e,t){var n=e/8|0;return(i[n]|i[n+1]<<8)>>(e&7)&t},qd=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},wB=function(i){return(i+7)/8|0},vB=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new ni(i.subarray(e,t))},CB=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],xi=function(i,e,t){var n=new Error(e||CB[i]);if(n.code=i,Error.captureStackTrace&&Error.captureStackTrace(n,xi),!t)throw n;return n},SB=function(i,e,t,n){var s=i.length,r=0;if(!s||e.f&&!e.l)return t||new ni(0);var a=!t,o=a||e.i!=2,c=e.i;a&&(t=new ni(s*3));var l=function(St){var ut=t.length;if(St>ut){var Je=new ni(Math.max(ut*2,St));Je.set(t),t=Je}},h=e.f||0,u=e.p||0,d=e.b||0,f=e.l,m=e.d,g=e.m,A=e.n,p=s*8;do{if(!f){h=bi(i,u,1);var y=bi(i,u+1,3);if(u+=3,y)if(y==1)f=_B,m=yB,g=9,A=5;else if(y==2){var w=bi(i,u,31)+257,S=bi(i,u+10,15)+4,T=w+bi(i,u+5,31)+1;u+=14;for(var C=new ni(T),v=new ni(19),F=0;F<S;++F)v[mB[F]]=bi(i,u+F*3,7);u+=S*3;for(var K=Wd(v),q=(1<<K)-1,$=Ro(v,K,1),F=0;F<T;){var D=$[bi(i,u,q)];u+=D&15;var b=D>>4;if(b<16)C[F++]=b;else{var O=0,Y=0;for(b==16?(Y=3+bi(i,u,3),u+=2,O=C[F-1]):b==17?(Y=3+bi(i,u,7),u+=3):b==18&&(Y=11+bi(i,u,127),u+=7);Y--;)C[F++]=O}}var Q=C.subarray(0,w),J=C.subarray(w);g=Wd(Q),A=Wd(J),f=Ro(Q,g,1),m=Ro(J,A,1)}else xi(1);else{var b=wB(u)+4,_=i[b-4]|i[b-3]<<8,M=b+_;if(M>s){c&&xi(0);break}o&&l(d+_),t.set(i.subarray(b,M),d),e.b=d+=_,e.p=u=M*8,e.f=h;continue}if(u>p){c&&xi(0);break}}o&&l(d+131072);for(var ee=(1<<g)-1,ae=(1<<A)-1,ye=u;;ye=u){var O=f[qd(i,u)&ee],Me=O>>4;if(u+=O&15,u>p){c&&xi(0);break}if(O||xi(2),Me<256)t[d++]=Me;else if(Me==256){ye=u,f=null;break}else{var se=Me-254;if(Me>264){var F=Me-257,me=Zm[F];se=bi(i,u,(1<<me)-1)+n0[F],u+=me}var be=m[qd(i,u)&ae],xe=be>>4;be||xi(3),u+=be&15;var J=EB[xe];if(xe>3){var me=$m[xe];J+=qd(i,u)&(1<<me)-1,u+=me}if(u>p){c&&xi(0);break}o&&l(d+131072);var Pe=d+se;if(d<J){var $e=r-J,Qe=Math.min(J,Pe);for($e+d<0&&xi(3);d<Qe;++d)t[d]=n[$e+d]}for(;d<Pe;++d)t[d]=t[d-J]}}e.l=f,e.p=ye,e.b=d,e.f=h,f&&(h=1,e.m=g,e.d=m,e.n=A)}while(!h);return d!=t.length&&a?vB(t,0,d):t.subarray(0,d)},IB=new ni(0),MB=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&xi(6,"invalid zlib data"),(i[1]>>5&1)==1&&xi(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function vl(i,e){return SB(i.subarray(MB(i),-4),{i:2},e,e)}var BB=typeof TextDecoder<"u"&&new TextDecoder,TB=0;try{BB.decode(IB,{stream:!0}),TB=1}catch{}class RB extends gy{constructor(e){super(e),this.type=Mn}parse(e){const C=Math.pow(2.7182818,2.2);function v(x,B){let k=0;for(let R=0;R<65536;++R)(R==0||x[R>>3]&1<<(R&7))&&(B[k++]=R);const E=k-1;for(;k<65536;)B[k++]=0;return E}function F(x){for(let B=0;B<16384;B++)x[B]={},x[B].len=0,x[B].lit=0,x[B].p=null}const K={l:0,c:0,lc:0};function q(x,B,k,E,R){for(;k<x;)B=B<<8|Te(E,R),k+=8;k-=x,K.l=B>>k&(1<<x)-1,K.c=B,K.lc=k}const $=new Array(59);function D(x){for(let k=0;k<=58;++k)$[k]=0;for(let k=0;k<65537;++k)$[x[k]]+=1;let B=0;for(let k=58;k>0;--k){const E=B+$[k]>>1;$[k]=B,B=E}for(let k=0;k<65537;++k){const E=x[k];E>0&&(x[k]=E|$[E]++<<6)}}function O(x,B,k,E,R,N){const U=B;let P=0,z=0;for(;E<=R;E++){if(U.value-B.value>k)return!1;q(6,P,z,x,U);const j=K.l;if(P=K.c,z=K.lc,N[E]=j,j==63){if(U.value-B.value>k)throw new Error("Something wrong with hufUnpackEncTable");q(8,P,z,x,U);let X=K.l+6;if(P=K.c,z=K.lc,E+X>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;X--;)N[E++]=0;E--}else if(j>=59){let X=j-59+2;if(E+X>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;X--;)N[E++]=0;E--}}D(N)}function Y(x){return x&63}function Q(x){return x>>6}function J(x,B,k,E){for(;B<=k;B++){const R=Q(x[B]),N=Y(x[B]);if(R>>N)throw new Error("Invalid table entry");if(N>14){const U=E[R>>N-14];if(U.len)throw new Error("Invalid table entry");if(U.lit++,U.p){const P=U.p;U.p=new Array(U.lit);for(let z=0;z<U.lit-1;++z)U.p[z]=P[z]}else U.p=new Array(1);U.p[U.lit-1]=B}else if(N){let U=0;for(let P=1<<14-N;P>0;P--){const z=E[(R<<14-N)+U];if(z.len||z.p)throw new Error("Invalid table entry");z.len=N,z.lit=B,U++}}}return!0}const ee={c:0,lc:0};function ae(x,B,k,E){x=x<<8|Te(k,E),B+=8,ee.c=x,ee.lc=B}const ye={c:0,lc:0};function Me(x,B,k,E,R,N,U,P,z){if(x==B){E<8&&(ae(k,E,R,N),k=ee.c,E=ee.lc),E-=8;let j=k>>E;if(j=new Uint8Array([j])[0],P.value+j>z)return!1;const X=U[P.value-1];for(;j-- >0;)U[P.value++]=X}else if(P.value<z)U[P.value++]=x;else return!1;ye.c=k,ye.lc=E}function se(x){return x&65535}function me(x){const B=se(x);return B>32767?B-65536:B}const be={a:0,b:0};function xe(x,B){const k=me(x),R=me(B),N=k+(R&1)+(R>>1),U=N,P=N-R;be.a=U,be.b=P}function Pe(x,B){const k=se(x),E=se(B),R=k-(E>>1)&65535,N=E+R-32768&65535;be.a=N,be.b=R}function $e(x,B,k,E,R,N,U){const P=U<16384,z=k>R?R:k;let j=1,X,ie;for(;j<=z;)j<<=1;for(j>>=1,X=j,j>>=1;j>=1;){ie=0;const he=ie+N*(R-X),ce=N*j,fe=N*X,ge=E*j,_e=E*X;let De,Ke,He,Fe;for(;ie<=he;ie+=fe){let st=ie;const Le=ie+E*(k-X);for(;st<=Le;st+=_e){const wt=st+ge,un=st+ce,Et=un+ge;P?(xe(x[st+B],x[un+B]),De=be.a,He=be.b,xe(x[wt+B],x[Et+B]),Ke=be.a,Fe=be.b,xe(De,Ke),x[st+B]=be.a,x[wt+B]=be.b,xe(He,Fe),x[un+B]=be.a,x[Et+B]=be.b):(Pe(x[st+B],x[un+B]),De=be.a,He=be.b,Pe(x[wt+B],x[Et+B]),Ke=be.a,Fe=be.b,Pe(De,Ke),x[st+B]=be.a,x[wt+B]=be.b,Pe(He,Fe),x[un+B]=be.a,x[Et+B]=be.b)}if(k&j){const wt=st+ce;P?xe(x[st+B],x[wt+B]):Pe(x[st+B],x[wt+B]),De=be.a,x[wt+B]=be.b,x[st+B]=De}}if(R&j){let st=ie;const Le=ie+E*(k-X);for(;st<=Le;st+=_e){const wt=st+ge;P?xe(x[st+B],x[wt+B]):Pe(x[st+B],x[wt+B]),De=be.a,x[wt+B]=be.b,x[st+B]=De}}X=j,j>>=1}return ie}function Qe(x,B,k,E,R,N,U,P,z){let j=0,X=0;const ie=U,he=Math.trunc(E.value+(R+7)/8);for(;E.value<he;)for(ae(j,X,k,E),j=ee.c,X=ee.lc;X>=14;){const fe=j>>X-14&16383,ge=B[fe];if(ge.len)X-=ge.len,Me(ge.lit,N,j,X,k,E,P,z,ie),j=ye.c,X=ye.lc;else{if(!ge.p)throw new Error("hufDecode issues");let _e;for(_e=0;_e<ge.lit;_e++){const De=Y(x[ge.p[_e]]);for(;X<De&&E.value<he;)ae(j,X,k,E),j=ee.c,X=ee.lc;if(X>=De&&Q(x[ge.p[_e]])==(j>>X-De&(1<<De)-1)){X-=De,Me(ge.p[_e],N,j,X,k,E,P,z,ie),j=ye.c,X=ye.lc;break}}if(_e==ge.lit)throw new Error("hufDecode issues")}}const ce=8-R&7;for(j>>=ce,X-=ce;X>0;){const fe=B[j<<14-X&16383];if(fe.len)X-=fe.len,Me(fe.lit,N,j,X,k,E,P,z,ie),j=ye.c,X=ye.lc;else throw new Error("hufDecode issues")}return!0}function St(x,B,k,E,R,N){const U={value:0},P=k.value,z=Oe(B,k),j=Oe(B,k);k.value+=4;const X=Oe(B,k);if(k.value+=4,z<0||z>=65537||j<0||j>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const ie=new Array(65537),he=new Array(16384);F(he);const ce=E-(k.value-P);if(O(x,k,ce,z,j,ie),X>8*(E-(k.value-P)))throw new Error("Something wrong with hufUncompress");J(ie,z,j,he),Qe(ie,he,x,k,X,j,N,R,U)}function ut(x,B,k){for(let E=0;E<k;++E)B[E]=x[B[E]]}function Je(x){for(let B=1;B<x.length;B++){const k=x[B-1]+x[B]-128;x[B]=k}}function G(x,B){let k=0,E=Math.floor((x.length+1)/2),R=0;const N=x.length-1;for(;!(R>N||(B[R++]=x[k++],R>N));)B[R++]=x[E++]}function mn(x){let B=x.byteLength;const k=new Array;let E=0;const R=new DataView(x);for(;B>0;){const N=R.getInt8(E++);if(N<0){const U=-N;B-=U+1;for(let P=0;P<U;P++)k.push(R.getUint8(E++))}else{const U=N;B-=2;const P=R.getUint8(E++);for(let z=0;z<U+1;z++)k.push(P)}}return k}function dt(x,B,k,E,R,N){let U=new DataView(N.buffer);const P=k[x.idx[0]].width,z=k[x.idx[0]].height,j=3,X=Math.floor(P/8),ie=Math.ceil(P/8),he=Math.ceil(z/8),ce=P-(ie-1)*8,fe=z-(he-1)*8,ge={value:0},_e=new Array(j),De=new Array(j),Ke=new Array(j),He=new Array(j),Fe=new Array(j);for(let Le=0;Le<j;++Le)Fe[Le]=B[x.idx[Le]],_e[Le]=Le<1?0:_e[Le-1]+ie*he,De[Le]=new Float32Array(64),Ke[Le]=new Uint16Array(64),He[Le]=new Uint16Array(ie*64);for(let Le=0;Le<he;++Le){let wt=8;Le==he-1&&(wt=fe);let un=8;for(let bt=0;bt<ie;++bt){bt==ie-1&&(un=ce);for(let je=0;je<j;++je)Ke[je].fill(0),Ke[je][0]=R[_e[je]++],pt(ge,E,Ke[je]),ze(Ke[je],De[je]),Rt(De[je]);Ge(De);for(let je=0;je<j;++je)L(De[je],He[je],bt*64)}let Et=0;for(let bt=0;bt<j;++bt){const je=k[x.idx[bt]].type;for(let qt=8*Le;qt<8*Le+wt;++qt){Et=Fe[bt][qt];for(let xn=0;xn<X;++xn){const Lt=xn*64+(qt&7)*8;U.setUint16(Et+0*je,He[bt][Lt+0],!0),U.setUint16(Et+2*je,He[bt][Lt+1],!0),U.setUint16(Et+4*je,He[bt][Lt+2],!0),U.setUint16(Et+6*je,He[bt][Lt+3],!0),U.setUint16(Et+8*je,He[bt][Lt+4],!0),U.setUint16(Et+10*je,He[bt][Lt+5],!0),U.setUint16(Et+12*je,He[bt][Lt+6],!0),U.setUint16(Et+14*je,He[bt][Lt+7],!0),Et+=16*je}}if(X!=ie)for(let qt=8*Le;qt<8*Le+wt;++qt){const xn=Fe[bt][qt]+8*X*2*je,Lt=X*64+(qt&7)*8;for(let dn=0;dn<un;++dn)U.setUint16(xn+dn*2*je,He[bt][Lt+dn],!0)}}}const st=new Uint16Array(P);U=new DataView(N.buffer);for(let Le=0;Le<j;++Le){k[x.idx[Le]].decoded=!0;const wt=k[x.idx[Le]].type;if(k[Le].type==2)for(let un=0;un<z;++un){const Et=Fe[Le][un];for(let bt=0;bt<P;++bt)st[bt]=U.getUint16(Et+bt*2*wt,!0);for(let bt=0;bt<P;++bt)U.setFloat32(Et+bt*2*wt,ne(st[bt]),!0)}}}function pt(x,B,k){let E,R=1;for(;R<64;)E=B[x.value],E==65280?R=64:E>>8==255?R+=E&255:(k[R]=E,R++),x.value++}function ze(x,B){B[0]=ne(x[0]),B[1]=ne(x[1]),B[2]=ne(x[5]),B[3]=ne(x[6]),B[4]=ne(x[14]),B[5]=ne(x[15]),B[6]=ne(x[27]),B[7]=ne(x[28]),B[8]=ne(x[2]),B[9]=ne(x[4]),B[10]=ne(x[7]),B[11]=ne(x[13]),B[12]=ne(x[16]),B[13]=ne(x[26]),B[14]=ne(x[29]),B[15]=ne(x[42]),B[16]=ne(x[3]),B[17]=ne(x[8]),B[18]=ne(x[12]),B[19]=ne(x[17]),B[20]=ne(x[25]),B[21]=ne(x[30]),B[22]=ne(x[41]),B[23]=ne(x[43]),B[24]=ne(x[9]),B[25]=ne(x[11]),B[26]=ne(x[18]),B[27]=ne(x[24]),B[28]=ne(x[31]),B[29]=ne(x[40]),B[30]=ne(x[44]),B[31]=ne(x[53]),B[32]=ne(x[10]),B[33]=ne(x[19]),B[34]=ne(x[23]),B[35]=ne(x[32]),B[36]=ne(x[39]),B[37]=ne(x[45]),B[38]=ne(x[52]),B[39]=ne(x[54]),B[40]=ne(x[20]),B[41]=ne(x[22]),B[42]=ne(x[33]),B[43]=ne(x[38]),B[44]=ne(x[46]),B[45]=ne(x[51]),B[46]=ne(x[55]),B[47]=ne(x[60]),B[48]=ne(x[21]),B[49]=ne(x[34]),B[50]=ne(x[37]),B[51]=ne(x[47]),B[52]=ne(x[50]),B[53]=ne(x[56]),B[54]=ne(x[59]),B[55]=ne(x[61]),B[56]=ne(x[35]),B[57]=ne(x[36]),B[58]=ne(x[48]),B[59]=ne(x[49]),B[60]=ne(x[57]),B[61]=ne(x[58]),B[62]=ne(x[62]),B[63]=ne(x[63])}function Rt(x){const B=.5*Math.cos(.7853975),k=.5*Math.cos(3.14159/16),E=.5*Math.cos(3.14159/8),R=.5*Math.cos(3*3.14159/16),N=.5*Math.cos(5*3.14159/16),U=.5*Math.cos(3*3.14159/8),P=.5*Math.cos(7*3.14159/16),z=new Array(4),j=new Array(4),X=new Array(4),ie=new Array(4);for(let he=0;he<8;++he){const ce=he*8;z[0]=E*x[ce+2],z[1]=U*x[ce+2],z[2]=E*x[ce+6],z[3]=U*x[ce+6],j[0]=k*x[ce+1]+R*x[ce+3]+N*x[ce+5]+P*x[ce+7],j[1]=R*x[ce+1]-P*x[ce+3]-k*x[ce+5]-N*x[ce+7],j[2]=N*x[ce+1]-k*x[ce+3]+P*x[ce+5]+R*x[ce+7],j[3]=P*x[ce+1]-N*x[ce+3]+R*x[ce+5]-k*x[ce+7],X[0]=B*(x[ce+0]+x[ce+4]),X[3]=B*(x[ce+0]-x[ce+4]),X[1]=z[0]+z[3],X[2]=z[1]-z[2],ie[0]=X[0]+X[1],ie[1]=X[3]+X[2],ie[2]=X[3]-X[2],ie[3]=X[0]-X[1],x[ce+0]=ie[0]+j[0],x[ce+1]=ie[1]+j[1],x[ce+2]=ie[2]+j[2],x[ce+3]=ie[3]+j[3],x[ce+4]=ie[3]-j[3],x[ce+5]=ie[2]-j[2],x[ce+6]=ie[1]-j[1],x[ce+7]=ie[0]-j[0]}for(let he=0;he<8;++he)z[0]=E*x[16+he],z[1]=U*x[16+he],z[2]=E*x[48+he],z[3]=U*x[48+he],j[0]=k*x[8+he]+R*x[24+he]+N*x[40+he]+P*x[56+he],j[1]=R*x[8+he]-P*x[24+he]-k*x[40+he]-N*x[56+he],j[2]=N*x[8+he]-k*x[24+he]+P*x[40+he]+R*x[56+he],j[3]=P*x[8+he]-N*x[24+he]+R*x[40+he]-k*x[56+he],X[0]=B*(x[he]+x[32+he]),X[3]=B*(x[he]-x[32+he]),X[1]=z[0]+z[3],X[2]=z[1]-z[2],ie[0]=X[0]+X[1],ie[1]=X[3]+X[2],ie[2]=X[3]-X[2],ie[3]=X[0]-X[1],x[0+he]=ie[0]+j[0],x[8+he]=ie[1]+j[1],x[16+he]=ie[2]+j[2],x[24+he]=ie[3]+j[3],x[32+he]=ie[3]-j[3],x[40+he]=ie[2]-j[2],x[48+he]=ie[1]-j[1],x[56+he]=ie[0]-j[0]}function Ge(x){for(let B=0;B<64;++B){const k=x[0][B],E=x[1][B],R=x[2][B];x[0][B]=k+1.5747*R,x[1][B]=k-.1873*E-.4682*R,x[2][B]=k+1.8556*E}}function L(x,B,k){for(let E=0;E<64;++E)B[k+E]=Jp.toHalfFloat(I(x[E]))}function I(x){return x<=1?Math.sign(x)*Math.pow(Math.abs(x),2.2):Math.sign(x)*Math.pow(C,Math.abs(x)-1)}function Z(x){return new DataView(x.array.buffer,x.offset.value,x.size)}function le(x){const B=x.viewer.buffer.slice(x.offset.value,x.offset.value+x.size),k=new Uint8Array(mn(B)),E=new Uint8Array(k.length);return Je(k),G(k,E),new DataView(E.buffer)}function Ae(x){const B=x.array.slice(x.offset.value,x.offset.value+x.size),k=vl(B),E=new Uint8Array(k.length);return Je(k),G(k,E),new DataView(E.buffer)}function oe(x){const B=x.viewer,k={value:x.offset.value},E=new Uint16Array(x.columns*x.lines*(x.inputChannels.length*x.type)),R=new Uint8Array(8192);let N=0;const U=new Array(x.inputChannels.length);for(let fe=0,ge=x.inputChannels.length;fe<ge;fe++)U[fe]={},U[fe].start=N,U[fe].end=U[fe].start,U[fe].nx=x.columns,U[fe].ny=x.lines,U[fe].size=x.type,N+=U[fe].nx*U[fe].ny*U[fe].size;const P=re(B,k),z=re(B,k);if(z>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(P<=z)for(let fe=0;fe<z-P+1;fe++)R[fe+P]=tt(B,k);const j=new Uint16Array(65536),X=v(R,j),ie=Oe(B,k);St(x.array,B,k,ie,E,N);for(let fe=0;fe<x.inputChannels.length;++fe){const ge=U[fe];for(let _e=0;_e<U[fe].size;++_e)$e(E,ge.start+_e,ge.nx,ge.size,ge.ny,ge.nx*ge.size,X)}ut(j,E,N);let he=0;const ce=new Uint8Array(E.buffer.byteLength);for(let fe=0;fe<x.lines;fe++)for(let ge=0;ge<x.inputChannels.length;ge++){const _e=U[ge],De=_e.nx*_e.size,Ke=new Uint8Array(E.buffer,_e.end*2,De*2);ce.set(Ke,he),he+=De*2,_e.end+=De}return new DataView(ce.buffer)}function Ue(x){const B=x.array.slice(x.offset.value,x.offset.value+x.size),k=vl(B),E=x.inputChannels.length*x.lines*x.columns*x.totalBytes,R=new ArrayBuffer(E),N=new DataView(R);let U=0,P=0;const z=new Array(4);for(let j=0;j<x.lines;j++)for(let X=0;X<x.inputChannels.length;X++){let ie=0;switch(x.inputChannels[X].pixelType){case 1:z[0]=U,z[1]=z[0]+x.columns,U=z[1]+x.columns;for(let ce=0;ce<x.columns;++ce){const fe=k[z[0]++]<<8|k[z[1]++];ie+=fe,N.setUint16(P,ie,!0),P+=2}break;case 2:z[0]=U,z[1]=z[0]+x.columns,z[2]=z[1]+x.columns,U=z[2]+x.columns;for(let ce=0;ce<x.columns;++ce){const fe=k[z[0]++]<<24|k[z[1]++]<<16|k[z[2]++]<<8;ie+=fe,N.setUint32(P,ie,!0),P+=4}break}}return N}function ve(x){const B=x.viewer,k={value:x.offset.value},E=new Uint8Array(x.columns*x.lines*(x.inputChannels.length*x.type*2)),R={version:We(B,k),unknownUncompressedSize:We(B,k),unknownCompressedSize:We(B,k),acCompressedSize:We(B,k),dcCompressedSize:We(B,k),rleCompressedSize:We(B,k),rleUncompressedSize:We(B,k),rleRawSize:We(B,k),totalAcUncompressedCount:We(B,k),totalDcUncompressedCount:We(B,k),acCompression:We(B,k)};if(R.version<2)throw new Error("EXRLoader.parse: "+gs.compression+" version "+R.version+" is unsupported");const N=new Array;let U=re(B,k)-2;for(;U>0;){const ge=Ve(B.buffer,k),_e=tt(B,k),De=_e>>2&3,Ke=(_e>>4)-1,He=new Int8Array([Ke])[0],Fe=tt(B,k);N.push({name:ge,index:He,type:Fe,compression:De}),U-=ge.length+3}const P=gs.channels,z=new Array(x.inputChannels.length);for(let ge=0;ge<x.inputChannels.length;++ge){const _e=z[ge]={},De=P[ge];_e.name=De.name,_e.compression=0,_e.decoded=!1,_e.type=De.pixelType,_e.pLinear=De.pLinear,_e.width=x.columns,_e.height=x.lines}const j={idx:new Array(3)};for(let ge=0;ge<x.inputChannels.length;++ge){const _e=z[ge];for(let De=0;De<N.length;++De){const Ke=N[De];_e.name==Ke.name&&(_e.compression=Ke.compression,Ke.index>=0&&(j.idx[Ke.index]=ge),_e.offset=ge)}}let X,ie,he;if(R.acCompressedSize>0)switch(R.acCompression){case 0:X=new Uint16Array(R.totalAcUncompressedCount),St(x.array,B,k,R.acCompressedSize,X,R.totalAcUncompressedCount);break;case 1:const ge=x.array.slice(k.value,k.value+R.totalAcUncompressedCount),_e=vl(ge);X=new Uint16Array(_e.buffer),k.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const ge={array:x.array,offset:k,size:R.dcCompressedSize};ie=new Uint16Array(Ae(ge).buffer),k.value+=R.dcCompressedSize}if(R.rleRawSize>0){const ge=x.array.slice(k.value,k.value+R.rleCompressedSize),_e=vl(ge);he=mn(_e.buffer),k.value+=R.rleCompressedSize}let ce=0;const fe=new Array(z.length);for(let ge=0;ge<fe.length;++ge)fe[ge]=new Array;for(let ge=0;ge<x.lines;++ge)for(let _e=0;_e<z.length;++_e)fe[_e].push(ce),ce+=z[_e].width*x.type*2;dt(j,fe,z,X,ie,E);for(let ge=0;ge<z.length;++ge){const _e=z[ge];if(!_e.decoded)switch(_e.compression){case 2:let De=0,Ke=0;for(let He=0;He<x.lines;++He){let Fe=fe[ge][De];for(let st=0;st<_e.width;++st){for(let Le=0;Le<2*_e.type;++Le)E[Fe++]=he[Ke+Le*_e.width*_e.height];Ke++}De++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(E.buffer)}function Ve(x,B){const k=new Uint8Array(x);let E=0;for(;k[B.value+E]!=0;)E+=1;const R=new TextDecoder().decode(k.slice(B.value,B.value+E));return B.value=B.value+E+1,R}function Ye(x,B,k){const E=new TextDecoder().decode(new Uint8Array(x).slice(B.value,B.value+k));return B.value=B.value+k,E}function Ee(x,B){const k=ke(x,B),E=Oe(x,B);return[k,E]}function Ne(x,B){const k=Oe(x,B),E=Oe(x,B);return[k,E]}function ke(x,B){const k=x.getInt32(B.value,!0);return B.value=B.value+4,k}function Oe(x,B){const k=x.getUint32(B.value,!0);return B.value=B.value+4,k}function Te(x,B){const k=x[B.value];return B.value=B.value+1,k}function tt(x,B){const k=x.getUint8(B.value);return B.value=B.value+1,k}const We=function(x,B){let k;return"getBigInt64"in DataView.prototype?k=Number(x.getBigInt64(B.value,!0)):k=x.getUint32(B.value+4,!0)+Number(x.getUint32(B.value,!0)<<32),B.value+=8,k};function nt(x,B){const k=x.getFloat32(B.value,!0);return B.value+=4,k}function W(x,B){return Jp.toHalfFloat(nt(x,B))}function ne(x){const B=(x&31744)>>10,k=x&1023;return(x>>15?-1:1)*(B?B===31?k?NaN:1/0:Math.pow(2,B-15)*(1+k/1024):6103515625e-14*(k/1024))}function re(x,B){const k=x.getUint16(B.value,!0);return B.value+=2,k}function de(x,B){return ne(re(x,B))}function Ie(x,B,k,E){const R=k.value,N=[];for(;k.value<R+E-1;){const U=Ve(B,k),P=ke(x,k),z=tt(x,k);k.value+=3;const j=ke(x,k),X=ke(x,k);N.push({name:U,pixelType:P,pLinear:z,xSampling:j,ySampling:X})}return k.value+=1,N}function Se(x,B){const k=nt(x,B),E=nt(x,B),R=nt(x,B),N=nt(x,B),U=nt(x,B),P=nt(x,B),z=nt(x,B),j=nt(x,B);return{redX:k,redY:E,greenX:R,greenY:N,blueX:U,blueY:P,whiteX:z,whiteY:j}}function it(x,B){const k=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],E=tt(x,B);return k[E]}function Ot(x,B){const k=ke(x,B),E=ke(x,B),R=ke(x,B),N=ke(x,B);return{xMin:k,yMin:E,xMax:R,yMax:N}}function bn(x,B){const k=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],E=tt(x,B);return k[E]}function yt(x,B){const k=["ENVMAP_LATLONG","ENVMAP_CUBE"],E=tt(x,B);return k[E]}function Yn(x,B){const k=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],E=["ROUND_DOWN","ROUND_UP"],R=Oe(x,B),N=Oe(x,B),U=tt(x,B);return{xSize:R,ySize:N,levelMode:k[U&15],roundingMode:E[U>>4]}}function Si(x,B){const k=nt(x,B),E=nt(x,B);return[k,E]}function lh(x,B){const k=nt(x,B),E=nt(x,B),R=nt(x,B);return[k,E,R]}function hh(x,B,k,E,R){if(E==="string"||E==="stringvector"||E==="iccProfile")return Ye(B,k,R);if(E==="chlist")return Ie(x,B,k,R);if(E==="chromaticities")return Se(x,k);if(E==="compression")return it(x,k);if(E==="box2i")return Ot(x,k);if(E==="envmap")return yt(x,k);if(E==="tiledesc")return Yn(x,k);if(E==="lineOrder")return bn(x,k);if(E==="float")return nt(x,k);if(E==="v2f")return Si(x,k);if(E==="v3f")return lh(x,k);if(E==="int")return ke(x,k);if(E==="rational")return Ee(x,k);if(E==="timecode")return Ne(x,k);if(E==="preview")return k.value+=R,"skipped";k.value+=R}function As(x,B){const k=Math.log2(x);return B=="ROUND_DOWN"?Math.floor(k):Math.ceil(k)}function ic(x,B,k){let E=0;switch(x.levelMode){case"ONE_LEVEL":E=1;break;case"MIPMAP_LEVELS":E=As(Math.max(B,k),x.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return E}function sc(x,B,k,E){const R=new Array(x);for(let N=0;N<x;N++){const U=1<<N;let P=B/U|0;E=="ROUND_UP"&&P*U<B&&(P+=1);const z=Math.max(P,1);R[N]=(z+k-1)/k|0}return R}function uh(){const x=this,B=x.offset,k={value:0};for(let E=0;E<x.tileCount;E++){const R=ke(x.viewer,B),N=ke(x.viewer,B);B.value+=8,x.size=Oe(x.viewer,B);const U=R*x.blockWidth,P=N*x.blockHeight;x.columns=U+x.blockWidth>x.width?x.width-U:x.blockWidth,x.lines=P+x.blockHeight>x.height?x.height-P:x.blockHeight;const z=x.columns*x.totalBytes,X=x.size<x.lines*z?x.uncompress(x):Z(x);B.value+=x.size;for(let ie=0;ie<x.lines;ie++){const he=ie*x.columns*x.totalBytes;for(let ce=0;ce<x.inputChannels.length;ce++){const fe=gs.channels[ce].name,ge=x.channelByteOffsets[fe]*x.columns,_e=x.decodeChannels[fe];if(_e===void 0)continue;k.value=he+ge;const De=(x.height-(1+P+ie))*x.outLineWidth;for(let Ke=0;Ke<x.columns;Ke++){const He=De+(Ke+U)*x.outputChannels+_e;x.byteArray[He]=x.getter(X,k)}}}}}function Ha(){const x=this,B=x.offset,k={value:0};for(let E=0;E<x.height/x.blockHeight;E++){const R=ke(x.viewer,B)-gs.dataWindow.yMin;x.size=Oe(x.viewer,B),x.lines=R+x.blockHeight>x.height?x.height-R:x.blockHeight;const N=x.columns*x.totalBytes,P=x.size<x.lines*N?x.uncompress(x):Z(x);B.value+=x.size;for(let z=0;z<x.blockHeight;z++){const j=E*x.blockHeight,X=z+x.scanOrder(j);if(X>=x.height)continue;const ie=z*N,he=(x.height-1-X)*x.outLineWidth;for(let ce=0;ce<x.inputChannels.length;ce++){const fe=gs.channels[ce].name,ge=x.channelByteOffsets[fe]*x.columns,_e=x.decodeChannels[fe];if(_e!==void 0){k.value=ie+ge;for(let De=0;De<x.columns;De++){const Ke=he+De*x.outputChannels+_e;x.byteArray[Ke]=x.getter(P,k)}}}}}}function dh(x,B,k){const E={};if(x.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");E.version=x.getUint8(4);const R=x.getUint8(5);E.spec={singleTile:!!(R&2),longName:!!(R&4),deepFormat:!!(R&8),multiPart:!!(R&16)},k.value=8;let N=!0;for(;N;){const U=Ve(B,k);if(U==="")N=!1;else{const P=Ve(B,k),z=Oe(x,k),j=hh(x,B,k,P,z);j===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`):E[U]=j}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",E),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return E}function za(x,B,k,E,R){const N={size:0,viewer:B,array:k,offset:E,width:x.dataWindow.xMax-x.dataWindow.xMin+1,height:x.dataWindow.yMax-x.dataWindow.yMin+1,inputChannels:x.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:rn};switch(x.compression){case"NO_COMPRESSION":N.blockHeight=1,N.uncompress=Z;break;case"RLE_COMPRESSION":N.blockHeight=1,N.uncompress=le;break;case"ZIPS_COMPRESSION":N.blockHeight=1,N.uncompress=Ae;break;case"ZIP_COMPRESSION":N.blockHeight=16,N.uncompress=Ae;break;case"PIZ_COMPRESSION":N.blockHeight=32,N.uncompress=oe;break;case"PXR24_COMPRESSION":N.blockHeight=16,N.uncompress=Ue;break;case"DWAA_COMPRESSION":N.blockHeight=32,N.uncompress=ve;break;case"DWAB_COMPRESSION":N.blockHeight=256,N.uncompress=ve;break;default:throw new Error("EXRLoader.parse: "+x.compression+" is unsupported")}const U={};for(const X of x.channels)switch(X.name){case"Y":case"R":case"G":case"B":case"A":U[X.name]=!0,N.type=X.pixelType}let P=!1;if(U.R&&U.G&&U.B)P=!U.A,N.outputChannels=4,N.decodeChannels={R:0,G:1,B:2,A:3};else if(U.Y)N.outputChannels=1,N.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(N.type==1)switch(R){case nn:N.getter=de;break;case Mn:N.getter=re;break}else if(N.type==2)switch(R){case nn:N.getter=nt;break;case Mn:N.getter=W}else throw new Error("EXRLoader.parse: unsupported pixelType "+N.type+" for "+x.compression+".");N.columns=N.width;const z=N.width*N.height*N.outputChannels;switch(R){case nn:N.byteArray=new Float32Array(z),P&&N.byteArray.fill(1,0,z);break;case Mn:N.byteArray=new Uint16Array(z),P&&N.byteArray.fill(15360,0,z);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let j=0;for(const X of x.channels)N.decodeChannels[X.name]!==void 0&&(N.channelByteOffsets[X.name]=j),j+=X.pixelType*2;if(N.totalBytes=j,N.outLineWidth=N.width*N.outputChannels,x.lineOrder==="INCREASING_Y"?N.scanOrder=X=>X:N.scanOrder=X=>N.height-1-X,N.outputChannels==4?(N.format=sn,N.colorSpace=rn):(N.format=Hi,N.colorSpace=ci),x.spec.singleTile){N.blockHeight=x.tiles.ySize,N.blockWidth=x.tiles.xSize;const X=ic(x.tiles,N.width,N.height),ie=sc(X,N.width,x.tiles.xSize,x.tiles.roundingMode),he=sc(X,N.height,x.tiles.ySize,x.tiles.roundingMode);N.tileCount=ie[0]*he[0];for(let ce=0;ce<X;ce++)for(let fe=0;fe<he[ce];fe++)for(let ge=0;ge<ie[ce];ge++)We(B,E);N.decode=uh.bind(N)}else{N.blockWidth=N.width;const X=Math.ceil(N.height/N.blockHeight);for(let ie=0;ie<X;ie++)We(B,E);N.decode=Ha.bind(N)}return N}const rc={value:0},ac=new DataView(e),op=new Uint8Array(e),gs=dh(ac,e,rc),Ks=za(gs,ac,op,rc,this.type);return Ks.decode(),{header:gs,width:Ks.width,height:Ks.height,data:Ks.byteArray,format:Ks.format,colorSpace:Ks.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,s){function r(a,o){a.colorSpace=o.colorSpace,a.minFilter=zt,a.magFilter=zt,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,o)}return super.load(e,r,n,s)}}function NB(i,e){const{id:t,path:n}=e;return t==="neutral"?Promise.resolve({envMap:i.neutralEnvironment}):t===""?Promise.resolve({envMap:null}):new Promise((s,r)=>{new RB().load(n,a=>{const o=i.pmremGenerator.fromEquirectangular(a).texture;a.dispose(),i._loadedEnvironment&&i._loadedEnvironment!==o&&i._loadedEnvironment.dispose(),i._loadedEnvironment=o,s({envMap:o})},void 0,r)})}function FB(i){i.renderer.render(i.scene,i.activeCamera),i.renderer.domElement.toBlob(e=>{if(!e)return;const t=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),n=URL.createObjectURL(e),s=document.createElement("a");s.download=`3d-screenshot-${t}.png`,s.href=n,s.click(),URL.revokeObjectURL(n)},"image/png"),DB(i)}function DB(i){const e=document.createElement("div");e.className="screenshot-flash",i.el.appendChild(e),e.addEventListener("animationend",()=>e.remove())}function LB(i,e){i.mixer&&(i.mixer.stopAllAction(),i.mixer.uncacheRoot(i.mixer.getRoot()),i.mixer=null),i.clips=e,e.length&&(i.mixer=new LA(i.content))}function PB(i){i.clips.forEach(e=>{i.mixer.clipAction(e).reset().play(),i.state.actionStates[e.name]=!0}),i.invalidate()}const kB=.35;class UB{constructor(){this.model=null,this.mixer=null,this.clips=new Map,this.actions=new Map,this.currentName=null,this.currentAction=null,this.loader=new Yu,this.onChange=null,this._gltfCache=new Map,this._animationDefs=[]}attach(e){this.detach(),this.model=e,this.mixer=new LA(e),this.actions.clear(),this.currentAction=null,this.currentName=null;for(const[t,n]of this.clips){const s=this._retargetClip(n,t),r=this.mixer.clipAction(s);r.enabled=!0,this.actions.set(t,r)}}detach(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null),this.model=null,this.actions.clear(),this.currentAction=null,this.currentName=null}setAnimationDefs(e){this._animationDefs=e}getAnimationDefs(){return this._animationDefs}async loadAnimation(e,t,n={}){if(this.clips.has(e))return this.clips.get(e);let s;this._gltfCache.has(t)?s=this._gltfCache.get(t):(s=await new Promise((a,o)=>{this.loader.load(t,a,void 0,o)}),this._gltfCache.set(t,s));let r;if(n.clipName?(r=s.animations.find(a=>a.name===n.clipName),r||(console.warn(`[AnimationManager] Clip "${n.clipName}" not found in ${t}, using first clip`),r=s.animations[0])):r=s.animations[0],!r)throw new Error(`No animation found in ${t}`);if(r=r.clone(),r.name=e,this.clips.set(e,r),this.model&&this.mixer){const a=this._retargetClip(r,e),o=this.mixer.clipAction(a);o.enabled=!0,o.setLoop(n.loop===!1?Cp:Sp),n.loop===!1&&(o.clampWhenFinished=!0),this.actions.set(e,o)}return r}async loadAll(){const e=this._animationDefs.map(async t=>{try{await this.loadAnimation(t.name,t.url,{loop:t.loop!==!1,clipName:t.clipName})}catch(n){console.warn(`[AnimationManager] Failed to load "${t.name}" from ${t.url}:`,n)}});await Promise.all(e)}play(e){const t=this.actions.get(e);if(!t){console.warn(`[AnimationManager] Animation "${e}" not loaded`);return}this.currentAction&&this.currentAction!==t&&this.currentAction.fadeOut(.01),t.reset().fadeIn(.01).play(),this.currentAction=t,this.currentName=e,this.onChange&&this.onChange(e)}crossfadeTo(e,t=kB){if(e===this.currentName)return;const n=this.actions.get(e);if(!n){console.warn(`[AnimationManager] Animation "${e}" not loaded`);return}n.reset(),n.play(),this.currentAction?this.currentAction.crossFadeTo(n,t,!0):n.fadeIn(t),this.currentAction=n,this.currentName=e,this.onChange&&this.onChange(e)}stopAll(){this.mixer&&this.mixer.stopAllAction(),this.currentAction=null,this.currentName=null,this.onChange&&this.onChange(null)}update(e){this.mixer&&this.mixer.update(e)}_retargetClip(e,t){if(!this.model)return e;const n=new Set;if(this.model.traverse(o=>{o.isBone&&n.add(o.name)}),n.size===0)return e;const s=new Set;for(const o of e.tracks){const c=o.name.split(".")[0];s.add(c)}let r=0;for(const o of s)n.has(o)&&r++;if(r/s.size>.5)return e;const a=this._buildBoneNameMap(n,s);return a?(e.tracks.map(o=>{const c=o.name.split("."),l=c[0],h=c.slice(1).join("."),u=a.get(l);if(!u)return null;const d=o.clone();return d.name=`${u}.${h}`,d}).filter(Boolean),e.clone().resetDuration()):e}_buildBoneNameMap(e,t){const n=new Map,s=[...e],r=[...t],a=h=>h.replace(/^mixamorig\d*[_:]?/i,"").replace(/^Armature[_/]?/i,""),o=new Map(s.map(h=>[a(h),h]));let c=0;for(const h of r){const u=a(h);o.has(u)&&(n.set(h,o.get(u)),c++)}if(c/r.length>.5)return n;const l=new Map(s.map(h=>[h.toLowerCase(),h]));n.clear(),c=0;for(const h of r)l.has(h.toLowerCase())&&(n.set(h,l.get(h.toLowerCase())),c++);return c/r.length>.5?n:null}getLoadedNames(){return[...this.clips.keys()]}isLoaded(e){return this.clips.has(e)}dispose(){this.detach(),this.clips.clear(),this._gltfCache.clear(),this._animationDefs=[]}}Ji.enabled=!0;class Kd{constructor(e,t){this.el=e,this.options=t,this.lights=[],this.content=null,this.mixer=null,this.clips=[],this.gui=null,this.animationManager=new UB,this._animPanelEl=null,this.state={environment:t.preset===zd.ASSET_GENERATOR?hl.find(r=>r.id==="footprint-court").name:hl[1].name,background:!1,playbackSpeed:1,actionStates:{},camera:yl,wireframe:!1,skeleton:!1,grid:!1,autoRotate:!1,punctualLights:!0,exposure:0,toneMapping:yh,ambientIntensity:.3,ambientColor:"#FFFFFF",directIntensity:.8*Math.PI,directColor:"#FFFFFF",bgColor:"#000000",transparentBg:!1,pointSize:1,showInfo:!0,showLabels:!1,followMode:"mouse"},this.prevTime=0,this.stats=new Eo,this.stats.dom.height="48px",[].forEach.call(this.stats.dom.children,r=>r.style.display=""),this.backgroundColor=new qe(this.state.bgColor),this.scene=new _u,this.scene.background=this.backgroundColor;const n=t.preset===zd.ASSET_GENERATOR?.8*180/Math.PI:60,s=e.clientWidth/e.clientHeight;this.defaultCamera=new Cn(n,s,.01,1e3),this.activeCamera=this.defaultCamera,this.scene.add(this.defaultCamera),this.renderer=window.renderer=new pg({antialias:!0,alpha:!0}),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.renderer.setSize(e.clientWidth,e.clientHeight),this.pmremGenerator=new qu(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.neutralEnvironment=this.pmremGenerator.fromScene(new UI).texture,this.controls=new CI(this.defaultCamera,this.renderer.domElement),this.controls.screenSpacePanning=!0,this._onControlsChange=()=>this.invalidate(),this.controls.addEventListener("change",this._onControlsChange),this.el.appendChild(this.renderer.domElement),this.cameraCtrl=null,this.cameraFolder=null,this.animFolder=null,this.animCtrls=[],this.morphFolder=null,this.morphCtrls=[],this.skeletonHelpers=[],this.gridHelper=null,this.axesHelper=null,this.modelInfo=null,this.annotationEls=[],this._tempVec=new H,this.addAxesHelper(),this.addGUI(),t.kiosk&&this.gui.close(),this.animate=this.animate.bind(this),this._rafId=null,this._visible=!0,this._tabVisible=!document.hidden,this._disposed=!1,this._loadedEnvironment=null,this._guiWrap=null,this._needsRender=!0,this._animating=!1,this._onVisibilityChange=()=>{const r=!this._tabVisible;this._tabVisible=!document.hidden,r&&this._tabVisible&&(this._needsRender=!0),this._updateRenderLoop()},document.addEventListener("visibilitychange",this._onVisibilityChange),typeof IntersectionObserver<"u"&&(this._intersectionObserver=new IntersectionObserver(r=>{const a=!this._visible;this._visible=r[r.length-1].isIntersecting,a&&this._visible&&(this._needsRender=!0),this._updateRenderLoop()},{threshold:0}),this._intersectionObserver.observe(this.el)),this._onResize=this.resize.bind(this),this._onKeyDown=r=>{(r.key==="p"||r.key==="P")&&!this.isInputFocused()&&this.takeScreenshot()},this._updateRenderLoop(),window.addEventListener("resize",this._onResize,!1),window.addEventListener("keydown",this._onKeyDown)}invalidate(){this._disposed||(this._needsRender=!0,this._updateRenderLoop())}_recomputeAnimating(){let e=!1;if(this.state&&this.state.autoRotate&&(e=!0),!e&&this.mixer&&this.state){for(const t in this.state.actionStates)if(this.state.actionStates[t]){e=!0;break}}!e&&this.animationManager.currentAction&&(e=!0),this._animating=e}_updateRenderLoop(){if(this._disposed)return;const e=this._visible&&this._tabVisible;e&&(this._needsRender||this._animating)&&this._rafId===null?(this.prevTime=performance.now(),this._rafId=requestAnimationFrame(this.animate)):!e&&this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null)}animate(e){const t=(e-this.prevTime)/1e3;if(this.prevTime=e,this._recomputeAnimating(),this.controls.update(),this.stats.update(),this.mixer&&this.mixer.update(t),this.animationManager.update(t),this._afterAnimateHooks)for(let n=0;n<this._afterAnimateHooks.length;n++)this._afterAnimateHooks[n](t);this.render(),this._needsRender=!1,this._animating&&this._visible&&this._tabVisible&&!this._disposed?this._rafId=requestAnimationFrame(this.animate):this._rafId=null}isInputFocused(){const e=document.activeElement;return e&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}render(){this.renderer.render(this.scene,this.activeCamera),this.state.grid&&(this.axesCamera.position.copy(this.defaultCamera.position),this.axesCamera.lookAt(this.axesScene.position),this.axesRenderer.render(this.axesScene,this.axesCamera)),this.projectAnnotations()}takeScreenshot(){FB(this)}resize(){const{clientHeight:e,clientWidth:t}=this.el;this.defaultCamera.aspect=t/e,this.defaultCamera.updateProjectionMatrix(),this.renderer.setSize(t,e),this.axesCamera.aspect=this.axesDiv.clientWidth/this.axesDiv.clientHeight,this.axesCamera.updateProjectionMatrix(),this.axesRenderer.setSize(this.axesDiv.clientWidth,this.axesDiv.clientHeight),this.invalidate()}load(e,t,n){const s=la.extractUrlBase(e);return new Promise((r,a)=>{wl.setURLModifier((l,h)=>{const u=t+decodeURI(l).replace(s,"").replace(/^(\.?\/)/,"");if(n.has(u)){const d=n.get(u),f=URL.createObjectURL(d);return c.push(f),f}return(h||"")+l});const o=new Yu(wl).setCrossOrigin("anonymous").setDRACOLoader(dB).setKTX2Loader(fB.detectSupport(this.renderer)).setMeshoptDecoder(wI),c=[];o.load(e,l=>{window.VIEWER.json=l;const h=l.scene||l.scenes[0],u=l.animations||[];if(!h)throw new Error("This model contains no scene, and cannot be viewed here. However, it may contain individual 3D resources.");this.setContent(h,u),c.forEach(URL.revokeObjectURL),r(l)},void 0,a)})}setContent(e,t){this.clear(),e.updateMatrixWorld();const n=new Mi().setFromObject(e),s=n.getSize(new H).length(),r=n.getCenter(new H);this.controls.reset(),e.position.x-=r.x,e.position.y-=r.y,e.position.z-=r.z,this.controls.maxDistance=s*10,this.defaultCamera.near=s/100,this.defaultCamera.far=s*100,this.defaultCamera.updateProjectionMatrix(),this.options.cameraPosition?(this.defaultCamera.position.fromArray(this.options.cameraPosition),this.defaultCamera.lookAt(new H)):(this.defaultCamera.position.copy(r),this.defaultCamera.position.x+=s/2,this.defaultCamera.position.y+=s/5,this.defaultCamera.position.z+=s/2,this.defaultCamera.lookAt(r)),this.setCamera(yl),this.axesCamera.position.copy(this.defaultCamera.position),this.axesCamera.lookAt(this.axesScene.position),this.axesCamera.near=s/100,this.axesCamera.far=s*100,this.axesCamera.updateProjectionMatrix(),this.axesCorner.scale.set(s,s,s),this.controls.saveState(),this.scene.add(e),this.content=e,this.state.punctualLights=!0,this.content.traverse(a=>{a.isLight&&(this.state.punctualLights=!1)}),this.setClips(t),this.animationManager.attach(this.content),this._setupAnimationPanel(),this.updateLights(),this.updateGUI(),this.updateEnvironment(),this.updateDisplay(),this.updateModelInfo(e,t),this.updateAnnotations(),window.VIEWER.scene=this.content,this.invalidate()}setClips(e){LB(this,e)}playAllClips(){PB(this)}setCamera(e){e===yl?(this.controls.enabled=!0,this.activeCamera=this.defaultCamera):(this.controls.enabled=!1,this.content.traverse(t=>{t.isCamera&&t.name===e&&(this.activeCamera=t)})),this.invalidate()}updateLights(){const e=this.state,t=this.lights;e.punctualLights&&!t.length?pB(this):!e.punctualLights&&t.length&&AB(this),this.renderer.toneMapping=Number(e.toneMapping),this.renderer.toneMappingExposure=Math.pow(2,e.exposure),t.length===2&&(t[0].intensity=e.ambientIntensity,t[0].color.set(e.ambientColor),t[1].intensity=e.directIntensity,t[1].color.set(e.directColor)),this.invalidate()}updateEnvironment(){const e=hl.filter(t=>t.name===this.state.environment)[0];NB(this,e).then(({envMap:t})=>{this._disposed||!this.scene||(this.scene.environment=t,this.scene.background=this.state.transparentBg?null:this.state.background?t:this.backgroundColor,this.invalidate())})}updateDisplay(){this.skeletonHelpers.length&&this.skeletonHelpers.forEach(e=>this.scene.remove(e)),Jm(this.content,e=>{e.wireframe=this.state.wireframe,e instanceof Ru&&(e.size=this.state.pointSize)}),this.content.traverse(e=>{if(e.geometry&&e.skeleton&&this.state.skeleton){const t=new Uy(e.skeleton.bones[0].parent);t.material.linewidth=3,this.scene.add(t),this.skeletonHelpers.push(t)}}),this.state.grid!==!!this.gridHelper&&(this.state.grid?(this.gridHelper=new Oy,this.axesHelper=new UA,this.axesHelper.renderOrder=999,this.axesHelper.onBeforeRender=e=>e.clearDepth(),this.scene.add(this.gridHelper),this.scene.add(this.axesHelper)):(this.scene.remove(this.gridHelper),this.scene.remove(this.axesHelper),this.gridHelper=null,this.axesHelper=null,this.axesRenderer.clear())),this.controls.autoRotate=this.state.autoRotate,this.invalidate()}updateBackground(){this.backgroundColor.set(this.state.bgColor),this.state.transparentBg?(this.scene.background=null,this.renderer.setClearColor(0,0)):(this.scene.background=this.backgroundColor,this.renderer.setClearColor(0,1),this.updateEnvironment()),this.invalidate()}setBackgroundColor(e){this.state.bgColor=typeof e=="string"?e:"#"+e.toString(16).padStart(6,"0"),this.state.transparentBg=!1,this.updateBackground()}updateModelInfo(e,t){this.modelInfo&&(this.modelInfo.remove(),this.modelInfo=null),this.state.showInfo&&e&&(this.modelInfo=VM(this.el,e,t))}updateAnnotations(){if(this.annotationEls.forEach(t=>t.el.remove()),this.annotationEls=[],!this.state.showLabels||!this.content)return;KM(this.content).forEach(t=>{const n=jM(t),s=document.createElement("div");s.classList.add("annotation-label"),s.appendChild(n),this.el.appendChild(s),this.annotationEls.push({el:s,position:t.position})}),this.invalidate()}projectAnnotations(){if(this.annotationEls.length===0)return;const e=this.el.clientWidth,t=this.el.clientHeight,n=e/2,s=t/2,r=this._tempVec;this.annotationEls.forEach(({el:a,position:o})=>{if(r.copy(o),r.project(this.activeCamera),r.z>1){a.style.display="none";return}const c=r.x*n+n,l=-(r.y*s)+s;a.style.display="",a.style.left=c+"px",a.style.top=l+"px"})}addAxesHelper(){this.axesDiv=document.createElement("div"),this.el.appendChild(this.axesDiv),this.axesDiv.classList.add("axes");const{clientWidth:e,clientHeight:t}=this.axesDiv;this.axesScene=new _u,this.axesCamera=new Cn(50,e/t,.1,10),this.axesScene.add(this.axesCamera),this.axesRenderer=new pg({alpha:!0}),this.axesRenderer.setPixelRatio(window.devicePixelRatio),this.axesRenderer.setSize(this.axesDiv.clientWidth,this.axesDiv.clientHeight),this.axesCamera.up=this.defaultCamera.up,this.axesCorner=new UA(5),this.axesScene.add(this.axesCorner),this.axesDiv.appendChild(this.axesRenderer.domElement)}addGUI(){const e=window.innerWidth<=700,t=this.gui=new a1({autoPlace:!1,width:e?220:260,hideable:!0}),n=t.addFolder("Display");n.add(this.state,"background").onChange(()=>this.updateEnvironment()),n.add(this.state,"autoRotate").onChange(()=>this.updateDisplay()),n.add(this.state,"wireframe").onChange(()=>this.updateDisplay()),n.add(this.state,"skeleton").onChange(()=>this.updateDisplay()),n.add(this.state,"grid").onChange(()=>this.updateDisplay()),n.add(this.controls,"screenSpacePanning"),n.add(this.state,"pointSize",1,16).onChange(()=>this.updateDisplay()),n.add(this.state,"transparentBg").name("transparent bg").onChange(()=>this.updateBackground()),n.addColor(this.state,"bgColor").onChange(()=>this.updateBackground()),n.add({screenshot:()=>this.takeScreenshot()},"screenshot").name("Screenshot [P]"),n.add(this.state,"showInfo").name("model info").onChange(()=>this.updateModelInfo(this.content,this.clips)),n.add(this.state,"showLabels").name("mesh labels").onChange(()=>this.updateAnnotations());const m=t.addFolder("Lighting");m.add(this.state,"environment",hl.map(w=>w.name)).onChange(()=>this.updateEnvironment()),[m.add(this.state,"toneMapping",{Linear:yh,"ACES Filmic":Ap}),m.add(this.state,"exposure",-10,10,.01),m.add(this.state,"punctualLights").listen(),m.add(this.state,"ambientIntensity",0,2),m.addColor(this.state,"ambientColor"),m.add(this.state,"directIntensity",0,4),m.addColor(this.state,"directColor")].forEach(w=>w.onChange(()=>this.updateLights())),this.animFolder=t.addFolder("Animation"),this.animFolder.domElement.style.display="none",this.animFolder.add(this.state,"playbackSpeed",0,1).onChange(w=>{this.mixer&&(this.mixer.timeScale=w)}),this.animFolder.add({playAll:()=>this.playAllClips()},"playAll"),this.morphFolder=t.addFolder("Morph Targets"),this.morphFolder.domElement.style.display="none",this.cameraFolder=t.addFolder("Cameras"),this.cameraFolder.domElement.style.display="none",t.addFolder("Agent").add(this.state,"followMode",{None:"none","Follow Mouse":"mouse","Follow Keystrokes":"keystrokes"}).name("follow mode");const y=t.addFolder("Performance"),b=document.createElement("li");this.stats.dom.style.position="static",b.appendChild(this.stats.dom),b.classList.add("gui-stats"),y.__ul.appendChild(b);const _=document.createElement("div");this.el.appendChild(_),_.classList.add("gui-wrap"),_.classList.add("gui-wrap--hidden"),_.appendChild(t.domElement),this._guiWrap=_;const M=document.createElement("button");M.className="gui-toggle",M.setAttribute("title","Toggle advanced controls"),M.setAttribute("aria-label","Toggle advanced controls"),M.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg><span class="gui-toggle__label">Controls</span>',M.addEventListener("click",()=>{const w=_.classList.toggle("gui-wrap--hidden");M.classList.toggle("gui-toggle--active",!w)}),this.el.appendChild(M),this._guiToggle=M,e?t.close():t.open()}updateGUI(){this.cameraFolder.domElement.style.display="none",this.morphCtrls.forEach(n=>n.remove()),this.morphCtrls.length=0,this.morphFolder.domElement.style.display="none",this.animCtrls.forEach(n=>n.remove()),this.animCtrls.length=0,this.animFolder.domElement.style.display="none";const e=[],t=[];if(this.content.traverse(n=>{n.geometry&&n.morphTargetInfluences&&t.push(n),n.isCamera&&(n.name=n.name||`VIEWER__camera_${e.length+1}`,e.push(n.name))}),e.length){this.cameraFolder.domElement.style.display="",this.cameraCtrl&&this.cameraCtrl.remove();const n=[yl].concat(e);this.cameraCtrl=this.cameraFolder.add(this.state,"camera",n),this.cameraCtrl.onChange(s=>this.setCamera(s))}if(t.length&&(this.morphFolder.domElement.style.display="",t.forEach(n=>{if(n.morphTargetInfluences.length){const s=this.morphFolder.add({name:n.name||"Untitled"},"name");this.morphCtrls.push(s)}for(let s=0;s<n.morphTargetInfluences.length;s++){const r=this.morphFolder.add(n.morphTargetInfluences,s,0,1,.01).listen();Object.keys(n.morphTargetDictionary).forEach(a=>{a&&n.morphTargetDictionary[a]===s&&r.name(a)}),this.morphCtrls.push(r)}})),this.clips.length){this.animFolder.domElement.style.display="";const n=this.state.actionStates={};this.clips.forEach((s,r)=>{s.name=`${r+1}. ${s.name}`;let a;r===0?(n[s.name]=!0,a=this.mixer.clipAction(s),a.play()):n[s.name]=!1;const o=this.animFolder.add(n,s.name).listen();o.onChange(c=>{a=a||this.mixer.clipAction(s),a.setEffectiveTimeScale(1),c?a.play():a.stop(),this.invalidate()}),this.animCtrls.push(o)})}}setAnimationDefs(e){this.animationManager.setAnimationDefs(e),this.content&&this._setupAnimationPanel()}_setupAnimationPanel(){this._animPanelEl&&(this._animPanelEl.remove(),this._animPanelEl=null);const e=this.animationManager.getAnimationDefs();if(e.length===0)return;let t=!1;if(this.content.traverse(s=>{s.isSkinnedMesh&&(t=!0)}),!t)return;const n=document.createElement("div");n.className="anim-panel",n.innerHTML='<div class="anim-panel__header"><span class="anim-panel__title">Animations</span><button class="anim-panel__stop" title="Stop all">⏹</button></div><div class="anim-panel__grid"></div>',this.el.appendChild(n),this._animPanelEl=n,this._renderAnimButtons(),this.animationManager.loadAll().then(()=>{if(this._renderAnimButtons(),!this.animationManager.currentName&&e.length>0){const s=e[0].name;this.animationManager.isLoaded(s)&&(this.animationManager.play(s),this._renderAnimButtons(),this.invalidate(),this._recomputeAnimating(),this._updateRenderLoop())}}),n.querySelector(".anim-panel__stop").addEventListener("click",()=>{this.animationManager.stopAll(),this._renderAnimButtons(),this.invalidate()}),this.animationManager.onChange=()=>{this._renderAnimButtons()}}_renderAnimButtons(){if(!this._animPanelEl)return;const e=this._animPanelEl.querySelector(".anim-panel__grid"),t=this.animationManager.getAnimationDefs(),n=this.animationManager.currentName,s={idle:"🧍",breathing:"🧍",standing:"🧍",walking:"🚶",walk:"🚶",running:"🏃",run:"🏃",waving:"👋",wave:"👋",dancing:"💃",dance:"💃",sitting:"🪑",sit:"🪑",jumping:"🦘",jump:"🦘",talking:"🗣️",talk:"🗣️",clapping:"👏",clap:"👏",punching:"👊",punch:"👊",kicking:"🦵",kick:"🦵"};e.innerHTML=t.map((r,a)=>{const o=this.animationManager.isLoaded(r.name),c=n===r.name,l=r.icon||s[r.name.toLowerCase()]||"▶",h=r.label||r.name.charAt(0).toUpperCase()+r.name.slice(1),u=a<9?a+1:"";return'<button class="anim-btn'+(c?" anim-btn--active":"")+(o?"":" anim-btn--loading")+'" data-anim="'+r.name+'" title="'+h+(u?" — press "+u:"")+'"'+(o?"":" disabled")+">"+(u?'<span class="anim-btn__key">'+u+"</span>":"")+'<span class="anim-btn__icon">'+l+'</span><span class="anim-btn__label">'+h+"</span></button>"}).join(""),e.querySelectorAll(".anim-btn:not([disabled])").forEach(r=>{r.addEventListener("click",()=>{const a=r.dataset.anim;this.animationManager.crossfadeTo(a),this.invalidate(),this._recomputeAnimating(),this._updateRenderLoop()})}),this._onAnimHotkey||(this._onAnimHotkey=r=>{if(r.target&&/INPUT|TEXTAREA|SELECT/.test(r.target.tagName)||r.metaKey||r.ctrlKey||r.altKey)return;const a=parseInt(r.key,10);if(!a||a<1||a>9)return;const c=this.animationManager.getAnimationDefs()[a-1];!c||!this.animationManager.isLoaded(c.name)||(this.animationManager.crossfadeTo(c.name),this.invalidate(),this._recomputeAnimating(),this._updateRenderLoop())},document.addEventListener("keydown",this._onAnimHotkey))}clear(){this.content&&(this.animationManager.detach(),this._animPanelEl&&(this._animPanelEl.remove(),this._animPanelEl=null),this.modelInfo&&(this.modelInfo.remove(),this.modelInfo=null),this.annotationEls.forEach(e=>e.el.remove()),this.annotationEls=[],this.scene.remove(this.content),this.content.traverse(e=>{e.geometry&&e.geometry.dispose()}),Jm(this.content,e=>{for(const t in e)t!=="envMap"&&e[t]&&e[t].isTexture&&e[t].dispose()}),this.content=null,this._disposed||this.invalidate())}dispose(){if(!this._disposed){if(this._disposed=!0,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._onResize,!1),window.removeEventListener("keydown",this._onKeyDown),this._onAnimHotkey&&(document.removeEventListener("keydown",this._onAnimHotkey),this._onAnimHotkey=null),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=null),this.clear(),this.mixer){this.mixer.stopAllAction();const e=this.mixer.getRoot();e&&this.mixer.uncacheRoot(e),this.mixer=null}this.clips=[],this.animationManager.dispose(),this._animPanelEl&&(this._animPanelEl.remove(),this._animPanelEl=null),this.skeletonHelpers.length&&(this.skeletonHelpers.forEach(e=>{this.scene.remove(e),e.dispose?.()}),this.skeletonHelpers.length=0),this.gridHelper&&(this.scene.remove(this.gridHelper),this.gridHelper.geometry?.dispose(),this.gridHelper.material?.dispose(),this.gridHelper=null),this.axesHelper&&(this.scene.remove(this.axesHelper),this.axesHelper.geometry?.dispose(),this.axesHelper.material?.dispose(),this.axesHelper=null),this.axesCorner&&(this.axesScene?.remove(this.axesCorner),this.axesCorner.geometry?.dispose(),this.axesCorner.material?.dispose(),this.axesCorner=null),this.lights.forEach(e=>e.parent?.remove(e)),this.lights=[],this.annotationEls.length&&(this.annotationEls.forEach(e=>e.el.remove()),this.annotationEls=[]),this.modelInfo&&(this.modelInfo.remove(),this.modelInfo=null),this.gui&&(this.gui.destroy(),this.gui=null),this._guiWrap&&(this._guiWrap.remove(),this._guiWrap=null),this._guiToggle&&(this._guiToggle.remove(),this._guiToggle=null),this.stats?.dom&&this.stats.dom.remove(),this.controls&&(this._onControlsChange&&(this.controls.removeEventListener("change",this._onControlsChange),this._onControlsChange=null),this.controls.dispose(),this.controls=null),this._loadedEnvironment&&(this._loadedEnvironment.dispose(),this._loadedEnvironment=null),this.neutralEnvironment&&(this.neutralEnvironment.dispose(),this.neutralEnvironment=null),this.scene&&(this.scene.environment=null,this.scene.background=null),this.pmremGenerator&&(this.pmremGenerator.dispose(),this.pmremGenerator=null),this.axesRenderer&&(this.axesRenderer.dispose(),this.axesRenderer.forceContextLoss?.(),this.axesRenderer.domElement?.remove(),this.axesRenderer=null),this.axesDiv&&(this.axesDiv.remove(),this.axesDiv=null),this.axesScene=null,this.axesCamera=null,this.renderer&&(this.renderer.dispose(),this.renderer.forceContextLoss?.(),this.renderer.domElement?.remove(),window.renderer===this.renderer&&(window.renderer=null),this.renderer=null),this.scene=null,this.content=null,this.activeCamera=null,this.defaultCamera=null,this._afterAnimateHooks=null}}}class OB{constructor({model:e="claude-opus-4-6",proxyURL:t,apiKey:n,temperature:s=.7,maxTokens:r=4096,thinking:a="auto"}={}){this.model=e,this.proxyURL=t,this.apiKey=n,this.temperature=s,this.maxTokens=r,this.thinking=a}async complete({system:e,messages:t,tools:n}){const s={model:this.model,max_tokens:this.maxTokens,temperature:this.temperature,system:e,messages:t};n&&n.length&&(s.tools=n),this.thinking==="always"&&(s.thinking={type:"enabled",budget_tokens:2048});const r=this.proxyURL||"https://api.anthropic.com/v1/messages",a={"content-type":"application/json"};this.apiKey&&(a["x-api-key"]=this.apiKey,a["anthropic-version"]="2023-06-01",a["anthropic-dangerous-direct-browser-access"]="true");const o=await fetch(r,{method:"POST",headers:a,body:JSON.stringify(s)});if(!o.ok){const l=await o.text();throw new Error(`Anthropic ${o.status}: ${l}`)}const c=await o.json();return this._normalize(c)}_normalize(e){const t={text:"",toolCalls:[],thinking:"",stopReason:e.stop_reason};for(const n of e.content||[])n.type==="text"?t.text+=n.text:n.type==="thinking"?t.thinking+=n.thinking||"":n.type==="tool_use"&&t.toolCalls.push({id:n.id,name:n.name,input:n.input});return t}formatToolResults(e){return{role:"user",content:e.map(t=>({type:"tool_result",tool_use_id:t.id,content:typeof t.output=="string"?t.output:JSON.stringify(t.output),is_error:!!t.isError}))}}formatAssistantWithToolCalls(e,t){const n=[];e&&n.push({type:"text",text:e});for(const s of t)n.push({type:"tool_use",id:s.id,name:s.name,input:s.input});return{role:"assistant",content:n}}}class QB{async complete(){return{text:"",toolCalls:[],stopReason:"end_turn"}}formatToolResults(){return{role:"user",content:[]}}formatAssistantWithToolCalls(e){return{role:"assistant",content:e||""}}}function GB(i={}){const e=i.provider||"anthropic";if(e==="anthropic")return new OB(i);if(e==="none")return new QB;throw new Error(`Unsupported provider: ${e}. Supported: anthropic, none`)}class HB{constructor({voiceId:e="default",rate:t=1,pitch:n=1,lang:s="en-US"}={}){this.voiceId=e,this.rate=t,this.pitch=n,this.lang=s,this._queue=[],this._speaking=!1}async speak(e,{onStart:t,onEnd:n}={}){if("speechSynthesis"in window)return new Promise(s=>{const r=new SpeechSynthesisUtterance(e);r.rate=this.rate,r.pitch=this.pitch,r.lang=this.lang;const a=this._pickVoice();a&&(r.voice=a),r.onstart=()=>{this._speaking=!0,t?.()},r.onend=()=>{this._speaking=!1,n?.(),s()},r.onerror=()=>{this._speaking=!1,s()},window.speechSynthesis.speak(r)})}cancel(){"speechSynthesis"in window&&window.speechSynthesis.cancel(),this._speaking=!1}get speaking(){return this._speaking}_pickVoice(){if(!("speechSynthesis"in window))return null;const e=window.speechSynthesis.getVoices();if(this.voiceId&&this.voiceId!=="default"){const t=e.find(n=>n.name===this.voiceId||n.voiceURI===this.voiceId);if(t)return t}return e.find(t=>t.lang?.startsWith(this.lang.slice(0,2)))||null}}class zB{constructor({language:e="en-US",continuous:t=!1,interimResults:n=!0}={}){this.language=e,this.continuous=t,this.interimResults=n,this._recognition=null,this._listening=!1}_ensure(){if(this._recognition)return this._recognition;const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(!e)return null;const t=new e;return t.lang=this.language,t.continuous=this.continuous,t.interimResults=this.interimResults,this._recognition=t,t}async listen({onInterim:e,onFinal:t}={}){const n=this._ensure();if(!n)throw new Error("SpeechRecognition unavailable in this browser");return new Promise((s,r)=>{let a="";n.onresult=o=>{for(let c=o.resultIndex;c<o.results.length;c++){const l=o.results[c],h=l[0].transcript;l.isFinal?(a+=h,t?.(h)):e?.(h)}},n.onerror=o=>{this._listening=!1,r(o.error)},n.onend=()=>{this._listening=!1,s(a.trim())},this._listening=!0;try{n.start()}catch(o){this._listening=!1,r(o)}})}stop(){this._recognition&&this._listening&&this._recognition.stop()}get listening(){return this._listening}}class VB{constructor({voiceId:e,modelId:t="eleven_turbo_v2_5",apiKey:n=null,proxyURL:s=null,rate:r=1,pitch:a=1,lang:o="en-US",stability:c=.5,similarityBoost:l=.75,useSpeakerBoost:h=!0}={}){if(!e)throw new Error("ElevenLabsTTS requires voiceId");this.voiceId=e,this.modelId=t,this.apiKey=n,this.proxyURL=s,this.rate=r,this.pitch=a,this.lang=o,this.stability=c,this.similarityBoost=l,this.useSpeakerBoost=h,this._speaking=!1,this._abort=null,this._audio=null,this._mediaSourceURL=null,this._onEnd=null}async speak(e,{onStart:t,onEnd:n}={}){if(this.cancel(),!e)return;this._abort=new AbortController,this._speaking=!0;const s=this.proxyURL||`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(this.voiceId)}/stream`,r={"content-type":"application/json",accept:"audio/mpeg"};!this.proxyURL&&this.apiKey&&(r["xi-api-key"]=this.apiKey);const a=Math.min(1.5,Math.max(.5,this.rate)),o=Math.min(1,Math.max(0,(a-.5)/1)),c=JSON.stringify({text:e,model_id:this.modelId,voice_settings:{stability:this.stability,similarity_boost:this.similarityBoost,style:o,use_speaker_boost:this.useSpeakerBoost},voiceId:this.voiceId,modelId:this.modelId});let l;try{l=await fetch(s,{method:"POST",headers:r,body:c,signal:this._abort.signal})}catch(d){if(this._speaking=!1,d.name==="AbortError")return;throw d}if(!l.ok)throw this._speaking=!1,new Error(`ElevenLabs TTS HTTP ${l.status}`);const h=typeof MediaSource<"u"&&MediaSource.isTypeSupported("audio/mpeg"),u=d=>{this._startedFired||(this._startedFired=!0,d?.())};return this._startedFired=!1,new Promise(d=>{this._onEnd=()=>{this._speaking=!1,this._cleanupAudio(),n?.(),this._onEnd=null,d()};const f=()=>{this._onEnd&&this._onEnd()};h&&l.body?this._playStreamingMSE(l.body,()=>u(t),f):this._playBuffered(l,()=>u(t),f)})}cancel(){if(this._abort){try{this._abort.abort()}catch{}this._abort=null}this._cleanupAudio(),this._speaking=!1,this._onEnd&&this._onEnd()}get speaking(){return this._speaking}_playStreamingMSE(e,t,n){const s=new MediaSource;this._mediaSourceURL=URL.createObjectURL(s);const r=new Audio(this._mediaSourceURL);this._audio=r,r.preload="auto",r.addEventListener("playing",t,{once:!0}),r.addEventListener("ended",()=>this._onEnd?.(),{once:!0}),r.addEventListener("error",()=>n?.(),{once:!0}),s.addEventListener("sourceopen",async()=>{let a;try{a=s.addSourceBuffer("audio/mpeg")}catch{n?.();return}const o=e.getReader(),c=[];let l=!0;const h=()=>{if(!l||a.updating)return;const u=c.shift();if(u)try{a.appendBuffer(u)}catch{l=!1;try{s.endOfStream()}catch{}}};a.addEventListener("updateend",h);try{for(;l;){const{value:u,done:d}=await o.read();if(d){l=!1;const f=()=>{if(a.updating||c.length)setTimeout(f,30);else try{s.endOfStream()}catch{}};f();break}c.push(u),h()}}catch(u){u.name!=="AbortError"&&n?.()}}),r.play().catch(n)}async _playBuffered(e,t,n){try{const s=await e.blob(),r=URL.createObjectURL(s);this._mediaSourceURL=r;const a=new Audio(r);this._audio=a,a.addEventListener("playing",t,{once:!0}),a.addEventListener("ended",()=>this._onEnd?.(),{once:!0}),a.addEventListener("error",()=>n?.(),{once:!0}),await a.play()}catch(s){s.name!=="AbortError"&&n?.()}}_cleanupAudio(){if(this._audio){try{this._audio.pause()}catch{}this._audio.src="",this._audio=null}if(this._mediaSourceURL){try{URL.revokeObjectURL(this._mediaSourceURL)}catch{}this._mediaSourceURL=null}this._startedFired=!1}}function WB(i={}){const e=i.provider||"browser";if(e==="none")return null;if(e==="browser")return new HB(i);if(e==="elevenlabs")return new VB(i);throw new Error(`TTS provider "${e}" not implemented yet`)}function qB(i={}){const e=i.provider||"browser";if(e==="none")return null;if(e==="browser")return new zB(i);throw new Error(`STT provider "${e}" not implemented yet`)}const s0=[{name:"wave",description:"Wave at the user. Use for greetings, farewells, or acknowledgments.",input_schema:{type:"object",properties:{duration_ms:{type:"integer",minimum:500,maximum:5e3,default:1500}}}},{name:"lookAt",description:"Direct the agent's gaze toward a target.",input_schema:{type:"object",properties:{target:{type:"string",enum:["user","camera","center"],description:"Where to look"}},required:["target"]}},{name:"play_clip",description:"Play a named animation clip from the loaded body.",input_schema:{type:"object",properties:{name:{type:"string"},loop:{type:"boolean",default:!1},fade_ms:{type:"integer",default:200}},required:["name"]}},{name:"setExpression",description:"Set facial expression via morph target preset.",input_schema:{type:"object",properties:{preset:{type:"string",enum:["neutral","happy","sad","surprised","confused","focused"]},intensity:{type:"number",minimum:0,maximum:1,default:1}},required:["preset"]}},{name:"speak",description:"Say something out loud via TTS. Use this instead of plain text when voice is on.",input_schema:{type:"object",properties:{text:{type:"string"}},required:["text"]}},{name:"remember",description:"Save a durable memory about the user, a feedback rule, a project fact, or a reference.",input_schema:{type:"object",properties:{key:{type:"string",description:'short snake_case filename, e.g. "user_role"'},name:{type:"string"},description:{type:"string"},type:{type:"string",enum:["user","feedback","project","reference"]},body:{type:"string"}},required:["key","name","description","type","body"]}}],KB={async wave(i,e){const t=i.duration_ms||1500;return await e.viewer.playAnimationByHint?.("wave",{duration:t}),e.memory.note("waved",{duration_ms:t}),{ok:!0}},async lookAt(i,e){const t=i.target||"user";return e.viewer.lookAt?.(t),{ok:!0,target:t}},async play_clip(i,e){const{name:t,loop:n=!1,fade_ms:s=200}=i,r=e.viewer.resolveAnimationSlot?.(t)??t;return e.viewer.playClipByName?.(r,{loop:n,fade_ms:s})?{ok:!0,name:t,resolved:r}:(r!==t&&console.warn(`[play_clip] slot "${t}" → "${r}" not found in library`),{ok:!1,error:`No clip named "${r}"`})},async setExpression(i,e){const{preset:t,intensity:n=1}=i;return e.viewer.setExpression?.(t,n),{ok:!0,preset:t}},async speak(i,e){return await e.speak(i.text),{ok:!0}},async remember(i,e){const{key:t,name:n,description:s,type:r,body:a}=i;return e.memory.write(t,{name:n,description:s,type:r,body:a}),{ok:!0,saved:t}},async observe_agents(i,e){return e.stage?{ok:!0,agents:e.stage.getAgents().filter(n=>n.agentId!==e.agentId).map(({agentId:n,name:s,position:r})=>({agentId:n,name:s,position:r}))}:{ok:!1,error:"not on a stage"}},async say_to_agent(i,e){if(!e.stage)return{ok:!1,error:"not on a stage"};const{agentId:t,text:n}=i;if(!t||!n)return{ok:!1,error:"agentId and text required"};const s=e.agentId||"anon";return e.stage.broadcast(s,{kind:"direct",to:t,text:n}),e.stage.routeMessage(s,t,n)}},jB=8;class r0 extends EventTarget{constructor({manifest:e,viewer:t,memory:n,skills:s,providerConfig:r={},voiceConfig:a={}}={}){super(),this.manifest=e||{},this.viewer=t,this.memory=n,this.skills=s,this.provider=GB({...this.manifest.brain,...r}),this.tts=WB({...this.manifest.voice?.tts,...a.tts}),this.stt=qB({...this.manifest.voice?.stt,...a.stt}),this.messages=[],this._busy=!1}get systemPrompt(){const e=[];return this.manifest.instructions&&e.push(this.manifest.instructions),this.memory&&e.push(`<memory>`+this.memory.contextBlock({maxTokens:this.manifest.memory?.maxTokens||8192})+`-</memory>`),this.skills&&e.push(this.skills.systemPrompt()),e.join("")}get tools(){const e=new Set(this.manifest.tools||Zm.map(s=>s.name)),t=Zm.filter(s=>e.has(s.name)),n=this.skills?this.skills.allTools():[];return[...t,...n]}async send(e,{voice:t=!1}={}){if(this._busy)throw new Error("Runtime busy — wait for current turn to finish");this._busy=!0;try{this.memory?.note("user_said",{text:e}),this.messages.push({role:"user",content:e}),this.dispatchEvent(new CustomEvent("brain:message",{detail:{role:"user",content:e}}));const n=await this._loop();return t&&n.text&&this.tts&&(this.dispatchEvent(new CustomEvent("voice:speech-start",{detail:{text:n.text}})),await this.tts.speak(n.text),this.dispatchEvent(new CustomEvent("voice:speech-end",{}))),n}finally{this._busy=!1}}async _loop(){let e=0,t="";for(;e++<QB;){const n=await this.provider.complete({system:this.systemPrompt,messages:this.messages,tools:this.tools});if(n.thinking&&this.dispatchEvent(new CustomEvent("brain:thinking",{detail:{content:n.thinking}})),!n.toolCalls.length){t=n.text,this.messages.push({role:"assistant",content:n.text}),this.dispatchEvent(new CustomEvent("brain:message",{detail:{role:"assistant",content:n.text}}));break}this.messages.push(this.provider.formatAssistantWithToolCalls(n.text,n.toolCalls)),n.text&&this.dispatchEvent(new CustomEvent("brain:message",{detail:{role:"assistant",content:n.text}}));const s=[];for(const r of n.toolCalls){let a,o=!1;try{a=await this._dispatchTool(r)}catch(c){a={error:c.message||String(c)},o=!0}this.dispatchEvent(new CustomEvent("skill:tool-called",{detail:{tool:r.name,args:r.input,result:a}})),s.push({id:r.id,output:a,isError:o})}this.messages.push(this.provider.formatToolResults(s))}return{text:t}}async _dispatchTool(e){const t=this._context(),n=this.skills?.findSkillForTool(e.name);if(n)return n.invoke(e.name,e.input,t);const s=OB[e.name];if(!s)throw new Error(`Unknown tool: ${e.name}`);return s(e.input,t)}_context(){return this.skills,{viewer:this.viewer,memory:this.memory,llm:{complete:(e,t)=>this.provider.complete({system:t?.system||"",messages:[{role:"user",content:e}],tools:t?.tools})},speak:async e=>{this.tts&&(this.dispatchEvent(new CustomEvent("voice:speech-start",{detail:{text:e}})),await this.tts.speak(e),this.dispatchEvent(new CustomEvent("voice:speech-end",{})))},listen:e=>this.stt?.listen(e),fetch:(e,t)=>fetch(e,t),loadGLB:async e=>this.viewer.loadGLB?.(e),loadClip:async e=>this.viewer.loadClip?.(e),loadJSON:async e=>(await fetch(e)).json(),call:async(e,t)=>this._dispatchTool({name:e,input:t})}}async listen({onInterim:e,onFinal:t}={}){if(!this.stt)throw new Error("STT not configured");return this.dispatchEvent(new CustomEvent("voice:listen-start",{})),await this.stt.listen({onInterim:s=>{this.dispatchEvent(new CustomEvent("voice:transcript",{detail:{text:s,final:!1}})),e?.(s)},onFinal:s=>{this.dispatchEvent(new CustomEvent("voice:transcript",{detail:{text:s,final:!0}})),t?.(s)}})}clearConversation(){this.messages=[]}pause(){this.tts?.cancel(),this.stt?.stop()}destroy(){this.pause(),this.messages=[]}}const Hd=["https://dweb.link/ipfs/","https://cloudflare-ipfs.com/ipfs/","https://ipfs.io/ipfs/"],GB="https://arweave.net/";function Ps(i,e=0){if(!i)return i;const t=i.match(/^ipfs:\/\/(.+)$/i);if(t)return Hd[e%Hd.length]+t[1];const n=i.match(/^ar:\/\/(.+)$/i);return n?GB+n[1]:i}async function e0(i){let e;for(let t=0;t<Hd.length;t++){const n=Ps(i,t);try{const s=await fetch(n);if(s.ok)return s}catch(s){e=s}}throw e||new Error("All IPFS gateways failed for "+i)}const t0={neutral:{},happy:{mouthSmile:1,browInnerUp:.3,cheekSquintL:.4,cheekSquintR:.4},sad:{mouthFrownL:.8,mouthFrownR:.8,browDownL:.6,browDownR:.6},surprised:{jawOpen:.5,eyeWideL:.8,eyeWideR:.8,browInnerUp:.9},confused:{browInnerUp:.5,browOuterUpL:.4,mouthPressL:.3,mouthPressR:.3},focused:{browDownL:.4,browDownR:.4,eyeSquintL:.3,eyeSquintR:.3}};class n0{constructor(e){this.viewer=e,this._loader=new Vu,this._userTarget=new H(0,1.6,2)}get scene(){return this.viewer.scene}get mixer(){return this.viewer.mixer}get clips(){return this.viewer.clips||[]}get content(){return this.viewer.content}async load(e,t="",n=new Map){return this.viewer.load(e,t,n)}playClipByName(e,{loop:t=!1,fade_ms:n=200}={}){const s=this._findClip(e);if(!s||!this.viewer.mixer)return!1;const r=this.viewer.mixer.clipAction(s);return r.reset(),r.setLoop(t?2201:2200),r.clampWhenFinished=!t,r.fadeIn(n/1e3),r.play(),this.viewer.state.actionStates[s.name]=!0,this.viewer.invalidate(),!0}playAnimationByHint(e,t){const n=e.toLowerCase(),s=this.clips.find(r=>r.name.toLowerCase().includes(n));return s?this.playClipByName(s.name,t):!1}stopClip(e){if(!this.viewer.mixer)return;const t=e?this._findClip(e):null;if(t){const n=this.viewer.mixer.existingAction(t);n&&n.fadeOut(.2),this.viewer.state.actionStates[t.name]=!1}else{this.viewer.mixer.stopAllAction();for(const n in this.viewer.state.actionStates)this.viewer.state.actionStates[n]=!1}this.viewer.invalidate()}async play(e,t){if(typeof e=="string")return this.playClipByName(e,t);if(!this.viewer.mixer||!e)return!1;const n=this.viewer.mixer.clipAction(e);return n.reset(),n.fadeIn(t?.blend??.2),n.play(),this.viewer.invalidate(),!0}async loadClip(e){const t=Ps(e);return new Promise((n,s)=>{this._loader.load(t,r=>n(r.animations?.[0]||null),void 0,s)})}async loadGLB(e){const t=Ps(e);return new Promise((n,s)=>{this._loader.load(t,n,void 0,s)})}lookAt(e){const t=this._resolveTarget(e);if(!t||!this.viewer.content)return;const n=this._findBone(["Head","head","mixamorigHead"]);n?n.lookAt(t):this.viewer.content.lookAt(t.x,this.viewer.content.position.y,t.z),this.viewer.invalidate()}_resolveTarget(e){return e instanceof H?e:e==="camera"?this.viewer.activeCamera.position.clone():e==="center"?new H(0,1,0):e==="user"?this.viewer.renderer?.xr?.isPresenting?this.viewer.renderer.xr.getCamera().position.clone():this._userTarget.clone():null}_findBone(e){if(!this.viewer.content)return null;let t=null;return this.viewer.content.traverse(n=>{t||n.isBone&&e.includes(n.name)&&(t=n)}),t}setExpression(e,t=1){const n=t0[e]||t0.neutral;this.viewer.content&&(this.viewer.content.traverse(s=>{if(!(!s.morphTargetDictionary||!s.morphTargetInfluences)){for(let r=0;r<s.morphTargetInfluences.length;r++)s.morphTargetInfluences[r]=0;for(const[r,a]of Object.entries(n)){const o=s.morphTargetDictionary[r];o!==void 0&&(s.morphTargetInfluences[o]=a*t)}}}),this.viewer.invalidate())}moveTo(e,{duration:t=600}={}){if(!this.viewer.content)return;const n=this.viewer.content.position.clone(),s=new H(e.x||0,e.y||n.y,e.z||0),r=performance.now(),a=o=>{const c=performance.now()-r,l=Math.min(c/t,1),h=l<.5?2*l*l:1-Math.pow(-2*l+2,2)/2;this.viewer.content.position.lerpVectors(n,s,h),this.viewer.invalidate(),l>=1&&this._removeHook(a)};this._addHook(a)}_addHook(e){this.viewer._afterAnimateHooks||(this.viewer._afterAnimateHooks=[]),this.viewer._afterAnimateHooks.push(e),this.viewer._animating=!0,this.viewer.invalidate()}_removeHook(e){const t=this.viewer._afterAnimateHooks;if(!t)return;const n=t.indexOf(e);n>=0&&t.splice(n,1)}_findClip(e){if(!this.clips.length)return null;const t=this.clips.find(s=>s.name===e);if(t)return t;const n=e.toLowerCase();return this.clips.find(s=>s.name.toLowerCase()===n)||this.clips.find(s=>s.name.toLowerCase().includes(n))}}function HB(i,e){return/^([a-z]+:|\/)/i.test(e)?e:(i.endsWith("/")||(i+="/"),i+e)}class i0{constructor({uri:e,manifest:t,instructions:n,tools:s,handlers:r}){this.uri=e,this.manifest=t,this.name=t.name,this.version=t.version,this.instructions=n,this.tools=s||[],this.handlers=r||{}}async invoke(e,t,n){const s=this.handlers[e];if(!s)throw new Error(`Skill "${this.name}" has no handler for tool "${e}"`);const r={...n,skillBaseURI:this.uri};return s(t,r)}systemPromptFragment(){return this.instructions?`+</memory>`),this.skills&&e.push(this.skills.systemPrompt()),e.join("")}get tools(){const e=new Set(this.manifest.tools||s0.map(s=>s.name)),t=s0.filter(s=>e.has(s.name)),n=this.skills?this.skills.allTools():[];return[...t,...n]}async send(e,{voice:t=!1}={}){if(this._busy)throw new Error("Runtime busy — wait for current turn to finish");this._busy=!0;try{this.memory?.note("user_said",{text:e}),this.messages.push({role:"user",content:e}),this.dispatchEvent(new CustomEvent("brain:message",{detail:{role:"user",content:e}}));const n=await this._loop();return t&&n.text&&this.tts&&(this.dispatchEvent(new CustomEvent("voice:speech-start",{detail:{text:n.text}})),await this.tts.speak(n.text),this.dispatchEvent(new CustomEvent("voice:speech-end",{}))),n}finally{this._busy=!1}}async _loop(){let e=0,t="";for(;e++<jB;){const n=await this.provider.complete({system:this.systemPrompt,messages:this.messages,tools:this.tools});if(n.thinking&&this.dispatchEvent(new CustomEvent("brain:thinking",{detail:{content:n.thinking}})),!n.toolCalls.length){t=n.text,this.messages.push({role:"assistant",content:n.text}),this.dispatchEvent(new CustomEvent("brain:message",{detail:{role:"assistant",content:n.text}}));break}this.messages.push(this.provider.formatAssistantWithToolCalls(n.text,n.toolCalls)),n.text&&this.dispatchEvent(new CustomEvent("brain:message",{detail:{role:"assistant",content:n.text}}));const s=[];for(const r of n.toolCalls){let a,o=!1;try{a=await this._dispatchTool(r)}catch(c){a={error:c.message||String(c)},o=!0}this.dispatchEvent(new CustomEvent("skill:tool-called",{detail:{tool:r.name,args:r.input,result:a}})),s.push({id:r.id,output:a,isError:o})}this.messages.push(this.provider.formatToolResults(s))}return{text:t}}async _dispatchTool(e){const t=this._context(),n=this.skills?.findSkillForTool(e.name);if(n)return n.invoke(e.name,e.input,t);const s=KB[e.name];if(!s)throw new Error(`Unknown tool: ${e.name}`);return s(e.input,t)}_context(){return this.skills,{viewer:this.viewer,memory:this.memory,llm:{complete:(e,t)=>this.provider.complete({system:t?.system||"",messages:[{role:"user",content:e}],tools:t?.tools})},speak:async e=>{this.tts&&(this.dispatchEvent(new CustomEvent("voice:speech-start",{detail:{text:e}})),await this.tts.speak(e),this.dispatchEvent(new CustomEvent("voice:speech-end",{})))},listen:e=>this.stt?.listen(e),fetch:(e,t)=>fetch(e,t),loadGLB:async e=>this.viewer.loadGLB?.(e),loadClip:async e=>this.viewer.loadClip?.(e),loadJSON:async e=>(await fetch(e)).json(),call:async(e,t)=>this._dispatchTool({name:e,input:t})}}async listen({onInterim:e,onFinal:t}={}){if(!this.stt)throw new Error("STT not configured");return this.dispatchEvent(new CustomEvent("voice:listen-start",{})),await this.stt.listen({onInterim:s=>{this.dispatchEvent(new CustomEvent("voice:transcript",{detail:{text:s,final:!1}})),e?.(s)},onFinal:s=>{this.dispatchEvent(new CustomEvent("voice:transcript",{detail:{text:s,final:!0}})),t?.(s)}})}clearConversation(){this.messages=[]}pause(){this.tts?.cancel(),this.stt?.stop()}destroy(){this.pause(),this.messages=[]}}const jd=["https://dweb.link/ipfs/","https://cloudflare-ipfs.com/ipfs/","https://ipfs.io/ipfs/"],XB="https://arweave.net/";function ks(i,e=0){if(!i)return i;const t=i.match(/^ipfs:\/\/(.+)$/i);if(t)return jd[e%jd.length]+t[1];const n=i.match(/^ar:\/\/(.+)$/i);return n?XB+n[1]:i}async function a0(i){let e;for(let t=0;t<jd.length;t++){const n=ks(i,t);try{const s=await fetch(n);if(s.ok)return s}catch(s){e=s}}throw e||new Error("All IPFS gateways failed for "+i)}const YB={idle:"idle",wave:"wave",nod:"yes",shake:"no",think:"sitting",celebrate:"dance",concern:"standing",bow:"wave",point:"standing",shrug:"standing"};function JB(i,e){return e&&e[i]?e[i]:YB[i]??i}const o0={neutral:{},happy:{mouthSmile:1,browInnerUp:.3,cheekSquintL:.4,cheekSquintR:.4},sad:{mouthFrownL:.8,mouthFrownR:.8,browDownL:.6,browDownR:.6},surprised:{jawOpen:.5,eyeWideL:.8,eyeWideR:.8,browInnerUp:.9},confused:{browInnerUp:.5,browOuterUpL:.4,mouthPressL:.3,mouthPressR:.3},focused:{browDownL:.4,browDownR:.4,eyeSquintL:.3,eyeSquintR:.3}};class c0{constructor(e){this.viewer=e,this._loader=new Yu,this._userTarget=new H(0,1.6,2),this._animationMap={}}get scene(){return this.viewer.scene}get mixer(){return this.viewer.mixer}get clips(){return this.viewer.clips||[]}get content(){return this.viewer.content}setAnimationMap(e){this._animationMap=e||{}}resolveAnimationSlot(e){return JB(e,this._animationMap)}async load(e,t="",n=new Map){return this.viewer.load(e,t,n)}playClipByName(e,{loop:t=!1,fade_ms:n=200}={}){const s=this._findClip(e);if(s&&this.viewer.mixer){const a=this.viewer.mixer.clipAction(s);return a.reset(),a.setLoop(t?2201:2200),a.clampWhenFinished=!t,a.fadeIn(n/1e3),a.play(),this.viewer.state.actionStates[s.name]=!0,this.viewer.invalidate(),!0}const r=this.viewer?.animationManager;return r?.isLoaded(e)?(t?r.crossfadeTo(e,n/1e3):r.play(e),!0):!1}playAnimationByHint(e,t){const n=e.toLowerCase(),s=this.clips.find(a=>a.name.toLowerCase().includes(n));if(s)return this.playClipByName(s.name,t);const r=this.viewer?.animationManager;if(r){for(const a of r.clips.keys())if(a.toLowerCase().includes(n))return this.playClipByName(a,t)}return!1}stopClip(e){if(!this.viewer.mixer)return;const t=e?this._findClip(e):null;if(t){const n=this.viewer.mixer.existingAction(t);n&&n.fadeOut(.2),this.viewer.state.actionStates[t.name]=!1}else{this.viewer.mixer.stopAllAction();for(const n in this.viewer.state.actionStates)this.viewer.state.actionStates[n]=!1}this.viewer.invalidate()}async play(e,t){if(typeof e=="string")return this.playClipByName(e,t);if(!this.viewer.mixer||!e)return!1;const n=this.viewer.mixer.clipAction(e);return n.reset(),n.fadeIn(t?.blend??.2),n.play(),this.viewer.invalidate(),!0}async loadClip(e){const t=ks(e);return new Promise((n,s)=>{this._loader.load(t,r=>n(r.animations?.[0]||null),void 0,s)})}async loadGLB(e){const t=ks(e);return new Promise((n,s)=>{this._loader.load(t,n,void 0,s)})}lookAt(e){const t=this._resolveTarget(e);if(!t||!this.viewer.content)return;const n=this._findBone(["Head","head","mixamorigHead"]);n?n.lookAt(t):this.viewer.content.lookAt(t.x,this.viewer.content.position.y,t.z),this.viewer.invalidate()}_resolveTarget(e){return e instanceof H?e:e==="camera"?this.viewer.activeCamera.position.clone():e==="center"?new H(0,1,0):e==="user"?this.viewer.renderer?.xr?.isPresenting?this.viewer.renderer.xr.getCamera().position.clone():this._userTarget.clone():null}_findBone(e){if(!this.viewer.content)return null;let t=null;return this.viewer.content.traverse(n=>{t||n.isBone&&e.includes(n.name)&&(t=n)}),t}setExpression(e,t=1){const n=o0[e]||o0.neutral;this.viewer.content&&(this.viewer.content.traverse(s=>{if(!(!s.morphTargetDictionary||!s.morphTargetInfluences)){for(let r=0;r<s.morphTargetInfluences.length;r++)s.morphTargetInfluences[r]=0;for(const[r,a]of Object.entries(n)){const o=s.morphTargetDictionary[r];o!==void 0&&(s.morphTargetInfluences[o]=a*t)}}}),this.viewer.invalidate())}moveTo(e,{duration:t=600}={}){if(!this.viewer.content)return;const n=this.viewer.content.position.clone(),s=new H(e.x||0,e.y||n.y,e.z||0),r=performance.now(),a=o=>{const c=performance.now()-r,l=Math.min(c/t,1),h=l<.5?2*l*l:1-Math.pow(-2*l+2,2)/2;this.viewer.content.position.lerpVectors(n,s,h),this.viewer.invalidate(),l>=1&&this._removeHook(a)};this._addHook(a)}_addHook(e){this.viewer._afterAnimateHooks||(this.viewer._afterAnimateHooks=[]),this.viewer._afterAnimateHooks.push(e),this.viewer._animating=!0,this.viewer.invalidate()}_removeHook(e){const t=this.viewer._afterAnimateHooks;if(!t)return;const n=t.indexOf(e);n>=0&&t.splice(n,1)}_findClip(e){if(!this.clips.length)return null;const t=this.clips.find(s=>s.name===e);if(t)return t;const n=e.toLowerCase();return this.clips.find(s=>s.name.toLowerCase()===n)||this.clips.find(s=>s.name.toLowerCase().includes(n))}}const ZB=`// Sandbox worker — executes skill handlers in an isolated Web Worker scope.+// No DOM, no window, no document. Only ctx.* and native worker APIs.++/** @type {Map<string, object>} skillURI → module exports */+const _skillHandlers = new Map();++/** @type {Map<number, { resolve: Function, reject: Function, timeoutId: number }>} */+const _pendingRequests = new Map();++/** @type {Map<string, Promise<void>>} skillURI → install promise (deduplication) */+const _installPromises = new Map();++/** @type {Map<string, { resolve: Function, reject: Function }>} */+const _installCallbacks = new Map();++let _requestId = 0;++self.onmessage = ({ data }) => {+ switch (data.type) {+ case 'install':+ _install(data);+ break;+ case 'invoke':+ _invoke(data);+ break;+ case 'response':+ _handleResponse(data);+ break;+ }+};++async function _install({ skillURI, handlersSrc }) {+ // Deduplicate concurrent install requests for the same skill+ if (_installPromises.has(skillURI)) return;++ const promise = new Promise((resolve, reject) => {+ _installCallbacks.set(skillURI, { resolve, reject });+ });+ _installPromises.set(skillURI, promise);++ let url;+ try {+ const blob = new Blob([handlersSrc], { type: 'text/javascript' });+ url = URL.createObjectURL(blob);+ // Dynamic import from blob URL — works in module workers+ const mod = await import(/* @vite-ignore */ url);+ _skillHandlers.set(skillURI, mod);+ _installCallbacks.get(skillURI)?.resolve();+ self.postMessage({ type: 'install-ack', skillURI, ok: true });+ } catch (err) {+ _installPromises.delete(skillURI);+ _installCallbacks.get(skillURI)?.reject(err);+ _installCallbacks.delete(skillURI);+ self.postMessage({ type: 'install-ack', skillURI, ok: false, error: err.message });+ } finally {+ if (url) URL.revokeObjectURL(url);+ }+}++function _makeCtx(invocationId, skillBaseURI) {+ // Each method sends a request to main thread and awaits a structured-cloneable response.+ // Non-serializable objects (AnimationClip, GLTF) are stored in the host's handle registry+ // and represented here as opaque "@h:N" strings.+ const proxy = (method, args) =>+ new Promise((resolve, reject) => {+ const id = ++_requestId;+ const timeoutId = setTimeout(() => {+ _pendingRequests.delete(id);+ reject(new Error(\`ctx.\${method} timed out after 30s\`));+ }, 30_000);+ _pendingRequests.set(id, { resolve, reject, timeoutId });+ self.postMessage({ type: 'request', invocationId, requestId: id, method, args });+ });++ return {+ viewer: {+ play: (clip, opts) => proxy('viewer.play', [clip, opts]),+ stop: (clipName) => proxy('viewer.stop', [clipName]),+ setExpression: (preset, intensity) => proxy('viewer.setExpression', [preset, intensity]),+ lookAt: (target) => proxy('viewer.lookAt', [target]),+ moveTo: (position, opts) => proxy('viewer.moveTo', [position, opts]),+ playAnimationByHint: (hint, opts) => proxy('viewer.playAnimationByHint', [hint, opts]),+ playClipByName: (name, opts) => proxy('viewer.playClipByName', [name, opts]),+ },+ llm: {+ complete: (prompt, opts) => proxy('llm.complete', [prompt, opts]),+ embed: (text) => proxy('llm.embed', [text]),+ },+ memory: {+ read: (key) => proxy('memory.read', [key]),+ write: (key, value) => proxy('memory.write', [key, value]),+ note: (type, data) => proxy('memory.note', [type, data]),+ recall: (query) => proxy('memory.recall', [query]),+ },+ // Asset loading — results are opaque handle strings; pass back to viewer.play etc.+ loadClip: (uri) => proxy('loadClip', [uri]),+ loadGLB: (uri) => proxy('loadGLB', [uri]),+ // fetch and loadJSON use native worker fetch — no proxy needed+ fetch: (uri, opts) => fetch(uri, opts),+ loadJSON: async (uri) => (await fetch(uri)).json(),+ call: (toolName, toolArgs) => proxy('call', [toolName, toolArgs]),+ speak: (text) => proxy('speak', [text]),+ listen: (opts) => proxy('listen', [opts]),+ skillBaseURI,+ };+}++async function _invoke({ invocationId, skillURI, toolName, args, skillBaseURI }) {+ // Wait for install to complete (handles the install→invoke race)+ const installPromise = _installPromises.get(skillURI);+ if (installPromise) {+ try {+ await installPromise;+ } catch (err) {+ self.postMessage({ type: 'invoke-result', invocationId, error: \`Install failed: \${err.message}\` });+ return;+ }+ }++ const mod = _skillHandlers.get(skillURI);+ if (!mod) {+ self.postMessage({ type: 'invoke-result', invocationId, error: \`Skill not installed: \${skillURI}\` });+ return;+ }++ const fn = mod[toolName];+ if (typeof fn !== 'function') {+ self.postMessage({+ type: 'invoke-result',+ invocationId,+ error: \`No handler "\${toolName}" in skill "\${skillURI}"\`,+ });+ return;+ }++ try {+ const ctx = _makeCtx(invocationId, skillBaseURI);+ const result = await fn(args, ctx);+ self.postMessage({ type: 'invoke-result', invocationId, result: result ?? null });+ } catch (err) {+ self.postMessage({ type: 'invoke-result', invocationId, error: err.message || String(err) });+ }+}++function _handleResponse({ requestId, result, error }) {+ const pending = _pendingRequests.get(requestId);+ if (!pending) return;+ clearTimeout(pending.timeoutId);+ _pendingRequests.delete(requestId);+ if (error !== undefined) {+ pending.reject(new Error(error));+ } else {+ pending.resolve(result);+ }+}+`;let ii=null,ya=null;const wa=new Map,Fo=new Map,Us=new Map,Cl=new Map;let $B=0,eT=0;function l0(i){if(i==null)return null;const e=`@h:${++$B}`;return Cl.set(e,i),e}function tT(i){return typeof i=="string"&&i.startsWith("@h:")?Cl.get(i)??i:i}function nT(i){return Array.isArray(i)?i.map(tT):i}function h0(){if(!ii){if(!ya){const i=new Blob([ZB],{type:"text/javascript"});ya=URL.createObjectURL(i)}ii=new Worker(ya),ii.onmessage=sT,ii.onerror=iT}return ii}function iT(i){console.error("[sandbox] worker crashed:",i),ii=null,wa.clear(),Fo.clear(),Cl.clear();for(const[,e]of Us)e.reject(new Error("Sandbox worker crashed"));Us.clear()}function sT({data:i}){switch(i.type){case"install-ack":{const e=Fo.get(i.skillURI);Fo.delete(i.skillURI),i.ok?e?.resolve():(wa.delete(i.skillURI),e?.reject(new Error(i.error||"Install failed")));break}case"request":{const{invocationId:e,requestId:t,method:n,args:s}=i,r=Us.get(e);if(!r){ii?.postMessage({type:"response",requestId:t,error:"No active invocation"});return}rT(n,s,r.mainCtx).then(a=>ii?.postMessage({type:"response",requestId:t,result:a??null}),a=>ii?.postMessage({type:"response",requestId:t,error:a.message||String(a)}));break}case"invoke-result":{const{invocationId:e,result:t,error:n}=i,s=Us.get(e);if(!s)return;Us.delete(e),n!==void 0?s.reject(new Error(n)):s.resolve(t);break}}}async function rT(i,e,t){const n=nT(e);switch(i){case"viewer.play":return t.viewer?.play?.(n[0],n[1]);case"viewer.stop":return t.viewer?.stop?.(n[0]);case"viewer.setExpression":return t.viewer?.setExpression?.(n[0],n[1]);case"viewer.lookAt":return t.viewer?.lookAt?.(n[0]);case"viewer.moveTo":return t.viewer?.moveTo?.(n[0],n[1]);case"viewer.playAnimationByHint":return t.viewer?.playAnimationByHint?.(n[0],n[1]);case"viewer.playClipByName":return t.viewer?.playClipByName?.(n[0],n[1]);case"memory.read":return t.memory?.read?.(n[0]);case"memory.write":return t.memory?.write?.(n[0],n[1]);case"memory.note":return t.memory?.note?.(n[0],n[1]);case"memory.recall":return t.memory?.recall?.(n[0]);case"llm.complete":return t.llm?.complete?.(n[0],n[1]);case"llm.embed":return t.llm?.embed?.(n[0]);case"loadClip":{const s=await t.loadClip?.(n[0]);return l0(s)}case"loadGLB":{const s=await t.loadGLB?.(n[0]);return l0(s)}case"speak":return t.speak?.(n[0]);case"listen":return t.listen?.(n[0]);case"call":return t.call?.(n[0],n[1]);default:throw new Error(`Unknown ctx method: ${i}`)}}async function aT(i,e){if(wa.has(i))return wa.get(i);const t=new Promise((n,s)=>{Fo.set(i,{resolve:n,reject:s})});return wa.set(i,t),h0().postMessage({type:"install",skillURI:i,handlersSrc:e}),t}async function oT(i,e,t,n,s){await aT(i,n);const r=++eT,a=h0();return new Promise((o,c)=>{Us.set(r,{resolve:o,reject:c,mainCtx:s}),a.postMessage({type:"invoke",invocationId:r,skillURI:i,toolName:e,args:t,skillBaseURI:s.skillBaseURI||i})})}function cT(){if(ii){ii.terminate(),ii=null,ya&&(URL.revokeObjectURL(ya),ya=null),wa.clear(),Fo.clear(),Cl.clear();for(const[,i]of Us)i.reject(new Error("Sandbox terminated"));Us.clear()}}function lT(){return{invoke:oT,terminate:cT}}function hT(i,e){return/^([a-z]+:|\/)/i.test(e)?e:(i.endsWith("/")||(i+="/"),i+e)}class u0{constructor({uri:e,manifest:t,instructions:n,tools:s,handlers:r,handlersSrc:a}){this.uri=e,this.manifest=t,this.name=t.name,this.version=t.version,this.instructions=n,this.tools=s||[],this.handlers=r||{},this.handlersSrc=a||null}async invoke(e,t,n){const s={...n,skillBaseURI:this.uri};if(this.manifest.sandboxPolicy==="trusted-main-thread"){const r=this.handlers[e];if(!r)throw new Error(`Skill "${this.name}" has no handler for tool "${e}"`);return r(t,s)}if(!this.handlersSrc)throw new Error(`Skill "${this.name}" has no handler source for tool "${e}"`);return lT().invoke(this.uri,e,t,this.handlersSrc,s)}systemPromptFragment(){return this.instructions?`<skill name="${this.name}" version="${this.version}">${this.instructions}-</skill>`:""}}class s0{constructor({fetchFn:e=fetch.bind(globalThis),trust:t="owned-only",ownerAddress:n}={}){this.fetchFn=e,this.trust=t,this.ownerAddress=n?.toLowerCase(),this.skills=new Map}async install(e,{bundleBase:t}={}){const n=this._resolveBundleURI(e.uri,t);if(this.skills.has(n))return this.skills.get(n);const s=await this._fetchJSON(`${n}manifest.json`);this._enforceTrust(s);const[r,a,o]=await Promise.all([this._fetchText(`${n}SKILL.md`).catch(()=>""),this._fetchJSON(`${n}tools.json`).catch(()=>({tools:[]})),this._fetchHandlers(`${n}handlers.js`).catch(()=>null)]),c=new i0({uri:n,manifest:s,instructions:r,tools:a.tools||[],handlers:o||{}});if(s.dependencies)for(const[l,h]of Object.entries(s.dependencies))await this.install({uri:l,version:h});return this.skills.set(n,c),c}uninstall(e){for(const[t,n]of this.skills)if(n.name===e)return this.skills.delete(t),!0;return!1}all(){return Array.from(this.skills.values())}allTools(){const e=new Map;for(const t of this.skills.values())for(const n of t.tools)e.has(n.name)&&console.warn(`[skills] tool "${n.name}" overridden by skill "${t.name}"`),e.set(n.name,{...n,_skill:t.name});return Array.from(e.values())}findSkillForTool(e){for(const t of this.skills.values())if(t.tools.some(n=>n.name===e))return t;return null}systemPrompt(){return this.all().map(e=>e.systemPromptFragment()).join("")}_resolveBundleURI(e,t){let n=e;return!/^([a-z]+:|\/)/i.test(e)&&t&&(n=HB(t,e)),n.endsWith("/")||(n+="/"),(n.startsWith("ipfs://")||n.startsWith("ar://"))&&(n=Ps(n)),n}async _fetchJSON(e){const t=await this.fetchFn(e);if(!t.ok)throw new Error(`Fetch failed: ${e} (${t.status})`);return t.json()}async _fetchText(e){const t=await this.fetchFn(e);if(!t.ok)throw new Error(`Fetch failed: ${e} (${t.status})`);return t.text()}async _fetchHandlers(e){try{return await import(e)}catch(t){return console.warn(`[skills] handlers load failed: ${e}`,t),null}}_enforceTrust(e){if(this.trust!=="any"){if(this.trust==="owned-only"){const t=(e.author||"").toLowerCase();if(t&&this.ownerAddress&&t!==this.ownerAddress)throw new Error(`Skill "${e.name}" author ${t} not trusted under owned-only policy`)}this.trust}}}const zB=/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;function El(i){const e=i.match(zB);if(!e)return{meta:{},body:i};const t={};for(const n of e[1].split(`-`)){const[s,...r]=n.split(":");s&&(t[s.trim()]=r.join(":").trim())}return{meta:t,body:e[2]}}function VB(i,e){const t=["---"];for(const[n,s]of Object.entries(i))t.push(`${n}: ${s}`);return t.push("---","",e),t.join(`-`)}class xi{constructor({mode:e="local",namespace:t,index:n={},files:s={},timeline:r=[]}={}){this.mode=e,this.namespace=t,this.files=new Map(Object.entries(s)),this.timeline=r,this.indexText=n.text||"",this._dirty=!1}static async load({mode:e="local",namespace:t,manifestURI:n,fetchFn:s}){if(e==="none")return new xi({mode:"none",namespace:t});if(e==="local")return xi._loadLocal(t);if(e==="ipfs"||e==="encrypted-ipfs")return xi._loadIPFS({mode:e,namespace:t,manifestURI:n,fetchFn:s});throw new Error(`Unknown memory mode: ${e}`)}static _loadLocal(e){const t=`agent:${e}:memory`;try{const n=localStorage.getItem(t);if(!n)return new xi({mode:"local",namespace:e});const s=JSON.parse(n);return new xi({mode:"local",namespace:e,...s})}catch{return new xi({mode:"local",namespace:e})}}static async _loadIPFS({mode:e,namespace:t,manifestURI:n,fetchFn:s}){const r=n.replace(/manifest\.json$/,"");try{const a=await s(`${r}memory/MEMORY.md`),o=a.ok?await a.text():"",c={},l=/\[([^\]]+)\]\(([^)]+\.md)\)/g;let h;for(;h=l.exec(o);){const u=h[2];try{const d=await s(`${r}memory/${u}`);d.ok&&(c[u]=await d.text())}catch{}}return new xi({mode:e,namespace:t,index:{text:o},files:c})}catch{return new xi({mode:e,namespace:t})}}read(e){const t=e.endsWith(".md")?e:`${e}.md`,n=this.files.get(t);return n?El(n):null}write(e,{name:t,description:n,type:s,body:r,decay:a}){const o=e.endsWith(".md")?e:`${e}.md`,c=new Date().toISOString().slice(0,10),l=this.files.get(o),h=l&&El(l).meta.created||c,u={name:t,description:n,type:s,created:h,updated:c};a&&(u.decay=a),this.files.set(o,VB(u,r||"")),this._rebuildIndex(),this._dirty=!0,this._persist()}note(e,t){const n={ts:new Date().toISOString(),type:e,...t};this.timeline.push(n),this.timeline.length>1e3&&(this.timeline=this.timeline.slice(-1e3)),this._dirty=!0,this._persist()}async recall(e,{limit:t=5}={}){const n=e.toLowerCase(),s=[];for(const[r,a]of this.files){const{meta:o,body:c}=El(a),l=`${o.name||""} ${o.description||""} ${c}`.toLowerCase();l.includes(n)&&s.push({file:r,meta:o,body:c,score:l.split(n).length-1})}return s.sort((r,a)=>a.score-r.score).slice(0,t)}_rebuildIndex(){const e={user:[],feedback:[],project:[],reference:[]};for(const[s,r]of this.files){const{meta:a}=El(r),o=a.type||"user";e[o]||(e[o]=[]),e[o].push({file:s,name:a.name||s,description:a.description||""})}const t=["# Memory",""],n={user:"## User",feedback:"## Feedback",project:"## Project",reference:"## Reference"};for(const[s,r]of Object.entries(e))if(r.length){t.push(n[s]||`## ${s}`);for(const a of r)t.push(`- [${a.name}](${a.file}) — ${a.description}`);t.push("")}this.indexText=t.join(`+</skill>`:""}}class d0{constructor({fetchFn:e=fetch.bind(globalThis),trust:t="owned-only",ownerAddress:n}={}){this.fetchFn=e,this.trust=t,this.ownerAddress=n?.toLowerCase(),this.skills=new Map}async install(e,{bundleBase:t}={}){const n=this._resolveBundleURI(e.uri,t);if(this.skills.has(n))return this.skills.get(n);const s=await this._fetchJSON(`${n}manifest.json`);this._enforceTrust(s);const r=s.sandboxPolicy==="trusted-main-thread",[a,o,c]=await Promise.all([this._fetchText(`${n}SKILL.md`).catch(()=>""),this._fetchJSON(`${n}tools.json`).catch(()=>({tools:[]})),r?this._fetchHandlers(`${n}handlers.js`).catch(()=>null):this._fetchHandlersSrc(`${n}handlers.js`).catch(()=>null)]),l=new u0({uri:n,manifest:s,instructions:a,tools:o.tools||[],handlers:r?c||{}:{},handlersSrc:r?null:c});if(s.dependencies)for(const[h,u]of Object.entries(s.dependencies))await this.install({uri:h,version:u});return this.skills.set(n,l),l}uninstall(e){for(const[t,n]of this.skills)if(n.name===e)return this.skills.delete(t),!0;return!1}all(){return Array.from(this.skills.values())}allTools(){const e=new Map;for(const t of this.skills.values())for(const n of t.tools)e.has(n.name)&&console.warn(`[skills] tool "${n.name}" overridden by skill "${t.name}"`),e.set(n.name,{...n,_skill:t.name});return Array.from(e.values())}findSkillForTool(e){for(const t of this.skills.values())if(t.tools.some(n=>n.name===e))return t;return null}systemPrompt(){return this.all().map(e=>e.systemPromptFragment()).join("")}_resolveBundleURI(e,t){let n=e;return!/^([a-z]+:|\/)/i.test(e)&&t&&(n=hT(t,e)),n.endsWith("/")||(n+="/"),(n.startsWith("ipfs://")||n.startsWith("ar://"))&&(n=ks(n)),n}async _fetchJSON(e){const t=await this.fetchFn(e);if(!t.ok)throw new Error(`Fetch failed: ${e} (${t.status})`);return t.json()}async _fetchText(e){const t=await this.fetchFn(e);if(!t.ok)throw new Error(`Fetch failed: ${e} (${t.status})`);return t.text()}async _fetchHandlers(e){try{return await import(e)}catch(t){return console.warn(`[skills] handlers load failed: ${e}`,t),null}}async _fetchHandlersSrc(e){const t=await this.fetchFn(e);if(!t.ok)throw new Error(`Fetch failed: ${e} (${t.status})`);return t.text()}_enforceTrust(e){if(this.trust!=="any"){if(this.trust==="owned-only"){const t=(e.author||"").toLowerCase();if(t&&this.ownerAddress&&t!==this.ownerAddress)throw new Error(`Skill "${e.name}" author ${t} not trusted under owned-only policy`)}this.trust}}}const uT=/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;function Sl(i){const e=i.match(uT);if(!e)return{meta:{},body:i};const t={};for(const n of e[1].split(`+`)){const[s,...r]=n.split(":");s&&(t[s.trim()]=r.join(":").trim())}return{meta:t,body:e[2]}}function dT(i,e){const t=["---"];for(const[n,s]of Object.entries(i))t.push(`${n}: ${s}`);return t.push("---","",e),t.join(`+`)}class Ei{constructor({mode:e="local",namespace:t,index:n={},files:s={},timeline:r=[]}={}){this.mode=e,this.namespace=t,this.files=new Map(Object.entries(s)),this.timeline=r,this.indexText=n.text||"",this._dirty=!1}static async load({mode:e="local",namespace:t,manifestURI:n,fetchFn:s}){if(e==="none")return new Ei({mode:"none",namespace:t});if(e==="local")return Ei._loadLocal(t);if(e==="ipfs"||e==="encrypted-ipfs")return Ei._loadIPFS({mode:e,namespace:t,manifestURI:n,fetchFn:s});throw new Error(`Unknown memory mode: ${e}`)}static _loadLocal(e){const t=`agent:${e}:memory`;try{const n=localStorage.getItem(t);if(!n)return new Ei({mode:"local",namespace:e});const s=JSON.parse(n);return new Ei({mode:"local",namespace:e,...s})}catch{return new Ei({mode:"local",namespace:e})}}static async _loadIPFS({mode:e,namespace:t,manifestURI:n,fetchFn:s}){const r=n.replace(/manifest\.json$/,"");try{const a=await s(`${r}memory/MEMORY.md`),o=a.ok?await a.text():"",c={},l=/\[([^\]]+)\]\(([^)]+\.md)\)/g;let h;for(;h=l.exec(o);){const u=h[2];try{const d=await s(`${r}memory/${u}`);d.ok&&(c[u]=await d.text())}catch{}}return new Ei({mode:e,namespace:t,index:{text:o},files:c})}catch{return new Ei({mode:e,namespace:t})}}read(e){const t=e.endsWith(".md")?e:`${e}.md`,n=this.files.get(t);return n?Sl(n):null}write(e,{name:t,description:n,type:s,body:r,decay:a}){const o=e.endsWith(".md")?e:`${e}.md`,c=new Date().toISOString().slice(0,10),l=this.files.get(o),h=l&&Sl(l).meta.created||c,u={name:t,description:n,type:s,created:h,updated:c};a&&(u.decay=a),this.files.set(o,dT(u,r||"")),this._rebuildIndex(),this._dirty=!0,this._persist()}note(e,t){const n={ts:new Date().toISOString(),type:e,...t};this.timeline.push(n),this.timeline.length>1e3&&(this.timeline=this.timeline.slice(-1e3)),this._dirty=!0,this._persist()}async recall(e,{limit:t=5}={}){const n=e.toLowerCase(),s=[];for(const[r,a]of this.files){const{meta:o,body:c}=Sl(a),l=`${o.name||""} ${o.description||""} ${c}`.toLowerCase();l.includes(n)&&s.push({file:r,meta:o,body:c,score:l.split(n).length-1})}return s.sort((r,a)=>a.score-r.score).slice(0,t)}_rebuildIndex(){const e={user:[],feedback:[],project:[],reference:[]};for(const[s,r]of this.files){const{meta:a}=Sl(r),o=a.type||"user";e[o]||(e[o]=[]),e[o].push({file:s,name:a.name||s,description:a.description||""})}const t=["# Memory",""],n={user:"## User",feedback:"## Feedback",project:"## Project",reference:"## Reference"};for(const[s,r]of Object.entries(e))if(r.length){t.push(n[s]||`## ${s}`);for(const a of r)t.push(`- [${a.name}](${a.file}) — ${a.description}`);t.push("")}this.indexText=t.join(``)}_persist(){if(this.mode!=="local"||!this.namespace)return;const e=`agent:${this.namespace}:memory`,t={index:{text:this.indexText},files:Object.fromEntries(this.files),timeline:this.timeline.slice(-200)};try{localStorage.setItem(e,JSON.stringify(t))}catch(n){console.warn("[memory] persist failed",n)}}contextBlock({maxTokens:e=8192}={}){const t=e*4,n=["# Agent Memory","",this.indexText];let s=n.join(``).length;for(const[r,a]of this.files){if(s+a.length>t)break;n.push("",`## ${r}`,a),s+=a.length}if(this.timeline.length){const a=this.timeline.slice(-20).map(o=>JSON.stringify(o)).join(``);s+a.length<t&&n.push("","## Recent timeline","```",a,"```")}return n.join(`-`)}async export(){return{version:"memory/0.1",index:this.indexText,files:Object.fromEntries(this.files),timeline:this.timeline}}async import(e,{strategy:t="merge"}={}){if(t==="replace")this.files=new Map(Object.entries(e.files||{})),this.timeline=e.timeline||[];else{for(const[n,s]of Object.entries(e.files||{}))this.files.has(n)||this.files.set(n,s);this.timeline=[...this.timeline,...e.timeline||[]].slice(-1e3)}this._rebuildIndex(),this._persist()}}const WB="6.16.0";function qB(i,e,t){const n=e.split("|").map(r=>r.trim());for(let r=0;r<n.length;r++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof i===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=i,s}async function Fn(i){const e=Object.keys(i);return(await Promise.all(e.map(n=>Promise.resolve(i[n])))).reduce((n,s,r)=>(n[e[r]]=s,n),{})}function Ye(i,e,t){for(let n in e){let s=e[n];const r=t?t[n]:null;r&&qB(s,r,n),Object.defineProperty(i,n,{enumerable:!0,value:s,writable:!1})}}function Ea(i,e){if(i==null)return"null";if(e==null&&(e=new Set),typeof i=="object"){if(e.has(i))return"[Circular]";e.add(i)}if(Array.isArray(i))return"[ "+i.map(t=>Ea(t,e)).join(", ")+" ]";if(i instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let s=0;s<i.length;s++)n+=t[i[s]>>4],n+=t[i[s]&15];return n}if(typeof i=="object"&&typeof i.toJSON=="function")return Ea(i.toJSON(),e);switch(typeof i){case"boolean":case"number":case"symbol":return i.toString();case"bigint":return BigInt(i).toString();case"string":return JSON.stringify(i);case"object":{const t=Object.keys(i);return t.sort(),"{ "+t.map(n=>`${Ea(n,e)}: ${Ea(i[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function _n(i,e){return i&&i.code===e}function zd(i){return _n(i,"CALL_EXCEPTION")}function Qt(i,e,t){let n=i;{const r=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${Ea(t)}`);for(const a in t){if(a==="shortMessage")continue;const o=t[a];r.push(a+"="+Ea(o))}}r.push(`code=${e}`),r.push(`version=${WB}`),r.length&&(i+=" ("+r.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(i);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(i);break;default:s=new Error(i)}return Ye(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&Ye(s,{shortMessage:n}),s}function pe(i,e,t,n){if(!i)throw Qt(e,t,n)}function V(i,e,t,n){pe(i,e,"INVALID_ARGUMENT",{argument:t,value:n})}function r0(i,e,t){t==null&&(t=""),t&&(t=": "+t),pe(i>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:i,expectedCount:e}),pe(i<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:i,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((i,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");i.push(e)}catch{}return i},[]);function _l(i,e,t){if(t==null&&(t=""),i!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),pe(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function a0(i,e,t){if(i instanceof Uint8Array)return t?new Uint8Array(i):i;if(typeof i=="string"&&i.length%2===0&&i.match(/^0x[0-9a-f]*$/i)){const n=new Uint8Array((i.length-2)/2);let s=2;for(let r=0;r<n.length;r++)n[r]=parseInt(i.substring(s,s+2),16),s+=2;return n}V(!1,"invalid BytesLike value",e||"value",i)}function lt(i,e){return a0(i,e,!1)}function Dn(i,e){return a0(i,e,!0)}function Ft(i,e){return!(typeof i!="string"||!i.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&i.length!==2+2*e||e===!0&&i.length%2!==0)}function Vd(i){return Ft(i,!0)||i instanceof Uint8Array}const o0="0123456789abcdef";function ve(i){const e=lt(i);let t="0x";for(let n=0;n<e.length;n++){const s=e[n];t+=o0[(s&240)>>4]+o0[s&15]}return t}function Ut(i){return"0x"+i.map(e=>ve(e).substring(2)).join("")}function _a(i){return Ft(i,!0)?(i.length-2)/2:lt(i).length}function Vt(i,e,t){const n=lt(i);return t!=null&&t>n.length&&pe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),ve(n.slice(e??0,t??n.length))}function c0(i,e,t){const n=lt(i);pe(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),ve(s)}function ts(i,e){return c0(i,e,!0)}function KB(i,e){return c0(i,e,!1)}const Bo=BigInt(0),Ei=BigInt(1),ya=9007199254740991;function XB(i,e){const t=yl(i,"value"),n=BigInt(ht(e,"width"));if(pe(t>>n===Bo,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:i}),t>>n-Ei){const s=(Ei<<n)-Ei;return-((~t&s)+Ei)}return t}function l0(i,e){let t=Re(i,"value");const n=BigInt(ht(e,"width")),s=Ei<<n-Ei;if(t<Bo){t=-t,pe(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:i});const r=(Ei<<n)-Ei;return(~t&r)+Ei}else pe(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:i});return t}function To(i,e){const t=yl(i,"value"),n=BigInt(ht(e,"bits"));return t&(Ei<<n)-Ei}function Re(i,e){switch(typeof i){case"bigint":return i;case"number":return V(Number.isInteger(i),"underflow",e||"value",i),V(i>=-ya&&i<=ya,"overflow",e||"value",i),BigInt(i);case"string":try{if(i==="")throw new Error("empty string");return i[0]==="-"&&i[1]!=="-"?-BigInt(i.substring(1)):BigInt(i)}catch(t){V(!1,`invalid BigNumberish string: ${t.message}`,e||"value",i)}}V(!1,"invalid BigNumberish value",e||"value",i)}function yl(i,e){const t=Re(i,e);return pe(t>=Bo,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:i}),t}const h0="0123456789abcdef";function Wd(i){if(i instanceof Uint8Array){let e="0x0";for(const t of i)e+=h0[t>>4],e+=h0[t&15];return BigInt(e)}return Re(i)}function ht(i,e){switch(typeof i){case"bigint":return V(i>=-ya&&i<=ya,"overflow",e||"value",i),Number(i);case"number":return V(Number.isInteger(i),"underflow",e||"value",i),V(i>=-ya&&i<=ya,"overflow",e||"value",i),i;case"string":try{if(i==="")throw new Error("empty string");return ht(BigInt(i),e)}catch(t){V(!1,`invalid numeric string: ${t.message}`,e||"value",i)}}V(!1,"invalid numeric value",e||"value",i)}function YB(i){return ht(Wd(i))}function ks(i,e){const t=yl(i,"value");let n=t.toString(16);if(e==null)n.length%2&&(n="0"+n);else{const s=ht(e,"width");if(s===0&&t===Bo)return"0x";for(pe(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:i});n.length<s*2;)n="0"+n}return"0x"+n}function Zt(i,e){const t=yl(i,"value");if(t===Bo)return new Uint8Array(0);let n=t.toString(16);n.length%2&&(n="0"+n);const s=new Uint8Array(n.length/2);for(let r=0;r<s.length;r++){const a=r*2;s[r]=parseInt(n.substring(a,a+2),16)}return s}function _i(i){let e=ve(Vd(i)?i:Zt(i)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const u0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const d0=BigInt(58);function jB(i){const e=lt(i);let t=Wd(e),n="";for(;t;)n=u0[Number(t%d0)]+n,t/=d0;for(let s=0;s<e.length&&!e[s];s++)n=u0[0]+n;return n}function JB(i){i=atob(i);const e=new Uint8Array(i.length);for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return lt(e)}function ZB(i){const e=lt(i);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}class f0{filter;emitter;#e;constructor(e,t,n){this.#e=t,Ye(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}}function $B(i,e,t,n,s){V(!1,`invalid codepoint at offset ${e}; ${i}`,"bytes",t)}function p0(i,e,t,n,s){if(i==="BAD_PREFIX"||i==="UNEXPECTED_CONTINUE"){let r=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)r++;return r}return i==="OVERRUN"?t.length-e-1:0}function eT(i,e,t,n,s){return i==="OVERLONG"?(V(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),p0(i,e,t))}const tT=Object.freeze({error:$B,ignore:p0,replace:eT});function nT(i,e){e==null&&(e=tT.error);const t=lt(i,"bytes"),n=[];let s=0;for(;s<t.length;){const r=t[s++];if(r>>7===0){n.push(r);continue}let a=null,o=null;if((r&224)===192)a=1,o=127;else if((r&240)===224)a=2,o=2047;else if((r&248)===240)a=3,o=65535;else{(r&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+a>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=r&(1<<8-a-1)-1;for(let l=0;l<a;l++){let h=t[s];if((h&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|h&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-a,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-a,t,n,c);continue}if(c<=o){s+=e("OVERLONG",s-1-a,t,n,c);continue}n.push(c)}}return n}function ns(i,e){V(typeof i=="string","invalid string value","str",i);let t=[];for(let n=0;n<i.length;n++){const s=i.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;const r=i.charCodeAt(n);V(n<i.length&&(r&64512)===56320,"invalid surrogate pair","str",i);const a=65536+((s&1023)<<10)+(r&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}function iT(i){return i.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function wl(i,e){return iT(nT(i,e))}function A0(i){async function e(t,n){pe(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const s=t.url.split(":")[0].toLowerCase();pe(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),pe(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let r=null;const a=new AbortController,o=setTimeout(()=>{r=Qt("request timeout","TIMEOUT"),a.abort()},t.timeout);n&&n.addListener(()=>{r=Qt("request cancelled","CANCELLED"),a.abort()});const c=Object.assign({},i,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:a.signal});let l;try{l=await fetch(t.url,c)}catch(f){throw clearTimeout(o),r||f}clearTimeout(o);const h={};l.headers.forEach((f,m)=>{h[m.toLowerCase()]=f});const u=await l.arrayBuffer(),d=u==null?null:new Uint8Array(u);return{statusCode:l.status,statusMessage:l.statusText,headers:h,body:d}}return e}const sT=12,rT=250;let g0=A0();const aT=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),oT=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let qd=!1;async function m0(i,e){try{const t=i.match(aT);if(!t)throw new Error("invalid data");return new Us(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?JB(t[3]):lT(t[3]))}catch{return new Us(599,"BAD REQUEST (invalid data: URI)",{},null,new Li(i))}}function b0(i){async function e(t,n){try{const s=t.match(oT);if(!s)throw new Error("invalid link");return new Li(`${i}${s[2]}`)}catch{return new Us(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Li(t))}}return e}const Cl={data:m0,ipfs:b0("https://gateway.ipfs.io/ipfs/")},x0=new WeakMap;class cT{#e;#t;constructor(e){this.#e=[],this.#t=!1,x0.set(e,()=>{if(!this.#t){this.#t=!0;for(const t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){pe(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){pe(!this.cancelled,"cancelled","CANCELLED",{})}}function vl(i){if(i==null)throw new Error("missing signal; should not happen");return i.checkSignal(),i}class Li{#e;#t;#n;#i;#s;#a;#r;#o;#f;#l;#p;#A;#c;#h;#u;get url(){return this.#a}set url(e){this.#a=String(e)}get body(){return this.#r==null?null:new Uint8Array(this.#r)}set body(e){if(e==null)this.#r=void 0,this.#o=void 0;else if(typeof e=="string")this.#r=ns(e),this.#o="text/plain";else if(e instanceof Uint8Array)this.#r=e,this.#o="application/octet-stream";else if(typeof e=="object")this.#r=ns(JSON.stringify(e)),this.#o="application/json";else throw new Error("invalid body")}hasBody(){return this.#r!=null}get method(){return this.#i?this.#i:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#i=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#n);return this.#f&&(e.authorization=`Basic ${ZB(ns(this.#f))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#o&&(e["content-type"]=this.#o),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#n[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#n={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#f||null}setCredentials(e,t){V(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#f=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#s}set timeout(e){V(e>=0,"timeout must be non-zero","timeout",e),this.#s=e}get preflightFunc(){return this.#l||null}set preflightFunc(e){this.#l=e}get processFunc(){return this.#p||null}set processFunc(e){this.#p=e}get retryFunc(){return this.#A||null}set retryFunc(e){this.#A=e}get getUrlFunc(){return this.#u||g0}set getUrlFunc(e){this.#u=e}constructor(e){this.#a=String(e),this.#e=!1,this.#t=!0,this.#n={},this.#i="",this.#s=3e5,this.#h={slotInterval:rT,maxAttempts:sT},this.#u=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#r?ve(this.#r):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#h.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#h.maxAttempts=e.maxAttempts)}async#d(e,t,n,s,r){if(e>=this.#h.maxAttempts)return r.makeServerError("exceeded maximum retry limit");pe(E0()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await hT(n);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in Cl){const h=await Cl[o](a.url,vl(s.#c));if(h instanceof Us){let u=h;if(this.processFunc){vl(s.#c);try{u=await this.processFunc(a,u)}catch(d){(d.throttle==null||typeof d.stall!="number")&&u.makeServerError("error in post-processing function",d).assertOk()}}return u}a=h}this.preflightFunc&&(a=await this.preflightFunc(a));const c=await this.getUrlFunc(a,vl(s.#c));let l=new Us(c.statusCode,c.statusMessage,c.headers,c.body,s);if(l.statusCode===301||l.statusCode===302){try{const h=l.headers.location||"";return a.redirect(h).#d(e+1,t,0,s,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,l,e))){const h=l.headers["retry-after"];let u=this.#h.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(u=parseInt(h)),a.clone().#d(e+1,t,u,s,l)}if(this.processFunc){vl(s.#c);try{l=await this.processFunc(a,l)}catch(h){(h.throttle==null||typeof h.stall!="number")&&l.makeServerError("error in post-processing function",h).assertOk();let u=this.#h.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(u=h.stall),a.clone().#d(e+1,t,u,s,l)}}return l}send(){return pe(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new cT(this),this.#d(0,E0()+this.timeout,0,this,new Us(0,"",{},null,this))}cancel(){pe(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=x0.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();pe(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new Li(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,s.#n=Object.assign({},this.#n),this.#r&&(s.#r=new Uint8Array(this.#r)),s.#o=this.#o,s}clone(){const e=new Li(this.url);return e.#i=this.#i,this.#r&&(e.#r=this.#r),e.#o=this.#o,e.#n=Object.assign({},this.#n),e.#f=this.#f,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#l=this.#l,e.#p=this.#p,e.#A=this.#A,e.#h=Object.assign({},this.#h),e.#u=this.#u,e}static lockConfig(){qd=!0}static getGateway(e){return Cl[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(qd)throw new Error("gateways locked");Cl[e]=t}static registerGetUrl(e){if(qd)throw new Error("gateways locked");g0=e}static createGetUrlFunc(e){return A0(e)}static createDataGateway(){return m0}static createIpfsGatewayFunc(e){return b0(e)}}class Us{#e;#t;#n;#i;#s;#a;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#i?ve(this.#i):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#n)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}get bodyText(){try{return this.#i==null?"":wl(this.#i)}catch{pe(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{pe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,s,r){this.#e=e,this.#t=t,this.#n=Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{}),this.#i=s==null?null:new Uint8Array(s),this.#s=r||null,this.#a={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const s=new Us(599,n,this.headers,this.body,this.#s||void 0);return s.#a={message:e,error:t},s}throwThrottleError(e,t){t==null?t=-1:V(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw Ye(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#i!=null}get request(){return this.#s}ok(){return this.#a.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#a;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{this.#i&&(s=wl(this.#i))}catch{}pe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function E0(){return new Date().getTime()}function lT(i){return ns(i.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function hT(i){return new Promise(e=>setTimeout(e,i))}function uT(i){let e=i.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function _0(i,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+i[e+s];return n}function y0(i,e,t,n){const s=[];for(;t<e+1+n;){const r=w0(i,t);s.push(r.result),t+=r.consumed,pe(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:i,length:n,offset:e})}return{consumed:1+n,result:s}}function w0(i,e){pe(i.length!==0,"data too short","BUFFER_OVERRUN",{buffer:i,length:0,offset:1});const t=n=>{pe(n<=i.length,"data short segment too short","BUFFER_OVERRUN",{buffer:i,length:i.length,offset:n})};if(i[e]>=248){const n=i[e]-247;t(e+1+n);const s=_0(i,e+1,n);return t(e+1+n+s),y0(i,e,e+1+n,n+s)}else if(i[e]>=192){const n=i[e]-192;return t(e+1+n),y0(i,e,e+1,n)}else if(i[e]>=184){const n=i[e]-183;t(e+1+n);const s=_0(i,e+1,n);t(e+1+n+s);const r=ve(i.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:r}}else if(i[e]>=128){const n=i[e]-128;t(e+1+n);const s=ve(i.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:uT(i[e])}}function Ro(i){const e=lt(i,"data"),t=w0(e,0);return V(t.consumed===e.length,"unexpected junk after rlp payload","data",i),t.result}function C0(i){const e=[];for(;i;)e.unshift(i&255),i>>=8;return e}function v0(i){if(Array.isArray(i)){let n=[];if(i.forEach(function(r){n=n.concat(v0(r))}),n.length<=55)return n.unshift(192+n.length),n;const s=C0(n.length);return s.unshift(247+s.length),s.concat(n)}const e=Array.prototype.slice.call(lt(i,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=C0(e.length);return t.unshift(183+t.length),t.concat(e)}const S0="0123456789abcdef";function is(i){let e="0x";for(const t of v0(i))e+=S0[t>>4],e+=S0[t&15];return e}const Ln=32,Kd=new Uint8Array(Ln),dT=["then"],Sl={},I0=new WeakMap;function ur(i){return I0.get(i)}function M0(i,e){I0.set(i,e)}function No(i,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${i}`);throw t.error=e,t}function Xd(i,e,t){return i.indexOf(null)>=0?e.map((n,s)=>n instanceof ss?Xd(ur(n),n,t):n):i.reduce((n,s,r)=>{let a=e.getValue(s);return s in n||(t&&a instanceof ss&&(a=Xd(ur(a),a,t)),n[s]=a),n},{})}class ss extends Array{#e;constructor(...e){const t=e[0];let n=e[1],s=(e[2]||[]).slice(),r=!0;t!==Sl&&(n=e,s=[],r=!1),super(n.length),n.forEach((c,l)=>{this[l]=c});const a=s.reduce((c,l)=>(typeof l=="string"&&c.set(l,(c.get(l)||0)+1),c),new Map);if(M0(this,Object.freeze(n.map((c,l)=>{const h=s[l];return h!=null&&a.get(h)===1?h:null}))),this.#e=[],this.#e==null&&this.#e,!r)return;Object.freeze(this);const o=new Proxy(this,{get:(c,l,h)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){const d=ht(l,"%index");if(d<0||d>=this.length)throw new RangeError("out of result range");const f=c[d];return f instanceof Error&&No(`index ${d}`,f),f}if(dT.indexOf(l)>=0)return Reflect.get(c,l,h);const u=c[l];if(u instanceof Function)return function(...d){return u.apply(this===h?c:this,d)};if(!(l in c))return c.getValue.apply(this===h?c:this,[l])}return Reflect.get(c,l,h)}});return M0(o,ur(this)),o}toArray(e){const t=[];return this.forEach((n,s)=>{n instanceof Error&&No(`index ${s}`,n),e&&n instanceof ss&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){const t=ur(this);return t.reduce((n,s,r)=>(pe(s!=null,`value at index ${r} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Xd(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);const n=ur(this),s=[],r=[];for(let a=e;a<t;a++)s.push(this[a]),r.push(n[a]);return new ss(Sl,s,r)}filter(e,t){const n=ur(this),s=[],r=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&No(`index ${a}`,o),e.call(t,o,a,this)&&(s.push(o),r.push(n[a]))}return new ss(Sl,s,r)}map(e,t){const n=[];for(let s=0;s<this.length;s++){const r=this[s];r instanceof Error&&No(`index ${s}`,r),n.push(e.call(t,r,s,this))}return n}getValue(e){const t=ur(this).indexOf(e);if(t===-1)return;const n=this[t];return n instanceof Error&&No(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new ss(Sl,e,t)}}function B0(i){let e=Zt(i);return pe(e.length<=Ln,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Ln,offset:e.length}),e.length!==Ln&&(e=Dn(Ut([Kd.slice(e.length%Ln),e]))),e}class rs{name;type;localName;dynamic;constructor(e,t,n,s){Ye(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){V(!1,e,this.localName,t)}}class Yd{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return Ut(this.#e)}get length(){return this.#t}#n(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#n(Dn(e.data))}writeBytes(e){let t=Dn(e);const n=t.length%Ln;return n&&(t=Dn(Ut([t,Kd.slice(n)]))),this.#n(t)}writeValue(e){return this.#n(B0(e))}writeUpdatableValue(){const e=this.#e.length;return this.#e.push(Kd),this.#t+=Ln,t=>{this.#e[e]=B0(t)}}}class jd{allowLoose;#e;#t;#n;#i;#s;constructor(e,t,n){Ye(this,{allowLoose:!!t}),this.#e=Dn(e),this.#n=0,this.#i=null,this.#s=n??1024,this.#t=0}get data(){return ve(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#a(e){if(this.#i)return this.#i.#a(e);this.#n+=e,pe(this.#s<1||this.#n<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Dn(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#n,dataLength:this.dataLength}})}#r(e,t,n){let s=Math.ceil(t/Ln)*Ln;return this.#t+s>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?s=t:pe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Dn(this.#e),length:this.#e.length,offset:this.#t+s})),this.#e.slice(this.#t,this.#t+s)}subReader(e){const t=new jd(this.#e.slice(this.#t+e),this.allowLoose,this.#s);return t.#i=this,t}readBytes(e,t){let n=this.#r(0,e,!!t);return this.#a(e),this.#t+=n.length,n.slice(0,e)}readValue(){return Wd(this.readBytes(Ln))}readIndex(){return YB(this.readBytes(Ln))}}function Il(i){if(!Number.isSafeInteger(i)||i<0)throw new Error(`Wrong positive integer: ${i}`)}function Jd(i,...e){if(!(i instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(i.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${i.length}`)}function fT(i){if(typeof i!="function"||typeof i.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Il(i.outputLen),Il(i.blockLen)}function wa(i,e=!0){if(i.destroyed)throw new Error("Hash instance has been destroyed");if(e&&i.finished)throw new Error("Hash#digest() has already been called")}function T0(i,e){Jd(i);const t=e.outputLen;if(i.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const Zd=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const R0=i=>i instanceof Uint8Array,pT=i=>new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)),$d=i=>new DataView(i.buffer,i.byteOffset,i.byteLength),Pi=(i,e)=>i<<32-e|i>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function AT(i){if(typeof i!="string")throw new Error(`utf8ToBytes expected string, got ${typeof i}`);return new Uint8Array(new TextEncoder().encode(i))}function Ml(i){if(typeof i=="string"&&(i=AT(i)),!R0(i))throw new Error(`expected Uint8Array, got ${typeof i}`);return i}function gT(...i){const e=new Uint8Array(i.reduce((n,s)=>n+s.length,0));let t=0;return i.forEach(n=>{if(!R0(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}class ef{clone(){return this._cloneInto()}}function tf(i){const e=n=>i().update(Ml(n)).digest(),t=i();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>i(),e}function mT(i=32){if(Zd&&typeof Zd.getRandomValues=="function")return Zd.getRandomValues(new Uint8Array(i));throw new Error("crypto.getRandomValues must be defined")}class N0 extends ef{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,fT(e);const n=Ml(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,r=new Uint8Array(s);r.set(n.length>s?e.create().update(n).digest():n);for(let a=0;a<r.length;a++)r[a]^=54;this.iHash.update(r),this.oHash=e.create();for(let a=0;a<r.length;a++)r[a]^=106;this.oHash.update(r),r.fill(0)}update(e){return wa(this),this.iHash.update(e),this}digestInto(e){wa(this),Jd(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:s,destroyed:r,blockLen:a,outputLen:o}=this;return e=e,e.finished=s,e.destroyed=r,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const F0=(i,e,t)=>new N0(i,e).update(t).digest();F0.create=(i,e)=>new N0(i,e);function bT(i,e,t,n){if(typeof i.setBigUint64=="function")return i.setBigUint64(e,t,n);const s=BigInt(32),r=BigInt(4294967295),a=Number(t>>s&r),o=Number(t&r),c=n?4:0,l=n?0:4;i.setUint32(e+c,a,n),i.setUint32(e+l,o,n)}class D0 extends ef{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=$d(this.buffer)}update(e){wa(this);const{view:t,buffer:n,blockLen:s}=this;e=Ml(e);const r=e.length;for(let a=0;a<r;){const o=Math.min(s-this.pos,r-a);if(o===s){const c=$d(e);for(;s<=r-a;a+=s)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){wa(this),T0(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:s,isLE:r}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let u=a;u<s;u++)t[u]=0;bT(n,s-8,BigInt(this.length*8),r),this.process(n,0);const o=$d(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<l;u++)o.setUint32(4*u,h[u],r)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:s,finished:r,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=r,e.destroyed=a,s%t&&e.buffer.set(n),e}}const xT=(i,e,t)=>i&e^~i&t,ET=(i,e,t)=>i&e^i&t^e&t,_T=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Os=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qs=new Uint32Array(64);class yT extends D0{constructor(){super(64,32,8,!1),this.A=Os[0]|0,this.B=Os[1]|0,this.C=Os[2]|0,this.D=Os[3]|0,this.E=Os[4]|0,this.F=Os[5]|0,this.G=Os[6]|0,this.H=Os[7]|0}get(){const{A:e,B:t,C:n,D:s,E:r,F:a,G:o,H:c}=this;return[e,t,n,s,r,a,o,c]}set(e,t,n,s,r,a,o,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=r|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,t){for(let u=0;u<16;u++,t+=4)Qs[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const d=Qs[u-15],f=Qs[u-2],m=Pi(d,7)^Pi(d,18)^d>>>3,g=Pi(f,17)^Pi(f,19)^f>>>10;Qs[u]=g+Qs[u-7]+m+Qs[u-16]|0}let{A:n,B:s,C:r,D:a,E:o,F:c,G:l,H:h}=this;for(let u=0;u<64;u++){const d=Pi(o,6)^Pi(o,11)^Pi(o,25),f=h+d+xT(o,c,l)+_T[u]+Qs[u]|0,g=(Pi(n,2)^Pi(n,13)^Pi(n,22))+ET(n,s,r)|0;h=l,l=c,c=o,o=a+f|0,a=r,r=s,s=n,n=f+g|0}n=n+this.A|0,s=s+this.B|0,r=r+this.C|0,a=a+this.D|0,o=o+this.E|0,c=c+this.F|0,l=l+this.G|0,h=h+this.H|0,this.set(n,s,r,a,o,c,l,h)}roundClean(){Qs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const L0=tf(()=>new yT),Bl=BigInt(2**32-1),nf=BigInt(32);function P0(i,e=!1){return e?{h:Number(i&Bl),l:Number(i>>nf&Bl)}:{h:Number(i>>nf&Bl)|0,l:Number(i&Bl)|0}}function k0(i,e=!1){let t=new Uint32Array(i.length),n=new Uint32Array(i.length);for(let s=0;s<i.length;s++){const{h:r,l:a}=P0(i[s],e);[t[s],n[s]]=[r,a]}return[t,n]}const wT=(i,e)=>BigInt(i>>>0)<<nf|BigInt(e>>>0),CT=(i,e,t)=>i>>>t,vT=(i,e,t)=>i<<32-t|e>>>t,ST=(i,e,t)=>i>>>t|e<<32-t,IT=(i,e,t)=>i<<32-t|e>>>t,MT=(i,e,t)=>i<<64-t|e>>>t-32,BT=(i,e,t)=>i>>>t-32|e<<64-t,TT=(i,e)=>e,RT=(i,e)=>i,U0=(i,e,t)=>i<<t|e>>>32-t,O0=(i,e,t)=>e<<t|i>>>32-t,Q0=(i,e,t)=>e<<t-32|i>>>64-t,G0=(i,e,t)=>i<<t-32|e>>>64-t;function NT(i,e,t,n){const s=(e>>>0)+(n>>>0);return{h:i+t+(s/2**32|0)|0,l:s|0}}const ct={fromBig:P0,split:k0,toBig:wT,shrSH:CT,shrSL:vT,rotrSH:ST,rotrSL:IT,rotrBH:MT,rotrBL:BT,rotr32H:TT,rotr32L:RT,rotlSH:U0,rotlSL:O0,rotlBH:Q0,rotlBL:G0,add:NT,add3L:(i,e,t)=>(i>>>0)+(e>>>0)+(t>>>0),add3H:(i,e,t,n)=>e+t+n+(i/2**32|0)|0,add4L:(i,e,t,n)=>(i>>>0)+(e>>>0)+(t>>>0)+(n>>>0),add4H:(i,e,t,n,s)=>e+t+n+s+(i/2**32|0)|0,add5H:(i,e,t,n,s,r)=>e+t+n+s+r+(i/2**32|0)|0,add5L:(i,e,t,n,s)=>(i>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0)},[FT,DT]=ct.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(i=>BigInt(i))),Gs=new Uint32Array(80),Hs=new Uint32Array(80);class LT extends D0{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:s,Ch:r,Cl:a,Dh:o,Dl:c,Eh:l,El:h,Fh:u,Fl:d,Gh:f,Gl:m,Hh:g,Hl:A}=this;return[e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A]}set(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=r|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=l|0,this.El=h|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=m|0,this.Hh=g|0,this.Hl=A|0}process(e,t){for(let b=0;b<16;b++,t+=4)Gs[b]=e.getUint32(t),Hs[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){const _=Gs[b-15]|0,M=Hs[b-15]|0,w=ct.rotrSH(_,M,1)^ct.rotrSH(_,M,8)^ct.shrSH(_,M,7),S=ct.rotrSL(_,M,1)^ct.rotrSL(_,M,8)^ct.shrSL(_,M,7),T=Gs[b-2]|0,v=Hs[b-2]|0,C=ct.rotrSH(T,v,19)^ct.rotrBH(T,v,61)^ct.shrSH(T,v,6),F=ct.rotrSL(T,v,19)^ct.rotrBL(T,v,61)^ct.shrSL(T,v,6),K=ct.add4L(S,F,Hs[b-7],Hs[b-16]),q=ct.add4H(K,w,C,Gs[b-7],Gs[b-16]);Gs[b]=q|0,Hs[b]=K|0}let{Ah:n,Al:s,Bh:r,Bl:a,Ch:o,Cl:c,Dh:l,Dl:h,Eh:u,El:d,Fh:f,Fl:m,Gh:g,Gl:A,Hh:p,Hl:y}=this;for(let b=0;b<80;b++){const _=ct.rotrSH(u,d,14)^ct.rotrSH(u,d,18)^ct.rotrBH(u,d,41),M=ct.rotrSL(u,d,14)^ct.rotrSL(u,d,18)^ct.rotrBL(u,d,41),w=u&f^~u&g,S=d&m^~d&A,T=ct.add5L(y,M,S,DT[b],Hs[b]),v=ct.add5H(T,p,_,w,FT[b],Gs[b]),C=T|0,F=ct.rotrSH(n,s,28)^ct.rotrBH(n,s,34)^ct.rotrBH(n,s,39),K=ct.rotrSL(n,s,28)^ct.rotrBL(n,s,34)^ct.rotrBL(n,s,39),q=n&r^n&o^r&o,$=s&a^s&c^a&c;p=g|0,y=A|0,g=f|0,A=m|0,f=u|0,m=d|0,{h:u,l:d}=ct.add(l|0,h|0,v|0,C|0),l=o|0,h=c|0,o=r|0,c=a|0,r=n|0,a=s|0;const D=ct.add3L(C,K,$);n=ct.add3H(D,v,F,q),s=D|0}({h:n,l:s}=ct.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:r,l:a}=ct.add(this.Bh|0,this.Bl|0,r|0,a|0),{h:o,l:c}=ct.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:l,l:h}=ct.add(this.Dh|0,this.Dl|0,l|0,h|0),{h:u,l:d}=ct.add(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:m}=ct.add(this.Fh|0,this.Fl|0,f|0,m|0),{h:g,l:A}=ct.add(this.Gh|0,this.Gl|0,g|0,A|0),{h:p,l:y}=ct.add(this.Hh|0,this.Hl|0,p|0,y|0),this.set(n,s,r,a,o,c,l,h,u,d,f,m,g,A,p,y)}roundClean(){Gs.fill(0),Hs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const PT=tf(()=>new LT);function kT(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const H0=kT();H0.crypto||H0.msCrypto;function UT(i){switch(i){case"sha256":return L0.create();case"sha512":return PT.create()}V(!1,"invalid hashing algorithm name","algorithm",i)}const[z0,V0,W0]=[[],[],[]],OT=BigInt(0),Fo=BigInt(1),QT=BigInt(2),GT=BigInt(7),HT=BigInt(256),zT=BigInt(113);for(let i=0,e=Fo,t=1,n=0;i<24;i++){[t,n]=[n,(2*t+3*n)%5],z0.push(2*(5*n+t)),V0.push((i+1)*(i+2)/2%64);let s=OT;for(let r=0;r<7;r++)e=(e<<Fo^(e>>GT)*zT)%HT,e&QT&&(s^=Fo<<(Fo<<BigInt(r))-Fo);W0.push(s)}const[VT,WT]=k0(W0,!0),q0=(i,e,t)=>t>32?Q0(i,e,t):U0(i,e,t),K0=(i,e,t)=>t>32?G0(i,e,t):O0(i,e,t);function qT(i,e=24){const t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)t[a]=i[a]^i[a+10]^i[a+20]^i[a+30]^i[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,c=(a+2)%10,l=t[c],h=t[c+1],u=q0(l,h,1)^t[o],d=K0(l,h,1)^t[o+1];for(let f=0;f<50;f+=10)i[a+f]^=u,i[a+f+1]^=d}let s=i[2],r=i[3];for(let a=0;a<24;a++){const o=V0[a],c=q0(s,r,o),l=K0(s,r,o),h=z0[a];s=i[h],r=i[h+1],i[h]=c,i[h+1]=l}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=i[a+o];for(let o=0;o<10;o++)i[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}i[0]^=VT[n],i[1]^=WT[n]}t.fill(0)}class sf extends ef{constructor(e,t,n,s=!1,r=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Il(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=pT(this.state)}keccak(){qT(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){wa(this);const{blockLen:t,state:n}=this;e=Ml(e);const s=e.length;for(let r=0;r<s;){const a=Math.min(t-this.pos,s-r);for(let o=0;o<a;o++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){wa(this,!1),Jd(e),this.finish();const t=this.state,{blockLen:n}=this;for(let s=0,r=e.length;s<r;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,r-s);e.set(t.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Il(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(T0(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:s,rounds:r,enableXOF:a}=this;return e||(e=new sf(t,n,s,a,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}}const KT=((i,e,t)=>tf(()=>new sf(e,i,t)))(1,136,256/8);let X0=!1;const Y0=function(i){return KT(i)};let j0=Y0;function $t(i){const e=lt(i,"data");return ve(j0(e))}$t._=Y0,$t.lock=function(){X0=!0},$t.register=function(i){if(X0)throw new TypeError("keccak256 is locked");j0=i},Object.freeze($t);const J0=function(i){return UT("sha256").update(i).digest()};let Z0=J0,$0=!1;function Ca(i){const e=lt(i,"data");return ve(Z0(e))}Ca._=J0,Ca.lock=function(){$0=!0},Ca.register=function(i){if($0)throw new Error("sha256 is locked");Z0=i},Object.freeze(Ca),Object.freeze(Ca);BigInt(0);const XT=BigInt(1),YT=BigInt(2),Tl=i=>i instanceof Uint8Array,jT=Array.from({length:256},(i,e)=>e.toString(16).padStart(2,"0"));function va(i){if(!Tl(i))throw new Error("Uint8Array expected");let e="";for(let t=0;t<i.length;t++)e+=jT[i[t]];return e}function rf(i){if(typeof i!="string")throw new Error("hex string expected, got "+typeof i);return BigInt(i===""?"0":`0x${i}`)}function Do(i){if(typeof i!="string")throw new Error("hex string expected, got "+typeof i);const e=i.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){const s=n*2,r=i.slice(s,s+2),a=Number.parseInt(r,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");t[n]=a}return t}function dr(i){return rf(va(i))}function af(i){if(!Tl(i))throw new Error("Uint8Array expected");return rf(va(Uint8Array.from(i).reverse()))}function Sa(i,e){return Do(i.toString(16).padStart(e*2,"0"))}function of(i,e){return Sa(i,e).reverse()}function yi(i,e,t){let n;if(typeof e=="string")try{n=Do(e)}catch(r){throw new Error(`${i} must be valid hex string, got "${e}". Cause: ${r}`)}else if(Tl(e))n=Uint8Array.from(e);else throw new Error(`${i} must be hex string or Uint8Array`);const s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${i} expected ${t} bytes, got ${s}`);return n}function Lo(...i){const e=new Uint8Array(i.reduce((n,s)=>n+s.length,0));let t=0;return i.forEach(n=>{if(!Tl(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}const cf=i=>(YT<<BigInt(i-1))-XT,lf=i=>new Uint8Array(i),eb=i=>Uint8Array.from(i);function tb(i,e,t){if(typeof i!="number"||i<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=lf(i),s=lf(i),r=0;const a=()=>{n.fill(1),s.fill(0),r=0},o=(...u)=>t(s,n,...u),c=(u=lf())=>{s=o(eb([0]),u),n=o(),u.length!==0&&(s=o(eb([1]),u),n=o())},l=()=>{if(r++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const d=[];for(;u<e;){n=o();const f=n.slice();d.push(f),u+=n.length}return Lo(...d)};return(u,d)=>{a(),c(u);let f;for(;!(f=d(l()));)c();return a(),f}}const JT={bigint:i=>typeof i=="bigint",function:i=>typeof i=="function",boolean:i=>typeof i=="boolean",string:i=>typeof i=="string",stringOrUint8Array:i=>typeof i=="string"||i instanceof Uint8Array,isSafeInteger:i=>Number.isSafeInteger(i),array:i=>Array.isArray(i),field:(i,e)=>e.Fp.isValid(i),hash:i=>typeof i=="function"&&Number.isSafeInteger(i.outputLen)};function Po(i,e,t={}){const n=(s,r,a)=>{const o=JT[r];if(typeof o!="function")throw new Error(`Invalid validator "${r}", expected function`);const c=i[s];if(!(a&&c===void 0)&&!o(c,i))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${r}`)};for(const[s,r]of Object.entries(e))n(s,r,!1);for(const[s,r]of Object.entries(t))n(s,r,!0);return i}const ZT=Object.freeze(Object.defineProperty({__proto__:null,bitMask:cf,bytesToHex:va,bytesToNumberBE:dr,bytesToNumberLE:af,concatBytes:Lo,createHmacDrbg:tb,ensureBytes:yi,hexToBytes:Do,hexToNumber:rf,numberToBytesBE:Sa,numberToBytesLE:of,validateObject:Po},Symbol.toStringTag,{value:"Module"}));const An=BigInt(0),Xt=BigInt(1),fr=BigInt(2),$T=BigInt(3),hf=BigInt(4),nb=BigInt(5),ib=BigInt(8);BigInt(9),BigInt(16);function Gn(i,e){const t=i%e;return t>=An?t:e+t}function eR(i,e,t){if(t<=An||e<An)throw new Error("Expected power/modulo > 0");if(t===Xt)return An;let n=Xt;for(;e>An;)e&Xt&&(n=n*i%t),i=i*i%t,e>>=Xt;return n}function ii(i,e,t){let n=i;for(;e-- >An;)n*=n,n%=t;return n}function uf(i,e){if(i===An||e<=An)throw new Error(`invert: expected positive integers, got n=${i} mod=${e}`);let t=Gn(i,e),n=e,s=An,r=Xt;for(;t!==An;){const o=n/t,c=n%t,l=s-r*o;n=t,t=c,s=r,r=l}if(n!==Xt)throw new Error("invert: does not exist");return Gn(s,e)}function tR(i){const e=(i-Xt)/fr;let t,n,s;for(t=i-Xt,n=0;t%fr===An;t/=fr,n++);for(s=fr;s<i&&eR(s,e,i)!==i-Xt;s++);if(n===1){const a=(i+Xt)/hf;return function(c,l){const h=c.pow(l,a);if(!c.eql(c.sqr(h),l))throw new Error("Cannot find square root");return h}}const r=(t+Xt)/fr;return function(o,c){if(o.pow(c,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let l=n,h=o.pow(o.mul(o.ONE,s),t),u=o.pow(c,r),d=o.pow(c,t);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let f=1;for(let g=o.sqr(d);f<l&&!o.eql(g,o.ONE);f++)g=o.sqr(g);const m=o.pow(h,Xt<<BigInt(l-f-1));h=o.sqr(m),u=o.mul(u,m),d=o.mul(d,h),l=f}return u}}function nR(i){if(i%hf===$T){const e=(i+Xt)/hf;return function(n,s){const r=n.pow(s,e);if(!n.eql(n.sqr(r),s))throw new Error("Cannot find square root");return r}}if(i%ib===nb){const e=(i-nb)/ib;return function(n,s){const r=n.mul(s,fr),a=n.pow(r,e),o=n.mul(s,a),c=n.mul(n.mul(o,fr),a),l=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(l),s))throw new Error("Cannot find square root");return l}}return tR(i)}const iR=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function sR(i){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=iR.reduce((n,s)=>(n[s]="function",n),e);return Po(i,t)}function rR(i,e,t){if(t<An)throw new Error("Expected power > 0");if(t===An)return i.ONE;if(t===Xt)return e;let n=i.ONE,s=e;for(;t>An;)t&Xt&&(n=i.mul(n,s)),s=i.sqr(s),t>>=Xt;return n}function aR(i,e){const t=new Array(e.length),n=e.reduce((r,a,o)=>i.is0(a)?r:(t[o]=r,i.mul(r,a)),i.ONE),s=i.inv(n);return e.reduceRight((r,a,o)=>i.is0(a)?r:(t[o]=i.mul(r,t[o]),i.mul(r,a)),s),t}function sb(i,e){const t=e!==void 0?e:i.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function oR(i,e,t=!1,n={}){if(i<=An)throw new Error(`Expected Field ORDER > 0, got ${i}`);const{nBitLength:s,nByteLength:r}=sb(i,e);if(r>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=nR(i),o=Object.freeze({ORDER:i,BITS:s,BYTES:r,MASK:cf(s),ZERO:An,ONE:Xt,create:c=>Gn(c,i),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return An<=c&&c<i},is0:c=>c===An,isOdd:c=>(c&Xt)===Xt,neg:c=>Gn(-c,i),eql:(c,l)=>c===l,sqr:c=>Gn(c*c,i),add:(c,l)=>Gn(c+l,i),sub:(c,l)=>Gn(c-l,i),mul:(c,l)=>Gn(c*l,i),pow:(c,l)=>rR(o,c,l),div:(c,l)=>Gn(c*uf(l,i),i),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>uf(c,i),sqrt:n.sqrt||(c=>a(o,c)),invertBatch:c=>aR(o,c),cmov:(c,l,h)=>h?l:c,toBytes:c=>t?of(c,r):Sa(c,r),fromBytes:c=>{if(c.length!==r)throw new Error(`Fp.fromBytes: expected ${r}, got ${c.length}`);return t?af(c):dr(c)}});return Object.freeze(o)}function rb(i){if(typeof i!="bigint")throw new Error("field order must be bigint");const e=i.toString(2).length;return Math.ceil(e/8)}function ab(i){const e=rb(i);return e+Math.ceil(e/2)}function cR(i,e,t=!1){const n=i.length,s=rb(e),r=ab(e);if(n<16||n<r||n>1024)throw new Error(`expected ${r}-1024 bytes of input, got ${n}`);const a=t?dr(i):af(i),o=Gn(a,e-Xt)+Xt;return t?of(o,s):Sa(o,s)}const lR=BigInt(0),df=BigInt(1);function hR(i,e){const t=(s,r)=>{const a=r.negate();return s?a:r},n=s=>{const r=Math.ceil(e/s)+1,a=2**(s-1);return{windows:r,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,r){let a=i.ZERO,o=s;for(;r>lR;)r&df&&(a=a.add(o)),o=o.double(),r>>=df;return a},precomputeWindow(s,r){const{windows:a,windowSize:o}=n(r),c=[];let l=s,h=l;for(let u=0;u<a;u++){h=l,c.push(h);for(let d=1;d<o;d++)h=h.add(l),c.push(h);l=h.double()}return c},wNAF(s,r,a){const{windows:o,windowSize:c}=n(s);let l=i.ZERO,h=i.BASE;const u=BigInt(2**s-1),d=2**s,f=BigInt(s);for(let m=0;m<o;m++){const g=m*c;let A=Number(a&u);a>>=f,A>c&&(A-=d,a+=df);const p=g,y=g+Math.abs(A)-1,b=m%2!==0,_=A<0;A===0?h=h.add(t(b,r[p])):l=l.add(t(_,r[y]))}return{p:l,f:h}},wNAFCached(s,r,a,o){const c=s._WINDOW_SIZE||1;let l=r.get(s);return l||(l=this.precomputeWindow(s,c),c!==1&&r.set(s,o(l))),this.wNAF(c,l,a)}}}function ob(i){return sR(i.Fp),Po(i,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...sb(i.n,i.nBitLength),...i,p:i.Fp.ORDER})}function uR(i){const e=ob(i);Po(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:dR,hexToBytes:fR}=ZT,pr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(i){const{Err:e}=pr;if(i.length<2||i[0]!==2)throw new e("Invalid signature integer tag");const t=i[1],n=i.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:dR(n),l:i.subarray(t+2)}},toSig(i){const{Err:e}=pr,t=typeof i=="string"?fR(i):i;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:s,l:r}=pr._parseInt(t.subarray(2)),{d:a,l:o}=pr._parseInt(r);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(i){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,t=l=>{const h=l.toString(16);return h.length&1?`0${h}`:h},n=e(t(i.s)),s=e(t(i.r)),r=n.length/2,a=s.length/2,o=t(r),c=t(a);return`30${t(a+r+4)}02${c}${s}02${o}${n}`}},as=BigInt(0),si=BigInt(1);BigInt(2);const cb=BigInt(3);BigInt(4);function pR(i){const e=uR(i),{Fp:t}=e,n=e.toBytes||((m,g,A)=>{const p=g.toAffine();return Lo(Uint8Array.from([4]),t.toBytes(p.x),t.toBytes(p.y))}),s=e.fromBytes||(m=>{const g=m.subarray(1),A=t.fromBytes(g.subarray(0,t.BYTES)),p=t.fromBytes(g.subarray(t.BYTES,2*t.BYTES));return{x:A,y:p}});function r(m){const{a:g,b:A}=e,p=t.sqr(m),y=t.mul(p,m);return t.add(t.add(y,t.mul(m,g)),A)}if(!t.eql(t.sqr(e.Gy),r(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&as<m&&m<e.n}function o(m){if(!a(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(m){const{allowedPrivateKeyLengths:g,nByteLength:A,wrapPrivateKey:p,n:y}=e;if(g&&typeof m!="bigint"){if(m instanceof Uint8Array&&(m=va(m)),typeof m!="string"||!g.includes(m.length))throw new Error("Invalid key");m=m.padStart(A*2,"0")}let b;try{b=typeof m=="bigint"?m:dr(yi("private key",m,A))}catch{throw new Error(`private key must be ${A} bytes, hex or bigint, not ${typeof m}`)}return p&&(b=Gn(b,y)),o(b),b}const l=new Map;function h(m){if(!(m instanceof u))throw new Error("ProjectivePoint expected")}class u{constructor(g,A,p){if(this.px=g,this.py=A,this.pz=p,g==null||!t.isValid(g))throw new Error("x required");if(A==null||!t.isValid(A))throw new Error("y required");if(p==null||!t.isValid(p))throw new Error("z required")}static fromAffine(g){const{x:A,y:p}=g||{};if(!g||!t.isValid(A)||!t.isValid(p))throw new Error("invalid affine point");if(g instanceof u)throw new Error("projective point not allowed");const y=b=>t.eql(b,t.ZERO);return y(A)&&y(p)?u.ZERO:new u(A,p,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(g){const A=t.invertBatch(g.map(p=>p.pz));return g.map((p,y)=>p.toAffine(A[y])).map(u.fromAffine)}static fromHex(g){const A=u.fromAffine(s(yi("pointHex",g)));return A.assertValidity(),A}static fromPrivateKey(g){return u.BASE.multiply(c(g))}_setWindowSize(g){this._WINDOW_SIZE=g,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:g,y:A}=this.toAffine();if(!t.isValid(g)||!t.isValid(A))throw new Error("bad point: x or y not FE");const p=t.sqr(A),y=r(g);if(!t.eql(p,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:g}=this.toAffine();if(t.isOdd)return!t.isOdd(g);throw new Error("Field doesn't support isOdd")}equals(g){h(g);const{px:A,py:p,pz:y}=this,{px:b,py:_,pz:M}=g,w=t.eql(t.mul(A,M),t.mul(b,y)),S=t.eql(t.mul(p,M),t.mul(_,y));return w&&S}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:g,b:A}=e,p=t.mul(A,cb),{px:y,py:b,pz:_}=this;let M=t.ZERO,w=t.ZERO,S=t.ZERO,T=t.mul(y,y),v=t.mul(b,b),C=t.mul(_,_),F=t.mul(y,b);return F=t.add(F,F),S=t.mul(y,_),S=t.add(S,S),M=t.mul(g,S),w=t.mul(p,C),w=t.add(M,w),M=t.sub(v,w),w=t.add(v,w),w=t.mul(M,w),M=t.mul(F,M),S=t.mul(p,S),C=t.mul(g,C),F=t.sub(T,C),F=t.mul(g,F),F=t.add(F,S),S=t.add(T,T),T=t.add(S,T),T=t.add(T,C),T=t.mul(T,F),w=t.add(w,T),C=t.mul(b,_),C=t.add(C,C),T=t.mul(C,F),M=t.sub(M,T),S=t.mul(C,v),S=t.add(S,S),S=t.add(S,S),new u(M,w,S)}add(g){h(g);const{px:A,py:p,pz:y}=this,{px:b,py:_,pz:M}=g;let w=t.ZERO,S=t.ZERO,T=t.ZERO;const v=e.a,C=t.mul(e.b,cb);let F=t.mul(A,b),K=t.mul(p,_),q=t.mul(y,M),$=t.add(A,p),D=t.add(b,_);$=t.mul($,D),D=t.add(F,K),$=t.sub($,D),D=t.add(A,y);let O=t.add(b,M);return D=t.mul(D,O),O=t.add(F,q),D=t.sub(D,O),O=t.add(p,y),w=t.add(_,M),O=t.mul(O,w),w=t.add(K,q),O=t.sub(O,w),T=t.mul(v,D),w=t.mul(C,q),T=t.add(w,T),w=t.sub(K,T),T=t.add(K,T),S=t.mul(w,T),K=t.add(F,F),K=t.add(K,F),q=t.mul(v,q),D=t.mul(C,D),K=t.add(K,q),q=t.sub(F,q),q=t.mul(v,q),D=t.add(D,q),F=t.mul(K,D),S=t.add(S,F),F=t.mul(O,D),w=t.mul($,w),w=t.sub(w,F),F=t.mul($,K),T=t.mul(O,T),T=t.add(T,F),new u(w,S,T)}subtract(g){return this.add(g.negate())}is0(){return this.equals(u.ZERO)}wNAF(g){return f.wNAFCached(this,l,g,A=>{const p=t.invertBatch(A.map(y=>y.pz));return A.map((y,b)=>y.toAffine(p[b])).map(u.fromAffine)})}multiplyUnsafe(g){const A=u.ZERO;if(g===as)return A;if(o(g),g===si)return this;const{endo:p}=e;if(!p)return f.unsafeLadder(this,g);let{k1neg:y,k1:b,k2neg:_,k2:M}=p.splitScalar(g),w=A,S=A,T=this;for(;b>as||M>as;)b&si&&(w=w.add(T)),M&si&&(S=S.add(T)),T=T.double(),b>>=si,M>>=si;return y&&(w=w.negate()),_&&(S=S.negate()),S=new u(t.mul(S.px,p.beta),S.py,S.pz),w.add(S)}multiply(g){o(g);let A=g,p,y;const{endo:b}=e;if(b){const{k1neg:_,k1:M,k2neg:w,k2:S}=b.splitScalar(A);let{p:T,f:v}=this.wNAF(M),{p:C,f:F}=this.wNAF(S);T=f.constTimeNegate(_,T),C=f.constTimeNegate(w,C),C=new u(t.mul(C.px,b.beta),C.py,C.pz),p=T.add(C),y=v.add(F)}else{const{p:_,f:M}=this.wNAF(A);p=_,y=M}return u.normalizeZ([p,y])[0]}multiplyAndAddUnsafe(g,A,p){const y=u.BASE,b=(M,w)=>w===as||w===si||!M.equals(y)?M.multiplyUnsafe(w):M.multiply(w),_=b(this,A).add(b(g,p));return _.is0()?void 0:_}toAffine(g){const{px:A,py:p,pz:y}=this,b=this.is0();g==null&&(g=b?t.ONE:t.inv(y));const _=t.mul(A,g),M=t.mul(p,g),w=t.mul(y,g);if(b)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:_,y:M}}isTorsionFree(){const{h:g,isTorsionFree:A}=e;if(g===si)return!0;if(A)return A(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:g,clearCofactor:A}=e;return g===si?this:A?A(u,this):this.multiplyUnsafe(e.h)}toRawBytes(g=!0){return this.assertValidity(),n(u,this,g)}toHex(g=!0){return va(this.toRawBytes(g))}}u.BASE=new u(e.Gx,e.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const d=e.nBitLength,f=hR(u,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:r,isWithinCurveOrder:a}}function AR(i){const e=ob(i);return Po(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function gR(i){const e=AR(i),{Fp:t,n}=e,s=t.BYTES+1,r=2*t.BYTES+1;function a(D){return as<D&&D<t.ORDER}function o(D){return Gn(D,n)}function c(D){return uf(D,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:h,weierstrassEquation:u,isWithinCurveOrder:d}=pR({...e,toBytes(D,O,j){const Q=O.toAffine(),J=t.toBytes(Q.x),ee=Lo;return j?ee(Uint8Array.from([O.hasEvenY()?2:3]),J):ee(Uint8Array.from([4]),J,t.toBytes(Q.y))},fromBytes(D){const O=D.length,j=D[0],Q=D.subarray(1);if(O===s&&(j===2||j===3)){const J=dr(Q);if(!a(J))throw new Error("Point is not on curve");const ee=u(J);let ae=t.sqrt(ee);const ye=(ae&si)===si;return(j&1)===1!==ye&&(ae=t.neg(ae)),{x:J,y:ae}}else if(O===r&&j===4){const J=t.fromBytes(Q.subarray(0,t.BYTES)),ee=t.fromBytes(Q.subarray(t.BYTES,2*t.BYTES));return{x:J,y:ee}}else throw new Error(`Point of length ${O} was invalid. Expected ${s} compressed bytes or ${r} uncompressed bytes`)}}),f=D=>va(Sa(D,e.nByteLength));function m(D){const O=n>>si;return D>O}function g(D){return m(D)?o(-D):D}const A=(D,O,j)=>dr(D.slice(O,j));class p{constructor(O,j,Q){this.r=O,this.s=j,this.recovery=Q,this.assertValidity()}static fromCompact(O){const j=e.nByteLength;return O=yi("compactSignature",O,j*2),new p(A(O,0,j),A(O,j,2*j))}static fromDER(O){const{r:j,s:Q}=pr.toSig(yi("DER",O));return new p(j,Q)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(O){return new p(this.r,this.s,O)}recoverPublicKey(O){const{r:j,s:Q,recovery:J}=this,ee=S(yi("msgHash",O));if(J==null||![0,1,2,3].includes(J))throw new Error("recovery id invalid");const ae=J===2||J===3?j+e.n:j;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const ye=(J&1)===0?"02":"03",Me=l.fromHex(ye+f(ae)),se=c(ae),me=o(-ee*se),be=o(Q*se),xe=l.BASE.multiplyAndAddUnsafe(Me,me,be);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new p(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Do(this.toDERHex())}toDERHex(){return pr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Do(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const y={isValidPrivateKey(D){try{return h(D),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const D=ab(e.n);return cR(e.randomBytes(D),e.n)},precompute(D=8,O=l.BASE){return O._setWindowSize(D),O.multiply(BigInt(3)),O}};function b(D,O=!0){return l.fromPrivateKey(D).toRawBytes(O)}function _(D){const O=D instanceof Uint8Array,j=typeof D=="string",Q=(O||j)&&D.length;return O?Q===s||Q===r:j?Q===2*s||Q===2*r:D instanceof l}function M(D,O,j=!0){if(_(D))throw new Error("first arg must be private key");if(!_(O))throw new Error("second arg must be public key");return l.fromHex(O).multiply(h(D)).toRawBytes(j)}const w=e.bits2int||function(D){const O=dr(D),j=D.length*8-e.nBitLength;return j>0?O>>BigInt(j):O},S=e.bits2int_modN||function(D){return o(w(D))},T=cf(e.nBitLength);function v(D){if(typeof D!="bigint")throw new Error("bigint expected");if(!(as<=D&&D<T))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Sa(D,e.nByteLength)}function C(D,O,j=F){if(["recovered","canonical"].some($e=>$e in j))throw new Error("sign() legacy options not supported");const{hash:Q,randomBytes:J}=e;let{lowS:ee,prehash:ae,extraEntropy:ye}=j;ee==null&&(ee=!0),D=yi("msgHash",D),ae&&(D=yi("prehashed msgHash",Q(D)));const Me=S(D),se=h(O),me=[v(se),v(Me)];if(ye!=null){const $e=ye===!0?J(t.BYTES):ye;me.push(yi("extraEntropy",$e))}const be=Lo(...me),xe=Me;function Pe($e){const Qe=w($e);if(!d(Qe))return;const St=c(Qe),ut=l.BASE.multiply(Qe).toAffine(),Je=o(ut.x);if(Je===as)return;const G=o(St*o(xe+Je*se));if(G===as)return;let mn=(ut.x===Je?0:2)|Number(ut.y&si),dt=G;return ee&&m(G)&&(dt=g(G),mn^=1),new p(Je,dt,mn)}return{seed:be,k2sig:Pe}}const F={lowS:e.lowS,prehash:!1},K={lowS:e.lowS,prehash:!1};function q(D,O,j=F){const{seed:Q,k2sig:J}=C(D,O,j),ee=e;return tb(ee.hash.outputLen,ee.nByteLength,ee.hmac)(Q,J)}l.BASE._setWindowSize(8);function $(D,O,j,Q=K){const J=D;if(O=yi("msgHash",O),j=yi("publicKey",j),"strict"in Q)throw new Error("options.strict was renamed to lowS");const{lowS:ee,prehash:ae}=Q;let ye,Me;try{if(typeof J=="string"||J instanceof Uint8Array)try{ye=p.fromDER(J)}catch(ut){if(!(ut instanceof pr.Err))throw ut;ye=p.fromCompact(J)}else if(typeof J=="object"&&typeof J.r=="bigint"&&typeof J.s=="bigint"){const{r:ut,s:Je}=J;ye=new p(ut,Je)}else throw new Error("PARSE");Me=l.fromHex(j)}catch(ut){if(ut.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ee&&ye.hasHighS())return!1;ae&&(O=e.hash(O));const{r:se,s:me}=ye,be=S(O),xe=c(me),Pe=o(be*xe),$e=o(se*xe),Qe=l.BASE.multiplyAndAddUnsafe(Me,Pe,$e)?.toAffine();return Qe?o(Qe.x)===se:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:M,sign:q,verify:$,ProjectivePoint:l,Signature:p,utils:y}}function mR(i){return{hash:i,hmac:(e,...t)=>F0(i,e,gT(...t)),randomBytes:mT}}function bR(i,e){const t=n=>gR({...i,...mR(n)});return Object.freeze({...t(e),create:t})}const lb=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),hb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xR=BigInt(1),ff=BigInt(2),ub=(i,e)=>(i+e/ff)/e;function ER(i){const e=lb,t=BigInt(3),n=BigInt(6),s=BigInt(11),r=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),l=i*i*i%e,h=l*l*i%e,u=ii(h,t,e)*h%e,d=ii(u,t,e)*h%e,f=ii(d,ff,e)*l%e,m=ii(f,s,e)*f%e,g=ii(m,r,e)*m%e,A=ii(g,o,e)*g%e,p=ii(A,c,e)*A%e,y=ii(p,o,e)*g%e,b=ii(y,t,e)*h%e,_=ii(b,a,e)*m%e,M=ii(_,n,e)*l%e,w=ii(M,ff,e);if(!pf.eql(pf.sqr(w),i))throw new Error("Cannot find square root");return w}const pf=oR(lb,void 0,void 0,{sqrt:ER}),zs=bR({a:BigInt(0),b:BigInt(7),Fp:pf,n:hb,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:i=>{const e=hb,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=t,a=BigInt("0x100000000000000000000000000000000"),o=ub(r*i,e),c=ub(-n*i,e);let l=Gn(i-o*t-c*s,e),h=Gn(-o*n-c*r,e);const u=l>a,d=h>a;if(u&&(l=e-l),d&&(h=e-h),l>a||h>a)throw new Error("splitScalar: Endomorphism failed, k="+i);return{k1neg:u,k1:l,k2neg:d,k2:h}}}},L0);BigInt(0),zs.ProjectivePoint;const ko="0x0000000000000000000000000000000000000000",db="0x0000000000000000000000000000000000000000000000000000000000000000",fb=BigInt(0),pb=BigInt(1),Af=BigInt(2),Ab=BigInt(27),gb=BigInt(28),Rl=BigInt(35),mb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_R=mb/Af,yR=Symbol.for("nodejs.util.inspect.custom"),Ar={};function gf(i){return ts(Zt(i),32)}class Gt{#e;#t;#n;#i;get r(){return this.#e}set r(e){V(_a(e)===32,"invalid r","value",e),this.#e=ve(e)}get s(){return V(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(e){V(_a(e)===32,"invalid s","value",e),this.#t=ve(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=_R}get v(){return this.#n}set v(e){const t=ht(e,"value");V(t===27||t===28,"invalid v","v",e),this.#n=t}get networkV(){return this.#i}get legacyChainId(){const e=this.networkV;return e==null?null:Gt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=lt(this.s);return this.yParity&&(e[0]|=128),ve(e)}get compactSerialized(){return Ut([this.r,this.yParityAndS])}get serialized(){return Ut([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,s){_l(e,Ar,"Signature"),this.#e=t,this.#t=n,this.#n=s,this.#i=null}getCanonical(){if(this.isValid())return this;const e=mb-BigInt(this._s),t=55-this.v,n=new Gt(Ar,this.r,gf(e),t);return this.networkV&&(n.#i=this.networkV),n}clone(){const e=new Gt(Ar,this.r,this._s,this.v);return this.networkV&&(e.#i=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this._s,v:this.v}}[yR](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){const t=Re(e,"v");return t==Ab||t==gb?fb:(V(t>=Rl,"invalid EIP-155 v","v",e),(t-Rl)/Af)}static getChainIdV(e,t){return Re(e)*Af+BigInt(35+t-27)}static getNormalizedV(e){const t=Re(e);return t===fb||t===Ab?27:t===pb||t===gb?28:(V(t>=Rl,"invalid v","v",e),t&pb?27:28)}static from(e){function t(l,h){V(l,h,"signature",e)}if(e==null)return new Gt(Ar,db,db,27);if(typeof e=="string"){const l=lt(e,"signature");if(l.length===64){const h=ve(l.slice(0,32)),u=l.slice(32,64),d=u[0]&128?28:27;return u[0]&=127,new Gt(Ar,h,ve(u),d)}if(l.length===65){const h=ve(l.slice(0,32)),u=ve(l.slice(32,64)),d=Gt.getNormalizedV(l[64]);return new Gt(Ar,h,u,d)}t(!1,"invalid raw signature length")}if(e instanceof Gt)return e.clone();const n=e.r;t(n!=null,"missing r");const s=gf(n),r=(function(l,h){if(l!=null)return gf(l);if(h!=null){t(Ft(h,32),"invalid yParityAndS");const u=lt(h);return u[0]&=127,ve(u)}t(!1,"missing s")})(e.s,e.yParityAndS),{networkV:a,v:o}=(function(l,h,u){if(l!=null){const d=Re(l);return{networkV:d>=Rl?d:void 0,v:Gt.getNormalizedV(d)}}if(h!=null)return t(Ft(h,32),"invalid yParityAndS"),{v:lt(h)[0]&128?28:27};if(u!=null){switch(ht(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")})(e.v,e.yParityAndS,e.yParity),c=new Gt(Ar,s,r,o);return a&&(c.#i=a),t(e.yParity==null||ht(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}}class os{#e;constructor(e){V(_a(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=ve(e)}get privateKey(){return this.#e}get publicKey(){return os.computePublicKey(this.#e)}get compressedPublicKey(){return os.computePublicKey(this.#e,!0)}sign(e){V(_a(e)===32,"invalid digest length","digest",e);const t=zs.sign(Dn(e),Dn(this.#e),{lowS:!0});return Gt.from({r:ks(t.r,32),s:ks(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=os.computePublicKey(e);return ve(zs.getSharedSecret(Dn(this.#e),lt(t),!1))}static computePublicKey(e,t){let n=lt(e,"key");if(n.length===32){const r=zs.getPublicKey(n,!!t);return ve(r)}if(n.length===64){const r=new Uint8Array(65);r[0]=4,r.set(n,1),n=r}const s=zs.ProjectivePoint.fromHex(n);return ve(s.toRawBytes(t))}static recoverPublicKey(e,t){V(_a(e)===32,"invalid digest length","digest",e);const n=Gt.from(t);let s=zs.Signature.fromCompact(Dn(Ut([n.r,n.s])));s=s.addRecoveryBit(n.yParity);const r=s.recoverPublicKey(Dn(e));return V(r!=null,"invalid signature for digest","signature",t),"0x"+r.toHex(!1)}static addPoints(e,t,n){const s=zs.ProjectivePoint.fromHex(os.computePublicKey(e).substring(2)),r=zs.ProjectivePoint.fromHex(os.computePublicKey(t).substring(2));return"0x"+s.add(r).toHex(!!n)}}const wR=BigInt(0),CR=BigInt(36);function bb(i){i=i.toLowerCase();const e=i.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const n=lt($t(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const mf={};for(let i=0;i<10;i++)mf[String(i)]=String(i);for(let i=0;i<26;i++)mf[String.fromCharCode(65+i)]=String(10+i);const xb=15;function vR(i){i=i.toUpperCase(),i=i.substring(4)+i.substring(0,2)+"00";let e=i.split("").map(n=>mf[n]).join("");for(;e.length>=xb;){let n=e.substring(0,xb);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const SR=(function(){const i={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];i[t]=BigInt(e)}return i})();function IR(i){i=i.toLowerCase();let e=wR;for(let t=0;t<i.length;t++)e=e*CR+SR[i[t]];return e}function vt(i){if(V(typeof i=="string","invalid address","address",i),i.match(/^(0x)?[0-9a-fA-F]{40}$/)){i.startsWith("0x")||(i="0x"+i);const e=bb(i);return V(!i.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===i,"bad address checksum","address",i),e}if(i.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){V(i.substring(2,4)===vR(i),"bad icap checksum","address",i);let e=IR(i.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return bb("0x"+e)}V(!1,"invalid address","address",i)}function MR(i){const e=vt(i.from);let n=Re(i.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,vt(Vt($t(is([e,n])),12))}function Eb(i){return i&&typeof i.getAddress=="function"}async function bf(i,e){const t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(pe(typeof i!="string","unconfigured name","UNCONFIGURED_NAME",{value:i}),V(!1,"invalid AddressLike value; did not resolve to a value address","target",i)),vt(t)}function Pn(i,e){if(typeof i=="string")return i.match(/^0x[0-9a-f]{40}$/i)?vt(i):(pe(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),bf(i,e.resolveName(i)));if(Eb(i))return bf(i,i.getAddress());if(i&&typeof i.then=="function")return bf(i,i);V(!1,"unsupported addressable value","target",i)}const cs={};function Be(i,e){let t=!1;return e<0&&(t=!0,e*=-1),new Wt(cs,`${t?"":"u"}int${e}`,i,{signed:t,width:e})}function xt(i,e){return new Wt(cs,`bytes${e||""}`,i,{size:e})}const _b=Symbol.for("_ethers_typed");class Wt{type;value;#e;_typedSymbol;constructor(e,t,n,s){s==null&&(s=null),_l(cs,e,"Typed"),Ye(this,{_typedSymbol:_b,type:t,value:n}),this.#e=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new Wt(cs,e,t)}static uint8(e){return Be(e,8)}static uint16(e){return Be(e,16)}static uint24(e){return Be(e,24)}static uint32(e){return Be(e,32)}static uint40(e){return Be(e,40)}static uint48(e){return Be(e,48)}static uint56(e){return Be(e,56)}static uint64(e){return Be(e,64)}static uint72(e){return Be(e,72)}static uint80(e){return Be(e,80)}static uint88(e){return Be(e,88)}static uint96(e){return Be(e,96)}static uint104(e){return Be(e,104)}static uint112(e){return Be(e,112)}static uint120(e){return Be(e,120)}static uint128(e){return Be(e,128)}static uint136(e){return Be(e,136)}static uint144(e){return Be(e,144)}static uint152(e){return Be(e,152)}static uint160(e){return Be(e,160)}static uint168(e){return Be(e,168)}static uint176(e){return Be(e,176)}static uint184(e){return Be(e,184)}static uint192(e){return Be(e,192)}static uint200(e){return Be(e,200)}static uint208(e){return Be(e,208)}static uint216(e){return Be(e,216)}static uint224(e){return Be(e,224)}static uint232(e){return Be(e,232)}static uint240(e){return Be(e,240)}static uint248(e){return Be(e,248)}static uint256(e){return Be(e,256)}static uint(e){return Be(e,256)}static int8(e){return Be(e,-8)}static int16(e){return Be(e,-16)}static int24(e){return Be(e,-24)}static int32(e){return Be(e,-32)}static int40(e){return Be(e,-40)}static int48(e){return Be(e,-48)}static int56(e){return Be(e,-56)}static int64(e){return Be(e,-64)}static int72(e){return Be(e,-72)}static int80(e){return Be(e,-80)}static int88(e){return Be(e,-88)}static int96(e){return Be(e,-96)}static int104(e){return Be(e,-104)}static int112(e){return Be(e,-112)}static int120(e){return Be(e,-120)}static int128(e){return Be(e,-128)}static int136(e){return Be(e,-136)}static int144(e){return Be(e,-144)}static int152(e){return Be(e,-152)}static int160(e){return Be(e,-160)}static int168(e){return Be(e,-168)}static int176(e){return Be(e,-176)}static int184(e){return Be(e,-184)}static int192(e){return Be(e,-192)}static int200(e){return Be(e,-200)}static int208(e){return Be(e,-208)}static int216(e){return Be(e,-216)}static int224(e){return Be(e,-224)}static int232(e){return Be(e,-232)}static int240(e){return Be(e,-240)}static int248(e){return Be(e,-248)}static int256(e){return Be(e,-256)}static int(e){return Be(e,-256)}static bytes1(e){return xt(e,1)}static bytes2(e){return xt(e,2)}static bytes3(e){return xt(e,3)}static bytes4(e){return xt(e,4)}static bytes5(e){return xt(e,5)}static bytes6(e){return xt(e,6)}static bytes7(e){return xt(e,7)}static bytes8(e){return xt(e,8)}static bytes9(e){return xt(e,9)}static bytes10(e){return xt(e,10)}static bytes11(e){return xt(e,11)}static bytes12(e){return xt(e,12)}static bytes13(e){return xt(e,13)}static bytes14(e){return xt(e,14)}static bytes15(e){return xt(e,15)}static bytes16(e){return xt(e,16)}static bytes17(e){return xt(e,17)}static bytes18(e){return xt(e,18)}static bytes19(e){return xt(e,19)}static bytes20(e){return xt(e,20)}static bytes21(e){return xt(e,21)}static bytes22(e){return xt(e,22)}static bytes23(e){return xt(e,23)}static bytes24(e){return xt(e,24)}static bytes25(e){return xt(e,25)}static bytes26(e){return xt(e,26)}static bytes27(e){return xt(e,27)}static bytes28(e){return xt(e,28)}static bytes29(e){return xt(e,29)}static bytes30(e){return xt(e,30)}static bytes31(e){return xt(e,31)}static bytes32(e){return xt(e,32)}static address(e){return new Wt(cs,"address",e)}static bool(e){return new Wt(cs,"bool",!!e)}static bytes(e){return new Wt(cs,"bytes",e)}static string(e){return new Wt(cs,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Wt(cs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===_b}static dereference(e,t){if(Wt.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class BR extends rs{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Wt.dereference(t,"string");try{n=vt(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return vt(ks(e.readValue(),20))}}class TR extends rs{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function yb(i,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(l=>{const h=l.localName;return pe(h,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),pe(!c[h],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),c[h]=!0,t[h]})}else V(!1,"invalid tuple value","tuple",t);V(e.length===n.length,"types/value length mismatch","tuple",t);let s=new Yd,r=new Yd,a=[];e.forEach((c,l)=>{let h=n[l];if(c.dynamic){let u=r.length;c.encode(r,h);let d=s.writeUpdatableValue();a.push(f=>{d(f+u)})}else c.encode(s,h)}),a.forEach(c=>{c(s.length)});let o=i.appendWriter(s);return o+=i.appendWriter(r),o}function wb(i,e){let t=[],n=[],s=i.subReader(0);return e.forEach(r=>{let a=null;if(r.dynamic){let o=i.readIndex(),c=s.subReader(o);try{a=r.decode(c)}catch(l){if(_n(l,"BUFFER_OVERRUN"))throw l;a=l,a.baseType=r.name,a.name=r.localName,a.type=r.type}}else try{a=r.decode(i)}catch(o){if(_n(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=r.name,a.name=r.localName,a.type=r.type}if(a==null)throw new Error("investigate");t.push(a),n.push(r.localName||null)}),ss.fromItems(t,n)}class RR extends rs{coder;length;constructor(e,t,n){const s=e.type+"["+(t>=0?t:"")+"]",r=t===-1||e.dynamic;super("array",s,n,r),Ye(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){const n=Wt.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let s=this.length;s===-1&&(s=n.length,e.writeValue(n.length)),r0(n.length,s,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let a=0;a<n.length;a++)r.push(this.coder);return yb(e,r,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),pe(t*Ln<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*Ln,length:e.dataLength}));let n=[];for(let s=0;s<t;s++)n.push(new TR(this.coder));return wb(e,n)}}class NR extends rs{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const n=Wt.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class Cb extends rs{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Dn(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class FR extends Cb{constructor(e){super("bytes",e)}decode(e){return ve(super.decode(e))}}class DR extends rs{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),Ye(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=Dn(Wt.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return ve(e.readBytes(this.size))}}const LR=new Uint8Array([]);class PR extends rs{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(LR)}decode(e){return e.readBytes(0),null}}const kR=BigInt(0),UR=BigInt(1),OR=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class QR extends rs{size;signed;constructor(e,t,n){const s=(t?"int":"uint")+e*8;super(s,s,n,!1),Ye(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=Re(Wt.dereference(t,this.type)),s=To(OR,Ln*8);if(this.signed){let r=To(s,this.size*8-1);(n>r||n<-(r+UR))&&this._throwError("value out-of-bounds",t),n=l0(n,8*Ln)}else(n<kR||n>To(s,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=To(e.readValue(),this.size*8);return this.signed&&(t=XB(t,this.size*8)),t}}class GR extends Cb{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,ns(Wt.dereference(t,"string")))}decode(e){return wl(super.decode(e))}}class Nl extends rs{coders;constructor(e,t){let n=!1;const s=[];e.forEach(a=>{a.dynamic&&(n=!0),s.push(a.type)});const r="tuple("+s.join(",")+")";super("tuple",r,t,n),Ye(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const t=this.coders.reduce((n,s)=>{const r=s.localName;return r&&(n[r]||(n[r]=0),n[r]++),n},{});return this.coders.forEach((n,s)=>{let r=n.localName;!r||t[r]!==1||(r==="length"&&(r="_length"),e[r]==null&&(e[r]=e[s]))}),Object.freeze(e)}encode(e,t){const n=Wt.dereference(t,"tuple");return yb(e,this.coders,n)}decode(e){return wb(e,this.coders)}}function xf(i,e){return{address:vt(i),storageKeys:e.map((t,n)=>(V(Ft(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function gr(i){if(Array.isArray(i))return i.map((t,n)=>Array.isArray(t)?(V(t.length===2,"invalid slot set",`value[${n}]`,t),xf(t[0],t[1])):(V(t!=null&&typeof t=="object","invalid address-slot set","value",i),xf(t.address,t.storageKeys)));V(i!=null&&typeof i=="object","invalid access list","value",i);const e=Object.keys(i).map(t=>{const n=i[t].reduce((s,r)=>(s[r]=!0,s),{});return xf(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function vb(i){return{address:vt(i.address),nonce:Re(i.nonce!=null?i.nonce:0),chainId:Re(i.chainId!=null?i.chainId:0),signature:Gt.from(i.signature)}}function HR(i){let e;return typeof i=="string"?e=os.computePublicKey(i,!1):e=i.publicKey,vt($t("0x"+e.substring(4)).substring(26))}function zR(i,e){return HR(os.recoverPublicKey(i,e))}const gn=BigInt(0),VR=BigInt(2),WR=BigInt(27),qR=BigInt(28),KR=BigInt(35),XR=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),YR=Symbol.for("nodejs.util.inspect.custom"),Ef=4096*32,Fl=128;function jR(i){return{blobToKzgCommitment:n=>{if("computeBlobProof"in i){if("blobToKzgCommitment"in i&&typeof i.blobToKzgCommitment=="function")return lt(i.blobToKzgCommitment(ve(n)))}else if("blobToKzgCommitment"in i&&typeof i.blobToKzgCommitment=="function")return lt(i.blobToKzgCommitment(n));if("blobToKZGCommitment"in i&&typeof i.blobToKZGCommitment=="function")return lt(i.blobToKZGCommitment(ve(n)));V(!1,"unsupported KZG library","kzg",i)},computeBlobKzgProof:(n,s)=>{if("computeBlobProof"in i&&typeof i.computeBlobProof=="function")return lt(i.computeBlobProof(ve(n),ve(s)));if("computeBlobKzgProof"in i&&typeof i.computeBlobKzgProof=="function")return i.computeBlobKzgProof(n,s);if("computeBlobKZGProof"in i&&typeof i.computeBlobKZGProof=="function")return lt(i.computeBlobKZGProof(ve(n),ve(s)));V(!1,"unsupported KZG library","kzg",i)}}}function Sb(i,e){let t=i.toString(16);for(;t.length<2;)t="0"+t;return t+=Ca(e).substring(4),"0x"+t}function Ia(i){return i==="0x"?null:vt(i)}function Dl(i,e){try{return gr(i)}catch(t){V(!1,t.message,e,i)}}function JR(i,e){try{if(!Array.isArray(i))throw new Error("authorizationList: invalid array");const t=[];for(let n=0;n<i.length;n++){const s=i[n];if(!Array.isArray(s))throw new Error(`authorization[${n}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${n}]: wrong length`);if(!s[1])throw new Error(`authorization[${n}]: null address`);t.push({address:Ia(s[1]),nonce:Tt(s[2],"nonce"),chainId:Tt(s[0],"chainId"),signature:Gt.from({yParity:mr(s[3],"yParity"),r:ts(s[4],32),s:ts(s[5],32)})})}return t}catch(t){V(!1,t.message,e,i)}}function mr(i,e){return i==="0x"?0:ht(i,e)}function Tt(i,e){if(i==="0x")return gn;const t=Re(i,e);return V(t<=XR,"value exceeds uint size",e,t),t}function gt(i,e){const t=Re(i,"value"),n=Zt(t);return V(n.length<=32,"value too large",`tx.${e}`,t),n}function Ll(i){return gr(i).map(e=>[e.address,e.storageKeys])}function ZR(i){return i.map(e=>[gt(e.chainId,"chainId"),e.address,gt(e.nonce,"nonce"),gt(e.signature.yParity,"yParity"),Zt(e.signature.r),Zt(e.signature._s)])}function $R(i,e){V(Array.isArray(i),`invalid ${e}`,"value",i);for(let t=0;t<i.length;t++)V(Ft(i[t],32),"invalid ${ param } hash",`value[${t}]`,i[t]);return i}function eN(i){const e=Ro(i);V(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",i);const t={type:0,nonce:mr(e[0],"nonce"),gasPrice:Tt(e[1],"gasPrice"),gasLimit:Tt(e[2],"gasLimit"),to:Ia(e[3]),value:Tt(e[4],"value"),data:ve(e[5]),chainId:gn};if(e.length===6)return t;const n=Tt(e[6],"v"),s=Tt(e[7],"r"),r=Tt(e[8],"s");if(s===gn&&r===gn)t.chainId=n;else{let a=(n-KR)/VR;a<gn&&(a=gn),t.chainId=a,V(a!==gn||n===WR||n===qR,"non-canonical legacy v","v",e[6]),t.signature=Gt.from({r:ts(e[7],32),s:ts(e[8],32),v:n})}return t}function tN(i,e){const t=[gt(i.nonce,"nonce"),gt(i.gasPrice||0,"gasPrice"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data];let n=gn;if(i.chainId!=gn)n=Re(i.chainId,"tx.chainId"),V(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(i.signature){const r=i.signature.legacyChainId;r!=null&&(n=r)}if(!e)return n!==gn&&(t.push(Zt(n)),t.push("0x"),t.push("0x")),is(t);let s=BigInt(27+e.yParity);return n!==gn?s=Gt.getChainIdV(n,e.v):BigInt(e.v)!==s&&V(!1,"tx.chainId/sig.v mismatch","sig",e),t.push(Zt(s)),t.push(Zt(e.r)),t.push(Zt(e._s)),is(t)}function Pl(i,e){let t;try{if(t=mr(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{V(!1,"invalid yParity","yParity",e[0])}const n=ts(e[1],32),s=ts(e[2],32),r=Gt.from({r:n,s,yParity:t});i.signature=r}function nN(i){const e=Ro(lt(i).slice(1));V(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",ve(i));const t={type:2,chainId:Tt(e[0],"chainId"),nonce:mr(e[1],"nonce"),maxPriorityFeePerGas:Tt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Tt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Tt(e[4],"gasLimit"),to:Ia(e[5]),value:Tt(e[6],"value"),data:ve(e[7]),accessList:Dl(e[8],"accessList")};return e.length===9||Pl(t,e.slice(9)),t}function iN(i,e){const t=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gt(i.maxFeePerGas||0,"maxFeePerGas"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data,Ll(i.accessList||[])];return e&&(t.push(gt(e.yParity,"yParity")),t.push(Zt(e.r)),t.push(Zt(e.s))),Ut(["0x02",is(t)])}function sN(i){const e=Ro(lt(i).slice(1));V(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",ve(i));const t={type:1,chainId:Tt(e[0],"chainId"),nonce:mr(e[1],"nonce"),gasPrice:Tt(e[2],"gasPrice"),gasLimit:Tt(e[3],"gasLimit"),to:Ia(e[4]),value:Tt(e[5],"value"),data:ve(e[6]),accessList:Dl(e[7],"accessList")};return e.length===8||Pl(t,e.slice(8)),t}function rN(i,e){const t=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.gasPrice||0,"gasPrice"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data,Ll(i.accessList||[])];return e&&(t.push(gt(e.yParity,"recoveryParam")),t.push(Zt(e.r)),t.push(Zt(e.s))),Ut(["0x01",is(t)])}function aN(i){let e=Ro(lt(i).slice(1)),t="3",n=null,s=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";const a=e[1],o=e[2],c=e[3];V(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),V(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),V(Array.isArray(c),"invalid network format: proofs not an array","fields[3]",c),V(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),V(a.length===c.length,"invalid network format: blobs/proofs length mismatch","fields",e),s=[];for(let l=0;l<e[1].length;l++)s.push({data:a[l],commitment:o[l],proof:c[l]});e=e[0]}else if(e.length===5&&Array.isArray(e[0])){t="3 (EIP-7594 network format)",n=ht(e[1]);const a=e[2],o=e[3],c=e[4];V(n===1,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),V(Array.isArray(a),"invalid EIP-7594 network format: blobs not an array","fields[2]",a),V(Array.isArray(o),"invalid EIP-7594 network format: commitments not an array","fields[3]",o),V(Array.isArray(c),"invalid EIP-7594 network format: proofs not an array","fields[4]",c),V(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),V(a.length*Fl===c.length,"invalid network format: blobs/proofs length mismatch","fields",e),s=[];for(let l=0;l<a.length;l++){const h=[];for(let u=0;u<Fl;u++)h.push(c[l*Fl+u]);s.push({data:a[l],commitment:o[l],proof:Ut(h)})}e=e[0]}V(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",ve(i));const r={type:3,chainId:Tt(e[0],"chainId"),nonce:mr(e[1],"nonce"),maxPriorityFeePerGas:Tt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Tt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Tt(e[4],"gasLimit"),to:Ia(e[5]),value:Tt(e[6],"value"),data:ve(e[7]),accessList:Dl(e[8],"accessList"),maxFeePerBlobGas:Tt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10],blobWrapperVersion:n};s&&(r.blobs=s),V(r.to!=null,`invalid address for transaction type: ${t}`,"data",i),V(Array.isArray(r.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",i);for(let a=0;a<r.blobVersionedHashes.length;a++)V(Ft(r.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",i);return e.length===11||Pl(r,e.slice(11)),r}function oN(i,e,t){const n=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gt(i.maxFeePerGas||0,"maxFeePerGas"),gt(i.gasLimit,"gasLimit"),i.to||ko,gt(i.value,"value"),i.data,Ll(i.accessList||[]),gt(i.maxFeePerBlobGas||0,"maxFeePerBlobGas"),$R(i.blobVersionedHashes||[],"blobVersionedHashes")];if(e&&(n.push(gt(e.yParity,"yParity")),n.push(Zt(e.r)),n.push(Zt(e.s)),t)){if(i.blobWrapperVersion!=null){const s=Zt(i.blobWrapperVersion),r=[];for(const{proof:a}of t){const o=lt(a),c=o.length/Fl;for(let l=0;l<o.length;l+=c)r.push(o.subarray(l,l+c))}return Ut(["0x03",is([n,s,t.map(a=>a.data),t.map(a=>a.commitment),r])])}return Ut(["0x03",is([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])])}return Ut(["0x03",is(n)])}function cN(i){const e=Ro(lt(i).slice(1));V(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",ve(i));const t={type:4,chainId:Tt(e[0],"chainId"),nonce:mr(e[1],"nonce"),maxPriorityFeePerGas:Tt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Tt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Tt(e[4],"gasLimit"),to:Ia(e[5]),value:Tt(e[6],"value"),data:ve(e[7]),accessList:Dl(e[8],"accessList"),authorizationList:JR(e[9],"authorizationList")};return e.length===10||Pl(t,e.slice(10)),t}function lN(i,e){const t=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gt(i.maxFeePerGas||0,"maxFeePerGas"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data,Ll(i.accessList||[]),ZR(i.authorizationList||[])];return e&&(t.push(gt(e.yParity,"yParity")),t.push(Zt(e.r)),t.push(Zt(e.s))),Ut(["0x04",is(t)])}class wi{#e;#t;#n;#i;#s;#a;#r;#o;#f;#l;#p;#A;#c;#h;#u;#d;#b;#g;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;case 4:case"pectra":case"eip-7702":this.#e=4;break;default:V(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#t;return e==null&&this.type===3?ko:e}set to(e){this.#t=e==null?null:vt(e)}get nonce(){return this.#i}set nonce(e){this.#i=ht(e,"value")}get gasLimit(){return this.#s}set gasLimit(e){this.#s=Re(e)}get gasPrice(){const e=this.#a;return e==null&&(this.type===0||this.type===1)?gn:e}set gasPrice(e){this.#a=e==null?null:Re(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#r;return e??(this.type===2||this.type===3?gn:null)}set maxPriorityFeePerGas(e){this.#r=e==null?null:Re(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#o;return e??(this.type===2||this.type===3?gn:null)}set maxFeePerGas(e){this.#o=e==null?null:Re(e,"maxFeePerGas")}get data(){return this.#n}set data(e){this.#n=ve(e)}get value(){return this.#f}set value(e){this.#f=Re(e,"value")}get chainId(){return this.#l}set chainId(e){this.#l=Re(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:Gt.from(e)}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const t=this.authorizationList;if(t){for(const n of t)if(!n.signature.isValid())return!1}return!0}get accessList(){const e=this.#A||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#A=e==null?null:gr(e)}get authorizationList(){const e=this.#b||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#b=e==null?null:e.map(t=>vb(t))}get maxFeePerBlobGas(){const e=this.#c;return e==null&&this.type===3?gn:e}set maxFeePerBlobGas(e){this.#c=e==null?null:Re(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#h;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){V(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)V(Ft(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#h=e}get blobs(){return this.#d==null?null:this.#d.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#d=null;return}const t=[],n=[];for(let s=0;s<e.length;s++){const r=e[s];if(Vd(r)){pe(this.#u,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=lt(r);if(V(a.length<=Ef,"blob is too large",`blobs[${s}]`,r),a.length!==Ef){const l=new Uint8Array(Ef);l.set(a),a=l}const o=this.#u.blobToKzgCommitment(a),c=ve(this.#u.computeBlobKzgProof(a,o));t.push({data:ve(a),commitment:ve(o),proof:c}),n.push(Sb(1,o))}else{const a=ve(r.data),o=ve(r.commitment),c=ve(r.proof);t.push({data:a,commitment:o,proof:c}),n.push(Sb(1,o))}}this.#d=t,this.#h=n}get kzg(){return this.#u}set kzg(e){e==null?this.#u=null:this.#u=jR(e)}get blobWrapperVersion(){return this.#g}set blobWrapperVersion(e){this.#g=e}constructor(){this.#e=null,this.#t=null,this.#i=0,this.#s=gn,this.#a=null,this.#r=null,this.#o=null,this.#n="0x",this.#f=gn,this.#l=gn,this.#p=null,this.#A=null,this.#c=null,this.#h=null,this.#u=null,this.#d=null,this.#b=null,this.#g=null}get hash(){return this.signature==null?null:$t(this.#m(!0,!1))}get unsignedHash(){return $t(this.unsignedSerialized)}get from(){return this.signature==null?null:zR(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:os.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#m(e,t){pe(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return tN(this,n);case 1:return rN(this,n);case 2:return iN(this,n);case 3:return oN(this,n,t?this.blobs:null);case 4:return lN(this,n)}pe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#m(!0,!0)}get unsignedSerialized(){return this.#m(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=this.#c!=null||this.#h;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&pe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),pe(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),pe(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const r=[];return this.type!=null?r.push(this.type):this.authorizationList&&this.authorizationList.length?r.push(4):t?r.push(2):e?(r.push(1),n||r.push(0)):n?(r.push(1),r.push(2)):(s&&this.to||(r.push(0),r.push(1),r.push(2)),r.push(3)),r.sort(),r}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return wi.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[YR](){return this.toString()}toString(){const e=[],t=s=>{let r=this[s];typeof r=="string"&&(r=JSON.stringify(r)),e.push(`${s}: ${r}`)};this.type&&t("type"),t("to"),t("data"),t("nonce"),t("gasLimit"),t("value"),this.chainId!=null&&t("chainId"),this.signature&&(t("from"),e.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const s=[];for(const r of n){const a=[];a.push(`address: ${JSON.stringify(r.address)}`),r.nonce!=null&&a.push(`nonce: ${r.nonce}`),r.chainId!=null&&a.push(`chainId: ${r.chainId}`),r.signature&&a.push(`signature: ${r.signature.toString()}`),s.push(`Authorization { ${a.join(", ")} }`)}e.push(`authorizations: [ ${s.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(e==null)return new wi;if(typeof e=="string"){const n=lt(e);if(n[0]>=127)return wi.from(eN(n));switch(n[0]){case 1:return wi.from(sN(n));case 2:return wi.from(nN(n));case 3:return wi.from(aN(n));case 4:return wi.from(cN(n))}pe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new wi;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Gt.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.authorizationList!=null&&(t.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobWrapperVersion!=null&&(t.blobWrapperVersion=e.blobWrapperVersion),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&(V(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),V(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(V(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),V(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}function br(i){return $t(ns(i))}var hN="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy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SlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const Ib=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Mb=4;function uN(i){let e=0;function t(){return i[e++]<<8|i[e++]}let n=t(),s=1,r=[0,1];for(let M=1;M<n;M++)r.push(s+=t());let a=t(),o=e;e+=a;let c=0,l=0;function h(){return c==0&&(l=l<<8|i[e++],c=8),l>>--c&1}const u=31,d=2**u,f=d>>>1,m=f>>1,g=d-1;let A=0;for(let M=0;M<u;M++)A=A<<1|h();let p=[],y=0,b=d;for(;;){let M=Math.floor(((A-y+1)*s-1)/b),w=0,S=n;for(;S-w>1;){let C=w+S>>>1;M<r[C]?S=C:w=C}if(w==0)break;p.push(w);let T=y+Math.floor(b*r[w]/s),v=y+Math.floor(b*r[w+1]/s)-1;for(;((T^v)&f)==0;)A=A<<1&g|h(),T=T<<1&g,v=v<<1&g|1;for(;T&~v&m;)A=A&f|A<<1&g>>>1|h(),T=T<<1^f,v=(v^f)<<1|f|1;y=T,b=1+v-T}let _=n-4;return p.map(M=>{switch(M-_){case 3:return _+65792+(i[o++]<<16|i[o++]<<8|i[o++]);case 2:return _+256+(i[o++]<<8|i[o++]);case 1:return _+i[o++];default:return M-1}})}function dN(i){let e=0;return()=>i[e++]}function Bb(i){return dN(uN(fN(i)))}function fN(i){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,r)=>e[s.charCodeAt(0)]=r);let t=i.length,n=new Uint8Array(6*t>>3);for(let s=0,r=0,a=0,o=0;s<t;s++)o=o<<6|e[i.charCodeAt(s)],a+=6,a>=8&&(n[r++]=o>>(a-=8));return n}function pN(i){return i&1?~i>>1:i>>1}function AN(i,e){let t=Array(i);for(let n=0,s=0;n<i;n++)t[n]=s+=pN(e());return t}function Uo(i,e=0){let t=[];for(;;){let n=i(),s=i();if(!s)break;e+=n;for(let r=0;r<s;r++)t.push(e+r);e+=s+1}return t}function Tb(i){return Oo(()=>{let e=Uo(i);if(e.length)return e})}function Rb(i){let e=[];for(;;){let t=i();if(t==0)break;e.push(gN(t,i))}for(;;){let t=i()-1;if(t<0)break;e.push(mN(t,i))}return e.flat()}function Oo(i){let e=[];for(;;){let t=i(e.length);if(!t)break;e.push(t)}return e}function Nb(i,e,t){let n=Array(i).fill().map(()=>[]);for(let s=0;s<e;s++)AN(i,t).forEach((r,a)=>n[a].push(r));return n}function gN(i,e){let t=1+e(),n=e(),s=Oo(e);return Nb(s.length,1+i,e).flatMap((a,o)=>{let[c,...l]=a;return Array(s[o]).fill().map((h,u)=>{let d=u*n;return[c+u*t,l.map(f=>f+d)]})})}function mN(i,e){let t=1+e();return Nb(t,1+i,e).map(s=>[s[0],s.slice(1)])}function bN(i){let e=[],t=Uo(i);return s(n([]),[]),e;function n(r){let a=i(),o=Oo(()=>{let c=Uo(i).map(l=>t[l]);if(c.length)return n(c)});return{S:a,B:o,Q:r}}function s({S:r,B:a},o,c){if(!(r&4&&c===o[o.length-1])){r&2&&(c=o[o.length-1]),r&1&&e.push(o);for(let l of a)for(let h of l.Q)s(l,[...o,h],c)}}}function xN(i){return i.toString(16).toUpperCase().padStart(2,"0")}function Fb(i){return`{${xN(i)}}`}function EN(i){let e=[];for(let t=0,n=i.length;t<n;){let s=i.codePointAt(t);t+=s<65536?1:2,e.push(s)}return e}function Ma(i){let t=i.length;if(t<4096)return String.fromCodePoint(...i);let n=[];for(let s=0;s<t;)n.push(String.fromCodePoint(...i.slice(s,s+=4096)));return n.join("")}function _N(i,e){let t=i.length,n=t-e.length;for(let s=0;n==0&&s<t;s++)n=i[s]-e[s];return n}var yN="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwE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iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const Qo=44032,kl=4352,Ul=4449,Ol=4519,Db=19,Lb=21,Ba=28,Ql=Lb*Ba,wN=Db*Ql,CN=Qo+wN,vN=kl+Db,SN=Ul+Lb,IN=Ol+Ba;function Go(i){return i>>24&255}function Pb(i){return i&16777215}let _f,kb,yf,Gl;function MN(){let i=Bb(yN);_f=new Map(Tb(i).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),kb=new Set(Uo(i)),yf=new Map,Gl=new Map;for(let[e,t]of Rb(i)){if(!kb.has(e)&&t.length==2){let[n,s]=t,r=Gl.get(n);r||(r=new Map,Gl.set(n,r)),r.set(s,e)}yf.set(e,t.reverse())}}function Ub(i){return i>=Qo&&i<CN}function BN(i,e){if(i>=kl&&i<vN&&e>=Ul&&e<SN)return Qo+(i-kl)*Ql+(e-Ul)*Ba;if(Ub(i)&&e>Ol&&e<IN&&(i-Qo)%Ba==0)return i+(e-Ol);{let t=Gl.get(i);return t&&(t=t.get(e),t)?t:-1}}function Ob(i){_f||MN();let e=[],t=[],n=!1;function s(r){let a=_f.get(r);a&&(n=!0,r|=a),e.push(r)}for(let r of i)for(;;){if(r<128)e.push(r);else if(Ub(r)){let a=r-Qo,o=a/Ql|0,c=a%Ql/Ba|0,l=a%Ba;s(kl+o),s(Ul+c),l>0&&s(Ol+l)}else{let a=yf.get(r);a?t.push(...a):s(r)}if(!t.length)break;r=t.pop()}if(n&&e.length>1){let r=Go(e[0]);for(let a=1;a<e.length;a++){let o=Go(e[a]);if(o==0||r<=o){r=o;continue}let c=a-1;for(;;){let l=e[c+1];if(e[c+1]=e[c],e[c]=l,!c||(r=Go(e[--c]),r<=o))break}r=Go(e[a])}}return e}function TN(i){let e=[],t=[],n=-1,s=0;for(let r of i){let a=Go(r),o=Pb(r);if(n==-1)a==0?n=o:e.push(o);else if(s>0&&s>=a)a==0?(e.push(n,...t),t.length=0,n=o):t.push(o),s=a;else{let c=BN(n,o);c>=0?n=c:s==0&&a==0?(e.push(n),n=o):(t.push(o),s=a)}}return n>=0&&e.push(n,...t),e}function Qb(i){return Ob(i).map(Pb)}function RN(i){return TN(Ob(i))}const Gb=45,Hb=".",zb=65039,Vb=1,Hl=i=>Array.from(i);function Ho(i,e){return i.P.has(e)||i.Q.has(e)}class NN extends Array{get is_emoji(){return!0}}let wf,Wb,xr,Cf,qb,Ta,vf,Ra,Er,Kb,Sf;function If(){if(wf)return;let i=Bb(hN);const e=()=>Uo(i),t=()=>new Set(e()),n=(h,u)=>u.forEach(d=>h.add(d));wf=new Map(Rb(i)),Wb=t(),xr=e(),Cf=new Set(e().map(h=>xr[h])),xr=new Set(xr),qb=t(),t();let s=Tb(i),r=i();const a=()=>{let h=new Set;return e().forEach(u=>n(h,s[u])),n(h,e()),h};Ta=Oo(h=>{let u=Oo(i).map(d=>d+96);if(u.length){let d=h>=r;u[0]-=32,u=Ma(u),d&&(u=`Restricted[${u}]`);let f=a(),m=a(),g=!i();return{N:u,P:f,Q:m,M:g,R:d}}}),vf=t(),Ra=new Map;let o=e().concat(Hl(vf)).sort((h,u)=>h-u);o.forEach((h,u)=>{let d=i(),f=o[u]=d?o[u-d]:{V:[],M:new Map};f.V.push(h),vf.has(h)||Ra.set(h,f)});for(let{V:h,M:u}of new Set(Ra.values())){let d=[];for(let m of h){let g=Ta.filter(p=>Ho(p,m)),A=d.find(({G:p})=>g.some(y=>p.has(y)));A||(A={G:new Set,V:[]},d.push(A)),A.V.push(m),n(A.G,g)}let f=d.flatMap(m=>Hl(m.G));for(let{G:m,V:g}of d){let A=new Set(f.filter(p=>!m.has(p)));for(let p of g)u.set(p,A)}}Er=new Set;let c=new Set;const l=h=>Er.has(h)?c.add(h):Er.add(h);for(let h of Ta){for(let u of h.P)l(u);for(let u of h.Q)l(u)}for(let h of Er)!Ra.has(h)&&!c.has(h)&&Ra.set(h,Vb);n(Er,Qb(Er)),Kb=bN(i).map(h=>NN.from(h)).sort(_N),Sf=new Map;for(let h of Kb){let u=[Sf];for(let d of h){let f=u.map(m=>{let g=m.get(d);return g||(g=new Map,m.set(d,g)),g});d===zb?u.push(...f):u=f}for(let d of u)d.V=h}}function Mf(i){return(Xb(i)?"":`${Bf(zl([i]))} `)+Fb(i)}function Bf(i){return`"${i}"`}function FN(i){if(i.length>=4&&i[2]==Gb&&i[3]==Gb)throw new Error(`invalid label extension: "${Ma(i.slice(0,4))}"`)}function DN(i){for(let t=i.lastIndexOf(95);t>0;)if(i[--t]!==95)throw new Error("underscore allowed only at start")}function LN(i){let e=i[0],t=Ib.get(e);if(t)throw zo(`leading ${t}`);let n=i.length,s=-1;for(let r=1;r<n;r++){e=i[r];let a=Ib.get(e);if(a){if(s==r)throw zo(`${t} + ${a}`);s=r+1,t=a}}if(s==n)throw zo(`trailing ${t}`)}function zl(i,e=1/0,t=Fb){let n=[];PN(i[0])&&n.push("◌"),i.length>e&&(e>>=1,i=[...i.slice(0,e),8230,...i.slice(-e)]);let s=0,r=i.length;for(let a=0;a<r;a++){let o=i[a];Xb(o)&&(n.push(Ma(i.slice(s,a))),n.push(t(o)),s=a+1)}return n.push(Ma(i.slice(s,r))),n.join("")}function PN(i){return If(),xr.has(i)}function Xb(i){return If(),qb.has(i)}function kN(i){return GN(UN(i,RN,VN))}function UN(i,e,t){if(!i)return[];If();let n=0;return i.split(Hb).map(s=>{let r=EN(s),a={input:r,offset:n};n+=r.length+1;try{let o=a.tokens=zN(r,e,t),c=o.length,l;if(!c)throw new Error("empty label");let h=a.output=o.flat();if(DN(h),!(a.emoji=c>1||o[0].is_emoji)&&h.every(d=>d<128))FN(h),l="ASCII";else{let d=o.flatMap(f=>f.is_emoji?[]:f);if(!d.length)l="Emoji";else{if(xr.has(h[0]))throw zo("leading combining mark");for(let g=1;g<c;g++){let A=o[g];if(!A.is_emoji&&xr.has(A[0]))throw zo(`emoji + combining mark: "${Ma(o[g-1])} + ${zl([A[0]])}"`)}LN(h);let f=Hl(new Set(d)),[m]=QN(f);HN(m,d),ON(m,f),l=m.N}}a.type=l}catch(o){a.error=o}return a})}function ON(i,e){let t,n=[];for(let s of e){let r=Ra.get(s);if(r===Vb)return;if(r){let a=r.M.get(s);if(t=t?t.filter(o=>a.has(o)):Hl(a),!t.length)return}else n.push(s)}if(t){for(let s of t)if(n.every(r=>Ho(s,r)))throw new Error(`whole-script confusable: ${i.N}/${s.N}`)}}function QN(i){let e=Ta;for(let t of i){let n=e.filter(s=>Ho(s,t));if(!n.length)throw Ta.some(s=>Ho(s,t))?jb(e[0],t):Yb(t);if(e=n,n.length==1)break}return e}function GN(i){return i.map(({input:e,error:t,output:n})=>{if(t){let s=t.message;throw new Error(i.length==1?s:`Invalid label ${Bf(zl(e,63))}: ${s}`)}return Ma(n)}).join(Hb)}function Yb(i){return new Error(`disallowed character: ${Mf(i)}`)}function jb(i,e){let t=Mf(e),n=Ta.find(s=>s.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${i.N} + ${t}`)}function zo(i){return new Error(`illegal placement: ${i}`)}function HN(i,e){for(let t of e)if(!Ho(i,t))throw jb(i,t);if(i.M){let t=Qb(e);for(let n=1,s=t.length;n<s;n++)if(Cf.has(t[n])){let r=n+1;for(let a;r<s&&Cf.has(a=t[r]);r++)for(let o=n;o<r;o++)if(t[o]==a)throw new Error(`duplicate non-spacing marks: ${Mf(a)}`);if(r-n>Mb)throw new Error(`excessive non-spacing marks: ${Bf(zl(t.slice(n-1,r)))} (${r-n}/${Mb})`);n=r}}}function zN(i,e,t){let n=[],s=[];for(i=i.slice().reverse();i.length;){let r=WN(i);if(r)s.length&&(n.push(e(s)),s=[]),n.push(t(r));else{let a=i.pop();if(Er.has(a))s.push(a);else{let o=wf.get(a);if(o)s.push(...o);else if(!Wb.has(a))throw Yb(a)}}}return s.length&&n.push(e(s)),n}function VN(i){return i.filter(e=>e!=zb)}function WN(i,e){let t=Sf,n,s=i.length;for(;s&&(t=t.get(i[--s]),!!t);){let{V:r}=t;r&&(n=r,i.length=s)}return n}const Jb=new Uint8Array(32);Jb.fill(0);function Zb(i){return V(i.length!==0,"invalid ENS name; empty component","comp",i),i}function $b(i){const e=ns(qN(i)),t=[];if(i.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(Zb(e.slice(n,s))),n=s+1);return V(n<e.length,"invalid ENS name; empty component","name",i),t.push(Zb(e.slice(n))),t}function qN(i){try{if(i.length===0)throw new Error("empty label");return kN(i)}catch(e){V(!1,`invalid ENS name (${e.message})`,"name",i)}}function Tf(i){V(typeof i=="string","invalid ENS name; not a string","name",i),V(i.length,"invalid ENS name (empty label)","name",i);let e=Jb;const t=$b(i);for(;t.length;)e=$t(Ut([e,$t(t.pop())]));return ve(e)}function KN(i,e){const t=e;return V(t<=255,"DNS encoded label cannot exceed 255","length",t),ve(Ut($b(i).map(n=>{V(n.length<=t,`label ${JSON.stringify(i)} exceeds ${t} bytes`,"name",i);const s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}const ex=new Uint8Array(32);ex.fill(0);const XN=BigInt(-1),tx=BigInt(0),nx=BigInt(1),YN=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jN(i){const e=lt(i),t=e.length%32;return t?Ut([e,ex.slice(t)]):ve(e)}const JN=ks(nx,32),ZN=ks(tx,32),ix={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Rf=["name","version","chainId","verifyingContract","salt"];function sx(i){return function(e){return V(typeof e=="string",`invalid domain value for ${JSON.stringify(i)}`,`domain.${i}`,e),e}}const $N={name:sx("name"),version:sx("version"),chainId:function(i){const e=Re(i,"domain.chainId");return V(e>=0,"invalid chain ID","domain.chainId",i),Number.isSafeInteger(e)?Number(e):_i(e)},verifyingContract:function(i){try{return vt(i).toLowerCase()}catch{}V(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",i)},salt:function(i){const e=lt(i,"domain.salt");return V(e.length===32,'invalid domain value "salt"',"domain.salt",i),ve(e)}};function Nf(i){{const e=i.match(/^(u?)int(\d+)$/);if(e){const t=e[1]==="",n=parseInt(e[2]);V(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",i);const s=To(YN,t?n-1:n),r=t?(s+nx)*XN:tx;return function(a){const o=Re(a,"value");return V(o>=r&&o<=s,`value out-of-bounds for ${i}`,"value",o),ks(t?l0(o,256):o,32)}}}{const e=i.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return V(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",i),function(n){const s=lt(n);return V(s.length===t,`invalid length for ${i}`,"value",n),jN(n)}}}switch(i){case"address":return function(e){return ts(vt(e),32)};case"bool":return function(e){return e?JN:ZN};case"bytes":return function(e){return $t(e)};case"string":return function(e){return br(e)}}return null}function rx(i,e){return`${i}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function Vl(i){const e=i.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:i}}class Kn{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#n;constructor(e){this.#t=new Map,this.#n=new Map;const t=new Map,n=new Map,s=new Map,r={};Object.keys(e).forEach(c=>{r[c]=e[c].map(({name:l,type:h})=>{let{base:u,index:d}=Vl(h);return u==="int"&&!e.int&&(u="int256"),u==="uint"&&!e.uint&&(u="uint256"),{name:l,type:u+(d||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),this.#e=JSON.stringify(r);for(const c in r){const l=new Set;for(const h of r[c]){V(!l.has(h.name),`duplicate variable name ${JSON.stringify(h.name)} in ${JSON.stringify(c)}`,"types",e),l.add(h.name);const u=Vl(h.type).base;V(u!==c,`circular type reference to ${JSON.stringify(u)}`,"types",e),!Nf(u)&&(V(n.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),n.get(u).push(c),t.get(c).add(u))}}const a=Array.from(n.keys()).filter(c=>n.get(c).length===0);V(a.length!==0,"missing primary type","types",e),V(a.length===1,`ambiguous primary types or unused types: ${a.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Ye(this,{primaryType:a[0]});function o(c,l){V(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const h of t.get(c))if(n.has(h)){o(h,l);for(const u of l)s.get(u).add(h)}l.delete(c)}o(this.primaryType,new Set);for(const[c,l]of s){const h=Array.from(l);h.sort(),this.#t.set(c,rx(c,r[c])+h.map(u=>rx(u,r[u])).join(""))}}getEncoder(e){let t=this.#n.get(e);return t||(t=this.#i(e),this.#n.set(e,t)),t}#i(e){{const s=Nf(e);if(s)return s}const t=Vl(e).array;if(t){const s=t.prefix,r=this.getEncoder(s);return a=>{V(t.count===-1||t.count===a.length,`array length mismatch; expected length ${t.count}`,"value",a);let o=a.map(r);return this.#t.has(s)&&(o=o.map($t)),$t(Ut(o))}}const n=this.types[e];if(n){const s=br(this.#t.get(e));return r=>{const a=n.map(({name:o,type:c})=>{const l=this.getEncoder(c)(r[o]);return this.#t.has(c)?$t(l):l});return a.unshift(s),Ut(a)}}V(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#t.get(e);return V(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return $t(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Nf(e))return n(e,t);const s=Vl(e).array;if(s)return V(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(a=>this._visit(s.prefix,a,n));const r=this.types[e];if(r)return r.reduce((a,{name:o,type:c})=>(a[o]=this._visit(c,t[o],n),a),{});V(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Kn(e)}static getPrimaryType(e){return Kn.from(e).primaryType}static hashStruct(e,t,n){return Kn.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(e[n]==null)continue;const s=ix[n];V(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>Rf.indexOf(n.name)-Rf.indexOf(s.name)),Kn.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Ut(["0x1901",Kn.hashDomain(e),Kn.from(t).hash(n)])}static hash(e,t,n){return $t(Kn.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const r={};e.verifyingContract&&!Ft(e.verifyingContract,20)&&(r[e.verifyingContract]="0x");const a=Kn.from(t);a.visit(n,(o,c)=>(o==="address"&&!Ft(c,20)&&(r[c]="0x"),c));for(const o in r)r[o]=await s(o);return e.verifyingContract&&r[e.verifyingContract]&&(e.verifyingContract=r[e.verifyingContract]),n=a.visit(n,(o,c)=>o==="address"&&r[c]?r[c]:c),{domain:e,value:n}}static getPayload(e,t,n){Kn.hashDomain(e);const s={},r=[];Rf.forEach(c=>{const l=e[c];l!=null&&(s[c]=$N[c](l),r.push({name:c,type:ix[c]}))});const a=Kn.from(t);t=a.types;const o=Object.assign({},t);return V(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=r,a.encode(n),{types:o,domain:s,primaryType:a.primaryType,message:a.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return ve(lt(l));if(c.match(/^u?int/))return Re(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return V(typeof l=="string","invalid string","value",l),l}V(!1,"unsupported type","type",c)})}}}function kn(i){const e=new Set;return i.forEach(t=>e.add(t)),Object.freeze(e)}const eF=kn("external public payable override".split(" ")),ax="constant external internal payable private public pure view override",tF=kn(ax.split(" ")),ox="constructor error event fallback function receive struct",cx=kn(ox.split(" ")),lx="calldata memory storage payable indexed",nF=kn(lx.split(" ")),iF=[ox,lx,"tuple returns",ax].join(" "),sF=kn(iF.split(" ")),rF={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},aF=new RegExp("^(\\s*)"),oF=new RegExp("^([0-9]+)"),cF=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),hx=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),ux=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class ri{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new ri(this.#t)}reset(){this.#e=0}#n(e=0,t=0){return new ri(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=this.#n(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;this.#e<e.match-1;){const n=this.peek().linkNext;t.push(this.#n(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let t=this.#e;t<this.#t.length;t++){const n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}}function Vs(i){const e=[],t=a=>{const o=r<i.length?JSON.stringify(i[r]):"$EOI";throw new Error(`invalid token ${o} at ${r}: ${a}`)};let n=[],s=[],r=0;for(;r<i.length;){let a=i.substring(r),o=a.match(aF);o&&(r+=o[1].length,a=i.substring(r));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:r,value:-1};e.push(c);let l=rF[a[0]]||"";if(l){if(c.type=l,c.text=a[0],r++,l==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(l=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(l==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let h=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;h=u+h,e[e.length-1].value=ht(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=h}continue}if(o=a.match(cF),o){if(c.text=o[1],r+=c.text.length,sF.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(ux)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(oF),o){c.text=o[1],c.type="NUMBER",r+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${r}`)}return new ri(e.map(a=>Object.freeze(a)))}function dx(i,e){let t=[];for(const n in e.keys())i.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function Wl(i,e){if(e.peekKeyword(cx)){const t=e.pop().text;if(t!==i)throw new Error(`expected ${i}, got ${t}`)}return e.popType("ID")}function ls(i,e){const t=new Set;for(;;){const n=i.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(i.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function fx(i){let e=ls(i,tF);return dx(e,kn("constant payable nonpayable".split(" "))),dx(e,kn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function hs(i,e){return i.popParams().map(t=>Dt.from(t,e))}function px(i){if(i.peekType("AT")){if(i.pop(),i.peekType("NUMBER"))return Re(i.pop().text);throw new Error("invalid gas")}return null}function _r(i){if(i.length)throw new Error(`unexpected tokens at offset ${i.offset}: ${i.toString()}`)}const lF=new RegExp(/^(.*)\[([0-9]*)\]$/);function Ax(i){const e=i.match(ux);if(V(e,"invalid type","type",i),i==="uint")return"uint256";if(i==="int")return"int256";if(e[2]){const t=parseInt(e[2]);V(t!==0&&t<=32,"invalid bytes length","type",i)}else if(e[3]){const t=parseInt(e[3]);V(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",i)}return i}const Ht={},Hn=Symbol.for("_ethers_internal"),gx="_ParamTypeInternal",mx="_ErrorInternal",bx="_EventInternal",xx="_ConstructorInternal",Ex="_FallbackInternal",_x="_FunctionInternal",yx="_StructInternal";class Dt{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,s,r,a,o,c){if(_l(e,Ht,"ParamType"),Object.defineProperty(this,Hn,{value:gx}),a&&(a=Object.freeze(a.slice())),s==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Ye(this,{name:t,type:n,baseType:s,indexed:r,components:a,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const r=JSON.parse(this.arrayChildren.format("json"));return r.name=n,r.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(r)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(r=>JSON.parse(r.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(s=>n.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((s,r)=>n.components[r].walk(s,t))}return t(this.type,e)}#e(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=t.slice();o.forEach((c,l)=>{a.#e(e,c,n,h=>{o[l]=h})}),s(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,l)=>{a[l].#e(e,c,n,h=>{o[l]=h})}),s(o);return}const r=n(this.type,t);r.then?e.push((async function(){s(await r)})()):s(r)}async walkAsync(e,t){const n=[],s=[e];return this.#e(n,e,t,r=>{s[0]=r}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(Dt.isParamType(e))return e;if(typeof e=="string")try{return Dt.from(Vs(e),t)}catch{V(!1,"invalid param type","obj",e)}else if(e instanceof ri){let o="",c="",l=null;ls(e,kn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(g=>Dt.from(g)),o=`tuple(${l.map(g=>g.format()).join(",")})`):(o=Ax(e.popType("TYPE")),c=o);let h=null,u=null;for(;e.length&&e.peekType("BRACKET");){const g=e.pop();h=new Dt(Ht,"",o,c,null,l,u,h),u=g.value,o+=g.text,c="array",l=null}let d=null;if(ls(e,nF).has("indexed")){if(!t)throw new Error("");d=!0}const m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Dt(Ht,m,o,c,d,l,u,h)}const n=e.name;V(!n||typeof n=="string"&&n.match(hx),"invalid name","obj.name",n);let s=e.indexed;s!=null&&(V(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let r=e.type,a=r.match(lF);if(a){const o=parseInt(a[2]||"-1"),c=Dt.from({type:a[1],components:e.components});return new Dt(Ht,n||"",r,"array",s,null,o,c)}if(r==="tuple"||r.startsWith("tuple(")||r.startsWith("(")){const o=e.components!=null?e.components.map(l=>Dt.from(l)):null;return new Dt(Ht,n||"",r,"tuple",s,o,null,null)}return r=Ax(e.type),new Dt(Ht,n||"",r,r,s,null,null,null)}static isParamType(e){return e&&e[Hn]===gx}}class yr{type;inputs;constructor(e,t,n){_l(e,Ht,"Fragment"),n=Object.freeze(n.slice()),Ye(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{yr.from(JSON.parse(e))}catch{}return yr.from(Vs(e))}if(e instanceof ri)switch(e.peekKeyword(cx)){case"constructor":return us.from(e);case"error":return zn.from(e);case"event":return ki.from(e);case"fallback":case"receive":return ds.from(e);case"function":return Ui.from(e);case"struct":return wr.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return us.from(e);case"error":return zn.from(e);case"event":return ki.from(e);case"fallback":case"receive":return ds.from(e);case"function":return Ui.from(e);case"struct":return wr.from(e)}pe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}V(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return us.isFragment(e)}static isError(e){return zn.isFragment(e)}static isEvent(e){return ki.isFragment(e)}static isFunction(e){return Ui.isFragment(e)}static isStruct(e){return wr.isFragment(e)}}class ql extends yr{name;constructor(e,t,n,s){super(e,t,s),V(typeof n=="string"&&n.match(hx),"invalid identifier","name",n),s=Object.freeze(s.slice()),Ye(this,{name:n})}}function Vo(i,e){return"("+e.map(t=>t.format(i)).join(i==="full"?", ":",")+")"}class zn extends ql{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,Hn,{value:mx})}get selector(){return br(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Vo(e,this.inputs)),t.join(" ")}static from(e){if(zn.isFragment(e))return e;if(typeof e=="string")return zn.from(Vs(e));if(e instanceof ri){const t=Wl("error",e),n=hs(e);return _r(e),new zn(Ht,t,n)}return new zn(Ht,e.name,e.inputs?e.inputs.map(Dt.from):[])}static isFragment(e){return e&&e[Hn]===mx}}class ki extends ql{anonymous;constructor(e,t,n,s){super(e,"event",t,n),Object.defineProperty(this,Hn,{value:bx}),Ye(this,{anonymous:s})}get topicHash(){return br(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Vo(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(s=>Dt.from(s)),new ki(Ht,e,t,!1).topicHash}static from(e){if(ki.isFragment(e))return e;if(typeof e=="string")try{return ki.from(Vs(e))}catch{V(!1,"invalid event fragment","obj",e)}else if(e instanceof ri){const t=Wl("event",e),n=hs(e,!0),s=!!ls(e,kn(["anonymous"])).has("anonymous");return _r(e),new ki(Ht,t,n,s)}return new ki(Ht,e.name,e.inputs?e.inputs.map(t=>Dt.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Hn]===bx}}class us extends yr{payable;gas;constructor(e,t,n,s,r){super(e,t,n),Object.defineProperty(this,Hn,{value:xx}),Ye(this,{payable:s,gas:r})}format(e){if(pe(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[`constructor${Vo(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(us.isFragment(e))return e;if(typeof e=="string")try{return us.from(Vs(e))}catch{V(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof ri){ls(e,kn(["constructor"]));const t=hs(e),n=!!ls(e,eF).has("payable"),s=px(e);return _r(e),new us(Ht,"constructor",t,n,s)}return new us(Ht,"constructor",e.inputs?e.inputs.map(Dt.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Hn]===xx}}class ds extends yr{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,Hn,{value:Ex}),Ye(this,{payable:n})}format(e){const t=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(ds.isFragment(e))return e;if(typeof e=="string")try{return ds.from(Vs(e))}catch{V(!1,"invalid fallback fragment","obj",e)}else if(e instanceof ri){const t=e.toString(),n=e.peekKeyword(kn(["fallback","receive"]));if(V(n,"type must be fallback or receive","obj",t),e.popKeyword(kn(["fallback","receive"]))==="receive"){const o=hs(e);return V(o.length===0,"receive cannot have arguments","obj.inputs",o),ls(e,kn(["payable"])),_r(e),new ds(Ht,[],!0)}let r=hs(e);r.length?V(r.length===1&&r[0].type==="bytes","invalid fallback inputs","obj.inputs",r.map(o=>o.format("minimal")).join(", ")):r=[Dt.from("bytes")];const a=fx(e);if(V(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),ls(e,kn(["returns"])).has("returns")){const o=hs(e);V(o.length===1&&o[0].type==="bytes","invalid fallback outputs","obj.outputs",o.map(c=>c.format("minimal")).join(", "))}return _r(e),new ds(Ht,r,a==="payable")}if(e.type==="receive")return new ds(Ht,[],!0);if(e.type==="fallback"){const t=[Dt.from("bytes")],n=e.stateMutability==="payable";return new ds(Ht,t,n)}V(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Hn]===Ex}}class Ui extends ql{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,s,r,a){super(e,"function",t,s),Object.defineProperty(this,Hn,{value:_x}),r=Object.freeze(r.slice()),Ye(this,{constant:n==="view"||n==="pure",gas:a,outputs:r,payable:n==="payable",stateMutability:n})}get selector(){return br(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Vo(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Vo(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(s=>Dt.from(s)),new Ui(Ht,e,"view",t,[],null).selector}static from(e){if(Ui.isFragment(e))return e;if(typeof e=="string")try{return Ui.from(Vs(e))}catch{V(!1,"invalid function fragment","obj",e)}else if(e instanceof ri){const n=Wl("function",e),s=hs(e),r=fx(e);let a=[];ls(e,kn(["returns"])).has("returns")&&(a=hs(e));const o=px(e);return _r(e),new Ui(Ht,n,r,s,a,o)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new Ui(Ht,e.name,t,e.inputs?e.inputs.map(Dt.from):[],e.outputs?e.outputs.map(Dt.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Hn]===_x}}class wr extends ql{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,Hn,{value:yx})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return wr.from(Vs(e))}catch{V(!1,"invalid struct fragment","obj",e)}else if(e instanceof ri){const t=Wl("struct",e),n=hs(e);return _r(e),new wr(Ht,t,n)}return new wr(Ht,e.name,e.inputs?e.inputs.map(Dt.from):[])}static isFragment(e){return e&&e[Hn]===yx}}const Ci=new Map;Ci.set(0,"GENERIC_PANIC"),Ci.set(1,"ASSERT_FALSE"),Ci.set(17,"OVERFLOW"),Ci.set(18,"DIVIDE_BY_ZERO"),Ci.set(33,"ENUM_RANGE_ERROR"),Ci.set(34,"BAD_STORAGE_DATA"),Ci.set(49,"STACK_UNDERFLOW"),Ci.set(50,"ARRAY_RANGE_ERROR"),Ci.set(65,"OUT_OF_MEMORY"),Ci.set(81,"UNINITIALIZED_FUNCTION_CALL");const hF=new RegExp(/^bytes([0-9]*)$/),uF=new RegExp(/^(u?int)([0-9]*)$/);let Ff=null,wx=1024;function dF(i,e,t,n){let s="missing revert data",r=null;const a=null;let o=null;if(t){s="execution reverted";const l=lt(t);if(t=ve(t),l.length===0)s+=" (no data present; likely require(false) occurred",r="require(false)";else if(l.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(ve(l.slice(0,4))==="0x08c379a0")try{r=n.decode(["string"],l.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[r]},s+=`: ${JSON.stringify(r)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(ve(l.slice(0,4))==="0x4e487b71")try{const h=Number(n.decode(["uint256"],l.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[h]},r=`Panic due to ${Ci.get(h)||"UNKNOWN"}(${h})`,s+=`: ${r}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const c={to:e.to?vt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=vt(e.from)),Qt(s,"CALL_EXCEPTION",{action:i,data:t,reason:r,transaction:c,invocation:a,revert:o})}class Na{#e(e){if(e.isArray())return new RR(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Nl(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new BR(e.name);case"bool":return new NR(e.name);case"string":return new GR(e.name);case"bytes":return new FR(e.name);case"":return new PR(e.name)}let t=e.type.match(uF);if(t){let n=parseInt(t[2]||"256");return V(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new QR(n/8,t[1]==="int",e.name)}if(t=e.type.match(hF),t){let n=parseInt(t[1]);return V(n!==0&&n<=32,"invalid bytes length","param",e),new DR(n,e.name)}V(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(s=>this.#e(Dt.from(s)));return new Nl(t,"_").defaultValue()}encode(e,t){r0(t.length,e.length,"types/values length mismatch");const n=e.map(a=>this.#e(Dt.from(a))),s=new Nl(n,"_"),r=new Yd;return s.encode(r,t),r.data}decode(e,t,n){const s=e.map(a=>this.#e(Dt.from(a)));return new Nl(s,"_").decode(new jd(t,n,wx))}static _setDefaultMaxInflation(e){V(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),wx=e}static defaultAbiCoder(){return Ff==null&&(Ff=new Na),Ff}static getBuiltinCallException(e,t,n){return dF(e,t,n,Na.defaultAbiCoder())}}class fF{fragment;name;signature;topic;args;constructor(e,t,n){const s=e.name,r=e.format();Ye(this,{fragment:e,name:s,signature:r,topic:t,args:n})}}class pF{fragment;name;args;signature;selector;value;constructor(e,t,n,s){const r=e.name,a=e.format();Ye(this,{fragment:e,name:r,args:n,signature:a,selector:t,value:s})}}class AF{fragment;name;args;signature;selector;constructor(e,t,n){const s=e.name,r=e.format();Ye(this,{fragment:e,name:s,args:n,signature:r,selector:t})}}class Cx{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){Ye(this,{hash:e,_isIndexed:!0})}}const vx={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Sx={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:i=>`reverted with reason string ${JSON.stringify(i)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:i=>{let e="unknown panic code";return i>=0&&i<=255&&vx[i.toString()]&&(e=vx[i.toString()]),`reverted with panic code 0x${i.toString(16)} (${e})`}}};class Cr{fragments;deploy;fallback;receive;#e;#t;#n;#i;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#n=new Map,this.#e=new Map,this.#t=new Map;const n=[];for(const a of t)try{n.push(yr.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}Ye(this,{fragments:Object.freeze(n)});let s=null,r=!1;this.#i=this.getAbiCoder(),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ye(this,{deploy:a});return;case"fallback":a.inputs.length===0?r=!0:(V(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${o}]`,a),s=a,r=s.payable);return;case"function":c=this.#n;break;case"event":c=this.#t;break;case"error":c=this.#e;break;default:return}const l=a.format();c.has(l)||c.set(l,a)}),this.deploy||Ye(this,{deploy:us.from("constructor()")}),Ye(this,{fallback:s,receive:r})}format(e){const t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Na.defaultAbiCoder()}#s(e,t,n){if(Ft(e)){const r=e.toLowerCase();for(const a of this.#n.values())if(r===a.selector)return a;return null}if(e.indexOf("(")===-1){const r=[];for(const[a,o]of this.#n)a.split("(")[0]===e&&r.push(o);if(t){const a=t.length>0?t[t.length-1]:null;let o=t.length,c=!0;Wt.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let l=r.length-1;l>=0;l--){const h=r[l].inputs.length;h!==o&&(!c||h!==o-1)&&r.splice(l,1)}for(let l=r.length-1;l>=0;l--){const h=r[l].inputs;for(let u=0;u<t.length;u++)if(Wt.isTyped(t[u])){if(u>=h.length){if(t[u].type==="overrides")continue;r.splice(l,1);break}if(t[u].type!==h[u].baseType){r.splice(l,1);break}}}}if(r.length===1&&t&&t.length!==r[0].inputs.length){const a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&r.splice(0,1)}if(r.length===0)return null;if(r.length>1&&n){const a=r.map(o=>JSON.stringify(o.format())).join(", ");V(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return r[0]}const s=this.#n.get(Ui.from(e).format());return s||null}getFunctionName(e){const t=this.#s(e,null,!1);return V(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#s(e,null,!1)}getFunction(e,t){return this.#s(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#n.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){const s=t[n];e(this.#n.get(s),n)}}#a(e,t,n){if(Ft(e)){const r=e.toLowerCase();for(const a of this.#t.values())if(r===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const r=[];for(const[a,o]of this.#t)a.split("(")[0]===e&&r.push(o);if(t){for(let a=r.length-1;a>=0;a--)r[a].inputs.length<t.length&&r.splice(a,1);for(let a=r.length-1;a>=0;a--){const o=r[a].inputs;for(let c=0;c<t.length;c++)if(Wt.isTyped(t[c])&&t[c].type!==o[c].baseType){r.splice(a,1);break}}}if(r.length===0)return null;if(r.length>1&&n){const a=r.map(o=>JSON.stringify(o.format())).join(", ");V(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return r[0]}const s=this.#t.get(ki.from(e).format());return s||null}getEventName(e){const t=this.#a(e,null,!1);return V(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#a(e,null,!1)}getEvent(e,t){return this.#a(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#t.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){const s=t[n];e(this.#t.get(s),n)}}getError(e,t){if(Ft(e)){const s=e.toLowerCase();if(Sx[s])return zn.from(Sx[s].signature);for(const r of this.#e.values())if(s===r.selector)return r;return null}if(e.indexOf("(")===-1){const s=[];for(const[r,a]of this.#e)r.split("(")[0]===e&&s.push(a);if(s.length===0)return e==="Error"?zn.from("error Error(string)"):e==="Panic"?zn.from("error Panic(uint256)"):null;if(s.length>1){const r=s.map(a=>JSON.stringify(a.format())).join(", ");V(!1,`ambiguous error description (i.e. ${r})`,"name",e)}return s[0]}if(e=zn.from(e).format(),e==="Error(string)")return zn.from("error Error(string)");if(e==="Panic(uint256)")return zn.from("error Panic(uint256)");const n=this.#e.get(e);return n||null}forEachError(e){const t=Array.from(this.#e.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){const s=t[n];e(this.#e.get(s),n)}}_decodeParams(e,t){return this.#i.decode(e,t)}_encodeParams(e,t){return this.#i.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);V(n,"unknown error","fragment",e),e=n}return V(Vt(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,Vt(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);V(n,"unknown error","fragment",e),e=n}return Ut([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);V(n,"unknown function","fragment",e),e=n}return V(Vt(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,Vt(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);V(n,"unknown function","fragment",e),e=n}return Ut([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){const r=this.getFunction(e);V(r,"unknown function","fragment",e),e=r}let n="invalid length for result data";const s=Dn(t);if(s.length%32===0)try{return this.#i.decode(e.outputs,s)}catch{n="could not decode result data"}pe(!1,n,"BAD_DATA",{value:ve(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){const n=lt(e,"data"),s=Na.getBuiltinCallException("call",t,n);if(s.message.startsWith("execution reverted (unknown custom error)")){const o=ve(n.slice(0,4)),c=this.getError(o);if(c)try{const l=this.#i.decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:l},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(t);return a&&(s.invocation={method:a.name,signature:a.signature,args:a.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){const n=this.getFunction(e);V(n,"unknown function","fragment",e),e=n}return ve(this.#i.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){const r=this.getEvent(e);V(r,"unknown event","eventFragment",e),e=r}pe(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const s=(r,a)=>r.type==="string"?br(a):r.type==="bytes"?$t(ve(a)):(r.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":r.type.match(/^u?int/)?a=ks(a):r.type.match(/^bytes/)?a=KB(a,32):r.type==="address"&&this.#i.encode(["address"],[a]),ts(ve(a),32));for(t.forEach((r,a)=>{const o=e.inputs[a];if(!o.indexed){V(r==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,r);return}r==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?V(!1,"filtering with tuples or arrays not supported","contract."+o.name,r):Array.isArray(r)?n.push(r.map(c=>s(o,c))):n.push(s(o,r))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){const a=this.getEvent(e);V(a,"unknown event","eventFragment",e),e=a}const n=[],s=[],r=[];return e.anonymous||n.push(e.topicHash),V(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{const c=t[o];if(a.indexed)if(a.type==="string")n.push(br(c));else if(a.type==="bytes")n.push($t(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(this.#i.encode([a.type],[c]))}else s.push(a),r.push(c)}),{data:this.#i.encode(s,r),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){const f=this.getEvent(e);V(f,"unknown event","eventFragment",e),e=f}if(n!=null&&!e.anonymous){const f=e.topicHash;V(Ft(n[0],32)&&n[0].toLowerCase()===f,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const s=[],r=[],a=[];e.inputs.forEach((f,m)=>{f.indexed?f.type==="string"||f.type==="bytes"||f.baseType==="tuple"||f.baseType==="array"?(s.push(Dt.from({type:"bytes32",name:f.name})),a.push(!0)):(s.push(f),a.push(!1)):(r.push(f),a.push(!1))});const o=n!=null?this.#i.decode(s,Ut(n)):null,c=this.#i.decode(r,t,!0),l=[],h=[];let u=0,d=0;return e.inputs.forEach((f,m)=>{let g=null;if(f.indexed)if(o==null)g=new Cx(null);else if(a[m])g=new Cx(o[d++]);else try{g=o[d++]}catch(A){g=A}else try{g=c[u++]}catch(A){g=A}l.push(g),h.push(f.name||null)}),ss.fromItems(l,h)}parseTransaction(e){const t=lt(e.data,"tx.data"),n=Re(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(ve(t.slice(0,4)));if(!s)return null;const r=this.#i.decode(s.inputs,t.slice(4));return new pF(s,s.selector,r,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new fF(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=ve(e),n=this.getError(Vt(t,0,4));if(!n)return null;const s=this.#i.decode(n.inputs,Vt(t,4));return new AF(n,n.selector,s)}static from(e){return e instanceof Cr?e:typeof e=="string"?new Cr(JSON.parse(e)):typeof e.formatJson=="function"?new Cr(e.formatJson()):typeof e.format=="function"?new Cr(e.format("json")):new Cr(e)}}const Ix=BigInt(0);function Fa(i){return i??null}function Yt(i){return i==null?null:i.toString()}class Mx{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){Ye(this,{gasPrice:Fa(e),maxFeePerGas:Fa(t),maxPriorityFeePerGas:Fa(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Yt(e),maxFeePerGas:Yt(t),maxPriorityFeePerGas:Yt(n)}}}function Kl(i){const e={};i.to&&(e.to=i.to),i.from&&(e.from=i.from),i.data&&(e.data=ve(i.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of t)!(s in i)||i[s]==null||(e[s]=Re(i[s],`request.${s}`));const n="type,nonce".split(/,/);for(const s of n)!(s in i)||i[s]==null||(e[s]=ht(i[s],`request.${s}`));return i.accessList&&(e.accessList=gr(i.accessList)),i.authorizationList&&(e.authorizationList=i.authorizationList.slice()),"blockTag"in i&&(e.blockTag=i.blockTag),"enableCcipRead"in i&&(e.enableCcipRead=!!i.enableCcipRead),"customData"in i&&(e.customData=i.customData),"blobVersionedHashes"in i&&i.blobVersionedHashes&&(e.blobVersionedHashes=i.blobVersionedHashes.slice()),"kzg"in i&&(e.kzg=i.kzg),"blobWrapperVersion"in i&&(e.blobWrapperVersion=i.blobWrapperVersion),"blobs"in i&&i.blobs&&(e.blobs=i.blobs.map(s=>Vd(s)?ve(s):Object.assign({},s))),e}class gF{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new qo(n,t):n),Ye(this,{provider:t,hash:Fa(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Fa(e.prevRandao),extraData:e.extraData,baseFeePerGas:Fa(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=this.#e.slice();return e.length===0?[]:(pe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:r,hash:a,miner:o,prevRandao:c,nonce:l,number:h,parentHash:u,parentBeaconBlockRoot:d,stateRoot:f,receiptsRoot:m,timestamp:g,transactions:A}=this;return{_type:"Block",baseFeePerGas:Yt(e),difficulty:Yt(t),extraData:n,gasLimit:Yt(s),gasUsed:Yt(r),blobGasUsed:Yt(this.blobGasUsed),excessBlobGas:Yt(this.excessBlobGas),hash:a,miner:o,prevRandao:c,nonce:l,number:h,parentHash:u,timestamp:g,parentBeaconBlockRoot:d,stateRoot:f,receiptsRoot:m,transactions:A}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{const n=e.toLowerCase();for(const s of this.#e)if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash!==n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(const n of t)if(n.hash===e)return n;V(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return mF(this)}}class Wo{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const n=Object.freeze(e.topics.slice());Ye(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:n,data:s,index:r,removed:a,topics:o,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:r,removed:a,topics:o,transactionHash:c,transactionIndex:l}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return pe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return pe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return pe(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return bF(this)}}class Bx{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(s=>new Wo(s,t)));let n=Ix;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Ye(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){const{to:e,from:t,contractAddress:n,hash:s,index:r,blockHash:a,blockNumber:o,logsBloom:c,logs:l,status:h,root:u}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:Yt(this.cumulativeGasUsed),from:t,gasPrice:Yt(this.gasPrice),blobGasUsed:Yt(this.blobGasUsed),blobGasPrice:Yt(this.blobGasPrice),gasUsed:Yt(this.gasUsed),hash:s,index:r,logs:l,logsBloom:c,root:u,status:h,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return Rx(this)}reorderedEvent(e){return pe(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),Tx(this,e)}}class qo{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.authorizationList=e.authorizationList!=null?e.authorizationList:null,this.#e=-1}toJSON(){const{blockNumber:e,blockHash:t,index:n,hash:s,type:r,to:a,from:o,nonce:c,data:l,signature:h,accessList:u,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:u,blockNumber:e,blockHash:t,blobVersionedHashes:d,chainId:Yt(this.chainId),data:l,from:o,gasLimit:Yt(this.gasLimit),gasPrice:Yt(this.gasPrice),hash:s,maxFeePerGas:Yt(this.maxFeePerGas),maxPriorityFeePerGas:Yt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Yt(this.maxFeePerBlobGas),nonce:c,signature:h,to:a,index:n,type:r,value:Yt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:t,blockNumber:n}=await Fn({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const n=e??1,s=t??0;let r=this.#e,a=-1,o=r===-1;const c=async()=>{if(o)return null;const{blockNumber:d,nonce:f}=await Fn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(f<this.nonce){r=d;return}if(o)return null;const m=await this.getTransaction();if(!(m&&m.blockNumber!=null))for(a===-1&&(a=r-3,a<this.#e&&(a=this.#e));a<=d;){if(o)return null;const g=await this.provider.getBlock(a,!0);if(g==null)return;for(const A of g)if(A===this.hash)return;for(let A=0;A<g.length;A++){const p=await g.getTransaction(A);if(p.from===this.from&&p.nonce===this.nonce){if(o)return null;const y=await this.provider.getTransactionReceipt(p.hash);if(y==null||d-y.blockNumber+1<n)return;let b="replaced";p.data===this.data&&p.to===this.to&&p.value===this.value?b="repriced":p.data==="0x"&&p.from===p.to&&p.value===Ix&&(b="cancelled"),pe(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:b==="replaced"||b==="cancelled",reason:b,replacement:p.replaceableTransaction(r),hash:p.hash,receipt:y})}}a++}},l=d=>{if(d==null||d.status!==0)return d;pe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},h=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(h);if(h){if(n===1||await h.confirmations()>=n)return l(h)}else if(await c(),n===0)return null;return await new Promise((d,f)=>{const m=[],g=()=>{m.forEach(p=>p())};if(m.push(()=>{o=!0}),s>0){const p=setTimeout(()=>{g(),f(Qt("wait for transaction timeout","TIMEOUT"))},s);m.push(()=>{clearTimeout(p)})}const A=async p=>{if(await p.confirmations()>=n){g();try{d(l(p))}catch(y){f(y)}}};if(m.push(()=>{this.provider.off(this.hash,A)}),this.provider.on(this.hash,A),r>=0){const p=async()=>{try{await c()}catch(y){if(_n(y,"TRANSACTION_REPLACED")){g(),f(y);return}}o||this.provider.once("block",p)};m.push(()=>{this.provider.off("block",p)}),this.provider.once("block",p)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return pe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Rx(this)}reorderedEvent(e){return pe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),pe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Tx(this,e)}replaceableTransaction(e){V(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new qo(this,this.provider);return t.#e=e,t}}function mF(i){return{orphan:"drop-block",hash:i.hash,number:i.number}}function Tx(i,e){return{orphan:"reorder-transaction",tx:i,other:e}}function Rx(i){return{orphan:"drop-transaction",tx:i}}function bF(i){return{orphan:"drop-log",log:{transactionHash:i.transactionHash,blockHash:i.blockHash,blockNumber:i.blockNumber,address:i.address,data:i.data,topics:Object.freeze(i.topics.slice()),index:i.index}}}class Df extends Wo{interface;fragment;args;constructor(e,t,n){super(e,e.provider);const s=t.decodeEventLog(n,e.data,e.topics);Ye(this,{args:s,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Nx extends Wo{error;constructor(e,t){super(e,e.provider),Ye(this,{error:t})}}class xF extends Bx{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new Df(e,this.#e,t)}catch(n){return new Nx(e,n)}return e})}}class Lf extends qo{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){const n=await super.wait(e,t);return n==null?null:new xF(this.#e,this.provider,n)}}class Fx extends f0{log;constructor(e,t,n,s){super(e,t,n),Ye(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class EF extends Fx{constructor(e,t,n,s,r){super(e,t,n,new Df(r,e.interface,s));const a=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Ye(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Dx=BigInt(0);function Lx(i){return i&&typeof i.call=="function"}function Px(i){return i&&typeof i.estimateGas=="function"}function Xl(i){return i&&typeof i.resolveName=="function"}function kx(i){return i&&typeof i.sendTransaction=="function"}function Ux(i){if(i!=null){if(Xl(i))return i;if(i.provider)return i.provider}}class _F{#e;fragment;constructor(e,t,n){if(Ye(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");const s=vr(e.runner,"resolveName"),r=Xl(s)?s:null;this.#e=(async function(){const a=await Promise.all(t.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(h,u)=>h==="address"?Array.isArray(u)?Promise.all(u.map(d=>Pn(d,r))):Pn(u,r):u)));return e.interface.encodeFilterTopics(t,a)})()}getTopicFilter(){return this.#e}}function vr(i,e){return i==null?null:typeof i[e]=="function"?i:i.provider&&typeof i.provider[e]=="function"?i.provider:null}function Sr(i){return i==null?null:i.provider||null}async function Ox(i,e){const t=Wt.dereference(i,"overrides");V(typeof t=="object","invalid overrides parameter","overrides",i);const n=Kl(t);return V(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),V(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function yF(i,e,t){const n=vr(i,"resolveName"),s=Xl(n)?n:null;return await Promise.all(e.map((r,a)=>r.walkAsync(t[a],(o,c)=>(c=Wt.dereference(c,o),o==="address"?Pn(c,s):c))))}function wF(i){const e=async function(a){const o=await Ox(a,["data"]);o.to=await i.getAddress(),o.from&&(o.from=await Pn(o.from,Ux(i.runner)));const c=i.interface,l=Re(o.value||Dx,"overrides.value")===Dx,h=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!h&&!l&&V(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),V(c.fallback||h,"cannot send data to receive-only contract","overrides.data",o.data);const u=c.receive||c.fallback&&c.fallback.payable;return V(u||l,"cannot send value to non-payable fallback","overrides.value",o.value),V(c.fallback||h,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){const o=vr(i.runner,"call");pe(Lx(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(a);try{return await o.call(c)}catch(l){throw zd(l)&&l.data?i.interface.makeError(l.data,c):l}},n=async function(a){const o=i.runner;pe(kx(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await e(a)),l=Sr(i.runner);return new Lf(i.interface,l,c)},s=async function(a){const o=vr(i.runner,"estimateGas");return pe(Px(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},r=async a=>await n(a);return Ye(r,{_contract:i,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),r}function CF(i,e){const t=function(...l){const h=i.interface.getFunction(e,l);return pe(h,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),h},n=async function(...l){const h=t(...l);let u={};if(h.inputs.length+1===l.length&&(u=await Ox(l.pop()),u.from&&(u.from=await Pn(u.from,Ux(i.runner)))),h.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await yF(i.runner,h.inputs,l);return Object.assign({},u,await Fn({to:i.getAddress(),data:i.interface.encodeFunctionData(h,d)}))},s=async function(...l){const h=await o(...l);return h.length===1?h[0]:h},r=async function(...l){const h=i.runner;pe(kx(h),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await h.sendTransaction(await n(...l)),d=Sr(i.runner);return new Lf(i.interface,d,u)},a=async function(...l){const h=vr(i.runner,"estimateGas");return pe(Px(h),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await h.estimateGas(await n(...l))},o=async function(...l){const h=vr(i.runner,"call");pe(Lx(h),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await n(...l);let d="0x";try{d=await h.call(u)}catch(m){throw zd(m)&&m.data?i.interface.makeError(m.data,u):m}const f=t(...l);return i.interface.decodeFunctionResult(f,d)},c=async(...l)=>t(...l).constant?await s(...l):await r(...l);return Ye(c,{name:i.interface.getFunctionName(e),_contract:i,_key:e,getFragment:t,estimateGas:a,populateTransaction:n,send:r,staticCall:s,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=i.interface.getFunction(e);return pe(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function vF(i,e){const t=function(...s){const r=i.interface.getEvent(e,s);return pe(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),r},n=function(...s){return new _F(i,t(...s),s)};return Ye(n,{name:i.interface.getEventName(e),_contract:i,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=i.interface.getEvent(e);return pe(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}const Yl=Symbol.for("_ethersInternal_contract"),Qx=new WeakMap;function SF(i,e){Qx.set(i[Yl],e)}function Xn(i){return Qx.get(i[Yl])}function IF(i){return i&&typeof i=="object"&&"getTopicFilter"in i&&typeof i.getTopicFilter=="function"&&i.fragment}async function Pf(i,e){let t,n=null;if(Array.isArray(e)){const r=function(a){if(Ft(a,32))return a;const o=i.interface.getEvent(a);return V(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(r):r(a))}else e==="*"?t=[null]:typeof e=="string"?Ft(e,32)?t=[e]:(n=i.interface.getEvent(e),V(n,"unknown fragment","event",e),t=[n.topicHash]):IF(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):V(!1,"unknown event name","event",e);t=t.map(r=>{if(r==null)return null;if(Array.isArray(r)){const a=Array.from(new Set(r.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return r.toLowerCase()});const s=t.map(r=>r==null?"null":Array.isArray(r)?r.join("|"):r).join("&");return{fragment:n,tag:s,topics:t}}async function Ko(i,e){const{subs:t}=Xn(i);return t.get((await Pf(i,e)).tag)||null}async function Gx(i,e,t){const n=Sr(i.runner);pe(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:r,topics:a}=await Pf(i,t),{addr:o,subs:c}=Xn(i);let l=c.get(r);if(!l){const u={address:o||i,topics:a},d=A=>{let p=s;if(p==null)try{p=i.interface.getEvent(A.topics[0])}catch{}if(p){const y=p,b=s?i.interface.decodeEventLog(s,A.data,A.topics):[];Uf(i,t,b,_=>new EF(i,_,t,y,A))}else Uf(i,t,[],y=>new Fx(i,y,t,A))};let f=[];l={tag:r,listeners:[],start:()=>{f.length||f.push(n.on(u,d))},stop:async()=>{if(f.length==0)return;let A=f;f=[],await Promise.all(A),n.off(u,d)}},c.set(r,l)}return l}let kf=Promise.resolve();async function MF(i,e,t,n){await kf;const s=await Ko(i,e);if(!s)return!1;const r=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:o})=>{const c=Array.from(t);n&&c.push(n(o?null:a));try{a.call(i,...c)}catch{}return!o}),s.listeners.length===0&&(s.stop(),Xn(i).subs.delete(s.tag)),r>0}async function Uf(i,e,t,n){try{await kf}catch{}const s=MF(i,e,t,n);return kf=s,await s}const jl=["then"];class Xo{target;interface;runner;filters;[Yl];fallback;constructor(e,t,n,s){V(typeof e=="string"||Eb(e),"invalid value for Contract target","target",e),n==null&&(n=null);const r=Cr.from(t);Ye(this,{target:e,runner:n,interface:r}),Object.defineProperty(this,Yl,{value:{}});let a,o=null,c=null;if(s){const u=Sr(n);c=new Lf(this.interface,u,s)}let l=new Map;if(typeof e=="string")if(Ft(e))o=e,a=Promise.resolve(e);else{const u=vr(n,"resolveName");if(!Xl(u))throw Qt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=u.resolveName(e).then(d=>{if(d==null)throw Qt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Xn(this).addr=d,d})}else a=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return Xn(this).addr=u,u});SF(this,{addrPromise:a,addr:o,deployTx:c,subs:l});const h=new Proxy({},{get:(u,d,f)=>{if(typeof d=="symbol"||jl.indexOf(d)>=0)return Reflect.get(u,d,f);try{return this.getEvent(d)}catch(m){if(!_n(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(u,d)=>jl.indexOf(d)>=0?Reflect.has(u,d):Reflect.has(u,d)||this.interface.hasEvent(String(d))});return Ye(this,{filters:h}),Ye(this,{fallback:r.receive||r.fallback?wF(this):null}),new Proxy(this,{get:(u,d,f)=>{if(typeof d=="symbol"||d in u||jl.indexOf(d)>=0)return Reflect.get(u,d,f);try{return u.getFunction(d)}catch(m){if(!_n(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(u,d)=>typeof d=="symbol"||d in u||jl.indexOf(d)>=0?Reflect.has(u,d):u.interface.hasFunction(d)})}connect(e){return new Xo(this.target,this.interface,e)}attach(e){return new Xo(e,this.interface,this.runner)}async getAddress(){return await Xn(this).addrPromise}async getDeployedCode(){const e=Sr(this.runner);pe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Sr(this.runner);return pe(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,r)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",a)}catch(o){r(o)}};a()})}deploymentTransaction(){return Xn(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),CF(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),vF(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");const{addr:s,addrPromise:r}=Xn(this),a=s||await r,{fragment:o,topics:c}=await Pf(this,e),l={address:a,topics:c,fromBlock:t,toBlock:n},h=Sr(this.runner);return pe(h,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await h.getLogs(l)).map(u=>{let d=o;if(d==null)try{d=this.interface.getEvent(u.topics[0])}catch{}if(d)try{return new Df(u,this.interface,d)}catch(f){return new Nx(u,f)}return new Wo(u,h)})}async on(e,t){const n=await Gx(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await Gx(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await Uf(this,e,t,null)}async listenerCount(e){if(e){const s=await Ko(this,e);return s?s.listeners.length:0}const{subs:t}=Xn(this);let n=0;for(const{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){const s=await Ko(this,e);return s?s.listeners.map(({listener:r})=>r):[]}const{subs:t}=Xn(this);let n=[];for(const{listeners:s}of t.values())n=n.concat(s.map(({listener:r})=>r));return n}async off(e,t){const n=await Ko(this,e);if(!n)return this;if(t){const s=n.listeners.map(({listener:r})=>r).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),Xn(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await Ko(this,e);if(!t)return this;t.stop(),Xn(this).subs.delete(t.tag)}else{const{subs:t}=Xn(this);for(const{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends Xo{constructor(s,r=null){super(s,e,r)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}}function BF(){return Xo}class Da extends BF(){}function Of(i){return i.match(/^ipfs:\/\/ipfs\//i)?i=i.substring(12):i.match(/^ipfs:\/\//i)?i=i.substring(7):V(!1,"unsupported IPFS format","link",i),`https://gateway.ipfs.io/ipfs/${i}`}class TF{name;constructor(e){Ye(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const Hx=new RegExp("^(ipfs)://(.*)$","i"),zx=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Hx,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class La{provider;address;name;#e;#t;constructor(e,t,n){Ye(this,{provider:e,address:t,name:n}),this.#e=null,this.#t=new Da(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(e){if(_n(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#n(e,t){t=(t||[]).slice();const n=this.#t.interface;t.unshift(Tf(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),pe(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[KN(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const r=await this.#t[e](...t);return s?n.decodeFunctionResult(s,r)[0]:r}catch(r){if(!_n(r,"CALL_EXCEPTION"))throw r}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{const r=await this.#n("addr(bytes32)");return r==null||r===ko?null:r}catch(r){if(_n(r,"CALL_EXCEPTION"))return null;throw r}if(e>=0&&e<2147483648){let r=e+2147483648;const a=await this.#n("addr(bytes32,uint)",[r]);if(Ft(a,20))return vt(a)}let t=null;for(const r of this.provider.plugins)if(r instanceof TF&&r.supportsCoinType(e)){t=r;break}if(t==null)return null;const n=await this.#n("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const s=await t.decodeAddress(e,n);if(s!=null)return s;pe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const t=await this.#n("text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await this.#n("contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const s=t[1]==="e3010170"?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===r*2)return`${s}://${jB("0x"+t[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;pe(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<zx.length;n++){const s=t.match(zx[n]);if(s==null)continue;const r=s[1].toLowerCase();switch(r){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const a=Of(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:a}),{linkage:e,url:a}}case"erc721":case"erc1155":{const a=r==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:r,value:t});const o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${r}caip`,value:s[2]||""}),{url:null,linkage:e};const l=c[1],h=new Da(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(r==="erc721"){const g=await h.ownerOf(l);if(o!==g)return e.push({type:"!owner",value:g}),{url:null,linkage:e};e.push({type:"owner",value:g})}else if(r==="erc1155"){const g=await h.balanceOf(o,l);if(!g)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:g.toString()})}let u=await h[a](l);if(u==null||u==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:u}),r==="erc1155"&&(u=u.replace("{id}",ks(l,32).substring(2)),e.push({type:"metadata-url-expanded",value:u})),u.match(/^ipfs:/i)&&(u=Of(u)),e.push({type:"metadata-url",value:u});let d={};const f=await new Li(u).send();f.assertOk();try{d=f.bodyJson}catch{try{e.push({type:"!metadata",value:f.bodyText})}catch{const p=f.body;return p&&e.push({type:"!metadata",value:ve(p)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let m=d.image;if(typeof m!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!m.match(/^(https:\/\/|data:)/i)){if(m.match(Hx)==null)return e.push({type:"!imageUrl-ipfs",value:m}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:m}),m=Of(m)}return e.push({type:"url",value:m}),{linkage:e,url:m}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return pe(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async#i(e,t){const n=await La.getEnsAddress(e);try{const r=await new Da(n,["function resolver(bytes32) view returns (address)"],e).resolver(Tf(t),{enableCcipRead:!0});return r===ko?null:r}catch(s){throw s}return null}static async fromName(e,t){let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;const s=await La.#i(e,n);if(s!=null){const r=new La(e,s,t);return n!==t&&!await r.supportsWildcard()?null:r}n=n.split(".").slice(1).join(".")}}}const Vx=BigInt(0);function mt(i,e){return(function(t){return t==null?e:i(t)})}function Yo(i,e){return(t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>i(n))})}function jo(i,e){return(t=>{const n={};for(const s in i){let r=s;if(e&&s in e&&!(r in t)){for(const a of e[s])if(a in t){r=a;break}}try{const a=i[s](t[r]);a!==void 0&&(n[s]=a)}catch(a){const o=a instanceof Error?a.message:"not-an-error";pe(!1,`invalid value for value.${s} (${o})`,"BAD_DATA",{value:t})}}return n})}function RF(i){switch(i){case!0:case"true":return!0;case!1:case"false":return!1}V(!1,`invalid boolean; ${JSON.stringify(i)}`,"value",i)}function Pa(i){return V(Ft(i,!0),"invalid data","value",i),i}function yn(i){return V(Ft(i,32),"invalid hash","value",i),i}const NF=jo({address:vt,blockHash:yn,blockNumber:ht,data:Pa,index:ht,removed:mt(RF,!1),topics:Yo(yn),transactionHash:yn,transactionIndex:ht},{index:["logIndex"]});function FF(i){return NF(i)}const DF=jo({hash:mt(yn),parentHash:yn,parentBeaconBlockRoot:mt(yn,null),number:ht,timestamp:ht,nonce:mt(Pa),difficulty:Re,gasLimit:Re,gasUsed:Re,stateRoot:mt(yn,null),receiptsRoot:mt(yn,null),blobGasUsed:mt(Re,null),excessBlobGas:mt(Re,null),miner:mt(vt),prevRandao:mt(yn,null),extraData:Pa,baseFeePerGas:mt(Re)},{prevRandao:["mixHash"]});function LF(i){const e=DF(i);return e.transactions=i.transactions.map(t=>typeof t=="string"?t:Wx(t)),e}const PF=jo({transactionIndex:ht,blockNumber:ht,transactionHash:yn,address:vt,topics:Yo(yn),data:Pa,index:ht,blockHash:yn},{index:["logIndex"]});function kF(i){return PF(i)}const UF=jo({to:mt(vt,null),from:mt(vt,null),contractAddress:mt(vt,null),index:ht,root:mt(ve),gasUsed:Re,blobGasUsed:mt(Re,null),logsBloom:mt(Pa),blockHash:yn,hash:yn,logs:Yo(kF),blockNumber:ht,cumulativeGasUsed:Re,effectiveGasPrice:mt(Re),blobGasPrice:mt(Re,null),status:mt(ht),type:mt(ht,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function OF(i){return UF(i)}function Wx(i){i.to&&Re(i.to)===Vx&&(i.to="0x0000000000000000000000000000000000000000");const e=jo({hash:yn,index:mt(ht,void 0),type:t=>t==="0x"||t==null?0:ht(t),accessList:mt(gr,null),blobVersionedHashes:mt(Yo(yn,!0),null),authorizationList:mt(Yo(t=>{let n;if(t.signature)n=t.signature;else{let s=t.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),n=Object.assign({},t,{yParity:s})}return{address:vt(t.address),chainId:Re(t.chainId),nonce:Re(t.nonce),signature:Gt.from(n)}},!1),null),blockHash:mt(yn,null),blockNumber:mt(ht,null),transactionIndex:mt(ht,null),from:vt,gasPrice:mt(Re),maxPriorityFeePerGas:mt(Re),maxFeePerGas:mt(Re),maxFeePerBlobGas:mt(Re,null),gasLimit:Re,to:mt(vt,null),value:Re,nonce:ht,data:Pa,creates:mt(vt,null),chainId:mt(Re,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(i);if(e.to==null&&e.creates==null&&(e.creates=MR(e)),(i.type===1||i.type===2)&&i.accessList==null&&(e.accessList=[]),i.signature?e.signature=Gt.from(i.signature):e.signature=Gt.from(i),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Re(e.blockHash)===Vx&&(e.blockHash=null),e}const QF="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Jo{name;constructor(e){Ye(this,{name:e})}clone(){return new Jo(this.name)}}class Jl extends Jo{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const n={effectiveBlock:e};function s(r,a){let o=(t||{})[r];o==null&&(o=a),V(typeof o=="number",`invalud value for ${r}`,"costs",t),n[r]=o}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Ye(this,n)}clone(){return new Jl(this.effectiveBlock,this)}}class Zl extends Jo{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),Ye(this,{address:e||QF,targetNetwork:t??1})}clone(){return new Zl(this.address,this.targetNetwork)}}class GF extends Jo{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}}const Qf=new Map;class Yn{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=Re(t),this.#n=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=Re(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Re(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Re(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Re(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#n.values())}attachPlugin(e){if(this.#n.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#n.set(e.name,e.clone()),this}getPlugin(e){return this.#n.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new Yn(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new Jl;let n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){const s=gr(e.accessList);for(const r in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[r].storageKeys.length}return n}static from(e){if(HF(),e==null)return Yn.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const t=Qf.get(e);if(t)return t();if(typeof e=="bigint")return new Yn("unknown",e);V(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){V(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const t=new Yn(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new Zl(e.ensAddress,e.ensNetwork)),t}V(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));const n=Qf.get(e);n&&V(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),Qf.set(e,t)}}function qx(i,e){const t=String(i);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${i}`);const n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${i}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function Kx(i){return new GF(i,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{const[r,a]=await Promise.all([n.send(),e()]);s=r;const o=s.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:qx(o.maxFee,9),maxPriorityFeePerGas:qx(o.maxPriorityFee,9)}}catch(r){pe(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:r})}})}let Xx=!1;function HF(){if(Xx)return;Xx=!0;function i(e,t,n){const s=function(){const r=new Yn(e,t);return n.ensNetwork!=null&&r.attachPlugin(new Zl(null,n.ensNetwork)),r.attachPlugin(new Jl),(n.plugins||[]).forEach(a=>{r.attachPlugin(a)}),r};Yn.register(e,s),Yn.register(t,s),n.altNames&&n.altNames.forEach(r=>{Yn.register(r,s)})}i("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),i("ropsten",3,{ensNetwork:3}),i("rinkeby",4,{ensNetwork:4}),i("goerli",5,{ensNetwork:5}),i("kovan",42,{ensNetwork:42}),i("sepolia",11155111,{ensNetwork:11155111}),i("holesky",17e3,{ensNetwork:17e3}),i("classic",61,{}),i("classicKotti",6,{}),i("arbitrum",42161,{ensNetwork:1}),i("arbitrum-goerli",421613,{}),i("arbitrum-sepolia",421614,{}),i("base",8453,{ensNetwork:1}),i("base-goerli",84531,{}),i("base-sepolia",84532,{}),i("bnb",56,{ensNetwork:1}),i("bnbt",97,{}),i("filecoin",314,{}),i("filecoin-calibration",314159,{}),i("linea",59144,{ensNetwork:1}),i("linea-goerli",59140,{}),i("linea-sepolia",59141,{}),i("matic",137,{ensNetwork:1,plugins:[Kx("https://gasstation.polygon.technology/v2")]}),i("matic-amoy",80002,{}),i("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Kx("https://gasstation-testnet.polygon.technology/v2")]}),i("optimism",10,{ensNetwork:1,plugins:[]}),i("optimism-goerli",420,{}),i("optimism-sepolia",11155420,{}),i("xdai",100,{ensNetwork:1})}function Gf(i){return JSON.parse(JSON.stringify(i))}class zF{#e;#t;#n;#i;constructor(e){this.#e=e,this.#t=null,this.#n=4e3,this.#i=-2}get pollingInterval(){return this.#n}set pollingInterval(e){this.#n=e}async#s(){try{const e=await this.#e.getBlockNumber();if(this.#i===-2){this.#i=e;return}if(e!==this.#i){for(let t=this.#i+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#i=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#n))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#n),this.#s())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}class Hf{#e;#t;#n;constructor(e){this.#e=e,this.#n=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#n||(this.#n=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}}class VF extends Hf{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){const n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}}class WF extends Hf{#e;constructor(e,t){super(e),this.#e=Gf(t)}async _poll(e,t){throw new Error("@TODO")}}class qF extends Hf{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){const n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}}class zf{#e;#t;#n;#i;#s;constructor(e,t){this.#e=e,this.#t=Gf(t),this.#n=this.#a.bind(this),this.#i=!1,this.#s=-2}async#a(e){if(this.#s===-2)return;const t=Gf(this.#t);t.fromBlock=this.#s+1,t.toBlock=e;const n=await this.#e.getLogs(t);if(n.length===0){this.#s<e-60&&(this.#s=e-60);return}for(const s of n)this.#e.emit(this.#t,s),this.#s=s.blockNumber}start(){this.#i||(this.#i=!0,this.#s===-2&&this.#e.getBlockNumber().then(e=>{this.#s=e}),this.#e.on("block",this.#n))}stop(){this.#i&&(this.#i=!1,this.#e.off("block",this.#n))}pause(e){this.stop(),e&&(this.#s=-2)}resume(){this.start()}}const KF=BigInt(2),XF=10;function $l(i){return i&&typeof i.then=="function"}function eh(i,e){return i+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const s=Object.keys(n);return s.sort(),s.reduce((r,a)=>(r[a]=n[a],r),{})}return n})}class Yx{name;constructor(e){Ye(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function YF(i){return JSON.parse(JSON.stringify(i))}function Vf(i){return i=Array.from(new Set(i).values()),i.sort(),i}async function Wf(i,e){if(i==null)throw new Error("invalid event");if(Array.isArray(i)&&(i={topics:i}),typeof i=="string")switch(i){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:i,tag:i}}if(Ft(i,32)){const t=i.toLowerCase();return{type:"transaction",tag:eh("tx",{hash:t}),hash:t}}if(i.orphan){const t=i;return{type:"orphan",tag:eh("orphan",t),filter:YF(t)}}if(i.address||i.topics){const t=i,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?Vf(s.map(r=>r.toLowerCase())):s.toLowerCase())};if(t.address){const s=[],r=[],a=o=>{Ft(o)?s.push(o):r.push((async()=>{s.push(await Pn(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),r.length&&await Promise.all(r),n.address=Vf(s.map(o=>o.toLowerCase()))}return{filter:n,tag:eh("event",n),type:"event"}}V(!1,"unknown ProviderEvent","event",i)}function qf(){return new Date().getTime()}const jF={cacheTimeout:250,pollingInterval:4e3};class JF{#e;#t;#n;#i;#s;#a;#r;#o;#f;#l;#p;#A;constructor(e,t){if(this.#A=Object.assign({},jF,t||{}),e==="any")this.#a=!0,this.#s=null;else if(e){const n=Yn.from(e);this.#a=!1,this.#s=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#a=!1,this.#s=null;this.#o=-1,this.#r=new Map,this.#e=new Map,this.#t=new Map,this.#n=null,this.#i=!1,this.#f=1,this.#l=new Map,this.#p=!1}get pollingInterval(){return this.#A.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#p}set disableCcipRead(e){this.#p=!!e}async#c(e){const t=this.#A.cacheTimeout;if(t<0)return await this._perform(e);const n=eh(e.method,e);let s=this.#r.get(n);return s||(s=this._perform(e),this.#r.set(n,s),setTimeout(()=>{this.#r.get(n)===s&&this.#r.delete(n)},t)),await s}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const s=e.to.toLowerCase(),r=t.toLowerCase(),a=[];for(let o=0;o<n.length;o++){const c=n[o],l=c.replace("{sender}",s).replace("{data}",r),h=new Li(l);c.indexOf("{data}")===-1&&(h.body={data:r,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:h,index:o,urls:n});let u="unknown error",d;try{d=await h.send()}catch(f){a.push(f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:{error:f}});continue}try{const f=d.bodyJson;if(f.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:h,result:f}),f.data;f.message&&(u=f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:f})}catch{}pe(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:u}}),a.push(u)}pe(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,t){return new gF(LF(e),this)}_wrapLog(e,t){return new Wo(FF(e),this)}_wrapTransactionReceipt(e,t){return new Bx(OF(e),this)}_wrapTransactionResponse(e,t){return new qo(Wx(e),this)}_detectNetwork(){pe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){pe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=ht(await this.#c({method:"getBlockNumber"}),"%response");return this.#o>=0&&(this.#o=e),e}_getAddress(e){return Pn(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Ft(e))return Ft(e,32)?e:_i(e);if(typeof e=="bigint"&&(e=ht(e,"blockTag")),typeof e=="number")return e>=0?_i(e):this.#o>=0?_i(this.#o+e):this.getBlockNumber().then(t=>_i(t+e));V(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?Vf(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,l,h)=>{let u;switch(c.length){case 0:break;case 1:u=c[0];break;default:c.sort(),u=c}if(n&&(l!=null||h!=null))throw new Error("invalid filter");const d={};return u&&(d.address=u),t.length&&(d.topics=t),l&&(d.fromBlock=l),h&&(d.toBlock=h),n&&(d.blockHash=n),d};let r=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)r.push(this._getAddress(c));else r.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),r.filter(c=>typeof c!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(r),a,o]).then(c=>s(c[0],c[1],c[2])):s(r,a,o)}_getTransactionRequest(e){const t=Kl(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;const r=Pn(t[s],this);$l(r)?n.push((async function(){t[s]=await r})()):t[s]=r}),t.blockTag!=null){const s=this._getBlockTag(t.blockTag);$l(s)?n.push((async function(){t.blockTag=await s})()):t.blockTag=s}return n.length?(async function(){return await Promise.all(n),t})():t}async getNetwork(){if(this.#s==null){const s=(async()=>{try{const r=await this._detectNetwork();return this.emit("network",r,null),r}catch(r){throw this.#s===s&&(this.#s=null),r}})();return this.#s=s,(await s).clone()}const e=this.#s,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#a?(this.emit("network",n,t),this.#s===e&&(this.#s=Promise.resolve(n))):pe(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:s,gasPrice:r,priorityFee:a}=await Fn({_block:this.#b("latest",!1),gasPrice:(async()=>{try{const h=await this.#c({method:"getGasPrice"});return Re(h,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const h=await this.#c({method:"getPriorityFee"});return Re(h,"%response")}catch{}return null})()});let o=null,c=null;const l=this._wrapBlock(s,e);return l&&l.baseFeePerGas&&(c=a??BigInt("1000000000"),o=l.baseFeePerGas*KF+c),new Mx(r,o,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const s=new Li(n.url),r=await n.processFunc(t,this,s);return new Mx(r.gasPrice,r.maxFeePerGas,r.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return $l(t)&&(t=await t),Re(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#h(e,t,n){pe(n<XF,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const s=Kl(e);try{return ve(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(r){if(!this.disableCcipRead&&zd(r)&&r.data&&n>=0&&t==="latest"&&s.to!=null&&Vt(r.data,0,4)==="0x556f1830"){const a=r.data,o=await Pn(s.to,this);let c;try{c=nD(Vt(r.data,4))}catch(u){pe(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:a}})}pe(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(s,c.calldata,c.urls);pe(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:r.data,errorArgs:c.errorArgs}});const h={to:o,data:Ut([c.selector,tD([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:h});try{const u=await this.#h(h,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},h),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},h),error:u}),u}}throw r}}async#u(e){const{value:t}=await Fn({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:n}=await Fn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#u(this.#h(t,n,e.enableCcipRead?0:-1))}async#d(e,t,n){let s=this._getAddress(t),r=this._getBlockTag(n);return(typeof s!="string"||typeof r!="string")&&([s,r]=await Promise.all([s,r])),await this.#u(this.#c(Object.assign(e,{address:s,blockTag:r})))}async getBalance(e,t){return Re(await this.#d({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return ht(await this.#d({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return ve(await this.#d({method:"getCode"},e,t))}async getStorage(e,t,n){const s=Re(t,"position");return ve(await this.#d({method:"getStorage",position:s},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:s}=await Fn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),r=wi.from(e);if(r.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(r,s).replaceableTransaction(t)}async#b(e,t){if(Ft(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){const{network:n,params:s}=await Fn({network:this.getNetwork(),params:this.#b(e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){const{network:t,params:n}=await Fn({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await Fn({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const s=await this.#c({method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await Fn({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:ve(t)}async getLogs(e){let t=this._getFilter(e);$l(t)&&(t=await t);const{network:n,params:s}=await Fn({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return s.map(r=>this._wrapLog(r,n))}_getProvider(e){pe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await La.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=vt(e);const t=Tf(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await La.getEnsAddress(this),r=await new Da(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(r==null||r===ko)return null;const o=await new Da(r,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(n){if(_n(n,"BAD_DATA")&&n.value==="0x"||_n(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){const s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(r,a)=>{let o=null;const c=(async l=>{try{const h=await this.getTransactionReceipt(e);if(h!=null&&l-h.blockNumber+1>=s){r(h),o&&(clearTimeout(o),o=null);return}}catch(h){console.log("EEE",h)}this.once("block",c)});n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",c),a(Qt("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){pe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#l.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#l.delete(e))}_setTimeout(e,t){t==null&&(t=0);const n=this.#f++,s=()=>{this.#l.delete(n),e()};if(this.paused)this.#l.set(n,{timer:null,func:s,time:t});else{const r=setTimeout(s,t);this.#l.set(n,{timer:r,func:s,time:qf()})}return n}_forEachSubscriber(e){for(const t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Yx(e.type);case"block":{const t=new zF(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new VF(this,e.type);case"event":return new zf(this,e.filter);case"transaction":return new qF(this,e.hash);case"orphan":return new WF(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#n!=null&&t.pause(this.#n);break}}async#g(e,t){let n=await Wf(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await Wf({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#m(e){const t=await Wf(e,this),n=t.tag;let s=this.#e.get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,s)),s}async on(e,t){const n=await this.#m(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#n!=null&&n.subscriber.pause(this.#n)),this}async once(e,t){const n=await this.#m(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#n!=null&&n.subscriber.pause(this.#n)),this}async emit(e,...t){const n=await this.#g(e,t);if(!n||n.listeners.length===0)return!1;const s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:r,once:a})=>{const o=new f0(this,a?null:r,e);try{r.call(this,...t,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),s>0}async listenerCount(e){if(e){const n=await this.#g(e);return n?n.listeners.length:0}let t=0;for(const{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){const n=await this.#g(e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(const{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){const n=await this.#g(e);if(!n)return this;if(t){const s=n.listeners.map(({listener:r})=>r).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:s}=await this.#m(e);n&&s.stop(),this.#e.delete(t)}else for(const[t,{started:n,subscriber:s}]of this.#e)n&&s.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#i}destroy(){this.removeAllListeners();for(const e of this.#l.keys())this._clearTimeout(e);this.#i=!0}get paused(){return this.#n!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#o=-1,this.#n!=null){if(this.#n==!!e)return;pe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#n=!!e;for(const t of this.#l.values())t.timer&&clearTimeout(t.timer),t.time=qf()-t.time}resume(){if(this.#n!=null){this._forEachSubscriber(e=>e.resume()),this.#n=null;for(const e of this.#l.values()){let t=e.time;t<0&&(t=0),e.time=qf(),setTimeout(e.func,t)}}}}function ZF(i,e){try{const t=Kf(i,e);if(t)return wl(t)}catch{}return null}function Kf(i,e){if(i==="0x")return null;try{const t=ht(Vt(i,e,e+32)),n=ht(Vt(i,t,t+32));return Vt(i,t+32,t+32+n)}catch{}return null}function jx(i){const e=Zt(i);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function $F(i){if(i.length%32===0)return i;const e=new Uint8Array(Math.ceil(i.length/32)*32);return e.set(i),e}const eD=new Uint8Array([]);function tD(i){const e=[];let t=0;for(let n=0;n<i.length;n++)e.push(eD),t+=32;for(let n=0;n<i.length;n++){const s=lt(i[n]);e[n]=jx(t),e.push(jx(s.length)),e.push($F(s)),t+=32+Math.ceil(s.length/32)*32}return Ut(e)}const Jx="0x0000000000000000000000000000000000000000000000000000000000000000";function nD(i){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};pe(_a(i)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=Vt(i,0,32);pe(Vt(t,0,12)===Vt(Jx,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Vt(t,12);try{const n=[],s=ht(Vt(i,32,64)),r=ht(Vt(i,s,s+32)),a=Vt(i,s+32);for(let o=0;o<r;o++){const c=ZF(a,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{pe(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=Kf(i,64);if(n==null)throw new Error("abort");e.calldata=n}catch{pe(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}pe(Vt(i,100,128)===Vt(Jx,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Vt(i,96,100);try{const n=Kf(i,128);if(n==null)throw new Error("abort");e.extraData=n}catch{pe(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function Ir(i,e){if(i.provider)return i.provider;pe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Zx(i,e){let t=Kl(e);if(t.to!=null&&(t.to=Pn(t.to,i)),t.from!=null){const n=t.from;t.from=Promise.all([i.getAddress(),Pn(n,i)]).then(([s,r])=>(V(s.toLowerCase()===r.toLowerCase(),"transaction from mismatch","tx.from",r),s))}else t.from=i.getAddress();return await Fn(t)}class iD{provider;constructor(e){Ye(this,{provider:e||null})}async getNonce(e){return Ir(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Zx(this,e)}async populateTransaction(e){const t=Ir(this,"populateTransaction"),n=await Zx(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const s=await this.provider.getNetwork();if(n.chainId!=null){const a=Re(n.chainId);V(a===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;const r=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||r)?V(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&r&&V(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const a=await t.getFeeData();pe(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{const a=await t.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(pe(!r,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):pe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await Fn(n)}async populateAuthorization(e){const t=Object.assign({},e);return t.chainId==null&&(t.chainId=(await Ir(this,"getNetwork").getNetwork()).chainId),t.nonce==null&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return Ir(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Ir(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Ir(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=Ir(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const s=wi.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}authorize(e){pe(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}function sD(i){return JSON.parse(JSON.stringify(i))}class $x{#e;#t;#n;#i;#s;#a;constructor(e){this.#e=e,this.#t=null,this.#n=this.#r.bind(this),this.#i=!1,this.#s=null,this.#a=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#r(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(r){if(!_n(r,"UNSUPPORTED_OPERATION")||r.operation!=="eth_newFilter")throw r}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}const n=await this.#e.getNetwork();if(this.#s||(this.#s=n),this.#s.chainId!==n.chainId)throw new Error("chaid changed");if(this.#a)return;const s=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,s)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#n)}#o(){const e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#i||(this.#i=!0,this.#r(-2))}stop(){this.#i&&(this.#i=!1,this.#a=!0,this.#o(),this.#e.off("block",this.#n))}pause(e){e&&this.#o(),this.#e.off("block",this.#n)}resume(){this.start()}}class rD extends $x{#e;constructor(e,t){super(e),this.#e=sD(t)}_recover(e){return new zf(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(const n of t)e.emit(this.#e,e._wrapLog(n,e._network))}}class aD extends $x{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const oD="bigint,boolean,function,number,string,symbol".split(/,/g);function th(i){if(i==null||oD.indexOf(typeof i)>=0||typeof i.getAddress=="function")return i;if(Array.isArray(i))return i.map(th);if(typeof i=="object")return Object.keys(i).reduce((e,t)=>(e[t]=i[t],e),{});throw new Error(`should not happen: ${i} (${typeof i})`)}function cD(i){return new Promise(e=>{setTimeout(e,i)})}function ka(i){return i&&i.toLowerCase()}function eE(i){return i&&typeof i.pollingInterval=="number"}const tE={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Xf extends iD{address;constructor(e,t){super(e),t=vt(t),Ye(this,{address:t})}connect(e){pe(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=th(e),n=[];if(t.from){const r=t.from;n.push((async()=>{const a=await Pn(r,this.provider);V(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=a})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){const r=t.to;n.push((async()=>{t.to=await Pn(r,this.provider)})())}n.length&&await Promise.all(n);const s=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((s,r)=>{const a=[1e3,100];let o=0;const c=async()=>{try{const l=await this.provider.getTransaction(n);if(l!=null){s(l.replaceableTransaction(t));return}}catch(l){if(_n(l,"CANCELLED")||_n(l,"BAD_DATA")||_n(l,"NETWORK_ERROR")||_n(l,"UNSUPPORTED_OPERATION")){l.info==null&&(l.info={}),l.info.sendTransactionHash=n,r(l);return}if(_n(l,"INVALID_ARGUMENT")&&(o++,l.info==null&&(l.info={}),l.info.sendTransactionHash=n,o>10)){r(l);return}this.provider.emit("error",Qt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:l}))}this.provider._setTimeout(()=>{c()},a.pop()||4e3)};c()})}async signTransaction(e){const t=th(e);if(t.from){const s=await Pn(t.from,this.provider);V(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=s}else t.from=this.address;const n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const t=typeof e=="string"?ns(e):e;return await this.provider.send("personal_sign",[ve(t),this.address.toLowerCase()])}async signTypedData(e,t,n){const s=th(n),r=await Kn.resolveNames(e,t,s,async a=>{const o=await Pn(a);return V(o!=null,"TypedData does not support null address","value",a),o});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Kn.getPayload(r.domain,t,r.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t=typeof e=="string"?ns(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),ve(t)])}}class lD extends JF{#e;#t;#n;#i;#s;#a;#r;#o(){if(this.#i)return;const e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#i=setTimeout(()=>{this.#i=null;const t=this.#n;for(this.#n=[];t.length;){const n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(r=>r.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{const s=n.length===1?n[0].payload:n.map(r=>r.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const r=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:a,reject:o,payload:c}of n){if(this.destroyed){o(Qt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const l=r.filter(h=>h.id===c.id)[0];if(l==null){const h=Qt("missing response for request","BAD_DATA",{value:r,info:{payload:c}});this.emit("error",h),o(h);continue}if("error"in l){o(this.getRpcError(c,l));continue}a(l.result)}}catch(r){this.emit("debug",{action:"receiveRpcError",error:r});for(const{reject:a}of n)a(r)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},tE,t||{}),this.#n=[],this.#i=null,this.#a=null,this.#r=null;{let s=null;const r=new Promise(a=>{s=a});this.#s={promise:r,resolve:s}}const n=this._getOption("staticNetwork");typeof n=="boolean"?(V(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#a=Yn.from(e))):n&&(V(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#a=n)}_getOption(e){return this.#e[e]}get _network(){return pe(this.#a,"network is not available yet","NETWORK_ERROR"),this.#a}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&Re(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}const t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#a)return this.#a}else return e;return this.#r?await this.#r:this.ready?(this.#r=(async()=>{try{const t=Yn.from(Re(await this.send("eth_chainId",[])));return this.#r=null,t}catch(t){throw this.#r=null,t}})(),await this.#r):(this.#r=(async()=>{const t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#r=null}catch(s){throw this.#r=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Yn.from(Re(n.result));throw this.getRpcError(t,n)})(),await this.#r)}_start(){this.#s==null||this.#s.resolve==null||(this.#s.resolve(),this.#s=null,(async()=>{for(;this.#a==null&&!this.destroyed;)try{this.#a=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Qt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await cD(1e3)}this.#o()})())}async _waitUntilReady(){if(this.#s!=null)return await this.#s.promise}_getSubscriber(e){return e.type==="pending"?new aD(this):e.type==="event"?this._getOption("polling")?new zf(this,e.filter):new rD(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new Yx("orphan"):super._getSubscriber(e)}get ready(){return this.#s==null}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let s=n;n==="gasLimit"&&(s="gas"),t[s]=_i(Re(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=ve(e[n]))}),e.accessList&&(t.accessList=gr(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(n=>{const s=vb(n);return{address:s.address,nonce:_i(s.nonce),chainId:_i(s.chainId),yParity:_i(s.signature.yParity),r:_i(s.signature.r),s:_i(s.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[ka(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[ka(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[ka(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[ka(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(ka):e.filter.address=ka(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:n}=e,{error:s}=t;if(n==="eth_estimateGas"&&s.message){const o=s.message;if(!o.match(/revert/i)&&o.match(/insufficient funds/i))return Qt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return Qt("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:s}})}if(n==="eth_call"||n==="eth_estimateGas"){const o=Yf(s),c=Na.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],o?o.data:null);return c.info={error:s,payload:e},c}const r=JSON.stringify(dD(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return Qt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:s}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){const o=e.params[0];if(r.match(/insufficient funds|base fee exceeds gas limit/i))return Qt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:o,info:{error:s}});if(r.match(/nonce/i)&&r.match(/too low/i))return Qt("nonce has already been used","NONCE_EXPIRED",{transaction:o,info:{error:s}});if(r.match(/replacement transaction/i)&&r.match(/underpriced/i))return Qt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:o,info:{error:s}});if(r.match(/only replay-protected/i))return Qt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:o,info:{error:s}}})}let a=!!r.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?Qt("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:s,payload:e}}):Qt("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(Qt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=this.#t++,s=new Promise((r,a)=>{this.#n.push({resolve:r,reject:a,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#o(),s}async getSigner(e){e==null&&(e=0);const t=this.send("eth_accounts",[]);if(typeof e=="number"){const s=await t;if(e>=s.length)throw new Error("no such account");return new Xf(this,s[e])}const{accounts:n}=await Fn({network:this.getNetwork(),accounts:t});e=vt(e);for(const s of n)if(vt(s)===e)return new Xf(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new Xf(this,t))}destroy(){this.#i&&(clearTimeout(this.#i),this.#i=null);for(const{payload:e,reject:t}of this.#n)t(Qt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#n=[],super.destroy()}}class hD extends lD{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=tE.pollingInterval),this.#e=n}_getSubscriber(e){const t=super._getSubscriber(e);return eE(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{eE(t)&&(t.pollingInterval=this.#e)})}}class uD extends hD{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new Li(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const n=await t.send();n.assertOk();let s=n.bodyJson;return Array.isArray(s)||(s=[s]),s}}function Yf(i){if(i==null)return null;if(typeof i.message=="string"&&i.message.match(/revert/i)&&Ft(i.data))return{message:i.message,data:i.data};if(typeof i=="object"){for(const e in i){const t=Yf(i[e]);if(t)return t}return null}if(typeof i=="string")try{return Yf(JSON.parse(i))}catch{}return null}function jf(i,e){if(i!=null){if(typeof i.message=="string"&&e.push(i.message),typeof i=="object")for(const t in i)jf(i[t],e);if(typeof i=="string")try{return jf(JSON.parse(i),e)}catch{}}}function dD(i){const e=[];return jf(i,e),e}const fD=["function register() external returns (uint256 agentId)","function register(string agentURI) external returns (uint256 agentId)","function register(string agentURI, tuple(string metadataKey, bytes metadataValue)[] metadata) external returns (uint256 agentId)","function setAgentURI(uint256 agentId, string newURI) external","function tokenURI(uint256 tokenId) external view returns (string)","function setMetadata(uint256 agentId, string metadataKey, bytes metadataValue) external","function getMetadata(uint256 agentId, string metadataKey) external view returns (bytes)","function getAgentWallet(uint256 agentId) external view returns (address)","function ownerOf(uint256 tokenId) external view returns (address)","function balanceOf(address owner) external view returns (uint256)","function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)","function totalSupply() external view returns (uint256)","function name() external view returns (string)","function symbol() external view returns (string)","function getVersion() external pure returns (string)","event Registered(uint256 indexed agentId, string agentURI, address indexed owner)","event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"],Mr={identityRegistry:"0x8004A818BFB912233c491871b3d84c89A494BD9e",reputationRegistry:"0x8004B663056A597Dffe9eCcC1965A193B7388713",validationRegistry:"0x8004Cb1BF31DAf7788923b405b754f57acEB4272"},Un={identityRegistry:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",reputationRegistry:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",validationRegistry:""},pD={1:Un,10:Un,56:Un,100:Un,137:Un,250:Un,324:Un,1284:Un,5e3:Un,8453:Un,42161:Un,42220:Un,43114:Un,59144:Un,534352:Un,97:Mr,11155111:Mr,84532:Mr,421614:Mr,11155420:Mr,80002:Mr,43113:Mr},AD={base:8453,"base-mainnet":8453,"base-sepolia":84532,ethereum:1,mainnet:1},gD={8453:"https://mainnet.base.org",84532:"https://sepolia.base.org",1:"https://eth.llamarpc.com"};async function Jf(i,{rpcURL:e,registry:t}={}){if(!i)throw new Error("loadManifest: source required");if(i.startsWith("agent://"))return mD(i,{rpcURL:e,registryOverride:t});if(i.startsWith("ipfs://")||i.startsWith("ar://")){const n=Ps(i),s=await Zf(n);return nh(s,{baseURI:$f(n)})}if(i.startsWith("http")){const n=await Zf(i);return nh(n,{baseURI:$f(i)})}throw new Error(`Unsupported manifest source: ${i}`)}async function mD(i,{rpcURL:e,registryOverride:t}){const n=i.match(/^agent:\/\/([^/]+)\/(\d+)$/);if(!n)throw new Error(`Malformed agent URI: ${i}`);const[,s,r]=n,a=AD[s.toLowerCase()]||Number(s);if(!a)throw new Error(`Unknown chain: ${s}`);const o=pD[a],c=t||o?.identityRegistry;if(!c)throw new Error(`No registry deployed on chain ${a}. Pass registry= override.`);const l=new uD(e||gD[a]),h=new Da(c,fD,l),u=BigInt(r),d=await h.tokenURI(u);if(!d)throw new Error(`Agent ${r} on chain ${a} has no URI`);const f=Ps(d),m=await Zf(f),g=nh(m,{baseURI:$f(f)});return g.id={...g.id,chain:s,chainId:a,registry:c,agentId:r},g}async function Zf(i){let e;try{e=await fetch(i)}catch{e=await e0(i)}if(!e.ok)throw new Error(`Manifest fetch failed: ${i} (${e.status})`);return e.json()}function nh(i,{baseURI:e=""}={}){if(i.spec&&i.spec.startsWith("agent-manifest/")){const t={...i,_baseURI:e};return t.body=t.body||{},!t.body.uri&&t.image&&(t.body.uri=t.image),t}if(i.type&&i.type.includes("eip-8004")){const t=i.registrations?.[0]||{};return{spec:"agent-manifest/0.1",_baseURI:e,_source:"erc8004-registration",id:{agentId:t.agentId?.toString()},name:i.name,description:i.description,image:i.image,body:{uri:i.image,format:"gltf-binary"},brain:{provider:"none"},voice:{tts:{provider:"browser"},stt:{provider:"browser"}},skills:[],memory:{mode:"local"},tools:["wave","lookAt","play_clip","setExpression"],version:"0.1.0"}}return{spec:"agent-manifest/0.1",_baseURI:e,name:i.name||"Unnamed agent",description:i.description||"",body:{uri:i.body?.uri||i.image||i.model||"",format:i.body?.format||"gltf-binary"},brain:i.brain||{provider:"none"},voice:i.voice||{tts:{provider:"browser"},stt:{provider:"browser"}},skills:i.skills||[],memory:i.memory||{mode:"local"},tools:i.tools||["wave","lookAt","play_clip","setExpression"],version:i.version||"0.1.0"}}function $f(i){const e=i.lastIndexOf("/");return e>=0?i.slice(0,e+1):i}async function nE(i,e){if(!i._baseURI)return null;try{const t=new URL(e,i._baseURI).href,n=await fetch(t);return n.ok?n.text():null}catch{return null}}class fs extends Error{constructor(e,t,{status:n}={}){super(t),this.name="AgentResolveError",this.code=e,n!==void 0&&(this.status=n)}}async function iE(i,{fetchFn:e}){let t;try{t=await e(i,{credentials:"include"})}catch(n){throw new fs("network",`network error fetching ${i}: ${n.message||n}`)}if(t.status===401||t.status===403)throw new fs("unauthorized",`unauthorized fetching ${i} (${t.status})`,{status:t.status});if(t.status===404)throw new fs("not_found",`resource not found: ${i}`,{status:404});if(!t.ok)throw new fs("network",`request failed: ${i} (${t.status})`,{status:t.status});try{return await t.json()}catch(n){throw new fs("network",`invalid JSON from ${i}: ${n.message||n}`)}}async function bD(i,{origin:e=typeof location<"u"?location.origin:"",fetchFn:t=fetch}={}){if(!i)throw new fs("not_found","agentId required");const n=t.bind(typeof globalThis<"u"?globalThis:void 0),r=(await iE(`${e}/api/agents/${encodeURIComponent(i)}`,{fetchFn:n}))?.agent;if(!r)throw new fs("not_found",`agent ${i} not found`);if(!r.avatar_id)throw new fs("no_avatar",`agent ${i} has no avatar bound`);const o=(await iE(`${e}/api/avatars/${encodeURIComponent(r.avatar_id)}`,{fetchFn:n}))?.avatar;if(!o||!o.url)throw new fs("no_avatar",`avatar ${r.avatar_id} has no url`);const c=Array.isArray(r.skills)?r.skills.map(l=>typeof l=="string"?{name:l}:l).filter(Boolean):[];return{spec:"agent-manifest/0.1",name:r.name||"Agent",description:r.description||"",id:{agentId:r.id,owner:r.wallet_address,chainId:r.chain_id,walletAddress:r.wallet_address},body:{uri:o.url,format:"gltf-binary"},brain:{},voice:{tts:{provider:"browser"},stt:{provider:"browser"}},skills:c,memory:{mode:"remote",namespace:r.id},tools:["wave","lookAt","play_clip","setExpression","speak","remember"],version:"0.1.0",_baseURI:`${e}/agent/${r.id}/`,_source:"agent-id"}}const xD=["inline","floating","section","fullscreen"],ED=`+`)}async export(){return{version:"memory/0.1",index:this.indexText,files:Object.fromEntries(this.files),timeline:this.timeline}}async import(e,{strategy:t="merge"}={}){if(t==="replace")this.files=new Map(Object.entries(e.files||{})),this.timeline=e.timeline||[];else{for(const[n,s]of Object.entries(e.files||{}))this.files.has(n)||this.files.set(n,s);this.timeline=[...this.timeline,...e.timeline||[]].slice(-1e3)}this._rebuildIndex(),this._persist()}}const fT="6.16.0";function pT(i,e,t){const n=e.split("|").map(r=>r.trim());for(let r=0;r<n.length;r++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof i===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=i,s}async function Fn(i){const e=Object.keys(i);return(await Promise.all(e.map(n=>Promise.resolve(i[n])))).reduce((n,s,r)=>(n[e[r]]=s,n),{})}function Xe(i,e,t){for(let n in e){let s=e[n];const r=t?t[n]:null;r&&pT(s,r,n),Object.defineProperty(i,n,{enumerable:!0,value:s,writable:!1})}}function va(i,e){if(i==null)return"null";if(e==null&&(e=new Set),typeof i=="object"){if(e.has(i))return"[Circular]";e.add(i)}if(Array.isArray(i))return"[ "+i.map(t=>va(t,e)).join(", ")+" ]";if(i instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let s=0;s<i.length;s++)n+=t[i[s]>>4],n+=t[i[s]&15];return n}if(typeof i=="object"&&typeof i.toJSON=="function")return va(i.toJSON(),e);switch(typeof i){case"boolean":case"number":case"symbol":return i.toString();case"bigint":return BigInt(i).toString();case"string":return JSON.stringify(i);case"object":{const t=Object.keys(i);return t.sort(),"{ "+t.map(n=>`${va(n,e)}: ${va(i[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function _n(i,e){return i&&i.code===e}function Xd(i){return _n(i,"CALL_EXCEPTION")}function Qt(i,e,t){let n=i;{const r=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${va(t)}`);for(const a in t){if(a==="shortMessage")continue;const o=t[a];r.push(a+"="+va(o))}}r.push(`code=${e}`),r.push(`version=${fT}`),r.length&&(i+=" ("+r.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(i);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(i);break;default:s=new Error(i)}return Xe(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&Xe(s,{shortMessage:n}),s}function pe(i,e,t,n){if(!i)throw Qt(e,t,n)}function V(i,e,t,n){pe(i,e,"INVALID_ARGUMENT",{argument:t,value:n})}function f0(i,e,t){t==null&&(t=""),t&&(t=": "+t),pe(i>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:i,expectedCount:e}),pe(i<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:i,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((i,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");i.push(e)}catch{}return i},[]);function Il(i,e,t){if(t==null&&(t=""),i!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),pe(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function p0(i,e,t){if(i instanceof Uint8Array)return t?new Uint8Array(i):i;if(typeof i=="string"&&i.length%2===0&&i.match(/^0x[0-9a-f]*$/i)){const n=new Uint8Array((i.length-2)/2);let s=2;for(let r=0;r<n.length;r++)n[r]=parseInt(i.substring(s,s+2),16),s+=2;return n}V(!1,"invalid BytesLike value",e||"value",i)}function lt(i,e){return p0(i,e,!1)}function Dn(i,e){return p0(i,e,!0)}function Ft(i,e){return!(typeof i!="string"||!i.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&i.length!==2+2*e||e===!0&&i.length%2!==0)}function Yd(i){return Ft(i,!0)||i instanceof Uint8Array}const A0="0123456789abcdef";function Ce(i){const e=lt(i);let t="0x";for(let n=0;n<e.length;n++){const s=e[n];t+=A0[(s&240)>>4]+A0[s&15]}return t}function Ut(i){return"0x"+i.map(e=>Ce(e).substring(2)).join("")}function Ca(i){return Ft(i,!0)?(i.length-2)/2:lt(i).length}function Vt(i,e,t){const n=lt(i);return t!=null&&t>n.length&&pe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),Ce(n.slice(e??0,t??n.length))}function g0(i,e,t){const n=lt(i);pe(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),Ce(s)}function ns(i,e){return g0(i,e,!0)}function AT(i,e){return g0(i,e,!1)}const Do=BigInt(0),_i=BigInt(1),Sa=9007199254740991;function gT(i,e){const t=Ml(i,"value"),n=BigInt(ht(e,"width"));if(pe(t>>n===Do,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:i}),t>>n-_i){const s=(_i<<n)-_i;return-((~t&s)+_i)}return t}function m0(i,e){let t=Re(i,"value");const n=BigInt(ht(e,"width")),s=_i<<n-_i;if(t<Do){t=-t,pe(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:i});const r=(_i<<n)-_i;return(~t&r)+_i}else pe(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:i});return t}function Lo(i,e){const t=Ml(i,"value"),n=BigInt(ht(e,"bits"));return t&(_i<<n)-_i}function Re(i,e){switch(typeof i){case"bigint":return i;case"number":return V(Number.isInteger(i),"underflow",e||"value",i),V(i>=-Sa&&i<=Sa,"overflow",e||"value",i),BigInt(i);case"string":try{if(i==="")throw new Error("empty string");return i[0]==="-"&&i[1]!=="-"?-BigInt(i.substring(1)):BigInt(i)}catch(t){V(!1,`invalid BigNumberish string: ${t.message}`,e||"value",i)}}V(!1,"invalid BigNumberish value",e||"value",i)}function Ml(i,e){const t=Re(i,e);return pe(t>=Do,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:i}),t}const b0="0123456789abcdef";function Jd(i){if(i instanceof Uint8Array){let e="0x0";for(const t of i)e+=b0[t>>4],e+=b0[t&15];return BigInt(e)}return Re(i)}function ht(i,e){switch(typeof i){case"bigint":return V(i>=-Sa&&i<=Sa,"overflow",e||"value",i),Number(i);case"number":return V(Number.isInteger(i),"underflow",e||"value",i),V(i>=-Sa&&i<=Sa,"overflow",e||"value",i),i;case"string":try{if(i==="")throw new Error("empty string");return ht(BigInt(i),e)}catch(t){V(!1,`invalid numeric string: ${t.message}`,e||"value",i)}}V(!1,"invalid numeric value",e||"value",i)}function mT(i){return ht(Jd(i))}function Os(i,e){const t=Ml(i,"value");let n=t.toString(16);if(e==null)n.length%2&&(n="0"+n);else{const s=ht(e,"width");if(s===0&&t===Do)return"0x";for(pe(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:i});n.length<s*2;)n="0"+n}return"0x"+n}function Zt(i,e){const t=Ml(i,"value");if(t===Do)return new Uint8Array(0);let n=t.toString(16);n.length%2&&(n="0"+n);const s=new Uint8Array(n.length/2);for(let r=0;r<s.length;r++){const a=r*2;s[r]=parseInt(n.substring(a,a+2),16)}return s}function yi(i){let e=Ce(Yd(i)?i:Zt(i)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const x0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const E0=BigInt(58);function bT(i){const e=lt(i);let t=Jd(e),n="";for(;t;)n=x0[Number(t%E0)]+n,t/=E0;for(let s=0;s<e.length&&!e[s];s++)n=x0[0]+n;return n}function xT(i){i=atob(i);const e=new Uint8Array(i.length);for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return lt(e)}function ET(i){const e=lt(i);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}class _0{filter;emitter;#e;constructor(e,t,n){this.#e=t,Xe(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}}function _T(i,e,t,n,s){V(!1,`invalid codepoint at offset ${e}; ${i}`,"bytes",t)}function y0(i,e,t,n,s){if(i==="BAD_PREFIX"||i==="UNEXPECTED_CONTINUE"){let r=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)r++;return r}return i==="OVERRUN"?t.length-e-1:0}function yT(i,e,t,n,s){return i==="OVERLONG"?(V(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),y0(i,e,t))}const wT=Object.freeze({error:_T,ignore:y0,replace:yT});function vT(i,e){e==null&&(e=wT.error);const t=lt(i,"bytes"),n=[];let s=0;for(;s<t.length;){const r=t[s++];if(r>>7===0){n.push(r);continue}let a=null,o=null;if((r&224)===192)a=1,o=127;else if((r&240)===224)a=2,o=2047;else if((r&248)===240)a=3,o=65535;else{(r&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+a>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=r&(1<<8-a-1)-1;for(let l=0;l<a;l++){let h=t[s];if((h&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|h&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-a,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-a,t,n,c);continue}if(c<=o){s+=e("OVERLONG",s-1-a,t,n,c);continue}n.push(c)}}return n}function is(i,e){V(typeof i=="string","invalid string value","str",i);let t=[];for(let n=0;n<i.length;n++){const s=i.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;const r=i.charCodeAt(n);V(n<i.length&&(r&64512)===56320,"invalid surrogate pair","str",i);const a=65536+((s&1023)<<10)+(r&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}function CT(i){return i.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Bl(i,e){return CT(vT(i,e))}function w0(i){async function e(t,n){pe(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const s=t.url.split(":")[0].toLowerCase();pe(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),pe(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let r=null;const a=new AbortController,o=setTimeout(()=>{r=Qt("request timeout","TIMEOUT"),a.abort()},t.timeout);n&&n.addListener(()=>{r=Qt("request cancelled","CANCELLED"),a.abort()});const c=Object.assign({},i,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:a.signal});let l;try{l=await fetch(t.url,c)}catch(f){throw clearTimeout(o),r||f}clearTimeout(o);const h={};l.headers.forEach((f,m)=>{h[m.toLowerCase()]=f});const u=await l.arrayBuffer(),d=u==null?null:new Uint8Array(u);return{statusCode:l.status,statusMessage:l.statusText,headers:h,body:d}}return e}const ST=12,IT=250;let v0=w0();const MT=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),BT=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Zd=!1;async function C0(i,e){try{const t=i.match(MT);if(!t)throw new Error("invalid data");return new Qs(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?xT(t[3]):RT(t[3]))}catch{return new Qs(599,"BAD REQUEST (invalid data: URI)",{},null,new Pi(i))}}function S0(i){async function e(t,n){try{const s=t.match(BT);if(!s)throw new Error("invalid link");return new Pi(`${i}${s[2]}`)}catch{return new Qs(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Pi(t))}}return e}const Tl={data:C0,ipfs:S0("https://gateway.ipfs.io/ipfs/")},I0=new WeakMap;class TT{#e;#t;constructor(e){this.#e=[],this.#t=!1,I0.set(e,()=>{if(!this.#t){this.#t=!0;for(const t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){pe(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){pe(!this.cancelled,"cancelled","CANCELLED",{})}}function Rl(i){if(i==null)throw new Error("missing signal; should not happen");return i.checkSignal(),i}class Pi{#e;#t;#n;#i;#s;#a;#r;#o;#f;#l;#p;#A;#c;#h;#u;get url(){return this.#a}set url(e){this.#a=String(e)}get body(){return this.#r==null?null:new Uint8Array(this.#r)}set body(e){if(e==null)this.#r=void 0,this.#o=void 0;else if(typeof e=="string")this.#r=is(e),this.#o="text/plain";else if(e instanceof Uint8Array)this.#r=e,this.#o="application/octet-stream";else if(typeof e=="object")this.#r=is(JSON.stringify(e)),this.#o="application/json";else throw new Error("invalid body")}hasBody(){return this.#r!=null}get method(){return this.#i?this.#i:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#i=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#n);return this.#f&&(e.authorization=`Basic ${ET(is(this.#f))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#o&&(e["content-type"]=this.#o),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#n[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#n={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#f||null}setCredentials(e,t){V(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#f=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#s}set timeout(e){V(e>=0,"timeout must be non-zero","timeout",e),this.#s=e}get preflightFunc(){return this.#l||null}set preflightFunc(e){this.#l=e}get processFunc(){return this.#p||null}set processFunc(e){this.#p=e}get retryFunc(){return this.#A||null}set retryFunc(e){this.#A=e}get getUrlFunc(){return this.#u||v0}set getUrlFunc(e){this.#u=e}constructor(e){this.#a=String(e),this.#e=!1,this.#t=!0,this.#n={},this.#i="",this.#s=3e5,this.#h={slotInterval:IT,maxAttempts:ST},this.#u=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#r?Ce(this.#r):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#h.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#h.maxAttempts=e.maxAttempts)}async#d(e,t,n,s,r){if(e>=this.#h.maxAttempts)return r.makeServerError("exceeded maximum retry limit");pe(M0()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await NT(n);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in Tl){const h=await Tl[o](a.url,Rl(s.#c));if(h instanceof Qs){let u=h;if(this.processFunc){Rl(s.#c);try{u=await this.processFunc(a,u)}catch(d){(d.throttle==null||typeof d.stall!="number")&&u.makeServerError("error in post-processing function",d).assertOk()}}return u}a=h}this.preflightFunc&&(a=await this.preflightFunc(a));const c=await this.getUrlFunc(a,Rl(s.#c));let l=new Qs(c.statusCode,c.statusMessage,c.headers,c.body,s);if(l.statusCode===301||l.statusCode===302){try{const h=l.headers.location||"";return a.redirect(h).#d(e+1,t,0,s,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,l,e))){const h=l.headers["retry-after"];let u=this.#h.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(u=parseInt(h)),a.clone().#d(e+1,t,u,s,l)}if(this.processFunc){Rl(s.#c);try{l=await this.processFunc(a,l)}catch(h){(h.throttle==null||typeof h.stall!="number")&&l.makeServerError("error in post-processing function",h).assertOk();let u=this.#h.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(u=h.stall),a.clone().#d(e+1,t,u,s,l)}}return l}send(){return pe(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new TT(this),this.#d(0,M0()+this.timeout,0,this,new Qs(0,"",{},null,this))}cancel(){pe(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=I0.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();pe(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new Pi(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,s.#n=Object.assign({},this.#n),this.#r&&(s.#r=new Uint8Array(this.#r)),s.#o=this.#o,s}clone(){const e=new Pi(this.url);return e.#i=this.#i,this.#r&&(e.#r=this.#r),e.#o=this.#o,e.#n=Object.assign({},this.#n),e.#f=this.#f,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#l=this.#l,e.#p=this.#p,e.#A=this.#A,e.#h=Object.assign({},this.#h),e.#u=this.#u,e}static lockConfig(){Zd=!0}static getGateway(e){return Tl[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Zd)throw new Error("gateways locked");Tl[e]=t}static registerGetUrl(e){if(Zd)throw new Error("gateways locked");v0=e}static createGetUrlFunc(e){return w0(e)}static createDataGateway(){return C0}static createIpfsGatewayFunc(e){return S0(e)}}class Qs{#e;#t;#n;#i;#s;#a;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#i?Ce(this.#i):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#n)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}get bodyText(){try{return this.#i==null?"":Bl(this.#i)}catch{pe(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{pe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,s,r){this.#e=e,this.#t=t,this.#n=Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{}),this.#i=s==null?null:new Uint8Array(s),this.#s=r||null,this.#a={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const s=new Qs(599,n,this.headers,this.body,this.#s||void 0);return s.#a={message:e,error:t},s}throwThrottleError(e,t){t==null?t=-1:V(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw Xe(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#i!=null}get request(){return this.#s}ok(){return this.#a.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#a;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{this.#i&&(s=Bl(this.#i))}catch{}pe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function M0(){return new Date().getTime()}function RT(i){return is(i.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function NT(i){return new Promise(e=>setTimeout(e,i))}function FT(i){let e=i.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function B0(i,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+i[e+s];return n}function T0(i,e,t,n){const s=[];for(;t<e+1+n;){const r=R0(i,t);s.push(r.result),t+=r.consumed,pe(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:i,length:n,offset:e})}return{consumed:1+n,result:s}}function R0(i,e){pe(i.length!==0,"data too short","BUFFER_OVERRUN",{buffer:i,length:0,offset:1});const t=n=>{pe(n<=i.length,"data short segment too short","BUFFER_OVERRUN",{buffer:i,length:i.length,offset:n})};if(i[e]>=248){const n=i[e]-247;t(e+1+n);const s=B0(i,e+1,n);return t(e+1+n+s),T0(i,e,e+1+n,n+s)}else if(i[e]>=192){const n=i[e]-192;return t(e+1+n),T0(i,e,e+1,n)}else if(i[e]>=184){const n=i[e]-183;t(e+1+n);const s=B0(i,e+1,n);t(e+1+n+s);const r=Ce(i.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:r}}else if(i[e]>=128){const n=i[e]-128;t(e+1+n);const s=Ce(i.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:FT(i[e])}}function Po(i){const e=lt(i,"data"),t=R0(e,0);return V(t.consumed===e.length,"unexpected junk after rlp payload","data",i),t.result}function N0(i){const e=[];for(;i;)e.unshift(i&255),i>>=8;return e}function F0(i){if(Array.isArray(i)){let n=[];if(i.forEach(function(r){n=n.concat(F0(r))}),n.length<=55)return n.unshift(192+n.length),n;const s=N0(n.length);return s.unshift(247+s.length),s.concat(n)}const e=Array.prototype.slice.call(lt(i,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=N0(e.length);return t.unshift(183+t.length),t.concat(e)}const D0="0123456789abcdef";function ss(i){let e="0x";for(const t of F0(i))e+=D0[t>>4],e+=D0[t&15];return e}const Ln=32,$d=new Uint8Array(Ln),DT=["then"],Nl={},L0=new WeakMap;function fr(i){return L0.get(i)}function P0(i,e){L0.set(i,e)}function ko(i,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${i}`);throw t.error=e,t}function ef(i,e,t){return i.indexOf(null)>=0?e.map((n,s)=>n instanceof rs?ef(fr(n),n,t):n):i.reduce((n,s,r)=>{let a=e.getValue(s);return s in n||(t&&a instanceof rs&&(a=ef(fr(a),a,t)),n[s]=a),n},{})}class rs extends Array{#e;constructor(...e){const t=e[0];let n=e[1],s=(e[2]||[]).slice(),r=!0;t!==Nl&&(n=e,s=[],r=!1),super(n.length),n.forEach((c,l)=>{this[l]=c});const a=s.reduce((c,l)=>(typeof l=="string"&&c.set(l,(c.get(l)||0)+1),c),new Map);if(P0(this,Object.freeze(n.map((c,l)=>{const h=s[l];return h!=null&&a.get(h)===1?h:null}))),this.#e=[],this.#e==null&&this.#e,!r)return;Object.freeze(this);const o=new Proxy(this,{get:(c,l,h)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){const d=ht(l,"%index");if(d<0||d>=this.length)throw new RangeError("out of result range");const f=c[d];return f instanceof Error&&ko(`index ${d}`,f),f}if(DT.indexOf(l)>=0)return Reflect.get(c,l,h);const u=c[l];if(u instanceof Function)return function(...d){return u.apply(this===h?c:this,d)};if(!(l in c))return c.getValue.apply(this===h?c:this,[l])}return Reflect.get(c,l,h)}});return P0(o,fr(this)),o}toArray(e){const t=[];return this.forEach((n,s)=>{n instanceof Error&&ko(`index ${s}`,n),e&&n instanceof rs&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){const t=fr(this);return t.reduce((n,s,r)=>(pe(s!=null,`value at index ${r} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),ef(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);const n=fr(this),s=[],r=[];for(let a=e;a<t;a++)s.push(this[a]),r.push(n[a]);return new rs(Nl,s,r)}filter(e,t){const n=fr(this),s=[],r=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&ko(`index ${a}`,o),e.call(t,o,a,this)&&(s.push(o),r.push(n[a]))}return new rs(Nl,s,r)}map(e,t){const n=[];for(let s=0;s<this.length;s++){const r=this[s];r instanceof Error&&ko(`index ${s}`,r),n.push(e.call(t,r,s,this))}return n}getValue(e){const t=fr(this).indexOf(e);if(t===-1)return;const n=this[t];return n instanceof Error&&ko(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new rs(Nl,e,t)}}function k0(i){let e=Zt(i);return pe(e.length<=Ln,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Ln,offset:e.length}),e.length!==Ln&&(e=Dn(Ut([$d.slice(e.length%Ln),e]))),e}class as{name;type;localName;dynamic;constructor(e,t,n,s){Xe(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){V(!1,e,this.localName,t)}}class tf{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return Ut(this.#e)}get length(){return this.#t}#n(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#n(Dn(e.data))}writeBytes(e){let t=Dn(e);const n=t.length%Ln;return n&&(t=Dn(Ut([t,$d.slice(n)]))),this.#n(t)}writeValue(e){return this.#n(k0(e))}writeUpdatableValue(){const e=this.#e.length;return this.#e.push($d),this.#t+=Ln,t=>{this.#e[e]=k0(t)}}}class nf{allowLoose;#e;#t;#n;#i;#s;constructor(e,t,n){Xe(this,{allowLoose:!!t}),this.#e=Dn(e),this.#n=0,this.#i=null,this.#s=n??1024,this.#t=0}get data(){return Ce(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#a(e){if(this.#i)return this.#i.#a(e);this.#n+=e,pe(this.#s<1||this.#n<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Dn(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#n,dataLength:this.dataLength}})}#r(e,t,n){let s=Math.ceil(t/Ln)*Ln;return this.#t+s>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?s=t:pe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Dn(this.#e),length:this.#e.length,offset:this.#t+s})),this.#e.slice(this.#t,this.#t+s)}subReader(e){const t=new nf(this.#e.slice(this.#t+e),this.allowLoose,this.#s);return t.#i=this,t}readBytes(e,t){let n=this.#r(0,e,!!t);return this.#a(e),this.#t+=n.length,n.slice(0,e)}readValue(){return Jd(this.readBytes(Ln))}readIndex(){return mT(this.readBytes(Ln))}}function Fl(i){if(!Number.isSafeInteger(i)||i<0)throw new Error(`Wrong positive integer: ${i}`)}function sf(i,...e){if(!(i instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(i.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${i.length}`)}function LT(i){if(typeof i!="function"||typeof i.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fl(i.outputLen),Fl(i.blockLen)}function Ia(i,e=!0){if(i.destroyed)throw new Error("Hash instance has been destroyed");if(e&&i.finished)throw new Error("Hash#digest() has already been called")}function U0(i,e){sf(i);const t=e.outputLen;if(i.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const rf=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const O0=i=>i instanceof Uint8Array,PT=i=>new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)),af=i=>new DataView(i.buffer,i.byteOffset,i.byteLength),ki=(i,e)=>i<<32-e|i>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function kT(i){if(typeof i!="string")throw new Error(`utf8ToBytes expected string, got ${typeof i}`);return new Uint8Array(new TextEncoder().encode(i))}function Dl(i){if(typeof i=="string"&&(i=kT(i)),!O0(i))throw new Error(`expected Uint8Array, got ${typeof i}`);return i}function UT(...i){const e=new Uint8Array(i.reduce((n,s)=>n+s.length,0));let t=0;return i.forEach(n=>{if(!O0(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}class of{clone(){return this._cloneInto()}}function cf(i){const e=n=>i().update(Dl(n)).digest(),t=i();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>i(),e}function OT(i=32){if(rf&&typeof rf.getRandomValues=="function")return rf.getRandomValues(new Uint8Array(i));throw new Error("crypto.getRandomValues must be defined")}class Q0 extends of{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,LT(e);const n=Dl(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,r=new Uint8Array(s);r.set(n.length>s?e.create().update(n).digest():n);for(let a=0;a<r.length;a++)r[a]^=54;this.iHash.update(r),this.oHash=e.create();for(let a=0;a<r.length;a++)r[a]^=106;this.oHash.update(r),r.fill(0)}update(e){return Ia(this),this.iHash.update(e),this}digestInto(e){Ia(this),sf(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:s,destroyed:r,blockLen:a,outputLen:o}=this;return e=e,e.finished=s,e.destroyed=r,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const G0=(i,e,t)=>new Q0(i,e).update(t).digest();G0.create=(i,e)=>new Q0(i,e);function QT(i,e,t,n){if(typeof i.setBigUint64=="function")return i.setBigUint64(e,t,n);const s=BigInt(32),r=BigInt(4294967295),a=Number(t>>s&r),o=Number(t&r),c=n?4:0,l=n?0:4;i.setUint32(e+c,a,n),i.setUint32(e+l,o,n)}class H0 extends of{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=af(this.buffer)}update(e){Ia(this);const{view:t,buffer:n,blockLen:s}=this;e=Dl(e);const r=e.length;for(let a=0;a<r;){const o=Math.min(s-this.pos,r-a);if(o===s){const c=af(e);for(;s<=r-a;a+=s)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ia(this),U0(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:s,isLE:r}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let u=a;u<s;u++)t[u]=0;QT(n,s-8,BigInt(this.length*8),r),this.process(n,0);const o=af(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<l;u++)o.setUint32(4*u,h[u],r)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:s,finished:r,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=r,e.destroyed=a,s%t&&e.buffer.set(n),e}}const GT=(i,e,t)=>i&e^~i&t,HT=(i,e,t)=>i&e^i&t^e&t,zT=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Gs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hs=new Uint32Array(64);class VT extends H0{constructor(){super(64,32,8,!1),this.A=Gs[0]|0,this.B=Gs[1]|0,this.C=Gs[2]|0,this.D=Gs[3]|0,this.E=Gs[4]|0,this.F=Gs[5]|0,this.G=Gs[6]|0,this.H=Gs[7]|0}get(){const{A:e,B:t,C:n,D:s,E:r,F:a,G:o,H:c}=this;return[e,t,n,s,r,a,o,c]}set(e,t,n,s,r,a,o,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=r|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,t){for(let u=0;u<16;u++,t+=4)Hs[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const d=Hs[u-15],f=Hs[u-2],m=ki(d,7)^ki(d,18)^d>>>3,g=ki(f,17)^ki(f,19)^f>>>10;Hs[u]=g+Hs[u-7]+m+Hs[u-16]|0}let{A:n,B:s,C:r,D:a,E:o,F:c,G:l,H:h}=this;for(let u=0;u<64;u++){const d=ki(o,6)^ki(o,11)^ki(o,25),f=h+d+GT(o,c,l)+zT[u]+Hs[u]|0,g=(ki(n,2)^ki(n,13)^ki(n,22))+HT(n,s,r)|0;h=l,l=c,c=o,o=a+f|0,a=r,r=s,s=n,n=f+g|0}n=n+this.A|0,s=s+this.B|0,r=r+this.C|0,a=a+this.D|0,o=o+this.E|0,c=c+this.F|0,l=l+this.G|0,h=h+this.H|0,this.set(n,s,r,a,o,c,l,h)}roundClean(){Hs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const z0=cf(()=>new VT),Ll=BigInt(2**32-1),lf=BigInt(32);function V0(i,e=!1){return e?{h:Number(i&Ll),l:Number(i>>lf&Ll)}:{h:Number(i>>lf&Ll)|0,l:Number(i&Ll)|0}}function W0(i,e=!1){let t=new Uint32Array(i.length),n=new Uint32Array(i.length);for(let s=0;s<i.length;s++){const{h:r,l:a}=V0(i[s],e);[t[s],n[s]]=[r,a]}return[t,n]}const WT=(i,e)=>BigInt(i>>>0)<<lf|BigInt(e>>>0),qT=(i,e,t)=>i>>>t,KT=(i,e,t)=>i<<32-t|e>>>t,jT=(i,e,t)=>i>>>t|e<<32-t,XT=(i,e,t)=>i<<32-t|e>>>t,YT=(i,e,t)=>i<<64-t|e>>>t-32,JT=(i,e,t)=>i>>>t-32|e<<64-t,ZT=(i,e)=>e,$T=(i,e)=>i,q0=(i,e,t)=>i<<t|e>>>32-t,K0=(i,e,t)=>e<<t|i>>>32-t,j0=(i,e,t)=>e<<t-32|i>>>64-t,X0=(i,e,t)=>i<<t-32|e>>>64-t;function eR(i,e,t,n){const s=(e>>>0)+(n>>>0);return{h:i+t+(s/2**32|0)|0,l:s|0}}const ct={fromBig:V0,split:W0,toBig:WT,shrSH:qT,shrSL:KT,rotrSH:jT,rotrSL:XT,rotrBH:YT,rotrBL:JT,rotr32H:ZT,rotr32L:$T,rotlSH:q0,rotlSL:K0,rotlBH:j0,rotlBL:X0,add:eR,add3L:(i,e,t)=>(i>>>0)+(e>>>0)+(t>>>0),add3H:(i,e,t,n)=>e+t+n+(i/2**32|0)|0,add4L:(i,e,t,n)=>(i>>>0)+(e>>>0)+(t>>>0)+(n>>>0),add4H:(i,e,t,n,s)=>e+t+n+s+(i/2**32|0)|0,add5H:(i,e,t,n,s,r)=>e+t+n+s+r+(i/2**32|0)|0,add5L:(i,e,t,n,s)=>(i>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0)},[tR,nR]=ct.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(i=>BigInt(i))),zs=new Uint32Array(80),Vs=new Uint32Array(80);class iR extends H0{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:s,Ch:r,Cl:a,Dh:o,Dl:c,Eh:l,El:h,Fh:u,Fl:d,Gh:f,Gl:m,Hh:g,Hl:A}=this;return[e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A]}set(e,t,n,s,r,a,o,c,l,h,u,d,f,m,g,A){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=r|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=l|0,this.El=h|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=m|0,this.Hh=g|0,this.Hl=A|0}process(e,t){for(let b=0;b<16;b++,t+=4)zs[b]=e.getUint32(t),Vs[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){const _=zs[b-15]|0,M=Vs[b-15]|0,w=ct.rotrSH(_,M,1)^ct.rotrSH(_,M,8)^ct.shrSH(_,M,7),S=ct.rotrSL(_,M,1)^ct.rotrSL(_,M,8)^ct.shrSL(_,M,7),T=zs[b-2]|0,C=Vs[b-2]|0,v=ct.rotrSH(T,C,19)^ct.rotrBH(T,C,61)^ct.shrSH(T,C,6),F=ct.rotrSL(T,C,19)^ct.rotrBL(T,C,61)^ct.shrSL(T,C,6),K=ct.add4L(S,F,Vs[b-7],Vs[b-16]),q=ct.add4H(K,w,v,zs[b-7],zs[b-16]);zs[b]=q|0,Vs[b]=K|0}let{Ah:n,Al:s,Bh:r,Bl:a,Ch:o,Cl:c,Dh:l,Dl:h,Eh:u,El:d,Fh:f,Fl:m,Gh:g,Gl:A,Hh:p,Hl:y}=this;for(let b=0;b<80;b++){const _=ct.rotrSH(u,d,14)^ct.rotrSH(u,d,18)^ct.rotrBH(u,d,41),M=ct.rotrSL(u,d,14)^ct.rotrSL(u,d,18)^ct.rotrBL(u,d,41),w=u&f^~u&g,S=d&m^~d&A,T=ct.add5L(y,M,S,nR[b],Vs[b]),C=ct.add5H(T,p,_,w,tR[b],zs[b]),v=T|0,F=ct.rotrSH(n,s,28)^ct.rotrBH(n,s,34)^ct.rotrBH(n,s,39),K=ct.rotrSL(n,s,28)^ct.rotrBL(n,s,34)^ct.rotrBL(n,s,39),q=n&r^n&o^r&o,$=s&a^s&c^a&c;p=g|0,y=A|0,g=f|0,A=m|0,f=u|0,m=d|0,{h:u,l:d}=ct.add(l|0,h|0,C|0,v|0),l=o|0,h=c|0,o=r|0,c=a|0,r=n|0,a=s|0;const D=ct.add3L(v,K,$);n=ct.add3H(D,C,F,q),s=D|0}({h:n,l:s}=ct.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:r,l:a}=ct.add(this.Bh|0,this.Bl|0,r|0,a|0),{h:o,l:c}=ct.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:l,l:h}=ct.add(this.Dh|0,this.Dl|0,l|0,h|0),{h:u,l:d}=ct.add(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:m}=ct.add(this.Fh|0,this.Fl|0,f|0,m|0),{h:g,l:A}=ct.add(this.Gh|0,this.Gl|0,g|0,A|0),{h:p,l:y}=ct.add(this.Hh|0,this.Hl|0,p|0,y|0),this.set(n,s,r,a,o,c,l,h,u,d,f,m,g,A,p,y)}roundClean(){zs.fill(0),Vs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sR=cf(()=>new iR);function rR(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const Y0=rR();Y0.crypto||Y0.msCrypto;function aR(i){switch(i){case"sha256":return z0.create();case"sha512":return sR.create()}V(!1,"invalid hashing algorithm name","algorithm",i)}const[J0,Z0,$0]=[[],[],[]],oR=BigInt(0),Uo=BigInt(1),cR=BigInt(2),lR=BigInt(7),hR=BigInt(256),uR=BigInt(113);for(let i=0,e=Uo,t=1,n=0;i<24;i++){[t,n]=[n,(2*t+3*n)%5],J0.push(2*(5*n+t)),Z0.push((i+1)*(i+2)/2%64);let s=oR;for(let r=0;r<7;r++)e=(e<<Uo^(e>>lR)*uR)%hR,e&cR&&(s^=Uo<<(Uo<<BigInt(r))-Uo);$0.push(s)}const[dR,fR]=W0($0,!0),eb=(i,e,t)=>t>32?j0(i,e,t):q0(i,e,t),tb=(i,e,t)=>t>32?X0(i,e,t):K0(i,e,t);function pR(i,e=24){const t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)t[a]=i[a]^i[a+10]^i[a+20]^i[a+30]^i[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,c=(a+2)%10,l=t[c],h=t[c+1],u=eb(l,h,1)^t[o],d=tb(l,h,1)^t[o+1];for(let f=0;f<50;f+=10)i[a+f]^=u,i[a+f+1]^=d}let s=i[2],r=i[3];for(let a=0;a<24;a++){const o=Z0[a],c=eb(s,r,o),l=tb(s,r,o),h=J0[a];s=i[h],r=i[h+1],i[h]=c,i[h+1]=l}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=i[a+o];for(let o=0;o<10;o++)i[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}i[0]^=dR[n],i[1]^=fR[n]}t.fill(0)}class hf extends of{constructor(e,t,n,s=!1,r=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fl(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=PT(this.state)}keccak(){pR(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Ia(this);const{blockLen:t,state:n}=this;e=Dl(e);const s=e.length;for(let r=0;r<s;){const a=Math.min(t-this.pos,s-r);for(let o=0;o<a;o++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Ia(this,!1),sf(e),this.finish();const t=this.state,{blockLen:n}=this;for(let s=0,r=e.length;s<r;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,r-s);e.set(t.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Fl(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(U0(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:s,rounds:r,enableXOF:a}=this;return e||(e=new hf(t,n,s,a,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}}const AR=((i,e,t)=>cf(()=>new hf(e,i,t)))(1,136,256/8);let nb=!1;const ib=function(i){return AR(i)};let sb=ib;function $t(i){const e=lt(i,"data");return Ce(sb(e))}$t._=ib,$t.lock=function(){nb=!0},$t.register=function(i){if(nb)throw new TypeError("keccak256 is locked");sb=i},Object.freeze($t);const rb=function(i){return aR("sha256").update(i).digest()};let ab=rb,ob=!1;function Ma(i){const e=lt(i,"data");return Ce(ab(e))}Ma._=rb,Ma.lock=function(){ob=!0},Ma.register=function(i){if(ob)throw new Error("sha256 is locked");ab=i},Object.freeze(Ma),Object.freeze(Ma);BigInt(0);const gR=BigInt(1),mR=BigInt(2),Pl=i=>i instanceof Uint8Array,bR=Array.from({length:256},(i,e)=>e.toString(16).padStart(2,"0"));function Ba(i){if(!Pl(i))throw new Error("Uint8Array expected");let e="";for(let t=0;t<i.length;t++)e+=bR[i[t]];return e}function uf(i){if(typeof i!="string")throw new Error("hex string expected, got "+typeof i);return BigInt(i===""?"0":`0x${i}`)}function Oo(i){if(typeof i!="string")throw new Error("hex string expected, got "+typeof i);const e=i.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){const s=n*2,r=i.slice(s,s+2),a=Number.parseInt(r,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");t[n]=a}return t}function pr(i){return uf(Ba(i))}function df(i){if(!Pl(i))throw new Error("Uint8Array expected");return uf(Ba(Uint8Array.from(i).reverse()))}function Ta(i,e){return Oo(i.toString(16).padStart(e*2,"0"))}function ff(i,e){return Ta(i,e).reverse()}function wi(i,e,t){let n;if(typeof e=="string")try{n=Oo(e)}catch(r){throw new Error(`${i} must be valid hex string, got "${e}". Cause: ${r}`)}else if(Pl(e))n=Uint8Array.from(e);else throw new Error(`${i} must be hex string or Uint8Array`);const s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${i} expected ${t} bytes, got ${s}`);return n}function Qo(...i){const e=new Uint8Array(i.reduce((n,s)=>n+s.length,0));let t=0;return i.forEach(n=>{if(!Pl(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}const pf=i=>(mR<<BigInt(i-1))-gR,Af=i=>new Uint8Array(i),cb=i=>Uint8Array.from(i);function lb(i,e,t){if(typeof i!="number"||i<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=Af(i),s=Af(i),r=0;const a=()=>{n.fill(1),s.fill(0),r=0},o=(...u)=>t(s,n,...u),c=(u=Af())=>{s=o(cb([0]),u),n=o(),u.length!==0&&(s=o(cb([1]),u),n=o())},l=()=>{if(r++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const d=[];for(;u<e;){n=o();const f=n.slice();d.push(f),u+=n.length}return Qo(...d)};return(u,d)=>{a(),c(u);let f;for(;!(f=d(l()));)c();return a(),f}}const xR={bigint:i=>typeof i=="bigint",function:i=>typeof i=="function",boolean:i=>typeof i=="boolean",string:i=>typeof i=="string",stringOrUint8Array:i=>typeof i=="string"||i instanceof Uint8Array,isSafeInteger:i=>Number.isSafeInteger(i),array:i=>Array.isArray(i),field:(i,e)=>e.Fp.isValid(i),hash:i=>typeof i=="function"&&Number.isSafeInteger(i.outputLen)};function Go(i,e,t={}){const n=(s,r,a)=>{const o=xR[r];if(typeof o!="function")throw new Error(`Invalid validator "${r}", expected function`);const c=i[s];if(!(a&&c===void 0)&&!o(c,i))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${r}`)};for(const[s,r]of Object.entries(e))n(s,r,!1);for(const[s,r]of Object.entries(t))n(s,r,!0);return i}const ER=Object.freeze(Object.defineProperty({__proto__:null,bitMask:pf,bytesToHex:Ba,bytesToNumberBE:pr,bytesToNumberLE:df,concatBytes:Qo,createHmacDrbg:lb,ensureBytes:wi,hexToBytes:Oo,hexToNumber:uf,numberToBytesBE:Ta,numberToBytesLE:ff,validateObject:Go},Symbol.toStringTag,{value:"Module"}));const An=BigInt(0),jt=BigInt(1),Ar=BigInt(2),_R=BigInt(3),gf=BigInt(4),hb=BigInt(5),ub=BigInt(8);BigInt(9),BigInt(16);function Gn(i,e){const t=i%e;return t>=An?t:e+t}function yR(i,e,t){if(t<=An||e<An)throw new Error("Expected power/modulo > 0");if(t===jt)return An;let n=jt;for(;e>An;)e&jt&&(n=n*i%t),i=i*i%t,e>>=jt;return n}function si(i,e,t){let n=i;for(;e-- >An;)n*=n,n%=t;return n}function mf(i,e){if(i===An||e<=An)throw new Error(`invert: expected positive integers, got n=${i} mod=${e}`);let t=Gn(i,e),n=e,s=An,r=jt;for(;t!==An;){const o=n/t,c=n%t,l=s-r*o;n=t,t=c,s=r,r=l}if(n!==jt)throw new Error("invert: does not exist");return Gn(s,e)}function wR(i){const e=(i-jt)/Ar;let t,n,s;for(t=i-jt,n=0;t%Ar===An;t/=Ar,n++);for(s=Ar;s<i&&yR(s,e,i)!==i-jt;s++);if(n===1){const a=(i+jt)/gf;return function(c,l){const h=c.pow(l,a);if(!c.eql(c.sqr(h),l))throw new Error("Cannot find square root");return h}}const r=(t+jt)/Ar;return function(o,c){if(o.pow(c,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let l=n,h=o.pow(o.mul(o.ONE,s),t),u=o.pow(c,r),d=o.pow(c,t);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let f=1;for(let g=o.sqr(d);f<l&&!o.eql(g,o.ONE);f++)g=o.sqr(g);const m=o.pow(h,jt<<BigInt(l-f-1));h=o.sqr(m),u=o.mul(u,m),d=o.mul(d,h),l=f}return u}}function vR(i){if(i%gf===_R){const e=(i+jt)/gf;return function(n,s){const r=n.pow(s,e);if(!n.eql(n.sqr(r),s))throw new Error("Cannot find square root");return r}}if(i%ub===hb){const e=(i-hb)/ub;return function(n,s){const r=n.mul(s,Ar),a=n.pow(r,e),o=n.mul(s,a),c=n.mul(n.mul(o,Ar),a),l=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(l),s))throw new Error("Cannot find square root");return l}}return wR(i)}const CR=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function SR(i){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=CR.reduce((n,s)=>(n[s]="function",n),e);return Go(i,t)}function IR(i,e,t){if(t<An)throw new Error("Expected power > 0");if(t===An)return i.ONE;if(t===jt)return e;let n=i.ONE,s=e;for(;t>An;)t&jt&&(n=i.mul(n,s)),s=i.sqr(s),t>>=jt;return n}function MR(i,e){const t=new Array(e.length),n=e.reduce((r,a,o)=>i.is0(a)?r:(t[o]=r,i.mul(r,a)),i.ONE),s=i.inv(n);return e.reduceRight((r,a,o)=>i.is0(a)?r:(t[o]=i.mul(r,t[o]),i.mul(r,a)),s),t}function db(i,e){const t=e!==void 0?e:i.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function BR(i,e,t=!1,n={}){if(i<=An)throw new Error(`Expected Field ORDER > 0, got ${i}`);const{nBitLength:s,nByteLength:r}=db(i,e);if(r>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=vR(i),o=Object.freeze({ORDER:i,BITS:s,BYTES:r,MASK:pf(s),ZERO:An,ONE:jt,create:c=>Gn(c,i),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return An<=c&&c<i},is0:c=>c===An,isOdd:c=>(c&jt)===jt,neg:c=>Gn(-c,i),eql:(c,l)=>c===l,sqr:c=>Gn(c*c,i),add:(c,l)=>Gn(c+l,i),sub:(c,l)=>Gn(c-l,i),mul:(c,l)=>Gn(c*l,i),pow:(c,l)=>IR(o,c,l),div:(c,l)=>Gn(c*mf(l,i),i),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>mf(c,i),sqrt:n.sqrt||(c=>a(o,c)),invertBatch:c=>MR(o,c),cmov:(c,l,h)=>h?l:c,toBytes:c=>t?ff(c,r):Ta(c,r),fromBytes:c=>{if(c.length!==r)throw new Error(`Fp.fromBytes: expected ${r}, got ${c.length}`);return t?df(c):pr(c)}});return Object.freeze(o)}function fb(i){if(typeof i!="bigint")throw new Error("field order must be bigint");const e=i.toString(2).length;return Math.ceil(e/8)}function pb(i){const e=fb(i);return e+Math.ceil(e/2)}function TR(i,e,t=!1){const n=i.length,s=fb(e),r=pb(e);if(n<16||n<r||n>1024)throw new Error(`expected ${r}-1024 bytes of input, got ${n}`);const a=t?pr(i):df(i),o=Gn(a,e-jt)+jt;return t?ff(o,s):Ta(o,s)}const RR=BigInt(0),bf=BigInt(1);function NR(i,e){const t=(s,r)=>{const a=r.negate();return s?a:r},n=s=>{const r=Math.ceil(e/s)+1,a=2**(s-1);return{windows:r,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,r){let a=i.ZERO,o=s;for(;r>RR;)r&bf&&(a=a.add(o)),o=o.double(),r>>=bf;return a},precomputeWindow(s,r){const{windows:a,windowSize:o}=n(r),c=[];let l=s,h=l;for(let u=0;u<a;u++){h=l,c.push(h);for(let d=1;d<o;d++)h=h.add(l),c.push(h);l=h.double()}return c},wNAF(s,r,a){const{windows:o,windowSize:c}=n(s);let l=i.ZERO,h=i.BASE;const u=BigInt(2**s-1),d=2**s,f=BigInt(s);for(let m=0;m<o;m++){const g=m*c;let A=Number(a&u);a>>=f,A>c&&(A-=d,a+=bf);const p=g,y=g+Math.abs(A)-1,b=m%2!==0,_=A<0;A===0?h=h.add(t(b,r[p])):l=l.add(t(_,r[y]))}return{p:l,f:h}},wNAFCached(s,r,a,o){const c=s._WINDOW_SIZE||1;let l=r.get(s);return l||(l=this.precomputeWindow(s,c),c!==1&&r.set(s,o(l))),this.wNAF(c,l,a)}}}function Ab(i){return SR(i.Fp),Go(i,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...db(i.n,i.nBitLength),...i,p:i.Fp.ORDER})}function FR(i){const e=Ab(i);Go(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:DR,hexToBytes:LR}=ER,gr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(i){const{Err:e}=gr;if(i.length<2||i[0]!==2)throw new e("Invalid signature integer tag");const t=i[1],n=i.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:DR(n),l:i.subarray(t+2)}},toSig(i){const{Err:e}=gr,t=typeof i=="string"?LR(i):i;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:s,l:r}=gr._parseInt(t.subarray(2)),{d:a,l:o}=gr._parseInt(r);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(i){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,t=l=>{const h=l.toString(16);return h.length&1?`0${h}`:h},n=e(t(i.s)),s=e(t(i.r)),r=n.length/2,a=s.length/2,o=t(r),c=t(a);return`30${t(a+r+4)}02${c}${s}02${o}${n}`}},os=BigInt(0),ri=BigInt(1);BigInt(2);const gb=BigInt(3);BigInt(4);function PR(i){const e=FR(i),{Fp:t}=e,n=e.toBytes||((m,g,A)=>{const p=g.toAffine();return Qo(Uint8Array.from([4]),t.toBytes(p.x),t.toBytes(p.y))}),s=e.fromBytes||(m=>{const g=m.subarray(1),A=t.fromBytes(g.subarray(0,t.BYTES)),p=t.fromBytes(g.subarray(t.BYTES,2*t.BYTES));return{x:A,y:p}});function r(m){const{a:g,b:A}=e,p=t.sqr(m),y=t.mul(p,m);return t.add(t.add(y,t.mul(m,g)),A)}if(!t.eql(t.sqr(e.Gy),r(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&os<m&&m<e.n}function o(m){if(!a(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(m){const{allowedPrivateKeyLengths:g,nByteLength:A,wrapPrivateKey:p,n:y}=e;if(g&&typeof m!="bigint"){if(m instanceof Uint8Array&&(m=Ba(m)),typeof m!="string"||!g.includes(m.length))throw new Error("Invalid key");m=m.padStart(A*2,"0")}let b;try{b=typeof m=="bigint"?m:pr(wi("private key",m,A))}catch{throw new Error(`private key must be ${A} bytes, hex or bigint, not ${typeof m}`)}return p&&(b=Gn(b,y)),o(b),b}const l=new Map;function h(m){if(!(m instanceof u))throw new Error("ProjectivePoint expected")}class u{constructor(g,A,p){if(this.px=g,this.py=A,this.pz=p,g==null||!t.isValid(g))throw new Error("x required");if(A==null||!t.isValid(A))throw new Error("y required");if(p==null||!t.isValid(p))throw new Error("z required")}static fromAffine(g){const{x:A,y:p}=g||{};if(!g||!t.isValid(A)||!t.isValid(p))throw new Error("invalid affine point");if(g instanceof u)throw new Error("projective point not allowed");const y=b=>t.eql(b,t.ZERO);return y(A)&&y(p)?u.ZERO:new u(A,p,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(g){const A=t.invertBatch(g.map(p=>p.pz));return g.map((p,y)=>p.toAffine(A[y])).map(u.fromAffine)}static fromHex(g){const A=u.fromAffine(s(wi("pointHex",g)));return A.assertValidity(),A}static fromPrivateKey(g){return u.BASE.multiply(c(g))}_setWindowSize(g){this._WINDOW_SIZE=g,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:g,y:A}=this.toAffine();if(!t.isValid(g)||!t.isValid(A))throw new Error("bad point: x or y not FE");const p=t.sqr(A),y=r(g);if(!t.eql(p,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:g}=this.toAffine();if(t.isOdd)return!t.isOdd(g);throw new Error("Field doesn't support isOdd")}equals(g){h(g);const{px:A,py:p,pz:y}=this,{px:b,py:_,pz:M}=g,w=t.eql(t.mul(A,M),t.mul(b,y)),S=t.eql(t.mul(p,M),t.mul(_,y));return w&&S}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:g,b:A}=e,p=t.mul(A,gb),{px:y,py:b,pz:_}=this;let M=t.ZERO,w=t.ZERO,S=t.ZERO,T=t.mul(y,y),C=t.mul(b,b),v=t.mul(_,_),F=t.mul(y,b);return F=t.add(F,F),S=t.mul(y,_),S=t.add(S,S),M=t.mul(g,S),w=t.mul(p,v),w=t.add(M,w),M=t.sub(C,w),w=t.add(C,w),w=t.mul(M,w),M=t.mul(F,M),S=t.mul(p,S),v=t.mul(g,v),F=t.sub(T,v),F=t.mul(g,F),F=t.add(F,S),S=t.add(T,T),T=t.add(S,T),T=t.add(T,v),T=t.mul(T,F),w=t.add(w,T),v=t.mul(b,_),v=t.add(v,v),T=t.mul(v,F),M=t.sub(M,T),S=t.mul(v,C),S=t.add(S,S),S=t.add(S,S),new u(M,w,S)}add(g){h(g);const{px:A,py:p,pz:y}=this,{px:b,py:_,pz:M}=g;let w=t.ZERO,S=t.ZERO,T=t.ZERO;const C=e.a,v=t.mul(e.b,gb);let F=t.mul(A,b),K=t.mul(p,_),q=t.mul(y,M),$=t.add(A,p),D=t.add(b,_);$=t.mul($,D),D=t.add(F,K),$=t.sub($,D),D=t.add(A,y);let O=t.add(b,M);return D=t.mul(D,O),O=t.add(F,q),D=t.sub(D,O),O=t.add(p,y),w=t.add(_,M),O=t.mul(O,w),w=t.add(K,q),O=t.sub(O,w),T=t.mul(C,D),w=t.mul(v,q),T=t.add(w,T),w=t.sub(K,T),T=t.add(K,T),S=t.mul(w,T),K=t.add(F,F),K=t.add(K,F),q=t.mul(C,q),D=t.mul(v,D),K=t.add(K,q),q=t.sub(F,q),q=t.mul(C,q),D=t.add(D,q),F=t.mul(K,D),S=t.add(S,F),F=t.mul(O,D),w=t.mul($,w),w=t.sub(w,F),F=t.mul($,K),T=t.mul(O,T),T=t.add(T,F),new u(w,S,T)}subtract(g){return this.add(g.negate())}is0(){return this.equals(u.ZERO)}wNAF(g){return f.wNAFCached(this,l,g,A=>{const p=t.invertBatch(A.map(y=>y.pz));return A.map((y,b)=>y.toAffine(p[b])).map(u.fromAffine)})}multiplyUnsafe(g){const A=u.ZERO;if(g===os)return A;if(o(g),g===ri)return this;const{endo:p}=e;if(!p)return f.unsafeLadder(this,g);let{k1neg:y,k1:b,k2neg:_,k2:M}=p.splitScalar(g),w=A,S=A,T=this;for(;b>os||M>os;)b&ri&&(w=w.add(T)),M&ri&&(S=S.add(T)),T=T.double(),b>>=ri,M>>=ri;return y&&(w=w.negate()),_&&(S=S.negate()),S=new u(t.mul(S.px,p.beta),S.py,S.pz),w.add(S)}multiply(g){o(g);let A=g,p,y;const{endo:b}=e;if(b){const{k1neg:_,k1:M,k2neg:w,k2:S}=b.splitScalar(A);let{p:T,f:C}=this.wNAF(M),{p:v,f:F}=this.wNAF(S);T=f.constTimeNegate(_,T),v=f.constTimeNegate(w,v),v=new u(t.mul(v.px,b.beta),v.py,v.pz),p=T.add(v),y=C.add(F)}else{const{p:_,f:M}=this.wNAF(A);p=_,y=M}return u.normalizeZ([p,y])[0]}multiplyAndAddUnsafe(g,A,p){const y=u.BASE,b=(M,w)=>w===os||w===ri||!M.equals(y)?M.multiplyUnsafe(w):M.multiply(w),_=b(this,A).add(b(g,p));return _.is0()?void 0:_}toAffine(g){const{px:A,py:p,pz:y}=this,b=this.is0();g==null&&(g=b?t.ONE:t.inv(y));const _=t.mul(A,g),M=t.mul(p,g),w=t.mul(y,g);if(b)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:_,y:M}}isTorsionFree(){const{h:g,isTorsionFree:A}=e;if(g===ri)return!0;if(A)return A(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:g,clearCofactor:A}=e;return g===ri?this:A?A(u,this):this.multiplyUnsafe(e.h)}toRawBytes(g=!0){return this.assertValidity(),n(u,this,g)}toHex(g=!0){return Ba(this.toRawBytes(g))}}u.BASE=new u(e.Gx,e.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const d=e.nBitLength,f=NR(u,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:r,isWithinCurveOrder:a}}function kR(i){const e=Ab(i);return Go(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function UR(i){const e=kR(i),{Fp:t,n}=e,s=t.BYTES+1,r=2*t.BYTES+1;function a(D){return os<D&&D<t.ORDER}function o(D){return Gn(D,n)}function c(D){return mf(D,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:h,weierstrassEquation:u,isWithinCurveOrder:d}=PR({...e,toBytes(D,O,Y){const Q=O.toAffine(),J=t.toBytes(Q.x),ee=Qo;return Y?ee(Uint8Array.from([O.hasEvenY()?2:3]),J):ee(Uint8Array.from([4]),J,t.toBytes(Q.y))},fromBytes(D){const O=D.length,Y=D[0],Q=D.subarray(1);if(O===s&&(Y===2||Y===3)){const J=pr(Q);if(!a(J))throw new Error("Point is not on curve");const ee=u(J);let ae=t.sqrt(ee);const ye=(ae&ri)===ri;return(Y&1)===1!==ye&&(ae=t.neg(ae)),{x:J,y:ae}}else if(O===r&&Y===4){const J=t.fromBytes(Q.subarray(0,t.BYTES)),ee=t.fromBytes(Q.subarray(t.BYTES,2*t.BYTES));return{x:J,y:ee}}else throw new Error(`Point of length ${O} was invalid. Expected ${s} compressed bytes or ${r} uncompressed bytes`)}}),f=D=>Ba(Ta(D,e.nByteLength));function m(D){const O=n>>ri;return D>O}function g(D){return m(D)?o(-D):D}const A=(D,O,Y)=>pr(D.slice(O,Y));class p{constructor(O,Y,Q){this.r=O,this.s=Y,this.recovery=Q,this.assertValidity()}static fromCompact(O){const Y=e.nByteLength;return O=wi("compactSignature",O,Y*2),new p(A(O,0,Y),A(O,Y,2*Y))}static fromDER(O){const{r:Y,s:Q}=gr.toSig(wi("DER",O));return new p(Y,Q)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(O){return new p(this.r,this.s,O)}recoverPublicKey(O){const{r:Y,s:Q,recovery:J}=this,ee=S(wi("msgHash",O));if(J==null||![0,1,2,3].includes(J))throw new Error("recovery id invalid");const ae=J===2||J===3?Y+e.n:Y;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const ye=(J&1)===0?"02":"03",Me=l.fromHex(ye+f(ae)),se=c(ae),me=o(-ee*se),be=o(Q*se),xe=l.BASE.multiplyAndAddUnsafe(Me,me,be);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new p(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Oo(this.toDERHex())}toDERHex(){return gr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Oo(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const y={isValidPrivateKey(D){try{return h(D),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const D=pb(e.n);return TR(e.randomBytes(D),e.n)},precompute(D=8,O=l.BASE){return O._setWindowSize(D),O.multiply(BigInt(3)),O}};function b(D,O=!0){return l.fromPrivateKey(D).toRawBytes(O)}function _(D){const O=D instanceof Uint8Array,Y=typeof D=="string",Q=(O||Y)&&D.length;return O?Q===s||Q===r:Y?Q===2*s||Q===2*r:D instanceof l}function M(D,O,Y=!0){if(_(D))throw new Error("first arg must be private key");if(!_(O))throw new Error("second arg must be public key");return l.fromHex(O).multiply(h(D)).toRawBytes(Y)}const w=e.bits2int||function(D){const O=pr(D),Y=D.length*8-e.nBitLength;return Y>0?O>>BigInt(Y):O},S=e.bits2int_modN||function(D){return o(w(D))},T=pf(e.nBitLength);function C(D){if(typeof D!="bigint")throw new Error("bigint expected");if(!(os<=D&&D<T))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Ta(D,e.nByteLength)}function v(D,O,Y=F){if(["recovered","canonical"].some($e=>$e in Y))throw new Error("sign() legacy options not supported");const{hash:Q,randomBytes:J}=e;let{lowS:ee,prehash:ae,extraEntropy:ye}=Y;ee==null&&(ee=!0),D=wi("msgHash",D),ae&&(D=wi("prehashed msgHash",Q(D)));const Me=S(D),se=h(O),me=[C(se),C(Me)];if(ye!=null){const $e=ye===!0?J(t.BYTES):ye;me.push(wi("extraEntropy",$e))}const be=Qo(...me),xe=Me;function Pe($e){const Qe=w($e);if(!d(Qe))return;const St=c(Qe),ut=l.BASE.multiply(Qe).toAffine(),Je=o(ut.x);if(Je===os)return;const G=o(St*o(xe+Je*se));if(G===os)return;let mn=(ut.x===Je?0:2)|Number(ut.y&ri),dt=G;return ee&&m(G)&&(dt=g(G),mn^=1),new p(Je,dt,mn)}return{seed:be,k2sig:Pe}}const F={lowS:e.lowS,prehash:!1},K={lowS:e.lowS,prehash:!1};function q(D,O,Y=F){const{seed:Q,k2sig:J}=v(D,O,Y),ee=e;return lb(ee.hash.outputLen,ee.nByteLength,ee.hmac)(Q,J)}l.BASE._setWindowSize(8);function $(D,O,Y,Q=K){const J=D;if(O=wi("msgHash",O),Y=wi("publicKey",Y),"strict"in Q)throw new Error("options.strict was renamed to lowS");const{lowS:ee,prehash:ae}=Q;let ye,Me;try{if(typeof J=="string"||J instanceof Uint8Array)try{ye=p.fromDER(J)}catch(ut){if(!(ut instanceof gr.Err))throw ut;ye=p.fromCompact(J)}else if(typeof J=="object"&&typeof J.r=="bigint"&&typeof J.s=="bigint"){const{r:ut,s:Je}=J;ye=new p(ut,Je)}else throw new Error("PARSE");Me=l.fromHex(Y)}catch(ut){if(ut.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ee&&ye.hasHighS())return!1;ae&&(O=e.hash(O));const{r:se,s:me}=ye,be=S(O),xe=c(me),Pe=o(be*xe),$e=o(se*xe),Qe=l.BASE.multiplyAndAddUnsafe(Me,Pe,$e)?.toAffine();return Qe?o(Qe.x)===se:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:M,sign:q,verify:$,ProjectivePoint:l,Signature:p,utils:y}}function OR(i){return{hash:i,hmac:(e,...t)=>G0(i,e,UT(...t)),randomBytes:OT}}function QR(i,e){const t=n=>UR({...i,...OR(n)});return Object.freeze({...t(e),create:t})}const mb=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),bb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),GR=BigInt(1),xf=BigInt(2),xb=(i,e)=>(i+e/xf)/e;function HR(i){const e=mb,t=BigInt(3),n=BigInt(6),s=BigInt(11),r=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),l=i*i*i%e,h=l*l*i%e,u=si(h,t,e)*h%e,d=si(u,t,e)*h%e,f=si(d,xf,e)*l%e,m=si(f,s,e)*f%e,g=si(m,r,e)*m%e,A=si(g,o,e)*g%e,p=si(A,c,e)*A%e,y=si(p,o,e)*g%e,b=si(y,t,e)*h%e,_=si(b,a,e)*m%e,M=si(_,n,e)*l%e,w=si(M,xf,e);if(!Ef.eql(Ef.sqr(w),i))throw new Error("Cannot find square root");return w}const Ef=BR(mb,void 0,void 0,{sqrt:HR}),Ws=QR({a:BigInt(0),b:BigInt(7),Fp:Ef,n:bb,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:i=>{const e=bb,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-GR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=t,a=BigInt("0x100000000000000000000000000000000"),o=xb(r*i,e),c=xb(-n*i,e);let l=Gn(i-o*t-c*s,e),h=Gn(-o*n-c*r,e);const u=l>a,d=h>a;if(u&&(l=e-l),d&&(h=e-h),l>a||h>a)throw new Error("splitScalar: Endomorphism failed, k="+i);return{k1neg:u,k1:l,k2neg:d,k2:h}}}},z0);BigInt(0),Ws.ProjectivePoint;const Ho="0x0000000000000000000000000000000000000000",Eb="0x0000000000000000000000000000000000000000000000000000000000000000",_b=BigInt(0),yb=BigInt(1),_f=BigInt(2),wb=BigInt(27),vb=BigInt(28),kl=BigInt(35),Cb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),zR=Cb/_f,VR=Symbol.for("nodejs.util.inspect.custom"),mr={};function yf(i){return ns(Zt(i),32)}class Gt{#e;#t;#n;#i;get r(){return this.#e}set r(e){V(Ca(e)===32,"invalid r","value",e),this.#e=Ce(e)}get s(){return V(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(e){V(Ca(e)===32,"invalid s","value",e),this.#t=Ce(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=zR}get v(){return this.#n}set v(e){const t=ht(e,"value");V(t===27||t===28,"invalid v","v",e),this.#n=t}get networkV(){return this.#i}get legacyChainId(){const e=this.networkV;return e==null?null:Gt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=lt(this.s);return this.yParity&&(e[0]|=128),Ce(e)}get compactSerialized(){return Ut([this.r,this.yParityAndS])}get serialized(){return Ut([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,s){Il(e,mr,"Signature"),this.#e=t,this.#t=n,this.#n=s,this.#i=null}getCanonical(){if(this.isValid())return this;const e=Cb-BigInt(this._s),t=55-this.v,n=new Gt(mr,this.r,yf(e),t);return this.networkV&&(n.#i=this.networkV),n}clone(){const e=new Gt(mr,this.r,this._s,this.v);return this.networkV&&(e.#i=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this._s,v:this.v}}[VR](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){const t=Re(e,"v");return t==wb||t==vb?_b:(V(t>=kl,"invalid EIP-155 v","v",e),(t-kl)/_f)}static getChainIdV(e,t){return Re(e)*_f+BigInt(35+t-27)}static getNormalizedV(e){const t=Re(e);return t===_b||t===wb?27:t===yb||t===vb?28:(V(t>=kl,"invalid v","v",e),t&yb?27:28)}static from(e){function t(l,h){V(l,h,"signature",e)}if(e==null)return new Gt(mr,Eb,Eb,27);if(typeof e=="string"){const l=lt(e,"signature");if(l.length===64){const h=Ce(l.slice(0,32)),u=l.slice(32,64),d=u[0]&128?28:27;return u[0]&=127,new Gt(mr,h,Ce(u),d)}if(l.length===65){const h=Ce(l.slice(0,32)),u=Ce(l.slice(32,64)),d=Gt.getNormalizedV(l[64]);return new Gt(mr,h,u,d)}t(!1,"invalid raw signature length")}if(e instanceof Gt)return e.clone();const n=e.r;t(n!=null,"missing r");const s=yf(n),r=(function(l,h){if(l!=null)return yf(l);if(h!=null){t(Ft(h,32),"invalid yParityAndS");const u=lt(h);return u[0]&=127,Ce(u)}t(!1,"missing s")})(e.s,e.yParityAndS),{networkV:a,v:o}=(function(l,h,u){if(l!=null){const d=Re(l);return{networkV:d>=kl?d:void 0,v:Gt.getNormalizedV(d)}}if(h!=null)return t(Ft(h,32),"invalid yParityAndS"),{v:lt(h)[0]&128?28:27};if(u!=null){switch(ht(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")})(e.v,e.yParityAndS,e.yParity),c=new Gt(mr,s,r,o);return a&&(c.#i=a),t(e.yParity==null||ht(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}}class cs{#e;constructor(e){V(Ca(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=Ce(e)}get privateKey(){return this.#e}get publicKey(){return cs.computePublicKey(this.#e)}get compressedPublicKey(){return cs.computePublicKey(this.#e,!0)}sign(e){V(Ca(e)===32,"invalid digest length","digest",e);const t=Ws.sign(Dn(e),Dn(this.#e),{lowS:!0});return Gt.from({r:Os(t.r,32),s:Os(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=cs.computePublicKey(e);return Ce(Ws.getSharedSecret(Dn(this.#e),lt(t),!1))}static computePublicKey(e,t){let n=lt(e,"key");if(n.length===32){const r=Ws.getPublicKey(n,!!t);return Ce(r)}if(n.length===64){const r=new Uint8Array(65);r[0]=4,r.set(n,1),n=r}const s=Ws.ProjectivePoint.fromHex(n);return Ce(s.toRawBytes(t))}static recoverPublicKey(e,t){V(Ca(e)===32,"invalid digest length","digest",e);const n=Gt.from(t);let s=Ws.Signature.fromCompact(Dn(Ut([n.r,n.s])));s=s.addRecoveryBit(n.yParity);const r=s.recoverPublicKey(Dn(e));return V(r!=null,"invalid signature for digest","signature",t),"0x"+r.toHex(!1)}static addPoints(e,t,n){const s=Ws.ProjectivePoint.fromHex(cs.computePublicKey(e).substring(2)),r=Ws.ProjectivePoint.fromHex(cs.computePublicKey(t).substring(2));return"0x"+s.add(r).toHex(!!n)}}const WR=BigInt(0),qR=BigInt(36);function Sb(i){i=i.toLowerCase();const e=i.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const n=lt($t(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const wf={};for(let i=0;i<10;i++)wf[String(i)]=String(i);for(let i=0;i<26;i++)wf[String.fromCharCode(65+i)]=String(10+i);const Ib=15;function KR(i){i=i.toUpperCase(),i=i.substring(4)+i.substring(0,2)+"00";let e=i.split("").map(n=>wf[n]).join("");for(;e.length>=Ib;){let n=e.substring(0,Ib);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const jR=(function(){const i={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];i[t]=BigInt(e)}return i})();function XR(i){i=i.toLowerCase();let e=WR;for(let t=0;t<i.length;t++)e=e*qR+jR[i[t]];return e}function Ct(i){if(V(typeof i=="string","invalid address","address",i),i.match(/^(0x)?[0-9a-fA-F]{40}$/)){i.startsWith("0x")||(i="0x"+i);const e=Sb(i);return V(!i.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===i,"bad address checksum","address",i),e}if(i.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){V(i.substring(2,4)===KR(i),"bad icap checksum","address",i);let e=XR(i.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Sb("0x"+e)}V(!1,"invalid address","address",i)}function YR(i){const e=Ct(i.from);let n=Re(i.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,Ct(Vt($t(ss([e,n])),12))}function Mb(i){return i&&typeof i.getAddress=="function"}async function vf(i,e){const t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(pe(typeof i!="string","unconfigured name","UNCONFIGURED_NAME",{value:i}),V(!1,"invalid AddressLike value; did not resolve to a value address","target",i)),Ct(t)}function Pn(i,e){if(typeof i=="string")return i.match(/^0x[0-9a-f]{40}$/i)?Ct(i):(pe(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),vf(i,e.resolveName(i)));if(Mb(i))return vf(i,i.getAddress());if(i&&typeof i.then=="function")return vf(i,i);V(!1,"unsupported addressable value","target",i)}const ls={};function Be(i,e){let t=!1;return e<0&&(t=!0,e*=-1),new Wt(ls,`${t?"":"u"}int${e}`,i,{signed:t,width:e})}function xt(i,e){return new Wt(ls,`bytes${e||""}`,i,{size:e})}const Bb=Symbol.for("_ethers_typed");class Wt{type;value;#e;_typedSymbol;constructor(e,t,n,s){s==null&&(s=null),Il(ls,e,"Typed"),Xe(this,{_typedSymbol:Bb,type:t,value:n}),this.#e=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new Wt(ls,e,t)}static uint8(e){return Be(e,8)}static uint16(e){return Be(e,16)}static uint24(e){return Be(e,24)}static uint32(e){return Be(e,32)}static uint40(e){return Be(e,40)}static uint48(e){return Be(e,48)}static uint56(e){return Be(e,56)}static uint64(e){return Be(e,64)}static uint72(e){return Be(e,72)}static uint80(e){return Be(e,80)}static uint88(e){return Be(e,88)}static uint96(e){return Be(e,96)}static uint104(e){return Be(e,104)}static uint112(e){return Be(e,112)}static uint120(e){return Be(e,120)}static uint128(e){return Be(e,128)}static uint136(e){return Be(e,136)}static uint144(e){return Be(e,144)}static uint152(e){return Be(e,152)}static uint160(e){return Be(e,160)}static uint168(e){return Be(e,168)}static uint176(e){return Be(e,176)}static uint184(e){return Be(e,184)}static uint192(e){return Be(e,192)}static uint200(e){return Be(e,200)}static uint208(e){return Be(e,208)}static uint216(e){return Be(e,216)}static uint224(e){return Be(e,224)}static uint232(e){return Be(e,232)}static uint240(e){return Be(e,240)}static uint248(e){return Be(e,248)}static uint256(e){return Be(e,256)}static uint(e){return Be(e,256)}static int8(e){return Be(e,-8)}static int16(e){return Be(e,-16)}static int24(e){return Be(e,-24)}static int32(e){return Be(e,-32)}static int40(e){return Be(e,-40)}static int48(e){return Be(e,-48)}static int56(e){return Be(e,-56)}static int64(e){return Be(e,-64)}static int72(e){return Be(e,-72)}static int80(e){return Be(e,-80)}static int88(e){return Be(e,-88)}static int96(e){return Be(e,-96)}static int104(e){return Be(e,-104)}static int112(e){return Be(e,-112)}static int120(e){return Be(e,-120)}static int128(e){return Be(e,-128)}static int136(e){return Be(e,-136)}static int144(e){return Be(e,-144)}static int152(e){return Be(e,-152)}static int160(e){return Be(e,-160)}static int168(e){return Be(e,-168)}static int176(e){return Be(e,-176)}static int184(e){return Be(e,-184)}static int192(e){return Be(e,-192)}static int200(e){return Be(e,-200)}static int208(e){return Be(e,-208)}static int216(e){return Be(e,-216)}static int224(e){return Be(e,-224)}static int232(e){return Be(e,-232)}static int240(e){return Be(e,-240)}static int248(e){return Be(e,-248)}static int256(e){return Be(e,-256)}static int(e){return Be(e,-256)}static bytes1(e){return xt(e,1)}static bytes2(e){return xt(e,2)}static bytes3(e){return xt(e,3)}static bytes4(e){return xt(e,4)}static bytes5(e){return xt(e,5)}static bytes6(e){return xt(e,6)}static bytes7(e){return xt(e,7)}static bytes8(e){return xt(e,8)}static bytes9(e){return xt(e,9)}static bytes10(e){return xt(e,10)}static bytes11(e){return xt(e,11)}static bytes12(e){return xt(e,12)}static bytes13(e){return xt(e,13)}static bytes14(e){return xt(e,14)}static bytes15(e){return xt(e,15)}static bytes16(e){return xt(e,16)}static bytes17(e){return xt(e,17)}static bytes18(e){return xt(e,18)}static bytes19(e){return xt(e,19)}static bytes20(e){return xt(e,20)}static bytes21(e){return xt(e,21)}static bytes22(e){return xt(e,22)}static bytes23(e){return xt(e,23)}static bytes24(e){return xt(e,24)}static bytes25(e){return xt(e,25)}static bytes26(e){return xt(e,26)}static bytes27(e){return xt(e,27)}static bytes28(e){return xt(e,28)}static bytes29(e){return xt(e,29)}static bytes30(e){return xt(e,30)}static bytes31(e){return xt(e,31)}static bytes32(e){return xt(e,32)}static address(e){return new Wt(ls,"address",e)}static bool(e){return new Wt(ls,"bool",!!e)}static bytes(e){return new Wt(ls,"bytes",e)}static string(e){return new Wt(ls,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Wt(ls,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===Bb}static dereference(e,t){if(Wt.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class JR extends as{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Wt.dereference(t,"string");try{n=Ct(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return Ct(Os(e.readValue(),20))}}class ZR extends as{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function Tb(i,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(l=>{const h=l.localName;return pe(h,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),pe(!c[h],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),c[h]=!0,t[h]})}else V(!1,"invalid tuple value","tuple",t);V(e.length===n.length,"types/value length mismatch","tuple",t);let s=new tf,r=new tf,a=[];e.forEach((c,l)=>{let h=n[l];if(c.dynamic){let u=r.length;c.encode(r,h);let d=s.writeUpdatableValue();a.push(f=>{d(f+u)})}else c.encode(s,h)}),a.forEach(c=>{c(s.length)});let o=i.appendWriter(s);return o+=i.appendWriter(r),o}function Rb(i,e){let t=[],n=[],s=i.subReader(0);return e.forEach(r=>{let a=null;if(r.dynamic){let o=i.readIndex(),c=s.subReader(o);try{a=r.decode(c)}catch(l){if(_n(l,"BUFFER_OVERRUN"))throw l;a=l,a.baseType=r.name,a.name=r.localName,a.type=r.type}}else try{a=r.decode(i)}catch(o){if(_n(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=r.name,a.name=r.localName,a.type=r.type}if(a==null)throw new Error("investigate");t.push(a),n.push(r.localName||null)}),rs.fromItems(t,n)}class $R extends as{coder;length;constructor(e,t,n){const s=e.type+"["+(t>=0?t:"")+"]",r=t===-1||e.dynamic;super("array",s,n,r),Xe(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){const n=Wt.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let s=this.length;s===-1&&(s=n.length,e.writeValue(n.length)),f0(n.length,s,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let a=0;a<n.length;a++)r.push(this.coder);return Tb(e,r,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),pe(t*Ln<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*Ln,length:e.dataLength}));let n=[];for(let s=0;s<t;s++)n.push(new ZR(this.coder));return Rb(e,n)}}class eN extends as{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const n=Wt.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class Nb extends as{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Dn(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class tN extends Nb{constructor(e){super("bytes",e)}decode(e){return Ce(super.decode(e))}}class nN extends as{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),Xe(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=Dn(Wt.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return Ce(e.readBytes(this.size))}}const iN=new Uint8Array([]);class sN extends as{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(iN)}decode(e){return e.readBytes(0),null}}const rN=BigInt(0),aN=BigInt(1),oN=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class cN extends as{size;signed;constructor(e,t,n){const s=(t?"int":"uint")+e*8;super(s,s,n,!1),Xe(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=Re(Wt.dereference(t,this.type)),s=Lo(oN,Ln*8);if(this.signed){let r=Lo(s,this.size*8-1);(n>r||n<-(r+aN))&&this._throwError("value out-of-bounds",t),n=m0(n,8*Ln)}else(n<rN||n>Lo(s,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=Lo(e.readValue(),this.size*8);return this.signed&&(t=gT(t,this.size*8)),t}}class lN extends Nb{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,is(Wt.dereference(t,"string")))}decode(e){return Bl(super.decode(e))}}class Ul extends as{coders;constructor(e,t){let n=!1;const s=[];e.forEach(a=>{a.dynamic&&(n=!0),s.push(a.type)});const r="tuple("+s.join(",")+")";super("tuple",r,t,n),Xe(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const t=this.coders.reduce((n,s)=>{const r=s.localName;return r&&(n[r]||(n[r]=0),n[r]++),n},{});return this.coders.forEach((n,s)=>{let r=n.localName;!r||t[r]!==1||(r==="length"&&(r="_length"),e[r]==null&&(e[r]=e[s]))}),Object.freeze(e)}encode(e,t){const n=Wt.dereference(t,"tuple");return Tb(e,this.coders,n)}decode(e){return Rb(e,this.coders)}}function Cf(i,e){return{address:Ct(i),storageKeys:e.map((t,n)=>(V(Ft(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function br(i){if(Array.isArray(i))return i.map((t,n)=>Array.isArray(t)?(V(t.length===2,"invalid slot set",`value[${n}]`,t),Cf(t[0],t[1])):(V(t!=null&&typeof t=="object","invalid address-slot set","value",i),Cf(t.address,t.storageKeys)));V(i!=null&&typeof i=="object","invalid access list","value",i);const e=Object.keys(i).map(t=>{const n=i[t].reduce((s,r)=>(s[r]=!0,s),{});return Cf(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function Fb(i){return{address:Ct(i.address),nonce:Re(i.nonce!=null?i.nonce:0),chainId:Re(i.chainId!=null?i.chainId:0),signature:Gt.from(i.signature)}}function hN(i){let e;return typeof i=="string"?e=cs.computePublicKey(i,!1):e=i.publicKey,Ct($t("0x"+e.substring(4)).substring(26))}function uN(i,e){return hN(cs.recoverPublicKey(i,e))}const gn=BigInt(0),dN=BigInt(2),fN=BigInt(27),pN=BigInt(28),AN=BigInt(35),gN=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),mN=Symbol.for("nodejs.util.inspect.custom"),Sf=4096*32,Ol=128;function bN(i){return{blobToKzgCommitment:n=>{if("computeBlobProof"in i){if("blobToKzgCommitment"in i&&typeof i.blobToKzgCommitment=="function")return lt(i.blobToKzgCommitment(Ce(n)))}else if("blobToKzgCommitment"in i&&typeof i.blobToKzgCommitment=="function")return lt(i.blobToKzgCommitment(n));if("blobToKZGCommitment"in i&&typeof i.blobToKZGCommitment=="function")return lt(i.blobToKZGCommitment(Ce(n)));V(!1,"unsupported KZG library","kzg",i)},computeBlobKzgProof:(n,s)=>{if("computeBlobProof"in i&&typeof i.computeBlobProof=="function")return lt(i.computeBlobProof(Ce(n),Ce(s)));if("computeBlobKzgProof"in i&&typeof i.computeBlobKzgProof=="function")return i.computeBlobKzgProof(n,s);if("computeBlobKZGProof"in i&&typeof i.computeBlobKZGProof=="function")return lt(i.computeBlobKZGProof(Ce(n),Ce(s)));V(!1,"unsupported KZG library","kzg",i)}}}function Db(i,e){let t=i.toString(16);for(;t.length<2;)t="0"+t;return t+=Ma(e).substring(4),"0x"+t}function Ra(i){return i==="0x"?null:Ct(i)}function Ql(i,e){try{return br(i)}catch(t){V(!1,t.message,e,i)}}function xN(i,e){try{if(!Array.isArray(i))throw new Error("authorizationList: invalid array");const t=[];for(let n=0;n<i.length;n++){const s=i[n];if(!Array.isArray(s))throw new Error(`authorization[${n}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${n}]: wrong length`);if(!s[1])throw new Error(`authorization[${n}]: null address`);t.push({address:Ra(s[1]),nonce:Tt(s[2],"nonce"),chainId:Tt(s[0],"chainId"),signature:Gt.from({yParity:xr(s[3],"yParity"),r:ns(s[4],32),s:ns(s[5],32)})})}return t}catch(t){V(!1,t.message,e,i)}}function xr(i,e){return i==="0x"?0:ht(i,e)}function Tt(i,e){if(i==="0x")return gn;const t=Re(i,e);return V(t<=gN,"value exceeds uint size",e,t),t}function gt(i,e){const t=Re(i,"value"),n=Zt(t);return V(n.length<=32,"value too large",`tx.${e}`,t),n}function Gl(i){return br(i).map(e=>[e.address,e.storageKeys])}function EN(i){return i.map(e=>[gt(e.chainId,"chainId"),e.address,gt(e.nonce,"nonce"),gt(e.signature.yParity,"yParity"),Zt(e.signature.r),Zt(e.signature._s)])}function _N(i,e){V(Array.isArray(i),`invalid ${e}`,"value",i);for(let t=0;t<i.length;t++)V(Ft(i[t],32),"invalid ${ param } hash",`value[${t}]`,i[t]);return i}function yN(i){const e=Po(i);V(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",i);const t={type:0,nonce:xr(e[0],"nonce"),gasPrice:Tt(e[1],"gasPrice"),gasLimit:Tt(e[2],"gasLimit"),to:Ra(e[3]),value:Tt(e[4],"value"),data:Ce(e[5]),chainId:gn};if(e.length===6)return t;const n=Tt(e[6],"v"),s=Tt(e[7],"r"),r=Tt(e[8],"s");if(s===gn&&r===gn)t.chainId=n;else{let a=(n-AN)/dN;a<gn&&(a=gn),t.chainId=a,V(a!==gn||n===fN||n===pN,"non-canonical legacy v","v",e[6]),t.signature=Gt.from({r:ns(e[7],32),s:ns(e[8],32),v:n})}return t}function wN(i,e){const t=[gt(i.nonce,"nonce"),gt(i.gasPrice||0,"gasPrice"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data];let n=gn;if(i.chainId!=gn)n=Re(i.chainId,"tx.chainId"),V(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(i.signature){const r=i.signature.legacyChainId;r!=null&&(n=r)}if(!e)return n!==gn&&(t.push(Zt(n)),t.push("0x"),t.push("0x")),ss(t);let s=BigInt(27+e.yParity);return n!==gn?s=Gt.getChainIdV(n,e.v):BigInt(e.v)!==s&&V(!1,"tx.chainId/sig.v mismatch","sig",e),t.push(Zt(s)),t.push(Zt(e.r)),t.push(Zt(e._s)),ss(t)}function Hl(i,e){let t;try{if(t=xr(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{V(!1,"invalid yParity","yParity",e[0])}const n=ns(e[1],32),s=ns(e[2],32),r=Gt.from({r:n,s,yParity:t});i.signature=r}function vN(i){const e=Po(lt(i).slice(1));V(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",Ce(i));const t={type:2,chainId:Tt(e[0],"chainId"),nonce:xr(e[1],"nonce"),maxPriorityFeePerGas:Tt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Tt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Tt(e[4],"gasLimit"),to:Ra(e[5]),value:Tt(e[6],"value"),data:Ce(e[7]),accessList:Ql(e[8],"accessList")};return e.length===9||Hl(t,e.slice(9)),t}function CN(i,e){const t=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gt(i.maxFeePerGas||0,"maxFeePerGas"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data,Gl(i.accessList||[])];return e&&(t.push(gt(e.yParity,"yParity")),t.push(Zt(e.r)),t.push(Zt(e.s))),Ut(["0x02",ss(t)])}function SN(i){const e=Po(lt(i).slice(1));V(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",Ce(i));const t={type:1,chainId:Tt(e[0],"chainId"),nonce:xr(e[1],"nonce"),gasPrice:Tt(e[2],"gasPrice"),gasLimit:Tt(e[3],"gasLimit"),to:Ra(e[4]),value:Tt(e[5],"value"),data:Ce(e[6]),accessList:Ql(e[7],"accessList")};return e.length===8||Hl(t,e.slice(8)),t}function IN(i,e){const t=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.gasPrice||0,"gasPrice"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data,Gl(i.accessList||[])];return e&&(t.push(gt(e.yParity,"recoveryParam")),t.push(Zt(e.r)),t.push(Zt(e.s))),Ut(["0x01",ss(t)])}function MN(i){let e=Po(lt(i).slice(1)),t="3",n=null,s=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";const a=e[1],o=e[2],c=e[3];V(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),V(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),V(Array.isArray(c),"invalid network format: proofs not an array","fields[3]",c),V(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),V(a.length===c.length,"invalid network format: blobs/proofs length mismatch","fields",e),s=[];for(let l=0;l<e[1].length;l++)s.push({data:a[l],commitment:o[l],proof:c[l]});e=e[0]}else if(e.length===5&&Array.isArray(e[0])){t="3 (EIP-7594 network format)",n=ht(e[1]);const a=e[2],o=e[3],c=e[4];V(n===1,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),V(Array.isArray(a),"invalid EIP-7594 network format: blobs not an array","fields[2]",a),V(Array.isArray(o),"invalid EIP-7594 network format: commitments not an array","fields[3]",o),V(Array.isArray(c),"invalid EIP-7594 network format: proofs not an array","fields[4]",c),V(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),V(a.length*Ol===c.length,"invalid network format: blobs/proofs length mismatch","fields",e),s=[];for(let l=0;l<a.length;l++){const h=[];for(let u=0;u<Ol;u++)h.push(c[l*Ol+u]);s.push({data:a[l],commitment:o[l],proof:Ut(h)})}e=e[0]}V(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",Ce(i));const r={type:3,chainId:Tt(e[0],"chainId"),nonce:xr(e[1],"nonce"),maxPriorityFeePerGas:Tt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Tt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Tt(e[4],"gasLimit"),to:Ra(e[5]),value:Tt(e[6],"value"),data:Ce(e[7]),accessList:Ql(e[8],"accessList"),maxFeePerBlobGas:Tt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10],blobWrapperVersion:n};s&&(r.blobs=s),V(r.to!=null,`invalid address for transaction type: ${t}`,"data",i),V(Array.isArray(r.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",i);for(let a=0;a<r.blobVersionedHashes.length;a++)V(Ft(r.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",i);return e.length===11||Hl(r,e.slice(11)),r}function BN(i,e,t){const n=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gt(i.maxFeePerGas||0,"maxFeePerGas"),gt(i.gasLimit,"gasLimit"),i.to||Ho,gt(i.value,"value"),i.data,Gl(i.accessList||[]),gt(i.maxFeePerBlobGas||0,"maxFeePerBlobGas"),_N(i.blobVersionedHashes||[],"blobVersionedHashes")];if(e&&(n.push(gt(e.yParity,"yParity")),n.push(Zt(e.r)),n.push(Zt(e.s)),t)){if(i.blobWrapperVersion!=null){const s=Zt(i.blobWrapperVersion),r=[];for(const{proof:a}of t){const o=lt(a),c=o.length/Ol;for(let l=0;l<o.length;l+=c)r.push(o.subarray(l,l+c))}return Ut(["0x03",ss([n,s,t.map(a=>a.data),t.map(a=>a.commitment),r])])}return Ut(["0x03",ss([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])])}return Ut(["0x03",ss(n)])}function TN(i){const e=Po(lt(i).slice(1));V(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",Ce(i));const t={type:4,chainId:Tt(e[0],"chainId"),nonce:xr(e[1],"nonce"),maxPriorityFeePerGas:Tt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Tt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Tt(e[4],"gasLimit"),to:Ra(e[5]),value:Tt(e[6],"value"),data:Ce(e[7]),accessList:Ql(e[8],"accessList"),authorizationList:xN(e[9],"authorizationList")};return e.length===10||Hl(t,e.slice(10)),t}function RN(i,e){const t=[gt(i.chainId,"chainId"),gt(i.nonce,"nonce"),gt(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gt(i.maxFeePerGas||0,"maxFeePerGas"),gt(i.gasLimit,"gasLimit"),i.to||"0x",gt(i.value,"value"),i.data,Gl(i.accessList||[]),EN(i.authorizationList||[])];return e&&(t.push(gt(e.yParity,"yParity")),t.push(Zt(e.r)),t.push(Zt(e.s))),Ut(["0x04",ss(t)])}class vi{#e;#t;#n;#i;#s;#a;#r;#o;#f;#l;#p;#A;#c;#h;#u;#d;#b;#g;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;case 4:case"pectra":case"eip-7702":this.#e=4;break;default:V(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#t;return e==null&&this.type===3?Ho:e}set to(e){this.#t=e==null?null:Ct(e)}get nonce(){return this.#i}set nonce(e){this.#i=ht(e,"value")}get gasLimit(){return this.#s}set gasLimit(e){this.#s=Re(e)}get gasPrice(){const e=this.#a;return e==null&&(this.type===0||this.type===1)?gn:e}set gasPrice(e){this.#a=e==null?null:Re(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#r;return e??(this.type===2||this.type===3?gn:null)}set maxPriorityFeePerGas(e){this.#r=e==null?null:Re(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#o;return e??(this.type===2||this.type===3?gn:null)}set maxFeePerGas(e){this.#o=e==null?null:Re(e,"maxFeePerGas")}get data(){return this.#n}set data(e){this.#n=Ce(e)}get value(){return this.#f}set value(e){this.#f=Re(e,"value")}get chainId(){return this.#l}set chainId(e){this.#l=Re(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:Gt.from(e)}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const t=this.authorizationList;if(t){for(const n of t)if(!n.signature.isValid())return!1}return!0}get accessList(){const e=this.#A||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#A=e==null?null:br(e)}get authorizationList(){const e=this.#b||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#b=e==null?null:e.map(t=>Fb(t))}get maxFeePerBlobGas(){const e=this.#c;return e==null&&this.type===3?gn:e}set maxFeePerBlobGas(e){this.#c=e==null?null:Re(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#h;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){V(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)V(Ft(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#h=e}get blobs(){return this.#d==null?null:this.#d.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#d=null;return}const t=[],n=[];for(let s=0;s<e.length;s++){const r=e[s];if(Yd(r)){pe(this.#u,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=lt(r);if(V(a.length<=Sf,"blob is too large",`blobs[${s}]`,r),a.length!==Sf){const l=new Uint8Array(Sf);l.set(a),a=l}const o=this.#u.blobToKzgCommitment(a),c=Ce(this.#u.computeBlobKzgProof(a,o));t.push({data:Ce(a),commitment:Ce(o),proof:c}),n.push(Db(1,o))}else{const a=Ce(r.data),o=Ce(r.commitment),c=Ce(r.proof);t.push({data:a,commitment:o,proof:c}),n.push(Db(1,o))}}this.#d=t,this.#h=n}get kzg(){return this.#u}set kzg(e){e==null?this.#u=null:this.#u=bN(e)}get blobWrapperVersion(){return this.#g}set blobWrapperVersion(e){this.#g=e}constructor(){this.#e=null,this.#t=null,this.#i=0,this.#s=gn,this.#a=null,this.#r=null,this.#o=null,this.#n="0x",this.#f=gn,this.#l=gn,this.#p=null,this.#A=null,this.#c=null,this.#h=null,this.#u=null,this.#d=null,this.#b=null,this.#g=null}get hash(){return this.signature==null?null:$t(this.#m(!0,!1))}get unsignedHash(){return $t(this.unsignedSerialized)}get from(){return this.signature==null?null:uN(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:cs.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#m(e,t){pe(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return wN(this,n);case 1:return IN(this,n);case 2:return CN(this,n);case 3:return BN(this,n,t?this.blobs:null);case 4:return RN(this,n)}pe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#m(!0,!0)}get unsignedSerialized(){return this.#m(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=this.#c!=null||this.#h;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&pe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),pe(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),pe(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const r=[];return this.type!=null?r.push(this.type):this.authorizationList&&this.authorizationList.length?r.push(4):t?r.push(2):e?(r.push(1),n||r.push(0)):n?(r.push(1),r.push(2)):(s&&this.to||(r.push(0),r.push(1),r.push(2)),r.push(3)),r.sort(),r}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return vi.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[mN](){return this.toString()}toString(){const e=[],t=s=>{let r=this[s];typeof r=="string"&&(r=JSON.stringify(r)),e.push(`${s}: ${r}`)};this.type&&t("type"),t("to"),t("data"),t("nonce"),t("gasLimit"),t("value"),this.chainId!=null&&t("chainId"),this.signature&&(t("from"),e.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const s=[];for(const r of n){const a=[];a.push(`address: ${JSON.stringify(r.address)}`),r.nonce!=null&&a.push(`nonce: ${r.nonce}`),r.chainId!=null&&a.push(`chainId: ${r.chainId}`),r.signature&&a.push(`signature: ${r.signature.toString()}`),s.push(`Authorization { ${a.join(", ")} }`)}e.push(`authorizations: [ ${s.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(e==null)return new vi;if(typeof e=="string"){const n=lt(e);if(n[0]>=127)return vi.from(yN(n));switch(n[0]){case 1:return vi.from(SN(n));case 2:return vi.from(vN(n));case 3:return vi.from(MN(n));case 4:return vi.from(TN(n))}pe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new vi;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Gt.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.authorizationList!=null&&(t.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobWrapperVersion!=null&&(t.blobWrapperVersion=e.blobWrapperVersion),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&(V(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),V(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(V(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),V(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}function Er(i){return $t(is(i))}var NN="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZ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mnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const Lb=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Pb=4;function FN(i){let e=0;function t(){return i[e++]<<8|i[e++]}let n=t(),s=1,r=[0,1];for(let M=1;M<n;M++)r.push(s+=t());let a=t(),o=e;e+=a;let c=0,l=0;function h(){return c==0&&(l=l<<8|i[e++],c=8),l>>--c&1}const u=31,d=2**u,f=d>>>1,m=f>>1,g=d-1;let A=0;for(let M=0;M<u;M++)A=A<<1|h();let p=[],y=0,b=d;for(;;){let M=Math.floor(((A-y+1)*s-1)/b),w=0,S=n;for(;S-w>1;){let v=w+S>>>1;M<r[v]?S=v:w=v}if(w==0)break;p.push(w);let T=y+Math.floor(b*r[w]/s),C=y+Math.floor(b*r[w+1]/s)-1;for(;((T^C)&f)==0;)A=A<<1&g|h(),T=T<<1&g,C=C<<1&g|1;for(;T&~C&m;)A=A&f|A<<1&g>>>1|h(),T=T<<1^f,C=(C^f)<<1|f|1;y=T,b=1+C-T}let _=n-4;return p.map(M=>{switch(M-_){case 3:return _+65792+(i[o++]<<16|i[o++]<<8|i[o++]);case 2:return _+256+(i[o++]<<8|i[o++]);case 1:return _+i[o++];default:return M-1}})}function DN(i){let e=0;return()=>i[e++]}function kb(i){return DN(FN(LN(i)))}function LN(i){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,r)=>e[s.charCodeAt(0)]=r);let t=i.length,n=new Uint8Array(6*t>>3);for(let s=0,r=0,a=0,o=0;s<t;s++)o=o<<6|e[i.charCodeAt(s)],a+=6,a>=8&&(n[r++]=o>>(a-=8));return n}function PN(i){return i&1?~i>>1:i>>1}function kN(i,e){let t=Array(i);for(let n=0,s=0;n<i;n++)t[n]=s+=PN(e());return t}function zo(i,e=0){let t=[];for(;;){let n=i(),s=i();if(!s)break;e+=n;for(let r=0;r<s;r++)t.push(e+r);e+=s+1}return t}function Ub(i){return Vo(()=>{let e=zo(i);if(e.length)return e})}function Ob(i){let e=[];for(;;){let t=i();if(t==0)break;e.push(UN(t,i))}for(;;){let t=i()-1;if(t<0)break;e.push(ON(t,i))}return e.flat()}function Vo(i){let e=[];for(;;){let t=i(e.length);if(!t)break;e.push(t)}return e}function Qb(i,e,t){let n=Array(i).fill().map(()=>[]);for(let s=0;s<e;s++)kN(i,t).forEach((r,a)=>n[a].push(r));return n}function UN(i,e){let t=1+e(),n=e(),s=Vo(e);return Qb(s.length,1+i,e).flatMap((a,o)=>{let[c,...l]=a;return Array(s[o]).fill().map((h,u)=>{let d=u*n;return[c+u*t,l.map(f=>f+d)]})})}function ON(i,e){let t=1+e();return Qb(t,1+i,e).map(s=>[s[0],s.slice(1)])}function QN(i){let e=[],t=zo(i);return s(n([]),[]),e;function n(r){let a=i(),o=Vo(()=>{let c=zo(i).map(l=>t[l]);if(c.length)return n(c)});return{S:a,B:o,Q:r}}function s({S:r,B:a},o,c){if(!(r&4&&c===o[o.length-1])){r&2&&(c=o[o.length-1]),r&1&&e.push(o);for(let l of a)for(let h of l.Q)s(l,[...o,h],c)}}}function GN(i){return i.toString(16).toUpperCase().padStart(2,"0")}function Gb(i){return`{${GN(i)}}`}function HN(i){let e=[];for(let t=0,n=i.length;t<n;){let s=i.codePointAt(t);t+=s<65536?1:2,e.push(s)}return e}function Na(i){let t=i.length;if(t<4096)return String.fromCodePoint(...i);let n=[];for(let s=0;s<t;)n.push(String.fromCodePoint(...i.slice(s,s+=4096)));return n.join("")}function zN(i,e){let t=i.length,n=t-e.length;for(let s=0;n==0&&s<t;s++)n=i[s]-e[s];return n}var VN="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ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B3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const Wo=44032,zl=4352,Vl=4449,Wl=4519,Hb=19,zb=21,Fa=28,ql=zb*Fa,WN=Hb*ql,qN=Wo+WN,KN=zl+Hb,jN=Vl+zb,XN=Wl+Fa;function qo(i){return i>>24&255}function Vb(i){return i&16777215}let If,Wb,Mf,Kl;function YN(){let i=kb(VN);If=new Map(Ub(i).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),Wb=new Set(zo(i)),Mf=new Map,Kl=new Map;for(let[e,t]of Ob(i)){if(!Wb.has(e)&&t.length==2){let[n,s]=t,r=Kl.get(n);r||(r=new Map,Kl.set(n,r)),r.set(s,e)}Mf.set(e,t.reverse())}}function qb(i){return i>=Wo&&i<qN}function JN(i,e){if(i>=zl&&i<KN&&e>=Vl&&e<jN)return Wo+(i-zl)*ql+(e-Vl)*Fa;if(qb(i)&&e>Wl&&e<XN&&(i-Wo)%Fa==0)return i+(e-Wl);{let t=Kl.get(i);return t&&(t=t.get(e),t)?t:-1}}function Kb(i){If||YN();let e=[],t=[],n=!1;function s(r){let a=If.get(r);a&&(n=!0,r|=a),e.push(r)}for(let r of i)for(;;){if(r<128)e.push(r);else if(qb(r)){let a=r-Wo,o=a/ql|0,c=a%ql/Fa|0,l=a%Fa;s(zl+o),s(Vl+c),l>0&&s(Wl+l)}else{let a=Mf.get(r);a?t.push(...a):s(r)}if(!t.length)break;r=t.pop()}if(n&&e.length>1){let r=qo(e[0]);for(let a=1;a<e.length;a++){let o=qo(e[a]);if(o==0||r<=o){r=o;continue}let c=a-1;for(;;){let l=e[c+1];if(e[c+1]=e[c],e[c]=l,!c||(r=qo(e[--c]),r<=o))break}r=qo(e[a])}}return e}function ZN(i){let e=[],t=[],n=-1,s=0;for(let r of i){let a=qo(r),o=Vb(r);if(n==-1)a==0?n=o:e.push(o);else if(s>0&&s>=a)a==0?(e.push(n,...t),t.length=0,n=o):t.push(o),s=a;else{let c=JN(n,o);c>=0?n=c:s==0&&a==0?(e.push(n),n=o):(t.push(o),s=a)}}return n>=0&&e.push(n,...t),e}function jb(i){return Kb(i).map(Vb)}function $N(i){return ZN(Kb(i))}const Xb=45,Yb=".",Jb=65039,Zb=1,jl=i=>Array.from(i);function Ko(i,e){return i.P.has(e)||i.Q.has(e)}class eF extends Array{get is_emoji(){return!0}}let Bf,$b,_r,Tf,ex,Da,Rf,La,yr,tx,Nf;function Ff(){if(Bf)return;let i=kb(NN);const e=()=>zo(i),t=()=>new Set(e()),n=(h,u)=>u.forEach(d=>h.add(d));Bf=new Map(Ob(i)),$b=t(),_r=e(),Tf=new Set(e().map(h=>_r[h])),_r=new Set(_r),ex=t(),t();let s=Ub(i),r=i();const a=()=>{let h=new Set;return e().forEach(u=>n(h,s[u])),n(h,e()),h};Da=Vo(h=>{let u=Vo(i).map(d=>d+96);if(u.length){let d=h>=r;u[0]-=32,u=Na(u),d&&(u=`Restricted[${u}]`);let f=a(),m=a(),g=!i();return{N:u,P:f,Q:m,M:g,R:d}}}),Rf=t(),La=new Map;let o=e().concat(jl(Rf)).sort((h,u)=>h-u);o.forEach((h,u)=>{let d=i(),f=o[u]=d?o[u-d]:{V:[],M:new Map};f.V.push(h),Rf.has(h)||La.set(h,f)});for(let{V:h,M:u}of new Set(La.values())){let d=[];for(let m of h){let g=Da.filter(p=>Ko(p,m)),A=d.find(({G:p})=>g.some(y=>p.has(y)));A||(A={G:new Set,V:[]},d.push(A)),A.V.push(m),n(A.G,g)}let f=d.flatMap(m=>jl(m.G));for(let{G:m,V:g}of d){let A=new Set(f.filter(p=>!m.has(p)));for(let p of g)u.set(p,A)}}yr=new Set;let c=new Set;const l=h=>yr.has(h)?c.add(h):yr.add(h);for(let h of Da){for(let u of h.P)l(u);for(let u of h.Q)l(u)}for(let h of yr)!La.has(h)&&!c.has(h)&&La.set(h,Zb);n(yr,jb(yr)),tx=QN(i).map(h=>eF.from(h)).sort(zN),Nf=new Map;for(let h of tx){let u=[Nf];for(let d of h){let f=u.map(m=>{let g=m.get(d);return g||(g=new Map,m.set(d,g)),g});d===Jb?u.push(...f):u=f}for(let d of u)d.V=h}}function Df(i){return(nx(i)?"":`${Lf(Xl([i]))} `)+Gb(i)}function Lf(i){return`"${i}"`}function tF(i){if(i.length>=4&&i[2]==Xb&&i[3]==Xb)throw new Error(`invalid label extension: "${Na(i.slice(0,4))}"`)}function nF(i){for(let t=i.lastIndexOf(95);t>0;)if(i[--t]!==95)throw new Error("underscore allowed only at start")}function iF(i){let e=i[0],t=Lb.get(e);if(t)throw jo(`leading ${t}`);let n=i.length,s=-1;for(let r=1;r<n;r++){e=i[r];let a=Lb.get(e);if(a){if(s==r)throw jo(`${t} + ${a}`);s=r+1,t=a}}if(s==n)throw jo(`trailing ${t}`)}function Xl(i,e=1/0,t=Gb){let n=[];sF(i[0])&&n.push("◌"),i.length>e&&(e>>=1,i=[...i.slice(0,e),8230,...i.slice(-e)]);let s=0,r=i.length;for(let a=0;a<r;a++){let o=i[a];nx(o)&&(n.push(Na(i.slice(s,a))),n.push(t(o)),s=a+1)}return n.push(Na(i.slice(s,r))),n.join("")}function sF(i){return Ff(),_r.has(i)}function nx(i){return Ff(),ex.has(i)}function rF(i){return lF(aF(i,$N,dF))}function aF(i,e,t){if(!i)return[];Ff();let n=0;return i.split(Yb).map(s=>{let r=HN(s),a={input:r,offset:n};n+=r.length+1;try{let o=a.tokens=uF(r,e,t),c=o.length,l;if(!c)throw new Error("empty label");let h=a.output=o.flat();if(nF(h),!(a.emoji=c>1||o[0].is_emoji)&&h.every(d=>d<128))tF(h),l="ASCII";else{let d=o.flatMap(f=>f.is_emoji?[]:f);if(!d.length)l="Emoji";else{if(_r.has(h[0]))throw jo("leading combining mark");for(let g=1;g<c;g++){let A=o[g];if(!A.is_emoji&&_r.has(A[0]))throw jo(`emoji + combining mark: "${Na(o[g-1])} + ${Xl([A[0]])}"`)}iF(h);let f=jl(new Set(d)),[m]=cF(f);hF(m,d),oF(m,f),l=m.N}}a.type=l}catch(o){a.error=o}return a})}function oF(i,e){let t,n=[];for(let s of e){let r=La.get(s);if(r===Zb)return;if(r){let a=r.M.get(s);if(t=t?t.filter(o=>a.has(o)):jl(a),!t.length)return}else n.push(s)}if(t){for(let s of t)if(n.every(r=>Ko(s,r)))throw new Error(`whole-script confusable: ${i.N}/${s.N}`)}}function cF(i){let e=Da;for(let t of i){let n=e.filter(s=>Ko(s,t));if(!n.length)throw Da.some(s=>Ko(s,t))?sx(e[0],t):ix(t);if(e=n,n.length==1)break}return e}function lF(i){return i.map(({input:e,error:t,output:n})=>{if(t){let s=t.message;throw new Error(i.length==1?s:`Invalid label ${Lf(Xl(e,63))}: ${s}`)}return Na(n)}).join(Yb)}function ix(i){return new Error(`disallowed character: ${Df(i)}`)}function sx(i,e){let t=Df(e),n=Da.find(s=>s.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${i.N} + ${t}`)}function jo(i){return new Error(`illegal placement: ${i}`)}function hF(i,e){for(let t of e)if(!Ko(i,t))throw sx(i,t);if(i.M){let t=jb(e);for(let n=1,s=t.length;n<s;n++)if(Tf.has(t[n])){let r=n+1;for(let a;r<s&&Tf.has(a=t[r]);r++)for(let o=n;o<r;o++)if(t[o]==a)throw new Error(`duplicate non-spacing marks: ${Df(a)}`);if(r-n>Pb)throw new Error(`excessive non-spacing marks: ${Lf(Xl(t.slice(n-1,r)))} (${r-n}/${Pb})`);n=r}}}function uF(i,e,t){let n=[],s=[];for(i=i.slice().reverse();i.length;){let r=fF(i);if(r)s.length&&(n.push(e(s)),s=[]),n.push(t(r));else{let a=i.pop();if(yr.has(a))s.push(a);else{let o=Bf.get(a);if(o)s.push(...o);else if(!$b.has(a))throw ix(a)}}}return s.length&&n.push(e(s)),n}function dF(i){return i.filter(e=>e!=Jb)}function fF(i,e){let t=Nf,n,s=i.length;for(;s&&(t=t.get(i[--s]),!!t);){let{V:r}=t;r&&(n=r,i.length=s)}return n}const rx=new Uint8Array(32);rx.fill(0);function ax(i){return V(i.length!==0,"invalid ENS name; empty component","comp",i),i}function ox(i){const e=is(pF(i)),t=[];if(i.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(ax(e.slice(n,s))),n=s+1);return V(n<e.length,"invalid ENS name; empty component","name",i),t.push(ax(e.slice(n))),t}function pF(i){try{if(i.length===0)throw new Error("empty label");return rF(i)}catch(e){V(!1,`invalid ENS name (${e.message})`,"name",i)}}function Pf(i){V(typeof i=="string","invalid ENS name; not a string","name",i),V(i.length,"invalid ENS name (empty label)","name",i);let e=rx;const t=ox(i);for(;t.length;)e=$t(Ut([e,$t(t.pop())]));return Ce(e)}function AF(i,e){const t=e;return V(t<=255,"DNS encoded label cannot exceed 255","length",t),Ce(Ut(ox(i).map(n=>{V(n.length<=t,`label ${JSON.stringify(i)} exceeds ${t} bytes`,"name",i);const s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}const cx=new Uint8Array(32);cx.fill(0);const gF=BigInt(-1),lx=BigInt(0),hx=BigInt(1),mF=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function bF(i){const e=lt(i),t=e.length%32;return t?Ut([e,cx.slice(t)]):Ce(e)}const xF=Os(hx,32),EF=Os(lx,32),ux={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},kf=["name","version","chainId","verifyingContract","salt"];function dx(i){return function(e){return V(typeof e=="string",`invalid domain value for ${JSON.stringify(i)}`,`domain.${i}`,e),e}}const _F={name:dx("name"),version:dx("version"),chainId:function(i){const e=Re(i,"domain.chainId");return V(e>=0,"invalid chain ID","domain.chainId",i),Number.isSafeInteger(e)?Number(e):yi(e)},verifyingContract:function(i){try{return Ct(i).toLowerCase()}catch{}V(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",i)},salt:function(i){const e=lt(i,"domain.salt");return V(e.length===32,'invalid domain value "salt"',"domain.salt",i),Ce(e)}};function Uf(i){{const e=i.match(/^(u?)int(\d+)$/);if(e){const t=e[1]==="",n=parseInt(e[2]);V(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",i);const s=Lo(mF,t?n-1:n),r=t?(s+hx)*gF:lx;return function(a){const o=Re(a,"value");return V(o>=r&&o<=s,`value out-of-bounds for ${i}`,"value",o),Os(t?m0(o,256):o,32)}}}{const e=i.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return V(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",i),function(n){const s=lt(n);return V(s.length===t,`invalid length for ${i}`,"value",n),bF(n)}}}switch(i){case"address":return function(e){return ns(Ct(e),32)};case"bool":return function(e){return e?xF:EF};case"bytes":return function(e){return $t(e)};case"string":return function(e){return Er(e)}}return null}function fx(i,e){return`${i}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function Yl(i){const e=i.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:i}}class Kn{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#n;constructor(e){this.#t=new Map,this.#n=new Map;const t=new Map,n=new Map,s=new Map,r={};Object.keys(e).forEach(c=>{r[c]=e[c].map(({name:l,type:h})=>{let{base:u,index:d}=Yl(h);return u==="int"&&!e.int&&(u="int256"),u==="uint"&&!e.uint&&(u="uint256"),{name:l,type:u+(d||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),this.#e=JSON.stringify(r);for(const c in r){const l=new Set;for(const h of r[c]){V(!l.has(h.name),`duplicate variable name ${JSON.stringify(h.name)} in ${JSON.stringify(c)}`,"types",e),l.add(h.name);const u=Yl(h.type).base;V(u!==c,`circular type reference to ${JSON.stringify(u)}`,"types",e),!Uf(u)&&(V(n.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),n.get(u).push(c),t.get(c).add(u))}}const a=Array.from(n.keys()).filter(c=>n.get(c).length===0);V(a.length!==0,"missing primary type","types",e),V(a.length===1,`ambiguous primary types or unused types: ${a.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Xe(this,{primaryType:a[0]});function o(c,l){V(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const h of t.get(c))if(n.has(h)){o(h,l);for(const u of l)s.get(u).add(h)}l.delete(c)}o(this.primaryType,new Set);for(const[c,l]of s){const h=Array.from(l);h.sort(),this.#t.set(c,fx(c,r[c])+h.map(u=>fx(u,r[u])).join(""))}}getEncoder(e){let t=this.#n.get(e);return t||(t=this.#i(e),this.#n.set(e,t)),t}#i(e){{const s=Uf(e);if(s)return s}const t=Yl(e).array;if(t){const s=t.prefix,r=this.getEncoder(s);return a=>{V(t.count===-1||t.count===a.length,`array length mismatch; expected length ${t.count}`,"value",a);let o=a.map(r);return this.#t.has(s)&&(o=o.map($t)),$t(Ut(o))}}const n=this.types[e];if(n){const s=Er(this.#t.get(e));return r=>{const a=n.map(({name:o,type:c})=>{const l=this.getEncoder(c)(r[o]);return this.#t.has(c)?$t(l):l});return a.unshift(s),Ut(a)}}V(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#t.get(e);return V(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return $t(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Uf(e))return n(e,t);const s=Yl(e).array;if(s)return V(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(a=>this._visit(s.prefix,a,n));const r=this.types[e];if(r)return r.reduce((a,{name:o,type:c})=>(a[o]=this._visit(c,t[o],n),a),{});V(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Kn(e)}static getPrimaryType(e){return Kn.from(e).primaryType}static hashStruct(e,t,n){return Kn.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(e[n]==null)continue;const s=ux[n];V(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>kf.indexOf(n.name)-kf.indexOf(s.name)),Kn.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Ut(["0x1901",Kn.hashDomain(e),Kn.from(t).hash(n)])}static hash(e,t,n){return $t(Kn.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const r={};e.verifyingContract&&!Ft(e.verifyingContract,20)&&(r[e.verifyingContract]="0x");const a=Kn.from(t);a.visit(n,(o,c)=>(o==="address"&&!Ft(c,20)&&(r[c]="0x"),c));for(const o in r)r[o]=await s(o);return e.verifyingContract&&r[e.verifyingContract]&&(e.verifyingContract=r[e.verifyingContract]),n=a.visit(n,(o,c)=>o==="address"&&r[c]?r[c]:c),{domain:e,value:n}}static getPayload(e,t,n){Kn.hashDomain(e);const s={},r=[];kf.forEach(c=>{const l=e[c];l!=null&&(s[c]=_F[c](l),r.push({name:c,type:ux[c]}))});const a=Kn.from(t);t=a.types;const o=Object.assign({},t);return V(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=r,a.encode(n),{types:o,domain:s,primaryType:a.primaryType,message:a.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Ce(lt(l));if(c.match(/^u?int/))return Re(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return V(typeof l=="string","invalid string","value",l),l}V(!1,"unsupported type","type",c)})}}}function kn(i){const e=new Set;return i.forEach(t=>e.add(t)),Object.freeze(e)}const yF=kn("external public payable override".split(" ")),px="constant external internal payable private public pure view override",wF=kn(px.split(" ")),Ax="constructor error event fallback function receive struct",gx=kn(Ax.split(" ")),mx="calldata memory storage payable indexed",vF=kn(mx.split(" ")),CF=[Ax,mx,"tuple returns",px].join(" "),SF=kn(CF.split(" ")),IF={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},MF=new RegExp("^(\\s*)"),BF=new RegExp("^([0-9]+)"),TF=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),bx=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),xx=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class ai{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new ai(this.#t)}reset(){this.#e=0}#n(e=0,t=0){return new ai(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=this.#n(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;this.#e<e.match-1;){const n=this.peek().linkNext;t.push(this.#n(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let t=this.#e;t<this.#t.length;t++){const n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}}function qs(i){const e=[],t=a=>{const o=r<i.length?JSON.stringify(i[r]):"$EOI";throw new Error(`invalid token ${o} at ${r}: ${a}`)};let n=[],s=[],r=0;for(;r<i.length;){let a=i.substring(r),o=a.match(MF);o&&(r+=o[1].length,a=i.substring(r));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:r,value:-1};e.push(c);let l=IF[a[0]]||"";if(l){if(c.type=l,c.text=a[0],r++,l==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(l=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(l==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let h=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;h=u+h,e[e.length-1].value=ht(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=h}continue}if(o=a.match(TF),o){if(c.text=o[1],r+=c.text.length,SF.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(xx)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(BF),o){c.text=o[1],c.type="NUMBER",r+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${r}`)}return new ai(e.map(a=>Object.freeze(a)))}function Ex(i,e){let t=[];for(const n in e.keys())i.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function Jl(i,e){if(e.peekKeyword(gx)){const t=e.pop().text;if(t!==i)throw new Error(`expected ${i}, got ${t}`)}return e.popType("ID")}function hs(i,e){const t=new Set;for(;;){const n=i.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(i.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function _x(i){let e=hs(i,wF);return Ex(e,kn("constant payable nonpayable".split(" "))),Ex(e,kn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function us(i,e){return i.popParams().map(t=>Dt.from(t,e))}function yx(i){if(i.peekType("AT")){if(i.pop(),i.peekType("NUMBER"))return Re(i.pop().text);throw new Error("invalid gas")}return null}function wr(i){if(i.length)throw new Error(`unexpected tokens at offset ${i.offset}: ${i.toString()}`)}const RF=new RegExp(/^(.*)\[([0-9]*)\]$/);function wx(i){const e=i.match(xx);if(V(e,"invalid type","type",i),i==="uint")return"uint256";if(i==="int")return"int256";if(e[2]){const t=parseInt(e[2]);V(t!==0&&t<=32,"invalid bytes length","type",i)}else if(e[3]){const t=parseInt(e[3]);V(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",i)}return i}const Ht={},Hn=Symbol.for("_ethers_internal"),vx="_ParamTypeInternal",Cx="_ErrorInternal",Sx="_EventInternal",Ix="_ConstructorInternal",Mx="_FallbackInternal",Bx="_FunctionInternal",Tx="_StructInternal";class Dt{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,s,r,a,o,c){if(Il(e,Ht,"ParamType"),Object.defineProperty(this,Hn,{value:vx}),a&&(a=Object.freeze(a.slice())),s==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Xe(this,{name:t,type:n,baseType:s,indexed:r,components:a,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const r=JSON.parse(this.arrayChildren.format("json"));return r.name=n,r.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(r)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(r=>JSON.parse(r.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(s=>n.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((s,r)=>n.components[r].walk(s,t))}return t(this.type,e)}#e(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=t.slice();o.forEach((c,l)=>{a.#e(e,c,n,h=>{o[l]=h})}),s(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,l)=>{a[l].#e(e,c,n,h=>{o[l]=h})}),s(o);return}const r=n(this.type,t);r.then?e.push((async function(){s(await r)})()):s(r)}async walkAsync(e,t){const n=[],s=[e];return this.#e(n,e,t,r=>{s[0]=r}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(Dt.isParamType(e))return e;if(typeof e=="string")try{return Dt.from(qs(e),t)}catch{V(!1,"invalid param type","obj",e)}else if(e instanceof ai){let o="",c="",l=null;hs(e,kn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(g=>Dt.from(g)),o=`tuple(${l.map(g=>g.format()).join(",")})`):(o=wx(e.popType("TYPE")),c=o);let h=null,u=null;for(;e.length&&e.peekType("BRACKET");){const g=e.pop();h=new Dt(Ht,"",o,c,null,l,u,h),u=g.value,o+=g.text,c="array",l=null}let d=null;if(hs(e,vF).has("indexed")){if(!t)throw new Error("");d=!0}const m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Dt(Ht,m,o,c,d,l,u,h)}const n=e.name;V(!n||typeof n=="string"&&n.match(bx),"invalid name","obj.name",n);let s=e.indexed;s!=null&&(V(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let r=e.type,a=r.match(RF);if(a){const o=parseInt(a[2]||"-1"),c=Dt.from({type:a[1],components:e.components});return new Dt(Ht,n||"",r,"array",s,null,o,c)}if(r==="tuple"||r.startsWith("tuple(")||r.startsWith("(")){const o=e.components!=null?e.components.map(l=>Dt.from(l)):null;return new Dt(Ht,n||"",r,"tuple",s,o,null,null)}return r=wx(e.type),new Dt(Ht,n||"",r,r,s,null,null,null)}static isParamType(e){return e&&e[Hn]===vx}}class vr{type;inputs;constructor(e,t,n){Il(e,Ht,"Fragment"),n=Object.freeze(n.slice()),Xe(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{vr.from(JSON.parse(e))}catch{}return vr.from(qs(e))}if(e instanceof ai)switch(e.peekKeyword(gx)){case"constructor":return ds.from(e);case"error":return zn.from(e);case"event":return Ui.from(e);case"fallback":case"receive":return fs.from(e);case"function":return Oi.from(e);case"struct":return Cr.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return ds.from(e);case"error":return zn.from(e);case"event":return Ui.from(e);case"fallback":case"receive":return fs.from(e);case"function":return Oi.from(e);case"struct":return Cr.from(e)}pe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}V(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return ds.isFragment(e)}static isError(e){return zn.isFragment(e)}static isEvent(e){return Ui.isFragment(e)}static isFunction(e){return Oi.isFragment(e)}static isStruct(e){return Cr.isFragment(e)}}class Zl extends vr{name;constructor(e,t,n,s){super(e,t,s),V(typeof n=="string"&&n.match(bx),"invalid identifier","name",n),s=Object.freeze(s.slice()),Xe(this,{name:n})}}function Xo(i,e){return"("+e.map(t=>t.format(i)).join(i==="full"?", ":",")+")"}class zn extends Zl{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,Hn,{value:Cx})}get selector(){return Er(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Xo(e,this.inputs)),t.join(" ")}static from(e){if(zn.isFragment(e))return e;if(typeof e=="string")return zn.from(qs(e));if(e instanceof ai){const t=Jl("error",e),n=us(e);return wr(e),new zn(Ht,t,n)}return new zn(Ht,e.name,e.inputs?e.inputs.map(Dt.from):[])}static isFragment(e){return e&&e[Hn]===Cx}}class Ui extends Zl{anonymous;constructor(e,t,n,s){super(e,"event",t,n),Object.defineProperty(this,Hn,{value:Sx}),Xe(this,{anonymous:s})}get topicHash(){return Er(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Xo(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(s=>Dt.from(s)),new Ui(Ht,e,t,!1).topicHash}static from(e){if(Ui.isFragment(e))return e;if(typeof e=="string")try{return Ui.from(qs(e))}catch{V(!1,"invalid event fragment","obj",e)}else if(e instanceof ai){const t=Jl("event",e),n=us(e,!0),s=!!hs(e,kn(["anonymous"])).has("anonymous");return wr(e),new Ui(Ht,t,n,s)}return new Ui(Ht,e.name,e.inputs?e.inputs.map(t=>Dt.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Hn]===Sx}}class ds extends vr{payable;gas;constructor(e,t,n,s,r){super(e,t,n),Object.defineProperty(this,Hn,{value:Ix}),Xe(this,{payable:s,gas:r})}format(e){if(pe(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[`constructor${Xo(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(ds.isFragment(e))return e;if(typeof e=="string")try{return ds.from(qs(e))}catch{V(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof ai){hs(e,kn(["constructor"]));const t=us(e),n=!!hs(e,yF).has("payable"),s=yx(e);return wr(e),new ds(Ht,"constructor",t,n,s)}return new ds(Ht,"constructor",e.inputs?e.inputs.map(Dt.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Hn]===Ix}}class fs extends vr{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,Hn,{value:Mx}),Xe(this,{payable:n})}format(e){const t=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(fs.isFragment(e))return e;if(typeof e=="string")try{return fs.from(qs(e))}catch{V(!1,"invalid fallback fragment","obj",e)}else if(e instanceof ai){const t=e.toString(),n=e.peekKeyword(kn(["fallback","receive"]));if(V(n,"type must be fallback or receive","obj",t),e.popKeyword(kn(["fallback","receive"]))==="receive"){const o=us(e);return V(o.length===0,"receive cannot have arguments","obj.inputs",o),hs(e,kn(["payable"])),wr(e),new fs(Ht,[],!0)}let r=us(e);r.length?V(r.length===1&&r[0].type==="bytes","invalid fallback inputs","obj.inputs",r.map(o=>o.format("minimal")).join(", ")):r=[Dt.from("bytes")];const a=_x(e);if(V(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),hs(e,kn(["returns"])).has("returns")){const o=us(e);V(o.length===1&&o[0].type==="bytes","invalid fallback outputs","obj.outputs",o.map(c=>c.format("minimal")).join(", "))}return wr(e),new fs(Ht,r,a==="payable")}if(e.type==="receive")return new fs(Ht,[],!0);if(e.type==="fallback"){const t=[Dt.from("bytes")],n=e.stateMutability==="payable";return new fs(Ht,t,n)}V(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Hn]===Mx}}class Oi extends Zl{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,s,r,a){super(e,"function",t,s),Object.defineProperty(this,Hn,{value:Bx}),r=Object.freeze(r.slice()),Xe(this,{constant:n==="view"||n==="pure",gas:a,outputs:r,payable:n==="payable",stateMutability:n})}get selector(){return Er(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Xo(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Xo(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(s=>Dt.from(s)),new Oi(Ht,e,"view",t,[],null).selector}static from(e){if(Oi.isFragment(e))return e;if(typeof e=="string")try{return Oi.from(qs(e))}catch{V(!1,"invalid function fragment","obj",e)}else if(e instanceof ai){const n=Jl("function",e),s=us(e),r=_x(e);let a=[];hs(e,kn(["returns"])).has("returns")&&(a=us(e));const o=yx(e);return wr(e),new Oi(Ht,n,r,s,a,o)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new Oi(Ht,e.name,t,e.inputs?e.inputs.map(Dt.from):[],e.outputs?e.outputs.map(Dt.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Hn]===Bx}}class Cr extends Zl{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,Hn,{value:Tx})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Cr.from(qs(e))}catch{V(!1,"invalid struct fragment","obj",e)}else if(e instanceof ai){const t=Jl("struct",e),n=us(e);return wr(e),new Cr(Ht,t,n)}return new Cr(Ht,e.name,e.inputs?e.inputs.map(Dt.from):[])}static isFragment(e){return e&&e[Hn]===Tx}}const Ci=new Map;Ci.set(0,"GENERIC_PANIC"),Ci.set(1,"ASSERT_FALSE"),Ci.set(17,"OVERFLOW"),Ci.set(18,"DIVIDE_BY_ZERO"),Ci.set(33,"ENUM_RANGE_ERROR"),Ci.set(34,"BAD_STORAGE_DATA"),Ci.set(49,"STACK_UNDERFLOW"),Ci.set(50,"ARRAY_RANGE_ERROR"),Ci.set(65,"OUT_OF_MEMORY"),Ci.set(81,"UNINITIALIZED_FUNCTION_CALL");const NF=new RegExp(/^bytes([0-9]*)$/),FF=new RegExp(/^(u?int)([0-9]*)$/);let Of=null,Rx=1024;function DF(i,e,t,n){let s="missing revert data",r=null;const a=null;let o=null;if(t){s="execution reverted";const l=lt(t);if(t=Ce(t),l.length===0)s+=" (no data present; likely require(false) occurred",r="require(false)";else if(l.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(Ce(l.slice(0,4))==="0x08c379a0")try{r=n.decode(["string"],l.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[r]},s+=`: ${JSON.stringify(r)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(Ce(l.slice(0,4))==="0x4e487b71")try{const h=Number(n.decode(["uint256"],l.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[h]},r=`Panic due to ${Ci.get(h)||"UNKNOWN"}(${h})`,s+=`: ${r}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const c={to:e.to?Ct(e.to):null,data:e.data||"0x"};return e.from&&(c.from=Ct(e.from)),Qt(s,"CALL_EXCEPTION",{action:i,data:t,reason:r,transaction:c,invocation:a,revert:o})}class Pa{#e(e){if(e.isArray())return new $R(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ul(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new JR(e.name);case"bool":return new eN(e.name);case"string":return new lN(e.name);case"bytes":return new tN(e.name);case"":return new sN(e.name)}let t=e.type.match(FF);if(t){let n=parseInt(t[2]||"256");return V(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new cN(n/8,t[1]==="int",e.name)}if(t=e.type.match(NF),t){let n=parseInt(t[1]);return V(n!==0&&n<=32,"invalid bytes length","param",e),new nN(n,e.name)}V(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(s=>this.#e(Dt.from(s)));return new Ul(t,"_").defaultValue()}encode(e,t){f0(t.length,e.length,"types/values length mismatch");const n=e.map(a=>this.#e(Dt.from(a))),s=new Ul(n,"_"),r=new tf;return s.encode(r,t),r.data}decode(e,t,n){const s=e.map(a=>this.#e(Dt.from(a)));return new Ul(s,"_").decode(new nf(t,n,Rx))}static _setDefaultMaxInflation(e){V(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Rx=e}static defaultAbiCoder(){return Of==null&&(Of=new Pa),Of}static getBuiltinCallException(e,t,n){return DF(e,t,n,Pa.defaultAbiCoder())}}class LF{fragment;name;signature;topic;args;constructor(e,t,n){const s=e.name,r=e.format();Xe(this,{fragment:e,name:s,signature:r,topic:t,args:n})}}class PF{fragment;name;args;signature;selector;value;constructor(e,t,n,s){const r=e.name,a=e.format();Xe(this,{fragment:e,name:r,args:n,signature:a,selector:t,value:s})}}class kF{fragment;name;args;signature;selector;constructor(e,t,n){const s=e.name,r=e.format();Xe(this,{fragment:e,name:s,args:n,signature:r,selector:t})}}class Nx{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){Xe(this,{hash:e,_isIndexed:!0})}}const Fx={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Dx={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:i=>`reverted with reason string ${JSON.stringify(i)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:i=>{let e="unknown panic code";return i>=0&&i<=255&&Fx[i.toString()]&&(e=Fx[i.toString()]),`reverted with panic code 0x${i.toString(16)} (${e})`}}};class Sr{fragments;deploy;fallback;receive;#e;#t;#n;#i;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#n=new Map,this.#e=new Map,this.#t=new Map;const n=[];for(const a of t)try{n.push(vr.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}Xe(this,{fragments:Object.freeze(n)});let s=null,r=!1;this.#i=this.getAbiCoder(),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Xe(this,{deploy:a});return;case"fallback":a.inputs.length===0?r=!0:(V(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${o}]`,a),s=a,r=s.payable);return;case"function":c=this.#n;break;case"event":c=this.#t;break;case"error":c=this.#e;break;default:return}const l=a.format();c.has(l)||c.set(l,a)}),this.deploy||Xe(this,{deploy:ds.from("constructor()")}),Xe(this,{fallback:s,receive:r})}format(e){const t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Pa.defaultAbiCoder()}#s(e,t,n){if(Ft(e)){const r=e.toLowerCase();for(const a of this.#n.values())if(r===a.selector)return a;return null}if(e.indexOf("(")===-1){const r=[];for(const[a,o]of this.#n)a.split("(")[0]===e&&r.push(o);if(t){const a=t.length>0?t[t.length-1]:null;let o=t.length,c=!0;Wt.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let l=r.length-1;l>=0;l--){const h=r[l].inputs.length;h!==o&&(!c||h!==o-1)&&r.splice(l,1)}for(let l=r.length-1;l>=0;l--){const h=r[l].inputs;for(let u=0;u<t.length;u++)if(Wt.isTyped(t[u])){if(u>=h.length){if(t[u].type==="overrides")continue;r.splice(l,1);break}if(t[u].type!==h[u].baseType){r.splice(l,1);break}}}}if(r.length===1&&t&&t.length!==r[0].inputs.length){const a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&r.splice(0,1)}if(r.length===0)return null;if(r.length>1&&n){const a=r.map(o=>JSON.stringify(o.format())).join(", ");V(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return r[0]}const s=this.#n.get(Oi.from(e).format());return s||null}getFunctionName(e){const t=this.#s(e,null,!1);return V(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#s(e,null,!1)}getFunction(e,t){return this.#s(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#n.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){const s=t[n];e(this.#n.get(s),n)}}#a(e,t,n){if(Ft(e)){const r=e.toLowerCase();for(const a of this.#t.values())if(r===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const r=[];for(const[a,o]of this.#t)a.split("(")[0]===e&&r.push(o);if(t){for(let a=r.length-1;a>=0;a--)r[a].inputs.length<t.length&&r.splice(a,1);for(let a=r.length-1;a>=0;a--){const o=r[a].inputs;for(let c=0;c<t.length;c++)if(Wt.isTyped(t[c])&&t[c].type!==o[c].baseType){r.splice(a,1);break}}}if(r.length===0)return null;if(r.length>1&&n){const a=r.map(o=>JSON.stringify(o.format())).join(", ");V(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return r[0]}const s=this.#t.get(Ui.from(e).format());return s||null}getEventName(e){const t=this.#a(e,null,!1);return V(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#a(e,null,!1)}getEvent(e,t){return this.#a(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#t.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){const s=t[n];e(this.#t.get(s),n)}}getError(e,t){if(Ft(e)){const s=e.toLowerCase();if(Dx[s])return zn.from(Dx[s].signature);for(const r of this.#e.values())if(s===r.selector)return r;return null}if(e.indexOf("(")===-1){const s=[];for(const[r,a]of this.#e)r.split("(")[0]===e&&s.push(a);if(s.length===0)return e==="Error"?zn.from("error Error(string)"):e==="Panic"?zn.from("error Panic(uint256)"):null;if(s.length>1){const r=s.map(a=>JSON.stringify(a.format())).join(", ");V(!1,`ambiguous error description (i.e. ${r})`,"name",e)}return s[0]}if(e=zn.from(e).format(),e==="Error(string)")return zn.from("error Error(string)");if(e==="Panic(uint256)")return zn.from("error Panic(uint256)");const n=this.#e.get(e);return n||null}forEachError(e){const t=Array.from(this.#e.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){const s=t[n];e(this.#e.get(s),n)}}_decodeParams(e,t){return this.#i.decode(e,t)}_encodeParams(e,t){return this.#i.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);V(n,"unknown error","fragment",e),e=n}return V(Vt(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,Vt(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);V(n,"unknown error","fragment",e),e=n}return Ut([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);V(n,"unknown function","fragment",e),e=n}return V(Vt(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,Vt(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);V(n,"unknown function","fragment",e),e=n}return Ut([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){const r=this.getFunction(e);V(r,"unknown function","fragment",e),e=r}let n="invalid length for result data";const s=Dn(t);if(s.length%32===0)try{return this.#i.decode(e.outputs,s)}catch{n="could not decode result data"}pe(!1,n,"BAD_DATA",{value:Ce(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){const n=lt(e,"data"),s=Pa.getBuiltinCallException("call",t,n);if(s.message.startsWith("execution reverted (unknown custom error)")){const o=Ce(n.slice(0,4)),c=this.getError(o);if(c)try{const l=this.#i.decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:l},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(t);return a&&(s.invocation={method:a.name,signature:a.signature,args:a.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){const n=this.getFunction(e);V(n,"unknown function","fragment",e),e=n}return Ce(this.#i.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){const r=this.getEvent(e);V(r,"unknown event","eventFragment",e),e=r}pe(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const s=(r,a)=>r.type==="string"?Er(a):r.type==="bytes"?$t(Ce(a)):(r.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":r.type.match(/^u?int/)?a=Os(a):r.type.match(/^bytes/)?a=AT(a,32):r.type==="address"&&this.#i.encode(["address"],[a]),ns(Ce(a),32));for(t.forEach((r,a)=>{const o=e.inputs[a];if(!o.indexed){V(r==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,r);return}r==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?V(!1,"filtering with tuples or arrays not supported","contract."+o.name,r):Array.isArray(r)?n.push(r.map(c=>s(o,c))):n.push(s(o,r))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){const a=this.getEvent(e);V(a,"unknown event","eventFragment",e),e=a}const n=[],s=[],r=[];return e.anonymous||n.push(e.topicHash),V(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{const c=t[o];if(a.indexed)if(a.type==="string")n.push(Er(c));else if(a.type==="bytes")n.push($t(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(this.#i.encode([a.type],[c]))}else s.push(a),r.push(c)}),{data:this.#i.encode(s,r),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){const f=this.getEvent(e);V(f,"unknown event","eventFragment",e),e=f}if(n!=null&&!e.anonymous){const f=e.topicHash;V(Ft(n[0],32)&&n[0].toLowerCase()===f,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const s=[],r=[],a=[];e.inputs.forEach((f,m)=>{f.indexed?f.type==="string"||f.type==="bytes"||f.baseType==="tuple"||f.baseType==="array"?(s.push(Dt.from({type:"bytes32",name:f.name})),a.push(!0)):(s.push(f),a.push(!1)):(r.push(f),a.push(!1))});const o=n!=null?this.#i.decode(s,Ut(n)):null,c=this.#i.decode(r,t,!0),l=[],h=[];let u=0,d=0;return e.inputs.forEach((f,m)=>{let g=null;if(f.indexed)if(o==null)g=new Nx(null);else if(a[m])g=new Nx(o[d++]);else try{g=o[d++]}catch(A){g=A}else try{g=c[u++]}catch(A){g=A}l.push(g),h.push(f.name||null)}),rs.fromItems(l,h)}parseTransaction(e){const t=lt(e.data,"tx.data"),n=Re(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(Ce(t.slice(0,4)));if(!s)return null;const r=this.#i.decode(s.inputs,t.slice(4));return new PF(s,s.selector,r,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new LF(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=Ce(e),n=this.getError(Vt(t,0,4));if(!n)return null;const s=this.#i.decode(n.inputs,Vt(t,4));return new kF(n,n.selector,s)}static from(e){return e instanceof Sr?e:typeof e=="string"?new Sr(JSON.parse(e)):typeof e.formatJson=="function"?new Sr(e.formatJson()):typeof e.format=="function"?new Sr(e.format("json")):new Sr(e)}}const Lx=BigInt(0);function ka(i){return i??null}function Xt(i){return i==null?null:i.toString()}class Px{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){Xe(this,{gasPrice:ka(e),maxFeePerGas:ka(t),maxPriorityFeePerGas:ka(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Xt(e),maxFeePerGas:Xt(t),maxPriorityFeePerGas:Xt(n)}}}function $l(i){const e={};i.to&&(e.to=i.to),i.from&&(e.from=i.from),i.data&&(e.data=Ce(i.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of t)!(s in i)||i[s]==null||(e[s]=Re(i[s],`request.${s}`));const n="type,nonce".split(/,/);for(const s of n)!(s in i)||i[s]==null||(e[s]=ht(i[s],`request.${s}`));return i.accessList&&(e.accessList=br(i.accessList)),i.authorizationList&&(e.authorizationList=i.authorizationList.slice()),"blockTag"in i&&(e.blockTag=i.blockTag),"enableCcipRead"in i&&(e.enableCcipRead=!!i.enableCcipRead),"customData"in i&&(e.customData=i.customData),"blobVersionedHashes"in i&&i.blobVersionedHashes&&(e.blobVersionedHashes=i.blobVersionedHashes.slice()),"kzg"in i&&(e.kzg=i.kzg),"blobWrapperVersion"in i&&(e.blobWrapperVersion=i.blobWrapperVersion),"blobs"in i&&i.blobs&&(e.blobs=i.blobs.map(s=>Yd(s)?Ce(s):Object.assign({},s))),e}class UF{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new Jo(n,t):n),Xe(this,{provider:t,hash:ka(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:ka(e.prevRandao),extraData:e.extraData,baseFeePerGas:ka(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=this.#e.slice();return e.length===0?[]:(pe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:r,hash:a,miner:o,prevRandao:c,nonce:l,number:h,parentHash:u,parentBeaconBlockRoot:d,stateRoot:f,receiptsRoot:m,timestamp:g,transactions:A}=this;return{_type:"Block",baseFeePerGas:Xt(e),difficulty:Xt(t),extraData:n,gasLimit:Xt(s),gasUsed:Xt(r),blobGasUsed:Xt(this.blobGasUsed),excessBlobGas:Xt(this.excessBlobGas),hash:a,miner:o,prevRandao:c,nonce:l,number:h,parentHash:u,timestamp:g,parentBeaconBlockRoot:d,stateRoot:f,receiptsRoot:m,transactions:A}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{const n=e.toLowerCase();for(const s of this.#e)if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash!==n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(const n of t)if(n.hash===e)return n;V(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return OF(this)}}class Yo{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const n=Object.freeze(e.topics.slice());Xe(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:n,data:s,index:r,removed:a,topics:o,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:r,removed:a,topics:o,transactionHash:c,transactionIndex:l}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return pe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return pe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return pe(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return QF(this)}}class kx{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(s=>new Yo(s,t)));let n=Lx;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Xe(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){const{to:e,from:t,contractAddress:n,hash:s,index:r,blockHash:a,blockNumber:o,logsBloom:c,logs:l,status:h,root:u}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:Xt(this.cumulativeGasUsed),from:t,gasPrice:Xt(this.gasPrice),blobGasUsed:Xt(this.blobGasUsed),blobGasPrice:Xt(this.blobGasPrice),gasUsed:Xt(this.gasUsed),hash:s,index:r,logs:l,logsBloom:c,root:u,status:h,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return Ox(this)}reorderedEvent(e){return pe(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),Ux(this,e)}}class Jo{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.authorizationList=e.authorizationList!=null?e.authorizationList:null,this.#e=-1}toJSON(){const{blockNumber:e,blockHash:t,index:n,hash:s,type:r,to:a,from:o,nonce:c,data:l,signature:h,accessList:u,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:u,blockNumber:e,blockHash:t,blobVersionedHashes:d,chainId:Xt(this.chainId),data:l,from:o,gasLimit:Xt(this.gasLimit),gasPrice:Xt(this.gasPrice),hash:s,maxFeePerGas:Xt(this.maxFeePerGas),maxPriorityFeePerGas:Xt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Xt(this.maxFeePerBlobGas),nonce:c,signature:h,to:a,index:n,type:r,value:Xt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:t,blockNumber:n}=await Fn({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const n=e??1,s=t??0;let r=this.#e,a=-1,o=r===-1;const c=async()=>{if(o)return null;const{blockNumber:d,nonce:f}=await Fn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(f<this.nonce){r=d;return}if(o)return null;const m=await this.getTransaction();if(!(m&&m.blockNumber!=null))for(a===-1&&(a=r-3,a<this.#e&&(a=this.#e));a<=d;){if(o)return null;const g=await this.provider.getBlock(a,!0);if(g==null)return;for(const A of g)if(A===this.hash)return;for(let A=0;A<g.length;A++){const p=await g.getTransaction(A);if(p.from===this.from&&p.nonce===this.nonce){if(o)return null;const y=await this.provider.getTransactionReceipt(p.hash);if(y==null||d-y.blockNumber+1<n)return;let b="replaced";p.data===this.data&&p.to===this.to&&p.value===this.value?b="repriced":p.data==="0x"&&p.from===p.to&&p.value===Lx&&(b="cancelled"),pe(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:b==="replaced"||b==="cancelled",reason:b,replacement:p.replaceableTransaction(r),hash:p.hash,receipt:y})}}a++}},l=d=>{if(d==null||d.status!==0)return d;pe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},h=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(h);if(h){if(n===1||await h.confirmations()>=n)return l(h)}else if(await c(),n===0)return null;return await new Promise((d,f)=>{const m=[],g=()=>{m.forEach(p=>p())};if(m.push(()=>{o=!0}),s>0){const p=setTimeout(()=>{g(),f(Qt("wait for transaction timeout","TIMEOUT"))},s);m.push(()=>{clearTimeout(p)})}const A=async p=>{if(await p.confirmations()>=n){g();try{d(l(p))}catch(y){f(y)}}};if(m.push(()=>{this.provider.off(this.hash,A)}),this.provider.on(this.hash,A),r>=0){const p=async()=>{try{await c()}catch(y){if(_n(y,"TRANSACTION_REPLACED")){g(),f(y);return}}o||this.provider.once("block",p)};m.push(()=>{this.provider.off("block",p)}),this.provider.once("block",p)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return pe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ox(this)}reorderedEvent(e){return pe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),pe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ux(this,e)}replaceableTransaction(e){V(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new Jo(this,this.provider);return t.#e=e,t}}function OF(i){return{orphan:"drop-block",hash:i.hash,number:i.number}}function Ux(i,e){return{orphan:"reorder-transaction",tx:i,other:e}}function Ox(i){return{orphan:"drop-transaction",tx:i}}function QF(i){return{orphan:"drop-log",log:{transactionHash:i.transactionHash,blockHash:i.blockHash,blockNumber:i.blockNumber,address:i.address,data:i.data,topics:Object.freeze(i.topics.slice()),index:i.index}}}class Qf extends Yo{interface;fragment;args;constructor(e,t,n){super(e,e.provider);const s=t.decodeEventLog(n,e.data,e.topics);Xe(this,{args:s,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Qx extends Yo{error;constructor(e,t){super(e,e.provider),Xe(this,{error:t})}}class GF extends kx{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new Qf(e,this.#e,t)}catch(n){return new Qx(e,n)}return e})}}class Gf extends Jo{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){const n=await super.wait(e,t);return n==null?null:new GF(this.#e,this.provider,n)}}class Gx extends _0{log;constructor(e,t,n,s){super(e,t,n),Xe(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class HF extends Gx{constructor(e,t,n,s,r){super(e,t,n,new Qf(r,e.interface,s));const a=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Xe(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Hx=BigInt(0);function zx(i){return i&&typeof i.call=="function"}function Vx(i){return i&&typeof i.estimateGas=="function"}function eh(i){return i&&typeof i.resolveName=="function"}function Wx(i){return i&&typeof i.sendTransaction=="function"}function qx(i){if(i!=null){if(eh(i))return i;if(i.provider)return i.provider}}class zF{#e;fragment;constructor(e,t,n){if(Xe(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");const s=Ir(e.runner,"resolveName"),r=eh(s)?s:null;this.#e=(async function(){const a=await Promise.all(t.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(h,u)=>h==="address"?Array.isArray(u)?Promise.all(u.map(d=>Pn(d,r))):Pn(u,r):u)));return e.interface.encodeFilterTopics(t,a)})()}getTopicFilter(){return this.#e}}function Ir(i,e){return i==null?null:typeof i[e]=="function"?i:i.provider&&typeof i.provider[e]=="function"?i.provider:null}function Mr(i){return i==null?null:i.provider||null}async function Kx(i,e){const t=Wt.dereference(i,"overrides");V(typeof t=="object","invalid overrides parameter","overrides",i);const n=$l(t);return V(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),V(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function VF(i,e,t){const n=Ir(i,"resolveName"),s=eh(n)?n:null;return await Promise.all(e.map((r,a)=>r.walkAsync(t[a],(o,c)=>(c=Wt.dereference(c,o),o==="address"?Pn(c,s):c))))}function WF(i){const e=async function(a){const o=await Kx(a,["data"]);o.to=await i.getAddress(),o.from&&(o.from=await Pn(o.from,qx(i.runner)));const c=i.interface,l=Re(o.value||Hx,"overrides.value")===Hx,h=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!h&&!l&&V(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),V(c.fallback||h,"cannot send data to receive-only contract","overrides.data",o.data);const u=c.receive||c.fallback&&c.fallback.payable;return V(u||l,"cannot send value to non-payable fallback","overrides.value",o.value),V(c.fallback||h,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){const o=Ir(i.runner,"call");pe(zx(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(a);try{return await o.call(c)}catch(l){throw Xd(l)&&l.data?i.interface.makeError(l.data,c):l}},n=async function(a){const o=i.runner;pe(Wx(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await e(a)),l=Mr(i.runner);return new Gf(i.interface,l,c)},s=async function(a){const o=Ir(i.runner,"estimateGas");return pe(Vx(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},r=async a=>await n(a);return Xe(r,{_contract:i,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),r}function qF(i,e){const t=function(...l){const h=i.interface.getFunction(e,l);return pe(h,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),h},n=async function(...l){const h=t(...l);let u={};if(h.inputs.length+1===l.length&&(u=await Kx(l.pop()),u.from&&(u.from=await Pn(u.from,qx(i.runner)))),h.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await VF(i.runner,h.inputs,l);return Object.assign({},u,await Fn({to:i.getAddress(),data:i.interface.encodeFunctionData(h,d)}))},s=async function(...l){const h=await o(...l);return h.length===1?h[0]:h},r=async function(...l){const h=i.runner;pe(Wx(h),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await h.sendTransaction(await n(...l)),d=Mr(i.runner);return new Gf(i.interface,d,u)},a=async function(...l){const h=Ir(i.runner,"estimateGas");return pe(Vx(h),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await h.estimateGas(await n(...l))},o=async function(...l){const h=Ir(i.runner,"call");pe(zx(h),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await n(...l);let d="0x";try{d=await h.call(u)}catch(m){throw Xd(m)&&m.data?i.interface.makeError(m.data,u):m}const f=t(...l);return i.interface.decodeFunctionResult(f,d)},c=async(...l)=>t(...l).constant?await s(...l):await r(...l);return Xe(c,{name:i.interface.getFunctionName(e),_contract:i,_key:e,getFragment:t,estimateGas:a,populateTransaction:n,send:r,staticCall:s,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=i.interface.getFunction(e);return pe(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function KF(i,e){const t=function(...s){const r=i.interface.getEvent(e,s);return pe(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),r},n=function(...s){return new zF(i,t(...s),s)};return Xe(n,{name:i.interface.getEventName(e),_contract:i,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=i.interface.getEvent(e);return pe(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}const th=Symbol.for("_ethersInternal_contract"),jx=new WeakMap;function jF(i,e){jx.set(i[th],e)}function jn(i){return jx.get(i[th])}function XF(i){return i&&typeof i=="object"&&"getTopicFilter"in i&&typeof i.getTopicFilter=="function"&&i.fragment}async function Hf(i,e){let t,n=null;if(Array.isArray(e)){const r=function(a){if(Ft(a,32))return a;const o=i.interface.getEvent(a);return V(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(r):r(a))}else e==="*"?t=[null]:typeof e=="string"?Ft(e,32)?t=[e]:(n=i.interface.getEvent(e),V(n,"unknown fragment","event",e),t=[n.topicHash]):XF(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):V(!1,"unknown event name","event",e);t=t.map(r=>{if(r==null)return null;if(Array.isArray(r)){const a=Array.from(new Set(r.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return r.toLowerCase()});const s=t.map(r=>r==null?"null":Array.isArray(r)?r.join("|"):r).join("&");return{fragment:n,tag:s,topics:t}}async function Zo(i,e){const{subs:t}=jn(i);return t.get((await Hf(i,e)).tag)||null}async function Xx(i,e,t){const n=Mr(i.runner);pe(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:r,topics:a}=await Hf(i,t),{addr:o,subs:c}=jn(i);let l=c.get(r);if(!l){const u={address:o||i,topics:a},d=A=>{let p=s;if(p==null)try{p=i.interface.getEvent(A.topics[0])}catch{}if(p){const y=p,b=s?i.interface.decodeEventLog(s,A.data,A.topics):[];Vf(i,t,b,_=>new HF(i,_,t,y,A))}else Vf(i,t,[],y=>new Gx(i,y,t,A))};let f=[];l={tag:r,listeners:[],start:()=>{f.length||f.push(n.on(u,d))},stop:async()=>{if(f.length==0)return;let A=f;f=[],await Promise.all(A),n.off(u,d)}},c.set(r,l)}return l}let zf=Promise.resolve();async function YF(i,e,t,n){await zf;const s=await Zo(i,e);if(!s)return!1;const r=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:o})=>{const c=Array.from(t);n&&c.push(n(o?null:a));try{a.call(i,...c)}catch{}return!o}),s.listeners.length===0&&(s.stop(),jn(i).subs.delete(s.tag)),r>0}async function Vf(i,e,t,n){try{await zf}catch{}const s=YF(i,e,t,n);return zf=s,await s}const nh=["then"];class $o{target;interface;runner;filters;[th];fallback;constructor(e,t,n,s){V(typeof e=="string"||Mb(e),"invalid value for Contract target","target",e),n==null&&(n=null);const r=Sr.from(t);Xe(this,{target:e,runner:n,interface:r}),Object.defineProperty(this,th,{value:{}});let a,o=null,c=null;if(s){const u=Mr(n);c=new Gf(this.interface,u,s)}let l=new Map;if(typeof e=="string")if(Ft(e))o=e,a=Promise.resolve(e);else{const u=Ir(n,"resolveName");if(!eh(u))throw Qt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=u.resolveName(e).then(d=>{if(d==null)throw Qt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return jn(this).addr=d,d})}else a=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return jn(this).addr=u,u});jF(this,{addrPromise:a,addr:o,deployTx:c,subs:l});const h=new Proxy({},{get:(u,d,f)=>{if(typeof d=="symbol"||nh.indexOf(d)>=0)return Reflect.get(u,d,f);try{return this.getEvent(d)}catch(m){if(!_n(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(u,d)=>nh.indexOf(d)>=0?Reflect.has(u,d):Reflect.has(u,d)||this.interface.hasEvent(String(d))});return Xe(this,{filters:h}),Xe(this,{fallback:r.receive||r.fallback?WF(this):null}),new Proxy(this,{get:(u,d,f)=>{if(typeof d=="symbol"||d in u||nh.indexOf(d)>=0)return Reflect.get(u,d,f);try{return u.getFunction(d)}catch(m){if(!_n(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(u,d)=>typeof d=="symbol"||d in u||nh.indexOf(d)>=0?Reflect.has(u,d):u.interface.hasFunction(d)})}connect(e){return new $o(this.target,this.interface,e)}attach(e){return new $o(e,this.interface,this.runner)}async getAddress(){return await jn(this).addrPromise}async getDeployedCode(){const e=Mr(this.runner);pe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Mr(this.runner);return pe(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,r)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",a)}catch(o){r(o)}};a()})}deploymentTransaction(){return jn(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),qF(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),KF(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");const{addr:s,addrPromise:r}=jn(this),a=s||await r,{fragment:o,topics:c}=await Hf(this,e),l={address:a,topics:c,fromBlock:t,toBlock:n},h=Mr(this.runner);return pe(h,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await h.getLogs(l)).map(u=>{let d=o;if(d==null)try{d=this.interface.getEvent(u.topics[0])}catch{}if(d)try{return new Qf(u,this.interface,d)}catch(f){return new Qx(u,f)}return new Yo(u,h)})}async on(e,t){const n=await Xx(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await Xx(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await Vf(this,e,t,null)}async listenerCount(e){if(e){const s=await Zo(this,e);return s?s.listeners.length:0}const{subs:t}=jn(this);let n=0;for(const{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){const s=await Zo(this,e);return s?s.listeners.map(({listener:r})=>r):[]}const{subs:t}=jn(this);let n=[];for(const{listeners:s}of t.values())n=n.concat(s.map(({listener:r})=>r));return n}async off(e,t){const n=await Zo(this,e);if(!n)return this;if(t){const s=n.listeners.map(({listener:r})=>r).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),jn(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await Zo(this,e);if(!t)return this;t.stop(),jn(this).subs.delete(t.tag)}else{const{subs:t}=jn(this);for(const{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends $o{constructor(s,r=null){super(s,e,r)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}}function JF(){return $o}class Ua extends JF(){}function Wf(i){return i.match(/^ipfs:\/\/ipfs\//i)?i=i.substring(12):i.match(/^ipfs:\/\//i)?i=i.substring(7):V(!1,"unsupported IPFS format","link",i),`https://gateway.ipfs.io/ipfs/${i}`}class ZF{name;constructor(e){Xe(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const Yx=new RegExp("^(ipfs)://(.*)$","i"),Jx=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Yx,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class Oa{provider;address;name;#e;#t;constructor(e,t,n){Xe(this,{provider:e,address:t,name:n}),this.#e=null,this.#t=new Ua(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(e){if(_n(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#n(e,t){t=(t||[]).slice();const n=this.#t.interface;t.unshift(Pf(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),pe(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[AF(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const r=await this.#t[e](...t);return s?n.decodeFunctionResult(s,r)[0]:r}catch(r){if(!_n(r,"CALL_EXCEPTION"))throw r}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{const r=await this.#n("addr(bytes32)");return r==null||r===Ho?null:r}catch(r){if(_n(r,"CALL_EXCEPTION"))return null;throw r}if(e>=0&&e<2147483648){let r=e+2147483648;const a=await this.#n("addr(bytes32,uint)",[r]);if(Ft(a,20))return Ct(a)}let t=null;for(const r of this.provider.plugins)if(r instanceof ZF&&r.supportsCoinType(e)){t=r;break}if(t==null)return null;const n=await this.#n("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const s=await t.decodeAddress(e,n);if(s!=null)return s;pe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const t=await this.#n("text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await this.#n("contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const s=t[1]==="e3010170"?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===r*2)return`${s}://${bT("0x"+t[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;pe(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<Jx.length;n++){const s=t.match(Jx[n]);if(s==null)continue;const r=s[1].toLowerCase();switch(r){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const a=Wf(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:a}),{linkage:e,url:a}}case"erc721":case"erc1155":{const a=r==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:r,value:t});const o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${r}caip`,value:s[2]||""}),{url:null,linkage:e};const l=c[1],h=new Ua(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(r==="erc721"){const g=await h.ownerOf(l);if(o!==g)return e.push({type:"!owner",value:g}),{url:null,linkage:e};e.push({type:"owner",value:g})}else if(r==="erc1155"){const g=await h.balanceOf(o,l);if(!g)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:g.toString()})}let u=await h[a](l);if(u==null||u==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:u}),r==="erc1155"&&(u=u.replace("{id}",Os(l,32).substring(2)),e.push({type:"metadata-url-expanded",value:u})),u.match(/^ipfs:/i)&&(u=Wf(u)),e.push({type:"metadata-url",value:u});let d={};const f=await new Pi(u).send();f.assertOk();try{d=f.bodyJson}catch{try{e.push({type:"!metadata",value:f.bodyText})}catch{const p=f.body;return p&&e.push({type:"!metadata",value:Ce(p)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let m=d.image;if(typeof m!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!m.match(/^(https:\/\/|data:)/i)){if(m.match(Yx)==null)return e.push({type:"!imageUrl-ipfs",value:m}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:m}),m=Wf(m)}return e.push({type:"url",value:m}),{linkage:e,url:m}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return pe(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async#i(e,t){const n=await Oa.getEnsAddress(e);try{const r=await new Ua(n,["function resolver(bytes32) view returns (address)"],e).resolver(Pf(t),{enableCcipRead:!0});return r===Ho?null:r}catch(s){throw s}return null}static async fromName(e,t){let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;const s=await Oa.#i(e,n);if(s!=null){const r=new Oa(e,s,t);return n!==t&&!await r.supportsWildcard()?null:r}n=n.split(".").slice(1).join(".")}}}const Zx=BigInt(0);function mt(i,e){return(function(t){return t==null?e:i(t)})}function ec(i,e){return(t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>i(n))})}function tc(i,e){return(t=>{const n={};for(const s in i){let r=s;if(e&&s in e&&!(r in t)){for(const a of e[s])if(a in t){r=a;break}}try{const a=i[s](t[r]);a!==void 0&&(n[s]=a)}catch(a){const o=a instanceof Error?a.message:"not-an-error";pe(!1,`invalid value for value.${s} (${o})`,"BAD_DATA",{value:t})}}return n})}function $F(i){switch(i){case!0:case"true":return!0;case!1:case"false":return!1}V(!1,`invalid boolean; ${JSON.stringify(i)}`,"value",i)}function Qa(i){return V(Ft(i,!0),"invalid data","value",i),i}function yn(i){return V(Ft(i,32),"invalid hash","value",i),i}const eD=tc({address:Ct,blockHash:yn,blockNumber:ht,data:Qa,index:ht,removed:mt($F,!1),topics:ec(yn),transactionHash:yn,transactionIndex:ht},{index:["logIndex"]});function tD(i){return eD(i)}const nD=tc({hash:mt(yn),parentHash:yn,parentBeaconBlockRoot:mt(yn,null),number:ht,timestamp:ht,nonce:mt(Qa),difficulty:Re,gasLimit:Re,gasUsed:Re,stateRoot:mt(yn,null),receiptsRoot:mt(yn,null),blobGasUsed:mt(Re,null),excessBlobGas:mt(Re,null),miner:mt(Ct),prevRandao:mt(yn,null),extraData:Qa,baseFeePerGas:mt(Re)},{prevRandao:["mixHash"]});function iD(i){const e=nD(i);return e.transactions=i.transactions.map(t=>typeof t=="string"?t:$x(t)),e}const sD=tc({transactionIndex:ht,blockNumber:ht,transactionHash:yn,address:Ct,topics:ec(yn),data:Qa,index:ht,blockHash:yn},{index:["logIndex"]});function rD(i){return sD(i)}const aD=tc({to:mt(Ct,null),from:mt(Ct,null),contractAddress:mt(Ct,null),index:ht,root:mt(Ce),gasUsed:Re,blobGasUsed:mt(Re,null),logsBloom:mt(Qa),blockHash:yn,hash:yn,logs:ec(rD),blockNumber:ht,cumulativeGasUsed:Re,effectiveGasPrice:mt(Re),blobGasPrice:mt(Re,null),status:mt(ht),type:mt(ht,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function oD(i){return aD(i)}function $x(i){i.to&&Re(i.to)===Zx&&(i.to="0x0000000000000000000000000000000000000000");const e=tc({hash:yn,index:mt(ht,void 0),type:t=>t==="0x"||t==null?0:ht(t),accessList:mt(br,null),blobVersionedHashes:mt(ec(yn,!0),null),authorizationList:mt(ec(t=>{let n;if(t.signature)n=t.signature;else{let s=t.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),n=Object.assign({},t,{yParity:s})}return{address:Ct(t.address),chainId:Re(t.chainId),nonce:Re(t.nonce),signature:Gt.from(n)}},!1),null),blockHash:mt(yn,null),blockNumber:mt(ht,null),transactionIndex:mt(ht,null),from:Ct,gasPrice:mt(Re),maxPriorityFeePerGas:mt(Re),maxFeePerGas:mt(Re),maxFeePerBlobGas:mt(Re,null),gasLimit:Re,to:mt(Ct,null),value:Re,nonce:ht,data:Qa,creates:mt(Ct,null),chainId:mt(Re,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(i);if(e.to==null&&e.creates==null&&(e.creates=YR(e)),(i.type===1||i.type===2)&&i.accessList==null&&(e.accessList=[]),i.signature?e.signature=Gt.from(i.signature):e.signature=Gt.from(i),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Re(e.blockHash)===Zx&&(e.blockHash=null),e}const cD="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class nc{name;constructor(e){Xe(this,{name:e})}clone(){return new nc(this.name)}}class ih extends nc{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const n={effectiveBlock:e};function s(r,a){let o=(t||{})[r];o==null&&(o=a),V(typeof o=="number",`invalud value for ${r}`,"costs",t),n[r]=o}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Xe(this,n)}clone(){return new ih(this.effectiveBlock,this)}}class sh extends nc{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),Xe(this,{address:e||cD,targetNetwork:t??1})}clone(){return new sh(this.address,this.targetNetwork)}}class lD extends nc{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}}const qf=new Map;class Xn{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=Re(t),this.#n=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=Re(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Re(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Re(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Re(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#n.values())}attachPlugin(e){if(this.#n.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#n.set(e.name,e.clone()),this}getPlugin(e){return this.#n.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new Xn(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new ih;let n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){const s=br(e.accessList);for(const r in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[r].storageKeys.length}return n}static from(e){if(hD(),e==null)return Xn.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const t=qf.get(e);if(t)return t();if(typeof e=="bigint")return new Xn("unknown",e);V(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){V(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const t=new Xn(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new sh(e.ensAddress,e.ensNetwork)),t}V(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));const n=qf.get(e);n&&V(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),qf.set(e,t)}}function eE(i,e){const t=String(i);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${i}`);const n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${i}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function tE(i){return new lD(i,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{const[r,a]=await Promise.all([n.send(),e()]);s=r;const o=s.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:eE(o.maxFee,9),maxPriorityFeePerGas:eE(o.maxPriorityFee,9)}}catch(r){pe(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:r})}})}let nE=!1;function hD(){if(nE)return;nE=!0;function i(e,t,n){const s=function(){const r=new Xn(e,t);return n.ensNetwork!=null&&r.attachPlugin(new sh(null,n.ensNetwork)),r.attachPlugin(new ih),(n.plugins||[]).forEach(a=>{r.attachPlugin(a)}),r};Xn.register(e,s),Xn.register(t,s),n.altNames&&n.altNames.forEach(r=>{Xn.register(r,s)})}i("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),i("ropsten",3,{ensNetwork:3}),i("rinkeby",4,{ensNetwork:4}),i("goerli",5,{ensNetwork:5}),i("kovan",42,{ensNetwork:42}),i("sepolia",11155111,{ensNetwork:11155111}),i("holesky",17e3,{ensNetwork:17e3}),i("classic",61,{}),i("classicKotti",6,{}),i("arbitrum",42161,{ensNetwork:1}),i("arbitrum-goerli",421613,{}),i("arbitrum-sepolia",421614,{}),i("base",8453,{ensNetwork:1}),i("base-goerli",84531,{}),i("base-sepolia",84532,{}),i("bnb",56,{ensNetwork:1}),i("bnbt",97,{}),i("filecoin",314,{}),i("filecoin-calibration",314159,{}),i("linea",59144,{ensNetwork:1}),i("linea-goerli",59140,{}),i("linea-sepolia",59141,{}),i("matic",137,{ensNetwork:1,plugins:[tE("https://gasstation.polygon.technology/v2")]}),i("matic-amoy",80002,{}),i("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[tE("https://gasstation-testnet.polygon.technology/v2")]}),i("optimism",10,{ensNetwork:1,plugins:[]}),i("optimism-goerli",420,{}),i("optimism-sepolia",11155420,{}),i("xdai",100,{ensNetwork:1})}function Kf(i){return JSON.parse(JSON.stringify(i))}class uD{#e;#t;#n;#i;constructor(e){this.#e=e,this.#t=null,this.#n=4e3,this.#i=-2}get pollingInterval(){return this.#n}set pollingInterval(e){this.#n=e}async#s(){try{const e=await this.#e.getBlockNumber();if(this.#i===-2){this.#i=e;return}if(e!==this.#i){for(let t=this.#i+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#i=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#n))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#n),this.#s())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}class jf{#e;#t;#n;constructor(e){this.#e=e,this.#n=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#n||(this.#n=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}}class dD extends jf{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){const n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}}class fD extends jf{#e;constructor(e,t){super(e),this.#e=Kf(t)}async _poll(e,t){throw new Error("@TODO")}}class pD extends jf{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){const n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}}class Xf{#e;#t;#n;#i;#s;constructor(e,t){this.#e=e,this.#t=Kf(t),this.#n=this.#a.bind(this),this.#i=!1,this.#s=-2}async#a(e){if(this.#s===-2)return;const t=Kf(this.#t);t.fromBlock=this.#s+1,t.toBlock=e;const n=await this.#e.getLogs(t);if(n.length===0){this.#s<e-60&&(this.#s=e-60);return}for(const s of n)this.#e.emit(this.#t,s),this.#s=s.blockNumber}start(){this.#i||(this.#i=!0,this.#s===-2&&this.#e.getBlockNumber().then(e=>{this.#s=e}),this.#e.on("block",this.#n))}stop(){this.#i&&(this.#i=!1,this.#e.off("block",this.#n))}pause(e){this.stop(),e&&(this.#s=-2)}resume(){this.start()}}const AD=BigInt(2),gD=10;function rh(i){return i&&typeof i.then=="function"}function ah(i,e){return i+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const s=Object.keys(n);return s.sort(),s.reduce((r,a)=>(r[a]=n[a],r),{})}return n})}class iE{name;constructor(e){Xe(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function mD(i){return JSON.parse(JSON.stringify(i))}function Yf(i){return i=Array.from(new Set(i).values()),i.sort(),i}async function Jf(i,e){if(i==null)throw new Error("invalid event");if(Array.isArray(i)&&(i={topics:i}),typeof i=="string")switch(i){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:i,tag:i}}if(Ft(i,32)){const t=i.toLowerCase();return{type:"transaction",tag:ah("tx",{hash:t}),hash:t}}if(i.orphan){const t=i;return{type:"orphan",tag:ah("orphan",t),filter:mD(t)}}if(i.address||i.topics){const t=i,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?Yf(s.map(r=>r.toLowerCase())):s.toLowerCase())};if(t.address){const s=[],r=[],a=o=>{Ft(o)?s.push(o):r.push((async()=>{s.push(await Pn(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),r.length&&await Promise.all(r),n.address=Yf(s.map(o=>o.toLowerCase()))}return{filter:n,tag:ah("event",n),type:"event"}}V(!1,"unknown ProviderEvent","event",i)}function Zf(){return new Date().getTime()}const bD={cacheTimeout:250,pollingInterval:4e3};class xD{#e;#t;#n;#i;#s;#a;#r;#o;#f;#l;#p;#A;constructor(e,t){if(this.#A=Object.assign({},bD,t||{}),e==="any")this.#a=!0,this.#s=null;else if(e){const n=Xn.from(e);this.#a=!1,this.#s=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#a=!1,this.#s=null;this.#o=-1,this.#r=new Map,this.#e=new Map,this.#t=new Map,this.#n=null,this.#i=!1,this.#f=1,this.#l=new Map,this.#p=!1}get pollingInterval(){return this.#A.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#p}set disableCcipRead(e){this.#p=!!e}async#c(e){const t=this.#A.cacheTimeout;if(t<0)return await this._perform(e);const n=ah(e.method,e);let s=this.#r.get(n);return s||(s=this._perform(e),this.#r.set(n,s),setTimeout(()=>{this.#r.get(n)===s&&this.#r.delete(n)},t)),await s}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const s=e.to.toLowerCase(),r=t.toLowerCase(),a=[];for(let o=0;o<n.length;o++){const c=n[o],l=c.replace("{sender}",s).replace("{data}",r),h=new Pi(l);c.indexOf("{data}")===-1&&(h.body={data:r,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:h,index:o,urls:n});let u="unknown error",d;try{d=await h.send()}catch(f){a.push(f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:{error:f}});continue}try{const f=d.bodyJson;if(f.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:h,result:f}),f.data;f.message&&(u=f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:f})}catch{}pe(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:u}}),a.push(u)}pe(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,t){return new UF(iD(e),this)}_wrapLog(e,t){return new Yo(tD(e),this)}_wrapTransactionReceipt(e,t){return new kx(oD(e),this)}_wrapTransactionResponse(e,t){return new Jo($x(e),this)}_detectNetwork(){pe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){pe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=ht(await this.#c({method:"getBlockNumber"}),"%response");return this.#o>=0&&(this.#o=e),e}_getAddress(e){return Pn(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Ft(e))return Ft(e,32)?e:yi(e);if(typeof e=="bigint"&&(e=ht(e,"blockTag")),typeof e=="number")return e>=0?yi(e):this.#o>=0?yi(this.#o+e):this.getBlockNumber().then(t=>yi(t+e));V(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?Yf(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,l,h)=>{let u;switch(c.length){case 0:break;case 1:u=c[0];break;default:c.sort(),u=c}if(n&&(l!=null||h!=null))throw new Error("invalid filter");const d={};return u&&(d.address=u),t.length&&(d.topics=t),l&&(d.fromBlock=l),h&&(d.toBlock=h),n&&(d.blockHash=n),d};let r=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)r.push(this._getAddress(c));else r.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),r.filter(c=>typeof c!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(r),a,o]).then(c=>s(c[0],c[1],c[2])):s(r,a,o)}_getTransactionRequest(e){const t=$l(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;const r=Pn(t[s],this);rh(r)?n.push((async function(){t[s]=await r})()):t[s]=r}),t.blockTag!=null){const s=this._getBlockTag(t.blockTag);rh(s)?n.push((async function(){t.blockTag=await s})()):t.blockTag=s}return n.length?(async function(){return await Promise.all(n),t})():t}async getNetwork(){if(this.#s==null){const s=(async()=>{try{const r=await this._detectNetwork();return this.emit("network",r,null),r}catch(r){throw this.#s===s&&(this.#s=null),r}})();return this.#s=s,(await s).clone()}const e=this.#s,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#a?(this.emit("network",n,t),this.#s===e&&(this.#s=Promise.resolve(n))):pe(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:s,gasPrice:r,priorityFee:a}=await Fn({_block:this.#b("latest",!1),gasPrice:(async()=>{try{const h=await this.#c({method:"getGasPrice"});return Re(h,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const h=await this.#c({method:"getPriorityFee"});return Re(h,"%response")}catch{}return null})()});let o=null,c=null;const l=this._wrapBlock(s,e);return l&&l.baseFeePerGas&&(c=a??BigInt("1000000000"),o=l.baseFeePerGas*AD+c),new Px(r,o,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const s=new Pi(n.url),r=await n.processFunc(t,this,s);return new Px(r.gasPrice,r.maxFeePerGas,r.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return rh(t)&&(t=await t),Re(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#h(e,t,n){pe(n<gD,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const s=$l(e);try{return Ce(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(r){if(!this.disableCcipRead&&Xd(r)&&r.data&&n>=0&&t==="latest"&&s.to!=null&&Vt(r.data,0,4)==="0x556f1830"){const a=r.data,o=await Pn(s.to,this);let c;try{c=vD(Vt(r.data,4))}catch(u){pe(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:a}})}pe(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(s,c.calldata,c.urls);pe(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:r.data,errorArgs:c.errorArgs}});const h={to:o,data:Ut([c.selector,wD([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:h});try{const u=await this.#h(h,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},h),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},h),error:u}),u}}throw r}}async#u(e){const{value:t}=await Fn({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:n}=await Fn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#u(this.#h(t,n,e.enableCcipRead?0:-1))}async#d(e,t,n){let s=this._getAddress(t),r=this._getBlockTag(n);return(typeof s!="string"||typeof r!="string")&&([s,r]=await Promise.all([s,r])),await this.#u(this.#c(Object.assign(e,{address:s,blockTag:r})))}async getBalance(e,t){return Re(await this.#d({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return ht(await this.#d({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return Ce(await this.#d({method:"getCode"},e,t))}async getStorage(e,t,n){const s=Re(t,"position");return Ce(await this.#d({method:"getStorage",position:s},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:s}=await Fn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),r=vi.from(e);if(r.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(r,s).replaceableTransaction(t)}async#b(e,t){if(Ft(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){const{network:n,params:s}=await Fn({network:this.getNetwork(),params:this.#b(e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){const{network:t,params:n}=await Fn({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await Fn({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const s=await this.#c({method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await Fn({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:Ce(t)}async getLogs(e){let t=this._getFilter(e);rh(t)&&(t=await t);const{network:n,params:s}=await Fn({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return s.map(r=>this._wrapLog(r,n))}_getProvider(e){pe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Oa.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=Ct(e);const t=Pf(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await Oa.getEnsAddress(this),r=await new Ua(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(r==null||r===Ho)return null;const o=await new Ua(r,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(n){if(_n(n,"BAD_DATA")&&n.value==="0x"||_n(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){const s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(r,a)=>{let o=null;const c=(async l=>{try{const h=await this.getTransactionReceipt(e);if(h!=null&&l-h.blockNumber+1>=s){r(h),o&&(clearTimeout(o),o=null);return}}catch(h){console.log("EEE",h)}this.once("block",c)});n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",c),a(Qt("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){pe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#l.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#l.delete(e))}_setTimeout(e,t){t==null&&(t=0);const n=this.#f++,s=()=>{this.#l.delete(n),e()};if(this.paused)this.#l.set(n,{timer:null,func:s,time:t});else{const r=setTimeout(s,t);this.#l.set(n,{timer:r,func:s,time:Zf()})}return n}_forEachSubscriber(e){for(const t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new iE(e.type);case"block":{const t=new uD(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new dD(this,e.type);case"event":return new Xf(this,e.filter);case"transaction":return new pD(this,e.hash);case"orphan":return new fD(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#n!=null&&t.pause(this.#n);break}}async#g(e,t){let n=await Jf(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await Jf({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#m(e){const t=await Jf(e,this),n=t.tag;let s=this.#e.get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,s)),s}async on(e,t){const n=await this.#m(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#n!=null&&n.subscriber.pause(this.#n)),this}async once(e,t){const n=await this.#m(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#n!=null&&n.subscriber.pause(this.#n)),this}async emit(e,...t){const n=await this.#g(e,t);if(!n||n.listeners.length===0)return!1;const s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:r,once:a})=>{const o=new _0(this,a?null:r,e);try{r.call(this,...t,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),s>0}async listenerCount(e){if(e){const n=await this.#g(e);return n?n.listeners.length:0}let t=0;for(const{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){const n=await this.#g(e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(const{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){const n=await this.#g(e);if(!n)return this;if(t){const s=n.listeners.map(({listener:r})=>r).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:s}=await this.#m(e);n&&s.stop(),this.#e.delete(t)}else for(const[t,{started:n,subscriber:s}]of this.#e)n&&s.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#i}destroy(){this.removeAllListeners();for(const e of this.#l.keys())this._clearTimeout(e);this.#i=!0}get paused(){return this.#n!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#o=-1,this.#n!=null){if(this.#n==!!e)return;pe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#n=!!e;for(const t of this.#l.values())t.timer&&clearTimeout(t.timer),t.time=Zf()-t.time}resume(){if(this.#n!=null){this._forEachSubscriber(e=>e.resume()),this.#n=null;for(const e of this.#l.values()){let t=e.time;t<0&&(t=0),e.time=Zf(),setTimeout(e.func,t)}}}}function ED(i,e){try{const t=$f(i,e);if(t)return Bl(t)}catch{}return null}function $f(i,e){if(i==="0x")return null;try{const t=ht(Vt(i,e,e+32)),n=ht(Vt(i,t,t+32));return Vt(i,t+32,t+32+n)}catch{}return null}function sE(i){const e=Zt(i);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function _D(i){if(i.length%32===0)return i;const e=new Uint8Array(Math.ceil(i.length/32)*32);return e.set(i),e}const yD=new Uint8Array([]);function wD(i){const e=[];let t=0;for(let n=0;n<i.length;n++)e.push(yD),t+=32;for(let n=0;n<i.length;n++){const s=lt(i[n]);e[n]=sE(t),e.push(sE(s.length)),e.push(_D(s)),t+=32+Math.ceil(s.length/32)*32}return Ut(e)}const rE="0x0000000000000000000000000000000000000000000000000000000000000000";function vD(i){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};pe(Ca(i)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=Vt(i,0,32);pe(Vt(t,0,12)===Vt(rE,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Vt(t,12);try{const n=[],s=ht(Vt(i,32,64)),r=ht(Vt(i,s,s+32)),a=Vt(i,s+32);for(let o=0;o<r;o++){const c=ED(a,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{pe(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=$f(i,64);if(n==null)throw new Error("abort");e.calldata=n}catch{pe(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}pe(Vt(i,100,128)===Vt(rE,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Vt(i,96,100);try{const n=$f(i,128);if(n==null)throw new Error("abort");e.extraData=n}catch{pe(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function Br(i,e){if(i.provider)return i.provider;pe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function aE(i,e){let t=$l(e);if(t.to!=null&&(t.to=Pn(t.to,i)),t.from!=null){const n=t.from;t.from=Promise.all([i.getAddress(),Pn(n,i)]).then(([s,r])=>(V(s.toLowerCase()===r.toLowerCase(),"transaction from mismatch","tx.from",r),s))}else t.from=i.getAddress();return await Fn(t)}class CD{provider;constructor(e){Xe(this,{provider:e||null})}async getNonce(e){return Br(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await aE(this,e)}async populateTransaction(e){const t=Br(this,"populateTransaction"),n=await aE(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const s=await this.provider.getNetwork();if(n.chainId!=null){const a=Re(n.chainId);V(a===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;const r=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||r)?V(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&r&&V(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const a=await t.getFeeData();pe(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{const a=await t.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(pe(!r,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):pe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await Fn(n)}async populateAuthorization(e){const t=Object.assign({},e);return t.chainId==null&&(t.chainId=(await Br(this,"getNetwork").getNetwork()).chainId),t.nonce==null&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return Br(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Br(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Br(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=Br(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const s=vi.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}authorize(e){pe(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}function SD(i){return JSON.parse(JSON.stringify(i))}class oE{#e;#t;#n;#i;#s;#a;constructor(e){this.#e=e,this.#t=null,this.#n=this.#r.bind(this),this.#i=!1,this.#s=null,this.#a=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#r(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(r){if(!_n(r,"UNSUPPORTED_OPERATION")||r.operation!=="eth_newFilter")throw r}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}const n=await this.#e.getNetwork();if(this.#s||(this.#s=n),this.#s.chainId!==n.chainId)throw new Error("chaid changed");if(this.#a)return;const s=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,s)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#n)}#o(){const e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#i||(this.#i=!0,this.#r(-2))}stop(){this.#i&&(this.#i=!1,this.#a=!0,this.#o(),this.#e.off("block",this.#n))}pause(e){e&&this.#o(),this.#e.off("block",this.#n)}resume(){this.start()}}class ID extends oE{#e;constructor(e,t){super(e),this.#e=SD(t)}_recover(e){return new Xf(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(const n of t)e.emit(this.#e,e._wrapLog(n,e._network))}}class MD extends oE{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const BD="bigint,boolean,function,number,string,symbol".split(/,/g);function oh(i){if(i==null||BD.indexOf(typeof i)>=0||typeof i.getAddress=="function")return i;if(Array.isArray(i))return i.map(oh);if(typeof i=="object")return Object.keys(i).reduce((e,t)=>(e[t]=i[t],e),{});throw new Error(`should not happen: ${i} (${typeof i})`)}function TD(i){return new Promise(e=>{setTimeout(e,i)})}function Ga(i){return i&&i.toLowerCase()}function cE(i){return i&&typeof i.pollingInterval=="number"}const lE={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class ep extends CD{address;constructor(e,t){super(e),t=Ct(t),Xe(this,{address:t})}connect(e){pe(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=oh(e),n=[];if(t.from){const r=t.from;n.push((async()=>{const a=await Pn(r,this.provider);V(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=a})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){const r=t.to;n.push((async()=>{t.to=await Pn(r,this.provider)})())}n.length&&await Promise.all(n);const s=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((s,r)=>{const a=[1e3,100];let o=0;const c=async()=>{try{const l=await this.provider.getTransaction(n);if(l!=null){s(l.replaceableTransaction(t));return}}catch(l){if(_n(l,"CANCELLED")||_n(l,"BAD_DATA")||_n(l,"NETWORK_ERROR")||_n(l,"UNSUPPORTED_OPERATION")){l.info==null&&(l.info={}),l.info.sendTransactionHash=n,r(l);return}if(_n(l,"INVALID_ARGUMENT")&&(o++,l.info==null&&(l.info={}),l.info.sendTransactionHash=n,o>10)){r(l);return}this.provider.emit("error",Qt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:l}))}this.provider._setTimeout(()=>{c()},a.pop()||4e3)};c()})}async signTransaction(e){const t=oh(e);if(t.from){const s=await Pn(t.from,this.provider);V(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=s}else t.from=this.address;const n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const t=typeof e=="string"?is(e):e;return await this.provider.send("personal_sign",[Ce(t),this.address.toLowerCase()])}async signTypedData(e,t,n){const s=oh(n),r=await Kn.resolveNames(e,t,s,async a=>{const o=await Pn(a);return V(o!=null,"TypedData does not support null address","value",a),o});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Kn.getPayload(r.domain,t,r.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t=typeof e=="string"?is(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ce(t)])}}class RD extends xD{#e;#t;#n;#i;#s;#a;#r;#o(){if(this.#i)return;const e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#i=setTimeout(()=>{this.#i=null;const t=this.#n;for(this.#n=[];t.length;){const n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(r=>r.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{const s=n.length===1?n[0].payload:n.map(r=>r.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const r=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:a,reject:o,payload:c}of n){if(this.destroyed){o(Qt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const l=r.filter(h=>h.id===c.id)[0];if(l==null){const h=Qt("missing response for request","BAD_DATA",{value:r,info:{payload:c}});this.emit("error",h),o(h);continue}if("error"in l){o(this.getRpcError(c,l));continue}a(l.result)}}catch(r){this.emit("debug",{action:"receiveRpcError",error:r});for(const{reject:a}of n)a(r)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},lE,t||{}),this.#n=[],this.#i=null,this.#a=null,this.#r=null;{let s=null;const r=new Promise(a=>{s=a});this.#s={promise:r,resolve:s}}const n=this._getOption("staticNetwork");typeof n=="boolean"?(V(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#a=Xn.from(e))):n&&(V(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#a=n)}_getOption(e){return this.#e[e]}get _network(){return pe(this.#a,"network is not available yet","NETWORK_ERROR"),this.#a}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&Re(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}const t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#a)return this.#a}else return e;return this.#r?await this.#r:this.ready?(this.#r=(async()=>{try{const t=Xn.from(Re(await this.send("eth_chainId",[])));return this.#r=null,t}catch(t){throw this.#r=null,t}})(),await this.#r):(this.#r=(async()=>{const t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#r=null}catch(s){throw this.#r=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Xn.from(Re(n.result));throw this.getRpcError(t,n)})(),await this.#r)}_start(){this.#s==null||this.#s.resolve==null||(this.#s.resolve(),this.#s=null,(async()=>{for(;this.#a==null&&!this.destroyed;)try{this.#a=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Qt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await TD(1e3)}this.#o()})())}async _waitUntilReady(){if(this.#s!=null)return await this.#s.promise}_getSubscriber(e){return e.type==="pending"?new MD(this):e.type==="event"?this._getOption("polling")?new Xf(this,e.filter):new ID(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new iE("orphan"):super._getSubscriber(e)}get ready(){return this.#s==null}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let s=n;n==="gasLimit"&&(s="gas"),t[s]=yi(Re(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=Ce(e[n]))}),e.accessList&&(t.accessList=br(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(n=>{const s=Fb(n);return{address:s.address,nonce:yi(s.nonce),chainId:yi(s.chainId),yParity:yi(s.signature.yParity),r:yi(s.signature.r),s:yi(s.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ga(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ga(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ga(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ga(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Ga):e.filter.address=Ga(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:n}=e,{error:s}=t;if(n==="eth_estimateGas"&&s.message){const o=s.message;if(!o.match(/revert/i)&&o.match(/insufficient funds/i))return Qt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return Qt("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:s}})}if(n==="eth_call"||n==="eth_estimateGas"){const o=tp(s),c=Pa.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],o?o.data:null);return c.info={error:s,payload:e},c}const r=JSON.stringify(DD(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return Qt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:s}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){const o=e.params[0];if(r.match(/insufficient funds|base fee exceeds gas limit/i))return Qt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:o,info:{error:s}});if(r.match(/nonce/i)&&r.match(/too low/i))return Qt("nonce has already been used","NONCE_EXPIRED",{transaction:o,info:{error:s}});if(r.match(/replacement transaction/i)&&r.match(/underpriced/i))return Qt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:o,info:{error:s}});if(r.match(/only replay-protected/i))return Qt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:o,info:{error:s}}})}let a=!!r.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?Qt("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:s,payload:e}}):Qt("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(Qt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=this.#t++,s=new Promise((r,a)=>{this.#n.push({resolve:r,reject:a,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#o(),s}async getSigner(e){e==null&&(e=0);const t=this.send("eth_accounts",[]);if(typeof e=="number"){const s=await t;if(e>=s.length)throw new Error("no such account");return new ep(this,s[e])}const{accounts:n}=await Fn({network:this.getNetwork(),accounts:t});e=Ct(e);for(const s of n)if(Ct(s)===e)return new ep(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new ep(this,t))}destroy(){this.#i&&(clearTimeout(this.#i),this.#i=null);for(const{payload:e,reject:t}of this.#n)t(Qt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#n=[],super.destroy()}}class ND extends RD{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=lE.pollingInterval),this.#e=n}_getSubscriber(e){const t=super._getSubscriber(e);return cE(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{cE(t)&&(t.pollingInterval=this.#e)})}}class FD extends ND{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new Pi(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const n=await t.send();n.assertOk();let s=n.bodyJson;return Array.isArray(s)||(s=[s]),s}}function tp(i){if(i==null)return null;if(typeof i.message=="string"&&i.message.match(/revert/i)&&Ft(i.data))return{message:i.message,data:i.data};if(typeof i=="object"){for(const e in i){const t=tp(i[e]);if(t)return t}return null}if(typeof i=="string")try{return tp(JSON.parse(i))}catch{}return null}function np(i,e){if(i!=null){if(typeof i.message=="string"&&e.push(i.message),typeof i=="object")for(const t in i)np(i[t],e);if(typeof i=="string")try{return np(JSON.parse(i),e)}catch{}}}function DD(i){const e=[];return np(i,e),e}const LD=["function register() external returns (uint256 agentId)","function register(string agentURI) external returns (uint256 agentId)","function register(string agentURI, tuple(string metadataKey, bytes metadataValue)[] metadata) external returns (uint256 agentId)","function setAgentURI(uint256 agentId, string newURI) external","function tokenURI(uint256 tokenId) external view returns (string)","function setMetadata(uint256 agentId, string metadataKey, bytes metadataValue) external","function getMetadata(uint256 agentId, string metadataKey) external view returns (bytes)","function getAgentWallet(uint256 agentId) external view returns (address)","function ownerOf(uint256 tokenId) external view returns (address)","function balanceOf(address owner) external view returns (uint256)","function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)","function totalSupply() external view returns (uint256)","function name() external view returns (string)","function symbol() external view returns (string)","function getVersion() external pure returns (string)","event Registered(uint256 indexed agentId, string agentURI, address indexed owner)","event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"],Tr={identityRegistry:"0x8004A818BFB912233c491871b3d84c89A494BD9e",reputationRegistry:"0x8004B663056A597Dffe9eCcC1965A193B7388713",validationRegistry:"0x8004Cb1BF31DAf7788923b405b754f57acEB4272"},Un={identityRegistry:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",reputationRegistry:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",validationRegistry:""},PD={1:Un,10:Un,56:Un,100:Un,137:Un,250:Un,324:Un,1284:Un,5e3:Un,8453:Un,42161:Un,42220:Un,43114:Un,59144:Un,534352:Un,97:Tr,11155111:Tr,84532:Tr,421614:Tr,11155420:Tr,80002:Tr,43113:Tr},kD={base:8453,"base-mainnet":8453,"base-sepolia":84532,ethereum:1,mainnet:1},UD={8453:"https://mainnet.base.org",84532:"https://sepolia.base.org",1:"https://eth.llamarpc.com"};async function ip(i,{rpcURL:e,registry:t}={}){if(!i)throw new Error("loadManifest: source required");if(i.startsWith("agent://"))return OD(i,{rpcURL:e,registryOverride:t});if(i.startsWith("ipfs://")||i.startsWith("ar://")){const n=ks(i),s=await sp(n);return ch(s,{baseURI:rp(n)})}if(i.startsWith("http")){const n=await sp(i);return ch(n,{baseURI:rp(i)})}throw new Error(`Unsupported manifest source: ${i}`)}async function OD(i,{rpcURL:e,registryOverride:t}){const n=i.match(/^agent:\/\/([^/]+)\/(\d+)$/);if(!n)throw new Error(`Malformed agent URI: ${i}`);const[,s,r]=n,a=kD[s.toLowerCase()]||Number(s);if(!a)throw new Error(`Unknown chain: ${s}`);const o=PD[a],c=t||o?.identityRegistry;if(!c)throw new Error(`No registry deployed on chain ${a}. Pass registry= override.`);const l=new FD(e||UD[a]),h=new Ua(c,LD,l),u=BigInt(r),d=await h.tokenURI(u);if(!d)throw new Error(`Agent ${r} on chain ${a} has no URI`);const f=ks(d),m=await sp(f),g=ch(m,{baseURI:rp(f)});return g.id={...g.id,chain:s,chainId:a,registry:c,agentId:r},g}async function sp(i){let e;try{e=await fetch(i)}catch{e=await a0(i)}if(!e.ok)throw new Error(`Manifest fetch failed: ${i} (${e.status})`);return e.json()}function ch(i,{baseURI:e=""}={}){if(i.spec&&i.spec.startsWith("agent-manifest/")){const t={...i,_baseURI:e};return t.body=t.body||{},!t.body.uri&&t.image&&(t.body.uri=t.image),t}if(i.type&&i.type.includes("eip-8004")){const t=i.registrations?.[0]||{};return{spec:"agent-manifest/0.1",_baseURI:e,_source:"erc8004-registration",id:{agentId:t.agentId?.toString()},name:i.name,description:i.description,image:i.image,body:{uri:i.image,format:"gltf-binary"},brain:{provider:"none"},voice:{tts:{provider:"browser"},stt:{provider:"browser"}},skills:[],memory:{mode:"local"},tools:["wave","lookAt","play_clip","setExpression"],version:"0.1.0"}}return{spec:"agent-manifest/0.1",_baseURI:e,name:i.name||"Unnamed agent",description:i.description||"",body:{uri:i.body?.uri||i.image||i.model||"",format:i.body?.format||"gltf-binary"},brain:i.brain||{provider:"none"},voice:i.voice||{tts:{provider:"browser"},stt:{provider:"browser"}},skills:i.skills||[],memory:i.memory||{mode:"local"},tools:i.tools||["wave","lookAt","play_clip","setExpression"],version:i.version||"0.1.0"}}function rp(i){const e=i.lastIndexOf("/");return e>=0?i.slice(0,e+1):i}async function hE(i,e){if(!i._baseURI)return null;try{const t=new URL(e,i._baseURI).href,n=await fetch(t);return n.ok?n.text():null}catch{return null}}class ps extends Error{constructor(e,t,{status:n}={}){super(t),this.name="AgentResolveError",this.code=e,n!==void 0&&(this.status=n)}}async function uE(i,{fetchFn:e}){let t;try{t=await e(i,{credentials:"include"})}catch(n){throw new ps("network",`network error fetching ${i}: ${n.message||n}`)}if(t.status===401||t.status===403)throw new ps("unauthorized",`unauthorized fetching ${i} (${t.status})`,{status:t.status});if(t.status===404)throw new ps("not_found",`resource not found: ${i}`,{status:404});if(!t.ok)throw new ps("network",`request failed: ${i} (${t.status})`,{status:t.status});try{return await t.json()}catch(n){throw new ps("network",`invalid JSON from ${i}: ${n.message||n}`)}}async function QD(i,{origin:e=typeof location<"u"?location.origin:"",fetchFn:t=fetch}={}){if(!i)throw new ps("not_found","agentId required");const n=t.bind(typeof globalThis<"u"?globalThis:void 0),r=(await uE(`${e}/api/agents/${encodeURIComponent(i)}`,{fetchFn:n}))?.agent;if(!r)throw new ps("not_found",`agent ${i} not found`);if(!r.avatar_id)throw new ps("no_avatar",`agent ${i} has no avatar bound`);const o=(await uE(`${e}/api/avatars/${encodeURIComponent(r.avatar_id)}`,{fetchFn:n}))?.avatar;if(!o||!o.url)throw new ps("no_avatar",`avatar ${r.avatar_id} has no url`);const c=Array.isArray(r.skills)?r.skills.map(l=>typeof l=="string"?{name:l}:l).filter(Boolean):[];return{spec:"agent-manifest/0.1",name:r.name||"Agent",description:r.description||"",id:{agentId:r.id,owner:r.wallet_address,chainId:r.chain_id,walletAddress:r.wallet_address},body:{uri:o.url,format:"gltf-binary"},brain:{},voice:{tts:{provider:"browser"},stt:{provider:"browser"}},skills:c,memory:{mode:"remote",namespace:r.id},tools:["wave","lookAt","play_clip","setExpression","speak","remember"],version:"0.1.0",_baseURI:`${e}/agent/${r.id}/`,_source:"agent-id"}}const GD=["inline","floating","section","fullscreen"],HD=`:host {display: block;position: relative;@@ -3880,6 +4035,18 @@ ${this.instructions}border-radius: var(--agent-bubble-radius);overflow: hidden;box-shadow: var(--agent-shadow);+ transition:+ width 0.3s cubic-bezier(0.4, 0, 0.2, 1),+ height 0.3s cubic-bezier(0.4, 0, 0.2, 1),+ border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);+ }+ @media (prefers-reduced-motion: reduce) {+ :host([mode="floating"]) { transition: none; }+ }+ /* Inline responsive: height follows width at a 3:4 portrait ratio */+ :host([mode="inline"][data-responsive]) {+ height: auto;+ aspect-ratio: var(--agent-aspect, 3/4);}:host([mode="fullscreen"]) {position: fixed;@@ -3896,6 +4063,33 @@ ${this.instructions}height: 100%;}.stage canvas { display: block; }+ /* Pill tap target — shown when collapsed to pill on narrow viewports */+ .pill-btn {+ display: none;+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ background: none;+ border: 0;+ cursor: pointer;+ border-radius: inherit;+ z-index: 10;+ }+ /* Swipe-down handle visible when bottom-sheet is expanded */+ .pill-drag {+ display: none;+ position: absolute;+ top: 8px;+ left: 50%;+ transform: translateX(-50%);+ width: 36px;+ height: 4px;+ border-radius: 2px;+ background: rgba(255,255,255,0.25);+ pointer-events: none;+ z-index: 20;+ }.chrome {position: absolute;left: 12px;@@ -3982,7 +4176,7 @@ ${this.instructions}padding: 16px;font: 14px var(--agent-chat-font);}-`;class ep extends HTMLElement{static get observedAttributes(){return["src","manifest","body","agent-id","mode","position","width","height","voice","api-key","key-proxy"]}constructor(){super(),this.attachShadow({mode:"open"}),this._viewer=null,this._scene=null,this._runtime=null,this._memory=null,this._skills=null,this._manifest=null,this._mounted=!1,this._booting=!1,this._listening=!1}connectedCallback(){this._renderShell(),this._applyLayout(),this._observeViewport(),this.hasAttribute("eager")&&this._boot()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){this._mounted&&(["mode","position","width","height"].includes(e)&&this._applyLayout(),["src","manifest","body","agent-id"].includes(e)&&(this._teardown(),this._boot()))}_renderShell(){const e=document.createElement("style");e.textContent=ED,this.shadowRoot.appendChild(e);const t=document.createElement("div");t.className="stage",t.part="stage",this.shadowRoot.appendChild(t),this._stageEl=t;const n=document.createElement("div");n.className="poster",this.getAttribute("poster")&&(n.style.backgroundImage=`url(${this.getAttribute("poster")})`),this.shadowRoot.appendChild(n),this._posterEl=n;const s=document.createElement("div");if(s.className="loading",s.textContent="Loading...",s.hidden=!0,this.shadowRoot.appendChild(s),this._loadingEl=s,!this.hasAttribute("kiosk")){const r=document.createElement("div");r.className="chrome",r.part="chrome";const a=document.createElement("div");a.className="chat",a.part="chat";const o=document.createElement("div");o.className="input-row";const c=document.createElement("input");c.type="text",c.placeholder="Say something...",c.addEventListener("keydown",h=>{if(h.key==="Enter"&&c.value.trim()){const u=c.value.trim();c.value="",this.say(u)}});const l=document.createElement("button");l.className="icon mic",l.title="Push to talk",l.innerHTML="🎙",l.addEventListener("click",()=>this._toggleMic()),o.appendChild(c),o.appendChild(l),r.appendChild(a),r.appendChild(o),this.shadowRoot.appendChild(r),this._chatEl=a,this._inputEl=c,this._micEl=l}}_applyLayout(){const e=this.getAttribute("mode")||"inline";if(!xD.includes(e))return;if(e==="floating"){const s=this.getAttribute("position")||"bottom-right",r=(this.getAttribute("offset")||"24px 24px").split(/\s+/),[a,o]=[r[0],r[1]||r[0]];this.style.top=this.style.bottom=this.style.left=this.style.right="",s.includes("top")?this.style.top=a:this.style.bottom=a,s.includes("left")?this.style.left=o:s.includes("right")?this.style.right=o:s.includes("center")&&(this.style.left="50%",this.style.transform="translateX(-50%)")}else this.style.top=this.style.bottom=this.style.left=this.style.right=this.style.transform="";const t=this.getAttribute("width"),n=this.getAttribute("height");t&&this.style.setProperty("--agent-width",t),n&&this.style.setProperty("--agent-height",n),e==="inline"&&(t&&(this.style.width=t),n&&(this.style.height=n))}_observeViewport(){if(!this.hasAttribute("eager")){if(typeof IntersectionObserver>"u"){this._boot();return}this._io=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&(this._io.disconnect(),this._boot())}),this._io.observe(this)}}async _boot(){if(!(this._booting||this._mounted)){this._booting=!0;try{this._loadingEl.hidden=!1,this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"manifest",pct:.1}}));const e=await this._resolveManifest();if(this._manifest=e,this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"manifest",pct:.3}})),typeof e.brain?.instructions=="string"&&e.brain.instructions.endsWith(".md")){const c=await nE(e,e.brain.instructions);c&&(e.instructions=_D(c))}else e.brain?.instructions&&(e.instructions=e.brain.instructions);this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"body",pct:.45}}));const t=new Gd(this._stageEl,{kiosk:this.hasAttribute("kiosk")});this._viewer=t;const n=Ps(e.body?.uri);n&&await t.load(n,"",new Map),this._scene=new n0(t),this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"memory",pct:.6}}));const s=e.id?.agentId||this.getAttribute("memory-key")||e.name||"anon";this._memory=await xi.load({mode:this.getAttribute("memory")||e.memory?.mode||"local",namespace:s,manifestURI:e._baseURI+"manifest.json",fetchFn:fetch.bind(globalThis)}),this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"skills",pct:.75}})),this._skills=new s0({trust:this.getAttribute("skill-trust")||"owned-only",ownerAddress:e.id?.owner});const r=e.skills||[];for(const c of r)try{const l=await this._skills.install(c,{bundleBase:e._baseURI});this.dispatchEvent(new CustomEvent("skill:loaded",{detail:{name:l.name,uri:l.uri}}))}catch(l){console.warn("[agent-3d] skill load failed",c,l)}this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"brain",pct:.9}}));const a={apiKey:this.getAttribute("api-key")||void 0,proxyURL:this.getAttribute("key-proxy")||void 0},o=this._parseTTSAttribute();o&&(e.voice=e.voice||{},e.voice.tts={...e.voice.tts||{},...o}),this._runtime=new $m({manifest:e,viewer:this._scene,memory:this._memory,skills:this._skills,providerConfig:a});for(const c of["brain:thinking","brain:message","skill:tool-called","voice:speech-start","voice:speech-end","voice:transcript","voice:listen-start","memory:write"])this._runtime.addEventListener(c,l=>{this.dispatchEvent(new CustomEvent(c,{detail:l.detail,bubbles:!0,composed:!0})),c==="brain:message"&&this._chatEl&&this._renderMessage(l.detail)});this._mounted=!0,this._loadingEl.hidden=!0,this._posterEl.style.opacity="0",this.dispatchEvent(new CustomEvent("agent:ready",{detail:{agent:this,manifest:e},bubbles:!0,composed:!0}))}catch(e){console.error("[agent-3d] boot failed",e),this._loadingEl.hidden=!0,this._showError(e),this.dispatchEvent(new CustomEvent("agent:error",{detail:{phase:"boot",error:e},bubbles:!0,composed:!0}))}finally{this._booting=!1}}}async _resolveManifest(){const e=this.getAttribute("src"),t=this.getAttribute("manifest"),n=this.getAttribute("body"),s=this.getAttribute("agent-id");if(e)return s&&console.warn("[agent-3d] both src and agent-id provided; using src"),Jf(e,{rpcURL:this.getAttribute("rpc-url"),registry:this.getAttribute("registry")});if(s)return bD(s);if(t)return Jf(t);if(n){const r=this.getAttribute("instructions");return{spec:"agent-manifest/0.1",_baseURI:"",name:this.getAttribute("name")||"Agent",body:{uri:n,format:"gltf-binary"},brain:{provider:this.getAttribute("brain")?"anthropic":"none",model:this.getAttribute("brain")||void 0,instructions:r||"You are an embodied 3D agent."},instructions:r||"You are an embodied 3D agent.",voice:{tts:{provider:"browser"},stt:{provider:"browser"}},skills:(this.getAttribute("skills")||"").split(",").map(a=>a.trim()).filter(Boolean).map(a=>({uri:a})),memory:{mode:this.getAttribute("memory")||"local"},tools:["wave","lookAt","play_clip","setExpression","speak","remember"],version:"0.1.0"}}throw new Error("<agent-3d> requires src=, manifest=, or body= attribute")}_renderMessage({role:e,content:t}){if(!this._chatEl||!t)return;const n=document.createElement("div");n.className="msg",n.innerHTML=`<div class="role">${e}</div><div class="body"></div>`,n.querySelector(".body").textContent=t,this._chatEl.appendChild(n),this._chatEl.scrollTop=this._chatEl.scrollHeight}_showError(e){const t=document.createElement("div");t.className="error",t.textContent=`Couldn't load agent: ${e.message||e}`,this.shadowRoot.appendChild(t)}async _toggleMic(){if(this._runtime){if(this._listening){this._runtime.stt?.stop(),this._listening=!1,this._micEl.dataset.listening="false";return}this._listening=!0,this._micEl.dataset.listening="true";try{const e=await this._runtime.listen();e&&await this.say(e,{voice:!0})}catch(e){console.warn("[agent-3d] listen failed",e)}finally{this._listening=!1,this._micEl.dataset.listening="false"}}}_teardown(){try{this._io?.disconnect()}catch{}try{this._runtime?.destroy()}catch{}try{this._viewer?.dispose?.()}catch{}this._mounted=!1,this._runtime=this._viewer=this._scene=this._memory=this._skills=null}async say(e,t={}){return this._runtime||await this._waitForReady(),this._runtime.send(e,{voice:t.voice??this.hasAttribute("voice")})}async ask(e,t={}){return(await this.say(e,t))?.text||""}clearConversation(){this._runtime?.clearConversation()}async wave(e){return this._scene?.playAnimationByHint("wave",e)}async lookAt(e){return this._scene?.lookAt(e)}async play(e,t){return this._scene?.playClipByName(e,t)}async installSkill(e){if(!this._skills)throw new Error("Agent not mounted");return this._skills.install({uri:e})}uninstallSkill(e){return this._skills?.uninstall(e)}get skills(){return this._skills?.all()||[]}get memory(){return this._memory}get manifest(){return this._manifest}get runtime(){return this._runtime}setMode(e){this.setAttribute("mode",e)}setPosition(e,t){this.setAttribute("position",e),t&&this.setAttribute("offset",t)}setSize(e,t){this.setAttribute("width",e),this.setAttribute("height",t)}pause(){this._runtime?.pause()}resume(){}destroy(){this._teardown()}_waitForReady(){return this._mounted?Promise.resolve():new Promise(e=>{const t=()=>{this.removeEventListener("agent:ready",t),e()};this.addEventListener("agent:ready",t),this._booting||this._boot()})}}function _D(i){const e=i.match(/^---\n[\s\S]*?\n---\n?([\s\S]*)$/);return e?e[1]:i}customElements.get("agent-3d")||customElements.define("agent-3d",ep);const yD=["row","circle","freeform"],wD=`+`;class ap extends HTMLElement{static get observedAttributes(){return["src","manifest","body","agent-id","mode","position","width","height","voice","api-key","key-proxy","responsive"]}constructor(){super(),this.attachShadow({mode:"open"}),this._viewer=null,this._scene=null,this._runtime=null,this._memory=null,this._skills=null,this._manifest=null,this._mounted=!1,this._booting=!1,this._listening=!1,this._pillActive=!1,this._mqNarrow=null,this._mqNarrowHandler=null,this._ro=null,this._outsideTapHandler=null}connectedCallback(){this._renderShell(),this._applyLayout(),this._setupResponsive(),this._observeViewport(),this.hasAttribute("eager")&&this._boot()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e,t,n){this._mounted&&(["mode","position","width","height","responsive"].includes(e)&&this._applyLayout(),["src","manifest","body","agent-id"].includes(e)&&(this._teardown(),this._boot()))}_renderShell(){const e=document.createElement("style");e.textContent=HD,this.shadowRoot.appendChild(e);const t=document.createElement("div");t.className="stage",t.part="stage",this.shadowRoot.appendChild(t),this._stageEl=t;const n=document.createElement("div");n.className="poster",this.getAttribute("poster")&&(n.style.backgroundImage=`url(${this.getAttribute("poster")})`),this.shadowRoot.appendChild(n),this._posterEl=n;const s=document.createElement("div");s.className="loading",s.textContent="Loading...",s.hidden=!0,this.shadowRoot.appendChild(s),this._loadingEl=s;const r=document.createElement("button");r.className="pill-btn",r.setAttribute("aria-label","Open agent"),r.addEventListener("click",()=>this._expandPill()),r.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this._expandPill())}),this.shadowRoot.appendChild(r),this._pillBtn=r;const a=document.createElement("div");if(a.className="pill-drag",this.shadowRoot.appendChild(a),this._pillDrag=a,!this.hasAttribute("kiosk")){const o=document.createElement("div");o.className="chrome",o.part="chrome";const c=document.createElement("div");c.className="chat",c.part="chat";const l=document.createElement("div");l.className="input-row";const h=document.createElement("input");h.type="text",h.placeholder="Say something...",h.addEventListener("keydown",d=>{if(d.key==="Enter"&&h.value.trim()){const f=h.value.trim();h.value="",this.say(f)}});const u=document.createElement("button");u.className="icon mic",u.title="Push to talk",u.innerHTML="🎙",u.addEventListener("click",()=>this._toggleMic()),l.appendChild(h),l.appendChild(u),o.appendChild(c),o.appendChild(l),this.shadowRoot.appendChild(o),this._chatEl=c,this._inputEl=h,this._micEl=u}}_isResponsive(){return this.getAttribute("responsive")!=="false"}_clampWidth(e){const t=_parsePx(e);if(!t)return e;const n=Math.round(Math.max(160,t*.65)),s=Math.round(t/1440*100);return`clamp(${n}px, ${s}vw, ${t}px)`}_clampHeight(e){const t=_parsePx(e);if(!t)return e;const n=Math.round(Math.max(200,t*.65)),s=Math.round(t/900*100);return`clamp(${n}px, ${s}vh, ${t}px)`}_applyLayout(){const e=this.getAttribute("mode")||"inline";if(!GD.includes(e))return;const t=this._isResponsive();if(e==="floating"){if(!this._pillActive){const r=this.getAttribute("position")||"bottom-right",a=(this.getAttribute("offset")||"24px 24px").split(/\s+/),[o,c]=[a[0],a[1]||a[0]];this.style.top=this.style.bottom=this.style.left=this.style.right="",r.includes("top")?this.style.top=o:this.style.bottom=o,r.includes("left")?this.style.left=c:r.includes("right")?this.style.right=c:r.includes("center")&&(this.style.left="50%",this.style.transform="translateX(-50%)")}const n=this.getAttribute("width")||"320px",s=this.getAttribute("height")||"420px";this.style.setProperty("--agent-width",t?this._clampWidth(n):n),this.style.setProperty("--agent-height",t?this._clampHeight(s):s)}else{this.style.top=this.style.bottom=this.style.left=this.style.right=this.style.transform="";const n=this.getAttribute("width"),s=this.getAttribute("height");e==="inline"&&(n&&(this.style.width=t?this._clampWidth(n):n),s?(this.style.height=s,this.removeAttribute("data-responsive")):t&&n&&(this.style.height="",this.setAttribute("data-responsive",""))),n&&this.style.setProperty("--agent-width",t?this._clampWidth(n):n),s&&this.style.setProperty("--agent-height",t?this._clampHeight(s):s)}}_setupResponsive(){const e=this.getAttribute("mode")||"inline";e==="inline"&&typeof ResizeObserver<"u"&&(this._ro=new ResizeObserver(()=>this._applyLayout()),this._ro.observe(this)),e==="floating"&&this._isResponsive()&&typeof window<"u"&&(this._mqNarrow=window.matchMedia("(max-width: 479px)"),this._mqNarrowHandler=n=>this._updatePillState(n.matches),this._mqNarrow.addEventListener("change",this._mqNarrowHandler),this._updatePillState(this._mqNarrow.matches));let t=0;this.shadowRoot.addEventListener("touchstart",n=>{t=n.touches[0].clientY},{passive:!0}),this.shadowRoot.addEventListener("touchend",n=>{n.changedTouches[0].clientY-t>60&&this._pillActive&&this.getAttribute("aria-expanded")==="true"&&this._collapsePill()},{passive:!0})}_updatePillState(e){e&&!this._pillActive?(this._pillActive=!0,this._collapsePill()):!e&&this._pillActive&&(this._pillActive=!1,this._restoreFromPill())}_collapsePill(){this.style.width="56px",this.style.height="56px",this.style.borderRadius="50%",this.setAttribute("aria-expanded","false"),this._pillBtn.style.display="block",this._pillDrag.style.display="none";const e=this.shadowRoot.querySelector(".chrome");e&&(e.style.display="none"),this._stageEl.style.display="none",this._outsideTapHandler&&(document.removeEventListener("pointerdown",this._outsideTapHandler),this._outsideTapHandler=null)}_expandPill(){if(!this._pillActive)return;this.style.width="100vw",this.style.height="70vh",this.style.borderRadius="16px 16px 0 0",this.style.bottom="0",this.style.top="auto",this.style.left="0",this.style.right="0",this.style.transform="none",this.setAttribute("aria-expanded","true"),this._pillBtn.style.display="none",this._pillDrag.style.display="block";const e=this.shadowRoot.querySelector(".chrome");e&&(e.style.display=""),this._stageEl.style.display="",this._outsideTapHandler=t=>{t.composedPath().includes(this)||this._collapsePill()},setTimeout(()=>document.addEventListener("pointerdown",this._outsideTapHandler),0)}_restoreFromPill(){this.removeAttribute("aria-expanded"),this._pillBtn.style.display="none",this._pillDrag.style.display="none";const e=this.shadowRoot.querySelector(".chrome");e&&(e.style.display=""),this._stageEl.style.display="",this.style.width=this.style.height=this.style.borderRadius="",this.style.bottom=this.style.top=this.style.left=this.style.right=this.style.transform="",this._applyLayout(),this._outsideTapHandler&&(document.removeEventListener("pointerdown",this._outsideTapHandler),this._outsideTapHandler=null)}_observeViewport(){if(!this.hasAttribute("eager")){if(typeof IntersectionObserver>"u"){this._boot();return}this._io=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&(this._io.disconnect(),this._boot())}),this._io.observe(this)}}async _boot(){if(!(this._booting||this._mounted)){this._booting=!0;try{this._loadingEl.hidden=!1,this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"manifest",pct:.1}}));const e=await this._resolveManifest();if(this._manifest=e,this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"manifest",pct:.3}})),typeof e.brain?.instructions=="string"&&e.brain.instructions.endsWith(".md")){const c=await hE(e,e.brain.instructions);c&&(e.instructions=zD(c))}else e.brain?.instructions&&(e.instructions=e.brain.instructions);this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"body",pct:.45}}));const t=new Kd(this._stageEl,{kiosk:this.hasAttribute("kiosk")});this._viewer=t;const n=ks(e.body?.uri);n&&await t.load(n,"",new Map),this._scene=new c0(t),this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"memory",pct:.6}}));const s=e.id?.agentId||this.getAttribute("memory-key")||e.name||"anon";this._memory=await Ei.load({mode:this.getAttribute("memory")||e.memory?.mode||"local",namespace:s,manifestURI:e._baseURI+"manifest.json",fetchFn:fetch.bind(globalThis)}),this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"skills",pct:.75}})),this._skills=new d0({trust:this.getAttribute("skill-trust")||"owned-only",ownerAddress:e.id?.owner});const r=e.skills||[];for(const c of r)try{const l=await this._skills.install(c,{bundleBase:e._baseURI});this.dispatchEvent(new CustomEvent("skill:loaded",{detail:{name:l.name,uri:l.uri}}))}catch(l){console.warn("[agent-3d] skill load failed",c,l)}this.dispatchEvent(new CustomEvent("agent:load-progress",{detail:{phase:"brain",pct:.9}}));const a={apiKey:this.getAttribute("api-key")||void 0,proxyURL:this.getAttribute("key-proxy")||void 0},o=this._parseTTSAttribute();o&&(e.voice=e.voice||{},e.voice.tts={...e.voice.tts||{},...o}),this._runtime=new r0({manifest:e,viewer:this._scene,memory:this._memory,skills:this._skills,providerConfig:a});for(const c of["brain:thinking","brain:message","skill:tool-called","voice:speech-start","voice:speech-end","voice:transcript","voice:listen-start","memory:write"])this._runtime.addEventListener(c,l=>{this.dispatchEvent(new CustomEvent(c,{detail:l.detail,bubbles:!0,composed:!0})),c==="brain:message"&&this._chatEl&&this._renderMessage(l.detail)});this._mounted=!0,this._loadingEl.hidden=!0,this._pillActive||(this._posterEl.style.opacity="0"),this.dispatchEvent(new CustomEvent("agent:ready",{detail:{agent:this,manifest:e},bubbles:!0,composed:!0}))}catch(e){console.error("[agent-3d] boot failed",e),this._loadingEl.hidden=!0,this._showError(e),this.dispatchEvent(new CustomEvent("agent:error",{detail:{phase:"boot",error:e},bubbles:!0,composed:!0}))}finally{this._booting=!1}}}async _resolveManifest(){const e=this.getAttribute("src"),t=this.getAttribute("manifest"),n=this.getAttribute("body"),s=this.getAttribute("agent-id");if(e)return s&&console.warn("[agent-3d] both src and agent-id provided; using src"),ip(e,{rpcURL:this.getAttribute("rpc-url"),registry:this.getAttribute("registry")});if(s)return QD(s);if(t)return ip(t);if(n){const r=this.getAttribute("instructions");return{spec:"agent-manifest/0.1",_baseURI:"",name:this.getAttribute("name")||"Agent",body:{uri:n,format:"gltf-binary"},brain:{provider:this.getAttribute("brain")?"anthropic":"none",model:this.getAttribute("brain")||void 0,instructions:r||"You are an embodied 3D agent."},instructions:r||"You are an embodied 3D agent.",voice:{tts:{provider:"browser"},stt:{provider:"browser"}},skills:(this.getAttribute("skills")||"").split(",").map(a=>a.trim()).filter(Boolean).map(a=>({uri:a})),memory:{mode:this.getAttribute("memory")||"local"},tools:["wave","lookAt","play_clip","setExpression","speak","remember"],version:"0.1.0"}}throw new Error("<agent-3d> requires src=, manifest=, or body= attribute")}_renderMessage({role:e,content:t}){if(!this._chatEl||!t)return;const n=document.createElement("div");n.className="msg",n.innerHTML=`<div class="role">${e}</div><div class="body"></div>`,n.querySelector(".body").textContent=t,this._chatEl.appendChild(n),this._chatEl.scrollTop=this._chatEl.scrollHeight}_showError(e){const t=document.createElement("div");t.className="error",t.textContent=`Couldn't load agent: ${e.message||e}`,this.shadowRoot.appendChild(t)}async _toggleMic(){if(this._runtime){if(this._listening){this._runtime.stt?.stop(),this._listening=!1,this._micEl.dataset.listening="false";return}this._listening=!0,this._micEl.dataset.listening="true";try{const e=await this._runtime.listen();e&&await this.say(e,{voice:!0})}catch(e){console.warn("[agent-3d] listen failed",e)}finally{this._listening=!1,this._micEl.dataset.listening="false"}}}_teardown(){try{this._io?.disconnect()}catch{}try{this._ro?.disconnect()}catch{}try{this._mqNarrow&&this._mqNarrowHandler&&this._mqNarrow.removeEventListener("change",this._mqNarrowHandler)}catch{}this._outsideTapHandler&&(document.removeEventListener("pointerdown",this._outsideTapHandler),this._outsideTapHandler=null);try{this._runtime?.destroy()}catch{}try{this._viewer?.dispose?.()}catch{}this._mounted=!1,this._pillActive=!1,this._runtime=this._viewer=this._scene=this._memory=this._skills=null}async say(e,t={}){return this._runtime||await this._waitForReady(),this._runtime.send(e,{voice:t.voice??this.hasAttribute("voice")})}async ask(e,t={}){return(await this.say(e,t))?.text||""}clearConversation(){this._runtime?.clearConversation()}async wave(e){return this._scene?.playAnimationByHint("wave",e)}async lookAt(e){return this._scene?.lookAt(e)}async play(e,t){return this._scene?.playClipByName(e,t)}async installSkill(e){if(!this._skills)throw new Error("Agent not mounted");return this._skills.install({uri:e})}uninstallSkill(e){return this._skills?.uninstall(e)}get skills(){return this._skills?.all()||[]}get memory(){return this._memory}get manifest(){return this._manifest}get runtime(){return this._runtime}setMode(e){this.setAttribute("mode",e)}setPosition(e,t){this.setAttribute("position",e),t&&this.setAttribute("offset",t)}setSize(e,t){this.setAttribute("width",e),this.setAttribute("height",t)}pause(){this._runtime?.pause()}resume(){}destroy(){this._teardown()}_waitForReady(){return this._mounted?Promise.resolve():new Promise(e=>{const t=()=>{this.removeEventListener("agent:ready",t),e()};this.addEventListener("agent:ready",t),this._booting||this._boot()})}}function zD(i){const e=i.match(/^---\n[\s\S]*?\n---\n?([\s\S]*)$/);return e?e[1]:i}customElements.get("agent-3d")||customElements.define("agent-3d",ap);const VD=["row","circle","freeform"],WD=`:host {display: block;position: relative;@@ -4002,4 +4196,4 @@ ${this.instructions}position: absolute;pointer-events: none;}-`;class sE extends HTMLElement{static get observedAttributes(){return["formation"]}constructor(){super(),this.attachShadow({mode:"open"}),this._viewer=null,this._agents=[],this._initialized=!1}connectedCallback(){this._renderShell(),this._initViewer(),this._mo=new MutationObserver(()=>this._repositionAll()),this._mo.observe(this,{childList:!0})}disconnectedCallback(){try{this._mo?.disconnect()}catch{}for(const e of[...this._agents])this.unregisterAgent(e.element);try{this._viewer?.dispose?.()}catch{}this._viewer=null,this._initialized=!1}attributeChangedCallback(e){e==="formation"&&this._repositionAll()}get formation(){const e=this.getAttribute("formation")||"row";return yD.includes(e)?e:"row"}get viewer(){return this._viewer}_renderShell(){const e=document.createElement("style");e.textContent=wD,this.shadowRoot.appendChild(e);const t=document.createElement("div");t.className="stage-canvas",t.part="stage",this.shadowRoot.appendChild(t),this._canvasBox=t;const n=document.createElement("slot");this.shadowRoot.appendChild(n)}_initViewer(){if(!this._initialized){this._viewer=new Gd(this._canvasBox,{kiosk:!0}),this._viewer.defaultCamera.position.set(0,1.55,3.4),this._viewer.defaultCamera.lookAt(0,1.2,0),this._viewer.controls.target.set(0,1.2,0),this._viewer.controls.update();try{this._viewer.updateLights?.()}catch{}try{this._viewer.updateEnvironment?.()}catch{}this._viewer.invalidate(),this._initialized=!0}}registerAgent(e,{id:t,group:n,manifest:s}){const r=this._uniqueId(t||s?.name||"agent"),a={id:r,element:e,group:n,manifest:s};return this._agents.push(a),this._viewer?.scene.add(n),this._repositionAll(),this.dispatchEvent(new CustomEvent("stage:agent-joined",{detail:{agentId:r,element:e,manifest:s},bubbles:!0,composed:!0})),r}unregisterAgent(e){const t=this._agents.findIndex(s=>s.element===e);if(t<0)return;const[n]=this._agents.splice(t,1);try{this._viewer?.scene.remove(n.group)}catch{}CD(n.group),this._repositionAll(),this.dispatchEvent(new CustomEvent("stage:agent-left",{detail:{agentId:n.id,element:n.element},bubbles:!0,composed:!0}))}_uniqueId(e){let t=e,n=1;const s=new Set(this._agents.map(r=>r.id));for(;s.has(t);)t=`${e}-${n++}`;return t}getAgents(){return this._agents.map(({id:e,group:t,manifest:n,element:s})=>({agentId:e,name:n?.name||e,position:[+t.position.x.toFixed(3),+t.position.y.toFixed(3),+t.position.z.toFixed(3)],element:s}))}broadcast(e,t){const n={from:e,event:t};for(const s of this._agents)s.id!==e&&s.element.dispatchEvent(new CustomEvent("stage:message",{detail:n}));this.dispatchEvent(new CustomEvent("stage:message",{detail:n,bubbles:!0,composed:!0}))}async routeMessage(e,t,n){const s=this._agents.find(r=>r.id===t);if(!s)return{ok:!1,error:`No agent "${t}" on stage`};try{return{ok:!0,reply:(await s.element.say(`[from ${e}] ${n}`))?.text||""}}catch(r){return{ok:!1,error:r?.message||String(r)}}}async addAgent(e){const t=document.createElement("agent-3d");return e&&typeof e=="object"&&(t._inlineManifest=e),t.hasAttribute("eager")||t.setAttribute("eager",""),this.appendChild(t),t}removeAgent(e){const t=this._agents.find(n=>n.id===e);t&&t.element.remove()}_repositionAll(){const e=this._agents.length;if(!(!e||!this._viewer)){for(let t=0;t<e;t++){const{element:n,group:s,manifest:r}=this._agents[t],a=this._slotFor(t,e);s.position.copy(a.world),s.lookAt(0,a.world.y+1,a.world.z+5),n.style.position="absolute",n.style.left=a.dom.left,n.style.top=a.dom.top,n.style.width=a.dom.width,n.style.height=a.dom.height,n.style.pointerEvents="none"}this._viewer.invalidate()}}_slotFor(e,t){const n=this.formation,s=1/Math.max(t,1);if(n==="circle"){const o=e/t*Math.PI*2,c=Math.max(.8,.4*t);return{world:new H(Math.sin(o)*c,0,-Math.cos(o)*c+c*.5),dom:{left:`${e*s*100}%`,top:"0",width:`${s*100}%`,height:"100%"}}}if(n==="freeform")return{world:new H(0,0,0),dom:{left:"0",top:"0",width:"100%",height:"100%"}};const a=(e-(t-1)/2)*1.1;return{world:new H(a,0,0),dom:{left:`${e*s*100}%`,top:"0",width:`${s*100}%`,height:"100%"}}}}function CD(i){i.traverse(e=>{if(e.geometry)try{e.geometry.dispose()}catch{}if(e.material){const t=Array.isArray(e.material)?e.material:[e.material];for(const n of t){for(const s of Object.keys(n)){const r=n[s];if(r&&r.isTexture)try{r.dispose()}catch{}}try{n.dispose()}catch{}}}}),i.parent&&i.parent.remove(i)}customElements.get("agent-stage")||customElements.define("agent-stage",sE);const vD=(i="agent-3d")=>{customElements.get(i)||customElements.define(i,ep)};en.Agent3DElement=ep,en.AgentStageElement=sE,en.Memory=xi,en.Runtime=$m,en.SceneController=n0,en.Skill=i0,en.SkillRegistry=s0,en.Viewer=Gd,en.defineElement=vD,en.fetchRelative=nE,en.fetchWithFallback=e0,en.loadManifest=Jf,en.normalize=nh,en.resolveURI=Ps,Object.defineProperty(en,Symbol.toStringTag,{value:"Module"})}));+`;class dE extends HTMLElement{static get observedAttributes(){return["formation"]}constructor(){super(),this.attachShadow({mode:"open"}),this._viewer=null,this._agents=[],this._initialized=!1}connectedCallback(){this._renderShell(),this._initViewer(),this._mo=new MutationObserver(()=>this._repositionAll()),this._mo.observe(this,{childList:!0})}disconnectedCallback(){try{this._mo?.disconnect()}catch{}for(const e of[...this._agents])this.unregisterAgent(e.element);try{this._viewer?.dispose?.()}catch{}this._viewer=null,this._initialized=!1}attributeChangedCallback(e){e==="formation"&&this._repositionAll()}get formation(){const e=this.getAttribute("formation")||"row";return VD.includes(e)?e:"row"}get viewer(){return this._viewer}_renderShell(){const e=document.createElement("style");e.textContent=WD,this.shadowRoot.appendChild(e);const t=document.createElement("div");t.className="stage-canvas",t.part="stage",this.shadowRoot.appendChild(t),this._canvasBox=t;const n=document.createElement("slot");this.shadowRoot.appendChild(n)}_initViewer(){if(!this._initialized){this._viewer=new Kd(this._canvasBox,{kiosk:!0}),this._viewer.defaultCamera.position.set(0,1.55,3.4),this._viewer.defaultCamera.lookAt(0,1.2,0),this._viewer.controls.target.set(0,1.2,0),this._viewer.controls.update();try{this._viewer.updateLights?.()}catch{}try{this._viewer.updateEnvironment?.()}catch{}this._viewer.invalidate(),this._initialized=!0}}registerAgent(e,{id:t,group:n,manifest:s}){const r=this._uniqueId(t||s?.name||"agent"),a={id:r,element:e,group:n,manifest:s};return this._agents.push(a),this._viewer?.scene.add(n),this._repositionAll(),this.dispatchEvent(new CustomEvent("stage:agent-joined",{detail:{agentId:r,element:e,manifest:s},bubbles:!0,composed:!0})),r}unregisterAgent(e){const t=this._agents.findIndex(s=>s.element===e);if(t<0)return;const[n]=this._agents.splice(t,1);try{this._viewer?.scene.remove(n.group)}catch{}qD(n.group),this._repositionAll(),this.dispatchEvent(new CustomEvent("stage:agent-left",{detail:{agentId:n.id,element:n.element},bubbles:!0,composed:!0}))}_uniqueId(e){let t=e,n=1;const s=new Set(this._agents.map(r=>r.id));for(;s.has(t);)t=`${e}-${n++}`;return t}getAgents(){return this._agents.map(({id:e,group:t,manifest:n,element:s})=>({agentId:e,name:n?.name||e,position:[+t.position.x.toFixed(3),+t.position.y.toFixed(3),+t.position.z.toFixed(3)],element:s}))}broadcast(e,t){const n={from:e,event:t};for(const s of this._agents)s.id!==e&&s.element.dispatchEvent(new CustomEvent("stage:message",{detail:n}));this.dispatchEvent(new CustomEvent("stage:message",{detail:n,bubbles:!0,composed:!0}))}async routeMessage(e,t,n){const s=this._agents.find(r=>r.id===t);if(!s)return{ok:!1,error:`No agent "${t}" on stage`};try{return{ok:!0,reply:(await s.element.say(`[from ${e}] ${n}`))?.text||""}}catch(r){return{ok:!1,error:r?.message||String(r)}}}async addAgent(e){const t=document.createElement("agent-3d");return e&&typeof e=="object"&&(t._inlineManifest=e),t.hasAttribute("eager")||t.setAttribute("eager",""),this.appendChild(t),t}removeAgent(e){const t=this._agents.find(n=>n.id===e);t&&t.element.remove()}_repositionAll(){const e=this._agents.length;if(!(!e||!this._viewer)){for(let t=0;t<e;t++){const{element:n,group:s,manifest:r}=this._agents[t],a=this._slotFor(t,e);s.position.copy(a.world),s.lookAt(0,a.world.y+1,a.world.z+5),n.style.position="absolute",n.style.left=a.dom.left,n.style.top=a.dom.top,n.style.width=a.dom.width,n.style.height=a.dom.height,n.style.pointerEvents="none"}this._viewer.invalidate()}}_slotFor(e,t){const n=this.formation,s=1/Math.max(t,1);if(n==="circle"){const o=e/t*Math.PI*2,c=Math.max(.8,.4*t);return{world:new H(Math.sin(o)*c,0,-Math.cos(o)*c+c*.5),dom:{left:`${e*s*100}%`,top:"0",width:`${s*100}%`,height:"100%"}}}if(n==="freeform")return{world:new H(0,0,0),dom:{left:"0",top:"0",width:"100%",height:"100%"}};const a=(e-(t-1)/2)*1.1;return{world:new H(a,0,0),dom:{left:`${e*s*100}%`,top:"0",width:`${s*100}%`,height:"100%"}}}}function qD(i){i.traverse(e=>{if(e.geometry)try{e.geometry.dispose()}catch{}if(e.material){const t=Array.isArray(e.material)?e.material:[e.material];for(const n of t){for(const s of Object.keys(n)){const r=n[s];if(r&&r.isTexture)try{r.dispose()}catch{}}try{n.dispose()}catch{}}}}),i.parent&&i.parent.remove(i)}customElements.get("agent-stage")||customElements.define("agent-stage",dE);const KD=(i="agent-3d")=>{customElements.get(i)||customElements.define(i,ap)};en.Agent3DElement=ap,en.AgentStageElement=dE,en.Memory=Ei,en.Runtime=r0,en.SceneController=c0,en.Skill=u0,en.SkillRegistry=d0,en.Viewer=Kd,en.defineElement=KD,en.fetchRelative=hE,en.fetchWithFallback=a0,en.loadManifest=ip,en.normalize=ch,en.resolveURI=ks,Object.defineProperty(en,Symbol.toStringTag,{value:"Module"})}));diff --git a/dist-lib/dashboard/dashboard.js b/dist-lib/dashboard/dashboard.jsindex 69f2c7f0f..6c6e800db 100644--- a/dist-lib/dashboard/dashboard.js+++ b/dist-lib/dashboard/dashboard.js@@ -97,6 +97,7 @@ function avatarCard(a) {<select data-vis>${['private','unlisted','public'].map((v) => `<option ${v===a.visibility?'selected':''} value="${v}">${v}</option>`).join('')}</select><div class="row" style="gap:6px"><a class="btn sec" href="#edit/${encodeURIComponent(a.id)}">Edit</a>+ <button class="btn sec" data-replace>Replace GLB</button><button class="btn sec" data-del>Delete</button></div></div>@@ -113,6 +114,7 @@ function avatarCard(a) {el.remove();} catch (err) { alert(err.message); }});+ el.querySelector('[data-replace]').addEventListener('click', () => replaceGlbFlow(a, el));return el;}diff --git a/src/agent-avatar.js b/src/agent-avatar.jsindex 4da0e36ab..b0d746b5b 100644--- a/src/agent-avatar.js+++ b/src/agent-avatar.js@@ -21,6 +21,7 @@import { ACTION_TYPES } from './agent-protocol.js';import { Vector3, Box3, MathUtils } from 'three';+import { resolveSlot, DEFAULT_ANIMATION_MAP } from './runtime/animation-slots.js';const DEG2RAD = Math.PI / 180;diff --git a/src/runtime/tools.js b/src/runtime/tools.jsindex a5b18e8d0..a53354933 100644--- a/src/runtime/tools.js+++ b/src/runtime/tools.js@@ -117,9 +117,14 @@ export const BUILTIN_HANDLERS = {async play_clip(args, ctx) {const { name, loop = false, fade_ms = 200 } = args;- const played = ctx.viewer.playClipByName?.(name, { loop, fade_ms });- if (!played) return { ok: false, error: `No clip named "${name}"` };- return { ok: true, name };+ // Resolve slot name (e.g. 'celebrate') to actual clip via agent's mapping+ const resolved = ctx.viewer.resolveAnimationSlot?.(name) ?? name;+ const played = ctx.viewer.playClipByName?.(resolved, { loop, fade_ms });+ if (!played) {+ if (resolved !== name) console.warn(`[play_clip] slot "${name}" → "${resolved}" not found in library`);+ return { ok: false, error: `No clip named "${resolved}"` };+ }+ return { ok: true, name, resolved };},async setExpression(args, ctx) {