{"manifest":{"apiVersion":1,"id":"gaussianSplatNode","renderer":"react","scope":"node","name":"Gaussian Splat","displayName":"Gaussian Splat","version":"1.0.0","author":"OpenCinema","github":"https://github.com/junjamrk/OpenCinema","description":"在画布中查看 3D Gaussian Splatting 扫描（PLY / SPLAT / KSPLAT / SPZ），设定机位，渲染静帧与环绕视频作为参考。","license":"MIT","homepage":"https://opencinema.site/market/","tags":["3d","gaussian-splatting","viewer","reference","render"],"requires":{"workspaceFiles":1,"workspaceReadRange":1,"nodeHistory":1,"ffmpeg":1,"worker":1},"configRules":[],"readme":"# Gaussian Splat\n\n在画布中查看 3D Gaussian Splatting 扫描，设定机位，渲染静帧与环绕视频，作为构图与空间参考连接到下游节点。本插件不是内置节点：它通过 [插件市场](https://opencinema.site/market/) 或“安装插件包”安装，同时也是 OpenCinema 插件链路能承载完整 3D 能力的验证。\n\n## 使用\n\n1. 添加节点后选择 `.ply`、`.splat`、`.ksplat` 或 `.spz` 文件，或连接一个 FILE 输入后点击“使用上游文件”。文件保存在工程的 `assets/<节点 ID>/` 下，节点记录格式、字节数、SHA-256 与 Gaussian 数量。\n2. 在节点内拖动旋转、滚轮缩放、右键平移。“保存机位”把当前视角写入节点并纳入画布历史；“自动取景”按扫描包围球重新取景。\n3. “渲染静帧”把 1280×720 PNG 写入 `image` 端口；“环绕视频”在后台逐帧渲染并用本机 FFmpeg 编码 4 秒 24 fps 的 H.264 MP4 写入 `video` 端口。`file` 端口原样输出扫描文件。\n\n渲染发生在本机浏览器的 WebGL 中，不上传文件、不调用生成模型。上限：100 MiB、2,000,000 个 Gaussian、环绕视频 600 帧。\n\n## Agent 操作\n\n通过 `getNodeTools` 发现函数：`getSplatInfo` 读状态，`setSplatSource` 选文件，`getCamera` / `setCamera` / `frameCamera` 管机位，`renderStill` 同步出图，`renderTurntable` 排队出视频并用 `getRenderStatus` / `cancelRender` 跟踪。随包发行的 `agent.md` 给出推荐顺序与边界。\n\n## 边界\n\n- 静帧与环绕视频是扫描的可视化参考，不是测量数据；`frameCamera` 的包围盒按 2%–98% 分位计算，会忽略远处漂浮点。\n- 更换扫描文件会清除旧机位与旧渲染输出；已写入的文件保留在工程里。\n- 需要宿主能力 `workspaceFiles`、`workspaceReadRange`、`nodeHistory`、`ffmpeg`、`worker`；环绕视频还需要在设置中就绪的 FFmpeg。\n\n## 第三方来源与许可\n\n- [GaussianSplats3D](https://github.com/mkkellogg/GaussianSplats3D) 0.4.7，MIT，Mark Kellogg。完整许可见 `licenses/gaussianSplats3dLicense.txt`。\n- [three.js](https://threejs.org) 0.184.0，MIT。完整许可见 `licenses/threeLicense.txt`。\n","agentGuide":"# Gaussian Splat · Agent 指南\n\n这个节点只做一件事：把一份 Gaussian Splatting 扫描变成可控机位的参考画面。\n\n## 推荐顺序\n\n1. `getSplatInfo`：读取来源、机位、渲染状态与输出端口。`source` 为 null 时先准备文件。\n2. `setSplatSource`：传入工作区内的 `.ply` / `.splat` / `.ksplat` / `.spz` 路径，或在已连接 FILE 输入时省略 `path`。返回 `splatCount`、`sha256` 与新的 `revision`。\n3. `frameCamera`：按包围球取景并保存机位；用 `azimuthDeg` / `elevationDeg` / `distanceScale` 调整构图。想要精确机位时直接 `setCamera`。\n4. `renderStill`：同步得到 PNG 路径并写入 `image` 端口。省略 `camera` 时使用已保存机位。\n5. `renderTurntable`：立即返回 `taskId`，用 `getRenderStatus` 轮询直到 `completed` 或 `failed`；`cancelRender` 可取消。完成后 `video` 端口才有产物。\n\n## 边界\n\n- 所有渲染在用户浏览器的 WebGL 中完成，不上传文件、不调用模型、不计费。\n- `running` 期间其他渲染与取景调用会以 `renderBusy` 拒绝；页面重载后旧任务显示为 `interrupted`，需要重新发起。\n- `expectedRevision` 是画布 documentRevision。环绕视频完成时按当时修订写入，长任务期间请避免并行改动该节点。\n- 输出是构图与空间参考，不是测量数据；更换来源会清除旧机位与旧输出。","resources":{}},"source":"const styles = [\"assets/ad9acbcea.css\"]; if (typeof document !== \"undefined\") await Promise.all(styles.map(path => new Promise((resolve, reject) => { const href = new URL(path, import.meta.url).href; if (document.querySelector('link[data-open-cinema-plugin-style=\"'+CSS.escape(href)+'\"]')) return resolve(); const link = document.createElement(\"link\"); link.rel = \"stylesheet\"; link.href = href; link.dataset.openCinemaPluginStyle = href; link.onload = () => resolve(); link.onerror = () => { link.remove(); reject(new Error(\"插件样式加载失败\")); }; document.head.append(link); })));\nimport { Fragment as e, React as t, jsx as n, jsxs as r, z as i } from \"/pluginSdk.js\";\ni.$brand, i.$input, i.$output, i.INVALID, i.NEVER, i.TimePrecision, i.ZodAny, i.ZodArray, i.ZodBase64, i.ZodBase64URL, i.ZodBigInt, i.ZodBigIntFormat, i.ZodBoolean, i.ZodCIDRv4, i.ZodCIDRv6, i.ZodCUID, i.ZodCUID2, i.ZodCatch, i.ZodCodec, i.ZodCompileAsyncError, i.ZodCompileUnsupportedError, i.ZodCreditCard, i.ZodCustom, i.ZodCustomStringFormat, i.ZodDate, i.ZodDefault, i.ZodDiscriminatedUnion, i.ZodE164, i.ZodEmail, i.ZodEmoji, i.ZodEnum, i.ZodError, i.ZodExactOptional, i.ZodFile, i.ZodFirstPartyTypeKind, i.ZodFunction, i.ZodGUID, i.ZodIBAN, i.ZodIPv4, i.ZodIPv6, i.ZodISODate, i.ZodISODateTime, i.ZodISODuration, i.ZodISOTime, i.ZodInstanceOf, i.ZodIntersection, i.ZodIssueCode, i.ZodJWT, i.ZodKSUID, i.ZodLazy, i.ZodLiteral, i.ZodMAC, i.ZodMap, i.ZodNaN, i.ZodNanoID, i.ZodNever, i.ZodNonOptional, i.ZodNull, i.ZodNullable, i.ZodNumber, i.ZodNumberFormat, i.ZodObject, i.ZodOptional, i.ZodPipe, i.ZodPrefault, i.ZodPreprocess, i.ZodPromise, i.ZodProperties, i.ZodReadonly, i.ZodRealError, i.ZodRecord, i.ZodSet, i.ZodString, i.ZodStringFormat, i.ZodSuccess, i.ZodSymbol, i.ZodTemplateLiteral, i.ZodTransform, i.ZodTuple, i.ZodType, i.ZodULID, i.ZodURL, i.ZodUUID, i.ZodUndefined, i.ZodUnion, i.ZodUnknown, i.ZodVoid, i.ZodXID, i.ZodXor, i._ZodString, i._default, i._function, i.any, i.array, i.base64, i.base64url, i.bigint, i.boolean, i.catch, i.check, i.cidrv4, i.cidrv6, i.clone, i.codec, i.coerce, i.compile, i.config, i.core, i.creditCard, i.cuid, i.cuid2, i.custom, i.date, i.decode, i.decodeAsync, i.deepPartial, i.describe, i.discriminatedUnion, i.e164, i.email, i.emoji, i.encode, i.encodeAsync, i.endsWith, i.enum, i.exactOptional, i.file, i.flattenError, i.float32, i.float64, i.formatError, i.fromJSONSchema, i.function, i.getDiscriminatedOption, i.getErrorMap, i.globalRegistry, i.gt, i.gte, i.guid, i.hash, i.hex, i.hostname, i.httpUrl, i.iban, i.includes, i.input, i.instanceof, i.int, i.int32, i.int64, i.intersection, i.invertCodec, i.ipv4, i.ipv6, i.iso, i.json, i.jwt, i.keyof, i.ksuid, i.lazy, i.length, i.literal, i.locales, i.looseObject, i.looseRecord, i.lowercase, i.lt, i.lte, i.mac, i.map, i.maxLength, i.maxSize, i.memoizer, i.meta, i.mime, i.minLength, i.minSize, i.multipleOf, i.nan, i.nanoid, i.nativeEnum, i.negative, i.never, i.nonnegative, i.nonoptional, i.nonpositive, i.normalize, i.null, i.nullable, i.nullish, i.number, i.object, i.optional, i.output, i.overwrite, i.parse, i.parseAsync, i.partialRecord, i.pipe, i.positive, i.prefault, i.preprocess, i.prettifyError, i.promise, i.properties, i.property, i.readonly, i.record, i.refine, i.regex, i.regexes, i.registry, i.safeDecode, i.safeDecodeAsync, i.safeEncode, i.safeEncodeAsync, i.safeParse, i.safeParseAsync, i.set, i.setErrorMap, i.size, i.slugify, i.startsWith, i.strictObject, i.string, i.stringFormat, i.stringbool, i.success, i.superRefine, i.symbol, i.templateLiteral, i.toJSONSchema, i.toLowerCase, i.toUpperCase, i.toZod, i.transform, i.treeifyError, i.trim, i.tuple, i.uint32, i.uint64, i.ulid, i.undefined, i.union, i.unknown, i.uppercase, i.url, i.util, i.uuid, i.uuidv4, i.uuidv6, i.uuidv7, i.validate, i.validateAsync, i.void, i.withParser, i.xid, i.xor;\n//#endregion\n//#region ../../nodeScaffold/src/nodeFiles.ts\nfunction a(e) {\n\tif (!e || /[\\\\/]/.test(e) || e === \".\" || e === \"..\") throw Error(\"节点 ID 不能作为文件夹名称\");\n\treturn `assets/${e}`;\n}\nasync function o(e, t, n) {\n\tlet r = a(t);\n\tfor (let t of [\"assets\", r]) await e.mkdir(t).catch((e) => {\n\t\tif (e.response?.data?.data?.code !== \"EEXIST\") throw e;\n\t});\n\tlet i = n.name.match(/\\.[a-zA-Z0-9]{1,10}$/)?.[0].toLowerCase() ?? \"\", o = `${r}/${crypto.randomUUID()}${i}`;\n\treturn await e.write(o, n, !0), o;\n}\ni.strictObject({\n\ttitle: i.string().trim().min(1).max(256).optional(),\n\treadOnlyHint: i.boolean().optional(),\n\tdestructiveHint: i.boolean().optional(),\n\tidempotentHint: i.boolean().optional(),\n\topenWorldHint: i.boolean().optional()\n});\nvar s = i.strictObject({\n\tcode: i.string().regex(/^[a-zA-Z][a-zA-Z0-9._-]{0,127}$/),\n\tmessage: i.string().max(1e4),\n\tphase: i.enum([\n\t\t\"validation\",\n\t\t\"target\",\n\t\t\"authorization\",\n\t\t\"execution\",\n\t\t\"result\",\n\t\t\"transport\"\n\t]),\n\ttarget: i.strictObject({\n\t\tdirectory: i.string().max(4096).optional(),\n\t\tcanvasId: i.string().max(4096).optional(),\n\t\tpath: i.string().max(4096).optional(),\n\t\tnodeId: i.string().max(4096).optional(),\n\t\tinstanceId: i.string().max(4096).optional(),\n\t\tpluginId: i.string().max(128).optional(),\n\t\ttoolName: i.string().max(512).optional(),\n\t\tconnectionId: i.string().max(256).optional()\n\t}).optional(),\n\texecutionState: i.enum([\n\t\t\"notDispatched\",\n\t\t\"accepted\",\n\t\t\"running\",\n\t\t\"completed\",\n\t\t\"failed\",\n\t\t\"cancelled\",\n\t\t\"unknown\"\n\t]),\n\trecovery: i.strictObject({\n\t\taction: i.enum([\n\t\t\t\"correctInput\",\n\t\t\t\"readState\",\n\t\t\t\"rediscoverTools\",\n\t\t\t\"queryOperation\",\n\t\t\t\"retry\",\n\t\t\t\"none\"\n\t\t]),\n\t\tmessage: i.string().max(4096),\n\t\ttool: i.string().max(512).optional(),\n\t\targs: i.record(i.string(), i.unknown()).optional()\n\t}),\n\tactualRevision: i.union([i.number().finite(), i.string().max(4096)]).optional(),\n\texpectedRevision: i.union([i.number().finite(), i.string().max(4096)]).optional(),\n\ttoolCatalogVersion: i.union([i.number().finite(), i.string().max(4096)]).optional(),\n\toperationId: i.string().max(256).optional(),\n\trequestId: i.string().max(128).optional()\n}), c = class extends Error {\n\tdetails;\n\tget code() {\n\t\treturn this.details.code;\n\t}\n\tget requestId() {\n\t\treturn this.details.requestId;\n\t}\n\tconstructor(e) {\n\t\tlet t = s.parse(e);\n\t\tsuper(t.message), this.name = \"ToolExecutionError\", this.details = t;\n\t}\n};\nt.Activity, t.Children, t.Component, t.Fragment, t.Profiler, t.PureComponent, t.StrictMode, t.Suspense, t.ViewTransition, t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, t.__COMPILER_RUNTIME, t.act, t.addTransitionType, t.cache, t.cacheSignal, t.captureOwnerStack, t.cloneElement, t.createContext;\nvar l = t.createElement;\nt.createRef;\nvar u = t.forwardRef;\nt.isValidElement, t.lazy, t.memo, t.startTransition, t.unstable_useCacheRefresh, t.use, t.useActionState, t.useCallback, t.useContext, t.useDebugValue, t.useDeferredValue;\nvar d = t.useEffect;\nt.useEffectEvent, t.useId, t.useImperativeHandle, t.useInsertionEffect, t.useLayoutEffect, t.useMemo, t.useOptimistic, t.useReducer;\nvar f = t.useRef, p = t.useState;\nt.useSyncExternalStore, t.useTransition, t.version, i.strictObject({\n\tsubject: i.string().max(2e3).default(\"\"),\n\taction: i.string().max(3e3).default(\"\"),\n\tsubjectDirection: i.string().max(2e3).default(\"\"),\n\tscreenDirection: i.string().max(1e3).default(\"\"),\n\tcameraMotion: i.string().max(2e3).default(\"\"),\n\tframing: i.string().max(1e3).default(\"\"),\n\tcontinuity: i.string().max(2e3).default(\"\"),\n\tcontinuousShot: i.boolean().default(!0)\n}), i.enum([\n\t\"general\",\n\t\"instruction\",\n\t\"identity\",\n\t\"composition\",\n\t\"motion\",\n\t\"exclude\"\n]);\nvar m = i.enum([\n\t\"unreviewed\",\n\t\"pass\",\n\t\"fail\",\n\t\"notApplicable\"\n]), h = i.strictObject({\n\tdirection: m,\n\taction: m,\n\tidentity: m,\n\tcontinuity: m,\n\tunwantedCuts: m,\n\tartifacts: m\n}), g = i.strictObject({\n\tsource: i.string().min(1),\n\tsourceRevision: i.string().min(1),\n\ttaskId: i.string().optional(),\n\tstatus: i.enum([\"approved\", \"rejected\"]),\n\tstart: i.number().finite().nonnegative(),\n\tend: i.number().finite().positive(),\n\tchecks: h,\n\tnotes: i.string().trim().min(1).max(1e4),\n\treviewedAt: i.string(),\n\trevision: i.number().int().positive().optional()\n});\ni.strictObject({\n\tpath: i.string().min(1),\n\tsourceRevision: i.string().optional(),\n\ttaskId: i.string().optional(),\n\torigin: i.enum([\n\t\t\"generated\",\n\t\t\"derived\",\n\t\t\"imported\"\n\t]).optional(),\n\tsources: i.array(i.strictObject({\n\t\tpath: i.string().min(1),\n\t\tsourceRevision: i.string().optional()\n\t})).optional(),\n\treview: g.optional()\n});\n//#endregion\n//#region ../../nodeShared/src/reactNode.ts\nvar _ = i.string().min(1).max(4096).refine((e) => !/^[\\\\/]|^[a-z][a-z0-9+.-]*:|[\\x00-\\x1f]/i.test(e) && !e.replaceAll(\"\\\\\", \"/\").split(\"/\").includes(\"..\"), \"仅支持工作区相对路径\"), v = i.strictObject({\n\turl: _,\n\tmimeType: i.string().min(1).max(200)\n});\nfunction y(e, t, n, r = \"mediaSourceRequired\", i) {\n\treturn new c({\n\t\tcode: r,\n\t\tmessage: n,\n\t\tphase: \"validation\",\n\t\texecutionState: \"notDispatched\",\n\t\ttarget: {\n\t\t\tdirectory: e.directory,\n\t\t\tcanvasId: e.canvasId,\n\t\t\tnodeId: t\n\t\t},\n\t\trecovery: i ?? {\n\t\t\taction: \"readState\",\n\t\t\tmessage: \"用getCanvasNodes读取当前节点ports/outputs，再读取输入连线；选择或连接有效媒体源后重新调用。此前未启动媒体处理。\",\n\t\t\ttool: \"getCanvasNodes\",\n\t\t\targs: {\n\t\t\t\tcanvasId: e.canvasId,\n\t\t\t\tnodeIds: [t],\n\t\t\t\tfields: [\"ports\", \"outputs\"]\n\t\t\t}\n\t\t}\n\t});\n}\nfunction b(e, t) {\n\tlet n = e.readNode(t);\n\tif (!n) throw new c({\n\t\tcode: \"nodeNotFound\",\n\t\tmessage: \"节点已不存在\",\n\t\tphase: \"target\",\n\t\texecutionState: \"notDispatched\",\n\t\ttarget: { nodeId: t },\n\t\trecovery: {\n\t\t\taction: \"readState\",\n\t\t\tmessage: \"重新读取当前画布节点并固定仍存在的目标\",\n\t\t\ttool: \"getCanvasNodes\",\n\t\t\targs: { nodeIds: [t] }\n\t\t}\n\t});\n\treturn n.data ?? {};\n}\nfunction x(e) {\n\tif (!e.nodeId) throw Error(\"节点插件未绑定编辑会话\");\n\treturn {\n\t\tid: e.nodeId,\n\t\tdocument: e.getService(\"document\"),\n\t\tworkbench: e.getService(\"workbench\")\n\t};\n}\nfunction S(e, t) {\n\tlet [n, r] = p(\"\"), [i, a] = p(\"\");\n\treturn d(() => {\n\t\tlet n = !0, i;\n\t\treturn r(\"\"), a(\"\"), t && e.acquireMedia(t.url, t.mimeType).then((e) => {\n\t\t\tif (!n) {\n\t\t\t\te.release();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ti = e.release, r(e.url);\n\t\t}).catch((e) => {\n\t\t\tn && a(C(e));\n\t\t}), () => {\n\t\t\tn = !1, i?.();\n\t\t};\n\t}, [\n\t\te,\n\t\tt?.url,\n\t\tt?.mimeType\n\t]), {\n\t\turl: n,\n\t\terror: i\n\t};\n}\nfunction C(e) {\n\treturn e instanceof i.ZodError ? e.issues.map((e) => e.message).join(\"；\") : e instanceof Error ? e.message : String(e);\n}\n//#endregion\n//#region src/splatFile.ts\nvar w = [\n\t\"ply\",\n\t\"splat\",\n\t\"ksplat\",\n\t\"spz\"\n], T = 100 * 1024 ** 2, E = 2e6, D = {\n\tply: \"application/x-gaussian-splat-ply\",\n\tsplat: \"application/x-gaussian-splat\",\n\tksplat: \"application/x-gaussian-ksplat\",\n\tspz: \"application/x-gaussian-spz\"\n}, O = \".ply,.splat,.ksplat,.spz\";\nfunction k(e) {\n\tlet t = e.split(/[\\\\/]/).at(-1)?.split(\".\").at(-1)?.toLowerCase();\n\treturn w.includes(t ?? \"\") ? t : void 0;\n}\nfunction A(e) {\n\tif (!Number.isSafeInteger(e) || e <= 0 || e > 2e6) throw Error(`扫描须含 1 至 ${E.toLocaleString(\"en-US\")} 个 Gaussian；超过上限请先在原工具中抽稀，这里不会自动处理`);\n\treturn e;\n}\nasync function j(e, t) {\n\tlet n = new Blob([e]).stream().pipeThrough(new DecompressionStream(\"gzip\")).getReader(), r = /* @__PURE__ */ new Uint8Array(16), i = 0;\n\ttry {\n\t\tfor (; i < 16;) {\n\t\t\tt?.throwIfAborted();\n\t\t\tlet e = await n.read();\n\t\t\tif (e.done) break;\n\t\t\tr.set(e.value.subarray(0, Math.min(e.value.byteLength, 16 - i)), i), i += e.value.byteLength;\n\t\t}\n\t} finally {\n\t\tawait n.cancel().catch(() => {});\n\t}\n\tif (i < 16) throw Error(\"SPZ 文件不完整\");\n\tlet a = new DataView(r.buffer);\n\tif (a.getUint32(0, !0) !== 1347635022 || ![1, 2].includes(a.getUint32(4, !0))) throw Error(\"仅支持 Gaussian SPZ v1/v2，文件头无效\");\n\treturn A(a.getUint32(8, !0));\n}\nfunction M(e, t) {\n\tif (!e.byteLength || e.byteLength > T) throw Error(\"扫描文件须非空且不超过 100 MiB\");\n\tif (t === \"spz\") return j(e);\n\tif (t === \"splat\") {\n\t\tif (e.byteLength % 32) throw Error(\"标准 SPLAT 每个 Gaussian 占 32 字节，文件长度无效\");\n\t\treturn A(e.byteLength / 32);\n\t}\n\tif (t === \"ksplat\") {\n\t\tif (e.byteLength < 5120) throw Error(\"KSPLAT 文件头或分段缺失\");\n\t\tlet t = new DataView(e), n = t.getUint32(4, !0);\n\t\tif (!n || n > 4096 || 4096 + n * 1024 > e.byteLength) throw Error(\"KSPLAT 分段无效\");\n\t\treturn A(t.getUint32(12, !0));\n\t}\n\tlet n = new TextDecoder().decode(new Uint8Array(e, 0, Math.min(e.byteLength, 65536))), r = n.indexOf(\"end_header\");\n\tif (!(n.startsWith(\"ply\\n\") || n.startsWith(\"ply\\r\\n\")) || r < 0) throw Error(\"PLY 文件头无效或超过 64 KiB\");\n\tlet i = n.slice(0, r);\n\tif (!/^format binary_little_endian 1\\.0\\s*$/m.test(i)) throw Error(\"仅支持二进制小端 Gaussian PLY，不接受 ASCII PLY 或普通点云\");\n\tlet a = new Set([...i.matchAll(/^property \\w+ (\\w+)\\s*$/gm)].map((e) => e[1])), o = [\n\t\t\"x\",\n\t\t\"y\",\n\t\t\"z\",\n\t\t\"scale_0\",\n\t\t\"rot_0\",\n\t\t\"opacity\",\n\t\t\"f_dc_0\"\n\t].every((e) => a.has(e)), s = [\n\t\t\"packed_position\",\n\t\t\"packed_rotation\",\n\t\t\"packed_scale\",\n\t\t\"packed_color\"\n\t].every((e) => a.has(e));\n\tif (!o && !s && !/^element codebook_centers \\d+\\s*$/m.test(i)) throw Error(\"PLY 缺少 Gaussian 的尺度、旋转或颜色字段，不能把普通点云当作扫描\");\n\treturn A([...i.matchAll(/^element vertex(?:_\\w+)? (\\d+)\\s*$/gm)].reduce((e, t) => e + Number(t[1]), 0));\n}\nasync function N(e) {\n\treturn Array.from(new Uint8Array(await crypto.subtle.digest(\"SHA-256\", e)), (e) => e.toString(16).padStart(2, \"0\")).join(\"\");\n}\nasync function P(e, t, n) {\n\tn?.throwIfAborted();\n\tlet r = await M(e, t);\n\tn?.throwIfAborted();\n\tlet i = await N(e);\n\treturn n?.throwIfAborted(), {\n\t\tsplatCount: r,\n\t\tsha256: i,\n\t\tbytes: e.byteLength\n\t};\n}\nvar F = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n}, I = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n}, ee = 1e3, te = 1001, ne = 1002, L = 1003, re = 1004, ie = 1005, R = 1006, ae = 1007, oe = 1008, se = 1009, ce = 1010, le = 1011, ue = 1012, de = 1013, fe = 1014, pe = 1015, me = 1016, he = 1017, ge = 1018, _e = 1020, ve = 35902, ye = 35899, be = 1021, xe = 1022, Se = 1023, Ce = 1026, z = 1027, we = 1028, Te = 1029, Ee = 1030, De = 1031, Oe = 1033, ke = 33776, B = 33777, Ae = 33778, V = 33779, je = 35840, Me = 35841, Ne = 35842, Pe = 35843, Fe = 36196, Ie = 37492, Le = 37496, Re = 37488, ze = 37489, Be = 37490, Ve = 37491, He = 37808, Ue = 37809, We = 37810, Ge = 37811, Ke = 37812, qe = 37813, Je = 37814, Ye = 37815, Xe = 37816, Ze = 37817, Qe = 37818, $e = 37819, et = 37820, tt = 37821, nt = 36492, rt = 36494, it = 36495, at = 36283, ot = 36284, st = 36285, ct = 36286, lt = 2300, ut = 2301, dt = 2302, ft = 2303, pt = 2400, mt = 2401, ht = 2402, gt = 3200, _t = \"srgb\", vt = \"srgb-linear\", yt = \"linear\", bt = \"srgb\", xt = 7680, St = 35044, Ct = 35048, wt = 2e3;\nfunction Tt(e) {\n\tfor (let t = e.length - 1; t >= 0; --t) if (e[t] >= 65535) return !0;\n\treturn !1;\n}\nfunction Et(e) {\n\treturn ArrayBuffer.isView(e) && !(e instanceof DataView);\n}\nfunction Dt(e) {\n\treturn document.createElementNS(\"http://www.w3.org/1999/xhtml\", e);\n}\nfunction Ot() {\n\tlet e = Dt(\"canvas\");\n\treturn e.style.display = \"block\", e;\n}\nvar kt = {};\nfunction At(...e) {\n\tlet t = \"THREE.\" + e.shift();\n\tconsole.log(t, ...e);\n}\nfunction jt(e) {\n\tlet t = e[0];\n\tif (typeof t == \"string\" && t.startsWith(\"TSL:\")) {\n\t\tlet t = e[1];\n\t\tt && t.isStackTrace ? e[0] += \" \" + t.getLocation() : e[1] = \"Stack trace not available. Enable \\\"THREE.Node.captureStackTrace\\\" to capture stack traces.\";\n\t}\n\treturn e;\n}\nfunction H(...e) {\n\te = jt(e);\n\tlet t = \"THREE.\" + e.shift();\n\t{\n\t\tlet n = e[0];\n\t\tn && n.isStackTrace ? console.warn(n.getError(t)) : console.warn(t, ...e);\n\t}\n}\nfunction U(...e) {\n\te = jt(e);\n\tlet t = \"THREE.\" + e.shift();\n\t{\n\t\tlet n = e[0];\n\t\tn && n.isStackTrace ? console.error(n.getError(t)) : console.error(t, ...e);\n\t}\n}\nfunction Mt(...e) {\n\tlet t = e.join(\" \");\n\tt in kt || (kt[t] = !0, H(...e));\n}\nfunction Nt(e, t, n) {\n\treturn new Promise(function(r, i) {\n\t\tfunction a() {\n\t\t\tswitch (e.clientWaitSync(t, e.SYNC_FLUSH_COMMANDS_BIT, 0)) {\n\t\t\t\tcase e.WAIT_FAILED:\n\t\t\t\t\ti();\n\t\t\t\t\tbreak;\n\t\t\t\tcase e.TIMEOUT_EXPIRED:\n\t\t\t\t\tsetTimeout(a, n);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: r();\n\t\t\t}\n\t\t}\n\t\tsetTimeout(a, n);\n\t});\n}\nvar Pt = {\n\t0: 1,\n\t2: 6,\n\t4: 7,\n\t3: 5,\n\t1: 0,\n\t6: 2,\n\t7: 4,\n\t5: 3\n}, Ft = class {\n\taddEventListener(e, t) {\n\t\tthis._listeners === void 0 && (this._listeners = {});\n\t\tlet n = this._listeners;\n\t\tn[e] === void 0 && (n[e] = []), n[e].indexOf(t) === -1 && n[e].push(t);\n\t}\n\thasEventListener(e, t) {\n\t\tlet n = this._listeners;\n\t\treturn n !== void 0 && n[e] !== void 0 && n[e].indexOf(t) !== -1;\n\t}\n\tremoveEventListener(e, t) {\n\t\tlet n = this._listeners;\n\t\tif (n === void 0) return;\n\t\tlet r = n[e];\n\t\tif (r !== void 0) {\n\t\t\tlet e = r.indexOf(t);\n\t\t\te !== -1 && r.splice(e, 1);\n\t\t}\n\t}\n\tdispatchEvent(e) {\n\t\tlet t = this._listeners;\n\t\tif (t === void 0) return;\n\t\tlet n = t[e.type];\n\t\tif (n !== void 0) {\n\t\t\te.target = this;\n\t\t\tlet t = n.slice(0);\n\t\t\tfor (let n = 0, r = t.length; n < r; n++) t[n].call(this, e);\n\t\t\te.target = null;\n\t\t}\n\t}\n}, It = /* @__PURE__ */ \"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\".split(\".\"), Lt = 1234567, Rt = Math.PI / 180, zt = 180 / Math.PI;\nfunction Bt() {\n\tlet e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0;\n\treturn (It[e & 255] + It[e >> 8 & 255] + It[e >> 16 & 255] + It[e >> 24 & 255] + \"-\" + It[t & 255] + It[t >> 8 & 255] + \"-\" + It[t >> 16 & 15 | 64] + It[t >> 24 & 255] + \"-\" + It[n & 63 | 128] + It[n >> 8 & 255] + \"-\" + It[n >> 16 & 255] + It[n >> 24 & 255] + It[r & 255] + It[r >> 8 & 255] + It[r >> 16 & 255] + It[r >> 24 & 255]).toLowerCase();\n}\nfunction W(e, t, n) {\n\treturn Math.max(t, Math.min(n, e));\n}\nfunction Vt(e, t) {\n\treturn (e % t + t) % t;\n}\nfunction Ht(e, t, n, r, i) {\n\treturn r + (e - t) * (i - r) / (n - t);\n}\nfunction Ut(e, t, n) {\n\treturn e === t ? 0 : (n - e) / (t - e);\n}\nfunction Wt(e, t, n) {\n\treturn (1 - n) * e + n * t;\n}\nfunction Gt(e, t, n, r) {\n\treturn Wt(e, t, 1 - Math.exp(-n * r));\n}\nfunction Kt(e, t = 1) {\n\treturn t - Math.abs(Vt(e, t * 2) - t);\n}\nfunction qt(e, t, n) {\n\treturn e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * (3 - 2 * e));\n}\nfunction Jt(e, t, n) {\n\treturn e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * e * (e * (e * 6 - 15) + 10));\n}\nfunction Yt(e, t) {\n\treturn e + Math.floor(Math.random() * (t - e + 1));\n}\nfunction Xt(e, t) {\n\treturn e + Math.random() * (t - e);\n}\nfunction Zt(e) {\n\treturn e * (.5 - Math.random());\n}\nfunction Qt(e) {\n\te !== void 0 && (Lt = e);\n\tlet t = Lt += 1831565813;\n\treturn t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\nfunction $t(e) {\n\treturn e * Rt;\n}\nfunction en(e) {\n\treturn e * zt;\n}\nfunction tn(e) {\n\treturn !(e & e - 1) && e !== 0;\n}\nfunction nn(e) {\n\treturn 2 ** Math.ceil(Math.log(e) / Math.LN2);\n}\nfunction rn(e) {\n\treturn 2 ** Math.floor(Math.log(e) / Math.LN2);\n}\nfunction an(e, t, n, r, i) {\n\tlet a = Math.cos, o = Math.sin, s = a(n / 2), c = o(n / 2), l = a((t + r) / 2), u = o((t + r) / 2), d = a((t - r) / 2), f = o((t - r) / 2), p = a((r - t) / 2), m = o((r - t) / 2);\n\tswitch (i) {\n\t\tcase \"XYX\":\n\t\t\te.set(s * u, c * d, c * f, s * l);\n\t\t\tbreak;\n\t\tcase \"YZY\":\n\t\t\te.set(c * f, s * u, c * d, s * l);\n\t\t\tbreak;\n\t\tcase \"ZXZ\":\n\t\t\te.set(c * d, c * f, s * u, s * l);\n\t\t\tbreak;\n\t\tcase \"XZX\":\n\t\t\te.set(s * u, c * m, c * p, s * l);\n\t\t\tbreak;\n\t\tcase \"YXY\":\n\t\t\te.set(c * p, s * u, c * m, s * l);\n\t\t\tbreak;\n\t\tcase \"ZYZ\":\n\t\t\te.set(c * m, c * p, s * u, s * l);\n\t\t\tbreak;\n\t\tdefault: H(\"MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: \" + i);\n\t}\n}\nfunction on(e, t) {\n\tswitch (t.constructor) {\n\t\tcase Float32Array: return e;\n\t\tcase Uint32Array: return e / 4294967295;\n\t\tcase Uint16Array: return e / 65535;\n\t\tcase Uint8Array: return e / 255;\n\t\tcase Int32Array: return Math.max(e / 2147483647, -1);\n\t\tcase Int16Array: return Math.max(e / 32767, -1);\n\t\tcase Int8Array: return Math.max(e / 127, -1);\n\t\tdefault: throw Error(\"Invalid component type.\");\n\t}\n}\nfunction sn(e, t) {\n\tswitch (t.constructor) {\n\t\tcase Float32Array: return e;\n\t\tcase Uint32Array: return Math.round(e * 4294967295);\n\t\tcase Uint16Array: return Math.round(e * 65535);\n\t\tcase Uint8Array: return Math.round(e * 255);\n\t\tcase Int32Array: return Math.round(e * 2147483647);\n\t\tcase Int16Array: return Math.round(e * 32767);\n\t\tcase Int8Array: return Math.round(e * 127);\n\t\tdefault: throw Error(\"Invalid component type.\");\n\t}\n}\nvar cn = {\n\tDEG2RAD: Rt,\n\tRAD2DEG: zt,\n\tgenerateUUID: Bt,\n\tclamp: W,\n\teuclideanModulo: Vt,\n\tmapLinear: Ht,\n\tinverseLerp: Ut,\n\tlerp: Wt,\n\tdamp: Gt,\n\tpingpong: Kt,\n\tsmoothstep: qt,\n\tsmootherstep: Jt,\n\trandInt: Yt,\n\trandFloat: Xt,\n\trandFloatSpread: Zt,\n\tseededRandom: Qt,\n\tdegToRad: $t,\n\tradToDeg: en,\n\tisPowerOfTwo: tn,\n\tceilPowerOfTwo: nn,\n\tfloorPowerOfTwo: rn,\n\tsetQuaternionFromProperEuler: an,\n\tnormalize: sn,\n\tdenormalize: on\n}, G = class e {\n\tstatic {\n\t\te.prototype.isVector2 = !0;\n\t}\n\tconstructor(e = 0, t = 0) {\n\t\tthis.x = e, this.y = t;\n\t}\n\tget width() {\n\t\treturn this.x;\n\t}\n\tset width(e) {\n\t\tthis.x = e;\n\t}\n\tget height() {\n\t\treturn this.y;\n\t}\n\tset height(e) {\n\t\tthis.y = e;\n\t}\n\tset(e, t) {\n\t\treturn this.x = e, this.y = t, this;\n\t}\n\tsetScalar(e) {\n\t\treturn this.x = e, this.y = e, this;\n\t}\n\tsetX(e) {\n\t\treturn this.x = e, this;\n\t}\n\tsetY(e) {\n\t\treturn this.y = e, this;\n\t}\n\tsetComponent(e, t) {\n\t\tswitch (e) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = t;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tthis.y = t;\n\t\t\t\tbreak;\n\t\t\tdefault: throw Error(\"index is out of range: \" + e);\n\t\t}\n\t\treturn this;\n\t}\n\tgetComponent(e) {\n\t\tswitch (e) {\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tdefault: throw Error(\"index is out of range: \" + e);\n\t\t}\n\t}\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\tcopy(e) {\n\t\treturn this.x = e.x, this.y = e.y, this;\n\t}\n\tadd(e) {\n\t\treturn this.x += e.x, this.y += e.y, this;\n\t}\n\taddScalar(e) {\n\t\treturn this.x += e, this.y += e, this;\n\t}\n\taddVectors(e, t) {\n\t\treturn this.x = e.x + t.x, this.y = e.y + t.y, this;\n\t}\n\taddScaledVector(e, t) {\n\t\treturn this.x += e.x * t, this.y += e.y * t, this;\n\t}\n\tsub(e) {\n\t\treturn this.x -= e.x, this.y -= e.y, this;\n\t}\n\tsubScalar(e) {\n\t\treturn this.x -= e, this.y -= e, this;\n\t}\n\tsubVectors(e, t) {\n\t\treturn this.x = e.x - t.x, this.y = e.y - t.y, this;\n\t}\n\tmultiply(e) {\n\t\treturn this.x *= e.x, this.y *= e.y, this;\n\t}\n\tmultiplyScalar(e) {\n\t\treturn this.x *= e, this.y *= e, this;\n\t}\n\tdivide(e) {\n\t\treturn this.x /= e.x, this.y /= e.y, this;\n\t}\n\tdivideScalar(e) {\n\t\treturn this.multiplyScalar(1 / e);\n\t}\n\tapplyMatrix3(e) {\n\t\tlet t = this.x, n = this.y, r = e.elements;\n\t\treturn this.x = r[0] * t + r[3] * n + r[6], this.y = r[1] * t + r[4] * n + r[7], this;\n\t}\n\tmin(e) {\n\t\treturn this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this;\n\t}\n\tmax(e) {\n\t\treturn this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this;\n\t}\n\tclamp(e, t) {\n\t\treturn this.x = W(this.x, e.x, t.x), this.y = W(this.y, e.y, t.y), this;\n\t}\n\tclampScalar(e, t) {\n\t\treturn this.x = W(this.x, e, t), this.y = W(this.y, e, t), this;\n\t}\n\tclampLength(e, t) {\n\t\tlet n = this.length();\n\t\treturn this.divideScalar(n || 1).multiplyScalar(W(n, e, t));\n\t}\n\tfloor() {\n\t\treturn this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;\n\t}\n\tceil() {\n\t\treturn this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;\n\t}\n\tround() {\n\t\treturn this.x = Math.round(this.x), this.y = Math.round(this.y), this;\n\t}\n\troundToZero() {\n\t\treturn this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this;\n\t}\n\tnegate() {\n\t\treturn this.x = -this.x, this.y = -this.y, this;\n\t}\n\tdot(e) {\n\t\treturn this.x * e.x + this.y * e.y;\n\t}\n\tcross(e) {\n\t\treturn this.x * e.y - this.y * e.x;\n\t}\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\tangle() {\n\t\treturn Math.atan2(-this.y, -this.x) + Math.PI;\n\t}\n\tangleTo(e) {\n\t\tlet t = Math.sqrt(this.lengthSq() * e.lengthSq());\n\t\tif (t === 0) return Math.PI / 2;\n\t\tlet n = this.dot(e) / t;\n\t\treturn Math.acos(W(n, -1, 1));\n\t}\n\tdistanceTo(e) {\n\t\treturn Math.sqrt(this.distanceToSquared(e));\n\t}\n\tdistanceToSquared(e) {\n\t\tlet t = this.x - e.x, n = this.y - e.y;\n\t\treturn t * t + n * n;\n\t}\n\tmanhattanDistanceTo(e) {\n\t\treturn Math.abs(this.x - e.x) + Math.abs(this.y - e.y);\n\t}\n\tsetLength(e) {\n\t\treturn this.normalize().multiplyScalar(e);\n\t}\n\tlerp(e, t) {\n\t\treturn this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this;\n\t}\n\tlerpVectors(e, t, n) {\n\t\treturn this.x = e.x + (t.x - e.x) * n, this.y = e.y + (t.y - e.y) * n, this;\n\t}\n\tequals(e) {\n\t\treturn e.x === this.x && e.y === this.y;\n\t}\n\tfromArray(e, t = 0) {\n\t\treturn this.x = e[t], this.y = e[t + 1], this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\treturn e[t] = this.x, e[t + 1] = this.y, e;\n\t}\n\tfromBufferAttribute(e, t) {\n\t\treturn this.x = e.getX(t), this.y = e.getY(t), this;\n\t}\n\trotateAround(e, t) {\n\t\tlet n = Math.cos(t), r = Math.sin(t), i = this.x - e.x, a = this.y - e.y;\n\t\treturn this.x = i * n - a * r + e.x, this.y = i * r + a * n + e.y, this;\n\t}\n\trandom() {\n\t\treturn this.x = Math.random(), this.y = Math.random(), this;\n\t}\n\t*[Symbol.iterator]() {\n\t\tyield this.x, yield this.y;\n\t}\n}, ln = class {\n\tconstructor(e = 0, t = 0, n = 0, r = 1) {\n\t\tthis.isQuaternion = !0, this._x = e, this._y = t, this._z = n, this._w = r;\n\t}\n\tstatic slerpFlat(e, t, n, r, i, a, o) {\n\t\tlet s = n[r + 0], c = n[r + 1], l = n[r + 2], u = n[r + 3], d = i[a + 0], f = i[a + 1], p = i[a + 2], m = i[a + 3];\n\t\tif (u !== m || s !== d || c !== f || l !== p) {\n\t\t\tlet e = s * d + c * f + l * p + u * m;\n\t\t\te < 0 && (d = -d, f = -f, p = -p, m = -m, e = -e);\n\t\t\tlet t = 1 - o;\n\t\t\tif (e < .9995) {\n\t\t\t\tlet n = Math.acos(e), r = Math.sin(n);\n\t\t\t\tt = Math.sin(t * n) / r, o = Math.sin(o * n) / r, s = s * t + d * o, c = c * t + f * o, l = l * t + p * o, u = u * t + m * o;\n\t\t\t} else {\n\t\t\t\ts = s * t + d * o, c = c * t + f * o, l = l * t + p * o, u = u * t + m * o;\n\t\t\t\tlet e = 1 / Math.sqrt(s * s + c * c + l * l + u * u);\n\t\t\t\ts *= e, c *= e, l *= e, u *= e;\n\t\t\t}\n\t\t}\n\t\te[t] = s, e[t + 1] = c, e[t + 2] = l, e[t + 3] = u;\n\t}\n\tstatic multiplyQuaternionsFlat(e, t, n, r, i, a) {\n\t\tlet o = n[r], s = n[r + 1], c = n[r + 2], l = n[r + 3], u = i[a], d = i[a + 1], f = i[a + 2], p = i[a + 3];\n\t\treturn e[t] = o * p + l * u + s * f - c * d, e[t + 1] = s * p + l * d + c * u - o * f, e[t + 2] = c * p + l * f + o * d - s * u, e[t + 3] = l * p - o * u - s * d - c * f, e;\n\t}\n\tget x() {\n\t\treturn this._x;\n\t}\n\tset x(e) {\n\t\tthis._x = e, this._onChangeCallback();\n\t}\n\tget y() {\n\t\treturn this._y;\n\t}\n\tset y(e) {\n\t\tthis._y = e, this._onChangeCallback();\n\t}\n\tget z() {\n\t\treturn this._z;\n\t}\n\tset z(e) {\n\t\tthis._z = e, this._onChangeCallback();\n\t}\n\tget w() {\n\t\treturn this._w;\n\t}\n\tset w(e) {\n\t\tthis._w = e, this._onChangeCallback();\n\t}\n\tset(e, t, n, r) {\n\t\treturn this._x = e, this._y = t, this._z = n, this._w = r, this._onChangeCallback(), this;\n\t}\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\tcopy(e) {\n\t\treturn this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;\n\t}\n\tsetFromEuler(e, t = !0) {\n\t\tlet n = e._x, r = e._y, i = e._z, a = e._order, o = Math.cos, s = Math.sin, c = o(n / 2), l = o(r / 2), u = o(i / 2), d = s(n / 2), f = s(r / 2), p = s(i / 2);\n\t\tswitch (a) {\n\t\t\tcase \"XYZ\":\n\t\t\t\tthis._x = d * l * u + c * f * p, this._y = c * f * u - d * l * p, this._z = c * l * p + d * f * u, this._w = c * l * u - d * f * p;\n\t\t\t\tbreak;\n\t\t\tcase \"YXZ\":\n\t\t\t\tthis._x = d * l * u + c * f * p, this._y = c * f * u - d * l * p, this._z = c * l * p - d * f * u, this._w = c * l * u + d * f * p;\n\t\t\t\tbreak;\n\t\t\tcase \"ZXY\":\n\t\t\t\tthis._x = d * l * u - c * f * p, this._y = c * f * u + d * l * p, this._z = c * l * p + d * f * u, this._w = c * l * u - d * f * p;\n\t\t\t\tbreak;\n\t\t\tcase \"ZYX\":\n\t\t\t\tthis._x = d * l * u - c * f * p, this._y = c * f * u + d * l * p, this._z = c * l * p - d * f * u, this._w = c * l * u + d * f * p;\n\t\t\t\tbreak;\n\t\t\tcase \"YZX\":\n\t\t\t\tthis._x = d * l * u + c * f * p, this._y = c * f * u + d * l * p, this._z = c * l * p - d * f * u, this._w = c * l * u - d * f * p;\n\t\t\t\tbreak;\n\t\t\tcase \"XZY\":\n\t\t\t\tthis._x = d * l * u - c * f * p, this._y = c * f * u - d * l * p, this._z = c * l * p + d * f * u, this._w = c * l * u + d * f * p;\n\t\t\t\tbreak;\n\t\t\tdefault: H(\"Quaternion: .setFromEuler() encountered an unknown order: \" + a);\n\t\t}\n\t\treturn t === !0 && this._onChangeCallback(), this;\n\t}\n\tsetFromAxisAngle(e, t) {\n\t\tlet n = t / 2, r = Math.sin(n);\n\t\treturn this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(n), this._onChangeCallback(), this;\n\t}\n\tsetFromRotationMatrix(e) {\n\t\tlet t = e.elements, n = t[0], r = t[4], i = t[8], a = t[1], o = t[5], s = t[9], c = t[2], l = t[6], u = t[10], d = n + o + u;\n\t\tif (d > 0) {\n\t\t\tlet e = .5 / Math.sqrt(d + 1);\n\t\t\tthis._w = .25 / e, this._x = (l - s) * e, this._y = (i - c) * e, this._z = (a - r) * e;\n\t\t} else if (n > o && n > u) {\n\t\t\tlet e = 2 * Math.sqrt(1 + n - o - u);\n\t\t\tthis._w = (l - s) / e, this._x = .25 * e, this._y = (r + a) / e, this._z = (i + c) / e;\n\t\t} else if (o > u) {\n\t\t\tlet e = 2 * Math.sqrt(1 + o - n - u);\n\t\t\tthis._w = (i - c) / e, this._x = (r + a) / e, this._y = .25 * e, this._z = (s + l) / e;\n\t\t} else {\n\t\t\tlet e = 2 * Math.sqrt(1 + u - n - o);\n\t\t\tthis._w = (a - r) / e, this._x = (i + c) / e, this._y = (s + l) / e, this._z = .25 * e;\n\t\t}\n\t\treturn this._onChangeCallback(), this;\n\t}\n\tsetFromUnitVectors(e, t) {\n\t\tlet n = e.dot(t) + 1;\n\t\treturn n < 1e-8 ? (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();\n\t}\n\tangleTo(e) {\n\t\treturn 2 * Math.acos(Math.abs(W(this.dot(e), -1, 1)));\n\t}\n\trotateTowards(e, t) {\n\t\tlet n = this.angleTo(e);\n\t\tif (n === 0) return this;\n\t\tlet r = Math.min(1, t / n);\n\t\treturn this.slerp(e, r), this;\n\t}\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\tinvert() {\n\t\treturn this.conjugate();\n\t}\n\tconjugate() {\n\t\treturn this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;\n\t}\n\tdot(e) {\n\t\treturn this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;\n\t}\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\tnormalize() {\n\t\tlet e = this.length();\n\t\treturn e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x *= e, this._y *= e, this._z *= e, this._w *= e), this._onChangeCallback(), this;\n\t}\n\tmultiply(e) {\n\t\treturn this.multiplyQuaternions(this, e);\n\t}\n\tpremultiply(e) {\n\t\treturn this.multiplyQuaternions(e, this);\n\t}\n\tmultiplyQuaternions(e, t) {\n\t\tlet n = e._x, r = e._y, i = e._z, a = e._w, o = t._x, s = t._y, c = t._z, l = t._w;\n\t\treturn this._x = n * l + a * o + r * c - i * s, this._y = r * l + a * s + i * o - n * c, this._z = i * l + a * c + n * s - r * o, this._w = a * l - n * o - r * s - i * c, this._onChangeCallback(), this;\n\t}\n\tslerp(e, t) {\n\t\tlet n = e._x, r = e._y, i = e._z, a = e._w, o = this.dot(e);\n\t\to < 0 && (n = -n, r = -r, i = -i, a = -a, o = -o);\n\t\tlet s = 1 - t;\n\t\tif (o < .9995) {\n\t\t\tlet e = Math.acos(o), c = Math.sin(e);\n\t\t\ts = Math.sin(s * e) / c, t = Math.sin(t * e) / c, this._x = this._x * s + n * t, this._y = this._y * s + r * t, this._z = this._z * s + i * t, this._w = this._w * s + a * t, this._onChangeCallback();\n\t\t} else this._x = this._x * s + n * t, this._y = this._y * s + r * t, this._z = this._z * s + i * t, this._w = this._w * s + a * t, this.normalize();\n\t\treturn this;\n\t}\n\tslerpQuaternions(e, t, n) {\n\t\treturn this.copy(e).slerp(t, n);\n\t}\n\trandom() {\n\t\tlet e = 2 * Math.PI * Math.random(), t = 2 * Math.PI * Math.random(), n = Math.random(), r = Math.sqrt(1 - n), i = Math.sqrt(n);\n\t\treturn this.set(r * Math.sin(e), r * Math.cos(e), i * Math.sin(t), i * Math.cos(t));\n\t}\n\tequals(e) {\n\t\treturn e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;\n\t}\n\tfromArray(e, t = 0) {\n\t\treturn this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\treturn e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e;\n\t}\n\tfromBufferAttribute(e, t) {\n\t\treturn this._x = e.getX(t), this._y = e.getY(t), this._z = e.getZ(t), this._w = e.getW(t), this._onChangeCallback(), this;\n\t}\n\ttoJSON() {\n\t\treturn this.toArray();\n\t}\n\t_onChange(e) {\n\t\treturn this._onChangeCallback = e, this;\n\t}\n\t_onChangeCallback() {}\n\t*[Symbol.iterator]() {\n\t\tyield this._x, yield this._y, yield this._z, yield this._w;\n\t}\n}, K = class e {\n\tstatic {\n\t\te.prototype.isVector3 = !0;\n\t}\n\tconstructor(e = 0, t = 0, n = 0) {\n\t\tthis.x = e, this.y = t, this.z = n;\n\t}\n\tset(e, t, n) {\n\t\treturn n === void 0 && (n = this.z), this.x = e, this.y = t, this.z = n, this;\n\t}\n\tsetScalar(e) {\n\t\treturn this.x = e, this.y = e, this.z = e, this;\n\t}\n\tsetX(e) {\n\t\treturn this.x = e, this;\n\t}\n\tsetY(e) {\n\t\treturn this.y = e, this;\n\t}\n\tsetZ(e) {\n\t\treturn this.z = e, this;\n\t}\n\tsetComponent(e, t) {\n\t\tswitch (e) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = t;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tthis.y = t;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tthis.z = t;\n\t\t\t\tbreak;\n\t\t\tdefault: throw Error(\"index is out of range: \" + e);\n\t\t}\n\t\treturn this;\n\t}\n\tgetComponent(e) {\n\t\tswitch (e) {\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw Error(\"index is out of range: \" + e);\n\t\t}\n\t}\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\tcopy(e) {\n\t\treturn this.x = e.x, this.y = e.y, this.z = e.z, this;\n\t}\n\tadd(e) {\n\t\treturn this.x += e.x, this.y += e.y, this.z += e.z, this;\n\t}\n\taddScalar(e) {\n\t\treturn this.x += e, this.y += e, this.z += e, this;\n\t}\n\taddVectors(e, t) {\n\t\treturn this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this;\n\t}\n\taddScaledVector(e, t) {\n\t\treturn this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this;\n\t}\n\tsub(e) {\n\t\treturn this.x -= e.x, this.y -= e.y, this.z -= e.z, this;\n\t}\n\tsubScalar(e) {\n\t\treturn this.x -= e, this.y -= e, this.z -= e, this;\n\t}\n\tsubVectors(e, t) {\n\t\treturn this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this;\n\t}\n\tmultiply(e) {\n\t\treturn this.x *= e.x, this.y *= e.y, this.z *= e.z, this;\n\t}\n\tmultiplyScalar(e) {\n\t\treturn this.x *= e, this.y *= e, this.z *= e, this;\n\t}\n\tmultiplyVectors(e, t) {\n\t\treturn this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this;\n\t}\n\tapplyEuler(e) {\n\t\treturn this.applyQuaternion(dn.setFromEuler(e));\n\t}\n\tapplyAxisAngle(e, t) {\n\t\treturn this.applyQuaternion(dn.setFromAxisAngle(e, t));\n\t}\n\tapplyMatrix3(e) {\n\t\tlet t = this.x, n = this.y, r = this.z, i = e.elements;\n\t\treturn this.x = i[0] * t + i[3] * n + i[6] * r, this.y = i[1] * t + i[4] * n + i[7] * r, this.z = i[2] * t + i[5] * n + i[8] * r, this;\n\t}\n\tapplyNormalMatrix(e) {\n\t\treturn this.applyMatrix3(e).normalize();\n\t}\n\tapplyMatrix4(e) {\n\t\tlet t = this.x, n = this.y, r = this.z, i = e.elements, a = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15]);\n\t\treturn this.x = (i[0] * t + i[4] * n + i[8] * r + i[12]) * a, this.y = (i[1] * t + i[5] * n + i[9] * r + i[13]) * a, this.z = (i[2] * t + i[6] * n + i[10] * r + i[14]) * a, this;\n\t}\n\tapplyQuaternion(e) {\n\t\tlet t = this.x, n = this.y, r = this.z, i = e.x, a = e.y, o = e.z, s = e.w, c = 2 * (a * r - o * n), l = 2 * (o * t - i * r), u = 2 * (i * n - a * t);\n\t\treturn this.x = t + s * c + a * u - o * l, this.y = n + s * l + o * c - i * u, this.z = r + s * u + i * l - a * c, this;\n\t}\n\tproject(e) {\n\t\treturn this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);\n\t}\n\tunproject(e) {\n\t\treturn this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld);\n\t}\n\ttransformDirection(e) {\n\t\tlet t = this.x, n = this.y, r = this.z, i = e.elements;\n\t\treturn this.x = i[0] * t + i[4] * n + i[8] * r, this.y = i[1] * t + i[5] * n + i[9] * r, this.z = i[2] * t + i[6] * n + i[10] * r, this.normalize();\n\t}\n\tdivide(e) {\n\t\treturn this.x /= e.x, this.y /= e.y, this.z /= e.z, this;\n\t}\n\tdivideScalar(e) {\n\t\treturn this.multiplyScalar(1 / e);\n\t}\n\tmin(e) {\n\t\treturn 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;\n\t}\n\tmax(e) {\n\t\treturn 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;\n\t}\n\tclamp(e, t) {\n\t\treturn this.x = W(this.x, e.x, t.x), this.y = W(this.y, e.y, t.y), this.z = W(this.z, e.z, t.z), this;\n\t}\n\tclampScalar(e, t) {\n\t\treturn this.x = W(this.x, e, t), this.y = W(this.y, e, t), this.z = W(this.z, e, t), this;\n\t}\n\tclampLength(e, t) {\n\t\tlet n = this.length();\n\t\treturn this.divideScalar(n || 1).multiplyScalar(W(n, e, t));\n\t}\n\tfloor() {\n\t\treturn this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;\n\t}\n\tceil() {\n\t\treturn this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;\n\t}\n\tround() {\n\t\treturn this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;\n\t}\n\troundToZero() {\n\t\treturn this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;\n\t}\n\tnegate() {\n\t\treturn this.x = -this.x, this.y = -this.y, this.z = -this.z, this;\n\t}\n\tdot(e) {\n\t\treturn this.x * e.x + this.y * e.y + this.z * e.z;\n\t}\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\tsetLength(e) {\n\t\treturn this.normalize().multiplyScalar(e);\n\t}\n\tlerp(e, t) {\n\t\treturn this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this;\n\t}\n\tlerpVectors(e, t, n) {\n\t\treturn 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;\n\t}\n\tcross(e) {\n\t\treturn this.crossVectors(this, e);\n\t}\n\tcrossVectors(e, t) {\n\t\tlet n = e.x, r = e.y, i = e.z, a = t.x, o = t.y, s = t.z;\n\t\treturn this.x = r * s - i * o, this.y = i * a - n * s, this.z = n * o - r * a, this;\n\t}\n\tprojectOnVector(e) {\n\t\tlet t = e.lengthSq();\n\t\tif (t === 0) return this.set(0, 0, 0);\n\t\tlet n = e.dot(this) / t;\n\t\treturn this.copy(e).multiplyScalar(n);\n\t}\n\tprojectOnPlane(e) {\n\t\treturn un.copy(this).projectOnVector(e), this.sub(un);\n\t}\n\treflect(e) {\n\t\treturn this.sub(un.copy(e).multiplyScalar(2 * this.dot(e)));\n\t}\n\tangleTo(e) {\n\t\tlet t = Math.sqrt(this.lengthSq() * e.lengthSq());\n\t\tif (t === 0) return Math.PI / 2;\n\t\tlet n = this.dot(e) / t;\n\t\treturn Math.acos(W(n, -1, 1));\n\t}\n\tdistanceTo(e) {\n\t\treturn Math.sqrt(this.distanceToSquared(e));\n\t}\n\tdistanceToSquared(e) {\n\t\tlet t = this.x - e.x, n = this.y - e.y, r = this.z - e.z;\n\t\treturn t * t + n * n + r * r;\n\t}\n\tmanhattanDistanceTo(e) {\n\t\treturn Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z);\n\t}\n\tsetFromSpherical(e) {\n\t\treturn this.setFromSphericalCoords(e.radius, e.phi, e.theta);\n\t}\n\tsetFromSphericalCoords(e, t, n) {\n\t\tlet r = Math.sin(t) * e;\n\t\treturn this.x = r * Math.sin(n), this.y = Math.cos(t) * e, this.z = r * Math.cos(n), this;\n\t}\n\tsetFromCylindrical(e) {\n\t\treturn this.setFromCylindricalCoords(e.radius, e.theta, e.y);\n\t}\n\tsetFromCylindricalCoords(e, t, n) {\n\t\treturn this.x = e * Math.sin(t), this.y = n, this.z = e * Math.cos(t), this;\n\t}\n\tsetFromMatrixPosition(e) {\n\t\tlet t = e.elements;\n\t\treturn this.x = t[12], this.y = t[13], this.z = t[14], this;\n\t}\n\tsetFromMatrixScale(e) {\n\t\tlet t = this.setFromMatrixColumn(e, 0).length(), n = this.setFromMatrixColumn(e, 1).length(), r = this.setFromMatrixColumn(e, 2).length();\n\t\treturn this.x = t, this.y = n, this.z = r, this;\n\t}\n\tsetFromMatrixColumn(e, t) {\n\t\treturn this.fromArray(e.elements, t * 4);\n\t}\n\tsetFromMatrix3Column(e, t) {\n\t\treturn this.fromArray(e.elements, t * 3);\n\t}\n\tsetFromEuler(e) {\n\t\treturn this.x = e._x, this.y = e._y, this.z = e._z, this;\n\t}\n\tsetFromColor(e) {\n\t\treturn this.x = e.r, this.y = e.g, this.z = e.b, this;\n\t}\n\tequals(e) {\n\t\treturn e.x === this.x && e.y === this.y && e.z === this.z;\n\t}\n\tfromArray(e, t = 0) {\n\t\treturn this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\treturn e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e;\n\t}\n\tfromBufferAttribute(e, t) {\n\t\treturn this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this;\n\t}\n\trandom() {\n\t\treturn this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;\n\t}\n\trandomDirection() {\n\t\tlet e = Math.random() * Math.PI * 2, t = Math.random() * 2 - 1, n = Math.sqrt(1 - t * t);\n\t\treturn this.x = n * Math.cos(e), this.y = t, this.z = n * Math.sin(e), this;\n\t}\n\t*[Symbol.iterator]() {\n\t\tyield this.x, yield this.y, yield this.z;\n\t}\n}, un = /*@__PURE__*/ new K(), dn = /*@__PURE__*/ new ln(), q = class e {\n\tstatic {\n\t\te.prototype.isMatrix3 = !0;\n\t}\n\tconstructor(e, t, n, r, i, a, o, s, c) {\n\t\tthis.elements = [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t], e !== void 0 && this.set(e, t, n, r, i, a, o, s, c);\n\t}\n\tset(e, t, n, r, i, a, o, s, c) {\n\t\tlet l = this.elements;\n\t\treturn l[0] = e, l[1] = r, l[2] = o, l[3] = t, l[4] = i, l[5] = s, l[6] = n, l[7] = a, l[8] = c, this;\n\t}\n\tidentity() {\n\t\treturn this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;\n\t}\n\tcopy(e) {\n\t\tlet t = this.elements, n = e.elements;\n\t\treturn 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;\n\t}\n\textractBasis(e, t, n) {\n\t\treturn e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), n.setFromMatrix3Column(this, 2), this;\n\t}\n\tsetFromMatrix4(e) {\n\t\tlet t = e.elements;\n\t\treturn this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this;\n\t}\n\tmultiply(e) {\n\t\treturn this.multiplyMatrices(this, e);\n\t}\n\tpremultiply(e) {\n\t\treturn this.multiplyMatrices(e, this);\n\t}\n\tmultiplyMatrices(e, t) {\n\t\tlet n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[3], s = n[6], c = n[1], l = n[4], u = n[7], d = n[2], f = n[5], p = n[8], m = r[0], h = r[3], g = r[6], _ = r[1], v = r[4], y = r[7], b = r[2], x = r[5], S = r[8];\n\t\treturn i[0] = a * m + o * _ + s * b, i[3] = a * h + o * v + s * x, i[6] = a * g + o * y + s * S, i[1] = c * m + l * _ + u * b, i[4] = c * h + l * v + u * x, i[7] = c * g + l * y + u * S, i[2] = d * m + f * _ + p * b, i[5] = d * h + f * v + p * x, i[8] = d * g + f * y + p * S, this;\n\t}\n\tmultiplyScalar(e) {\n\t\tlet t = this.elements;\n\t\treturn 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;\n\t}\n\tdeterminant() {\n\t\tlet e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], c = e[7], l = e[8];\n\t\treturn t * a * l - t * o * c - n * i * l + n * o * s + r * i * c - r * a * s;\n\t}\n\tinvert() {\n\t\tlet e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], c = e[7], l = e[8], u = l * a - o * c, d = o * s - l * i, f = c * i - a * s, p = t * u + n * d + r * f;\n\t\tif (p === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tlet m = 1 / p;\n\t\treturn e[0] = u * m, e[1] = (r * c - l * n) * m, e[2] = (o * n - r * a) * m, e[3] = d * m, e[4] = (l * t - r * s) * m, e[5] = (r * i - o * t) * m, e[6] = f * m, e[7] = (n * s - c * t) * m, e[8] = (a * t - n * i) * m, this;\n\t}\n\ttranspose() {\n\t\tlet e, t = this.elements;\n\t\treturn 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;\n\t}\n\tgetNormalMatrix(e) {\n\t\treturn this.setFromMatrix4(e).invert().transpose();\n\t}\n\ttransposeIntoArray(e) {\n\t\tlet t = this.elements;\n\t\treturn 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;\n\t}\n\tsetUvTransform(e, t, n, r, i, a, o) {\n\t\tlet s = Math.cos(i), c = Math.sin(i);\n\t\treturn this.set(n * s, n * c, -n * (s * a + c * o) + a + e, -r * c, r * s, -r * (-c * a + s * o) + o + t, 0, 0, 1), this;\n\t}\n\tscale(e, t) {\n\t\treturn this.premultiply(fn.makeScale(e, t)), this;\n\t}\n\trotate(e) {\n\t\treturn this.premultiply(fn.makeRotation(-e)), this;\n\t}\n\ttranslate(e, t) {\n\t\treturn this.premultiply(fn.makeTranslation(e, t)), this;\n\t}\n\tmakeTranslation(e, t) {\n\t\treturn 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;\n\t}\n\tmakeRotation(e) {\n\t\tlet t = Math.cos(e), n = Math.sin(e);\n\t\treturn this.set(t, -n, 0, n, t, 0, 0, 0, 1), this;\n\t}\n\tmakeScale(e, t) {\n\t\treturn this.set(e, 0, 0, 0, t, 0, 0, 0, 1), this;\n\t}\n\tequals(e) {\n\t\tlet t = this.elements, n = e.elements;\n\t\tfor (let e = 0; e < 9; e++) if (t[e] !== n[e]) return !1;\n\t\treturn !0;\n\t}\n\tfromArray(e, t = 0) {\n\t\tfor (let n = 0; n < 9; n++) this.elements[n] = e[n + t];\n\t\treturn this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\tlet n = this.elements;\n\t\treturn 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;\n\t}\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n}, fn = /*@__PURE__*/ new q(), pn = /*@__PURE__*/ new q().set(.4123908, .3575843, .1804808, .212639, .7151687, .0721923, .0193308, .1191948, .9505322), mn = /*@__PURE__*/ new q().set(3.2409699, -1.5373832, -.4986108, -.9692436, 1.8759675, .0415551, .0556301, -.203977, 1.0569715);\nfunction hn() {\n\tlet e = {\n\t\tenabled: !0,\n\t\tworkingColorSpace: vt,\n\t\tspaces: {},\n\t\tconvert: function(e, t, n) {\n\t\t\treturn this.enabled === !1 || t === n || !t || !n ? e : (this.spaces[t].transfer === \"srgb\" && (e.r = _n(e.r), e.g = _n(e.g), e.b = _n(e.b)), this.spaces[t].primaries !== this.spaces[n].primaries && (e.applyMatrix3(this.spaces[t].toXYZ), e.applyMatrix3(this.spaces[n].fromXYZ)), this.spaces[n].transfer === \"srgb\" && (e.r = vn(e.r), e.g = vn(e.g), e.b = vn(e.b)), e);\n\t\t},\n\t\tworkingToColorSpace: function(e, t) {\n\t\t\treturn this.convert(e, this.workingColorSpace, t);\n\t\t},\n\t\tcolorSpaceToWorking: function(e, t) {\n\t\t\treturn this.convert(e, t, this.workingColorSpace);\n\t\t},\n\t\tgetPrimaries: function(e) {\n\t\t\treturn this.spaces[e].primaries;\n\t\t},\n\t\tgetTransfer: function(e) {\n\t\t\treturn e === \"\" ? yt : this.spaces[e].transfer;\n\t\t},\n\t\tgetToneMappingMode: function(e) {\n\t\t\treturn this.spaces[e].outputColorSpaceConfig.toneMappingMode || \"standard\";\n\t\t},\n\t\tgetLuminanceCoefficients: function(e, t = this.workingColorSpace) {\n\t\t\treturn e.fromArray(this.spaces[t].luminanceCoefficients);\n\t\t},\n\t\tdefine: function(e) {\n\t\t\tObject.assign(this.spaces, e);\n\t\t},\n\t\t_getMatrix: function(e, t, n) {\n\t\t\treturn e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ);\n\t\t},\n\t\t_getDrawingBufferColorSpace: function(e) {\n\t\t\treturn this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace;\n\t\t},\n\t\t_getUnpackColorSpace: function(e = this.workingColorSpace) {\n\t\t\treturn this.spaces[e].workingColorSpaceConfig.unpackColorSpace;\n\t\t},\n\t\tfromWorkingColorSpace: function(t, n) {\n\t\t\treturn Mt(\"ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().\"), e.workingToColorSpace(t, n);\n\t\t},\n\t\ttoWorkingColorSpace: function(t, n) {\n\t\t\treturn Mt(\"ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().\"), e.colorSpaceToWorking(t, n);\n\t\t}\n\t}, t = [\n\t\t.64,\n\t\t.33,\n\t\t.3,\n\t\t.6,\n\t\t.15,\n\t\t.06\n\t], n = [\n\t\t.2126,\n\t\t.7152,\n\t\t.0722\n\t], r = [.3127, .329];\n\treturn e.define({\n\t\t[vt]: {\n\t\t\tprimaries: t,\n\t\t\twhitePoint: r,\n\t\t\ttransfer: yt,\n\t\t\ttoXYZ: pn,\n\t\t\tfromXYZ: mn,\n\t\t\tluminanceCoefficients: n,\n\t\t\tworkingColorSpaceConfig: { unpackColorSpace: _t },\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: _t }\n\t\t},\n\t\t[_t]: {\n\t\t\tprimaries: t,\n\t\t\twhitePoint: r,\n\t\t\ttransfer: bt,\n\t\t\ttoXYZ: pn,\n\t\t\tfromXYZ: mn,\n\t\t\tluminanceCoefficients: n,\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: _t }\n\t\t}\n\t}), e;\n}\nvar gn = /*@__PURE__*/ hn();\nfunction _n(e) {\n\treturn e < .04045 ? e * .0773993808 : (e * .9478672986 + .0521327014) ** 2.4;\n}\nfunction vn(e) {\n\treturn e < .0031308 ? e * 12.92 : 1.055 * e ** .41666 - .055;\n}\nvar yn, bn = class {\n\tstatic getDataURL(e, t = \"image/png\") {\n\t\tif (/^data:/i.test(e.src) || typeof HTMLCanvasElement > \"u\") return e.src;\n\t\tlet n;\n\t\tif (e instanceof HTMLCanvasElement) n = e;\n\t\telse {\n\t\t\tyn === void 0 && (yn = Dt(\"canvas\")), yn.width = e.width, yn.height = e.height;\n\t\t\tlet t = yn.getContext(\"2d\");\n\t\t\te instanceof ImageData ? t.putImageData(e, 0, 0) : t.drawImage(e, 0, 0, e.width, e.height), n = yn;\n\t\t}\n\t\treturn n.toDataURL(t);\n\t}\n\tstatic sRGBToLinear(e) {\n\t\tif (typeof HTMLImageElement < \"u\" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < \"u\" && e instanceof HTMLCanvasElement || typeof ImageBitmap < \"u\" && e instanceof ImageBitmap) {\n\t\t\tlet t = Dt(\"canvas\");\n\t\t\tt.width = e.width, t.height = e.height;\n\t\t\tlet n = t.getContext(\"2d\");\n\t\t\tn.drawImage(e, 0, 0, e.width, e.height);\n\t\t\tlet r = n.getImageData(0, 0, e.width, e.height), i = r.data;\n\t\t\tfor (let e = 0; e < i.length; e++) i[e] = _n(i[e] / 255) * 255;\n\t\t\treturn n.putImageData(r, 0, 0), t;\n\t\t}\n\t\tif (e.data) {\n\t\t\tlet t = e.data.slice(0);\n\t\t\tfor (let e = 0; e < t.length; e++) t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[e] = Math.floor(_n(t[e] / 255) * 255) : t[e] = _n(t[e]);\n\t\t\treturn {\n\t\t\t\tdata: t,\n\t\t\t\twidth: e.width,\n\t\t\t\theight: e.height\n\t\t\t};\n\t\t}\n\t\treturn H(\"ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.\"), e;\n\t}\n}, xn = 0, Sn = class {\n\tconstructor(e = null) {\n\t\tthis.isSource = !0, Object.defineProperty(this, \"id\", { value: xn++ }), this.uuid = Bt(), this.data = e, this.dataReady = !0, this.version = 0;\n\t}\n\tgetSize(e) {\n\t\tlet t = this.data;\n\t\treturn typeof HTMLVideoElement < \"u\" && t instanceof HTMLVideoElement ? e.set(t.videoWidth, t.videoHeight, 0) : typeof VideoFrame < \"u\" && t instanceof VideoFrame ? e.set(t.displayWidth, t.displayHeight, 0) : t === null ? e.set(0, 0, 0) : e.set(t.width, t.height, t.depth || 0), e;\n\t}\n\tset needsUpdate(e) {\n\t\te === !0 && this.version++;\n\t}\n\ttoJSON(e) {\n\t\tlet t = e === void 0 || typeof e == \"string\";\n\t\tif (!t && e.images[this.uuid] !== void 0) return e.images[this.uuid];\n\t\tlet n = {\n\t\t\tuuid: this.uuid,\n\t\t\turl: \"\"\n\t\t}, r = this.data;\n\t\tif (r !== null) {\n\t\t\tlet e;\n\t\t\tif (Array.isArray(r)) {\n\t\t\t\te = [];\n\t\t\t\tfor (let t = 0, n = r.length; t < n; t++) r[t].isDataTexture ? e.push(Cn(r[t].image)) : e.push(Cn(r[t]));\n\t\t\t} else e = Cn(r);\n\t\t\tn.url = e;\n\t\t}\n\t\treturn t || (e.images[this.uuid] = n), n;\n\t}\n};\nfunction Cn(e) {\n\treturn typeof HTMLImageElement < \"u\" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < \"u\" && e instanceof HTMLCanvasElement || typeof ImageBitmap < \"u\" && e instanceof ImageBitmap ? bn.getDataURL(e) : e.data ? {\n\t\tdata: Array.from(e.data),\n\t\twidth: e.width,\n\t\theight: e.height,\n\t\ttype: e.data.constructor.name\n\t} : (H(\"Texture: Unable to serialize Texture.\"), {});\n}\nvar wn = 0, Tn = /*@__PURE__*/ new K(), En = class e extends Ft {\n\tconstructor(t = e.DEFAULT_IMAGE, n = e.DEFAULT_MAPPING, r = te, i = te, a = R, o = oe, s = Se, c = se, l = e.DEFAULT_ANISOTROPY, u = \"\") {\n\t\tsuper(), this.isTexture = !0, Object.defineProperty(this, \"id\", { value: wn++ }), this.uuid = Bt(), this.name = \"\", this.source = new Sn(t), this.mipmaps = [], this.mapping = n, this.channel = 0, this.wrapS = r, this.wrapT = i, this.magFilter = a, this.minFilter = o, this.anisotropy = l, this.format = s, this.internalFormat = null, this.type = c, this.offset = new G(0, 0), this.repeat = new G(1, 1), this.center = new G(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new q(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = u, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(t && t.depth && t.depth > 1), this.pmremVersion = 0, this.normalized = !1;\n\t}\n\tget width() {\n\t\treturn this.source.getSize(Tn).x;\n\t}\n\tget height() {\n\t\treturn this.source.getSize(Tn).y;\n\t}\n\tget depth() {\n\t\treturn this.source.getSize(Tn).z;\n\t}\n\tget image() {\n\t\treturn this.source.data;\n\t}\n\tset image(e) {\n\t\tthis.source.data = e;\n\t}\n\tupdateMatrix() {\n\t\tthis.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);\n\t}\n\taddUpdateRange(e, t) {\n\t\tthis.updateRanges.push({\n\t\t\tstart: e,\n\t\t\tcount: t\n\t\t});\n\t}\n\tclearUpdateRanges() {\n\t\tthis.updateRanges.length = 0;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\tcopy(e) {\n\t\treturn 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.normalized = e.normalized, 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.isArrayTexture = e.isArrayTexture, this.userData = JSON.parse(JSON.stringify(e.userData)), this.needsUpdate = !0, this;\n\t}\n\tsetValues(e) {\n\t\tfor (let t in e) {\n\t\t\tlet n = e[t];\n\t\t\tif (n === void 0) {\n\t\t\t\tH(`Texture.setValues(): parameter '${t}' has value of undefined.`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet r = this[t];\n\t\t\tif (r === void 0) {\n\t\t\t\tH(`Texture.setValues(): property '${t}' does not exist.`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tr && n && r.isVector2 && n.isVector2 || r && n && r.isVector3 && n.isVector3 || r && n && r.isMatrix3 && n.isMatrix3 ? r.copy(n) : this[t] = n;\n\t\t}\n\t}\n\ttoJSON(e) {\n\t\tlet t = e === void 0 || typeof e == \"string\";\n\t\tif (!t && e.textures[this.uuid] !== void 0) return e.textures[this.uuid];\n\t\tlet n = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: \"Texture\",\n\t\t\t\tgenerator: \"Texture.toJSON\"\n\t\t\t},\n\t\t\tuuid: this.uuid,\n\t\t\tname: this.name,\n\t\t\timage: this.source.toJSON(e).uuid,\n\t\t\tmapping: this.mapping,\n\t\t\tchannel: this.channel,\n\t\t\trepeat: [this.repeat.x, this.repeat.y],\n\t\t\toffset: [this.offset.x, this.offset.y],\n\t\t\tcenter: [this.center.x, this.center.y],\n\t\t\trotation: this.rotation,\n\t\t\twrap: [this.wrapS, this.wrapT],\n\t\t\tformat: this.format,\n\t\t\tinternalFormat: this.internalFormat,\n\t\t\ttype: this.type,\n\t\t\tnormalized: this.normalized,\n\t\t\tcolorSpace: this.colorSpace,\n\t\t\tminFilter: this.minFilter,\n\t\t\tmagFilter: this.magFilter,\n\t\t\tanisotropy: this.anisotropy,\n\t\t\tflipY: this.flipY,\n\t\t\tgenerateMipmaps: this.generateMipmaps,\n\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\tunpackAlignment: this.unpackAlignment\n\t\t};\n\t\treturn Object.keys(this.userData).length > 0 && (n.userData = this.userData), t || (e.textures[this.uuid] = n), n;\n\t}\n\tdispose() {\n\t\tthis.dispatchEvent({ type: \"dispose\" });\n\t}\n\ttransformUv(e) {\n\t\tif (this.mapping !== 300) return e;\n\t\tif (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) {\n\t\t\tcase ee:\n\t\t\t\te.x -= Math.floor(e.x);\n\t\t\t\tbreak;\n\t\t\tcase te:\n\t\t\t\te.x = e.x < 0 ? 0 : 1;\n\t\t\t\tbreak;\n\t\t\tcase ne: Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x -= Math.floor(e.x);\n\t\t}\n\t\tif (e.y < 0 || e.y > 1) switch (this.wrapT) {\n\t\t\tcase ee:\n\t\t\t\te.y -= Math.floor(e.y);\n\t\t\t\tbreak;\n\t\t\tcase te:\n\t\t\t\te.y = e.y < 0 ? 0 : 1;\n\t\t\t\tbreak;\n\t\t\tcase ne: Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y -= Math.floor(e.y);\n\t\t}\n\t\treturn this.flipY && (e.y = 1 - e.y), e;\n\t}\n\tset needsUpdate(e) {\n\t\te === !0 && (this.version++, this.source.needsUpdate = !0);\n\t}\n\tset needsPMREMUpdate(e) {\n\t\te === !0 && this.pmremVersion++;\n\t}\n};\nEn.DEFAULT_IMAGE = null, En.DEFAULT_MAPPING = 300, En.DEFAULT_ANISOTROPY = 1;\nvar Dn = class e {\n\tstatic {\n\t\te.prototype.isVector4 = !0;\n\t}\n\tconstructor(e = 0, t = 0, n = 0, r = 1) {\n\t\tthis.x = e, this.y = t, this.z = n, this.w = r;\n\t}\n\tget width() {\n\t\treturn this.z;\n\t}\n\tset width(e) {\n\t\tthis.z = e;\n\t}\n\tget height() {\n\t\treturn this.w;\n\t}\n\tset height(e) {\n\t\tthis.w = e;\n\t}\n\tset(e, t, n, r) {\n\t\treturn this.x = e, this.y = t, this.z = n, this.w = r, this;\n\t}\n\tsetScalar(e) {\n\t\treturn this.x = e, this.y = e, this.z = e, this.w = e, this;\n\t}\n\tsetX(e) {\n\t\treturn this.x = e, this;\n\t}\n\tsetY(e) {\n\t\treturn this.y = e, this;\n\t}\n\tsetZ(e) {\n\t\treturn this.z = e, this;\n\t}\n\tsetW(e) {\n\t\treturn this.w = e, this;\n\t}\n\tsetComponent(e, t) {\n\t\tswitch (e) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = t;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tthis.y = t;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tthis.z = t;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tthis.w = t;\n\t\t\t\tbreak;\n\t\t\tdefault: throw Error(\"index is out of range: \" + e);\n\t\t}\n\t\treturn this;\n\t}\n\tgetComponent(e) {\n\t\tswitch (e) {\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw Error(\"index is out of range: \" + e);\n\t\t}\n\t}\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\tcopy(e) {\n\t\treturn this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w === void 0 ? 1 : e.w, this;\n\t}\n\tadd(e) {\n\t\treturn this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this;\n\t}\n\taddScalar(e) {\n\t\treturn this.x += e, this.y += e, this.z += e, this.w += e, this;\n\t}\n\taddVectors(e, t) {\n\t\treturn 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;\n\t}\n\taddScaledVector(e, t) {\n\t\treturn this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this;\n\t}\n\tsub(e) {\n\t\treturn this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this;\n\t}\n\tsubScalar(e) {\n\t\treturn this.x -= e, this.y -= e, this.z -= e, this.w -= e, this;\n\t}\n\tsubVectors(e, t) {\n\t\treturn 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;\n\t}\n\tmultiply(e) {\n\t\treturn this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this;\n\t}\n\tmultiplyScalar(e) {\n\t\treturn this.x *= e, this.y *= e, this.z *= e, this.w *= e, this;\n\t}\n\tapplyMatrix4(e) {\n\t\tlet t = this.x, n = this.y, r = this.z, i = this.w, a = e.elements;\n\t\treturn this.x = a[0] * t + a[4] * n + a[8] * r + a[12] * i, this.y = a[1] * t + a[5] * n + a[9] * r + a[13] * i, this.z = a[2] * t + a[6] * n + a[10] * r + a[14] * i, this.w = a[3] * t + a[7] * n + a[11] * r + a[15] * i, this;\n\t}\n\tdivide(e) {\n\t\treturn this.x /= e.x, this.y /= e.y, this.z /= e.z, this.w /= e.w, this;\n\t}\n\tdivideScalar(e) {\n\t\treturn this.multiplyScalar(1 / e);\n\t}\n\tsetAxisAngleFromQuaternion(e) {\n\t\tthis.w = 2 * Math.acos(e.w);\n\t\tlet t = Math.sqrt(1 - e.w * e.w);\n\t\treturn 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;\n\t}\n\tsetAxisAngleFromRotationMatrix(e) {\n\t\tlet t, n, r, i, a = .01, o = .1, s = e.elements, c = s[0], l = s[4], u = s[8], d = s[1], f = s[5], p = s[9], m = s[2], h = s[6], g = s[10];\n\t\tif (Math.abs(l - d) < a && Math.abs(u - m) < a && Math.abs(p - h) < a) {\n\t\t\tif (Math.abs(l + d) < o && Math.abs(u + m) < o && Math.abs(p + h) < o && Math.abs(c + f + g - 3) < o) return this.set(1, 0, 0, 0), this;\n\t\t\tt = Math.PI;\n\t\t\tlet e = (c + 1) / 2, s = (f + 1) / 2, _ = (g + 1) / 2, v = (l + d) / 4, y = (u + m) / 4, b = (p + h) / 4;\n\t\t\treturn e > s && e > _ ? e < a ? (n = 0, r = .707106781, i = .707106781) : (n = Math.sqrt(e), r = v / n, i = y / n) : s > _ ? s < a ? (n = .707106781, r = 0, i = .707106781) : (r = Math.sqrt(s), n = v / r, i = b / r) : _ < a ? (n = .707106781, r = .707106781, i = 0) : (i = Math.sqrt(_), n = y / i, r = b / i), this.set(n, r, i, t), this;\n\t\t}\n\t\tlet _ = Math.sqrt((h - p) * (h - p) + (u - m) * (u - m) + (d - l) * (d - l));\n\t\treturn Math.abs(_) < .001 && (_ = 1), this.x = (h - p) / _, this.y = (u - m) / _, this.z = (d - l) / _, this.w = Math.acos((c + f + g - 1) / 2), this;\n\t}\n\tsetFromMatrixPosition(e) {\n\t\tlet t = e.elements;\n\t\treturn this.x = t[12], this.y = t[13], this.z = t[14], this.w = t[15], this;\n\t}\n\tmin(e) {\n\t\treturn 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;\n\t}\n\tmax(e) {\n\t\treturn 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;\n\t}\n\tclamp(e, t) {\n\t\treturn this.x = W(this.x, e.x, t.x), this.y = W(this.y, e.y, t.y), this.z = W(this.z, e.z, t.z), this.w = W(this.w, e.w, t.w), this;\n\t}\n\tclampScalar(e, t) {\n\t\treturn this.x = W(this.x, e, t), this.y = W(this.y, e, t), this.z = W(this.z, e, t), this.w = W(this.w, e, t), this;\n\t}\n\tclampLength(e, t) {\n\t\tlet n = this.length();\n\t\treturn this.divideScalar(n || 1).multiplyScalar(W(n, e, t));\n\t}\n\tfloor() {\n\t\treturn 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;\n\t}\n\tceil() {\n\t\treturn 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;\n\t}\n\tround() {\n\t\treturn 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;\n\t}\n\troundToZero() {\n\t\treturn 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;\n\t}\n\tnegate() {\n\t\treturn this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;\n\t}\n\tdot(e) {\n\t\treturn this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;\n\t}\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\tsetLength(e) {\n\t\treturn this.normalize().multiplyScalar(e);\n\t}\n\tlerp(e, t) {\n\t\treturn 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;\n\t}\n\tlerpVectors(e, t, n) {\n\t\treturn 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;\n\t}\n\tequals(e) {\n\t\treturn e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;\n\t}\n\tfromArray(e, t = 0) {\n\t\treturn this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\treturn e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e;\n\t}\n\tfromBufferAttribute(e, t) {\n\t\treturn this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this;\n\t}\n\trandom() {\n\t\treturn this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;\n\t}\n\t*[Symbol.iterator]() {\n\t\tyield this.x, yield this.y, yield this.z, yield this.w;\n\t}\n}, On = class extends Ft {\n\tconstructor(e = 1, t = 1, n = {}) {\n\t\tsuper(), n = Object.assign({\n\t\t\tgenerateMipmaps: !1,\n\t\t\tinternalFormat: null,\n\t\t\tminFilter: R,\n\t\t\tdepthBuffer: !0,\n\t\t\tstencilBuffer: !1,\n\t\t\tresolveDepthBuffer: !0,\n\t\t\tresolveStencilBuffer: !0,\n\t\t\tdepthTexture: null,\n\t\t\tsamples: 0,\n\t\t\tcount: 1,\n\t\t\tdepth: 1,\n\t\t\tmultiview: !1\n\t\t}, n), this.isRenderTarget = !0, this.width = e, this.height = t, this.depth = n.depth, this.scissor = new Dn(0, 0, e, t), this.scissorTest = !1, this.viewport = new Dn(0, 0, e, t), this.textures = [];\n\t\tlet r = new En({\n\t\t\twidth: e,\n\t\t\theight: t,\n\t\t\tdepth: n.depth\n\t\t}), i = n.count;\n\t\tfor (let e = 0; e < i; e++) this.textures[e] = r.clone(), this.textures[e].isRenderTargetTexture = !0, this.textures[e].renderTarget = this;\n\t\tthis._setTextureOptions(n), 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;\n\t}\n\t_setTextureOptions(e = {}) {\n\t\tlet t = {\n\t\t\tminFilter: R,\n\t\t\tgenerateMipmaps: !1,\n\t\t\tflipY: !1,\n\t\t\tinternalFormat: null\n\t\t};\n\t\te.mapping !== void 0 && (t.mapping = e.mapping), e.wrapS !== void 0 && (t.wrapS = e.wrapS), e.wrapT !== void 0 && (t.wrapT = e.wrapT), e.wrapR !== void 0 && (t.wrapR = e.wrapR), e.magFilter !== void 0 && (t.magFilter = e.magFilter), e.minFilter !== void 0 && (t.minFilter = e.minFilter), e.format !== void 0 && (t.format = e.format), e.type !== void 0 && (t.type = e.type), e.anisotropy !== void 0 && (t.anisotropy = e.anisotropy), e.colorSpace !== void 0 && (t.colorSpace = e.colorSpace), e.flipY !== void 0 && (t.flipY = e.flipY), e.generateMipmaps !== void 0 && (t.generateMipmaps = e.generateMipmaps), e.internalFormat !== void 0 && (t.internalFormat = e.internalFormat);\n\t\tfor (let e = 0; e < this.textures.length; e++) this.textures[e].setValues(t);\n\t}\n\tget texture() {\n\t\treturn this.textures[0];\n\t}\n\tset texture(e) {\n\t\tthis.textures[0] = e;\n\t}\n\tset depthTexture(e) {\n\t\tthis._depthTexture !== null && (this._depthTexture.renderTarget = null), e !== null && (e.renderTarget = this), this._depthTexture = e;\n\t}\n\tget depthTexture() {\n\t\treturn this._depthTexture;\n\t}\n\tsetSize(e, t, n = 1) {\n\t\tif (this.width !== e || this.height !== t || this.depth !== n) {\n\t\t\tthis.width = e, this.height = t, this.depth = n;\n\t\t\tfor (let r = 0, i = this.textures.length; r < i; r++) this.textures[r].image.width = e, this.textures[r].image.height = t, this.textures[r].image.depth = n, this.textures[r].isData3DTexture !== !0 && (this.textures[r].isArrayTexture = this.textures[r].image.depth > 1);\n\t\t\tthis.dispose();\n\t\t}\n\t\tthis.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t);\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\tcopy(e) {\n\t\tthis.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;\n\t\tfor (let t = 0, n = e.textures.length; t < n; t++) {\n\t\t\tthis.textures[t] = e.textures[t].clone(), this.textures[t].isRenderTargetTexture = !0, this.textures[t].renderTarget = this;\n\t\t\tlet n = Object.assign({}, e.textures[t].image);\n\t\t\tthis.textures[t].source = new Sn(n);\n\t\t}\n\t\treturn 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.multiview = e.multiview, this;\n\t}\n\tdispose() {\n\t\tthis.dispatchEvent({ type: \"dispose\" });\n\t}\n}, kn = class extends On {\n\tconstructor(e = 1, t = 1, n = {}) {\n\t\tsuper(e, t, n), this.isWebGLRenderTarget = !0;\n\t}\n}, An = class extends En {\n\tconstructor(e = null, t = 1, n = 1, r = 1) {\n\t\tsuper(null), this.isDataArrayTexture = !0, this.image = {\n\t\t\tdata: e,\n\t\t\twidth: t,\n\t\t\theight: n,\n\t\t\tdepth: r\n\t\t}, this.magFilter = L, this.minFilter = L, this.wrapR = te, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();\n\t}\n\taddLayerUpdate(e) {\n\t\tthis.layerUpdates.add(e);\n\t}\n\tclearLayerUpdates() {\n\t\tthis.layerUpdates.clear();\n\t}\n}, jn = class extends En {\n\tconstructor(e = null, t = 1, n = 1, r = 1) {\n\t\tsuper(null), this.isData3DTexture = !0, this.image = {\n\t\t\tdata: e,\n\t\t\twidth: t,\n\t\t\theight: n,\n\t\t\tdepth: r\n\t\t}, this.magFilter = L, this.minFilter = L, this.wrapR = te, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;\n\t}\n}, J = class e {\n\tstatic {\n\t\te.prototype.isMatrix4 = !0;\n\t}\n\tconstructor(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {\n\t\tthis.elements = [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t], e !== void 0 && this.set(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h);\n\t}\n\tset(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {\n\t\tlet g = this.elements;\n\t\treturn g[0] = e, g[4] = t, g[8] = n, g[12] = r, g[1] = i, g[5] = a, g[9] = o, g[13] = s, g[2] = c, g[6] = l, g[10] = u, g[14] = d, g[3] = f, g[7] = p, g[11] = m, g[15] = h, this;\n\t}\n\tidentity() {\n\t\treturn this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;\n\t}\n\tclone() {\n\t\treturn new e().fromArray(this.elements);\n\t}\n\tcopy(e) {\n\t\tlet t = this.elements, n = e.elements;\n\t\treturn 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;\n\t}\n\tcopyPosition(e) {\n\t\tlet t = this.elements, n = e.elements;\n\t\treturn t[12] = n[12], t[13] = n[13], t[14] = n[14], this;\n\t}\n\tsetFromMatrix3(e) {\n\t\tlet t = e.elements;\n\t\treturn 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;\n\t}\n\textractBasis(e, t, n) {\n\t\treturn this.determinant() === 0 ? (e.set(1, 0, 0), t.set(0, 1, 0), n.set(0, 0, 1), this) : (e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), n.setFromMatrixColumn(this, 2), this);\n\t}\n\tmakeBasis(e, t, n) {\n\t\treturn 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;\n\t}\n\textractRotation(e) {\n\t\tif (e.determinant() === 0) return this.identity();\n\t\tlet t = this.elements, n = e.elements, r = 1 / Mn.setFromMatrixColumn(e, 0).length(), i = 1 / Mn.setFromMatrixColumn(e, 1).length(), a = 1 / Mn.setFromMatrixColumn(e, 2).length();\n\t\treturn t[0] = n[0] * r, t[1] = n[1] * r, t[2] = n[2] * r, t[3] = 0, t[4] = n[4] * i, t[5] = n[5] * i, t[6] = n[6] * i, 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;\n\t}\n\tmakeRotationFromEuler(e) {\n\t\tlet t = this.elements, n = e.x, r = e.y, i = e.z, a = Math.cos(n), o = Math.sin(n), s = Math.cos(r), c = Math.sin(r), l = Math.cos(i), u = Math.sin(i);\n\t\tif (e.order === \"XYZ\") {\n\t\t\tlet e = a * l, n = a * u, r = o * l, i = o * u;\n\t\t\tt[0] = s * l, t[4] = -s * u, t[8] = c, t[1] = n + r * c, t[5] = e - i * c, t[9] = -o * s, t[2] = i - e * c, t[6] = r + n * c, t[10] = a * s;\n\t\t} else if (e.order === \"YXZ\") {\n\t\t\tlet e = s * l, n = s * u, r = c * l, i = c * u;\n\t\t\tt[0] = e + i * o, t[4] = r * o - n, t[8] = a * c, t[1] = a * u, t[5] = a * l, t[9] = -o, t[2] = n * o - r, t[6] = i + e * o, t[10] = a * s;\n\t\t} else if (e.order === \"ZXY\") {\n\t\t\tlet e = s * l, n = s * u, r = c * l, i = c * u;\n\t\t\tt[0] = e - i * o, t[4] = -a * u, t[8] = r + n * o, t[1] = n + r * o, t[5] = a * l, t[9] = i - e * o, t[2] = -a * c, t[6] = o, t[10] = a * s;\n\t\t} else if (e.order === \"ZYX\") {\n\t\t\tlet e = a * l, n = a * u, r = o * l, i = o * u;\n\t\t\tt[0] = s * l, t[4] = r * c - n, t[8] = e * c + i, t[1] = s * u, t[5] = i * c + e, t[9] = n * c - r, t[2] = -c, t[6] = o * s, t[10] = a * s;\n\t\t} else if (e.order === \"YZX\") {\n\t\t\tlet e = a * s, n = a * c, r = o * s, i = o * c;\n\t\t\tt[0] = s * l, t[4] = i - e * u, t[8] = r * u + n, t[1] = u, t[5] = a * l, t[9] = -o * l, t[2] = -c * l, t[6] = n * u + r, t[10] = e - i * u;\n\t\t} else if (e.order === \"XZY\") {\n\t\t\tlet e = a * s, n = a * c, r = o * s, i = o * c;\n\t\t\tt[0] = s * l, t[4] = -u, t[8] = c * l, t[1] = e * u + i, t[5] = a * l, t[9] = n * u - r, t[2] = r * u - n, t[6] = o * l, t[10] = i * u + e;\n\t\t}\n\t\treturn t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;\n\t}\n\tmakeRotationFromQuaternion(e) {\n\t\treturn this.compose(Pn, e, Fn);\n\t}\n\tlookAt(e, t, n) {\n\t\tlet r = this.elements;\n\t\treturn Rn.subVectors(e, t), Rn.lengthSq() === 0 && (Rn.z = 1), Rn.normalize(), In.crossVectors(n, Rn), In.lengthSq() === 0 && (Math.abs(n.z) === 1 ? Rn.x += 1e-4 : Rn.z += 1e-4, Rn.normalize(), In.crossVectors(n, Rn)), In.normalize(), Ln.crossVectors(Rn, In), r[0] = In.x, r[4] = Ln.x, r[8] = Rn.x, r[1] = In.y, r[5] = Ln.y, r[9] = Rn.y, r[2] = In.z, r[6] = Ln.z, r[10] = Rn.z, this;\n\t}\n\tmultiply(e) {\n\t\treturn this.multiplyMatrices(this, e);\n\t}\n\tpremultiply(e) {\n\t\treturn this.multiplyMatrices(e, this);\n\t}\n\tmultiplyMatrices(e, t) {\n\t\tlet n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], P = r[7], F = r[11], I = r[15];\n\t\treturn i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * P, i[8] = a * C + o * D + s * j + c * F, i[12] = a * w + o * O + s * M + c * I, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * P, i[9] = l * C + u * D + d * j + f * F, i[13] = l * w + u * O + d * M + f * I, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * P, i[10] = p * C + m * D + h * j + g * F, i[14] = p * w + m * O + h * M + g * I, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * P, i[11] = _ * C + v * D + y * j + b * F, i[15] = _ * w + v * O + y * M + b * I, this;\n\t}\n\tmultiplyScalar(e) {\n\t\tlet t = this.elements;\n\t\treturn 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;\n\t}\n\tdeterminant() {\n\t\tlet e = this.elements, t = e[0], n = e[4], r = e[8], i = e[12], a = e[1], o = e[5], s = e[9], c = e[13], l = e[2], u = e[6], d = e[10], f = e[14], p = e[3], m = e[7], h = e[11], g = e[15], _ = s * f - c * d, v = o * f - c * u, y = o * d - s * u, b = a * f - c * l, x = a * d - s * l, S = a * u - o * l;\n\t\treturn t * (m * _ - h * v + g * y) - n * (p * _ - h * b + g * x) + r * (p * v - m * b + g * S) - i * (p * y - m * x + h * S);\n\t}\n\ttranspose() {\n\t\tlet e = this.elements, t;\n\t\treturn 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;\n\t}\n\tsetPosition(e, t, n) {\n\t\tlet r = this.elements;\n\t\treturn e.isVector3 ? (r[12] = e.x, r[13] = e.y, r[14] = e.z) : (r[12] = e, r[13] = t, r[14] = n), this;\n\t}\n\tinvert() {\n\t\tlet e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], c = e[7], l = e[8], u = e[9], d = e[10], f = e[11], p = e[12], m = e[13], h = e[14], g = e[15], _ = t * o - n * a, v = t * s - r * a, y = t * c - i * a, b = n * s - r * o, x = n * c - i * o, S = r * c - i * s, C = l * m - u * p, w = l * h - d * p, T = l * g - f * p, E = u * h - d * m, D = u * g - f * m, O = d * g - f * h, k = _ * O - v * D + y * E + b * T - x * w + S * C;\n\t\tif (k === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tlet A = 1 / k;\n\t\treturn e[0] = (o * O - s * D + c * E) * A, e[1] = (r * D - n * O - i * E) * A, e[2] = (m * S - h * x + g * b) * A, e[3] = (d * x - u * S - f * b) * A, e[4] = (s * T - a * O - c * w) * A, e[5] = (t * O - r * T + i * w) * A, e[6] = (h * y - p * S - g * v) * A, e[7] = (l * S - d * y + f * v) * A, e[8] = (a * D - o * T + c * C) * A, e[9] = (n * T - t * D - i * C) * A, e[10] = (p * x - m * y + g * _) * A, e[11] = (u * y - l * x - f * _) * A, e[12] = (o * w - a * E - s * C) * A, e[13] = (t * E - n * w + r * C) * A, e[14] = (m * v - p * b - h * _) * A, e[15] = (l * b - u * v + d * _) * A, this;\n\t}\n\tscale(e) {\n\t\tlet t = this.elements, n = e.x, r = e.y, i = e.z;\n\t\treturn t[0] *= n, t[4] *= r, t[8] *= i, t[1] *= n, t[5] *= r, t[9] *= i, t[2] *= n, t[6] *= r, t[10] *= i, t[3] *= n, t[7] *= r, t[11] *= i, this;\n\t}\n\tgetMaxScaleOnAxis() {\n\t\tlet 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], r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];\n\t\treturn Math.sqrt(Math.max(t, n, r));\n\t}\n\tmakeTranslation(e, t, n) {\n\t\treturn 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;\n\t}\n\tmakeRotationX(e) {\n\t\tlet t = Math.cos(e), n = Math.sin(e);\n\t\treturn this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this;\n\t}\n\tmakeRotationY(e) {\n\t\tlet t = Math.cos(e), n = Math.sin(e);\n\t\treturn this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this;\n\t}\n\tmakeRotationZ(e) {\n\t\tlet t = Math.cos(e), n = Math.sin(e);\n\t\treturn this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;\n\t}\n\tmakeRotationAxis(e, t) {\n\t\tlet n = Math.cos(t), r = Math.sin(t), i = 1 - n, a = e.x, o = e.y, s = e.z, c = i * a, l = i * o;\n\t\treturn this.set(c * a + n, c * o - r * s, c * s + r * o, 0, c * o + r * s, l * o + n, l * s - r * a, 0, c * s - r * o, l * s + r * a, i * s * s + n, 0, 0, 0, 0, 1), this;\n\t}\n\tmakeScale(e, t, n) {\n\t\treturn this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this;\n\t}\n\tmakeShear(e, t, n, r, i, a) {\n\t\treturn this.set(1, n, i, 0, e, 1, a, 0, t, r, 1, 0, 0, 0, 0, 1), this;\n\t}\n\tcompose(e, t, n) {\n\t\tlet r = this.elements, i = t._x, a = t._y, o = t._z, s = t._w, c = i + i, l = a + a, u = o + o, d = i * c, f = i * l, p = i * u, m = a * l, h = a * u, g = o * u, _ = s * c, v = s * l, y = s * u, b = n.x, x = n.y, S = n.z;\n\t\treturn r[0] = (1 - (m + g)) * b, r[1] = (f + y) * b, r[2] = (p - v) * b, r[3] = 0, r[4] = (f - y) * x, r[5] = (1 - (d + g)) * x, r[6] = (h + _) * x, r[7] = 0, r[8] = (p + v) * S, r[9] = (h - _) * S, r[10] = (1 - (d + m)) * S, r[11] = 0, r[12] = e.x, r[13] = e.y, r[14] = e.z, r[15] = 1, this;\n\t}\n\tdecompose(e, t, n) {\n\t\tlet r = this.elements;\n\t\te.x = r[12], e.y = r[13], e.z = r[14];\n\t\tlet i = this.determinant();\n\t\tif (i === 0) return n.set(1, 1, 1), t.identity(), this;\n\t\tlet a = Mn.set(r[0], r[1], r[2]).length(), o = Mn.set(r[4], r[5], r[6]).length(), s = Mn.set(r[8], r[9], r[10]).length();\n\t\ti < 0 && (a = -a), Nn.copy(this);\n\t\tlet c = 1 / a, l = 1 / o, u = 1 / s;\n\t\treturn Nn.elements[0] *= c, Nn.elements[1] *= c, Nn.elements[2] *= c, Nn.elements[4] *= l, Nn.elements[5] *= l, Nn.elements[6] *= l, Nn.elements[8] *= u, Nn.elements[9] *= u, Nn.elements[10] *= u, t.setFromRotationMatrix(Nn), n.x = a, n.y = o, n.z = s, this;\n\t}\n\tmakePerspective(e, t, n, r, i, a, o = wt, s = !1) {\n\t\tlet c = this.elements, l = 2 * i / (t - e), u = 2 * i / (n - r), d = (t + e) / (t - e), f = (n + r) / (n - r), p, m;\n\t\tif (s) p = i / (a - i), m = a * i / (a - i);\n\t\telse if (o === 2e3) p = -(a + i) / (a - i), m = -2 * a * i / (a - i);\n\t\telse if (o === 2001) p = -a / (a - i), m = -a * i / (a - i);\n\t\telse throw Error(\"THREE.Matrix4.makePerspective(): Invalid coordinate system: \" + o);\n\t\treturn c[0] = l, c[4] = 0, c[8] = d, c[12] = 0, c[1] = 0, c[5] = u, c[9] = f, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = p, c[14] = m, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this;\n\t}\n\tmakeOrthographic(e, t, n, r, i, a, o = wt, s = !1) {\n\t\tlet c = this.elements, l = 2 / (t - e), u = 2 / (n - r), d = -(t + e) / (t - e), f = -(n + r) / (n - r), p, m;\n\t\tif (s) p = 1 / (a - i), m = a / (a - i);\n\t\telse if (o === 2e3) p = -2 / (a - i), m = -(a + i) / (a - i);\n\t\telse if (o === 2001) p = -1 / (a - i), m = -i / (a - i);\n\t\telse throw Error(\"THREE.Matrix4.makeOrthographic(): Invalid coordinate system: \" + o);\n\t\treturn c[0] = l, c[4] = 0, c[8] = 0, c[12] = d, c[1] = 0, c[5] = u, c[9] = 0, c[13] = f, c[2] = 0, c[6] = 0, c[10] = p, c[14] = m, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this;\n\t}\n\tequals(e) {\n\t\tlet t = this.elements, n = e.elements;\n\t\tfor (let e = 0; e < 16; e++) if (t[e] !== n[e]) return !1;\n\t\treturn !0;\n\t}\n\tfromArray(e, t = 0) {\n\t\tfor (let n = 0; n < 16; n++) this.elements[n] = e[n + t];\n\t\treturn this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\tlet n = this.elements;\n\t\treturn 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;\n\t}\n}, Mn = /*@__PURE__*/ new K(), Nn = /*@__PURE__*/ new J(), Pn = /*@__PURE__*/ new K(0, 0, 0), Fn = /*@__PURE__*/ new K(1, 1, 1), In = /*@__PURE__*/ new K(), Ln = /*@__PURE__*/ new K(), Rn = /*@__PURE__*/ new K(), zn = /*@__PURE__*/ new J(), Bn = /*@__PURE__*/ new ln(), Vn = class e {\n\tconstructor(t = 0, n = 0, r = 0, i = e.DEFAULT_ORDER) {\n\t\tthis.isEuler = !0, this._x = t, this._y = n, this._z = r, this._order = i;\n\t}\n\tget x() {\n\t\treturn this._x;\n\t}\n\tset x(e) {\n\t\tthis._x = e, this._onChangeCallback();\n\t}\n\tget y() {\n\t\treturn this._y;\n\t}\n\tset y(e) {\n\t\tthis._y = e, this._onChangeCallback();\n\t}\n\tget z() {\n\t\treturn this._z;\n\t}\n\tset z(e) {\n\t\tthis._z = e, this._onChangeCallback();\n\t}\n\tget order() {\n\t\treturn this._order;\n\t}\n\tset order(e) {\n\t\tthis._order = e, this._onChangeCallback();\n\t}\n\tset(e, t, n, r = this._order) {\n\t\treturn this._x = e, this._y = t, this._z = n, this._order = r, this._onChangeCallback(), this;\n\t}\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\tcopy(e) {\n\t\treturn this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this;\n\t}\n\tsetFromRotationMatrix(e, t = this._order, n = !0) {\n\t\tlet r = e.elements, i = r[0], a = r[4], o = r[8], s = r[1], c = r[5], l = r[9], u = r[2], d = r[6], f = r[10];\n\t\tswitch (t) {\n\t\t\tcase \"XYZ\":\n\t\t\t\tthis._y = Math.asin(W(o, -1, 1)), Math.abs(o) < .9999999 ? (this._x = Math.atan2(-l, f), this._z = Math.atan2(-a, i)) : (this._x = Math.atan2(d, c), this._z = 0);\n\t\t\t\tbreak;\n\t\t\tcase \"YXZ\":\n\t\t\t\tthis._x = Math.asin(-W(l, -1, 1)), Math.abs(l) < .9999999 ? (this._y = Math.atan2(o, f), this._z = Math.atan2(s, c)) : (this._y = Math.atan2(-u, i), this._z = 0);\n\t\t\t\tbreak;\n\t\t\tcase \"ZXY\":\n\t\t\t\tthis._x = Math.asin(W(d, -1, 1)), Math.abs(d) < .9999999 ? (this._y = Math.atan2(-u, f), this._z = Math.atan2(-a, c)) : (this._y = 0, this._z = Math.atan2(s, i));\n\t\t\t\tbreak;\n\t\t\tcase \"ZYX\":\n\t\t\t\tthis._y = Math.asin(-W(u, -1, 1)), Math.abs(u) < .9999999 ? (this._x = Math.atan2(d, f), this._z = Math.atan2(s, i)) : (this._x = 0, this._z = Math.atan2(-a, c));\n\t\t\t\tbreak;\n\t\t\tcase \"YZX\":\n\t\t\t\tthis._z = Math.asin(W(s, -1, 1)), Math.abs(s) < .9999999 ? (this._x = Math.atan2(-l, c), this._y = Math.atan2(-u, i)) : (this._x = 0, this._y = Math.atan2(o, f));\n\t\t\t\tbreak;\n\t\t\tcase \"XZY\":\n\t\t\t\tthis._z = Math.asin(-W(a, -1, 1)), Math.abs(a) < .9999999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(o, i)) : (this._x = Math.atan2(-l, f), this._y = 0);\n\t\t\t\tbreak;\n\t\t\tdefault: H(\"Euler: .setFromRotationMatrix() encountered an unknown order: \" + t);\n\t\t}\n\t\treturn this._order = t, n === !0 && this._onChangeCallback(), this;\n\t}\n\tsetFromQuaternion(e, t, n) {\n\t\treturn zn.makeRotationFromQuaternion(e), this.setFromRotationMatrix(zn, t, n);\n\t}\n\tsetFromVector3(e, t = this._order) {\n\t\treturn this.set(e.x, e.y, e.z, t);\n\t}\n\treorder(e) {\n\t\treturn Bn.setFromEuler(this), this.setFromQuaternion(Bn, e);\n\t}\n\tequals(e) {\n\t\treturn e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order;\n\t}\n\tfromArray(e) {\n\t\treturn this._x = e[0], this._y = e[1], this._z = e[2], e[3] !== void 0 && (this._order = e[3]), this._onChangeCallback(), this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\treturn e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e;\n\t}\n\t_onChange(e) {\n\t\treturn this._onChangeCallback = e, this;\n\t}\n\t_onChangeCallback() {}\n\t*[Symbol.iterator]() {\n\t\tyield this._x, yield this._y, yield this._z, yield this._order;\n\t}\n};\nVn.DEFAULT_ORDER = \"XYZ\";\nvar Hn = class {\n\tconstructor() {\n\t\tthis.mask = 1;\n\t}\n\tset(e) {\n\t\tthis.mask = (1 << e | 0) >>> 0;\n\t}\n\tenable(e) {\n\t\tthis.mask |= 1 << e | 0;\n\t}\n\tenableAll() {\n\t\tthis.mask = -1;\n\t}\n\ttoggle(e) {\n\t\tthis.mask ^= 1 << e | 0;\n\t}\n\tdisable(e) {\n\t\tthis.mask &= ~(1 << e | 0);\n\t}\n\tdisableAll() {\n\t\tthis.mask = 0;\n\t}\n\ttest(e) {\n\t\treturn (this.mask & e.mask) !== 0;\n\t}\n\tisEnabled(e) {\n\t\treturn !!(this.mask & (1 << e | 0));\n\t}\n}, Un = 0, Wn = /*@__PURE__*/ new K(), Gn = /*@__PURE__*/ new ln(), Kn = /*@__PURE__*/ new J(), qn = /*@__PURE__*/ new K(), Jn = /*@__PURE__*/ new K(), Yn = /*@__PURE__*/ new K(), Xn = /*@__PURE__*/ new ln(), Zn = /*@__PURE__*/ new K(1, 0, 0), Qn = /*@__PURE__*/ new K(0, 1, 0), $n = /*@__PURE__*/ new K(0, 0, 1), er = { type: \"added\" }, tr = { type: \"removed\" }, nr = {\n\ttype: \"childadded\",\n\tchild: null\n}, rr = {\n\ttype: \"childremoved\",\n\tchild: null\n}, ir = class e extends Ft {\n\tconstructor() {\n\t\tsuper(), this.isObject3D = !0, Object.defineProperty(this, \"id\", { value: Un++ }), this.uuid = Bt(), this.name = \"\", this.type = \"Object3D\", this.parent = null, this.children = [], this.up = e.DEFAULT_UP.clone();\n\t\tlet t = new K(), n = new Vn(), r = new ln(), i = new K(1, 1, 1);\n\t\tfunction a() {\n\t\t\tr.setFromEuler(n, !1);\n\t\t}\n\t\tfunction o() {\n\t\t\tn.setFromQuaternion(r, void 0, !1);\n\t\t}\n\t\tn._onChange(a), r._onChange(o), Object.defineProperties(this, {\n\t\t\tposition: {\n\t\t\t\tconfigurable: !0,\n\t\t\t\tenumerable: !0,\n\t\t\t\tvalue: t\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tconfigurable: !0,\n\t\t\t\tenumerable: !0,\n\t\t\t\tvalue: n\n\t\t\t},\n\t\t\tquaternion: {\n\t\t\t\tconfigurable: !0,\n\t\t\t\tenumerable: !0,\n\t\t\t\tvalue: r\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tconfigurable: !0,\n\t\t\t\tenumerable: !0,\n\t\t\t\tvalue: i\n\t\t\t},\n\t\t\tmodelViewMatrix: { value: new J() },\n\t\t\tnormalMatrix: { value: new q() }\n\t\t}), this.matrix = new J(), this.matrixWorld = new J(), this.matrixAutoUpdate = e.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = !1, this.layers = new Hn(), 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.static = !1, this.userData = {}, this.pivot = null;\n\t}\n\tonBeforeShadow() {}\n\tonAfterShadow() {}\n\tonBeforeRender() {}\n\tonAfterRender() {}\n\tapplyMatrix4(e) {\n\t\tthis.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale);\n\t}\n\tapplyQuaternion(e) {\n\t\treturn this.quaternion.premultiply(e), this;\n\t}\n\tsetRotationFromAxisAngle(e, t) {\n\t\tthis.quaternion.setFromAxisAngle(e, t);\n\t}\n\tsetRotationFromEuler(e) {\n\t\tthis.quaternion.setFromEuler(e, !0);\n\t}\n\tsetRotationFromMatrix(e) {\n\t\tthis.quaternion.setFromRotationMatrix(e);\n\t}\n\tsetRotationFromQuaternion(e) {\n\t\tthis.quaternion.copy(e);\n\t}\n\trotateOnAxis(e, t) {\n\t\treturn Gn.setFromAxisAngle(e, t), this.quaternion.multiply(Gn), this;\n\t}\n\trotateOnWorldAxis(e, t) {\n\t\treturn Gn.setFromAxisAngle(e, t), this.quaternion.premultiply(Gn), this;\n\t}\n\trotateX(e) {\n\t\treturn this.rotateOnAxis(Zn, e);\n\t}\n\trotateY(e) {\n\t\treturn this.rotateOnAxis(Qn, e);\n\t}\n\trotateZ(e) {\n\t\treturn this.rotateOnAxis($n, e);\n\t}\n\ttranslateOnAxis(e, t) {\n\t\treturn Wn.copy(e).applyQuaternion(this.quaternion), this.position.add(Wn.multiplyScalar(t)), this;\n\t}\n\ttranslateX(e) {\n\t\treturn this.translateOnAxis(Zn, e);\n\t}\n\ttranslateY(e) {\n\t\treturn this.translateOnAxis(Qn, e);\n\t}\n\ttranslateZ(e) {\n\t\treturn this.translateOnAxis($n, e);\n\t}\n\tlocalToWorld(e) {\n\t\treturn this.updateWorldMatrix(!0, !1), e.applyMatrix4(this.matrixWorld);\n\t}\n\tworldToLocal(e) {\n\t\treturn this.updateWorldMatrix(!0, !1), e.applyMatrix4(Kn.copy(this.matrixWorld).invert());\n\t}\n\tlookAt(e, t, n) {\n\t\te.isVector3 ? qn.copy(e) : qn.set(e, t, n);\n\t\tlet r = this.parent;\n\t\tthis.updateWorldMatrix(!0, !1), Jn.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Kn.lookAt(Jn, qn, this.up) : Kn.lookAt(qn, Jn, this.up), this.quaternion.setFromRotationMatrix(Kn), r && (Kn.extractRotation(r.matrixWorld), Gn.setFromRotationMatrix(Kn), this.quaternion.premultiply(Gn.invert()));\n\t}\n\tadd(e) {\n\t\tif (arguments.length > 1) {\n\t\t\tfor (let e = 0; e < arguments.length; e++) this.add(arguments[e]);\n\t\t\treturn this;\n\t\t}\n\t\treturn e === this ? (U(\"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(er), nr.child = e, this.dispatchEvent(nr), nr.child = null) : U(\"Object3D.add: object not an instance of THREE.Object3D.\", e), this);\n\t}\n\tremove(e) {\n\t\tif (arguments.length > 1) {\n\t\t\tfor (let e = 0; e < arguments.length; e++) this.remove(arguments[e]);\n\t\t\treturn this;\n\t\t}\n\t\tlet t = this.children.indexOf(e);\n\t\treturn t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(tr), rr.child = e, this.dispatchEvent(rr), rr.child = null), this;\n\t}\n\tremoveFromParent() {\n\t\tlet e = this.parent;\n\t\treturn e !== null && e.remove(this), this;\n\t}\n\tclear() {\n\t\treturn this.remove(...this.children);\n\t}\n\tattach(e) {\n\t\treturn this.updateWorldMatrix(!0, !1), Kn.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Kn.multiply(e.parent.matrixWorld)), e.applyMatrix4(Kn), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(er), nr.child = e, this.dispatchEvent(nr), nr.child = null, this;\n\t}\n\tgetObjectById(e) {\n\t\treturn this.getObjectByProperty(\"id\", e);\n\t}\n\tgetObjectByName(e) {\n\t\treturn this.getObjectByProperty(\"name\", e);\n\t}\n\tgetObjectByProperty(e, t) {\n\t\tif (this[e] === t) return this;\n\t\tfor (let n = 0, r = this.children.length; n < r; n++) {\n\t\t\tlet r = this.children[n].getObjectByProperty(e, t);\n\t\t\tif (r !== void 0) return r;\n\t\t}\n\t}\n\tgetObjectsByProperty(e, t, n = []) {\n\t\tthis[e] === t && n.push(this);\n\t\tlet r = this.children;\n\t\tfor (let i = 0, a = r.length; i < a; i++) r[i].getObjectsByProperty(e, t, n);\n\t\treturn n;\n\t}\n\tgetWorldPosition(e) {\n\t\treturn this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld);\n\t}\n\tgetWorldQuaternion(e) {\n\t\treturn this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Jn, e, Yn), e;\n\t}\n\tgetWorldScale(e) {\n\t\treturn this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Jn, Xn, e), e;\n\t}\n\tgetWorldDirection(e) {\n\t\tthis.updateWorldMatrix(!0, !1);\n\t\tlet t = this.matrixWorld.elements;\n\t\treturn e.set(t[8], t[9], t[10]).normalize();\n\t}\n\traycast() {}\n\ttraverse(e) {\n\t\te(this);\n\t\tlet t = this.children;\n\t\tfor (let n = 0, r = t.length; n < r; n++) t[n].traverse(e);\n\t}\n\ttraverseVisible(e) {\n\t\tif (this.visible === !1) return;\n\t\te(this);\n\t\tlet t = this.children;\n\t\tfor (let n = 0, r = t.length; n < r; n++) t[n].traverseVisible(e);\n\t}\n\ttraverseAncestors(e) {\n\t\tlet t = this.parent;\n\t\tt !== null && (e(t), t.traverseAncestors(e));\n\t}\n\tupdateMatrix() {\n\t\tthis.matrix.compose(this.position, this.quaternion, this.scale);\n\t\tlet e = this.pivot;\n\t\tif (e !== null) {\n\t\t\tlet t = e.x, n = e.y, r = e.z, i = this.matrix.elements;\n\t\t\ti[12] += t - i[0] * t - i[4] * n - i[8] * r, i[13] += n - i[1] * t - i[5] * n - i[9] * r, i[14] += r - i[2] * t - i[6] * n - i[10] * r;\n\t\t}\n\t\tthis.matrixWorldNeedsUpdate = !0;\n\t}\n\tupdateMatrixWorld(e) {\n\t\tthis.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);\n\t\tlet t = this.children;\n\t\tfor (let n = 0, r = t.length; n < r; n++) t[n].updateMatrixWorld(e);\n\t}\n\tupdateWorldMatrix(e, t) {\n\t\tlet n = this.parent;\n\t\tif (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) {\n\t\t\tlet e = this.children;\n\t\t\tfor (let t = 0, n = e.length; t < n; t++) e[t].updateWorldMatrix(!1, !0);\n\t\t}\n\t}\n\ttoJSON(e) {\n\t\tlet t = e === void 0 || typeof e == \"string\", n = {};\n\t\tt && (e = {\n\t\t\tgeometries: {},\n\t\t\tmaterials: {},\n\t\t\ttextures: {},\n\t\t\timages: {},\n\t\t\tshapes: {},\n\t\t\tskeletons: {},\n\t\t\tanimations: {},\n\t\t\tnodes: {}\n\t\t}, n.metadata = {\n\t\t\tversion: 4.7,\n\t\t\ttype: \"Object\",\n\t\t\tgenerator: \"Object3D.toJSON\"\n\t\t});\n\t\tlet r = {};\n\t\tr.uuid = this.uuid, r.type = this.type, this.name !== \"\" && (r.name = this.name), this.castShadow === !0 && (r.castShadow = !0), this.receiveShadow === !0 && (r.receiveShadow = !0), this.visible === !1 && (r.visible = !1), this.frustumCulled === !1 && (r.frustumCulled = !1), this.renderOrder !== 0 && (r.renderOrder = this.renderOrder), this.static !== !1 && (r.static = this.static), Object.keys(this.userData).length > 0 && (r.userData = this.userData), r.layers = this.layers.mask, r.matrix = this.matrix.toArray(), r.up = this.up.toArray(), this.pivot !== null && (r.pivot = this.pivot.toArray()), this.matrixAutoUpdate === !1 && (r.matrixAutoUpdate = !1), this.morphTargetDictionary !== void 0 && (r.morphTargetDictionary = Object.assign({}, this.morphTargetDictionary)), this.morphTargetInfluences !== void 0 && (r.morphTargetInfluences = this.morphTargetInfluences.slice()), this.isInstancedMesh && (r.type = \"InstancedMesh\", r.count = this.count, r.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (r.instanceColor = this.instanceColor.toJSON())), this.isBatchedMesh && (r.type = \"BatchedMesh\", r.perObjectFrustumCulled = this.perObjectFrustumCulled, r.sortObjects = this.sortObjects, r.drawRanges = this._drawRanges, r.reservedRanges = this._reservedRanges, r.geometryInfo = this._geometryInfo.map((e) => ({\n\t\t\t...e,\n\t\t\tboundingBox: e.boundingBox ? e.boundingBox.toJSON() : void 0,\n\t\t\tboundingSphere: e.boundingSphere ? e.boundingSphere.toJSON() : void 0\n\t\t})), r.instanceInfo = this._instanceInfo.map((e) => ({ ...e })), r.availableInstanceIds = this._availableInstanceIds.slice(), r.availableGeometryIds = this._availableGeometryIds.slice(), r.nextIndexStart = this._nextIndexStart, r.nextVertexStart = this._nextVertexStart, r.geometryCount = this._geometryCount, r.maxInstanceCount = this._maxInstanceCount, r.maxVertexCount = this._maxVertexCount, r.maxIndexCount = this._maxIndexCount, r.geometryInitialized = this._geometryInitialized, r.matricesTexture = this._matricesTexture.toJSON(e), r.indirectTexture = this._indirectTexture.toJSON(e), this._colorsTexture !== null && (r.colorsTexture = this._colorsTexture.toJSON(e)), this.boundingSphere !== null && (r.boundingSphere = this.boundingSphere.toJSON()), this.boundingBox !== null && (r.boundingBox = this.boundingBox.toJSON()));\n\t\tfunction i(t, n) {\n\t\t\treturn t[n.uuid] === void 0 && (t[n.uuid] = n.toJSON(e)), n.uuid;\n\t\t}\n\t\tif (this.isScene) this.background && (this.background.isColor ? r.background = this.background.toJSON() : this.background.isTexture && (r.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== !0 && (r.environment = this.environment.toJSON(e).uuid);\n\t\telse if (this.isMesh || this.isLine || this.isPoints) {\n\t\t\tr.geometry = i(e.geometries, this.geometry);\n\t\t\tlet t = this.geometry.parameters;\n\t\t\tif (t !== void 0 && t.shapes !== void 0) {\n\t\t\t\tlet n = t.shapes;\n\t\t\t\tif (Array.isArray(n)) for (let t = 0, r = n.length; t < r; t++) {\n\t\t\t\t\tlet r = n[t];\n\t\t\t\t\ti(e.shapes, r);\n\t\t\t\t}\n\t\t\t\telse i(e.shapes, n);\n\t\t\t}\n\t\t}\n\t\tif (this.isSkinnedMesh && (r.bindMode = this.bindMode, r.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (i(e.skeletons, this.skeleton), r.skeleton = this.skeleton.uuid)), this.material !== void 0) {\n\t\t\tif (Array.isArray(this.material)) {\n\t\t\t\tlet t = [];\n\t\t\t\tfor (let n = 0, r = this.material.length; n < r; n++) t.push(i(e.materials, this.material[n]));\n\t\t\t\tr.material = t;\n\t\t\t} else r.material = i(e.materials, this.material);\n\t\t}\n\t\tif (this.children.length > 0) {\n\t\t\tr.children = [];\n\t\t\tfor (let t = 0; t < this.children.length; t++) r.children.push(this.children[t].toJSON(e).object);\n\t\t}\n\t\tif (this.animations.length > 0) {\n\t\t\tr.animations = [];\n\t\t\tfor (let t = 0; t < this.animations.length; t++) {\n\t\t\t\tlet n = this.animations[t];\n\t\t\t\tr.animations.push(i(e.animations, n));\n\t\t\t}\n\t\t}\n\t\tif (t) {\n\t\t\tlet t = a(e.geometries), r = a(e.materials), i = a(e.textures), o = a(e.images), s = a(e.shapes), c = a(e.skeletons), l = a(e.animations), u = a(e.nodes);\n\t\t\tt.length > 0 && (n.geometries = t), r.length > 0 && (n.materials = r), i.length > 0 && (n.textures = i), o.length > 0 && (n.images = o), s.length > 0 && (n.shapes = s), c.length > 0 && (n.skeletons = c), l.length > 0 && (n.animations = l), u.length > 0 && (n.nodes = u);\n\t\t}\n\t\treturn n.object = r, n;\n\t\tfunction a(e) {\n\t\t\tlet t = [];\n\t\t\tfor (let n in e) {\n\t\t\t\tlet r = e[n];\n\t\t\t\tdelete r.metadata, t.push(r);\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t}\n\tclone(e) {\n\t\treturn new this.constructor().copy(this, e);\n\t}\n\tcopy(e, t = !0) {\n\t\tif (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.pivot = e.pivot === null ? null : e.pivot.clone(), 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.static = e.static, this.animations = e.animations.slice(), this.userData = JSON.parse(JSON.stringify(e.userData)), t === !0) for (let t = 0; t < e.children.length; t++) {\n\t\t\tlet n = e.children[t];\n\t\t\tthis.add(n.clone());\n\t\t}\n\t\treturn this;\n\t}\n};\nir.DEFAULT_UP = /*@__PURE__*/ new K(0, 1, 0), ir.DEFAULT_MATRIX_AUTO_UPDATE = !0, ir.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;\nvar ar = class extends ir {\n\tconstructor() {\n\t\tsuper(), this.isGroup = !0, this.type = \"Group\";\n\t}\n}, or = { type: \"move\" }, sr = class {\n\tconstructor() {\n\t\tthis._targetRay = null, this._grip = null, this._hand = null;\n\t}\n\tgetHandSpace() {\n\t\treturn this._hand === null && (this._hand = new ar(), this._hand.matrixAutoUpdate = !1, this._hand.visible = !1, this._hand.joints = {}, this._hand.inputState = { pinching: !1 }), this._hand;\n\t}\n\tgetTargetRaySpace() {\n\t\treturn this._targetRay === null && (this._targetRay = new ar(), this._targetRay.matrixAutoUpdate = !1, this._targetRay.visible = !1, this._targetRay.hasLinearVelocity = !1, this._targetRay.linearVelocity = new K(), this._targetRay.hasAngularVelocity = !1, this._targetRay.angularVelocity = new K()), this._targetRay;\n\t}\n\tgetGripSpace() {\n\t\treturn this._grip === null && (this._grip = new ar(), this._grip.matrixAutoUpdate = !1, this._grip.visible = !1, this._grip.hasLinearVelocity = !1, this._grip.linearVelocity = new K(), this._grip.hasAngularVelocity = !1, this._grip.angularVelocity = new K(), this._grip.eventsEnabled = !1), this._grip;\n\t}\n\tdispatchEvent(e) {\n\t\treturn this._targetRay !== null && this._targetRay.dispatchEvent(e), this._grip !== null && this._grip.dispatchEvent(e), this._hand !== null && this._hand.dispatchEvent(e), this;\n\t}\n\tconnect(e) {\n\t\tif (e && e.hand) {\n\t\t\tlet t = this._hand;\n\t\t\tif (t) for (let n of e.hand.values()) this._getHandJoint(t, n);\n\t\t}\n\t\treturn this.dispatchEvent({\n\t\t\ttype: \"connected\",\n\t\t\tdata: e\n\t\t}), this;\n\t}\n\tdisconnect(e) {\n\t\treturn this.dispatchEvent({\n\t\t\ttype: \"disconnected\",\n\t\t\tdata: e\n\t\t}), this._targetRay !== null && (this._targetRay.visible = !1), this._grip !== null && (this._grip.visible = !1), this._hand !== null && (this._hand.visible = !1), this;\n\t}\n\tupdate(e, t, n) {\n\t\tlet r = null, i = null, a = null, o = this._targetRay, s = this._grip, c = this._hand;\n\t\tif (e && t.session.visibilityState !== \"visible-blurred\") {\n\t\t\tif (c && e.hand) {\n\t\t\t\ta = !0;\n\t\t\t\tfor (let r of e.hand.values()) {\n\t\t\t\t\tlet e = t.getJointPose(r, n), i = this._getHandJoint(c, r);\n\t\t\t\t\te !== null && (i.matrix.fromArray(e.transform.matrix), i.matrix.decompose(i.position, i.rotation, i.scale), i.matrixWorldNeedsUpdate = !0, i.jointRadius = e.radius), i.visible = e !== null;\n\t\t\t\t}\n\t\t\t\tlet r = c.joints[\"index-finger-tip\"], i = c.joints[\"thumb-tip\"], o = r.position.distanceTo(i.position);\n\t\t\t\tc.inputState.pinching && o > .025 ? (c.inputState.pinching = !1, this.dispatchEvent({\n\t\t\t\t\ttype: \"pinchend\",\n\t\t\t\t\thandedness: e.handedness,\n\t\t\t\t\ttarget: this\n\t\t\t\t})) : !c.inputState.pinching && o <= .015 && (c.inputState.pinching = !0, this.dispatchEvent({\n\t\t\t\t\ttype: \"pinchstart\",\n\t\t\t\t\thandedness: e.handedness,\n\t\t\t\t\ttarget: this\n\t\t\t\t}));\n\t\t\t} else s !== null && e.gripSpace && (i = t.getPose(e.gripSpace, n), i !== null && (s.matrix.fromArray(i.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale), s.matrixWorldNeedsUpdate = !0, i.linearVelocity ? (s.hasLinearVelocity = !0, s.linearVelocity.copy(i.linearVelocity)) : s.hasLinearVelocity = !1, i.angularVelocity ? (s.hasAngularVelocity = !0, s.angularVelocity.copy(i.angularVelocity)) : s.hasAngularVelocity = !1, s.eventsEnabled && s.dispatchEvent({\n\t\t\t\ttype: \"gripUpdated\",\n\t\t\t\tdata: e,\n\t\t\t\ttarget: this\n\t\t\t})));\n\t\t\to !== null && (r = t.getPose(e.targetRaySpace, n), r === null && i !== null && (r = i), r !== null && (o.matrix.fromArray(r.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), o.matrixWorldNeedsUpdate = !0, r.linearVelocity ? (o.hasLinearVelocity = !0, o.linearVelocity.copy(r.linearVelocity)) : o.hasLinearVelocity = !1, r.angularVelocity ? (o.hasAngularVelocity = !0, o.angularVelocity.copy(r.angularVelocity)) : o.hasAngularVelocity = !1, this.dispatchEvent(or)));\n\t\t}\n\t\treturn o !== null && (o.visible = r !== null), s !== null && (s.visible = i !== null), c !== null && (c.visible = a !== null), this;\n\t}\n\t_getHandJoint(e, t) {\n\t\tif (e.joints[t.jointName] === void 0) {\n\t\t\tlet n = new ar();\n\t\t\tn.matrixAutoUpdate = !1, n.visible = !1, e.joints[t.jointName] = n, e.add(n);\n\t\t}\n\t\treturn e.joints[t.jointName];\n\t}\n}, cr = {\n\taliceblue: 15792383,\n\tantiquewhite: 16444375,\n\taqua: 65535,\n\taquamarine: 8388564,\n\tazure: 15794175,\n\tbeige: 16119260,\n\tbisque: 16770244,\n\tblack: 0,\n\tblanchedalmond: 16772045,\n\tblue: 255,\n\tblueviolet: 9055202,\n\tbrown: 10824234,\n\tburlywood: 14596231,\n\tcadetblue: 6266528,\n\tchartreuse: 8388352,\n\tchocolate: 13789470,\n\tcoral: 16744272,\n\tcornflowerblue: 6591981,\n\tcornsilk: 16775388,\n\tcrimson: 14423100,\n\tcyan: 65535,\n\tdarkblue: 139,\n\tdarkcyan: 35723,\n\tdarkgoldenrod: 12092939,\n\tdarkgray: 11119017,\n\tdarkgreen: 25600,\n\tdarkgrey: 11119017,\n\tdarkkhaki: 12433259,\n\tdarkmagenta: 9109643,\n\tdarkolivegreen: 5597999,\n\tdarkorange: 16747520,\n\tdarkorchid: 10040012,\n\tdarkred: 9109504,\n\tdarksalmon: 15308410,\n\tdarkseagreen: 9419919,\n\tdarkslateblue: 4734347,\n\tdarkslategray: 3100495,\n\tdarkslategrey: 3100495,\n\tdarkturquoise: 52945,\n\tdarkviolet: 9699539,\n\tdeeppink: 16716947,\n\tdeepskyblue: 49151,\n\tdimgray: 6908265,\n\tdimgrey: 6908265,\n\tdodgerblue: 2003199,\n\tfirebrick: 11674146,\n\tfloralwhite: 16775920,\n\tforestgreen: 2263842,\n\tfuchsia: 16711935,\n\tgainsboro: 14474460,\n\tghostwhite: 16316671,\n\tgold: 16766720,\n\tgoldenrod: 14329120,\n\tgray: 8421504,\n\tgreen: 32768,\n\tgreenyellow: 11403055,\n\tgrey: 8421504,\n\thoneydew: 15794160,\n\thotpink: 16738740,\n\tindianred: 13458524,\n\tindigo: 4915330,\n\tivory: 16777200,\n\tkhaki: 15787660,\n\tlavender: 15132410,\n\tlavenderblush: 16773365,\n\tlawngreen: 8190976,\n\tlemonchiffon: 16775885,\n\tlightblue: 11393254,\n\tlightcoral: 15761536,\n\tlightcyan: 14745599,\n\tlightgoldenrodyellow: 16448210,\n\tlightgray: 13882323,\n\tlightgreen: 9498256,\n\tlightgrey: 13882323,\n\tlightpink: 16758465,\n\tlightsalmon: 16752762,\n\tlightseagreen: 2142890,\n\tlightskyblue: 8900346,\n\tlightslategray: 7833753,\n\tlightslategrey: 7833753,\n\tlightsteelblue: 11584734,\n\tlightyellow: 16777184,\n\tlime: 65280,\n\tlimegreen: 3329330,\n\tlinen: 16445670,\n\tmagenta: 16711935,\n\tmaroon: 8388608,\n\tmediumaquamarine: 6737322,\n\tmediumblue: 205,\n\tmediumorchid: 12211667,\n\tmediumpurple: 9662683,\n\tmediumseagreen: 3978097,\n\tmediumslateblue: 8087790,\n\tmediumspringgreen: 64154,\n\tmediumturquoise: 4772300,\n\tmediumvioletred: 13047173,\n\tmidnightblue: 1644912,\n\tmintcream: 16121850,\n\tmistyrose: 16770273,\n\tmoccasin: 16770229,\n\tnavajowhite: 16768685,\n\tnavy: 128,\n\toldlace: 16643558,\n\tolive: 8421376,\n\tolivedrab: 7048739,\n\torange: 16753920,\n\torangered: 16729344,\n\torchid: 14315734,\n\tpalegoldenrod: 15657130,\n\tpalegreen: 10025880,\n\tpaleturquoise: 11529966,\n\tpalevioletred: 14381203,\n\tpapayawhip: 16773077,\n\tpeachpuff: 16767673,\n\tperu: 13468991,\n\tpink: 16761035,\n\tplum: 14524637,\n\tpowderblue: 11591910,\n\tpurple: 8388736,\n\trebeccapurple: 6697881,\n\tred: 16711680,\n\trosybrown: 12357519,\n\troyalblue: 4286945,\n\tsaddlebrown: 9127187,\n\tsalmon: 16416882,\n\tsandybrown: 16032864,\n\tseagreen: 3050327,\n\tseashell: 16774638,\n\tsienna: 10506797,\n\tsilver: 12632256,\n\tskyblue: 8900331,\n\tslateblue: 6970061,\n\tslategray: 7372944,\n\tslategrey: 7372944,\n\tsnow: 16775930,\n\tspringgreen: 65407,\n\tsteelblue: 4620980,\n\ttan: 13808780,\n\tteal: 32896,\n\tthistle: 14204888,\n\ttomato: 16737095,\n\tturquoise: 4251856,\n\tviolet: 15631086,\n\twheat: 16113331,\n\twhite: 16777215,\n\twhitesmoke: 16119285,\n\tyellow: 16776960,\n\tyellowgreen: 10145074\n}, lr = {\n\th: 0,\n\ts: 0,\n\tl: 0\n}, ur = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nfunction dr(e, t, n) {\n\treturn n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * 6 * (2 / 3 - n) : e;\n}\nvar fr = class {\n\tconstructor(e, t, n) {\n\t\treturn this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e, t, n);\n\t}\n\tset(e, t, n) {\n\t\tif (t === void 0 && n === void 0) {\n\t\t\tlet t = e;\n\t\t\tt && t.isColor ? this.copy(t) : typeof t == \"number\" ? this.setHex(t) : typeof t == \"string\" && this.setStyle(t);\n\t\t} else this.setRGB(e, t, n);\n\t\treturn this;\n\t}\n\tsetScalar(e) {\n\t\treturn this.r = e, this.g = e, this.b = e, this;\n\t}\n\tsetHex(e, t = _t) {\n\t\treturn e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, gn.colorSpaceToWorking(this, t), this;\n\t}\n\tsetRGB(e, t, n, r = gn.workingColorSpace) {\n\t\treturn this.r = e, this.g = t, this.b = n, gn.colorSpaceToWorking(this, r), this;\n\t}\n\tsetHSL(e, t, n, r = gn.workingColorSpace) {\n\t\tif (e = Vt(e, 1), t = W(t, 0, 1), n = W(n, 0, 1), t === 0) this.r = this.g = this.b = n;\n\t\telse {\n\t\t\tlet r = n <= .5 ? n * (1 + t) : n + t - n * t, i = 2 * n - r;\n\t\t\tthis.r = dr(i, r, e + 1 / 3), this.g = dr(i, r, e), this.b = dr(i, r, e - 1 / 3);\n\t\t}\n\t\treturn gn.colorSpaceToWorking(this, r), this;\n\t}\n\tsetStyle(e, t = _t) {\n\t\tfunction n(t) {\n\t\t\tt !== void 0 && parseFloat(t) < 1 && H(\"Color: Alpha component of \" + e + \" will be ignored.\");\n\t\t}\n\t\tlet r;\n\t\tif (r = /^(\\w+)\\(([^\\)]*)\\)/.exec(e)) {\n\t\t\tlet i, a = r[1], o = r[2];\n\t\t\tswitch (a) {\n\t\t\t\tcase \"rgb\":\n\t\t\t\tcase \"rgba\":\n\t\t\t\t\tif (i = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o)) return n(i[4]), this.setRGB(Math.min(255, parseInt(i[1], 10)) / 255, Math.min(255, parseInt(i[2], 10)) / 255, Math.min(255, parseInt(i[3], 10)) / 255, t);\n\t\t\t\t\tif (i = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o)) return n(i[4]), this.setRGB(Math.min(100, parseInt(i[1], 10)) / 100, Math.min(100, parseInt(i[2], 10)) / 100, Math.min(100, parseInt(i[3], 10)) / 100, t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"hsl\":\n\t\t\t\tcase \"hsla\":\n\t\t\t\t\tif (i = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o)) return n(i[4]), this.setHSL(parseFloat(i[1]) / 360, parseFloat(i[2]) / 100, parseFloat(i[3]) / 100, t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: H(\"Color: Unknown color model \" + e);\n\t\t\t}\n\t\t} else if (r = /^\\#([A-Fa-f\\d]+)$/.exec(e)) {\n\t\t\tlet n = r[1], i = n.length;\n\t\t\tif (i === 3) return this.setRGB(parseInt(n.charAt(0), 16) / 15, parseInt(n.charAt(1), 16) / 15, parseInt(n.charAt(2), 16) / 15, t);\n\t\t\tif (i === 6) return this.setHex(parseInt(n, 16), t);\n\t\t\tH(\"Color: Invalid hex color \" + e);\n\t\t} else if (e && e.length > 0) return this.setColorName(e, t);\n\t\treturn this;\n\t}\n\tsetColorName(e, t = _t) {\n\t\tlet n = cr[e.toLowerCase()];\n\t\treturn n === void 0 ? H(\"Color: Unknown color \" + e) : this.setHex(n, t), this;\n\t}\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\tcopy(e) {\n\t\treturn this.r = e.r, this.g = e.g, this.b = e.b, this;\n\t}\n\tcopySRGBToLinear(e) {\n\t\treturn this.r = _n(e.r), this.g = _n(e.g), this.b = _n(e.b), this;\n\t}\n\tcopyLinearToSRGB(e) {\n\t\treturn this.r = vn(e.r), this.g = vn(e.g), this.b = vn(e.b), this;\n\t}\n\tconvertSRGBToLinear() {\n\t\treturn this.copySRGBToLinear(this), this;\n\t}\n\tconvertLinearToSRGB() {\n\t\treturn this.copyLinearToSRGB(this), this;\n\t}\n\tgetHex(e = _t) {\n\t\treturn gn.workingToColorSpace(pr.copy(this), e), Math.round(W(pr.r * 255, 0, 255)) * 65536 + Math.round(W(pr.g * 255, 0, 255)) * 256 + Math.round(W(pr.b * 255, 0, 255));\n\t}\n\tgetHexString(e = _t) {\n\t\treturn (\"000000\" + this.getHex(e).toString(16)).slice(-6);\n\t}\n\tgetHSL(e, t = gn.workingColorSpace) {\n\t\tgn.workingToColorSpace(pr.copy(this), t);\n\t\tlet n = pr.r, r = pr.g, i = pr.b, a = Math.max(n, r, i), o = Math.min(n, r, i), s, c, l = (o + a) / 2;\n\t\tif (o === a) s = 0, c = 0;\n\t\telse {\n\t\t\tlet e = a - o;\n\t\t\tswitch (c = l <= .5 ? e / (a + o) : e / (2 - a - o), a) {\n\t\t\t\tcase n:\n\t\t\t\t\ts = (r - i) / e + (r < i ? 6 : 0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase r:\n\t\t\t\t\ts = (i - n) / e + 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase i: s = (n - r) / e + 4;\n\t\t\t}\n\t\t\ts /= 6;\n\t\t}\n\t\treturn e.h = s, e.s = c, e.l = l, e;\n\t}\n\tgetRGB(e, t = gn.workingColorSpace) {\n\t\treturn gn.workingToColorSpace(pr.copy(this), t), e.r = pr.r, e.g = pr.g, e.b = pr.b, e;\n\t}\n\tgetStyle(e = _t) {\n\t\tgn.workingToColorSpace(pr.copy(this), e);\n\t\tlet t = pr.r, n = pr.g, r = pr.b;\n\t\treturn e === \"srgb\" ? `rgb(${Math.round(t * 255)},${Math.round(n * 255)},${Math.round(r * 255)})` : `color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`;\n\t}\n\toffsetHSL(e, t, n) {\n\t\treturn this.getHSL(lr), this.setHSL(lr.h + e, lr.s + t, lr.l + n);\n\t}\n\tadd(e) {\n\t\treturn this.r += e.r, this.g += e.g, this.b += e.b, this;\n\t}\n\taddColors(e, t) {\n\t\treturn this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this;\n\t}\n\taddScalar(e) {\n\t\treturn this.r += e, this.g += e, this.b += e, this;\n\t}\n\tsub(e) {\n\t\treturn 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;\n\t}\n\tmultiply(e) {\n\t\treturn this.r *= e.r, this.g *= e.g, this.b *= e.b, this;\n\t}\n\tmultiplyScalar(e) {\n\t\treturn this.r *= e, this.g *= e, this.b *= e, this;\n\t}\n\tlerp(e, t) {\n\t\treturn this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this;\n\t}\n\tlerpColors(e, t, n) {\n\t\treturn 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;\n\t}\n\tlerpHSL(e, t) {\n\t\tthis.getHSL(lr), e.getHSL(ur);\n\t\tlet n = Wt(lr.h, ur.h, t), r = Wt(lr.s, ur.s, t), i = Wt(lr.l, ur.l, t);\n\t\treturn this.setHSL(n, r, i), this;\n\t}\n\tsetFromVector3(e) {\n\t\treturn this.r = e.x, this.g = e.y, this.b = e.z, this;\n\t}\n\tapplyMatrix3(e) {\n\t\tlet t = this.r, n = this.g, r = this.b, i = e.elements;\n\t\treturn this.r = i[0] * t + i[3] * n + i[6] * r, this.g = i[1] * t + i[4] * n + i[7] * r, this.b = i[2] * t + i[5] * n + i[8] * r, this;\n\t}\n\tequals(e) {\n\t\treturn e.r === this.r && e.g === this.g && e.b === this.b;\n\t}\n\tfromArray(e, t = 0) {\n\t\treturn this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this;\n\t}\n\ttoArray(e = [], t = 0) {\n\t\treturn e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e;\n\t}\n\tfromBufferAttribute(e, t) {\n\t\treturn this.r = e.getX(t), this.g = e.getY(t), this.b = e.getZ(t), this;\n\t}\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\t*[Symbol.iterator]() {\n\t\tyield this.r, yield this.g, yield this.b;\n\t}\n}, pr = /*@__PURE__*/ new fr();\nfr.NAMES = cr;\nvar mr = class extends ir {\n\tconstructor() {\n\t\tsuper(), this.isScene = !0, this.type = \"Scene\", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Vn(), this.environmentIntensity = 1, this.environmentRotation = new Vn(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < \"u\" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n\t}\n\tcopy(e, t) {\n\t\treturn 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;\n\t}\n\ttoJSON(e) {\n\t\tlet t = super.toJSON(e);\n\t\treturn 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;\n\t}\n}, hr = /*@__PURE__*/ new K(), gr = /*@__PURE__*/ new K(), _r = /*@__PURE__*/ new K(), vr = /*@__PURE__*/ new K(), yr = /*@__PURE__*/ new K(), br = /*@__PURE__*/ new K(), xr = /*@__PURE__*/ new K(), Sr = /*@__PURE__*/ new K(), Cr = /*@__PURE__*/ new K(), wr = /*@__PURE__*/ new K(), Tr = /*@__PURE__*/ new Dn(), Er = /*@__PURE__*/ new Dn(), Dr = /*@__PURE__*/ new Dn(), Or = class e {\n\tconstructor(e = new K(), t = new K(), n = new K()) {\n\t\tthis.a = e, this.b = t, this.c = n;\n\t}\n\tstatic getNormal(e, t, n, r) {\n\t\tr.subVectors(n, t), hr.subVectors(e, t), r.cross(hr);\n\t\tlet i = r.lengthSq();\n\t\treturn i > 0 ? r.multiplyScalar(1 / Math.sqrt(i)) : r.set(0, 0, 0);\n\t}\n\tstatic getBarycoord(e, t, n, r, i) {\n\t\thr.subVectors(r, t), gr.subVectors(n, t), _r.subVectors(e, t);\n\t\tlet a = hr.dot(hr), o = hr.dot(gr), s = hr.dot(_r), c = gr.dot(gr), l = gr.dot(_r), u = a * c - o * o;\n\t\tif (u === 0) return i.set(0, 0, 0), null;\n\t\tlet d = 1 / u, f = (c * s - o * l) * d, p = (a * l - o * s) * d;\n\t\treturn i.set(1 - f - p, p, f);\n\t}\n\tstatic containsPoint(e, t, n, r) {\n\t\treturn this.getBarycoord(e, t, n, r, vr) !== null && vr.x >= 0 && vr.y >= 0 && vr.x + vr.y <= 1;\n\t}\n\tstatic getInterpolation(e, t, n, r, i, a, o, s) {\n\t\treturn this.getBarycoord(e, t, n, r, vr) === null ? (s.x = 0, s.y = 0, \"z\" in s && (s.z = 0), \"w\" in s && (s.w = 0), null) : (s.setScalar(0), s.addScaledVector(i, vr.x), s.addScaledVector(a, vr.y), s.addScaledVector(o, vr.z), s);\n\t}\n\tstatic getInterpolatedAttribute(e, t, n, r, i, a) {\n\t\treturn Tr.setScalar(0), Er.setScalar(0), Dr.setScalar(0), Tr.fromBufferAttribute(e, t), Er.fromBufferAttribute(e, n), Dr.fromBufferAttribute(e, r), a.setScalar(0), a.addScaledVector(Tr, i.x), a.addScaledVector(Er, i.y), a.addScaledVector(Dr, i.z), a;\n\t}\n\tstatic isFrontFacing(e, t, n, r) {\n\t\treturn hr.subVectors(n, t), gr.subVectors(e, t), hr.cross(gr).dot(r) < 0;\n\t}\n\tset(e, t, n) {\n\t\treturn this.a.copy(e), this.b.copy(t), this.c.copy(n), this;\n\t}\n\tsetFromPointsAndIndices(e, t, n, r) {\n\t\treturn this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this;\n\t}\n\tsetFromAttributeAndIndices(e, t, n, r) {\n\t\treturn this.a.fromBufferAttribute(e, t), this.b.fromBufferAttribute(e, n), this.c.fromBufferAttribute(e, r), this;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\tcopy(e) {\n\t\treturn this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;\n\t}\n\tgetArea() {\n\t\treturn hr.subVectors(this.c, this.b), gr.subVectors(this.a, this.b), hr.cross(gr).length() * .5;\n\t}\n\tgetMidpoint(e) {\n\t\treturn e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\tgetNormal(t) {\n\t\treturn e.getNormal(this.a, this.b, this.c, t);\n\t}\n\tgetPlane(e) {\n\t\treturn e.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\tgetBarycoord(t, n) {\n\t\treturn e.getBarycoord(t, this.a, this.b, this.c, n);\n\t}\n\tgetInterpolation(t, n, r, i, a) {\n\t\treturn e.getInterpolation(t, this.a, this.b, this.c, n, r, i, a);\n\t}\n\tcontainsPoint(t) {\n\t\treturn e.containsPoint(t, this.a, this.b, this.c);\n\t}\n\tisFrontFacing(t) {\n\t\treturn e.isFrontFacing(this.a, this.b, this.c, t);\n\t}\n\tintersectsBox(e) {\n\t\treturn e.intersectsTriangle(this);\n\t}\n\tclosestPointToPoint(e, t) {\n\t\tlet n = this.a, r = this.b, i = this.c, a, o;\n\t\tyr.subVectors(r, n), br.subVectors(i, n), Sr.subVectors(e, n);\n\t\tlet s = yr.dot(Sr), c = br.dot(Sr);\n\t\tif (s <= 0 && c <= 0) return t.copy(n);\n\t\tCr.subVectors(e, r);\n\t\tlet l = yr.dot(Cr), u = br.dot(Cr);\n\t\tif (l >= 0 && u <= l) return t.copy(r);\n\t\tlet d = s * u - l * c;\n\t\tif (d <= 0 && s >= 0 && l <= 0) return a = s / (s - l), t.copy(n).addScaledVector(yr, a);\n\t\twr.subVectors(e, i);\n\t\tlet f = yr.dot(wr), p = br.dot(wr);\n\t\tif (p >= 0 && f <= p) return t.copy(i);\n\t\tlet m = f * c - s * p;\n\t\tif (m <= 0 && c >= 0 && p <= 0) return o = c / (c - p), t.copy(n).addScaledVector(br, o);\n\t\tlet h = l * p - f * u;\n\t\tif (h <= 0 && u - l >= 0 && f - p >= 0) return xr.subVectors(i, r), o = (u - l) / (u - l + (f - p)), t.copy(r).addScaledVector(xr, o);\n\t\tlet g = 1 / (h + m + d);\n\t\treturn a = m * g, o = d * g, t.copy(n).addScaledVector(yr, a).addScaledVector(br, o);\n\t}\n\tequals(e) {\n\t\treturn e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);\n\t}\n}, kr = class {\n\tconstructor(e = new K(Infinity, Infinity, Infinity), t = new K(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = !0, this.min = e, this.max = t;\n\t}\n\tset(e, t) {\n\t\treturn this.min.copy(e), this.max.copy(t), this;\n\t}\n\tsetFromArray(e) {\n\t\tthis.makeEmpty();\n\t\tfor (let t = 0, n = e.length; t < n; t += 3) this.expandByPoint(jr.fromArray(e, t));\n\t\treturn this;\n\t}\n\tsetFromBufferAttribute(e) {\n\t\tthis.makeEmpty();\n\t\tfor (let t = 0, n = e.count; t < n; t++) this.expandByPoint(jr.fromBufferAttribute(e, t));\n\t\treturn this;\n\t}\n\tsetFromPoints(e) {\n\t\tthis.makeEmpty();\n\t\tfor (let t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]);\n\t\treturn this;\n\t}\n\tsetFromCenterAndSize(e, t) {\n\t\tlet n = jr.copy(t).multiplyScalar(.5);\n\t\treturn this.min.copy(e).sub(n), this.max.copy(e).add(n), this;\n\t}\n\tsetFromObject(e, t = !1) {\n\t\treturn this.makeEmpty(), this.expandByObject(e, t);\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\tcopy(e) {\n\t\treturn this.min.copy(e.min), this.max.copy(e.max), this;\n\t}\n\tmakeEmpty() {\n\t\treturn this.min.x = this.min.y = this.min.z = Infinity, this.max.x = this.max.y = this.max.z = -Infinity, this;\n\t}\n\tisEmpty() {\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\tgetCenter(e) {\n\t\treturn this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(.5);\n\t}\n\tgetSize(e) {\n\t\treturn this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min);\n\t}\n\texpandByPoint(e) {\n\t\treturn this.min.min(e), this.max.max(e), this;\n\t}\n\texpandByVector(e) {\n\t\treturn this.min.sub(e), this.max.add(e), this;\n\t}\n\texpandByScalar(e) {\n\t\treturn this.min.addScalar(-e), this.max.addScalar(e), this;\n\t}\n\texpandByObject(e, t = !1) {\n\t\te.updateWorldMatrix(!1, !1);\n\t\tlet n = e.geometry;\n\t\tif (n !== void 0) {\n\t\t\tlet r = n.getAttribute(\"position\");\n\t\t\tif (t === !0 && r !== void 0 && e.isInstancedMesh !== !0) for (let t = 0, n = r.count; t < n; t++) e.isMesh === !0 ? e.getVertexPosition(t, jr) : jr.fromBufferAttribute(r, t), jr.applyMatrix4(e.matrixWorld), this.expandByPoint(jr);\n\t\t\telse e.boundingBox === void 0 ? (n.boundingBox === null && n.computeBoundingBox(), Mr.copy(n.boundingBox)) : (e.boundingBox === null && e.computeBoundingBox(), Mr.copy(e.boundingBox)), Mr.applyMatrix4(e.matrixWorld), this.union(Mr);\n\t\t}\n\t\tlet r = e.children;\n\t\tfor (let e = 0, n = r.length; e < n; e++) this.expandByObject(r[e], t);\n\t\treturn this;\n\t}\n\tcontainsPoint(e) {\n\t\treturn 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;\n\t}\n\tcontainsBox(e) {\n\t\treturn 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;\n\t}\n\tgetParameter(e, t) {\n\t\treturn 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));\n\t}\n\tintersectsBox(e) {\n\t\treturn 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;\n\t}\n\tintersectsSphere(e) {\n\t\treturn this.clampPoint(e.center, jr), jr.distanceToSquared(e.center) <= e.radius * e.radius;\n\t}\n\tintersectsPlane(e) {\n\t\tlet t, n;\n\t\treturn 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;\n\t}\n\tintersectsTriangle(e) {\n\t\tif (this.isEmpty()) return !1;\n\t\tthis.getCenter(zr), Br.subVectors(this.max, zr), Nr.subVectors(e.a, zr), Pr.subVectors(e.b, zr), Fr.subVectors(e.c, zr), Ir.subVectors(Pr, Nr), Lr.subVectors(Fr, Pr), Rr.subVectors(Nr, Fr);\n\t\tlet t = [\n\t\t\t0,\n\t\t\t-Ir.z,\n\t\t\tIr.y,\n\t\t\t0,\n\t\t\t-Lr.z,\n\t\t\tLr.y,\n\t\t\t0,\n\t\t\t-Rr.z,\n\t\t\tRr.y,\n\t\t\tIr.z,\n\t\t\t0,\n\t\t\t-Ir.x,\n\t\t\tLr.z,\n\t\t\t0,\n\t\t\t-Lr.x,\n\t\t\tRr.z,\n\t\t\t0,\n\t\t\t-Rr.x,\n\t\t\t-Ir.y,\n\t\t\tIr.x,\n\t\t\t0,\n\t\t\t-Lr.y,\n\t\t\tLr.x,\n\t\t\t0,\n\t\t\t-Rr.y,\n\t\t\tRr.x,\n\t\t\t0\n\t\t];\n\t\treturn !Ur(t, Nr, Pr, Fr, Br) || (t = [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t], !Ur(t, Nr, Pr, Fr, Br)) ? !1 : (Vr.crossVectors(Ir, Lr), t = [\n\t\t\tVr.x,\n\t\t\tVr.y,\n\t\t\tVr.z\n\t\t], Ur(t, Nr, Pr, Fr, Br));\n\t}\n\tclampPoint(e, t) {\n\t\treturn t.copy(e).clamp(this.min, this.max);\n\t}\n\tdistanceToPoint(e) {\n\t\treturn this.clampPoint(e, jr).distanceTo(e);\n\t}\n\tgetBoundingSphere(e) {\n\t\treturn this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(jr).length() * .5), e;\n\t}\n\tintersect(e) {\n\t\treturn this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this;\n\t}\n\tunion(e) {\n\t\treturn this.min.min(e.min), this.max.max(e.max), this;\n\t}\n\tapplyMatrix4(e) {\n\t\treturn this.isEmpty() ? this : (Ar[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Ar[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Ar[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Ar[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Ar[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Ar[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Ar[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Ar[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Ar), this);\n\t}\n\ttranslate(e) {\n\t\treturn this.min.add(e), this.max.add(e), this;\n\t}\n\tequals(e) {\n\t\treturn e.min.equals(this.min) && e.max.equals(this.max);\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tmin: this.min.toArray(),\n\t\t\tmax: this.max.toArray()\n\t\t};\n\t}\n\tfromJSON(e) {\n\t\treturn this.min.fromArray(e.min), this.max.fromArray(e.max), this;\n\t}\n}, Ar = [\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K(),\n\t/*@__PURE__*/ new K()\n], jr = /*@__PURE__*/ new K(), Mr = /*@__PURE__*/ new kr(), Nr = /*@__PURE__*/ new K(), Pr = /*@__PURE__*/ new K(), Fr = /*@__PURE__*/ new K(), Ir = /*@__PURE__*/ new K(), Lr = /*@__PURE__*/ new K(), Rr = /*@__PURE__*/ new K(), zr = /*@__PURE__*/ new K(), Br = /*@__PURE__*/ new K(), Vr = /*@__PURE__*/ new K(), Hr = /*@__PURE__*/ new K();\nfunction Ur(e, t, n, r, i) {\n\tfor (let a = 0, o = e.length - 3; a <= o; a += 3) {\n\t\tHr.fromArray(e, a);\n\t\tlet o = i.x * Math.abs(Hr.x) + i.y * Math.abs(Hr.y) + i.z * Math.abs(Hr.z), s = t.dot(Hr), c = n.dot(Hr), l = r.dot(Hr);\n\t\tif (Math.max(-Math.max(s, c, l), Math.min(s, c, l)) > o) return !1;\n\t}\n\treturn !0;\n}\nvar Wr = /*@__PURE__*/ Gr();\nfunction Gr() {\n\tlet e = /* @__PURE__ */ new ArrayBuffer(4), t = new Float32Array(e), n = new Uint32Array(e), r = /* @__PURE__ */ new Uint32Array(512), i = /* @__PURE__ */ new Uint32Array(512);\n\tfor (let e = 0; e < 256; ++e) {\n\t\tlet t = e - 127;\n\t\tt < -27 ? (r[e] = 0, r[e | 256] = 32768, i[e] = 24, i[e | 256] = 24) : t < -14 ? (r[e] = 1024 >> -t - 14, r[e | 256] = 1024 >> -t - 14 | 32768, i[e] = -t - 1, i[e | 256] = -t - 1) : t <= 15 ? (r[e] = t + 15 << 10, r[e | 256] = t + 15 << 10 | 32768, i[e] = 13, i[e | 256] = 13) : t < 128 ? (r[e] = 31744, r[e | 256] = 64512, i[e] = 24, i[e | 256] = 24) : (r[e] = 31744, r[e | 256] = 64512, i[e] = 13, i[e | 256] = 13);\n\t}\n\tlet a = /* @__PURE__ */ new Uint32Array(2048), o = /* @__PURE__ */ new Uint32Array(64), s = /* @__PURE__ */ new Uint32Array(64);\n\tfor (let e = 1; e < 1024; ++e) {\n\t\tlet t = e << 13, n = 0;\n\t\tfor (; !(t & 8388608);) t <<= 1, n -= 8388608;\n\t\tt &= -8388609, n += 947912704, a[e] = t | n;\n\t}\n\tfor (let e = 1024; e < 2048; ++e) a[e] = 939524096 + (e - 1024 << 13);\n\tfor (let e = 1; e < 31; ++e) o[e] = e << 23;\n\to[31] = 1199570944, o[32] = 2147483648;\n\tfor (let e = 33; e < 63; ++e) o[e] = 2147483648 + (e - 32 << 23);\n\to[63] = 3347054592;\n\tfor (let e = 1; e < 64; ++e) e !== 32 && (s[e] = 1024);\n\treturn {\n\t\tfloatView: t,\n\t\tuint32View: n,\n\t\tbaseTable: r,\n\t\tshiftTable: i,\n\t\tmantissaTable: a,\n\t\texponentTable: o,\n\t\toffsetTable: s\n\t};\n}\nfunction Kr(e) {\n\tMath.abs(e) > 65504 && H(\"DataUtils.toHalfFloat(): Value out of range.\"), e = W(e, -65504, 65504), Wr.floatView[0] = e;\n\tlet t = Wr.uint32View[0], n = t >> 23 & 511;\n\treturn Wr.baseTable[n] + ((t & 8388607) >> Wr.shiftTable[n]);\n}\nfunction qr(e) {\n\tlet t = e >> 10;\n\treturn Wr.uint32View[0] = Wr.mantissaTable[Wr.offsetTable[t] + (e & 1023)] + Wr.exponentTable[t], Wr.floatView[0];\n}\nvar Jr = class {\n\tstatic toHalfFloat(e) {\n\t\treturn Kr(e);\n\t}\n\tstatic fromHalfFloat(e) {\n\t\treturn qr(e);\n\t}\n}, Yr = /*@__PURE__*/ new K(), Xr = /*@__PURE__*/ new G(), Zr = 0, Qr = class extends Ft {\n\tconstructor(e, t, n = !1) {\n\t\tif (super(), Array.isArray(e)) throw TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\n\t\tthis.isBufferAttribute = !0, Object.defineProperty(this, \"id\", { value: Zr++ }), this.name = \"\", this.array = e, this.itemSize = t, this.count = e === void 0 ? 0 : e.length / t, this.normalized = n, this.usage = St, this.updateRanges = [], this.gpuType = pe, this.version = 0;\n\t}\n\tonUploadCallback() {}\n\tset needsUpdate(e) {\n\t\te === !0 && this.version++;\n\t}\n\tsetUsage(e) {\n\t\treturn this.usage = e, this;\n\t}\n\taddUpdateRange(e, t) {\n\t\tthis.updateRanges.push({\n\t\t\tstart: e,\n\t\t\tcount: t\n\t\t});\n\t}\n\tclearUpdateRanges() {\n\t\tthis.updateRanges.length = 0;\n\t}\n\tcopy(e) {\n\t\treturn 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;\n\t}\n\tcopyAt(e, t, n) {\n\t\te *= this.itemSize, n *= t.itemSize;\n\t\tfor (let r = 0, i = this.itemSize; r < i; r++) this.array[e + r] = t.array[n + r];\n\t\treturn this;\n\t}\n\tcopyArray(e) {\n\t\treturn this.array.set(e), this;\n\t}\n\tapplyMatrix3(e) {\n\t\tif (this.itemSize === 2) for (let t = 0, n = this.count; t < n; t++) Xr.fromBufferAttribute(this, t), Xr.applyMatrix3(e), this.setXY(t, Xr.x, Xr.y);\n\t\telse if (this.itemSize === 3) for (let t = 0, n = this.count; t < n; t++) Yr.fromBufferAttribute(this, t), Yr.applyMatrix3(e), this.setXYZ(t, Yr.x, Yr.y, Yr.z);\n\t\treturn this;\n\t}\n\tapplyMatrix4(e) {\n\t\tfor (let t = 0, n = this.count; t < n; t++) Yr.fromBufferAttribute(this, t), Yr.applyMatrix4(e), this.setXYZ(t, Yr.x, Yr.y, Yr.z);\n\t\treturn this;\n\t}\n\tapplyNormalMatrix(e) {\n\t\tfor (let t = 0, n = this.count; t < n; t++) Yr.fromBufferAttribute(this, t), Yr.applyNormalMatrix(e), this.setXYZ(t, Yr.x, Yr.y, Yr.z);\n\t\treturn this;\n\t}\n\ttransformDirection(e) {\n\t\tfor (let t = 0, n = this.count; t < n; t++) Yr.fromBufferAttribute(this, t), Yr.transformDirection(e), this.setXYZ(t, Yr.x, Yr.y, Yr.z);\n\t\treturn this;\n\t}\n\tset(e, t = 0) {\n\t\treturn this.array.set(e, t), this;\n\t}\n\tgetComponent(e, t) {\n\t\tlet n = this.array[e * this.itemSize + t];\n\t\treturn this.normalized && (n = on(n, this.array)), n;\n\t}\n\tsetComponent(e, t, n) {\n\t\treturn this.normalized && (n = sn(n, this.array)), this.array[e * this.itemSize + t] = n, this;\n\t}\n\tgetX(e) {\n\t\tlet t = this.array[e * this.itemSize];\n\t\treturn this.normalized && (t = on(t, this.array)), t;\n\t}\n\tsetX(e, t) {\n\t\treturn this.normalized && (t = sn(t, this.array)), this.array[e * this.itemSize] = t, this;\n\t}\n\tgetY(e) {\n\t\tlet t = this.array[e * this.itemSize + 1];\n\t\treturn this.normalized && (t = on(t, this.array)), t;\n\t}\n\tsetY(e, t) {\n\t\treturn this.normalized && (t = sn(t, this.array)), this.array[e * this.itemSize + 1] = t, this;\n\t}\n\tgetZ(e) {\n\t\tlet t = this.array[e * this.itemSize + 2];\n\t\treturn this.normalized && (t = on(t, this.array)), t;\n\t}\n\tsetZ(e, t) {\n\t\treturn this.normalized && (t = sn(t, this.array)), this.array[e * this.itemSize + 2] = t, this;\n\t}\n\tgetW(e) {\n\t\tlet t = this.array[e * this.itemSize + 3];\n\t\treturn this.normalized && (t = on(t, this.array)), t;\n\t}\n\tsetW(e, t) {\n\t\treturn this.normalized && (t = sn(t, this.array)), this.array[e * this.itemSize + 3] = t, this;\n\t}\n\tsetXY(e, t, n) {\n\t\treturn e *= this.itemSize, this.normalized && (t = sn(t, this.array), n = sn(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;\n\t}\n\tsetXYZ(e, t, n, r) {\n\t\treturn e *= this.itemSize, this.normalized && (t = sn(t, this.array), n = sn(n, this.array), r = sn(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;\n\t}\n\tsetXYZW(e, t, n, r, i) {\n\t\treturn e *= this.itemSize, this.normalized && (t = sn(t, this.array), n = sn(n, this.array), r = sn(r, this.array), i = sn(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;\n\t}\n\tonUpload(e) {\n\t\treturn this.onUploadCallback = e, this;\n\t}\n\tclone() {\n\t\treturn new this.constructor(this.array, this.itemSize).copy(this);\n\t}\n\ttoJSON() {\n\t\tlet e = {\n\t\t\titemSize: this.itemSize,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tarray: Array.from(this.array),\n\t\t\tnormalized: this.normalized\n\t\t};\n\t\treturn this.name !== \"\" && (e.name = this.name), this.usage !== 35044 && (e.usage = this.usage), e;\n\t}\n\tdispose() {\n\t\tthis.dispatchEvent({ type: \"dispose\" });\n\t}\n}, $r = class extends Qr {\n\tconstructor(e, t, n) {\n\t\tsuper(new Uint16Array(e), t, n);\n\t}\n}, ei = class extends Qr {\n\tconstructor(e, t, n) {\n\t\tsuper(new Uint32Array(e), t, n);\n\t}\n}, ti = class extends Qr {\n\tconstructor(e, t, n) {\n\t\tsuper(new Float32Array(e), t, n);\n\t}\n}, ni = /*@__PURE__*/ new kr(), ri = /*@__PURE__*/ new K(), ii = /*@__PURE__*/ new K(), ai = class {\n\tconstructor(e = new K(), t = -1) {\n\t\tthis.isSphere = !0, this.center = e, this.radius = t;\n\t}\n\tset(e, t) {\n\t\treturn this.center.copy(e), this.radius = t, this;\n\t}\n\tsetFromPoints(e, t) {\n\t\tlet n = this.center;\n\t\tt === void 0 ? ni.setFromPoints(e).getCenter(n) : n.copy(t);\n\t\tlet r = 0;\n\t\tfor (let t = 0, i = e.length; t < i; t++) r = Math.max(r, n.distanceToSquared(e[t]));\n\t\treturn this.radius = Math.sqrt(r), this;\n\t}\n\tcopy(e) {\n\t\treturn this.center.copy(e.center), this.radius = e.radius, this;\n\t}\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\tmakeEmpty() {\n\t\treturn this.center.set(0, 0, 0), this.radius = -1, this;\n\t}\n\tcontainsPoint(e) {\n\t\treturn e.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\tdistanceToPoint(e) {\n\t\treturn e.distanceTo(this.center) - this.radius;\n\t}\n\tintersectsSphere(e) {\n\t\tlet t = this.radius + e.radius;\n\t\treturn e.center.distanceToSquared(this.center) <= t * t;\n\t}\n\tintersectsBox(e) {\n\t\treturn e.intersectsSphere(this);\n\t}\n\tintersectsPlane(e) {\n\t\treturn Math.abs(e.distanceToPoint(this.center)) <= this.radius;\n\t}\n\tclampPoint(e, t) {\n\t\tlet n = this.center.distanceToSquared(e);\n\t\treturn t.copy(e), n > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t;\n\t}\n\tgetBoundingBox(e) {\n\t\treturn this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e);\n\t}\n\tapplyMatrix4(e) {\n\t\treturn this.center.applyMatrix4(e), this.radius *= e.getMaxScaleOnAxis(), this;\n\t}\n\ttranslate(e) {\n\t\treturn this.center.add(e), this;\n\t}\n\texpandByPoint(e) {\n\t\tif (this.isEmpty()) return this.center.copy(e), this.radius = 0, this;\n\t\tri.subVectors(e, this.center);\n\t\tlet t = ri.lengthSq();\n\t\tif (t > this.radius * this.radius) {\n\t\t\tlet e = Math.sqrt(t), n = (e - this.radius) * .5;\n\t\t\tthis.center.addScaledVector(ri, n / e), this.radius += n;\n\t\t}\n\t\treturn this;\n\t}\n\tunion(e) {\n\t\treturn e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (ii.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(ri.copy(e.center).add(ii)), this.expandByPoint(ri.copy(e.center).sub(ii))), this);\n\t}\n\tequals(e) {\n\t\treturn e.center.equals(this.center) && e.radius === this.radius;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tradius: this.radius,\n\t\t\tcenter: this.center.toArray()\n\t\t};\n\t}\n\tfromJSON(e) {\n\t\treturn this.radius = e.radius, this.center.fromArray(e.center), this;\n\t}\n}, oi = 0, si = /*@__PURE__*/ new J(), ci = /*@__PURE__*/ new ir(), li = /*@__PURE__*/ new K(), ui = /*@__PURE__*/ new kr(), di = /*@__PURE__*/ new kr(), fi = /*@__PURE__*/ new K(), pi = class e extends Ft {\n\tconstructor() {\n\t\tsuper(), this.isBufferGeometry = !0, Object.defineProperty(this, \"id\", { value: oi++ }), this.uuid = Bt(), this.name = \"\", this.type = \"BufferGeometry\", this.index = null, this.indirect = null, this.indirectOffset = 0, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = {\n\t\t\tstart: 0,\n\t\t\tcount: Infinity\n\t\t}, this.userData = {};\n\t}\n\tgetIndex() {\n\t\treturn this.index;\n\t}\n\tsetIndex(e) {\n\t\treturn this.index = Array.isArray(e) ? new (Tt(e) ? ei : $r)(e, 1) : e, this;\n\t}\n\tsetIndirect(e, t = 0) {\n\t\treturn this.indirect = e, this.indirectOffset = t, this;\n\t}\n\tgetIndirect() {\n\t\treturn this.indirect;\n\t}\n\tgetAttribute(e) {\n\t\treturn this.attributes[e];\n\t}\n\tsetAttribute(e, t) {\n\t\treturn this.attributes[e] = t, this;\n\t}\n\tdeleteAttribute(e) {\n\t\treturn delete this.attributes[e], this;\n\t}\n\thasAttribute(e) {\n\t\treturn this.attributes[e] !== void 0;\n\t}\n\taddGroup(e, t, n = 0) {\n\t\tthis.groups.push({\n\t\t\tstart: e,\n\t\t\tcount: t,\n\t\t\tmaterialIndex: n\n\t\t});\n\t}\n\tclearGroups() {\n\t\tthis.groups = [];\n\t}\n\tsetDrawRange(e, t) {\n\t\tthis.drawRange.start = e, this.drawRange.count = t;\n\t}\n\tapplyMatrix4(e) {\n\t\tlet t = this.attributes.position;\n\t\tt !== void 0 && (t.applyMatrix4(e), t.needsUpdate = !0);\n\t\tlet n = this.attributes.normal;\n\t\tif (n !== void 0) {\n\t\t\tlet t = new q().getNormalMatrix(e);\n\t\t\tn.applyNormalMatrix(t), n.needsUpdate = !0;\n\t\t}\n\t\tlet r = this.attributes.tangent;\n\t\treturn r !== void 0 && (r.transformDirection(e), r.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;\n\t}\n\tapplyQuaternion(e) {\n\t\treturn si.makeRotationFromQuaternion(e), this.applyMatrix4(si), this;\n\t}\n\trotateX(e) {\n\t\treturn si.makeRotationX(e), this.applyMatrix4(si), this;\n\t}\n\trotateY(e) {\n\t\treturn si.makeRotationY(e), this.applyMatrix4(si), this;\n\t}\n\trotateZ(e) {\n\t\treturn si.makeRotationZ(e), this.applyMatrix4(si), this;\n\t}\n\ttranslate(e, t, n) {\n\t\treturn si.makeTranslation(e, t, n), this.applyMatrix4(si), this;\n\t}\n\tscale(e, t, n) {\n\t\treturn si.makeScale(e, t, n), this.applyMatrix4(si), this;\n\t}\n\tlookAt(e) {\n\t\treturn ci.lookAt(e), ci.updateMatrix(), this.applyMatrix4(ci.matrix), this;\n\t}\n\tcenter() {\n\t\treturn this.computeBoundingBox(), this.boundingBox.getCenter(li).negate(), this.translate(li.x, li.y, li.z), this;\n\t}\n\tsetFromPoints(e) {\n\t\tlet t = this.getAttribute(\"position\");\n\t\tif (t === void 0) {\n\t\t\tlet t = [];\n\t\t\tfor (let n = 0, r = e.length; n < r; n++) {\n\t\t\t\tlet r = e[n];\n\t\t\t\tt.push(r.x, r.y, r.z || 0);\n\t\t\t}\n\t\t\tthis.setAttribute(\"position\", new ti(t, 3));\n\t\t} else {\n\t\t\tlet n = Math.min(e.length, t.count);\n\t\t\tfor (let r = 0; r < n; r++) {\n\t\t\t\tlet n = e[r];\n\t\t\t\tt.setXYZ(r, n.x, n.y, n.z || 0);\n\t\t\t}\n\t\t\te.length > t.count && H(\"BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.\"), t.needsUpdate = !0;\n\t\t}\n\t\treturn this;\n\t}\n\tcomputeBoundingBox() {\n\t\tthis.boundingBox === null && (this.boundingBox = new kr());\n\t\tlet e = this.attributes.position, t = this.morphAttributes.position;\n\t\tif (e && e.isGLBufferAttribute) {\n\t\t\tU(\"BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.\", this), this.boundingBox.set(new K(-Infinity, -Infinity, -Infinity), new K(Infinity, Infinity, Infinity));\n\t\t\treturn;\n\t\t}\n\t\tif (e !== void 0) {\n\t\t\tif (this.boundingBox.setFromBufferAttribute(e), t) for (let e = 0, n = t.length; e < n; e++) {\n\t\t\t\tlet n = t[e];\n\t\t\t\tui.setFromBufferAttribute(n), this.morphTargetsRelative ? (fi.addVectors(this.boundingBox.min, ui.min), this.boundingBox.expandByPoint(fi), fi.addVectors(this.boundingBox.max, ui.max), this.boundingBox.expandByPoint(fi)) : (this.boundingBox.expandByPoint(ui.min), this.boundingBox.expandByPoint(ui.max));\n\t\t\t}\n\t\t} else this.boundingBox.makeEmpty();\n\t\t(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && U(\"BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \\\"position\\\" attribute is likely to have NaN values.\", this);\n\t}\n\tcomputeBoundingSphere() {\n\t\tthis.boundingSphere === null && (this.boundingSphere = new ai());\n\t\tlet e = this.attributes.position, t = this.morphAttributes.position;\n\t\tif (e && e.isGLBufferAttribute) {\n\t\t\tU(\"BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.\", this), this.boundingSphere.set(new K(), Infinity);\n\t\t\treturn;\n\t\t}\n\t\tif (e) {\n\t\t\tlet n = this.boundingSphere.center;\n\t\t\tif (ui.setFromBufferAttribute(e), t) for (let e = 0, n = t.length; e < n; e++) {\n\t\t\t\tlet n = t[e];\n\t\t\t\tdi.setFromBufferAttribute(n), this.morphTargetsRelative ? (fi.addVectors(ui.min, di.min), ui.expandByPoint(fi), fi.addVectors(ui.max, di.max), ui.expandByPoint(fi)) : (ui.expandByPoint(di.min), ui.expandByPoint(di.max));\n\t\t\t}\n\t\t\tui.getCenter(n);\n\t\t\tlet r = 0;\n\t\t\tfor (let t = 0, i = e.count; t < i; t++) fi.fromBufferAttribute(e, t), r = Math.max(r, n.distanceToSquared(fi));\n\t\t\tif (t) for (let i = 0, a = t.length; i < a; i++) {\n\t\t\t\tlet a = t[i], o = this.morphTargetsRelative;\n\t\t\t\tfor (let t = 0, i = a.count; t < i; t++) fi.fromBufferAttribute(a, t), o && (li.fromBufferAttribute(e, t), fi.add(li)), r = Math.max(r, n.distanceToSquared(fi));\n\t\t\t}\n\t\t\tthis.boundingSphere.radius = Math.sqrt(r), isNaN(this.boundingSphere.radius) && U(\"BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \\\"position\\\" attribute is likely to have NaN values.\", this);\n\t\t}\n\t}\n\tcomputeTangents() {\n\t\tlet e = this.index, t = this.attributes;\n\t\tif (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) {\n\t\t\tU(\"BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)\");\n\t\t\treturn;\n\t\t}\n\t\tlet n = t.position, r = t.normal, i = t.uv;\n\t\tthis.hasAttribute(\"tangent\") === !1 && this.setAttribute(\"tangent\", new Qr(new Float32Array(4 * n.count), 4));\n\t\tlet a = this.getAttribute(\"tangent\"), o = [], s = [];\n\t\tfor (let e = 0; e < n.count; e++) o[e] = new K(), s[e] = new K();\n\t\tlet c = new K(), l = new K(), u = new K(), d = new G(), f = new G(), p = new G(), m = new K(), h = new K();\n\t\tfunction g(e, t, r) {\n\t\t\tc.fromBufferAttribute(n, e), l.fromBufferAttribute(n, t), u.fromBufferAttribute(n, r), d.fromBufferAttribute(i, e), f.fromBufferAttribute(i, t), p.fromBufferAttribute(i, r), l.sub(c), u.sub(c), f.sub(d), p.sub(d);\n\t\t\tlet a = 1 / (f.x * p.y - p.x * f.y);\n\t\t\tisFinite(a) && (m.copy(l).multiplyScalar(p.y).addScaledVector(u, -f.y).multiplyScalar(a), h.copy(u).multiplyScalar(f.x).addScaledVector(l, -p.x).multiplyScalar(a), o[e].add(m), o[t].add(m), o[r].add(m), s[e].add(h), s[t].add(h), s[r].add(h));\n\t\t}\n\t\tlet _ = this.groups;\n\t\t_.length === 0 && (_ = [{\n\t\t\tstart: 0,\n\t\t\tcount: e.count\n\t\t}]);\n\t\tfor (let t = 0, n = _.length; t < n; ++t) {\n\t\t\tlet n = _[t], r = n.start, i = n.count;\n\t\t\tfor (let t = r, n = r + i; t < n; t += 3) g(e.getX(t + 0), e.getX(t + 1), e.getX(t + 2));\n\t\t}\n\t\tlet v = new K(), y = new K(), b = new K(), x = new K();\n\t\tfunction S(e) {\n\t\t\tb.fromBufferAttribute(r, e), x.copy(b);\n\t\t\tlet t = o[e];\n\t\t\tv.copy(t), v.sub(b.multiplyScalar(b.dot(t))).normalize(), y.crossVectors(x, t);\n\t\t\tlet n = y.dot(s[e]) < 0 ? -1 : 1;\n\t\t\ta.setXYZW(e, v.x, v.y, v.z, n);\n\t\t}\n\t\tfor (let t = 0, n = _.length; t < n; ++t) {\n\t\t\tlet n = _[t], r = n.start, i = n.count;\n\t\t\tfor (let t = r, n = r + i; t < n; t += 3) S(e.getX(t + 0)), S(e.getX(t + 1)), S(e.getX(t + 2));\n\t\t}\n\t}\n\tcomputeVertexNormals() {\n\t\tlet e = this.index, t = this.getAttribute(\"position\");\n\t\tif (t !== void 0) {\n\t\t\tlet n = this.getAttribute(\"normal\");\n\t\t\tif (n === void 0) n = new Qr(new Float32Array(t.count * 3), 3), this.setAttribute(\"normal\", n);\n\t\t\telse for (let e = 0, t = n.count; e < t; e++) n.setXYZ(e, 0, 0, 0);\n\t\t\tlet r = new K(), i = new K(), a = new K(), o = new K(), s = new K(), c = new K(), l = new K(), u = new K();\n\t\t\tif (e) for (let d = 0, f = e.count; d < f; d += 3) {\n\t\t\t\tlet f = e.getX(d + 0), p = e.getX(d + 1), m = e.getX(d + 2);\n\t\t\t\tr.fromBufferAttribute(t, f), i.fromBufferAttribute(t, p), a.fromBufferAttribute(t, m), l.subVectors(a, i), u.subVectors(r, i), l.cross(u), o.fromBufferAttribute(n, f), s.fromBufferAttribute(n, p), c.fromBufferAttribute(n, m), o.add(l), s.add(l), c.add(l), n.setXYZ(f, o.x, o.y, o.z), n.setXYZ(p, s.x, s.y, s.z), n.setXYZ(m, c.x, c.y, c.z);\n\t\t\t}\n\t\t\telse for (let e = 0, o = t.count; e < o; e += 3) r.fromBufferAttribute(t, e + 0), i.fromBufferAttribute(t, e + 1), a.fromBufferAttribute(t, e + 2), l.subVectors(a, i), u.subVectors(r, i), l.cross(u), n.setXYZ(e + 0, l.x, l.y, l.z), n.setXYZ(e + 1, l.x, l.y, l.z), n.setXYZ(e + 2, l.x, l.y, l.z);\n\t\t\tthis.normalizeNormals(), n.needsUpdate = !0;\n\t\t}\n\t}\n\tnormalizeNormals() {\n\t\tlet e = this.attributes.normal;\n\t\tfor (let t = 0, n = e.count; t < n; t++) fi.fromBufferAttribute(e, t), fi.normalize(), e.setXYZ(t, fi.x, fi.y, fi.z);\n\t}\n\ttoNonIndexed() {\n\t\tfunction t(e, t) {\n\t\t\tlet n = e.array, r = e.itemSize, i = e.normalized, a = new n.constructor(t.length * r), o = 0, s = 0;\n\t\t\tfor (let i = 0, c = t.length; i < c; i++) {\n\t\t\t\to = e.isInterleavedBufferAttribute ? t[i] * e.data.stride + e.offset : t[i] * r;\n\t\t\t\tfor (let e = 0; e < r; e++) a[s++] = n[o++];\n\t\t\t}\n\t\t\treturn new Qr(a, r, i);\n\t\t}\n\t\tif (this.index === null) return H(\"BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.\"), this;\n\t\tlet n = new e(), r = this.index.array, i = this.attributes;\n\t\tfor (let e in i) {\n\t\t\tlet a = i[e], o = t(a, r);\n\t\t\tn.setAttribute(e, o);\n\t\t}\n\t\tlet a = this.morphAttributes;\n\t\tfor (let e in a) {\n\t\t\tlet i = [], o = a[e];\n\t\t\tfor (let e = 0, n = o.length; e < n; e++) {\n\t\t\t\tlet n = o[e], a = t(n, r);\n\t\t\t\ti.push(a);\n\t\t\t}\n\t\t\tn.morphAttributes[e] = i;\n\t\t}\n\t\tn.morphTargetsRelative = this.morphTargetsRelative;\n\t\tlet o = this.groups;\n\t\tfor (let e = 0, t = o.length; e < t; e++) {\n\t\t\tlet t = o[e];\n\t\t\tn.addGroup(t.start, t.count, t.materialIndex);\n\t\t}\n\t\treturn n;\n\t}\n\ttoJSON() {\n\t\tlet e = { metadata: {\n\t\t\tversion: 4.7,\n\t\t\ttype: \"BufferGeometry\",\n\t\t\tgenerator: \"BufferGeometry.toJSON\"\n\t\t} };\n\t\tif (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) {\n\t\t\tlet t = this.parameters;\n\t\t\tfor (let n in t) t[n] !== void 0 && (e[n] = t[n]);\n\t\t\treturn e;\n\t\t}\n\t\te.data = { attributes: {} };\n\t\tlet t = this.index;\n\t\tt !== null && (e.data.index = {\n\t\t\ttype: t.array.constructor.name,\n\t\t\tarray: Array.prototype.slice.call(t.array)\n\t\t});\n\t\tlet n = this.attributes;\n\t\tfor (let t in n) {\n\t\t\tlet r = n[t];\n\t\t\te.data.attributes[t] = r.toJSON(e.data);\n\t\t}\n\t\tlet r = {}, i = !1;\n\t\tfor (let t in this.morphAttributes) {\n\t\t\tlet n = this.morphAttributes[t], a = [];\n\t\t\tfor (let t = 0, r = n.length; t < r; t++) {\n\t\t\t\tlet r = n[t];\n\t\t\t\ta.push(r.toJSON(e.data));\n\t\t\t}\n\t\t\ta.length > 0 && (r[t] = a, i = !0);\n\t\t}\n\t\ti && (e.data.morphAttributes = r, e.data.morphTargetsRelative = this.morphTargetsRelative);\n\t\tlet a = this.groups;\n\t\ta.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));\n\t\tlet o = this.boundingSphere;\n\t\treturn o !== null && (e.data.boundingSphere = o.toJSON()), e;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\tcopy(e) {\n\t\tthis.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null;\n\t\tlet t = {};\n\t\tthis.name = e.name;\n\t\tlet n = e.index;\n\t\tn !== null && this.setIndex(n.clone());\n\t\tlet r = e.attributes;\n\t\tfor (let e in r) {\n\t\t\tlet n = r[e];\n\t\t\tthis.setAttribute(e, n.clone(t));\n\t\t}\n\t\tlet i = e.morphAttributes;\n\t\tfor (let e in i) {\n\t\t\tlet n = [], r = i[e];\n\t\t\tfor (let e = 0, i = r.length; e < i; e++) n.push(r[e].clone(t));\n\t\t\tthis.morphAttributes[e] = n;\n\t\t}\n\t\tthis.morphTargetsRelative = e.morphTargetsRelative;\n\t\tlet a = e.groups;\n\t\tfor (let e = 0, t = a.length; e < t; e++) {\n\t\t\tlet t = a[e];\n\t\t\tthis.addGroup(t.start, t.count, t.materialIndex);\n\t\t}\n\t\tlet o = e.boundingBox;\n\t\to !== null && (this.boundingBox = o.clone());\n\t\tlet s = e.boundingSphere;\n\t\treturn s !== null && (this.boundingSphere = s.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this;\n\t}\n\tdispose() {\n\t\tthis.dispatchEvent({ type: \"dispose\" });\n\t}\n}, mi = 0, hi = class extends Ft {\n\tconstructor() {\n\t\tsuper(), this.isMaterial = !0, Object.defineProperty(this, \"id\", { value: mi++ }), this.uuid = Bt(), this.name = \"\", this.type = \"Material\", this.blending = 1, this.side = 0, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = 204, this.blendDst = 205, this.blendEquation = 100, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new fr(0, 0, 0), this.blendAlpha = 0, this.depthFunc = 3, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = 519, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = xt, this.stencilZFail = xt, this.stencilZPass = xt, 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;\n\t}\n\tget alphaTest() {\n\t\treturn this._alphaTest;\n\t}\n\tset alphaTest(e) {\n\t\tthis._alphaTest > 0 != e > 0 && this.version++, this._alphaTest = e;\n\t}\n\tonBeforeRender() {}\n\tonBeforeCompile() {}\n\tcustomProgramCacheKey() {\n\t\treturn this.onBeforeCompile.toString();\n\t}\n\tsetValues(e) {\n\t\tif (e !== void 0) for (let t in e) {\n\t\t\tlet n = e[t];\n\t\t\tif (n === void 0) {\n\t\t\t\tH(`Material: parameter '${t}' has value of undefined.`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet r = this[t];\n\t\t\tif (r === void 0) {\n\t\t\t\tH(`Material: '${t}' is not a property of THREE.${this.type}.`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tr && r.isColor ? r.set(n) : r && r.isVector3 && n && n.isVector3 ? r.copy(n) : this[t] = n;\n\t\t}\n\t}\n\ttoJSON(e) {\n\t\tlet t = e === void 0 || typeof e == \"string\";\n\t\tt && (e = {\n\t\t\ttextures: {},\n\t\t\timages: {}\n\t\t});\n\t\tlet n = { metadata: {\n\t\t\tversion: 4.7,\n\t\t\ttype: \"Material\",\n\t\t\tgenerator: \"Material.toJSON\"\n\t\t} };\n\t\tn.uuid = this.uuid, n.type = this.type, this.name !== \"\" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== Infinity && (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 !== 1 && (n.blending = this.blending), this.side !== 0 && (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 !== 204 && (n.blendSrc = this.blendSrc), this.blendDst !== 205 && (n.blendDst = this.blendDst), this.blendEquation !== 100 && (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 !== 3 && (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 !== 519 && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== 7680 && (n.stencilFail = this.stencilFail), this.stencilZFail !== 7680 && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== 7680 && (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.allowOverride === !1 && (n.allowOverride = !1), 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\t\tfunction r(e) {\n\t\t\tlet t = [];\n\t\t\tfor (let n in e) {\n\t\t\t\tlet r = e[n];\n\t\t\t\tdelete r.metadata, t.push(r);\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t\tif (t) {\n\t\t\tlet t = r(e.textures), i = r(e.images);\n\t\t\tt.length > 0 && (n.textures = t), i.length > 0 && (n.images = i);\n\t\t}\n\t\treturn n;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\tcopy(e) {\n\t\tthis.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;\n\t\tlet t = e.clippingPlanes, n = null;\n\t\tif (t !== null) {\n\t\t\tlet e = t.length;\n\t\t\tn = Array(e);\n\t\t\tfor (let r = 0; r !== e; ++r) n[r] = t[r].clone();\n\t\t}\n\t\treturn 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.allowOverride = e.allowOverride, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this;\n\t}\n\tdispose() {\n\t\tthis.dispatchEvent({ type: \"dispose\" });\n\t}\n\tset needsUpdate(e) {\n\t\te === !0 && this.version++;\n\t}\n}, gi = /*@__PURE__*/ new K(), _i = /*@__PURE__*/ new K(), vi = /*@__PURE__*/ new K(), yi = /*@__PURE__*/ new K(), bi = /*@__PURE__*/ new K(), xi = /*@__PURE__*/ new K(), Si = /*@__PURE__*/ new K(), Ci = class {\n\tconstructor(e = new K(), t = new K(0, 0, -1)) {\n\t\tthis.origin = e, this.direction = t;\n\t}\n\tset(e, t) {\n\t\treturn this.origin.copy(e), this.direction.copy(t), this;\n\t}\n\tcopy(e) {\n\t\treturn this.origin.copy(e.origin), this.direction.copy(e.direction), this;\n\t}\n\tat(e, t) {\n\t\treturn t.copy(this.origin).addScaledVector(this.direction, e);\n\t}\n\tlookAt(e) {\n\t\treturn this.direction.copy(e).sub(this.origin).normalize(), this;\n\t}\n\trecast(e) {\n\t\treturn this.origin.copy(this.at(e, gi)), this;\n\t}\n\tclosestPointToPoint(e, t) {\n\t\tt.subVectors(e, this.origin);\n\t\tlet n = t.dot(this.direction);\n\t\treturn n < 0 ? t.copy(this.origin) : t.copy(this.origin).addScaledVector(this.direction, n);\n\t}\n\tdistanceToPoint(e) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(e));\n\t}\n\tdistanceSqToPoint(e) {\n\t\tlet t = gi.subVectors(e, this.origin).dot(this.direction);\n\t\treturn t < 0 ? this.origin.distanceToSquared(e) : (gi.copy(this.origin).addScaledVector(this.direction, t), gi.distanceToSquared(e));\n\t}\n\tdistanceSqToSegment(e, t, n, r) {\n\t\t_i.copy(e).add(t).multiplyScalar(.5), vi.copy(t).sub(e).normalize(), yi.copy(this.origin).sub(_i);\n\t\tlet i = e.distanceTo(t) * .5, a = -this.direction.dot(vi), o = yi.dot(this.direction), s = -yi.dot(vi), c = yi.lengthSq(), l = Math.abs(1 - a * a), u, d, f, p;\n\t\tif (l > 0) {\n\t\t\tif (u = a * s - o, d = a * o - s, p = i * l, u >= 0) {\n\t\t\t\tif (d >= -p) {\n\t\t\t\t\tif (d <= p) {\n\t\t\t\t\t\tlet e = 1 / l;\n\t\t\t\t\t\tu *= e, d *= e, f = u * (u + a * d + 2 * o) + d * (a * u + d + 2 * s) + c;\n\t\t\t\t\t} else d = i, u = Math.max(0, -(a * d + o)), f = -u * u + d * (d + 2 * s) + c;\n\t\t\t\t} else d = -i, u = Math.max(0, -(a * d + o)), f = -u * u + d * (d + 2 * s) + c;\n\t\t\t} else d <= -p ? (u = Math.max(0, -(-a * i + o)), d = u > 0 ? -i : Math.min(Math.max(-i, -s), i), f = -u * u + d * (d + 2 * s) + c) : d <= p ? (u = 0, d = Math.min(Math.max(-i, -s), i), f = d * (d + 2 * s) + c) : (u = Math.max(0, -(a * i + o)), d = u > 0 ? i : Math.min(Math.max(-i, -s), i), f = -u * u + d * (d + 2 * s) + c);\n\t\t} else d = a > 0 ? -i : i, u = Math.max(0, -(a * d + o)), f = -u * u + d * (d + 2 * s) + c;\n\t\treturn n && n.copy(this.origin).addScaledVector(this.direction, u), r && r.copy(_i).addScaledVector(vi, d), f;\n\t}\n\tintersectSphere(e, t) {\n\t\tgi.subVectors(e.center, this.origin);\n\t\tlet n = gi.dot(this.direction), r = gi.dot(gi) - n * n, i = e.radius * e.radius;\n\t\tif (r > i) return null;\n\t\tlet a = Math.sqrt(i - r), o = n - a, s = n + a;\n\t\treturn s < 0 ? null : o < 0 ? this.at(s, t) : this.at(o, t);\n\t}\n\tintersectsSphere(e) {\n\t\treturn e.radius < 0 ? !1 : this.distanceSqToPoint(e.center) <= e.radius * e.radius;\n\t}\n\tdistanceToPlane(e) {\n\t\tlet t = e.normal.dot(this.direction);\n\t\tif (t === 0) return e.distanceToPoint(this.origin) === 0 ? 0 : null;\n\t\tlet n = -(this.origin.dot(e.normal) + e.constant) / t;\n\t\treturn n >= 0 ? n : null;\n\t}\n\tintersectPlane(e, t) {\n\t\tlet n = this.distanceToPlane(e);\n\t\treturn n === null ? null : this.at(n, t);\n\t}\n\tintersectsPlane(e) {\n\t\tlet t = e.distanceToPoint(this.origin);\n\t\treturn t === 0 || e.normal.dot(this.direction) * t < 0;\n\t}\n\tintersectBox(e, t) {\n\t\tlet n, r, i, a, o, s, c = 1 / this.direction.x, l = 1 / this.direction.y, u = 1 / this.direction.z, d = this.origin;\n\t\treturn c >= 0 ? (n = (e.min.x - d.x) * c, r = (e.max.x - d.x) * c) : (n = (e.max.x - d.x) * c, r = (e.min.x - d.x) * c), l >= 0 ? (i = (e.min.y - d.y) * l, a = (e.max.y - d.y) * l) : (i = (e.max.y - d.y) * l, a = (e.min.y - d.y) * l), n > a || i > r || ((i > n || isNaN(n)) && (n = i), (a < r || isNaN(r)) && (r = a), u >= 0 ? (o = (e.min.z - d.z) * u, s = (e.max.z - d.z) * u) : (o = (e.max.z - d.z) * u, s = (e.min.z - d.z) * u), n > s || o > r) || ((o > n || n !== n) && (n = o), (s < r || r !== r) && (r = s), r < 0) ? null : this.at(n >= 0 ? n : r, t);\n\t}\n\tintersectsBox(e) {\n\t\treturn this.intersectBox(e, gi) !== null;\n\t}\n\tintersectTriangle(e, t, n, r, i) {\n\t\tbi.subVectors(t, e), xi.subVectors(n, e), Si.crossVectors(bi, xi);\n\t\tlet a = this.direction.dot(Si), o;\n\t\tif (a > 0) {\n\t\t\tif (r) return null;\n\t\t\to = 1;\n\t\t} else if (a < 0) o = -1, a = -a;\n\t\telse return null;\n\t\tyi.subVectors(this.origin, e);\n\t\tlet s = o * this.direction.dot(xi.crossVectors(yi, xi));\n\t\tif (s < 0) return null;\n\t\tlet c = o * this.direction.dot(bi.cross(yi));\n\t\tif (c < 0 || s + c > a) return null;\n\t\tlet l = -o * yi.dot(Si);\n\t\treturn l < 0 ? null : this.at(l / a, i);\n\t}\n\tapplyMatrix4(e) {\n\t\treturn this.origin.applyMatrix4(e), this.direction.transformDirection(e), this;\n\t}\n\tequals(e) {\n\t\treturn e.origin.equals(this.origin) && e.direction.equals(this.direction);\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n}, wi = class extends hi {\n\tconstructor(e) {\n\t\tsuper(), this.isMeshBasicMaterial = !0, this.type = \"MeshBasicMaterial\", this.color = new fr(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 Vn(), this.combine = 0, this.reflectivity = 1, this.refractionRatio = .98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.fog = !0, this.setValues(e);\n\t}\n\tcopy(e) {\n\t\treturn 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;\n\t}\n}, Ti = /*@__PURE__*/ new J(), Ei = /*@__PURE__*/ new Ci(), Di = /*@__PURE__*/ new ai(), Oi = /*@__PURE__*/ new K(), ki = /*@__PURE__*/ new K(), Ai = /*@__PURE__*/ new K(), ji = /*@__PURE__*/ new K(), Mi = /*@__PURE__*/ new K(), Ni = /*@__PURE__*/ new K(), Pi = /*@__PURE__*/ new K(), Fi = /*@__PURE__*/ new K(), Ii = class extends ir {\n\tconstructor(e = new pi(), t = new wi()) {\n\t\tsuper(), this.isMesh = !0, this.type = \"Mesh\", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();\n\t}\n\tcopy(e, t) {\n\t\treturn 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;\n\t}\n\tupdateMorphTargets() {\n\t\tlet e = this.geometry.morphAttributes, t = Object.keys(e);\n\t\tif (t.length > 0) {\n\t\t\tlet n = e[t[0]];\n\t\t\tif (n !== void 0) {\n\t\t\t\tthis.morphTargetInfluences = [], this.morphTargetDictionary = {};\n\t\t\t\tfor (let e = 0, t = n.length; e < t; e++) {\n\t\t\t\t\tlet t = n[e].name || String(e);\n\t\t\t\t\tthis.morphTargetInfluences.push(0), this.morphTargetDictionary[t] = e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tgetVertexPosition(e, t) {\n\t\tlet n = this.geometry, r = n.attributes.position, i = n.morphAttributes.position, a = n.morphTargetsRelative;\n\t\tt.fromBufferAttribute(r, e);\n\t\tlet o = this.morphTargetInfluences;\n\t\tif (i && o) {\n\t\t\tNi.set(0, 0, 0);\n\t\t\tfor (let n = 0, r = i.length; n < r; n++) {\n\t\t\t\tlet r = o[n], s = i[n];\n\t\t\t\tr !== 0 && (Mi.fromBufferAttribute(s, e), a ? Ni.addScaledVector(Mi, r) : Ni.addScaledVector(Mi.sub(t), r));\n\t\t\t}\n\t\t\tt.add(Ni);\n\t\t}\n\t\treturn t;\n\t}\n\traycast(e, t) {\n\t\tlet n = this.geometry, r = this.material, i = this.matrixWorld;\n\t\tr !== void 0 && (n.boundingSphere === null && n.computeBoundingSphere(), Di.copy(n.boundingSphere), Di.applyMatrix4(i), Ei.copy(e.ray).recast(e.near), !(Di.containsPoint(Ei.origin) === !1 && (Ei.intersectSphere(Di, Oi) === null || Ei.origin.distanceToSquared(Oi) > (e.far - e.near) ** 2)) && (Ti.copy(i).invert(), Ei.copy(e.ray).applyMatrix4(Ti), (n.boundingBox === null || Ei.intersectsBox(n.boundingBox) !== !1) && this._computeIntersections(e, t, Ei)));\n\t}\n\t_computeIntersections(e, t, n) {\n\t\tlet r, i = this.geometry, a = this.material, o = i.index, s = i.attributes.position, c = i.attributes.uv, l = i.attributes.uv1, u = i.attributes.normal, d = i.groups, f = i.drawRange;\n\t\tif (o !== null) {\n\t\t\tif (Array.isArray(a)) for (let i = 0, s = d.length; i < s; i++) {\n\t\t\t\tlet s = d[i], p = a[s.materialIndex], m = Math.max(s.start, f.start), h = Math.min(o.count, Math.min(s.start + s.count, f.start + f.count));\n\t\t\t\tfor (let i = m, a = h; i < a; i += 3) {\n\t\t\t\t\tlet a = o.getX(i), d = o.getX(i + 1), f = o.getX(i + 2);\n\t\t\t\t\tr = Ri(this, p, e, n, c, l, u, a, d, f), r && (r.faceIndex = Math.floor(i / 3), r.face.materialIndex = s.materialIndex, t.push(r));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlet i = Math.max(0, f.start), s = Math.min(o.count, f.start + f.count);\n\t\t\t\tfor (let d = i, f = s; d < f; d += 3) {\n\t\t\t\t\tlet i = o.getX(d), s = o.getX(d + 1), f = o.getX(d + 2);\n\t\t\t\t\tr = Ri(this, a, e, n, c, l, u, i, s, f), r && (r.faceIndex = Math.floor(d / 3), t.push(r));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (s !== void 0) {\n\t\t\tif (Array.isArray(a)) for (let i = 0, o = d.length; i < o; i++) {\n\t\t\t\tlet o = d[i], p = a[o.materialIndex], m = Math.max(o.start, f.start), h = Math.min(s.count, Math.min(o.start + o.count, f.start + f.count));\n\t\t\t\tfor (let i = m, a = h; i < a; i += 3) {\n\t\t\t\t\tlet a = i, s = i + 1, d = i + 2;\n\t\t\t\t\tr = Ri(this, p, e, n, c, l, u, a, s, d), r && (r.faceIndex = Math.floor(i / 3), r.face.materialIndex = o.materialIndex, t.push(r));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlet i = Math.max(0, f.start), o = Math.min(s.count, f.start + f.count);\n\t\t\t\tfor (let s = i, d = o; s < d; s += 3) {\n\t\t\t\t\tlet i = s, o = s + 1, d = s + 2;\n\t\t\t\t\tr = Ri(this, a, e, n, c, l, u, i, o, d), r && (r.faceIndex = Math.floor(s / 3), t.push(r));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\nfunction Li(e, t, n, r, i, a, o, s) {\n\tlet c;\n\tif (c = t.side === 1 ? r.intersectTriangle(o, a, i, !0, s) : r.intersectTriangle(i, a, o, t.side === 0, s), c === null) return null;\n\tFi.copy(s), Fi.applyMatrix4(e.matrixWorld);\n\tlet l = n.ray.origin.distanceTo(Fi);\n\treturn l < n.near || l > n.far ? null : {\n\t\tdistance: l,\n\t\tpoint: Fi.clone(),\n\t\tobject: e\n\t};\n}\nfunction Ri(e, t, n, r, i, a, o, s, c, l) {\n\te.getVertexPosition(s, ki), e.getVertexPosition(c, Ai), e.getVertexPosition(l, ji);\n\tlet u = Li(e, t, n, r, ki, Ai, ji, Pi);\n\tif (u) {\n\t\tlet e = new K();\n\t\tOr.getBarycoord(Pi, ki, Ai, ji, e), i && (u.uv = Or.getInterpolatedAttribute(i, s, c, l, e, new G())), a && (u.uv1 = Or.getInterpolatedAttribute(a, s, c, l, e, new G())), o && (u.normal = Or.getInterpolatedAttribute(o, s, c, l, e, new K()), u.normal.dot(r.direction) > 0 && u.normal.multiplyScalar(-1));\n\t\tlet t = {\n\t\t\ta: s,\n\t\t\tb: c,\n\t\t\tc: l,\n\t\t\tnormal: new K(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\t\tOr.getNormal(ki, Ai, ji, t.normal), u.face = t, u.barycoord = e;\n\t}\n\treturn u;\n}\nvar zi = class extends En {\n\tconstructor(e = null, t = 1, n = 1, r, i, a, o, s, c = L, l = L, u, d) {\n\t\tsuper(null, a, o, s, c, l, r, i, u, d), this.isDataTexture = !0, this.image = {\n\t\t\tdata: e,\n\t\t\twidth: t,\n\t\t\theight: n\n\t\t}, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;\n\t}\n}, Bi = class extends Qr {\n\tconstructor(e, t, n, r = 1) {\n\t\tsuper(e, t, n), this.isInstancedBufferAttribute = !0, this.meshPerAttribute = r;\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this;\n\t}\n\ttoJSON() {\n\t\tlet e = super.toJSON();\n\t\treturn e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = !0, e;\n\t}\n}, Vi = /*@__PURE__*/ new K(), Hi = /*@__PURE__*/ new K(), Ui = /*@__PURE__*/ new q(), Wi = class {\n\tconstructor(e = new K(1, 0, 0), t = 0) {\n\t\tthis.isPlane = !0, this.normal = e, this.constant = t;\n\t}\n\tset(e, t) {\n\t\treturn this.normal.copy(e), this.constant = t, this;\n\t}\n\tsetComponents(e, t, n, r) {\n\t\treturn this.normal.set(e, t, n), this.constant = r, this;\n\t}\n\tsetFromNormalAndCoplanarPoint(e, t) {\n\t\treturn this.normal.copy(e), this.constant = -t.dot(this.normal), this;\n\t}\n\tsetFromCoplanarPoints(e, t, n) {\n\t\tlet r = Vi.subVectors(n, t).cross(Hi.subVectors(e, t)).normalize();\n\t\treturn this.setFromNormalAndCoplanarPoint(r, e), this;\n\t}\n\tcopy(e) {\n\t\treturn this.normal.copy(e.normal), this.constant = e.constant, this;\n\t}\n\tnormalize() {\n\t\tlet e = 1 / this.normal.length();\n\t\treturn this.normal.multiplyScalar(e), this.constant *= e, this;\n\t}\n\tnegate() {\n\t\treturn this.constant *= -1, this.normal.negate(), this;\n\t}\n\tdistanceToPoint(e) {\n\t\treturn this.normal.dot(e) + this.constant;\n\t}\n\tdistanceToSphere(e) {\n\t\treturn this.distanceToPoint(e.center) - e.radius;\n\t}\n\tprojectPoint(e, t) {\n\t\treturn t.copy(e).addScaledVector(this.normal, -this.distanceToPoint(e));\n\t}\n\tintersectLine(e, t, n = !0) {\n\t\tlet r = e.delta(Vi), i = this.normal.dot(r);\n\t\tif (i === 0) return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;\n\t\tlet a = -(e.start.dot(this.normal) + this.constant) / i;\n\t\treturn n === !0 && (a < 0 || a > 1) ? null : t.copy(e.start).addScaledVector(r, a);\n\t}\n\tintersectsLine(e) {\n\t\tlet t = this.distanceToPoint(e.start), n = this.distanceToPoint(e.end);\n\t\treturn t < 0 && n > 0 || n < 0 && t > 0;\n\t}\n\tintersectsBox(e) {\n\t\treturn e.intersectsPlane(this);\n\t}\n\tintersectsSphere(e) {\n\t\treturn e.intersectsPlane(this);\n\t}\n\tcoplanarPoint(e) {\n\t\treturn e.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\tapplyMatrix4(e, t) {\n\t\tlet n = t || Ui.getNormalMatrix(e), r = this.coplanarPoint(Vi).applyMatrix4(e), i = this.normal.applyMatrix3(n).normalize();\n\t\treturn this.constant = -r.dot(i), this;\n\t}\n\ttranslate(e) {\n\t\treturn this.constant -= e.dot(this.normal), this;\n\t}\n\tequals(e) {\n\t\treturn e.normal.equals(this.normal) && e.constant === this.constant;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n}, Gi = /*@__PURE__*/ new ai(), Ki = /*@__PURE__*/ new G(.5, .5), qi = /*@__PURE__*/ new K(), Ji = class {\n\tconstructor(e = new Wi(), t = new Wi(), n = new Wi(), r = new Wi(), i = new Wi(), a = new Wi()) {\n\t\tthis.planes = [\n\t\t\te,\n\t\t\tt,\n\t\t\tn,\n\t\t\tr,\n\t\t\ti,\n\t\t\ta\n\t\t];\n\t}\n\tset(e, t, n, r, i, a) {\n\t\tlet o = this.planes;\n\t\treturn o[0].copy(e), o[1].copy(t), o[2].copy(n), o[3].copy(r), o[4].copy(i), o[5].copy(a), this;\n\t}\n\tcopy(e) {\n\t\tlet t = this.planes;\n\t\tfor (let n = 0; n < 6; n++) t[n].copy(e.planes[n]);\n\t\treturn this;\n\t}\n\tsetFromProjectionMatrix(e, t = wt, n = !1) {\n\t\tlet r = this.planes, i = e.elements, a = i[0], o = i[1], s = i[2], c = i[3], l = i[4], u = i[5], d = i[6], f = i[7], p = i[8], m = i[9], h = i[10], g = i[11], _ = i[12], v = i[13], y = i[14], b = i[15];\n\t\tif (r[0].setComponents(c - a, f - l, g - p, b - _).normalize(), r[1].setComponents(c + a, f + l, g + p, b + _).normalize(), r[2].setComponents(c + o, f + u, g + m, b + v).normalize(), r[3].setComponents(c - o, f - u, g - m, b - v).normalize(), n) r[4].setComponents(s, d, h, y).normalize(), r[5].setComponents(c - s, f - d, g - h, b - y).normalize();\n\t\telse if (r[4].setComponents(c - s, f - d, g - h, b - y).normalize(), t === 2e3) r[5].setComponents(c + s, f + d, g + h, b + y).normalize();\n\t\telse if (t === 2001) r[5].setComponents(s, d, h, y).normalize();\n\t\telse throw Error(\"THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: \" + t);\n\t\treturn this;\n\t}\n\tintersectsObject(e) {\n\t\tif (e.boundingSphere !== void 0) e.boundingSphere === null && e.computeBoundingSphere(), Gi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);\n\t\telse {\n\t\t\tlet t = e.geometry;\n\t\t\tt.boundingSphere === null && t.computeBoundingSphere(), Gi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld);\n\t\t}\n\t\treturn this.intersectsSphere(Gi);\n\t}\n\tintersectsSprite(e) {\n\t\treturn Gi.center.set(0, 0, 0), Gi.radius = .7071067811865476 + Ki.distanceTo(e.center), Gi.applyMatrix4(e.matrixWorld), this.intersectsSphere(Gi);\n\t}\n\tintersectsSphere(e) {\n\t\tlet t = this.planes, n = e.center, r = -e.radius;\n\t\tfor (let e = 0; e < 6; e++) if (t[e].distanceToPoint(n) < r) return !1;\n\t\treturn !0;\n\t}\n\tintersectsBox(e) {\n\t\tlet t = this.planes;\n\t\tfor (let n = 0; n < 6; n++) {\n\t\t\tlet r = t[n];\n\t\t\tif (qi.x = r.normal.x > 0 ? e.max.x : e.min.x, qi.y = r.normal.y > 0 ? e.max.y : e.min.y, qi.z = r.normal.z > 0 ? e.max.z : e.min.z, r.distanceToPoint(qi) < 0) return !1;\n\t\t}\n\t\treturn !0;\n\t}\n\tcontainsPoint(e) {\n\t\tlet t = this.planes;\n\t\tfor (let n = 0; n < 6; n++) if (t[n].distanceToPoint(e) < 0) return !1;\n\t\treturn !0;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n}, Yi = class extends En {\n\tconstructor(e = [], t = 301, n, r, i, a, o, s, c, l) {\n\t\tsuper(e, t, n, r, i, a, o, s, c, l), this.isCubeTexture = !0, this.flipY = !1;\n\t}\n\tget images() {\n\t\treturn this.image;\n\t}\n\tset images(e) {\n\t\tthis.image = e;\n\t}\n}, Xi = class extends En {\n\tconstructor(e, t, n = fe, r, i, a, o = L, s = L, c, l = Ce, u = 1) {\n\t\tif (l !== 1026 && l !== 1027) throw Error(\"DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat\");\n\t\tsuper({\n\t\t\twidth: e,\n\t\t\theight: t,\n\t\t\tdepth: u\n\t\t}, r, i, a, o, s, l, n, c), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.source = new Sn(Object.assign({}, e.image)), this.compareFunction = e.compareFunction, this;\n\t}\n\ttoJSON(e) {\n\t\tlet t = super.toJSON(e);\n\t\treturn this.compareFunction !== null && (t.compareFunction = this.compareFunction), t;\n\t}\n}, Zi = class extends Xi {\n\tconstructor(e, t = fe, n = 301, r, i, a = L, o = L, s, c = Ce) {\n\t\tlet l = {\n\t\t\twidth: e,\n\t\t\theight: e,\n\t\t\tdepth: 1\n\t\t}, u = [\n\t\t\tl,\n\t\t\tl,\n\t\t\tl,\n\t\t\tl,\n\t\t\tl,\n\t\t\tl\n\t\t];\n\t\tsuper(e, e, t, n, r, i, a, o, s, c), this.image = u, this.isCubeDepthTexture = !0, this.isCubeTexture = !0;\n\t}\n\tget images() {\n\t\treturn this.image;\n\t}\n\tset images(e) {\n\t\tthis.image = e;\n\t}\n}, Qi = class extends En {\n\tconstructor(e = null) {\n\t\tsuper(), this.sourceTexture = e, this.isExternalTexture = !0;\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.sourceTexture = e.sourceTexture, this;\n\t}\n}, $i = class e extends pi {\n\tconstructor(e = 1, t = 1, n = 1, r = 1, i = 1, a = 1) {\n\t\tsuper(), this.type = \"BoxGeometry\", this.parameters = {\n\t\t\twidth: e,\n\t\t\theight: t,\n\t\t\tdepth: n,\n\t\t\twidthSegments: r,\n\t\t\theightSegments: i,\n\t\t\tdepthSegments: a\n\t\t};\n\t\tlet o = this;\n\t\tr = Math.floor(r), i = Math.floor(i), a = Math.floor(a);\n\t\tlet s = [], c = [], l = [], u = [], d = 0, f = 0;\n\t\tp(\"z\", \"y\", \"x\", -1, -1, n, t, e, a, i, 0), p(\"z\", \"y\", \"x\", 1, -1, n, t, -e, a, i, 1), p(\"x\", \"z\", \"y\", 1, 1, e, n, t, r, a, 2), p(\"x\", \"z\", \"y\", 1, -1, e, n, -t, r, a, 3), p(\"x\", \"y\", \"z\", 1, -1, e, t, n, r, i, 4), p(\"x\", \"y\", \"z\", -1, -1, e, t, -n, r, i, 5), this.setIndex(s), this.setAttribute(\"position\", new ti(c, 3)), this.setAttribute(\"normal\", new ti(l, 3)), this.setAttribute(\"uv\", new ti(u, 2));\n\t\tfunction p(e, t, n, r, i, a, p, m, h, g, _) {\n\t\t\tlet v = a / h, y = p / g, b = a / 2, x = p / 2, S = m / 2, C = h + 1, w = g + 1, T = 0, E = 0, D = new K();\n\t\t\tfor (let a = 0; a < w; a++) {\n\t\t\t\tlet o = a * y - x;\n\t\t\t\tfor (let s = 0; s < C; s++) D[e] = (s * v - b) * r, D[t] = o * i, D[n] = S, c.push(D.x, D.y, D.z), D[e] = 0, D[t] = 0, D[n] = m > 0 ? 1 : -1, l.push(D.x, D.y, D.z), u.push(s / h), u.push(1 - a / g), T += 1;\n\t\t\t}\n\t\t\tfor (let e = 0; e < g; e++) for (let t = 0; t < h; t++) {\n\t\t\t\tlet n = d + t + C * e, r = d + t + C * (e + 1), i = d + (t + 1) + C * (e + 1), a = d + (t + 1) + C * e;\n\t\t\t\ts.push(n, r, a), s.push(r, i, a), E += 6;\n\t\t\t}\n\t\t\to.addGroup(f, E, _), f += E, d += T;\n\t\t}\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.parameters = Object.assign({}, e.parameters), this;\n\t}\n\tstatic fromJSON(t) {\n\t\treturn new e(t.width, t.height, t.depth, t.widthSegments, t.heightSegments, t.depthSegments);\n\t}\n}, ea = class e extends pi {\n\tconstructor(e = 1, t = 1, n = 1, r = 32, i = 1, a = !1, o = 0, s = Math.PI * 2) {\n\t\tsuper(), this.type = \"CylinderGeometry\", this.parameters = {\n\t\t\tradiusTop: e,\n\t\t\tradiusBottom: t,\n\t\t\theight: n,\n\t\t\tradialSegments: r,\n\t\t\theightSegments: i,\n\t\t\topenEnded: a,\n\t\t\tthetaStart: o,\n\t\t\tthetaLength: s\n\t\t};\n\t\tlet c = this;\n\t\tr = Math.floor(r), i = Math.floor(i);\n\t\tlet l = [], u = [], d = [], f = [], p = 0, m = [], h = n / 2, g = 0;\n\t\t_(), a === !1 && (e > 0 && v(!0), t > 0 && v(!1)), this.setIndex(l), this.setAttribute(\"position\", new ti(u, 3)), this.setAttribute(\"normal\", new ti(d, 3)), this.setAttribute(\"uv\", new ti(f, 2));\n\t\tfunction _() {\n\t\t\tlet a = new K(), _ = new K(), v = 0, y = (t - e) / n;\n\t\t\tfor (let c = 0; c <= i; c++) {\n\t\t\t\tlet l = [], g = c / i, v = g * (t - e) + e;\n\t\t\t\tfor (let e = 0; e <= r; e++) {\n\t\t\t\t\tlet t = e / r, i = t * s + o, c = Math.sin(i), m = Math.cos(i);\n\t\t\t\t\t_.x = v * c, _.y = -g * n + h, _.z = v * m, u.push(_.x, _.y, _.z), a.set(c, y, m).normalize(), d.push(a.x, a.y, a.z), f.push(t, 1 - g), l.push(p++);\n\t\t\t\t}\n\t\t\t\tm.push(l);\n\t\t\t}\n\t\t\tfor (let n = 0; n < r; n++) for (let r = 0; r < i; r++) {\n\t\t\t\tlet a = m[r][n], o = m[r + 1][n], s = m[r + 1][n + 1], c = m[r][n + 1];\n\t\t\t\t(e > 0 || r !== 0) && (l.push(a, o, c), v += 3), (t > 0 || r !== i - 1) && (l.push(o, s, c), v += 3);\n\t\t\t}\n\t\t\tc.addGroup(g, v, 0), g += v;\n\t\t}\n\t\tfunction v(n) {\n\t\t\tlet i = p, a = new G(), m = new K(), _ = 0, v = n === !0 ? e : t, y = n === !0 ? 1 : -1;\n\t\t\tfor (let e = 1; e <= r; e++) u.push(0, h * y, 0), d.push(0, y, 0), f.push(.5, .5), p++;\n\t\t\tlet b = p;\n\t\t\tfor (let e = 0; e <= r; e++) {\n\t\t\t\tlet t = e / r * s + o, n = Math.cos(t), i = Math.sin(t);\n\t\t\t\tm.x = v * i, m.y = h * y, m.z = v * n, u.push(m.x, m.y, m.z), d.push(0, y, 0), a.x = n * .5 + .5, a.y = i * .5 * y + .5, f.push(a.x, a.y), p++;\n\t\t\t}\n\t\t\tfor (let e = 0; e < r; e++) {\n\t\t\t\tlet t = i + e, r = b + e;\n\t\t\t\tn === !0 ? l.push(r, r + 1, t) : l.push(r + 1, r, t), _ += 3;\n\t\t\t}\n\t\t\tc.addGroup(g, _, n === !0 ? 1 : 2), g += _;\n\t\t}\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.parameters = Object.assign({}, e.parameters), this;\n\t}\n\tstatic fromJSON(t) {\n\t\treturn new e(t.radiusTop, t.radiusBottom, t.height, t.radialSegments, t.heightSegments, t.openEnded, t.thetaStart, t.thetaLength);\n\t}\n}, ta = class e extends ea {\n\tconstructor(e = 1, t = 1, n = 32, r = 1, i = !1, a = 0, o = Math.PI * 2) {\n\t\tsuper(0, e, t, n, r, i, a, o), this.type = \"ConeGeometry\", this.parameters = {\n\t\t\tradius: e,\n\t\t\theight: t,\n\t\t\tradialSegments: n,\n\t\t\theightSegments: r,\n\t\t\topenEnded: i,\n\t\t\tthetaStart: a,\n\t\t\tthetaLength: o\n\t\t};\n\t}\n\tstatic fromJSON(t) {\n\t\treturn new e(t.radius, t.height, t.radialSegments, t.heightSegments, t.openEnded, t.thetaStart, t.thetaLength);\n\t}\n}, na = class e extends pi {\n\tconstructor(e = 1, t = 1, n = 1, r = 1) {\n\t\tsuper(), this.type = \"PlaneGeometry\", this.parameters = {\n\t\t\twidth: e,\n\t\t\theight: t,\n\t\t\twidthSegments: n,\n\t\t\theightSegments: r\n\t\t};\n\t\tlet i = e / 2, a = t / 2, o = Math.floor(n), s = Math.floor(r), c = o + 1, l = s + 1, u = e / o, d = t / s, f = [], p = [], m = [], h = [];\n\t\tfor (let e = 0; e < l; e++) {\n\t\t\tlet t = e * d - a;\n\t\t\tfor (let n = 0; n < c; n++) {\n\t\t\t\tlet r = n * u - i;\n\t\t\t\tp.push(r, -t, 0), m.push(0, 0, 1), h.push(n / o), h.push(1 - e / s);\n\t\t\t}\n\t\t}\n\t\tfor (let e = 0; e < s; e++) for (let t = 0; t < o; t++) {\n\t\t\tlet n = t + c * e, r = t + c * (e + 1), i = t + 1 + c * (e + 1), a = t + 1 + c * e;\n\t\t\tf.push(n, r, a), f.push(r, i, a);\n\t\t}\n\t\tthis.setIndex(f), this.setAttribute(\"position\", new ti(p, 3)), this.setAttribute(\"normal\", new ti(m, 3)), this.setAttribute(\"uv\", new ti(h, 2));\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.parameters = Object.assign({}, e.parameters), this;\n\t}\n\tstatic fromJSON(t) {\n\t\treturn new e(t.width, t.height, t.widthSegments, t.heightSegments);\n\t}\n}, ra = class e extends pi {\n\tconstructor(e = 1, t = 32, n = 16, r = 0, i = Math.PI * 2, a = 0, o = Math.PI) {\n\t\tsuper(), this.type = \"SphereGeometry\", this.parameters = {\n\t\t\tradius: e,\n\t\t\twidthSegments: t,\n\t\t\theightSegments: n,\n\t\t\tphiStart: r,\n\t\t\tphiLength: i,\n\t\t\tthetaStart: a,\n\t\t\tthetaLength: o\n\t\t}, t = Math.max(3, Math.floor(t)), n = Math.max(2, Math.floor(n));\n\t\tlet s = Math.min(a + o, Math.PI), c = 0, l = [], u = new K(), d = new K(), f = [], p = [], m = [], h = [];\n\t\tfor (let f = 0; f <= n; f++) {\n\t\t\tlet g = [], _ = f / n, v = 0;\n\t\t\tf === 0 && a === 0 ? v = .5 / t : f === n && s === Math.PI && (v = -.5 / t);\n\t\t\tfor (let n = 0; n <= t; n++) {\n\t\t\t\tlet s = n / t;\n\t\t\t\tu.x = -e * Math.cos(r + s * i) * Math.sin(a + _ * o), u.y = e * Math.cos(a + _ * o), u.z = e * Math.sin(r + s * i) * Math.sin(a + _ * o), p.push(u.x, u.y, u.z), d.copy(u).normalize(), m.push(d.x, d.y, d.z), h.push(s + v, 1 - _), g.push(c++);\n\t\t\t}\n\t\t\tl.push(g);\n\t\t}\n\t\tfor (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {\n\t\t\tlet t = l[e][r + 1], i = l[e][r], o = l[e + 1][r], c = l[e + 1][r + 1];\n\t\t\t(e !== 0 || a > 0) && f.push(t, i, c), (e !== n - 1 || s < Math.PI) && f.push(i, o, c);\n\t\t}\n\t\tthis.setIndex(f), this.setAttribute(\"position\", new ti(p, 3)), this.setAttribute(\"normal\", new ti(m, 3)), this.setAttribute(\"uv\", new ti(h, 2));\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.parameters = Object.assign({}, e.parameters), this;\n\t}\n\tstatic fromJSON(t) {\n\t\treturn new e(t.radius, t.widthSegments, t.heightSegments, t.phiStart, t.phiLength, t.thetaStart, t.thetaLength);\n\t}\n};\nfunction ia(e) {\n\tlet t = {};\n\tfor (let n in e) {\n\t\tt[n] = {};\n\t\tfor (let r in e[n]) {\n\t\t\tlet i = e[n][r];\n\t\t\tif (oa(i)) i.isRenderTargetTexture ? (H(\"UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().\"), t[n][r] = null) : t[n][r] = i.clone();\n\t\t\telse if (Array.isArray(i)) {\n\t\t\t\tif (oa(i[0])) {\n\t\t\t\t\tlet e = [];\n\t\t\t\t\tfor (let t = 0, n = i.length; t < n; t++) e[t] = i[t].clone();\n\t\t\t\t\tt[n][r] = e;\n\t\t\t\t} else t[n][r] = i.slice();\n\t\t\t} else t[n][r] = i;\n\t\t}\n\t}\n\treturn t;\n}\nfunction aa(e) {\n\tlet t = {};\n\tfor (let n = 0; n < e.length; n++) {\n\t\tlet r = ia(e[n]);\n\t\tfor (let e in r) t[e] = r[e];\n\t}\n\treturn t;\n}\nfunction oa(e) {\n\treturn e && (e.isColor || e.isMatrix3 || e.isMatrix4 || e.isVector2 || e.isVector3 || e.isVector4 || e.isTexture || e.isQuaternion);\n}\nfunction sa(e) {\n\tlet t = [];\n\tfor (let n = 0; n < e.length; n++) t.push(e[n].clone());\n\treturn t;\n}\nfunction ca(e) {\n\tlet t = e.getRenderTarget();\n\treturn t === null ? e.outputColorSpace : t.isXRRenderTarget === !0 ? t.texture.colorSpace : gn.workingColorSpace;\n}\nvar la = {\n\tclone: ia,\n\tmerge: aa\n}, ua = \"void main() {\\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\", da = \"void main() {\\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\", fa = class extends hi {\n\tconstructor(e) {\n\t\tsuper(), this.isShaderMaterial = !0, this.type = \"ShaderMaterial\", this.defines = {}, this.uniforms = {}, this.uniformsGroups = [], this.vertexShader = ua, this.fragmentShader = da, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.forceSinglePass = !0, this.extensions = {\n\t\t\tclipCullDistance: !1,\n\t\t\tmultiDraw: !1\n\t\t}, this.defaultAttributeValues = {\n\t\t\tcolor: [\n\t\t\t\t1,\n\t\t\t\t1,\n\t\t\t\t1\n\t\t\t],\n\t\t\tuv: [0, 0],\n\t\t\tuv1: [0, 0]\n\t\t}, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && this.setValues(e);\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = ia(e.uniforms), this.uniformsGroups = sa(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.defaultAttributeValues = Object.assign({}, e.defaultAttributeValues), this.index0AttributeName = e.index0AttributeName, this.uniformsNeedUpdate = e.uniformsNeedUpdate, this;\n\t}\n\ttoJSON(e) {\n\t\tlet t = super.toJSON(e);\n\t\tt.glslVersion = this.glslVersion, t.uniforms = {};\n\t\tfor (let n in this.uniforms) {\n\t\t\tlet r = this.uniforms[n].value;\n\t\t\tr && r.isTexture ? t.uniforms[n] = {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: r.toJSON(e).uuid\n\t\t\t} : r && r.isColor ? t.uniforms[n] = {\n\t\t\t\ttype: \"c\",\n\t\t\t\tvalue: r.getHex()\n\t\t\t} : r && r.isVector2 ? t.uniforms[n] = {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: r.toArray()\n\t\t\t} : r && r.isVector3 ? t.uniforms[n] = {\n\t\t\t\ttype: \"v3\",\n\t\t\t\tvalue: r.toArray()\n\t\t\t} : r && r.isVector4 ? t.uniforms[n] = {\n\t\t\t\ttype: \"v4\",\n\t\t\t\tvalue: r.toArray()\n\t\t\t} : r && r.isMatrix3 ? t.uniforms[n] = {\n\t\t\t\ttype: \"m3\",\n\t\t\t\tvalue: r.toArray()\n\t\t\t} : r && r.isMatrix4 ? t.uniforms[n] = {\n\t\t\t\ttype: \"m4\",\n\t\t\t\tvalue: r.toArray()\n\t\t\t} : t.uniforms[n] = { value: r };\n\t\t}\n\t\tObject.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;\n\t\tlet n = {};\n\t\tfor (let e in this.extensions) this.extensions[e] === !0 && (n[e] = !0);\n\t\treturn Object.keys(n).length > 0 && (t.extensions = n), t;\n\t}\n}, pa = class extends fa {\n\tconstructor(e) {\n\t\tsuper(e), this.isRawShaderMaterial = !0, this.type = \"RawShaderMaterial\";\n\t}\n}, ma = class extends hi {\n\tconstructor(e) {\n\t\tsuper(), this.isMeshDepthMaterial = !0, this.type = \"MeshDepthMaterial\", this.depthPacking = gt, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.setValues(e);\n\t}\n\tcopy(e) {\n\t\treturn 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;\n\t}\n}, ha = class extends hi {\n\tconstructor(e) {\n\t\tsuper(), this.isMeshDistanceMaterial = !0, this.type = \"MeshDistanceMaterial\", this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.setValues(e);\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this;\n\t}\n};\nfunction ga(e, t) {\n\treturn !e || e.constructor === t ? e : typeof t.BYTES_PER_ELEMENT == \"number\" ? new t(e) : Array.prototype.slice.call(e);\n}\nvar _a = class {\n\tconstructor(e, t, n, r) {\n\t\tthis.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = r === void 0 ? new t.constructor(n) : r, this.sampleValues = t, this.valueSize = n, this.settings = null, this.DefaultSettings_ = {};\n\t}\n\tevaluate(e) {\n\t\tlet t = this.parameterPositions, n = this._cachedIndex, r = t[n], i = t[n - 1];\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet a;\n\t\t\t\tlinear_scan: {\n\t\t\t\t\tforward_scan: if (!(e < r)) {\n\t\t\t\t\t\tfor (let a = n + 2;;) {\n\t\t\t\t\t\t\tif (r === void 0) {\n\t\t\t\t\t\t\t\tif (e < i) break forward_scan;\n\t\t\t\t\t\t\t\treturn n = t.length, this._cachedIndex = n, this.copySampleValue_(n - 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (n === a) break;\n\t\t\t\t\t\t\tif (i = r, r = t[++n], e < r) break seek;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta = t.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t}\n\t\t\t\t\tif (!(e >= i)) {\n\t\t\t\t\t\tlet o = t[1];\n\t\t\t\t\t\te < o && (n = 2, i = o);\n\t\t\t\t\t\tfor (let a = n - 2;;) {\n\t\t\t\t\t\t\tif (i === void 0) return this._cachedIndex = 0, this.copySampleValue_(0);\n\t\t\t\t\t\t\tif (n === a) break;\n\t\t\t\t\t\t\tif (r = i, i = t[--n - 1], e >= i) break seek;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta = n, n = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t}\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t}\n\t\t\t\tfor (; n < a;) {\n\t\t\t\t\tlet r = n + a >>> 1;\n\t\t\t\t\te < t[r] ? a = r : n = r + 1;\n\t\t\t\t}\n\t\t\t\tif (r = t[n], i = t[n - 1], i === void 0) return this._cachedIndex = 0, this.copySampleValue_(0);\n\t\t\t\tif (r === void 0) return n = t.length, this._cachedIndex = n, this.copySampleValue_(n - 1);\n\t\t\t}\n\t\t\tthis._cachedIndex = n, this.intervalChanged_(n, i, r);\n\t\t}\n\t\treturn this.interpolate_(n, i, e, r);\n\t}\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\tcopySampleValue_(e) {\n\t\tlet t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r;\n\t\tfor (let e = 0; e !== r; ++e) t[e] = n[i + e];\n\t\treturn t;\n\t}\n\tinterpolate_() {\n\t\tthrow Error(\"call to abstract method\");\n\t}\n\tintervalChanged_() {}\n}, va = class extends _a {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = {\n\t\t\tendingStart: pt,\n\t\t\tendingEnd: pt\n\t\t};\n\t}\n\tintervalChanged_(e, t, n) {\n\t\tlet r = this.parameterPositions, i = e - 2, a = e + 1, o = r[i], s = r[a];\n\t\tif (o === void 0) switch (this.getSettings_().endingStart) {\n\t\t\tcase mt:\n\t\t\t\ti = e, o = 2 * t - n;\n\t\t\t\tbreak;\n\t\t\tcase ht:\n\t\t\t\ti = r.length - 2, o = t + r[i] - r[i + 1];\n\t\t\t\tbreak;\n\t\t\tdefault: i = e, o = n;\n\t\t}\n\t\tif (s === void 0) switch (this.getSettings_().endingEnd) {\n\t\t\tcase mt:\n\t\t\t\ta = e, s = 2 * n - t;\n\t\t\t\tbreak;\n\t\t\tcase ht:\n\t\t\t\ta = 1, s = n + r[1] - r[0];\n\t\t\t\tbreak;\n\t\t\tdefault: a = e - 1, s = t;\n\t\t}\n\t\tlet c = (n - t) * .5, l = this.valueSize;\n\t\tthis._weightPrev = c / (t - o), this._weightNext = c / (s - n), this._offsetPrev = i * l, this._offsetNext = a * l;\n\t}\n\tinterpolate_(e, t, n, r) {\n\t\tlet i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = e * o, c = s - o, l = this._offsetPrev, u = this._offsetNext, d = this._weightPrev, f = this._weightNext, p = (n - t) / (r - t), m = p * p, h = m * p, g = -d * h + 2 * d * m - d * p, _ = (1 + d) * h + (-1.5 - 2 * d) * m + (-.5 + d) * p + 1, v = (-1 - f) * h + (1.5 + f) * m + .5 * p, y = f * h - f * m;\n\t\tfor (let e = 0; e !== o; ++e) i[e] = g * a[l + e] + _ * a[c + e] + v * a[s + e] + y * a[u + e];\n\t\treturn i;\n\t}\n}, ya = class extends _a {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n\tinterpolate_(e, t, n, r) {\n\t\tlet i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = e * o, c = s - o, l = (n - t) / (r - t), u = 1 - l;\n\t\tfor (let e = 0; e !== o; ++e) i[e] = a[c + e] * u + a[s + e] * l;\n\t\treturn i;\n\t}\n}, ba = class extends _a {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n\tinterpolate_(e) {\n\t\treturn this.copySampleValue_(e - 1);\n\t}\n}, xa = class extends _a {\n\tinterpolate_(e, t, n, r) {\n\t\tlet i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = e * o, c = s - o, l = this.settings || this.DefaultSettings_, u = l.inTangents, d = l.outTangents;\n\t\tif (!u || !d) {\n\t\t\tlet e = (n - t) / (r - t), l = 1 - e;\n\t\t\tfor (let t = 0; t !== o; ++t) i[t] = a[c + t] * l + a[s + t] * e;\n\t\t\treturn i;\n\t\t}\n\t\tlet f = o * 2, p = e - 1;\n\t\tfor (let l = 0; l !== o; ++l) {\n\t\t\tlet o = a[c + l], m = a[s + l], h = p * f + l * 2, g = d[h], _ = d[h + 1], v = e * f + l * 2, y = u[v], b = u[v + 1], x = (n - t) / (r - t), S, C, w, T, E;\n\t\t\tfor (let e = 0; e < 8; e++) {\n\t\t\t\tS = x * x, C = S * x, w = 1 - x, T = w * w, E = T * w;\n\t\t\t\tlet e = E * t + 3 * T * x * g + 3 * w * S * y + C * r - n;\n\t\t\t\tif (Math.abs(e) < 1e-10) break;\n\t\t\t\tlet i = 3 * T * (g - t) + 6 * w * x * (y - g) + 3 * S * (r - y);\n\t\t\t\tif (Math.abs(i) < 1e-10) break;\n\t\t\t\tx -= e / i, x = Math.max(0, Math.min(1, x));\n\t\t\t}\n\t\t\ti[l] = E * o + 3 * T * x * _ + 3 * w * S * b + C * m;\n\t\t}\n\t\treturn i;\n\t}\n}, Sa = class {\n\tconstructor(e, t, n, r) {\n\t\tif (e === void 0) throw Error(\"THREE.KeyframeTrack: track name is undefined\");\n\t\tif (t === void 0 || t.length === 0) throw Error(\"THREE.KeyframeTrack: no keyframes in track named \" + e);\n\t\tthis.name = e, this.times = ga(t, this.TimeBufferType), this.values = ga(n, this.ValueBufferType), this.setInterpolation(r || this.DefaultInterpolation);\n\t}\n\tstatic toJSON(e) {\n\t\tlet t = e.constructor, n;\n\t\tif (t.toJSON !== this.toJSON) n = t.toJSON(e);\n\t\telse {\n\t\t\tn = {\n\t\t\t\tname: e.name,\n\t\t\t\ttimes: ga(e.times, Array),\n\t\t\t\tvalues: ga(e.values, Array)\n\t\t\t};\n\t\t\tlet t = e.getInterpolation();\n\t\t\tt !== e.DefaultInterpolation && (n.interpolation = t);\n\t\t}\n\t\treturn n.type = e.ValueTypeName, n;\n\t}\n\tInterpolantFactoryMethodDiscrete(e) {\n\t\treturn new ba(this.times, this.values, this.getValueSize(), e);\n\t}\n\tInterpolantFactoryMethodLinear(e) {\n\t\treturn new ya(this.times, this.values, this.getValueSize(), e);\n\t}\n\tInterpolantFactoryMethodSmooth(e) {\n\t\treturn new va(this.times, this.values, this.getValueSize(), e);\n\t}\n\tInterpolantFactoryMethodBezier(e) {\n\t\tlet t = new xa(this.times, this.values, this.getValueSize(), e);\n\t\treturn this.settings && (t.settings = this.settings), t;\n\t}\n\tsetInterpolation(e) {\n\t\tlet t;\n\t\tswitch (e) {\n\t\t\tcase lt:\n\t\t\t\tt = this.InterpolantFactoryMethodDiscrete;\n\t\t\t\tbreak;\n\t\t\tcase ut:\n\t\t\t\tt = this.InterpolantFactoryMethodLinear;\n\t\t\t\tbreak;\n\t\t\tcase dt:\n\t\t\t\tt = this.InterpolantFactoryMethodSmooth;\n\t\t\t\tbreak;\n\t\t\tcase ft: t = this.InterpolantFactoryMethodBezier;\n\t\t}\n\t\tif (t === void 0) {\n\t\t\tlet t = \"unsupported interpolation for \" + this.ValueTypeName + \" keyframe track named \" + this.name;\n\t\t\tif (this.createInterpolant === void 0) {\n\t\t\t\tif (e !== this.DefaultInterpolation) this.setInterpolation(this.DefaultInterpolation);\n\t\t\t\telse throw Error(t);\n\t\t\t}\n\t\t\treturn H(\"KeyframeTrack:\", t), this;\n\t\t}\n\t\treturn this.createInterpolant = t, this;\n\t}\n\tgetInterpolation() {\n\t\tswitch (this.createInterpolant) {\n\t\t\tcase this.InterpolantFactoryMethodDiscrete: return lt;\n\t\t\tcase this.InterpolantFactoryMethodLinear: return ut;\n\t\t\tcase this.InterpolantFactoryMethodSmooth: return dt;\n\t\t\tcase this.InterpolantFactoryMethodBezier: return ft;\n\t\t}\n\t}\n\tgetValueSize() {\n\t\treturn this.values.length / this.times.length;\n\t}\n\tshift(e) {\n\t\tif (e !== 0) {\n\t\t\tlet t = this.times;\n\t\t\tfor (let n = 0, r = t.length; n !== r; ++n) t[n] += e;\n\t\t}\n\t\treturn this;\n\t}\n\tscale(e) {\n\t\tif (e !== 1) {\n\t\t\tlet t = this.times;\n\t\t\tfor (let n = 0, r = t.length; n !== r; ++n) t[n] *= e;\n\t\t}\n\t\treturn this;\n\t}\n\ttrim(e, t) {\n\t\tlet n = this.times, r = n.length, i = 0, a = r - 1;\n\t\tfor (; i !== r && n[i] < e;) ++i;\n\t\tfor (; a !== -1 && n[a] > t;) --a;\n\t\tif (++a, i !== 0 || a !== r) {\n\t\t\ti >= a && (a = Math.max(a, 1), i = a - 1);\n\t\t\tlet e = this.getValueSize();\n\t\t\tthis.times = n.slice(i, a), this.values = this.values.slice(i * e, a * e);\n\t\t}\n\t\treturn this;\n\t}\n\tvalidate() {\n\t\tlet e = !0, t = this.getValueSize();\n\t\tt - Math.floor(t) !== 0 && (U(\"KeyframeTrack: Invalid value size in track.\", this), e = !1);\n\t\tlet n = this.times, r = this.values, i = n.length;\n\t\ti === 0 && (U(\"KeyframeTrack: Track is empty.\", this), e = !1);\n\t\tlet a = null;\n\t\tfor (let t = 0; t !== i; t++) {\n\t\t\tlet r = n[t];\n\t\t\tif (typeof r == \"number\" && isNaN(r)) {\n\t\t\t\tU(\"KeyframeTrack: Time is not a valid number.\", this, t, r), e = !1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (a !== null && a > r) {\n\t\t\t\tU(\"KeyframeTrack: Out of order keys.\", this, t, r, a), e = !1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ta = r;\n\t\t}\n\t\tif (r !== void 0 && Et(r)) for (let t = 0, n = r.length; t !== n; ++t) {\n\t\t\tlet n = r[t];\n\t\t\tif (isNaN(n)) {\n\t\t\t\tU(\"KeyframeTrack: Value is not a valid number.\", this, t, n), e = !1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn e;\n\t}\n\toptimize() {\n\t\tlet e = this.times.slice(), t = this.values.slice(), n = this.getValueSize(), r = this.getInterpolation() === dt, i = e.length - 1, a = 1;\n\t\tfor (let o = 1; o < i; ++o) {\n\t\t\tlet i = !1, s = e[o];\n\t\t\tif (s !== e[o + 1] && (o !== 1 || s !== e[0])) {\n\t\t\t\tif (r) i = !0;\n\t\t\t\telse {\n\t\t\t\t\tlet e = o * n, r = e - n, a = e + n;\n\t\t\t\t\tfor (let o = 0; o !== n; ++o) {\n\t\t\t\t\t\tlet n = t[e + o];\n\t\t\t\t\t\tif (n !== t[r + o] || n !== t[a + o]) {\n\t\t\t\t\t\t\ti = !0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i) {\n\t\t\t\tif (o !== a) {\n\t\t\t\t\te[a] = e[o];\n\t\t\t\t\tlet r = o * n, i = a * n;\n\t\t\t\t\tfor (let e = 0; e !== n; ++e) t[i + e] = t[r + e];\n\t\t\t\t}\n\t\t\t\t++a;\n\t\t\t}\n\t\t}\n\t\tif (i > 0) {\n\t\t\te[a] = e[i];\n\t\t\tfor (let e = i * n, r = a * n, o = 0; o !== n; ++o) t[r + o] = t[e + o];\n\t\t\t++a;\n\t\t}\n\t\treturn a === e.length ? (this.times = e, this.values = t) : (this.times = e.slice(0, a), this.values = t.slice(0, a * n)), this;\n\t}\n\tclone() {\n\t\tlet e = this.times.slice(), t = this.values.slice(), n = this.constructor, r = new n(this.name, e, t);\n\t\treturn r.createInterpolant = this.createInterpolant, r;\n\t}\n};\nSa.prototype.ValueTypeName = \"\", Sa.prototype.TimeBufferType = Float32Array, Sa.prototype.ValueBufferType = Float32Array, Sa.prototype.DefaultInterpolation = ut;\nvar Ca = class extends Sa {\n\tconstructor(e, t, n) {\n\t\tsuper(e, t, n);\n\t}\n};\nCa.prototype.ValueTypeName = \"bool\", Ca.prototype.ValueBufferType = Array, Ca.prototype.DefaultInterpolation = lt, Ca.prototype.InterpolantFactoryMethodLinear = void 0, Ca.prototype.InterpolantFactoryMethodSmooth = void 0;\nvar wa = class extends Sa {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n};\nwa.prototype.ValueTypeName = \"color\";\nvar Ta = class extends Sa {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n};\nTa.prototype.ValueTypeName = \"number\";\nvar Ea = class extends _a {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n\tinterpolate_(e, t, n, r) {\n\t\tlet i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = (n - t) / (r - t), c = e * o;\n\t\tfor (let e = c + o; c !== e; c += 4) ln.slerpFlat(i, 0, a, c - o, a, c, s);\n\t\treturn i;\n\t}\n}, Da = class extends Sa {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n\tInterpolantFactoryMethodLinear(e) {\n\t\treturn new Ea(this.times, this.values, this.getValueSize(), e);\n\t}\n};\nDa.prototype.ValueTypeName = \"quaternion\", Da.prototype.InterpolantFactoryMethodSmooth = void 0;\nvar Oa = class extends Sa {\n\tconstructor(e, t, n) {\n\t\tsuper(e, t, n);\n\t}\n};\nOa.prototype.ValueTypeName = \"string\", Oa.prototype.ValueBufferType = Array, Oa.prototype.DefaultInterpolation = lt, Oa.prototype.InterpolantFactoryMethodLinear = void 0, Oa.prototype.InterpolantFactoryMethodSmooth = void 0;\nvar ka = class extends Sa {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r);\n\t}\n};\nka.prototype.ValueTypeName = \"vector\";\nvar Aa = /*@__PURE__*/ new K(), ja = /*@__PURE__*/ new ln(), Ma = /*@__PURE__*/ new K(), Na = class extends ir {\n\tconstructor() {\n\t\tsuper(), this.isCamera = !0, this.type = \"Camera\", this.matrixWorldInverse = new J(), this.projectionMatrix = new J(), this.projectionMatrixInverse = new J(), this.coordinateSystem = wt, this._reversedDepth = !1;\n\t}\n\tget reversedDepth() {\n\t\treturn this._reversedDepth;\n\t}\n\tcopy(e, t) {\n\t\treturn super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this.coordinateSystem = e.coordinateSystem, this;\n\t}\n\tgetWorldDirection(e) {\n\t\treturn super.getWorldDirection(e).negate();\n\t}\n\tupdateMatrixWorld(e) {\n\t\tsuper.updateMatrixWorld(e), this.matrixWorld.decompose(Aa, ja, Ma), Ma.x === 1 && Ma.y === 1 && Ma.z === 1 ? this.matrixWorldInverse.copy(this.matrixWorld).invert() : this.matrixWorldInverse.compose(Aa, ja, Ma.set(1, 1, 1)).invert();\n\t}\n\tupdateWorldMatrix(e, t) {\n\t\tsuper.updateWorldMatrix(e, t), this.matrixWorld.decompose(Aa, ja, Ma), Ma.x === 1 && Ma.y === 1 && Ma.z === 1 ? this.matrixWorldInverse.copy(this.matrixWorld).invert() : this.matrixWorldInverse.compose(Aa, ja, Ma.set(1, 1, 1)).invert();\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n}, Pa = /*@__PURE__*/ new K(), Fa = /*@__PURE__*/ new G(), Ia = /*@__PURE__*/ new G(), La = class extends Na {\n\tconstructor(e = 50, t = 1, n = .1, r = 2e3) {\n\t\tsuper(), this.isPerspectiveCamera = !0, this.type = \"PerspectiveCamera\", this.fov = e, this.zoom = 1, this.near = n, this.far = r, this.focus = 10, this.aspect = t, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix();\n\t}\n\tcopy(e, t) {\n\t\treturn 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;\n\t}\n\tsetFocalLength(e) {\n\t\tlet t = .5 * this.getFilmHeight() / e;\n\t\tthis.fov = zt * 2 * Math.atan(t), this.updateProjectionMatrix();\n\t}\n\tgetFocalLength() {\n\t\tlet e = Math.tan(Rt * .5 * this.fov);\n\t\treturn .5 * this.getFilmHeight() / e;\n\t}\n\tgetEffectiveFOV() {\n\t\treturn zt * 2 * Math.atan(Math.tan(Rt * .5 * this.fov) / this.zoom);\n\t}\n\tgetFilmWidth() {\n\t\treturn this.filmGauge * Math.min(this.aspect, 1);\n\t}\n\tgetFilmHeight() {\n\t\treturn this.filmGauge / Math.max(this.aspect, 1);\n\t}\n\tgetViewBounds(e, t, n) {\n\t\tPa.set(-1, -1, .5).applyMatrix4(this.projectionMatrixInverse), t.set(Pa.x, Pa.y).multiplyScalar(-e / Pa.z), Pa.set(1, 1, .5).applyMatrix4(this.projectionMatrixInverse), n.set(Pa.x, Pa.y).multiplyScalar(-e / Pa.z);\n\t}\n\tgetViewSize(e, t) {\n\t\treturn this.getViewBounds(e, Fa, Ia), t.subVectors(Ia, Fa);\n\t}\n\tsetViewOffset(e, t, n, r, i, a) {\n\t\tthis.aspect = e / t, this.view === null && (this.view = {\n\t\t\tenabled: !0,\n\t\t\tfullWidth: 1,\n\t\t\tfullHeight: 1,\n\t\t\toffsetX: 0,\n\t\t\toffsetY: 0,\n\t\t\twidth: 1,\n\t\t\theight: 1\n\t\t}), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = n, this.view.offsetY = r, this.view.width = i, this.view.height = a, this.updateProjectionMatrix();\n\t}\n\tclearViewOffset() {\n\t\tthis.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();\n\t}\n\tupdateProjectionMatrix() {\n\t\tlet e = this.near, t = e * Math.tan(Rt * .5 * this.fov) / this.zoom, n = 2 * t, r = this.aspect * n, i = -.5 * r, a = this.view;\n\t\tif (this.view !== null && this.view.enabled) {\n\t\t\tlet e = a.fullWidth, o = a.fullHeight;\n\t\t\ti += a.offsetX * r / e, t -= a.offsetY * n / o, r *= a.width / e, n *= a.height / o;\n\t\t}\n\t\tlet o = this.filmOffset;\n\t\to !== 0 && (i += e * o / this.getFilmWidth()), this.projectionMatrix.makePerspective(i, i + r, t, t - n, e, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n\t}\n\ttoJSON(e) {\n\t\tlet t = super.toJSON(e);\n\t\treturn 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;\n\t}\n}, Ra = class extends Na {\n\tconstructor(e = -1, t = 1, n = 1, r = -1, i = .1, a = 2e3) {\n\t\tsuper(), this.isOrthographicCamera = !0, this.type = \"OrthographicCamera\", this.zoom = 1, this.view = null, this.left = e, this.right = t, this.top = n, this.bottom = r, this.near = i, this.far = a, this.updateProjectionMatrix();\n\t}\n\tcopy(e, t) {\n\t\treturn 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;\n\t}\n\tsetViewOffset(e, t, n, r, i, a) {\n\t\tthis.view === null && (this.view = {\n\t\t\tenabled: !0,\n\t\t\tfullWidth: 1,\n\t\t\tfullHeight: 1,\n\t\t\toffsetX: 0,\n\t\t\toffsetY: 0,\n\t\t\twidth: 1,\n\t\t\theight: 1\n\t\t}), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = n, this.view.offsetY = r, this.view.width = i, this.view.height = a, this.updateProjectionMatrix();\n\t}\n\tclearViewOffset() {\n\t\tthis.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();\n\t}\n\tupdateProjectionMatrix() {\n\t\tlet e = (this.right - this.left) / (2 * this.zoom), t = (this.top - this.bottom) / (2 * this.zoom), n = (this.right + this.left) / 2, r = (this.top + this.bottom) / 2, i = n - e, a = n + e, o = r + t, s = r - t;\n\t\tif (this.view !== null && this.view.enabled) {\n\t\t\tlet e = (this.right - this.left) / this.view.fullWidth / this.zoom, t = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n\t\t\ti += e * this.view.offsetX, a = i + e * this.view.width, o -= t * this.view.offsetY, s = o - t * this.view.height;\n\t\t}\n\t\tthis.projectionMatrix.makeOrthographic(i, a, o, s, this.near, this.far, this.coordinateSystem, this.reversedDepth), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n\t}\n\ttoJSON(e) {\n\t\tlet t = super.toJSON(e);\n\t\treturn 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;\n\t}\n}, za = class extends pi {\n\tconstructor() {\n\t\tsuper(), this.isInstancedBufferGeometry = !0, this.type = \"InstancedBufferGeometry\", this.instanceCount = Infinity;\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e), this.instanceCount = e.instanceCount, this;\n\t}\n\ttoJSON() {\n\t\tlet e = super.toJSON();\n\t\treturn e.instanceCount = this.instanceCount, e.isInstancedBufferGeometry = !0, e;\n\t}\n}, Ba = -90, Va = 1, Ha = class extends ir {\n\tconstructor(e, t, n) {\n\t\tsuper(), this.type = \"CubeCamera\", this.renderTarget = n, this.coordinateSystem = null, this.activeMipmapLevel = 0;\n\t\tlet r = new La(Ba, Va, e, t);\n\t\tr.layers = this.layers, this.add(r);\n\t\tlet i = new La(Ba, Va, e, t);\n\t\ti.layers = this.layers, this.add(i);\n\t\tlet a = new La(Ba, Va, e, t);\n\t\ta.layers = this.layers, this.add(a);\n\t\tlet o = new La(Ba, Va, e, t);\n\t\to.layers = this.layers, this.add(o);\n\t\tlet s = new La(Ba, Va, e, t);\n\t\ts.layers = this.layers, this.add(s);\n\t\tlet c = new La(Ba, Va, e, t);\n\t\tc.layers = this.layers, this.add(c);\n\t}\n\tupdateCoordinateSystem() {\n\t\tlet e = this.coordinateSystem, t = this.children.concat(), [n, r, i, a, o, s] = t;\n\t\tfor (let e of t) this.remove(e);\n\t\tif (e === 2e3) n.up.set(0, 1, 0), n.lookAt(1, 0, 0), r.up.set(0, 1, 0), r.lookAt(-1, 0, 0), i.up.set(0, 0, -1), i.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), s.up.set(0, 1, 0), s.lookAt(0, 0, -1);\n\t\telse if (e === 2001) n.up.set(0, -1, 0), n.lookAt(-1, 0, 0), r.up.set(0, -1, 0), r.lookAt(1, 0, 0), i.up.set(0, 0, 1), i.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), s.up.set(0, -1, 0), s.lookAt(0, 0, -1);\n\t\telse throw Error(\"THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: \" + e);\n\t\tfor (let e of t) this.add(e), e.updateMatrixWorld();\n\t}\n\tupdate(e, t) {\n\t\tthis.parent === null && this.updateMatrixWorld();\n\t\tlet { renderTarget: n, activeMipmapLevel: r } = this;\n\t\tthis.coordinateSystem !== e.coordinateSystem && (this.coordinateSystem = e.coordinateSystem, this.updateCoordinateSystem());\n\t\tlet [i, a, o, s, c, l] = this.children, u = e.getRenderTarget(), d = e.getActiveCubeFace(), f = e.getActiveMipmapLevel(), p = e.xr.enabled;\n\t\te.xr.enabled = !1;\n\t\tlet m = n.texture.generateMipmaps;\n\t\tn.texture.generateMipmaps = !1;\n\t\tlet h = !1;\n\t\th = e.isWebGLRenderer === !0 ? e.state.buffers.depth.getReversed() : e.reversedDepthBuffer, e.setRenderTarget(n, 0, r), h && e.autoClear === !1 && e.clearDepth(), e.render(t, i), e.setRenderTarget(n, 1, r), h && e.autoClear === !1 && e.clearDepth(), e.render(t, a), e.setRenderTarget(n, 2, r), h && e.autoClear === !1 && e.clearDepth(), e.render(t, o), e.setRenderTarget(n, 3, r), h && e.autoClear === !1 && e.clearDepth(), e.render(t, s), e.setRenderTarget(n, 4, r), h && e.autoClear === !1 && e.clearDepth(), e.render(t, c), n.texture.generateMipmaps = m, e.setRenderTarget(n, 5, r), h && e.autoClear === !1 && e.clearDepth(), e.render(t, l), e.setRenderTarget(u, d, f), e.xr.enabled = p, n.texture.needsPMREMUpdate = !0;\n\t}\n}, Ua = class extends La {\n\tconstructor(e = []) {\n\t\tsuper(), this.isArrayCamera = !0, this.isMultiViewCamera = !1, this.cameras = e;\n\t}\n}, Wa = \"\\\\[\\\\]\\\\.:\\\\/\", Ga = /* @__PURE__ */ RegExp(\"[\\\\[\\\\]\\\\.:\\\\/]\", \"g\"), Ka = \"[^\\\\[\\\\]\\\\.:\\\\/]\", qa = \"[^\" + Wa.replace(\"\\\\.\", \"\") + \"]\", Ja = /*@__PURE__*/ \"((?:WC+[\\\\/:])*)\".replace(\"WC\", Ka), Ya = /*@__PURE__*/ \"(WCOD+)?\".replace(\"WCOD\", qa), Xa = /*@__PURE__*/ \"(?:\\\\.(WC+)(?:\\\\[(.+)\\\\])?)?\".replace(\"WC\", Ka), Za = /*@__PURE__*/ \"\\\\.(WC+)(?:\\\\[(.+)\\\\])?\".replace(\"WC\", Ka), Qa = RegExp(\"^\" + Ja + Ya + Xa + Za + \"$\"), $a = [\n\t\"material\",\n\t\"materials\",\n\t\"bones\",\n\t\"map\"\n], eo = class {\n\tconstructor(e, t, n) {\n\t\tlet r = n || to.parseTrackName(t);\n\t\tthis._targetGroup = e, this._bindings = e.subscribe_(t, r);\n\t}\n\tgetValue(e, t) {\n\t\tthis.bind();\n\t\tlet n = this._targetGroup.nCachedObjects_, r = this._bindings[n];\n\t\tr !== void 0 && r.getValue(e, t);\n\t}\n\tsetValue(e, t) {\n\t\tlet n = this._bindings;\n\t\tfor (let r = this._targetGroup.nCachedObjects_, i = n.length; r !== i; ++r) n[r].setValue(e, t);\n\t}\n\tbind() {\n\t\tlet e = this._bindings;\n\t\tfor (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t) e[t].bind();\n\t}\n\tunbind() {\n\t\tlet e = this._bindings;\n\t\tfor (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t) e[t].unbind();\n\t}\n}, to = class e {\n\tconstructor(t, n, r) {\n\t\tthis.path = n, this.parsedPath = r || e.parseTrackName(n), this.node = e.findNode(t, this.parsedPath.nodeName), this.rootNode = t, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;\n\t}\n\tstatic create(t, n, r) {\n\t\treturn t && t.isAnimationObjectGroup ? new e.Composite(t, n, r) : new e(t, n, r);\n\t}\n\tstatic sanitizeNodeName(e) {\n\t\treturn e.replace(/\\s/g, \"_\").replace(Ga, \"\");\n\t}\n\tstatic parseTrackName(e) {\n\t\tlet t = Qa.exec(e);\n\t\tif (t === null) throw Error(\"PropertyBinding: Cannot parse trackName: \" + e);\n\t\tlet n = {\n\t\t\tnodeName: t[2],\n\t\t\tobjectName: t[3],\n\t\t\tobjectIndex: t[4],\n\t\t\tpropertyName: t[5],\n\t\t\tpropertyIndex: t[6]\n\t\t}, r = n.nodeName && n.nodeName.lastIndexOf(\".\");\n\t\tif (r !== void 0 && r !== -1) {\n\t\t\tlet e = n.nodeName.substring(r + 1);\n\t\t\t$a.indexOf(e) !== -1 && (n.nodeName = n.nodeName.substring(0, r), n.objectName = e);\n\t\t}\n\t\tif (n.propertyName === null || n.propertyName.length === 0) throw Error(\"PropertyBinding: can not parse propertyName from trackName: \" + e);\n\t\treturn n;\n\t}\n\tstatic findNode(e, t) {\n\t\tif (t === void 0 || t === \"\" || t === \".\" || t === -1 || t === e.name || t === e.uuid) return e;\n\t\tif (e.skeleton) {\n\t\t\tlet n = e.skeleton.getBoneByName(t);\n\t\t\tif (n !== void 0) return n;\n\t\t}\n\t\tif (e.children) {\n\t\t\tlet n = function(e) {\n\t\t\t\tfor (let r = 0; r < e.length; r++) {\n\t\t\t\t\tlet i = e[r];\n\t\t\t\t\tif (i.name === t || i.uuid === t) return i;\n\t\t\t\t\tlet a = n(i.children);\n\t\t\t\t\tif (a) return a;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}, r = n(e.children);\n\t\t\tif (r) return r;\n\t\t}\n\t\treturn null;\n\t}\n\t_getValue_unavailable() {}\n\t_setValue_unavailable() {}\n\t_getValue_direct(e, t) {\n\t\te[t] = this.targetObject[this.propertyName];\n\t}\n\t_getValue_array(e, t) {\n\t\tlet n = this.resolvedProperty;\n\t\tfor (let r = 0, i = n.length; r !== i; ++r) e[t++] = n[r];\n\t}\n\t_getValue_arrayElement(e, t) {\n\t\te[t] = this.resolvedProperty[this.propertyIndex];\n\t}\n\t_getValue_toArray(e, t) {\n\t\tthis.resolvedProperty.toArray(e, t);\n\t}\n\t_setValue_direct(e, t) {\n\t\tthis.targetObject[this.propertyName] = e[t];\n\t}\n\t_setValue_direct_setNeedsUpdate(e, t) {\n\t\tthis.targetObject[this.propertyName] = e[t], this.targetObject.needsUpdate = !0;\n\t}\n\t_setValue_direct_setMatrixWorldNeedsUpdate(e, t) {\n\t\tthis.targetObject[this.propertyName] = e[t], this.targetObject.matrixWorldNeedsUpdate = !0;\n\t}\n\t_setValue_array(e, t) {\n\t\tlet n = this.resolvedProperty;\n\t\tfor (let r = 0, i = n.length; r !== i; ++r) n[r] = e[t++];\n\t}\n\t_setValue_array_setNeedsUpdate(e, t) {\n\t\tlet n = this.resolvedProperty;\n\t\tfor (let r = 0, i = n.length; r !== i; ++r) n[r] = e[t++];\n\t\tthis.targetObject.needsUpdate = !0;\n\t}\n\t_setValue_array_setMatrixWorldNeedsUpdate(e, t) {\n\t\tlet n = this.resolvedProperty;\n\t\tfor (let r = 0, i = n.length; r !== i; ++r) n[r] = e[t++];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = !0;\n\t}\n\t_setValue_arrayElement(e, t) {\n\t\tthis.resolvedProperty[this.propertyIndex] = e[t];\n\t}\n\t_setValue_arrayElement_setNeedsUpdate(e, t) {\n\t\tthis.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.needsUpdate = !0;\n\t}\n\t_setValue_arrayElement_setMatrixWorldNeedsUpdate(e, t) {\n\t\tthis.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.matrixWorldNeedsUpdate = !0;\n\t}\n\t_setValue_fromArray(e, t) {\n\t\tthis.resolvedProperty.fromArray(e, t);\n\t}\n\t_setValue_fromArray_setNeedsUpdate(e, t) {\n\t\tthis.resolvedProperty.fromArray(e, t), this.targetObject.needsUpdate = !0;\n\t}\n\t_setValue_fromArray_setMatrixWorldNeedsUpdate(e, t) {\n\t\tthis.resolvedProperty.fromArray(e, t), this.targetObject.matrixWorldNeedsUpdate = !0;\n\t}\n\t_getValue_unbound(e, t) {\n\t\tthis.bind(), this.getValue(e, t);\n\t}\n\t_setValue_unbound(e, t) {\n\t\tthis.bind(), this.setValue(e, t);\n\t}\n\tbind() {\n\t\tlet t = this.node, n = this.parsedPath, r = n.objectName, i = n.propertyName, a = n.propertyIndex;\n\t\tif (t || (t = e.findNode(this.rootNode, n.nodeName), this.node = t), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !t) {\n\t\t\tH(\"PropertyBinding: No target node found for track: \" + this.path + \".\");\n\t\t\treturn;\n\t\t}\n\t\tif (r) {\n\t\t\tlet e = n.objectIndex;\n\t\t\tswitch (r) {\n\t\t\t\tcase \"materials\":\n\t\t\t\t\tif (!t.material) {\n\t\t\t\t\t\tU(\"PropertyBinding: Can not bind to material as node does not have a material.\", this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!t.material.materials) {\n\t\t\t\t\t\tU(\"PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.\", this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tt = t.material.materials;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"bones\":\n\t\t\t\t\tif (!t.skeleton) {\n\t\t\t\t\t\tU(\"PropertyBinding: Can not bind to bones as node does not have a skeleton.\", this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tt = t.skeleton.bones;\n\t\t\t\t\tfor (let n = 0; n < t.length; n++) if (t[n].name === e) {\n\t\t\t\t\t\te = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"map\":\n\t\t\t\t\tif (\"map\" in t) {\n\t\t\t\t\t\tt = t.map;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!t.material) {\n\t\t\t\t\t\tU(\"PropertyBinding: Can not bind to material as node does not have a material.\", this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!t.material.map) {\n\t\t\t\t\t\tU(\"PropertyBinding: Can not bind to material.map as node.material does not have a map.\", this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tt = t.material.map;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (t[r] === void 0) {\n\t\t\t\t\t\tU(\"PropertyBinding: Can not bind to objectName of node undefined.\", this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tt = t[r];\n\t\t\t}\n\t\t\tif (e !== void 0) {\n\t\t\t\tif (t[e] === void 0) {\n\t\t\t\t\tU(\"PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.\", this, t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tt = t[e];\n\t\t\t}\n\t\t}\n\t\tlet o = t[i];\n\t\tif (o === void 0) {\n\t\t\tlet e = n.nodeName;\n\t\t\tU(\"PropertyBinding: Trying to update property for track: \" + e + \".\" + i + \" but it wasn't found.\", t);\n\t\t\treturn;\n\t\t}\n\t\tlet s = this.Versioning.None;\n\t\tthis.targetObject = t, t.isMaterial === !0 ? s = this.Versioning.NeedsUpdate : t.isObject3D === !0 && (s = this.Versioning.MatrixWorldNeedsUpdate);\n\t\tlet c = this.BindingType.Direct;\n\t\tif (a !== void 0) {\n\t\t\tif (i === \"morphTargetInfluences\") {\n\t\t\t\tif (!t.geometry) {\n\t\t\t\t\tU(\"PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.\", this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!t.geometry.morphAttributes) {\n\t\t\t\t\tU(\"PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.\", this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tt.morphTargetDictionary[a] !== void 0 && (a = t.morphTargetDictionary[a]);\n\t\t\t}\n\t\t\tc = this.BindingType.ArrayElement, this.resolvedProperty = o, this.propertyIndex = a;\n\t\t} else o.fromArray !== void 0 && o.toArray !== void 0 ? (c = this.BindingType.HasFromToArray, this.resolvedProperty = o) : Array.isArray(o) ? (c = this.BindingType.EntireArray, this.resolvedProperty = o) : this.propertyName = i;\n\t\tthis.getValue = this.GetterByBindingType[c], this.setValue = this.SetterByBindingTypeAndVersioning[c][s];\n\t}\n\tunbind() {\n\t\tthis.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;\n\t}\n};\nto.Composite = eo, to.prototype.BindingType = {\n\tDirect: 0,\n\tEntireArray: 1,\n\tArrayElement: 2,\n\tHasFromToArray: 3\n}, to.prototype.Versioning = {\n\tNone: 0,\n\tNeedsUpdate: 1,\n\tMatrixWorldNeedsUpdate: 2\n}, to.prototype.GetterByBindingType = [\n\tto.prototype._getValue_direct,\n\tto.prototype._getValue_array,\n\tto.prototype._getValue_arrayElement,\n\tto.prototype._getValue_toArray\n], to.prototype.SetterByBindingTypeAndVersioning = [\n\t[\n\t\tto.prototype._setValue_direct,\n\t\tto.prototype._setValue_direct_setNeedsUpdate,\n\t\tto.prototype._setValue_direct_setMatrixWorldNeedsUpdate\n\t],\n\t[\n\t\tto.prototype._setValue_array,\n\t\tto.prototype._setValue_array_setNeedsUpdate,\n\t\tto.prototype._setValue_array_setMatrixWorldNeedsUpdate\n\t],\n\t[\n\t\tto.prototype._setValue_arrayElement,\n\t\tto.prototype._setValue_arrayElement_setNeedsUpdate,\n\t\tto.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate\n\t],\n\t[\n\t\tto.prototype._setValue_fromArray,\n\t\tto.prototype._setValue_fromArray_setNeedsUpdate,\n\t\tto.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate\n\t]\n];\nvar no = class {\n\tconstructor(e = 1, t = 0, n = 0) {\n\t\tthis.radius = e, this.phi = t, this.theta = n;\n\t}\n\tset(e, t, n) {\n\t\treturn this.radius = e, this.phi = t, this.theta = n, this;\n\t}\n\tcopy(e) {\n\t\treturn this.radius = e.radius, this.phi = e.phi, this.theta = e.theta, this;\n\t}\n\tmakeSafe() {\n\t\tlet e = 1e-6;\n\t\treturn this.phi = W(this.phi, e, Math.PI - e), this;\n\t}\n\tsetFromVector3(e) {\n\t\treturn this.setFromCartesianCoords(e.x, e.y, e.z);\n\t}\n\tsetFromCartesianCoords(e, t, n) {\n\t\treturn 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(W(t / this.radius, -1, 1))), this;\n\t}\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n};\n(class e {\n\tstatic {\n\t\te.prototype.isMatrix2 = !0;\n\t}\n\tconstructor(e, t, n, r) {\n\t\tthis.elements = [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t], e !== void 0 && this.set(e, t, n, r);\n\t}\n\tidentity() {\n\t\treturn this.set(1, 0, 0, 1), this;\n\t}\n\tfromArray(e, t = 0) {\n\t\tfor (let n = 0; n < 4; n++) this.elements[n] = e[n + t];\n\t\treturn this;\n\t}\n\tset(e, t, n, r) {\n\t\tlet i = this.elements;\n\t\treturn i[0] = e, i[2] = t, i[1] = n, i[3] = r, this;\n\t}\n});\nvar ro = class extends Ft {\n\tconstructor(e, t = null) {\n\t\tsuper(), this.object = e, this.domElement = t, this.enabled = !0, this.state = -1, this.keys = {}, this.mouseButtons = {\n\t\t\tLEFT: null,\n\t\t\tMIDDLE: null,\n\t\t\tRIGHT: null\n\t\t}, this.touches = {\n\t\t\tONE: null,\n\t\t\tTWO: null\n\t\t};\n\t}\n\tconnect(e) {\n\t\tif (e === void 0) {\n\t\t\tH(\"Controls: connect() now requires an element.\");\n\t\t\treturn;\n\t\t}\n\t\tthis.domElement !== null && this.disconnect(), this.domElement = e;\n\t}\n\tdisconnect() {}\n\tdispose() {}\n\tupdate() {}\n};\nfunction io(e, t, n, r) {\n\tlet i = ao(r);\n\tswitch (n) {\n\t\tcase be: return e * t;\n\t\tcase we: return e * t / i.components * i.byteLength;\n\t\tcase Te: return e * t / i.components * i.byteLength;\n\t\tcase Ee: return e * t * 2 / i.components * i.byteLength;\n\t\tcase De: return e * t * 2 / i.components * i.byteLength;\n\t\tcase xe: return e * t * 3 / i.components * i.byteLength;\n\t\tcase Se: return e * t * 4 / i.components * i.byteLength;\n\t\tcase Oe: return e * t * 4 / i.components * i.byteLength;\n\t\tcase ke:\n\t\tcase B: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8;\n\t\tcase Ae:\n\t\tcase V: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16;\n\t\tcase Me:\n\t\tcase Pe: return Math.max(e, 16) * Math.max(t, 8) / 4;\n\t\tcase je:\n\t\tcase Ne: return Math.max(e, 8) * Math.max(t, 8) / 2;\n\t\tcase Fe:\n\t\tcase Ie:\n\t\tcase Re:\n\t\tcase ze: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8;\n\t\tcase Le:\n\t\tcase Be:\n\t\tcase Ve: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16;\n\t\tcase He: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16;\n\t\tcase Ue: return Math.floor((e + 4) / 5) * Math.floor((t + 3) / 4) * 16;\n\t\tcase We: return Math.floor((e + 4) / 5) * Math.floor((t + 4) / 5) * 16;\n\t\tcase Ge: return Math.floor((e + 5) / 6) * Math.floor((t + 4) / 5) * 16;\n\t\tcase Ke: return Math.floor((e + 5) / 6) * Math.floor((t + 5) / 6) * 16;\n\t\tcase qe: return Math.floor((e + 7) / 8) * Math.floor((t + 4) / 5) * 16;\n\t\tcase Je: return Math.floor((e + 7) / 8) * Math.floor((t + 5) / 6) * 16;\n\t\tcase Ye: return Math.floor((e + 7) / 8) * Math.floor((t + 7) / 8) * 16;\n\t\tcase Xe: return Math.floor((e + 9) / 10) * Math.floor((t + 4) / 5) * 16;\n\t\tcase Ze: return Math.floor((e + 9) / 10) * Math.floor((t + 5) / 6) * 16;\n\t\tcase Qe: return Math.floor((e + 9) / 10) * Math.floor((t + 7) / 8) * 16;\n\t\tcase $e: return Math.floor((e + 9) / 10) * Math.floor((t + 9) / 10) * 16;\n\t\tcase et: return Math.floor((e + 11) / 12) * Math.floor((t + 9) / 10) * 16;\n\t\tcase tt: return Math.floor((e + 11) / 12) * Math.floor((t + 11) / 12) * 16;\n\t\tcase nt:\n\t\tcase rt:\n\t\tcase it: return Math.ceil(e / 4) * Math.ceil(t / 4) * 16;\n\t\tcase at:\n\t\tcase ot: return Math.ceil(e / 4) * Math.ceil(t / 4) * 8;\n\t\tcase st:\n\t\tcase ct: return Math.ceil(e / 4) * Math.ceil(t / 4) * 16;\n\t}\n\tthrow Error(`Unable to determine texture byte length for ${n} format.`);\n}\nfunction ao(e) {\n\tswitch (e) {\n\t\tcase se:\n\t\tcase ce: return {\n\t\t\tbyteLength: 1,\n\t\t\tcomponents: 1\n\t\t};\n\t\tcase ue:\n\t\tcase le:\n\t\tcase me: return {\n\t\t\tbyteLength: 2,\n\t\t\tcomponents: 1\n\t\t};\n\t\tcase he:\n\t\tcase ge: return {\n\t\t\tbyteLength: 2,\n\t\t\tcomponents: 4\n\t\t};\n\t\tcase fe:\n\t\tcase de:\n\t\tcase pe: return {\n\t\t\tbyteLength: 4,\n\t\t\tcomponents: 1\n\t\t};\n\t\tcase ve:\n\t\tcase ye: return {\n\t\t\tbyteLength: 4,\n\t\t\tcomponents: 3\n\t\t};\n\t}\n\tthrow Error(`Unknown texture type ${e}.`);\n}\ntypeof __THREE_DEVTOOLS__ < \"u\" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"register\", { detail: { revision: \"184\" } })), typeof window < \"u\" && (window.__THREE__ ? H(\"WARNING: Multiple instances of Three.js being imported.\") : window.__THREE__ = \"184\");\n//#endregion\n//#region ../../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.module.js\nfunction oo() {\n\tlet e = null, t = !1, n = null, r = null;\n\tfunction i(t, a) {\n\t\tn(t, a), r = e.requestAnimationFrame(i);\n\t}\n\treturn {\n\t\tstart: function() {\n\t\t\tt !== !0 && n !== null && e !== null && (r = e.requestAnimationFrame(i), t = !0);\n\t\t},\n\t\tstop: function() {\n\t\t\te !== null && e.cancelAnimationFrame(r), t = !1;\n\t\t},\n\t\tsetAnimationLoop: function(e) {\n\t\t\tn = e;\n\t\t},\n\t\tsetContext: function(t) {\n\t\t\te = t;\n\t\t}\n\t};\n}\nfunction so(e) {\n\tlet t = /* @__PURE__ */ new WeakMap();\n\tfunction n(t, n) {\n\t\tlet r = t.array, i = t.usage, a = r.byteLength, o = e.createBuffer();\n\t\te.bindBuffer(n, o), e.bufferData(n, r, i), t.onUploadCallback();\n\t\tlet s;\n\t\tif (r instanceof Float32Array) s = e.FLOAT;\n\t\telse if (typeof Float16Array < \"u\" && r instanceof Float16Array) s = e.HALF_FLOAT;\n\t\telse if (r instanceof Uint16Array) s = t.isFloat16BufferAttribute ? e.HALF_FLOAT : e.UNSIGNED_SHORT;\n\t\telse if (r instanceof Int16Array) s = e.SHORT;\n\t\telse if (r instanceof Uint32Array) s = e.UNSIGNED_INT;\n\t\telse if (r instanceof Int32Array) s = e.INT;\n\t\telse if (r instanceof Int8Array) s = e.BYTE;\n\t\telse if (r instanceof Uint8Array) s = e.UNSIGNED_BYTE;\n\t\telse if (r instanceof Uint8ClampedArray) s = e.UNSIGNED_BYTE;\n\t\telse throw Error(\"THREE.WebGLAttributes: Unsupported buffer data format: \" + r);\n\t\treturn {\n\t\t\tbuffer: o,\n\t\t\ttype: s,\n\t\t\tbytesPerElement: r.BYTES_PER_ELEMENT,\n\t\t\tversion: t.version,\n\t\t\tsize: a\n\t\t};\n\t}\n\tfunction r(t, n, r) {\n\t\tlet i = n.array, a = n.updateRanges;\n\t\tif (e.bindBuffer(r, t), a.length === 0) e.bufferSubData(r, 0, i);\n\t\telse {\n\t\t\ta.sort((e, t) => e.start - t.start);\n\t\t\tlet t = 0;\n\t\t\tfor (let e = 1; e < a.length; e++) {\n\t\t\t\tlet n = a[t], r = a[e];\n\t\t\t\tr.start <= n.start + n.count + 1 ? n.count = Math.max(n.count, r.start + r.count - n.start) : (++t, a[t] = r);\n\t\t\t}\n\t\t\ta.length = t + 1;\n\t\t\tfor (let t = 0, n = a.length; t < n; t++) {\n\t\t\t\tlet n = a[t];\n\t\t\t\te.bufferSubData(r, n.start * i.BYTES_PER_ELEMENT, i, n.start, n.count);\n\t\t\t}\n\t\t\tn.clearUpdateRanges();\n\t\t}\n\t\tn.onUploadCallback();\n\t}\n\tfunction i(e) {\n\t\treturn e.isInterleavedBufferAttribute && (e = e.data), t.get(e);\n\t}\n\tfunction a(n) {\n\t\tn.isInterleavedBufferAttribute && (n = n.data);\n\t\tlet r = t.get(n);\n\t\tr && (e.deleteBuffer(r.buffer), t.delete(n));\n\t}\n\tfunction o(e, i) {\n\t\tif (e.isInterleavedBufferAttribute && (e = e.data), e.isGLBufferAttribute) {\n\t\t\tlet n = t.get(e);\n\t\t\t(!n || n.version < e.version) && t.set(e, {\n\t\t\t\tbuffer: e.buffer,\n\t\t\t\ttype: e.type,\n\t\t\t\tbytesPerElement: e.elementSize,\n\t\t\t\tversion: e.version\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tlet a = t.get(e);\n\t\tif (a === void 0) t.set(e, n(e, i));\n\t\telse if (a.version < e.version) {\n\t\t\tif (a.size !== e.array.byteLength) throw 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\t\t\tr(a.buffer, e, i), a.version = e.version;\n\t\t}\n\t}\n\treturn {\n\t\tget: i,\n\t\tremove: a,\n\t\tupdate: o\n\t};\n}\nvar Y = {\n\talphahash_fragment: \"#ifdef USE_ALPHAHASH\\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\\n#endif\",\n\talphahash_pars_fragment: \"#ifdef USE_ALPHAHASH\\n\tconst float ALPHA_HASH_SCALE = 0.05;\\n\tfloat hash2D( vec2 value ) {\\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\\n\t}\\n\tfloat hash3D( vec3 value ) {\\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\\n\t}\\n\tfloat getAlphaHashThreshold( vec3 position ) {\\n\t\tfloat maxDeriv = max(\\n\t\t\tlength( dFdx( position.xyz ) ),\\n\t\t\tlength( dFdy( position.xyz ) )\\n\t\t);\\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\\n\t\tvec2 pixScales = vec2(\\n\t\t\texp2( floor( log2( pixScale ) ) ),\\n\t\t\texp2( ceil( log2( pixScale ) ) )\\n\t\t);\\n\t\tvec2 alpha = vec2(\\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\\n\t\t);\\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\\n\t\tvec3 cases = vec3(\\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\\n\t\t);\\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\\n\t\t\t: cases.z;\\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\\n\t}\\n#endif\",\n\talphamap_fragment: \"#ifdef USE_ALPHAMAP\\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\\n#endif\",\n\talphamap_pars_fragment: \"#ifdef USE_ALPHAMAP\\n\tuniform sampler2D alphaMap;\\n#endif\",\n\talphatest_fragment: \"#ifdef USE_ALPHATEST\\n\t#ifdef ALPHA_TO_COVERAGE\\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\\n\tif ( diffuseColor.a == 0.0 ) discard;\\n\t#else\\n\tif ( diffuseColor.a < alphaTest ) discard;\\n\t#endif\\n#endif\",\n\talphatest_pars_fragment: \"#ifdef USE_ALPHATEST\\n\tuniform float alphaTest;\\n#endif\",\n\taomap_fragment: \"#ifdef USE_AOMAP\\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\t#if defined( USE_CLEARCOAT ) \\n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\\n\t#endif\\n\t#if defined( USE_SHEEN ) \\n\t\tsheenSpecularIndirect *= ambientOcclusion;\\n\t#endif\\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\t#endif\\n#endif\",\n\taomap_pars_fragment: \"#ifdef USE_AOMAP\\n\tuniform sampler2D aoMap;\\n\tuniform float aoMapIntensity;\\n#endif\",\n\tbatching_pars_vertex: \"#ifdef USE_BATCHING\\n\t#if ! defined( GL_ANGLE_multi_draw )\\n\t#define gl_DrawID _gl_DrawID\\n\tuniform int _gl_DrawID;\\n\t#endif\\n\tuniform highp sampler2D batchingTexture;\\n\tuniform highp usampler2D batchingIdTexture;\\n\tmat4 getBatchingMatrix( const in float i ) {\\n\t\tint size = textureSize( batchingTexture, 0 ).x;\\n\t\tint j = int( i ) * 4;\\n\t\tint x = j % size;\\n\t\tint y = j / size;\\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\\n\t\treturn mat4( v1, v2, v3, v4 );\\n\t}\\n\tfloat getIndirectIndex( const in int i ) {\\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\\n\t\tint x = i % size;\\n\t\tint y = i / size;\\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\\n\t}\\n#endif\\n#ifdef USE_BATCHING_COLOR\\n\tuniform sampler2D batchingColorTexture;\\n\tvec4 getBatchingColor( const in float i ) {\\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\\n\t\tint j = int( i );\\n\t\tint x = j % size;\\n\t\tint y = j / size;\\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 );\\n\t}\\n#endif\",\n\tbatching_vertex: \"#ifdef USE_BATCHING\\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\\n#endif\",\n\tbegin_vertex: \"vec3 transformed = vec3( position );\\n#ifdef USE_ALPHAHASH\\n\tvPosition = vec3( position );\\n#endif\",\n\tbeginnormal_vertex: \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\",\n\tbsdfs: \"float G_BlinnPhong_Implicit( ) {\\n\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\tvec3 halfDir = normalize( lightDir + viewDir );\\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\tfloat G = G_BlinnPhong_Implicit( );\\n\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\treturn F * ( G * D );\\n} // validated\",\n\tiridescence_fragment: \"#ifdef USE_IRIDESCENCE\\n\tconst mat3 XYZ_TO_REC709 = mat3(\\n\t\t 3.2404542, -0.9692660,  0.0556434,\\n\t\t-1.5371385,  1.8760108, -0.2040259,\\n\t\t-0.4985314,  0.0415560,  1.0572252\\n\t);\\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\\n\t}\\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\\n\t}\\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\\n\t}\\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\\n\t\txyz /= 1.0685e-7;\\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\\n\t\treturn rgb;\\n\t}\\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\\n\t\tvec3 I;\\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\\n\t\tif ( cosTheta2Sq < 0.0 ) {\\n\t\t\treturn vec3( 1.0 );\\n\t\t}\\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\\n\t\tfloat T121 = 1.0 - R12;\\n\t\tfloat phi12 = 0.0;\\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\\n\t\tfloat phi21 = PI - phi12;\\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\\n\t\tvec3 phi23 = vec3( 0.0 );\\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\\n\t\tvec3 phi = vec3( phi21 ) + phi23;\\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\\n\t\tvec3 r123 = sqrt( R123 );\\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\\n\t\tvec3 C0 = R12 + Rs;\\n\t\tI = C0;\\n\t\tvec3 Cm = Rs - T121;\\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\\n\t\t\tCm *= r123;\\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\\n\t\t\tI += Cm * Sm;\\n\t\t}\\n\t\treturn max( I, vec3( 0.0 ) );\\n\t}\\n#endif\",\n\tbumpmap_pars_fragment: \"#ifdef USE_BUMPMAP\\n\tuniform sampler2D bumpMap;\\n\tuniform float bumpScale;\\n\tvec2 dHdxy_fwd() {\\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\\n\t\treturn vec2( dBx, dBy );\\n\t}\\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\\n\t\tvec3 vN = surf_norm;\\n\t\tvec3 R1 = cross( vSigmaY, vN );\\n\t\tvec3 R2 = cross( vN, vSigmaX );\\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\t}\\n#endif\",\n\tclipping_planes_fragment: \"#if NUM_CLIPPING_PLANES > 0\\n\tvec4 plane;\\n\t#ifdef ALPHA_TO_COVERAGE\\n\t\tfloat distanceToPlane, distanceGradient;\\n\t\tfloat clipOpacity = 1.0;\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\t\t\tplane = clippingPlanes[ i ];\\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\t\t\tif ( clipOpacity == 0.0 ) discard;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\t\t\tfloat unionClipOpacity = 1.0;\\n\t\t\t#pragma unroll_loop_start\\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\t\t\t\tplane = clippingPlanes[ i ];\\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\t\t\t}\\n\t\t\t#pragma unroll_loop_end\\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\\n\t\t#endif\\n\t\tdiffuseColor.a *= clipOpacity;\\n\t\tif ( diffuseColor.a == 0.0 ) discard;\\n\t#else\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\t\t\tplane = clippingPlanes[ i ];\\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\t\t\tbool clipped = true;\\n\t\t\t#pragma unroll_loop_start\\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\t\t\t\tplane = clippingPlanes[ i ];\\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\t\t\t}\\n\t\t\t#pragma unroll_loop_end\\n\t\t\tif ( clipped ) discard;\\n\t\t#endif\\n\t#endif\\n#endif\",\n\tclipping_planes_pars_fragment: \"#if NUM_CLIPPING_PLANES > 0\\n\tvarying vec3 vClipPosition;\\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\",\n\tclipping_planes_pars_vertex: \"#if NUM_CLIPPING_PLANES > 0\\n\tvarying vec3 vClipPosition;\\n#endif\",\n\tclipping_planes_vertex: \"#if NUM_CLIPPING_PLANES > 0\\n\tvClipPosition = - mvPosition.xyz;\\n#endif\",\n\tcolor_fragment: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\\n\tdiffuseColor *= vColor;\\n#endif\",\n\tcolor_pars_fragment: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\\n\tvarying vec4 vColor;\\n#endif\",\n\tcolor_pars_vertex: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\\n\tvarying vec4 vColor;\\n#endif\",\n\tcolor_vertex: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\\n\tvColor = vec4( 1.0 );\\n#endif\\n#ifdef USE_COLOR_ALPHA\\n\tvColor *= color;\\n#elif defined( USE_COLOR )\\n\tvColor.rgb *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\tvColor.rgb *= instanceColor.rgb;\\n#endif\\n#ifdef USE_BATCHING_COLOR\\n\tvColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );\\n#endif\",\n\tcommon: \"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nvec3 pow2( const in vec3 x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\tfloat precisionSafeLength( vec3 v ) {\\n\t\tfloat maxComponent = max3( abs( v ) );\\n\t\treturn length( v / maxComponent ) * maxComponent;\\n\t}\\n#endif\\nstruct IncidentLight {\\n\tvec3 color;\\n\tvec3 direction;\\n\tbool visible;\\n};\\nstruct ReflectedLight {\\n\tvec3 directDiffuse;\\n\tvec3 directSpecular;\\n\tvec3 indirectDiffuse;\\n\tvec3 indirectSpecular;\\n};\\n#ifdef USE_ALPHAHASH\\n\tvarying vec3 vPosition;\\n#endif\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\treturn vec2( u, v );\\n}\\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n} // validated\",\n\tcube_uv_reflection_fragment: \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\t#define cubeUV_minMipLevel 4.0\\n\t#define cubeUV_minTileSize 16.0\\n\tfloat getFace( vec3 direction ) {\\n\t\tvec3 absDirection = abs( direction );\\n\t\tfloat face = - 1.0;\\n\t\tif ( absDirection.x > absDirection.z ) {\\n\t\t\tif ( absDirection.x > absDirection.y )\\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\t\t\telse\\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\t\t} else {\\n\t\t\tif ( absDirection.z > absDirection.y )\\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\t\t\telse\\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\t\t}\\n\t\treturn face;\\n\t}\\n\tvec2 getUV( vec3 direction, float face ) {\\n\t\tvec2 uv;\\n\t\tif ( face == 0.0 ) {\\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\t\t} else if ( face == 1.0 ) {\\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\t\t} else if ( face == 2.0 ) {\\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\t\t} else if ( face == 3.0 ) {\\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\t\t} else if ( face == 4.0 ) {\\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\t\t} else {\\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\t\t}\\n\t\treturn 0.5 * ( uv + 1.0 );\\n\t}\\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\t\tfloat face = getFace( direction );\\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\t\tfloat faceSize = exp2( mipInt );\\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\\n\t\tif ( face > 2.0 ) {\\n\t\t\tuv.y += faceSize;\\n\t\t\tface -= 3.0;\\n\t\t}\\n\t\tuv.x += face * faceSize;\\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\\n\t\t#ifdef texture2DGradEXT\\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\\n\t\t#else\\n\t\t\treturn texture2D( envMap, uv ).rgb;\\n\t\t#endif\\n\t}\\n\t#define cubeUV_r0 1.0\\n\t#define cubeUV_m0 - 2.0\\n\t#define cubeUV_r1 0.8\\n\t#define cubeUV_m1 - 1.0\\n\t#define cubeUV_r4 0.4\\n\t#define cubeUV_m4 2.0\\n\t#define cubeUV_r5 0.305\\n\t#define cubeUV_m5 3.0\\n\t#define cubeUV_r6 0.21\\n\t#define cubeUV_m6 4.0\\n\tfloat roughnessToMip( float roughness ) {\\n\t\tfloat mip = 0.0;\\n\t\tif ( roughness >= cubeUV_r1 ) {\\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\\n\t\t} else if ( roughness >= cubeUV_r4 ) {\\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\\n\t\t} else if ( roughness >= cubeUV_r5 ) {\\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\\n\t\t} else if ( roughness >= cubeUV_r6 ) {\\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\\n\t\t} else {\\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\\n\t\treturn mip;\\n\t}\\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\\n\t\tfloat mipF = fract( mip );\\n\t\tfloat mipInt = floor( mip );\\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\t\tif ( mipF == 0.0 ) {\\n\t\t\treturn vec4( color0, 1.0 );\\n\t\t} else {\\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\t\t}\\n\t}\\n#endif\",\n\tdefaultnormal_vertex: \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_TANGENT\\n\tvec3 transformedTangent = objectTangent;\\n#endif\\n#ifdef USE_BATCHING\\n\tmat3 bm = mat3( batchingMatrix );\\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\\n\ttransformedNormal = bm * transformedNormal;\\n\t#ifdef USE_TANGENT\\n\t\ttransformedTangent = bm * transformedTangent;\\n\t#endif\\n#endif\\n#ifdef USE_INSTANCING\\n\tmat3 im = mat3( instanceMatrix );\\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\\n\ttransformedNormal = im * transformedNormal;\\n\t#ifdef USE_TANGENT\\n\t\ttransformedTangent = im * transformedTangent;\\n\t#endif\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\\n\t#ifdef FLIP_SIDED\\n\t\ttransformedTangent = - transformedTangent;\\n\t#endif\\n#endif\",\n\tdisplacementmap_pars_vertex: \"#ifdef USE_DISPLACEMENTMAP\\n\tuniform sampler2D displacementMap;\\n\tuniform float displacementScale;\\n\tuniform float displacementBias;\\n#endif\",\n\tdisplacementmap_vertex: \"#ifdef USE_DISPLACEMENTMAP\\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\\n#endif\",\n\temissivemap_fragment: \"#ifdef USE_EMISSIVEMAP\\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\\n\t#endif\\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\",\n\temissivemap_pars_fragment: \"#ifdef USE_EMISSIVEMAP\\n\tuniform sampler2D emissiveMap;\\n#endif\",\n\tcolorspace_fragment: \"gl_FragColor = linearToOutputTexel( gl_FragColor );\",\n\tcolorspace_pars_fragment: \"vec4 LinearTransferOETF( in vec4 value ) {\\n\treturn value;\\n}\\nvec4 sRGBTransferEOTF( in vec4 value ) {\\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\\n}\\nvec4 sRGBTransferOETF( in vec4 value ) {\\n\treturn 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 );\\n}\",\n\tenvmap_fragment: \"#ifdef USE_ENVMAP\\n\t#ifdef ENV_WORLDPOS\\n\t\tvec3 cameraToFrag;\\n\t\tif ( isOrthographic ) {\\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\t\t} else {\\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\t\t}\\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\t\t#ifdef ENVMAP_MODE_REFLECTION\\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\t\t#else\\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\t\t#endif\\n\t#else\\n\t\tvec3 reflectVec = vReflect;\\n\t#endif\\n\t#ifdef ENVMAP_TYPE_CUBE\\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * reflectVec );\\n\t\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\t\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\t\t#elif defined( ENVMAP_BLENDING_MIX )\\n\t\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\t\t#elif defined( ENVMAP_BLENDING_ADD )\\n\t\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\t\t#endif\\n\t#endif\\n#endif\",\n\tenvmap_common_pars_fragment: \"#ifdef USE_ENVMAP\\n\tuniform float envMapIntensity;\\n\tuniform mat3 envMapRotation;\\n\t#ifdef ENVMAP_TYPE_CUBE\\n\t\tuniform samplerCube envMap;\\n\t#else\\n\t\tuniform sampler2D envMap;\\n\t#endif\\n#endif\",\n\tenvmap_pars_fragment: \"#ifdef USE_ENVMAP\\n\tuniform float reflectivity;\\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\t\t#define ENV_WORLDPOS\\n\t#endif\\n\t#ifdef ENV_WORLDPOS\\n\t\tvarying vec3 vWorldPosition;\\n\t\tuniform float refractionRatio;\\n\t#else\\n\t\tvarying vec3 vReflect;\\n\t#endif\\n#endif\",\n\tenvmap_pars_vertex: \"#ifdef USE_ENVMAP\\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\t\t#define ENV_WORLDPOS\\n\t#endif\\n\t#ifdef ENV_WORLDPOS\\n\t\t\\n\t\tvarying vec3 vWorldPosition;\\n\t#else\\n\t\tvarying vec3 vReflect;\\n\t\tuniform float refractionRatio;\\n\t#endif\\n#endif\",\n\tenvmap_physical_pars_fragment: \"#ifdef USE_ENVMAP\\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\\n\t\t#else\\n\t\t\treturn vec3( 0.0 );\\n\t\t#endif\\n\t}\\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\\n\t\t\treflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\\n\t\t\treturn envMapColor.rgb * envMapIntensity;\\n\t\t#else\\n\t\t\treturn vec3( 0.0 );\\n\t\t#endif\\n\t}\\n\t#ifdef USE_ANISOTROPY\\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\\n\t\t\t#else\\n\t\t\t\treturn vec3( 0.0 );\\n\t\t\t#endif\\n\t\t}\\n\t#endif\\n#endif\",\n\tenvmap_vertex: \"#ifdef USE_ENVMAP\\n\t#ifdef ENV_WORLDPOS\\n\t\tvWorldPosition = worldPosition.xyz;\\n\t#else\\n\t\tvec3 cameraToVertex;\\n\t\tif ( isOrthographic ) {\\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\t\t} else {\\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\t\t}\\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\t\t#ifdef ENVMAP_MODE_REFLECTION\\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\\n\t\t#else\\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\t\t#endif\\n\t#endif\\n#endif\",\n\tfog_vertex: \"#ifdef USE_FOG\\n\tvFogDepth = - mvPosition.z;\\n#endif\",\n\tfog_pars_vertex: \"#ifdef USE_FOG\\n\tvarying float vFogDepth;\\n#endif\",\n\tfog_fragment: \"#ifdef USE_FOG\\n\t#ifdef FOG_EXP2\\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\t#else\\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\t#endif\\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\",\n\tfog_pars_fragment: \"#ifdef USE_FOG\\n\tuniform vec3 fogColor;\\n\tvarying float vFogDepth;\\n\t#ifdef FOG_EXP2\\n\t\tuniform float fogDensity;\\n\t#else\\n\t\tuniform float fogNear;\\n\t\tuniform float fogFar;\\n\t#endif\\n#endif\",\n\tgradientmap_pars_fragment: \"#ifdef USE_GRADIENTMAP\\n\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\tfloat dotNL = dot( normal, lightDirection );\\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\t#ifdef USE_GRADIENTMAP\\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\\n\t#else\\n\t\tvec2 fw = fwidth( coord ) * 0.5;\\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\\n\t#endif\\n}\",\n\tlightmap_pars_fragment: \"#ifdef USE_LIGHTMAP\\n\tuniform sampler2D lightMap;\\n\tuniform float lightMapIntensity;\\n#endif\",\n\tlights_lambert_fragment: \"LambertMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularStrength = specularStrength;\",\n\tlights_lambert_pars_fragment: \"varying vec3 vViewPosition;\\nstruct LambertMaterial {\\n\tvec3 diffuseColor;\\n\tfloat specularStrength;\\n};\\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\tvec3 irradiance = dotNL * directLight.color;\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\",\n\tlights_pars_begin: \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\n#if defined( USE_LIGHT_PROBES )\\n\tuniform vec3 lightProbe[ 9 ];\\n#endif\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\tvec3 irradiance = ambientLightColor;\\n\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\tif ( cutoffDistance > 0.0 ) {\\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\t}\\n\treturn distanceFalloff;\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\tstruct DirectionalLight {\\n\t\tvec3 direction;\\n\t\tvec3 color;\\n\t};\\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\\n\t\tlight.color = directionalLight.color;\\n\t\tlight.direction = directionalLight.direction;\\n\t\tlight.visible = true;\\n\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\tstruct PointLight {\\n\t\tvec3 position;\\n\t\tvec3 color;\\n\t\tfloat distance;\\n\t\tfloat decay;\\n\t};\\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\t\tvec3 lVector = pointLight.position - geometryPosition;\\n\t\tlight.direction = normalize( lVector );\\n\t\tfloat lightDistance = length( lVector );\\n\t\tlight.color = pointLight.color;\\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\tstruct SpotLight {\\n\t\tvec3 position;\\n\t\tvec3 direction;\\n\t\tvec3 color;\\n\t\tfloat distance;\\n\t\tfloat decay;\\n\t\tfloat coneCos;\\n\t\tfloat penumbraCos;\\n\t};\\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\t\tvec3 lVector = spotLight.position - geometryPosition;\\n\t\tlight.direction = normalize( lVector );\\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\t\tif ( spotAttenuation > 0.0 ) {\\n\t\t\tfloat lightDistance = length( lVector );\\n\t\t\tlight.color = spotLight.color * spotAttenuation;\\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\t\t} else {\\n\t\t\tlight.color = vec3( 0.0 );\\n\t\t\tlight.visible = false;\\n\t\t}\\n\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\tstruct RectAreaLight {\\n\t\tvec3 color;\\n\t\tvec3 position;\\n\t\tvec3 halfWidth;\\n\t\tvec3 halfHeight;\\n\t};\\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\tstruct HemisphereLight {\\n\t\tvec3 direction;\\n\t\tvec3 skyColor;\\n\t\tvec3 groundColor;\\n\t};\\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\t\treturn irradiance;\\n\t}\\n#endif\\n#include <lightprobes_pars_fragment>\",\n\tlights_toon_fragment: \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\",\n\tlights_toon_pars_fragment: \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\",\n\tlights_phong_fragment: \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\",\n\tlights_phong_pars_fragment: \"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\tvec3 diffuseColor;\\n\tvec3 specularColor;\\n\tfloat specularShininess;\\n\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\tvec3 irradiance = dotNL * directLight.color;\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\",\n\tlights_physical_fragment: \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nmaterial.metalness = metalnessFactor;\\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\tmaterial.ior = ior;\\n\t#ifdef USE_SPECULAR\\n\t\tfloat specularIntensityFactor = specularIntensity;\\n\t\tvec3 specularColorFactor = specularColor;\\n\t\t#ifdef USE_SPECULAR_COLORMAP\\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\\n\t\t#endif\\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\\n\t\t#endif\\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\t#else\\n\t\tfloat specularIntensityFactor = 1.0;\\n\t\tvec3 specularColorFactor = vec3( 1.0 );\\n\t\tmaterial.specularF90 = 1.0;\\n\t#endif\\n\tmaterial.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\tmaterial.specularColor = vec3( 0.04 );\\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\\n\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\tmaterial.clearcoat = clearcoat;\\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\tmaterial.clearcoatF90 = 1.0;\\n\t#ifdef USE_CLEARCOATMAP\\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\\n\t#endif\\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\\n\t#endif\\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\tmaterial.clearcoatRoughness += geometryRoughness;\\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_DISPERSION\\n\tmaterial.dispersion = dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\tmaterial.iridescence = iridescence;\\n\tmaterial.iridescenceIOR = iridescenceIOR;\\n\t#ifdef USE_IRIDESCENCEMAP\\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\\n\t#endif\\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\\n\t#else\\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\\n\t#endif\\n#endif\\n#ifdef USE_SHEEN\\n\tmaterial.sheenColor = sheenColor;\\n\t#ifdef USE_SHEEN_COLORMAP\\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\\n\t#endif\\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\\n\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\t#ifdef USE_ANISOTROPYMAP\\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\\n\t#else\\n\t\tvec2 anisotropyV = anisotropyVector;\\n\t#endif\\n\tmaterial.anisotropy = length( anisotropyV );\\n\tif( material.anisotropy == 0.0 ) {\\n\t\tanisotropyV = vec2( 1.0, 0.0 );\\n\t} else {\\n\t\tanisotropyV /= material.anisotropy;\\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\\n\t}\\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\\n#endif\",\n\tlights_physical_pars_fragment: \"uniform sampler2D dfgLUT;\\nstruct PhysicalMaterial {\\n\tvec3 diffuseColor;\\n\tvec3 diffuseContribution;\\n\tvec3 specularColor;\\n\tvec3 specularColorBlended;\\n\tfloat roughness;\\n\tfloat metalness;\\n\tfloat specularF90;\\n\tfloat dispersion;\\n\t#ifdef USE_CLEARCOAT\\n\t\tfloat clearcoat;\\n\t\tfloat clearcoatRoughness;\\n\t\tvec3 clearcoatF0;\\n\t\tfloat clearcoatF90;\\n\t#endif\\n\t#ifdef USE_IRIDESCENCE\\n\t\tfloat iridescence;\\n\t\tfloat iridescenceIOR;\\n\t\tfloat iridescenceThickness;\\n\t\tvec3 iridescenceFresnel;\\n\t\tvec3 iridescenceF0;\\n\t\tvec3 iridescenceFresnelDielectric;\\n\t\tvec3 iridescenceFresnelMetallic;\\n\t#endif\\n\t#ifdef USE_SHEEN\\n\t\tvec3 sheenColor;\\n\t\tfloat sheenRoughness;\\n\t#endif\\n\t#ifdef IOR\\n\t\tfloat ior;\\n\t#endif\\n\t#ifdef USE_TRANSMISSION\\n\t\tfloat transmission;\\n\t\tfloat transmissionAlpha;\\n\t\tfloat thickness;\\n\t\tfloat attenuationDistance;\\n\t\tvec3 attenuationColor;\\n\t#endif\\n\t#ifdef USE_ANISOTROPY\\n\t\tfloat anisotropy;\\n\t\tfloat alphaT;\\n\t\tvec3 anisotropyT;\\n\t\tvec3 anisotropyB;\\n\t#endif\\n};\\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\\nvec3 sheenSpecularDirect = vec3( 0.0 );\\nvec3 sheenSpecularIndirect = vec3(0.0 );\\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\\n    float x2 = x * x;\\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\tfloat a2 = pow2( alpha );\\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\tfloat a2 = pow2( alpha );\\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\n#ifdef USE_ANISOTROPY\\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\\n\t\treturn 0.5 / max( gv + gl, EPSILON );\\n\t}\\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\\n\t\tfloat a2 = alphaT * alphaB;\\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\\n\t\thighp float v2 = dot( v, v );\\n\t\tfloat w2 = a2 / v2;\\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\\n\t}\\n#endif\\n#ifdef USE_CLEARCOAT\\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\\n\t\tvec3 f0 = material.clearcoatF0;\\n\t\tfloat f90 = material.clearcoatF90;\\n\t\tfloat roughness = material.clearcoatRoughness;\\n\t\tfloat alpha = pow2( roughness );\\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\t\tfloat D = D_GGX( alpha, dotNH );\\n\t\treturn F * ( V * D );\\n\t}\\n#endif\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\\n\tvec3 f0 = material.specularColorBlended;\\n\tfloat f90 = material.specularF90;\\n\tfloat roughness = material.roughness;\\n\tfloat alpha = pow2( roughness );\\n\tvec3 halfDir = normalize( lightDir + viewDir );\\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\t#ifdef USE_IRIDESCENCE\\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\\n\t#endif\\n\t#ifdef USE_ANISOTROPY\\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\\n\t#else\\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\t\tfloat D = D_GGX( alpha, dotNH );\\n\t#endif\\n\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\tconst float LUT_SIZE = 64.0;\\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\tfloat dotNV = saturate( dot( N, V ) );\\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\tfloat l = length( f );\\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\tfloat x = dot( v1, v2 );\\n\tfloat y = abs( x );\\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\tfloat v = a / b;\\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\tvec3 lightNormal = cross( v1, v2 );\\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\tvec3 T1, T2;\\n\tT1 = normalize( V - N * dot( V, N ) );\\n\tT2 = - cross( N, T1 );\\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\\n\tvec3 coords[ 4 ];\\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\tvec3 vectorFormFactor = vec3( 0.0 );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\treturn vec3( result );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\tfloat alpha = pow2( roughness );\\n\tfloat invAlpha = 1.0 / alpha;\\n\tfloat cos2h = dotNH * dotNH;\\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\\n\tvec3 halfDir = normalize( lightDir + viewDir );\\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\tfloat V = V_Neubelt( dotNV, dotNL );\\n\treturn sheenColor * ( D * V );\\n}\\n#endif\\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tfloat r2 = roughness * roughness;\\n\tfloat rInv = 1.0 / ( roughness + 0.1 );\\n\tfloat a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\\n\tfloat b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\\n\tfloat DG = exp( a * dotNV + b );\\n\treturn saturate( DG );\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\\n\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\n#ifdef USE_IRIDESCENCE\\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#else\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#endif\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\\n\t#ifdef USE_IRIDESCENCE\\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\\n\t#else\\n\t\tvec3 Fr = specularColor;\\n\t#endif\\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\\n\tfloat Ess = fab.x + fab.y;\\n\tfloat Ems = 1.0 - Ess;\\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\tsingleScatter += FssEss;\\n\tmultiScatter += Fms * Ems;\\n}\\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\\n\tvec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tvec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\\n\tvec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\\n\tvec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\\n\tvec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\\n\tfloat Ess_V = dfgV.x + dfgV.y;\\n\tfloat Ess_L = dfgL.x + dfgL.y;\\n\tfloat Ems_V = 1.0 - Ess_V;\\n\tfloat Ems_L = 1.0 - Ess_L;\\n\tvec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\\n\tvec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\\n\tfloat compensationFactor = Ems_V * Ems_L;\\n\tvec3 multiScatter = Fms * compensationFactor;\\n\treturn singleScatter + multiScatter;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\t\tvec3 normal = geometryNormal;\\n\t\tvec3 viewDir = geometryViewDir;\\n\t\tvec3 position = geometryPosition;\\n\t\tvec3 lightPos = rectAreaLight.position;\\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\t\tvec3 lightColor = rectAreaLight.color;\\n\t\tfloat roughness = material.roughness;\\n\t\tvec3 rectCoords[ 4 ];\\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\t\tvec4 t1 = texture2D( ltc_1, uv );\\n\t\tvec4 t2 = texture2D( ltc_2, uv );\\n\t\tmat3 mInv = mat3(\\n\t\t\tvec3( t1.x, 0, t1.y ),\\n\t\t\tvec3(    0, 1,    0 ),\\n\t\t\tvec3( t1.z, 0, t1.w )\\n\t\t);\\n\t\tvec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\t\t#ifdef USE_CLEARCOAT\\n\t\t\tvec3 Ncc = geometryClearcoatNormal;\\n\t\t\tvec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\\n\t\t\tvec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\\n\t\t\tvec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\\n\t\t\tmat3 mInvClearcoat = mat3(\\n\t\t\t\tvec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\\n\t\t\t\tvec3(             0, 1,             0 ),\\n\t\t\t\tvec3( t1Clearcoat.z, 0, t1Clearcoat.w )\\n\t\t\t);\\n\t\t\tvec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\\n\t\t\tclearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\\n\t\t#endif\\n\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\tvec3 irradiance = dotNL * directLight.color;\\n\t#ifdef USE_CLEARCOAT\\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\\n\t#endif\\n\t#ifdef USE_SHEEN\\n \\n \t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\\n \\n \t\tfloat sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n \t\tfloat sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\\n \\n \t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\\n \\n \t\tirradiance *= sheenEnergyComp;\\n \\n \t#endif\\n\treflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\tvec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\\n\t#ifdef USE_SHEEN\\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\\n\t\tdiffuse *= sheenEnergyComp;\\n\t#endif\\n\treflectedLight.indirectDiffuse += diffuse;\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\t#ifdef USE_CLEARCOAT\\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\t#endif\\n\t#ifdef USE_SHEEN\\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\\n \t#endif\\n\tvec3 singleScatteringDielectric = vec3( 0.0 );\\n\tvec3 multiScatteringDielectric = vec3( 0.0 );\\n\tvec3 singleScatteringMetallic = vec3( 0.0 );\\n\tvec3 multiScatteringMetallic = vec3( 0.0 );\\n\t#ifdef USE_IRIDESCENCE\\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\\n\t#else\\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\\n\t#endif\\n\tvec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\\n\tvec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\\n\tvec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\\n\tvec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\tvec3 indirectSpecular = radiance * singleScattering;\\n\tindirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\tvec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\\n\t#ifdef USE_SHEEN\\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\\n\t\tindirectSpecular *= sheenEnergyComp;\\n\t\tindirectDiffuse *= sheenEnergyComp;\\n\t#endif\\n\treflectedLight.indirectSpecular += indirectSpecular;\\n\treflectedLight.indirectDiffuse += indirectDiffuse;\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Physical\\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\",\n\tlights_fragment_begin: \"\\nvec3 geometryPosition = - vViewPosition;\\nvec3 geometryNormal = normal;\\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\nvec3 geometryClearcoatNormal = vec3( 0.0 );\\n#ifdef USE_CLEARCOAT\\n\tgeometryClearcoatNormal = clearcoatNormal;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\\n\tif ( material.iridescenceThickness == 0.0 ) {\\n\t\tmaterial.iridescence = 0.0;\\n\t} else {\\n\t\tmaterial.iridescence = saturate( material.iridescence );\\n\t}\\n\tif ( material.iridescence > 0.0 ) {\\n\t\tmaterial.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\\n\t\tmaterial.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\\n\t\tmaterial.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\\n\t}\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\tPointLight pointLight;\\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\tPointLightShadow pointLightShadow;\\n\t#endif\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\t\tpointLight = pointLights[ i ];\\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\\n\t\tpointLightShadow = pointLightShadows[ i ];\\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\t\t#endif\\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\tSpotLight spotLight;\\n\tvec4 spotColor;\\n\tvec3 spotLightCoord;\\n\tbool inSpotLightMap;\\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\tSpotLightShadow spotLightShadow;\\n\t#endif\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\t\tspotLight = spotLights[ i ];\\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\\n\t\t#else\\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\t\t#endif\\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\\n\t\t#endif\\n\t\t#undef SPOT_LIGHT_MAP_INDEX\\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\t\tspotLightShadow = spotLightShadows[ i ];\\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\t\t#endif\\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\tDirectionalLight directionalLight;\\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\tDirectionalLightShadow directionalLightShadow;\\n\t#endif\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\t\tdirectionalLight = directionalLights[ i ];\\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\t\t#endif\\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\tRectAreaLight rectAreaLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\t\trectAreaLight = rectAreaLights[ i ];\\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\tvec3 iblIrradiance = vec3( 0.0 );\\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\t#if defined( USE_LIGHT_PROBES )\\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\\n\t#endif\\n\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t#endif\\n\t#ifdef USE_LIGHT_PROBES_GRID\\n\t\tvec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;\\n\t\tvec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix );\\n\t\tirradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );\\n\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\tvec3 radiance = vec3( 0.0 );\\n\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\",\n\tlights_fragment_maps: \"#if defined( RE_IndirectDiffuse )\\n\t#ifdef USE_LIGHTMAP\\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\t\tirradiance += lightMapIrradiance;\\n\t#endif\\n\t#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\t\t#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\\n\t\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\\n\t\t#endif\\n\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\t#ifdef USE_ANISOTROPY\\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\\n\t#else\\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\\n\t#endif\\n\t#ifdef USE_CLEARCOAT\\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\\n\t#endif\\n#endif\",\n\tlights_fragment_end: \"#if defined( RE_IndirectDiffuse )\\n\t#if defined( LAMBERT ) || defined( PHONG )\\n\t\tirradiance += iblIrradiance;\\n\t#endif\\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\",\n\tlightprobes_pars_fragment: \"#ifdef USE_LIGHT_PROBES_GRID\\nuniform highp sampler3D probesSH;\\nuniform vec3 probesMin;\\nuniform vec3 probesMax;\\nuniform vec3 probesResolution;\\nvec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {\\n\tvec3 res = probesResolution;\\n\tvec3 gridRange = probesMax - probesMin;\\n\tvec3 resMinusOne = res - 1.0;\\n\tvec3 probeSpacing = gridRange / resMinusOne;\\n\tvec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;\\n\tvec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );\\n\tuvw = uvw * resMinusOne / res + 0.5 / res;\\n\tfloat nz          = res.z;\\n\tfloat paddedSlices = nz + 2.0;\\n\tfloat atlasDepth  = 7.0 * paddedSlices;\\n\tfloat uvZBase     = uvw.z * nz + 1.0;\\n\tvec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase                       ) / atlasDepth ) );\\n\tvec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase +       paddedSlices   ) / atlasDepth ) );\\n\tvec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices   ) / atlasDepth ) );\\n\tvec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices   ) / atlasDepth ) );\\n\tvec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices   ) / atlasDepth ) );\\n\tvec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices   ) / atlasDepth ) );\\n\tvec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices   ) / atlasDepth ) );\\n\tvec3 c0 = s0.xyz;\\n\tvec3 c1 = vec3( s0.w, s1.xy );\\n\tvec3 c2 = vec3( s1.zw, s2.x );\\n\tvec3 c3 = s2.yzw;\\n\tvec3 c4 = s3.xyz;\\n\tvec3 c5 = vec3( s3.w, s4.xy );\\n\tvec3 c6 = vec3( s4.zw, s5.x );\\n\tvec3 c7 = s5.yzw;\\n\tvec3 c8 = s6.xyz;\\n\tfloat x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;\\n\tvec3 result = c0 * 0.886227;\\n\tresult += c1 * 2.0 * 0.511664 * y;\\n\tresult += c2 * 2.0 * 0.511664 * z;\\n\tresult += c3 * 2.0 * 0.511664 * x;\\n\tresult += c4 * 2.0 * 0.429043 * x * y;\\n\tresult += c5 * 2.0 * 0.429043 * y * z;\\n\tresult += c6 * ( 0.743125 * z * z - 0.247708 );\\n\tresult += c7 * 2.0 * 0.429043 * x * z;\\n\tresult += c8 * 0.429043 * ( x * x - y * y );\\n\treturn max( result, vec3( 0.0 ) );\\n}\\n#endif\",\n\tlogdepthbuf_fragment: \"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\",\n\tlogdepthbuf_pars_fragment: \"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\\n\tuniform float logDepthBufFC;\\n\tvarying float vFragDepth;\\n\tvarying float vIsPerspective;\\n#endif\",\n\tlogdepthbuf_pars_vertex: \"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\\n\tvarying float vFragDepth;\\n\tvarying float vIsPerspective;\\n#endif\",\n\tlogdepthbuf_vertex: \"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\\n\tvFragDepth = 1.0 + gl_Position.w;\\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n#endif\",\n\tmap_fragment: \"#ifdef USE_MAP\\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\\n\t#ifdef DECODE_VIDEO_TEXTURE\\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\\n\t#endif\\n\tdiffuseColor *= sampledDiffuseColor;\\n#endif\",\n\tmap_pars_fragment: \"#ifdef USE_MAP\\n\tuniform sampler2D map;\\n#endif\",\n\tmap_particle_fragment: \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\t#if defined( USE_POINTS_UV )\\n\t\tvec2 uv = vUv;\\n\t#else\\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n\t#endif\\n#endif\\n#ifdef USE_MAP\\n\tdiffuseColor *= texture2D( map, uv );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\",\n\tmap_particle_pars_fragment: \"#if defined( USE_POINTS_UV )\\n\tvarying vec2 vUv;\\n#else\\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\t\tuniform mat3 uvTransform;\\n\t#endif\\n#endif\\n#ifdef USE_MAP\\n\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tuniform sampler2D alphaMap;\\n#endif\",\n\tmetalnessmap_fragment: \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\\n\tmetalnessFactor *= texelMetalness.b;\\n#endif\",\n\tmetalnessmap_pars_fragment: \"#ifdef USE_METALNESSMAP\\n\tuniform sampler2D metalnessMap;\\n#endif\",\n\tmorphinstance_vertex: \"#ifdef USE_INSTANCING_MORPH\\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\\n\t}\\n#endif\",\n\tmorphcolor_vertex: \"#if defined( USE_MORPHCOLORS )\\n\tvColor *= morphTargetBaseInfluence;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\t#if defined( USE_COLOR_ALPHA )\\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\\n\t\t#elif defined( USE_COLOR )\\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\\n\t\t#endif\\n\t}\\n#endif\",\n\tmorphnormal_vertex: \"#ifdef USE_MORPHNORMALS\\n\tobjectNormal *= morphTargetBaseInfluence;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\\n\t}\\n#endif\",\n\tmorphtarget_pars_vertex: \"#ifdef USE_MORPHTARGETS\\n\t#ifndef USE_INSTANCING_MORPH\\n\t\tuniform float morphTargetBaseInfluence;\\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\t#endif\\n\tuniform sampler2DArray morphTargetsTexture;\\n\tuniform ivec2 morphTargetsTextureSize;\\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\\n\t}\\n#endif\",\n\tmorphtarget_vertex: \"#ifdef USE_MORPHTARGETS\\n\ttransformed *= morphTargetBaseInfluence;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\\n\t}\\n#endif\",\n\tnormal_fragment_begin: \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\tvec3 fdx = dFdx( vViewPosition );\\n\tvec3 fdy = dFdy( vViewPosition );\\n\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\tvec3 normal = normalize( vNormal );\\n\t#ifdef DOUBLE_SIDED\\n\t\tnormal *= faceDirection;\\n\t#endif\\n#endif\\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\\n\t#ifdef USE_TANGENT\\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\t#else\\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\\n\t\t#if defined( USE_NORMALMAP )\\n\t\t\tvNormalMapUv\\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\\n\t\t\tvClearcoatNormalMapUv\\n\t\t#else\\n\t\t\tvUv\\n\t\t#endif\\n\t\t);\\n\t#endif\\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\\n\t\ttbn[0] *= faceDirection;\\n\t\ttbn[1] *= faceDirection;\\n\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\t#ifdef USE_TANGENT\\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\t#else\\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\\n\t#endif\\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\\n\t\ttbn2[0] *= faceDirection;\\n\t\ttbn2[1] *= faceDirection;\\n\t#endif\\n#endif\\nvec3 nonPerturbedNormal = normal;\",\n\tnormal_fragment_maps: \"#ifdef USE_NORMALMAP_OBJECTSPACE\\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\t#ifdef FLIP_SIDED\\n\t\tnormal = - normal;\\n\t#endif\\n\t#ifdef DOUBLE_SIDED\\n\t\tnormal = normal * faceDirection;\\n\t#endif\\n\tnormal = normalize( normalMatrix * normal );\\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\t#if defined( USE_PACKED_NORMALMAP )\\n\t\tmapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );\\n\t#endif\\n\tmapN.xy *= normalScale;\\n\tnormal = normalize( tbn * mapN );\\n#elif defined( USE_BUMPMAP )\\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\",\n\tnormal_pars_fragment: \"#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n\t#ifdef USE_TANGENT\\n\t\tvarying vec3 vTangent;\\n\t\tvarying vec3 vBitangent;\\n\t#endif\\n#endif\",\n\tnormal_pars_vertex: \"#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n\t#ifdef USE_TANGENT\\n\t\tvarying vec3 vTangent;\\n\t\tvarying vec3 vBitangent;\\n\t#endif\\n#endif\",\n\tnormal_vertex: \"#ifndef FLAT_SHADED\\n\tvNormal = normalize( transformedNormal );\\n\t#ifdef USE_TANGENT\\n\t\tvTangent = normalize( transformedTangent );\\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\t#endif\\n#endif\",\n\tnormalmap_pars_fragment: \"#ifdef USE_NORMALMAP\\n\tuniform sampler2D normalMap;\\n\tuniform vec2 normalScale;\\n#endif\\n#ifdef USE_NORMALMAP_OBJECTSPACE\\n\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\\n\t\tvec2 st0 = dFdx( uv.st );\\n\t\tvec2 st1 = dFdy( uv.st );\\n\t\tvec3 N = surf_norm;\\n\t\tvec3 q1perp = cross( q1, N );\\n\t\tvec3 q0perp = cross( N, q0 );\\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\\n\t\treturn mat3( T * scale, B * scale, N );\\n\t}\\n#endif\",\n\tclearcoat_normal_fragment_begin: \"#ifdef USE_CLEARCOAT\\n\tvec3 clearcoatNormal = nonPerturbedNormal;\\n#endif\",\n\tclearcoat_normal_fragment_maps: \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\\n\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\\n#endif\",\n\tclearcoat_pars_fragment: \"#ifdef USE_CLEARCOATMAP\\n\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tuniform sampler2D clearcoatNormalMap;\\n\tuniform vec2 clearcoatNormalScale;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\",\n\tiridescence_pars_fragment: \"#ifdef USE_IRIDESCENCEMAP\\n\tuniform sampler2D iridescenceMap;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tuniform sampler2D iridescenceThicknessMap;\\n#endif\",\n\topaque_fragment: \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= material.transmissionAlpha;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\",\n\tpacking: \"vec3 packNormalToRGB( const in vec3 normal ) {\\n\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\\nconst float Inv255 = 1. / 255.;\\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\\nvec4 packDepthToRGBA( const in float v ) {\\n\tif( v <= 0.0 )\\n\t\treturn vec4( 0., 0., 0., 0. );\\n\tif( v >= 1.0 )\\n\t\treturn vec4( 1., 1., 1., 1. );\\n\tfloat vuf;\\n\tfloat af = modf( v * PackFactors.a, vuf );\\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\\n}\\nvec3 packDepthToRGB( const in float v ) {\\n\tif( v <= 0.0 )\\n\t\treturn vec3( 0., 0., 0. );\\n\tif( v >= 1.0 )\\n\t\treturn vec3( 1., 1., 1. );\\n\tfloat vuf;\\n\tfloat bf = modf( v * PackFactors.b, vuf );\\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\\n}\\nvec2 packDepthToRG( const in float v ) {\\n\tif( v <= 0.0 )\\n\t\treturn vec2( 0., 0. );\\n\tif( v >= 1.0 )\\n\t\treturn vec2( 1., 1. );\\n\tfloat vuf;\\n\tfloat gf = modf( v * 256., vuf );\\n\treturn vec2( vuf * Inv255, gf );\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\treturn dot( v, UnpackFactors4 );\\n}\\nfloat unpackRGBToDepth( const in vec3 v ) {\\n\treturn dot( v, UnpackFactors3 );\\n}\\nfloat unpackRGToDepth( const in vec2 v ) {\\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\\n}\\nvec4 pack2HalfToRGBA( const in vec2 v ) {\\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( const in vec4 v ) {\\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\\n\t\treturn depth * ( far - near ) - far;\\n\t#else\\n\t\treturn depth * ( near - far ) - near;\\n\t#endif\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\t\\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\treturn ( near * far ) / ( ( near - far ) * depth - near );\\n\t#else\\n\t\treturn ( near * far ) / ( ( far - near ) * depth - far );\\n\t#endif\\n}\",\n\tpremultiplied_alpha_fragment: \"#ifdef PREMULTIPLIED_ALPHA\\n\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\",\n\tproject_vertex: \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_BATCHING\\n\tmvPosition = batchingMatrix * mvPosition;\\n#endif\\n#ifdef USE_INSTANCING\\n\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\",\n\tdithering_fragment: \"#ifdef DITHERING\\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\",\n\tdithering_pars_fragment: \"#ifdef DITHERING\\n\tvec3 dithering( vec3 color ) {\\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\t\treturn color + dither_shift_RGB;\\n\t}\\n#endif\",\n\troughnessmap_fragment: \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\\n\troughnessFactor *= texelRoughness.g;\\n#endif\",\n\troughnessmap_pars_fragment: \"#ifdef USE_ROUGHNESSMAP\\n\tuniform sampler2D roughnessMap;\\n#endif\",\n\tshadowmap_pars_fragment: \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#if NUM_SPOT_LIGHT_MAPS > 0\\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\t\tuniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\t#else\\n\t\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\t#endif\\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\tstruct DirectionalLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\t\tuniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t\t#else\\n\t\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t\t#endif\\n\t\tstruct SpotLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\t\tuniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\t#elif defined( SHADOWMAP_TYPE_BASIC )\\n\t\t\tuniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\t#endif\\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\tstruct PointLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t\tfloat shadowCameraNear;\\n\t\t\tfloat shadowCameraFar;\\n\t\t};\\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\tfloat interleavedGradientNoise( vec2 position ) {\\n\t\t\treturn fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\\n\t\t}\\n\t\tvec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\\n\t\t\tconst float goldenAngle = 2.399963229728653;\\n\t\t\tfloat r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\\n\t\t\tfloat theta = float( sampleIndex ) * goldenAngle + phi;\\n\t\t\treturn vec2( cos( theta ), sin( theta ) ) * r;\\n\t\t}\\n\t#endif\\n\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\tfloat getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\t\tfloat shadow = 1.0;\\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\\n\t\t\tshadowCoord.z += shadowBias;\\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\t\t\tif ( frustumTest ) {\\n\t\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\t\t\t\tfloat radius = shadowRadius * texelSize.x;\\n\t\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\\n\t\t\t\tshadow = (\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\\n\t\t\t\t) * 0.2;\\n\t\t\t}\\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t\t}\\n\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\t\tfloat shadow = 1.0;\\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tshadowCoord.z -= shadowBias;\\n\t\t\t#else\\n\t\t\t\tshadowCoord.z += shadowBias;\\n\t\t\t#endif\\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\t\t\tif ( frustumTest ) {\\n\t\t\t\tvec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\\n\t\t\t\tfloat mean = distribution.x;\\n\t\t\t\tfloat variance = distribution.y * distribution.y;\\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\t\tfloat hard_shadow = step( mean, shadowCoord.z );\\n\t\t\t\t#else\\n\t\t\t\t\tfloat hard_shadow = step( shadowCoord.z, mean );\\n\t\t\t\t#endif\\n\t\t\t\t\\n\t\t\t\tif ( hard_shadow == 1.0 ) {\\n\t\t\t\t\tshadow = 1.0;\\n\t\t\t\t} else {\\n\t\t\t\t\tvariance = max( variance, 0.0000001 );\\n\t\t\t\t\tfloat d = shadowCoord.z - mean;\\n\t\t\t\t\tfloat p_max = variance / ( variance + d * d );\\n\t\t\t\t\tp_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\\n\t\t\t\t\tshadow = max( hard_shadow, p_max );\\n\t\t\t\t}\\n\t\t\t}\\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t\t}\\n\t#else\\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\t\tfloat shadow = 1.0;\\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tshadowCoord.z -= shadowBias;\\n\t\t\t#else\\n\t\t\t\tshadowCoord.z += shadowBias;\\n\t\t\t#endif\\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\t\t\tif ( frustumTest ) {\\n\t\t\t\tfloat depth = texture2D( shadowMap, shadowCoord.xy ).r;\\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\t\tshadow = step( depth, shadowCoord.z );\\n\t\t\t\t#else\\n\t\t\t\t\tshadow = step( shadowCoord.z, depth );\\n\t\t\t\t#endif\\n\t\t\t}\\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t\t}\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t#if defined( SHADOWMAP_TYPE_PCF )\\n\tfloat getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\t\tfloat shadow = 1.0;\\n\t\tvec3 lightToPosition = shadowCoord.xyz;\\n\t\tvec3 bd3D = normalize( lightToPosition );\\n\t\tvec3 absVec = abs( lightToPosition );\\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tfloat dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\\n\t\t\t\tdp -= shadowBias;\\n\t\t\t#else\\n\t\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\\n\t\t\t\tdp += shadowBias;\\n\t\t\t#endif\\n\t\t\tfloat texelSize = shadowRadius / shadowMapSize.x;\\n\t\t\tvec3 absDir = abs( bd3D );\\n\t\t\tvec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\\n\t\t\ttangent = normalize( cross( bd3D, tangent ) );\\n\t\t\tvec3 bitangent = cross( bd3D, tangent );\\n\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\\n\t\t\tvec2 sample0 = vogelDiskSample( 0, 5, phi );\\n\t\t\tvec2 sample1 = vogelDiskSample( 1, 5, phi );\\n\t\t\tvec2 sample2 = vogelDiskSample( 2, 5, phi );\\n\t\t\tvec2 sample3 = vogelDiskSample( 3, 5, phi );\\n\t\t\tvec2 sample4 = vogelDiskSample( 4, 5, phi );\\n\t\t\tshadow = (\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\\n\t\t\t) * 0.2;\\n\t\t}\\n\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t}\\n\t#elif defined( SHADOWMAP_TYPE_BASIC )\\n\tfloat getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\t\tfloat shadow = 1.0;\\n\t\tvec3 lightToPosition = shadowCoord.xyz;\\n\t\tvec3 absVec = abs( lightToPosition );\\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\\n\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\\n\t\t\tdp += shadowBias;\\n\t\t\tvec3 bd3D = normalize( lightToPosition );\\n\t\t\tfloat depth = textureCube( shadowMap, bd3D ).r;\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tdepth = 1.0 - depth;\\n\t\t\t#endif\\n\t\t\tshadow = step( dp, depth );\\n\t\t}\\n\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t}\\n\t#endif\\n\t#endif\\n#endif\",\n\tshadowmap_pars_vertex: \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\tstruct DirectionalLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\t\tstruct SpotLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\tstruct PointLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t\tfloat shadowCameraNear;\\n\t\t\tfloat shadowCameraFar;\\n\t\t};\\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\t#endif\\n#endif\",\n\tshadowmap_vertex: \"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\\n\t#ifdef HAS_NORMAL\\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\t#else\\n\t\tvec3 shadowWorldNormal = vec3( 0.0 );\\n\t#endif\\n\tvec4 shadowWorldPosition;\\n#endif\\n#if defined( USE_SHADOWMAP )\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t#endif\\n#endif\\n#if NUM_SPOT_LIGHT_COORDS > 0\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\\n\t\tshadowWorldPosition = worldPosition;\\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\\n\t\t#endif\\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\",\n\tshadowmask_pars_fragment: \"float getShadowMask() {\\n\tfloat shadow = 1.0;\\n\t#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\tDirectionalLightShadow directionalLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\t\tdirectionalLight = directionalLightShadows[ i ];\\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\t}\\n\t#pragma unroll_loop_end\\n\t#endif\\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\tSpotLightShadow spotLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\t\tspotLight = spotLightShadows[ i ];\\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\t}\\n\t#pragma unroll_loop_end\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\\n\tPointLightShadow pointLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\t\tpointLight = pointLightShadows[ i ];\\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\t}\\n\t#pragma unroll_loop_end\\n\t#endif\\n\t#endif\\n\treturn shadow;\\n}\",\n\tskinbase_vertex: \"#ifdef USE_SKINNING\\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\",\n\tskinning_pars_vertex: \"#ifdef USE_SKINNING\\n\tuniform mat4 bindMatrix;\\n\tuniform mat4 bindMatrixInverse;\\n\tuniform highp sampler2D boneTexture;\\n\tmat4 getBoneMatrix( const in float i ) {\\n\t\tint size = textureSize( boneTexture, 0 ).x;\\n\t\tint j = int( i ) * 4;\\n\t\tint x = j % size;\\n\t\tint y = j / size;\\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\\n\t\treturn mat4( v1, v2, v3, v4 );\\n\t}\\n#endif\",\n\tskinning_vertex: \"#ifdef USE_SKINNING\\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\tvec4 skinned = vec4( 0.0 );\\n\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\",\n\tskinnormal_vertex: \"#ifdef USE_SKINNING\\n\tmat4 skinMatrix = mat4( 0.0 );\\n\tskinMatrix += skinWeight.x * boneMatX;\\n\tskinMatrix += skinWeight.y * boneMatY;\\n\tskinMatrix += skinWeight.z * boneMatZ;\\n\tskinMatrix += skinWeight.w * boneMatW;\\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\t#ifdef USE_TANGENT\\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\t#endif\\n#endif\",\n\tspecularmap_fragment: \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\\n\tspecularStrength = texelSpecular.r;\\n#else\\n\tspecularStrength = 1.0;\\n#endif\",\n\tspecularmap_pars_fragment: \"#ifdef USE_SPECULARMAP\\n\tuniform sampler2D specularMap;\\n#endif\",\n\ttonemapping_fragment: \"#if defined( TONE_MAPPING )\\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\",\n\ttonemapping_pars_fragment: \"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\treturn saturate( toneMappingExposure * color );\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\tcolor *= toneMappingExposure;\\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 CineonToneMapping( vec3 color ) {\\n\tcolor *= toneMappingExposure;\\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\tconst mat3 ACESInputMat = mat3(\\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\\n\t);\\n\tconst mat3 ACESOutputMat = mat3(\\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\\n\t);\\n\tcolor *= toneMappingExposure / 0.6;\\n\tcolor = ACESInputMat * color;\\n\tcolor = RRTAndODTFit( color );\\n\tcolor = ACESOutputMat * color;\\n\treturn saturate( color );\\n}\\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\\n);\\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\\n\tvec3( 0.6274, 0.0691, 0.0164 ),\\n\tvec3( 0.3293, 0.9195, 0.0880 ),\\n\tvec3( 0.0433, 0.0113, 0.8956 )\\n);\\nvec3 agxDefaultContrastApprox( vec3 x ) {\\n\tvec3 x2 = x * x;\\n\tvec3 x4 = x2 * x2;\\n\treturn + 15.5 * x4 * x2\\n\t\t- 40.14 * x4 * x\\n\t\t+ 31.96 * x4\\n\t\t- 6.868 * x2 * x\\n\t\t+ 0.4298 * x2\\n\t\t+ 0.1191 * x\\n\t\t- 0.00232;\\n}\\nvec3 AgXToneMapping( vec3 color ) {\\n\tconst mat3 AgXInsetMatrix = mat3(\\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\\n\t);\\n\tconst mat3 AgXOutsetMatrix = mat3(\\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\\n\t);\\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\\n\tcolor *= toneMappingExposure;\\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\\n\tcolor = AgXInsetMatrix * color;\\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\\n\tcolor = clamp( color, 0.0, 1.0 );\\n\tcolor = agxDefaultContrastApprox( color );\\n\tcolor = AgXOutsetMatrix * color;\\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\\n\tcolor = clamp( color, 0.0, 1.0 );\\n\treturn color;\\n}\\nvec3 NeutralToneMapping( vec3 color ) {\\n\tconst float StartCompression = 0.8 - 0.04;\\n\tconst float Desaturation = 0.15;\\n\tcolor *= toneMappingExposure;\\n\tfloat x = min( color.r, min( color.g, color.b ) );\\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\\n\tcolor -= offset;\\n\tfloat peak = max( color.r, max( color.g, color.b ) );\\n\tif ( peak < StartCompression ) return color;\\n\tfloat d = 1. - StartCompression;\\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\\n\tcolor *= newPeak / peak;\\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\\n\treturn mix( color, vec3( newPeak ), g );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\",\n\ttransmission_fragment: \"#ifdef USE_TRANSMISSION\\n\tmaterial.transmission = transmission;\\n\tmaterial.transmissionAlpha = 1.0;\\n\tmaterial.thickness = thickness;\\n\tmaterial.attenuationDistance = attenuationDistance;\\n\tmaterial.attenuationColor = attenuationColor;\\n\t#ifdef USE_TRANSMISSIONMAP\\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\\n\t#endif\\n\t#ifdef USE_THICKNESSMAP\\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\\n\t#endif\\n\tvec3 pos = vWorldPosition;\\n\tvec3 v = normalize( cameraPosition - pos );\\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\tvec4 transmitted = getIBLVolumeRefraction(\\n\t\tn, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\\n\t\tmaterial.attenuationColor, material.attenuationDistance );\\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\\n#endif\",\n\ttransmission_pars_fragment: \"#ifdef USE_TRANSMISSION\\n\tuniform float transmission;\\n\tuniform float thickness;\\n\tuniform float attenuationDistance;\\n\tuniform vec3 attenuationColor;\\n\t#ifdef USE_TRANSMISSIONMAP\\n\t\tuniform sampler2D transmissionMap;\\n\t#endif\\n\t#ifdef USE_THICKNESSMAP\\n\t\tuniform sampler2D thicknessMap;\\n\t#endif\\n\tuniform vec2 transmissionSamplerSize;\\n\tuniform sampler2D transmissionSamplerMap;\\n\tuniform mat4 modelMatrix;\\n\tuniform mat4 projectionMatrix;\\n\tvarying vec3 vWorldPosition;\\n\tfloat w0( float a ) {\\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\\n\t}\\n\tfloat w1( float a ) {\\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\\n\t}\\n\tfloat w2( float a ){\\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\\n\t}\\n\tfloat w3( float a ) {\\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\\n\t}\\n\tfloat g0( float a ) {\\n\t\treturn w0( a ) + w1( a );\\n\t}\\n\tfloat g1( float a ) {\\n\t\treturn w2( a ) + w3( a );\\n\t}\\n\tfloat h0( float a ) {\\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\\n\t}\\n\tfloat h1( float a ) {\\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\\n\t}\\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\\n\t\tuv = uv * texelSize.zw + 0.5;\\n\t\tvec2 iuv = floor( uv );\\n\t\tvec2 fuv = fract( uv );\\n\t\tfloat g0x = g0( fuv.x );\\n\t\tfloat g1x = g1( fuv.x );\\n\t\tfloat h0x = h0( fuv.x );\\n\t\tfloat h1x = h1( fuv.x );\\n\t\tfloat h0y = h0( fuv.y );\\n\t\tfloat h1y = h1( fuv.y );\\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\\n\t}\\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\\n\t\treturn mix( fSample, cSample, fract( lod ) );\\n\t}\\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\t\tvec3 modelScale;\\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\\n\t}\\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\t}\\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\\n\t}\\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\\n\t\tif ( isinf( attenuationDistance ) ) {\\n\t\t\treturn vec3( 1.0 );\\n\t\t} else {\\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\\n\t\t}\\n\t}\\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\\n\t\tvec4 transmittedLight;\\n\t\tvec3 transmittance;\\n\t\t#ifdef USE_DISPERSION\\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\t\t\t\trefractionCoords += 1.0;\\n\t\t\t\trefractionCoords /= 2.0;\\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\\n\t\t\t}\\n\t\t\ttransmittedLight.a /= 3.0;\\n\t\t#else\\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\t\t\trefractionCoords += 1.0;\\n\t\t\trefractionCoords /= 2.0;\\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\\n\t\t#endif\\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\\n\t}\\n#endif\",\n\tuv_pars_fragment: \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\tuniform mat3 transmissionMapTransform;\\n\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\tuniform mat3 thicknessMapTransform;\\n\tvarying vec2 vThicknessMapUv;\\n#endif\",\n\tuv_pars_vertex: \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\tuniform mat3 mapTransform;\\n\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tuniform mat3 alphaMapTransform;\\n\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\tuniform mat3 lightMapTransform;\\n\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\tuniform mat3 aoMapTransform;\\n\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\tuniform mat3 bumpMapTransform;\\n\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tuniform mat3 normalMapTransform;\\n\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\tuniform mat3 displacementMapTransform;\\n\tvarying vec2 vDisplacementMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\tuniform mat3 emissiveMapTransform;\\n\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\tuniform mat3 metalnessMapTransform;\\n\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\tuniform mat3 roughnessMapTransform;\\n\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\tuniform mat3 anisotropyMapTransform;\\n\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\tuniform mat3 clearcoatMapTransform;\\n\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tuniform mat3 clearcoatNormalMapTransform;\\n\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tuniform mat3 clearcoatRoughnessMapTransform;\\n\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\tuniform mat3 sheenColorMapTransform;\\n\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\tuniform mat3 sheenRoughnessMapTransform;\\n\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\tuniform mat3 iridescenceMapTransform;\\n\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tuniform mat3 iridescenceThicknessMapTransform;\\n\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\tuniform mat3 specularMapTransform;\\n\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\tuniform mat3 specularColorMapTransform;\\n\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\tuniform mat3 specularIntensityMapTransform;\\n\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\tuniform mat3 transmissionMapTransform;\\n\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\tuniform mat3 thicknessMapTransform;\\n\tvarying vec2 vThicknessMapUv;\\n#endif\",\n\tuv_vertex: \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\tvUv = vec3( uv, 1 ).xy;\\n#endif\\n#ifdef USE_MAP\\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_AOMAP\\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_BUMPMAP\\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\",\n\tworldpos_vertex: \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\\n\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\t#ifdef USE_BATCHING\\n\t\tworldPosition = batchingMatrix * worldPosition;\\n\t#endif\\n\t#ifdef USE_INSTANCING\\n\t\tworldPosition = instanceMatrix * worldPosition;\\n\t#endif\\n\tworldPosition = modelMatrix * worldPosition;\\n#endif\",\n\tbackground_vert: \"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\",\n\tbackground_frag: \"uniform sampler2D t2D;\\nuniform float backgroundIntensity;\\nvarying vec2 vUv;\\nvoid main() {\\n\tvec4 texColor = texture2D( t2D, vUv );\\n\t#ifdef DECODE_VIDEO_TEXTURE\\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\\n\t#endif\\n\ttexColor.rgb *= backgroundIntensity;\\n\tgl_FragColor = texColor;\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n\tbackgroundCube_vert: \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvWorldDirection = transformDirection( position, modelMatrix );\\n\t#include <begin_vertex>\\n\t#include <project_vertex>\\n\tgl_Position.z = gl_Position.w;\\n}\",\n\tbackgroundCube_frag: \"#ifdef ENVMAP_TYPE_CUBE\\n\tuniform samplerCube envMap;\\n#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\tuniform sampler2D envMap;\\n#endif\\nuniform float backgroundBlurriness;\\nuniform float backgroundIntensity;\\nuniform mat3 backgroundRotation;\\nvarying vec3 vWorldDirection;\\n#include <cube_uv_reflection_fragment>\\nvoid main() {\\n\t#ifdef ENVMAP_TYPE_CUBE\\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );\\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\\n\t#else\\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\t#endif\\n\ttexColor.rgb *= backgroundIntensity;\\n\tgl_FragColor = texColor;\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n\tcube_vert: \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvWorldDirection = transformDirection( position, modelMatrix );\\n\t#include <begin_vertex>\\n\t#include <project_vertex>\\n\tgl_Position.z = gl_Position.w;\\n}\",\n\tcube_frag: \"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\nvoid main() {\\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\\n\tgl_FragColor = texColor;\\n\tgl_FragColor.a *= opacity;\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n\tdepth_vert: \"#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <batching_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <morphinstance_vertex>\\n\t#ifdef USE_DISPLACEMENTMAP\\n\t\t#include <beginnormal_vertex>\\n\t\t#include <morphnormal_vertex>\\n\t\t#include <skinnormal_vertex>\\n\t#endif\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvHighPrecisionZW = gl_Position.zw;\\n}\",\n\tdepth_frag: \"#if DEPTH_PACKING == 3200\\n\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\tvec4 diffuseColor = vec4( 1.0 );\\n\t#include <clipping_planes_fragment>\\n\t#if DEPTH_PACKING == 3200\\n\t\tdiffuseColor.a = opacity;\\n\t#endif\\n\t#include <map_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\\n\t#else\\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\\n\t#endif\\n\t#if DEPTH_PACKING == 3200\\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\t#elif DEPTH_PACKING == 3201\\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\t#elif DEPTH_PACKING == 3202\\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\\n\t#elif DEPTH_PACKING == 3203\\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\\n\t#endif\\n}\",\n\tdistance_vert: \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <batching_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <morphinstance_vertex>\\n\t#ifdef USE_DISPLACEMENTMAP\\n\t\t#include <beginnormal_vertex>\\n\t\t#include <morphnormal_vertex>\\n\t\t#include <skinnormal_vertex>\\n\t#endif\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvWorldPosition = worldPosition.xyz;\\n}\",\n\tdistance_frag: \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\tvec4 diffuseColor = vec4( 1.0 );\\n\t#include <clipping_planes_fragment>\\n\t#include <map_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\tfloat dist = length( vWorldPosition - referencePosition );\\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\tdist = saturate( dist );\\n\tgl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\\n}\",\n\tequirect_vert: \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvWorldDirection = transformDirection( position, modelMatrix );\\n\t#include <begin_vertex>\\n\t#include <project_vertex>\\n}\",\n\tequirect_frag: \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvec3 direction = normalize( vWorldDirection );\\n\tvec2 sampleUV = equirectUv( direction );\\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n\tlinedashed_vert: \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\tvLineDistance = scale * lineDistance;\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tlinedashed_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\t\tdiscard;\\n\t}\\n\tvec3 outgoingLight = vec3( 0.0 );\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\toutgoingLight = diffuseColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n}\",\n\tmeshbasic_vert: \"#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\t\t#include <beginnormal_vertex>\\n\t\t#include <morphnormal_vertex>\\n\t\t#include <skinbase_vertex>\\n\t\t#include <skinnormal_vertex>\\n\t\t#include <defaultnormal_vertex>\\n\t#endif\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <envmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tmeshbasic_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <specularmap_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\t#ifdef USE_LIGHTMAP\\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\\n\t#else\\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\t#endif\\n\t#include <aomap_fragment>\\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\t#include <envmap_fragment>\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n\tmeshlambert_vert: \"#define LAMBERT\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <envmap_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tmeshlambert_frag: \"#define LAMBERT\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_lambert_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <specularmap_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_lambert_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\t#include <envmap_fragment>\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n\tmeshmatcap_vert: \"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <fog_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n}\",\n\tmeshmatcap_frag: \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\tvec3 viewDir = normalize( vViewPosition );\\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\tvec3 y = cross( viewDir, x );\\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\\n\t#ifdef USE_MATCAP\\n\t\tvec4 matcapColor = texture2D( matcap, uv );\\n\t#else\\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\\n\t#endif\\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n\tmeshnormal_vert: \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvarying vec3 vViewPosition;\\n#endif\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\",\n\tmeshnormal_frag: \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvarying vec3 vViewPosition;\\n#endif\\n#include <uv_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\\n\t#include <clipping_planes_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\tgl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\\n\t#ifdef OPAQUE\\n\t\tgl_FragColor.a = 1.0;\\n\t#endif\\n}\",\n\tmeshphong_vert: \"#define PHONG\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <envmap_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tmeshphong_frag: \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <specularmap_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_phong_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\t#include <envmap_fragment>\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n\tmeshphysical_vert: \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\tvarying vec3 vWorldPosition;\\n#endif\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n#ifdef USE_TRANSMISSION\\n\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\",\n\tmeshphysical_frag: \"#define STANDARD\\n#ifdef PHYSICAL\\n\t#define IOR\\n\t#define USE_SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\tuniform float ior;\\n#endif\\n#ifdef USE_SPECULAR\\n\tuniform float specularIntensity;\\n\tuniform vec3 specularColor;\\n\t#ifdef USE_SPECULAR_COLORMAP\\n\t\tuniform sampler2D specularColorMap;\\n\t#endif\\n\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\t\tuniform sampler2D specularIntensityMap;\\n\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\tuniform float clearcoat;\\n\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_DISPERSION\\n\tuniform float dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\tuniform float iridescence;\\n\tuniform float iridescenceIOR;\\n\tuniform float iridescenceThicknessMinimum;\\n\tuniform float iridescenceThicknessMaximum;\\n#endif\\n#ifdef USE_SHEEN\\n\tuniform vec3 sheenColor;\\n\tuniform float sheenRoughness;\\n\t#ifdef USE_SHEEN_COLORMAP\\n\t\tuniform sampler2D sheenColorMap;\\n\t#endif\\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\t\tuniform sampler2D sheenRoughnessMap;\\n\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\tuniform vec2 anisotropyVector;\\n\t#ifdef USE_ANISOTROPYMAP\\n\t\tuniform sampler2D anisotropyMap;\\n\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <iridescence_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_physical_pars_fragment>\\n#include <transmission_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <clearcoat_pars_fragment>\\n#include <iridescence_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <roughnessmap_fragment>\\n\t#include <metalnessmap_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <clearcoat_normal_fragment_begin>\\n\t#include <clearcoat_normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_physical_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\t#include <transmission_fragment>\\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\t#ifdef USE_SHEEN\\n \\n\t\toutgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\\n \\n \t#endif\\n\t#ifdef USE_CLEARCOAT\\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\\n\t#endif\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n\tmeshtoon_vert: \"#define TOON\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tmeshtoon_frag: \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_toon_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_toon_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n\tpoints_vert: \"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\n#ifdef USE_POINTS_UV\\n\tvarying vec2 vUv;\\n\tuniform mat3 uvTransform;\\n#endif\\nvoid main() {\\n\t#ifdef USE_POINTS_UV\\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\t#endif\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <project_vertex>\\n\tgl_PointSize = size;\\n\t#ifdef USE_SIZEATTENUATION\\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\t#endif\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tpoints_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tvec3 outgoingLight = vec3( 0.0 );\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_particle_fragment>\\n\t#include <color_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\toutgoingLight = diffuseColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n}\",\n\tshadow_vert: \"#include <common>\\n#include <batching_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tshadow_frag: \"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <logdepthbuf_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\t#include <logdepthbuf_fragment>\\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n}\",\n\tsprite_vert: \"uniform float rotation;\\nuniform vec2 center;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\\n\t#ifndef USE_SIZEATTENUATION\\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\\n\t#endif\\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\tvec2 rotatedPosition;\\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\tmvPosition.xy += rotatedPosition;\\n\tgl_Position = projectionMatrix * mvPosition;\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <fog_vertex>\\n}\",\n\tsprite_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tvec3 outgoingLight = vec3( 0.0 );\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\toutgoingLight = diffuseColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n}\"\n}, X = {\n\tcommon: {\n\t\tdiffuse: { value: /*@__PURE__*/ new fr(16777215) },\n\t\topacity: { value: 1 },\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new q() },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new q() },\n\t\talphaTest: { value: 0 }\n\t},\n\tspecularmap: {\n\t\tspecularMap: { value: null },\n\t\tspecularMapTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\tenvmap: {\n\t\tenvMap: { value: null },\n\t\tenvMapRotation: { value: /*@__PURE__*/ new q() },\n\t\treflectivity: { value: 1 },\n\t\tior: { value: 1.5 },\n\t\trefractionRatio: { value: .98 },\n\t\tdfgLUT: { value: null }\n\t},\n\taomap: {\n\t\taoMap: { value: null },\n\t\taoMapIntensity: { value: 1 },\n\t\taoMapTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\tlightmap: {\n\t\tlightMap: { value: null },\n\t\tlightMapIntensity: { value: 1 },\n\t\tlightMapTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\tbumpmap: {\n\t\tbumpMap: { value: null },\n\t\tbumpMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tbumpScale: { value: 1 }\n\t},\n\tnormalmap: {\n\t\tnormalMap: { value: null },\n\t\tnormalMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tnormalScale: { value: /*@__PURE__*/ new G(1, 1) }\n\t},\n\tdisplacementmap: {\n\t\tdisplacementMap: { value: null },\n\t\tdisplacementMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tdisplacementScale: { value: 1 },\n\t\tdisplacementBias: { value: 0 }\n\t},\n\temissivemap: {\n\t\temissiveMap: { value: null },\n\t\temissiveMapTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\tmetalnessmap: {\n\t\tmetalnessMap: { value: null },\n\t\tmetalnessMapTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\troughnessmap: {\n\t\troughnessMap: { value: null },\n\t\troughnessMapTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\tgradientmap: { gradientMap: { value: null } },\n\tfog: {\n\t\tfogDensity: { value: 25e-5 },\n\t\tfogNear: { value: 1 },\n\t\tfogFar: { value: 2e3 },\n\t\tfogColor: { value: /*@__PURE__*/ new fr(16777215) }\n\t},\n\tlights: {\n\t\tambientLightColor: { value: [] },\n\t\tlightProbe: { value: [] },\n\t\tdirectionalLights: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tdirection: {},\n\t\t\t\tcolor: {}\n\t\t\t}\n\t\t},\n\t\tdirectionalLightShadows: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tshadowIntensity: 1,\n\t\t\t\tshadowBias: {},\n\t\t\t\tshadowNormalBias: {},\n\t\t\t\tshadowRadius: {},\n\t\t\t\tshadowMapSize: {}\n\t\t\t}\n\t\t},\n\t\tdirectionalShadowMatrix: { value: [] },\n\t\tspotLights: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tcolor: {},\n\t\t\t\tposition: {},\n\t\t\t\tdirection: {},\n\t\t\t\tdistance: {},\n\t\t\t\tconeCos: {},\n\t\t\t\tpenumbraCos: {},\n\t\t\t\tdecay: {}\n\t\t\t}\n\t\t},\n\t\tspotLightShadows: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tshadowIntensity: 1,\n\t\t\t\tshadowBias: {},\n\t\t\t\tshadowNormalBias: {},\n\t\t\t\tshadowRadius: {},\n\t\t\t\tshadowMapSize: {}\n\t\t\t}\n\t\t},\n\t\tspotLightMap: { value: [] },\n\t\tspotLightMatrix: { value: [] },\n\t\tpointLights: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tcolor: {},\n\t\t\t\tposition: {},\n\t\t\t\tdecay: {},\n\t\t\t\tdistance: {}\n\t\t\t}\n\t\t},\n\t\tpointLightShadows: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tshadowIntensity: 1,\n\t\t\t\tshadowBias: {},\n\t\t\t\tshadowNormalBias: {},\n\t\t\t\tshadowRadius: {},\n\t\t\t\tshadowMapSize: {},\n\t\t\t\tshadowCameraNear: {},\n\t\t\t\tshadowCameraFar: {}\n\t\t\t}\n\t\t},\n\t\tpointShadowMatrix: { value: [] },\n\t\themisphereLights: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tdirection: {},\n\t\t\t\tskyColor: {},\n\t\t\t\tgroundColor: {}\n\t\t\t}\n\t\t},\n\t\trectAreaLights: {\n\t\t\tvalue: [],\n\t\t\tproperties: {\n\t\t\t\tcolor: {},\n\t\t\t\tposition: {},\n\t\t\t\twidth: {},\n\t\t\t\theight: {}\n\t\t\t}\n\t\t},\n\t\tltc_1: { value: null },\n\t\tltc_2: { value: null },\n\t\tprobesSH: { value: null },\n\t\tprobesMin: { value: /*@__PURE__*/ new K() },\n\t\tprobesMax: { value: /*@__PURE__*/ new K() },\n\t\tprobesResolution: { value: /*@__PURE__*/ new K() }\n\t},\n\tpoints: {\n\t\tdiffuse: { value: /*@__PURE__*/ new fr(16777215) },\n\t\topacity: { value: 1 },\n\t\tsize: { value: 1 },\n\t\tscale: { value: 1 },\n\t\tmap: { value: null },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new q() },\n\t\talphaTest: { value: 0 },\n\t\tuvTransform: { value: /*@__PURE__*/ new q() }\n\t},\n\tsprite: {\n\t\tdiffuse: { value: /*@__PURE__*/ new fr(16777215) },\n\t\topacity: { value: 1 },\n\t\tcenter: { value: /*@__PURE__*/ new G(.5, .5) },\n\t\trotation: { value: 0 },\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new q() },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new q() },\n\t\talphaTest: { value: 0 }\n\t}\n}, co = {\n\tbasic: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.specularmap,\n\t\t\tX.envmap,\n\t\t\tX.aomap,\n\t\t\tX.lightmap,\n\t\t\tX.fog\n\t\t]),\n\t\tvertexShader: Y.meshbasic_vert,\n\t\tfragmentShader: Y.meshbasic_frag\n\t},\n\tlambert: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.specularmap,\n\t\t\tX.envmap,\n\t\t\tX.aomap,\n\t\t\tX.lightmap,\n\t\t\tX.emissivemap,\n\t\t\tX.bumpmap,\n\t\t\tX.normalmap,\n\t\t\tX.displacementmap,\n\t\t\tX.fog,\n\t\t\tX.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new fr(0) },\n\t\t\t\tenvMapIntensity: { value: 1 }\n\t\t\t}\n\t\t]),\n\t\tvertexShader: Y.meshlambert_vert,\n\t\tfragmentShader: Y.meshlambert_frag\n\t},\n\tphong: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.specularmap,\n\t\t\tX.envmap,\n\t\t\tX.aomap,\n\t\t\tX.lightmap,\n\t\t\tX.emissivemap,\n\t\t\tX.bumpmap,\n\t\t\tX.normalmap,\n\t\t\tX.displacementmap,\n\t\t\tX.fog,\n\t\t\tX.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new fr(0) },\n\t\t\t\tspecular: { value: /*@__PURE__*/ new fr(1118481) },\n\t\t\t\tshininess: { value: 30 },\n\t\t\t\tenvMapIntensity: { value: 1 }\n\t\t\t}\n\t\t]),\n\t\tvertexShader: Y.meshphong_vert,\n\t\tfragmentShader: Y.meshphong_frag\n\t},\n\tstandard: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.envmap,\n\t\t\tX.aomap,\n\t\t\tX.lightmap,\n\t\t\tX.emissivemap,\n\t\t\tX.bumpmap,\n\t\t\tX.normalmap,\n\t\t\tX.displacementmap,\n\t\t\tX.roughnessmap,\n\t\t\tX.metalnessmap,\n\t\t\tX.fog,\n\t\t\tX.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new fr(0) },\n\t\t\t\troughness: { value: 1 },\n\t\t\t\tmetalness: { value: 0 },\n\t\t\t\tenvMapIntensity: { value: 1 }\n\t\t\t}\n\t\t]),\n\t\tvertexShader: Y.meshphysical_vert,\n\t\tfragmentShader: Y.meshphysical_frag\n\t},\n\ttoon: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.aomap,\n\t\t\tX.lightmap,\n\t\t\tX.emissivemap,\n\t\t\tX.bumpmap,\n\t\t\tX.normalmap,\n\t\t\tX.displacementmap,\n\t\t\tX.gradientmap,\n\t\t\tX.fog,\n\t\t\tX.lights,\n\t\t\t{ emissive: { value: /*@__PURE__*/ new fr(0) } }\n\t\t]),\n\t\tvertexShader: Y.meshtoon_vert,\n\t\tfragmentShader: Y.meshtoon_frag\n\t},\n\tmatcap: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.bumpmap,\n\t\t\tX.normalmap,\n\t\t\tX.displacementmap,\n\t\t\tX.fog,\n\t\t\t{ matcap: { value: null } }\n\t\t]),\n\t\tvertexShader: Y.meshmatcap_vert,\n\t\tfragmentShader: Y.meshmatcap_frag\n\t},\n\tpoints: {\n\t\tuniforms: /*@__PURE__*/ aa([X.points, X.fog]),\n\t\tvertexShader: Y.points_vert,\n\t\tfragmentShader: Y.points_frag\n\t},\n\tdashed: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.fog,\n\t\t\t{\n\t\t\t\tscale: { value: 1 },\n\t\t\t\tdashSize: { value: 1 },\n\t\t\t\ttotalSize: { value: 2 }\n\t\t\t}\n\t\t]),\n\t\tvertexShader: Y.linedashed_vert,\n\t\tfragmentShader: Y.linedashed_frag\n\t},\n\tdepth: {\n\t\tuniforms: /*@__PURE__*/ aa([X.common, X.displacementmap]),\n\t\tvertexShader: Y.depth_vert,\n\t\tfragmentShader: Y.depth_frag\n\t},\n\tnormal: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.bumpmap,\n\t\t\tX.normalmap,\n\t\t\tX.displacementmap,\n\t\t\t{ opacity: { value: 1 } }\n\t\t]),\n\t\tvertexShader: Y.meshnormal_vert,\n\t\tfragmentShader: Y.meshnormal_frag\n\t},\n\tsprite: {\n\t\tuniforms: /*@__PURE__*/ aa([X.sprite, X.fog]),\n\t\tvertexShader: Y.sprite_vert,\n\t\tfragmentShader: Y.sprite_frag\n\t},\n\tbackground: {\n\t\tuniforms: {\n\t\t\tuvTransform: { value: /*@__PURE__*/ new q() },\n\t\t\tt2D: { value: null },\n\t\t\tbackgroundIntensity: { value: 1 }\n\t\t},\n\t\tvertexShader: Y.background_vert,\n\t\tfragmentShader: Y.background_frag\n\t},\n\tbackgroundCube: {\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\tbackgroundBlurriness: { value: 0 },\n\t\t\tbackgroundIntensity: { value: 1 },\n\t\t\tbackgroundRotation: { value: /*@__PURE__*/ new q() }\n\t\t},\n\t\tvertexShader: Y.backgroundCube_vert,\n\t\tfragmentShader: Y.backgroundCube_frag\n\t},\n\tcube: {\n\t\tuniforms: {\n\t\t\ttCube: { value: null },\n\t\t\ttFlip: { value: -1 },\n\t\t\topacity: { value: 1 }\n\t\t},\n\t\tvertexShader: Y.cube_vert,\n\t\tfragmentShader: Y.cube_frag\n\t},\n\tequirect: {\n\t\tuniforms: { tEquirect: { value: null } },\n\t\tvertexShader: Y.equirect_vert,\n\t\tfragmentShader: Y.equirect_frag\n\t},\n\tdistance: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.common,\n\t\t\tX.displacementmap,\n\t\t\t{\n\t\t\t\treferencePosition: { value: /*@__PURE__*/ new K() },\n\t\t\t\tnearDistance: { value: 1 },\n\t\t\t\tfarDistance: { value: 1e3 }\n\t\t\t}\n\t\t]),\n\t\tvertexShader: Y.distance_vert,\n\t\tfragmentShader: Y.distance_frag\n\t},\n\tshadow: {\n\t\tuniforms: /*@__PURE__*/ aa([\n\t\t\tX.lights,\n\t\t\tX.fog,\n\t\t\t{\n\t\t\t\tcolor: { value: /*@__PURE__*/ new fr(0) },\n\t\t\t\topacity: { value: 1 }\n\t\t\t}\n\t\t]),\n\t\tvertexShader: Y.shadow_vert,\n\t\tfragmentShader: Y.shadow_frag\n\t}\n};\nco.physical = {\n\tuniforms: /*@__PURE__*/ aa([co.standard.uniforms, {\n\t\tclearcoat: { value: 0 },\n\t\tclearcoatMap: { value: null },\n\t\tclearcoatMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tclearcoatNormalMap: { value: null },\n\t\tclearcoatNormalMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tclearcoatNormalScale: { value: /*@__PURE__*/ new G(1, 1) },\n\t\tclearcoatRoughness: { value: 0 },\n\t\tclearcoatRoughnessMap: { value: null },\n\t\tclearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tdispersion: { value: 0 },\n\t\tiridescence: { value: 0 },\n\t\tiridescenceMap: { value: null },\n\t\tiridescenceMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tiridescenceIOR: { value: 1.3 },\n\t\tiridescenceThicknessMinimum: { value: 100 },\n\t\tiridescenceThicknessMaximum: { value: 400 },\n\t\tiridescenceThicknessMap: { value: null },\n\t\tiridescenceThicknessMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tsheen: { value: 0 },\n\t\tsheenColor: { value: /*@__PURE__*/ new fr(0) },\n\t\tsheenColorMap: { value: null },\n\t\tsheenColorMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tsheenRoughness: { value: 1 },\n\t\tsheenRoughnessMap: { value: null },\n\t\tsheenRoughnessMapTransform: { value: /*@__PURE__*/ new q() },\n\t\ttransmission: { value: 0 },\n\t\ttransmissionMap: { value: null },\n\t\ttransmissionMapTransform: { value: /*@__PURE__*/ new q() },\n\t\ttransmissionSamplerSize: { value: /*@__PURE__*/ new G() },\n\t\ttransmissionSamplerMap: { value: null },\n\t\tthickness: { value: 0 },\n\t\tthicknessMap: { value: null },\n\t\tthicknessMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tattenuationDistance: { value: 0 },\n\t\tattenuationColor: { value: /*@__PURE__*/ new fr(0) },\n\t\tspecularColor: { value: /*@__PURE__*/ new fr(1, 1, 1) },\n\t\tspecularColorMap: { value: null },\n\t\tspecularColorMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tspecularIntensity: { value: 1 },\n\t\tspecularIntensityMap: { value: null },\n\t\tspecularIntensityMapTransform: { value: /*@__PURE__*/ new q() },\n\t\tanisotropyVector: { value: /*@__PURE__*/ new G() },\n\t\tanisotropyMap: { value: null },\n\t\tanisotropyMapTransform: { value: /*@__PURE__*/ new q() }\n\t}]),\n\tvertexShader: Y.meshphysical_vert,\n\tfragmentShader: Y.meshphysical_frag\n};\nvar lo = {\n\tr: 0,\n\tb: 0,\n\tg: 0\n}, uo = /*@__PURE__*/ new J(), fo = /*@__PURE__*/ new q();\nfo.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);\nfunction po(e, t, n, r, i, a) {\n\tlet o = new fr(0), s = i === !0 ? 0 : 1, c, l, u = null, d = 0, f = null;\n\tfunction p(e) {\n\t\tlet n = e.isScene === !0 ? e.background : null;\n\t\tif (n && n.isTexture) {\n\t\t\tlet r = e.backgroundBlurriness > 0;\n\t\t\tn = t.get(n, r);\n\t\t}\n\t\treturn n;\n\t}\n\tfunction m(t) {\n\t\tlet r = !1, i = p(t);\n\t\ti === null ? g(o, s) : i && i.isColor && (g(i, 1), r = !0);\n\t\tlet c = e.xr.getEnvironmentBlendMode();\n\t\tc === \"additive\" ? n.buffers.color.setClear(0, 0, 0, 1, a) : c === \"alpha-blend\" && n.buffers.color.setClear(0, 0, 0, 0, a), (e.autoClear || r) && (n.buffers.depth.setTest(!0), n.buffers.depth.setMask(!0), n.buffers.color.setMask(!0), e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil));\n\t}\n\tfunction h(t, n) {\n\t\tlet i = p(n);\n\t\ti && (i.isCubeTexture || i.mapping === 306) ? (l === void 0 && (l = new Ii(new $i(1, 1, 1), new fa({\n\t\t\tname: \"BackgroundCubeMaterial\",\n\t\t\tuniforms: ia(co.backgroundCube.uniforms),\n\t\t\tvertexShader: co.backgroundCube.vertexShader,\n\t\t\tfragmentShader: co.backgroundCube.fragmentShader,\n\t\t\tside: 1,\n\t\t\tdepthTest: !1,\n\t\t\tdepthWrite: !1,\n\t\t\tfog: !1,\n\t\t\tallowOverride: !1\n\t\t})), l.geometry.deleteAttribute(\"normal\"), l.geometry.deleteAttribute(\"uv\"), l.onBeforeRender = function(e, t, n) {\n\t\t\tthis.matrixWorld.copyPosition(n.matrixWorld);\n\t\t}, Object.defineProperty(l.material, \"envMap\", { get: function() {\n\t\t\treturn this.uniforms.envMap.value;\n\t\t} }), r.update(l)), l.material.uniforms.envMap.value = i, l.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.uniforms.backgroundRotation.value.setFromMatrix4(uo.makeRotationFromEuler(n.backgroundRotation)).transpose(), i.isCubeTexture && i.isRenderTargetTexture === !1 && l.material.uniforms.backgroundRotation.value.premultiply(fo), l.material.toneMapped = gn.getTransfer(i.colorSpace) !== bt, (u !== i || d !== i.version || f !== e.toneMapping) && (l.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null)) : i && i.isTexture && (c === void 0 && (c = new Ii(new na(2, 2), new fa({\n\t\t\tname: \"BackgroundMaterial\",\n\t\t\tuniforms: ia(co.background.uniforms),\n\t\t\tvertexShader: co.background.vertexShader,\n\t\t\tfragmentShader: co.background.fragmentShader,\n\t\t\tside: 0,\n\t\t\tdepthTest: !1,\n\t\t\tdepthWrite: !1,\n\t\t\tfog: !1,\n\t\t\tallowOverride: !1\n\t\t})), c.geometry.deleteAttribute(\"normal\"), Object.defineProperty(c.material, \"map\", { get: function() {\n\t\t\treturn this.uniforms.t2D.value;\n\t\t} }), r.update(c)), c.material.uniforms.t2D.value = i, c.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, c.material.toneMapped = gn.getTransfer(i.colorSpace) !== bt, i.matrixAutoUpdate === !0 && i.updateMatrix(), c.material.uniforms.uvTransform.value.copy(i.matrix), (u !== i || d !== i.version || f !== e.toneMapping) && (c.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), c.layers.enableAll(), t.unshift(c, c.geometry, c.material, 0, 0, null));\n\t}\n\tfunction g(t, r) {\n\t\tt.getRGB(lo, ca(e)), n.buffers.color.setClear(lo.r, lo.g, lo.b, r, a);\n\t}\n\tfunction _() {\n\t\tl !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0), c !== void 0 && (c.geometry.dispose(), c.material.dispose(), c = void 0);\n\t}\n\treturn {\n\t\tgetClearColor: function() {\n\t\t\treturn o;\n\t\t},\n\t\tsetClearColor: function(e, t = 1) {\n\t\t\to.set(e), s = t, g(o, s);\n\t\t},\n\t\tgetClearAlpha: function() {\n\t\t\treturn s;\n\t\t},\n\t\tsetClearAlpha: function(e) {\n\t\t\ts = e, g(o, s);\n\t\t},\n\t\trender: m,\n\t\taddToRenderList: h,\n\t\tdispose: _\n\t};\n}\nfunction mo(e, t) {\n\tlet n = e.getParameter(e.MAX_VERTEX_ATTRIBS), r = {}, i = f(null), a = i, o = !1;\n\tfunction s(n, r, i, s, c) {\n\t\tlet u = !1, f = d(n, s, i, r);\n\t\ta !== f && (a = f, l(a.object)), u = p(n, s, i, c), u && m(n, s, i, c), c !== null && t.update(c, e.ELEMENT_ARRAY_BUFFER), (u || o) && (o = !1, b(n, r, i, s), c !== null && e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, t.get(c).buffer));\n\t}\n\tfunction c() {\n\t\treturn e.createVertexArray();\n\t}\n\tfunction l(t) {\n\t\treturn e.bindVertexArray(t);\n\t}\n\tfunction u(t) {\n\t\treturn e.deleteVertexArray(t);\n\t}\n\tfunction d(e, t, n, i) {\n\t\tlet a = i.wireframe === !0, o = r[t.id];\n\t\to === void 0 && (o = {}, r[t.id] = o);\n\t\tlet s = e.isInstancedMesh === !0 ? e.id : 0, l = o[s];\n\t\tl === void 0 && (l = {}, o[s] = l);\n\t\tlet u = l[n.id];\n\t\tu === void 0 && (u = {}, l[n.id] = u);\n\t\tlet d = u[a];\n\t\treturn d === void 0 && (d = f(c()), u[a] = d), d;\n\t}\n\tfunction f(e) {\n\t\tlet t = [], r = [], i = [];\n\t\tfor (let e = 0; e < n; e++) t[e] = 0, r[e] = 0, i[e] = 0;\n\t\treturn {\n\t\t\tgeometry: null,\n\t\t\tprogram: null,\n\t\t\twireframe: !1,\n\t\t\tnewAttributes: t,\n\t\t\tenabledAttributes: r,\n\t\t\tattributeDivisors: i,\n\t\t\tobject: e,\n\t\t\tattributes: {},\n\t\t\tindex: null\n\t\t};\n\t}\n\tfunction p(e, t, n, r) {\n\t\tlet i = a.attributes, o = t.attributes, s = 0, c = n.getAttributes();\n\t\tfor (let t in c) if (c[t].location >= 0) {\n\t\t\tlet n = i[t], r = o[t];\n\t\t\tif (r === void 0 && (t === \"instanceMatrix\" && e.instanceMatrix && (r = e.instanceMatrix), t === \"instanceColor\" && e.instanceColor && (r = e.instanceColor)), n === void 0 || n.attribute !== r || r && n.data !== r.data) return !0;\n\t\t\ts++;\n\t\t}\n\t\treturn a.attributesNum !== s || a.index !== r;\n\t}\n\tfunction m(e, t, n, r) {\n\t\tlet i = {}, o = t.attributes, s = 0, c = n.getAttributes();\n\t\tfor (let t in c) if (c[t].location >= 0) {\n\t\t\tlet n = o[t];\n\t\t\tn === void 0 && (t === \"instanceMatrix\" && e.instanceMatrix && (n = e.instanceMatrix), t === \"instanceColor\" && e.instanceColor && (n = e.instanceColor));\n\t\t\tlet r = {};\n\t\t\tr.attribute = n, n && n.data && (r.data = n.data), i[t] = r, s++;\n\t\t}\n\t\ta.attributes = i, a.attributesNum = s, a.index = r;\n\t}\n\tfunction h() {\n\t\tlet e = a.newAttributes;\n\t\tfor (let t = 0, n = e.length; t < n; t++) e[t] = 0;\n\t}\n\tfunction g(e) {\n\t\t_(e, 0);\n\t}\n\tfunction _(t, n) {\n\t\tlet r = a.newAttributes, i = a.enabledAttributes, o = a.attributeDivisors;\n\t\tr[t] = 1, i[t] === 0 && (e.enableVertexAttribArray(t), i[t] = 1), o[t] !== n && (e.vertexAttribDivisor(t, n), o[t] = n);\n\t}\n\tfunction v() {\n\t\tlet t = a.newAttributes, n = a.enabledAttributes;\n\t\tfor (let r = 0, i = n.length; r < i; r++) n[r] !== t[r] && (e.disableVertexAttribArray(r), n[r] = 0);\n\t}\n\tfunction y(t, n, r, i, a, o, s) {\n\t\ts === !0 ? e.vertexAttribIPointer(t, n, r, a, o) : e.vertexAttribPointer(t, n, r, i, a, o);\n\t}\n\tfunction b(n, r, i, a) {\n\t\th();\n\t\tlet o = a.attributes, s = i.getAttributes(), c = r.defaultAttributeValues;\n\t\tfor (let r in s) {\n\t\t\tlet i = s[r];\n\t\t\tif (i.location >= 0) {\n\t\t\t\tlet s = o[r];\n\t\t\t\tif (s === void 0 && (r === \"instanceMatrix\" && n.instanceMatrix && (s = n.instanceMatrix), r === \"instanceColor\" && n.instanceColor && (s = n.instanceColor)), s !== void 0) {\n\t\t\t\t\tlet r = s.normalized, o = s.itemSize, c = t.get(s);\n\t\t\t\t\tif (c === void 0) continue;\n\t\t\t\t\tlet l = c.buffer, u = c.type, d = c.bytesPerElement, f = u === e.INT || u === e.UNSIGNED_INT || s.gpuType === 1013;\n\t\t\t\t\tif (s.isInterleavedBufferAttribute) {\n\t\t\t\t\t\tlet t = s.data, c = t.stride, p = s.offset;\n\t\t\t\t\t\tif (t.isInstancedInterleavedBuffer) {\n\t\t\t\t\t\t\tfor (let e = 0; e < i.locationSize; e++) _(i.location + e, t.meshPerAttribute);\n\t\t\t\t\t\t\tn.isInstancedMesh !== !0 && a._maxInstanceCount === void 0 && (a._maxInstanceCount = t.meshPerAttribute * t.count);\n\t\t\t\t\t\t} else for (let e = 0; e < i.locationSize; e++) g(i.location + e);\n\t\t\t\t\t\te.bindBuffer(e.ARRAY_BUFFER, l);\n\t\t\t\t\t\tfor (let e = 0; e < i.locationSize; e++) y(i.location + e, o / i.locationSize, u, r, c * d, (p + o / i.locationSize * e) * d, f);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (s.isInstancedBufferAttribute) {\n\t\t\t\t\t\t\tfor (let e = 0; e < i.locationSize; e++) _(i.location + e, s.meshPerAttribute);\n\t\t\t\t\t\t\tn.isInstancedMesh !== !0 && a._maxInstanceCount === void 0 && (a._maxInstanceCount = s.meshPerAttribute * s.count);\n\t\t\t\t\t\t} else for (let e = 0; e < i.locationSize; e++) g(i.location + e);\n\t\t\t\t\t\te.bindBuffer(e.ARRAY_BUFFER, l);\n\t\t\t\t\t\tfor (let e = 0; e < i.locationSize; e++) y(i.location + e, o / i.locationSize, u, r, o * d, o / i.locationSize * e * d, f);\n\t\t\t\t\t}\n\t\t\t\t} else if (c !== void 0) {\n\t\t\t\t\tlet t = c[r];\n\t\t\t\t\tif (t !== void 0) switch (t.length) {\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\te.vertexAttrib2fv(i.location, t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\te.vertexAttrib3fv(i.location, t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\te.vertexAttrib4fv(i.location, t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault: e.vertexAttrib1fv(i.location, t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tv();\n\t}\n\tfunction x() {\n\t\tT();\n\t\tfor (let e in r) {\n\t\t\tlet t = r[e];\n\t\t\tfor (let e in t) {\n\t\t\t\tlet n = t[e];\n\t\t\t\tfor (let e in n) {\n\t\t\t\t\tlet t = n[e];\n\t\t\t\t\tfor (let e in t) u(t[e].object), delete t[e];\n\t\t\t\t\tdelete n[e];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete r[e];\n\t\t}\n\t}\n\tfunction S(e) {\n\t\tif (r[e.id] === void 0) return;\n\t\tlet t = r[e.id];\n\t\tfor (let e in t) {\n\t\t\tlet n = t[e];\n\t\t\tfor (let e in n) {\n\t\t\t\tlet t = n[e];\n\t\t\t\tfor (let e in t) u(t[e].object), delete t[e];\n\t\t\t\tdelete n[e];\n\t\t\t}\n\t\t}\n\t\tdelete r[e.id];\n\t}\n\tfunction C(e) {\n\t\tfor (let t in r) {\n\t\t\tlet n = r[t];\n\t\t\tfor (let t in n) {\n\t\t\t\tlet r = n[t];\n\t\t\t\tif (r[e.id] === void 0) continue;\n\t\t\t\tlet i = r[e.id];\n\t\t\t\tfor (let e in i) u(i[e].object), delete i[e];\n\t\t\t\tdelete r[e.id];\n\t\t\t}\n\t\t}\n\t}\n\tfunction w(e) {\n\t\tfor (let t in r) {\n\t\t\tlet n = r[t], i = e.isInstancedMesh === !0 ? e.id : 0, a = n[i];\n\t\t\tif (a !== void 0) {\n\t\t\t\tfor (let e in a) {\n\t\t\t\t\tlet t = a[e];\n\t\t\t\t\tfor (let e in t) u(t[e].object), delete t[e];\n\t\t\t\t\tdelete a[e];\n\t\t\t\t}\n\t\t\t\tdelete n[i], Object.keys(n).length === 0 && delete r[t];\n\t\t\t}\n\t\t}\n\t}\n\tfunction T() {\n\t\tE(), o = !0, a !== i && (a = i, l(a.object));\n\t}\n\tfunction E() {\n\t\ti.geometry = null, i.program = null, i.wireframe = !1;\n\t}\n\treturn {\n\t\tsetup: s,\n\t\treset: T,\n\t\tresetDefaultState: E,\n\t\tdispose: x,\n\t\treleaseStatesOfGeometry: S,\n\t\treleaseStatesOfObject: w,\n\t\treleaseStatesOfProgram: C,\n\t\tinitAttributes: h,\n\t\tenableAttribute: g,\n\t\tdisableUnusedAttributes: v\n\t};\n}\nfunction ho(e, t, n) {\n\tlet r;\n\tfunction i(e) {\n\t\tr = e;\n\t}\n\tfunction a(t, i) {\n\t\te.drawArrays(r, t, i), n.update(i, r, 1);\n\t}\n\tfunction o(t, i, a) {\n\t\ta !== 0 && (e.drawArraysInstanced(r, t, i, a), n.update(i, r, a));\n\t}\n\tfunction s(e, i, a) {\n\t\tif (a === 0) return;\n\t\tt.get(\"WEBGL_multi_draw\").multiDrawArraysWEBGL(r, e, 0, i, 0, a);\n\t\tlet o = 0;\n\t\tfor (let e = 0; e < a; e++) o += i[e];\n\t\tn.update(o, r, 1);\n\t}\n\tthis.setMode = i, this.render = a, this.renderInstances = o, this.renderMultiDraw = s;\n}\nfunction go(e, t, n, r) {\n\tlet i;\n\tfunction a() {\n\t\tif (i !== void 0) return i;\n\t\tif (t.has(\"EXT_texture_filter_anisotropic\") === !0) {\n\t\t\tlet n = t.get(\"EXT_texture_filter_anisotropic\");\n\t\t\ti = e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n\t\t} else i = 0;\n\t\treturn i;\n\t}\n\tfunction o(t) {\n\t\treturn t === 1023 || r.convert(t) === e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT);\n\t}\n\tfunction s(n) {\n\t\tlet i = n === 1016 && (t.has(\"EXT_color_buffer_half_float\") || t.has(\"EXT_color_buffer_float\"));\n\t\treturn !(n !== 1009 && r.convert(n) !== e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE) && n !== 1015 && !i);\n\t}\n\tfunction c(t) {\n\t\tif (t === \"highp\") {\n\t\t\tif (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0) return \"highp\";\n\t\t\tt = \"mediump\";\n\t\t}\n\t\treturn t === \"mediump\" && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? \"mediump\" : \"lowp\";\n\t}\n\tlet l = n.precision === void 0 ? \"highp\" : n.precision, u = c(l);\n\tu !== l && (H(\"WebGLRenderer:\", l, \"not supported, using\", u, \"instead.\"), l = u);\n\tlet d = n.logarithmicDepthBuffer === !0, f = n.reversedDepthBuffer === !0 && t.has(\"EXT_clip_control\");\n\tn.reversedDepthBuffer === !0 && f === !1 && H(\"WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.\");\n\tlet p = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), m = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS), h = e.getParameter(e.MAX_TEXTURE_SIZE), g = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), _ = e.getParameter(e.MAX_VERTEX_ATTRIBS), v = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), y = e.getParameter(e.MAX_VARYING_VECTORS), b = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), x = e.getParameter(e.MAX_SAMPLES), S = e.getParameter(e.SAMPLES);\n\treturn {\n\t\tisWebGL2: !0,\n\t\tgetMaxAnisotropy: a,\n\t\tgetMaxPrecision: c,\n\t\ttextureFormatReadable: o,\n\t\ttextureTypeReadable: s,\n\t\tprecision: l,\n\t\tlogarithmicDepthBuffer: d,\n\t\treversedDepthBuffer: f,\n\t\tmaxTextures: p,\n\t\tmaxVertexTextures: m,\n\t\tmaxTextureSize: h,\n\t\tmaxCubemapSize: g,\n\t\tmaxAttributes: _,\n\t\tmaxVertexUniforms: v,\n\t\tmaxVaryings: y,\n\t\tmaxFragmentUniforms: b,\n\t\tmaxSamples: x,\n\t\tsamples: S\n\t};\n}\nfunction _o(e) {\n\tlet t = this, n = null, r = 0, i = !1, a = !1, o = new Wi(), s = new q(), c = {\n\t\tvalue: null,\n\t\tneedsUpdate: !1\n\t};\n\tthis.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(e, t) {\n\t\tlet n = e.length !== 0 || t || r !== 0 || i;\n\t\treturn i = t, r = e.length, n;\n\t}, this.beginShadows = function() {\n\t\ta = !0, u(null);\n\t}, this.endShadows = function() {\n\t\ta = !1;\n\t}, this.setGlobalState = function(e, t) {\n\t\tn = u(e, t, 0);\n\t}, this.setState = function(t, o, s) {\n\t\tlet d = t.clippingPlanes, f = t.clipIntersection, p = t.clipShadows, m = e.get(t);\n\t\tif (!i || d === null || d.length === 0 || a && !p) a ? u(null) : l();\n\t\telse {\n\t\t\tlet e = a ? 0 : r, t = e * 4, i = m.clippingState || null;\n\t\t\tc.value = i, i = u(d, o, t, s);\n\t\t\tfor (let e = 0; e !== t; ++e) i[e] = n[e];\n\t\t\tm.clippingState = i, this.numIntersection = f ? this.numPlanes : 0, this.numPlanes += e;\n\t\t}\n\t};\n\tfunction l() {\n\t\tc.value !== n && (c.value = n, c.needsUpdate = r > 0), t.numPlanes = r, t.numIntersection = 0;\n\t}\n\tfunction u(e, n, r, i) {\n\t\tlet a = e === null ? 0 : e.length, l = null;\n\t\tif (a !== 0) {\n\t\t\tif (l = c.value, i !== !0 || l === null) {\n\t\t\t\tlet t = r + a * 4, i = n.matrixWorldInverse;\n\t\t\t\ts.getNormalMatrix(i), (l === null || l.length < t) && (l = new Float32Array(t));\n\t\t\t\tfor (let t = 0, n = r; t !== a; ++t, n += 4) o.copy(e[t]).applyMatrix4(i, s), o.normal.toArray(l, n), l[n + 3] = o.constant;\n\t\t\t}\n\t\t\tc.value = l, c.needsUpdate = !0;\n\t\t}\n\t\treturn t.numPlanes = a, t.numIntersection = 0, l;\n\t}\n}\nvar vo = 4, yo = [\n\t.125,\n\t.215,\n\t.35,\n\t.446,\n\t.526,\n\t.582\n], bo = 20, xo = 256, So = /*@__PURE__*/ new Ra(), Co = /*@__PURE__*/ new fr(), wo = null, To = 0, Eo = 0, Do = !1, Oo = /*@__PURE__*/ new K(), ko = class {\n\tconstructor(e) {\n\t\tthis._renderer = e, this._pingPongRenderTarget = null, this._lodMax = 0, this._cubeSize = 0, this._sizeLods = [], this._sigmas = [], this._lodMeshes = [], this._backgroundBox = null, this._cubemapMaterial = null, this._equirectMaterial = null, this._blurMaterial = null, this._ggxMaterial = null;\n\t}\n\tfromScene(e, t = 0, n = .1, r = 100, i = {}) {\n\t\tlet { size: a = 256, position: o = Oo } = i;\n\t\two = this._renderer.getRenderTarget(), To = this._renderer.getActiveCubeFace(), Eo = this._renderer.getActiveMipmapLevel(), Do = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);\n\t\tlet s = this._allocateTargets();\n\t\treturn s.depthBuffer = !0, this._sceneToCubeUV(e, n, r, s, o), t > 0 && this._blur(s, 0, 0, t), this._applyPMREM(s), this._cleanup(s), s;\n\t}\n\tfromEquirectangular(e, t = null) {\n\t\treturn this._fromTexture(e, t);\n\t}\n\tfromCubemap(e, t = null) {\n\t\treturn this._fromTexture(e, t);\n\t}\n\tcompileCubemapShader() {\n\t\tthis._cubemapMaterial === null && (this._cubemapMaterial = Io(), this._compileMaterial(this._cubemapMaterial));\n\t}\n\tcompileEquirectangularShader() {\n\t\tthis._equirectMaterial === null && (this._equirectMaterial = Fo(), this._compileMaterial(this._equirectMaterial));\n\t}\n\tdispose() {\n\t\tthis._dispose(), this._cubemapMaterial !== null && this._cubemapMaterial.dispose(), this._equirectMaterial !== null && this._equirectMaterial.dispose(), this._backgroundBox !== null && (this._backgroundBox.geometry.dispose(), this._backgroundBox.material.dispose());\n\t}\n\t_setSize(e) {\n\t\tthis._lodMax = Math.floor(Math.log2(e)), this._cubeSize = 2 ** this._lodMax;\n\t}\n\t_dispose() {\n\t\tthis._blurMaterial !== null && this._blurMaterial.dispose(), this._ggxMaterial !== null && this._ggxMaterial.dispose(), this._pingPongRenderTarget !== null && this._pingPongRenderTarget.dispose();\n\t\tfor (let e = 0; e < this._lodMeshes.length; e++) this._lodMeshes[e].geometry.dispose();\n\t}\n\t_cleanup(e) {\n\t\tthis._renderer.setRenderTarget(wo, To, Eo), this._renderer.xr.enabled = Do, e.scissorTest = !1, Mo(e, 0, 0, e.width, e.height);\n\t}\n\t_fromTexture(e, t) {\n\t\te.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), wo = this._renderer.getRenderTarget(), To = this._renderer.getActiveCubeFace(), Eo = this._renderer.getActiveMipmapLevel(), Do = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;\n\t\tlet n = t || this._allocateTargets();\n\t\treturn this._textureToCubeUV(e, n), this._applyPMREM(n), this._cleanup(n), n;\n\t}\n\t_allocateTargets() {\n\t\tlet e = 3 * Math.max(this._cubeSize, 112), t = 4 * this._cubeSize, n = {\n\t\t\tmagFilter: R,\n\t\t\tminFilter: R,\n\t\t\tgenerateMipmaps: !1,\n\t\t\ttype: me,\n\t\t\tformat: Se,\n\t\t\tcolorSpace: vt,\n\t\t\tdepthBuffer: !1\n\t\t}, r = jo(e, t, n);\n\t\tif (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {\n\t\t\tthis._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = jo(e, t, n);\n\t\t\tlet { _lodMax: r } = this;\n\t\t\t({lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas} = Ao(r)), this._blurMaterial = Po(r, e, t), this._ggxMaterial = No(r, e, t);\n\t\t}\n\t\treturn r;\n\t}\n\t_compileMaterial(e) {\n\t\tlet t = new Ii(new pi(), e);\n\t\tthis._renderer.compile(t, So);\n\t}\n\t_sceneToCubeUV(e, t, n, r, i) {\n\t\tlet a = new La(90, 1, t, n), o = [\n\t\t\t1,\n\t\t\t-1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1\n\t\t], s = [\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\t-1\n\t\t], c = this._renderer, l = c.autoClear, u = c.toneMapping;\n\t\tc.getClearColor(Co), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new Ii(new $i(), new wi({\n\t\t\tname: \"PMREM.Background\",\n\t\t\tside: 1,\n\t\t\tdepthWrite: !1,\n\t\t\tdepthTest: !1\n\t\t})));\n\t\tlet d = this._backgroundBox, f = d.material, p = !1, m = e.background;\n\t\tm ? m.isColor && (f.color.copy(m), e.background = null, p = !0) : (f.color.copy(Co), p = !0);\n\t\tfor (let t = 0; t < 6; t++) {\n\t\t\tlet n = t % 3;\n\t\t\tn === 0 ? (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x + s[t], i.y, i.z)) : n === 1 ? (a.up.set(0, 0, o[t]), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y + s[t], i.z)) : (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y, i.z + s[t]));\n\t\t\tlet l = this._cubeSize;\n\t\t\tMo(r, n * l, t > 2 ? l : 0, l, l), c.setRenderTarget(r), p && c.render(d, a), c.render(e, a);\n\t\t}\n\t\tc.toneMapping = u, c.autoClear = l, e.background = m;\n\t}\n\t_textureToCubeUV(e, t) {\n\t\tlet n = this._renderer, r = e.mapping === 301 || e.mapping === 302;\n\t\tr ? (this._cubemapMaterial === null && (this._cubemapMaterial = Io()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = Fo());\n\t\tlet i = r ? this._cubemapMaterial : this._equirectMaterial, a = this._lodMeshes[0];\n\t\ta.material = i;\n\t\tlet o = i.uniforms;\n\t\to.envMap.value = e;\n\t\tlet s = this._cubeSize;\n\t\tMo(t, 0, 0, 3 * s, 2 * s), n.setRenderTarget(t), n.render(a, So);\n\t}\n\t_applyPMREM(e) {\n\t\tlet t = this._renderer, n = t.autoClear;\n\t\tt.autoClear = !1;\n\t\tlet r = this._lodMeshes.length;\n\t\tfor (let t = 1; t < r; t++) this._applyGGXFilter(e, t - 1, t);\n\t\tt.autoClear = n;\n\t}\n\t_applyGGXFilter(e, t, n) {\n\t\tlet r = this._renderer, i = this._pingPongRenderTarget, a = this._ggxMaterial, o = this._lodMeshes[n];\n\t\to.material = a;\n\t\tlet s = a.uniforms, c = n / (this._lodMeshes.length - 1), l = t / (this._lodMeshes.length - 1), u = Math.sqrt(c * c - l * l) * (0 + c * 1.25), { _lodMax: d } = this, f = this._sizeLods[n], p = 3 * f * (n > d - vo ? n - d + vo : 0), m = 4 * (this._cubeSize - f);\n\t\ts.envMap.value = e.texture, s.roughness.value = u, s.mipInt.value = d - t, Mo(i, p, m, 3 * f, 2 * f), r.setRenderTarget(i), r.render(o, So), s.envMap.value = i.texture, s.roughness.value = 0, s.mipInt.value = d - n, Mo(e, p, m, 3 * f, 2 * f), r.setRenderTarget(e), r.render(o, So);\n\t}\n\t_blur(e, t, n, r, i) {\n\t\tlet a = this._pingPongRenderTarget;\n\t\tthis._halfBlur(e, a, t, n, r, \"latitudinal\", i), this._halfBlur(a, e, n, n, r, \"longitudinal\", i);\n\t}\n\t_halfBlur(e, t, n, r, i, a, o) {\n\t\tlet s = this._renderer, c = this._blurMaterial;\n\t\ta !== \"latitudinal\" && a !== \"longitudinal\" && U(\"blur direction must be either latitudinal or longitudinal!\");\n\t\tlet l = this._lodMeshes[r];\n\t\tl.material = c;\n\t\tlet u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / 39, p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : bo;\n\t\tm > bo && H(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${bo}`);\n\t\tlet h = [], g = 0;\n\t\tfor (let e = 0; e < bo; ++e) {\n\t\t\tlet t = e / p, n = Math.exp(-t * t / 2);\n\t\t\th.push(n), e === 0 ? g += n : e < m && (g += 2 * n);\n\t\t}\n\t\tfor (let e = 0; e < h.length; e++) h[e] = h[e] / g;\n\t\tu.envMap.value = e.texture, u.samples.value = m, u.weights.value = h, u.latitudinal.value = a === \"latitudinal\", o && (u.poleAxis.value = o);\n\t\tlet { _lodMax: _ } = this;\n\t\tu.dTheta.value = f, u.mipInt.value = _ - n;\n\t\tlet v = this._sizeLods[r];\n\t\tMo(t, 3 * v * (r > _ - vo ? r - _ + vo : 0), 4 * (this._cubeSize - v), 3 * v, 2 * v), s.setRenderTarget(t), s.render(l, So);\n\t}\n};\nfunction Ao(e) {\n\tlet t = [], n = [], r = [], i = e, a = e - vo + 1 + yo.length;\n\tfor (let o = 0; o < a; o++) {\n\t\tlet a = 2 ** i;\n\t\tt.push(a);\n\t\tlet s = 1 / a;\n\t\to > e - vo ? s = yo[o - e + vo - 1] : o === 0 && (s = 0), n.push(s);\n\t\tlet c = 1 / (a - 2), l = -c, u = 1 + c, d = [\n\t\t\tl,\n\t\t\tl,\n\t\t\tu,\n\t\t\tl,\n\t\t\tu,\n\t\t\tu,\n\t\t\tl,\n\t\t\tl,\n\t\t\tu,\n\t\t\tu,\n\t\t\tl,\n\t\t\tu\n\t\t], f = /* @__PURE__ */ new Float32Array(108), p = /* @__PURE__ */ new Float32Array(72), m = /* @__PURE__ */ new Float32Array(36);\n\t\tfor (let e = 0; e < 6; e++) {\n\t\t\tlet t = e % 3 * 2 / 3 - 1, n = e > 2 ? 0 : -1, r = [\n\t\t\t\tt,\n\t\t\t\tn,\n\t\t\t\t0,\n\t\t\t\tt + 2 / 3,\n\t\t\t\tn,\n\t\t\t\t0,\n\t\t\t\tt + 2 / 3,\n\t\t\t\tn + 1,\n\t\t\t\t0,\n\t\t\t\tt,\n\t\t\t\tn,\n\t\t\t\t0,\n\t\t\t\tt + 2 / 3,\n\t\t\t\tn + 1,\n\t\t\t\t0,\n\t\t\t\tt,\n\t\t\t\tn + 1,\n\t\t\t\t0\n\t\t\t];\n\t\t\tf.set(r, 18 * e), p.set(d, 12 * e);\n\t\t\tlet i = [\n\t\t\t\te,\n\t\t\t\te,\n\t\t\t\te,\n\t\t\t\te,\n\t\t\t\te,\n\t\t\t\te\n\t\t\t];\n\t\t\tm.set(i, 6 * e);\n\t\t}\n\t\tlet h = new pi();\n\t\th.setAttribute(\"position\", new Qr(f, 3)), h.setAttribute(\"uv\", new Qr(p, 2)), h.setAttribute(\"faceIndex\", new Qr(m, 1)), r.push(new Ii(h, null)), i > vo && i--;\n\t}\n\treturn {\n\t\tlodMeshes: r,\n\t\tsizeLods: t,\n\t\tsigmas: n\n\t};\n}\nfunction jo(e, t, n) {\n\tlet r = new kn(e, t, n);\n\treturn r.texture.mapping = 306, r.texture.name = \"PMREM.cubeUv\", r.scissorTest = !0, r;\n}\nfunction Mo(e, t, n, r, i) {\n\te.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i);\n}\nfunction No(e, t, n) {\n\treturn new fa({\n\t\tname: \"PMREMGGXConvolution\",\n\t\tdefines: {\n\t\t\tGGX_SAMPLES: xo,\n\t\t\tCUBEUV_TEXEL_WIDTH: 1 / t,\n\t\t\tCUBEUV_TEXEL_HEIGHT: 1 / n,\n\t\t\tCUBEUV_MAX_MIP: `${e}.0`\n\t\t},\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\troughness: { value: 0 },\n\t\t\tmipInt: { value: 0 }\n\t\t},\n\t\tvertexShader: Lo(),\n\t\tfragmentShader: \"\\n\\n\t\t\tprecision highp float;\\n\t\t\tprecision highp int;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform sampler2D envMap;\\n\t\t\tuniform float roughness;\\n\t\t\tuniform float mipInt;\\n\\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\\n\t\t\t#include <cube_uv_reflection_fragment>\\n\\n\t\t\t#define PI 3.14159265359\\n\\n\t\t\t// Van der Corput radical inverse\\n\t\t\tfloat radicalInverse_VdC(uint bits) {\\n\t\t\t\tbits = (bits << 16u) | (bits >> 16u);\\n\t\t\t\tbits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\\n\t\t\t\tbits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\\n\t\t\t\tbits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\\n\t\t\t\tbits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\\n\t\t\t\treturn float(bits) * 2.3283064365386963e-10; // / 0x100000000\\n\t\t\t}\\n\\n\t\t\t// Hammersley sequence\\n\t\t\tvec2 hammersley(uint i, uint N) {\\n\t\t\t\treturn vec2(float(i) / float(N), radicalInverse_VdC(i));\\n\t\t\t}\\n\\n\t\t\t// GGX VNDF importance sampling (Eric Heitz 2018)\\n\t\t\t// \\\"Sampling the GGX Distribution of Visible Normals\\\"\\n\t\t\t// https://jcgt.org/published/0007/04/01/\\n\t\t\tvec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {\\n\t\t\t\tfloat alpha = roughness * roughness;\\n\\n\t\t\t\t// Section 4.1: Orthonormal basis\\n\t\t\t\tvec3 T1 = vec3(1.0, 0.0, 0.0);\\n\t\t\t\tvec3 T2 = cross(V, T1);\\n\\n\t\t\t\t// Section 4.2: Parameterization of projected area\\n\t\t\t\tfloat r = sqrt(Xi.x);\\n\t\t\t\tfloat phi = 2.0 * PI * Xi.y;\\n\t\t\t\tfloat t1 = r * cos(phi);\\n\t\t\t\tfloat t2 = r * sin(phi);\\n\t\t\t\tfloat s = 0.5 * (1.0 + V.z);\\n\t\t\t\tt2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;\\n\\n\t\t\t\t// Section 4.3: Reprojection onto hemisphere\\n\t\t\t\tvec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;\\n\\n\t\t\t\t// Section 3.4: Transform back to ellipsoid configuration\\n\t\t\t\treturn normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));\\n\t\t\t}\\n\\n\t\t\tvoid main() {\\n\t\t\t\tvec3 N = normalize(vOutputDirection);\\n\t\t\t\tvec3 V = N; // Assume view direction equals normal for pre-filtering\\n\\n\t\t\t\tvec3 prefilteredColor = vec3(0.0);\\n\t\t\t\tfloat totalWeight = 0.0;\\n\\n\t\t\t\t// For very low roughness, just sample the environment directly\\n\t\t\t\tif (roughness < 0.001) {\\n\t\t\t\t\tgl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);\\n\t\t\t\t\treturn;\\n\t\t\t\t}\\n\\n\t\t\t\t// Tangent space basis for VNDF sampling\\n\t\t\t\tvec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\\n\t\t\t\tvec3 tangent = normalize(cross(up, N));\\n\t\t\t\tvec3 bitangent = cross(N, tangent);\\n\\n\t\t\t\tfor(uint i = 0u; i < uint(GGX_SAMPLES); i++) {\\n\t\t\t\t\tvec2 Xi = hammersley(i, uint(GGX_SAMPLES));\\n\\n\t\t\t\t\t// For PMREM, V = N, so in tangent space V is always (0, 0, 1)\\n\t\t\t\t\tvec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);\\n\\n\t\t\t\t\t// Transform H back to world space\\n\t\t\t\t\tvec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);\\n\t\t\t\t\tvec3 L = normalize(2.0 * dot(V, H) * H - V);\\n\\n\t\t\t\t\tfloat NdotL = max(dot(N, L), 0.0);\\n\\n\t\t\t\t\tif(NdotL > 0.0) {\\n\t\t\t\t\t\t// Sample environment at fixed mip level\\n\t\t\t\t\t\t// VNDF importance sampling handles the distribution filtering\\n\t\t\t\t\t\tvec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);\\n\\n\t\t\t\t\t\t// Weight by NdotL for the split-sum approximation\\n\t\t\t\t\t\t// VNDF PDF naturally accounts for the visible microfacet distribution\\n\t\t\t\t\t\tprefilteredColor += sampleColor * NdotL;\\n\t\t\t\t\t\ttotalWeight += NdotL;\\n\t\t\t\t\t}\\n\t\t\t\t}\\n\\n\t\t\t\tif (totalWeight > 0.0) {\\n\t\t\t\t\tprefilteredColor = prefilteredColor / totalWeight;\\n\t\t\t\t}\\n\\n\t\t\t\tgl_FragColor = vec4(prefilteredColor, 1.0);\\n\t\t\t}\\n\t\t\",\n\t\tblending: 0,\n\t\tdepthTest: !1,\n\t\tdepthWrite: !1\n\t});\n}\nfunction Po(e, t, n) {\n\tlet r = new Float32Array(bo), i = new K(0, 1, 0);\n\treturn new fa({\n\t\tname: \"SphericalGaussianBlur\",\n\t\tdefines: {\n\t\t\tn: bo,\n\t\t\tCUBEUV_TEXEL_WIDTH: 1 / t,\n\t\t\tCUBEUV_TEXEL_HEIGHT: 1 / n,\n\t\t\tCUBEUV_MAX_MIP: `${e}.0`\n\t\t},\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\tsamples: { value: 1 },\n\t\t\tweights: { value: r },\n\t\t\tlatitudinal: { value: !1 },\n\t\t\tdTheta: { value: 0 },\n\t\t\tmipInt: { value: 0 },\n\t\t\tpoleAxis: { value: i }\n\t\t},\n\t\tvertexShader: Lo(),\n\t\tfragmentShader: \"\\n\\n\t\t\tprecision mediump float;\\n\t\t\tprecision mediump int;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform sampler2D envMap;\\n\t\t\tuniform int samples;\\n\t\t\tuniform float weights[ n ];\\n\t\t\tuniform bool latitudinal;\\n\t\t\tuniform float dTheta;\\n\t\t\tuniform float mipInt;\\n\t\t\tuniform vec3 poleAxis;\\n\\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\\n\t\t\t#include <cube_uv_reflection_fragment>\\n\\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\\n\\n\t\t\t\tfloat cosTheta = cos( theta );\\n\t\t\t\t// Rodrigues' axis-angle rotation\\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\\n\\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\\n\\n\t\t\t}\\n\\n\t\t\tvoid main() {\\n\\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\\n\\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\\n\\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\\n\\n\t\t\t\t}\\n\\n\t\t\t\taxis = normalize( axis );\\n\\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\\n\\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\\n\\n\t\t\t\t\tif ( i >= samples ) {\\n\\n\t\t\t\t\t\tbreak;\\n\\n\t\t\t\t\t}\\n\\n\t\t\t\t\tfloat theta = dTheta * float( i );\\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\\n\\n\t\t\t\t}\\n\\n\t\t\t}\\n\t\t\",\n\t\tblending: 0,\n\t\tdepthTest: !1,\n\t\tdepthWrite: !1\n\t});\n}\nfunction Fo() {\n\treturn new fa({\n\t\tname: \"EquirectangularToCubeUV\",\n\t\tuniforms: { envMap: { value: null } },\n\t\tvertexShader: Lo(),\n\t\tfragmentShader: \"\\n\\n\t\t\tprecision mediump float;\\n\t\t\tprecision mediump int;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform sampler2D envMap;\\n\\n\t\t\t#include <common>\\n\\n\t\t\tvoid main() {\\n\\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\\n\\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\\n\\n\t\t\t}\\n\t\t\",\n\t\tblending: 0,\n\t\tdepthTest: !1,\n\t\tdepthWrite: !1\n\t});\n}\nfunction Io() {\n\treturn new fa({\n\t\tname: \"CubemapToCubeUV\",\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\tflipEnvMap: { value: -1 }\n\t\t},\n\t\tvertexShader: Lo(),\n\t\tfragmentShader: \"\\n\\n\t\t\tprecision mediump float;\\n\t\t\tprecision mediump int;\\n\\n\t\t\tuniform float flipEnvMap;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform samplerCube envMap;\\n\\n\t\t\tvoid main() {\\n\\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\\n\\n\t\t\t}\\n\t\t\",\n\t\tblending: 0,\n\t\tdepthTest: !1,\n\t\tdepthWrite: !1\n\t});\n}\nfunction Lo() {\n\treturn \"\\n\\n\t\tprecision mediump float;\\n\t\tprecision mediump int;\\n\\n\t\tattribute float faceIndex;\\n\\n\t\tvarying vec3 vOutputDirection;\\n\\n\t\t// RH coordinate system; PMREM face-indexing convention\\n\t\tvec3 getDirection( vec2 uv, float face ) {\\n\\n\t\t\tuv = 2.0 * uv - 1.0;\\n\\n\t\t\tvec3 direction = vec3( uv, 1.0 );\\n\\n\t\t\tif ( face == 0.0 ) {\\n\\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\\n\\n\t\t\t} else if ( face == 1.0 ) {\\n\\n\t\t\t\tdirection = direction.xzy;\\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\\n\\n\t\t\t} else if ( face == 2.0 ) {\\n\\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\\n\\n\t\t\t} else if ( face == 3.0 ) {\\n\\n\t\t\t\tdirection = direction.zyx;\\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\\n\\n\t\t\t} else if ( face == 4.0 ) {\\n\\n\t\t\t\tdirection = direction.xzy;\\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\\n\\n\t\t\t} else if ( face == 5.0 ) {\\n\\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\\n\\n\t\t\t}\\n\\n\t\t\treturn direction;\\n\\n\t\t}\\n\\n\t\tvoid main() {\\n\\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\\n\t\t\tgl_Position = vec4( position, 1.0 );\\n\\n\t\t}\\n\t\";\n}\nvar Ro = class extends kn {\n\tconstructor(e = 1, t = {}) {\n\t\tsuper(e, e, t), this.isWebGLCubeRenderTarget = !0;\n\t\tlet n = {\n\t\t\twidth: e,\n\t\t\theight: e,\n\t\t\tdepth: 1\n\t\t}, r = [\n\t\t\tn,\n\t\t\tn,\n\t\t\tn,\n\t\t\tn,\n\t\t\tn,\n\t\t\tn\n\t\t];\n\t\tthis.texture = new Yi(r), this._setTextureOptions(t), this.texture.isRenderTargetTexture = !0;\n\t}\n\tfromEquirectangularTexture(e, t) {\n\t\tthis.texture.type = t.type, this.texture.colorSpace = t.colorSpace, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter;\n\t\tlet n = {\n\t\t\tuniforms: { tEquirect: { value: null } },\n\t\t\tvertexShader: \"\\n\\n\t\t\t\tvarying vec3 vWorldDirection;\\n\\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n\\n\t\t\t\t}\\n\\n\t\t\t\tvoid main() {\\n\\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\n\t\t\t\t\t#include <begin_vertex>\\n\t\t\t\t\t#include <project_vertex>\\n\\n\t\t\t\t}\\n\t\t\t\",\n\t\t\tfragmentShader: \"\\n\\n\t\t\t\tuniform sampler2D tEquirect;\\n\\n\t\t\t\tvarying vec3 vWorldDirection;\\n\\n\t\t\t\t#include <common>\\n\\n\t\t\t\tvoid main() {\\n\\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\\n\\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\\n\\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\n\t\t\t\t}\\n\t\t\t\"\n\t\t}, r = new $i(5, 5, 5), i = new fa({\n\t\t\tname: \"CubemapFromEquirect\",\n\t\t\tuniforms: ia(n.uniforms),\n\t\t\tvertexShader: n.vertexShader,\n\t\t\tfragmentShader: n.fragmentShader,\n\t\t\tside: 1,\n\t\t\tblending: 0\n\t\t});\n\t\ti.uniforms.tEquirect.value = t;\n\t\tlet a = new Ii(r, i), o = t.minFilter;\n\t\treturn t.minFilter === 1008 && (t.minFilter = R), new Ha(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;\n\t}\n\tclear(e, t = !0, n = !0, r = !0) {\n\t\tlet i = e.getRenderTarget();\n\t\tfor (let i = 0; i < 6; i++) e.setRenderTarget(this, i), e.clear(t, n, r);\n\t\te.setRenderTarget(i);\n\t}\n};\nfunction zo(e) {\n\tlet t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = null;\n\tfunction i(e, t = !1) {\n\t\treturn e == null ? null : t ? o(e) : a(e);\n\t}\n\tfunction a(n) {\n\t\tif (n && n.isTexture) {\n\t\t\tlet r = n.mapping;\n\t\t\tif (r === 303 || r === 304) {\n\t\t\t\tif (t.has(n)) {\n\t\t\t\t\tlet e = t.get(n).texture;\n\t\t\t\t\treturn s(e, n.mapping);\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\tlet r = n.image;\n\t\t\t\t\tif (r && r.height > 0) {\n\t\t\t\t\t\tlet i = new Ro(r.height);\n\t\t\t\t\t\treturn i.fromEquirectangularTexture(e, n), t.set(n, i), n.addEventListener(\"dispose\", l), s(i.texture, n.mapping);\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn n;\n\t}\n\tfunction o(t) {\n\t\tif (t && t.isTexture) {\n\t\t\tlet i = t.mapping, a = i === 303 || i === 304, o = i === 301 || i === 302;\n\t\t\tif (a || o) {\n\t\t\t\tlet i = n.get(t), s = i === void 0 ? 0 : i.texture.pmremVersion;\n\t\t\t\tif (t.isRenderTargetTexture && t.pmremVersion !== s) return r === null && (r = new ko(e)), i = a ? r.fromEquirectangular(t, i) : r.fromCubemap(t, i), i.texture.pmremVersion = t.pmremVersion, n.set(t, i), i.texture;\n\t\t\t\tif (i !== void 0) return i.texture;\n\t\t\t\t{\n\t\t\t\t\tlet s = t.image;\n\t\t\t\t\treturn a && s && s.height > 0 || o && s && c(s) ? (r === null && (r = new ko(e)), i = a ? r.fromEquirectangular(t) : r.fromCubemap(t), i.texture.pmremVersion = t.pmremVersion, n.set(t, i), t.addEventListener(\"dispose\", u), i.texture) : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn t;\n\t}\n\tfunction s(e, t) {\n\t\treturn t === 303 ? e.mapping = 301 : t === 304 && (e.mapping = 302), e;\n\t}\n\tfunction c(e) {\n\t\tlet t = 0;\n\t\tfor (let n = 0; n < 6; n++) e[n] !== void 0 && t++;\n\t\treturn t === 6;\n\t}\n\tfunction l(e) {\n\t\tlet n = e.target;\n\t\tn.removeEventListener(\"dispose\", l);\n\t\tlet r = t.get(n);\n\t\tr !== void 0 && (t.delete(n), r.dispose());\n\t}\n\tfunction u(e) {\n\t\tlet t = e.target;\n\t\tt.removeEventListener(\"dispose\", u);\n\t\tlet r = n.get(t);\n\t\tr !== void 0 && (n.delete(t), r.dispose());\n\t}\n\tfunction d() {\n\t\tt = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r !== null && (r.dispose(), r = null);\n\t}\n\treturn {\n\t\tget: i,\n\t\tdispose: d\n\t};\n}\nfunction Bo(e) {\n\tlet t = {};\n\tfunction n(n) {\n\t\tif (t[n] !== void 0) return t[n];\n\t\tlet r = e.getExtension(n);\n\t\treturn t[n] = r, r;\n\t}\n\treturn {\n\t\thas: function(e) {\n\t\t\treturn n(e) !== null;\n\t\t},\n\t\tinit: function() {\n\t\t\tn(\"EXT_color_buffer_float\"), n(\"WEBGL_clip_cull_distance\"), n(\"OES_texture_float_linear\"), n(\"EXT_color_buffer_half_float\"), n(\"WEBGL_multisampled_render_to_texture\"), n(\"WEBGL_render_shared_exponent\");\n\t\t},\n\t\tget: function(e) {\n\t\t\tlet t = n(e);\n\t\t\treturn t === null && Mt(\"WebGLRenderer: \" + e + \" extension not supported.\"), t;\n\t\t}\n\t};\n}\nfunction Vo(e, t, n, r) {\n\tlet i = {}, a = /* @__PURE__ */ new WeakMap();\n\tfunction o(e) {\n\t\tlet s = e.target;\n\t\ts.index !== null && t.remove(s.index);\n\t\tfor (let e in s.attributes) t.remove(s.attributes[e]);\n\t\ts.removeEventListener(\"dispose\", o), delete i[s.id];\n\t\tlet c = a.get(s);\n\t\tc && (t.remove(c), a.delete(s)), r.releaseStatesOfGeometry(s), s.isInstancedBufferGeometry === !0 && delete s._maxInstanceCount, n.memory.geometries--;\n\t}\n\tfunction s(e, t) {\n\t\treturn i[t.id] === !0 ? t : (t.addEventListener(\"dispose\", o), i[t.id] = !0, n.memory.geometries++, t);\n\t}\n\tfunction c(n) {\n\t\tlet r = n.attributes;\n\t\tfor (let n in r) t.update(r[n], e.ARRAY_BUFFER);\n\t}\n\tfunction l(e) {\n\t\tlet n = [], r = e.index, i = e.attributes.position, o = 0;\n\t\tif (i === void 0) return;\n\t\tif (r !== null) {\n\t\t\tlet e = r.array;\n\t\t\to = r.version;\n\t\t\tfor (let t = 0, r = e.length; t < r; t += 3) {\n\t\t\t\tlet r = e[t + 0], i = e[t + 1], a = e[t + 2];\n\t\t\t\tn.push(r, i, i, a, a, r);\n\t\t\t}\n\t\t} else {\n\t\t\tlet e = i.array;\n\t\t\to = i.version;\n\t\t\tfor (let t = 0, r = e.length / 3 - 1; t < r; t += 3) {\n\t\t\t\tlet e = t + 0, r = t + 1, i = t + 2;\n\t\t\t\tn.push(e, r, r, i, i, e);\n\t\t\t}\n\t\t}\n\t\tlet s = new (i.count >= 65535 ? ei : $r)(n, 1);\n\t\ts.version = o;\n\t\tlet c = a.get(e);\n\t\tc && t.remove(c), a.set(e, s);\n\t}\n\tfunction u(e) {\n\t\tlet t = a.get(e);\n\t\tif (t) {\n\t\t\tlet n = e.index;\n\t\t\tn !== null && t.version < n.version && l(e);\n\t\t} else l(e);\n\t\treturn a.get(e);\n\t}\n\treturn {\n\t\tget: s,\n\t\tupdate: c,\n\t\tgetWireframeAttribute: u\n\t};\n}\nfunction Ho(e, t, n) {\n\tlet r;\n\tfunction i(e) {\n\t\tr = e;\n\t}\n\tlet a, o;\n\tfunction s(e) {\n\t\ta = e.type, o = e.bytesPerElement;\n\t}\n\tfunction c(t, i) {\n\t\te.drawElements(r, i, a, t * o), n.update(i, r, 1);\n\t}\n\tfunction l(t, i, s) {\n\t\ts !== 0 && (e.drawElementsInstanced(r, i, a, t * o, s), n.update(i, r, s));\n\t}\n\tfunction u(e, i, o) {\n\t\tif (o === 0) return;\n\t\tt.get(\"WEBGL_multi_draw\").multiDrawElementsWEBGL(r, i, 0, a, e, 0, o);\n\t\tlet s = 0;\n\t\tfor (let e = 0; e < o; e++) s += i[e];\n\t\tn.update(s, r, 1);\n\t}\n\tthis.setMode = i, this.setIndex = s, this.render = c, this.renderInstances = l, this.renderMultiDraw = u;\n}\nfunction Uo(e) {\n\tlet t = {\n\t\tgeometries: 0,\n\t\ttextures: 0\n\t}, n = {\n\t\tframe: 0,\n\t\tcalls: 0,\n\t\ttriangles: 0,\n\t\tpoints: 0,\n\t\tlines: 0\n\t};\n\tfunction r(t, r, i) {\n\t\tswitch (n.calls++, r) {\n\t\t\tcase e.TRIANGLES:\n\t\t\t\tn.triangles += t / 3 * i;\n\t\t\t\tbreak;\n\t\t\tcase e.LINES:\n\t\t\t\tn.lines += t / 2 * i;\n\t\t\t\tbreak;\n\t\t\tcase e.LINE_STRIP:\n\t\t\t\tn.lines += i * (t - 1);\n\t\t\t\tbreak;\n\t\t\tcase e.LINE_LOOP:\n\t\t\t\tn.lines += i * t;\n\t\t\t\tbreak;\n\t\t\tcase e.POINTS:\n\t\t\t\tn.points += i * t;\n\t\t\t\tbreak;\n\t\t\tdefault: U(\"WebGLInfo: Unknown draw mode:\", r);\n\t\t}\n\t}\n\tfunction i() {\n\t\tn.calls = 0, n.triangles = 0, n.points = 0, n.lines = 0;\n\t}\n\treturn {\n\t\tmemory: t,\n\t\trender: n,\n\t\tprograms: null,\n\t\tautoReset: !0,\n\t\treset: i,\n\t\tupdate: r\n\t};\n}\nfunction Wo(e, t, n) {\n\tlet r = /* @__PURE__ */ new WeakMap(), i = new Dn();\n\tfunction a(a, o, s) {\n\t\tlet c = a.morphTargetInfluences, l = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, u = l === void 0 ? 0 : l.length, d = r.get(o);\n\t\tif (d === void 0 || d.count !== u) {\n\t\t\td !== void 0 && d.texture.dispose();\n\t\t\tlet e = o.morphAttributes.position !== void 0, n = o.morphAttributes.normal !== void 0, a = o.morphAttributes.color !== void 0, s = o.morphAttributes.position || [], c = o.morphAttributes.normal || [], l = o.morphAttributes.color || [], f = 0;\n\t\t\te === !0 && (f = 1), n === !0 && (f = 2), a === !0 && (f = 3);\n\t\t\tlet p = o.attributes.position.count * f, m = 1;\n\t\t\tp > t.maxTextureSize && (m = Math.ceil(p / t.maxTextureSize), p = t.maxTextureSize);\n\t\t\tlet h = new Float32Array(p * m * 4 * u), g = new An(h, p, m, u);\n\t\t\tg.type = pe, g.needsUpdate = !0;\n\t\t\tlet _ = f * 4;\n\t\t\tfor (let t = 0; t < u; t++) {\n\t\t\t\tlet r = s[t], o = c[t], u = l[t], d = p * m * 4 * t;\n\t\t\t\tfor (let t = 0; t < r.count; t++) {\n\t\t\t\t\tlet s = t * _;\n\t\t\t\t\te === !0 && (i.fromBufferAttribute(r, t), h[d + s + 0] = i.x, h[d + s + 1] = i.y, h[d + s + 2] = i.z, h[d + s + 3] = 0), n === !0 && (i.fromBufferAttribute(o, t), h[d + s + 4] = i.x, h[d + s + 5] = i.y, h[d + s + 6] = i.z, h[d + s + 7] = 0), a === !0 && (i.fromBufferAttribute(u, t), h[d + s + 8] = i.x, h[d + s + 9] = i.y, h[d + s + 10] = i.z, h[d + s + 11] = u.itemSize === 4 ? i.w : 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\td = {\n\t\t\t\tcount: u,\n\t\t\t\ttexture: g,\n\t\t\t\tsize: new G(p, m)\n\t\t\t}, r.set(o, d);\n\t\t\tfunction v() {\n\t\t\t\tg.dispose(), r.delete(o), o.removeEventListener(\"dispose\", v);\n\t\t\t}\n\t\t\to.addEventListener(\"dispose\", v);\n\t\t}\n\t\tif (a.isInstancedMesh === !0 && a.morphTexture !== null) s.getUniforms().setValue(e, \"morphTexture\", a.morphTexture, n);\n\t\telse {\n\t\t\tlet t = 0;\n\t\t\tfor (let e = 0; e < c.length; e++) t += c[e];\n\t\t\tlet n = o.morphTargetsRelative ? 1 : 1 - t;\n\t\t\ts.getUniforms().setValue(e, \"morphTargetBaseInfluence\", n), s.getUniforms().setValue(e, \"morphTargetInfluences\", c);\n\t\t}\n\t\ts.getUniforms().setValue(e, \"morphTargetsTexture\", d.texture, n), s.getUniforms().setValue(e, \"morphTargetsTextureSize\", d.size);\n\t}\n\treturn { update: a };\n}\nfunction Go(e, t, n, r, i) {\n\tlet a = /* @__PURE__ */ new WeakMap();\n\tfunction o(r) {\n\t\tlet o = i.render.frame, s = r.geometry, l = t.get(r, s);\n\t\tif (a.get(l) !== o && (t.update(l), a.set(l, o)), r.isInstancedMesh && (r.hasEventListener(\"dispose\", c) === !1 && r.addEventListener(\"dispose\", c), a.get(r) !== o && (n.update(r.instanceMatrix, e.ARRAY_BUFFER), r.instanceColor !== null && n.update(r.instanceColor, e.ARRAY_BUFFER), a.set(r, o))), r.isSkinnedMesh) {\n\t\t\tlet e = r.skeleton;\n\t\t\ta.get(e) !== o && (e.update(), a.set(e, o));\n\t\t}\n\t\treturn l;\n\t}\n\tfunction s() {\n\t\ta = /* @__PURE__ */ new WeakMap();\n\t}\n\tfunction c(e) {\n\t\tlet t = e.target;\n\t\tt.removeEventListener(\"dispose\", c), r.releaseStatesOfObject(t), n.remove(t.instanceMatrix), t.instanceColor !== null && n.remove(t.instanceColor);\n\t}\n\treturn {\n\t\tupdate: o,\n\t\tdispose: s\n\t};\n}\nvar Ko = {\n\t1: \"LINEAR_TONE_MAPPING\",\n\t2: \"REINHARD_TONE_MAPPING\",\n\t3: \"CINEON_TONE_MAPPING\",\n\t4: \"ACES_FILMIC_TONE_MAPPING\",\n\t6: \"AGX_TONE_MAPPING\",\n\t7: \"NEUTRAL_TONE_MAPPING\",\n\t5: \"CUSTOM_TONE_MAPPING\"\n};\nfunction qo(e, t, n, r, i) {\n\tlet a = new kn(t, n, {\n\t\ttype: e,\n\t\tdepthBuffer: r,\n\t\tstencilBuffer: i,\n\t\tdepthTexture: r ? new Xi(t, n) : void 0\n\t}), o = new kn(t, n, {\n\t\ttype: me,\n\t\tdepthBuffer: !1,\n\t\tstencilBuffer: !1\n\t}), s = new pi();\n\ts.setAttribute(\"position\", new ti([\n\t\t-1,\n\t\t3,\n\t\t0,\n\t\t-1,\n\t\t-1,\n\t\t0,\n\t\t3,\n\t\t-1,\n\t\t0\n\t], 3)), s.setAttribute(\"uv\", new ti([\n\t\t0,\n\t\t2,\n\t\t0,\n\t\t0,\n\t\t2,\n\t\t0\n\t], 2));\n\tlet c = new pa({\n\t\tuniforms: { tDiffuse: { value: null } },\n\t\tvertexShader: \"\\n\t\t\tprecision highp float;\\n\\n\t\t\tuniform mat4 modelViewMatrix;\\n\t\t\tuniform mat4 projectionMatrix;\\n\\n\t\t\tattribute vec3 position;\\n\t\t\tattribute vec2 uv;\\n\\n\t\t\tvarying vec2 vUv;\\n\\n\t\t\tvoid main() {\\n\t\t\t\tvUv = uv;\\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n\t\t\t}\",\n\t\tfragmentShader: \"\\n\t\t\tprecision highp float;\\n\\n\t\t\tuniform sampler2D tDiffuse;\\n\\n\t\t\tvarying vec2 vUv;\\n\\n\t\t\t#include <tonemapping_pars_fragment>\\n\t\t\t#include <colorspace_pars_fragment>\\n\\n\t\t\tvoid main() {\\n\t\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\\n\\n\t\t\t\t#ifdef LINEAR_TONE_MAPPING\\n\t\t\t\t\tgl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( REINHARD_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( CINEON_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( ACES_FILMIC_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( AGX_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( NEUTRAL_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( CUSTOM_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#endif\\n\\n\t\t\t\t#ifdef SRGB_TRANSFER\\n\t\t\t\t\tgl_FragColor = sRGBTransferOETF( gl_FragColor );\\n\t\t\t\t#endif\\n\t\t\t}\",\n\t\tdepthTest: !1,\n\t\tdepthWrite: !1\n\t}), l = new Ii(s, c), u = new Ra(-1, 1, 1, -1, 0, 1), d = null, f = null, p = !1, m, h = null, g = [], _ = !1;\n\tthis.setSize = function(e, t) {\n\t\ta.setSize(e, t), o.setSize(e, t);\n\t\tfor (let n = 0; n < g.length; n++) {\n\t\t\tlet r = g[n];\n\t\t\tr.setSize && r.setSize(e, t);\n\t\t}\n\t}, this.setEffects = function(e) {\n\t\tg = e, _ = g.length > 0 && g[0].isRenderPass === !0;\n\t\tlet t = a.width, n = a.height;\n\t\tfor (let e = 0; e < g.length; e++) {\n\t\t\tlet r = g[e];\n\t\t\tr.setSize && r.setSize(t, n);\n\t\t}\n\t}, this.begin = function(e, t) {\n\t\tif (p || e.toneMapping === 0 && g.length === 0) return !1;\n\t\tif (h = t, t !== null) {\n\t\t\tlet e = t.width, n = t.height;\n\t\t\t(a.width !== e || a.height !== n) && this.setSize(e, n);\n\t\t}\n\t\treturn _ === !1 && e.setRenderTarget(a), m = e.toneMapping, e.toneMapping = 0, !0;\n\t}, this.hasRenderPass = function() {\n\t\treturn _;\n\t}, this.end = function(e, t) {\n\t\te.toneMapping = m, p = !0;\n\t\tlet n = a, r = o;\n\t\tfor (let i = 0; i < g.length; i++) {\n\t\t\tlet a = g[i];\n\t\t\tif (a.enabled !== !1 && (a.render(e, r, n, t), a.needsSwap !== !1)) {\n\t\t\t\tlet e = n;\n\t\t\t\tn = r, r = e;\n\t\t\t}\n\t\t}\n\t\tif (d !== e.outputColorSpace || f !== e.toneMapping) {\n\t\t\td = e.outputColorSpace, f = e.toneMapping, c.defines = {}, gn.getTransfer(d) === \"srgb\" && (c.defines.SRGB_TRANSFER = \"\");\n\t\t\tlet t = Ko[f];\n\t\t\tt && (c.defines[t] = \"\"), c.needsUpdate = !0;\n\t\t}\n\t\tc.uniforms.tDiffuse.value = n.texture, e.setRenderTarget(h), e.render(l, u), h = null, p = !1;\n\t}, this.isCompositing = function() {\n\t\treturn p;\n\t}, this.dispose = function() {\n\t\ta.depthTexture && a.depthTexture.dispose(), a.dispose(), o.dispose(), s.dispose(), c.dispose();\n\t};\n}\nvar Jo = /*@__PURE__*/ new En(), Yo = /*@__PURE__*/ new Xi(1, 1), Xo = /*@__PURE__*/ new An(), Zo = /*@__PURE__*/ new jn(), Qo = /*@__PURE__*/ new Yi(), $o = [], es = [], ts = /* @__PURE__ */ new Float32Array(16), ns = /* @__PURE__ */ new Float32Array(9), rs = /* @__PURE__ */ new Float32Array(4);\nfunction is(e, t, n) {\n\tlet r = e[0];\n\tif (r <= 0 || r > 0) return e;\n\tlet i = t * n, a = $o[i];\n\tif (a === void 0 && (a = new Float32Array(i), $o[i] = a), t !== 0) {\n\t\tr.toArray(a, 0);\n\t\tfor (let r = 1, i = 0; r !== t; ++r) i += n, e[r].toArray(a, i);\n\t}\n\treturn a;\n}\nfunction as(e, t) {\n\tif (e.length !== t.length) return !1;\n\tfor (let n = 0, r = e.length; n < r; n++) if (e[n] !== t[n]) return !1;\n\treturn !0;\n}\nfunction os(e, t) {\n\tfor (let n = 0, r = t.length; n < r; n++) e[n] = t[n];\n}\nfunction ss(e, t) {\n\tlet n = es[t];\n\tn === void 0 && (n = new Int32Array(t), es[t] = n);\n\tfor (let r = 0; r !== t; ++r) n[r] = e.allocateTextureUnit();\n\treturn n;\n}\nfunction cs(e, t) {\n\tlet n = this.cache;\n\tn[0] !== t && (e.uniform1f(this.addr, t), n[0] = t);\n}\nfunction ls(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2f(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform2fv(this.addr, t), os(n, t);\n\t}\n}\nfunction us(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3f(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);\n\telse if (t.r !== void 0) (n[0] !== t.r || n[1] !== t.g || n[2] !== t.b) && (e.uniform3f(this.addr, t.r, t.g, t.b), n[0] = t.r, n[1] = t.g, n[2] = t.b);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform3fv(this.addr, t), os(n, t);\n\t}\n}\nfunction ds(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4f(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform4fv(this.addr, t), os(n, t);\n\t}\n}\nfunction fs(e, t) {\n\tlet n = this.cache, r = t.elements;\n\tif (r === void 0) {\n\t\tif (as(n, t)) return;\n\t\te.uniformMatrix2fv(this.addr, !1, t), os(n, t);\n\t} else {\n\t\tif (as(n, r)) return;\n\t\trs.set(r), e.uniformMatrix2fv(this.addr, !1, rs), os(n, r);\n\t}\n}\nfunction ps(e, t) {\n\tlet n = this.cache, r = t.elements;\n\tif (r === void 0) {\n\t\tif (as(n, t)) return;\n\t\te.uniformMatrix3fv(this.addr, !1, t), os(n, t);\n\t} else {\n\t\tif (as(n, r)) return;\n\t\tns.set(r), e.uniformMatrix3fv(this.addr, !1, ns), os(n, r);\n\t}\n}\nfunction ms(e, t) {\n\tlet n = this.cache, r = t.elements;\n\tif (r === void 0) {\n\t\tif (as(n, t)) return;\n\t\te.uniformMatrix4fv(this.addr, !1, t), os(n, t);\n\t} else {\n\t\tif (as(n, r)) return;\n\t\tts.set(r), e.uniformMatrix4fv(this.addr, !1, ts), os(n, r);\n\t}\n}\nfunction hs(e, t) {\n\tlet n = this.cache;\n\tn[0] !== t && (e.uniform1i(this.addr, t), n[0] = t);\n}\nfunction gs(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2i(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform2iv(this.addr, t), os(n, t);\n\t}\n}\nfunction _s(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3i(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform3iv(this.addr, t), os(n, t);\n\t}\n}\nfunction vs(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4i(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform4iv(this.addr, t), os(n, t);\n\t}\n}\nfunction ys(e, t) {\n\tlet n = this.cache;\n\tn[0] !== t && (e.uniform1ui(this.addr, t), n[0] = t);\n}\nfunction bs(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2ui(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform2uiv(this.addr, t), os(n, t);\n\t}\n}\nfunction xs(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3ui(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform3uiv(this.addr, t), os(n, t);\n\t}\n}\nfunction Ss(e, t) {\n\tlet n = this.cache;\n\tif (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4ui(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);\n\telse {\n\t\tif (as(n, t)) return;\n\t\te.uniform4uiv(this.addr, t), os(n, t);\n\t}\n}\nfunction Cs(e, t, n) {\n\tlet r = this.cache, i = n.allocateTextureUnit();\n\tr[0] !== i && (e.uniform1i(this.addr, i), r[0] = i);\n\tlet a;\n\tthis.type === e.SAMPLER_2D_SHADOW ? (Yo.compareFunction = n.isReversedDepthBuffer() ? 518 : 515, a = Yo) : a = Jo, n.setTexture2D(t || a, i);\n}\nfunction ws(e, t, n) {\n\tlet r = this.cache, i = n.allocateTextureUnit();\n\tr[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || Zo, i);\n}\nfunction Ts(e, t, n) {\n\tlet r = this.cache, i = n.allocateTextureUnit();\n\tr[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTextureCube(t || Qo, i);\n}\nfunction Es(e, t, n) {\n\tlet r = this.cache, i = n.allocateTextureUnit();\n\tr[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture2DArray(t || Xo, i);\n}\nfunction Ds(e) {\n\tswitch (e) {\n\t\tcase 5126: return cs;\n\t\tcase 35664: return ls;\n\t\tcase 35665: return us;\n\t\tcase 35666: return ds;\n\t\tcase 35674: return fs;\n\t\tcase 35675: return ps;\n\t\tcase 35676: return ms;\n\t\tcase 5124:\n\t\tcase 35670: return hs;\n\t\tcase 35667:\n\t\tcase 35671: return gs;\n\t\tcase 35668:\n\t\tcase 35672: return _s;\n\t\tcase 35669:\n\t\tcase 35673: return vs;\n\t\tcase 5125: return ys;\n\t\tcase 36294: return bs;\n\t\tcase 36295: return xs;\n\t\tcase 36296: return Ss;\n\t\tcase 35678:\n\t\tcase 36198:\n\t\tcase 36298:\n\t\tcase 36306:\n\t\tcase 35682: return Cs;\n\t\tcase 35679:\n\t\tcase 36299:\n\t\tcase 36307: return ws;\n\t\tcase 35680:\n\t\tcase 36300:\n\t\tcase 36308:\n\t\tcase 36293: return Ts;\n\t\tcase 36289:\n\t\tcase 36303:\n\t\tcase 36311:\n\t\tcase 36292: return Es;\n\t}\n}\nfunction Os(e, t) {\n\te.uniform1fv(this.addr, t);\n}\nfunction ks(e, t) {\n\tlet n = is(t, this.size, 2);\n\te.uniform2fv(this.addr, n);\n}\nfunction As(e, t) {\n\tlet n = is(t, this.size, 3);\n\te.uniform3fv(this.addr, n);\n}\nfunction js(e, t) {\n\tlet n = is(t, this.size, 4);\n\te.uniform4fv(this.addr, n);\n}\nfunction Ms(e, t) {\n\tlet n = is(t, this.size, 4);\n\te.uniformMatrix2fv(this.addr, !1, n);\n}\nfunction Ns(e, t) {\n\tlet n = is(t, this.size, 9);\n\te.uniformMatrix3fv(this.addr, !1, n);\n}\nfunction Ps(e, t) {\n\tlet n = is(t, this.size, 16);\n\te.uniformMatrix4fv(this.addr, !1, n);\n}\nfunction Fs(e, t) {\n\te.uniform1iv(this.addr, t);\n}\nfunction Is(e, t) {\n\te.uniform2iv(this.addr, t);\n}\nfunction Ls(e, t) {\n\te.uniform3iv(this.addr, t);\n}\nfunction Rs(e, t) {\n\te.uniform4iv(this.addr, t);\n}\nfunction zs(e, t) {\n\te.uniform1uiv(this.addr, t);\n}\nfunction Bs(e, t) {\n\te.uniform2uiv(this.addr, t);\n}\nfunction Vs(e, t) {\n\te.uniform3uiv(this.addr, t);\n}\nfunction Hs(e, t) {\n\te.uniform4uiv(this.addr, t);\n}\nfunction Us(e, t, n) {\n\tlet r = this.cache, i = t.length, a = ss(n, i);\n\tas(r, a) || (e.uniform1iv(this.addr, a), os(r, a));\n\tlet o;\n\to = this.type === e.SAMPLER_2D_SHADOW ? Yo : Jo;\n\tfor (let e = 0; e !== i; ++e) n.setTexture2D(t[e] || o, a[e]);\n}\nfunction Ws(e, t, n) {\n\tlet r = this.cache, i = t.length, a = ss(n, i);\n\tas(r, a) || (e.uniform1iv(this.addr, a), os(r, a));\n\tfor (let e = 0; e !== i; ++e) n.setTexture3D(t[e] || Zo, a[e]);\n}\nfunction Gs(e, t, n) {\n\tlet r = this.cache, i = t.length, a = ss(n, i);\n\tas(r, a) || (e.uniform1iv(this.addr, a), os(r, a));\n\tfor (let e = 0; e !== i; ++e) n.setTextureCube(t[e] || Qo, a[e]);\n}\nfunction Ks(e, t, n) {\n\tlet r = this.cache, i = t.length, a = ss(n, i);\n\tas(r, a) || (e.uniform1iv(this.addr, a), os(r, a));\n\tfor (let e = 0; e !== i; ++e) n.setTexture2DArray(t[e] || Xo, a[e]);\n}\nfunction qs(e) {\n\tswitch (e) {\n\t\tcase 5126: return Os;\n\t\tcase 35664: return ks;\n\t\tcase 35665: return As;\n\t\tcase 35666: return js;\n\t\tcase 35674: return Ms;\n\t\tcase 35675: return Ns;\n\t\tcase 35676: return Ps;\n\t\tcase 5124:\n\t\tcase 35670: return Fs;\n\t\tcase 35667:\n\t\tcase 35671: return Is;\n\t\tcase 35668:\n\t\tcase 35672: return Ls;\n\t\tcase 35669:\n\t\tcase 35673: return Rs;\n\t\tcase 5125: return zs;\n\t\tcase 36294: return Bs;\n\t\tcase 36295: return Vs;\n\t\tcase 36296: return Hs;\n\t\tcase 35678:\n\t\tcase 36198:\n\t\tcase 36298:\n\t\tcase 36306:\n\t\tcase 35682: return Us;\n\t\tcase 35679:\n\t\tcase 36299:\n\t\tcase 36307: return Ws;\n\t\tcase 35680:\n\t\tcase 36300:\n\t\tcase 36308:\n\t\tcase 36293: return Gs;\n\t\tcase 36289:\n\t\tcase 36303:\n\t\tcase 36311:\n\t\tcase 36292: return Ks;\n\t}\n}\nvar Js = class {\n\tconstructor(e, t, n) {\n\t\tthis.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = Ds(t.type);\n\t}\n}, Ys = class {\n\tconstructor(e, t, n) {\n\t\tthis.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = qs(t.type);\n\t}\n}, Xs = class {\n\tconstructor(e) {\n\t\tthis.id = e, this.seq = [], this.map = {};\n\t}\n\tsetValue(e, t, n) {\n\t\tlet r = this.seq;\n\t\tfor (let i = 0, a = r.length; i !== a; ++i) {\n\t\t\tlet a = r[i];\n\t\t\ta.setValue(e, t[a.id], n);\n\t\t}\n\t}\n}, Zs = /(\\w+)(\\])?(\\[|\\.)?/g;\nfunction Qs(e, t) {\n\te.seq.push(t), e.map[t.id] = t;\n}\nfunction $s(e, t, n) {\n\tlet r = e.name, i = r.length;\n\tfor (Zs.lastIndex = 0;;) {\n\t\tlet a = Zs.exec(r), o = Zs.lastIndex, s = a[1], c = a[2] === \"]\", l = a[3];\n\t\tif (c && (s |= 0), l === void 0 || l === \"[\" && o + 2 === i) {\n\t\t\tQs(n, l === void 0 ? new Js(s, e, t) : new Ys(s, e, t));\n\t\t\tbreak;\n\t\t}\n\t\t{\n\t\t\tlet e = n.map[s];\n\t\t\te === void 0 && (e = new Xs(s), Qs(n, e)), n = e;\n\t\t}\n\t}\n}\nvar ec = class {\n\tconstructor(e, t) {\n\t\tthis.seq = [], this.map = {};\n\t\tlet n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);\n\t\tfor (let r = 0; r < n; ++r) {\n\t\t\tlet n = e.getActiveUniform(t, r);\n\t\t\t$s(n, e.getUniformLocation(t, n.name), this);\n\t\t}\n\t\tlet r = [], i = [];\n\t\tfor (let t of this.seq) t.type === e.SAMPLER_2D_SHADOW || t.type === e.SAMPLER_CUBE_SHADOW || t.type === e.SAMPLER_2D_ARRAY_SHADOW ? r.push(t) : i.push(t);\n\t\tr.length > 0 && (this.seq = r.concat(i));\n\t}\n\tsetValue(e, t, n, r) {\n\t\tlet i = this.map[t];\n\t\ti !== void 0 && i.setValue(e, n, r);\n\t}\n\tsetOptional(e, t, n) {\n\t\tlet r = t[n];\n\t\tr !== void 0 && this.setValue(e, n, r);\n\t}\n\tstatic upload(e, t, n, r) {\n\t\tfor (let i = 0, a = t.length; i !== a; ++i) {\n\t\t\tlet a = t[i], o = n[a.id];\n\t\t\to.needsUpdate !== !1 && a.setValue(e, o.value, r);\n\t\t}\n\t}\n\tstatic seqWithValue(e, t) {\n\t\tlet n = [];\n\t\tfor (let r = 0, i = e.length; r !== i; ++r) {\n\t\t\tlet i = e[r];\n\t\t\ti.id in t && n.push(i);\n\t\t}\n\t\treturn n;\n\t}\n};\nfunction tc(e, t, n) {\n\tlet r = e.createShader(t);\n\treturn e.shaderSource(r, n), e.compileShader(r), r;\n}\nvar nc = 37297, rc = 0;\nfunction ic(e, t) {\n\tlet n = e.split(\"\\n\"), r = [], i = Math.max(t - 6, 0), a = Math.min(t + 6, n.length);\n\tfor (let e = i; e < a; e++) {\n\t\tlet i = e + 1;\n\t\tr.push(`${i === t ? \">\" : \" \"} ${i}: ${n[e]}`);\n\t}\n\treturn r.join(\"\\n\");\n}\nvar ac = /*@__PURE__*/ new q();\nfunction oc(e) {\n\tgn._getMatrix(ac, gn.workingColorSpace, e);\n\tlet t = `mat3( ${ac.elements.map((e) => e.toFixed(4))} )`;\n\tswitch (gn.getTransfer(e)) {\n\t\tcase yt: return [t, \"LinearTransferOETF\"];\n\t\tcase bt: return [t, \"sRGBTransferOETF\"];\n\t\tdefault: return H(\"WebGLProgram: Unsupported color space: \", e), [t, \"LinearTransferOETF\"];\n\t}\n}\nfunction sc(e, t, n) {\n\tlet r = e.getShaderParameter(t, e.COMPILE_STATUS), i = (e.getShaderInfoLog(t) || \"\").trim();\n\tif (r && i === \"\") return \"\";\n\tlet a = /ERROR: 0:(\\d+)/.exec(i);\n\tif (a) {\n\t\tlet r = parseInt(a[1]);\n\t\treturn n.toUpperCase() + \"\\n\\n\" + i + \"\\n\\n\" + ic(e.getShaderSource(t), r);\n\t}\n\treturn i;\n}\nfunction cc(e, t) {\n\tlet n = oc(t);\n\treturn [\n\t\t`vec4 ${e}( vec4 value ) {`,\n\t\t`\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,\n\t\t\"}\"\n\t].join(\"\\n\");\n}\nvar lc = {\n\t1: \"Linear\",\n\t2: \"Reinhard\",\n\t3: \"Cineon\",\n\t4: \"ACESFilmic\",\n\t6: \"AgX\",\n\t7: \"Neutral\",\n\t5: \"Custom\"\n};\nfunction uc(e, t) {\n\tlet n = lc[t];\n\treturn n === void 0 ? (H(\"WebGLProgram: Unsupported toneMapping:\", t), \"vec3 \" + e + \"( vec3 color ) { return LinearToneMapping( color ); }\") : \"vec3 \" + e + \"( vec3 color ) { return \" + n + \"ToneMapping( color ); }\";\n}\nvar dc = /*@__PURE__*/ new K();\nfunction fc() {\n\treturn gn.getLuminanceCoefficients(dc), [\n\t\t\"float luminance( const in vec3 rgb ) {\",\n\t\t`\tconst vec3 weights = vec3( ${dc.x.toFixed(4)}, ${dc.y.toFixed(4)}, ${dc.z.toFixed(4)} );`,\n\t\t\"\treturn dot( weights, rgb );\",\n\t\t\"}\"\n\t].join(\"\\n\");\n}\nfunction pc(e) {\n\treturn [e.extensionClipCullDistance ? \"#extension GL_ANGLE_clip_cull_distance : require\" : \"\", e.extensionMultiDraw ? \"#extension GL_ANGLE_multi_draw : require\" : \"\"].filter(gc).join(\"\\n\");\n}\nfunction mc(e) {\n\tlet t = [];\n\tfor (let n in e) {\n\t\tlet r = e[n];\n\t\tr !== !1 && t.push(\"#define \" + n + \" \" + r);\n\t}\n\treturn t.join(\"\\n\");\n}\nfunction hc(e, t) {\n\tlet n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES);\n\tfor (let i = 0; i < r; i++) {\n\t\tlet r = e.getActiveAttrib(t, i), a = r.name, o = 1;\n\t\tr.type === e.FLOAT_MAT2 && (o = 2), r.type === e.FLOAT_MAT3 && (o = 3), r.type === e.FLOAT_MAT4 && (o = 4), n[a] = {\n\t\t\ttype: r.type,\n\t\t\tlocation: e.getAttribLocation(t, a),\n\t\t\tlocationSize: o\n\t\t};\n\t}\n\treturn n;\n}\nfunction gc(e) {\n\treturn e !== \"\";\n}\nfunction _c(e, t) {\n\tlet n = t.numSpotLightShadows + t.numSpotLightMaps - t.numSpotLightShadowsWithMaps;\n\treturn e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, n).replace(/NUM_RECT_AREA_LIGHTS/g, t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, t.numPointLightShadows);\n}\nfunction vc(e, t) {\n\treturn e.replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection);\n}\nvar yc = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\nfunction bc(e) {\n\treturn e.replace(yc, Sc);\n}\nvar xc = /* @__PURE__ */ new Map();\nfunction Sc(e, t) {\n\tlet n = Y[t];\n\tif (n === void 0) {\n\t\tlet e = xc.get(t);\n\t\tif (e !== void 0) n = Y[e], H(\"WebGLRenderer: Shader chunk \\\"%s\\\" has been deprecated. Use \\\"%s\\\" instead.\", t, e);\n\t\telse throw Error(\"Can not resolve #include <\" + t + \">\");\n\t}\n\treturn bc(n);\n}\nvar Cc = /#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;\nfunction wc(e) {\n\treturn e.replace(Cc, Tc);\n}\nfunction Tc(e, t, n, r) {\n\tlet i = \"\";\n\tfor (let e = parseInt(t); e < parseInt(n); e++) i += r.replace(/\\[\\s*i\\s*\\]/g, \"[ \" + e + \" ]\").replace(/UNROLLED_LOOP_INDEX/g, e);\n\treturn i;\n}\nfunction Ec(e) {\n\tlet t = `precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;\n\treturn e.precision === \"highp\" ? t += \"\\n#define HIGH_PRECISION\" : e.precision === \"mediump\" ? t += \"\\n#define MEDIUM_PRECISION\" : e.precision === \"lowp\" && (t += \"\\n#define LOW_PRECISION\"), t;\n}\nvar Dc = {\n\t1: \"SHADOWMAP_TYPE_PCF\",\n\t3: \"SHADOWMAP_TYPE_VSM\"\n};\nfunction Oc(e) {\n\treturn Dc[e.shadowMapType] || \"SHADOWMAP_TYPE_BASIC\";\n}\nvar kc = {\n\t301: \"ENVMAP_TYPE_CUBE\",\n\t302: \"ENVMAP_TYPE_CUBE\",\n\t306: \"ENVMAP_TYPE_CUBE_UV\"\n};\nfunction Ac(e) {\n\treturn e.envMap === !1 ? \"ENVMAP_TYPE_CUBE\" : kc[e.envMapMode] || \"ENVMAP_TYPE_CUBE\";\n}\nvar jc = { 302: \"ENVMAP_MODE_REFRACTION\" };\nfunction Mc(e) {\n\treturn e.envMap === !1 ? \"ENVMAP_MODE_REFLECTION\" : jc[e.envMapMode] || \"ENVMAP_MODE_REFLECTION\";\n}\nvar Nc = {\n\t0: \"ENVMAP_BLENDING_MULTIPLY\",\n\t1: \"ENVMAP_BLENDING_MIX\",\n\t2: \"ENVMAP_BLENDING_ADD\"\n};\nfunction Pc(e) {\n\treturn e.envMap === !1 ? \"ENVMAP_BLENDING_NONE\" : Nc[e.combine] || \"ENVMAP_BLENDING_NONE\";\n}\nfunction Fc(e) {\n\tlet t = e.envMapCubeUVHeight;\n\tif (t === null) return null;\n\tlet n = Math.log2(t) - 2, r = 1 / t;\n\treturn {\n\t\ttexelWidth: 1 / (3 * Math.max(2 ** n, 112)),\n\t\ttexelHeight: r,\n\t\tmaxMip: n\n\t};\n}\nfunction Ic(e, t, n, r) {\n\tlet i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = Oc(n), l = Ac(n), u = Mc(n), d = Pc(n), f = Fc(n), p = pc(n), m = mc(a), h = i.createProgram(), g, _, v = n.glslVersion ? \"#version \" + n.glslVersion + \"\\n\" : \"\";\n\tn.isRawShaderMaterial ? (g = [\n\t\t\"#define SHADER_TYPE \" + n.shaderType,\n\t\t\"#define SHADER_NAME \" + n.shaderName,\n\t\tm\n\t].filter(gc).join(\"\\n\"), g.length > 0 && (g += \"\\n\"), _ = [\n\t\t\"#define SHADER_TYPE \" + n.shaderType,\n\t\t\"#define SHADER_NAME \" + n.shaderName,\n\t\tm\n\t].filter(gc).join(\"\\n\"), _.length > 0 && (_ += \"\\n\")) : (g = [\n\t\tEc(n),\n\t\t\"#define SHADER_TYPE \" + n.shaderType,\n\t\t\"#define SHADER_NAME \" + n.shaderName,\n\t\tm,\n\t\tn.extensionClipCullDistance ? \"#define USE_CLIP_DISTANCE\" : \"\",\n\t\tn.batching ? \"#define USE_BATCHING\" : \"\",\n\t\tn.batchingColor ? \"#define USE_BATCHING_COLOR\" : \"\",\n\t\tn.instancing ? \"#define USE_INSTANCING\" : \"\",\n\t\tn.instancingColor ? \"#define USE_INSTANCING_COLOR\" : \"\",\n\t\tn.instancingMorph ? \"#define USE_INSTANCING_MORPH\" : \"\",\n\t\tn.useFog && n.fog ? \"#define USE_FOG\" : \"\",\n\t\tn.useFog && n.fogExp2 ? \"#define FOG_EXP2\" : \"\",\n\t\tn.map ? \"#define USE_MAP\" : \"\",\n\t\tn.envMap ? \"#define USE_ENVMAP\" : \"\",\n\t\tn.envMap ? \"#define \" + u : \"\",\n\t\tn.lightMap ? \"#define USE_LIGHTMAP\" : \"\",\n\t\tn.aoMap ? \"#define USE_AOMAP\" : \"\",\n\t\tn.bumpMap ? \"#define USE_BUMPMAP\" : \"\",\n\t\tn.normalMap ? \"#define USE_NORMALMAP\" : \"\",\n\t\tn.normalMapObjectSpace ? \"#define USE_NORMALMAP_OBJECTSPACE\" : \"\",\n\t\tn.normalMapTangentSpace ? \"#define USE_NORMALMAP_TANGENTSPACE\" : \"\",\n\t\tn.displacementMap ? \"#define USE_DISPLACEMENTMAP\" : \"\",\n\t\tn.emissiveMap ? \"#define USE_EMISSIVEMAP\" : \"\",\n\t\tn.anisotropy ? \"#define USE_ANISOTROPY\" : \"\",\n\t\tn.anisotropyMap ? \"#define USE_ANISOTROPYMAP\" : \"\",\n\t\tn.clearcoatMap ? \"#define USE_CLEARCOATMAP\" : \"\",\n\t\tn.clearcoatRoughnessMap ? \"#define USE_CLEARCOAT_ROUGHNESSMAP\" : \"\",\n\t\tn.clearcoatNormalMap ? \"#define USE_CLEARCOAT_NORMALMAP\" : \"\",\n\t\tn.iridescenceMap ? \"#define USE_IRIDESCENCEMAP\" : \"\",\n\t\tn.iridescenceThicknessMap ? \"#define USE_IRIDESCENCE_THICKNESSMAP\" : \"\",\n\t\tn.specularMap ? \"#define USE_SPECULARMAP\" : \"\",\n\t\tn.specularColorMap ? \"#define USE_SPECULAR_COLORMAP\" : \"\",\n\t\tn.specularIntensityMap ? \"#define USE_SPECULAR_INTENSITYMAP\" : \"\",\n\t\tn.roughnessMap ? \"#define USE_ROUGHNESSMAP\" : \"\",\n\t\tn.metalnessMap ? \"#define USE_METALNESSMAP\" : \"\",\n\t\tn.alphaMap ? \"#define USE_ALPHAMAP\" : \"\",\n\t\tn.alphaHash ? \"#define USE_ALPHAHASH\" : \"\",\n\t\tn.transmission ? \"#define USE_TRANSMISSION\" : \"\",\n\t\tn.transmissionMap ? \"#define USE_TRANSMISSIONMAP\" : \"\",\n\t\tn.thicknessMap ? \"#define USE_THICKNESSMAP\" : \"\",\n\t\tn.sheenColorMap ? \"#define USE_SHEEN_COLORMAP\" : \"\",\n\t\tn.sheenRoughnessMap ? \"#define USE_SHEEN_ROUGHNESSMAP\" : \"\",\n\t\tn.mapUv ? \"#define MAP_UV \" + n.mapUv : \"\",\n\t\tn.alphaMapUv ? \"#define ALPHAMAP_UV \" + n.alphaMapUv : \"\",\n\t\tn.lightMapUv ? \"#define LIGHTMAP_UV \" + n.lightMapUv : \"\",\n\t\tn.aoMapUv ? \"#define AOMAP_UV \" + n.aoMapUv : \"\",\n\t\tn.emissiveMapUv ? \"#define EMISSIVEMAP_UV \" + n.emissiveMapUv : \"\",\n\t\tn.bumpMapUv ? \"#define BUMPMAP_UV \" + n.bumpMapUv : \"\",\n\t\tn.normalMapUv ? \"#define NORMALMAP_UV \" + n.normalMapUv : \"\",\n\t\tn.displacementMapUv ? \"#define DISPLACEMENTMAP_UV \" + n.displacementMapUv : \"\",\n\t\tn.metalnessMapUv ? \"#define METALNESSMAP_UV \" + n.metalnessMapUv : \"\",\n\t\tn.roughnessMapUv ? \"#define ROUGHNESSMAP_UV \" + n.roughnessMapUv : \"\",\n\t\tn.anisotropyMapUv ? \"#define ANISOTROPYMAP_UV \" + n.anisotropyMapUv : \"\",\n\t\tn.clearcoatMapUv ? \"#define CLEARCOATMAP_UV \" + n.clearcoatMapUv : \"\",\n\t\tn.clearcoatNormalMapUv ? \"#define CLEARCOAT_NORMALMAP_UV \" + n.clearcoatNormalMapUv : \"\",\n\t\tn.clearcoatRoughnessMapUv ? \"#define CLEARCOAT_ROUGHNESSMAP_UV \" + n.clearcoatRoughnessMapUv : \"\",\n\t\tn.iridescenceMapUv ? \"#define IRIDESCENCEMAP_UV \" + n.iridescenceMapUv : \"\",\n\t\tn.iridescenceThicknessMapUv ? \"#define IRIDESCENCE_THICKNESSMAP_UV \" + n.iridescenceThicknessMapUv : \"\",\n\t\tn.sheenColorMapUv ? \"#define SHEEN_COLORMAP_UV \" + n.sheenColorMapUv : \"\",\n\t\tn.sheenRoughnessMapUv ? \"#define SHEEN_ROUGHNESSMAP_UV \" + n.sheenRoughnessMapUv : \"\",\n\t\tn.specularMapUv ? \"#define SPECULARMAP_UV \" + n.specularMapUv : \"\",\n\t\tn.specularColorMapUv ? \"#define SPECULAR_COLORMAP_UV \" + n.specularColorMapUv : \"\",\n\t\tn.specularIntensityMapUv ? \"#define SPECULAR_INTENSITYMAP_UV \" + n.specularIntensityMapUv : \"\",\n\t\tn.transmissionMapUv ? \"#define TRANSMISSIONMAP_UV \" + n.transmissionMapUv : \"\",\n\t\tn.thicknessMapUv ? \"#define THICKNESSMAP_UV \" + n.thicknessMapUv : \"\",\n\t\tn.vertexTangents && n.flatShading === !1 ? \"#define USE_TANGENT\" : \"\",\n\t\tn.vertexNormals ? \"#define HAS_NORMAL\" : \"\",\n\t\tn.vertexColors ? \"#define USE_COLOR\" : \"\",\n\t\tn.vertexAlphas ? \"#define USE_COLOR_ALPHA\" : \"\",\n\t\tn.vertexUv1s ? \"#define USE_UV1\" : \"\",\n\t\tn.vertexUv2s ? \"#define USE_UV2\" : \"\",\n\t\tn.vertexUv3s ? \"#define USE_UV3\" : \"\",\n\t\tn.pointsUvs ? \"#define USE_POINTS_UV\" : \"\",\n\t\tn.flatShading ? \"#define FLAT_SHADED\" : \"\",\n\t\tn.skinning ? \"#define USE_SKINNING\" : \"\",\n\t\tn.morphTargets ? \"#define USE_MORPHTARGETS\" : \"\",\n\t\tn.morphNormals && n.flatShading === !1 ? \"#define USE_MORPHNORMALS\" : \"\",\n\t\tn.morphColors ? \"#define USE_MORPHCOLORS\" : \"\",\n\t\tn.morphTargetsCount > 0 ? \"#define MORPHTARGETS_TEXTURE_STRIDE \" + n.morphTextureStride : \"\",\n\t\tn.morphTargetsCount > 0 ? \"#define MORPHTARGETS_COUNT \" + n.morphTargetsCount : \"\",\n\t\tn.doubleSided ? \"#define DOUBLE_SIDED\" : \"\",\n\t\tn.flipSided ? \"#define FLIP_SIDED\" : \"\",\n\t\tn.shadowMapEnabled ? \"#define USE_SHADOWMAP\" : \"\",\n\t\tn.shadowMapEnabled ? \"#define \" + c : \"\",\n\t\tn.sizeAttenuation ? \"#define USE_SIZEATTENUATION\" : \"\",\n\t\tn.numLightProbes > 0 ? \"#define USE_LIGHT_PROBES\" : \"\",\n\t\tn.logarithmicDepthBuffer ? \"#define USE_LOGARITHMIC_DEPTH_BUFFER\" : \"\",\n\t\tn.reversedDepthBuffer ? \"#define USE_REVERSED_DEPTH_BUFFER\" : \"\",\n\t\t\"uniform mat4 modelMatrix;\",\n\t\t\"uniform mat4 modelViewMatrix;\",\n\t\t\"uniform mat4 projectionMatrix;\",\n\t\t\"uniform mat4 viewMatrix;\",\n\t\t\"uniform mat3 normalMatrix;\",\n\t\t\"uniform vec3 cameraPosition;\",\n\t\t\"uniform bool isOrthographic;\",\n\t\t\"#ifdef USE_INSTANCING\",\n\t\t\"\tattribute mat4 instanceMatrix;\",\n\t\t\"#endif\",\n\t\t\"#ifdef USE_INSTANCING_COLOR\",\n\t\t\"\tattribute vec3 instanceColor;\",\n\t\t\"#endif\",\n\t\t\"#ifdef USE_INSTANCING_MORPH\",\n\t\t\"\tuniform sampler2D morphTexture;\",\n\t\t\"#endif\",\n\t\t\"attribute vec3 position;\",\n\t\t\"attribute vec3 normal;\",\n\t\t\"attribute vec2 uv;\",\n\t\t\"#ifdef USE_UV1\",\n\t\t\"\tattribute vec2 uv1;\",\n\t\t\"#endif\",\n\t\t\"#ifdef USE_UV2\",\n\t\t\"\tattribute vec2 uv2;\",\n\t\t\"#endif\",\n\t\t\"#ifdef USE_UV3\",\n\t\t\"\tattribute vec2 uv3;\",\n\t\t\"#endif\",\n\t\t\"#ifdef USE_TANGENT\",\n\t\t\"\tattribute vec4 tangent;\",\n\t\t\"#endif\",\n\t\t\"#if defined( USE_COLOR_ALPHA )\",\n\t\t\"\tattribute vec4 color;\",\n\t\t\"#elif defined( USE_COLOR )\",\n\t\t\"\tattribute vec3 color;\",\n\t\t\"#endif\",\n\t\t\"#ifdef USE_SKINNING\",\n\t\t\"\tattribute vec4 skinIndex;\",\n\t\t\"\tattribute vec4 skinWeight;\",\n\t\t\"#endif\",\n\t\t\"\\n\"\n\t].filter(gc).join(\"\\n\"), _ = [\n\t\tEc(n),\n\t\t\"#define SHADER_TYPE \" + n.shaderType,\n\t\t\"#define SHADER_NAME \" + n.shaderName,\n\t\tm,\n\t\tn.useFog && n.fog ? \"#define USE_FOG\" : \"\",\n\t\tn.useFog && n.fogExp2 ? \"#define FOG_EXP2\" : \"\",\n\t\tn.alphaToCoverage ? \"#define ALPHA_TO_COVERAGE\" : \"\",\n\t\tn.map ? \"#define USE_MAP\" : \"\",\n\t\tn.matcap ? \"#define USE_MATCAP\" : \"\",\n\t\tn.envMap ? \"#define USE_ENVMAP\" : \"\",\n\t\tn.envMap ? \"#define \" + l : \"\",\n\t\tn.envMap ? \"#define \" + u : \"\",\n\t\tn.envMap ? \"#define \" + d : \"\",\n\t\tf ? \"#define CUBEUV_TEXEL_WIDTH \" + f.texelWidth : \"\",\n\t\tf ? \"#define CUBEUV_TEXEL_HEIGHT \" + f.texelHeight : \"\",\n\t\tf ? \"#define CUBEUV_MAX_MIP \" + f.maxMip + \".0\" : \"\",\n\t\tn.lightMap ? \"#define USE_LIGHTMAP\" : \"\",\n\t\tn.aoMap ? \"#define USE_AOMAP\" : \"\",\n\t\tn.bumpMap ? \"#define USE_BUMPMAP\" : \"\",\n\t\tn.normalMap ? \"#define USE_NORMALMAP\" : \"\",\n\t\tn.normalMapObjectSpace ? \"#define USE_NORMALMAP_OBJECTSPACE\" : \"\",\n\t\tn.normalMapTangentSpace ? \"#define USE_NORMALMAP_TANGENTSPACE\" : \"\",\n\t\tn.packedNormalMap ? \"#define USE_PACKED_NORMALMAP\" : \"\",\n\t\tn.emissiveMap ? \"#define USE_EMISSIVEMAP\" : \"\",\n\t\tn.anisotropy ? \"#define USE_ANISOTROPY\" : \"\",\n\t\tn.anisotropyMap ? \"#define USE_ANISOTROPYMAP\" : \"\",\n\t\tn.clearcoat ? \"#define USE_CLEARCOAT\" : \"\",\n\t\tn.clearcoatMap ? \"#define USE_CLEARCOATMAP\" : \"\",\n\t\tn.clearcoatRoughnessMap ? \"#define USE_CLEARCOAT_ROUGHNESSMAP\" : \"\",\n\t\tn.clearcoatNormalMap ? \"#define USE_CLEARCOAT_NORMALMAP\" : \"\",\n\t\tn.dispersion ? \"#define USE_DISPERSION\" : \"\",\n\t\tn.iridescence ? \"#define USE_IRIDESCENCE\" : \"\",\n\t\tn.iridescenceMap ? \"#define USE_IRIDESCENCEMAP\" : \"\",\n\t\tn.iridescenceThicknessMap ? \"#define USE_IRIDESCENCE_THICKNESSMAP\" : \"\",\n\t\tn.specularMap ? \"#define USE_SPECULARMAP\" : \"\",\n\t\tn.specularColorMap ? \"#define USE_SPECULAR_COLORMAP\" : \"\",\n\t\tn.specularIntensityMap ? \"#define USE_SPECULAR_INTENSITYMAP\" : \"\",\n\t\tn.roughnessMap ? \"#define USE_ROUGHNESSMAP\" : \"\",\n\t\tn.metalnessMap ? \"#define USE_METALNESSMAP\" : \"\",\n\t\tn.alphaMap ? \"#define USE_ALPHAMAP\" : \"\",\n\t\tn.alphaTest ? \"#define USE_ALPHATEST\" : \"\",\n\t\tn.alphaHash ? \"#define USE_ALPHAHASH\" : \"\",\n\t\tn.sheen ? \"#define USE_SHEEN\" : \"\",\n\t\tn.sheenColorMap ? \"#define USE_SHEEN_COLORMAP\" : \"\",\n\t\tn.sheenRoughnessMap ? \"#define USE_SHEEN_ROUGHNESSMAP\" : \"\",\n\t\tn.transmission ? \"#define USE_TRANSMISSION\" : \"\",\n\t\tn.transmissionMap ? \"#define USE_TRANSMISSIONMAP\" : \"\",\n\t\tn.thicknessMap ? \"#define USE_THICKNESSMAP\" : \"\",\n\t\tn.vertexTangents && n.flatShading === !1 ? \"#define USE_TANGENT\" : \"\",\n\t\tn.vertexColors || n.instancingColor ? \"#define USE_COLOR\" : \"\",\n\t\tn.vertexAlphas || n.batchingColor ? \"#define USE_COLOR_ALPHA\" : \"\",\n\t\tn.vertexUv1s ? \"#define USE_UV1\" : \"\",\n\t\tn.vertexUv2s ? \"#define USE_UV2\" : \"\",\n\t\tn.vertexUv3s ? \"#define USE_UV3\" : \"\",\n\t\tn.pointsUvs ? \"#define USE_POINTS_UV\" : \"\",\n\t\tn.gradientMap ? \"#define USE_GRADIENTMAP\" : \"\",\n\t\tn.flatShading ? \"#define FLAT_SHADED\" : \"\",\n\t\tn.doubleSided ? \"#define DOUBLE_SIDED\" : \"\",\n\t\tn.flipSided ? \"#define FLIP_SIDED\" : \"\",\n\t\tn.shadowMapEnabled ? \"#define USE_SHADOWMAP\" : \"\",\n\t\tn.shadowMapEnabled ? \"#define \" + c : \"\",\n\t\tn.premultipliedAlpha ? \"#define PREMULTIPLIED_ALPHA\" : \"\",\n\t\tn.numLightProbes > 0 ? \"#define USE_LIGHT_PROBES\" : \"\",\n\t\tn.numLightProbeGrids > 0 ? \"#define USE_LIGHT_PROBES_GRID\" : \"\",\n\t\tn.decodeVideoTexture ? \"#define DECODE_VIDEO_TEXTURE\" : \"\",\n\t\tn.decodeVideoTextureEmissive ? \"#define DECODE_VIDEO_TEXTURE_EMISSIVE\" : \"\",\n\t\tn.logarithmicDepthBuffer ? \"#define USE_LOGARITHMIC_DEPTH_BUFFER\" : \"\",\n\t\tn.reversedDepthBuffer ? \"#define USE_REVERSED_DEPTH_BUFFER\" : \"\",\n\t\t\"uniform mat4 viewMatrix;\",\n\t\t\"uniform vec3 cameraPosition;\",\n\t\t\"uniform bool isOrthographic;\",\n\t\tn.toneMapping === 0 ? \"\" : \"#define TONE_MAPPING\",\n\t\tn.toneMapping === 0 ? \"\" : Y.tonemapping_pars_fragment,\n\t\tn.toneMapping === 0 ? \"\" : uc(\"toneMapping\", n.toneMapping),\n\t\tn.dithering ? \"#define DITHERING\" : \"\",\n\t\tn.opaque ? \"#define OPAQUE\" : \"\",\n\t\tY.colorspace_pars_fragment,\n\t\tcc(\"linearToOutputTexel\", n.outputColorSpace),\n\t\tfc(),\n\t\tn.useDepthPacking ? \"#define DEPTH_PACKING \" + n.depthPacking : \"\",\n\t\t\"\\n\"\n\t].filter(gc).join(\"\\n\")), o = bc(o), o = _c(o, n), o = vc(o, n), s = bc(s), s = _c(s, n), s = vc(s, n), o = wc(o), s = wc(s), n.isRawShaderMaterial !== !0 && (v = \"#version 300 es\\n\", g = [\n\t\tp,\n\t\t\"#define attribute in\",\n\t\t\"#define varying out\",\n\t\t\"#define texture2D texture\"\n\t].join(\"\\n\") + \"\\n\" + g, _ = [\n\t\t\"#define varying in\",\n\t\tn.glslVersion === \"300 es\" ? \"\" : \"layout(location = 0) out highp vec4 pc_fragColor;\",\n\t\tn.glslVersion === \"300 es\" ? \"\" : \"#define gl_FragColor pc_fragColor\",\n\t\t\"#define gl_FragDepthEXT gl_FragDepth\",\n\t\t\"#define texture2D texture\",\n\t\t\"#define textureCube texture\",\n\t\t\"#define texture2DProj textureProj\",\n\t\t\"#define texture2DLodEXT textureLod\",\n\t\t\"#define texture2DProjLodEXT textureProjLod\",\n\t\t\"#define textureCubeLodEXT textureLod\",\n\t\t\"#define texture2DGradEXT textureGrad\",\n\t\t\"#define texture2DProjGradEXT textureProjGrad\",\n\t\t\"#define textureCubeGradEXT textureGrad\"\n\t].join(\"\\n\") + \"\\n\" + _);\n\tlet y = v + g + o, b = v + _ + s, x = tc(i, i.VERTEX_SHADER, y), S = tc(i, i.FRAGMENT_SHADER, b);\n\ti.attachShader(h, x), i.attachShader(h, S), n.index0AttributeName === void 0 ? n.morphTargets === !0 && i.bindAttribLocation(h, 0, \"position\") : i.bindAttribLocation(h, 0, n.index0AttributeName), i.linkProgram(h);\n\tfunction C(t) {\n\t\tif (e.debug.checkShaderErrors) {\n\t\t\tlet n = i.getProgramInfoLog(h) || \"\", r = i.getShaderInfoLog(x) || \"\", a = i.getShaderInfoLog(S) || \"\", o = n.trim(), s = r.trim(), c = a.trim(), l = !0, u = !0;\n\t\t\tif (i.getProgramParameter(h, i.LINK_STATUS) === !1) {\n\t\t\t\tif (l = !1, typeof e.debug.onShaderError == \"function\") e.debug.onShaderError(i, h, x, S);\n\t\t\t\telse {\n\t\t\t\t\tlet e = sc(i, x, \"vertex\"), n = sc(i, S, \"fragment\");\n\t\t\t\t\tU(\"THREE.WebGLProgram: Shader Error \" + i.getError() + \" - VALIDATE_STATUS \" + i.getProgramParameter(h, i.VALIDATE_STATUS) + \"\\n\\nMaterial Name: \" + t.name + \"\\nMaterial Type: \" + t.type + \"\\n\\nProgram Info Log: \" + o + \"\\n\" + e + \"\\n\" + n);\n\t\t\t\t}\n\t\t\t} else o === \"\" ? (s === \"\" || c === \"\") && (u = !1) : H(\"WebGLProgram: Program Info Log:\", o);\n\t\t\tu && (t.diagnostics = {\n\t\t\t\trunnable: l,\n\t\t\t\tprogramLog: o,\n\t\t\t\tvertexShader: {\n\t\t\t\t\tlog: s,\n\t\t\t\t\tprefix: g\n\t\t\t\t},\n\t\t\t\tfragmentShader: {\n\t\t\t\t\tlog: c,\n\t\t\t\t\tprefix: _\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\ti.deleteShader(x), i.deleteShader(S), w = new ec(i, h), T = hc(i, h);\n\t}\n\tlet w;\n\tthis.getUniforms = function() {\n\t\treturn w === void 0 && C(this), w;\n\t};\n\tlet T;\n\tthis.getAttributes = function() {\n\t\treturn T === void 0 && C(this), T;\n\t};\n\tlet E = n.rendererExtensionParallelShaderCompile === !1;\n\treturn this.isReady = function() {\n\t\treturn E === !1 && (E = i.getProgramParameter(h, nc)), E;\n\t}, this.destroy = function() {\n\t\tr.releaseStatesOfProgram(this), i.deleteProgram(h), this.program = void 0;\n\t}, this.type = n.shaderType, this.name = n.shaderName, this.id = rc++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = x, this.fragmentShader = S, this;\n}\nvar Lc = 0, Rc = class {\n\tconstructor() {\n\t\tthis.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();\n\t}\n\tupdate(e) {\n\t\tlet t = e.vertexShader, n = e.fragmentShader, r = this._getShaderStage(t), i = this._getShaderStage(n), a = this._getShaderCacheForMaterial(e);\n\t\treturn a.has(r) === !1 && (a.add(r), r.usedTimes++), a.has(i) === !1 && (a.add(i), i.usedTimes++), this;\n\t}\n\tremove(e) {\n\t\tlet t = this.materialCache.get(e);\n\t\tfor (let e of t) e.usedTimes--, e.usedTimes === 0 && this.shaderCache.delete(e.code);\n\t\treturn this.materialCache.delete(e), this;\n\t}\n\tgetVertexShaderID(e) {\n\t\treturn this._getShaderStage(e.vertexShader).id;\n\t}\n\tgetFragmentShaderID(e) {\n\t\treturn this._getShaderStage(e.fragmentShader).id;\n\t}\n\tdispose() {\n\t\tthis.shaderCache.clear(), this.materialCache.clear();\n\t}\n\t_getShaderCacheForMaterial(e) {\n\t\tlet t = this.materialCache, n = t.get(e);\n\t\treturn n === void 0 && (n = /* @__PURE__ */ new Set(), t.set(e, n)), n;\n\t}\n\t_getShaderStage(e) {\n\t\tlet t = this.shaderCache, n = t.get(e);\n\t\treturn n === void 0 && (n = new zc(e), t.set(e, n)), n;\n\t}\n}, zc = class {\n\tconstructor(e) {\n\t\tthis.id = Lc++, this.code = e, this.usedTimes = 0;\n\t}\n};\nfunction Bc(e) {\n\treturn e === 1030 || e === 37490 || e === 36285;\n}\nfunction Vc(e, t, n, r, i, a) {\n\tlet o = new Hn(), s = new Rc(), c = /* @__PURE__ */ new Set(), l = [], u = /* @__PURE__ */ new Map(), d = r.logarithmicDepthBuffer, f = r.precision, p = {\n\t\tMeshDepthMaterial: \"depth\",\n\t\tMeshDistanceMaterial: \"distance\",\n\t\tMeshNormalMaterial: \"normal\",\n\t\tMeshBasicMaterial: \"basic\",\n\t\tMeshLambertMaterial: \"lambert\",\n\t\tMeshPhongMaterial: \"phong\",\n\t\tMeshToonMaterial: \"toon\",\n\t\tMeshStandardMaterial: \"physical\",\n\t\tMeshPhysicalMaterial: \"physical\",\n\t\tMeshMatcapMaterial: \"matcap\",\n\t\tLineBasicMaterial: \"basic\",\n\t\tLineDashedMaterial: \"dashed\",\n\t\tPointsMaterial: \"points\",\n\t\tShadowMaterial: \"shadow\",\n\t\tSpriteMaterial: \"sprite\"\n\t};\n\tfunction m(e) {\n\t\treturn c.add(e), e === 0 ? \"uv\" : `uv${e}`;\n\t}\n\tfunction h(i, o, l, u, h, g) {\n\t\tlet _ = u.fog, v = h.geometry, y = i.isMeshStandardMaterial || i.isMeshLambertMaterial || i.isMeshPhongMaterial ? u.environment : null, b = i.isMeshStandardMaterial || i.isMeshLambertMaterial && !i.envMap || i.isMeshPhongMaterial && !i.envMap, x = t.get(i.envMap || y, b), S = x && x.mapping === 306 ? x.image.height : null, C = p[i.type];\n\t\ti.precision !== null && (f = r.getMaxPrecision(i.precision), f !== i.precision && H(\"WebGLProgram.getParameters:\", i.precision, \"not supported, using\", f, \"instead.\"));\n\t\tlet w = v.morphAttributes.position || v.morphAttributes.normal || v.morphAttributes.color, T = w === void 0 ? 0 : w.length, E = 0;\n\t\tv.morphAttributes.position !== void 0 && (E = 1), v.morphAttributes.normal !== void 0 && (E = 2), v.morphAttributes.color !== void 0 && (E = 3);\n\t\tlet D, O, k, A;\n\t\tif (C) {\n\t\t\tlet e = co[C];\n\t\t\tD = e.vertexShader, O = e.fragmentShader;\n\t\t} else D = i.vertexShader, O = i.fragmentShader, s.update(i), k = s.getVertexShaderID(i), A = s.getFragmentShaderID(i);\n\t\tlet j = e.getRenderTarget(), M = e.state.buffers.depth.getReversed(), N = h.isInstancedMesh === !0, P = h.isBatchedMesh === !0, F = !!i.map, I = !!i.matcap, ee = !!x, te = !!i.aoMap, ne = !!i.lightMap, L = !!i.bumpMap, re = !!i.normalMap, ie = !!i.displacementMap, R = !!i.emissiveMap, ae = !!i.metalnessMap, oe = !!i.roughnessMap, se = i.anisotropy > 0, ce = i.clearcoat > 0, le = i.dispersion > 0, ue = i.iridescence > 0, de = i.sheen > 0, fe = i.transmission > 0, pe = se && !!i.anisotropyMap, me = ce && !!i.clearcoatMap, he = ce && !!i.clearcoatNormalMap, ge = ce && !!i.clearcoatRoughnessMap, _e = ue && !!i.iridescenceMap, ve = ue && !!i.iridescenceThicknessMap, ye = de && !!i.sheenColorMap, be = de && !!i.sheenRoughnessMap, xe = !!i.specularMap, Se = !!i.specularColorMap, Ce = !!i.specularIntensityMap, z = fe && !!i.transmissionMap, we = fe && !!i.thicknessMap, Te = !!i.gradientMap, Ee = !!i.alphaMap, De = i.alphaTest > 0, Oe = !!i.alphaHash, ke = !!i.extensions, B = 0;\n\t\ti.toneMapped && (j === null || j.isXRRenderTarget === !0) && (B = e.toneMapping);\n\t\tlet Ae = {\n\t\t\tshaderID: C,\n\t\t\tshaderType: i.type,\n\t\t\tshaderName: i.name,\n\t\t\tvertexShader: D,\n\t\t\tfragmentShader: O,\n\t\t\tdefines: i.defines,\n\t\t\tcustomVertexShaderID: k,\n\t\t\tcustomFragmentShaderID: A,\n\t\t\tisRawShaderMaterial: i.isRawShaderMaterial === !0,\n\t\t\tglslVersion: i.glslVersion,\n\t\t\tprecision: f,\n\t\t\tbatching: P,\n\t\t\tbatchingColor: P && h._colorsTexture !== null,\n\t\t\tinstancing: N,\n\t\t\tinstancingColor: N && h.instanceColor !== null,\n\t\t\tinstancingMorph: N && h.morphTexture !== null,\n\t\t\toutputColorSpace: j === null ? e.outputColorSpace : j.isXRRenderTarget === !0 ? j.texture.colorSpace : gn.workingColorSpace,\n\t\t\talphaToCoverage: !!i.alphaToCoverage,\n\t\t\tmap: F,\n\t\t\tmatcap: I,\n\t\t\tenvMap: ee,\n\t\t\tenvMapMode: ee && x.mapping,\n\t\t\tenvMapCubeUVHeight: S,\n\t\t\taoMap: te,\n\t\t\tlightMap: ne,\n\t\t\tbumpMap: L,\n\t\t\tnormalMap: re,\n\t\t\tdisplacementMap: ie,\n\t\t\temissiveMap: R,\n\t\t\tnormalMapObjectSpace: re && i.normalMapType === 1,\n\t\t\tnormalMapTangentSpace: re && i.normalMapType === 0,\n\t\t\tpackedNormalMap: re && i.normalMapType === 0 && Bc(i.normalMap.format),\n\t\t\tmetalnessMap: ae,\n\t\t\troughnessMap: oe,\n\t\t\tanisotropy: se,\n\t\t\tanisotropyMap: pe,\n\t\t\tclearcoat: ce,\n\t\t\tclearcoatMap: me,\n\t\t\tclearcoatNormalMap: he,\n\t\t\tclearcoatRoughnessMap: ge,\n\t\t\tdispersion: le,\n\t\t\tiridescence: ue,\n\t\t\tiridescenceMap: _e,\n\t\t\tiridescenceThicknessMap: ve,\n\t\t\tsheen: de,\n\t\t\tsheenColorMap: ye,\n\t\t\tsheenRoughnessMap: be,\n\t\t\tspecularMap: xe,\n\t\t\tspecularColorMap: Se,\n\t\t\tspecularIntensityMap: Ce,\n\t\t\ttransmission: fe,\n\t\t\ttransmissionMap: z,\n\t\t\tthicknessMap: we,\n\t\t\tgradientMap: Te,\n\t\t\topaque: i.transparent === !1 && i.blending === 1 && i.alphaToCoverage === !1,\n\t\t\talphaMap: Ee,\n\t\t\talphaTest: De,\n\t\t\talphaHash: Oe,\n\t\t\tcombine: i.combine,\n\t\t\tmapUv: F && m(i.map.channel),\n\t\t\taoMapUv: te && m(i.aoMap.channel),\n\t\t\tlightMapUv: ne && m(i.lightMap.channel),\n\t\t\tbumpMapUv: L && m(i.bumpMap.channel),\n\t\t\tnormalMapUv: re && m(i.normalMap.channel),\n\t\t\tdisplacementMapUv: ie && m(i.displacementMap.channel),\n\t\t\temissiveMapUv: R && m(i.emissiveMap.channel),\n\t\t\tmetalnessMapUv: ae && m(i.metalnessMap.channel),\n\t\t\troughnessMapUv: oe && m(i.roughnessMap.channel),\n\t\t\tanisotropyMapUv: pe && m(i.anisotropyMap.channel),\n\t\t\tclearcoatMapUv: me && m(i.clearcoatMap.channel),\n\t\t\tclearcoatNormalMapUv: he && m(i.clearcoatNormalMap.channel),\n\t\t\tclearcoatRoughnessMapUv: ge && m(i.clearcoatRoughnessMap.channel),\n\t\t\tiridescenceMapUv: _e && m(i.iridescenceMap.channel),\n\t\t\tiridescenceThicknessMapUv: ve && m(i.iridescenceThicknessMap.channel),\n\t\t\tsheenColorMapUv: ye && m(i.sheenColorMap.channel),\n\t\t\tsheenRoughnessMapUv: be && m(i.sheenRoughnessMap.channel),\n\t\t\tspecularMapUv: xe && m(i.specularMap.channel),\n\t\t\tspecularColorMapUv: Se && m(i.specularColorMap.channel),\n\t\t\tspecularIntensityMapUv: Ce && m(i.specularIntensityMap.channel),\n\t\t\ttransmissionMapUv: z && m(i.transmissionMap.channel),\n\t\t\tthicknessMapUv: we && m(i.thicknessMap.channel),\n\t\t\talphaMapUv: Ee && m(i.alphaMap.channel),\n\t\t\tvertexTangents: !!v.attributes.tangent && (re || se),\n\t\t\tvertexNormals: !!v.attributes.normal,\n\t\t\tvertexColors: i.vertexColors,\n\t\t\tvertexAlphas: i.vertexColors === !0 && !!v.attributes.color && v.attributes.color.itemSize === 4,\n\t\t\tpointsUvs: h.isPoints === !0 && !!v.attributes.uv && (F || Ee),\n\t\t\tfog: !!_,\n\t\t\tuseFog: i.fog === !0,\n\t\t\tfogExp2: !!_ && _.isFogExp2,\n\t\t\tflatShading: i.wireframe === !1 && (i.flatShading === !0 || v.attributes.normal === void 0 && re === !1 && (i.isMeshLambertMaterial || i.isMeshPhongMaterial || i.isMeshStandardMaterial || i.isMeshPhysicalMaterial)),\n\t\t\tsizeAttenuation: i.sizeAttenuation === !0,\n\t\t\tlogarithmicDepthBuffer: d,\n\t\t\treversedDepthBuffer: M,\n\t\t\tskinning: h.isSkinnedMesh === !0,\n\t\t\tmorphTargets: v.morphAttributes.position !== void 0,\n\t\t\tmorphNormals: v.morphAttributes.normal !== void 0,\n\t\t\tmorphColors: v.morphAttributes.color !== void 0,\n\t\t\tmorphTargetsCount: T,\n\t\t\tmorphTextureStride: E,\n\t\t\tnumDirLights: o.directional.length,\n\t\t\tnumPointLights: o.point.length,\n\t\t\tnumSpotLights: o.spot.length,\n\t\t\tnumSpotLightMaps: o.spotLightMap.length,\n\t\t\tnumRectAreaLights: o.rectArea.length,\n\t\t\tnumHemiLights: o.hemi.length,\n\t\t\tnumDirLightShadows: o.directionalShadowMap.length,\n\t\t\tnumPointLightShadows: o.pointShadowMap.length,\n\t\t\tnumSpotLightShadows: o.spotShadowMap.length,\n\t\t\tnumSpotLightShadowsWithMaps: o.numSpotLightShadowsWithMaps,\n\t\t\tnumLightProbes: o.numLightProbes,\n\t\t\tnumLightProbeGrids: g.length,\n\t\t\tnumClippingPlanes: a.numPlanes,\n\t\t\tnumClipIntersection: a.numIntersection,\n\t\t\tdithering: i.dithering,\n\t\t\tshadowMapEnabled: e.shadowMap.enabled && l.length > 0,\n\t\t\tshadowMapType: e.shadowMap.type,\n\t\t\ttoneMapping: B,\n\t\t\tdecodeVideoTexture: F && i.map.isVideoTexture === !0 && gn.getTransfer(i.map.colorSpace) === \"srgb\",\n\t\t\tdecodeVideoTextureEmissive: R && i.emissiveMap.isVideoTexture === !0 && gn.getTransfer(i.emissiveMap.colorSpace) === \"srgb\",\n\t\t\tpremultipliedAlpha: i.premultipliedAlpha,\n\t\t\tdoubleSided: i.side === 2,\n\t\t\tflipSided: i.side === 1,\n\t\t\tuseDepthPacking: i.depthPacking >= 0,\n\t\t\tdepthPacking: i.depthPacking || 0,\n\t\t\tindex0AttributeName: i.index0AttributeName,\n\t\t\textensionClipCullDistance: ke && i.extensions.clipCullDistance === !0 && n.has(\"WEBGL_clip_cull_distance\"),\n\t\t\textensionMultiDraw: (ke && i.extensions.multiDraw === !0 || P) && n.has(\"WEBGL_multi_draw\"),\n\t\t\trendererExtensionParallelShaderCompile: n.has(\"KHR_parallel_shader_compile\"),\n\t\t\tcustomProgramCacheKey: i.customProgramCacheKey()\n\t\t};\n\t\treturn Ae.vertexUv1s = c.has(1), Ae.vertexUv2s = c.has(2), Ae.vertexUv3s = c.has(3), c.clear(), Ae;\n\t}\n\tfunction g(t) {\n\t\tlet n = [];\n\t\tif (t.shaderID ? n.push(t.shaderID) : (n.push(t.customVertexShaderID), n.push(t.customFragmentShaderID)), t.defines !== void 0) for (let e in t.defines) n.push(e), n.push(t.defines[e]);\n\t\treturn t.isRawShaderMaterial === !1 && (_(n, t), v(n, t), n.push(e.outputColorSpace)), n.push(t.customProgramCacheKey), n.join();\n\t}\n\tfunction _(e, t) {\n\t\te.push(t.precision), e.push(t.outputColorSpace), e.push(t.envMapMode), e.push(t.envMapCubeUVHeight), e.push(t.mapUv), e.push(t.alphaMapUv), e.push(t.lightMapUv), e.push(t.aoMapUv), e.push(t.bumpMapUv), e.push(t.normalMapUv), e.push(t.displacementMapUv), e.push(t.emissiveMapUv), e.push(t.metalnessMapUv), e.push(t.roughnessMapUv), e.push(t.anisotropyMapUv), e.push(t.clearcoatMapUv), e.push(t.clearcoatNormalMapUv), e.push(t.clearcoatRoughnessMapUv), e.push(t.iridescenceMapUv), e.push(t.iridescenceThicknessMapUv), e.push(t.sheenColorMapUv), e.push(t.sheenRoughnessMapUv), e.push(t.specularMapUv), e.push(t.specularColorMapUv), e.push(t.specularIntensityMapUv), e.push(t.transmissionMapUv), e.push(t.thicknessMapUv), e.push(t.combine), e.push(t.fogExp2), e.push(t.sizeAttenuation), e.push(t.morphTargetsCount), e.push(t.morphAttributeCount), e.push(t.numDirLights), e.push(t.numPointLights), e.push(t.numSpotLights), e.push(t.numSpotLightMaps), e.push(t.numHemiLights), e.push(t.numRectAreaLights), e.push(t.numDirLightShadows), e.push(t.numPointLightShadows), e.push(t.numSpotLightShadows), e.push(t.numSpotLightShadowsWithMaps), e.push(t.numLightProbes), e.push(t.shadowMapType), e.push(t.toneMapping), e.push(t.numClippingPlanes), e.push(t.numClipIntersection), e.push(t.depthPacking);\n\t}\n\tfunction v(e, t) {\n\t\to.disableAll(), t.instancing && o.enable(0), t.instancingColor && o.enable(1), t.instancingMorph && o.enable(2), t.matcap && o.enable(3), t.envMap && o.enable(4), t.normalMapObjectSpace && o.enable(5), t.normalMapTangentSpace && o.enable(6), t.clearcoat && o.enable(7), t.iridescence && o.enable(8), t.alphaTest && o.enable(9), t.vertexColors && o.enable(10), t.vertexAlphas && o.enable(11), t.vertexUv1s && o.enable(12), t.vertexUv2s && o.enable(13), t.vertexUv3s && o.enable(14), t.vertexTangents && o.enable(15), t.anisotropy && o.enable(16), t.alphaHash && o.enable(17), t.batching && o.enable(18), t.dispersion && o.enable(19), t.batchingColor && o.enable(20), t.gradientMap && o.enable(21), t.packedNormalMap && o.enable(22), t.vertexNormals && o.enable(23), e.push(o.mask), o.disableAll(), t.fog && o.enable(0), t.useFog && o.enable(1), t.flatShading && o.enable(2), t.logarithmicDepthBuffer && o.enable(3), t.reversedDepthBuffer && o.enable(4), t.skinning && o.enable(5), t.morphTargets && o.enable(6), t.morphNormals && o.enable(7), t.morphColors && o.enable(8), t.premultipliedAlpha && o.enable(9), t.shadowMapEnabled && o.enable(10), t.doubleSided && o.enable(11), t.flipSided && o.enable(12), t.useDepthPacking && o.enable(13), t.dithering && o.enable(14), t.transmission && o.enable(15), t.sheen && o.enable(16), t.opaque && o.enable(17), t.pointsUvs && o.enable(18), t.decodeVideoTexture && o.enable(19), t.decodeVideoTextureEmissive && o.enable(20), t.alphaToCoverage && o.enable(21), t.numLightProbeGrids > 0 && o.enable(22), e.push(o.mask);\n\t}\n\tfunction y(e) {\n\t\tlet t = p[e.type], n;\n\t\tif (t) {\n\t\t\tlet e = co[t];\n\t\t\tn = la.clone(e.uniforms);\n\t\t} else n = e.uniforms;\n\t\treturn n;\n\t}\n\tfunction b(t, n) {\n\t\tlet r = u.get(n);\n\t\treturn r === void 0 ? (r = new Ic(e, n, t, i), l.push(r), u.set(n, r)) : ++r.usedTimes, r;\n\t}\n\tfunction x(e) {\n\t\tif (--e.usedTimes === 0) {\n\t\t\tlet t = l.indexOf(e);\n\t\t\tl[t] = l[l.length - 1], l.pop(), u.delete(e.cacheKey), e.destroy();\n\t\t}\n\t}\n\tfunction S(e) {\n\t\ts.remove(e);\n\t}\n\tfunction C() {\n\t\ts.dispose();\n\t}\n\treturn {\n\t\tgetParameters: h,\n\t\tgetProgramCacheKey: g,\n\t\tgetUniforms: y,\n\t\tacquireProgram: b,\n\t\treleaseProgram: x,\n\t\treleaseShaderCache: S,\n\t\tprograms: l,\n\t\tdispose: C\n\t};\n}\nfunction Hc() {\n\tlet e = /* @__PURE__ */ new WeakMap();\n\tfunction t(t) {\n\t\treturn e.has(t);\n\t}\n\tfunction n(t) {\n\t\tlet n = e.get(t);\n\t\treturn n === void 0 && (n = {}, e.set(t, n)), n;\n\t}\n\tfunction r(t) {\n\t\te.delete(t);\n\t}\n\tfunction i(t, n, r) {\n\t\te.get(t)[n] = r;\n\t}\n\tfunction a() {\n\t\te = /* @__PURE__ */ new WeakMap();\n\t}\n\treturn {\n\t\thas: t,\n\t\tget: n,\n\t\tremove: r,\n\t\tupdate: i,\n\t\tdispose: a\n\t};\n}\nfunction Uc(e, t) {\n\treturn e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.material.id === t.material.id ? e.materialVariant === t.materialVariant ? e.z === t.z ? e.id - t.id : e.z - t.z : e.materialVariant - t.materialVariant : e.material.id - t.material.id : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;\n}\nfunction Wc(e, t) {\n\treturn e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.z === t.z ? e.id - t.id : t.z - e.z : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;\n}\nfunction Gc() {\n\tlet e = [], t = 0, n = [], r = [], i = [];\n\tfunction a() {\n\t\tt = 0, n.length = 0, r.length = 0, i.length = 0;\n\t}\n\tfunction o(e) {\n\t\tlet t = 0;\n\t\treturn e.isInstancedMesh && (t += 2), e.isSkinnedMesh && (t += 1), t;\n\t}\n\tfunction s(n, r, i, a, s, c) {\n\t\tlet l = e[t];\n\t\treturn l === void 0 ? (l = {\n\t\t\tid: n.id,\n\t\t\tobject: n,\n\t\t\tgeometry: r,\n\t\t\tmaterial: i,\n\t\t\tmaterialVariant: o(n),\n\t\t\tgroupOrder: a,\n\t\t\trenderOrder: n.renderOrder,\n\t\t\tz: s,\n\t\t\tgroup: c\n\t\t}, e[t] = l) : (l.id = n.id, l.object = n, l.geometry = r, l.material = i, l.materialVariant = o(n), l.groupOrder = a, l.renderOrder = n.renderOrder, l.z = s, l.group = c), t++, l;\n\t}\n\tfunction c(e, t, a, o, c, l) {\n\t\tlet u = s(e, t, a, o, c, l);\n\t\ta.transmission > 0 ? r.push(u) : a.transparent === !0 ? i.push(u) : n.push(u);\n\t}\n\tfunction l(e, t, a, o, c, l) {\n\t\tlet u = s(e, t, a, o, c, l);\n\t\ta.transmission > 0 ? r.unshift(u) : a.transparent === !0 ? i.unshift(u) : n.unshift(u);\n\t}\n\tfunction u(e, t) {\n\t\tn.length > 1 && n.sort(e || Uc), r.length > 1 && r.sort(t || Wc), i.length > 1 && i.sort(t || Wc);\n\t}\n\tfunction d() {\n\t\tfor (let n = t, r = e.length; n < r; n++) {\n\t\t\tlet t = e[n];\n\t\t\tif (t.id === null) break;\n\t\t\tt.id = null, t.object = null, t.geometry = null, t.material = null, t.group = null;\n\t\t}\n\t}\n\treturn {\n\t\topaque: n,\n\t\ttransmissive: r,\n\t\ttransparent: i,\n\t\tinit: a,\n\t\tpush: c,\n\t\tunshift: l,\n\t\tfinish: d,\n\t\tsort: u\n\t};\n}\nfunction Kc() {\n\tlet e = /* @__PURE__ */ new WeakMap();\n\tfunction t(t, n) {\n\t\tlet r = e.get(t), i;\n\t\treturn r === void 0 ? (i = new Gc(), e.set(t, [i])) : n >= r.length ? (i = new Gc(), r.push(i)) : i = r[n], i;\n\t}\n\tfunction n() {\n\t\te = /* @__PURE__ */ new WeakMap();\n\t}\n\treturn {\n\t\tget: t,\n\t\tdispose: n\n\t};\n}\nfunction qc() {\n\tlet e = {};\n\treturn { get: function(t) {\n\t\tif (e[t.id] !== void 0) return e[t.id];\n\t\tlet n;\n\t\tswitch (t.type) {\n\t\t\tcase \"DirectionalLight\":\n\t\t\t\tn = {\n\t\t\t\t\tdirection: new K(),\n\t\t\t\t\tcolor: new fr()\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"SpotLight\":\n\t\t\t\tn = {\n\t\t\t\t\tposition: new K(),\n\t\t\t\t\tdirection: new K(),\n\t\t\t\t\tcolor: new fr(),\n\t\t\t\t\tdistance: 0,\n\t\t\t\t\tconeCos: 0,\n\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\tdecay: 0\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"PointLight\":\n\t\t\t\tn = {\n\t\t\t\t\tposition: new K(),\n\t\t\t\t\tcolor: new fr(),\n\t\t\t\t\tdistance: 0,\n\t\t\t\t\tdecay: 0\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"HemisphereLight\":\n\t\t\t\tn = {\n\t\t\t\t\tdirection: new K(),\n\t\t\t\t\tskyColor: new fr(),\n\t\t\t\t\tgroundColor: new fr()\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"RectAreaLight\": n = {\n\t\t\t\tcolor: new fr(),\n\t\t\t\tposition: new K(),\n\t\t\t\thalfWidth: new K(),\n\t\t\t\thalfHeight: new K()\n\t\t\t};\n\t\t}\n\t\treturn e[t.id] = n, n;\n\t} };\n}\nfunction Jc() {\n\tlet e = {};\n\treturn { get: function(t) {\n\t\tif (e[t.id] !== void 0) return e[t.id];\n\t\tlet n;\n\t\tswitch (t.type) {\n\t\t\tcase \"DirectionalLight\":\n\t\t\t\tn = {\n\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\tshadowMapSize: new G()\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"SpotLight\":\n\t\t\t\tn = {\n\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\tshadowMapSize: new G()\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"PointLight\": n = {\n\t\t\t\tshadowIntensity: 1,\n\t\t\t\tshadowBias: 0,\n\t\t\t\tshadowNormalBias: 0,\n\t\t\t\tshadowRadius: 1,\n\t\t\t\tshadowMapSize: new G(),\n\t\t\t\tshadowCameraNear: 1,\n\t\t\t\tshadowCameraFar: 1e3\n\t\t\t};\n\t\t}\n\t\treturn e[t.id] = n, n;\n\t} };\n}\nvar Yc = 0;\nfunction Xc(e, t) {\n\treturn (t.castShadow ? 2 : 0) - (e.castShadow ? 2 : 0) + +!!t.map - !!e.map;\n}\nfunction Zc(e) {\n\tlet t = new qc(), n = Jc(), r = {\n\t\tversion: 0,\n\t\thash: {\n\t\t\tdirectionalLength: -1,\n\t\t\tpointLength: -1,\n\t\t\tspotLength: -1,\n\t\t\trectAreaLength: -1,\n\t\t\themiLength: -1,\n\t\t\tnumDirectionalShadows: -1,\n\t\t\tnumPointShadows: -1,\n\t\t\tnumSpotShadows: -1,\n\t\t\tnumSpotMaps: -1,\n\t\t\tnumLightProbes: -1\n\t\t},\n\t\tambient: [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\tprobe: [],\n\t\tdirectional: [],\n\t\tdirectionalShadow: [],\n\t\tdirectionalShadowMap: [],\n\t\tdirectionalShadowMatrix: [],\n\t\tspot: [],\n\t\tspotLightMap: [],\n\t\tspotShadow: [],\n\t\tspotShadowMap: [],\n\t\tspotLightMatrix: [],\n\t\trectArea: [],\n\t\trectAreaLTC1: null,\n\t\trectAreaLTC2: null,\n\t\tpoint: [],\n\t\tpointShadow: [],\n\t\tpointShadowMap: [],\n\t\tpointShadowMatrix: [],\n\t\themi: [],\n\t\tnumSpotLightShadowsWithMaps: 0,\n\t\tnumLightProbes: 0\n\t};\n\tfor (let e = 0; e < 9; e++) r.probe.push(new K());\n\tlet i = new K(), a = new J(), o = new J();\n\tfunction s(i) {\n\t\tlet a = 0, o = 0, s = 0;\n\t\tfor (let e = 0; e < 9; e++) r.probe[e].set(0, 0, 0);\n\t\tlet c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0;\n\t\ti.sort(Xc);\n\t\tfor (let e = 0, y = i.length; e < y; e++) {\n\t\t\tlet y = i[e], b = y.color, x = y.intensity, S = y.distance, C = null;\n\t\t\tif (y.shadow && y.shadow.map && (C = y.shadow.map.texture.format === 1030 ? y.shadow.map.texture : y.shadow.map.depthTexture || y.shadow.map.texture), y.isAmbientLight) a += b.r * x, o += b.g * x, s += b.b * x;\n\t\t\telse if (y.isLightProbe) {\n\t\t\t\tfor (let e = 0; e < 9; e++) r.probe[e].addScaledVector(y.sh.coefficients[e], x);\n\t\t\t\tv++;\n\t\t\t} else if (y.isDirectionalLight) {\n\t\t\t\tlet e = t.get(y);\n\t\t\t\tif (e.color.copy(y.color).multiplyScalar(y.intensity), y.castShadow) {\n\t\t\t\t\tlet e = y.shadow, t = n.get(y);\n\t\t\t\t\tt.shadowIntensity = e.intensity, t.shadowBias = e.bias, t.shadowNormalBias = e.normalBias, t.shadowRadius = e.radius, t.shadowMapSize = e.mapSize, r.directionalShadow[c] = t, r.directionalShadowMap[c] = C, r.directionalShadowMatrix[c] = y.shadow.matrix, p++;\n\t\t\t\t}\n\t\t\t\tr.directional[c] = e, c++;\n\t\t\t} else if (y.isSpotLight) {\n\t\t\t\tlet e = t.get(y);\n\t\t\t\te.position.setFromMatrixPosition(y.matrixWorld), e.color.copy(b).multiplyScalar(x), e.distance = S, e.coneCos = Math.cos(y.angle), e.penumbraCos = Math.cos(y.angle * (1 - y.penumbra)), e.decay = y.decay, r.spot[u] = e;\n\t\t\t\tlet i = y.shadow;\n\t\t\t\tif (y.map && (r.spotLightMap[g] = y.map, g++, i.updateMatrices(y), y.castShadow && _++), r.spotLightMatrix[u] = i.matrix, y.castShadow) {\n\t\t\t\t\tlet e = n.get(y);\n\t\t\t\t\te.shadowIntensity = i.intensity, e.shadowBias = i.bias, e.shadowNormalBias = i.normalBias, e.shadowRadius = i.radius, e.shadowMapSize = i.mapSize, r.spotShadow[u] = e, r.spotShadowMap[u] = C, h++;\n\t\t\t\t}\n\t\t\t\tu++;\n\t\t\t} else if (y.isRectAreaLight) {\n\t\t\t\tlet e = t.get(y);\n\t\t\t\te.color.copy(b).multiplyScalar(x), e.halfWidth.set(y.width * .5, 0, 0), e.halfHeight.set(0, y.height * .5, 0), r.rectArea[d] = e, d++;\n\t\t\t} else if (y.isPointLight) {\n\t\t\t\tlet e = t.get(y);\n\t\t\t\tif (e.color.copy(y.color).multiplyScalar(y.intensity), e.distance = y.distance, e.decay = y.decay, y.castShadow) {\n\t\t\t\t\tlet e = y.shadow, t = n.get(y);\n\t\t\t\t\tt.shadowIntensity = e.intensity, t.shadowBias = e.bias, t.shadowNormalBias = e.normalBias, t.shadowRadius = e.radius, t.shadowMapSize = e.mapSize, t.shadowCameraNear = e.camera.near, t.shadowCameraFar = e.camera.far, r.pointShadow[l] = t, r.pointShadowMap[l] = C, r.pointShadowMatrix[l] = y.shadow.matrix, m++;\n\t\t\t\t}\n\t\t\t\tr.point[l] = e, l++;\n\t\t\t} else if (y.isHemisphereLight) {\n\t\t\t\tlet e = t.get(y);\n\t\t\t\te.skyColor.copy(y.color).multiplyScalar(x), e.groundColor.copy(y.groundColor).multiplyScalar(x), r.hemi[f] = e, f++;\n\t\t\t}\n\t\t}\n\t\td > 0 && (e.has(\"OES_texture_float_linear\") === !0 ? (r.rectAreaLTC1 = X.LTC_FLOAT_1, r.rectAreaLTC2 = X.LTC_FLOAT_2) : (r.rectAreaLTC1 = X.LTC_HALF_1, r.rectAreaLTC2 = X.LTC_HALF_2)), r.ambient[0] = a, r.ambient[1] = o, r.ambient[2] = s;\n\t\tlet y = r.hash;\n\t\t(y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = Yc++);\n\t}\n\tfunction c(e, t) {\n\t\tlet n = 0, s = 0, c = 0, l = 0, u = 0, d = t.matrixWorldInverse;\n\t\tfor (let t = 0, f = e.length; t < f; t++) {\n\t\t\tlet f = e[t];\n\t\t\tif (f.isDirectionalLight) {\n\t\t\t\tlet e = r.directional[n];\n\t\t\t\te.direction.setFromMatrixPosition(f.matrixWorld), i.setFromMatrixPosition(f.target.matrixWorld), e.direction.sub(i), e.direction.transformDirection(d), n++;\n\t\t\t} else if (f.isSpotLight) {\n\t\t\t\tlet e = r.spot[c];\n\t\t\t\te.position.setFromMatrixPosition(f.matrixWorld), e.position.applyMatrix4(d), e.direction.setFromMatrixPosition(f.matrixWorld), i.setFromMatrixPosition(f.target.matrixWorld), e.direction.sub(i), e.direction.transformDirection(d), c++;\n\t\t\t} else if (f.isRectAreaLight) {\n\t\t\t\tlet e = r.rectArea[l];\n\t\t\t\te.position.setFromMatrixPosition(f.matrixWorld), e.position.applyMatrix4(d), o.identity(), a.copy(f.matrixWorld), a.premultiply(d), o.extractRotation(a), e.halfWidth.set(f.width * .5, 0, 0), e.halfHeight.set(0, f.height * .5, 0), e.halfWidth.applyMatrix4(o), e.halfHeight.applyMatrix4(o), l++;\n\t\t\t} else if (f.isPointLight) {\n\t\t\t\tlet e = r.point[s];\n\t\t\t\te.position.setFromMatrixPosition(f.matrixWorld), e.position.applyMatrix4(d), s++;\n\t\t\t} else if (f.isHemisphereLight) {\n\t\t\t\tlet e = r.hemi[u];\n\t\t\t\te.direction.setFromMatrixPosition(f.matrixWorld), e.direction.transformDirection(d), u++;\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tsetup: s,\n\t\tsetupView: c,\n\t\tstate: r\n\t};\n}\nfunction Qc(e) {\n\tlet t = new Zc(e), n = [], r = [], i = [];\n\tfunction a(e) {\n\t\td.camera = e, n.length = 0, r.length = 0, i.length = 0;\n\t}\n\tfunction o(e) {\n\t\tn.push(e);\n\t}\n\tfunction s(e) {\n\t\tr.push(e);\n\t}\n\tfunction c(e) {\n\t\ti.push(e);\n\t}\n\tfunction l() {\n\t\tt.setup(n);\n\t}\n\tfunction u(e) {\n\t\tt.setupView(n, e);\n\t}\n\tlet d = {\n\t\tlightsArray: n,\n\t\tshadowsArray: r,\n\t\tlightProbeGridArray: i,\n\t\tcamera: null,\n\t\tlights: t,\n\t\ttransmissionRenderTarget: {},\n\t\ttextureUnits: 0\n\t};\n\treturn {\n\t\tinit: a,\n\t\tstate: d,\n\t\tsetupLights: l,\n\t\tsetupLightsView: u,\n\t\tpushLight: o,\n\t\tpushShadow: s,\n\t\tpushLightProbeGrid: c\n\t};\n}\nfunction $c(e) {\n\tlet t = /* @__PURE__ */ new WeakMap();\n\tfunction n(n, r = 0) {\n\t\tlet i = t.get(n), a;\n\t\treturn i === void 0 ? (a = new Qc(e), t.set(n, [a])) : r >= i.length ? (a = new Qc(e), i.push(a)) : a = i[r], a;\n\t}\n\tfunction r() {\n\t\tt = /* @__PURE__ */ new WeakMap();\n\t}\n\treturn {\n\t\tget: n,\n\t\tdispose: r\n\t};\n}\nvar el = \"void main() {\\n\tgl_Position = vec4( position, 1.0 );\\n}\", tl = \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\nvoid main() {\\n\tconst float samples = float( VSM_SAMPLES );\\n\tfloat mean = 0.0;\\n\tfloat squared_mean = 0.0;\\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\t\tfloat uvOffset = uvStart + i * uvStride;\\n\t\t#ifdef HORIZONTAL_PASS\\n\t\t\tvec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\\n\t\t\tmean += distribution.x;\\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\t\t#else\\n\t\t\tfloat depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\\n\t\t\tmean += depth;\\n\t\t\tsquared_mean += depth * depth;\\n\t\t#endif\\n\t}\\n\tmean = mean / samples;\\n\tsquared_mean = squared_mean / samples;\\n\tfloat std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\\n\tgl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\\n}\", nl = [\n\t/*@__PURE__*/ new K(1, 0, 0),\n\t/*@__PURE__*/ new K(-1, 0, 0),\n\t/*@__PURE__*/ new K(0, 1, 0),\n\t/*@__PURE__*/ new K(0, -1, 0),\n\t/*@__PURE__*/ new K(0, 0, 1),\n\t/*@__PURE__*/ new K(0, 0, -1)\n], rl = [\n\t/*@__PURE__*/ new K(0, -1, 0),\n\t/*@__PURE__*/ new K(0, -1, 0),\n\t/*@__PURE__*/ new K(0, 0, 1),\n\t/*@__PURE__*/ new K(0, 0, -1),\n\t/*@__PURE__*/ new K(0, -1, 0),\n\t/*@__PURE__*/ new K(0, -1, 0)\n], il = /*@__PURE__*/ new J(), al = /*@__PURE__*/ new K(), ol = /*@__PURE__*/ new K();\nfunction sl(e, t, n) {\n\tlet r = new Ji(), i = new G(), a = new G(), o = new Dn(), s = new ma(), c = new ha(), l = {}, u = n.maxTextureSize, d = {\n\t\t0: 1,\n\t\t1: 0,\n\t\t2: 2\n\t}, f = new fa({\n\t\tdefines: { VSM_SAMPLES: 8 },\n\t\tuniforms: {\n\t\t\tshadow_pass: { value: null },\n\t\t\tresolution: { value: new G() },\n\t\t\tradius: { value: 4 }\n\t\t},\n\t\tvertexShader: el,\n\t\tfragmentShader: tl\n\t}), p = f.clone();\n\tp.defines.HORIZONTAL_PASS = 1;\n\tlet m = new pi();\n\tm.setAttribute(\"position\", new Qr(new Float32Array([\n\t\t-1,\n\t\t-1,\n\t\t.5,\n\t\t3,\n\t\t-1,\n\t\t.5,\n\t\t-1,\n\t\t3,\n\t\t.5\n\t]), 3));\n\tlet h = new Ii(m, f), g = this;\n\tthis.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = 1;\n\tlet _ = this.type;\n\tthis.render = function(t, n, s) {\n\t\tif (g.enabled === !1 || g.autoUpdate === !1 && g.needsUpdate === !1 || t.length === 0) return;\n\t\tthis.type === 2 && (H(\"WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.\"), this.type = 1);\n\t\tlet c = e.getRenderTarget(), l = e.getActiveCubeFace(), d = e.getActiveMipmapLevel(), f = e.state;\n\t\tf.setBlending(0), f.buffers.depth.getReversed() === !0 ? f.buffers.color.setClear(0, 0, 0, 0) : f.buffers.color.setClear(1, 1, 1, 1), f.buffers.depth.setTest(!0), f.setScissorTest(!1);\n\t\tlet p = _ !== this.type;\n\t\tp && n.traverse(function(e) {\n\t\t\te.material && (Array.isArray(e.material) ? e.material.forEach((e) => e.needsUpdate = !0) : e.material.needsUpdate = !0);\n\t\t});\n\t\tfor (let c = 0, l = t.length; c < l; c++) {\n\t\t\tlet l = t[c], d = l.shadow;\n\t\t\tif (d === void 0) {\n\t\t\t\tH(\"WebGLShadowMap:\", l, \"has no shadow.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (d.autoUpdate === !1 && d.needsUpdate === !1) continue;\n\t\t\ti.copy(d.mapSize);\n\t\t\tlet m = d.getFrameExtents();\n\t\t\ti.multiply(m), a.copy(d.mapSize), (i.x > u || i.y > u) && (i.x > u && (a.x = Math.floor(u / m.x), i.x = a.x * m.x, d.mapSize.x = a.x), i.y > u && (a.y = Math.floor(u / m.y), i.y = a.y * m.y, d.mapSize.y = a.y));\n\t\t\tlet h = e.state.buffers.depth.getReversed();\n\t\t\tif (d.camera._reversedDepth = h, d.map === null || p === !0) {\n\t\t\t\tif (d.map !== null && (d.map.depthTexture !== null && (d.map.depthTexture.dispose(), d.map.depthTexture = null), d.map.dispose()), this.type === 3) {\n\t\t\t\t\tif (l.isPointLight) {\n\t\t\t\t\t\tH(\"WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\td.map = new kn(i.x, i.y, {\n\t\t\t\t\t\tformat: Ee,\n\t\t\t\t\t\ttype: me,\n\t\t\t\t\t\tminFilter: R,\n\t\t\t\t\t\tmagFilter: R,\n\t\t\t\t\t\tgenerateMipmaps: !1\n\t\t\t\t\t}), d.map.texture.name = l.name + \".shadowMap\", d.map.depthTexture = new Xi(i.x, i.y, pe), d.map.depthTexture.name = l.name + \".shadowMapDepth\", d.map.depthTexture.format = Ce, d.map.depthTexture.compareFunction = null, d.map.depthTexture.minFilter = L, d.map.depthTexture.magFilter = L;\n\t\t\t\t} else l.isPointLight ? (d.map = new Ro(i.x), d.map.depthTexture = new Zi(i.x, fe)) : (d.map = new kn(i.x, i.y), d.map.depthTexture = new Xi(i.x, i.y, fe)), d.map.depthTexture.name = l.name + \".shadowMap\", d.map.depthTexture.format = Ce, this.type === 1 ? (d.map.depthTexture.compareFunction = h ? 518 : 515, d.map.depthTexture.minFilter = R, d.map.depthTexture.magFilter = R) : (d.map.depthTexture.compareFunction = null, d.map.depthTexture.minFilter = L, d.map.depthTexture.magFilter = L);\n\t\t\t\td.camera.updateProjectionMatrix();\n\t\t\t}\n\t\t\tlet g = d.map.isWebGLCubeRenderTarget ? 6 : 1;\n\t\t\tfor (let t = 0; t < g; t++) {\n\t\t\t\tif (d.map.isWebGLCubeRenderTarget) e.setRenderTarget(d.map, t), e.clear();\n\t\t\t\telse {\n\t\t\t\t\tt === 0 && (e.setRenderTarget(d.map), e.clear());\n\t\t\t\t\tlet n = d.getViewport(t);\n\t\t\t\t\to.set(a.x * n.x, a.y * n.y, a.x * n.z, a.y * n.w), f.viewport(o);\n\t\t\t\t}\n\t\t\t\tif (l.isPointLight) {\n\t\t\t\t\tlet e = d.camera, n = d.matrix, r = l.distance || e.far;\n\t\t\t\t\tr !== e.far && (e.far = r, e.updateProjectionMatrix()), al.setFromMatrixPosition(l.matrixWorld), e.position.copy(al), ol.copy(e.position), ol.add(nl[t]), e.up.copy(rl[t]), e.lookAt(ol), e.updateMatrixWorld(), n.makeTranslation(-al.x, -al.y, -al.z), il.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse), d._frustum.setFromProjectionMatrix(il, e.coordinateSystem, e.reversedDepth);\n\t\t\t\t} else d.updateMatrices(l);\n\t\t\t\tr = d.getFrustum(), b(n, s, d.camera, l, this.type);\n\t\t\t}\n\t\t\td.isPointLightShadow !== !0 && this.type === 3 && v(d, s), d.needsUpdate = !1;\n\t\t}\n\t\t_ = this.type, g.needsUpdate = !1, e.setRenderTarget(c, l, d);\n\t};\n\tfunction v(n, r) {\n\t\tlet a = t.update(h);\n\t\tf.defines.VSM_SAMPLES !== n.blurSamples && (f.defines.VSM_SAMPLES = n.blurSamples, p.defines.VSM_SAMPLES = n.blurSamples, f.needsUpdate = !0, p.needsUpdate = !0), n.mapPass === null && (n.mapPass = new kn(i.x, i.y, {\n\t\t\tformat: Ee,\n\t\t\ttype: me\n\t\t})), f.uniforms.shadow_pass.value = n.map.depthTexture, f.uniforms.resolution.value = n.mapSize, f.uniforms.radius.value = n.radius, e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, a, f, h, null), p.uniforms.shadow_pass.value = n.mapPass.texture, p.uniforms.resolution.value = n.mapSize, p.uniforms.radius.value = n.radius, e.setRenderTarget(n.map), e.clear(), e.renderBufferDirect(r, null, a, p, h, null);\n\t}\n\tfunction y(t, n, r, i) {\n\t\tlet a = null, o = r.isPointLight === !0 ? t.customDistanceMaterial : t.customDepthMaterial;\n\t\tif (o !== void 0) a = o;\n\t\telse if (a = r.isPointLight === !0 ? c : s, e.localClippingEnabled && n.clipShadows === !0 && Array.isArray(n.clippingPlanes) && n.clippingPlanes.length !== 0 || n.displacementMap && n.displacementScale !== 0 || n.alphaMap && n.alphaTest > 0 || n.map && n.alphaTest > 0 || n.alphaToCoverage === !0) {\n\t\t\tlet e = a.uuid, t = n.uuid, r = l[e];\n\t\t\tr === void 0 && (r = {}, l[e] = r);\n\t\t\tlet i = r[t];\n\t\t\ti === void 0 && (i = a.clone(), r[t] = i, n.addEventListener(\"dispose\", x)), a = i;\n\t\t}\n\t\tif (a.visible = n.visible, a.wireframe = n.wireframe, i === 3 ? a.side = n.shadowSide === null ? n.side : n.shadowSide : a.side = n.shadowSide === null ? d[n.side] : n.shadowSide, a.alphaMap = n.alphaMap, a.alphaTest = n.alphaToCoverage === !0 ? .5 : n.alphaTest, a.map = n.map, a.clipShadows = n.clipShadows, a.clippingPlanes = n.clippingPlanes, a.clipIntersection = n.clipIntersection, a.displacementMap = n.displacementMap, a.displacementScale = n.displacementScale, a.displacementBias = n.displacementBias, a.wireframeLinewidth = n.wireframeLinewidth, a.linewidth = n.linewidth, r.isPointLight === !0 && a.isMeshDistanceMaterial === !0) {\n\t\t\tlet t = e.properties.get(a);\n\t\t\tt.light = r;\n\t\t}\n\t\treturn a;\n\t}\n\tfunction b(n, i, a, o, s) {\n\t\tif (n.visible === !1) return;\n\t\tif (n.layers.test(i.layers) && (n.isMesh || n.isLine || n.isPoints) && (n.castShadow || n.receiveShadow && s === 3) && (!n.frustumCulled || r.intersectsObject(n))) {\n\t\t\tn.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse, n.matrixWorld);\n\t\t\tlet r = t.update(n), c = n.material;\n\t\t\tif (Array.isArray(c)) {\n\t\t\t\tlet t = r.groups;\n\t\t\t\tfor (let l = 0, u = t.length; l < u; l++) {\n\t\t\t\t\tlet u = t[l], d = c[u.materialIndex];\n\t\t\t\t\tif (d && d.visible) {\n\t\t\t\t\t\tlet t = y(n, d, o, s);\n\t\t\t\t\t\tn.onBeforeShadow(e, n, i, a, r, t, u), e.renderBufferDirect(a, null, r, t, n, u), n.onAfterShadow(e, n, i, a, r, t, u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (c.visible) {\n\t\t\t\tlet t = y(n, c, o, s);\n\t\t\t\tn.onBeforeShadow(e, n, i, a, r, t, null), e.renderBufferDirect(a, null, r, t, n, null), n.onAfterShadow(e, n, i, a, r, t, null);\n\t\t\t}\n\t\t}\n\t\tlet c = n.children;\n\t\tfor (let e = 0, t = c.length; e < t; e++) b(c[e], i, a, o, s);\n\t}\n\tfunction x(e) {\n\t\te.target.removeEventListener(\"dispose\", x);\n\t\tfor (let t in l) {\n\t\t\tlet n = l[t], r = e.target.uuid;\n\t\t\tr in n && (n[r].dispose(), delete n[r]);\n\t\t}\n\t}\n}\nfunction cl(e, t) {\n\tfunction n() {\n\t\tlet t = !1, n = new Dn(), r = null, i = new Dn(0, 0, 0, 0);\n\t\treturn {\n\t\t\tsetMask: function(n) {\n\t\t\t\tr !== n && !t && (e.colorMask(n, n, n, n), r = n);\n\t\t\t},\n\t\t\tsetLocked: function(e) {\n\t\t\t\tt = e;\n\t\t\t},\n\t\t\tsetClear: function(t, r, a, o, s) {\n\t\t\t\ts === !0 && (t *= o, r *= o, a *= o), n.set(t, r, a, o), i.equals(n) === !1 && (e.clearColor(t, r, a, o), i.copy(n));\n\t\t\t},\n\t\t\treset: function() {\n\t\t\t\tt = !1, r = null, i.set(-1, 0, 0, 0);\n\t\t\t}\n\t\t};\n\t}\n\tfunction r() {\n\t\tlet n = !1, r = !1, i = null, a = null, o = null;\n\t\treturn {\n\t\t\tsetReversed: function(e) {\n\t\t\t\tif (r !== e) {\n\t\t\t\t\tlet n = t.get(\"EXT_clip_control\");\n\t\t\t\t\te ? n.clipControlEXT(n.LOWER_LEFT_EXT, n.ZERO_TO_ONE_EXT) : n.clipControlEXT(n.LOWER_LEFT_EXT, n.NEGATIVE_ONE_TO_ONE_EXT), r = e;\n\t\t\t\t\tlet i = o;\n\t\t\t\t\to = null, this.setClear(i);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetReversed: function() {\n\t\t\t\treturn r;\n\t\t\t},\n\t\t\tsetTest: function(t) {\n\t\t\t\tt ? ae(e.DEPTH_TEST) : oe(e.DEPTH_TEST);\n\t\t\t},\n\t\t\tsetMask: function(t) {\n\t\t\t\ti !== t && !n && (e.depthMask(t), i = t);\n\t\t\t},\n\t\t\tsetFunc: function(t) {\n\t\t\t\tif (r && (t = Pt[t]), a !== t) {\n\t\t\t\t\tswitch (t) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\te.depthFunc(e.NEVER);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\te.depthFunc(e.ALWAYS);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\te.depthFunc(e.LESS);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\te.depthFunc(e.LEQUAL);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\te.depthFunc(e.EQUAL);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\te.depthFunc(e.GEQUAL);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\te.depthFunc(e.GREATER);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\te.depthFunc(e.NOTEQUAL);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault: e.depthFunc(e.LEQUAL);\n\t\t\t\t\t}\n\t\t\t\t\ta = t;\n\t\t\t\t}\n\t\t\t},\n\t\t\tsetLocked: function(e) {\n\t\t\t\tn = e;\n\t\t\t},\n\t\t\tsetClear: function(t) {\n\t\t\t\to !== t && (o = t, r && (t = 1 - t), e.clearDepth(t));\n\t\t\t},\n\t\t\treset: function() {\n\t\t\t\tn = !1, i = null, a = null, o = null, r = !1;\n\t\t\t}\n\t\t};\n\t}\n\tfunction i() {\n\t\tlet t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;\n\t\treturn {\n\t\t\tsetTest: function(n) {\n\t\t\t\tt || (n ? ae(e.STENCIL_TEST) : oe(e.STENCIL_TEST));\n\t\t\t},\n\t\t\tsetMask: function(r) {\n\t\t\t\tn !== r && !t && (e.stencilMask(r), n = r);\n\t\t\t},\n\t\t\tsetFunc: function(t, n, o) {\n\t\t\t\t(r !== t || i !== n || a !== o) && (e.stencilFunc(t, n, o), r = t, i = n, a = o);\n\t\t\t},\n\t\t\tsetOp: function(t, n, r) {\n\t\t\t\t(o !== t || s !== n || c !== r) && (e.stencilOp(t, n, r), o = t, s = n, c = r);\n\t\t\t},\n\t\t\tsetLocked: function(e) {\n\t\t\t\tt = e;\n\t\t\t},\n\t\t\tsetClear: function(t) {\n\t\t\t\tl !== t && (e.clearStencil(t), l = t);\n\t\t\t},\n\t\t\treset: function() {\n\t\t\t\tt = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;\n\t\t\t}\n\t\t};\n\t}\n\tlet a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new fr(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null, M = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), N = !1, P = 0, F = e.getParameter(e.VERSION);\n\tF.indexOf(\"WebGL\") === -1 ? F.indexOf(\"OpenGL ES\") !== -1 && (P = parseFloat(/^OpenGL ES (\\d)/.exec(F)[1]), N = P >= 2) : (P = parseFloat(/^WebGL (\\d)/.exec(F)[1]), N = P >= 1);\n\tlet I = null, ee = {}, te = e.getParameter(e.SCISSOR_BOX), ne = e.getParameter(e.VIEWPORT), L = new Dn().fromArray(te), re = new Dn().fromArray(ne);\n\tfunction ie(t, n, r, i) {\n\t\tlet a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();\n\t\te.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);\n\t\tfor (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);\n\t\treturn o;\n\t}\n\tlet R = {};\n\tR[e.TEXTURE_2D] = ie(e.TEXTURE_2D, e.TEXTURE_2D, 1), R[e.TEXTURE_CUBE_MAP] = ie(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), R[e.TEXTURE_2D_ARRAY] = ie(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), R[e.TEXTURE_3D] = ie(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), ae(e.DEPTH_TEST), o.setFunc(3), me(!1), he(1), ae(e.CULL_FACE), fe(0);\n\tfunction ae(t) {\n\t\tu[t] !== !0 && (e.enable(t), u[t] = !0);\n\t}\n\tfunction oe(t) {\n\t\tu[t] !== !1 && (e.disable(t), u[t] = !1);\n\t}\n\tfunction se(t, n) {\n\t\treturn f[t] !== n && (e.bindFramebuffer(t, n), f[t] = n, t === e.DRAW_FRAMEBUFFER && (f[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (f[e.DRAW_FRAMEBUFFER] = n), !0);\n\t}\n\tfunction ce(t, n) {\n\t\tlet r = m, i = !1;\n\t\tif (t) {\n\t\t\tr = p.get(n), r === void 0 && (r = [], p.set(n, r));\n\t\t\tlet a = t.textures;\n\t\t\tif (r.length !== a.length || r[0] !== e.COLOR_ATTACHMENT0) {\n\t\t\t\tfor (let t = 0, n = a.length; t < n; t++) r[t] = e.COLOR_ATTACHMENT0 + t;\n\t\t\t\tr.length = a.length, i = !0;\n\t\t\t}\n\t\t} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);\n\t\ti && e.drawBuffers(r);\n\t}\n\tfunction le(t) {\n\t\treturn h !== t && (e.useProgram(t), h = t, !0);\n\t}\n\tlet ue = {\n\t\t100: e.FUNC_ADD,\n\t\t101: e.FUNC_SUBTRACT,\n\t\t102: e.FUNC_REVERSE_SUBTRACT\n\t};\n\tue[103] = e.MIN, ue[104] = e.MAX;\n\tlet de = {\n\t\t200: e.ZERO,\n\t\t201: e.ONE,\n\t\t202: e.SRC_COLOR,\n\t\t204: e.SRC_ALPHA,\n\t\t210: e.SRC_ALPHA_SATURATE,\n\t\t208: e.DST_COLOR,\n\t\t206: e.DST_ALPHA,\n\t\t203: e.ONE_MINUS_SRC_COLOR,\n\t\t205: e.ONE_MINUS_SRC_ALPHA,\n\t\t209: e.ONE_MINUS_DST_COLOR,\n\t\t207: e.ONE_MINUS_DST_ALPHA,\n\t\t211: e.CONSTANT_COLOR,\n\t\t212: e.ONE_MINUS_CONSTANT_COLOR,\n\t\t213: e.CONSTANT_ALPHA,\n\t\t214: e.ONE_MINUS_CONSTANT_ALPHA\n\t};\n\tfunction fe(t, n, r, i, a, o, s, c, l, u) {\n\t\tif (t === 0) {\n\t\t\tg === !0 && (oe(e.BLEND), g = !1);\n\t\t\treturn;\n\t\t}\n\t\tif (g === !1 && (ae(e.BLEND), g = !0), t !== 5) {\n\t\t\tif (t !== _ || u !== E) {\n\t\t\t\tif ((v !== 100 || x !== 100) && (e.blendEquation(e.FUNC_ADD), v = 100, x = 100), u) switch (t) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\te.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\te.blendFunc(e.ONE, e.ONE);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\te.blendFuncSeparate(e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ZERO, e.ONE);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\te.blendFuncSeparate(e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA, e.ZERO, e.ONE);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: U(\"WebGLState: Invalid blending: \", t);\n\t\t\t\t}\n\t\t\t\telse switch (t) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\te.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\te.blendFuncSeparate(e.SRC_ALPHA, e.ONE, e.ONE, e.ONE);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tU(\"WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tU(\"WebGLState: MultiplyBlending requires material.premultipliedAlpha = true\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: U(\"WebGLState: Invalid blending: \", t);\n\t\t\t\t}\n\t\t\t\ty = null, b = null, S = null, C = null, w.set(0, 0, 0), T = 0, _ = t, E = u;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\ta ||= n, o ||= r, s ||= i, (n !== v || a !== x) && (e.blendEquationSeparate(ue[n], ue[a]), v = n, x = a), (r !== y || i !== b || o !== S || s !== C) && (e.blendFuncSeparate(de[r], de[i], de[o], de[s]), y = r, b = i, S = o, C = s), (c.equals(w) === !1 || l !== T) && (e.blendColor(c.r, c.g, c.b, l), w.copy(c), T = l), _ = t, E = !1;\n\t}\n\tfunction pe(t, n) {\n\t\tt.side === 2 ? oe(e.CULL_FACE) : ae(e.CULL_FACE);\n\t\tlet r = t.side === 1;\n\t\tn && (r = !r), me(r), t.blending === 1 && t.transparent === !1 ? fe(0) : fe(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);\n\t\tlet i = t.stencilWrite;\n\t\ts.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), _e(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? ae(e.SAMPLE_ALPHA_TO_COVERAGE) : oe(e.SAMPLE_ALPHA_TO_COVERAGE);\n\t}\n\tfunction me(t) {\n\t\tD !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), D = t);\n\t}\n\tfunction he(t) {\n\t\tt === 0 ? oe(e.CULL_FACE) : (ae(e.CULL_FACE), t !== O && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), O = t;\n\t}\n\tfunction ge(t) {\n\t\tt !== k && (N && e.lineWidth(t), k = t);\n\t}\n\tfunction _e(t, n, r) {\n\t\tt ? (ae(e.POLYGON_OFFSET_FILL), (A !== n || j !== r) && (A = n, j = r, o.getReversed() && (n = -n), e.polygonOffset(n, r))) : oe(e.POLYGON_OFFSET_FILL);\n\t}\n\tfunction ve(t) {\n\t\tt ? ae(e.SCISSOR_TEST) : oe(e.SCISSOR_TEST);\n\t}\n\tfunction ye(t) {\n\t\tt === void 0 && (t = e.TEXTURE0 + M - 1), I !== t && (e.activeTexture(t), I = t);\n\t}\n\tfunction be(t, n, r) {\n\t\tr === void 0 && (r = I === null ? e.TEXTURE0 + M - 1 : I);\n\t\tlet i = ee[r];\n\t\ti === void 0 && (i = {\n\t\t\ttype: void 0,\n\t\t\ttexture: void 0\n\t\t}, ee[r] = i), (i.type !== t || i.texture !== n) && (I !== r && (e.activeTexture(r), I = r), e.bindTexture(t, n || R[t]), i.type = t, i.texture = n);\n\t}\n\tfunction xe() {\n\t\tlet t = ee[I];\n\t\tt !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);\n\t}\n\tfunction Se() {\n\t\ttry {\n\t\t\te.compressedTexImage2D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction Ce() {\n\t\ttry {\n\t\t\te.compressedTexImage3D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction z() {\n\t\ttry {\n\t\t\te.texSubImage2D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction we() {\n\t\ttry {\n\t\t\te.texSubImage3D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction Te() {\n\t\ttry {\n\t\t\te.compressedTexSubImage2D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction Ee() {\n\t\ttry {\n\t\t\te.compressedTexSubImage3D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction De() {\n\t\ttry {\n\t\t\te.texStorage2D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction Oe() {\n\t\ttry {\n\t\t\te.texStorage3D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction ke() {\n\t\ttry {\n\t\t\te.texImage2D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction B() {\n\t\ttry {\n\t\t\te.texImage3D(...arguments);\n\t\t} catch (e) {\n\t\t\tU(\"WebGLState:\", e);\n\t\t}\n\t}\n\tfunction Ae(t) {\n\t\treturn d[t] === void 0 ? e.getParameter(t) : d[t];\n\t}\n\tfunction V(t, n) {\n\t\td[t] !== n && (e.pixelStorei(t, n), d[t] = n);\n\t}\n\tfunction je(t) {\n\t\tL.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), L.copy(t));\n\t}\n\tfunction Me(t) {\n\t\tre.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), re.copy(t));\n\t}\n\tfunction Ne(t, n) {\n\t\tlet r = l.get(n);\n\t\tr === void 0 && (r = /* @__PURE__ */ new WeakMap(), l.set(n, r));\n\t\tlet i = r.get(t);\n\t\ti === void 0 && (i = e.getUniformBlockIndex(n, t.name), r.set(t, i));\n\t}\n\tfunction Pe(t, n) {\n\t\tlet r = l.get(n).get(t);\n\t\tc.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));\n\t}\n\tfunction Fe() {\n\t\te.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.pixelStorei(e.PACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_ALIGNMENT, 4), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !1), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.BROWSER_DEFAULT_WEBGL), e.pixelStorei(e.PACK_ROW_LENGTH, 0), e.pixelStorei(e.PACK_SKIP_PIXELS, 0), e.pixelStorei(e.PACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_ROW_LENGTH, 0), e.pixelStorei(e.UNPACK_IMAGE_HEIGHT, 0), e.pixelStorei(e.UNPACK_SKIP_PIXELS, 0), e.pixelStorei(e.UNPACK_SKIP_ROWS, 0), e.pixelStorei(e.UNPACK_SKIP_IMAGES, 0), u = {}, d = {}, I = null, ee = {}, f = {}, p = /* @__PURE__ */ new WeakMap(), m = [], h = null, g = !1, _ = null, v = null, y = null, b = null, x = null, S = null, C = null, w = new fr(0, 0, 0), T = 0, E = !1, D = null, O = null, k = null, A = null, j = null, L.set(0, 0, e.canvas.width, e.canvas.height), re.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();\n\t}\n\treturn {\n\t\tbuffers: {\n\t\t\tcolor: a,\n\t\t\tdepth: o,\n\t\t\tstencil: s\n\t\t},\n\t\tenable: ae,\n\t\tdisable: oe,\n\t\tbindFramebuffer: se,\n\t\tdrawBuffers: ce,\n\t\tuseProgram: le,\n\t\tsetBlending: fe,\n\t\tsetMaterial: pe,\n\t\tsetFlipSided: me,\n\t\tsetCullFace: he,\n\t\tsetLineWidth: ge,\n\t\tsetPolygonOffset: _e,\n\t\tsetScissorTest: ve,\n\t\tactiveTexture: ye,\n\t\tbindTexture: be,\n\t\tunbindTexture: xe,\n\t\tcompressedTexImage2D: Se,\n\t\tcompressedTexImage3D: Ce,\n\t\ttexImage2D: ke,\n\t\ttexImage3D: B,\n\t\tpixelStorei: V,\n\t\tgetParameter: Ae,\n\t\tupdateUBOMapping: Ne,\n\t\tuniformBlockBinding: Pe,\n\t\ttexStorage2D: De,\n\t\ttexStorage3D: Oe,\n\t\ttexSubImage2D: z,\n\t\ttexSubImage3D: we,\n\t\tcompressedTexSubImage2D: Te,\n\t\tcompressedTexSubImage3D: Ee,\n\t\tscissor: je,\n\t\tviewport: Me,\n\t\treset: Fe\n\t};\n}\nfunction ll(e, t, n, r, i, a, o) {\n\tlet s = t.has(\"WEBGL_multisampled_render_to_texture\") ? t.get(\"WEBGL_multisampled_render_to_texture\") : null, c = typeof navigator > \"u\" ? !1 : /OculusBrowser/g.test(navigator.userAgent), l = new G(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new Set(), f, p = /* @__PURE__ */ new WeakMap(), m = !1;\n\ttry {\n\t\tm = typeof OffscreenCanvas < \"u\" && new OffscreenCanvas(1, 1).getContext(\"2d\") !== null;\n\t} catch {}\n\tfunction h(e, t) {\n\t\treturn m ? new OffscreenCanvas(e, t) : Dt(\"canvas\");\n\t}\n\tfunction g(e, t, n) {\n\t\tlet r = 1, i = Ae(e);\n\t\tif ((i.width > n || i.height > n) && (r = n / Math.max(i.width, i.height)), r < 1) {\n\t\t\tif (typeof HTMLImageElement < \"u\" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < \"u\" && e instanceof HTMLCanvasElement || typeof ImageBitmap < \"u\" && e instanceof ImageBitmap || typeof VideoFrame < \"u\" && e instanceof VideoFrame) {\n\t\t\t\tlet n = Math.floor(r * i.width), a = Math.floor(r * i.height);\n\t\t\t\tf === void 0 && (f = h(n, a));\n\t\t\t\tlet o = t ? h(n, a) : f;\n\t\t\t\treturn o.width = n, o.height = a, o.getContext(\"2d\").drawImage(e, 0, 0, n, a), H(\"WebGLRenderer: Texture has been resized from (\" + i.width + \"x\" + i.height + \") to (\" + n + \"x\" + a + \").\"), o;\n\t\t\t}\n\t\t\treturn \"data\" in e && H(\"WebGLRenderer: Image in DataTexture is too big (\" + i.width + \"x\" + i.height + \").\"), e;\n\t\t}\n\t\treturn e;\n\t}\n\tfunction _(e) {\n\t\treturn e.generateMipmaps;\n\t}\n\tfunction v(t) {\n\t\te.generateMipmap(t);\n\t}\n\tfunction y(t) {\n\t\treturn t.isWebGLCubeRenderTarget ? e.TEXTURE_CUBE_MAP : t.isWebGL3DRenderTarget ? e.TEXTURE_3D : t.isWebGLArrayRenderTarget || t.isCompressedArrayTexture ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D;\n\t}\n\tfunction b(n, r, i, a, o, s = !1) {\n\t\tif (n !== null) {\n\t\t\tif (e[n] !== void 0) return e[n];\n\t\t\tH(\"WebGLRenderer: Attempt to use non-existing WebGL internal format '\" + n + \"'\");\n\t\t}\n\t\tlet c;\n\t\ta && (c = t.get(\"EXT_texture_norm16\"), c || H(\"WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension\"));\n\t\tlet l = r;\n\t\tif (r === e.RED && (i === e.FLOAT && (l = e.R32F), i === e.HALF_FLOAT && (l = e.R16F), i === e.UNSIGNED_BYTE && (l = e.R8), i === e.UNSIGNED_SHORT && c && (l = c.R16_EXT), i === e.SHORT && c && (l = c.R16_SNORM_EXT)), r === e.RED_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.R8UI), i === e.UNSIGNED_SHORT && (l = e.R16UI), i === e.UNSIGNED_INT && (l = e.R32UI), i === e.BYTE && (l = e.R8I), i === e.SHORT && (l = e.R16I), i === e.INT && (l = e.R32I)), r === e.RG && (i === e.FLOAT && (l = e.RG32F), i === e.HALF_FLOAT && (l = e.RG16F), i === e.UNSIGNED_BYTE && (l = e.RG8), i === e.UNSIGNED_SHORT && c && (l = c.RG16_EXT), i === e.SHORT && c && (l = c.RG16_SNORM_EXT)), r === e.RG_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.RG8UI), i === e.UNSIGNED_SHORT && (l = e.RG16UI), i === e.UNSIGNED_INT && (l = e.RG32UI), i === e.BYTE && (l = e.RG8I), i === e.SHORT && (l = e.RG16I), i === e.INT && (l = e.RG32I)), r === e.RGB_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.RGB8UI), i === e.UNSIGNED_SHORT && (l = e.RGB16UI), i === e.UNSIGNED_INT && (l = e.RGB32UI), i === e.BYTE && (l = e.RGB8I), i === e.SHORT && (l = e.RGB16I), i === e.INT && (l = e.RGB32I)), r === e.RGBA_INTEGER && (i === e.UNSIGNED_BYTE && (l = e.RGBA8UI), i === e.UNSIGNED_SHORT && (l = e.RGBA16UI), i === e.UNSIGNED_INT && (l = e.RGBA32UI), i === e.BYTE && (l = e.RGBA8I), i === e.SHORT && (l = e.RGBA16I), i === e.INT && (l = e.RGBA32I)), r === e.RGB && (i === e.UNSIGNED_SHORT && c && (l = c.RGB16_EXT), i === e.SHORT && c && (l = c.RGB16_SNORM_EXT), i === e.UNSIGNED_INT_5_9_9_9_REV && (l = e.RGB9_E5), i === e.UNSIGNED_INT_10F_11F_11F_REV && (l = e.R11F_G11F_B10F)), r === e.RGBA) {\n\t\t\tlet t = s ? yt : gn.getTransfer(o);\n\t\t\ti === e.FLOAT && (l = e.RGBA32F), i === e.HALF_FLOAT && (l = e.RGBA16F), i === e.UNSIGNED_BYTE && (l = t === \"srgb\" ? e.SRGB8_ALPHA8 : e.RGBA8), i === e.UNSIGNED_SHORT && c && (l = c.RGBA16_EXT), i === e.SHORT && c && (l = c.RGBA16_SNORM_EXT), i === e.UNSIGNED_SHORT_4_4_4_4 && (l = e.RGBA4), i === e.UNSIGNED_SHORT_5_5_5_1 && (l = e.RGB5_A1);\n\t\t}\n\t\treturn (l === e.R16F || l === e.R32F || l === e.RG16F || l === e.RG32F || l === e.RGBA16F || l === e.RGBA32F) && t.get(\"EXT_color_buffer_float\"), l;\n\t}\n\tfunction x(t, n) {\n\t\tlet r;\n\t\treturn t ? n === null || n === 1014 || n === 1020 ? r = e.DEPTH24_STENCIL8 : n === 1015 ? r = e.DEPTH32F_STENCIL8 : n === 1012 && (r = e.DEPTH24_STENCIL8, H(\"DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.\")) : n === null || n === 1014 || n === 1020 ? r = e.DEPTH_COMPONENT24 : n === 1015 ? r = e.DEPTH_COMPONENT32F : n === 1012 && (r = e.DEPTH_COMPONENT16), r;\n\t}\n\tfunction S(e, t) {\n\t\treturn _(e) === !0 || e.isFramebufferTexture && e.minFilter !== 1003 && e.minFilter !== 1006 ? Math.log2(Math.max(t.width, t.height)) + 1 : e.mipmaps !== void 0 && e.mipmaps.length > 0 ? e.mipmaps.length : e.isCompressedTexture && Array.isArray(e.image) ? t.mipmaps.length : 1;\n\t}\n\tfunction C(e) {\n\t\tlet t = e.target;\n\t\tt.removeEventListener(\"dispose\", C), T(t), t.isVideoTexture && u.delete(t), t.isHTMLTexture && d.delete(t);\n\t}\n\tfunction w(e) {\n\t\tlet t = e.target;\n\t\tt.removeEventListener(\"dispose\", w), D(t);\n\t}\n\tfunction T(e) {\n\t\tlet t = r.get(e);\n\t\tif (t.__webglInit === void 0) return;\n\t\tlet n = e.source, i = p.get(n);\n\t\tif (i) {\n\t\t\tlet r = i[t.__cacheKey];\n\t\t\tr.usedTimes--, r.usedTimes === 0 && E(e), Object.keys(i).length === 0 && p.delete(n);\n\t\t}\n\t\tr.remove(e);\n\t}\n\tfunction E(t) {\n\t\tlet n = r.get(t);\n\t\te.deleteTexture(n.__webglTexture);\n\t\tlet i = t.source, a = p.get(i);\n\t\tdelete a[n.__cacheKey], o.memory.textures--;\n\t}\n\tfunction D(t) {\n\t\tlet n = r.get(t);\n\t\tif (t.depthTexture && (t.depthTexture.dispose(), r.remove(t.depthTexture)), t.isWebGLCubeRenderTarget) for (let t = 0; t < 6; t++) {\n\t\t\tif (Array.isArray(n.__webglFramebuffer[t])) for (let r = 0; r < n.__webglFramebuffer[t].length; r++) e.deleteFramebuffer(n.__webglFramebuffer[t][r]);\n\t\t\telse e.deleteFramebuffer(n.__webglFramebuffer[t]);\n\t\t\tn.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer[t]);\n\t\t}\n\t\telse {\n\t\t\tif (Array.isArray(n.__webglFramebuffer)) for (let t = 0; t < n.__webglFramebuffer.length; t++) e.deleteFramebuffer(n.__webglFramebuffer[t]);\n\t\t\telse e.deleteFramebuffer(n.__webglFramebuffer);\n\t\t\tif (n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer), n.__webglMultisampledFramebuffer && e.deleteFramebuffer(n.__webglMultisampledFramebuffer), n.__webglColorRenderbuffer) for (let t = 0; t < n.__webglColorRenderbuffer.length; t++) n.__webglColorRenderbuffer[t] && e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);\n\t\t\tn.__webglDepthRenderbuffer && e.deleteRenderbuffer(n.__webglDepthRenderbuffer);\n\t\t}\n\t\tlet i = t.textures;\n\t\tfor (let t = 0, n = i.length; t < n; t++) {\n\t\t\tlet n = r.get(i[t]);\n\t\t\tn.__webglTexture && (e.deleteTexture(n.__webglTexture), o.memory.textures--), r.remove(i[t]);\n\t\t}\n\t\tr.remove(t);\n\t}\n\tlet O = 0;\n\tfunction k() {\n\t\tO = 0;\n\t}\n\tfunction A() {\n\t\treturn O;\n\t}\n\tfunction j(e) {\n\t\tO = e;\n\t}\n\tfunction M() {\n\t\tlet e = O;\n\t\treturn e >= i.maxTextures && H(\"WebGLTextures: Trying to use \" + e + \" texture units while this GPU supports only \" + i.maxTextures), O += 1, e;\n\t}\n\tfunction N(e) {\n\t\tlet t = [];\n\t\treturn t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();\n\t}\n\tfunction P(t, i) {\n\t\tlet a = r.get(t);\n\t\tif (t.isVideoTexture && ke(t), t.isRenderTargetTexture === !1 && t.isExternalTexture !== !0 && t.version > 0 && a.__version !== t.version) {\n\t\t\tlet e = t.image;\n\t\t\tif (e === null) H(\"WebGLRenderer: Texture marked for update but no image data found.\");\n\t\t\telse if (e.complete === !1) H(\"WebGLRenderer: Texture marked for update but image is incomplete\");\n\t\t\telse {\n\t\t\t\the(a, t, i);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else t.isExternalTexture && (a.__webglTexture = t.sourceTexture ? t.sourceTexture : null);\n\t\tn.bindTexture(e.TEXTURE_2D, a.__webglTexture, e.TEXTURE0 + i);\n\t}\n\tfunction F(t, i) {\n\t\tlet a = r.get(t);\n\t\tif (t.isRenderTargetTexture === !1 && t.version > 0 && a.__version !== t.version) {\n\t\t\the(a, t, i);\n\t\t\treturn;\n\t\t}\n\t\tt.isExternalTexture && (a.__webglTexture = t.sourceTexture ? t.sourceTexture : null), n.bindTexture(e.TEXTURE_2D_ARRAY, a.__webglTexture, e.TEXTURE0 + i);\n\t}\n\tfunction I(t, i) {\n\t\tlet a = r.get(t);\n\t\tif (t.isRenderTargetTexture === !1 && t.version > 0 && a.__version !== t.version) {\n\t\t\the(a, t, i);\n\t\t\treturn;\n\t\t}\n\t\tn.bindTexture(e.TEXTURE_3D, a.__webglTexture, e.TEXTURE0 + i);\n\t}\n\tfunction se(t, i) {\n\t\tlet a = r.get(t);\n\t\tif (t.isCubeDepthTexture !== !0 && t.version > 0 && a.__version !== t.version) {\n\t\t\tge(a, t, i);\n\t\t\treturn;\n\t\t}\n\t\tn.bindTexture(e.TEXTURE_CUBE_MAP, a.__webglTexture, e.TEXTURE0 + i);\n\t}\n\tlet ce = {\n\t\t[ee]: e.REPEAT,\n\t\t[te]: e.CLAMP_TO_EDGE,\n\t\t[ne]: e.MIRRORED_REPEAT\n\t}, le = {\n\t\t[L]: e.NEAREST,\n\t\t[re]: e.NEAREST_MIPMAP_NEAREST,\n\t\t[ie]: e.NEAREST_MIPMAP_LINEAR,\n\t\t[R]: e.LINEAR,\n\t\t[ae]: e.LINEAR_MIPMAP_NEAREST,\n\t\t[oe]: e.LINEAR_MIPMAP_LINEAR\n\t}, ue = {\n\t\t512: e.NEVER,\n\t\t519: e.ALWAYS,\n\t\t513: e.LESS,\n\t\t515: e.LEQUAL,\n\t\t514: e.EQUAL,\n\t\t518: e.GEQUAL,\n\t\t516: e.GREATER,\n\t\t517: e.NOTEQUAL\n\t};\n\tfunction de(n, a) {\n\t\tif (a.type === 1015 && t.has(\"OES_texture_float_linear\") === !1 && (a.magFilter === 1006 || a.magFilter === 1007 || a.magFilter === 1005 || a.magFilter === 1008 || a.minFilter === 1006 || a.minFilter === 1007 || a.minFilter === 1005 || a.minFilter === 1008) && H(\"WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.\"), e.texParameteri(n, e.TEXTURE_WRAP_S, ce[a.wrapS]), e.texParameteri(n, e.TEXTURE_WRAP_T, ce[a.wrapT]), (n === e.TEXTURE_3D || n === e.TEXTURE_2D_ARRAY) && e.texParameteri(n, e.TEXTURE_WRAP_R, ce[a.wrapR]), e.texParameteri(n, e.TEXTURE_MAG_FILTER, le[a.magFilter]), e.texParameteri(n, e.TEXTURE_MIN_FILTER, le[a.minFilter]), a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE), e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, ue[a.compareFunction])), t.has(\"EXT_texture_filter_anisotropic\") === !0) {\n\t\t\tif (a.magFilter === 1003 || a.minFilter !== 1005 && a.minFilter !== 1008 || a.type === 1015 && t.has(\"OES_texture_float_linear\") === !1) return;\n\t\t\tif (a.anisotropy > 1 || r.get(a).__currentAnisotropy) {\n\t\t\t\tlet o = t.get(\"EXT_texture_filter_anisotropic\");\n\t\t\t\te.texParameterf(n, o.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(a.anisotropy, i.getMaxAnisotropy())), r.get(a).__currentAnisotropy = a.anisotropy;\n\t\t\t}\n\t\t}\n\t}\n\tfunction fe(t, n) {\n\t\tlet r = !1;\n\t\tt.__webglInit === void 0 && (t.__webglInit = !0, n.addEventListener(\"dispose\", C));\n\t\tlet i = n.source, a = p.get(i);\n\t\ta === void 0 && (a = {}, p.set(i, a));\n\t\tlet s = N(n);\n\t\tif (s !== t.__cacheKey) {\n\t\t\ta[s] === void 0 && (a[s] = {\n\t\t\t\ttexture: e.createTexture(),\n\t\t\t\tusedTimes: 0\n\t\t\t}, o.memory.textures++, r = !0), a[s].usedTimes++;\n\t\t\tlet i = a[t.__cacheKey];\n\t\t\ti !== void 0 && (a[t.__cacheKey].usedTimes--, i.usedTimes === 0 && E(n)), t.__cacheKey = s, t.__webglTexture = a[s].texture;\n\t\t}\n\t\treturn r;\n\t}\n\tfunction pe(e, t, n) {\n\t\treturn Math.floor(Math.floor(e / n) / t);\n\t}\n\tfunction me(t, r, i, a) {\n\t\tlet o = t.updateRanges;\n\t\tif (o.length === 0) n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, r.width, r.height, i, a, r.data);\n\t\telse {\n\t\t\to.sort((e, t) => e.start - t.start);\n\t\t\tlet s = 0;\n\t\t\tfor (let e = 1; e < o.length; e++) {\n\t\t\t\tlet t = o[s], n = o[e], i = t.start + t.count, a = pe(n.start, r.width, 4), c = pe(t.start, r.width, 4);\n\t\t\t\tn.start <= i + 1 && a === c && pe(n.start + n.count - 1, r.width, 4) === a ? t.count = Math.max(t.count, n.start + n.count - t.start) : (++s, o[s] = n);\n\t\t\t}\n\t\t\to.length = s + 1;\n\t\t\tlet c = n.getParameter(e.UNPACK_ROW_LENGTH), l = n.getParameter(e.UNPACK_SKIP_PIXELS), u = n.getParameter(e.UNPACK_SKIP_ROWS);\n\t\t\tn.pixelStorei(e.UNPACK_ROW_LENGTH, r.width);\n\t\t\tfor (let t = 0, s = o.length; t < s; t++) {\n\t\t\t\tlet s = o[t], c = Math.floor(s.start / 4), l = Math.ceil(s.count / 4), u = c % r.width, d = Math.floor(c / r.width), f = l;\n\t\t\t\tn.pixelStorei(e.UNPACK_SKIP_PIXELS, u), n.pixelStorei(e.UNPACK_SKIP_ROWS, d), n.texSubImage2D(e.TEXTURE_2D, 0, u, d, f, 1, i, a, r.data);\n\t\t\t}\n\t\t\tt.clearUpdateRanges(), n.pixelStorei(e.UNPACK_ROW_LENGTH, c), n.pixelStorei(e.UNPACK_SKIP_PIXELS, l), n.pixelStorei(e.UNPACK_SKIP_ROWS, u);\n\t\t}\n\t}\n\tfunction he(t, o, s) {\n\t\tlet c = e.TEXTURE_2D;\n\t\t(o.isDataArrayTexture || o.isCompressedArrayTexture) && (c = e.TEXTURE_2D_ARRAY), o.isData3DTexture && (c = e.TEXTURE_3D);\n\t\tlet l = fe(t, o), u = o.source;\n\t\tn.bindTexture(c, t.__webglTexture, e.TEXTURE0 + s);\n\t\tlet f = r.get(u);\n\t\tif (u.version !== f.__version || l === !0) {\n\t\t\tif (n.activeTexture(e.TEXTURE0 + s), !(typeof ImageBitmap < \"u\" && o.image instanceof ImageBitmap)) {\n\t\t\t\tlet t = gn.getPrimaries(gn.workingColorSpace), r = o.colorSpace === \"\" ? null : gn.getPrimaries(o.colorSpace), i = o.colorSpace === \"\" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;\n\t\t\t\tn.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, i);\n\t\t\t}\n\t\t\tn.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment);\n\t\t\tlet t = g(o.image, !1, i.maxTextureSize);\n\t\t\tt = B(o, t);\n\t\t\tlet r = a.convert(o.format, o.colorSpace), p = a.convert(o.type), m = b(o.internalFormat, r, p, o.normalized, o.colorSpace, o.isVideoTexture);\n\t\t\tde(c, o);\n\t\t\tlet h, y = o.mipmaps, C = o.isVideoTexture !== !0, w = f.__version === void 0 || l === !0, T = u.dataReady, E = S(o, t);\n\t\t\tif (o.isDepthTexture) m = x(o.format === z, o.type), w && (C ? n.texStorage2D(e.TEXTURE_2D, 1, m, t.width, t.height) : n.texImage2D(e.TEXTURE_2D, 0, m, t.width, t.height, 0, r, p, null));\n\t\t\telse if (o.isDataTexture) {\n\t\t\t\tif (y.length > 0) {\n\t\t\t\t\tC && w && n.texStorage2D(e.TEXTURE_2D, E, m, y[0].width, y[0].height);\n\t\t\t\t\tfor (let t = 0, i = y.length; t < i; t++) h = y[t], C ? T && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, p, h.data) : n.texImage2D(e.TEXTURE_2D, t, m, h.width, h.height, 0, r, p, h.data);\n\t\t\t\t\to.generateMipmaps = !1;\n\t\t\t\t} else C ? (w && n.texStorage2D(e.TEXTURE_2D, E, m, t.width, t.height), T && me(o, t, r, p)) : n.texImage2D(e.TEXTURE_2D, 0, m, t.width, t.height, 0, r, p, t.data);\n\t\t\t} else if (o.isCompressedTexture) {\n\t\t\t\tif (o.isCompressedArrayTexture) {\n\t\t\t\t\tC && w && n.texStorage3D(e.TEXTURE_2D_ARRAY, E, m, y[0].width, y[0].height, t.depth);\n\t\t\t\t\tfor (let i = 0, a = y.length; i < a; i++) if (h = y[i], o.format !== 1023) {\n\t\t\t\t\t\tif (r !== null) {\n\t\t\t\t\t\t\tif (C) {\n\t\t\t\t\t\t\t\tif (T) {\n\t\t\t\t\t\t\t\t\tif (o.layerUpdates.size > 0) {\n\t\t\t\t\t\t\t\t\t\tlet t = io(h.width, h.height, o.format, o.type);\n\t\t\t\t\t\t\t\t\t\tfor (let a of o.layerUpdates) {\n\t\t\t\t\t\t\t\t\t\t\tlet o = h.data.subarray(a * t / h.data.BYTES_PER_ELEMENT, (a + 1) * t / h.data.BYTES_PER_ELEMENT);\n\t\t\t\t\t\t\t\t\t\t\tn.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, i, 0, 0, a, h.width, h.height, 1, r, o);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\to.clearLayerUpdates();\n\t\t\t\t\t\t\t\t\t} else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, i, 0, 0, 0, h.width, h.height, t.depth, r, h.data);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY, i, m, h.width, h.height, t.depth, 0, h.data, 0, 0);\n\t\t\t\t\t\t} else H(\"WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\");\n\t\t\t\t\t} else C ? T && n.texSubImage3D(e.TEXTURE_2D_ARRAY, i, 0, 0, 0, h.width, h.height, t.depth, r, p, h.data) : n.texImage3D(e.TEXTURE_2D_ARRAY, i, m, h.width, h.height, t.depth, 0, r, p, h.data);\n\t\t\t\t} else {\n\t\t\t\t\tC && w && n.texStorage2D(e.TEXTURE_2D, E, m, y[0].width, y[0].height);\n\t\t\t\t\tfor (let t = 0, i = y.length; t < i; t++) h = y[t], o.format === 1023 ? C ? T && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, p, h.data) : n.texImage2D(e.TEXTURE_2D, t, m, h.width, h.height, 0, r, p, h.data) : r === null ? H(\"WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\") : C ? T && n.compressedTexSubImage2D(e.TEXTURE_2D, t, 0, 0, h.width, h.height, r, h.data) : n.compressedTexImage2D(e.TEXTURE_2D, t, m, h.width, h.height, 0, h.data);\n\t\t\t\t}\n\t\t\t} else if (o.isDataArrayTexture) {\n\t\t\t\tif (C) {\n\t\t\t\t\tif (w && n.texStorage3D(e.TEXTURE_2D_ARRAY, E, m, t.width, t.height, t.depth), T) {\n\t\t\t\t\t\tif (o.layerUpdates.size > 0) {\n\t\t\t\t\t\t\tlet i = io(t.width, t.height, o.format, o.type);\n\t\t\t\t\t\t\tfor (let a of o.layerUpdates) {\n\t\t\t\t\t\t\t\tlet o = t.data.subarray(a * i / t.data.BYTES_PER_ELEMENT, (a + 1) * i / t.data.BYTES_PER_ELEMENT);\n\t\t\t\t\t\t\t\tn.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, a, t.width, t.height, 1, r, p, o);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\to.clearLayerUpdates();\n\t\t\t\t\t\t} else n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, 0, t.width, t.height, t.depth, r, p, t.data);\n\t\t\t\t\t}\n\t\t\t\t} else n.texImage3D(e.TEXTURE_2D_ARRAY, 0, m, t.width, t.height, t.depth, 0, r, p, t.data);\n\t\t\t} else if (o.isData3DTexture) C ? (w && n.texStorage3D(e.TEXTURE_3D, E, m, t.width, t.height, t.depth), T && n.texSubImage3D(e.TEXTURE_3D, 0, 0, 0, 0, t.width, t.height, t.depth, r, p, t.data)) : n.texImage3D(e.TEXTURE_3D, 0, m, t.width, t.height, t.depth, 0, r, p, t.data);\n\t\t\telse if (o.isFramebufferTexture) {\n\t\t\t\tif (w) {\n\t\t\t\t\tif (C) n.texStorage2D(e.TEXTURE_2D, E, m, t.width, t.height);\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet i = t.width, a = t.height;\n\t\t\t\t\t\tfor (let t = 0; t < E; t++) n.texImage2D(e.TEXTURE_2D, t, m, i, a, 0, r, p, null), i >>= 1, a >>= 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (o.isHTMLTexture) {\n\t\t\t\tif (\"texElementImage2D\" in e) {\n\t\t\t\t\tlet n = e.canvas;\n\t\t\t\t\tif (n.hasAttribute(\"layoutsubtree\") || n.setAttribute(\"layoutsubtree\", \"true\"), t.parentNode !== n) {\n\t\t\t\t\t\tn.appendChild(t), d.add(o), n.onpaint = (e) => {\n\t\t\t\t\t\t\tlet t = e.changedElements;\n\t\t\t\t\t\t\tfor (let e of d) t.includes(e.image) && (e.needsUpdate = !0);\n\t\t\t\t\t\t}, n.requestPaint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet r = e.RGBA, i = e.RGBA, a = e.UNSIGNED_BYTE;\n\t\t\t\t\te.texElementImage2D(e.TEXTURE_2D, 0, r, i, a, t), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE);\n\t\t\t\t}\n\t\t\t} else if (y.length > 0) {\n\t\t\t\tif (C && w) {\n\t\t\t\t\tlet t = Ae(y[0]);\n\t\t\t\t\tn.texStorage2D(e.TEXTURE_2D, E, m, t.width, t.height);\n\t\t\t\t}\n\t\t\t\tfor (let t = 0, i = y.length; t < i; t++) h = y[t], C ? T && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, r, p, h) : n.texImage2D(e.TEXTURE_2D, t, m, r, p, h);\n\t\t\t\to.generateMipmaps = !1;\n\t\t\t} else if (C) {\n\t\t\t\tif (w) {\n\t\t\t\t\tlet r = Ae(t);\n\t\t\t\t\tn.texStorage2D(e.TEXTURE_2D, E, m, r.width, r.height);\n\t\t\t\t}\n\t\t\t\tT && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, r, p, t);\n\t\t\t} else n.texImage2D(e.TEXTURE_2D, 0, m, r, p, t);\n\t\t\t_(o) && v(c), f.__version = u.version, o.onUpdate && o.onUpdate(o);\n\t\t}\n\t\tt.__version = o.version;\n\t}\n\tfunction ge(t, o, s) {\n\t\tif (o.image.length !== 6) return;\n\t\tlet c = fe(t, o), l = o.source;\n\t\tn.bindTexture(e.TEXTURE_CUBE_MAP, t.__webglTexture, e.TEXTURE0 + s);\n\t\tlet u = r.get(l);\n\t\tif (l.version !== u.__version || c === !0) {\n\t\t\tn.activeTexture(e.TEXTURE0 + s);\n\t\t\tlet t = gn.getPrimaries(gn.workingColorSpace), r = o.colorSpace === \"\" ? null : gn.getPrimaries(o.colorSpace), d = o.colorSpace === \"\" || t === r ? e.NONE : e.BROWSER_DEFAULT_WEBGL;\n\t\t\tn.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), n.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, d);\n\t\t\tlet f = o.isCompressedTexture || o.image[0].isCompressedTexture, p = o.image[0] && o.image[0].isDataTexture, m = [];\n\t\t\tfor (let e = 0; e < 6; e++) !f && !p ? m[e] = g(o.image[e], !0, i.maxCubemapSize) : m[e] = p ? o.image[e].image : o.image[e], m[e] = B(o, m[e]);\n\t\t\tlet h = m[0], y = a.convert(o.format, o.colorSpace), x = a.convert(o.type), C = b(o.internalFormat, y, x, o.normalized, o.colorSpace), w = o.isVideoTexture !== !0, T = u.__version === void 0 || c === !0, E = l.dataReady, D = S(o, h);\n\t\t\tde(e.TEXTURE_CUBE_MAP, o);\n\t\t\tlet O;\n\t\t\tif (f) {\n\t\t\t\tw && T && n.texStorage2D(e.TEXTURE_CUBE_MAP, D, C, h.width, h.height);\n\t\t\t\tfor (let t = 0; t < 6; t++) {\n\t\t\t\t\tO = m[t].mipmaps;\n\t\t\t\t\tfor (let r = 0; r < O.length; r++) {\n\t\t\t\t\t\tlet i = O[r];\n\t\t\t\t\t\to.format === 1023 ? w ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, y, x, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, C, i.width, i.height, 0, y, x, i.data) : y === null ? H(\"WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\") : w ? E && n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, 0, 0, i.width, i.height, y, i.data) : n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r, C, i.width, i.height, 0, i.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (O = o.mipmaps, w && T) {\n\t\t\t\t\tO.length > 0 && D++;\n\t\t\t\t\tlet t = Ae(m[0]);\n\t\t\t\t\tn.texStorage2D(e.TEXTURE_CUBE_MAP, D, C, t.width, t.height);\n\t\t\t\t}\n\t\t\t\tfor (let t = 0; t < 6; t++) if (p) {\n\t\t\t\t\tw ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, m[t].width, m[t].height, y, x, m[t].data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, C, m[t].width, m[t].height, 0, y, x, m[t].data);\n\t\t\t\t\tfor (let r = 0; r < O.length; r++) {\n\t\t\t\t\t\tlet i = O[r].image[t].image;\n\t\t\t\t\t\tw ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, i.width, i.height, y, x, i.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, C, i.width, i.height, 0, y, x, i.data);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tw ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, y, x, m[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, C, y, x, m[t]);\n\t\t\t\t\tfor (let r = 0; r < O.length; r++) {\n\t\t\t\t\t\tlet i = O[r];\n\t\t\t\t\t\tw ? E && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, 0, 0, y, x, i.image[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, r + 1, C, y, x, i.image[t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t_(o) && v(e.TEXTURE_CUBE_MAP), u.__version = l.version, o.onUpdate && o.onUpdate(o);\n\t\t}\n\t\tt.__version = o.version;\n\t}\n\tfunction _e(t, i, o, c, l, u) {\n\t\tlet d = a.convert(o.format, o.colorSpace), f = a.convert(o.type), p = b(o.internalFormat, d, f, o.normalized, o.colorSpace), m = r.get(i), h = r.get(o);\n\t\tif (h.__renderTarget = i, !m.__hasExternalTextures) {\n\t\t\tlet t = Math.max(1, i.width >> u), r = Math.max(1, i.height >> u);\n\t\t\tl === e.TEXTURE_3D || l === e.TEXTURE_2D_ARRAY ? n.texImage3D(l, u, p, t, r, i.depth, 0, d, f, null) : n.texImage2D(l, u, p, t, r, 0, d, f, null);\n\t\t}\n\t\tn.bindFramebuffer(e.FRAMEBUFFER, t), Oe(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, c, l, h.__webglTexture, 0, De(i)) : (l === e.TEXTURE_2D || l >= e.TEXTURE_CUBE_MAP_POSITIVE_X && l <= e.TEXTURE_CUBE_MAP_NEGATIVE_Z) && e.framebufferTexture2D(e.FRAMEBUFFER, c, l, h.__webglTexture, u), n.bindFramebuffer(e.FRAMEBUFFER, null);\n\t}\n\tfunction ve(t, n, r) {\n\t\tif (e.bindRenderbuffer(e.RENDERBUFFER, t), n.depthBuffer) {\n\t\t\tlet i = n.depthTexture, a = i && i.isDepthTexture ? i.type : null, o = x(n.stencilBuffer, a), c = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;\n\t\t\tOe(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, De(n), o, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, De(n), o, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, o, n.width, n.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, c, e.RENDERBUFFER, t);\n\t\t} else {\n\t\t\tlet t = n.textures;\n\t\t\tfor (let i = 0; i < t.length; i++) {\n\t\t\t\tlet o = t[i], c = a.convert(o.format, o.colorSpace), l = a.convert(o.type), u = b(o.internalFormat, c, l, o.normalized, o.colorSpace);\n\t\t\t\tOe(n) ? s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, De(n), u, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, De(n), u, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, u, n.width, n.height);\n\t\t\t}\n\t\t}\n\t\te.bindRenderbuffer(e.RENDERBUFFER, null);\n\t}\n\tfunction ye(t, i, o) {\n\t\tlet c = i.isWebGLCubeRenderTarget === !0;\n\t\tif (n.bindFramebuffer(e.FRAMEBUFFER, t), !(i.depthTexture && i.depthTexture.isDepthTexture)) throw Error(\"renderTarget.depthTexture must be an instance of THREE.DepthTexture\");\n\t\tlet l = r.get(i.depthTexture);\n\t\tif (l.__renderTarget = i, (!l.__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), c) {\n\t\t\tif (l.__webglInit === void 0 && (l.__webglInit = !0, i.depthTexture.addEventListener(\"dispose\", C)), l.__webglTexture === void 0) {\n\t\t\t\tl.__webglTexture = e.createTexture(), n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture), de(e.TEXTURE_CUBE_MAP, i.depthTexture);\n\t\t\t\tlet t = a.convert(i.depthTexture.format), r = a.convert(i.depthTexture.type), o;\n\t\t\t\ti.depthTexture.format === 1026 ? o = e.DEPTH_COMPONENT24 : i.depthTexture.format === 1027 && (o = e.DEPTH24_STENCIL8);\n\t\t\t\tfor (let n = 0; n < 6; n++) e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0, o, i.width, i.height, 0, t, r, null);\n\t\t\t}\n\t\t} else P(i.depthTexture, 0);\n\t\tlet u = l.__webglTexture, d = De(i), f = c ? e.TEXTURE_CUBE_MAP_POSITIVE_X + o : e.TEXTURE_2D, p = i.depthTexture.format === 1027 ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;\n\t\tif (i.depthTexture.format === 1026) Oe(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, p, f, u, 0, d) : e.framebufferTexture2D(e.FRAMEBUFFER, p, f, u, 0);\n\t\telse if (i.depthTexture.format === 1027) Oe(i) ? s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, p, f, u, 0, d) : e.framebufferTexture2D(e.FRAMEBUFFER, p, f, u, 0);\n\t\telse throw Error(\"Unknown depthTexture format\");\n\t}\n\tfunction be(t) {\n\t\tlet i = r.get(t), a = t.isWebGLCubeRenderTarget === !0;\n\t\tif (i.__boundDepthTexture !== t.depthTexture) {\n\t\t\tlet e = t.depthTexture;\n\t\t\tif (i.__depthDisposeCallback && i.__depthDisposeCallback(), e) {\n\t\t\t\tlet t = () => {\n\t\t\t\t\tdelete i.__boundDepthTexture, delete i.__depthDisposeCallback, e.removeEventListener(\"dispose\", t);\n\t\t\t\t};\n\t\t\t\te.addEventListener(\"dispose\", t), i.__depthDisposeCallback = t;\n\t\t\t}\n\t\t\ti.__boundDepthTexture = e;\n\t\t}\n\t\tif (t.depthTexture && !i.__autoAllocateDepthBuffer) {\n\t\t\tif (a) for (let e = 0; e < 6; e++) ye(i.__webglFramebuffer[e], t, e);\n\t\t\telse {\n\t\t\t\tlet e = t.texture.mipmaps;\n\t\t\t\te && e.length > 0 ? ye(i.__webglFramebuffer[0], t, 0) : ye(i.__webglFramebuffer, t, 0);\n\t\t\t}\n\t\t} else if (a) {\n\t\t\ti.__webglDepthbuffer = [];\n\t\t\tfor (let r = 0; r < 6; r++) if (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[r]), i.__webglDepthbuffer[r] === void 0) i.__webglDepthbuffer[r] = e.createRenderbuffer(), ve(i.__webglDepthbuffer[r], t, !1);\n\t\t\telse {\n\t\t\t\tlet n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, a = i.__webglDepthbuffer[r];\n\t\t\t\te.bindRenderbuffer(e.RENDERBUFFER, a), e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, a);\n\t\t\t}\n\t\t} else {\n\t\t\tlet r = t.texture.mipmaps;\n\t\t\tif (r && r.length > 0 ? n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[0]) : n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer), i.__webglDepthbuffer === void 0) i.__webglDepthbuffer = e.createRenderbuffer(), ve(i.__webglDepthbuffer, t, !1);\n\t\t\telse {\n\t\t\t\tlet n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, r = i.__webglDepthbuffer;\n\t\t\t\te.bindRenderbuffer(e.RENDERBUFFER, r), e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, r);\n\t\t\t}\n\t\t}\n\t\tn.bindFramebuffer(e.FRAMEBUFFER, null);\n\t}\n\tfunction xe(t, n, i) {\n\t\tlet a = r.get(t);\n\t\tn !== void 0 && _e(a.__webglFramebuffer, t, t.texture, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, 0), i !== void 0 && be(t);\n\t}\n\tfunction Se(t) {\n\t\tlet i = t.texture, s = r.get(t), c = r.get(i);\n\t\tt.addEventListener(\"dispose\", w);\n\t\tlet l = t.textures, u = t.isWebGLCubeRenderTarget === !0, d = l.length > 1;\n\t\tif (d || (c.__webglTexture === void 0 && (c.__webglTexture = e.createTexture()), c.__version = i.version, o.memory.textures++), u) {\n\t\t\ts.__webglFramebuffer = [];\n\t\t\tfor (let t = 0; t < 6; t++) if (i.mipmaps && i.mipmaps.length > 0) {\n\t\t\t\ts.__webglFramebuffer[t] = [];\n\t\t\t\tfor (let n = 0; n < i.mipmaps.length; n++) s.__webglFramebuffer[t][n] = e.createFramebuffer();\n\t\t\t} else s.__webglFramebuffer[t] = e.createFramebuffer();\n\t\t} else {\n\t\t\tif (i.mipmaps && i.mipmaps.length > 0) {\n\t\t\t\ts.__webglFramebuffer = [];\n\t\t\t\tfor (let t = 0; t < i.mipmaps.length; t++) s.__webglFramebuffer[t] = e.createFramebuffer();\n\t\t\t} else s.__webglFramebuffer = e.createFramebuffer();\n\t\t\tif (d) for (let t = 0, n = l.length; t < n; t++) {\n\t\t\t\tlet n = r.get(l[t]);\n\t\t\t\tn.__webglTexture === void 0 && (n.__webglTexture = e.createTexture(), o.memory.textures++);\n\t\t\t}\n\t\t\tif (t.samples > 0 && Oe(t) === !1) {\n\t\t\t\ts.__webglMultisampledFramebuffer = e.createFramebuffer(), s.__webglColorRenderbuffer = [], n.bindFramebuffer(e.FRAMEBUFFER, s.__webglMultisampledFramebuffer);\n\t\t\t\tfor (let n = 0; n < l.length; n++) {\n\t\t\t\t\tlet r = l[n];\n\t\t\t\t\ts.__webglColorRenderbuffer[n] = e.createRenderbuffer(), e.bindRenderbuffer(e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);\n\t\t\t\t\tlet i = a.convert(r.format, r.colorSpace), o = a.convert(r.type), c = b(r.internalFormat, i, o, r.normalized, r.colorSpace, t.isXRRenderTarget === !0), u = De(t);\n\t\t\t\t\te.renderbufferStorageMultisample(e.RENDERBUFFER, u, c, t.width, t.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + n, e.RENDERBUFFER, s.__webglColorRenderbuffer[n]);\n\t\t\t\t}\n\t\t\t\te.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && (s.__webglDepthRenderbuffer = e.createRenderbuffer(), ve(s.__webglDepthRenderbuffer, t, !0)), n.bindFramebuffer(e.FRAMEBUFFER, null);\n\t\t\t}\n\t\t}\n\t\tif (u) {\n\t\t\tn.bindTexture(e.TEXTURE_CUBE_MAP, c.__webglTexture), de(e.TEXTURE_CUBE_MAP, i);\n\t\t\tfor (let n = 0; n < 6; n++) if (i.mipmaps && i.mipmaps.length > 0) for (let r = 0; r < i.mipmaps.length; r++) _e(s.__webglFramebuffer[n][r], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, r);\n\t\t\telse _e(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0);\n\t\t\t_(i) && v(e.TEXTURE_CUBE_MAP), n.unbindTexture();\n\t\t} else if (d) {\n\t\t\tfor (let i = 0, a = l.length; i < a; i++) {\n\t\t\t\tlet a = l[i], o = r.get(a), c = e.TEXTURE_2D;\n\t\t\t\t(t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (c = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(c, o.__webglTexture), de(c, a), _e(s.__webglFramebuffer, t, a, e.COLOR_ATTACHMENT0 + i, c, 0), _(a) && v(c);\n\t\t\t}\n\t\t\tn.unbindTexture();\n\t\t} else {\n\t\t\tlet r = e.TEXTURE_2D;\n\t\t\tif ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (r = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(r, c.__webglTexture), de(r, i), i.mipmaps && i.mipmaps.length > 0) for (let n = 0; n < i.mipmaps.length; n++) _e(s.__webglFramebuffer[n], t, i, e.COLOR_ATTACHMENT0, r, n);\n\t\t\telse _e(s.__webglFramebuffer, t, i, e.COLOR_ATTACHMENT0, r, 0);\n\t\t\t_(i) && v(r), n.unbindTexture();\n\t\t}\n\t\tt.depthBuffer && be(t);\n\t}\n\tfunction Ce(e) {\n\t\tlet t = e.textures;\n\t\tfor (let i = 0, a = t.length; i < a; i++) {\n\t\t\tlet a = t[i];\n\t\t\tif (_(a)) {\n\t\t\t\tlet t = y(e), i = r.get(a).__webglTexture;\n\t\t\t\tn.bindTexture(t, i), v(t), n.unbindTexture();\n\t\t\t}\n\t\t}\n\t}\n\tlet we = [], Te = [];\n\tfunction Ee(t) {\n\t\tif (t.samples > 0) {\n\t\t\tif (Oe(t) === !1) {\n\t\t\t\tlet i = t.textures, a = t.width, o = t.height, s = e.COLOR_BUFFER_BIT, l = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, u = r.get(t), d = i.length > 1;\n\t\t\t\tif (d) for (let t = 0; t < i.length; t++) n.bindFramebuffer(e.FRAMEBUFFER, u.__webglMultisampledFramebuffer), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, null), n.bindFramebuffer(e.FRAMEBUFFER, u.__webglFramebuffer), e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.TEXTURE_2D, null, 0);\n\t\t\t\tn.bindFramebuffer(e.READ_FRAMEBUFFER, u.__webglMultisampledFramebuffer);\n\t\t\t\tlet f = t.texture.mipmaps;\n\t\t\t\tf && f.length > 0 ? n.bindFramebuffer(e.DRAW_FRAMEBUFFER, u.__webglFramebuffer[0]) : n.bindFramebuffer(e.DRAW_FRAMEBUFFER, u.__webglFramebuffer);\n\t\t\t\tfor (let n = 0; n < i.length; n++) {\n\t\t\t\t\tif (t.resolveDepthBuffer && (t.depthBuffer && (s |= e.DEPTH_BUFFER_BIT), t.stencilBuffer && t.resolveStencilBuffer && (s |= e.STENCIL_BUFFER_BIT)), d) {\n\t\t\t\t\t\te.framebufferRenderbuffer(e.READ_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.RENDERBUFFER, u.__webglColorRenderbuffer[n]);\n\t\t\t\t\t\tlet t = r.get(i[n]).__webglTexture;\n\t\t\t\t\t\te.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0);\n\t\t\t\t\t}\n\t\t\t\t\te.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, e.NEAREST), c === !0 && (we.length = 0, Te.length = 0, we.push(e.COLOR_ATTACHMENT0 + n), t.depthBuffer && t.resolveDepthBuffer === !1 && (we.push(l), Te.push(l), e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, Te)), e.invalidateFramebuffer(e.READ_FRAMEBUFFER, we));\n\t\t\t\t}\n\t\t\t\tif (n.bindFramebuffer(e.READ_FRAMEBUFFER, null), n.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), d) for (let t = 0; t < i.length; t++) {\n\t\t\t\t\tn.bindFramebuffer(e.FRAMEBUFFER, u.__webglMultisampledFramebuffer), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, u.__webglColorRenderbuffer[t]);\n\t\t\t\t\tlet a = r.get(i[t]).__webglTexture;\n\t\t\t\t\tn.bindFramebuffer(e.FRAMEBUFFER, u.__webglFramebuffer), e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.TEXTURE_2D, a, 0);\n\t\t\t\t}\n\t\t\t\tn.bindFramebuffer(e.DRAW_FRAMEBUFFER, u.__webglMultisampledFramebuffer);\n\t\t\t} else if (t.depthBuffer && t.resolveDepthBuffer === !1 && c) {\n\t\t\t\tlet n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;\n\t\t\t\te.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, [n]);\n\t\t\t}\n\t\t}\n\t}\n\tfunction De(e) {\n\t\treturn Math.min(i.maxSamples, e.samples);\n\t}\n\tfunction Oe(e) {\n\t\tlet n = r.get(e);\n\t\treturn e.samples > 0 && t.has(\"WEBGL_multisampled_render_to_texture\") === !0 && n.__useRenderToTexture !== !1;\n\t}\n\tfunction ke(e) {\n\t\tlet t = o.render.frame;\n\t\tu.get(e) !== t && (u.set(e, t), e.update());\n\t}\n\tfunction B(e, t) {\n\t\tlet n = e.colorSpace, r = e.format, i = e.type;\n\t\treturn e.isCompressedTexture === !0 || e.isVideoTexture === !0 || n !== \"srgb-linear\" && n !== \"\" && (gn.getTransfer(n) === \"srgb\" ? (r !== 1023 || i !== 1009) && H(\"WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.\") : U(\"WebGLTextures: Unsupported texture color space:\", n)), t;\n\t}\n\tfunction Ae(e) {\n\t\treturn typeof HTMLImageElement < \"u\" && e instanceof HTMLImageElement ? (l.width = e.naturalWidth || e.width, l.height = e.naturalHeight || e.height) : typeof VideoFrame < \"u\" && e instanceof VideoFrame ? (l.width = e.displayWidth, l.height = e.displayHeight) : (l.width = e.width, l.height = e.height), l;\n\t}\n\tthis.allocateTextureUnit = M, this.resetTextureUnits = k, this.getTextureUnits = A, this.setTextureUnits = j, this.setTexture2D = P, this.setTexture2DArray = F, this.setTexture3D = I, this.setTextureCube = se, this.rebindTextures = xe, this.setupRenderTarget = Se, this.updateRenderTargetMipmap = Ce, this.updateMultisampleRenderTarget = Ee, this.setupDepthRenderbuffer = be, this.setupFrameBufferTexture = _e, this.useMultisampledRTT = Oe, this.isReversedDepthBuffer = function() {\n\t\treturn n.buffers.depth.getReversed();\n\t};\n}\nfunction ul(e, t) {\n\tfunction n(n, r = \"\") {\n\t\tlet i, a = gn.getTransfer(r);\n\t\tif (n === 1009) return e.UNSIGNED_BYTE;\n\t\tif (n === 1017) return e.UNSIGNED_SHORT_4_4_4_4;\n\t\tif (n === 1018) return e.UNSIGNED_SHORT_5_5_5_1;\n\t\tif (n === 35902) return e.UNSIGNED_INT_5_9_9_9_REV;\n\t\tif (n === 35899) return e.UNSIGNED_INT_10F_11F_11F_REV;\n\t\tif (n === 1010) return e.BYTE;\n\t\tif (n === 1011) return e.SHORT;\n\t\tif (n === 1012) return e.UNSIGNED_SHORT;\n\t\tif (n === 1013) return e.INT;\n\t\tif (n === 1014) return e.UNSIGNED_INT;\n\t\tif (n === 1015) return e.FLOAT;\n\t\tif (n === 1016) return e.HALF_FLOAT;\n\t\tif (n === 1021) return e.ALPHA;\n\t\tif (n === 1022) return e.RGB;\n\t\tif (n === 1023) return e.RGBA;\n\t\tif (n === 1026) return e.DEPTH_COMPONENT;\n\t\tif (n === 1027) return e.DEPTH_STENCIL;\n\t\tif (n === 1028) return e.RED;\n\t\tif (n === 1029) return e.RED_INTEGER;\n\t\tif (n === 1030) return e.RG;\n\t\tif (n === 1031) return e.RG_INTEGER;\n\t\tif (n === 1033) return e.RGBA_INTEGER;\n\t\tif (n === 33776 || n === 33777 || n === 33778 || n === 33779) {\n\t\t\tif (a === \"srgb\") {\n\t\t\t\tif (i = t.get(\"WEBGL_compressed_texture_s3tc_srgb\"), i !== null) {\n\t\t\t\t\tif (n === 33776) return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif (n === 33777) return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;\n\t\t\t\t\tif (n === 33778) return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;\n\t\t\t\t\tif (n === 33779) return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;\n\t\t\t\t} else return null;\n\t\t\t} else if (i = t.get(\"WEBGL_compressed_texture_s3tc\"), i !== null) {\n\t\t\t\tif (n === 33776) return i.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif (n === 33777) return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif (n === 33778) return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif (n === 33779) return i.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\t\t\t} else return null;\n\t\t}\n\t\tif (n === 35840 || n === 35841 || n === 35842 || n === 35843) {\n\t\t\tif (i = t.get(\"WEBGL_compressed_texture_pvrtc\"), i !== null) {\n\t\t\t\tif (n === 35840) return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif (n === 35841) return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif (n === 35842) return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif (n === 35843) return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\t\t\t} else return null;\n\t\t}\n\t\tif (n === 36196 || n === 37492 || n === 37496 || n === 37488 || n === 37489 || n === 37490 || n === 37491) {\n\t\t\tif (i = t.get(\"WEBGL_compressed_texture_etc\"), i !== null) {\n\t\t\t\tif (n === 36196 || n === 37492) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ETC2 : i.COMPRESSED_RGB8_ETC2;\n\t\t\t\tif (n === 37496) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : i.COMPRESSED_RGBA8_ETC2_EAC;\n\t\t\t\tif (n === 37488) return i.COMPRESSED_R11_EAC;\n\t\t\t\tif (n === 37489) return i.COMPRESSED_SIGNED_R11_EAC;\n\t\t\t\tif (n === 37490) return i.COMPRESSED_RG11_EAC;\n\t\t\t\tif (n === 37491) return i.COMPRESSED_SIGNED_RG11_EAC;\n\t\t\t} else return null;\n\t\t}\n\t\tif (n === 37808 || n === 37809 || n === 37810 || n === 37811 || n === 37812 || n === 37813 || n === 37814 || n === 37815 || n === 37816 || n === 37817 || n === 37818 || n === 37819 || n === 37820 || n === 37821) {\n\t\t\tif (i = t.get(\"WEBGL_compressed_texture_astc\"), i !== null) {\n\t\t\t\tif (n === 37808) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : i.COMPRESSED_RGBA_ASTC_4x4_KHR;\n\t\t\t\tif (n === 37809) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : i.COMPRESSED_RGBA_ASTC_5x4_KHR;\n\t\t\t\tif (n === 37810) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : i.COMPRESSED_RGBA_ASTC_5x5_KHR;\n\t\t\t\tif (n === 37811) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : i.COMPRESSED_RGBA_ASTC_6x5_KHR;\n\t\t\t\tif (n === 37812) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : i.COMPRESSED_RGBA_ASTC_6x6_KHR;\n\t\t\t\tif (n === 37813) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : i.COMPRESSED_RGBA_ASTC_8x5_KHR;\n\t\t\t\tif (n === 37814) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : i.COMPRESSED_RGBA_ASTC_8x6_KHR;\n\t\t\t\tif (n === 37815) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : i.COMPRESSED_RGBA_ASTC_8x8_KHR;\n\t\t\t\tif (n === 37816) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : i.COMPRESSED_RGBA_ASTC_10x5_KHR;\n\t\t\t\tif (n === 37817) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : i.COMPRESSED_RGBA_ASTC_10x6_KHR;\n\t\t\t\tif (n === 37818) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : i.COMPRESSED_RGBA_ASTC_10x8_KHR;\n\t\t\t\tif (n === 37819) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : i.COMPRESSED_RGBA_ASTC_10x10_KHR;\n\t\t\t\tif (n === 37820) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : i.COMPRESSED_RGBA_ASTC_12x10_KHR;\n\t\t\t\tif (n === 37821) return a === \"srgb\" ? i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : i.COMPRESSED_RGBA_ASTC_12x12_KHR;\n\t\t\t} else return null;\n\t\t}\n\t\tif (n === 36492 || n === 36494 || n === 36495) {\n\t\t\tif (i = t.get(\"EXT_texture_compression_bptc\"), i !== null) {\n\t\t\t\tif (n === 36492) return a === \"srgb\" ? i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : i.COMPRESSED_RGBA_BPTC_UNORM_EXT;\n\t\t\t\tif (n === 36494) return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;\n\t\t\t\tif (n === 36495) return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;\n\t\t\t} else return null;\n\t\t}\n\t\tif (n === 36283 || n === 36284 || n === 36285 || n === 36286) {\n\t\t\tif (i = t.get(\"EXT_texture_compression_rgtc\"), i !== null) {\n\t\t\t\tif (n === 36283) return i.COMPRESSED_RED_RGTC1_EXT;\n\t\t\t\tif (n === 36284) return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;\n\t\t\t\tif (n === 36285) return i.COMPRESSED_RED_GREEN_RGTC2_EXT;\n\t\t\t\tif (n === 36286) return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;\n\t\t\t} else return null;\n\t\t}\n\t\treturn n === 1020 ? e.UNSIGNED_INT_24_8 : e[n] === void 0 ? null : e[n];\n\t}\n\treturn { convert: n };\n}\nvar dl = \"\\nvoid main() {\\n\\n\tgl_Position = vec4( position, 1.0 );\\n\\n}\", fl = \"\\nuniform sampler2DArray depthColor;\\nuniform float depthWidth;\\nuniform float depthHeight;\\n\\nvoid main() {\\n\\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\\n\\n\tif ( coord.x >= 1.0 ) {\\n\\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\\n\\n\t} else {\\n\\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\\n\\n\t}\\n\\n}\", pl = class {\n\tconstructor() {\n\t\tthis.texture = null, this.mesh = null, this.depthNear = 0, this.depthFar = 0;\n\t}\n\tinit(e, t) {\n\t\tif (this.texture === null) {\n\t\t\tlet n = new Qi(e.texture);\n\t\t\t(e.depthNear !== t.depthNear || e.depthFar !== t.depthFar) && (this.depthNear = e.depthNear, this.depthFar = e.depthFar), this.texture = n;\n\t\t}\n\t}\n\tgetMesh(e) {\n\t\tif (this.texture !== null && this.mesh === null) {\n\t\t\tlet t = e.cameras[0].viewport, n = new fa({\n\t\t\t\tvertexShader: dl,\n\t\t\t\tfragmentShader: fl,\n\t\t\t\tuniforms: {\n\t\t\t\t\tdepthColor: { value: this.texture },\n\t\t\t\t\tdepthWidth: { value: t.z },\n\t\t\t\t\tdepthHeight: { value: t.w }\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.mesh = new Ii(new na(20, 20), n);\n\t\t}\n\t\treturn this.mesh;\n\t}\n\treset() {\n\t\tthis.texture = null, this.mesh = null;\n\t}\n\tgetDepthTexture() {\n\t\treturn this.texture;\n\t}\n}, ml = class extends Ft {\n\tconstructor(e, t) {\n\t\tsuper();\n\t\tlet n = this, r = null, i = 1, a = null, o = \"local-floor\", s = 1, c = null, l = null, u = null, d = null, f = null, p = null, m = typeof XRWebGLBinding < \"u\", h = new pl(), g = {}, _ = t.getContextAttributes(), v = null, y = null, b = [], x = [], S = new G(), C = null, w = new La();\n\t\tw.viewport = new Dn();\n\t\tlet T = new La();\n\t\tT.viewport = new Dn();\n\t\tlet E = [w, T], D = new Ua(), O = null, k = null;\n\t\tthis.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {\n\t\t\tlet t = b[e];\n\t\t\treturn t === void 0 && (t = new sr(), b[e] = t), t.getTargetRaySpace();\n\t\t}, this.getControllerGrip = function(e) {\n\t\t\tlet t = b[e];\n\t\t\treturn t === void 0 && (t = new sr(), b[e] = t), t.getGripSpace();\n\t\t}, this.getHand = function(e) {\n\t\t\tlet t = b[e];\n\t\t\treturn t === void 0 && (t = new sr(), b[e] = t), t.getHandSpace();\n\t\t};\n\t\tfunction A(e) {\n\t\t\tlet t = x.indexOf(e.inputSource);\n\t\t\tif (t === -1) return;\n\t\t\tlet n = b[t];\n\t\t\tn !== void 0 && (n.update(e.inputSource, e.frame, c || a), n.dispatchEvent({\n\t\t\t\ttype: e.type,\n\t\t\t\tdata: e.inputSource\n\t\t\t}));\n\t\t}\n\t\tfunction j() {\n\t\t\tr.removeEventListener(\"select\", A), r.removeEventListener(\"selectstart\", A), r.removeEventListener(\"selectend\", A), r.removeEventListener(\"squeeze\", A), r.removeEventListener(\"squeezestart\", A), r.removeEventListener(\"squeezeend\", A), r.removeEventListener(\"end\", j), r.removeEventListener(\"inputsourceschange\", M);\n\t\t\tfor (let e = 0; e < b.length; e++) {\n\t\t\t\tlet t = x[e];\n\t\t\t\tt !== null && (x[e] = null, b[e].disconnect(t));\n\t\t\t}\n\t\t\tO = null, k = null, h.reset();\n\t\t\tfor (let e in g) delete g[e];\n\t\t\te.setRenderTarget(v), f = null, d = null, u = null, r = null, y = null, L.stop(), n.isPresenting = !1, e.setPixelRatio(C), e.setSize(S.width, S.height, !1), n.dispatchEvent({ type: \"sessionend\" });\n\t\t}\n\t\tthis.setFramebufferScaleFactor = function(e) {\n\t\t\ti = e, n.isPresenting === !0 && H(\"WebXRManager: Cannot change framebuffer scale while presenting.\");\n\t\t}, this.setReferenceSpaceType = function(e) {\n\t\t\to = e, n.isPresenting === !0 && H(\"WebXRManager: Cannot change reference space type while presenting.\");\n\t\t}, this.getReferenceSpace = function() {\n\t\t\treturn c || a;\n\t\t}, this.setReferenceSpace = function(e) {\n\t\t\tc = e;\n\t\t}, this.getBaseLayer = function() {\n\t\t\treturn d === null ? f : d;\n\t\t}, this.getBinding = function() {\n\t\t\treturn u === null && m && (u = new XRWebGLBinding(r, t)), u;\n\t\t}, this.getFrame = function() {\n\t\t\treturn p;\n\t\t}, this.getSession = function() {\n\t\t\treturn r;\n\t\t}, this.setSession = async function(l) {\n\t\t\tif (r = l, r !== null) {\n\t\t\t\tif (v = e.getRenderTarget(), r.addEventListener(\"select\", A), r.addEventListener(\"selectstart\", A), r.addEventListener(\"selectend\", A), r.addEventListener(\"squeeze\", A), r.addEventListener(\"squeezestart\", A), r.addEventListener(\"squeezeend\", A), r.addEventListener(\"end\", j), r.addEventListener(\"inputsourceschange\", M), _.xrCompatible !== !0 && await t.makeXRCompatible(), C = e.getPixelRatio(), e.getSize(S), m && \"createProjectionLayer\" in XRWebGLBinding.prototype) {\n\t\t\t\t\tlet n = null, a = null, o = null;\n\t\t\t\t\t_.depth && (o = _.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = _.stencil ? z : Ce, a = _.stencil ? _e : fe);\n\t\t\t\t\tlet s = {\n\t\t\t\t\t\tcolorFormat: t.RGBA8,\n\t\t\t\t\t\tdepthFormat: o,\n\t\t\t\t\t\tscaleFactor: i\n\t\t\t\t\t};\n\t\t\t\t\tu = this.getBinding(), d = u.createProjectionLayer(s), r.updateRenderState({ layers: [d] }), e.setPixelRatio(1), e.setSize(d.textureWidth, d.textureHeight, !1), y = new kn(d.textureWidth, d.textureHeight, {\n\t\t\t\t\t\tformat: Se,\n\t\t\t\t\t\ttype: se,\n\t\t\t\t\t\tdepthTexture: new Xi(d.textureWidth, d.textureHeight, a, void 0, void 0, void 0, void 0, void 0, void 0, n),\n\t\t\t\t\t\tstencilBuffer: _.stencil,\n\t\t\t\t\t\tcolorSpace: e.outputColorSpace,\n\t\t\t\t\t\tsamples: _.antialias ? 4 : 0,\n\t\t\t\t\t\tresolveDepthBuffer: d.ignoreDepthValues === !1,\n\t\t\t\t\t\tresolveStencilBuffer: d.ignoreDepthValues === !1\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tlet n = {\n\t\t\t\t\t\tantialias: _.antialias,\n\t\t\t\t\t\talpha: !0,\n\t\t\t\t\t\tdepth: _.depth,\n\t\t\t\t\t\tstencil: _.stencil,\n\t\t\t\t\t\tframebufferScaleFactor: i\n\t\t\t\t\t};\n\t\t\t\t\tf = new XRWebGLLayer(r, t, n), r.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), y = new kn(f.framebufferWidth, f.framebufferHeight, {\n\t\t\t\t\t\tformat: Se,\n\t\t\t\t\t\ttype: se,\n\t\t\t\t\t\tcolorSpace: e.outputColorSpace,\n\t\t\t\t\t\tstencilBuffer: _.stencil,\n\t\t\t\t\t\tresolveDepthBuffer: f.ignoreDepthValues === !1,\n\t\t\t\t\t\tresolveStencilBuffer: f.ignoreDepthValues === !1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\ty.isXRRenderTarget = !0, this.setFoveation(s), c = null, a = await r.requestReferenceSpace(o), L.setContext(r), L.start(), n.isPresenting = !0, n.dispatchEvent({ type: \"sessionstart\" });\n\t\t\t}\n\t\t}, this.getEnvironmentBlendMode = function() {\n\t\t\tif (r !== null) return r.environmentBlendMode;\n\t\t}, this.getDepthTexture = function() {\n\t\t\treturn h.getDepthTexture();\n\t\t};\n\t\tfunction M(e) {\n\t\t\tfor (let t = 0; t < e.removed.length; t++) {\n\t\t\t\tlet n = e.removed[t], r = x.indexOf(n);\n\t\t\t\tr >= 0 && (x[r] = null, b[r].disconnect(n));\n\t\t\t}\n\t\t\tfor (let t = 0; t < e.added.length; t++) {\n\t\t\t\tlet n = e.added[t], r = x.indexOf(n);\n\t\t\t\tif (r === -1) {\n\t\t\t\t\tfor (let e = 0; e < b.length; e++) if (e >= x.length) {\n\t\t\t\t\t\tx.push(n), r = e;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (x[e] === null) {\n\t\t\t\t\t\tx[e] = n, r = e;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (r === -1) break;\n\t\t\t\t}\n\t\t\t\tlet i = b[r];\n\t\t\t\ti && i.connect(n);\n\t\t\t}\n\t\t}\n\t\tlet N = new K(), P = new K();\n\t\tfunction F(e, t, n) {\n\t\t\tN.setFromMatrixPosition(t.matrixWorld), P.setFromMatrixPosition(n.matrixWorld);\n\t\t\tlet r = N.distanceTo(P), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;\n\t\t\tif (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);\n\t\t\telse {\n\t\t\t\tlet t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;\n\t\t\t\te.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();\n\t\t\t}\n\t\t}\n\t\tfunction I(e, t) {\n\t\t\tt === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();\n\t\t}\n\t\tthis.updateCamera = function(e) {\n\t\t\tif (r === null) return;\n\t\t\tlet t = e.near, n = e.far;\n\t\t\th.texture !== null && (h.depthNear > 0 && (t = h.depthNear), h.depthFar > 0 && (n = h.depthFar)), D.near = T.near = w.near = t, D.far = T.far = w.far = n, (O !== D.near || k !== D.far) && (r.updateRenderState({\n\t\t\t\tdepthNear: D.near,\n\t\t\t\tdepthFar: D.far\n\t\t\t}), O = D.near, k = D.far), D.layers.mask = e.layers.mask | 6, w.layers.mask = D.layers.mask & -5, T.layers.mask = D.layers.mask & -3;\n\t\t\tlet i = e.parent, a = D.cameras;\n\t\t\tI(D, i);\n\t\t\tfor (let e = 0; e < a.length; e++) I(a[e], i);\n\t\t\ta.length === 2 ? F(D, w, T) : D.projectionMatrix.copy(w.projectionMatrix), ee(e, D, i);\n\t\t};\n\t\tfunction ee(e, t, n) {\n\t\t\tn === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = zt * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);\n\t\t}\n\t\tthis.getCamera = function() {\n\t\t\treturn D;\n\t\t}, this.getFoveation = function() {\n\t\t\tif (d !== null || f !== null) return s;\n\t\t}, this.setFoveation = function(e) {\n\t\t\ts = e, d !== null && (d.fixedFoveation = e), f !== null && f.fixedFoveation !== void 0 && (f.fixedFoveation = e);\n\t\t}, this.hasDepthSensing = function() {\n\t\t\treturn h.texture !== null;\n\t\t}, this.getDepthSensingMesh = function() {\n\t\t\treturn h.getMesh(D);\n\t\t}, this.getCameraTexture = function(e) {\n\t\t\treturn g[e];\n\t\t};\n\t\tlet te = null;\n\t\tfunction ne(t, i) {\n\t\t\tif (l = i.getViewerPose(c || a), p = i, l !== null) {\n\t\t\t\tlet t = l.views;\n\t\t\t\tf !== null && (e.setRenderTargetFramebuffer(y, f.framebuffer), e.setRenderTarget(y));\n\t\t\t\tlet i = !1;\n\t\t\t\tt.length !== D.cameras.length && (D.cameras.length = 0, i = !0);\n\t\t\t\tfor (let n = 0; n < t.length; n++) {\n\t\t\t\t\tlet r = t[n], a = null;\n\t\t\t\t\tif (f !== null) a = f.getViewport(r);\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet t = u.getViewSubImage(d, r);\n\t\t\t\t\t\ta = t.viewport, n === 0 && (e.setRenderTargetTextures(y, t.colorTexture, t.depthStencilTexture), e.setRenderTarget(y));\n\t\t\t\t\t}\n\t\t\t\t\tlet o = E[n];\n\t\t\t\t\to === void 0 && (o = new La(), o.layers.enable(n), o.viewport = new Dn(), E[n] = o), o.matrix.fromArray(r.transform.matrix), o.matrix.decompose(o.position, o.quaternion, o.scale), o.projectionMatrix.fromArray(r.projectionMatrix), o.projectionMatrixInverse.copy(o.projectionMatrix).invert(), o.viewport.set(a.x, a.y, a.width, a.height), n === 0 && (D.matrix.copy(o.matrix), D.matrix.decompose(D.position, D.quaternion, D.scale)), i === !0 && D.cameras.push(o);\n\t\t\t\t}\n\t\t\t\tlet a = r.enabledFeatures;\n\t\t\t\tif (a && a.includes(\"depth-sensing\") && r.depthUsage == \"gpu-optimized\" && m) {\n\t\t\t\t\tu = n.getBinding();\n\t\t\t\t\tlet e = u.getDepthInformation(t[0]);\n\t\t\t\t\te && e.isValid && e.texture && h.init(e, r.renderState);\n\t\t\t\t}\n\t\t\t\tif (a && a.includes(\"camera-access\") && m) {\n\t\t\t\t\te.state.unbindTexture(), u = n.getBinding();\n\t\t\t\t\tfor (let e = 0; e < t.length; e++) {\n\t\t\t\t\t\tlet n = t[e].camera;\n\t\t\t\t\t\tif (n) {\n\t\t\t\t\t\t\tlet e = g[n];\n\t\t\t\t\t\t\te || (e = new Qi(), g[n] = e);\n\t\t\t\t\t\t\tlet t = u.getCameraImage(n);\n\t\t\t\t\t\t\te.sourceTexture = t;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let e = 0; e < b.length; e++) {\n\t\t\t\tlet t = x[e], n = b[e];\n\t\t\t\tt !== null && n !== void 0 && n.update(t, i, c || a);\n\t\t\t}\n\t\t\tte && te(t, i), i.detectedPlanes && n.dispatchEvent({\n\t\t\t\ttype: \"planesdetected\",\n\t\t\t\tdata: i\n\t\t\t}), p = null;\n\t\t}\n\t\tlet L = new oo();\n\t\tL.setAnimationLoop(ne), this.setAnimationLoop = function(e) {\n\t\t\tte = e;\n\t\t}, this.dispose = function() {};\n\t}\n}, hl = /*@__PURE__*/ new J(), gl = /*@__PURE__*/ new q();\ngl.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);\nfunction _l(e, t) {\n\tfunction n(e, t) {\n\t\te.matrixAutoUpdate === !0 && e.updateMatrix(), t.value.copy(e.matrix);\n\t}\n\tfunction r(t, n) {\n\t\tn.color.getRGB(t.fogColor.value, ca(e)), n.isFog ? (t.fogNear.value = n.near, t.fogFar.value = n.far) : n.isFogExp2 && (t.fogDensity.value = n.density);\n\t}\n\tfunction i(e, t, n, r, i) {\n\t\tt.isNodeMaterial ? t.uniformsNeedUpdate = !1 : t.isMeshBasicMaterial ? a(e, t) : t.isMeshLambertMaterial ? (a(e, t), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)) : t.isMeshToonMaterial ? (a(e, t), d(e, t)) : t.isMeshPhongMaterial ? (a(e, t), u(e, t), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)) : t.isMeshStandardMaterial ? (a(e, t), f(e, t), t.isMeshPhysicalMaterial && p(e, t, i)) : t.isMeshMatcapMaterial ? (a(e, t), m(e, t)) : t.isMeshDepthMaterial ? a(e, t) : t.isMeshDistanceMaterial ? (a(e, t), h(e, t)) : t.isMeshNormalMaterial ? a(e, t) : t.isLineBasicMaterial ? (o(e, t), t.isLineDashedMaterial && s(e, t)) : t.isPointsMaterial ? c(e, t, n, r) : t.isSpriteMaterial ? l(e, t) : t.isShadowMaterial ? (e.color.value.copy(t.color), e.opacity.value = t.opacity) : t.isShaderMaterial && (t.uniformsNeedUpdate = !1);\n\t}\n\tfunction a(e, r) {\n\t\te.opacity.value = r.opacity, r.color && e.diffuse.value.copy(r.color), r.emissive && e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity), r.map && (e.map.value = r.map, n(r.map, e.mapTransform)), r.alphaMap && (e.alphaMap.value = r.alphaMap, n(r.alphaMap, e.alphaMapTransform)), r.bumpMap && (e.bumpMap.value = r.bumpMap, n(r.bumpMap, e.bumpMapTransform), e.bumpScale.value = r.bumpScale, r.side === 1 && (e.bumpScale.value *= -1)), r.normalMap && (e.normalMap.value = r.normalMap, n(r.normalMap, e.normalMapTransform), e.normalScale.value.copy(r.normalScale), r.side === 1 && e.normalScale.value.negate()), r.displacementMap && (e.displacementMap.value = r.displacementMap, n(r.displacementMap, e.displacementMapTransform), e.displacementScale.value = r.displacementScale, e.displacementBias.value = r.displacementBias), r.emissiveMap && (e.emissiveMap.value = r.emissiveMap, n(r.emissiveMap, e.emissiveMapTransform)), r.specularMap && (e.specularMap.value = r.specularMap, n(r.specularMap, e.specularMapTransform)), r.alphaTest > 0 && (e.alphaTest.value = r.alphaTest);\n\t\tlet i = t.get(r), a = i.envMap, o = i.envMapRotation;\n\t\ta && (e.envMap.value = a, e.envMapRotation.value.setFromMatrix4(hl.makeRotationFromEuler(o)).transpose(), a.isCubeTexture && a.isRenderTargetTexture === !1 && e.envMapRotation.value.premultiply(gl), e.reflectivity.value = r.reflectivity, e.ior.value = r.ior, e.refractionRatio.value = r.refractionRatio), r.lightMap && (e.lightMap.value = r.lightMap, e.lightMapIntensity.value = r.lightMapIntensity, n(r.lightMap, e.lightMapTransform)), r.aoMap && (e.aoMap.value = r.aoMap, e.aoMapIntensity.value = r.aoMapIntensity, n(r.aoMap, e.aoMapTransform));\n\t}\n\tfunction o(e, t) {\n\t\te.diffuse.value.copy(t.color), e.opacity.value = t.opacity, t.map && (e.map.value = t.map, n(t.map, e.mapTransform));\n\t}\n\tfunction s(e, t) {\n\t\te.dashSize.value = t.dashSize, e.totalSize.value = t.dashSize + t.gapSize, e.scale.value = t.scale;\n\t}\n\tfunction c(e, t, r, i) {\n\t\te.diffuse.value.copy(t.color), e.opacity.value = t.opacity, e.size.value = t.size * r, e.scale.value = i * .5, t.map && (e.map.value = t.map, n(t.map, e.uvTransform)), t.alphaMap && (e.alphaMap.value = t.alphaMap, n(t.alphaMap, e.alphaMapTransform)), t.alphaTest > 0 && (e.alphaTest.value = t.alphaTest);\n\t}\n\tfunction l(e, t) {\n\t\te.diffuse.value.copy(t.color), e.opacity.value = t.opacity, e.rotation.value = t.rotation, t.map && (e.map.value = t.map, n(t.map, e.mapTransform)), t.alphaMap && (e.alphaMap.value = t.alphaMap, n(t.alphaMap, e.alphaMapTransform)), t.alphaTest > 0 && (e.alphaTest.value = t.alphaTest);\n\t}\n\tfunction u(e, t) {\n\t\te.specular.value.copy(t.specular), e.shininess.value = Math.max(t.shininess, 1e-4);\n\t}\n\tfunction d(e, t) {\n\t\tt.gradientMap && (e.gradientMap.value = t.gradientMap);\n\t}\n\tfunction f(e, t) {\n\t\te.metalness.value = t.metalness, t.metalnessMap && (e.metalnessMap.value = t.metalnessMap, n(t.metalnessMap, e.metalnessMapTransform)), e.roughness.value = t.roughness, t.roughnessMap && (e.roughnessMap.value = t.roughnessMap, n(t.roughnessMap, e.roughnessMapTransform)), t.envMap && (e.envMapIntensity.value = t.envMapIntensity);\n\t}\n\tfunction p(e, t, r) {\n\t\te.ior.value = t.ior, t.sheen > 0 && (e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen), e.sheenRoughness.value = t.sheenRoughness, t.sheenColorMap && (e.sheenColorMap.value = t.sheenColorMap, n(t.sheenColorMap, e.sheenColorMapTransform)), t.sheenRoughnessMap && (e.sheenRoughnessMap.value = t.sheenRoughnessMap, n(t.sheenRoughnessMap, e.sheenRoughnessMapTransform))), t.clearcoat > 0 && (e.clearcoat.value = t.clearcoat, e.clearcoatRoughness.value = t.clearcoatRoughness, t.clearcoatMap && (e.clearcoatMap.value = t.clearcoatMap, n(t.clearcoatMap, e.clearcoatMapTransform)), t.clearcoatRoughnessMap && (e.clearcoatRoughnessMap.value = t.clearcoatRoughnessMap, n(t.clearcoatRoughnessMap, e.clearcoatRoughnessMapTransform)), t.clearcoatNormalMap && (e.clearcoatNormalMap.value = t.clearcoatNormalMap, n(t.clearcoatNormalMap, e.clearcoatNormalMapTransform), e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale), t.side === 1 && e.clearcoatNormalScale.value.negate())), t.dispersion > 0 && (e.dispersion.value = t.dispersion), t.iridescence > 0 && (e.iridescence.value = t.iridescence, e.iridescenceIOR.value = t.iridescenceIOR, e.iridescenceThicknessMinimum.value = t.iridescenceThicknessRange[0], e.iridescenceThicknessMaximum.value = t.iridescenceThicknessRange[1], t.iridescenceMap && (e.iridescenceMap.value = t.iridescenceMap, n(t.iridescenceMap, e.iridescenceMapTransform)), t.iridescenceThicknessMap && (e.iridescenceThicknessMap.value = t.iridescenceThicknessMap, n(t.iridescenceThicknessMap, e.iridescenceThicknessMapTransform))), t.transmission > 0 && (e.transmission.value = t.transmission, e.transmissionSamplerMap.value = r.texture, e.transmissionSamplerSize.value.set(r.width, r.height), t.transmissionMap && (e.transmissionMap.value = t.transmissionMap, n(t.transmissionMap, e.transmissionMapTransform)), e.thickness.value = t.thickness, t.thicknessMap && (e.thicknessMap.value = t.thicknessMap, n(t.thicknessMap, e.thicknessMapTransform)), e.attenuationDistance.value = t.attenuationDistance, e.attenuationColor.value.copy(t.attenuationColor)), t.anisotropy > 0 && (e.anisotropyVector.value.set(t.anisotropy * Math.cos(t.anisotropyRotation), t.anisotropy * Math.sin(t.anisotropyRotation)), t.anisotropyMap && (e.anisotropyMap.value = t.anisotropyMap, n(t.anisotropyMap, e.anisotropyMapTransform))), e.specularIntensity.value = t.specularIntensity, e.specularColor.value.copy(t.specularColor), t.specularColorMap && (e.specularColorMap.value = t.specularColorMap, n(t.specularColorMap, e.specularColorMapTransform)), t.specularIntensityMap && (e.specularIntensityMap.value = t.specularIntensityMap, n(t.specularIntensityMap, e.specularIntensityMapTransform));\n\t}\n\tfunction m(e, t) {\n\t\tt.matcap && (e.matcap.value = t.matcap);\n\t}\n\tfunction h(e, n) {\n\t\tlet r = t.get(n).light;\n\t\te.referencePosition.value.setFromMatrixPosition(r.matrixWorld), e.nearDistance.value = r.shadow.camera.near, e.farDistance.value = r.shadow.camera.far;\n\t}\n\treturn {\n\t\trefreshFogUniforms: r,\n\t\trefreshMaterialUniforms: i\n\t};\n}\nfunction vl(e, t, n, r) {\n\tlet i = {}, a = {}, o = [], s = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);\n\tfunction c(e, t) {\n\t\tlet n = t.program;\n\t\tr.uniformBlockBinding(e, n);\n\t}\n\tfunction l(e, n) {\n\t\tlet o = i[e.id];\n\t\to === void 0 && (m(e), o = u(e), i[e.id] = o, e.addEventListener(\"dispose\", g));\n\t\tlet s = n.program;\n\t\tr.updateUBOMapping(e, s);\n\t\tlet c = t.render.frame;\n\t\ta[e.id] !== c && (f(e), a[e.id] = c);\n\t}\n\tfunction u(t) {\n\t\tlet n = d();\n\t\tt.__bindingPointIndex = n;\n\t\tlet r = e.createBuffer(), i = t.__size, a = t.usage;\n\t\treturn e.bindBuffer(e.UNIFORM_BUFFER, r), e.bufferData(e.UNIFORM_BUFFER, i, a), e.bindBuffer(e.UNIFORM_BUFFER, null), e.bindBufferBase(e.UNIFORM_BUFFER, n, r), r;\n\t}\n\tfunction d() {\n\t\tfor (let e = 0; e < s; e++) if (o.indexOf(e) === -1) return o.push(e), e;\n\t\treturn U(\"WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.\"), 0;\n\t}\n\tfunction f(t) {\n\t\tlet n = i[t.id], r = t.uniforms, a = t.__cache;\n\t\te.bindBuffer(e.UNIFORM_BUFFER, n);\n\t\tfor (let t = 0, n = r.length; t < n; t++) {\n\t\t\tlet n = Array.isArray(r[t]) ? r[t] : [r[t]];\n\t\t\tfor (let r = 0, i = n.length; r < i; r++) {\n\t\t\t\tlet i = n[r];\n\t\t\t\tif (p(i, t, r, a) === !0) {\n\t\t\t\t\tlet t = i.__offset, n = Array.isArray(i.value) ? i.value : [i.value], r = 0;\n\t\t\t\t\tfor (let a = 0; a < n.length; a++) {\n\t\t\t\t\t\tlet o = n[a], s = h(o);\n\t\t\t\t\t\ttypeof o == \"number\" || typeof o == \"boolean\" ? (i.__data[0] = o, e.bufferSubData(e.UNIFORM_BUFFER, t + r, i.__data)) : o.isMatrix3 ? (i.__data[0] = o.elements[0], i.__data[1] = o.elements[1], i.__data[2] = o.elements[2], i.__data[3] = 0, i.__data[4] = o.elements[3], i.__data[5] = o.elements[4], i.__data[6] = o.elements[5], i.__data[7] = 0, i.__data[8] = o.elements[6], i.__data[9] = o.elements[7], i.__data[10] = o.elements[8], i.__data[11] = 0) : ArrayBuffer.isView(o) ? i.__data.set(new o.constructor(o.buffer, o.byteOffset, i.__data.length)) : (o.toArray(i.__data, r), r += s.storage / Float32Array.BYTES_PER_ELEMENT);\n\t\t\t\t\t}\n\t\t\t\t\te.bufferSubData(e.UNIFORM_BUFFER, t, i.__data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\te.bindBuffer(e.UNIFORM_BUFFER, null);\n\t}\n\tfunction p(e, t, n, r) {\n\t\tlet i = e.value, a = t + \"_\" + n;\n\t\tif (r[a] === void 0) return r[a] = typeof i == \"number\" || typeof i == \"boolean\" ? i : ArrayBuffer.isView(i) ? i.slice() : i.clone(), !0;\n\t\t{\n\t\t\tlet e = r[a];\n\t\t\tif (typeof i == \"number\" || typeof i == \"boolean\") {\n\t\t\t\tif (e !== i) return r[a] = i, !0;\n\t\t\t} else if (ArrayBuffer.isView(i)) return !0;\n\t\t\telse if (e.equals(i) === !1) return e.copy(i), !0;\n\t\t}\n\t\treturn !1;\n\t}\n\tfunction m(e) {\n\t\tlet t = e.uniforms, n = 0;\n\t\tfor (let e = 0, r = t.length; e < r; e++) {\n\t\t\tlet r = Array.isArray(t[e]) ? t[e] : [t[e]];\n\t\t\tfor (let e = 0, t = r.length; e < t; e++) {\n\t\t\t\tlet t = r[e], i = Array.isArray(t.value) ? t.value : [t.value];\n\t\t\t\tfor (let e = 0, r = i.length; e < r; e++) {\n\t\t\t\t\tlet r = i[e], a = h(r), o = n % 16, s = o % a.boundary, c = o + s;\n\t\t\t\t\tn += s, c !== 0 && 16 - c < a.storage && (n += 16 - c), t.__data = new Float32Array(a.storage / Float32Array.BYTES_PER_ELEMENT), t.__offset = n, n += a.storage;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlet r = n % 16;\n\t\treturn r > 0 && (n += 16 - r), e.__size = n, e.__cache = {}, this;\n\t}\n\tfunction h(e) {\n\t\tlet t = {\n\t\t\tboundary: 0,\n\t\t\tstorage: 0\n\t\t};\n\t\treturn typeof e == \"number\" || typeof e == \"boolean\" ? (t.boundary = 4, t.storage = 4) : e.isVector2 ? (t.boundary = 8, t.storage = 8) : e.isVector3 || e.isColor ? (t.boundary = 16, t.storage = 12) : e.isVector4 ? (t.boundary = 16, t.storage = 16) : e.isMatrix3 ? (t.boundary = 48, t.storage = 48) : e.isMatrix4 ? (t.boundary = 64, t.storage = 64) : e.isTexture ? H(\"WebGLRenderer: Texture samplers can not be part of an uniforms group.\") : ArrayBuffer.isView(e) ? (t.boundary = 16, t.storage = e.byteLength) : H(\"WebGLRenderer: Unsupported uniform value type.\", e), t;\n\t}\n\tfunction g(t) {\n\t\tlet n = t.target;\n\t\tn.removeEventListener(\"dispose\", g);\n\t\tlet r = o.indexOf(n.__bindingPointIndex);\n\t\to.splice(r, 1), e.deleteBuffer(i[n.id]), delete i[n.id], delete a[n.id];\n\t}\n\tfunction _() {\n\t\tfor (let t in i) e.deleteBuffer(i[t]);\n\t\to = [], i = {}, a = {};\n\t}\n\treturn {\n\t\tbind: c,\n\t\tupdate: l,\n\t\tdispose: _\n\t};\n}\nvar yl = new Uint16Array([\n\t12469,\n\t15057,\n\t12620,\n\t14925,\n\t13266,\n\t14620,\n\t13807,\n\t14376,\n\t14323,\n\t13990,\n\t14545,\n\t13625,\n\t14713,\n\t13328,\n\t14840,\n\t12882,\n\t14931,\n\t12528,\n\t14996,\n\t12233,\n\t15039,\n\t11829,\n\t15066,\n\t11525,\n\t15080,\n\t11295,\n\t15085,\n\t10976,\n\t15082,\n\t10705,\n\t15073,\n\t10495,\n\t13880,\n\t14564,\n\t13898,\n\t14542,\n\t13977,\n\t14430,\n\t14158,\n\t14124,\n\t14393,\n\t13732,\n\t14556,\n\t13410,\n\t14702,\n\t12996,\n\t14814,\n\t12596,\n\t14891,\n\t12291,\n\t14937,\n\t11834,\n\t14957,\n\t11489,\n\t14958,\n\t11194,\n\t14943,\n\t10803,\n\t14921,\n\t10506,\n\t14893,\n\t10278,\n\t14858,\n\t9960,\n\t14484,\n\t14039,\n\t14487,\n\t14025,\n\t14499,\n\t13941,\n\t14524,\n\t13740,\n\t14574,\n\t13468,\n\t14654,\n\t13106,\n\t14743,\n\t12678,\n\t14818,\n\t12344,\n\t14867,\n\t11893,\n\t14889,\n\t11509,\n\t14893,\n\t11180,\n\t14881,\n\t10751,\n\t14852,\n\t10428,\n\t14812,\n\t10128,\n\t14765,\n\t9754,\n\t14712,\n\t9466,\n\t14764,\n\t13480,\n\t14764,\n\t13475,\n\t14766,\n\t13440,\n\t14766,\n\t13347,\n\t14769,\n\t13070,\n\t14786,\n\t12713,\n\t14816,\n\t12387,\n\t14844,\n\t11957,\n\t14860,\n\t11549,\n\t14868,\n\t11215,\n\t14855,\n\t10751,\n\t14825,\n\t10403,\n\t14782,\n\t10044,\n\t14729,\n\t9651,\n\t14666,\n\t9352,\n\t14599,\n\t9029,\n\t14967,\n\t12835,\n\t14966,\n\t12831,\n\t14963,\n\t12804,\n\t14954,\n\t12723,\n\t14936,\n\t12564,\n\t14917,\n\t12347,\n\t14900,\n\t11958,\n\t14886,\n\t11569,\n\t14878,\n\t11247,\n\t14859,\n\t10765,\n\t14828,\n\t10401,\n\t14784,\n\t10011,\n\t14727,\n\t9600,\n\t14660,\n\t9289,\n\t14586,\n\t8893,\n\t14508,\n\t8533,\n\t15111,\n\t12234,\n\t15110,\n\t12234,\n\t15104,\n\t12216,\n\t15092,\n\t12156,\n\t15067,\n\t12010,\n\t15028,\n\t11776,\n\t14981,\n\t11500,\n\t14942,\n\t11205,\n\t14902,\n\t10752,\n\t14861,\n\t10393,\n\t14812,\n\t9991,\n\t14752,\n\t9570,\n\t14682,\n\t9252,\n\t14603,\n\t8808,\n\t14519,\n\t8445,\n\t14431,\n\t8145,\n\t15209,\n\t11449,\n\t15208,\n\t11451,\n\t15202,\n\t11451,\n\t15190,\n\t11438,\n\t15163,\n\t11384,\n\t15117,\n\t11274,\n\t15055,\n\t10979,\n\t14994,\n\t10648,\n\t14932,\n\t10343,\n\t14871,\n\t9936,\n\t14803,\n\t9532,\n\t14729,\n\t9218,\n\t14645,\n\t8742,\n\t14556,\n\t8381,\n\t14461,\n\t8020,\n\t14365,\n\t7603,\n\t15273,\n\t10603,\n\t15272,\n\t10607,\n\t15267,\n\t10619,\n\t15256,\n\t10631,\n\t15231,\n\t10614,\n\t15182,\n\t10535,\n\t15118,\n\t10389,\n\t15042,\n\t10167,\n\t14963,\n\t9787,\n\t14883,\n\t9447,\n\t14800,\n\t9115,\n\t14710,\n\t8665,\n\t14615,\n\t8318,\n\t14514,\n\t7911,\n\t14411,\n\t7507,\n\t14279,\n\t7198,\n\t15314,\n\t9675,\n\t15313,\n\t9683,\n\t15309,\n\t9712,\n\t15298,\n\t9759,\n\t15277,\n\t9797,\n\t15229,\n\t9773,\n\t15166,\n\t9668,\n\t15084,\n\t9487,\n\t14995,\n\t9274,\n\t14898,\n\t8910,\n\t14800,\n\t8539,\n\t14697,\n\t8234,\n\t14590,\n\t7790,\n\t14479,\n\t7409,\n\t14367,\n\t7067,\n\t14178,\n\t6621,\n\t15337,\n\t8619,\n\t15337,\n\t8631,\n\t15333,\n\t8677,\n\t15325,\n\t8769,\n\t15305,\n\t8871,\n\t15264,\n\t8940,\n\t15202,\n\t8909,\n\t15119,\n\t8775,\n\t15022,\n\t8565,\n\t14916,\n\t8328,\n\t14804,\n\t8009,\n\t14688,\n\t7614,\n\t14569,\n\t7287,\n\t14448,\n\t6888,\n\t14321,\n\t6483,\n\t14088,\n\t6171,\n\t15350,\n\t7402,\n\t15350,\n\t7419,\n\t15347,\n\t7480,\n\t15340,\n\t7613,\n\t15322,\n\t7804,\n\t15287,\n\t7973,\n\t15229,\n\t8057,\n\t15148,\n\t8012,\n\t15046,\n\t7846,\n\t14933,\n\t7611,\n\t14810,\n\t7357,\n\t14682,\n\t7069,\n\t14552,\n\t6656,\n\t14421,\n\t6316,\n\t14251,\n\t5948,\n\t14007,\n\t5528,\n\t15356,\n\t5942,\n\t15356,\n\t5977,\n\t15353,\n\t6119,\n\t15348,\n\t6294,\n\t15332,\n\t6551,\n\t15302,\n\t6824,\n\t15249,\n\t7044,\n\t15171,\n\t7122,\n\t15070,\n\t7050,\n\t14949,\n\t6861,\n\t14818,\n\t6611,\n\t14679,\n\t6349,\n\t14538,\n\t6067,\n\t14398,\n\t5651,\n\t14189,\n\t5311,\n\t13935,\n\t4958,\n\t15359,\n\t4123,\n\t15359,\n\t4153,\n\t15356,\n\t4296,\n\t15353,\n\t4646,\n\t15338,\n\t5160,\n\t15311,\n\t5508,\n\t15263,\n\t5829,\n\t15188,\n\t6042,\n\t15088,\n\t6094,\n\t14966,\n\t6001,\n\t14826,\n\t5796,\n\t14678,\n\t5543,\n\t14527,\n\t5287,\n\t14377,\n\t4985,\n\t14133,\n\t4586,\n\t13869,\n\t4257,\n\t15360,\n\t1563,\n\t15360,\n\t1642,\n\t15358,\n\t2076,\n\t15354,\n\t2636,\n\t15341,\n\t3350,\n\t15317,\n\t4019,\n\t15273,\n\t4429,\n\t15203,\n\t4732,\n\t15105,\n\t4911,\n\t14981,\n\t4932,\n\t14836,\n\t4818,\n\t14679,\n\t4621,\n\t14517,\n\t4386,\n\t14359,\n\t4156,\n\t14083,\n\t3795,\n\t13808,\n\t3437,\n\t15360,\n\t122,\n\t15360,\n\t137,\n\t15358,\n\t285,\n\t15355,\n\t636,\n\t15344,\n\t1274,\n\t15322,\n\t2177,\n\t15281,\n\t2765,\n\t15215,\n\t3223,\n\t15120,\n\t3451,\n\t14995,\n\t3569,\n\t14846,\n\t3567,\n\t14681,\n\t3466,\n\t14511,\n\t3305,\n\t14344,\n\t3121,\n\t14037,\n\t2800,\n\t13753,\n\t2467,\n\t15360,\n\t0,\n\t15360,\n\t1,\n\t15359,\n\t21,\n\t15355,\n\t89,\n\t15346,\n\t253,\n\t15325,\n\t479,\n\t15287,\n\t796,\n\t15225,\n\t1148,\n\t15133,\n\t1492,\n\t15008,\n\t1749,\n\t14856,\n\t1882,\n\t14685,\n\t1886,\n\t14506,\n\t1783,\n\t14324,\n\t1608,\n\t13996,\n\t1398,\n\t13702,\n\t1183\n]), bl = null;\nfunction xl() {\n\treturn bl === null && (bl = new zi(yl, 16, 16, Ee, me), bl.name = \"DFG_LUT\", bl.minFilter = R, bl.magFilter = R, bl.wrapS = te, bl.wrapT = te, bl.generateMipmaps = !1, bl.needsUpdate = !0), bl;\n}\nvar Sl = class {\n\tconstructor(e = {}) {\n\t\tlet { canvas: t = Ot(), context: n = null, depth: r = !0, stencil: i = !1, alpha: a = !1, antialias: o = !1, premultipliedAlpha: s = !0, preserveDrawingBuffer: c = !1, powerPreference: l = \"default\", failIfMajorPerformanceCaveat: u = !1, reversedDepthBuffer: d = !1, outputBufferType: f = se } = e;\n\t\tthis.isWebGLRenderer = !0;\n\t\tlet p;\n\t\tif (n !== null) {\n\t\t\tif (typeof WebGLRenderingContext < \"u\" && n instanceof WebGLRenderingContext) throw Error(\"THREE.WebGLRenderer: WebGL 1 is not supported since r163.\");\n\t\t\tp = n.getContextAttributes().alpha;\n\t\t} else p = a;\n\t\tlet m = f, h = /* @__PURE__ */ new Set([\n\t\t\tOe,\n\t\t\tDe,\n\t\t\tTe\n\t\t]), g = /* @__PURE__ */ new Set([\n\t\t\tse,\n\t\t\tfe,\n\t\t\tue,\n\t\t\t_e,\n\t\t\the,\n\t\t\tge\n\t\t]), _ = /* @__PURE__ */ new Uint32Array(4), v = /* @__PURE__ */ new Int32Array(4), y = new K(), b = null, x = null, S = [], C = [], w = null;\n\t\tthis.domElement = t, this.debug = {\n\t\t\tcheckShaderErrors: !0,\n\t\t\tonShaderError: null\n\t\t}, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;\n\t\tlet T = this, E = !1, D = null;\n\t\tthis._outputColorSpace = _t;\n\t\tlet O = 0, k = 0, A = null, j = -1, M = null, N = new Dn(), P = new Dn(), F = null, I = new fr(0), ee = 0, te = t.width, ne = t.height, L = 1, re = null, ie = null, R = new Dn(0, 0, te, ne), ae = new Dn(0, 0, te, ne), ce = !1, le = new Ji(), de = !1, pe = !1, ve = new J(), ye = new K(), be = new Dn(), xe = {\n\t\t\tbackground: null,\n\t\t\tfog: null,\n\t\t\tenvironment: null,\n\t\t\toverrideMaterial: null,\n\t\t\tisScene: !0\n\t\t}, Se = !1;\n\t\tfunction Ce() {\n\t\t\treturn A === null ? L : 1;\n\t\t}\n\t\tlet z = n;\n\t\tfunction we(e, n) {\n\t\t\treturn t.getContext(e, n);\n\t\t}\n\t\ttry {\n\t\t\tlet e = {\n\t\t\t\talpha: !0,\n\t\t\t\tdepth: r,\n\t\t\t\tstencil: i,\n\t\t\t\tantialias: o,\n\t\t\t\tpremultipliedAlpha: s,\n\t\t\t\tpreserveDrawingBuffer: c,\n\t\t\t\tpowerPreference: l,\n\t\t\t\tfailIfMajorPerformanceCaveat: u\n\t\t\t};\n\t\t\tif (\"setAttribute\" in t && t.setAttribute(\"data-engine\", \"three.js r184\"), t.addEventListener(\"webglcontextlost\", Ze, !1), t.addEventListener(\"webglcontextrestored\", Qe, !1), t.addEventListener(\"webglcontextcreationerror\", $e, !1), z === null) {\n\t\t\t\tlet t = \"webgl2\";\n\t\t\t\tif (z = we(t, e), z === null) throw we(t) ? Error(\"Error creating WebGL context with your selected attributes.\") : Error(\"Error creating WebGL context.\");\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow U(\"WebGLRenderer: \" + e.message), e;\n\t\t}\n\t\tlet Ee, ke, B, Ae, V, je, Me, Ne, Pe, Fe, Ie, Le, Re, ze, Be, Ve, He, Ue, We, Ge, Ke, qe, Je;\n\t\tfunction Ye() {\n\t\t\tEe = new Bo(z), Ee.init(), Ke = new ul(z, Ee), ke = new go(z, Ee, e, Ke), B = new cl(z, Ee), ke.reversedDepthBuffer && d && B.buffers.depth.setReversed(!0), Ae = new Uo(z), V = new Hc(), je = new ll(z, Ee, B, V, ke, Ke, Ae), Me = new zo(T), Ne = new so(z), qe = new mo(z, Ne), Pe = new Vo(z, Ne, Ae, qe), Fe = new Go(z, Pe, Ne, qe, Ae), Ue = new Wo(z, ke, je), Be = new _o(V), Ie = new Vc(T, Me, Ee, ke, qe, Be), Le = new _l(T, V), Re = new Kc(), ze = new $c(Ee), He = new po(T, Me, B, Fe, p, s), Ve = new sl(T, Fe, ke), Je = new vl(z, Ae, ke, B), We = new ho(z, Ee, Ae), Ge = new Ho(z, Ee, Ae), Ae.programs = Ie.programs, T.capabilities = ke, T.extensions = Ee, T.properties = V, T.renderLists = Re, T.shadowMap = Ve, T.state = B, T.info = Ae;\n\t\t}\n\t\tYe(), m !== 1009 && (w = new qo(m, t.width, t.height, r, i));\n\t\tlet Xe = new ml(T, z);\n\t\tthis.xr = Xe, this.getContext = function() {\n\t\t\treturn z;\n\t\t}, this.getContextAttributes = function() {\n\t\t\treturn z.getContextAttributes();\n\t\t}, this.forceContextLoss = function() {\n\t\t\tlet e = Ee.get(\"WEBGL_lose_context\");\n\t\t\te && e.loseContext();\n\t\t}, this.forceContextRestore = function() {\n\t\t\tlet e = Ee.get(\"WEBGL_lose_context\");\n\t\t\te && e.restoreContext();\n\t\t}, this.getPixelRatio = function() {\n\t\t\treturn L;\n\t\t}, this.setPixelRatio = function(e) {\n\t\t\te !== void 0 && (L = e, this.setSize(te, ne, !1));\n\t\t}, this.getSize = function(e) {\n\t\t\treturn e.set(te, ne);\n\t\t}, this.setSize = function(e, n, r = !0) {\n\t\t\tif (Xe.isPresenting) {\n\t\t\t\tH(\"WebGLRenderer: Can't change size while VR device is presenting.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tte = e, ne = n, t.width = Math.floor(e * L), t.height = Math.floor(n * L), r === !0 && (t.style.width = e + \"px\", t.style.height = n + \"px\"), w !== null && w.setSize(t.width, t.height), this.setViewport(0, 0, e, n);\n\t\t}, this.getDrawingBufferSize = function(e) {\n\t\t\treturn e.set(te * L, ne * L).floor();\n\t\t}, this.setDrawingBufferSize = function(e, n, r) {\n\t\t\tte = e, ne = n, L = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);\n\t\t}, this.setEffects = function(e) {\n\t\t\tif (m === 1009) {\n\t\t\t\tU(\"THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (e) {\n\t\t\t\tfor (let t = 0; t < e.length; t++) if (e[t].isOutputPass === !0) {\n\t\t\t\t\tH(\"THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tw.setEffects(e || []);\n\t\t}, this.getCurrentViewport = function(e) {\n\t\t\treturn e.copy(N);\n\t\t}, this.getViewport = function(e) {\n\t\t\treturn e.copy(R);\n\t\t}, this.setViewport = function(e, t, n, r) {\n\t\t\te.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), B.viewport(N.copy(R).multiplyScalar(L).round());\n\t\t}, this.getScissor = function(e) {\n\t\t\treturn e.copy(ae);\n\t\t}, this.setScissor = function(e, t, n, r) {\n\t\t\te.isVector4 ? ae.set(e.x, e.y, e.z, e.w) : ae.set(e, t, n, r), B.scissor(P.copy(ae).multiplyScalar(L).round());\n\t\t}, this.getScissorTest = function() {\n\t\t\treturn ce;\n\t\t}, this.setScissorTest = function(e) {\n\t\t\tB.setScissorTest(ce = e);\n\t\t}, this.setOpaqueSort = function(e) {\n\t\t\tre = e;\n\t\t}, this.setTransparentSort = function(e) {\n\t\t\tie = e;\n\t\t}, this.getClearColor = function(e) {\n\t\t\treturn e.copy(He.getClearColor());\n\t\t}, this.setClearColor = function() {\n\t\t\tHe.setClearColor(...arguments);\n\t\t}, this.getClearAlpha = function() {\n\t\t\treturn He.getClearAlpha();\n\t\t}, this.setClearAlpha = function() {\n\t\t\tHe.setClearAlpha(...arguments);\n\t\t}, this.clear = function(e = !0, t = !0, n = !0) {\n\t\t\tlet r = 0;\n\t\t\tif (e) {\n\t\t\t\tlet e = !1;\n\t\t\t\tif (A !== null) {\n\t\t\t\t\tlet t = A.texture.format;\n\t\t\t\t\te = h.has(t);\n\t\t\t\t}\n\t\t\t\tif (e) {\n\t\t\t\t\tlet e = A.texture.type, t = g.has(e), n = He.getClearColor(), r = He.getClearAlpha(), i = n.r, a = n.g, o = n.b;\n\t\t\t\t\tt ? (_[0] = i, _[1] = a, _[2] = o, _[3] = r, z.clearBufferuiv(z.COLOR, 0, _)) : (v[0] = i, v[1] = a, v[2] = o, v[3] = r, z.clearBufferiv(z.COLOR, 0, v));\n\t\t\t\t} else r |= z.COLOR_BUFFER_BIT;\n\t\t\t}\n\t\t\tt && (r |= z.DEPTH_BUFFER_BIT, this.state.buffers.depth.setMask(!0)), n && (r |= z.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), r !== 0 && z.clear(r);\n\t\t}, this.clearColor = function() {\n\t\t\tthis.clear(!0, !1, !1);\n\t\t}, this.clearDepth = function() {\n\t\t\tthis.clear(!1, !0, !1);\n\t\t}, this.clearStencil = function() {\n\t\t\tthis.clear(!1, !1, !0);\n\t\t}, this.setNodesHandler = function(e) {\n\t\t\te.setRenderer(this), D = e;\n\t\t}, this.dispose = function() {\n\t\t\tt.removeEventListener(\"webglcontextlost\", Ze, !1), t.removeEventListener(\"webglcontextrestored\", Qe, !1), t.removeEventListener(\"webglcontextcreationerror\", $e, !1), He.dispose(), Re.dispose(), ze.dispose(), V.dispose(), Me.dispose(), Fe.dispose(), qe.dispose(), Je.dispose(), Ie.dispose(), Xe.dispose(), Xe.removeEventListener(\"sessionstart\", ot), Xe.removeEventListener(\"sessionend\", st), ct.stop();\n\t\t};\n\t\tfunction Ze(e) {\n\t\t\te.preventDefault(), At(\"WebGLRenderer: Context Lost.\"), E = !0;\n\t\t}\n\t\tfunction Qe() {\n\t\t\tAt(\"WebGLRenderer: Context Restored.\"), E = !1;\n\t\t\tlet e = Ae.autoReset, t = Ve.enabled, n = Ve.autoUpdate, r = Ve.needsUpdate, i = Ve.type;\n\t\t\tYe(), Ae.autoReset = e, Ve.enabled = t, Ve.autoUpdate = n, Ve.needsUpdate = r, Ve.type = i;\n\t\t}\n\t\tfunction $e(e) {\n\t\t\tU(\"WebGLRenderer: A WebGL context could not be created. Reason: \", e.statusMessage);\n\t\t}\n\t\tfunction et(e) {\n\t\t\tlet t = e.target;\n\t\t\tt.removeEventListener(\"dispose\", et), tt(t);\n\t\t}\n\t\tfunction tt(e) {\n\t\t\tnt(e), V.remove(e);\n\t\t}\n\t\tfunction nt(e) {\n\t\t\tlet t = V.get(e).programs;\n\t\t\tt !== void 0 && (t.forEach(function(e) {\n\t\t\t\tIe.releaseProgram(e);\n\t\t\t}), e.isShaderMaterial && Ie.releaseShaderCache(e));\n\t\t}\n\t\tthis.renderBufferDirect = function(e, t, n, r, i, a) {\n\t\t\tt === null && (t = xe);\n\t\t\tlet o = i.isMesh && i.matrixWorld.determinant() < 0, s = yt(e, t, n, r, i);\n\t\t\tB.setMaterial(r, o);\n\t\t\tlet c = n.index, l = 1;\n\t\t\tif (r.wireframe === !0) {\n\t\t\t\tif (c = Pe.getWireframeAttribute(n), c === void 0) return;\n\t\t\t\tl = 2;\n\t\t\t}\n\t\t\tlet u = n.drawRange, d = n.attributes.position, f = u.start * l, p = (u.start + u.count) * l;\n\t\t\ta !== null && (f = Math.max(f, a.start * l), p = Math.min(p, (a.start + a.count) * l)), c === null ? d != null && (f = Math.max(f, 0), p = Math.min(p, d.count)) : (f = Math.max(f, 0), p = Math.min(p, c.count));\n\t\t\tlet m = p - f;\n\t\t\tif (m < 0 || m === Infinity) return;\n\t\t\tqe.setup(i, r, s, n, c);\n\t\t\tlet h, g = We;\n\t\t\tif (c !== null && (h = Ne.get(c), g = Ge, g.setIndex(h)), i.isMesh) r.wireframe === !0 ? (B.setLineWidth(r.wireframeLinewidth * Ce()), g.setMode(z.LINES)) : g.setMode(z.TRIANGLES);\n\t\t\telse if (i.isLine) {\n\t\t\t\tlet e = r.linewidth;\n\t\t\t\te === void 0 && (e = 1), B.setLineWidth(e * Ce()), i.isLineSegments ? g.setMode(z.LINES) : i.isLineLoop ? g.setMode(z.LINE_LOOP) : g.setMode(z.LINE_STRIP);\n\t\t\t} else i.isPoints ? g.setMode(z.POINTS) : i.isSprite && g.setMode(z.TRIANGLES);\n\t\t\tif (i.isBatchedMesh) {\n\t\t\t\tif (Ee.get(\"WEBGL_multi_draw\")) g.renderMultiDraw(i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount);\n\t\t\t\telse {\n\t\t\t\t\tlet e = i._multiDrawStarts, t = i._multiDrawCounts, n = i._multiDrawCount, a = c ? Ne.get(c).bytesPerElement : 1, o = V.get(r).currentProgram.getUniforms();\n\t\t\t\t\tfor (let r = 0; r < n; r++) o.setValue(z, \"_gl_DrawID\", r), g.render(e[r] / a, t[r]);\n\t\t\t\t}\n\t\t\t} else if (i.isInstancedMesh) g.renderInstances(f, m, i.count);\n\t\t\telse if (n.isInstancedBufferGeometry) {\n\t\t\t\tlet e = n._maxInstanceCount === void 0 ? Infinity : n._maxInstanceCount, t = Math.min(n.instanceCount, e);\n\t\t\t\tg.renderInstances(f, m, t);\n\t\t\t} else g.render(f, m);\n\t\t};\n\t\tfunction rt(e, t, n) {\n\t\t\te.transparent === !0 && e.side === 2 && e.forceSinglePass === !1 ? (e.side = 1, e.needsUpdate = !0, mt(e, t, n), e.side = 0, e.needsUpdate = !0, mt(e, t, n), e.side = 2) : mt(e, t, n);\n\t\t}\n\t\tthis.compile = function(e, t, n = null) {\n\t\t\tn === null && (n = e), x = ze.get(n), x.init(t), C.push(x), n.traverseVisible(function(e) {\n\t\t\t\te.isLight && e.layers.test(t.layers) && (x.pushLight(e), e.castShadow && x.pushShadow(e));\n\t\t\t}), e !== n && e.traverseVisible(function(e) {\n\t\t\t\te.isLight && e.layers.test(t.layers) && (x.pushLight(e), e.castShadow && x.pushShadow(e));\n\t\t\t}), x.setupLights();\n\t\t\tlet r = /* @__PURE__ */ new Set();\n\t\t\treturn e.traverse(function(e) {\n\t\t\t\tif (!(e.isMesh || e.isPoints || e.isLine || e.isSprite)) return;\n\t\t\t\tlet t = e.material;\n\t\t\t\tif (t) {\n\t\t\t\t\tif (Array.isArray(t)) for (let i = 0; i < t.length; i++) {\n\t\t\t\t\t\tlet a = t[i];\n\t\t\t\t\t\trt(a, n, e), r.add(a);\n\t\t\t\t\t}\n\t\t\t\t\telse rt(t, n, e), r.add(t);\n\t\t\t\t}\n\t\t\t}), x = C.pop(), r;\n\t\t}, this.compileAsync = function(e, t, n = null) {\n\t\t\tlet r = this.compile(e, t, n);\n\t\t\treturn new Promise((t) => {\n\t\t\t\tfunction n() {\n\t\t\t\t\tif (r.forEach(function(e) {\n\t\t\t\t\t\tV.get(e).currentProgram.isReady() && r.delete(e);\n\t\t\t\t\t}), r.size === 0) {\n\t\t\t\t\t\tt(e);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(n, 10);\n\t\t\t\t}\n\t\t\t\tEe.get(\"KHR_parallel_shader_compile\") === null ? setTimeout(n, 10) : n();\n\t\t\t});\n\t\t};\n\t\tlet it = null;\n\t\tfunction at(e) {\n\t\t\tit && it(e);\n\t\t}\n\t\tfunction ot() {\n\t\t\tct.stop();\n\t\t}\n\t\tfunction st() {\n\t\t\tct.start();\n\t\t}\n\t\tlet ct = new oo();\n\t\tct.setAnimationLoop(at), typeof self < \"u\" && ct.setContext(self), this.setAnimationLoop = function(e) {\n\t\t\tit = e, Xe.setAnimationLoop(e), e === null ? ct.stop() : ct.start();\n\t\t}, Xe.addEventListener(\"sessionstart\", ot), Xe.addEventListener(\"sessionend\", st), this.render = function(e, t) {\n\t\t\tif (t !== void 0 && t.isCamera !== !0) {\n\t\t\t\tU(\"WebGLRenderer.render: camera is not an instance of THREE.Camera.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (E === !0) return;\n\t\t\tD !== null && D.renderStart(e, t);\n\t\t\tlet n = Xe.enabled === !0 && Xe.isPresenting === !0, r = w !== null && (A === null || n) && w.begin(T, A);\n\t\t\tif (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Xe.enabled === !0 && Xe.isPresenting === !0 && (w === null || w.isCompositing() === !1) && (Xe.cameraAutoUpdate === !0 && Xe.updateCamera(t), t = Xe.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, A), x = ze.get(e, C.length), x.init(t), x.state.textureUnits = je.getTextureUnits(), C.push(x), ve.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), le.setFromProjectionMatrix(ve, wt, t.reversedDepth), pe = this.localClippingEnabled, de = Be.init(this.clippingPlanes, pe), b = Re.get(e, S.length), b.init(), S.push(b), Xe.enabled === !0 && Xe.isPresenting === !0) {\n\t\t\t\tlet e = T.xr.getDepthSensingMesh();\n\t\t\t\te !== null && lt(e, t, -Infinity, T.sortObjects);\n\t\t\t}\n\t\t\tlt(e, t, 0, T.sortObjects), b.finish(), T.sortObjects === !0 && b.sort(re, ie), Se = Xe.enabled === !1 || Xe.isPresenting === !1 || Xe.hasDepthSensing() === !1, Se && He.addToRenderList(b, e), this.info.render.frame++, de === !0 && Be.beginShadows();\n\t\t\tlet i = x.state.shadowsArray;\n\t\t\tif (Ve.render(i, e, t), de === !0 && Be.endShadows(), this.info.autoReset === !0 && this.info.reset(), (r && w.hasRenderPass()) === !1) {\n\t\t\t\tlet n = b.opaque, r = b.transmissive;\n\t\t\t\tif (x.setupLights(), t.isArrayCamera) {\n\t\t\t\t\tlet i = t.cameras;\n\t\t\t\t\tif (r.length > 0) for (let t = 0, a = i.length; t < a; t++) {\n\t\t\t\t\t\tlet a = i[t];\n\t\t\t\t\t\tdt(n, r, e, a);\n\t\t\t\t\t}\n\t\t\t\t\tSe && He.render(e);\n\t\t\t\t\tfor (let t = 0, n = i.length; t < n; t++) {\n\t\t\t\t\t\tlet n = i[t];\n\t\t\t\t\t\tut(b, e, n, n.viewport);\n\t\t\t\t\t}\n\t\t\t\t} else r.length > 0 && dt(n, r, e, t), Se && He.render(e), ut(b, e, t);\n\t\t\t}\n\t\t\tA !== null && k === 0 && (je.updateMultisampleRenderTarget(A), je.updateRenderTargetMipmap(A)), r && w.end(T), e.isScene === !0 && e.onAfterRender(T, e, t), qe.resetDefaultState(), j = -1, M = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], je.setTextureUnits(x.state.textureUnits), de === !0 && Be.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), b = S.length > 0 ? S[S.length - 1] : null, D !== null && D.renderEnd();\n\t\t};\n\t\tfunction lt(e, t, n, r) {\n\t\t\tif (e.visible === !1) return;\n\t\t\tif (e.layers.test(t.layers)) {\n\t\t\t\tif (e.isGroup) n = e.renderOrder;\n\t\t\t\telse if (e.isLOD) e.autoUpdate === !0 && e.update(t);\n\t\t\t\telse if (e.isLightProbeGrid) x.pushLightProbeGrid(e);\n\t\t\t\telse if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);\n\t\t\t\telse if (e.isSprite) {\n\t\t\t\t\tif (!e.frustumCulled || le.intersectsSprite(e)) {\n\t\t\t\t\t\tr && be.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ve);\n\t\t\t\t\t\tlet t = Fe.update(e), i = e.material;\n\t\t\t\t\t\ti.visible && b.push(e, t, i, n, be.z, null);\n\t\t\t\t\t}\n\t\t\t\t} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || le.intersectsObject(e))) {\n\t\t\t\t\tlet t = Fe.update(e), i = e.material;\n\t\t\t\t\tif (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), be.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), be.copy(e.boundingSphere.center)), be.applyMatrix4(e.matrixWorld).applyMatrix4(ve)), Array.isArray(i)) {\n\t\t\t\t\t\tlet r = t.groups;\n\t\t\t\t\t\tfor (let a = 0, o = r.length; a < o; a++) {\n\t\t\t\t\t\t\tlet o = r[a], s = i[o.materialIndex];\n\t\t\t\t\t\t\ts && s.visible && b.push(e, t, s, n, be.z, o);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else i.visible && b.push(e, t, i, n, be.z, null);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet i = e.children;\n\t\t\tfor (let e = 0, a = i.length; e < a; e++) lt(i[e], t, n, r);\n\t\t}\n\t\tfunction ut(e, t, n, r) {\n\t\t\tlet { opaque: i, transmissive: a, transparent: o } = e;\n\t\t\tx.setupLightsView(n), de === !0 && Be.setGlobalState(T.clippingPlanes, n), r && B.viewport(N.copy(r)), i.length > 0 && ft(i, t, n), a.length > 0 && ft(a, t, n), o.length > 0 && ft(o, t, n), B.buffers.depth.setTest(!0), B.buffers.depth.setMask(!0), B.buffers.color.setMask(!0), B.setPolygonOffset(!1);\n\t\t}\n\t\tfunction dt(e, t, n, r) {\n\t\t\tif ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;\n\t\t\tif (x.state.transmissionRenderTarget[r.id] === void 0) {\n\t\t\t\tlet e = Ee.has(\"EXT_color_buffer_half_float\") || Ee.has(\"EXT_color_buffer_float\");\n\t\t\t\tx.state.transmissionRenderTarget[r.id] = new kn(1, 1, {\n\t\t\t\t\tgenerateMipmaps: !0,\n\t\t\t\t\ttype: e ? me : se,\n\t\t\t\t\tminFilter: oe,\n\t\t\t\t\tsamples: Math.max(4, ke.samples),\n\t\t\t\t\tstencilBuffer: i,\n\t\t\t\t\tresolveDepthBuffer: !1,\n\t\t\t\t\tresolveStencilBuffer: !1,\n\t\t\t\t\tcolorSpace: gn.workingColorSpace\n\t\t\t\t});\n\t\t\t}\n\t\t\tlet a = x.state.transmissionRenderTarget[r.id], o = r.viewport || N;\n\t\t\ta.setSize(o.z * T.transmissionResolutionScale, o.w * T.transmissionResolutionScale);\n\t\t\tlet s = T.getRenderTarget(), c = T.getActiveCubeFace(), l = T.getActiveMipmapLevel();\n\t\t\tT.setRenderTarget(a), T.getClearColor(I), ee = T.getClearAlpha(), ee < 1 && T.setClearColor(16777215, .5), T.clear(), Se && He.render(n);\n\t\t\tlet u = T.toneMapping;\n\t\t\tT.toneMapping = 0;\n\t\t\tlet d = r.viewport;\n\t\t\tif (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), de === !0 && Be.setGlobalState(T.clippingPlanes, r), ft(e, n, r), je.updateMultisampleRenderTarget(a), je.updateRenderTargetMipmap(a), Ee.has(\"WEBGL_multisampled_render_to_texture\") === !1) {\n\t\t\t\tlet e = !1;\n\t\t\t\tfor (let i = 0, a = t.length; i < a; i++) {\n\t\t\t\t\tlet { object: a, geometry: o, material: s, group: c } = t[i];\n\t\t\t\t\tif (s.side === 2 && a.layers.test(r.layers)) {\n\t\t\t\t\t\tlet t = s.side;\n\t\t\t\t\t\ts.side = 1, s.needsUpdate = !0, pt(a, n, r, o, s, c), s.side = t, s.needsUpdate = !0, e = !0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\te === !0 && (je.updateMultisampleRenderTarget(a), je.updateRenderTargetMipmap(a));\n\t\t\t}\n\t\t\tT.setRenderTarget(s, c, l), T.setClearColor(I, ee), d !== void 0 && (r.viewport = d), T.toneMapping = u;\n\t\t}\n\t\tfunction ft(e, t, n) {\n\t\t\tlet r = t.isScene === !0 ? t.overrideMaterial : null;\n\t\t\tfor (let i = 0, a = e.length; i < a; i++) {\n\t\t\t\tlet a = e[i], { object: o, geometry: s, group: c } = a, l = a.material;\n\t\t\t\tl.allowOverride === !0 && r !== null && (l = r), o.layers.test(n.layers) && pt(o, t, n, s, l, c);\n\t\t\t}\n\t\t}\n\t\tfunction pt(e, t, n, r, i, a) {\n\t\t\te.onBeforeRender(T, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(T, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : T.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(T, t, n, r, i, a);\n\t\t}\n\t\tfunction mt(e, t, n) {\n\t\t\tt.isScene !== !0 && (t = xe);\n\t\t\tlet r = V.get(e), i = x.state.lights, a = x.state.shadowsArray, o = i.state.version, s = Ie.getParameters(e, i.state, a, t, n, x.state.lightProbeGridArray), c = Ie.getProgramCacheKey(s), l = r.programs;\n\t\t\tr.environment = e.isMeshStandardMaterial || e.isMeshLambertMaterial || e.isMeshPhongMaterial ? t.environment : null, r.fog = t.fog;\n\t\t\tlet u = e.isMeshStandardMaterial || e.isMeshLambertMaterial && !e.envMap || e.isMeshPhongMaterial && !e.envMap;\n\t\t\tr.envMap = Me.get(e.envMap || r.environment, u), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener(\"dispose\", et), l = /* @__PURE__ */ new Map(), r.programs = l);\n\t\t\tlet d = l.get(c);\n\t\t\tif (d !== void 0) {\n\t\t\t\tif (r.currentProgram === d && r.lightsStateVersion === o) return gt(e, s), d;\n\t\t\t} else s.uniforms = Ie.getUniforms(e), D !== null && e.isNodeMaterial && D.build(e, n, s), e.onBeforeCompile(s, T), d = Ie.acquireProgram(s, c), l.set(c, d), r.uniforms = s.uniforms;\n\t\t\tlet f = r.uniforms;\n\t\t\treturn (!e.isShaderMaterial && !e.isRawShaderMaterial || e.clipping === !0) && (f.clippingPlanes = Be.uniform), gt(e, s), r.needsLights = xt(e), r.lightsStateVersion = o, r.needsLights && (f.ambientLightColor.value = i.state.ambient, f.lightProbe.value = i.state.probe, f.directionalLights.value = i.state.directional, f.directionalLightShadows.value = i.state.directionalShadow, f.spotLights.value = i.state.spot, f.spotLightShadows.value = i.state.spotShadow, f.rectAreaLights.value = i.state.rectArea, f.ltc_1.value = i.state.rectAreaLTC1, f.ltc_2.value = i.state.rectAreaLTC2, f.pointLights.value = i.state.point, f.pointLightShadows.value = i.state.pointShadow, f.hemisphereLights.value = i.state.hemi, f.directionalShadowMatrix.value = i.state.directionalShadowMatrix, f.spotLightMatrix.value = i.state.spotLightMatrix, f.spotLightMap.value = i.state.spotLightMap, f.pointShadowMatrix.value = i.state.pointShadowMatrix), r.lightProbeGrid = x.state.lightProbeGridArray.length > 0, r.currentProgram = d, r.uniformsList = null, d;\n\t\t}\n\t\tfunction ht(e) {\n\t\t\tif (e.uniformsList === null) {\n\t\t\t\tlet t = e.currentProgram.getUniforms();\n\t\t\t\te.uniformsList = ec.seqWithValue(t.seq, e.uniforms);\n\t\t\t}\n\t\t\treturn e.uniformsList;\n\t\t}\n\t\tfunction gt(e, t) {\n\t\t\tlet n = V.get(e);\n\t\t\tn.outputColorSpace = t.outputColorSpace, n.batching = t.batching, n.batchingColor = t.batchingColor, n.instancing = t.instancing, n.instancingColor = t.instancingColor, n.instancingMorph = t.instancingMorph, n.skinning = t.skinning, n.morphTargets = t.morphTargets, n.morphNormals = t.morphNormals, n.morphColors = t.morphColors, n.morphTargetsCount = t.morphTargetsCount, n.numClippingPlanes = t.numClippingPlanes, n.numIntersection = t.numClipIntersection, n.vertexAlphas = t.vertexAlphas, n.vertexTangents = t.vertexTangents, n.toneMapping = t.toneMapping;\n\t\t}\n\t\tfunction vt(e, t) {\n\t\t\tif (e.length === 0) return null;\n\t\t\tif (e.length === 1) return e[0].texture === null ? null : e[0];\n\t\t\ty.setFromMatrixPosition(t.matrixWorld);\n\t\t\tfor (let t = 0, n = e.length; t < n; t++) {\n\t\t\t\tlet n = e[t];\n\t\t\t\tif (n.texture !== null && n.boundingBox.containsPoint(y)) return n;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tfunction yt(e, t, n, r, i) {\n\t\t\tt.isScene !== !0 && (t = xe), je.resetTextureUnits();\n\t\t\tlet a = t.fog, o = r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial ? t.environment : null, s = A === null ? T.outputColorSpace : A.isXRRenderTarget === !0 ? A.texture.colorSpace : gn.workingColorSpace, c = r.isMeshStandardMaterial || r.isMeshLambertMaterial && !r.envMap || r.isMeshPhongMaterial && !r.envMap, l = Me.get(r.envMap || o, c), u = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, d = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), f = !!n.morphAttributes.position, p = !!n.morphAttributes.normal, m = !!n.morphAttributes.color, h = 0;\n\t\t\tr.toneMapped && (A === null || A.isXRRenderTarget === !0) && (h = T.toneMapping);\n\t\t\tlet g = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, _ = g === void 0 ? 0 : g.length, v = V.get(r), y = x.state.lights;\n\t\t\tif (de === !0 && (pe === !0 || e !== M)) {\n\t\t\t\tlet t = e === M && r.id === j;\n\t\t\t\tBe.setState(r, e, t);\n\t\t\t}\n\t\t\tlet b = !1;\n\t\t\tr.version === v.__version ? v.needsLights && v.lightsStateVersion !== y.state.version ? b = !0 : v.outputColorSpace === s ? i.isBatchedMesh && v.batching === !1 || !i.isBatchedMesh && v.batching === !0 || i.isBatchedMesh && v.batchingColor === !0 && i.colorTexture === null || i.isBatchedMesh && v.batchingColor === !1 && i.colorTexture !== null || i.isInstancedMesh && v.instancing === !1 || !i.isInstancedMesh && v.instancing === !0 || i.isSkinnedMesh && v.skinning === !1 || !i.isSkinnedMesh && v.skinning === !0 || i.isInstancedMesh && v.instancingColor === !0 && i.instanceColor === null || i.isInstancedMesh && v.instancingColor === !1 && i.instanceColor !== null || i.isInstancedMesh && v.instancingMorph === !0 && i.morphTexture === null || i.isInstancedMesh && v.instancingMorph === !1 && i.morphTexture !== null ? b = !0 : v.envMap === l ? r.fog === !0 && v.fog !== a || v.numClippingPlanes !== void 0 && (v.numClippingPlanes !== Be.numPlanes || v.numIntersection !== Be.numIntersection) ? b = !0 : v.vertexAlphas === u && v.vertexTangents === d && v.morphTargets === f && v.morphNormals === p && v.morphColors === m && v.toneMapping === h && v.morphTargetsCount === _ ? !!v.lightProbeGrid != x.state.lightProbeGridArray.length > 0 && (b = !0) : b = !0 : b = !0 : b = !0 : (b = !0, v.__version = r.version);\n\t\t\tlet S = v.currentProgram;\n\t\t\tb === !0 && (S = mt(r, t, i), D && r.isNodeMaterial && D.onUpdateProgram(r, S, v));\n\t\t\tlet C = !1, w = !1, E = !1, O = S.getUniforms(), k = v.uniforms;\n\t\t\tif (B.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== j && (j = r.id, w = !0), v.needsLights) {\n\t\t\t\tlet e = vt(x.state.lightProbeGridArray, i);\n\t\t\t\tv.lightProbeGrid !== e && (v.lightProbeGrid = e, w = !0);\n\t\t\t}\n\t\t\tif (C || M !== e) {\n\t\t\t\tB.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), O.setValue(z, \"projectionMatrix\", e.projectionMatrix), O.setValue(z, \"viewMatrix\", e.matrixWorldInverse);\n\t\t\t\tlet t = O.map.cameraPosition;\n\t\t\t\tt !== void 0 && t.setValue(z, ye.setFromMatrixPosition(e.matrixWorld)), ke.logarithmicDepthBuffer && O.setValue(z, \"logDepthBufFC\", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && O.setValue(z, \"isOrthographic\", e.isOrthographicCamera === !0), M !== e && (M = e, w = !0, E = !0);\n\t\t\t}\n\t\t\tif (v.needsLights && (y.state.directionalShadowMap.length > 0 && O.setValue(z, \"directionalShadowMap\", y.state.directionalShadowMap, je), y.state.spotShadowMap.length > 0 && O.setValue(z, \"spotShadowMap\", y.state.spotShadowMap, je), y.state.pointShadowMap.length > 0 && O.setValue(z, \"pointShadowMap\", y.state.pointShadowMap, je)), i.isSkinnedMesh) {\n\t\t\t\tO.setOptional(z, i, \"bindMatrix\"), O.setOptional(z, i, \"bindMatrixInverse\");\n\t\t\t\tlet e = i.skeleton;\n\t\t\t\te && (e.boneTexture === null && e.computeBoneTexture(), O.setValue(z, \"boneTexture\", e.boneTexture, je));\n\t\t\t}\n\t\t\ti.isBatchedMesh && (O.setOptional(z, i, \"batchingTexture\"), O.setValue(z, \"batchingTexture\", i._matricesTexture, je), O.setOptional(z, i, \"batchingIdTexture\"), O.setValue(z, \"batchingIdTexture\", i._indirectTexture, je), O.setOptional(z, i, \"batchingColorTexture\"), i._colorsTexture !== null && O.setValue(z, \"batchingColorTexture\", i._colorsTexture, je));\n\t\t\tlet N = n.morphAttributes;\n\t\t\tif ((N.position !== void 0 || N.normal !== void 0 || N.color !== void 0) && Ue.update(i, n, S), (w || v.receiveShadow !== i.receiveShadow) && (v.receiveShadow = i.receiveShadow, O.setValue(z, \"receiveShadow\", i.receiveShadow)), (r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial) && r.envMap === null && t.environment !== null && (k.envMapIntensity.value = t.environmentIntensity), k.dfgLUT !== void 0 && (k.dfgLUT.value = xl()), w) {\n\t\t\t\tif (O.setValue(z, \"toneMappingExposure\", T.toneMappingExposure), v.needsLights && bt(k, E), a && r.fog === !0 && Le.refreshFogUniforms(k, a), Le.refreshMaterialUniforms(k, r, L, ne, x.state.transmissionRenderTarget[e.id]), v.needsLights && v.lightProbeGrid) {\n\t\t\t\t\tlet e = v.lightProbeGrid;\n\t\t\t\t\tk.probesSH.value = e.texture, k.probesMin.value.copy(e.boundingBox.min), k.probesMax.value.copy(e.boundingBox.max), k.probesResolution.value.copy(e.resolution);\n\t\t\t\t}\n\t\t\t\tec.upload(z, ht(v), k, je);\n\t\t\t}\n\t\t\tif (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (ec.upload(z, ht(v), k, je), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && O.setValue(z, \"center\", i.center), O.setValue(z, \"modelViewMatrix\", i.modelViewMatrix), O.setValue(z, \"normalMatrix\", i.normalMatrix), O.setValue(z, \"modelMatrix\", i.matrixWorld), r.uniformsGroups !== void 0) {\n\t\t\t\tlet e = r.uniformsGroups;\n\t\t\t\tfor (let t = 0, n = e.length; t < n; t++) {\n\t\t\t\t\tlet n = e[t];\n\t\t\t\t\tJe.update(n, S), Je.bind(n, S);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn S;\n\t\t}\n\t\tfunction bt(e, t) {\n\t\t\te.ambientLightColor.needsUpdate = t, e.lightProbe.needsUpdate = t, e.directionalLights.needsUpdate = t, e.directionalLightShadows.needsUpdate = t, e.pointLights.needsUpdate = t, e.pointLightShadows.needsUpdate = t, e.spotLights.needsUpdate = t, e.spotLightShadows.needsUpdate = t, e.rectAreaLights.needsUpdate = t, e.hemisphereLights.needsUpdate = t;\n\t\t}\n\t\tfunction xt(e) {\n\t\t\treturn e.isMeshLambertMaterial || e.isMeshToonMaterial || e.isMeshPhongMaterial || e.isMeshStandardMaterial || e.isShadowMaterial || e.isShaderMaterial && e.lights === !0;\n\t\t}\n\t\tthis.getActiveCubeFace = function() {\n\t\t\treturn O;\n\t\t}, this.getActiveMipmapLevel = function() {\n\t\t\treturn k;\n\t\t}, this.getRenderTarget = function() {\n\t\t\treturn A;\n\t\t}, this.setRenderTargetTextures = function(e, t, n) {\n\t\t\tlet r = V.get(e);\n\t\t\tr.__autoAllocateDepthBuffer = e.resolveDepthBuffer === !1, r.__autoAllocateDepthBuffer === !1 && (r.__useRenderToTexture = !1), V.get(e.texture).__webglTexture = t, V.get(e.depthTexture).__webglTexture = r.__autoAllocateDepthBuffer ? void 0 : n, r.__hasExternalTextures = !0;\n\t\t}, this.setRenderTargetFramebuffer = function(e, t) {\n\t\t\tlet n = V.get(e);\n\t\t\tn.__webglFramebuffer = t, n.__useDefaultFramebuffer = t === void 0;\n\t\t};\n\t\tlet St = z.createFramebuffer();\n\t\tthis.setRenderTarget = function(e, t = 0, n = 0) {\n\t\t\tA = e, O = t, k = n;\n\t\t\tlet r = null, i = !1, a = !1;\n\t\t\tif (e) {\n\t\t\t\tlet o = V.get(e);\n\t\t\t\tif (o.__useDefaultFramebuffer !== void 0) {\n\t\t\t\t\tB.bindFramebuffer(z.FRAMEBUFFER, o.__webglFramebuffer), N.copy(e.viewport), P.copy(e.scissor), F = e.scissorTest, B.viewport(N), B.scissor(P), B.setScissorTest(F), j = -1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (o.__webglFramebuffer === void 0) je.setupRenderTarget(e);\n\t\t\t\telse if (o.__hasExternalTextures) je.rebindTextures(e, V.get(e.texture).__webglTexture, V.get(e.depthTexture).__webglTexture);\n\t\t\t\telse if (e.depthBuffer) {\n\t\t\t\t\tlet t = e.depthTexture;\n\t\t\t\t\tif (o.__boundDepthTexture !== t) {\n\t\t\t\t\t\tif (t !== null && V.has(t) && (e.width !== t.image.width || e.height !== t.image.height)) throw Error(\"WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.\");\n\t\t\t\t\t\tje.setupDepthRenderbuffer(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet s = e.texture;\n\t\t\t\t(s.isData3DTexture || s.isDataArrayTexture || s.isCompressedArrayTexture) && (a = !0);\n\t\t\t\tlet c = V.get(e).__webglFramebuffer;\n\t\t\t\te.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t], i = !0) : r = e.samples > 0 && je.useMultisampledRTT(e) === !1 ? V.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c, N.copy(e.viewport), P.copy(e.scissor), F = e.scissorTest;\n\t\t\t} else N.copy(R).multiplyScalar(L).floor(), P.copy(ae).multiplyScalar(L).floor(), F = ce;\n\t\t\tif (n !== 0 && (r = St), B.bindFramebuffer(z.FRAMEBUFFER, r) && B.drawBuffers(e, r), B.viewport(N), B.scissor(P), B.setScissorTest(F), i) {\n\t\t\t\tlet r = V.get(e.texture);\n\t\t\t\tz.framebufferTexture2D(z.FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);\n\t\t\t} else if (a) {\n\t\t\t\tlet r = t;\n\t\t\t\tfor (let t = 0; t < e.textures.length; t++) {\n\t\t\t\t\tlet i = V.get(e.textures[t]);\n\t\t\t\t\tz.framebufferTextureLayer(z.FRAMEBUFFER, z.COLOR_ATTACHMENT0 + t, i.__webglTexture, n, r);\n\t\t\t\t}\n\t\t\t} else if (e !== null && n !== 0) {\n\t\t\t\tlet t = V.get(e.texture);\n\t\t\t\tz.framebufferTexture2D(z.FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_2D, t.__webglTexture, n);\n\t\t\t}\n\t\t\tj = -1;\n\t\t}, this.readRenderTargetPixels = function(e, t, n, r, i, a, o, s = 0) {\n\t\t\tif (!(e && e.isWebGLRenderTarget)) {\n\t\t\t\tU(\"WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet c = V.get(e).__webglFramebuffer;\n\t\t\tif (e.isWebGLCubeRenderTarget && o !== void 0 && (c = c[o]), c) {\n\t\t\t\tB.bindFramebuffer(z.FRAMEBUFFER, c);\n\t\t\t\ttry {\n\t\t\t\t\tlet o = e.textures[s], c = o.format, l = o.type;\n\t\t\t\t\tif (e.textures.length > 1 && z.readBuffer(z.COLOR_ATTACHMENT0 + s), !ke.textureFormatReadable(c)) {\n\t\t\t\t\t\tU(\"WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!ke.textureTypeReadable(l)) {\n\t\t\t\t\t\tU(\"WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tt >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i && z.readPixels(t, n, r, i, Ke.convert(c), Ke.convert(l), a);\n\t\t\t\t} finally {\n\t\t\t\t\tlet e = A === null ? null : V.get(A).__webglFramebuffer;\n\t\t\t\t\tB.bindFramebuffer(z.FRAMEBUFFER, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}, this.readRenderTargetPixelsAsync = async function(e, t, n, r, i, a, o, s = 0) {\n\t\t\tif (!(e && e.isWebGLRenderTarget)) throw Error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\");\n\t\t\tlet c = V.get(e).__webglFramebuffer;\n\t\t\tif (e.isWebGLCubeRenderTarget && o !== void 0 && (c = c[o]), c) {\n\t\t\t\tif (t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i) {\n\t\t\t\t\tB.bindFramebuffer(z.FRAMEBUFFER, c);\n\t\t\t\t\tlet o = e.textures[s], l = o.format, u = o.type;\n\t\t\t\t\tif (e.textures.length > 1 && z.readBuffer(z.COLOR_ATTACHMENT0 + s), !ke.textureFormatReadable(l)) throw Error(\"THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.\");\n\t\t\t\t\tif (!ke.textureTypeReadable(u)) throw Error(\"THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.\");\n\t\t\t\t\tlet d = z.createBuffer();\n\t\t\t\t\tz.bindBuffer(z.PIXEL_PACK_BUFFER, d), z.bufferData(z.PIXEL_PACK_BUFFER, a.byteLength, z.STREAM_READ), z.readPixels(t, n, r, i, Ke.convert(l), Ke.convert(u), 0);\n\t\t\t\t\tlet f = A === null ? null : V.get(A).__webglFramebuffer;\n\t\t\t\t\tB.bindFramebuffer(z.FRAMEBUFFER, f);\n\t\t\t\t\tlet p = z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE, 0);\n\t\t\t\t\treturn z.flush(), await Nt(z, p, 4), z.bindBuffer(z.PIXEL_PACK_BUFFER, d), z.getBufferSubData(z.PIXEL_PACK_BUFFER, 0, a), z.deleteBuffer(d), z.deleteSync(p), a;\n\t\t\t\t}\n\t\t\t\tthrow Error(\"THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.\");\n\t\t\t}\n\t\t}, this.copyFramebufferToTexture = function(e, t = null, n = 0) {\n\t\t\tlet r = 2 ** -n, i = Math.floor(e.image.width * r), a = Math.floor(e.image.height * r), o = t === null ? 0 : t.x, s = t === null ? 0 : t.y;\n\t\t\tje.setTexture2D(e, 0), z.copyTexSubImage2D(z.TEXTURE_2D, n, 0, 0, o, s, i, a), B.unbindTexture();\n\t\t};\n\t\tlet Ct = z.createFramebuffer(), Tt = z.createFramebuffer();\n\t\tthis.copyTextureToTexture = function(e, t, n = null, r = null, i = 0, a = 0) {\n\t\t\tlet o, s, c, l, u, d, f, p, m, h = e.isCompressedTexture ? e.mipmaps[a] : e.image;\n\t\t\tif (n !== null) o = n.max.x - n.min.x, s = n.max.y - n.min.y, c = n.isBox3 ? n.max.z - n.min.z : 1, l = n.min.x, u = n.min.y, d = n.isBox3 ? n.min.z : 0;\n\t\t\telse {\n\t\t\t\tlet t = 2 ** -i;\n\t\t\t\to = Math.floor(h.width * t), s = Math.floor(h.height * t), c = e.isDataArrayTexture ? h.depth : e.isData3DTexture ? Math.floor(h.depth * t) : 1, l = 0, u = 0, d = 0;\n\t\t\t}\n\t\t\tr === null ? (f = 0, p = 0, m = 0) : (f = r.x, p = r.y, m = r.z);\n\t\t\tlet g = Ke.convert(t.format), _ = Ke.convert(t.type), v;\n\t\t\tt.isData3DTexture ? (je.setTexture3D(t, 0), v = z.TEXTURE_3D) : t.isDataArrayTexture || t.isCompressedArrayTexture ? (je.setTexture2DArray(t, 0), v = z.TEXTURE_2D_ARRAY) : (je.setTexture2D(t, 0), v = z.TEXTURE_2D), B.activeTexture(z.TEXTURE0), B.pixelStorei(z.UNPACK_FLIP_Y_WEBGL, t.flipY), B.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), B.pixelStorei(z.UNPACK_ALIGNMENT, t.unpackAlignment);\n\t\t\tlet y = B.getParameter(z.UNPACK_ROW_LENGTH), b = B.getParameter(z.UNPACK_IMAGE_HEIGHT), x = B.getParameter(z.UNPACK_SKIP_PIXELS), S = B.getParameter(z.UNPACK_SKIP_ROWS), C = B.getParameter(z.UNPACK_SKIP_IMAGES);\n\t\t\tB.pixelStorei(z.UNPACK_ROW_LENGTH, h.width), B.pixelStorei(z.UNPACK_IMAGE_HEIGHT, h.height), B.pixelStorei(z.UNPACK_SKIP_PIXELS, l), B.pixelStorei(z.UNPACK_SKIP_ROWS, u), B.pixelStorei(z.UNPACK_SKIP_IMAGES, d);\n\t\t\tlet w = e.isDataArrayTexture || e.isData3DTexture, T = t.isDataArrayTexture || t.isData3DTexture;\n\t\t\tif (e.isDepthTexture) {\n\t\t\t\tlet n = V.get(e), r = V.get(t), h = V.get(n.__renderTarget), g = V.get(r.__renderTarget);\n\t\t\t\tB.bindFramebuffer(z.READ_FRAMEBUFFER, h.__webglFramebuffer), B.bindFramebuffer(z.DRAW_FRAMEBUFFER, g.__webglFramebuffer);\n\t\t\t\tfor (let n = 0; n < c; n++) w && (z.framebufferTextureLayer(z.READ_FRAMEBUFFER, z.COLOR_ATTACHMENT0, V.get(e).__webglTexture, i, d + n), z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER, z.COLOR_ATTACHMENT0, V.get(t).__webglTexture, a, m + n)), z.blitFramebuffer(l, u, o, s, f, p, o, s, z.DEPTH_BUFFER_BIT, z.NEAREST);\n\t\t\t\tB.bindFramebuffer(z.READ_FRAMEBUFFER, null), B.bindFramebuffer(z.DRAW_FRAMEBUFFER, null);\n\t\t\t} else if (i !== 0 || e.isRenderTargetTexture || V.has(e)) {\n\t\t\t\tlet n = V.get(e), r = V.get(t);\n\t\t\t\tB.bindFramebuffer(z.READ_FRAMEBUFFER, Ct), B.bindFramebuffer(z.DRAW_FRAMEBUFFER, Tt);\n\t\t\t\tfor (let e = 0; e < c; e++) w ? z.framebufferTextureLayer(z.READ_FRAMEBUFFER, z.COLOR_ATTACHMENT0, n.__webglTexture, i, d + e) : z.framebufferTexture2D(z.READ_FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_2D, n.__webglTexture, i), T ? z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER, z.COLOR_ATTACHMENT0, r.__webglTexture, a, m + e) : z.framebufferTexture2D(z.DRAW_FRAMEBUFFER, z.COLOR_ATTACHMENT0, z.TEXTURE_2D, r.__webglTexture, a), i === 0 ? T ? z.copyTexSubImage3D(v, a, f, p, m + e, l, u, o, s) : z.copyTexSubImage2D(v, a, f, p, l, u, o, s) : z.blitFramebuffer(l, u, o, s, f, p, o, s, z.COLOR_BUFFER_BIT, z.NEAREST);\n\t\t\t\tB.bindFramebuffer(z.READ_FRAMEBUFFER, null), B.bindFramebuffer(z.DRAW_FRAMEBUFFER, null);\n\t\t\t} else T ? e.isDataTexture || e.isData3DTexture ? z.texSubImage3D(v, a, f, p, m, o, s, c, g, _, h.data) : t.isCompressedArrayTexture ? z.compressedTexSubImage3D(v, a, f, p, m, o, s, c, g, h.data) : z.texSubImage3D(v, a, f, p, m, o, s, c, g, _, h) : e.isDataTexture ? z.texSubImage2D(z.TEXTURE_2D, a, f, p, o, s, g, _, h.data) : e.isCompressedTexture ? z.compressedTexSubImage2D(z.TEXTURE_2D, a, f, p, h.width, h.height, g, h.data) : z.texSubImage2D(z.TEXTURE_2D, a, f, p, o, s, g, _, h);\n\t\t\tB.pixelStorei(z.UNPACK_ROW_LENGTH, y), B.pixelStorei(z.UNPACK_IMAGE_HEIGHT, b), B.pixelStorei(z.UNPACK_SKIP_PIXELS, x), B.pixelStorei(z.UNPACK_SKIP_ROWS, S), B.pixelStorei(z.UNPACK_SKIP_IMAGES, C), a === 0 && t.generateMipmaps && z.generateMipmap(v), B.unbindTexture();\n\t\t}, this.initRenderTarget = function(e) {\n\t\t\tV.get(e).__webglFramebuffer === void 0 && je.setupRenderTarget(e);\n\t\t}, this.initTexture = function(e) {\n\t\t\te.isCubeTexture ? je.setTextureCube(e, 0) : e.isData3DTexture ? je.setTexture3D(e, 0) : e.isDataArrayTexture || e.isCompressedArrayTexture ? je.setTexture2DArray(e, 0) : je.setTexture2D(e, 0), B.unbindTexture();\n\t\t}, this.resetState = function() {\n\t\t\tO = 0, k = 0, A = null, B.reset(), qe.reset();\n\t\t}, typeof __THREE_DEVTOOLS__ < \"u\" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n\t}\n\tget coordinateSystem() {\n\t\treturn wt;\n\t}\n\tget outputColorSpace() {\n\t\treturn this._outputColorSpace;\n\t}\n\tset outputColorSpace(e) {\n\t\tthis._outputColorSpace = e;\n\t\tlet t = this.getContext();\n\t\tt.drawingBufferColorSpace = gn._getDrawingBufferColorSpace(e), t.unpackColorSpace = gn._getUnpackColorSpace();\n\t}\n}, Cl = { type: \"change\" }, wl = { type: \"start\" }, Tl = { type: \"end\" }, El = new Ci(), Dl = new Wi(), Ol = Math.cos(70 * cn.DEG2RAD), kl = new K(), Al = 2 * Math.PI, jl = {\n\tNONE: -1,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2,\n\tTOUCH_ROTATE: 3,\n\tTOUCH_PAN: 4,\n\tTOUCH_DOLLY_PAN: 5,\n\tTOUCH_DOLLY_ROTATE: 6\n}, Ml = 1e-6, Nl = class extends ro {\n\tconstructor(e, t = null) {\n\t\tsuper(e, t), this.state = jl.NONE, this.target = new K(), this.cursor = new K(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minTargetRadius = 0, this.maxTargetRadius = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, 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 = {\n\t\t\tLEFT: \"ArrowLeft\",\n\t\t\tUP: \"ArrowUp\",\n\t\t\tRIGHT: \"ArrowRight\",\n\t\t\tBOTTOM: \"ArrowDown\"\n\t\t}, this.mouseButtons = {\n\t\t\tLEFT: F.ROTATE,\n\t\t\tMIDDLE: F.DOLLY,\n\t\t\tRIGHT: F.PAN\n\t\t}, this.touches = {\n\t\t\tONE: I.ROTATE,\n\t\t\tTWO: I.DOLLY_PAN\n\t\t}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = \"auto\", this._domElementKeyEvents = null, this._lastPosition = new K(), this._lastQuaternion = new ln(), this._lastTargetPosition = new K(), this._quat = new ln().setFromUnitVectors(e.up, new K(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new no(), this._sphericalDelta = new no(), this._scale = 1, this._panOffset = new K(), this._rotateStart = new G(), this._rotateEnd = new G(), this._rotateDelta = new G(), this._panStart = new G(), this._panEnd = new G(), this._panDelta = new G(), this._dollyStart = new G(), this._dollyEnd = new G(), this._dollyDelta = new G(), this._dollyDirection = new K(), this._mouse = new G(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Fl.bind(this), this._onPointerDown = Pl.bind(this), this._onPointerUp = Il.bind(this), this._onContextMenu = Ul.bind(this), this._onMouseWheel = zl.bind(this), this._onKeyDown = Bl.bind(this), this._onTouchStart = Vl.bind(this), this._onTouchMove = Hl.bind(this), this._onMouseDown = Ll.bind(this), this._onMouseMove = Rl.bind(this), this._interceptControlDown = Wl.bind(this), this._interceptControlUp = Gl.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();\n\t}\n\tset cursorStyle(e) {\n\t\tthis._cursorStyle = e, e === \"grab\" ? this.domElement.style.cursor = \"grab\" : this.domElement.style.cursor = \"auto\";\n\t}\n\tget cursorStyle() {\n\t\treturn this._cursorStyle;\n\t}\n\tconnect(e) {\n\t\tsuper.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, {\n\t\t\tpassive: !0,\n\t\t\tcapture: !0\n\t\t}), this.domElement.style.touchAction = \"none\";\n\t}\n\tdisconnect() {\n\t\tthis.domElement.removeEventListener(\"pointerdown\", this._onPointerDown), this.domElement.ownerDocument.removeEventListener(\"pointermove\", this._onPointerMove), this.domElement.ownerDocument.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 = \"\";\n\t}\n\tdispose() {\n\t\tthis.disconnect();\n\t}\n\tgetPolarAngle() {\n\t\treturn this._spherical.phi;\n\t}\n\tgetAzimuthalAngle() {\n\t\treturn this._spherical.theta;\n\t}\n\tgetDistance() {\n\t\treturn this.object.position.distanceTo(this.target);\n\t}\n\tlistenToKeyEvents(e) {\n\t\te.addEventListener(\"keydown\", this._onKeyDown), this._domElementKeyEvents = e;\n\t}\n\tstopListenToKeyEvents() {\n\t\tthis._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener(\"keydown\", this._onKeyDown), this._domElementKeyEvents = null);\n\t}\n\tsaveState() {\n\t\tthis.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;\n\t}\n\treset() {\n\t\tthis.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Cl), this.update(), this.state = jl.NONE;\n\t}\n\tpan(e, t) {\n\t\tthis._pan(e, t), this.update();\n\t}\n\tdollyIn(e) {\n\t\tthis._dollyIn(e), this.update();\n\t}\n\tdollyOut(e) {\n\t\tthis._dollyOut(e), this.update();\n\t}\n\trotateLeft(e) {\n\t\tthis._rotateLeft(e), this.update();\n\t}\n\trotateUp(e) {\n\t\tthis._rotateUp(e), this.update();\n\t}\n\tupdate(e = null) {\n\t\tlet t = this.object.position;\n\t\tkl.copy(t).sub(this.target), kl.applyQuaternion(this._quat), this._spherical.setFromVector3(kl), this.autoRotate && this.state === jl.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);\n\t\tlet n = this.minAzimuthAngle, r = this.maxAzimuthAngle;\n\t\tisFinite(n) && isFinite(r) && (n < -Math.PI ? n += Al : n > Math.PI && (n -= Al), r < -Math.PI ? r += Al : r > Math.PI && (r -= Al), n <= r ? this._spherical.theta = Math.max(n, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + r) / 2 ? Math.max(n, this._spherical.theta) : Math.min(r, 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);\n\t\tlet i = !1;\n\t\tif (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera) this._spherical.radius = this._clampDistance(this._spherical.radius);\n\t\telse {\n\t\t\tlet e = this._spherical.radius;\n\t\t\tthis._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), i = e != this._spherical.radius;\n\t\t}\n\t\tif (kl.setFromSpherical(this._spherical), kl.applyQuaternion(this._quatInverse), t.copy(this.target).add(kl), 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) {\n\t\t\tlet e = null;\n\t\t\tif (this.object.isPerspectiveCamera) {\n\t\t\t\tlet t = kl.length();\n\t\t\t\te = this._clampDistance(t * this._scale);\n\t\t\t\tlet n = t - e;\n\t\t\t\tthis.object.position.addScaledVector(this._dollyDirection, n), this.object.updateMatrixWorld(), i = !!n;\n\t\t\t} else if (this.object.isOrthographicCamera) {\n\t\t\t\tlet t = new K(this._mouse.x, this._mouse.y, 0);\n\t\t\t\tt.unproject(this.object);\n\t\t\t\tlet n = this.object.zoom;\n\t\t\t\tthis.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), i = n !== this.object.zoom;\n\t\t\t\tlet r = new K(this._mouse.x, this._mouse.y, 0);\n\t\t\t\tr.unproject(this.object), this.object.position.sub(r).add(t), this.object.updateMatrixWorld(), e = kl.length();\n\t\t\t} else console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.\"), this.zoomToCursor = !1;\n\t\t\te !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).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)) < Ol ? this.object.lookAt(this.target) : (Dl.setFromNormalAndCoplanarPoint(this.object.up, this.target), El.intersectPlane(Dl, this.target))));\n\t\t} else if (this.object.isOrthographicCamera) {\n\t\t\tlet e = this.object.zoom;\n\t\t\tthis.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), e !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);\n\t\t}\n\t\treturn this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > Ml || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Ml || this._lastTargetPosition.distanceToSquared(this.target) > Ml ? (this.dispatchEvent(Cl), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;\n\t}\n\t_getAutoRotationAngle(e) {\n\t\treturn e === null ? Al / 60 / 60 * this.autoRotateSpeed : Al / 60 * this.autoRotateSpeed * e;\n\t}\n\t_getZoomScale(e) {\n\t\tlet t = Math.abs(e * .01);\n\t\treturn .95 ** (this.zoomSpeed * t);\n\t}\n\t_rotateLeft(e) {\n\t\tthis._sphericalDelta.theta -= e;\n\t}\n\t_rotateUp(e) {\n\t\tthis._sphericalDelta.phi -= e;\n\t}\n\t_panLeft(e, t) {\n\t\tkl.setFromMatrixColumn(t, 0), kl.multiplyScalar(-e), this._panOffset.add(kl);\n\t}\n\t_panUp(e, t) {\n\t\tthis.screenSpacePanning === !0 ? kl.setFromMatrixColumn(t, 1) : (kl.setFromMatrixColumn(t, 0), kl.crossVectors(this.object.up, kl)), kl.multiplyScalar(e), this._panOffset.add(kl);\n\t}\n\t_pan(e, t) {\n\t\tlet n = this.domElement;\n\t\tif (this.object.isPerspectiveCamera) {\n\t\t\tlet r = this.object.position;\n\t\t\tkl.copy(r).sub(this.target);\n\t\t\tlet i = kl.length();\n\t\t\ti *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * i / n.clientHeight, this.object.matrix), this._panUp(2 * t * i / n.clientHeight, this.object.matrix);\n\t\t} 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);\n\t}\n\t_dollyOut(e) {\n\t\tthis.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= e : (console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.\"), this.enableZoom = !1);\n\t}\n\t_dollyIn(e) {\n\t\tthis.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= e : (console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.\"), this.enableZoom = !1);\n\t}\n\t_updateZoomParameters(e, t) {\n\t\tif (!this.zoomToCursor) return;\n\t\tthis._performCursorZoom = !0;\n\t\tlet n = this.domElement.getBoundingClientRect(), r = e - n.left, i = t - n.top, a = n.width, o = n.height;\n\t\tthis._mouse.x = r / a * 2 - 1, this._mouse.y = -(i / o) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();\n\t}\n\t_clampDistance(e) {\n\t\treturn Math.max(this.minDistance, Math.min(this.maxDistance, e));\n\t}\n\t_handleMouseDownRotate(e) {\n\t\tthis._rotateStart.set(e.clientX, e.clientY);\n\t}\n\t_handleMouseDownDolly(e) {\n\t\tthis._updateZoomParameters(e.clientX, e.clientX), this._dollyStart.set(e.clientX, e.clientY);\n\t}\n\t_handleMouseDownPan(e) {\n\t\tthis._panStart.set(e.clientX, e.clientY);\n\t}\n\t_handleMouseMoveRotate(e) {\n\t\tthis._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);\n\t\tlet t = this.domElement;\n\t\tthis._rotateLeft(Al * this._rotateDelta.x / t.clientHeight), this._rotateUp(Al * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();\n\t}\n\t_handleMouseMoveDolly(e) {\n\t\tthis._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();\n\t}\n\t_handleMouseMovePan(e) {\n\t\tthis._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();\n\t}\n\t_handleMouseWheel(e) {\n\t\tthis._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();\n\t}\n\t_handleKeyDown(e) {\n\t\tlet t = !1;\n\t\tswitch (e.code) {\n\t\t\tcase this.keys.UP:\n\t\t\t\te.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(Al * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;\n\t\t\t\tbreak;\n\t\t\tcase this.keys.BOTTOM:\n\t\t\t\te.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-Al * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;\n\t\t\t\tbreak;\n\t\t\tcase this.keys.LEFT:\n\t\t\t\te.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(Al * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;\n\t\t\t\tbreak;\n\t\t\tcase this.keys.RIGHT: e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-Al * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;\n\t\t}\n\t\tt && (e.preventDefault(), this.update());\n\t}\n\t_handleTouchStartRotate(e) {\n\t\tif (this._pointers.length === 1) this._rotateStart.set(e.pageX, e.pageY);\n\t\telse {\n\t\t\tlet t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);\n\t\t\tthis._rotateStart.set(n, r);\n\t\t}\n\t}\n\t_handleTouchStartPan(e) {\n\t\tif (this._pointers.length === 1) this._panStart.set(e.pageX, e.pageY);\n\t\telse {\n\t\t\tlet t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);\n\t\t\tthis._panStart.set(n, r);\n\t\t}\n\t}\n\t_handleTouchStartDolly(e) {\n\t\tlet t = this._getSecondPointerPosition(e), n = e.pageX - t.x, r = e.pageY - t.y, i = Math.sqrt(n * n + r * r);\n\t\tthis._dollyStart.set(0, i);\n\t}\n\t_handleTouchStartDollyPan(e) {\n\t\tthis.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);\n\t}\n\t_handleTouchStartDollyRotate(e) {\n\t\tthis.enableZoom && this._handleTouchStartDolly(e), this.enableRotate && this._handleTouchStartRotate(e);\n\t}\n\t_handleTouchMoveRotate(e) {\n\t\tif (this._pointers.length == 1) this._rotateEnd.set(e.pageX, e.pageY);\n\t\telse {\n\t\t\tlet t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);\n\t\t\tthis._rotateEnd.set(n, r);\n\t\t}\n\t\tthis._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);\n\t\tlet t = this.domElement;\n\t\tthis._rotateLeft(Al * this._rotateDelta.x / t.clientHeight), this._rotateUp(Al * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);\n\t}\n\t_handleTouchMovePan(e) {\n\t\tif (this._pointers.length === 1) this._panEnd.set(e.pageX, e.pageY);\n\t\telse {\n\t\t\tlet t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);\n\t\t\tthis._panEnd.set(n, r);\n\t\t}\n\t\tthis._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);\n\t}\n\t_handleTouchMoveDolly(e) {\n\t\tlet t = this._getSecondPointerPosition(e), n = e.pageX - t.x, r = e.pageY - t.y, i = Math.sqrt(n * n + r * r);\n\t\tthis._dollyEnd.set(0, i), this._dollyDelta.set(0, (this._dollyEnd.y / this._dollyStart.y) ** +this.zoomSpeed), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);\n\t\tlet a = (e.pageX + t.x) * .5, o = (e.pageY + t.y) * .5;\n\t\tthis._updateZoomParameters(a, o);\n\t}\n\t_handleTouchMoveDollyPan(e) {\n\t\tthis.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);\n\t}\n\t_handleTouchMoveDollyRotate(e) {\n\t\tthis.enableZoom && this._handleTouchMoveDolly(e), this.enableRotate && this._handleTouchMoveRotate(e);\n\t}\n\t_addPointer(e) {\n\t\tthis._pointers.push(e.pointerId);\n\t}\n\t_removePointer(e) {\n\t\tdelete this._pointerPositions[e.pointerId];\n\t\tfor (let t = 0; t < this._pointers.length; t++) if (this._pointers[t] == e.pointerId) {\n\t\t\tthis._pointers.splice(t, 1);\n\t\t\treturn;\n\t\t}\n\t}\n\t_isTrackingPointer(e) {\n\t\tfor (let t = 0; t < this._pointers.length; t++) if (this._pointers[t] == e.pointerId) return !0;\n\t\treturn !1;\n\t}\n\t_trackPointer(e) {\n\t\tlet t = this._pointerPositions[e.pointerId];\n\t\tt === void 0 && (t = new G(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);\n\t}\n\t_getSecondPointerPosition(e) {\n\t\tlet t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];\n\t\treturn this._pointerPositions[t];\n\t}\n\t_customWheelEvent(e) {\n\t\tlet t = e.deltaMode, n = {\n\t\t\tclientX: e.clientX,\n\t\t\tclientY: e.clientY,\n\t\t\tdeltaY: e.deltaY\n\t\t};\n\t\tswitch (t) {\n\t\t\tcase 1:\n\t\t\t\tn.deltaY *= 16;\n\t\t\t\tbreak;\n\t\t\tcase 2: n.deltaY *= 100;\n\t\t}\n\t\treturn e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;\n\t}\n};\nfunction Pl(e) {\n\tthis.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(e.pointerId), this.domElement.ownerDocument.addEventListener(\"pointermove\", this._onPointerMove), this.domElement.ownerDocument.addEventListener(\"pointerup\", this._onPointerUp)), !this._isTrackingPointer(e) && (this._addPointer(e), e.pointerType === \"touch\" ? this._onTouchStart(e) : this._onMouseDown(e), this._cursorStyle === \"grab\" && (this.domElement.style.cursor = \"grabbing\")));\n}\nfunction Fl(e) {\n\tthis.enabled !== !1 && (e.pointerType === \"touch\" ? this._onTouchMove(e) : this._onMouseMove(e));\n}\nfunction Il(e) {\n\tswitch (this._removePointer(e), this._pointers.length) {\n\t\tcase 0:\n\t\t\tthis.domElement.releasePointerCapture(e.pointerId), this.domElement.ownerDocument.removeEventListener(\"pointermove\", this._onPointerMove), this.domElement.ownerDocument.removeEventListener(\"pointerup\", this._onPointerUp), this.dispatchEvent(Tl), this.state = jl.NONE, this._cursorStyle === \"grab\" && (this.domElement.style.cursor = \"grab\");\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tlet t = this._pointers[0], n = this._pointerPositions[t];\n\t\t\tthis._onTouchStart({\n\t\t\t\tpointerId: t,\n\t\t\t\tpageX: n.x,\n\t\t\t\tpageY: n.y\n\t\t\t});\n\t}\n}\nfunction Ll(e) {\n\tlet t;\n\tswitch (e.button) {\n\t\tcase 0:\n\t\t\tt = this.mouseButtons.LEFT;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tt = this.mouseButtons.MIDDLE;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tt = this.mouseButtons.RIGHT;\n\t\t\tbreak;\n\t\tdefault: t = -1;\n\t}\n\tswitch (t) {\n\t\tcase F.DOLLY:\n\t\t\tif (this.enableZoom === !1) return;\n\t\t\tthis._handleMouseDownDolly(e), this.state = jl.DOLLY;\n\t\t\tbreak;\n\t\tcase F.ROTATE:\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey) {\n\t\t\t\tif (this.enablePan === !1) return;\n\t\t\t\tthis._handleMouseDownPan(e), this.state = jl.PAN;\n\t\t\t} else {\n\t\t\t\tif (this.enableRotate === !1) return;\n\t\t\t\tthis._handleMouseDownRotate(e), this.state = jl.ROTATE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase F.PAN:\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey) {\n\t\t\t\tif (this.enableRotate === !1) return;\n\t\t\t\tthis._handleMouseDownRotate(e), this.state = jl.ROTATE;\n\t\t\t} else {\n\t\t\t\tif (this.enablePan === !1) return;\n\t\t\t\tthis._handleMouseDownPan(e), this.state = jl.PAN;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: this.state = jl.NONE;\n\t}\n\tthis.state !== jl.NONE && this.dispatchEvent(wl);\n}\nfunction Rl(e) {\n\tswitch (this.state) {\n\t\tcase jl.ROTATE:\n\t\t\tif (this.enableRotate === !1) return;\n\t\t\tthis._handleMouseMoveRotate(e);\n\t\t\tbreak;\n\t\tcase jl.DOLLY:\n\t\t\tif (this.enableZoom === !1) return;\n\t\t\tthis._handleMouseMoveDolly(e);\n\t\t\tbreak;\n\t\tcase jl.PAN:\n\t\t\tif (this.enablePan === !1) return;\n\t\t\tthis._handleMouseMovePan(e);\n\t}\n}\nfunction zl(e) {\n\tthis.enabled !== !1 && this.enableZoom !== !1 && this.state === jl.NONE && (e.preventDefault(), this.dispatchEvent(wl), this._handleMouseWheel(this._customWheelEvent(e)), this.dispatchEvent(Tl));\n}\nfunction Bl(e) {\n\tthis.enabled !== !1 && this._handleKeyDown(e);\n}\nfunction Vl(e) {\n\tswitch (this._trackPointer(e), this._pointers.length) {\n\t\tcase 1:\n\t\t\tswitch (this.touches.ONE) {\n\t\t\t\tcase I.ROTATE:\n\t\t\t\t\tif (this.enableRotate === !1) return;\n\t\t\t\t\tthis._handleTouchStartRotate(e), this.state = jl.TOUCH_ROTATE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase I.PAN:\n\t\t\t\t\tif (this.enablePan === !1) return;\n\t\t\t\t\tthis._handleTouchStartPan(e), this.state = jl.TOUCH_PAN;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: this.state = jl.NONE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tswitch (this.touches.TWO) {\n\t\t\t\tcase I.DOLLY_PAN:\n\t\t\t\t\tif (this.enableZoom === !1 && this.enablePan === !1) return;\n\t\t\t\t\tthis._handleTouchStartDollyPan(e), this.state = jl.TOUCH_DOLLY_PAN;\n\t\t\t\t\tbreak;\n\t\t\t\tcase I.DOLLY_ROTATE:\n\t\t\t\t\tif (this.enableZoom === !1 && this.enableRotate === !1) return;\n\t\t\t\t\tthis._handleTouchStartDollyRotate(e), this.state = jl.TOUCH_DOLLY_ROTATE;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: this.state = jl.NONE;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: this.state = jl.NONE;\n\t}\n\tthis.state !== jl.NONE && this.dispatchEvent(wl);\n}\nfunction Hl(e) {\n\tswitch (this._trackPointer(e), this.state) {\n\t\tcase jl.TOUCH_ROTATE:\n\t\t\tif (this.enableRotate === !1) return;\n\t\t\tthis._handleTouchMoveRotate(e), this.update();\n\t\t\tbreak;\n\t\tcase jl.TOUCH_PAN:\n\t\t\tif (this.enablePan === !1) return;\n\t\t\tthis._handleTouchMovePan(e), this.update();\n\t\t\tbreak;\n\t\tcase jl.TOUCH_DOLLY_PAN:\n\t\t\tif (this.enableZoom === !1 && this.enablePan === !1) return;\n\t\t\tthis._handleTouchMoveDollyPan(e), this.update();\n\t\t\tbreak;\n\t\tcase jl.TOUCH_DOLLY_ROTATE:\n\t\t\tif (this.enableZoom === !1 && this.enableRotate === !1) return;\n\t\t\tthis._handleTouchMoveDollyRotate(e), this.update();\n\t\t\tbreak;\n\t\tdefault: this.state = jl.NONE;\n\t}\n}\nfunction Ul(e) {\n\tthis.enabled !== !1 && e.preventDefault();\n}\nfunction Wl(e) {\n\te.key === \"Control\" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener(\"keyup\", this._interceptControlUp, {\n\t\tpassive: !0,\n\t\tcapture: !0\n\t}));\n}\nfunction Gl(e) {\n\te.key === \"Control\" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener(\"keyup\", this._interceptControlUp, {\n\t\tpassive: !0,\n\t\tcapture: !0\n\t}));\n}\n//#endregion\n//#region ../../../node_modules/.bun/@mkkellogg+gaussian-splats-3d@0.4.7+7b565cd016fb14f9/node_modules/@mkkellogg/gaussian-splats-3d/build/gaussian-splats-3d.module.js\nvar Kl = class e {\n\tstatic idGen = 0;\n\tconstructor(t, n) {\n\t\tlet r, i;\n\t\tthis.promise = new Promise((e, t) => {\n\t\t\tr = e, i = t;\n\t\t});\n\t\tlet a = r.bind(this), o = i.bind(this);\n\t\tt(((...e) => {\n\t\t\ta(...e);\n\t\t}).bind(this), ((e) => {\n\t\t\to(e);\n\t\t}).bind(this)), this.abortHandler = n, this.id = e.idGen++;\n\t}\n\tthen(t) {\n\t\treturn new e((n, r) => {\n\t\t\tthis.promise = this.promise.then((...r) => {\n\t\t\t\tlet i = t(...r);\n\t\t\t\ti instanceof Promise || i instanceof e ? i.then((...e) => {\n\t\t\t\t\tn(...e);\n\t\t\t\t}) : n(i);\n\t\t\t}).catch((e) => {\n\t\t\t\tr(e);\n\t\t\t});\n\t\t}, this.abortHandler);\n\t}\n\tcatch(t) {\n\t\treturn new e((e) => {\n\t\t\tthis.promise = this.promise.then((...t) => {\n\t\t\t\te(...t);\n\t\t\t}).catch(t);\n\t\t}, this.abortHandler);\n\t}\n\tabort(e) {\n\t\tthis.abortHandler && this.abortHandler(e);\n\t}\n}, ql = class extends Error {\n\tconstructor(e) {\n\t\tsuper(e);\n\t}\n};\n(function() {\n\tlet e = /* @__PURE__ */ new Float32Array(1), t = new Int32Array(e.buffer);\n\treturn function(n) {\n\t\te[0] = n;\n\t\tlet r = t[0], i = r >> 16 & 32768, a = r >> 12 & 2047, o = r >> 23 & 255;\n\t\treturn o < 103 ? i : o > 142 ? (i |= 31744, i |= (o == 255 ? 0 : 1) && r & 8388607, i) : o < 113 ? (a |= 2048, i |= (a >> 114 - o) + (a >> 113 - o & 1), i) : (i |= o - 112 << 10 | a >> 1, i += a & 1, i);\n\t};\n})();\nvar Jl = function() {\n\tlet e = /* @__PURE__ */ new Float32Array(1), t = new Int32Array(e.buffer);\n\treturn function(n) {\n\t\treturn e[0] = n, t[0];\n\t};\n}(), Yl = function(e, t) {\n\treturn e[t] + (e[t + 1] << 8) + (e[t + 2] << 16) + (e[t + 3] << 24);\n}, Xl = function(e, t, n = !0, r) {\n\tlet i = new AbortController(), a = i.signal, o = !1, s = (e) => {\n\t\ti.abort(e), o = !0;\n\t}, c = !1, l = (e, n, r, i) => {\n\t\tt && !c && (t(e, n, r, i), e === 100 && (c = !0));\n\t};\n\treturn new Kl((t, i) => {\n\t\tlet s = { signal: a };\n\t\tr && (s.headers = r), fetch(e, s).then(async (e) => {\n\t\t\tif (!e.ok) {\n\t\t\t\tlet t = await e.text();\n\t\t\t\ti(/* @__PURE__ */ Error(`Fetch failed: ${e.status} ${e.statusText} ${t}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet r = e.body.getReader(), a = 0, s = e.headers.get(\"Content-Length\"), c = s ? parseInt(s) : void 0, u = [];\n\t\t\tfor (; !o;) try {\n\t\t\t\tlet { value: e, done: i } = await r.read();\n\t\t\t\tif (i) {\n\t\t\t\t\tl(100, \"100%\", e, c), n ? t(new Blob(u).arrayBuffer()) : t();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ta += e.length;\n\t\t\t\tlet o, s;\n\t\t\t\tc !== void 0 && (o = a / c * 100, s = `${o.toFixed(2)}%`), n && u.push(e), l(o, s, e, c);\n\t\t\t} catch (e) {\n\t\t\t\ti(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}).catch((e) => {\n\t\t\ti(new ql(e));\n\t\t});\n\t}, s);\n}, Zl = function(e, t, n) {\n\treturn Math.max(Math.min(e, n), t);\n}, Ql = function() {\n\treturn performance.now() / 1e3;\n}, $l = (e) => {\n\tif (e.geometry &&= (e.geometry.dispose(), null), e.material &&= (e.material.dispose(), null), e.children) for (let t of e.children) $l(t);\n}, eu = (e, t) => new Promise((n) => {\n\twindow.setTimeout(() => {\n\t\tn(e ? e() : void 0);\n\t}, t ? 1 : 50);\n}), tu = (e = 0) => {\n\tlet t = 0;\n\tif (e === 1) t = 9;\n\telse if (e === 2) t = 24;\n\telse if (e === 3) t = 45;\n\telse if (e > 3) throw Error(\"getSphericalHarmonicsComponentCountForDegree() -> Invalid spherical harmonics degree\");\n\treturn t;\n}, nu = () => {\n\tlet e, t;\n\treturn {\n\t\tpromise: new Promise((n, r) => {\n\t\t\te = n, t = r;\n\t\t}),\n\t\tresolve: e,\n\t\treject: t\n\t};\n}, ru = (e) => {\n\tlet t, n;\n\treturn e ||= () => {}, {\n\t\tpromise: new Kl((e, r) => {\n\t\t\tt = e, n = r;\n\t\t}, e),\n\t\tresolve: t,\n\t\treject: n\n\t};\n}, iu = class {\n\tconstructor(e, t, n) {\n\t\tthis.major = e, this.minor = t, this.patch = n;\n\t}\n\ttoString() {\n\t\treturn `${this.major}_${this.minor}_${this.patch}`;\n\t}\n};\nfunction au() {\n\tlet e = navigator.userAgent;\n\treturn e.indexOf(\"iPhone\") > 0 || e.indexOf(\"iPad\") > 0;\n}\nfunction ou() {\n\tif (au()) {\n\t\tlet e = navigator.userAgent.match(/OS (\\d+)_(\\d+)_?(\\d+)?/);\n\t\treturn new iu(parseInt(e[1] || 0, 10), parseInt(e[2] || 0, 10), parseInt(e[3] || 0, 10));\n\t}\n\treturn null;\n}\nvar su = 14, Z = class e {\n\tstatic OFFSET = {\n\t\tX: 0,\n\t\tY: 1,\n\t\tZ: 2,\n\t\tSCALE0: 3,\n\t\tSCALE1: 4,\n\t\tSCALE2: 5,\n\t\tROTATION0: 6,\n\t\tROTATION1: 7,\n\t\tROTATION2: 8,\n\t\tROTATION3: 9,\n\t\tFDC0: 10,\n\t\tFDC1: 11,\n\t\tFDC2: 12,\n\t\tOPACITY: 13,\n\t\tFRC0: 14,\n\t\tFRC1: 15,\n\t\tFRC2: 16,\n\t\tFRC3: 17,\n\t\tFRC4: 18,\n\t\tFRC5: 19,\n\t\tFRC6: 20,\n\t\tFRC7: 21,\n\t\tFRC8: 22,\n\t\tFRC9: 23,\n\t\tFRC10: 24,\n\t\tFRC11: 25,\n\t\tFRC12: 26,\n\t\tFRC13: 27,\n\t\tFRC14: 28,\n\t\tFRC15: 29,\n\t\tFRC16: 30,\n\t\tFRC17: 31,\n\t\tFRC18: 32,\n\t\tFRC19: 33,\n\t\tFRC20: 34,\n\t\tFRC21: 35,\n\t\tFRC22: 36,\n\t\tFRC23: 37\n\t};\n\tconstructor(e = 0) {\n\t\tthis.sphericalHarmonicsDegree = e, this.sphericalHarmonicsCount = tu(this.sphericalHarmonicsDegree), this.componentCount = this.sphericalHarmonicsCount + su, this.defaultSphericalHarmonics = Array(this.sphericalHarmonicsCount).fill(0), this.splats = [], this.splatCount = 0;\n\t}\n\tstatic createSplat(e = 0) {\n\t\tlet t = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t], n = tu(e);\n\t\tfor (let e = 0; e < n; e++) t.push(0);\n\t\treturn t;\n\t}\n\taddSplat(e) {\n\t\tthis.splats.push(e), this.splatCount++;\n\t}\n\tgetSplat(e) {\n\t\treturn this.splats[e];\n\t}\n\taddDefaultSplat() {\n\t\tlet t = e.createSplat(this.sphericalHarmonicsDegree);\n\t\treturn this.addSplat(t), t;\n\t}\n\taddSplatFromComonents(e, t, n, r, i, a, o, s, c, l, u, d, f, p, ...m) {\n\t\tlet h = [\n\t\t\te,\n\t\t\tt,\n\t\t\tn,\n\t\t\tr,\n\t\t\ti,\n\t\t\ta,\n\t\t\to,\n\t\t\ts,\n\t\t\tc,\n\t\t\tl,\n\t\t\tu,\n\t\t\td,\n\t\t\tf,\n\t\t\tp,\n\t\t\t...this.defaultSphericalHarmonics\n\t\t];\n\t\tfor (let e = 0; e < m.length && e < this.sphericalHarmonicsCount; e++) h[e] = m[e];\n\t\treturn this.addSplat(h), h;\n\t}\n\taddSplatFromArray(t, n) {\n\t\tlet r = t.splats[n], i = e.createSplat(this.sphericalHarmonicsDegree);\n\t\tfor (let e = 0; e < this.componentCount && e < r.length; e++) i[e] = r[e];\n\t\tthis.addSplat(i);\n\t}\n}, cu = class {\n\tstatic DefaultSplatSortDistanceMapPrecision = 16;\n\tstatic MemoryPageSize = 65536;\n\tstatic BytesPerFloat = 4;\n\tstatic BytesPerInt = 4;\n\tstatic MaxScenes = 32;\n\tstatic ProgressiveLoadSectionSize = 262144;\n\tstatic ProgressiveLoadSectionDelayDuration = 15;\n\tstatic SphericalHarmonics8BitCompressionRange = 3;\n}, lu = cu.SphericalHarmonics8BitCompressionRange / 2, uu = Jr.toHalfFloat.bind(Jr), du = Jr.fromHalfFloat.bind(Jr), fu = (e, t, n = !1, r, i) => {\n\tif (t === 0) return e;\n\tif (t === 1 || t === 2 && !n) return Jr.fromHalfFloat(e);\n\tif (t === 2) return mu(e, r, i);\n}, pu = (e, t, n) => {\n\te = Zl(e, t, n);\n\tlet r = n - t;\n\treturn Zl(Math.floor((e - t) / r * 255), 0, 255);\n}, mu = (e, t, n) => {\n\tlet r = n - t;\n\treturn e / 255 * r + t;\n}, hu = (e, t, n) => pu(du(e, t, n)), gu = (e, t, n) => uu(mu(e, t, n)), _u = (e, t, n, r = !1) => n === 0 ? e.getFloat32(t * 4, !0) : n === 1 || n === 2 && !r ? e.getUint16(t * 2, !0) : e.getUint8(t, !0), vu = function() {\n\tlet e = (e) => e;\n\treturn function(t, n, r, i = !1) {\n\t\tif (n === r) return t;\n\t\tlet a = e;\n\t\treturn n === 2 && i ? r === 1 ? a = gu : r == 0 && (a = mu) : n === 2 || n === 1 ? r === 0 ? a = du : r == 2 && (a = i ? hu : e) : n === 0 && (r === 1 ? a = uu : r == 2 && (a = i ? pu : uu)), a(t);\n\t};\n}(), yu = (e, t, n, r, i = 0) => {\n\tlet a = new Uint8Array(e, t), o = new Uint8Array(n, r);\n\tfor (let e = 0; e < i; e++) o[e] = a[e];\n}, Q = class e {\n\tstatic CurrentMajorVersion = 0;\n\tstatic CurrentMinorVersion = 1;\n\tstatic CenterComponentCount = 3;\n\tstatic ScaleComponentCount = 3;\n\tstatic RotationComponentCount = 4;\n\tstatic ColorComponentCount = 4;\n\tstatic CovarianceComponentCount = 6;\n\tstatic SplatScaleOffsetFloat = 3;\n\tstatic SplatRotationOffsetFloat = 6;\n\tstatic CompressionLevels = {\n\t\t0: {\n\t\t\tBytesPerCenter: 12,\n\t\t\tBytesPerScale: 12,\n\t\t\tBytesPerRotation: 16,\n\t\t\tBytesPerColor: 4,\n\t\t\tScaleOffsetBytes: 12,\n\t\t\tRotationffsetBytes: 24,\n\t\t\tColorOffsetBytes: 40,\n\t\t\tSphericalHarmonicsOffsetBytes: 44,\n\t\t\tScaleRange: 1,\n\t\t\tBytesPerSphericalHarmonicsComponent: 4,\n\t\t\tSphericalHarmonicsOffsetFloat: 11,\n\t\t\tSphericalHarmonicsDegrees: {\n\t\t\t\t0: { BytesPerSplat: 44 },\n\t\t\t\t1: { BytesPerSplat: 80 },\n\t\t\t\t2: { BytesPerSplat: 140 }\n\t\t\t}\n\t\t},\n\t\t1: {\n\t\t\tBytesPerCenter: 6,\n\t\t\tBytesPerScale: 6,\n\t\t\tBytesPerRotation: 8,\n\t\t\tBytesPerColor: 4,\n\t\t\tScaleOffsetBytes: 6,\n\t\t\tRotationffsetBytes: 12,\n\t\t\tColorOffsetBytes: 20,\n\t\t\tSphericalHarmonicsOffsetBytes: 24,\n\t\t\tScaleRange: 32767,\n\t\t\tBytesPerSphericalHarmonicsComponent: 2,\n\t\t\tSphericalHarmonicsOffsetFloat: 12,\n\t\t\tSphericalHarmonicsDegrees: {\n\t\t\t\t0: { BytesPerSplat: 24 },\n\t\t\t\t1: { BytesPerSplat: 42 },\n\t\t\t\t2: { BytesPerSplat: 72 }\n\t\t\t}\n\t\t},\n\t\t2: {\n\t\t\tBytesPerCenter: 6,\n\t\t\tBytesPerScale: 6,\n\t\t\tBytesPerRotation: 8,\n\t\t\tBytesPerColor: 4,\n\t\t\tScaleOffsetBytes: 6,\n\t\t\tRotationffsetBytes: 12,\n\t\t\tColorOffsetBytes: 20,\n\t\t\tSphericalHarmonicsOffsetBytes: 24,\n\t\t\tScaleRange: 32767,\n\t\t\tBytesPerSphericalHarmonicsComponent: 1,\n\t\t\tSphericalHarmonicsOffsetFloat: 12,\n\t\t\tSphericalHarmonicsDegrees: {\n\t\t\t\t0: { BytesPerSplat: 24 },\n\t\t\t\t1: { BytesPerSplat: 33 },\n\t\t\t\t2: { BytesPerSplat: 48 }\n\t\t\t}\n\t\t}\n\t};\n\tstatic CovarianceSizeFloats = 6;\n\tstatic HeaderSizeBytes = 4096;\n\tstatic SectionHeaderSizeBytes = 1024;\n\tstatic BucketStorageSizeBytes = 12;\n\tstatic BucketStorageSizeFloats = 3;\n\tstatic BucketBlockSize = 5;\n\tstatic BucketSize = 256;\n\tconstructor(e, t = !0) {\n\t\tthis.constructFromBuffer(e, t);\n\t}\n\tgetSplatCount() {\n\t\treturn this.splatCount;\n\t}\n\tgetMaxSplatCount() {\n\t\treturn this.maxSplatCount;\n\t}\n\tgetMinSphericalHarmonicsDegree() {\n\t\tlet e = 0;\n\t\tfor (let t = 0; t < this.sections.length; t++) {\n\t\t\tlet n = this.sections[t];\n\t\t\t(t === 0 || n.sphericalHarmonicsDegree < e) && (e = n.sphericalHarmonicsDegree);\n\t\t}\n\t\treturn e;\n\t}\n\tgetBucketIndex(e, t) {\n\t\tlet n, r = e.fullBucketCount * e.bucketSize;\n\t\tif (t < r) n = Math.floor(t / e.bucketSize);\n\t\telse {\n\t\t\tlet i = r;\n\t\t\tn = e.fullBucketCount;\n\t\t\tlet a = 0;\n\t\t\tfor (; i < e.splatCount;) {\n\t\t\t\tlet r = e.partiallyFilledBucketLengths[a];\n\t\t\t\tif (t >= i && t < i + r) break;\n\t\t\t\ti += r, n++, a++;\n\t\t\t}\n\t\t}\n\t\treturn n;\n\t}\n\tgetSplatCenter(t, n, r) {\n\t\tlet i = this.globalSplatIndexToSectionMap[t], a = this.sections[i], o = t - a.splatCountOffset, s = a.bytesPerSplat * o, c = new DataView(this.bufferData, a.dataBase + s), l = _u(c, 0, this.compressionLevel), u = _u(c, 1, this.compressionLevel), d = _u(c, 2, this.compressionLevel);\n\t\tif (this.compressionLevel >= 1) {\n\t\t\tlet t = this.getBucketIndex(a, o) * e.BucketStorageSizeFloats, r = a.compressionScaleFactor, i = a.compressionScaleRange;\n\t\t\tn.x = (l - i) * r + a.bucketArray[t], n.y = (u - i) * r + a.bucketArray[t + 1], n.z = (d - i) * r + a.bucketArray[t + 2];\n\t\t} else n.x = l, n.y = u, n.z = d;\n\t\tr && n.applyMatrix4(r);\n\t}\n\tgetSplatScaleAndRotation = function() {\n\t\tlet t = new J(), n = new J(), r = new J(), i = new K(), a = new K(), o = new ln();\n\t\treturn function(s, c, l, u, d) {\n\t\t\tlet f = this.globalSplatIndexToSectionMap[s], p = this.sections[f], m = s - p.splatCountOffset, h = p.bytesPerSplat * m + e.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, g = new DataView(this.bufferData, p.dataBase + h);\n\t\t\ta.set(fu(_u(g, 0, this.compressionLevel), this.compressionLevel), fu(_u(g, 1, this.compressionLevel), this.compressionLevel), fu(_u(g, 2, this.compressionLevel), this.compressionLevel)), d && (d.x !== void 0 && (a.x = d.x), d.y !== void 0 && (a.y = d.y), d.z !== void 0 && (a.z = d.z)), o.set(fu(_u(g, 4, this.compressionLevel), this.compressionLevel), fu(_u(g, 5, this.compressionLevel), this.compressionLevel), fu(_u(g, 6, this.compressionLevel), this.compressionLevel), fu(_u(g, 3, this.compressionLevel), this.compressionLevel)), u ? (t.makeScale(a.x, a.y, a.z), n.makeRotationFromQuaternion(o), r.copy(t).multiply(n).multiply(u), r.decompose(i, l, c)) : (c.copy(a), l.copy(o));\n\t\t};\n\t}();\n\tgetSplatColor(t, n) {\n\t\tlet r = this.globalSplatIndexToSectionMap[t], i = this.sections[r], a = t - i.splatCountOffset, o = i.bytesPerSplat * a + e.CompressionLevels[this.compressionLevel].ColorOffsetBytes, s = new Uint8Array(this.bufferData, i.dataBase + o, 4);\n\t\tn.set(s[0], s[1], s[2], s[3]);\n\t}\n\tfillSplatCenterArray(t, n, r, i, a) {\n\t\tlet o = this.splatCount;\n\t\tr ||= 0, i ||= o - 1, a === void 0 && (a = r);\n\t\tlet s = new K();\n\t\tfor (let o = r; o <= i; o++) {\n\t\t\tlet i = this.globalSplatIndexToSectionMap[o], c = this.sections[i], l = o - c.splatCountOffset, u = (o - r + a) * e.CenterComponentCount, d = c.bytesPerSplat * l, f = new DataView(this.bufferData, c.dataBase + d), p = _u(f, 0, this.compressionLevel), m = _u(f, 1, this.compressionLevel), h = _u(f, 2, this.compressionLevel);\n\t\t\tif (this.compressionLevel >= 1) {\n\t\t\t\tlet t = this.getBucketIndex(c, l) * e.BucketStorageSizeFloats, n = c.compressionScaleFactor, r = c.compressionScaleRange;\n\t\t\t\ts.x = (p - r) * n + c.bucketArray[t], s.y = (m - r) * n + c.bucketArray[t + 1], s.z = (h - r) * n + c.bucketArray[t + 2];\n\t\t\t} else s.x = p, s.y = m, s.z = h;\n\t\t\tn && s.applyMatrix4(n), t[u] = s.x, t[u + 1] = s.y, t[u + 2] = s.z;\n\t\t}\n\t}\n\tfillSplatScaleRotationArray = function() {\n\t\tlet t = new J(), n = new J(), r = new J(), i = new K(), a = new ln(), o = new K(), s = (e) => {\n\t\t\tlet t = e.w < 0 ? -1 : 1;\n\t\t\te.x *= t, e.y *= t, e.z *= t, e.w *= t;\n\t\t};\n\t\treturn function(c, l, u, d, f, p, m, h) {\n\t\t\tlet g = this.splatCount;\n\t\t\td ||= 0, f ||= g - 1, p === void 0 && (p = d);\n\t\t\tlet _ = (e, t) => (t === void 0 && (t = this.compressionLevel), vu(e, t, m));\n\t\t\tfor (let m = d; m <= f; m++) {\n\t\t\t\tlet f = this.globalSplatIndexToSectionMap[m], g = this.sections[f], v = m - g.splatCountOffset, y = g.bytesPerSplat * v + e.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, b = (m - d + p) * e.ScaleComponentCount, x = (m - d + p) * e.RotationComponentCount, S = new DataView(this.bufferData, g.dataBase + y), C = h && h.x !== void 0 ? h.x : _u(S, 0, this.compressionLevel), w = h && h.y !== void 0 ? h.y : _u(S, 1, this.compressionLevel), T = h && h.z !== void 0 ? h.z : _u(S, 2, this.compressionLevel), E = _u(S, 3, this.compressionLevel), D = _u(S, 4, this.compressionLevel), O = _u(S, 5, this.compressionLevel), k = _u(S, 6, this.compressionLevel);\n\t\t\t\ti.set(fu(C, this.compressionLevel), fu(w, this.compressionLevel), fu(T, this.compressionLevel)), a.set(fu(D, this.compressionLevel), fu(O, this.compressionLevel), fu(k, this.compressionLevel), fu(E, this.compressionLevel)).normalize(), u && (o.set(0, 0, 0), t.makeScale(i.x, i.y, i.z), n.makeRotationFromQuaternion(a), r.identity().premultiply(t).premultiply(n), r.premultiply(u), r.decompose(o, a, i), a.normalize()), s(a), c && (c[b] = _(i.x, 0), c[b + 1] = _(i.y, 0), c[b + 2] = _(i.z, 0)), l && (l[x] = _(a.x, 0), l[x + 1] = _(a.y, 0), l[x + 2] = _(a.z, 0), l[x + 3] = _(a.w, 0));\n\t\t\t}\n\t\t};\n\t}();\n\tstatic computeCovariance = function() {\n\t\tlet e = new J(), t = new q(), n = new q(), r = new q(), i = new q(), a = new q(), o = new q();\n\t\treturn function(s, c, l, u, d = 0, f) {\n\t\t\te.makeScale(s.x, s.y, s.z), t.setFromMatrix4(e), e.makeRotationFromQuaternion(c), n.setFromMatrix4(e), r.copy(n).multiply(t), i.copy(r).transpose().premultiply(r), l && (a.setFromMatrix4(l), o.copy(a).transpose(), i.multiply(o), i.premultiply(a)), f >= 1 ? (u[d] = uu(i.elements[0]), u[d + 1] = uu(i.elements[3]), u[d + 2] = uu(i.elements[6]), u[d + 3] = uu(i.elements[4]), u[d + 4] = uu(i.elements[7]), u[d + 5] = uu(i.elements[8])) : (u[d] = i.elements[0], u[d + 1] = i.elements[3], u[d + 2] = i.elements[6], u[d + 3] = i.elements[4], u[d + 4] = i.elements[7], u[d + 5] = i.elements[8]);\n\t\t};\n\t}();\n\tfillSplatCovarianceArray(t, n, r, i, a, o) {\n\t\tlet s = this.splatCount, c = new K(), l = new ln();\n\t\tr ||= 0, i ||= s - 1, a === void 0 && (a = r);\n\t\tfor (let s = r; s <= i; s++) {\n\t\t\tlet i = this.globalSplatIndexToSectionMap[s], u = this.sections[i], d = s - u.splatCountOffset, f = (s - r + a) * e.CovarianceComponentCount, p = u.bytesPerSplat * d + e.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, m = new DataView(this.bufferData, u.dataBase + p);\n\t\t\tc.set(fu(_u(m, 0, this.compressionLevel), this.compressionLevel), fu(_u(m, 1, this.compressionLevel), this.compressionLevel), fu(_u(m, 2, this.compressionLevel), this.compressionLevel)), l.set(fu(_u(m, 4, this.compressionLevel), this.compressionLevel), fu(_u(m, 5, this.compressionLevel), this.compressionLevel), fu(_u(m, 6, this.compressionLevel), this.compressionLevel), fu(_u(m, 3, this.compressionLevel), this.compressionLevel)), e.computeCovariance(c, l, n, t, f, o);\n\t\t}\n\t}\n\tfillSplatColorArray(t, n, r, i, a) {\n\t\tlet o = this.splatCount;\n\t\tr ||= 0, i ||= o - 1, a === void 0 && (a = r);\n\t\tfor (let o = r; o <= i; o++) {\n\t\t\tlet i = this.globalSplatIndexToSectionMap[o], s = this.sections[i], c = o - s.splatCountOffset, l = (o - r + a) * e.ColorComponentCount, u = s.bytesPerSplat * c + e.CompressionLevels[this.compressionLevel].ColorOffsetBytes, d = new Uint8Array(this.bufferData, s.dataBase + u), f = d[3];\n\t\t\tf = f >= n ? f : 0, t[l] = d[0], t[l + 1] = d[1], t[l + 2] = d[2], t[l + 3] = f;\n\t\t}\n\t}\n\tfillSphericalHarmonicsArray = function() {\n\t\tlet t = [];\n\t\tfor (let e = 0; e < 15; e++) t[e] = new K();\n\t\tlet n = new q(), r = new J(), i = new K(), a = new K(), o = new ln(), s = [], c = [], l = [], u = [], d = [], f = [], p = [], m = [], h = [], g = [], _ = [], v = [], y = [], b = [], x = [], S = [], C = [], w = [], T = (e) => e, E = (e, t, n, r) => {\n\t\t\te[0] = t, e[1] = n, e[2] = r;\n\t\t}, D = (e, t, n, r, i) => {\n\t\t\te[0] = _u(t, r, i, !0), e[1] = _u(t, r + n, i, !0), e[2] = _u(t, r + n + n, i, !0);\n\t\t}, O = (e, t) => {\n\t\t\tt[0] = e[0], t[1] = e[1], t[2] = e[2];\n\t\t}, k = (e, t, n, r) => {\n\t\t\tt[n] = r(e[0]), t[n + 1] = r(e[1]), t[n + 2] = r(e[2]);\n\t\t}, A = (e, t, n, r, i) => (t[0] = fu(e[0], n, !0, r, i), t[1] = fu(e[1], n, !0, r, i), t[2] = fu(e[2], n, !0, r, i), t);\n\t\treturn function(t, j, M, N, P, F, I) {\n\t\t\tlet ee = this.splatCount;\n\t\t\tN ||= 0, P ||= ee - 1, F === void 0 && (F = N), M && j >= 1 && (r.copy(M), r.decompose(i, o, a), o.normalize(), r.makeRotationFromQuaternion(o), n.setFromMatrix4(r), E(s, n.elements[4], -n.elements[7], n.elements[1]), E(c, -n.elements[5], n.elements[8], -n.elements[2]), E(l, n.elements[3], -n.elements[6], n.elements[0]));\n\t\t\tlet te = (e) => hu(e, this.minSphericalHarmonicsCoeff, this.maxSphericalHarmonicsCoeff), ne = (e) => pu(e, this.minSphericalHarmonicsCoeff, this.maxSphericalHarmonicsCoeff);\n\t\t\tfor (let n = N; n <= P; n++) {\n\t\t\t\tlet r = this.globalSplatIndexToSectionMap[n], i = this.sections[r];\n\t\t\t\tj = Math.min(j, i.sphericalHarmonicsDegree);\n\t\t\t\tlet a = tu(j), o = n - i.splatCountOffset, E = i.bytesPerSplat * o + e.CompressionLevels[this.compressionLevel].SphericalHarmonicsOffsetBytes, P = new DataView(this.bufferData, i.dataBase + E), ee = (n - N + F) * a, L = M ? 0 : this.compressionLevel, re = T;\n\t\t\t\tL !== I && (L === 1 ? I === 0 ? re = du : I == 2 && (re = te) : L === 0 && (I === 1 ? re = uu : I == 2 && (re = ne)));\n\t\t\t\tlet ie = this.minSphericalHarmonicsCoeff, R = this.maxSphericalHarmonicsCoeff;\n\t\t\t\tj >= 1 && (D(h, P, 3, 0, this.compressionLevel), D(g, P, 3, 1, this.compressionLevel), D(_, P, 3, 2, this.compressionLevel), M ? (A(h, h, this.compressionLevel, ie, R), A(g, g, this.compressionLevel, ie, R), A(_, _, this.compressionLevel, ie, R), e.rotateSphericalHarmonics3(h, g, _, s, c, l, b, x, S)) : (O(h, b), O(g, x), O(_, S)), k(b, t, ee, re), k(x, t, ee + 3, re), k(S, t, ee + 6, re), j >= 2 && (D(h, P, 5, 9, this.compressionLevel), D(g, P, 5, 10, this.compressionLevel), D(_, P, 5, 11, this.compressionLevel), D(v, P, 5, 12, this.compressionLevel), D(y, P, 5, 13, this.compressionLevel), M ? (A(h, h, this.compressionLevel, ie, R), A(g, g, this.compressionLevel, ie, R), A(_, _, this.compressionLevel, ie, R), A(v, v, this.compressionLevel, ie, R), A(y, y, this.compressionLevel, ie, R), e.rotateSphericalHarmonics5(h, g, _, v, y, s, c, l, u, d, f, p, m, b, x, S, C, w)) : (O(h, b), O(g, x), O(_, S), O(v, C), O(y, w)), k(b, t, ee + 9, re), k(x, t, ee + 12, re), k(S, t, ee + 15, re), k(C, t, ee + 18, re), k(w, t, ee + 21, re)));\n\t\t\t}\n\t\t};\n\t}();\n\tstatic dot3 = (t, n, r, i, a) => {\n\t\ta[0] = a[1] = a[2] = 0;\n\t\tlet o = i[0], s = i[1], c = i[2];\n\t\te.addInto3(t[0] * o, t[1] * o, t[2] * o, a), e.addInto3(n[0] * s, n[1] * s, n[2] * s, a), e.addInto3(r[0] * c, r[1] * c, r[2] * c, a);\n\t};\n\tstatic addInto3 = (e, t, n, r) => {\n\t\tr[0] += e, r[1] += t, r[2] += n;\n\t};\n\tstatic dot5 = (t, n, r, i, a, o, s) => {\n\t\ts[0] = s[1] = s[2] = 0;\n\t\tlet c = o[0], l = o[1], u = o[2], d = o[3], f = o[4];\n\t\te.addInto3(t[0] * c, t[1] * c, t[2] * c, s), e.addInto3(n[0] * l, n[1] * l, n[2] * l, s), e.addInto3(r[0] * u, r[1] * u, r[2] * u, s), e.addInto3(i[0] * d, i[1] * d, i[2] * d, s), e.addInto3(a[0] * f, a[1] * f, a[2] * f, s);\n\t};\n\tstatic rotateSphericalHarmonics3 = (t, n, r, i, a, o, s, c, l) => {\n\t\te.dot3(t, n, r, i, s), e.dot3(t, n, r, a, c), e.dot3(t, n, r, o, l);\n\t};\n\tstatic rotateSphericalHarmonics5 = (t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v) => {\n\t\tlet y = Math.sqrt(1 / 4), b = Math.sqrt(3 / 4), x = Math.sqrt(1 / 3), S = Math.sqrt(4 / 3), C = Math.sqrt(1 / 12);\n\t\tl[0] = y * (c[2] * o[0] + c[0] * o[2] + (o[2] * c[0] + o[0] * c[2])), l[1] = c[1] * o[0] + o[1] * c[0], l[2] = b * (c[1] * o[1] + o[1] * c[1]), l[3] = c[1] * o[2] + o[1] * c[2], l[4] = y * (c[2] * o[2] - c[0] * o[0] + (o[2] * c[2] - o[0] * c[0])), e.dot5(t, n, r, i, a, l, m), u[0] = y * (s[2] * o[0] + s[0] * o[2] + (o[2] * s[0] + o[0] * s[2])), u[1] = s[1] * o[0] + o[1] * s[0], u[2] = b * (s[1] * o[1] + o[1] * s[1]), u[3] = s[1] * o[2] + o[1] * s[2], u[4] = y * (s[2] * o[2] - s[0] * o[0] + (o[2] * s[2] - o[0] * s[0])), e.dot5(t, n, r, i, a, u, h), d[0] = x * (s[2] * s[0] + s[0] * s[2]) + -C * (c[2] * c[0] + c[0] * c[2] + (o[2] * o[0] + o[0] * o[2])), d[1] = S * s[1] * s[0] + -x * (c[1] * c[0] + o[1] * o[0]), d[2] = s[1] * s[1] + -y * (c[1] * c[1] + o[1] * o[1]), d[3] = S * s[1] * s[2] + -x * (c[1] * c[2] + o[1] * o[2]), d[4] = x * (s[2] * s[2] - s[0] * s[0]) + -C * (c[2] * c[2] - c[0] * c[0] + (o[2] * o[2] - o[0] * o[0])), e.dot5(t, n, r, i, a, d, g), f[0] = y * (s[2] * c[0] + s[0] * c[2] + (c[2] * s[0] + c[0] * s[2])), f[1] = s[1] * c[0] + c[1] * s[0], f[2] = b * (s[1] * c[1] + c[1] * s[1]), f[3] = s[1] * c[2] + c[1] * s[2], f[4] = y * (s[2] * c[2] - s[0] * c[0] + (c[2] * s[2] - c[0] * s[0])), e.dot5(t, n, r, i, a, f, _), p[0] = y * (c[2] * c[0] + c[0] * c[2] - (o[2] * o[0] + o[0] * o[2])), p[1] = c[1] * c[0] - o[1] * o[0], p[2] = b * (c[1] * c[1] - o[1] * o[1]), p[3] = c[1] * c[2] - o[1] * o[2], p[4] = y * (c[2] * c[2] - c[0] * c[0] - (o[2] * o[2] - o[0] * o[0])), e.dot5(t, n, r, i, a, p, v);\n\t};\n\tstatic parseHeader(t) {\n\t\tlet n = new Uint8Array(t, 0, e.HeaderSizeBytes), r = new Uint16Array(t, 0, e.HeaderSizeBytes / 2), i = new Uint32Array(t, 0, e.HeaderSizeBytes / 4), a = new Float32Array(t, 0, e.HeaderSizeBytes / 4);\n\t\treturn {\n\t\t\tversionMajor: n[0],\n\t\t\tversionMinor: n[1],\n\t\t\tmaxSectionCount: i[1],\n\t\t\tsectionCount: i[2],\n\t\t\tmaxSplatCount: i[3],\n\t\t\tsplatCount: i[4],\n\t\t\tcompressionLevel: r[10],\n\t\t\tsceneCenter: new K(a[6], a[7], a[8]),\n\t\t\tminSphericalHarmonicsCoeff: a[9] || -lu,\n\t\t\tmaxSphericalHarmonicsCoeff: a[10] || lu\n\t\t};\n\t}\n\tstatic writeHeaderCountsToBuffer(t, n, r) {\n\t\tlet i = new Uint32Array(r, 0, e.HeaderSizeBytes / 4);\n\t\ti[2] = t, i[4] = n;\n\t}\n\tstatic writeHeaderToBuffer(t, n) {\n\t\tlet r = new Uint8Array(n, 0, e.HeaderSizeBytes), i = new Uint16Array(n, 0, e.HeaderSizeBytes / 2), a = new Uint32Array(n, 0, e.HeaderSizeBytes / 4), o = new Float32Array(n, 0, e.HeaderSizeBytes / 4);\n\t\tr[0] = t.versionMajor, r[1] = t.versionMinor, r[2] = 0, r[3] = 0, a[1] = t.maxSectionCount, a[2] = t.sectionCount, a[3] = t.maxSplatCount, a[4] = t.splatCount, i[10] = t.compressionLevel, o[6] = t.sceneCenter.x, o[7] = t.sceneCenter.y, o[8] = t.sceneCenter.z, o[9] = t.minSphericalHarmonicsCoeff || -lu, o[10] = t.maxSphericalHarmonicsCoeff || lu;\n\t}\n\tstatic parseSectionHeaders(t, n, r = 0, i) {\n\t\tlet a = t.compressionLevel, o = t.maxSectionCount, s = new Uint16Array(n, r, o * e.SectionHeaderSizeBytes / 2), c = new Uint32Array(n, r, o * e.SectionHeaderSizeBytes / 4), l = new Float32Array(n, r, o * e.SectionHeaderSizeBytes / 4), u = [], d = 0, f = d / 2, p = d / 4, m = e.HeaderSizeBytes + t.maxSectionCount * e.SectionHeaderSizeBytes, h = 0;\n\t\tfor (let t = 0; t < o; t++) {\n\t\t\tlet n = c[p + 1], r = c[p + 2], o = c[p + 3], g = l[p + 4], _ = g / 2, v = s[f + 10], y = c[p + 6] || e.CompressionLevels[a].ScaleRange, b = c[p + 8], x = c[p + 9], S = x * 4, C = v * o + S, w = s[f + 20], { bytesPerSplat: T } = e.calculateComponentStorage(a, w), E = T * n, D = E + C, O = {\n\t\t\t\tbytesPerSplat: T,\n\t\t\t\tsplatCountOffset: h,\n\t\t\t\tsplatCount: i ? n : 0,\n\t\t\t\tmaxSplatCount: n,\n\t\t\t\tbucketSize: r,\n\t\t\t\tbucketCount: o,\n\t\t\t\tbucketBlockSize: g,\n\t\t\t\thalfBucketBlockSize: _,\n\t\t\t\tbucketStorageSizeBytes: v,\n\t\t\t\tbucketsStorageSizeBytes: C,\n\t\t\t\tsplatDataStorageSizeBytes: E,\n\t\t\t\tstorageSizeBytes: D,\n\t\t\t\tcompressionScaleRange: y,\n\t\t\t\tcompressionScaleFactor: _ / y,\n\t\t\t\tbase: m,\n\t\t\t\tbucketsBase: m + S,\n\t\t\t\tdataBase: m + C,\n\t\t\t\tfullBucketCount: b,\n\t\t\t\tpartiallyFilledBucketCount: x,\n\t\t\t\tsphericalHarmonicsDegree: w\n\t\t\t};\n\t\t\tu[t] = O, m += D, d += e.SectionHeaderSizeBytes, f = d / 2, p = d / 4, h += n;\n\t\t}\n\t\treturn u;\n\t}\n\tstatic writeSectionHeaderToBuffer(t, n, r, i = 0) {\n\t\tlet a = new Uint16Array(r, i, e.SectionHeaderSizeBytes / 2), o = new Uint32Array(r, i, e.SectionHeaderSizeBytes / 4), s = new Float32Array(r, i, e.SectionHeaderSizeBytes / 4);\n\t\to[0] = t.splatCount, o[1] = t.maxSplatCount, o[2] = n >= 1 ? t.bucketSize : 0, o[3] = n >= 1 ? t.bucketCount : 0, s[4] = n >= 1 ? t.bucketBlockSize : 0, a[10] = n >= 1 ? e.BucketStorageSizeBytes : 0, o[6] = n >= 1 ? t.compressionScaleRange : 0, o[7] = t.storageSizeBytes, o[8] = n >= 1 ? t.fullBucketCount : 0, o[9] = n >= 1 ? t.partiallyFilledBucketCount : 0, a[20] = t.sphericalHarmonicsDegree;\n\t}\n\tstatic writeSectionHeaderSplatCountToBuffer(t, n, r = 0) {\n\t\tlet i = new Uint32Array(n, r, e.SectionHeaderSizeBytes / 4);\n\t\ti[0] = t;\n\t}\n\tconstructFromBuffer(t, n) {\n\t\tthis.bufferData = t, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSectionMap = [];\n\t\tlet r = e.parseHeader(this.bufferData);\n\t\tthis.versionMajor = r.versionMajor, this.versionMinor = r.versionMinor, this.maxSectionCount = r.maxSectionCount, this.sectionCount = n ? r.maxSectionCount : 0, this.maxSplatCount = r.maxSplatCount, this.splatCount = n ? r.maxSplatCount : 0, this.compressionLevel = r.compressionLevel, this.sceneCenter = new K().copy(r.sceneCenter), this.minSphericalHarmonicsCoeff = r.minSphericalHarmonicsCoeff, this.maxSphericalHarmonicsCoeff = r.maxSphericalHarmonicsCoeff, this.sections = e.parseSectionHeaders(r, this.bufferData, e.HeaderSizeBytes, n), this.linkBufferArrays(), this.buildMaps();\n\t}\n\tstatic calculateComponentStorage(t, n) {\n\t\tlet r = e.CompressionLevels[t].BytesPerCenter, i = e.CompressionLevels[t].BytesPerScale, a = e.CompressionLevels[t].BytesPerRotation, o = e.CompressionLevels[t].BytesPerColor, s = tu(n), c = e.CompressionLevels[t].BytesPerSphericalHarmonicsComponent * s;\n\t\treturn {\n\t\t\tbytesPerCenter: r,\n\t\t\tbytesPerScale: i,\n\t\t\tbytesPerRotation: a,\n\t\t\tbytesPerColor: o,\n\t\t\tsphericalHarmonicsComponentsPerSplat: s,\n\t\t\tsphericalHarmonicsBytesPerSplat: c,\n\t\t\tbytesPerSplat: r + i + a + o + c\n\t\t};\n\t}\n\tlinkBufferArrays() {\n\t\tfor (let t = 0; t < this.maxSectionCount; t++) {\n\t\t\tlet n = this.sections[t];\n\t\t\tn.bucketArray = new Float32Array(this.bufferData, n.bucketsBase, n.bucketCount * e.BucketStorageSizeFloats), n.partiallyFilledBucketCount > 0 && (n.partiallyFilledBucketLengths = new Uint32Array(this.bufferData, n.base, n.partiallyFilledBucketCount));\n\t\t}\n\t}\n\tbuildMaps() {\n\t\tlet e = 0;\n\t\tfor (let t = 0; t < this.maxSectionCount; t++) {\n\t\t\tlet n = this.sections[t];\n\t\t\tfor (let r = 0; r < n.maxSplatCount; r++) {\n\t\t\t\tlet n = e + r;\n\t\t\t\tthis.globalSplatIndexToLocalSplatIndexMap[n] = r, this.globalSplatIndexToSectionMap[n] = t;\n\t\t\t}\n\t\t\te += n.maxSplatCount;\n\t\t}\n\t}\n\tupdateLoadedCounts(t, n) {\n\t\te.writeHeaderCountsToBuffer(t, n, this.bufferData), this.sectionCount = t, this.splatCount = n;\n\t}\n\tupdateSectionLoadedCounts(t, n) {\n\t\tlet r = e.HeaderSizeBytes + e.SectionHeaderSizeBytes * t;\n\t\te.writeSectionHeaderSplatCountToBuffer(n, this.bufferData, r), this.sections[t].splatCount = n;\n\t}\n\tstatic writeSplatDataToSectionBuffer = function() {\n\t\tlet t = /* @__PURE__ */ new ArrayBuffer(12), n = /* @__PURE__ */ new ArrayBuffer(12), r = /* @__PURE__ */ new ArrayBuffer(16), i = /* @__PURE__ */ new ArrayBuffer(4), a = /* @__PURE__ */ new ArrayBuffer(256), o = new ln(), s = new K(), c = new K(), { X: l, Y: u, Z: d, SCALE0: f, SCALE1: p, SCALE2: m, ROTATION0: h, ROTATION1: g, ROTATION2: _, ROTATION3: v, FDC0: y, FDC1: b, FDC2: x, OPACITY: S, FRC0: C, FRC9: w } = Z.OFFSET, T = (e, t, n) => {\n\t\t\tlet r = n * 2 + 1;\n\t\t\treturn e = Math.round(e * t) + n, Zl(e, 0, r);\n\t\t};\n\t\treturn function(E, D, O, k, A, j, M, N, P = -lu, F = lu) {\n\t\t\tlet I = tu(A), ee = e.CompressionLevels[k].BytesPerCenter, te = e.CompressionLevels[k].BytesPerScale, ne = e.CompressionLevels[k].BytesPerRotation, L = e.CompressionLevels[k].BytesPerColor, re = O, ie = re + ee, R = ie + te, ae = R + ne, oe = ae + L;\n\t\t\tif (E[h] === void 0 ? o.set(1, 0, 0, 0) : (o.set(E[h], E[g], E[_], E[v]), o.normalize()), E[f] === void 0 ? s.set(0, 0, 0) : s.set(E[f] || 0, E[p] || 0, E[m] || 0), k === 0) {\n\t\t\t\tlet t = new Float32Array(D, re, e.CenterComponentCount), n = new Float32Array(D, R, e.RotationComponentCount), r = new Float32Array(D, ie, e.ScaleComponentCount);\n\t\t\t\tif (n.set([\n\t\t\t\t\to.x,\n\t\t\t\t\to.y,\n\t\t\t\t\to.z,\n\t\t\t\t\to.w\n\t\t\t\t]), r.set([\n\t\t\t\t\ts.x,\n\t\t\t\t\ts.y,\n\t\t\t\t\ts.z\n\t\t\t\t]), t.set([\n\t\t\t\t\tE[l],\n\t\t\t\t\tE[u],\n\t\t\t\t\tE[d]\n\t\t\t\t]), A > 0) {\n\t\t\t\t\tlet e = new Float32Array(D, oe, I);\n\t\t\t\t\tif (A >= 1) {\n\t\t\t\t\t\tfor (let t = 0; t < 9; t++) e[t] = E[C + t] || 0;\n\t\t\t\t\t\tif (A >= 2) for (let t = 0; t < 15; t++) e[t + 9] = E[w + t] || 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet i = new Uint16Array(t, 0, e.CenterComponentCount), f = new Uint16Array(r, 0, e.RotationComponentCount), p = new Uint16Array(n, 0, e.ScaleComponentCount);\n\t\t\t\tif (f.set([\n\t\t\t\t\tuu(o.x),\n\t\t\t\t\tuu(o.y),\n\t\t\t\t\tuu(o.z),\n\t\t\t\t\tuu(o.w)\n\t\t\t\t]), p.set([\n\t\t\t\t\tuu(s.x),\n\t\t\t\t\tuu(s.y),\n\t\t\t\t\tuu(s.z)\n\t\t\t\t]), c.set(E[l], E[u], E[d]).sub(j), c.x = T(c.x, M, N), c.y = T(c.y, M, N), c.z = T(c.z, M, N), i.set([\n\t\t\t\t\tc.x,\n\t\t\t\t\tc.y,\n\t\t\t\t\tc.z\n\t\t\t\t]), A > 0) {\n\t\t\t\t\tlet e = k === 1 ? Uint16Array : Uint8Array, t = k === 1 ? 2 : 1, n = new e(a, 0, I);\n\t\t\t\t\tif (A >= 1) {\n\t\t\t\t\t\tfor (let e = 0; e < 9; e++) {\n\t\t\t\t\t\t\tlet t = E[C + e] || 0;\n\t\t\t\t\t\t\tn[e] = k === 1 ? uu(t) : pu(t, P, F);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet e = 9 * t;\n\t\t\t\t\t\tif (yu(n.buffer, 0, D, oe, e), A >= 2) {\n\t\t\t\t\t\t\tfor (let e = 0; e < 15; e++) {\n\t\t\t\t\t\t\t\tlet t = E[w + e] || 0;\n\t\t\t\t\t\t\t\tn[e + 9] = k === 1 ? uu(t) : pu(t, P, F);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tyu(n.buffer, e, D, oe + e, 15 * t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tyu(i.buffer, 0, D, re, 6), yu(p.buffer, 0, D, ie, 6), yu(f.buffer, 0, D, R, 8);\n\t\t\t}\n\t\t\tlet se = new Uint8ClampedArray(i, 0, 4);\n\t\t\tse.set([\n\t\t\t\tE[y] || 0,\n\t\t\t\tE[b] || 0,\n\t\t\t\tE[x] || 0\n\t\t\t]), se[3] = E[S] || 0, yu(se.buffer, 0, D, ae, 4);\n\t\t};\n\t}();\n\tstatic generateFromUncompressedSplatArrays(t, n, r, i, a, o, s = []) {\n\t\tlet c = 0;\n\t\tfor (let e = 0; e < t.length; e++) {\n\t\t\tlet n = t[e];\n\t\t\tc = Math.max(n.sphericalHarmonicsDegree, c);\n\t\t}\n\t\tlet l, u;\n\t\tfor (let e = 0; e < t.length; e++) {\n\t\t\tlet n = t[e];\n\t\t\tfor (let e = 0; e < n.splats.length; e++) {\n\t\t\t\tlet t = n.splats[e];\n\t\t\t\tfor (let e = Z.OFFSET.FRC0; e < Z.OFFSET.FRC23 && e < t.length; e++) (!l || t[e] < l) && (l = t[e]), (!u || t[e] > u) && (u = t[e]);\n\t\t\t}\n\t\t}\n\t\tl ||= -lu, u ||= lu;\n\t\tlet { bytesPerSplat: d } = e.calculateComponentStorage(r, c), f = e.CompressionLevels[r].ScaleRange, p = [], m = [], h = 0;\n\t\tfor (let i = 0; i < t.length; i++) {\n\t\t\tlet g = t[i], _ = new Z(c);\n\t\t\tfor (let e = 0; e < g.splatCount; e++) {\n\t\t\t\tlet t = g.splats[e];\n\t\t\t\t(t[Z.OFFSET.OPACITY] || 0) >= n && _.addSplat(t);\n\t\t\t}\n\t\t\tlet v = s[i] || {}, y = (v.blockSizeFactor || 1) * (a || e.BucketBlockSize), b = Math.ceil((v.bucketSizeFactor || 1) * (o || e.BucketSize)), x = e.computeBucketsForUncompressedSplatArray(_, y, b), S = x.fullBuckets.length, C = x.partiallyFullBuckets.map((e) => e.splats.length), w = C.length, T = [...x.fullBuckets, ...x.partiallyFullBuckets], E = _.splats.length * d, D = w * 4, O = r >= 1 ? T.length * e.BucketStorageSizeBytes + D : 0, k = E + O, A = new ArrayBuffer(k), j = f / (y * .5), M = new K(), N = 0;\n\t\t\tfor (let t = 0; t < T.length; t++) {\n\t\t\t\tlet n = T[t];\n\t\t\t\tM.fromArray(n.center);\n\t\t\t\tfor (let t = 0; t < n.splats.length; t++) {\n\t\t\t\t\tlet i = n.splats[t], a = _.splats[i], o = O + N * d;\n\t\t\t\t\te.writeSplatDataToSectionBuffer(a, A, o, r, c, M, j, f, l, u), N++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (h += N, r >= 1) {\n\t\t\t\tlet t = new Uint32Array(A, 0, C.length * 4);\n\t\t\t\tfor (let e = 0; e < C.length; e++) t[e] = C[e];\n\t\t\t\tlet n = new Float32Array(A, D, T.length * e.BucketStorageSizeFloats);\n\t\t\t\tfor (let e = 0; e < T.length; e++) {\n\t\t\t\t\tlet t = T[e], r = e * 3;\n\t\t\t\t\tn[r] = t.center[0], n[r + 1] = t.center[1], n[r + 2] = t.center[2];\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.push(A);\n\t\t\tlet P = new ArrayBuffer(e.SectionHeaderSizeBytes);\n\t\t\te.writeSectionHeaderToBuffer({\n\t\t\t\tmaxSplatCount: N,\n\t\t\t\tsplatCount: N,\n\t\t\t\tbucketSize: b,\n\t\t\t\tbucketCount: T.length,\n\t\t\t\tbucketBlockSize: y,\n\t\t\t\tcompressionScaleRange: f,\n\t\t\t\tstorageSizeBytes: k,\n\t\t\t\tfullBucketCount: S,\n\t\t\t\tpartiallyFilledBucketCount: w,\n\t\t\t\tsphericalHarmonicsDegree: c\n\t\t\t}, r, P, 0), m.push(P);\n\t\t}\n\t\tlet g = 0;\n\t\tfor (let e of p) g += e.byteLength;\n\t\tlet _ = e.HeaderSizeBytes + e.SectionHeaderSizeBytes * p.length + g, v = new ArrayBuffer(_);\n\t\te.writeHeaderToBuffer({\n\t\t\tversionMajor: 0,\n\t\t\tversionMinor: 1,\n\t\t\tmaxSectionCount: p.length,\n\t\t\tsectionCount: p.length,\n\t\t\tmaxSplatCount: h,\n\t\t\tsplatCount: h,\n\t\t\tcompressionLevel: r,\n\t\t\tsceneCenter: i,\n\t\t\tminSphericalHarmonicsCoeff: l,\n\t\t\tmaxSphericalHarmonicsCoeff: u\n\t\t}, v);\n\t\tlet y = e.HeaderSizeBytes;\n\t\tfor (let t of m) new Uint8Array(v, y, e.SectionHeaderSizeBytes).set(new Uint8Array(t)), y += e.SectionHeaderSizeBytes;\n\t\tfor (let e of p) new Uint8Array(v, y, e.byteLength).set(new Uint8Array(e)), y += e.byteLength;\n\t\treturn new e(v);\n\t}\n\tstatic computeBucketsForUncompressedSplatArray(e, t, n) {\n\t\tlet r = e.splatCount, i = t / 2, a = new K(), o = new K();\n\t\tfor (let t = 0; t < r; t++) {\n\t\t\tlet n = e.splats[t], r = [\n\t\t\t\tn[Z.OFFSET.X],\n\t\t\t\tn[Z.OFFSET.Y],\n\t\t\t\tn[Z.OFFSET.Z]\n\t\t\t];\n\t\t\t(t === 0 || r[0] < a.x) && (a.x = r[0]), (t === 0 || r[0] > o.x) && (o.x = r[0]), (t === 0 || r[1] < a.y) && (a.y = r[1]), (t === 0 || r[1] > o.y) && (o.y = r[1]), (t === 0 || r[2] < a.z) && (a.z = r[2]), (t === 0 || r[2] > o.z) && (o.z = r[2]);\n\t\t}\n\t\tlet s = new K().copy(o).sub(a), c = Math.ceil(s.y / t), l = Math.ceil(s.z / t), u = new K(), d = [], f = {};\n\t\tfor (let o = 0; o < r; o++) {\n\t\t\tlet r = e.splats[o], s = [\n\t\t\t\tr[Z.OFFSET.X],\n\t\t\t\tr[Z.OFFSET.Y],\n\t\t\t\tr[Z.OFFSET.Z]\n\t\t\t], p = Math.floor((s[0] - a.x) / t), m = Math.floor((s[1] - a.y) / t), h = Math.floor((s[2] - a.z) / t);\n\t\t\tu.x = p * t + a.x + i, u.y = m * t + a.y + i, u.z = h * t + a.z + i;\n\t\t\tlet g = c * l * p + m * l + h, _ = f[g];\n\t\t\t_ || (f[g] = _ = {\n\t\t\t\tsplats: [],\n\t\t\t\tcenter: u.toArray()\n\t\t\t}), _.splats.push(o), _.splats.length >= n && (d.push(_), f[g] = null);\n\t\t}\n\t\tlet p = [];\n\t\tfor (let e in f) if (f.hasOwnProperty(e)) {\n\t\t\tlet t = f[e];\n\t\t\tt && p.push(t);\n\t\t}\n\t\treturn {\n\t\t\tfullBuckets: d,\n\t\t\tpartiallyFullBuckets: p\n\t\t};\n\t}\n\tstatic preallocateUncompressed(t, n) {\n\t\tlet r = e.CompressionLevels[0].SphericalHarmonicsDegrees[n], i = e.HeaderSizeBytes + e.SectionHeaderSizeBytes, a = i + r.BytesPerSplat * t, o = new ArrayBuffer(a);\n\t\treturn e.writeHeaderToBuffer({\n\t\t\tversionMajor: e.CurrentMajorVersion,\n\t\t\tversionMinor: e.CurrentMinorVersion,\n\t\t\tmaxSectionCount: 1,\n\t\t\tsectionCount: 1,\n\t\t\tmaxSplatCount: t,\n\t\t\tsplatCount: t,\n\t\t\tcompressionLevel: 0,\n\t\t\tsceneCenter: new K()\n\t\t}, o), e.writeSectionHeaderToBuffer({\n\t\t\tmaxSplatCount: t,\n\t\t\tsplatCount: t,\n\t\t\tbucketSize: 0,\n\t\t\tbucketCount: 0,\n\t\t\tbucketBlockSize: 0,\n\t\t\tcompressionScaleRange: 0,\n\t\t\tstorageSizeBytes: 0,\n\t\t\tfullBucketCount: 0,\n\t\t\tpartiallyFilledBucketCount: 0,\n\t\t\tsphericalHarmonicsDegree: n\n\t\t}, 0, o, e.HeaderSizeBytes), {\n\t\t\tsplatBuffer: new e(o, !0),\n\t\t\tsplatBufferDataOffsetBytes: i\n\t\t};\n\t}\n}, bu = new Uint8Array([\n\t112,\n\t108,\n\t121,\n\t10\n]), xu = new Uint8Array([\n\t10,\n\t101,\n\t110,\n\t100,\n\t95,\n\t104,\n\t101,\n\t97,\n\t100,\n\t101,\n\t114,\n\t10\n]), Su = \"end_header\", Cu = /* @__PURE__ */ new Map([\n\t[\"char\", Int8Array],\n\t[\"uchar\", Uint8Array],\n\t[\"short\", Int16Array],\n\t[\"ushort\", Uint16Array],\n\t[\"int\", Int32Array],\n\t[\"uint\", Uint32Array],\n\t[\"float\", Float32Array],\n\t[\"double\", Float64Array]\n]), wu = (e, t) => {\n\tlet n = (1 << t) - 1;\n\treturn (e & n) / n;\n}, Tu = (e, t) => {\n\te.x = wu(t >>> 21, 11), e.y = wu(t >>> 11, 10), e.z = wu(t, 11);\n}, Eu = (e, t) => {\n\te.x = wu(t >>> 24, 8), e.y = wu(t >>> 16, 8), e.z = wu(t >>> 8, 8), e.w = wu(t, 8);\n}, Du = (e, t) => {\n\tlet n = 1 / (Math.sqrt(2) * .5), r = (wu(t >>> 20, 10) - .5) * n, i = (wu(t >>> 10, 10) - .5) * n, a = (wu(t, 10) - .5) * n, o = Math.sqrt(1 - (r * r + i * i + a * a));\n\tswitch (t >>> 30) {\n\t\tcase 0:\n\t\t\te.set(o, r, i, a);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\te.set(r, o, i, a);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\te.set(r, i, o, a);\n\t\t\tbreak;\n\t\tcase 3: e.set(r, i, a, o);\n\t}\n}, Ou = (e, t, n) => e * (1 - n) + t * n, ku = (e, t) => e.properties.find((e) => e.name === t && e.storage)?.storage, Au = class e {\n\tstatic decodeHeaderText(e) {\n\t\tlet t, n, r, i, a = e.split(\"\\n\").filter((e) => !e.startsWith(\"comment \")), o = 0, s = !1;\n\t\tfor (let e = 1; e < a.length; ++e) {\n\t\t\tlet c = a[e].split(\" \");\n\t\t\tswitch (c[0]) {\n\t\t\t\tcase \"format\":\n\t\t\t\t\tif (c[1] !== \"binary_little_endian\") throw Error(\"Unsupported ply format\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"element\":\n\t\t\t\t\tt = {\n\t\t\t\t\t\tname: c[1],\n\t\t\t\t\t\tcount: parseInt(c[2], 10),\n\t\t\t\t\t\tproperties: [],\n\t\t\t\t\t\tstorageSizeBytes: 0\n\t\t\t\t\t}, t.name === \"chunk\" ? n = t : t.name === \"vertex\" ? r = t : t.name === \"sh\" && (i = t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"property\": {\n\t\t\t\t\tif (!Cu.has(c[1])) throw Error(`Unrecognized property data type '${c[1]}' in ply header`);\n\t\t\t\t\tlet e = Cu.get(c[1]), n = e.BYTES_PER_ELEMENT * t.count;\n\t\t\t\t\tt.name === \"vertex\" && (o += e.BYTES_PER_ELEMENT), t.properties.push({\n\t\t\t\t\t\ttype: c[1],\n\t\t\t\t\t\tname: c[2],\n\t\t\t\t\t\tstorage: null,\n\t\t\t\t\t\tbyteSize: e.BYTES_PER_ELEMENT,\n\t\t\t\t\t\tstorageSizeByes: n\n\t\t\t\t\t}), t.storageSizeBytes += n;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase Su:\n\t\t\t\t\ts = !0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: throw Error(`Unrecognized header value '${c[0]}' in ply header`);\n\t\t\t}\n\t\t\tif (s) break;\n\t\t}\n\t\tlet c = 0, l = 0;\n\t\treturn i && (l = i.properties.length, i.properties.length >= 45 ? c = 3 : i.properties.length >= 24 ? c = 2 : i.properties.length >= 9 && (c = 1)), {\n\t\t\tchunkElement: n,\n\t\t\tvertexElement: r,\n\t\t\tshElement: i,\n\t\t\tbytesPerSplat: o,\n\t\t\theaderSizeBytes: e.indexOf(Su) + 10 + 1,\n\t\t\tsphericalHarmonicsDegree: c,\n\t\t\tsphericalHarmonicsPerSplat: l\n\t\t};\n\t}\n\tstatic decodeHeader(t) {\n\t\tlet n = (e, t) => {\n\t\t\tlet n = e.length - t.length, r, i;\n\t\t\tfor (r = 0; r <= n; ++r) {\n\t\t\t\tfor (i = 0; i < t.length && e[r + i] === t[i]; ++i);\n\t\t\t\tif (i === t.length) return r;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}, r = (e, t) => {\n\t\t\tif (e.length < t.length) return !1;\n\t\t\tfor (let n = 0; n < t.length; ++n) if (e[n] !== t[n]) return !1;\n\t\t\treturn !0;\n\t\t}, i = new Uint8Array(t), a;\n\t\tif (i.length >= bu.length && !r(i, bu)) throw Error(\"Invalid PLY header\");\n\t\tif (a = n(i, xu), a === -1) throw Error(\"End of PLY header not found\");\n\t\tlet o = new TextDecoder(\"ascii\").decode(i.slice(0, a)), { chunkElement: s, vertexElement: c, shElement: l, sphericalHarmonicsDegree: u, sphericalHarmonicsPerSplat: d, bytesPerSplat: f } = e.decodeHeaderText(o);\n\t\treturn {\n\t\t\theaderSizeBytes: a + xu.length,\n\t\t\tbytesPerSplat: f,\n\t\t\tchunkElement: s,\n\t\t\tvertexElement: c,\n\t\t\tshElement: l,\n\t\t\tsphericalHarmonicsDegree: u,\n\t\t\tsphericalHarmonicsPerSplat: d\n\t\t};\n\t}\n\tstatic readElementData(e, t, n, r, i, a = null) {\n\t\tlet o = t instanceof DataView ? t : new DataView(t);\n\t\tr ||= 0, i ||= e.count - 1;\n\t\tfor (let t = r; t <= i; ++t) for (let r = 0; r < e.properties.length; ++r) {\n\t\t\tlet i = e.properties[r], s = Cu.get(i.type), c = s.BYTES_PER_ELEMENT * e.count;\n\t\t\tif ((!i.storage || i.storage.byteLength < c) && (!a || a(i.name)) && (i.storage = new s(e.count)), i.storage) switch (i.type) {\n\t\t\t\tcase \"char\":\n\t\t\t\t\ti.storage[t] = o.getInt8(n);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"uchar\":\n\t\t\t\t\ti.storage[t] = o.getUint8(n);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"short\":\n\t\t\t\t\ti.storage[t] = o.getInt16(n, !0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"ushort\":\n\t\t\t\t\ti.storage[t] = o.getUint16(n, !0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"int\":\n\t\t\t\t\ti.storage[t] = o.getInt32(n, !0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"uint\":\n\t\t\t\t\ti.storage[t] = o.getUint32(n, !0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"float\":\n\t\t\t\t\ti.storage[t] = o.getFloat32(n, !0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"double\": i.storage[t] = o.getFloat64(n, !0);\n\t\t\t}\n\t\t\tn += i.byteSize;\n\t\t}\n\t\treturn n;\n\t}\n\tstatic readPly(t, n = null) {\n\t\tlet r = e.decodeHeader(t), i = e.readElementData(r.chunkElement, t, r.headerSizeBytes, null, null, n);\n\t\treturn i = e.readElementData(r.vertexElement, t, i, null, null, n), e.readElementData(r.shElement, t, i, null, null, n), {\n\t\t\tchunkElement: r.chunkElement,\n\t\t\tvertexElement: r.vertexElement,\n\t\t\tshElement: r.shElement,\n\t\t\tsphericalHarmonicsDegree: r.sphericalHarmonicsDegree,\n\t\t\tsphericalHarmonicsPerSplat: r.sphericalHarmonicsPerSplat\n\t\t};\n\t}\n\tstatic getElementStorageArrays(e, t, n) {\n\t\tlet r = {};\n\t\tif (t) {\n\t\t\tlet n = ku(e, \"min_r\"), i = ku(e, \"min_g\"), a = ku(e, \"min_b\"), o = ku(e, \"max_r\"), s = ku(e, \"max_g\"), c = ku(e, \"max_b\"), l = ku(e, \"min_x\"), u = ku(e, \"min_y\"), d = ku(e, \"min_z\"), f = ku(e, \"max_x\"), p = ku(e, \"max_y\"), m = ku(e, \"max_z\"), h = ku(e, \"min_scale_x\"), g = ku(e, \"min_scale_y\"), _ = ku(e, \"min_scale_z\"), v = ku(e, \"max_scale_x\"), y = ku(e, \"max_scale_y\"), b = ku(e, \"max_scale_z\"), x = ku(t, \"packed_position\"), S = ku(t, \"packed_rotation\"), C = ku(t, \"packed_scale\"), w = ku(t, \"packed_color\");\n\t\t\tr.colorExtremes = {\n\t\t\t\tminR: n,\n\t\t\t\tmaxR: o,\n\t\t\t\tminG: i,\n\t\t\t\tmaxG: s,\n\t\t\t\tminB: a,\n\t\t\t\tmaxB: c\n\t\t\t}, r.positionExtremes = {\n\t\t\t\tminX: l,\n\t\t\t\tmaxX: f,\n\t\t\t\tminY: u,\n\t\t\t\tmaxY: p,\n\t\t\t\tminZ: d,\n\t\t\t\tmaxZ: m\n\t\t\t}, r.scaleExtremes = {\n\t\t\t\tminScaleX: h,\n\t\t\t\tmaxScaleX: v,\n\t\t\t\tminScaleY: g,\n\t\t\t\tmaxScaleY: y,\n\t\t\t\tminScaleZ: _,\n\t\t\t\tmaxScaleZ: b\n\t\t\t}, r.position = x, r.rotation = S, r.scale = C, r.color = w;\n\t\t}\n\t\tif (n) {\n\t\t\tlet e = {};\n\t\t\tfor (let t = 0; t < 45; t++) {\n\t\t\t\tlet r = `f_rest_${t}`, i = ku(n, r);\n\t\t\t\tif (i) e[r] = i;\n\t\t\t\telse break;\n\t\t\t}\n\t\t\tr.sh = e;\n\t\t}\n\t\treturn r;\n\t}\n\tstatic decompressBaseSplat = function() {\n\t\tlet e = new K(), t = new ln(), n = new K(), r = new Dn(), i = Z.OFFSET;\n\t\treturn function(a, o, s, c, l, u, d, f, p, m) {\n\t\t\tm ||= Z.createSplat();\n\t\t\tlet h = Math.floor((o + a) / 256);\n\t\t\treturn Tu(e, s[a]), Du(t, d[a]), Tu(n, l[a]), Eu(r, p[a]), m[i.X] = Ou(c.minX[h], c.maxX[h], e.x), m[i.Y] = Ou(c.minY[h], c.maxY[h], e.y), m[i.Z] = Ou(c.minZ[h], c.maxZ[h], e.z), m[i.ROTATION0] = t.x, m[i.ROTATION1] = t.y, m[i.ROTATION2] = t.z, m[i.ROTATION3] = t.w, m[i.SCALE0] = Math.exp(Ou(u.minScaleX[h], u.maxScaleX[h], n.x)), m[i.SCALE1] = Math.exp(Ou(u.minScaleY[h], u.maxScaleY[h], n.y)), m[i.SCALE2] = Math.exp(Ou(u.minScaleZ[h], u.maxScaleZ[h], n.z)), f.minR && f.maxR ? m[i.FDC0] = Zl(Math.round(Ou(f.minR[h], f.maxR[h], r.x) * 255), 0, 255) : m[i.FDC0] = Zl(Math.floor(r.x * 255), 0, 255), f.minG && f.maxG ? m[i.FDC1] = Zl(Math.round(Ou(f.minG[h], f.maxG[h], r.y) * 255), 0, 255) : m[i.FDC1] = Zl(Math.floor(r.y * 255), 0, 255), f.minB && f.maxB ? m[i.FDC2] = Zl(Math.round(Ou(f.minB[h], f.maxB[h], r.z) * 255), 0, 255) : m[i.FDC2] = Zl(Math.floor(r.z * 255), 0, 255), m[i.OPACITY] = Zl(Math.floor(r.w * 255), 0, 255), m;\n\t\t};\n\t}();\n\tstatic decompressSphericalHarmonics = function() {\n\t\tlet e = [\n\t\t\t0,\n\t\t\t3,\n\t\t\t8,\n\t\t\t15\n\t\t], t = [\n\t\t\t0,\n\t\t\t1,\n\t\t\t2,\n\t\t\t9,\n\t\t\t10,\n\t\t\t11,\n\t\t\t12,\n\t\t\t13,\n\t\t\t24,\n\t\t\t25,\n\t\t\t26,\n\t\t\t27,\n\t\t\t28,\n\t\t\t29,\n\t\t\t30,\n\t\t\t3,\n\t\t\t4,\n\t\t\t5,\n\t\t\t14,\n\t\t\t15,\n\t\t\t16,\n\t\t\t17,\n\t\t\t18,\n\t\t\t31,\n\t\t\t32,\n\t\t\t33,\n\t\t\t34,\n\t\t\t35,\n\t\t\t36,\n\t\t\t37,\n\t\t\t6,\n\t\t\t7,\n\t\t\t8,\n\t\t\t19,\n\t\t\t20,\n\t\t\t21,\n\t\t\t22,\n\t\t\t23,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44\n\t\t];\n\t\treturn function(n, r, i, a, o) {\n\t\t\to ||= Z.createSplat();\n\t\t\tlet s = e[i], c = e[a];\n\t\t\tfor (let e = 0; e < 3; ++e) for (let i = 0; i < 15; ++i) {\n\t\t\t\tlet a = t[e * 15 + i];\n\t\t\t\ti < s && i < c && (o[Z.OFFSET.FRC0 + a] = r[e * c + i][n] * (8 / 255) - 4);\n\t\t\t}\n\t\t\treturn o;\n\t\t};\n\t}();\n\tstatic parseToUncompressedSplatBufferSection(t, n, r, i, a, o, s, c, l = null) {\n\t\te.readElementData(n, o, 0, r, i, l);\n\t\tlet u = Q.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, { positionExtremes: d, scaleExtremes: f, colorExtremes: p, position: m, rotation: h, scale: g, color: _ } = e.getElementStorageArrays(t, n), v = Z.createSplat();\n\t\tfor (let t = r; t <= i; ++t) {\n\t\t\te.decompressBaseSplat(t, a, m, d, g, f, h, p, _, v);\n\t\t\tlet n = t * u + c;\n\t\t\tQ.writeSplatDataToSectionBuffer(v, s, n, 0, 0);\n\t\t}\n\t}\n\tstatic parseToUncompressedSplatArraySection(t, n, r, i, a, o, s, c = null) {\n\t\te.readElementData(n, o, 0, r, i, c);\n\t\tlet { positionExtremes: l, scaleExtremes: u, colorExtremes: d, position: f, rotation: p, scale: m, color: h } = e.getElementStorageArrays(t, n);\n\t\tfor (let t = r; t <= i; ++t) {\n\t\t\tlet n = Z.createSplat();\n\t\t\te.decompressBaseSplat(t, a, f, l, m, u, p, d, h, n), s.addSplat(n);\n\t\t}\n\t}\n\tstatic parseSphericalHarmonicsToUncompressedSplatArraySection(t, n, r, i, a, o, s, c, l, u = null) {\n\t\te.readElementData(n, a, o, r, i, u);\n\t\tlet { sh: d } = e.getElementStorageArrays(t, void 0, n), f = Object.values(d);\n\t\tfor (let t = r; t <= i; ++t) e.decompressSphericalHarmonics(t, f, s, c, l.splats[t]);\n\t}\n\tstatic parseToUncompressedSplatArray(t, n) {\n\t\tlet { chunkElement: r, vertexElement: i, shElement: a, sphericalHarmonicsDegree: o } = e.readPly(t);\n\t\tn = Math.min(n, o);\n\t\tlet s = new Z(n), { positionExtremes: c, scaleExtremes: l, colorExtremes: u, position: d, rotation: f, scale: p, color: m } = e.getElementStorageArrays(r, i), h;\n\t\tif (n > 0) {\n\t\t\tlet { sh: t } = e.getElementStorageArrays(r, void 0, a);\n\t\t\th = Object.values(t);\n\t\t}\n\t\tfor (let t = 0; t < i.count; ++t) {\n\t\t\ts.addDefaultSplat();\n\t\t\tlet r = s.getSplat(s.splatCount - 1);\n\t\t\te.decompressBaseSplat(t, 0, d, c, p, l, f, u, m, r), n > 0 && e.decompressSphericalHarmonics(t, h, n, o, r);\n\t\t}\n\t\treturn s;\n\t}\n\tstatic parseToUncompressedSplatBuffer(t, n) {\n\t\tlet { chunkElement: r, vertexElement: i, shElement: a, sphericalHarmonicsDegree: o } = e.readPly(t);\n\t\tn = Math.min(n, o);\n\t\tlet { splatBuffer: s, splatBufferDataOffsetBytes: c } = Q.preallocateUncompressed(i.count, n), { positionExtremes: l, scaleExtremes: u, colorExtremes: d, position: f, rotation: p, scale: m, color: h } = e.getElementStorageArrays(r, i), g;\n\t\tif (n > 0) {\n\t\t\tlet { sh: t } = e.getElementStorageArrays(r, void 0, a);\n\t\t\tg = Object.values(t);\n\t\t}\n\t\tlet _ = Q.CompressionLevels[0].SphericalHarmonicsDegrees[n].BytesPerSplat, v = Z.createSplat(n);\n\t\tfor (let t = 0; t < i.count; ++t) {\n\t\t\te.decompressBaseSplat(t, 0, f, l, m, u, p, d, h, v), n > 0 && e.decompressSphericalHarmonics(t, g, n, o, v);\n\t\t\tlet r = t * _ + c;\n\t\t\tQ.writeSplatDataToSectionBuffer(v, s.bufferData, r, 0, n);\n\t\t}\n\t\treturn s;\n\t}\n}, ju = {\n\tINRIAV1: 0,\n\tINRIAV2: 1,\n\tPlayCanvasCompressed: 2\n}, [Mu, Nu, Pu, Fu, Iu, Lu, Ru] = [\n\t0,\n\t1,\n\t2,\n\t3,\n\t4,\n\t5,\n\t6\n], zu = {\n\tdouble: Mu,\n\tint: Nu,\n\tuint: Pu,\n\tfloat: Fu,\n\tshort: Iu,\n\tushort: Lu,\n\tuchar: Ru\n}, Bu = {\n\t[Mu]: 8,\n\t[Nu]: 4,\n\t[Pu]: 4,\n\t[Fu]: 4,\n\t[Iu]: 2,\n\t[Lu]: 2,\n\t[Ru]: 1\n}, Vu = class e {\n\tstatic HeaderEndToken = \"end_header\";\n\tstatic decodeSectionHeader(t, n, r = 0) {\n\t\tlet i = [], a = !1, o = -1, s = 0, c = !1, l = null, u = [], d = [], f = [], p = [], m = {};\n\t\tfor (let h = r; h < t.length; h++) {\n\t\t\tlet g = t[h].trim();\n\t\t\tif (g.startsWith(\"element\")) {\n\t\t\t\tif (a) {\n\t\t\t\t\to--;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\ta = !0, r = h, o = h;\n\t\t\t\t\tlet e = g.split(\" \"), t = 0;\n\t\t\t\t\tfor (let n of e) {\n\t\t\t\t\t\tlet e = n.trim();\n\t\t\t\t\t\te.length > 0 && (t++, t === 2 ? l = e : t === 3 && (s = parseInt(e)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (g.startsWith(\"property\")) {\n\t\t\t\tlet e = g.match(/(\\w+)\\s+(\\w+)\\s+(\\w+)/);\n\t\t\t\tif (e) {\n\t\t\t\t\tlet t = e[2], r = e[3];\n\t\t\t\t\tf.push(r);\n\t\t\t\t\tlet i = n[r];\n\t\t\t\t\tm[r] = t;\n\t\t\t\t\tlet a = zu[t];\n\t\t\t\t\ti !== void 0 && (p.push(r), u.push(i), d[i] = a);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (g === e.HeaderEndToken) {\n\t\t\t\tc = !0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ta && (i.push(g), o++);\n\t\t}\n\t\tlet h = [], g = 0;\n\t\tfor (let e of f) {\n\t\t\tlet t = m[e];\n\t\t\tif (m.hasOwnProperty(e)) {\n\t\t\t\tlet t = n[e];\n\t\t\t\tt !== void 0 && (h[t] = g);\n\t\t\t}\n\t\t\tg += Bu[zu[t]];\n\t\t}\n\t\tlet _ = e.decodeSphericalHarmonicsFromSectionHeader(f, n);\n\t\treturn {\n\t\t\theaderLines: i,\n\t\t\theaderStartLine: r,\n\t\t\theaderEndLine: o,\n\t\t\tfieldTypes: d,\n\t\t\tfieldIds: u,\n\t\t\tfieldOffsets: h,\n\t\t\tbytesPerVertex: g,\n\t\t\tvertexCount: s,\n\t\t\tdataSizeBytes: g * s,\n\t\t\tendOfHeader: c,\n\t\t\tsectionName: l,\n\t\t\tsphericalHarmonicsDegree: _.degree,\n\t\t\tsphericalHarmonicsCoefficientsPerChannel: _.coefficientsPerChannel,\n\t\t\tsphericalHarmonicsDegree1Fields: _.degree1Fields,\n\t\t\tsphericalHarmonicsDegree2Fields: _.degree2Fields\n\t\t};\n\t}\n\tstatic decodeSphericalHarmonicsFromSectionHeader(e, t) {\n\t\tlet n = 0, r = 0;\n\t\tfor (let t of e) t.startsWith(\"f_rest\") && n++;\n\t\tr = n / 3;\n\t\tlet i = 0;\n\t\tr >= 3 && (i = 1), r >= 8 && (i = 2);\n\t\tlet a = [], o = [];\n\t\tfor (let e = 0; e < 3; e++) {\n\t\t\tif (i >= 1) for (let n = 0; n < 3; n++) a.push(t[\"f_rest_\" + (n + r * e)]);\n\t\t\tif (i >= 2) for (let n = 0; n < 5; n++) o.push(t[\"f_rest_\" + (n + r * e + 3)]);\n\t\t}\n\t\treturn {\n\t\t\tdegree: i,\n\t\t\tcoefficientsPerChannel: r,\n\t\t\tdegree1Fields: a,\n\t\t\tdegree2Fields: o\n\t\t};\n\t}\n\tstatic getHeaderSectionNames(e) {\n\t\tlet t = [];\n\t\tfor (let n of e) if (n.startsWith(\"element\")) {\n\t\t\tlet e = n.split(\" \"), r = 0;\n\t\t\tfor (let n of e) {\n\t\t\t\tlet e = n.trim();\n\t\t\t\te.length > 0 && (r++, r === 2 && t.push(e));\n\t\t\t}\n\t\t}\n\t\treturn t;\n\t}\n\tstatic checkTextForEndHeader(t) {\n\t\treturn !!t.includes(e.HeaderEndToken);\n\t}\n\tstatic checkBufferForEndHeader(t, n, r, i) {\n\t\tlet a = new Uint8Array(t, Math.max(0, n - r), r), o = i.decode(a);\n\t\treturn e.checkTextForEndHeader(o);\n\t}\n\tstatic extractHeaderFromBufferToText(t) {\n\t\tlet n = new TextDecoder(), r = 0, i = \"\";\n\t\tfor (;;) {\n\t\t\tif (r + 100 >= t.byteLength) throw Error(\"End of file reached while searching for end of header\");\n\t\t\tlet a = new Uint8Array(t, r, 100);\n\t\t\tif (i += n.decode(a), r += 100, e.checkBufferForEndHeader(t, r, 200, n)) break;\n\t\t}\n\t\treturn i;\n\t}\n\tstatic readHeaderFromBuffer(t) {\n\t\tlet n = new TextDecoder(), r = 0, i = \"\";\n\t\tfor (;;) {\n\t\t\tif (r + 100 >= t.byteLength) throw Error(\"End of file reached while searching for end of header\");\n\t\t\tlet a = new Uint8Array(t, r, 100);\n\t\t\tif (i += n.decode(a), r += 100, e.checkBufferForEndHeader(t, r, 200, n)) break;\n\t\t}\n\t\treturn i;\n\t}\n\tstatic convertHeaderTextToLines(t) {\n\t\tlet n = t.split(\"\\n\"), r = [];\n\t\tfor (let t = 0; t < n.length; t++) {\n\t\t\tlet i = n[t].trim();\n\t\t\tif (r.push(i), i === e.HeaderEndToken) break;\n\t\t}\n\t\treturn r;\n\t}\n\tstatic determineHeaderFormatFromHeaderText(t) {\n\t\tlet n = e.convertHeaderTextToLines(t), r = ju.INRIAV1;\n\t\tfor (let t = 0; t < n.length; t++) {\n\t\t\tlet i = n[t].trim();\n\t\t\tif (i.startsWith(\"element chunk\") || i.match(/[A-Za-z]*packed_[A-Za-z]*/)) r = ju.PlayCanvasCompressed;\n\t\t\telse if (i.startsWith(\"element codebook_centers\")) r = ju.INRIAV2;\n\t\t\telse if (i === e.HeaderEndToken) break;\n\t\t}\n\t\treturn r;\n\t}\n\tstatic determineHeaderFormatFromPlyBuffer(t) {\n\t\tlet n = e.extractHeaderFromBufferToText(t);\n\t\treturn e.determineHeaderFormatFromHeaderText(n);\n\t}\n\tstatic readVertex(e, t, n, r, i, a, o = !0) {\n\t\tlet s = n * t.bytesPerVertex + r, c = t.fieldOffsets, l = t.fieldTypes;\n\t\tfor (let t of i) {\n\t\t\tlet n = l[t];\n\t\t\tn === Fu ? a[t] = e.getFloat32(s + c[t], !0) : n === Iu ? a[t] = e.getInt16(s + c[t], !0) : n === Lu ? a[t] = e.getUint16(s + c[t], !0) : n === Nu ? a[t] = e.getInt32(s + c[t], !0) : n === Pu ? a[t] = e.getUint32(s + c[t], !0) : n === Ru && (a[t] = o ? e.getUint8(s + c[t]) / 255 : e.getUint8(s + c[t]));\n\t\t}\n\t}\n}, Hu = [\n\t\"scale_0\",\n\t\"scale_1\",\n\t\"scale_2\",\n\t\"rot_0\",\n\t\"rot_1\",\n\t\"rot_2\",\n\t\"rot_3\",\n\t\"x\",\n\t\"y\",\n\t\"z\",\n\t\"f_dc_0\",\n\t\"f_dc_1\",\n\t\"f_dc_2\",\n\t\"opacity\",\n\t\"red\",\n\t\"green\",\n\t\"blue\",\n\t\"f_rest_0\"\n], [Uu, Wu, Gu, Ku, qu, Ju, Yu, Xu, Zu, Qu, $u, ed, td, nd, rd, id, ad, od] = Hu.map((e, t) => t), sd = class e {\n\tstatic decodeHeaderLines(e) {\n\t\tlet t = 0;\n\t\te.forEach((e) => {\n\t\t\te.includes(\"f_rest_\") && t++;\n\t\t});\n\t\tlet n = 0;\n\t\tt >= 45 ? n = 45 : t >= 24 ? n = 24 : t >= 9 && (n = 9);\n\t\tlet r = Array.from(Array(Math.max(n - 1, 0))).map((e, t) => `f_rest_${t + 1}`), i = [...Hu, ...r], a = i.map((e, t) => t), o = a.reduce((e, t) => (e[i[t]] = t, e), {}), s = Vu.decodeSectionHeader(e, o, 0);\n\t\treturn s.splatCount = s.vertexCount, s.bytesPerSplat = s.bytesPerVertex, s.fieldsToReadIndexes = a, s;\n\t}\n\tstatic decodeHeaderText(t) {\n\t\tlet n = Vu.convertHeaderTextToLines(t), r = e.decodeHeaderLines(n);\n\t\treturn r.headerText = t, r.headerSizeBytes = t.indexOf(Vu.HeaderEndToken) + Vu.HeaderEndToken.length + 1, r;\n\t}\n\tstatic decodeHeaderFromBuffer(t) {\n\t\tlet n = Vu.readHeaderFromBuffer(t);\n\t\treturn e.decodeHeaderText(n);\n\t}\n\tstatic findSplatData(e, t) {\n\t\treturn new DataView(e, t.headerSizeBytes);\n\t}\n\tstatic parseToUncompressedSplatBufferSection(t, n, r, i, a, o, s, c = 0) {\n\t\tc = Math.min(c, t.sphericalHarmonicsDegree);\n\t\tlet l = Q.CompressionLevels[0].SphericalHarmonicsDegrees[c].BytesPerSplat;\n\t\tfor (let u = n; u <= r; u++) {\n\t\t\tlet n = e.parseToUncompressedSplat(i, u, t, a, c), r = u * l + s;\n\t\t\tQ.writeSplatDataToSectionBuffer(n, o, r, 0, c);\n\t\t}\n\t}\n\tstatic parseToUncompressedSplatArraySection(t, n, r, i, a, o, s = 0) {\n\t\ts = Math.min(s, t.sphericalHarmonicsDegree);\n\t\tfor (let c = n; c <= r; c++) {\n\t\t\tlet n = e.parseToUncompressedSplat(i, c, t, a, s);\n\t\t\to.addSplat(n);\n\t\t}\n\t}\n\tstatic decodeSectionSplatData(t, n, r, i, a = !0) {\n\t\tif (i = Math.min(i, r.sphericalHarmonicsDegree), a) {\n\t\t\tlet a = new Z(i);\n\t\t\tfor (let o = 0; o < n; o++) {\n\t\t\t\tlet n = e.parseToUncompressedSplat(t, o, r, 0, i);\n\t\t\t\ta.addSplat(n);\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t\t{\n\t\t\tlet { splatBuffer: a, splatBufferDataOffsetBytes: o } = Q.preallocateUncompressed(n, i);\n\t\t\treturn e.parseToUncompressedSplatBufferSection(r, 0, n - 1, t, 0, a.bufferData, o, i), a;\n\t\t}\n\t}\n\tstatic parseToUncompressedSplat = function() {\n\t\tlet t = [], n = new ln(), r = Z.OFFSET.X, i = Z.OFFSET.Y, a = Z.OFFSET.Z, o = Z.OFFSET.SCALE0, s = Z.OFFSET.SCALE1, c = Z.OFFSET.SCALE2, l = Z.OFFSET.ROTATION0, u = Z.OFFSET.ROTATION1, d = Z.OFFSET.ROTATION2, f = Z.OFFSET.ROTATION3, p = Z.OFFSET.FDC0, m = Z.OFFSET.FDC1, h = Z.OFFSET.FDC2, g = Z.OFFSET.OPACITY, _ = [];\n\t\tfor (let e = 0; e < 45; e++) _[e] = Z.OFFSET.FRC0 + e;\n\t\treturn function(v, y, b, x = 0, S = 0) {\n\t\t\tS = Math.min(S, b.sphericalHarmonicsDegree), e.readSplat(v, b, y, x, t);\n\t\t\tlet C = Z.createSplat(S);\n\t\t\tif (t[Uu] === void 0 ? (C[o] = .01, C[s] = .01, C[c] = .01) : (C[o] = Math.exp(t[Uu]), C[s] = Math.exp(t[Wu]), C[c] = Math.exp(t[Gu])), t[$u] !== void 0) {\n\t\t\t\tlet e = .28209479177387814;\n\t\t\t\tC[p] = (.5 + e * t[$u]) * 255, C[m] = (.5 + e * t[ed]) * 255, C[h] = (.5 + e * t[td]) * 255;\n\t\t\t} else t[rd] === void 0 ? (C[p] = 0, C[m] = 0, C[h] = 0) : (C[p] = t[rd] * 255, C[m] = t[id] * 255, C[h] = t[ad] * 255);\n\t\t\tif (t[nd] !== void 0 && (C[g] = 1 / (1 + Math.exp(-t[nd])) * 255), C[p] = Zl(Math.floor(C[p]), 0, 255), C[m] = Zl(Math.floor(C[m]), 0, 255), C[h] = Zl(Math.floor(C[h]), 0, 255), C[g] = Zl(Math.floor(C[g]), 0, 255), S >= 1 && t[od] !== void 0) {\n\t\t\t\tfor (let e = 0; e < 9; e++) C[_[e]] = t[b.sphericalHarmonicsDegree1Fields[e]];\n\t\t\t\tif (S >= 2) for (let e = 0; e < 15; e++) C[_[9 + e]] = t[b.sphericalHarmonicsDegree2Fields[e]];\n\t\t\t}\n\t\t\treturn n.set(t[Ku], t[qu], t[Ju], t[Yu]), n.normalize(), C[l] = n.x, C[u] = n.y, C[d] = n.z, C[f] = n.w, C[r] = t[Xu], C[i] = t[Zu], C[a] = t[Qu], C;\n\t\t};\n\t}();\n\tstatic readSplat(e, t, n, r, i) {\n\t\treturn Vu.readVertex(e, t, n, r, t.fieldsToReadIndexes, i, !0);\n\t}\n\tstatic parseToUncompressedSplatArray(t, n = 0) {\n\t\tlet { header: r, splatCount: i, splatData: a } = cd(t);\n\t\treturn e.decodeSectionSplatData(a, i, r, n, !0);\n\t}\n\tstatic parseToUncompressedSplatBuffer(t, n = 0) {\n\t\tlet { header: r, splatCount: i, splatData: a } = cd(t);\n\t\treturn e.decodeSectionSplatData(a, i, r, n, !1);\n\t}\n};\nfunction cd(e) {\n\tlet t = sd.decodeHeaderFromBuffer(e);\n\treturn {\n\t\theader: t,\n\t\tsplatCount: t.splatCount,\n\t\tsplatData: sd.findSplatData(e, t)\n\t};\n}\nvar ld = [\n\t\"features_dc\",\n\t\"features_rest_0\",\n\t\"features_rest_1\",\n\t\"features_rest_2\",\n\t\"features_rest_3\",\n\t\"features_rest_4\",\n\t\"features_rest_5\",\n\t\"features_rest_6\",\n\t\"features_rest_7\",\n\t\"features_rest_8\",\n\t\"features_rest_9\",\n\t\"features_rest_10\",\n\t\"features_rest_11\",\n\t\"features_rest_12\",\n\t\"features_rest_13\",\n\t\"features_rest_14\",\n\t\"opacity\",\n\t\"scaling\",\n\t\"rotation_re\",\n\t\"rotation_im\"\n], ud = ld.map((e, t) => t), [dd, fd, pd, md, hd, gd, _d] = [\n\t0,\n\t1,\n\t4,\n\t16,\n\t17,\n\t18,\n\t19\n], vd = /* @__PURE__ */ \"scale_0.scale_1.scale_2.rot_0.rot_1.rot_2.rot_3.x.y.z.f_dc_0.f_dc_1.f_dc_2.opacity.red.green.blue.f_rest_0.f_rest_1.f_rest_2.f_rest_3.f_rest_4.f_rest_5.f_rest_6.f_rest_7.f_rest_8.f_rest_9.f_rest_10.f_rest_11.f_rest_12.f_rest_13.f_rest_14.f_rest_15.f_rest_16.f_rest_17.f_rest_18.f_rest_19.f_rest_20.f_rest_21.f_rest_22.f_rest_23.f_rest_24.f_rest_25.f_rest_26.f_rest_27.f_rest_28.f_rest_29.f_rest_30.f_rest_31.f_rest_32.f_rest_33.f_rest_34.f_rest_35.f_rest_36.f_rest_37.f_rest_38.f_rest_39.f_rest_40.f_rest_41.f_rest_42.f_rest_43.f_rest_44.f_rest_45\".split(\".\"), yd = vd.map((e, t) => t), [bd, xd, Sd, Cd, wd, Td, Ed, Dd, Od, kd, Ad, jd, Md, Nd] = yd, Pd = Ad, Fd = jd, Id = Md, Ld = (e) => {\n\tlet t = (31744 & e) >> 10, n = 1023 & e;\n\treturn (e >> 15 ? -1 : 1) * (t ? t === 31 ? n ? NaN : 1 / 0 : 2 ** (t - 15) * (1 + n / 1024) : n / 1024 * 6103515625e-14);\n}, Rd = class e {\n\tstatic decodeSectionHeadersFromHeaderLines(e) {\n\t\tlet t = yd.reduce((e, t) => (e[vd[t]] = t, e), {}), n = ud.reduce((e, t) => (e[ld[t]] = t, e), {}), r = Vu.getHeaderSectionNames(e), i;\n\t\tfor (let e = 0; e < r.length; e++) r[e] === \"codebook_centers\" && (i = e);\n\t\tlet a = 0, o = !1, s = [], c = 0;\n\t\tfor (; !o;) {\n\t\t\tlet r;\n\t\t\tr = c === i ? Vu.decodeSectionHeader(e, n, a) : Vu.decodeSectionHeader(e, t, a), o = r.endOfHeader, a = r.headerEndLine + 1, o || (r.splatCount = r.vertexCount, r.bytesPerSplat = r.bytesPerVertex), s.push(r), c++;\n\t\t}\n\t\treturn s;\n\t}\n\tstatic decodeSectionHeadersFromHeaderText(t) {\n\t\tlet n = Vu.convertHeaderTextToLines(t);\n\t\treturn e.decodeSectionHeadersFromHeaderLines(n);\n\t}\n\tstatic getSplatCountFromSectionHeaders(e) {\n\t\tlet t = 0;\n\t\tfor (let n of e) n.sectionName !== \"codebook_centers\" && (t += n.vertexCount);\n\t\treturn t;\n\t}\n\tstatic decodeHeaderFromHeaderText(t) {\n\t\tlet n = t.indexOf(Vu.HeaderEndToken) + Vu.HeaderEndToken.length + 1, r = e.decodeSectionHeadersFromHeaderText(t);\n\t\treturn {\n\t\t\theaderSizeBytes: n,\n\t\t\tsectionHeaders: r,\n\t\t\tsplatCount: e.getSplatCountFromSectionHeaders(r)\n\t\t};\n\t}\n\tstatic decodeHeaderFromBuffer(t) {\n\t\tlet n = Vu.readHeaderFromBuffer(t);\n\t\treturn e.decodeHeaderFromHeaderText(n);\n\t}\n\tstatic findVertexData(e, t, n) {\n\t\tlet r = t.headerSizeBytes;\n\t\tfor (let e = 0; e < n && e < t.sectionHeaders.length; e++) {\n\t\t\tlet n = t.sectionHeaders[e];\n\t\t\tr += n.dataSizeBytes;\n\t\t}\n\t\treturn new DataView(e, r, t.sectionHeaders[n].dataSizeBytes);\n\t}\n\tstatic decodeCodeBook(e, t) {\n\t\tlet n = [], r = [];\n\t\tfor (let i = 0; i < t.vertexCount; i++) {\n\t\t\tVu.readVertex(e, t, i, 0, ud, n);\n\t\t\tfor (let e of ud) {\n\t\t\t\tlet t = ud[e], i = r[t];\n\t\t\t\ti || (r[t] = i = []), i.push(n[e]);\n\t\t\t}\n\t\t}\n\t\tfor (let e = 0; e < r.length; e++) {\n\t\t\tlet t = r[e];\n\t\t\tfor (let n = 0; n < t.length; n++) {\n\t\t\t\tlet r = Ld(t[n]);\n\t\t\t\te === md ? t[n] = Math.round(1 / (1 + Math.exp(-r)) * 255) : e === dd ? t[n] = Math.round((.5 + .28209479177387814 * r) * 255) : e === hd ? t[n] = Math.exp(r) : t[n] = r;\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n\tstatic decodeSectionSplatData(t, n, r, i, a) {\n\t\ta = Math.min(a, r.sphericalHarmonicsDegree);\n\t\tlet o = new Z(a);\n\t\tfor (let s = 0; s < n; s++) {\n\t\t\tlet n = e.parseToUncompressedSplat(t, s, r, i, 0, a);\n\t\t\to.addSplat(n);\n\t\t}\n\t\treturn o;\n\t}\n\tstatic parseToUncompressedSplat = function() {\n\t\tlet t = [], n = new ln(), r = Z.OFFSET.X, i = Z.OFFSET.Y, a = Z.OFFSET.Z, o = Z.OFFSET.SCALE0, s = Z.OFFSET.SCALE1, c = Z.OFFSET.SCALE2, l = Z.OFFSET.ROTATION0, u = Z.OFFSET.ROTATION1, d = Z.OFFSET.ROTATION2, f = Z.OFFSET.ROTATION3, p = Z.OFFSET.FDC0, m = Z.OFFSET.FDC1, h = Z.OFFSET.FDC2, g = Z.OFFSET.OPACITY, _ = [];\n\t\tfor (let e = 0; e < 45; e++) _[e] = Z.OFFSET.FRC0 + e;\n\t\treturn function(v, y, b, x, S = 0, C = 0) {\n\t\t\tC = Math.min(C, b.sphericalHarmonicsDegree), e.readSplat(v, b, y, S, t);\n\t\t\tlet w = Z.createSplat(C);\n\t\t\tif (t[bd] === void 0 ? (w[o] = .01, w[s] = .01, w[c] = .01) : (w[o] = x[hd][t[bd]], w[s] = x[hd][t[xd]], w[c] = x[hd][t[Sd]]), t[Ad] === void 0 ? t[Pd] === void 0 ? (w[p] = 0, w[m] = 0, w[h] = 0) : (w[p] = t[Pd] * 255, w[m] = t[Fd] * 255, w[h] = t[Id] * 255) : (w[p] = x[dd][t[Ad]], w[m] = x[dd][t[jd]], w[h] = x[dd][t[Md]]), t[Nd] !== void 0 && (w[g] = x[md][t[Nd]]), w[p] = Zl(Math.floor(w[p]), 0, 255), w[m] = Zl(Math.floor(w[m]), 0, 255), w[h] = Zl(Math.floor(w[h]), 0, 255), w[g] = Zl(Math.floor(w[g]), 0, 255), C >= 1 && b.sphericalHarmonicsDegree >= 1) {\n\t\t\t\tfor (let e = 0; e < 9; e++) {\n\t\t\t\t\tlet n = x[fd + e % 3];\n\t\t\t\t\tw[_[e]] = n[t[b.sphericalHarmonicsDegree1Fields[e]]];\n\t\t\t\t}\n\t\t\t\tif (C >= 2 && b.sphericalHarmonicsDegree >= 2) for (let e = 0; e < 15; e++) {\n\t\t\t\t\tlet n = x[pd + e % 5];\n\t\t\t\t\tw[_[9 + e]] = n[t[b.sphericalHarmonicsDegree2Fields[e]]];\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet T = x[gd][t[Cd]], E = x[_d][t[wd]], D = x[_d][t[Td]], O = x[_d][t[Ed]];\n\t\t\treturn n.set(T, E, D, O), n.normalize(), w[l] = n.x, w[u] = n.y, w[d] = n.z, w[f] = n.w, w[r] = Ld(t[Dd]), w[i] = Ld(t[Od]), w[a] = Ld(t[kd]), w;\n\t\t};\n\t}();\n\tstatic readSplat(e, t, n, r, i) {\n\t\treturn Vu.readVertex(e, t, n, r, yd, i, !1);\n\t}\n\tstatic parseToUncompressedSplatArray(t, n = 0) {\n\t\tlet r = [], i = e.decodeHeaderFromBuffer(t, n), a;\n\t\tfor (let n = 0; n < i.sectionHeaders.length; n++) {\n\t\t\tlet r = i.sectionHeaders[n];\n\t\t\tif (r.sectionName === \"codebook_centers\") {\n\t\t\t\tlet o = e.findVertexData(t, i, n);\n\t\t\t\ta = e.decodeCodeBook(o, r);\n\t\t\t}\n\t\t}\n\t\tfor (let o = 0; o < i.sectionHeaders.length; o++) {\n\t\t\tlet s = i.sectionHeaders[o];\n\t\t\tif (s.sectionName !== \"codebook_centers\") {\n\t\t\t\tlet c = s.vertexCount, l = e.findVertexData(t, i, o), u = e.decodeSectionSplatData(l, c, s, a, n);\n\t\t\t\tr.push(u);\n\t\t\t}\n\t\t}\n\t\tlet o = new Z(n);\n\t\tfor (let e of r) for (let t of e.splats) o.addSplat(t);\n\t\treturn o;\n\t}\n}, zd = class {\n\tstatic parseToUncompressedSplatArray(e, t = 0) {\n\t\tlet n = Vu.determineHeaderFormatFromPlyBuffer(e);\n\t\tif (n === ju.PlayCanvasCompressed) return Au.parseToUncompressedSplatArray(e, t);\n\t\tif (n === ju.INRIAV1) return sd.parseToUncompressedSplatArray(e, t);\n\t\tif (n === ju.INRIAV2) return Rd.parseToUncompressedSplatArray(e, t);\n\t}\n\tstatic parseToUncompressedSplatBuffer(e, t = 0) {\n\t\tlet n = Vu.determineHeaderFormatFromPlyBuffer(e);\n\t\tif (n === ju.PlayCanvasCompressed) return Au.parseToUncompressedSplatBuffer(e, t);\n\t\tif (n === ju.INRIAV1) return sd.parseToUncompressedSplatBuffer(e, t);\n\t\tif (n === ju.INRIAV2) throw Error(\"parseToUncompressedSplatBuffer() is not implemented for INRIA V2 PLY files\");\n\t}\n}, Bd = class e {\n\tconstructor(e, t, n, r) {\n\t\tthis.sectionCount = e, this.sectionFilters = t, this.groupingParameters = n, this.partitionGenerator = r;\n\t}\n\tpartitionUncompressedSplatArray(e) {\n\t\tlet t, n, r;\n\t\tif (this.partitionGenerator) {\n\t\t\tlet i = this.partitionGenerator(e);\n\t\t\tt = i.groupingParameters, n = i.sectionCount, r = i.sectionFilters;\n\t\t} else t = this.groupingParameters, n = this.sectionCount, r = this.sectionFilters;\n\t\tlet i = [];\n\t\tfor (let t = 0; t < n; t++) {\n\t\t\tlet n = new Z(e.sphericalHarmonicsDegree), a = r[t];\n\t\t\tfor (let t = 0; t < e.splatCount; t++) a(t) && n.addSplat(e.splats[t]);\n\t\t\ti.push(n);\n\t\t}\n\t\treturn {\n\t\t\tsplatArrays: i,\n\t\t\tparameters: t\n\t\t};\n\t}\n\tstatic getStandardPartitioner(t = 0, n = new K(), r = Q.BucketBlockSize, i = Q.BucketSize) {\n\t\treturn new e(void 0, void 0, void 0, (e) => {\n\t\t\tlet a = Z.OFFSET.X, o = Z.OFFSET.Y, s = Z.OFFSET.Z;\n\t\t\tt <= 0 && (t = e.splatCount);\n\t\t\tlet c = new K(), l = .5, u = (e) => {\n\t\t\t\te.x = Math.floor(e.x / l) * l, e.y = Math.floor(e.y / l) * l, e.z = Math.floor(e.z / l) * l;\n\t\t\t};\n\t\t\te.splats.forEach((e) => {\n\t\t\t\tc.set(e[a], e[o], e[s]).sub(n), u(c), e.centerDist = c.lengthSq();\n\t\t\t}), e.splats.sort((e, t) => e.centerDist > t.centerDist ? 1 : -1);\n\t\t\tlet d = [], f = [];\n\t\t\tt = Math.min(e.splatCount, t);\n\t\t\tlet p = Math.ceil(e.splatCount / t), m = 0;\n\t\t\tfor (let e = 0; e < p; e++) {\n\t\t\t\tlet e = m;\n\t\t\t\td.push((n) => n >= e && n < e + t), f.push({\n\t\t\t\t\tblocksSize: r,\n\t\t\t\t\tbucketSize: i\n\t\t\t\t}), m += t;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tsectionCount: d.length,\n\t\t\t\tsectionFilters: d,\n\t\t\t\tgroupingParameters: f\n\t\t\t};\n\t\t});\n\t}\n}, Vd = class e {\n\tconstructor(e, t, n, r, i, a, o) {\n\t\tthis.splatPartitioner = e, this.alphaRemovalThreshold = t, this.compressionLevel = n, this.sectionSize = r, this.sceneCenter = i ? new K().copy(i) : void 0, this.blockSize = a, this.bucketSize = o;\n\t}\n\tgenerateFromUncompressedSplatArray(e) {\n\t\tlet t = this.splatPartitioner.partitionUncompressedSplatArray(e);\n\t\treturn Q.generateFromUncompressedSplatArrays(t.splatArrays, this.alphaRemovalThreshold, this.compressionLevel, this.sceneCenter, this.blockSize, this.bucketSize, t.parameters);\n\t}\n\tstatic getStandardGenerator(t = 1, n = 1, r = 0, i = new K(), a = Q.BucketBlockSize, o = Q.BucketSize) {\n\t\tlet s = Bd.getStandardPartitioner(r, i, a, o);\n\t\treturn new e(s, t, n, r, i, a, o);\n\t}\n}, Hd = {\n\tDownloading: 0,\n\tProcessing: 1,\n\tDone: 2\n}, Ud = class extends Error {\n\tconstructor(e) {\n\t\tsuper(e);\n\t}\n}, Wd = {\n\tProgressiveToSplatBuffer: 0,\n\tProgressiveToSplatArray: 1,\n\tDownloadBeforeProcessing: 2\n};\nfunction Gd(e, t) {\n\tlet n = 0;\n\tfor (let t of e) n += t.sizeBytes;\n\t(!t || t.byteLength < n) && (t = new ArrayBuffer(n));\n\tlet r = 0;\n\tfor (let n of e) new Uint8Array(t, r, n.sizeBytes).set(n.data), r += n.sizeBytes;\n\treturn t;\n}\nfunction Kd(e, t, n, r, i, a, o, s) {\n\treturn t ? Vd.getStandardGenerator(n, r, i, a, o, s).generateFromUncompressedSplatArray(e) : Q.generateFromUncompressedSplatArrays([e], n, 0, new K());\n}\nvar qd = class e {\n\tstatic loadFromURL(t, n, r, i, a, o, s = !0, c = 0, l, u, d, f, p) {\n\t\tlet m;\n\t\tm = !r && !s ? Wd.DownloadBeforeProcessing : s ? Wd.ProgressiveToSplatArray : Wd.ProgressiveToSplatBuffer;\n\t\tlet h = cu.ProgressiveLoadSectionSize, g = Q.HeaderSizeBytes + Q.SectionHeaderSizeBytes, _, v, y, b, x, S = 0, C = 0, w = 0, T = !1, E = !1, D = !1, O = nu(), k = 0, A = 0, j = 0, M = 0, N = \"\", P = null, F = [], I, ee = new TextDecoder();\n\t\treturn n && n(0, \"0%\", Hd.Downloading), Xl(t, (e, t, r) => {\n\t\t\tlet a = e >= 100;\n\t\t\tif (r && (F.push({\n\t\t\t\tdata: r,\n\t\t\t\tsizeBytes: r.byteLength,\n\t\t\t\tstartBytes: j,\n\t\t\t\tendBytes: j + r.byteLength\n\t\t\t}), j += r.byteLength), m === Wd.DownloadBeforeProcessing) a && O.resolve(F);\n\t\t\telse {\n\t\t\t\tif (!T) {\n\t\t\t\t\tif (N += ee.decode(r), Vu.checkTextForEndHeader(N)) {\n\t\t\t\t\t\tif (_ = Vu.determineHeaderFormatFromHeaderText(N), _ === ju.INRIAV1) P = sd.decodeHeaderText(N), c = Math.min(c, P.sphericalHarmonicsDegree), S = P.splatCount, E = !0, M = P.headerSizeBytes + P.bytesPerSplat * S;\n\t\t\t\t\t\telse if (_ === ju.PlayCanvasCompressed) {\n\t\t\t\t\t\t\tif (P = Au.decodeHeaderText(N), c = Math.min(c, P.sphericalHarmonicsDegree), m === Wd.ProgressiveToSplatBuffer && c > 0) throw new Ud(\"PlyLoader.loadFromURL() -> Selected PLY format has spherical harmonics data that cannot be progressively loaded.\");\n\t\t\t\t\t\t\tS = P.vertexElement.count, M = P.headerSizeBytes + P.bytesPerSplat * S + P.chunkElement.storageSizeBytes;\n\t\t\t\t\t\t} else if (m === Wd.ProgressiveToSplatBuffer) throw new Ud(\"PlyLoader.loadFromURL() -> Selected PLY format cannot be progressively loaded.\");\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tm = Wd.DownloadBeforeProcessing;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === Wd.ProgressiveToSplatBuffer) {\n\t\t\t\t\t\t\tlet e = Q.CompressionLevels[0].SphericalHarmonicsDegrees[c], t = g + e.BytesPerSplat * S;\n\t\t\t\t\t\t\ty = new ArrayBuffer(t), Q.writeHeaderToBuffer({\n\t\t\t\t\t\t\t\tversionMajor: Q.CurrentMajorVersion,\n\t\t\t\t\t\t\t\tversionMinor: Q.CurrentMinorVersion,\n\t\t\t\t\t\t\t\tmaxSectionCount: 1,\n\t\t\t\t\t\t\t\tsectionCount: 1,\n\t\t\t\t\t\t\t\tmaxSplatCount: S,\n\t\t\t\t\t\t\t\tsplatCount: 0,\n\t\t\t\t\t\t\t\tcompressionLevel: 0,\n\t\t\t\t\t\t\t\tsceneCenter: new K()\n\t\t\t\t\t\t\t}, y);\n\t\t\t\t\t\t} else I = new Z(c);\n\t\t\t\t\t\tk = P.headerSizeBytes, A = P.headerSizeBytes, T = !0;\n\t\t\t\t\t}\n\t\t\t\t} else if (_ === ju.PlayCanvasCompressed && !E) {\n\t\t\t\t\tlet e = P.headerSizeBytes + P.chunkElement.storageSizeBytes;\n\t\t\t\t\tx = Gd(F, x), x.byteLength >= e && (Au.readElementData(P.chunkElement, x, P.headerSizeBytes), k = e, A = e, E = !0);\n\t\t\t\t}\n\t\t\t\tif (T && E && F.length > 0 && (v = Gd(F, v), j - k > h || j >= M && !D || a)) {\n\t\t\t\t\tlet e = D ? P.sphericalHarmonicsPerSplat : P.bytesPerSplat, t = (D ? j : Math.min(M, j)) - A, n = Math.floor(t / e), r = n * e, i = j - A - r, a = A - F[0].startBytes, o = new DataView(v, a, r);\n\t\t\t\t\tif (D) _ === ju.PlayCanvasCompressed && m === Wd.ProgressiveToSplatArray && (Au.parseSphericalHarmonicsToUncompressedSplatArraySection(P.chunkElement, P.shElement, w, w + n - 1, o, 0, c, P.sphericalHarmonicsDegree, I), w += n);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (m === Wd.ProgressiveToSplatBuffer) {\n\t\t\t\t\t\t\tlet e = Q.CompressionLevels[0].SphericalHarmonicsDegrees[c], t = C * e.BytesPerSplat + g;\n\t\t\t\t\t\t\t_ === ju.PlayCanvasCompressed ? Au.parseToUncompressedSplatBufferSection(P.chunkElement, P.vertexElement, 0, n - 1, C, o, y, t) : sd.parseToUncompressedSplatBufferSection(P, 0, n - 1, o, 0, y, t, c);\n\t\t\t\t\t\t} else _ === ju.PlayCanvasCompressed ? Au.parseToUncompressedSplatArraySection(P.chunkElement, P.vertexElement, 0, n - 1, C, o, I) : sd.parseToUncompressedSplatArraySection(P, 0, n - 1, o, 0, I, c);\n\t\t\t\t\t\tC += n, m === Wd.ProgressiveToSplatBuffer && (b ||= (Q.writeSectionHeaderToBuffer({\n\t\t\t\t\t\t\tmaxSplatCount: S,\n\t\t\t\t\t\t\tsplatCount: C,\n\t\t\t\t\t\t\tbucketSize: 0,\n\t\t\t\t\t\t\tbucketCount: 0,\n\t\t\t\t\t\t\tbucketBlockSize: 0,\n\t\t\t\t\t\t\tcompressionScaleRange: 0,\n\t\t\t\t\t\t\tstorageSizeBytes: 0,\n\t\t\t\t\t\t\tfullBucketCount: 0,\n\t\t\t\t\t\t\tpartiallyFilledBucketCount: 0,\n\t\t\t\t\t\t\tsphericalHarmonicsDegree: c\n\t\t\t\t\t\t}, 0, y, Q.HeaderSizeBytes), new Q(y, !1)), b.updateLoadedCounts(1, C)), j >= M && (D = !0);\n\t\t\t\t\t}\n\t\t\t\t\tif (i === 0) F = [];\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet e = [], t = 0;\n\t\t\t\t\t\tfor (let n = F.length - 1; n >= 0; n--) {\n\t\t\t\t\t\t\tlet r = F[n];\n\t\t\t\t\t\t\tif (t += r.sizeBytes, e.unshift(r), t >= i) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tF = e;\n\t\t\t\t\t}\n\t\t\t\t\tk += h, A += r;\n\t\t\t\t}\n\t\t\t\ti && b && i(b, a), a && (m === Wd.ProgressiveToSplatBuffer ? O.resolve(b) : O.resolve(I));\n\t\t\t}\n\t\t\tn && n(e, t, Hd.Downloading);\n\t\t}, !1, l).then(() => (n && n(0, \"0%\", Hd.Processing), O.promise.then((t) => {\n\t\t\tif (n && n(100, \"100%\", Hd.Done), m === Wd.DownloadBeforeProcessing) {\n\t\t\t\tlet t = F.map((e) => e.data);\n\t\t\t\treturn new Blob(t).arrayBuffer().then((t) => e.loadFromFileData(t, a, o, s, c, u, d, f, p));\n\t\t\t}\n\t\t\treturn m === Wd.ProgressiveToSplatBuffer ? t : eu(() => Kd(t, s, a, o, u, d, f, p));\n\t\t})));\n\t}\n\tstatic loadFromFileData(e, t, n, r, i = 0, a, o, s, c) {\n\t\treturn r ? eu(() => zd.parseToUncompressedSplatArray(e, i)).then((e) => Kd(e, r, t, n, a, o, s, c)) : eu(() => zd.parseToUncompressedSplatBuffer(e, i));\n\t}\n}, Jd = (e) => new ReadableStream({ async start(t) {\n\tt.enqueue(e), t.close();\n} });\nasync function Yd(e) {\n\ttry {\n\t\tlet t = Jd(e);\n\t\tif (!t) throw Error(\"Failed to create stream from data\");\n\t\treturn await Xd(t);\n\t} catch (e) {\n\t\tthrow console.error(\"Error decompressing gzipped data:\", e), e;\n\t}\n}\nasync function Xd(e) {\n\tlet t = e.pipeThrough(new DecompressionStream(\"gzip\")), n = await new Response(t).arrayBuffer();\n\treturn new Uint8Array(n);\n}\nvar Zd = 1347635022, Qd = 1, $d = .15;\nfunction ef(e) {\n\tlet t = e >> 15 & 1, n = e >> 10 & 31, r = e & 1023, i = t === 1 ? -1 : 1;\n\treturn n === 0 ? i * 2 ** -14 * r / 1024 : n === 31 ? r === 0 ? i * Infinity : NaN : i * 2 ** (n - 15) * (1 + r / 1024);\n}\nfunction tf(e) {\n\treturn (e - 128) / 128;\n}\nfunction nf(e) {\n\tswitch (e) {\n\t\tcase 0: return 0;\n\t\tcase 1: return 3;\n\t\tcase 2: return 8;\n\t\tcase 3: return 15;\n\t\tdefault: return console.error(`[SPZ: ERROR] Unsupported SH degree: ${e}`), 0;\n\t}\n}\nvar rf = function() {\n\tlet e = [], t = new ln(), n = Z.OFFSET.X, r = Z.OFFSET.Y, i = Z.OFFSET.Z, a = Z.OFFSET.SCALE0, o = Z.OFFSET.SCALE1, s = Z.OFFSET.SCALE2, c = Z.OFFSET.ROTATION0, l = Z.OFFSET.ROTATION1, u = Z.OFFSET.ROTATION2, d = Z.OFFSET.ROTATION3, f = Z.OFFSET.FDC0, p = Z.OFFSET.FDC1, m = Z.OFFSET.FDC2, h = Z.OFFSET.OPACITY, g = [];\n\tfor (let e = 0; e < 45; e++) g[e] = Z.OFFSET.FRC0 + e;\n\tlet _ = [\n\t\tnf(0),\n\t\tnf(1),\n\t\tnf(2),\n\t\tnf(3)\n\t], v = [\n\t\t0,\n\t\t1,\n\t\t2,\n\t\t9,\n\t\t10,\n\t\t11,\n\t\t12,\n\t\t13,\n\t\t24,\n\t\t25,\n\t\t26,\n\t\t27,\n\t\t28,\n\t\t29,\n\t\t30,\n\t\t3,\n\t\t4,\n\t\t5,\n\t\t14,\n\t\t15,\n\t\t16,\n\t\t17,\n\t\t18,\n\t\t31,\n\t\t32,\n\t\t33,\n\t\t34,\n\t\t35,\n\t\t36,\n\t\t37,\n\t\t6,\n\t\t7,\n\t\t8,\n\t\t19,\n\t\t20,\n\t\t21,\n\t\t22,\n\t\t23,\n\t\t38,\n\t\t39,\n\t\t40,\n\t\t41,\n\t\t42,\n\t\t43,\n\t\t44\n\t];\n\treturn function(g, y, b) {\n\t\tb = Math.min(y, b);\n\t\tlet x = Z.createSplat(b);\n\t\tg.scale[0] === void 0 ? (x[a] = .01, x[o] = .01, x[s] = .01) : (x[a] = g.scale[0], x[o] = g.scale[1], x[s] = g.scale[2]), g.color[0] === void 0 ? e[RED] === void 0 ? (x[f] = 0, x[p] = 0, x[m] = 0) : (x[f] = e[RED] * 255, x[p] = e[GREEN] * 255, x[m] = e[BLUE] * 255) : (x[f] = g.color[0], x[p] = g.color[1], x[m] = g.color[2]), g.alpha !== void 0 && (x[h] = g.alpha), x[f] = Zl(Math.floor(x[f]), 0, 255), x[p] = Zl(Math.floor(x[p]), 0, 255), x[m] = Zl(Math.floor(x[m]), 0, 255), x[h] = Zl(Math.floor(x[h]), 0, 255);\n\t\tlet S = _[b], C = _[y];\n\t\tfor (let e = 0; e < 3; ++e) for (let t = 0; t < 15; ++t) {\n\t\t\tlet n = v[e * 15 + t];\n\t\t\tt < S && t < C && (x[Z.OFFSET.FRC0 + n] = g.sh[e * C + t]);\n\t\t}\n\t\treturn t.set(g.rotation[3], g.rotation[0], g.rotation[1], g.rotation[2]), t.normalize(), x[c] = t.x, x[l] = t.y, x[u] = t.z, x[d] = t.w, x[n] = g.position[0], x[r] = g.position[1], x[i] = g.position[2], x;\n\t};\n}();\nfunction af(e, t, n, r) {\n\treturn e.positions.length === t * 3 * (r ? 2 : 3) && e.scales.length === t * 3 && e.rotations.length === t * 3 && e.alphas.length === t && e.colors.length === t * 3 && e.sh.length === t * n * 3;\n}\nfunction of(e, t, n, r, i) {\n\tt = Math.min(t, e.shDegree);\n\tlet a = e.numPoints, o = nf(e.shDegree), s = e.positions.length === a * 3 * 2;\n\tif (!af(e, a, o, s)) return null;\n\tlet c = {\n\t\tposition: [],\n\t\tscale: [],\n\t\trotation: [],\n\t\talpha: void 0,\n\t\tcolor: [],\n\t\tsh: []\n\t}, l;\n\ts && (l = new Uint16Array(e.positions.buffer, e.positions.byteOffset, a * 3));\n\tlet u = 1 / (1 << e.fractionalBits), d = nf(e.shDegree);\n\tfor (let o = 0; o < a; o++) {\n\t\tif (s) for (let e = 0; e < 3; e++) c.position[e] = ef(l[o * 3 + e]);\n\t\telse for (let t = 0; t < 3; t++) {\n\t\t\tlet n = o * 9 + t * 3, r = e.positions[n];\n\t\t\tr |= e.positions[n + 1] << 8, r |= e.positions[n + 2] << 16, r |= r & 8388608 ? 4278190080 : 0, c.position[t] = r * u;\n\t\t}\n\t\tfor (let t = 0; t < 3; t++) c.scale[t] = Math.exp(e.scales[o * 3 + t] / 16 - 10);\n\t\tlet a = e.rotations.subarray(o * 3, o * 3 + 3), f = [\n\t\t\ta[0] / 127.5 - 1,\n\t\t\ta[1] / 127.5 - 1,\n\t\t\ta[2] / 127.5 - 1\n\t\t];\n\t\tc.rotation[0] = f[0], c.rotation[1] = f[1], c.rotation[2] = f[2];\n\t\tlet p = f[0] * f[0] + f[1] * f[1] + f[2] * f[2];\n\t\tc.rotation[3] = Math.sqrt(Math.max(0, 1 - p)), c.alpha = Math.floor(e.alphas[o]);\n\t\tfor (let t = 0; t < 3; t++) c.color[t] = Math.floor(((e.colors[o * 3 + t] / 255 - .5) / $d * .28209479177387814 + .5) * 255);\n\t\tfor (let t = 0; t < 3; t++) for (let n = 0; n < d; n++) c.sh[t * d + n] = tf(e.sh[d * 3 * o + n * 3 + t]);\n\t\tlet m = rf(c, e.shDegree, t);\n\t\tif (n) {\n\t\t\tlet e = Q.CompressionLevels[0].SphericalHarmonicsDegrees[t].BytesPerSplat, n = o * e + i;\n\t\t\tQ.writeSplatDataToSectionBuffer(m, r, n, 0, t);\n\t\t} else r.addSplat(m);\n\t}\n}\nvar sf = 16, cf = 1e7;\nfunction lf(e) {\n\tlet t = new DataView(e), n = 0, r = {\n\t\tmagic: t.getUint32(n, !0),\n\t\tversion: t.getUint32(n + 4, !0),\n\t\tnumPoints: t.getUint32(n + 8, !0),\n\t\tshDegree: t.getUint8(n + 12),\n\t\tfractionalBits: t.getUint8(n + 13),\n\t\tflags: t.getUint8(n + 14),\n\t\treserved: t.getUint8(n + 15)\n\t};\n\tif (n += sf, r.magic !== Zd) return console.error(\"[SPZ ERROR] deserializePackedGaussians: header not found\"), null;\n\tif (r.version < 1 || r.version > 2) return console.error(`[SPZ ERROR] deserializePackedGaussians: version not supported: ${r.version}`), null;\n\tif (r.numPoints > cf) return console.error(`[SPZ ERROR] deserializePackedGaussians: Too many points: ${r.numPoints}`), null;\n\tif (r.shDegree > 3) return console.error(`[SPZ ERROR] deserializePackedGaussians: Unsupported SH degree: ${r.shDegree}`), null;\n\tlet i = r.numPoints, a = nf(r.shDegree), o = r.version === 1, s = {\n\t\tnumPoints: i,\n\t\tshDegree: r.shDegree,\n\t\tfractionalBits: r.fractionalBits,\n\t\tantialiased: (r.flags & Qd) !== 0,\n\t\tpositions: new Uint8Array(i * 3 * (o ? 2 : 3)),\n\t\tscales: new Uint8Array(i * 3),\n\t\trotations: new Uint8Array(i * 3),\n\t\talphas: new Uint8Array(i),\n\t\tcolors: new Uint8Array(i * 3),\n\t\tsh: new Uint8Array(i * a * 3)\n\t};\n\ttry {\n\t\tlet t = new Uint8Array(e), r = s.positions.length, i = n;\n\t\tif (s.positions.set(t.slice(i, i + r)), i += r, s.alphas.set(t.slice(i, i + s.alphas.length)), i += s.alphas.length, s.colors.set(t.slice(i, i + s.colors.length)), i += s.colors.length, s.scales.set(t.slice(i, i + s.scales.length)), i += s.scales.length, s.rotations.set(t.slice(i, i + s.rotations.length)), i += s.rotations.length, s.sh.set(t.slice(i, i + s.sh.length)), i + s.sh.length !== e.byteLength) return console.error(\"[SPZ ERROR] deserializePackedGaussians: incorrect buffer size\"), null;\n\t} catch (e) {\n\t\treturn console.error(\"[SPZ ERROR] deserializePackedGaussians: read error\", e), null;\n\t}\n\treturn s;\n}\nasync function uf(e) {\n\ttry {\n\t\treturn lf((await Yd(e)).buffer);\n\t} catch (e) {\n\t\treturn console.error(\"[SPZ ERROR] loadSpzPacked: decompression error\", e), null;\n\t}\n}\nvar df = class e {\n\tstatic loadFromURL(t, n, r, i, a = !0, o = 0, s, c, l, u, d) {\n\t\treturn n && n(0, \"0%\", Hd.Downloading), Xl(t, n, !0, s).then((t) => (n && n(0, \"0%\", Hd.Processing), e.loadFromFileData(t, r, i, a, o, c, l, u, d)));\n\t}\n\tstatic async loadFromFileData(e, t, n, r, i = 0, a, o, s, c) {\n\t\tawait eu();\n\t\tlet l = await uf(e);\n\t\ti = Math.min(l.shDegree, i);\n\t\tlet u = new Z(i);\n\t\tif (r) return of(l, i, !1, u, 0), Vd.getStandardGenerator(t, n, a, o, s, c).generateFromUncompressedSplatArray(u);\n\t\t{\n\t\t\tlet { splatBuffer: e, splatBufferDataOffsetBytes: t } = Q.preallocateUncompressed(l.numPoints, i);\n\t\t\treturn of(l, i, !0, e.bufferData, t), e;\n\t\t}\n\t}\n}, ff = class e {\n\tstatic RowSizeBytes = 32;\n\tstatic CenterSizeBytes = 12;\n\tstatic ScaleSizeBytes = 12;\n\tstatic RotationSizeBytes = 4;\n\tstatic ColorSizeBytes = 4;\n\tstatic parseToUncompressedSplatBufferSection(t, n, r, i, a, o) {\n\t\tlet s = Q.CompressionLevels[0].BytesPerCenter, c = Q.CompressionLevels[0].BytesPerScale, l = Q.CompressionLevels[0].BytesPerRotation, u = Q.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat;\n\t\tfor (let d = t; d <= n; d++) {\n\t\t\tlet t = d * e.RowSizeBytes + i, n = new Float32Array(r, t, 3), f = new Float32Array(r, t + e.CenterSizeBytes, 3), p = new Uint8Array(r, t + e.CenterSizeBytes + e.ScaleSizeBytes, 4), m = new Uint8Array(r, t + e.CenterSizeBytes + e.ScaleSizeBytes + e.RotationSizeBytes, 4), h = new ln((m[1] - 128) / 128, (m[2] - 128) / 128, (m[3] - 128) / 128, (m[0] - 128) / 128);\n\t\t\th.normalize();\n\t\t\tlet g = d * u + o, _ = new Float32Array(a, g, 3), v = new Float32Array(a, g + s, 3), y = new Float32Array(a, g + s + c, 4), b = new Uint8Array(a, g + s + c + l, 4);\n\t\t\t_[0] = n[0], _[1] = n[1], _[2] = n[2], v[0] = f[0], v[1] = f[1], v[2] = f[2], y[0] = h.w, y[1] = h.x, y[2] = h.y, y[3] = h.z, b[0] = p[0], b[1] = p[1], b[2] = p[2], b[3] = p[3];\n\t\t}\n\t}\n\tstatic parseToUncompressedSplatArraySection(t, n, r, i, a) {\n\t\tfor (let o = t; o <= n; o++) {\n\t\t\tlet t = o * e.RowSizeBytes + i, n = new Float32Array(r, t, 3), s = new Float32Array(r, t + e.CenterSizeBytes, 3), c = new Uint8Array(r, t + e.CenterSizeBytes + e.ScaleSizeBytes, 4), l = new Uint8Array(r, t + e.CenterSizeBytes + e.ScaleSizeBytes + e.RotationSizeBytes, 4), u = new ln((l[1] - 128) / 128, (l[2] - 128) / 128, (l[3] - 128) / 128, (l[0] - 128) / 128);\n\t\t\tu.normalize(), a.addSplatFromComonents(n[0], n[1], n[2], s[0], s[1], s[2], u.w, u.x, u.y, u.z, c[0], c[1], c[2], c[3]);\n\t\t}\n\t}\n\tstatic parseStandardSplatToUncompressedSplatArray(t) {\n\t\tlet n = t.byteLength / e.RowSizeBytes, r = new Z();\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet n = i * e.RowSizeBytes, a = new Float32Array(t, n, 3), o = new Float32Array(t, n + e.CenterSizeBytes, 3), s = new Uint8Array(t, n + e.CenterSizeBytes + e.ScaleSizeBytes, 4), c = new Uint8Array(t, n + e.CenterSizeBytes + e.ScaleSizeBytes + e.ColorSizeBytes, 4), l = new ln((c[1] - 128) / 128, (c[2] - 128) / 128, (c[3] - 128) / 128, (c[0] - 128) / 128);\n\t\t\tl.normalize(), r.addSplatFromComonents(a[0], a[1], a[2], o[0], o[1], o[2], l.w, l.x, l.y, l.z, s[0], s[1], s[2], s[3]);\n\t\t}\n\t\treturn r;\n\t}\n};\nfunction pf(e, t, n, r, i, a, o, s) {\n\treturn t ? Vd.getStandardGenerator(n, r, i, a, o, s).generateFromUncompressedSplatArray(e) : Q.generateFromUncompressedSplatArrays([e], n, 0, new K());\n}\nvar mf = class e {\n\tstatic loadFromURL(t, n, r, i, a, o, s = !0, c, l, u, d, f) {\n\t\tlet p = r ? Wd.ProgressiveToSplatBuffer : Wd.ProgressiveToSplatArray;\n\t\ts && (p = Wd.ProgressiveToSplatArray);\n\t\tlet m = Q.HeaderSizeBytes + Q.SectionHeaderSizeBytes, h = cu.ProgressiveLoadSectionSize, g, _, v, y = 0, b = 0, x, S = nu(), C = 0, w = 0, T = [];\n\t\treturn n && n(0, \"0%\", Hd.Downloading), Xl(t, (e, t, a, o) => {\n\t\t\tlet s = e >= 100;\n\t\t\tif (a && T.push(a), p === Wd.DownloadBeforeProcessing) {\n\t\t\t\ts && S.resolve(T);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!o) {\n\t\t\t\tif (r) throw new Ud(\"Cannon directly load .splat because no file size info is available.\");\n\t\t\t\tp = Wd.DownloadBeforeProcessing;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!g) {\n\t\t\t\ty = o / ff.RowSizeBytes, g = new ArrayBuffer(o);\n\t\t\t\tlet e = Q.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, t = m + e * y;\n\t\t\t\tp === Wd.ProgressiveToSplatBuffer ? (_ = new ArrayBuffer(t), Q.writeHeaderToBuffer({\n\t\t\t\t\tversionMajor: Q.CurrentMajorVersion,\n\t\t\t\t\tversionMinor: Q.CurrentMinorVersion,\n\t\t\t\t\tmaxSectionCount: 1,\n\t\t\t\t\tsectionCount: 1,\n\t\t\t\t\tmaxSplatCount: y,\n\t\t\t\t\tsplatCount: b,\n\t\t\t\t\tcompressionLevel: 0,\n\t\t\t\t\tsceneCenter: new K()\n\t\t\t\t}, _)) : x = new Z(0);\n\t\t\t}\n\t\t\tif (a) {\n\t\t\t\tnew Uint8Array(g, w, a.byteLength).set(new Uint8Array(a)), w += a.byteLength;\n\t\t\t\tlet e = w - C;\n\t\t\t\tif (e > h || s) {\n\t\t\t\t\tlet t = (s ? e : h) / ff.RowSizeBytes, n = b + t;\n\t\t\t\t\tp === Wd.ProgressiveToSplatBuffer ? ff.parseToUncompressedSplatBufferSection(b, n - 1, g, 0, _, m) : ff.parseToUncompressedSplatArraySection(b, n - 1, g, 0, x), b = n, p === Wd.ProgressiveToSplatBuffer && (v ||= (Q.writeSectionHeaderToBuffer({\n\t\t\t\t\t\tmaxSplatCount: y,\n\t\t\t\t\t\tsplatCount: b,\n\t\t\t\t\t\tbucketSize: 0,\n\t\t\t\t\t\tbucketCount: 0,\n\t\t\t\t\t\tbucketBlockSize: 0,\n\t\t\t\t\t\tcompressionScaleRange: 0,\n\t\t\t\t\t\tstorageSizeBytes: 0,\n\t\t\t\t\t\tfullBucketCount: 0,\n\t\t\t\t\t\tpartiallyFilledBucketCount: 0\n\t\t\t\t\t}, 0, _, Q.HeaderSizeBytes), new Q(_, !1)), v.updateLoadedCounts(1, b), i && i(v, s)), C += h;\n\t\t\t\t}\n\t\t\t}\n\t\t\ts && (p === Wd.ProgressiveToSplatBuffer ? S.resolve(v) : S.resolve(x)), n && n(e, t, Hd.Downloading);\n\t\t}, !1, c).then(() => (n && n(0, \"0%\", Hd.Processing), S.promise.then((t) => (n && n(100, \"100%\", Hd.Done), p === Wd.DownloadBeforeProcessing ? new Blob(T).arrayBuffer().then((t) => e.loadFromFileData(t, a, o, s, l, u, d, f)) : p === Wd.ProgressiveToSplatBuffer ? t : eu(() => pf(t, s, a, o, l, u, d, f))))));\n\t}\n\tstatic loadFromFileData(e, t, n, r, i, a, o, s) {\n\t\treturn eu(() => pf(ff.parseStandardSplatToUncompressedSplatArray(e), r, t, n, i, a, o, s));\n\t}\n}, hf = class e {\n\tstatic checkVersion(e) {\n\t\tlet t = Q.CurrentMajorVersion, n = Q.CurrentMinorVersion, r = Q.parseHeader(e);\n\t\tif (r.versionMajor === t && r.versionMinor >= n || r.versionMajor > t) return !0;\n\t\tthrow Error(`KSplat version not supported: v${r.versionMajor}.${r.versionMinor}. Minimum required: v${t}.${n}`);\n\t}\n\tstatic loadFromURL(t, n, r, i, a) {\n\t\tlet o, s, c, l, u = !1, d = !1, f, p = [], m = !1, h = !1, g = 0, _ = 0, v = 0, y = !1, b = !1, x = !1, S = [], C = nu(), w = () => {\n\t\t\t!u && !d && g >= Q.HeaderSizeBytes && (d = !0, new Blob(S).arrayBuffer().then((t) => {\n\t\t\t\tc = new ArrayBuffer(Q.HeaderSizeBytes), new Uint8Array(c).set(new Uint8Array(t, 0, Q.HeaderSizeBytes)), e.checkVersion(c), d = !1, u = !0, l = Q.parseHeader(c), window.setTimeout(() => {\n\t\t\t\t\tD();\n\t\t\t\t}, 1);\n\t\t\t}));\n\t\t}, T = 0, E = () => {\n\t\t\tT === 0 && (T++, window.setTimeout(() => {\n\t\t\t\tT--, O();\n\t\t\t}, 1));\n\t\t}, D = () => {\n\t\t\t!h && !m && u && g >= Q.HeaderSizeBytes + Q.SectionHeaderSizeBytes * l.maxSectionCount && (h = !0, new Blob(S).arrayBuffer().then((e) => {\n\t\t\t\th = !1, m = !0, f = new ArrayBuffer(l.maxSectionCount * Q.SectionHeaderSizeBytes), new Uint8Array(f).set(new Uint8Array(e, Q.HeaderSizeBytes, l.maxSectionCount * Q.SectionHeaderSizeBytes)), p = Q.parseSectionHeaders(l, f, 0, !1);\n\t\t\t\tlet t = 0;\n\t\t\t\tfor (let e = 0; e < l.maxSectionCount; e++) t += p[e].storageSizeBytes;\n\t\t\t\tlet n = Q.HeaderSizeBytes + l.maxSectionCount * Q.SectionHeaderSizeBytes + t;\n\t\t\t\tif (!o) {\n\t\t\t\t\to = new ArrayBuffer(n);\n\t\t\t\t\tlet e = 0;\n\t\t\t\t\tfor (let t = 0; t < S.length; t++) {\n\t\t\t\t\t\tlet n = S[t];\n\t\t\t\t\t\tnew Uint8Array(o, e, n.byteLength).set(new Uint8Array(n)), e += n.byteLength;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv = Q.HeaderSizeBytes + Q.SectionHeaderSizeBytes * l.maxSectionCount;\n\t\t\t\tfor (let e = 0; e <= p.length && e < l.maxSectionCount; e++) v += p[e].storageSizeBytes;\n\t\t\t\tE();\n\t\t\t}));\n\t\t}, O = () => {\n\t\t\tx || (x = !0, window.setTimeout(() => {\n\t\t\t\tif (x = !1, m) {\n\t\t\t\t\tif (b) return;\n\t\t\t\t\tif (y = g >= v, g - _ > cu.ProgressiveLoadSectionSize || y) {\n\t\t\t\t\t\t_ += cu.ProgressiveLoadSectionSize, b = _ >= v, s ||= new Q(o, !1);\n\t\t\t\t\t\tlet e = Q.HeaderSizeBytes + Q.SectionHeaderSizeBytes * l.maxSectionCount, t = 0, r = 0, a = 0;\n\t\t\t\t\t\tfor (let n = 0; n < l.maxSectionCount; n++) {\n\t\t\t\t\t\t\tlet i = p[n], o = e + (t + i.partiallyFilledBucketCount * 4 + i.bucketStorageSizeBytes * i.bucketCount);\n\t\t\t\t\t\t\tif (_ >= o) {\n\t\t\t\t\t\t\t\tr++;\n\t\t\t\t\t\t\t\tlet e = _ - o, t = Q.CompressionLevels[l.compressionLevel].SphericalHarmonicsDegrees[i.sphericalHarmonicsDegree].BytesPerSplat, c = Math.floor(e / t);\n\t\t\t\t\t\t\t\tc = Math.min(c, i.maxSplatCount), a += c, s.updateLoadedCounts(r, a), s.updateSectionLoadedCounts(n, c);\n\t\t\t\t\t\t\t} else break;\n\t\t\t\t\t\t\tt += i.storageSizeBytes;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti(s, b);\n\t\t\t\t\t\tlet c = _ / v * 100, u = c.toFixed(2) + \"%\";\n\t\t\t\t\t\tn && n(c, u, Hd.Downloading), b ? C.resolve(s) : O();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, cu.ProgressiveLoadSectionDelayDuration));\n\t\t};\n\t\treturn Xl(t, (e, t, i) => {\n\t\t\ti && (S.push(i), o && new Uint8Array(o, g, i.byteLength).set(new Uint8Array(i)), g += i.byteLength), r ? (w(), D(), O()) : n && n(e, t, Hd.Downloading);\n\t\t}, !r, a).then((t) => (n && n(0, \"0%\", Hd.Processing), (r ? C.promise : e.loadFromFileData(t)).then((e) => (n && n(100, \"100%\", Hd.Done), e))));\n\t}\n\tstatic loadFromFileData(t) {\n\t\treturn eu(() => (e.checkVersion(t), new Q(t)));\n\t}\n\tstatic downloadFile = function() {\n\t\tlet e;\n\t\treturn function(t, n) {\n\t\t\tlet r = new Blob([t.bufferData], { type: \"application/octet-stream\" });\n\t\t\te || (e = document.createElement(\"a\"), document.body.appendChild(e)), e.download = n, e.href = URL.createObjectURL(r), e.click();\n\t\t};\n\t}();\n}, gf = {\n\tSplat: 0,\n\tKSplat: 1,\n\tPly: 2,\n\tSpz: 3\n}, _f = (e) => e.endsWith(\".ply\") ? gf.Ply : e.endsWith(\".splat\") ? gf.Splat : e.endsWith(\".ksplat\") ? gf.KSplat : e.endsWith(\".spz\") ? gf.Spz : null, vf = { type: \"change\" }, yf = { type: \"start\" }, bf = { type: \"end\" }, xf = new Ci(), Sf = new Wi(), Cf = Math.cos(70 * cn.DEG2RAD), wf = class extends Ft {\n\tconstructor(e, t) {\n\t\tsuper(), this.object = e, this.domElement = t, this.domElement.style.touchAction = \"none\", this.enabled = !0, this.target = new K(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = {\n\t\t\tLEFT: \"KeyA\",\n\t\t\tUP: \"KeyW\",\n\t\t\tRIGHT: \"KeyD\",\n\t\t\tBOTTOM: \"KeyS\"\n\t\t}, this.mouseButtons = {\n\t\t\tLEFT: F.ROTATE,\n\t\t\tMIDDLE: F.DOLLY,\n\t\t\tRIGHT: F.PAN\n\t\t}, this.touches = {\n\t\t\tONE: I.ROTATE,\n\t\t\tTWO: I.DOLLY_PAN\n\t\t}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {\n\t\t\treturn o.phi;\n\t\t}, this.getAzimuthalAngle = function() {\n\t\t\treturn o.theta;\n\t\t}, this.getDistance = function() {\n\t\t\treturn this.object.position.distanceTo(this.target);\n\t\t}, this.listenToKeyEvents = function(e) {\n\t\t\te.addEventListener(\"keydown\", Se), this._domElementKeyEvents = e;\n\t\t}, this.stopListenToKeyEvents = function() {\n\t\t\tthis._domElementKeyEvents.removeEventListener(\"keydown\", Se), this._domElementKeyEvents = null;\n\t\t}, this.saveState = function() {\n\t\t\tn.target0.copy(n.target), n.position0.copy(n.object.position), n.zoom0 = n.object.zoom;\n\t\t}, this.reset = function() {\n\t\t\tn.target.copy(n.target0), n.object.position.copy(n.position0), n.object.zoom = n.zoom0, this.clearDampedRotation(), this.clearDampedPan(), n.object.updateProjectionMatrix(), n.dispatchEvent(vf), n.update(), i = r.NONE;\n\t\t}, this.clearDampedRotation = function() {\n\t\t\ts.theta = 0, s.phi = 0;\n\t\t}, this.clearDampedPan = function() {\n\t\t\tl.set(0, 0, 0);\n\t\t}, this.update = function() {\n\t\t\tlet t = new K(), u = new ln().setFromUnitVectors(e.up, new K(0, 1, 0)), d = u.clone().invert(), f = new K(), p = new ln(), m = new K(), h = 2 * Math.PI;\n\t\t\treturn function() {\n\t\t\t\tu.setFromUnitVectors(e.up, new K(0, 1, 0)), d.copy(u).invert();\n\t\t\t\tlet g = n.object.position;\n\t\t\t\tt.copy(g).sub(n.target), t.applyQuaternion(u), o.setFromVector3(t), n.autoRotate && i === r.NONE && E(w()), n.enableDamping ? (o.theta += s.theta * n.dampingFactor, o.phi += s.phi * n.dampingFactor) : (o.theta += s.theta, o.phi += s.phi);\n\t\t\t\tlet _ = n.minAzimuthAngle, v = n.maxAzimuthAngle;\n\t\t\t\tisFinite(_) && isFinite(v) && (_ < -Math.PI ? _ += h : _ > Math.PI && (_ -= h), v < -Math.PI ? v += h : v > Math.PI && (v -= h), _ <= v ? o.theta = Math.max(_, Math.min(v, o.theta)) : o.theta = o.theta > (_ + v) / 2 ? Math.max(_, o.theta) : Math.min(v, o.theta)), o.phi = Math.max(n.minPolarAngle, Math.min(n.maxPolarAngle, o.phi)), o.makeSafe(), n.enableDamping === !0 ? n.target.addScaledVector(l, n.dampingFactor) : n.target.add(l), n.zoomToCursor && x || n.object.isOrthographicCamera ? o.radius = P(o.radius) : o.radius = P(o.radius * c), t.setFromSpherical(o), t.applyQuaternion(d), g.copy(n.target).add(t), n.object.lookAt(n.target), n.enableDamping === !0 ? (s.theta *= 1 - n.dampingFactor, s.phi *= 1 - n.dampingFactor, l.multiplyScalar(1 - n.dampingFactor)) : (s.set(0, 0, 0), l.set(0, 0, 0));\n\t\t\t\tlet S = !1;\n\t\t\t\tif (n.zoomToCursor && x) {\n\t\t\t\t\tlet r = null;\n\t\t\t\t\tif (n.object.isPerspectiveCamera) {\n\t\t\t\t\t\tlet e = t.length();\n\t\t\t\t\t\tr = P(e * c);\n\t\t\t\t\t\tlet i = e - r;\n\t\t\t\t\t\tn.object.position.addScaledVector(y, i), n.object.updateMatrixWorld();\n\t\t\t\t\t} else if (n.object.isOrthographicCamera) {\n\t\t\t\t\t\tlet e = new K(b.x, b.y, 0);\n\t\t\t\t\t\te.unproject(n.object), n.object.zoom = Math.max(n.minZoom, Math.min(n.maxZoom, n.object.zoom / c)), n.object.updateProjectionMatrix(), S = !0;\n\t\t\t\t\t\tlet i = new K(b.x, b.y, 0);\n\t\t\t\t\t\ti.unproject(n.object), n.object.position.sub(i).add(e), n.object.updateMatrixWorld(), r = t.length();\n\t\t\t\t\t} else console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.\"), n.zoomToCursor = !1;\n\t\t\t\t\tr !== null && (this.screenSpacePanning ? n.target.set(0, 0, -1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position) : (xf.origin.copy(n.object.position), xf.direction.set(0, 0, -1).transformDirection(n.object.matrix), Math.abs(n.object.up.dot(xf.direction)) < Cf ? e.lookAt(n.target) : (Sf.setFromNormalAndCoplanarPoint(n.object.up, n.target), xf.intersectPlane(Sf, n.target))));\n\t\t\t\t} else n.object.isOrthographicCamera && (n.object.zoom = Math.max(n.minZoom, Math.min(n.maxZoom, n.object.zoom / c)), n.object.updateProjectionMatrix(), S = !0);\n\t\t\t\treturn c = 1, x = !1, S || f.distanceToSquared(n.object.position) > a || 8 * (1 - p.dot(n.object.quaternion)) > a || m.distanceToSquared(n.target) > 0 ? (n.dispatchEvent(vf), f.copy(n.object.position), p.copy(n.object.quaternion), m.copy(n.target), S = !1, !0) : !1;\n\t\t\t};\n\t\t}(), this.dispose = function() {\n\t\t\tn.domElement.removeEventListener(\"contextmenu\", we), n.domElement.removeEventListener(\"pointerdown\", ge), n.domElement.removeEventListener(\"pointercancel\", ve), n.domElement.removeEventListener(\"wheel\", xe), n.domElement.removeEventListener(\"pointermove\", _e), n.domElement.removeEventListener(\"pointerup\", ve), n._domElementKeyEvents !== null && (n._domElementKeyEvents.removeEventListener(\"keydown\", Se), n._domElementKeyEvents = null);\n\t\t};\n\t\tlet n = this, r = {\n\t\t\tNONE: -1,\n\t\t\tROTATE: 0,\n\t\t\tDOLLY: 1,\n\t\t\tPAN: 2,\n\t\t\tTOUCH_ROTATE: 3,\n\t\t\tTOUCH_PAN: 4,\n\t\t\tTOUCH_DOLLY_PAN: 5,\n\t\t\tTOUCH_DOLLY_ROTATE: 6\n\t\t}, i = r.NONE, a = 1e-6, o = new no(), s = new no(), c = 1, l = new K(), u = new G(), d = new G(), f = new G(), p = new G(), m = new G(), h = new G(), g = new G(), _ = new G(), v = new G(), y = new K(), b = new G(), x = !1, S = [], C = {};\n\t\tfunction w() {\n\t\t\treturn 2 * Math.PI / 60 / 60 * n.autoRotateSpeed;\n\t\t}\n\t\tfunction T() {\n\t\t\treturn .95 ** n.zoomSpeed;\n\t\t}\n\t\tfunction E(e) {\n\t\t\ts.theta -= e;\n\t\t}\n\t\tfunction D(e) {\n\t\t\ts.phi -= e;\n\t\t}\n\t\tlet O = function() {\n\t\t\tlet e = new K();\n\t\t\treturn function(t, n) {\n\t\t\t\te.setFromMatrixColumn(n, 0), e.multiplyScalar(-t), l.add(e);\n\t\t\t};\n\t\t}(), k = function() {\n\t\t\tlet e = new K();\n\t\t\treturn function(t, r) {\n\t\t\t\tn.screenSpacePanning === !0 ? e.setFromMatrixColumn(r, 1) : (e.setFromMatrixColumn(r, 0), e.crossVectors(n.object.up, e)), e.multiplyScalar(t), l.add(e);\n\t\t\t};\n\t\t}(), A = function() {\n\t\t\tlet e = new K();\n\t\t\treturn function(t, r) {\n\t\t\t\tlet i = n.domElement;\n\t\t\t\tif (n.object.isPerspectiveCamera) {\n\t\t\t\t\tlet a = n.object.position;\n\t\t\t\t\te.copy(a).sub(n.target);\n\t\t\t\t\tlet o = e.length();\n\t\t\t\t\to *= Math.tan(n.object.fov / 2 * Math.PI / 180), O(2 * t * o / i.clientHeight, n.object.matrix), k(2 * r * o / i.clientHeight, n.object.matrix);\n\t\t\t\t} else n.object.isOrthographicCamera ? (O(t * (n.object.right - n.object.left) / n.object.zoom / i.clientWidth, n.object.matrix), k(r * (n.object.top - n.object.bottom) / n.object.zoom / i.clientHeight, n.object.matrix)) : (console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.\"), n.enablePan = !1);\n\t\t\t};\n\t\t}();\n\t\tfunction j(e) {\n\t\t\tn.object.isPerspectiveCamera || n.object.isOrthographicCamera ? c /= e : (console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.\"), n.enableZoom = !1);\n\t\t}\n\t\tfunction M(e) {\n\t\t\tn.object.isPerspectiveCamera || n.object.isOrthographicCamera ? c *= e : (console.warn(\"WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.\"), n.enableZoom = !1);\n\t\t}\n\t\tfunction N(t) {\n\t\t\tif (!n.zoomToCursor) return;\n\t\t\tx = !0;\n\t\t\tlet r = n.domElement.getBoundingClientRect(), i = t.clientX - r.left, a = t.clientY - r.top, o = r.width, s = r.height;\n\t\t\tb.x = i / o * 2 - 1, b.y = -(a / s) * 2 + 1, y.set(b.x, b.y, 1).unproject(e).sub(e.position).normalize();\n\t\t}\n\t\tfunction P(e) {\n\t\t\treturn Math.max(n.minDistance, Math.min(n.maxDistance, e));\n\t\t}\n\t\tfunction ee(e) {\n\t\t\tu.set(e.clientX, e.clientY);\n\t\t}\n\t\tfunction te(e) {\n\t\t\tN(e), g.set(e.clientX, e.clientY);\n\t\t}\n\t\tfunction ne(e) {\n\t\t\tp.set(e.clientX, e.clientY);\n\t\t}\n\t\tfunction L(e) {\n\t\t\td.set(e.clientX, e.clientY), f.subVectors(d, u).multiplyScalar(n.rotateSpeed);\n\t\t\tlet t = n.domElement;\n\t\t\tE(2 * Math.PI * f.x / t.clientHeight), D(2 * Math.PI * f.y / t.clientHeight), u.copy(d), n.update();\n\t\t}\n\t\tfunction re(e) {\n\t\t\t_.set(e.clientX, e.clientY), v.subVectors(_, g), v.y > 0 ? j(T()) : v.y < 0 && M(T()), g.copy(_), n.update();\n\t\t}\n\t\tfunction ie(e) {\n\t\t\tm.set(e.clientX, e.clientY), h.subVectors(m, p).multiplyScalar(n.panSpeed), A(h.x, h.y), p.copy(m), n.update();\n\t\t}\n\t\tfunction R(e) {\n\t\t\tN(e), e.deltaY < 0 ? M(T()) : e.deltaY > 0 && j(T()), n.update();\n\t\t}\n\t\tfunction ae(e) {\n\t\t\tlet t = !1;\n\t\t\tswitch (e.code) {\n\t\t\t\tcase n.keys.UP:\n\t\t\t\t\te.ctrlKey || e.metaKey || e.shiftKey ? D(2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : A(0, n.keyPanSpeed), t = !0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase n.keys.BOTTOM:\n\t\t\t\t\te.ctrlKey || e.metaKey || e.shiftKey ? D(-2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : A(0, -n.keyPanSpeed), t = !0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase n.keys.LEFT:\n\t\t\t\t\te.ctrlKey || e.metaKey || e.shiftKey ? E(2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : A(n.keyPanSpeed, 0), t = !0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase n.keys.RIGHT: e.ctrlKey || e.metaKey || e.shiftKey ? E(-2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : A(-n.keyPanSpeed, 0), t = !0;\n\t\t\t}\n\t\t\tt && (e.preventDefault(), n.update());\n\t\t}\n\t\tfunction oe() {\n\t\t\tif (S.length === 1) u.set(S[0].pageX, S[0].pageY);\n\t\t\telse {\n\t\t\t\tlet e = .5 * (S[0].pageX + S[1].pageX), t = .5 * (S[0].pageY + S[1].pageY);\n\t\t\t\tu.set(e, t);\n\t\t\t}\n\t\t}\n\t\tfunction se() {\n\t\t\tif (S.length === 1) p.set(S[0].pageX, S[0].pageY);\n\t\t\telse {\n\t\t\t\tlet e = .5 * (S[0].pageX + S[1].pageX), t = .5 * (S[0].pageY + S[1].pageY);\n\t\t\t\tp.set(e, t);\n\t\t\t}\n\t\t}\n\t\tfunction ce() {\n\t\t\tlet e = S[0].pageX - S[1].pageX, t = S[0].pageY - S[1].pageY, n = Math.sqrt(e * e + t * t);\n\t\t\tg.set(0, n);\n\t\t}\n\t\tfunction le() {\n\t\t\tn.enableZoom && ce(), n.enablePan && se();\n\t\t}\n\t\tfunction ue() {\n\t\t\tn.enableZoom && ce(), n.enableRotate && oe();\n\t\t}\n\t\tfunction de(e) {\n\t\t\tif (S.length == 1) d.set(e.pageX, e.pageY);\n\t\t\telse {\n\t\t\t\tlet t = Oe(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);\n\t\t\t\td.set(n, r);\n\t\t\t}\n\t\t\tf.subVectors(d, u).multiplyScalar(n.rotateSpeed);\n\t\t\tlet t = n.domElement;\n\t\t\tE(2 * Math.PI * f.x / t.clientHeight), D(2 * Math.PI * f.y / t.clientHeight), u.copy(d);\n\t\t}\n\t\tfunction fe(e) {\n\t\t\tif (S.length === 1) m.set(e.pageX, e.pageY);\n\t\t\telse {\n\t\t\t\tlet t = Oe(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);\n\t\t\t\tm.set(n, r);\n\t\t\t}\n\t\t\th.subVectors(m, p).multiplyScalar(n.panSpeed), A(h.x, h.y), p.copy(m);\n\t\t}\n\t\tfunction pe(e) {\n\t\t\tlet t = Oe(e), r = e.pageX - t.x, i = e.pageY - t.y, a = Math.sqrt(r * r + i * i);\n\t\t\t_.set(0, a), v.set(0, (_.y / g.y) ** +n.zoomSpeed), j(v.y), g.copy(_);\n\t\t}\n\t\tfunction me(e) {\n\t\t\tn.enableZoom && pe(e), n.enablePan && fe(e);\n\t\t}\n\t\tfunction he(e) {\n\t\t\tn.enableZoom && pe(e), n.enableRotate && de(e);\n\t\t}\n\t\tfunction ge(e) {\n\t\t\tn.enabled !== !1 && (S.length === 0 && (n.domElement.setPointerCapture(e.pointerId), n.domElement.addEventListener(\"pointermove\", _e), n.domElement.addEventListener(\"pointerup\", ve)), Te(e), e.pointerType === \"touch\" ? Ce(e) : ye(e));\n\t\t}\n\t\tfunction _e(e) {\n\t\t\tn.enabled !== !1 && (e.pointerType === \"touch\" ? z(e) : be(e));\n\t\t}\n\t\tfunction ve(e) {\n\t\t\tEe(e), S.length === 0 && (n.domElement.releasePointerCapture(e.pointerId), n.domElement.removeEventListener(\"pointermove\", _e), n.domElement.removeEventListener(\"pointerup\", ve)), n.dispatchEvent(bf), i = r.NONE;\n\t\t}\n\t\tfunction ye(e) {\n\t\t\tlet t;\n\t\t\tswitch (e.button) {\n\t\t\t\tcase 0:\n\t\t\t\t\tt = n.mouseButtons.LEFT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tt = n.mouseButtons.MIDDLE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tt = n.mouseButtons.RIGHT;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: t = -1;\n\t\t\t}\n\t\t\tswitch (t) {\n\t\t\t\tcase F.DOLLY:\n\t\t\t\t\tif (n.enableZoom === !1) return;\n\t\t\t\t\tte(e), i = r.DOLLY;\n\t\t\t\t\tbreak;\n\t\t\t\tcase F.ROTATE:\n\t\t\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey) {\n\t\t\t\t\t\tif (n.enablePan === !1) return;\n\t\t\t\t\t\tne(e), i = r.PAN;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (n.enableRotate === !1) return;\n\t\t\t\t\t\tee(e), i = r.ROTATE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase F.PAN:\n\t\t\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey) {\n\t\t\t\t\t\tif (n.enableRotate === !1) return;\n\t\t\t\t\t\tee(e), i = r.ROTATE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (n.enablePan === !1) return;\n\t\t\t\t\t\tne(e), i = r.PAN;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: i = r.NONE;\n\t\t\t}\n\t\t\ti !== r.NONE && n.dispatchEvent(yf);\n\t\t}\n\t\tfunction be(e) {\n\t\t\tswitch (i) {\n\t\t\t\tcase r.ROTATE:\n\t\t\t\t\tif (n.enableRotate === !1) return;\n\t\t\t\t\tL(e);\n\t\t\t\t\tbreak;\n\t\t\t\tcase r.DOLLY:\n\t\t\t\t\tif (n.enableZoom === !1) return;\n\t\t\t\t\tre(e);\n\t\t\t\t\tbreak;\n\t\t\t\tcase r.PAN:\n\t\t\t\t\tif (n.enablePan === !1) return;\n\t\t\t\t\tie(e);\n\t\t\t}\n\t\t}\n\t\tfunction xe(e) {\n\t\t\tn.enabled !== !1 && n.enableZoom !== !1 && i === r.NONE && (e.preventDefault(), n.dispatchEvent(yf), R(e), n.dispatchEvent(bf));\n\t\t}\n\t\tfunction Se(e) {\n\t\t\tn.enabled !== !1 && n.enablePan !== !1 && ae(e);\n\t\t}\n\t\tfunction Ce(e) {\n\t\t\tswitch (De(e), S.length) {\n\t\t\t\tcase 1:\n\t\t\t\t\tswitch (n.touches.ONE) {\n\t\t\t\t\t\tcase I.ROTATE:\n\t\t\t\t\t\t\tif (n.enableRotate === !1) return;\n\t\t\t\t\t\t\toe(), i = r.TOUCH_ROTATE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase I.PAN:\n\t\t\t\t\t\t\tif (n.enablePan === !1) return;\n\t\t\t\t\t\t\tse(), i = r.TOUCH_PAN;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault: i = r.NONE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tswitch (n.touches.TWO) {\n\t\t\t\t\t\tcase I.DOLLY_PAN:\n\t\t\t\t\t\t\tif (n.enableZoom === !1 && n.enablePan === !1) return;\n\t\t\t\t\t\t\tle(), i = r.TOUCH_DOLLY_PAN;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase I.DOLLY_ROTATE:\n\t\t\t\t\t\t\tif (n.enableZoom === !1 && n.enableRotate === !1) return;\n\t\t\t\t\t\t\tue(), i = r.TOUCH_DOLLY_ROTATE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault: i = r.NONE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: i = r.NONE;\n\t\t\t}\n\t\t\ti !== r.NONE && n.dispatchEvent(yf);\n\t\t}\n\t\tfunction z(e) {\n\t\t\tswitch (De(e), i) {\n\t\t\t\tcase r.TOUCH_ROTATE:\n\t\t\t\t\tif (n.enableRotate === !1) return;\n\t\t\t\t\tde(e), n.update();\n\t\t\t\t\tbreak;\n\t\t\t\tcase r.TOUCH_PAN:\n\t\t\t\t\tif (n.enablePan === !1) return;\n\t\t\t\t\tfe(e), n.update();\n\t\t\t\t\tbreak;\n\t\t\t\tcase r.TOUCH_DOLLY_PAN:\n\t\t\t\t\tif (n.enableZoom === !1 && n.enablePan === !1) return;\n\t\t\t\t\tme(e), n.update();\n\t\t\t\t\tbreak;\n\t\t\t\tcase r.TOUCH_DOLLY_ROTATE:\n\t\t\t\t\tif (n.enableZoom === !1 && n.enableRotate === !1) return;\n\t\t\t\t\the(e), n.update();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: i = r.NONE;\n\t\t\t}\n\t\t}\n\t\tfunction we(e) {\n\t\t\tn.enabled !== !1 && e.preventDefault();\n\t\t}\n\t\tfunction Te(e) {\n\t\t\tS.push(e);\n\t\t}\n\t\tfunction Ee(e) {\n\t\t\tdelete C[e.pointerId];\n\t\t\tfor (let t = 0; t < S.length; t++) if (S[t].pointerId == e.pointerId) {\n\t\t\t\tS.splice(t, 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfunction De(e) {\n\t\t\tlet t = C[e.pointerId];\n\t\t\tt === void 0 && (t = new G(), C[e.pointerId] = t), t.set(e.pageX, e.pageY);\n\t\t}\n\t\tfunction Oe(e) {\n\t\t\tlet t = e.pointerId === S[0].pointerId ? S[1] : S[0];\n\t\t\treturn C[t.pointerId];\n\t\t}\n\t\tn.domElement.addEventListener(\"contextmenu\", we), n.domElement.addEventListener(\"pointerdown\", ge), n.domElement.addEventListener(\"pointercancel\", ve), n.domElement.addEventListener(\"wheel\", xe, { passive: !1 }), this.update();\n\t}\n}, Tf = (e, t, n, r, i) => {\n\tlet a = performance.now(), o = e.style.display === \"none\" ? 0 : parseFloat(e.style.opacity);\n\tisNaN(o) && (o = 1);\n\tlet s = window.setInterval(() => {\n\t\tlet c = performance.now() - a, l = Math.min(c / r, 1);\n\t\tl > .999 && (l = 1);\n\t\tlet u;\n\t\tt ? (u = (1 - l) * o, u < 1e-4 && (u = 0)) : u = (1 - o) * l + o, u > 0 ? (e.style.display = n, e.style.opacity = u) : e.style.display = \"none\", l >= 1 && (i && i(), window.clearInterval(s));\n\t}, 16);\n\treturn s;\n}, Ef = 500, Df = class e {\n\tstatic elementIDGen = 0;\n\tconstructor(t, n) {\n\t\tthis.taskIDGen = 0, this.elementID = e.elementIDGen++, this.tasks = [], this.message = t || \"Loading...\", this.container = n || document.body, this.spinnerContainerOuter = document.createElement(\"div\"), this.spinnerContainerOuter.className = `spinnerOuterContainer${this.elementID}`, this.spinnerContainerOuter.style.display = \"none\", this.spinnerContainerPrimary = document.createElement(\"div\"), this.spinnerContainerPrimary.className = `spinnerContainerPrimary${this.elementID}`, this.spinnerPrimary = document.createElement(\"div\"), this.spinnerPrimary.classList.add(`spinner${this.elementID}`, `spinnerPrimary${this.elementID}`), this.messageContainerPrimary = document.createElement(\"div\"), this.messageContainerPrimary.classList.add(`messageContainer${this.elementID}`, `messageContainerPrimary${this.elementID}`), this.messageContainerPrimary.innerHTML = this.message, this.spinnerContainerMin = document.createElement(\"div\"), this.spinnerContainerMin.className = `spinnerContainerMin${this.elementID}`, this.spinnerMin = document.createElement(\"div\"), this.spinnerMin.classList.add(`spinner${this.elementID}`, `spinnerMin${this.elementID}`), this.messageContainerMin = document.createElement(\"div\"), this.messageContainerMin.classList.add(`messageContainer${this.elementID}`, `messageContainerMin${this.elementID}`), this.messageContainerMin.innerHTML = this.message, this.spinnerContainerPrimary.appendChild(this.spinnerPrimary), this.spinnerContainerPrimary.appendChild(this.messageContainerPrimary), this.spinnerContainerOuter.appendChild(this.spinnerContainerPrimary), this.spinnerContainerMin.appendChild(this.spinnerMin), this.spinnerContainerMin.appendChild(this.messageContainerMin), this.spinnerContainerOuter.appendChild(this.spinnerContainerMin);\n\t\tlet r = document.createElement(\"style\");\n\t\tr.innerHTML = `\n\n            .spinnerOuterContainer${this.elementID} {\n                width: 100%;\n                height: 100%;\n                margin: 0;\n                top: 0;\n                left: 0;\n                position: absolute;\n                pointer-events: none;\n            }\n\n            .messageContainer${this.elementID} {\n                height: 20px;\n                font-family: arial;\n                font-size: 12pt;\n                color: #ffffff;\n                text-align: center;\n                vertical-align: middle;\n            }\n\n            .spinner${this.elementID} {\n                padding: 15px;\n                background: #07e8d6;\n                z-index:99999;\n            \n                aspect-ratio: 1;\n                border-radius: 50%;\n                --_m: \n                    conic-gradient(#0000,#000),\n                    linear-gradient(#000 0 0) content-box;\n                -webkit-mask: var(--_m);\n                    mask: var(--_m);\n                -webkit-mask-composite: source-out;\n                    mask-composite: subtract;\n                box-sizing: border-box;\n                animation: load 1s linear infinite;\n            }\n\n            .spinnerContainerPrimary${this.elementID} {\n                z-index:99999;\n                background-color: rgba(128, 128, 128, 0.75);\n                border: #666666 1px solid;\n                border-radius: 5px;\n                padding-top: 20px;\n                padding-bottom: 10px;\n                margin: 0;\n                position: absolute;\n                top: 50%;\n                left: 50%;\n                transform: translate(-80px, -80px);\n                width: 180px;\n                pointer-events: auto;\n            }\n\n            .spinnerPrimary${this.elementID} {\n                width: 120px;\n                margin-left: 30px;\n            }\n\n            .messageContainerPrimary${this.elementID} {\n                padding-top: 15px;\n            }\n\n            .spinnerContainerMin${this.elementID} {\n                z-index:99999;\n                background-color: rgba(128, 128, 128, 0.75);\n                border: #666666 1px solid;\n                border-radius: 5px;\n                padding-top: 20px;\n                padding-bottom: 15px;\n                margin: 0;\n                position: absolute;\n                bottom: 50px;\n                left: 50%;\n                transform: translate(-50%, 0);\n                display: flex;\n                flex-direction: left;\n                pointer-events: auto;\n                min-width: 250px;\n            }\n\n            .messageContainerMin${this.elementID} {\n                margin-right: 15px;\n            }\n\n            .spinnerMin${this.elementID} {\n                width: 50px;\n                height: 50px;\n                margin-left: 15px;\n                margin-right: 25px;\n            }\n\n            .messageContainerMin${this.elementID} {\n                padding-top: 15px;\n            }\n            \n            @keyframes load {\n                to{transform: rotate(1turn)}\n            }\n\n        `, this.spinnerContainerOuter.appendChild(r), this.container.appendChild(this.spinnerContainerOuter), this.setMinimized(!1, !0), this.fadeTransitions = [];\n\t}\n\taddTask(e) {\n\t\tlet t = {\n\t\t\tmessage: e,\n\t\t\tid: this.taskIDGen++\n\t\t};\n\t\treturn this.tasks.push(t), this.update(), t.id;\n\t}\n\tremoveTask(e) {\n\t\tlet t = 0;\n\t\tfor (let n of this.tasks) {\n\t\t\tif (n.id === e) {\n\t\t\t\tthis.tasks.splice(t, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tt++;\n\t\t}\n\t\tthis.update();\n\t}\n\tremoveAllTasks() {\n\t\tthis.tasks = [], this.update();\n\t}\n\tsetMessageForTask(e, t) {\n\t\tfor (let n of this.tasks) if (n.id === e) {\n\t\t\tn.message = t;\n\t\t\tbreak;\n\t\t}\n\t\tthis.update();\n\t}\n\tupdate() {\n\t\tthis.tasks.length > 0 ? (this.show(), this.setMessage(this.tasks[this.tasks.length - 1].message)) : this.hide();\n\t}\n\tshow() {\n\t\tthis.spinnerContainerOuter.style.display = \"block\", this.visible = !0;\n\t}\n\thide() {\n\t\tthis.spinnerContainerOuter.style.display = \"none\", this.visible = !1;\n\t}\n\tsetContainer(e) {\n\t\tthis.container && this.spinnerContainerOuter.parentElement === this.container && this.container.removeChild(this.spinnerContainerOuter), e && (this.container = e, this.container.appendChild(this.spinnerContainerOuter), this.spinnerContainerOuter.style.zIndex = this.container.style.zIndex + 1);\n\t}\n\tsetMinimized(e, t) {\n\t\tlet n = (e, t, n, r, i) => {\n\t\t\tn ? e.style.display = t ? r : \"none\" : this.fadeTransitions[i] = Tf(e, !t, r, Ef, () => {\n\t\t\t\tthis.fadeTransitions[i] = null;\n\t\t\t});\n\t\t};\n\t\tn(this.spinnerContainerPrimary, !e, t, \"block\", 0), n(this.spinnerContainerMin, e, t, \"flex\", 1), this.minimized = e;\n\t}\n\tsetMessage(e) {\n\t\tthis.messageContainerPrimary.innerHTML = e, this.messageContainerMin.innerHTML = e;\n\t}\n}, Of = class {\n\tconstructor(e) {\n\t\tthis.idGen = 0, this.tasks = [], this.container = e || document.body, this.progressBarContainerOuter = document.createElement(\"div\"), this.progressBarContainerOuter.className = \"progressBarOuterContainer\", this.progressBarContainerOuter.style.display = \"none\", this.progressBarBox = document.createElement(\"div\"), this.progressBarBox.className = \"progressBarBox\", this.progressBarBackground = document.createElement(\"div\"), this.progressBarBackground.className = \"progressBarBackground\", this.progressBar = document.createElement(\"div\"), this.progressBar.className = \"progressBar\", this.progressBarBackground.appendChild(this.progressBar), this.progressBarBox.appendChild(this.progressBarBackground), this.progressBarContainerOuter.appendChild(this.progressBarBox);\n\t\tlet t = document.createElement(\"style\");\n\t\tt.innerHTML = \"\\n\\n            .progressBarOuterContainer {\\n                width: 100%;\\n                height: 100%;\\n                margin: 0;\\n                top: 0;\\n                left: 0;\\n                position: absolute;\\n                pointer-events: none;\\n            }\\n\\n            .progressBarBox {\\n                z-index:99999;\\n                padding: 7px 9px 5px 7px;\\n                background-color: rgba(190, 190, 190, 0.75);\\n                border: #555555 1px solid;\\n                border-radius: 15px;\\n                margin: 0;\\n                position: absolute;\\n                bottom: 50px;\\n                left: 50%;\\n                transform: translate(-50%, 0);\\n                width: 180px;\\n                height: 30px;\\n                pointer-events: auto;\\n            }\\n\\n            .progressBarBackground {\\n                width: 100%;\\n                height: 25px;\\n                border-radius:10px;\\n                background-color: rgba(128, 128, 128, 0.75);\\n                border: #444444 1px solid;\\n                box-shadow: inset 0 0 10px #333333;\\n            }\\n\\n            .progressBar {\\n                height: 25px;\\n                width: 0px;\\n                border-radius:10px;\\n                background-color: rgba(0, 200, 0, 0.75);\\n                box-shadow: inset 0 0 10px #003300;\\n            }\\n\\n        \", this.progressBarContainerOuter.appendChild(t), this.container.appendChild(this.progressBarContainerOuter);\n\t}\n\tshow() {\n\t\tthis.progressBarContainerOuter.style.display = \"block\";\n\t}\n\thide() {\n\t\tthis.progressBarContainerOuter.style.display = \"none\";\n\t}\n\tsetProgress(e) {\n\t\tthis.progressBar.style.width = e + \"%\";\n\t}\n\tsetContainer(e) {\n\t\tthis.container && this.progressBarContainerOuter.parentElement === this.container && this.container.removeChild(this.progressBarContainerOuter), e && (this.container = e, this.container.appendChild(this.progressBarContainerOuter), this.progressBarContainerOuter.style.zIndex = this.container.style.zIndex + 1);\n\t}\n}, kf = class {\n\tconstructor(e) {\n\t\tthis.container = e || document.body, this.infoCells = {};\n\t\tlet t = [\n\t\t\t[\"Camera position\", \"cameraPosition\"],\n\t\t\t[\"Camera look-at\", \"cameraLookAt\"],\n\t\t\t[\"Camera up\", \"cameraUp\"],\n\t\t\t[\"Camera mode\", \"orthographicCamera\"],\n\t\t\t[\"Cursor position\", \"cursorPosition\"],\n\t\t\t[\"FPS\", \"fps\"],\n\t\t\t[\"Rendering:\", \"renderSplatCount\"],\n\t\t\t[\"Sort time\", \"sortTime\"],\n\t\t\t[\"Render window\", \"renderWindow\"],\n\t\t\t[\"Focal adjustment\", \"focalAdjustment\"],\n\t\t\t[\"Splat scale\", \"splatScale\"],\n\t\t\t[\"Point cloud mode\", \"pointCloudMode\"]\n\t\t];\n\t\tthis.infoPanelContainer = document.createElement(\"div\");\n\t\tlet n = document.createElement(\"style\");\n\t\tn.innerHTML = \"\\n\\n            .infoPanel {\\n                width: 430px;\\n                padding: 10px;\\n                background-color: rgba(50, 50, 50, 0.85);\\n                border: #555555 2px solid;\\n                color: #dddddd;\\n                border-radius: 10px;\\n                z-index: 9999;\\n                font-family: arial;\\n                font-size: 11pt;\\n                text-align: left;\\n                margin: 0;\\n                top: 10px;\\n                left:10px;\\n                position: absolute;\\n                pointer-events: auto;\\n            }\\n\\n            .info-panel-cell {\\n                margin-bottom: 5px;\\n                padding-bottom: 2px;\\n            }\\n\\n            .label-cell {\\n                font-weight: bold;\\n                font-size: 12pt;\\n                width: 140px;\\n            }\\n\\n        \", this.infoPanelContainer.append(n), this.infoPanel = document.createElement(\"div\"), this.infoPanel.className = \"infoPanel\";\n\t\tlet r = document.createElement(\"div\");\n\t\tr.style.display = \"table\";\n\t\tfor (let e of t) {\n\t\t\tlet t = document.createElement(\"div\");\n\t\t\tt.style.display = \"table-row\", t.className = \"info-panel-row\";\n\t\t\tlet n = document.createElement(\"div\");\n\t\t\tn.style.display = \"table-cell\", n.innerHTML = `${e[0]}: `, n.classList.add(\"info-panel-cell\", \"label-cell\");\n\t\t\tlet i = document.createElement(\"div\");\n\t\t\ti.style.display = \"table-cell\", i.style.width = \"10px\", i.innerHTML = \" \", i.className = \"info-panel-cell\";\n\t\t\tlet a = document.createElement(\"div\");\n\t\t\ta.style.display = \"table-cell\", a.innerHTML = \"\", a.className = \"info-panel-cell\", this.infoCells[e[1]] = a, t.appendChild(n), t.appendChild(i), t.appendChild(a), r.appendChild(t);\n\t\t}\n\t\tthis.infoPanel.appendChild(r), this.infoPanelContainer.append(this.infoPanel), this.infoPanelContainer.style.display = \"none\", this.container.appendChild(this.infoPanelContainer), this.visible = !1;\n\t}\n\tupdate = function(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {\n\t\tlet m = `${t.x.toFixed(5)}, ${t.y.toFixed(5)}, ${t.z.toFixed(5)}`;\n\t\tif (this.infoCells.cameraPosition.innerHTML !== m && (this.infoCells.cameraPosition.innerHTML = m), n) {\n\t\t\tlet e = n, t = `${e.x.toFixed(5)}, ${e.y.toFixed(5)}, ${e.z.toFixed(5)}`;\n\t\t\tthis.infoCells.cameraLookAt.innerHTML !== t && (this.infoCells.cameraLookAt.innerHTML = t);\n\t\t}\n\t\tlet h = `${r.x.toFixed(5)}, ${r.y.toFixed(5)}, ${r.z.toFixed(5)}`;\n\t\tif (this.infoCells.cameraUp.innerHTML !== h && (this.infoCells.cameraUp.innerHTML = h), this.infoCells.orthographicCamera.innerHTML = i ? \"Orthographic\" : \"Perspective\", a) {\n\t\t\tlet e = a, t = `${e.x.toFixed(5)}, ${e.y.toFixed(5)}, ${e.z.toFixed(5)}`;\n\t\t\tthis.infoCells.cursorPosition.innerHTML = t;\n\t\t} else this.infoCells.cursorPosition.innerHTML = \"N/A\";\n\t\tthis.infoCells.fps.innerHTML = o, this.infoCells.renderWindow.innerHTML = `${e.x} x ${e.y}`, this.infoCells.renderSplatCount.innerHTML = `${c} splats out of ${s} (${l.toFixed(2)}%)`, this.infoCells.sortTime.innerHTML = `${u.toFixed(3)} ms`, this.infoCells.focalAdjustment.innerHTML = `${d.toFixed(3)}`, this.infoCells.splatScale.innerHTML = `${f.toFixed(3)}`, this.infoCells.pointCloudMode.innerHTML = `${p}`;\n\t};\n\tsetContainer(e) {\n\t\tthis.container && this.infoPanelContainer.parentElement === this.container && this.container.removeChild(this.infoPanelContainer), e && (this.container = e, this.container.appendChild(this.infoPanelContainer), this.infoPanelContainer.style.zIndex = this.container.style.zIndex + 1);\n\t}\n\tshow() {\n\t\tthis.infoPanelContainer.style.display = \"block\", this.visible = !0;\n\t}\n\thide() {\n\t\tthis.infoPanelContainer.style.display = \"none\", this.visible = !1;\n\t}\n}, Af = new K(), jf = class extends ir {\n\tconstructor(e = new K(0, 0, 1), t = new K(0, 0, 0), n = 1, r = .1, i = 16776960, a = n * .2, o = a * .2) {\n\t\tsuper(), this.type = \"ArrowHelper\";\n\t\tlet s = new ea(r, r, n, 32);\n\t\ts.translate(0, n / 2, 0);\n\t\tlet c = new ea(0, o, a, 32);\n\t\tc.translate(0, n, 0), this.position.copy(t), this.line = new Ii(s, new wi({\n\t\t\tcolor: i,\n\t\t\ttoneMapped: !1\n\t\t})), this.line.matrixAutoUpdate = !1, this.add(this.line), this.cone = new Ii(c, new wi({\n\t\t\tcolor: i,\n\t\t\ttoneMapped: !1\n\t\t})), this.cone.matrixAutoUpdate = !1, this.add(this.cone), this.setDirection(e);\n\t}\n\tsetDirection(e) {\n\t\tif (e.y > .99999) this.quaternion.set(0, 0, 0, 1);\n\t\telse if (e.y < -.99999) this.quaternion.set(1, 0, 0, 0);\n\t\telse {\n\t\t\tAf.set(e.z, 0, -e.x).normalize();\n\t\t\tlet t = Math.acos(e.y);\n\t\t\tthis.quaternion.setFromAxisAngle(Af, t);\n\t\t}\n\t}\n\tsetColor(e) {\n\t\tthis.line.material.color.set(e), this.cone.material.color.set(e);\n\t}\n\tcopy(e) {\n\t\treturn super.copy(e, !1), this.line.copy(e.line), this.cone.copy(e.cone), this;\n\t}\n\tdispose() {\n\t\tthis.line.geometry.dispose(), this.line.material.dispose(), this.cone.geometry.dispose(), this.cone.material.dispose();\n\t}\n}, Mf = class e {\n\tconstructor(e) {\n\t\tthis.threeScene = e, this.splatRenderTarget = null, this.renderTargetCopyQuad = null, this.renderTargetCopyCamera = null, this.meshCursor = null, this.focusMarker = null, this.controlPlane = null, this.debugRoot = null, this.secondaryDebugRoot = null;\n\t}\n\tupdateSplatRenderTargetForRenderDimensions(e, t) {\n\t\tthis.destroySplatRendertarget(), this.splatRenderTarget = new kn(e, t, {\n\t\t\tformat: Se,\n\t\t\tstencilBuffer: !1,\n\t\t\tdepthBuffer: !0\n\t\t}), this.splatRenderTarget.depthTexture = new Xi(e, t), this.splatRenderTarget.depthTexture.format = Ce, this.splatRenderTarget.depthTexture.type = fe;\n\t}\n\tdestroySplatRendertarget() {\n\t\tthis.splatRenderTarget &&= null;\n\t}\n\tsetupRenderTargetCopyObjects() {\n\t\tlet e = new fa({\n\t\t\tvertexShader: \"\\n                varying vec2 vUv;\\n                void main() {\\n                    vUv = uv;\\n                    gl_Position = vec4( position.xy, 0.0, 1.0 );    \\n                }\\n            \",\n\t\t\tfragmentShader: \"\\n                #include <common>\\n                #include <packing>\\n                varying vec2 vUv;\\n                uniform sampler2D sourceColorTexture;\\n                uniform sampler2D sourceDepthTexture;\\n                void main() {\\n                    vec4 color = texture2D(sourceColorTexture, vUv);\\n                    float fragDepth = texture2D(sourceDepthTexture, vUv).x;\\n                    gl_FragDepth = fragDepth;\\n                    gl_FragColor = vec4(color.rgb, color.a * 2.0);\\n              }\\n            \",\n\t\t\tuniforms: {\n\t\t\t\tsourceColorTexture: {\n\t\t\t\t\ttype: \"t\",\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\tsourceDepthTexture: {\n\t\t\t\t\ttype: \"t\",\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t},\n\t\t\tdepthWrite: !1,\n\t\t\tdepthTest: !1,\n\t\t\ttransparent: !0,\n\t\t\tblending: 5,\n\t\t\tblendSrc: 204,\n\t\t\tblendSrcAlpha: 204,\n\t\t\tblendDst: 205,\n\t\t\tblendDstAlpha: 205\n\t\t});\n\t\te.extensions.fragDepth = !0, this.renderTargetCopyQuad = new Ii(new na(2, 2), e), this.renderTargetCopyCamera = new Ra(-1, 1, 1, -1, 0, 1);\n\t}\n\tdestroyRenderTargetCopyObjects() {\n\t\tthis.renderTargetCopyQuad &&= ($l(this.renderTargetCopyQuad), null);\n\t}\n\tsetupMeshCursor() {\n\t\tif (!this.meshCursor) {\n\t\t\tlet e = new ta(.5, 1.5, 32), t = new wi({ color: 16777215 }), n = new Ii(e, t);\n\t\t\tn.rotation.set(0, 0, Math.PI), n.position.set(0, 1, 0);\n\t\t\tlet r = new Ii(e, t);\n\t\t\tr.position.set(0, -1, 0);\n\t\t\tlet i = new Ii(e, t);\n\t\t\ti.rotation.set(0, 0, Math.PI / 2), i.position.set(1, 0, 0);\n\t\t\tlet a = new Ii(e, t);\n\t\t\ta.rotation.set(0, 0, -Math.PI / 2), a.position.set(-1, 0, 0), this.meshCursor = new ir(), this.meshCursor.add(n), this.meshCursor.add(r), this.meshCursor.add(i), this.meshCursor.add(a), this.meshCursor.scale.set(.1, .1, .1), this.threeScene.add(this.meshCursor), this.meshCursor.visible = !1;\n\t\t}\n\t}\n\tdestroyMeshCursor() {\n\t\tthis.meshCursor &&= ($l(this.meshCursor), this.threeScene.remove(this.meshCursor), null);\n\t}\n\tsetMeshCursorVisibility(e) {\n\t\tthis.meshCursor.visible = e;\n\t}\n\tgetMeschCursorVisibility() {\n\t\treturn this.meshCursor.visible;\n\t}\n\tsetMeshCursorPosition(e) {\n\t\tthis.meshCursor.position.copy(e);\n\t}\n\tpositionAndOrientMeshCursor(e, t) {\n\t\tthis.meshCursor.position.copy(e), this.meshCursor.up.copy(t.up), this.meshCursor.lookAt(t.position);\n\t}\n\tsetupFocusMarker() {\n\t\tif (!this.focusMarker) {\n\t\t\tlet t = new ra(.5, 32, 32), n = e.buildFocusMarkerMaterial();\n\t\t\tn.depthTest = !1, n.depthWrite = !1, n.transparent = !0, this.focusMarker = new Ii(t, n);\n\t\t}\n\t}\n\tdestroyFocusMarker() {\n\t\tthis.focusMarker &&= ($l(this.focusMarker), null);\n\t}\n\tupdateFocusMarker = function() {\n\t\tlet e = new K(), t = new J(), n = new K();\n\t\treturn function(r, i, a) {\n\t\t\tt.copy(i.matrixWorld).invert(), e.copy(r).applyMatrix4(t), e.normalize().multiplyScalar(10), e.applyMatrix4(i.matrixWorld), n.copy(i.position).sub(r);\n\t\t\tlet o = n.length();\n\t\t\tthis.focusMarker.position.copy(r), this.focusMarker.scale.set(o, o, o), this.focusMarker.material.uniforms.realFocusPosition.value.copy(r), this.focusMarker.material.uniforms.viewport.value.copy(a), this.focusMarker.material.uniformsNeedUpdate = !0;\n\t\t};\n\t}();\n\tsetFocusMarkerVisibility(e) {\n\t\tthis.focusMarker.visible = e;\n\t}\n\tsetFocusMarkerOpacity(e) {\n\t\tthis.focusMarker.material.uniforms.opacity.value = e, this.focusMarker.material.uniformsNeedUpdate = !0;\n\t}\n\tgetFocusMarkerOpacity() {\n\t\treturn this.focusMarker.material.uniforms.opacity.value;\n\t}\n\tsetupControlPlane() {\n\t\tif (!this.controlPlane) {\n\t\t\tlet e = new na(1, 1);\n\t\t\te.rotateX(-Math.PI / 2);\n\t\t\tlet t = new wi({ color: 16777215 });\n\t\t\tt.transparent = !0, t.opacity = .6, t.depthTest = !1, t.depthWrite = !1, t.side = 2;\n\t\t\tlet n = new Ii(e, t), r = new K(0, 1, 0);\n\t\t\tr.normalize();\n\t\t\tlet i = new jf(r, new K(0, 0, 0), .5, .01, 56576, .1, .03);\n\t\t\tthis.controlPlane = new ir(), this.controlPlane.add(n), this.controlPlane.add(i);\n\t\t}\n\t}\n\tdestroyControlPlane() {\n\t\tthis.controlPlane &&= ($l(this.controlPlane), null);\n\t}\n\tsetControlPlaneVisibility(e) {\n\t\tthis.controlPlane.visible = e;\n\t}\n\tpositionAndOrientControlPlane = function() {\n\t\tlet e = new ln(), t = new K(0, 1, 0);\n\t\treturn function(n, r) {\n\t\t\te.setFromUnitVectors(t, r), this.controlPlane.position.copy(n), this.controlPlane.quaternion.copy(e);\n\t\t};\n\t}();\n\taddDebugMeshes() {\n\t\tthis.debugRoot = this.createDebugMeshes(), this.secondaryDebugRoot = this.createSecondaryDebugMeshes(), this.threeScene.add(this.debugRoot), this.threeScene.add(this.secondaryDebugRoot);\n\t}\n\tdestroyDebugMeshes() {\n\t\tfor (let e of [this.debugRoot, this.secondaryDebugRoot]) e && ($l(e), this.threeScene.remove(e));\n\t\tthis.debugRoot = null, this.secondaryDebugRoot = null;\n\t}\n\tcreateDebugMeshes(t) {\n\t\tlet n = new ra(1, 32, 32), r = new ir(), i = (i, a) => {\n\t\t\tlet o = new Ii(n, e.buildDebugMaterial(i));\n\t\t\to.renderOrder = t, r.add(o), o.position.fromArray(a);\n\t\t};\n\t\treturn i(16711680, [\n\t\t\t-50,\n\t\t\t0,\n\t\t\t0\n\t\t]), i(16711680, [\n\t\t\t50,\n\t\t\t0,\n\t\t\t0\n\t\t]), i(65280, [\n\t\t\t0,\n\t\t\t0,\n\t\t\t-50\n\t\t]), i(65280, [\n\t\t\t0,\n\t\t\t0,\n\t\t\t50\n\t\t]), i(16755200, [\n\t\t\t5,\n\t\t\t0,\n\t\t\t5\n\t\t]), r;\n\t}\n\tcreateSecondaryDebugMeshes(t) {\n\t\tlet n = new $i(3, 3, 3), r = new ir(), i = (i) => {\n\t\t\tlet a = new Ii(n, e.buildDebugMaterial(12303291));\n\t\t\ta.renderOrder = t, r.add(a), a.position.fromArray(i);\n\t\t};\n\t\treturn i([\n\t\t\t-10,\n\t\t\t0,\n\t\t\t-10\n\t\t]), i([\n\t\t\t-10,\n\t\t\t0,\n\t\t\t10\n\t\t]), i([\n\t\t\t10,\n\t\t\t0,\n\t\t\t-10\n\t\t]), i([\n\t\t\t10,\n\t\t\t0,\n\t\t\t10\n\t\t]), r;\n\t}\n\tstatic buildDebugMaterial(e) {\n\t\tlet t = new fa({\n\t\t\tuniforms: { color: {\n\t\t\t\ttype: \"v3\",\n\t\t\t\tvalue: new fr(e)\n\t\t\t} },\n\t\t\tvertexShader: \"\\n            #include <common>\\n            varying float ndcDepth;\\n\\n            void main() {\\n                gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position.xyz, 1.0);\\n                ndcDepth = gl_Position.z / gl_Position.w;\\n                gl_Position.x = gl_Position.x / gl_Position.w;\\n                gl_Position.y = gl_Position.y / gl_Position.w;\\n                gl_Position.z = 0.0;\\n                gl_Position.w = 1.0;\\n    \\n            }\\n        \",\n\t\t\tfragmentShader: \"\\n            #include <common>\\n            uniform vec3 color;\\n            varying float ndcDepth;\\n            void main() {\\n                gl_FragDepth = (ndcDepth + 1.0) / 2.0;\\n                gl_FragColor = vec4(color.rgb, 0.0);\\n            }\\n        \",\n\t\t\ttransparent: !1,\n\t\t\tdepthTest: !0,\n\t\t\tdepthWrite: !0,\n\t\t\tside: 0\n\t\t});\n\t\treturn t.extensions.fragDepth = !0, t;\n\t}\n\tstatic buildFocusMarkerMaterial(e) {\n\t\treturn new fa({\n\t\t\tuniforms: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttype: \"v3\",\n\t\t\t\t\tvalue: new fr(e)\n\t\t\t\t},\n\t\t\t\trealFocusPosition: {\n\t\t\t\t\ttype: \"v3\",\n\t\t\t\t\tvalue: new K()\n\t\t\t\t},\n\t\t\t\tviewport: {\n\t\t\t\t\ttype: \"v2\",\n\t\t\t\t\tvalue: new G()\n\t\t\t\t},\n\t\t\t\topacity: { value: 0 }\n\t\t\t},\n\t\t\tvertexShader: \"\\n            #include <common>\\n\\n            uniform vec2 viewport;\\n            uniform vec3 realFocusPosition;\\n\\n            varying vec4 ndcPosition;\\n            varying vec4 ndcCenter;\\n            varying vec4 ndcFocusPosition;\\n\\n            void main() {\\n                float radius = 0.01;\\n\\n                vec4 viewPosition = modelViewMatrix * vec4(position.xyz, 1.0);\\n                vec4 viewCenter = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\\n\\n                vec4 viewFocusPosition = modelViewMatrix * vec4(realFocusPosition, 1.0);\\n\\n                ndcPosition = projectionMatrix * viewPosition;\\n                ndcPosition = ndcPosition * vec4(1.0 / ndcPosition.w);\\n                ndcCenter = projectionMatrix * viewCenter;\\n                ndcCenter = ndcCenter * vec4(1.0 / ndcCenter.w);\\n\\n                ndcFocusPosition = projectionMatrix * viewFocusPosition;\\n                ndcFocusPosition = ndcFocusPosition * vec4(1.0 / ndcFocusPosition.w);\\n\\n                gl_Position = projectionMatrix * viewPosition;\\n\\n            }\\n        \",\n\t\t\tfragmentShader: \"\\n            #include <common>\\n            uniform vec3 color;\\n            uniform vec2 viewport;\\n            uniform float opacity;\\n\\n            varying vec4 ndcPosition;\\n            varying vec4 ndcCenter;\\n            varying vec4 ndcFocusPosition;\\n\\n            void main() {\\n                vec2 screenPosition = vec2(ndcPosition) * viewport;\\n                vec2 screenCenter = vec2(ndcCenter) * viewport;\\n\\n                vec2 screenVec = screenPosition - screenCenter;\\n\\n                float projectedRadius = length(screenVec);\\n\\n                float lineWidth = 0.0005 * viewport.y;\\n                float aaRange = 0.0025 * viewport.y;\\n                float radius = 0.06 * viewport.y;\\n                float radDiff = abs(projectedRadius - radius) - lineWidth;\\n                float alpha = 1.0 - clamp(radDiff / 5.0, 0.0, 1.0); \\n\\n                gl_FragColor = vec4(color.rgb, alpha * opacity);\\n            }\\n        \",\n\t\t\ttransparent: !0,\n\t\t\tdepthTest: !1,\n\t\t\tdepthWrite: !1,\n\t\t\tside: 0\n\t\t});\n\t}\n\tdispose() {\n\t\tthis.destroyMeshCursor(), this.destroyFocusMarker(), this.destroyDebugMeshes(), this.destroyControlPlane(), this.destroyRenderTargetCopyObjects(), this.destroySplatRendertarget();\n\t}\n}, Nf = new K(1, 0, 0), Pf = new K(0, 1, 0), Ff = new K(0, 0, 1), If = class {\n\tconstructor(e = new K(), t = new K()) {\n\t\tthis.origin = new K(), this.direction = new K(), this.setParameters(e, t);\n\t}\n\tsetParameters(e, t) {\n\t\tthis.origin.copy(e), this.direction.copy(t).normalize();\n\t}\n\tboxContainsPoint(e, t, n) {\n\t\treturn !(t.x < e.min.x - n || t.x > e.max.x + n || t.y < e.min.y - n || t.y > e.max.y + n || t.z < e.min.z - n || t.z > e.max.z + n);\n\t}\n\tintersectBox = function() {\n\t\tlet e = new K(), t = [], n = [], r = [];\n\t\treturn function(i, a) {\n\t\t\tif (n[0] = this.origin.x, n[1] = this.origin.y, n[2] = this.origin.z, r[0] = this.direction.x, r[1] = this.direction.y, r[2] = this.direction.z, this.boxContainsPoint(i, this.origin, 1e-4)) return a && (a.origin.copy(this.origin), a.normal.set(0, 0, 0), a.distance = -1), !0;\n\t\t\tfor (let o = 0; o < 3; o++) {\n\t\t\t\tif (r[o] == 0) continue;\n\t\t\t\tlet s = o == 0 ? Nf : o == 1 ? Pf : Ff, c = r[o] < 0 ? i.max : i.min, l = -Math.sign(r[o]);\n\t\t\t\tt[0] = o == 0 ? c.x : o == 1 ? c.y : c.z;\n\t\t\t\tlet u = t[0] - n[o];\n\t\t\t\tif (u * l < 0) {\n\t\t\t\t\tlet c = (o + 1) % 3, d = (o + 2) % 3;\n\t\t\t\t\tif (t[2] = r[c] / r[o] * u + n[c], t[1] = r[d] / r[o] * u + n[d], e.set(t[o], t[d], t[c]), this.boxContainsPoint(i, e, 1e-4)) return a && (a.origin.copy(e), a.normal.copy(s).multiplyScalar(l), a.distance = e.sub(this.origin).length()), !0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !1;\n\t\t};\n\t}();\n\tintersectSphere = function() {\n\t\tlet e = new K();\n\t\treturn function(t, n, r) {\n\t\t\te.copy(t).sub(this.origin);\n\t\t\tlet i = e.dot(this.direction), a = i * i, o = e.dot(e) - a, s = n * n;\n\t\t\tif (o > s) return !1;\n\t\t\tlet c = Math.sqrt(s - o), l = i - c, u = i + c;\n\t\t\tif (u < 0) return !1;\n\t\t\tlet d = l < 0 ? u : l;\n\t\t\treturn r && (r.origin.copy(this.origin).addScaledVector(this.direction, d), r.normal.copy(r.origin).sub(t).normalize(), r.distance = d), !0;\n\t\t};\n\t}();\n}, Lf = class e {\n\tconstructor() {\n\t\tthis.origin = new K(), this.normal = new K(), this.distance = 0, this.splatIndex = 0;\n\t}\n\tset(e, t, n, r) {\n\t\tthis.origin.copy(e), this.normal.copy(t), this.distance = n, this.splatIndex = r;\n\t}\n\tclone() {\n\t\tlet t = new e();\n\t\treturn t.origin.copy(this.origin), t.normal.copy(this.normal), t.distance = this.distance, t.splatIndex = this.splatIndex, t;\n\t}\n}, Rf = {\n\tThreeD: 0,\n\tTwoD: 1\n}, zf = class {\n\tconstructor(e, t, n = !1) {\n\t\tthis.ray = new If(e, t), this.raycastAgainstTrueSplatEllipsoid = n;\n\t}\n\tsetFromCameraAndScreenPosition = function() {\n\t\tlet e = new G();\n\t\treturn function(t, n, r) {\n\t\t\tif (e.x = n.x / r.x * 2 - 1, e.y = (r.y - n.y) / r.y * 2 - 1, t.isPerspectiveCamera) this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize(), this.camera = t;\n\t\t\telse if (t.isOrthographicCamera) this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld), this.camera = t;\n\t\t\telse throw Error(\"Raycaster::setFromCameraAndScreenPosition() -> Unsupported camera type\");\n\t\t};\n\t}();\n\tintersectSplatMesh = function() {\n\t\tlet e = new J(), t = new J(), n = new J(), r = new If(), i = new K();\n\t\treturn function(a, o = []) {\n\t\t\tlet s = a.getSplatTree();\n\t\t\tif (s) {\n\t\t\t\tfor (let c = 0; c < s.subTrees.length; c++) {\n\t\t\t\t\tlet l = s.subTrees[c];\n\t\t\t\t\tt.copy(a.matrixWorld), a.dynamicMode && (a.getSceneTransform(c, n), t.multiply(n)), e.copy(t).invert(), r.origin.copy(this.ray.origin).applyMatrix4(e), r.direction.copy(this.ray.origin).add(this.ray.direction), r.direction.applyMatrix4(e).sub(r.origin).normalize();\n\t\t\t\t\tlet u = [];\n\t\t\t\t\tl.rootNode && this.castRayAtSplatTreeNode(r, s, l.rootNode, u), u.forEach((e) => {\n\t\t\t\t\t\te.origin.applyMatrix4(t), e.normal.applyMatrix4(t).normalize(), e.distance = i.copy(e.origin).sub(this.ray.origin).length();\n\t\t\t\t\t}), o.push(...u);\n\t\t\t\t}\n\t\t\t\treturn o.sort((e, t) => e.distance > t.distance ? 1 : -1), o;\n\t\t\t}\n\t\t};\n\t}();\n\tcastRayAtSplatTreeNode = function() {\n\t\tlet e = new Dn(), t = new K(), n = new K(), r = new ln(), i = new Lf(), a = 1e-7, o = new K(0, 0, 0), s = new J(), c = new J(), l = new J(), u = new J(), d = new J(), f = new If();\n\t\treturn function(p, m, h, g = []) {\n\t\t\tif (p.intersectBox(h.boundingBox)) {\n\t\t\t\tif (h.data && h.data.indexes && h.data.indexes.length > 0) for (let _ = 0; _ < h.data.indexes.length; _++) {\n\t\t\t\t\tlet v = h.data.indexes[_], y = m.splatMesh.getSceneIndexForSplat(v);\n\t\t\t\t\tif (m.splatMesh.getScene(y).visible && (m.splatMesh.getSplatColor(v, e), m.splatMesh.getSplatCenter(v, t), m.splatMesh.getSplatScaleAndRotation(v, n, r), !(n.x <= a || n.y <= a || m.splatMesh.splatRenderMode === Rf.ThreeD && n.z <= a))) {\n\t\t\t\t\t\tif (this.raycastAgainstTrueSplatEllipsoid) {\n\t\t\t\t\t\t\tc.makeScale(n.x, n.y, n.z), l.makeRotationFromQuaternion(r);\n\t\t\t\t\t\t\tlet a = Math.log10(e.w) * 2;\n\t\t\t\t\t\t\tif (s.makeScale(a, a, a), d.copy(s).multiply(l).multiply(c), u.copy(d).invert(), f.origin.copy(p.origin).sub(t).applyMatrix4(u), f.direction.copy(p.origin).add(p.direction).sub(t), f.direction.applyMatrix4(u).sub(f.origin).normalize(), f.intersectSphere(o, 1, i)) {\n\t\t\t\t\t\t\t\tlet e = i.clone();\n\t\t\t\t\t\t\t\te.splatIndex = v, e.origin.applyMatrix4(d).add(t), g.push(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlet e = n.x + n.y, r = 2;\n\t\t\t\t\t\t\tif (m.splatMesh.splatRenderMode === Rf.ThreeD && (e += n.z, r = 3), e /= r, p.intersectSphere(t, e, i)) {\n\t\t\t\t\t\t\t\tlet e = i.clone();\n\t\t\t\t\t\t\t\te.splatIndex = v, g.push(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (h.children && h.children.length > 0) for (let e of h.children) this.castRayAtSplatTreeNode(p, m, e, g);\n\t\t\t\treturn g;\n\t\t\t}\n\t\t};\n\t}();\n}, Bf = class {\n\tstatic buildVertexShaderBase(e = !1, t = !1, n = 0, r = \"\") {\n\t\tlet i = \"\\n        precision highp float;\\n        #include <common>\\n\\n        attribute uint splatIndex;\\n        uniform highp usampler2D centersColorsTexture;\\n        uniform highp sampler2D sphericalHarmonicsTexture;\\n        uniform highp sampler2D sphericalHarmonicsTextureR;\\n        uniform highp sampler2D sphericalHarmonicsTextureG;\\n        uniform highp sampler2D sphericalHarmonicsTextureB;\\n\\n        uniform highp usampler2D sceneIndexesTexture;\\n        uniform vec2 sceneIndexesTextureSize;\\n        uniform int sceneCount;\\n    \";\n\t\treturn t && (i += `\n            uniform float sceneOpacity[${cu.MaxScenes}];\n            uniform int sceneVisibility[${cu.MaxScenes}];\n        `), e && (i += `\n            uniform highp mat4 transforms[${cu.MaxScenes}];\n        `), i += `\n        ${r}\n        uniform vec2 focal;\n        uniform float orthoZoom;\n        uniform int orthographicMode;\n        uniform int pointCloudModeEnabled;\n        uniform float inverseFocalAdjustment;\n        uniform vec2 viewport;\n        uniform vec2 basisViewport;\n        uniform vec2 centersColorsTextureSize;\n        uniform int sphericalHarmonicsDegree;\n        uniform vec2 sphericalHarmonicsTextureSize;\n        uniform int sphericalHarmonics8BitMode;\n        uniform int sphericalHarmonicsMultiTextureMode;\n        uniform float visibleRegionRadius;\n        uniform float visibleRegionFadeStartRadius;\n        uniform float firstRenderTime;\n        uniform float currentTime;\n        uniform int fadeInComplete;\n        uniform vec3 sceneCenter;\n        uniform float splatScale;\n        uniform float sphericalHarmonics8BitCompressionRangeMin[${cu.MaxScenes}];\n        uniform float sphericalHarmonics8BitCompressionRangeMax[${cu.MaxScenes}];\n\n        varying vec4 vColor;\n        varying vec2 vUv;\n        varying vec2 vPosition;\n\n        mat3 quaternionToRotationMatrix(float x, float y, float z, float w) {\n            float s = 1.0 / sqrt(w * w + x * x + y * y + z * z);\n        \n            return mat3(\n                1. - 2. * (y * y + z * z),\n                2. * (x * y + w * z),\n                2. * (x * z - w * y),\n                2. * (x * y - w * z),\n                1. - 2. * (x * x + z * z),\n                2. * (y * z + w * x),\n                2. * (x * z + w * y),\n                2. * (y * z - w * x),\n                1. - 2. * (x * x + y * y)\n            );\n        }\n\n        const float sqrt8 = sqrt(8.0);\n        const float minAlpha = 1.0 / 255.0;\n\n        const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n        const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n        const uvec4 shift4 = uvec4(0, 8, 16, 24);\n        vec4 uintToRGBAVec (uint u) {\n           uvec4 urgba = mask4 & u;\n           urgba = urgba >> shift4;\n           vec4 rgba = vec4(urgba) * encodeNorm4;\n           return rgba;\n        }\n\n        vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n            vec2 samplerUV = vec2(0.0, 0.0);\n            float d = float(splatIndex * uint(stride) + uint(offset)) / dimensions.x;\n            samplerUV.y = float(floor(d)) / dimensions.y;\n            samplerUV.x = fract(d);\n            return samplerUV;\n        }\n\n        vec2 getDataUVF(in uint sIndex, in float stride, in uint offset, in vec2 dimensions) {\n            vec2 samplerUV = vec2(0.0, 0.0);\n            float d = float(uint(float(sIndex) * stride) + offset) / dimensions.x;\n            samplerUV.y = float(floor(d)) / dimensions.y;\n            samplerUV.x = fract(d);\n            return samplerUV;\n        }\n\n        const float SH_C1 = 0.4886025119029199f;\n        const float[5] SH_C2 = float[](1.0925484, -1.0925484, 0.3153916, -1.0925484, 0.5462742);\n\n        void main () {\n\n            uint oddOffset = splatIndex & uint(0x00000001);\n            uint doubleOddOffset = oddOffset * uint(2);\n            bool isEven = oddOffset == uint(0);\n            uint nearestEvenIndex = splatIndex - oddOffset;\n            float fOddOffset = float(oddOffset);\n\n            uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n            vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n\n            uint sceneIndex = uint(0);\n            if (sceneCount > 1) {\n                sceneIndex = texture(sceneIndexesTexture, getDataUV(1, 0, sceneIndexesTextureSize)).r;\n            }\n            `, t && (i += \"\\n                float splatOpacityFromScene = sceneOpacity[sceneIndex];\\n                int sceneVisible = sceneVisibility[sceneIndex];\\n                if (splatOpacityFromScene <= 0.01 || sceneVisible == 0) {\\n                    gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\\n                    return;\\n                }\\n            \"), i += e ? \"\\n                mat4 transform = transforms[sceneIndex];\\n                mat4 transformModelViewMatrix = viewMatrix * transform;\\n            \" : \"mat4 transformModelViewMatrix = modelViewMatrix;\", i += \"\\n            float sh8BitCompressionRangeMinForScene = sphericalHarmonics8BitCompressionRangeMin[sceneIndex];\\n            float sh8BitCompressionRangeMaxForScene = sphericalHarmonics8BitCompressionRangeMax[sceneIndex];\\n            float sh8BitCompressionRangeForScene = sh8BitCompressionRangeMaxForScene - sh8BitCompressionRangeMinForScene;\\n            float sh8BitCompressionHalfRangeForScene = sh8BitCompressionRangeForScene / 2.0;\\n            vec3 vec8BitSHShift = vec3(sh8BitCompressionRangeMinForScene);\\n\\n            vec4 viewCenter = transformModelViewMatrix * vec4(splatCenter, 1.0);\\n\\n            vec4 clipCenter = projectionMatrix * viewCenter;\\n\\n            float clip = 1.2 * clipCenter.w;\\n            if (clipCenter.z < -clip || clipCenter.x < -clip || clipCenter.x > clip || clipCenter.y < -clip || clipCenter.y > clip) {\\n                gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\\n                return;\\n            }\\n\\n            vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\\n\\n            vPosition = position.xy;\\n            vColor = uintToRGBAVec(sampledCenterColor.r);\\n        \", n >= 1 && (i += \"   \\n            if (sphericalHarmonicsDegree >= 1) {\\n            \", i += e ? \"\\n                    vec3 worldViewDir = normalize(splatCenter - vec3(inverse(transform) * vec4(cameraPosition, 1.0)));\\n                \" : \"\\n                    vec3 worldViewDir = normalize(splatCenter - cameraPosition);\\n                \", i += \"\\n                vec3 sh1;\\n                vec3 sh2;\\n                vec3 sh3;\\n            \", n >= 2 && (i += \"\\n                    vec3 sh4;\\n                    vec3 sh5;\\n                    vec3 sh6;\\n                    vec3 sh7;\\n                    vec3 sh8;\\n                \"), n === 1 ? i += \"\\n                    if (sphericalHarmonicsMultiTextureMode == 0) {\\n                        vec2 shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset, sphericalHarmonicsTextureSize);\\n                        vec4 sampledSH0123 = texture(sphericalHarmonicsTexture, shUV);\\n                        shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset + uint(1), sphericalHarmonicsTextureSize);\\n                        vec4 sampledSH4567 = texture(sphericalHarmonicsTexture, shUV);\\n                        shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset + uint(2), sphericalHarmonicsTextureSize);\\n                        vec4 sampledSH891011 = texture(sphericalHarmonicsTexture, shUV);\\n                        sh1 = vec3(sampledSH0123.rgb) * (1.0 - fOddOffset) + vec3(sampledSH0123.ba, sampledSH4567.r) * fOddOffset;\\n                        sh2 = vec3(sampledSH0123.a, sampledSH4567.rg) * (1.0 - fOddOffset) + vec3(sampledSH4567.gba) * fOddOffset;\\n                        sh3 = vec3(sampledSH4567.ba, sampledSH891011.r) * (1.0 - fOddOffset) + vec3(sampledSH891011.rgb) * fOddOffset;\\n                    } else {\\n                        vec2 sampledSH01R = texture(sphericalHarmonicsTextureR, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\\n                        vec2 sampledSH23R = texture(sphericalHarmonicsTextureR, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\\n                        vec2 sampledSH01G = texture(sphericalHarmonicsTextureG, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\\n                        vec2 sampledSH23G = texture(sphericalHarmonicsTextureG, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\\n                        vec2 sampledSH01B = texture(sphericalHarmonicsTextureB, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\\n                        vec2 sampledSH23B = texture(sphericalHarmonicsTextureB, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\\n                        sh1 = vec3(sampledSH01R.rg, sampledSH23R.r);\\n                        sh2 = vec3(sampledSH01G.rg, sampledSH23G.r);\\n                        sh3 = vec3(sampledSH01B.rg, sampledSH23B.r);\\n                    }\\n                \" : n === 2 && (i += \"\\n                    vec4 sampledSH0123;\\n                    vec4 sampledSH4567;\\n                    vec4 sampledSH891011;\\n\\n                    vec4 sampledSH0123R;\\n                    vec4 sampledSH0123G;\\n                    vec4 sampledSH0123B;\\n\\n                    if (sphericalHarmonicsMultiTextureMode == 0) {\\n                        sampledSH0123 = texture(sphericalHarmonicsTexture, getDataUV(6, 0, sphericalHarmonicsTextureSize));\\n                        sampledSH4567 = texture(sphericalHarmonicsTexture, getDataUV(6, 1, sphericalHarmonicsTextureSize));\\n                        sampledSH891011 = texture(sphericalHarmonicsTexture, getDataUV(6, 2, sphericalHarmonicsTextureSize));\\n                        sh1 = sampledSH0123.rgb;\\n                        sh2 = vec3(sampledSH0123.a, sampledSH4567.rg);\\n                        sh3 = vec3(sampledSH4567.ba, sampledSH891011.r);\\n                    } else {\\n                        sampledSH0123R = texture(sphericalHarmonicsTextureR, getDataUV(2, 0, sphericalHarmonicsTextureSize));\\n                        sampledSH0123G = texture(sphericalHarmonicsTextureG, getDataUV(2, 0, sphericalHarmonicsTextureSize));\\n                        sampledSH0123B = texture(sphericalHarmonicsTextureB, getDataUV(2, 0, sphericalHarmonicsTextureSize));\\n                        sh1 = vec3(sampledSH0123R.rgb);\\n                        sh2 = vec3(sampledSH0123G.rgb);\\n                        sh3 = vec3(sampledSH0123B.rgb);\\n                    }\\n                \"), i += \"\\n                    if (sphericalHarmonics8BitMode == 1) {\\n                        sh1 = sh1 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                        sh2 = sh2 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                        sh3 = sh3 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                    }\\n                    float x = worldViewDir.x;\\n                    float y = worldViewDir.y;\\n                    float z = worldViewDir.z;\\n                    vColor.rgb += SH_C1 * (-sh1 * y + sh2 * z - sh3 * x);\\n            \", n >= 2 && (i += \"\\n                    if (sphericalHarmonicsDegree >= 2) {\\n                        float xx = x * x;\\n                        float yy = y * y;\\n                        float zz = z * z;\\n                        float xy = x * y;\\n                        float yz = y * z;\\n                        float xz = x * z;\\n                \", n === 2 && (i += \"\\n                        if (sphericalHarmonicsMultiTextureMode == 0) {\\n                            vec4 sampledSH12131415 = texture(sphericalHarmonicsTexture, getDataUV(6, 3, sphericalHarmonicsTextureSize));\\n                            vec4 sampledSH16171819 = texture(sphericalHarmonicsTexture, getDataUV(6, 4, sphericalHarmonicsTextureSize));\\n                            vec4 sampledSH20212223 = texture(sphericalHarmonicsTexture, getDataUV(6, 5, sphericalHarmonicsTextureSize));\\n                            sh4 = sampledSH891011.gba;\\n                            sh5 = sampledSH12131415.rgb;\\n                            sh6 = vec3(sampledSH12131415.a, sampledSH16171819.rg);\\n                            sh7 = vec3(sampledSH16171819.ba, sampledSH20212223.r);\\n                            sh8 = sampledSH20212223.gba;\\n                        } else {\\n                            vec4 sampledSH4567R = texture(sphericalHarmonicsTextureR, getDataUV(2, 1, sphericalHarmonicsTextureSize));\\n                            vec4 sampledSH4567G = texture(sphericalHarmonicsTextureG, getDataUV(2, 1, sphericalHarmonicsTextureSize));\\n                            vec4 sampledSH4567B = texture(sphericalHarmonicsTextureB, getDataUV(2, 1, sphericalHarmonicsTextureSize));\\n                            sh4 = vec3(sampledSH0123R.a, sampledSH4567R.rg);\\n                            sh5 = vec3(sampledSH4567R.ba, sampledSH0123G.a);\\n                            sh6 = vec3(sampledSH4567G.rgb);\\n                            sh7 = vec3(sampledSH4567G.a, sampledSH0123B.a, sampledSH4567B.r);\\n                            sh8 = vec3(sampledSH4567B.gba);\\n                        }\\n                    \"), i += \"\\n                        if (sphericalHarmonics8BitMode == 1) {\\n                            sh4 = sh4 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                            sh5 = sh5 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                            sh6 = sh6 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                            sh7 = sh7 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                            sh8 = sh8 * sh8BitCompressionRangeForScene + vec8BitSHShift;\\n                        }\\n\\n                        vColor.rgb +=\\n                            (SH_C2[0] * xy) * sh4 +\\n                            (SH_C2[1] * yz) * sh5 +\\n                            (SH_C2[2] * (2.0 * zz - xx - yy)) * sh6 +\\n                            (SH_C2[3] * xz) * sh7 +\\n                            (SH_C2[4] * (xx - yy)) * sh8;\\n                    }\\n                \"), i += \"\\n\\n                vColor.rgb = clamp(vColor.rgb, vec3(0.), vec3(1.));\\n\\n            }\\n\\n            \"), i;\n\t}\n\tstatic getVertexShaderFadeIn() {\n\t\treturn \"\\n            if (fadeInComplete == 0) {\\n                float opacityAdjust = 1.0;\\n                float centerDist = length(splatCenter - sceneCenter);\\n                float renderTime = max(currentTime - firstRenderTime, 0.0);\\n\\n                float fadeDistance = 0.75;\\n                float distanceLoadFadeInFactor = step(visibleRegionFadeStartRadius, centerDist);\\n                distanceLoadFadeInFactor = (1.0 - distanceLoadFadeInFactor) +\\n                                        (1.0 - clamp((centerDist - visibleRegionFadeStartRadius) / fadeDistance, 0.0, 1.0)) *\\n                                        distanceLoadFadeInFactor;\\n                opacityAdjust *= distanceLoadFadeInFactor;\\n                vColor.a *= opacityAdjust;\\n            }\\n        \";\n\t}\n\tstatic getUniforms(e = !1, t = !1, n = 0, r = 1, i = !1) {\n\t\tlet a = {\n\t\t\tsceneCenter: {\n\t\t\t\ttype: \"v3\",\n\t\t\t\tvalue: new K()\n\t\t\t},\n\t\t\tfadeInComplete: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\torthographicMode: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tvisibleRegionFadeStartRadius: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tvisibleRegionRadius: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tcurrentTime: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tfirstRenderTime: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tcentersColorsTexture: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsphericalHarmonicsTexture: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsphericalHarmonicsTextureR: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsphericalHarmonicsTextureG: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsphericalHarmonicsTextureB: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsphericalHarmonics8BitCompressionRangeMin: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tsphericalHarmonics8BitCompressionRangeMax: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tfocal: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new G()\n\t\t\t},\n\t\t\torthoZoom: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 1\n\t\t\t},\n\t\t\tinverseFocalAdjustment: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 1\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new G()\n\t\t\t},\n\t\t\tbasisViewport: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new G()\n\t\t\t},\n\t\t\tdebugColor: {\n\t\t\t\ttype: \"v3\",\n\t\t\t\tvalue: new fr()\n\t\t\t},\n\t\t\tcentersColorsTextureSize: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new G(1024, 1024)\n\t\t\t},\n\t\t\tsphericalHarmonicsDegree: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: n\n\t\t\t},\n\t\t\tsphericalHarmonicsTextureSize: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new G(1024, 1024)\n\t\t\t},\n\t\t\tsphericalHarmonics8BitMode: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tsphericalHarmonicsMultiTextureMode: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tsplatScale: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: r\n\t\t\t},\n\t\t\tpointCloudModeEnabled: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: +!!i\n\t\t\t},\n\t\t\tsceneIndexesTexture: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsceneIndexesTextureSize: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new G(1024, 1024)\n\t\t\t},\n\t\t\tsceneCount: {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t};\n\t\tfor (let e = 0; e < cu.MaxScenes; e++) a.sphericalHarmonics8BitCompressionRangeMin.value.push(-cu.SphericalHarmonics8BitCompressionRange / 2), a.sphericalHarmonics8BitCompressionRangeMax.value.push(cu.SphericalHarmonics8BitCompressionRange / 2);\n\t\tif (t) {\n\t\t\tlet e = [];\n\t\t\tfor (let t = 0; t < cu.MaxScenes; t++) e.push(1);\n\t\t\ta.sceneOpacity = {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: e\n\t\t\t};\n\t\t\tlet t = [];\n\t\t\tfor (let e = 0; e < cu.MaxScenes; e++) t.push(1);\n\t\t\ta.sceneVisibility = {\n\t\t\t\ttype: \"i\",\n\t\t\t\tvalue: t\n\t\t\t};\n\t\t}\n\t\tif (e) {\n\t\t\tlet e = [];\n\t\t\tfor (let t = 0; t < cu.MaxScenes; t++) e.push(new J());\n\t\t\ta.transforms = {\n\t\t\t\ttype: \"mat4\",\n\t\t\t\tvalue: e\n\t\t\t};\n\t\t}\n\t\treturn a;\n\t}\n}, Vf = class e {\n\tstatic build(t = !1, n = !1, r = !1, i = 2048, a = 1, o = !1, s = 0, c = .3) {\n\t\tlet l = Bf.buildVertexShaderBase(t, n, s, \"\\n            uniform vec2 covariancesTextureSize;\\n            uniform highp sampler2D covariancesTexture;\\n            uniform highp usampler2D covariancesTextureHalfFloat;\\n            uniform int covariancesAreHalfFloat;\\n\\n            void fromCovarianceHalfFloatV4(uvec4 val, out vec4 first, out vec4 second) {\\n                vec2 r = unpackHalf2x16(val.r);\\n                vec2 g = unpackHalf2x16(val.g);\\n                vec2 b = unpackHalf2x16(val.b);\\n\\n                first = vec4(r.x, r.y, g.x, g.y);\\n                second = vec4(b.x, b.y, 0.0, 0.0);\\n            }\\n        \");\n\t\tl += e.buildVertexShaderProjection(r, n, i, c);\n\t\tlet u = e.buildFragmentShader(), d = Bf.getUniforms(t, n, s, a, o);\n\t\treturn d.covariancesTextureSize = {\n\t\t\ttype: \"v2\",\n\t\t\tvalue: new G(1024, 1024)\n\t\t}, d.covariancesTexture = {\n\t\t\ttype: \"t\",\n\t\t\tvalue: null\n\t\t}, d.covariancesTextureHalfFloat = {\n\t\t\ttype: \"t\",\n\t\t\tvalue: null\n\t\t}, d.covariancesAreHalfFloat = {\n\t\t\ttype: \"i\",\n\t\t\tvalue: 0\n\t\t}, new fa({\n\t\t\tuniforms: d,\n\t\t\tvertexShader: l,\n\t\t\tfragmentShader: u,\n\t\t\ttransparent: !0,\n\t\t\talphaTest: 1,\n\t\t\tblending: 1,\n\t\t\tdepthTest: !0,\n\t\t\tdepthWrite: !1,\n\t\t\tside: 2\n\t\t});\n\t}\n\tstatic buildVertexShaderProjection(e, t, n, r) {\n\t\tlet i = \"\\n\\n            vec4 sampledCovarianceA;\\n            vec4 sampledCovarianceB;\\n            vec3 cov3D_M11_M12_M13;\\n            vec3 cov3D_M22_M23_M33;\\n            if (covariancesAreHalfFloat == 0) {\\n                sampledCovarianceA = texture(covariancesTexture, getDataUVF(nearestEvenIndex, 1.5, oddOffset,\\n                                                                            covariancesTextureSize));\\n                sampledCovarianceB = texture(covariancesTexture, getDataUVF(nearestEvenIndex, 1.5, oddOffset + uint(1),\\n                                                                            covariancesTextureSize));\\n\\n                cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rgb) * (1.0 - fOddOffset) +\\n                                    vec3(sampledCovarianceA.ba, sampledCovarianceB.r) * fOddOffset;\\n                cov3D_M22_M23_M33 = vec3(sampledCovarianceA.a, sampledCovarianceB.rg) * (1.0 - fOddOffset) +\\n                                    vec3(sampledCovarianceB.gba) * fOddOffset;\\n            } else {\\n                uvec4 sampledCovarianceU = texture(covariancesTextureHalfFloat, getDataUV(1, 0, covariancesTextureSize));\\n                fromCovarianceHalfFloatV4(sampledCovarianceU, sampledCovarianceA, sampledCovarianceB);\\n                cov3D_M11_M12_M13 = sampledCovarianceA.rgb;\\n                cov3D_M22_M23_M33 = vec3(sampledCovarianceA.a, sampledCovarianceB.rg);\\n            }\\n        \\n            // Construct the 3D covariance matrix\\n            mat3 Vrk = mat3(\\n                cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\\n                cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\\n                cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\\n            );\\n\\n            mat3 J;\\n            if (orthographicMode == 1) {\\n                // Since the projection is linear, we don't need an approximation\\n                J = transpose(mat3(orthoZoom, 0.0, 0.0,\\n                                0.0, orthoZoom, 0.0,\\n                                0.0, 0.0, 0.0));\\n            } else {\\n                // Construct the Jacobian of the affine approximation of the projection matrix. It will be used to transform the\\n                // 3D covariance matrix instead of using the actual projection matrix because that transformation would\\n                // require a non-linear component (perspective division) which would yield a non-gaussian result.\\n                float s = 1.0 / (viewCenter.z * viewCenter.z);\\n                J = mat3(\\n                    focal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\\n                    0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\\n                    0., 0., 0.\\n                );\\n            }\\n\\n            // Concatenate the projection approximation with the model-view transformation\\n            mat3 W = transpose(mat3(transformModelViewMatrix));\\n            mat3 T = W * J;\\n\\n            // Transform the 3D covariance matrix (Vrk) to compute the 2D covariance matrix\\n            mat3 cov2Dm = transpose(T) * Vrk * T;\\n            \";\n\t\treturn i += e ? `\n                float detOrig = cov2Dm[0][0] * cov2Dm[1][1] - cov2Dm[0][1] * cov2Dm[0][1];\n                cov2Dm[0][0] += ${r};\n                cov2Dm[1][1] += ${r};\n                float detBlur = cov2Dm[0][0] * cov2Dm[1][1] - cov2Dm[0][1] * cov2Dm[0][1];\n                vColor.a *= sqrt(max(detOrig / detBlur, 0.0));\n                if (vColor.a < minAlpha) return;\n            ` : `\n                cov2Dm[0][0] += ${r};\n                cov2Dm[1][1] += ${r};\n            `, i += `\n\n            // We are interested in the upper-left 2x2 portion of the projected 3D covariance matrix because\n            // we only care about the X and Y values. We want the X-diagonal, cov2Dm[0][0],\n            // the Y-diagonal, cov2Dm[1][1], and the correlation between the two cov2Dm[0][1]. We don't\n            // need cov2Dm[1][0] because it is a symetric matrix.\n            vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n            // We now need to solve for the eigen-values and eigen vectors of the 2D covariance matrix\n            // so that we can determine the 2D basis for the splat. This is done using the method described\n            // here: https://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n            // After calculating the eigen-values and eigen-vectors, we calculate the basis for rendering the splat\n            // by normalizing the eigen-vectors and then multiplying them by (sqrt(8) * sqrt(eigen-value)), which is\n            // equal to scaling them by sqrt(8) standard deviations.\n            //\n            // This is a different approach than in the original work at INRIA. In that work they compute the\n            // max extents of the projected splat in screen space to form a screen-space aligned bounding rectangle\n            // which forms the geometry that is actually rasterized. The dimensions of that bounding box are 3.0\n            // times the square root of the maximum eigen-value, or 3 standard deviations. They then use the inverse\n            // 2D covariance matrix (called 'conic') in the CUDA rendering thread to determine fragment opacity by\n            // calculating the full gaussian: exp(-0.5 * (X - mean) * conic * (X - mean)) * splat opacity\n            float a = cov2Dv.x;\n            float d = cov2Dv.z;\n            float b = cov2Dv.y;\n            float D = a * d - b * b;\n            float trace = a + d;\n            float traceOver2 = 0.5 * trace;\n            float term2 = sqrt(max(0.1f, traceOver2 * traceOver2 - D));\n            float eigenValue1 = traceOver2 + term2;\n            float eigenValue2 = traceOver2 - term2;\n\n            if (pointCloudModeEnabled == 1) {\n                eigenValue1 = eigenValue2 = 0.2;\n            }\n\n            if (eigenValue2 <= 0.0) return;\n\n            vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n            // since the eigen vectors are orthogonal, we derive the second one from the first\n            vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n\n            // We use sqrt(8) standard deviations instead of 3 to eliminate more of the splat with a very low opacity.\n            vec2 basisVector1 = eigenVector1 * splatScale * min(sqrt8 * sqrt(eigenValue1), ${parseInt(n)}.0);\n            vec2 basisVector2 = eigenVector2 * splatScale * min(sqrt8 * sqrt(eigenValue2), ${parseInt(n)}.0);\n            `, t && (i += \"\\n                vColor.a *= splatOpacityFromScene;\\n            \"), i += \"\\n            vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) *\\n                             basisViewport * 2.0 * inverseFocalAdjustment;\\n\\n            vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\\n            gl_Position = quadPos;\\n\\n            // Scale the position data we send to the fragment shader\\n            vPosition *= sqrt8;\\n        \", i += Bf.getVertexShaderFadeIn(), i += \"}\", i;\n\t}\n\tstatic buildFragmentShader() {\n\t\tlet e = \"\\n            precision highp float;\\n            #include <common>\\n \\n            uniform vec3 debugColor;\\n\\n            varying vec4 vColor;\\n            varying vec2 vUv;\\n            varying vec2 vPosition;\\n        \";\n\t\treturn e += \"\\n            void main () {\\n                // Compute the positional squared distance from the center of the splat to the current fragment.\\n                float A = dot(vPosition, vPosition);\\n                // Since the positional data in vPosition has been scaled by sqrt(8), the squared result will be\\n                // scaled by a factor of 8. If the squared result is larger than 8, it means it is outside the ellipse\\n                // defined by the rectangle formed by vPosition. It also means it's farther\\n                // away than sqrt(8) standard deviations from the mean.\\n                if (A > 8.0) discard;\\n                vec3 color = vColor.rgb;\\n\\n                // Since the rendered splat is scaled by sqrt(8), the inverse covariance matrix that is part of\\n                // the gaussian formula becomes the identity matrix. We're then left with (X - mean) * (X - mean),\\n                // and since 'mean' is zero, we have X * X, which is the same as A:\\n                float opacity = exp(-0.5 * A) * vColor.a;\\n\\n                gl_FragColor = vec4(color.rgb, opacity);\\n            }\\n        \", e;\n\t}\n}, Hf = class e {\n\tstatic build(t = !1, n = !1, r = 1, i = !1, a = 0) {\n\t\tlet o = Bf.buildVertexShaderBase(t, n, a, \"\\n            uniform vec2 scaleRotationsTextureSize;\\n            uniform highp sampler2D scaleRotationsTexture;\\n            varying mat3 vT;\\n            varying vec2 vQuadCenter;\\n            varying vec2 vFragCoord;\\n        \");\n\t\to += e.buildVertexShaderProjection();\n\t\tlet s = e.buildFragmentShader(), c = Bf.getUniforms(t, n, a, r, i);\n\t\treturn c.scaleRotationsTexture = {\n\t\t\ttype: \"t\",\n\t\t\tvalue: null\n\t\t}, c.scaleRotationsTextureSize = {\n\t\t\ttype: \"v2\",\n\t\t\tvalue: new G(1024, 1024)\n\t\t}, new fa({\n\t\t\tuniforms: c,\n\t\t\tvertexShader: o,\n\t\t\tfragmentShader: s,\n\t\t\ttransparent: !0,\n\t\t\talphaTest: 1,\n\t\t\tblending: 1,\n\t\t\tdepthTest: !0,\n\t\t\tdepthWrite: !1,\n\t\t\tside: 2\n\t\t});\n\t}\n\tstatic buildVertexShaderProjection() {\n\t\tlet e = \"\\n\\n            vec4 scaleRotationA = texture(scaleRotationsTexture, getDataUVF(nearestEvenIndex, 1.5,\\n                                                                            oddOffset, scaleRotationsTextureSize));\\n            vec4 scaleRotationB = texture(scaleRotationsTexture, getDataUVF(nearestEvenIndex, 1.5,\\n                                                                            oddOffset + uint(1), scaleRotationsTextureSize));\\n\\n            vec3 scaleRotation123 = vec3(scaleRotationA.rgb) * (1.0 - fOddOffset) +\\n                                    vec3(scaleRotationA.ba, scaleRotationB.r) * fOddOffset;\\n            vec3 scaleRotation456 = vec3(scaleRotationA.a, scaleRotationB.rg) * (1.0 - fOddOffset) +\\n                                    vec3(scaleRotationB.gba) * fOddOffset;\\n\\n            float missingW = sqrt(1.0 - scaleRotation456.x * scaleRotation456.x - scaleRotation456.y *\\n                                    scaleRotation456.y - scaleRotation456.z * scaleRotation456.z);\\n            mat3 R = quaternionToRotationMatrix(scaleRotation456.r, scaleRotation456.g, scaleRotation456.b, missingW);\\n            mat3 S = mat3(scaleRotation123.r, 0.0, 0.0,\\n                            0.0, scaleRotation123.g, 0.0,\\n                            0.0, 0.0, scaleRotation123.b);\\n            \\n            mat3 L = R * S;\\n\\n            mat3x4 splat2World = mat3x4(vec4(L[0], 0.0),\\n                                        vec4(L[1], 0.0),\\n                                        vec4(splatCenter.x, splatCenter.y, splatCenter.z, 1.0));\\n\\n            mat4 world2ndc = transpose(projectionMatrix * transformModelViewMatrix);\\n\\n            mat3x4 ndc2pix = mat3x4(vec4(viewport.x / 2.0, 0.0, 0.0, (viewport.x - 1.0) / 2.0),\\n                                    vec4(0.0, viewport.y / 2.0, 0.0, (viewport.y - 1.0) / 2.0),\\n                                    vec4(0.0, 0.0, 0.0, 1.0));\\n\\n            mat3 T = transpose(splat2World) * world2ndc * ndc2pix;\\n            vec3 normal = vec3(viewMatrix * vec4(L[0][2], L[1][2], L[2][2], 0.0));\\n        \";\n\t\treturn e += \"\\n\\n                mat4 splat2World4 = mat4(vec4(L[0], 0.0),\\n                                        vec4(L[1], 0.0),\\n                                        vec4(L[2], 0.0),\\n                                        vec4(splatCenter.x, splatCenter.y, splatCenter.z, 1.0));\\n\\n                mat4 Tt = transpose(transpose(splat2World4) * world2ndc);\\n\\n                vec4 tempPoint1 = Tt * vec4(1.0, 0.0, 0.0, 1.0);\\n                tempPoint1 /= tempPoint1.w;\\n\\n                vec4 tempPoint2 = Tt * vec4(0.0, 1.0, 0.0, 1.0);\\n                tempPoint2 /= tempPoint2.w;\\n\\n                vec4 center = Tt * vec4(0.0, 0.0, 0.0, 1.0);\\n                center /= center.w;\\n\\n                vec2 basisVector1 = tempPoint1.xy - center.xy;\\n                vec2 basisVector2 = tempPoint2.xy - center.xy;\\n\\n                vec2 basisVector1Screen = basisVector1 * 0.5 * viewport;\\n                vec2 basisVector2Screen = basisVector2 * 0.5 * viewport;\\n\\n                const float minPix = 1.;\\n                if (length(basisVector1Screen) < minPix || length(basisVector2Screen) < minPix) {\\n                    \\n            vec3 T0 = vec3(T[0][0], T[0][1], T[0][2]);\\n            vec3 T1 = vec3(T[1][0], T[1][1], T[1][2]);\\n            vec3 T3 = vec3(T[2][0], T[2][1], T[2][2]);\\n\\n            vec3 tempPoint = vec3(1.0, 1.0, -1.0);\\n            float distance = (T3.x * T3.x * tempPoint.x) + (T3.y * T3.y * tempPoint.y) + (T3.z * T3.z * tempPoint.z);\\n            vec3 f = (1.0 / distance) * tempPoint;\\n            if (abs(distance) < 0.00001) return;\\n\\n            float pointImageX = (T0.x * T3.x * f.x) + (T0.y * T3.y * f.y) + (T0.z * T3.z * f.z);\\n            float pointImageY = (T1.x * T3.x * f.x) + (T1.y * T3.y * f.y) + (T1.z * T3.z * f.z);\\n            vec2 pointImage = vec2(pointImageX, pointImageY);\\n\\n            float tempX = (T0.x * T0.x * f.x) + (T0.y * T0.y * f.y) + (T0.z * T0.z * f.z);\\n            float tempY = (T1.x * T1.x * f.x) + (T1.y * T1.y * f.y) + (T1.z * T1.z * f.z);\\n            vec2 temp = vec2(tempX, tempY);\\n\\n            vec2 halfExtend = pointImage * pointImage - temp;\\n            vec2 extent = sqrt(max(vec2(0.0001), halfExtend));\\n            float radius = max(extent.x, extent.y);\\n\\n            vec2 ndcOffset = ((position.xy * radius * 3.0) * basisViewport * 2.0);\\n\\n            vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\\n            gl_Position = quadPos;\\n\\n            vT = T;\\n            vQuadCenter = pointImage;\\n            vFragCoord = (quadPos.xy * 0.5 + 0.5) * viewport;\\n        \\n                } else {\\n                    vec2 ndcOffset = vec2(position.x * basisVector1 + position.y * basisVector2) * 3.0 * inverseFocalAdjustment;\\n                    vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\\n                    gl_Position = quadPos;\\n\\n                    vT = T;\\n                    vQuadCenter = center.xy;\\n                    vFragCoord = (quadPos.xy * 0.5 + 0.5) * viewport;\\n                }\\n            \", e += Bf.getVertexShaderFadeIn(), e += \"}\", e;\n\t}\n\tstatic buildFragmentShader() {\n\t\treturn \"\\n            precision highp float;\\n            #include <common>\\n\\n            uniform vec3 debugColor;\\n\\n            varying vec4 vColor;\\n            varying vec2 vUv;\\n            varying vec2 vPosition;\\n            varying mat3 vT;\\n            varying vec2 vQuadCenter;\\n            varying vec2 vFragCoord;\\n\\n            void main () {\\n\\n                const float FilterInvSquare = 2.0;\\n                const float near_n = 0.2;\\n                const float T = 1.0;\\n\\n                vec2 xy = vQuadCenter;\\n                vec3 Tu = vT[0];\\n                vec3 Tv = vT[1];\\n                vec3 Tw = vT[2];\\n                vec3 k = vFragCoord.x * Tw - Tu;\\n                vec3 l = vFragCoord.y * Tw - Tv;\\n                vec3 p = cross(k, l);\\n                if (p.z == 0.0) discard;\\n                vec2 s = vec2(p.x / p.z, p.y / p.z);\\n                float rho3d = (s.x * s.x + s.y * s.y); \\n                vec2 d = vec2(xy.x - vFragCoord.x, xy.y - vFragCoord.y);\\n                float rho2d = FilterInvSquare * (d.x * d.x + d.y * d.y); \\n\\n                // compute intersection and depth\\n                float rho = min(rho3d, rho2d);\\n                float depth = (rho3d <= rho2d) ? (s.x * Tw.x + s.y * Tw.y) + Tw.z : Tw.z; \\n                if (depth < near_n) discard;\\n                //  vec4 nor_o = collected_normal_opacity[j];\\n                //  float normal[3] = {nor_o.x, nor_o.y, nor_o.z};\\n                float opa = vColor.a;\\n\\n                float power = -0.5f * rho;\\n                if (power > 0.0f) discard;\\n\\n                // Eq. (2) from 3D Gaussian splatting paper.\\n                // Obtain alpha by multiplying with Gaussian opacity\\n                // and its exponential falloff from mean.\\n                // Avoid numerical instabilities (see paper appendix). \\n                float alpha = min(0.99f, opa * exp(power));\\n                if (alpha < 1.0f / 255.0f) discard;\\n                float test_T = T * (1.0 - alpha);\\n                if (test_T < 0.0001)discard;\\n\\n                float w = alpha * T;\\n                gl_FragColor = vec4(vColor.rgb, w);\\n            }\\n        \";\n\t}\n}, Uf = class {\n\tstatic build(e) {\n\t\tlet t = new pi();\n\t\tt.setIndex([\n\t\t\t0,\n\t\t\t1,\n\t\t\t2,\n\t\t\t0,\n\t\t\t2,\n\t\t\t3\n\t\t]);\n\t\tlet n = new Qr(/* @__PURE__ */ new Float32Array(12), 3);\n\t\tt.setAttribute(\"position\", n), n.setXYZ(0, -1, -1, 0), n.setXYZ(1, -1, 1, 0), n.setXYZ(2, 1, 1, 0), n.setXYZ(3, 1, -1, 0), n.needsUpdate = !0;\n\t\tlet r = new za().copy(t), i = new Bi(new Uint32Array(e), 1, !1);\n\t\treturn i.setUsage(Ct), r.setAttribute(\"splatIndex\", i), r.instanceCount = 0, r;\n\t}\n}, Wf = class extends ir {\n\tconstructor(e, t = new K(), n = new ln(), r = new K(1, 1, 1), i = 1, a = 1, o = !0) {\n\t\tsuper(), this.splatBuffer = e, this.position.copy(t), this.quaternion.copy(n), this.scale.copy(r), this.transform = new J(), this.minimumAlpha = i, this.opacity = a, this.visible = o;\n\t}\n\tcopyTransformData(e) {\n\t\tthis.position.copy(e.position), this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.transform.copy(e.transform);\n\t}\n\tupdateTransform(e) {\n\t\te ? (this.matrixWorldAutoUpdate && this.updateWorldMatrix(!0, !1), this.transform.copy(this.matrixWorld)) : (this.matrixAutoUpdate && this.updateMatrix(), this.transform.copy(this.matrix));\n\t}\n}, Gf = class e {\n\tstatic idGen = 0;\n\tconstructor(t, n, r, i) {\n\t\tthis.min = new K().copy(t), this.max = new K().copy(n), this.boundingBox = new kr(this.min, this.max), this.center = new K().copy(this.max).sub(this.min).multiplyScalar(.5).add(this.min), this.depth = r, this.children = [], this.data = null, this.id = i || e.idGen++;\n\t}\n}, Kf = class e {\n\tconstructor(e, t) {\n\t\tthis.maxDepth = e, this.maxCentersPerNode = t, this.sceneDimensions = new K(), this.sceneMin = new K(), this.sceneMax = new K(), this.rootNode = null, this.nodesWithIndexes = [], this.splatMesh = null;\n\t}\n\tstatic convertWorkerSubTreeNode(t) {\n\t\tlet n = new Gf(new K().fromArray(t.min), new K().fromArray(t.max), t.depth, t.id);\n\t\tif (t.data.indexes) {\n\t\t\tn.data = { indexes: [] };\n\t\t\tfor (let e of t.data.indexes) n.data.indexes.push(e);\n\t\t}\n\t\tif (t.children) for (let r of t.children) n.children.push(e.convertWorkerSubTreeNode(r));\n\t\treturn n;\n\t}\n\tstatic convertWorkerSubTree(t, n) {\n\t\tlet r = new e(t.maxDepth, t.maxCentersPerNode);\n\t\tr.sceneMin = new K().fromArray(t.sceneMin), r.sceneMax = new K().fromArray(t.sceneMax), r.splatMesh = n, r.rootNode = e.convertWorkerSubTreeNode(t.rootNode);\n\t\tlet i = (e, t) => {\n\t\t\te.children.length === 0 && t(e);\n\t\t\tfor (let n of e.children) i(n, t);\n\t\t};\n\t\treturn r.nodesWithIndexes = [], i(r.rootNode, (e) => {\n\t\t\te.data && e.data.indexes && e.data.indexes.length > 0 && r.nodesWithIndexes.push(e);\n\t\t}), r;\n\t}\n};\nfunction qf(e) {\n\tlet t = 0;\n\tclass n {\n\t\tconstructor(e, t) {\n\t\t\tthis.min = [\n\t\t\t\te[0],\n\t\t\t\te[1],\n\t\t\t\te[2]\n\t\t\t], this.max = [\n\t\t\t\tt[0],\n\t\t\t\tt[1],\n\t\t\t\tt[2]\n\t\t\t];\n\t\t}\n\t\tcontainsPoint(e) {\n\t\t\treturn e[0] >= this.min[0] && e[0] <= this.max[0] && e[1] >= this.min[1] && e[1] <= this.max[1] && e[2] >= this.min[2] && e[2] <= this.max[2];\n\t\t}\n\t}\n\tclass r {\n\t\tconstructor(e, t) {\n\t\t\tthis.maxDepth = e, this.maxCentersPerNode = t, this.sceneDimensions = [], this.sceneMin = [], this.sceneMax = [], this.rootNode = null, this.addedIndexes = {}, this.nodesWithIndexes = [], this.splatMesh = null, this.disposed = !1;\n\t\t}\n\t}\n\tclass i {\n\t\tconstructor(e, n, r, i) {\n\t\t\tthis.min = [\n\t\t\t\te[0],\n\t\t\t\te[1],\n\t\t\t\te[2]\n\t\t\t], this.max = [\n\t\t\t\tn[0],\n\t\t\t\tn[1],\n\t\t\t\tn[2]\n\t\t\t], this.center = [\n\t\t\t\t(n[0] - e[0]) * .5 + e[0],\n\t\t\t\t(n[1] - e[1]) * .5 + e[1],\n\t\t\t\t(n[2] - e[2]) * .5 + e[2]\n\t\t\t], this.depth = r, this.children = [], this.data = null, this.id = i || t++;\n\t\t}\n\t}\n\tprocessSplatTreeNode = function(e, t, r, a) {\n\t\tlet o = t.data.indexes.length;\n\t\tif (o < e.maxCentersPerNode || t.depth > e.maxDepth) {\n\t\t\tlet n = [];\n\t\t\tfor (let r = 0; r < t.data.indexes.length; r++) e.addedIndexes[t.data.indexes[r]] || (n.push(t.data.indexes[r]), e.addedIndexes[t.data.indexes[r]] = !0);\n\t\t\tt.data.indexes = n, t.data.indexes.sort((e, t) => e > t ? 1 : -1), e.nodesWithIndexes.push(t);\n\t\t\treturn;\n\t\t}\n\t\tlet s = [\n\t\t\tt.max[0] - t.min[0],\n\t\t\tt.max[1] - t.min[1],\n\t\t\tt.max[2] - t.min[2]\n\t\t], c = [\n\t\t\ts[0] * .5,\n\t\t\ts[1] * .5,\n\t\t\ts[2] * .5\n\t\t], l = [\n\t\t\tt.min[0] + c[0],\n\t\t\tt.min[1] + c[1],\n\t\t\tt.min[2] + c[2]\n\t\t], u = [\n\t\t\tnew n([\n\t\t\t\tl[0] - c[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2] - c[2]\n\t\t\t], [\n\t\t\t\tl[0],\n\t\t\t\tl[1] + c[1],\n\t\t\t\tl[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2] - c[2]\n\t\t\t], [\n\t\t\t\tl[0] + c[0],\n\t\t\t\tl[1] + c[1],\n\t\t\t\tl[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2]\n\t\t\t], [\n\t\t\t\tl[0] + c[0],\n\t\t\t\tl[1] + c[1],\n\t\t\t\tl[2] + c[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0] - c[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2]\n\t\t\t], [\n\t\t\t\tl[0],\n\t\t\t\tl[1] + c[1],\n\t\t\t\tl[2] + c[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0] - c[0],\n\t\t\t\tl[1] - c[1],\n\t\t\t\tl[2] - c[2]\n\t\t\t], [\n\t\t\t\tl[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0],\n\t\t\t\tl[1] - c[1],\n\t\t\t\tl[2] - c[2]\n\t\t\t], [\n\t\t\t\tl[0] + c[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0],\n\t\t\t\tl[1] - c[1],\n\t\t\t\tl[2]\n\t\t\t], [\n\t\t\t\tl[0] + c[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2] + c[2]\n\t\t\t]),\n\t\t\tnew n([\n\t\t\t\tl[0] - c[0],\n\t\t\t\tl[1] - c[1],\n\t\t\t\tl[2]\n\t\t\t], [\n\t\t\t\tl[0],\n\t\t\t\tl[1],\n\t\t\t\tl[2] + c[2]\n\t\t\t])\n\t\t], d = [], f = [];\n\t\tfor (let e = 0; e < u.length; e++) d[e] = 0, f[e] = [];\n\t\tlet p = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t];\n\t\tfor (let e = 0; e < o; e++) {\n\t\t\tlet n = t.data.indexes[e], i = r[n];\n\t\t\tp[0] = a[i], p[1] = a[i + 1], p[2] = a[i + 2];\n\t\t\tfor (let e = 0; e < u.length; e++) u[e].containsPoint(p) && (d[e]++, f[e].push(n));\n\t\t}\n\t\tfor (let e = 0; e < u.length; e++) {\n\t\t\tlet n = new i(u[e].min, u[e].max, t.depth + 1);\n\t\t\tn.data = { indexes: f[e] }, t.children.push(n);\n\t\t}\n\t\tt.data = {};\n\t\tfor (let n of t.children) processSplatTreeNode(e, n, r, a);\n\t};\n\tlet a = (e, t, n) => {\n\t\tlet a = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t], o = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t], s = [], c = Math.floor(e.length / 4);\n\t\tfor (let t = 0; t < c; t++) {\n\t\t\tlet n = t * 4, r = e[n], i = e[n + 1], c = e[n + 2], l = Math.round(e[n + 3]);\n\t\t\t(t === 0 || r < a[0]) && (a[0] = r), (t === 0 || r > o[0]) && (o[0] = r), (t === 0 || i < a[1]) && (a[1] = i), (t === 0 || i > o[1]) && (o[1] = i), (t === 0 || c < a[2]) && (a[2] = c), (t === 0 || c > o[2]) && (o[2] = c), s.push(l);\n\t\t}\n\t\tlet l = new r(t, n);\n\t\treturn l.sceneMin = a, l.sceneMax = o, l.rootNode = new i(l.sceneMin, l.sceneMax, 0), l.rootNode.data = { indexes: s }, l;\n\t};\n\tfunction o(t, n, r) {\n\t\tlet i = [];\n\t\tfor (let e of t) {\n\t\t\tlet t = Math.floor(e.length / 4);\n\t\t\tfor (let n = 0; n < t; n++) {\n\t\t\t\tlet t = n * 4, r = Math.round(e[t + 3]);\n\t\t\t\ti[r] = t;\n\t\t\t}\n\t\t}\n\t\tlet o = [];\n\t\tfor (let e of t) {\n\t\t\tlet t = a(e, n, r);\n\t\t\to.push(t), processSplatTreeNode(t, t.rootNode, i, e);\n\t\t}\n\t\te.postMessage({ subTrees: o });\n\t}\n\te.onmessage = (e) => {\n\t\te.data.process && o(e.data.process.centers, e.data.process.maxDepth, e.data.process.maxCentersPerNode);\n\t};\n}\nfunction Jf(e, t, n, r, i) {\n\te.postMessage({ process: {\n\t\tcenters: t,\n\t\tmaxDepth: r,\n\t\tmaxCentersPerNode: i\n\t} }, n);\n}\nfunction Yf() {\n\treturn new Worker(URL.createObjectURL(new Blob([\n\t\t\"(\",\n\t\tqf.toString(),\n\t\t\")(self)\"\n\t], { type: \"application/javascript\" })));\n}\nvar Xf = class {\n\tconstructor(e, t) {\n\t\tthis.maxDepth = e, this.maxCentersPerNode = t, this.subTrees = [], this.splatMesh = null;\n\t}\n\tdispose() {\n\t\tthis.diposeSplatTreeWorker(), this.disposed = !0;\n\t}\n\tdiposeSplatTreeWorker() {\n\t\tthis.splatTreeWorker && this.splatTreeWorker.terminate(), this.splatTreeWorker = null;\n\t}\n\tprocessSplatMesh = function(e, t = () => !0, n, r) {\n\t\tthis.splatTreeWorker ||= Yf(), this.splatMesh = e, this.subTrees = [];\n\t\tlet i = new K(), a = (n, r) => {\n\t\t\tlet a = new Float32Array(r * 4), o = 0;\n\t\t\tfor (let s = 0; s < r; s++) {\n\t\t\t\tlet r = s + n;\n\t\t\t\tif (t(r)) {\n\t\t\t\t\te.getSplatCenter(r, i);\n\t\t\t\t\tlet t = o * 4;\n\t\t\t\t\ta[t] = i.x, a[t + 1] = i.y, a[t + 2] = i.z, a[t + 3] = r, o++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a;\n\t\t};\n\t\treturn new Promise((t) => {\n\t\t\tlet i = () => this.disposed ? (this.diposeSplatTreeWorker(), t(), !0) : !1;\n\t\t\tn && n(!1), eu(() => {\n\t\t\t\tif (i()) return;\n\t\t\t\tlet o = [];\n\t\t\t\tif (e.dynamicMode) {\n\t\t\t\t\tlet t = 0;\n\t\t\t\t\tfor (let n = 0; n < e.scenes.length; n++) {\n\t\t\t\t\t\tlet r = e.getScene(n).splatBuffer.getSplatCount(), i = a(t, r);\n\t\t\t\t\t\to.push(i), t += r;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet t = a(0, e.getSplatCount());\n\t\t\t\t\to.push(t);\n\t\t\t\t}\n\t\t\t\tthis.splatTreeWorker.onmessage = (n) => {\n\t\t\t\t\ti() || n.data.subTrees && (r && r(!1), eu(() => {\n\t\t\t\t\t\tif (!i()) {\n\t\t\t\t\t\t\tfor (let t of n.data.subTrees) {\n\t\t\t\t\t\t\t\tlet n = Kf.convertWorkerSubTree(t, e);\n\t\t\t\t\t\t\t\tthis.subTrees.push(n);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.diposeSplatTreeWorker(), r && r(!0), eu(() => {\n\t\t\t\t\t\t\t\tt();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}, eu(() => {\n\t\t\t\t\tif (i()) return;\n\t\t\t\t\tn && n(!0);\n\t\t\t\t\tlet e = o.map((e) => e.buffer);\n\t\t\t\t\tJf(this.splatTreeWorker, o, e, this.maxDepth, this.maxCentersPerNode);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n\tcountLeaves() {\n\t\tlet e = 0;\n\t\treturn this.visitLeaves(() => {\n\t\t\te++;\n\t\t}), e;\n\t}\n\tvisitLeaves(e) {\n\t\tlet t = (e, n) => {\n\t\t\te.children.length === 0 && n(e);\n\t\t\tfor (let r of e.children) t(r, n);\n\t\t};\n\t\tfor (let n of this.subTrees) t(n.rootNode, e);\n\t}\n};\nfunction Zf(e) {\n\tlet t = {};\n\tfunction n(n) {\n\t\tif (t[n] !== void 0) return t[n];\n\t\tlet r;\n\t\tswitch (n) {\n\t\t\tcase \"WEBGL_depth_texture\":\n\t\t\t\tr = e.getExtension(\"WEBGL_depth_texture\") || e.getExtension(\"MOZ_WEBGL_depth_texture\") || e.getExtension(\"WEBKIT_WEBGL_depth_texture\");\n\t\t\t\tbreak;\n\t\t\tcase \"EXT_texture_filter_anisotropic\":\n\t\t\t\tr = e.getExtension(\"EXT_texture_filter_anisotropic\") || e.getExtension(\"MOZ_EXT_texture_filter_anisotropic\") || e.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\");\n\t\t\t\tbreak;\n\t\t\tcase \"WEBGL_compressed_texture_s3tc\":\n\t\t\t\tr = e.getExtension(\"WEBGL_compressed_texture_s3tc\") || e.getExtension(\"MOZ_WEBGL_compressed_texture_s3tc\") || e.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\");\n\t\t\t\tbreak;\n\t\t\tcase \"WEBGL_compressed_texture_pvrtc\":\n\t\t\t\tr = e.getExtension(\"WEBGL_compressed_texture_pvrtc\") || e.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\");\n\t\t\t\tbreak;\n\t\t\tdefault: r = e.getExtension(n);\n\t\t}\n\t\treturn t[n] = r, r;\n\t}\n\treturn {\n\t\thas: function(e) {\n\t\t\treturn n(e) !== null;\n\t\t},\n\t\tinit: function(e) {\n\t\t\te.isWebGL2 ? (n(\"EXT_color_buffer_float\"), n(\"WEBGL_clip_cull_distance\")) : (n(\"WEBGL_depth_texture\"), n(\"OES_texture_float\"), n(\"OES_texture_half_float\"), n(\"OES_texture_half_float_linear\"), n(\"OES_standard_derivatives\"), n(\"OES_element_index_uint\"), n(\"OES_vertex_array_object\"), n(\"ANGLE_instanced_arrays\")), n(\"OES_texture_float_linear\"), n(\"EXT_color_buffer_half_float\"), n(\"WEBGL_multisampled_render_to_texture\");\n\t\t},\n\t\tget: function(e) {\n\t\t\tlet t = n(e);\n\t\t\treturn t === null && console.warn(\"THREE.WebGLRenderer: \" + e + \" extension not supported.\"), t;\n\t\t}\n\t};\n}\nfunction Qf(e, t, n) {\n\tlet r;\n\tfunction i() {\n\t\tif (r !== void 0) return r;\n\t\tif (t.has(\"EXT_texture_filter_anisotropic\") === !0) {\n\t\t\tlet n = t.get(\"EXT_texture_filter_anisotropic\");\n\t\t\tr = e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n\t\t} else r = 0;\n\t\treturn r;\n\t}\n\tfunction a(t) {\n\t\tif (t === \"highp\") {\n\t\t\tif (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0) return \"highp\";\n\t\t\tt = \"mediump\";\n\t\t}\n\t\treturn t === \"mediump\" && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? \"mediump\" : \"lowp\";\n\t}\n\tlet o = typeof WebGL2RenderingContext < \"u\" && e.constructor.name === \"WebGL2RenderingContext\", s = n.precision === void 0 ? \"highp\" : n.precision, c = a(s);\n\tc !== s && (console.warn(\"THREE.WebGLRenderer:\", s, \"not supported, using\", c, \"instead.\"), s = c);\n\tlet l = o || t.has(\"WEBGL_draw_buffers\"), u = n.logarithmicDepthBuffer === !0, d = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), f = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS), p = e.getParameter(e.MAX_TEXTURE_SIZE), m = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), h = e.getParameter(e.MAX_VERTEX_ATTRIBS), g = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), _ = e.getParameter(e.MAX_VARYING_VECTORS), v = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), y = f > 0, b = o || t.has(\"OES_texture_float\"), x = y && b, S = o ? e.getParameter(e.MAX_SAMPLES) : 0;\n\treturn {\n\t\tisWebGL2: o,\n\t\tdrawBuffers: l,\n\t\tgetMaxAnisotropy: i,\n\t\tgetMaxPrecision: a,\n\t\tprecision: s,\n\t\tlogarithmicDepthBuffer: u,\n\t\tmaxTextures: d,\n\t\tmaxVertexTextures: f,\n\t\tmaxTextureSize: p,\n\t\tmaxCubemapSize: m,\n\t\tmaxAttributes: h,\n\t\tmaxVertexUniforms: g,\n\t\tmaxVaryings: _,\n\t\tmaxFragmentUniforms: v,\n\t\tvertexTextures: y,\n\t\tfloatFragmentTextures: b,\n\t\tfloatVertexTextures: x,\n\t\tmaxSamples: S\n\t};\n}\nvar $f = {\n\tDefault: 0,\n\tGradual: 1,\n\tInstant: 2\n}, ep = {\n\tNone: 0,\n\tError: 1,\n\tWarning: 2,\n\tInfo: 3,\n\tDebug: 4\n}, tp = new pi(), np = new wi(), rp = 6, ip = 4, ap = 4, op = 4, sp = 6, cp = 8, lp = 4, up = 4, dp = 1, fp = .012, pp = .003, mp = 1, hp = 16777216, gp = class e extends Ii {\n\tconstructor(e = Rf.ThreeD, t = !1, n = !1, r = !1, i = 1, a = !0, o = !1, s = !1, c = 1024, l = ep.None, u = 0, d = 1, f = .3) {\n\t\tsuper(tp, np), this.renderer = void 0, this.splatRenderMode = e, this.dynamicMode = t, this.enableOptionalEffects = n, this.halfPrecisionCovariancesOnGPU = r, this.devicePixelRatio = i, this.enableDistancesComputationOnGPU = a, this.integerBasedDistancesComputation = o, this.antialiased = s, this.kernel2DSize = f, this.maxScreenSpaceSplatSize = c, this.logLevel = l, this.sphericalHarmonicsDegree = u, this.minSphericalHarmonicsDegree = 0, this.sceneFadeInRateMultiplier = d, this.scenes = [], this.splatTree = null, this.baseSplatTree = null, this.splatDataTextures = {}, this.distancesTransformFeedback = {\n\t\t\tid: null,\n\t\t\tvertexShader: null,\n\t\t\tfragmentShader: null,\n\t\t\tprogram: null,\n\t\t\tcentersBuffer: null,\n\t\t\tsceneIndexesBuffer: null,\n\t\t\toutDistancesBuffer: null,\n\t\t\tcentersLoc: -1,\n\t\t\tmodelViewProjLoc: -1,\n\t\t\tsceneIndexesLoc: -1,\n\t\t\ttransformsLocs: []\n\t\t}, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSceneIndexMap = [], this.lastBuildSplatCount = 0, this.lastBuildScenes = [], this.lastBuildMaxSplatCount = 0, this.lastBuildSceneCount = 0, this.firstRenderTime = -1, this.finalBuild = !1, this.webGLUtils = null, this.boundingBox = new kr(), this.calculatedSceneCenter = new K(), this.maxSplatDistanceFromSceneCenter = 0, this.visibleRegionBufferRadius = 0, this.visibleRegionRadius = 0, this.visibleRegionFadeStartRadius = 0, this.visibleRegionChanging = !1, this.splatScale = 1, this.pointCloudModeEnabled = !1, this.disposed = !1, this.lastRenderer = null, this.visible = !1;\n\t}\n\tstatic buildScenes(t, n, r) {\n\t\tlet i = [];\n\t\ti.length = n.length;\n\t\tfor (let a = 0; a < n.length; a++) {\n\t\t\tlet o = n[a], s = r[a] || {}, c = s.position || [\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0\n\t\t\t], l = s.rotation || [\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t1\n\t\t\t], u = s.scale || [\n\t\t\t\t1,\n\t\t\t\t1,\n\t\t\t\t1\n\t\t\t], d = new K().fromArray(c), f = new ln().fromArray(l), p = new K().fromArray(u), m = e.createScene(o, d, f, p, s.splatAlphaRemovalThreshold || 1, s.opacity, s.visible);\n\t\t\tt.add(m), i[a] = m;\n\t\t}\n\t\treturn i;\n\t}\n\tstatic createScene(e, t, n, r, i, a = 1, o = !0) {\n\t\treturn new Wf(e, t, n, r, i, a, o);\n\t}\n\tstatic buildSplatIndexMaps(e) {\n\t\tlet t = [], n = [], r = 0;\n\t\tfor (let i = 0; i < e.length; i++) {\n\t\t\tlet a = e[i].getMaxSplatCount();\n\t\t\tfor (let e = 0; e < a; e++) t[r] = e, n[r] = i, r++;\n\t\t}\n\t\treturn {\n\t\t\tlocalSplatIndexMap: t,\n\t\t\tsceneIndexMap: n\n\t\t};\n\t}\n\tbuildSplatTree = function(e = [], t, n) {\n\t\treturn new Promise((r) => {\n\t\t\tthis.disposeSplatTree(), this.baseSplatTree = new Xf(8, 1e3);\n\t\t\tlet i = performance.now(), a = new Dn();\n\t\t\tthis.baseSplatTree.processSplatMesh(this, (t) => {\n\t\t\t\tthis.getSplatColor(t, a);\n\t\t\t\tlet n = e[this.getSceneIndexForSplat(t)] || 1;\n\t\t\t\treturn a.w >= n;\n\t\t\t}, t, n).then(() => {\n\t\t\t\tlet e = performance.now() - i;\n\t\t\t\tif (this.logLevel >= ep.Info && console.log(\"SplatTree build: \" + e + \" ms\"), this.disposed) r();\n\t\t\t\telse {\n\t\t\t\t\tthis.splatTree = this.baseSplatTree, this.baseSplatTree = null;\n\t\t\t\t\tlet e = 0, t = 0, n = 0, i = 0;\n\t\t\t\t\tthis.splatTree.visitLeaves((r) => {\n\t\t\t\t\t\tlet a = r.data.indexes.length;\n\t\t\t\t\t\ta > 0 && (t += a, n = Math.max(n, a), i++, e++);\n\t\t\t\t\t}), this.logLevel >= ep.Info && (console.log(`SplatTree leaves: ${this.splatTree.countLeaves()}`), console.log(`SplatTree leaves with splats:${e}`), t /= i, console.log(`Avg splat count per node: ${t}`), console.log(`Total splat count: ${this.getSplatCount()}`)), r();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n\tbuild(t, n, r = !0, i = !1, a, o, s = !0) {\n\t\tthis.sceneOptions = n, this.finalBuild = i;\n\t\tlet c = e.getTotalMaxSplatCountForSplatBuffers(t), l = e.buildScenes(this, t, n);\n\t\tif (r) for (let e = 0; e < this.scenes.length && e < l.length; e++) {\n\t\t\tlet t = l[e], n = this.getScene(e);\n\t\t\tt.copyTransformData(n);\n\t\t}\n\t\tthis.scenes = l;\n\t\tlet u = 3;\n\t\tfor (let e of t) {\n\t\t\tlet t = e.getMinSphericalHarmonicsDegree();\n\t\t\tt < u && (u = t);\n\t\t}\n\t\tthis.minSphericalHarmonicsDegree = Math.min(u, this.sphericalHarmonicsDegree);\n\t\tlet d = !1;\n\t\tif (t.length !== this.lastBuildScenes.length) d = !0;\n\t\telse for (let e = 0; e < t.length; e++) if (t[e] !== this.lastBuildScenes[e].splatBuffer) {\n\t\t\td = !0;\n\t\t\tbreak;\n\t\t}\n\t\tlet f = !0;\n\t\tif ((this.scenes.length !== 1 || this.lastBuildSceneCount !== this.scenes.length || this.lastBuildMaxSplatCount !== c || d) && (f = !1), !f) {\n\t\t\tthis.boundingBox = new kr(), s || (this.maxSplatDistanceFromSceneCenter = 0, this.visibleRegionBufferRadius = 0, this.visibleRegionRadius = 0, this.visibleRegionFadeStartRadius = 0, this.firstRenderTime = -1), this.lastBuildScenes = [], this.lastBuildSplatCount = 0, this.lastBuildMaxSplatCount = 0, this.disposeMeshData(), this.geometry = Uf.build(c), this.material = this.splatRenderMode === Rf.ThreeD ? Vf.build(this.dynamicMode, this.enableOptionalEffects, this.antialiased, this.maxScreenSpaceSplatSize, this.splatScale, this.pointCloudModeEnabled, this.minSphericalHarmonicsDegree, this.kernel2DSize) : Hf.build(this.dynamicMode, this.enableOptionalEffects, this.splatScale, this.pointCloudModeEnabled, this.minSphericalHarmonicsDegree);\n\t\t\tlet n = e.buildSplatIndexMaps(t);\n\t\t\tthis.globalSplatIndexToLocalSplatIndexMap = n.localSplatIndexMap, this.globalSplatIndexToSceneIndexMap = n.sceneIndexMap;\n\t\t}\n\t\tlet p = this.getSplatCount(!0);\n\t\tthis.enableDistancesComputationOnGPU && this.setupDistancesComputationTransformFeedback();\n\t\tlet m = this.refreshGPUDataFromSplatBuffers(f);\n\t\tfor (let e = 0; e < this.scenes.length; e++) this.lastBuildScenes[e] = this.scenes[e];\n\t\treturn this.lastBuildSplatCount = p, this.lastBuildMaxSplatCount = this.getMaxSplatCount(), this.lastBuildSceneCount = this.scenes.length, i && this.scenes.length > 0 && this.buildSplatTree(n.map((e) => e.splatAlphaRemovalThreshold || 1), a, o).then(() => {\n\t\t\tthis.onSplatTreeReadyCallback && this.onSplatTreeReadyCallback(this.splatTree), this.onSplatTreeReadyCallback = null;\n\t\t}), this.visible = this.scenes.length > 0, m;\n\t}\n\tfreeIntermediateSplatData() {\n\t\tlet e = (e) => {\n\t\t\tdelete e.source.data, delete e.image, e.onUpdate = null;\n\t\t};\n\t\tdelete this.splatDataTextures.baseData.covariances, delete this.splatDataTextures.baseData.centers, delete this.splatDataTextures.baseData.colors, delete this.splatDataTextures.baseData.sphericalHarmonics, delete this.splatDataTextures.centerColors.data, delete this.splatDataTextures.covariances.data, this.splatDataTextures.sphericalHarmonics && delete this.splatDataTextures.sphericalHarmonics.data, this.splatDataTextures.sceneIndexes && delete this.splatDataTextures.sceneIndexes.data, this.splatDataTextures.centerColors.texture.needsUpdate = !0, this.splatDataTextures.centerColors.texture.onUpdate = () => {\n\t\t\te(this.splatDataTextures.centerColors.texture);\n\t\t}, this.splatDataTextures.covariances.texture.needsUpdate = !0, this.splatDataTextures.covariances.texture.onUpdate = () => {\n\t\t\te(this.splatDataTextures.covariances.texture);\n\t\t}, this.splatDataTextures.sphericalHarmonics && (this.splatDataTextures.sphericalHarmonics.texture ? (this.splatDataTextures.sphericalHarmonics.texture.needsUpdate = !0, this.splatDataTextures.sphericalHarmonics.texture.onUpdate = () => {\n\t\t\te(this.splatDataTextures.sphericalHarmonics.texture);\n\t\t}) : this.splatDataTextures.sphericalHarmonics.textures.forEach((t) => {\n\t\t\tt.needsUpdate = !0, t.onUpdate = () => {\n\t\t\t\te(t);\n\t\t\t};\n\t\t})), this.splatDataTextures.sceneIndexes && (this.splatDataTextures.sceneIndexes.texture.needsUpdate = !0, this.splatDataTextures.sceneIndexes.texture.onUpdate = () => {\n\t\t\te(this.splatDataTextures.sceneIndexes.texture);\n\t\t});\n\t}\n\tdispose() {\n\t\tthis.disposeMeshData(), this.disposeTextures(), this.disposeSplatTree(), this.enableDistancesComputationOnGPU && (this.computeDistancesOnGPUSyncTimeout &&= (clearTimeout(this.computeDistancesOnGPUSyncTimeout), null), this.disposeDistancesComputationGPUResources()), this.scenes = [], this.distancesTransformFeedback = {\n\t\t\tid: null,\n\t\t\tvertexShader: null,\n\t\t\tfragmentShader: null,\n\t\t\tprogram: null,\n\t\t\tcentersBuffer: null,\n\t\t\tsceneIndexesBuffer: null,\n\t\t\toutDistancesBuffer: null,\n\t\t\tcentersLoc: -1,\n\t\t\tmodelViewProjLoc: -1,\n\t\t\tsceneIndexesLoc: -1,\n\t\t\ttransformsLocs: []\n\t\t}, this.renderer = null, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSceneIndexMap = [], this.lastBuildSplatCount = 0, this.lastBuildScenes = [], this.lastBuildMaxSplatCount = 0, this.lastBuildSceneCount = 0, this.firstRenderTime = -1, this.finalBuild = !1, this.webGLUtils = null, this.boundingBox = new kr(), this.calculatedSceneCenter = new K(), this.maxSplatDistanceFromSceneCenter = 0, this.visibleRegionBufferRadius = 0, this.visibleRegionRadius = 0, this.visibleRegionFadeStartRadius = 0, this.visibleRegionChanging = !1, this.splatScale = 1, this.pointCloudModeEnabled = !1, this.disposed = !0, this.lastRenderer = null, this.visible = !1;\n\t}\n\tdisposeMeshData() {\n\t\tthis.geometry && this.geometry !== tp && (this.geometry.dispose(), this.geometry = null), this.material &&= (this.material.dispose(), null);\n\t}\n\tdisposeTextures() {\n\t\tfor (let e in this.splatDataTextures) if (this.splatDataTextures.hasOwnProperty(e)) {\n\t\t\tlet t = this.splatDataTextures[e];\n\t\t\tt.texture &&= (t.texture.dispose(), null);\n\t\t}\n\t\tthis.splatDataTextures = null;\n\t}\n\tdisposeSplatTree() {\n\t\tthis.splatTree &&= (this.splatTree.dispose(), null), this.baseSplatTree &&= (this.baseSplatTree.dispose(), null);\n\t}\n\tgetSplatTree() {\n\t\treturn this.splatTree;\n\t}\n\tonSplatTreeReady(e) {\n\t\tthis.onSplatTreeReadyCallback = e;\n\t}\n\tgetDataForDistancesComputation(e, t) {\n\t\treturn {\n\t\t\tcenters: this.integerBasedDistancesComputation ? this.getIntegerCenters(e, t, !0) : this.getFloatCenters(e, t, !0),\n\t\t\tsceneIndexes: this.getSceneIndexes(e, t)\n\t\t};\n\t}\n\trefreshGPUDataFromSplatBuffers(e) {\n\t\tlet t = this.getSplatCount(!0);\n\t\tthis.refreshDataTexturesFromSplatBuffers(e);\n\t\tlet n = e ? this.lastBuildSplatCount : 0, { centers: r, sceneIndexes: i } = this.getDataForDistancesComputation(n, t - 1);\n\t\treturn this.enableDistancesComputationOnGPU && this.refreshGPUBuffersForDistancesComputation(r, i, e), {\n\t\t\tfrom: n,\n\t\t\tto: t - 1,\n\t\t\tcount: t - n,\n\t\t\tcenters: r,\n\t\t\tsceneIndexes: i\n\t\t};\n\t}\n\trefreshGPUBuffersForDistancesComputation(e, t, n = !1) {\n\t\tlet r = n ? this.lastBuildSplatCount : 0;\n\t\tthis.updateGPUCentersBufferForDistancesComputation(n, e, r), this.updateGPUTransformIndexesBufferForDistancesComputation(n, t, r);\n\t}\n\trefreshDataTexturesFromSplatBuffers(e) {\n\t\tlet t = this.getSplatCount(!0), n = this.lastBuildSplatCount, r = t - 1;\n\t\te ? this.updateBaseDataFromSplatBuffers(n, r) : (this.setupDataTextures(), this.updateBaseDataFromSplatBuffers()), this.updateDataTexturesFromBaseData(n, r), this.updateVisibleRegion(e);\n\t}\n\tsetupDataTextures() {\n\t\tlet t = this.getMaxSplatCount(), n = this.getSplatCount(!0);\n\t\tthis.disposeTextures();\n\t\tlet r = (e, n) => {\n\t\t\tlet r = new G(4096, 1024);\n\t\t\tfor (; r.x * r.y * e < t * n;) r.y *= 2;\n\t\t\treturn r;\n\t\t}, i = (e) => e >= 1 ? sp : ap, a = (e) => {\n\t\t\tlet t = i(e);\n\t\t\treturn {\n\t\t\t\telementsPerTexelStored: t,\n\t\t\t\ttexSize: r(t, 6)\n\t\t\t};\n\t\t}, o = this.getTargetCovarianceCompressionLevel(), s = this.getTargetSphericalHarmonicsCompressionLevel(), c, l, u;\n\t\tif (this.splatRenderMode === Rf.ThreeD) {\n\t\t\tlet e = a(o);\n\t\t\te.texSize.x * e.texSize.y > hp && o === 0 && (o = 1), c = new Float32Array(t * rp);\n\t\t} else l = new Float32Array(t * 3), u = new Float32Array(t * 4);\n\t\tlet d = new Float32Array(t * 3), f = new Uint8Array(t * 4), p = Float32Array;\n\t\ts === 1 ? p = Uint16Array : s === 2 && (p = Uint8Array);\n\t\tlet m = tu(this.minSphericalHarmonicsDegree), h = this.minSphericalHarmonicsDegree ? new p(t * m) : void 0, g = r(up, 4), _ = new Uint32Array(g.x * g.y * up);\n\t\te.updateCenterColorsPaddedData(0, n - 1, d, f, _);\n\t\tlet v = new zi(_, g.x, g.y, Oe, fe);\n\t\tif (v.internalFormat = \"RGBA32UI\", v.needsUpdate = !0, this.material.uniforms.centersColorsTexture.value = v, this.material.uniforms.centersColorsTextureSize.value.copy(g), this.material.uniformsNeedUpdate = !0, this.splatDataTextures = {\n\t\t\tbaseData: {\n\t\t\t\tcovariances: c,\n\t\t\t\tscales: l,\n\t\t\t\trotations: u,\n\t\t\t\tcenters: d,\n\t\t\t\tcolors: f,\n\t\t\t\tsphericalHarmonics: h\n\t\t\t},\n\t\t\tcenterColors: {\n\t\t\t\tdata: _,\n\t\t\t\ttexture: v,\n\t\t\t\tsize: g\n\t\t\t}\n\t\t}, this.splatRenderMode === Rf.ThreeD) {\n\t\t\tlet t = a(o), n = t.elementsPerTexelStored, r = t.texSize, i = o >= 1 ? Uint32Array : Float32Array, s = o >= 1 ? cp : op, l = new i(r.x * r.y * s);\n\t\t\to === 0 ? l.set(c) : e.updatePaddedCompressedCovariancesTextureData(c, l, 0, 0, c.length);\n\t\t\tlet u;\n\t\t\tif (o >= 1) u = new zi(l, r.x, r.y, Oe, fe), u.internalFormat = \"RGBA32UI\", this.material.uniforms.covariancesTextureHalfFloat.value = u;\n\t\t\telse {\n\t\t\t\tu = new zi(l, r.x, r.y, Se, pe), this.material.uniforms.covariancesTexture.value = u;\n\t\t\t\tlet e = new zi(/* @__PURE__ */ new Uint32Array(32), 2, 2, Oe, fe);\n\t\t\t\te.internalFormat = \"RGBA32UI\", this.material.uniforms.covariancesTextureHalfFloat.value = e, e.needsUpdate = !0;\n\t\t\t}\n\t\t\tu.needsUpdate = !0, this.material.uniforms.covariancesAreHalfFloat.value = +(o >= 1), this.material.uniforms.covariancesTextureSize.value.copy(r), this.splatDataTextures.covariances = {\n\t\t\t\tdata: l,\n\t\t\t\ttexture: u,\n\t\t\t\tsize: r,\n\t\t\t\tcompressionLevel: o,\n\t\t\t\telementsPerTexelStored: n,\n\t\t\t\telementsPerTexelAllocated: s\n\t\t\t};\n\t\t} else {\n\t\t\tlet t = r(lp, 6), i = Float32Array, a = pe, o = new i(t.x * t.y * lp);\n\t\t\te.updateScaleRotationsPaddedData(0, n - 1, l, u, o);\n\t\t\tlet s = new zi(o, t.x, t.y, Se, a);\n\t\t\ts.needsUpdate = !0, this.material.uniforms.scaleRotationsTexture.value = s, this.material.uniforms.scaleRotationsTextureSize.value.copy(t), this.splatDataTextures.scaleRotations = {\n\t\t\t\tdata: o,\n\t\t\t\ttexture: s,\n\t\t\t\tsize: t,\n\t\t\t\tcompressionLevel: 0\n\t\t\t};\n\t\t}\n\t\tif (h) {\n\t\t\tlet e = s === 2 ? se : me, t = m;\n\t\t\tt % 2 != 0 && t++;\n\t\t\tlet i = Se, a = r(4, t);\n\t\t\tif (a.x * a.y <= hp) {\n\t\t\t\tlet r = a.x * a.y * 4, o = new p(r);\n\t\t\t\tfor (let e = 0; e < n; e++) {\n\t\t\t\t\tlet n = m * e, r = t * e;\n\t\t\t\t\tfor (let e = 0; e < m; e++) o[r + e] = h[n + e];\n\t\t\t\t}\n\t\t\t\tlet c = new zi(o, a.x, a.y, i, e);\n\t\t\t\tc.needsUpdate = !0, this.material.uniforms.sphericalHarmonicsTexture.value = c, this.splatDataTextures.sphericalHarmonics = {\n\t\t\t\t\tcomponentCount: m,\n\t\t\t\t\tpaddedComponentCount: t,\n\t\t\t\t\tdata: o,\n\t\t\t\t\ttextureCount: 1,\n\t\t\t\t\ttexture: c,\n\t\t\t\t\tsize: a,\n\t\t\t\t\tcompressionLevel: s,\n\t\t\t\t\telementsPerTexel: 4\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tlet o = m / 3;\n\t\t\t\tt = o, t % 2 != 0 && t++, a = r(4, t);\n\t\t\t\tlet c = a.x * a.y * 4, l = [\n\t\t\t\t\tthis.material.uniforms.sphericalHarmonicsTextureR,\n\t\t\t\t\tthis.material.uniforms.sphericalHarmonicsTextureG,\n\t\t\t\t\tthis.material.uniforms.sphericalHarmonicsTextureB\n\t\t\t\t], u = [], d = [];\n\t\t\t\tfor (let r = 0; r < 3; r++) {\n\t\t\t\t\tlet s = new p(c);\n\t\t\t\t\tu.push(s);\n\t\t\t\t\tfor (let e = 0; e < n; e++) {\n\t\t\t\t\t\tlet n = m * e, i = t * e;\n\t\t\t\t\t\tif (o >= 3) {\n\t\t\t\t\t\t\tfor (let e = 0; e < 3; e++) s[i + e] = h[n + r * 3 + e];\n\t\t\t\t\t\t\tif (o >= 8) for (let e = 0; e < 5; e++) s[i + 3 + e] = h[n + 9 + r * 5 + e];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet f = new zi(s, a.x, a.y, i, e);\n\t\t\t\t\td.push(f), f.needsUpdate = !0, l[r].value = f;\n\t\t\t\t}\n\t\t\t\tthis.material.uniforms.sphericalHarmonicsMultiTextureMode.value = 1, this.splatDataTextures.sphericalHarmonics = {\n\t\t\t\t\tcomponentCount: m,\n\t\t\t\t\tcomponentCountPerChannel: o,\n\t\t\t\t\tpaddedComponentCount: t,\n\t\t\t\t\tdata: u,\n\t\t\t\t\ttextureCount: 3,\n\t\t\t\t\ttextures: d,\n\t\t\t\t\tsize: a,\n\t\t\t\t\tcompressionLevel: s,\n\t\t\t\t\telementsPerTexel: 4\n\t\t\t\t};\n\t\t\t}\n\t\t\tthis.material.uniforms.sphericalHarmonicsTextureSize.value.copy(a), this.material.uniforms.sphericalHarmonics8BitMode.value = +(s === 2);\n\t\t\tfor (let e = 0; e < this.scenes.length; e++) {\n\t\t\t\tlet t = this.scenes[e].splatBuffer;\n\t\t\t\tthis.material.uniforms.sphericalHarmonics8BitCompressionRangeMin.value[e] = t.minSphericalHarmonicsCoeff, this.material.uniforms.sphericalHarmonics8BitCompressionRangeMax.value[e] = t.maxSphericalHarmonicsCoeff;\n\t\t\t}\n\t\t\tthis.material.uniformsNeedUpdate = !0;\n\t\t}\n\t\tlet y = r(dp, 4), b = new Uint32Array(y.x * y.y * dp);\n\t\tfor (let e = 0; e < n; e++) b[e] = this.globalSplatIndexToSceneIndexMap[e];\n\t\tlet x = new zi(b, y.x, y.y, Te, fe);\n\t\tx.internalFormat = \"R32UI\", x.needsUpdate = !0, this.material.uniforms.sceneIndexesTexture.value = x, this.material.uniforms.sceneIndexesTextureSize.value.copy(y), this.material.uniformsNeedUpdate = !0, this.splatDataTextures.sceneIndexes = {\n\t\t\tdata: b,\n\t\t\ttexture: x,\n\t\t\tsize: y\n\t\t}, this.material.uniforms.sceneCount.value = this.scenes.length;\n\t}\n\tupdateBaseDataFromSplatBuffers(e, t) {\n\t\tlet n = this.splatDataTextures.covariances, r = n ? n.compressionLevel : void 0, i = this.splatDataTextures.scaleRotations, a = i ? i.compressionLevel : void 0, o = this.splatDataTextures.sphericalHarmonics, s = o ? o.compressionLevel : 0;\n\t\tthis.fillSplatDataArrays(this.splatDataTextures.baseData.covariances, this.splatDataTextures.baseData.scales, this.splatDataTextures.baseData.rotations, this.splatDataTextures.baseData.centers, this.splatDataTextures.baseData.colors, this.splatDataTextures.baseData.sphericalHarmonics, void 0, r, a, s, e, t, e);\n\t}\n\tupdateDataTexturesFromBaseData(t, n) {\n\t\tlet r = this.splatDataTextures.covariances, i = r ? r.compressionLevel : void 0, a = this.splatDataTextures.scaleRotations, o = a ? a.compressionLevel : void 0, s = this.splatDataTextures.sphericalHarmonics, c = s ? s.compressionLevel : 0, l = this.splatDataTextures.centerColors, u = l.data, d = l.texture;\n\t\te.updateCenterColorsPaddedData(t, n, this.splatDataTextures.baseData.centers, this.splatDataTextures.baseData.colors, u);\n\t\tlet f = this.renderer ? this.renderer.properties.get(d) : null;\n\t\tif (!f || !f.__webglTexture ? d.needsUpdate = !0 : this.updateDataTexture(u, l.texture, l.size, f, up, ip, 4, t, n), r) {\n\t\t\tlet a = r.texture, o = t * rp, s = n * rp;\n\t\t\tif (i === 0) for (let e = o; e <= s; e++) {\n\t\t\t\tlet t = this.splatDataTextures.baseData.covariances[e];\n\t\t\t\tr.data[e] = t;\n\t\t\t}\n\t\t\telse e.updatePaddedCompressedCovariancesTextureData(this.splatDataTextures.baseData.covariances, r.data, t * r.elementsPerTexelAllocated, o, s);\n\t\t\tlet c = this.renderer ? this.renderer.properties.get(a) : null;\n\t\t\t!c || !c.__webglTexture ? a.needsUpdate = !0 : i === 0 ? this.updateDataTexture(r.data, r.texture, r.size, c, r.elementsPerTexelStored, rp, 4, t, n) : this.updateDataTexture(r.data, r.texture, r.size, c, r.elementsPerTexelAllocated, r.elementsPerTexelAllocated, 2, t, n);\n\t\t}\n\t\tif (a) {\n\t\t\tlet r = a.data, i = a.texture, s = o === 0 ? 4 : 2;\n\t\t\te.updateScaleRotationsPaddedData(t, n, this.splatDataTextures.baseData.scales, this.splatDataTextures.baseData.rotations, r);\n\t\t\tlet c = this.renderer ? this.renderer.properties.get(i) : null;\n\t\t\t!c || !c.__webglTexture ? i.needsUpdate = !0 : this.updateDataTexture(r, a.texture, a.size, c, lp, 6, s, t, n);\n\t\t}\n\t\tlet p = this.splatDataTextures.baseData.sphericalHarmonics;\n\t\tif (p) {\n\t\t\tlet e = 4;\n\t\t\tc === 1 ? e = 2 : c === 2 && (e = 1);\n\t\t\tlet r = (r, i, a, o, s) => {\n\t\t\t\tlet c = this.renderer ? this.renderer.properties.get(r) : null;\n\t\t\t\t!c || !c.__webglTexture ? r.needsUpdate = !0 : this.updateDataTexture(o, r, i, c, a, s, e, t, n);\n\t\t\t}, i = s.componentCount, a = s.paddedComponentCount;\n\t\t\tif (s.textureCount === 1) {\n\t\t\t\tlet e = s.data;\n\t\t\t\tfor (let r = t; r <= n; r++) {\n\t\t\t\t\tlet t = i * r, n = a * r;\n\t\t\t\t\tfor (let r = 0; r < i; r++) e[n + r] = p[t + r];\n\t\t\t\t}\n\t\t\t\tr(s.texture, s.size, s.elementsPerTexel, e, a);\n\t\t\t} else {\n\t\t\t\tlet e = s.componentCountPerChannel;\n\t\t\t\tfor (let o = 0; o < 3; o++) {\n\t\t\t\t\tlet c = s.data[o];\n\t\t\t\t\tfor (let r = t; r <= n; r++) {\n\t\t\t\t\t\tlet t = i * r, n = a * r;\n\t\t\t\t\t\tif (e >= 3) {\n\t\t\t\t\t\t\tfor (let e = 0; e < 3; e++) c[n + e] = p[t + o * 3 + e];\n\t\t\t\t\t\t\tif (e >= 8) for (let e = 0; e < 5; e++) c[n + 3 + e] = p[t + 9 + o * 5 + e];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr(s.textures[o], s.size, s.elementsPerTexel, c, a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlet m = this.splatDataTextures.sceneIndexes, h = m.data;\n\t\tfor (let e = this.lastBuildSplatCount; e <= n; e++) h[e] = this.globalSplatIndexToSceneIndexMap[e];\n\t\tlet g = m.texture, _ = this.renderer ? this.renderer.properties.get(g) : null;\n\t\t!_ || !_.__webglTexture ? g.needsUpdate = !0 : this.updateDataTexture(h, m.texture, m.size, _, 1, 1, 1, this.lastBuildSplatCount, n);\n\t}\n\tgetTargetCovarianceCompressionLevel() {\n\t\treturn +!!this.halfPrecisionCovariancesOnGPU;\n\t}\n\tgetTargetSphericalHarmonicsCompressionLevel() {\n\t\treturn Math.max(1, this.getMaximumSplatBufferCompressionLevel());\n\t}\n\tgetMaximumSplatBufferCompressionLevel() {\n\t\tlet e;\n\t\tfor (let t = 0; t < this.scenes.length; t++) {\n\t\t\tlet n = this.getScene(t).splatBuffer;\n\t\t\t(t === 0 || n.compressionLevel > e) && (e = n.compressionLevel);\n\t\t}\n\t\treturn e;\n\t}\n\tgetMinimumSplatBufferCompressionLevel() {\n\t\tlet e;\n\t\tfor (let t = 0; t < this.scenes.length; t++) {\n\t\t\tlet n = this.getScene(t).splatBuffer;\n\t\t\t(t === 0 || n.compressionLevel < e) && (e = n.compressionLevel);\n\t\t}\n\t\treturn e;\n\t}\n\tstatic computeTextureUpdateRegion(e, t, n, r, i) {\n\t\tlet a = i / r, o = e * a, s = Math.floor(o / n), c = s * n * r, l = t * a, u = Math.floor(l / n);\n\t\treturn {\n\t\t\tdataStart: c,\n\t\t\tdataEnd: u * n * r + n * r,\n\t\t\tstartRow: s,\n\t\t\tendRow: u\n\t\t};\n\t}\n\tupdateDataTexture(t, n, r, i, a, o, s, c, l) {\n\t\tlet u = this.renderer.getContext(), d = e.computeTextureUpdateRegion(c, l, r.x, a, o), f = d.dataEnd - d.dataStart, p = new t.constructor(t.buffer, d.dataStart * s, f), m = d.endRow - d.startRow + 1, h = this.webGLUtils.convert(n.type), g = this.webGLUtils.convert(n.format, n.colorSpace), _ = u.getParameter(u.TEXTURE_BINDING_2D);\n\t\tu.bindTexture(u.TEXTURE_2D, i.__webglTexture), u.texSubImage2D(u.TEXTURE_2D, 0, 0, d.startRow, r.x, m, g, h, p), u.bindTexture(u.TEXTURE_2D, _);\n\t}\n\tstatic updatePaddedCompressedCovariancesTextureData(e, t, n, r, i) {\n\t\tlet a = new DataView(t.buffer), o = n, s = 0;\n\t\tfor (let t = r; t <= i; t += 2) a.setUint16(o * 2, e[t], !0), a.setUint16(o * 2 + 2, e[t + 1], !0), o += 2, s++, s >= 3 && (o += 2, s = 0);\n\t}\n\tstatic updateCenterColorsPaddedData(e, t, n, r, i) {\n\t\tfor (let a = e; a <= t; a++) {\n\t\t\tlet e = a * 4, t = a * 3, o = a * 4;\n\t\t\ti[o] = Yl(r, e), i[o + 1] = Jl(n[t]), i[o + 2] = Jl(n[t + 1]), i[o + 3] = Jl(n[t + 2]);\n\t\t}\n\t}\n\tstatic updateScaleRotationsPaddedData(e, t, n, r, i) {\n\t\tfor (let a = e; a <= t; a++) {\n\t\t\tlet e = a * 3, t = a * 4, o = a * 6;\n\t\t\ti[o] = n[e], i[o + 1] = n[e + 1], i[o + 2] = n[e + 2], i[o + 3] = r[t], i[o + 4] = r[t + 1], i[o + 5] = r[t + 2];\n\t\t}\n\t}\n\tupdateVisibleRegion(e) {\n\t\tlet t = this.getSplatCount(!0), n = new K();\n\t\tif (!e) {\n\t\t\tlet e = new K();\n\t\t\tthis.scenes.forEach((t) => {\n\t\t\t\te.add(t.splatBuffer.sceneCenter);\n\t\t\t}), e.multiplyScalar(1 / this.scenes.length), this.calculatedSceneCenter.copy(e), this.material.uniforms.sceneCenter.value.copy(this.calculatedSceneCenter), this.material.uniformsNeedUpdate = !0;\n\t\t}\n\t\tlet r = e ? this.lastBuildSplatCount : 0;\n\t\tfor (let e = r; e < t; e++) {\n\t\t\tthis.getSplatCenter(e, n, !0);\n\t\t\tlet t = n.sub(this.calculatedSceneCenter).length();\n\t\t\tt > this.maxSplatDistanceFromSceneCenter && (this.maxSplatDistanceFromSceneCenter = t);\n\t\t}\n\t\tthis.maxSplatDistanceFromSceneCenter - this.visibleRegionBufferRadius > mp && (this.visibleRegionBufferRadius = this.maxSplatDistanceFromSceneCenter, this.visibleRegionRadius = Math.max(this.visibleRegionBufferRadius - mp, 0)), this.finalBuild && (this.visibleRegionRadius = this.visibleRegionBufferRadius = this.maxSplatDistanceFromSceneCenter), this.updateVisibleRegionFadeDistance();\n\t}\n\tupdateVisibleRegionFadeDistance(e = $f.Default) {\n\t\tlet t = fp * this.sceneFadeInRateMultiplier, n = pp * this.sceneFadeInRateMultiplier, r = this.finalBuild ? t : n, i = e === $f.Default ? r : n;\n\t\tthis.visibleRegionFadeStartRadius = (this.visibleRegionRadius - this.visibleRegionFadeStartRadius) * i + this.visibleRegionFadeStartRadius;\n\t\tlet a = (this.visibleRegionBufferRadius > 0 ? this.visibleRegionFadeStartRadius / this.visibleRegionBufferRadius : 0) > .99, o = a || e === $f.Instant ? 1 : 0;\n\t\tthis.material.uniforms.visibleRegionFadeStartRadius.value = this.visibleRegionFadeStartRadius, this.material.uniforms.visibleRegionRadius.value = this.visibleRegionRadius, this.material.uniforms.firstRenderTime.value = this.firstRenderTime, this.material.uniforms.currentTime.value = performance.now(), this.material.uniforms.fadeInComplete.value = o, this.material.uniformsNeedUpdate = !0, this.visibleRegionChanging = !a;\n\t}\n\tupdateRenderIndexes(e, t) {\n\t\tlet n = this.geometry;\n\t\tn.attributes.splatIndex.set(e), n.attributes.splatIndex.needsUpdate = !0, t > 0 && this.firstRenderTime === -1 && (this.firstRenderTime = performance.now()), n.instanceCount = t, n.setDrawRange(0, t);\n\t}\n\tupdateTransforms() {\n\t\tfor (let e = 0; e < this.scenes.length; e++) this.getScene(e).updateTransform(this.dynamicMode);\n\t}\n\tupdateUniforms = function() {\n\t\tlet e = new G();\n\t\treturn function(t, n, r, i, a, o) {\n\t\t\tif (this.getSplatCount() > 0) {\n\t\t\t\tif (e.set(t.x * this.devicePixelRatio, t.y * this.devicePixelRatio), this.material.uniforms.viewport.value.copy(e), this.material.uniforms.basisViewport.value.set(1 / e.x, 1 / e.y), this.material.uniforms.focal.value.set(n, r), this.material.uniforms.orthographicMode.value = +!!i, this.material.uniforms.orthoZoom.value = a, this.material.uniforms.inverseFocalAdjustment.value = o, this.dynamicMode) for (let e = 0; e < this.scenes.length; e++) this.material.uniforms.transforms.value[e].copy(this.getScene(e).transform);\n\t\t\t\tif (this.enableOptionalEffects) for (let e = 0; e < this.scenes.length; e++) this.material.uniforms.sceneOpacity.value[e] = Zl(this.getScene(e).opacity, 0, 1), this.material.uniforms.sceneVisibility.value[e] = +!!this.getScene(e).visible, this.material.uniformsNeedUpdate = !0;\n\t\t\t\tthis.material.uniformsNeedUpdate = !0;\n\t\t\t}\n\t\t};\n\t}();\n\tsetSplatScale(e = 1) {\n\t\tthis.splatScale = e, this.material.uniforms.splatScale.value = e, this.material.uniformsNeedUpdate = !0;\n\t}\n\tgetSplatScale() {\n\t\treturn this.splatScale;\n\t}\n\tsetPointCloudModeEnabled(e) {\n\t\tthis.pointCloudModeEnabled = e, this.material.uniforms.pointCloudModeEnabled.value = +!!e, this.material.uniformsNeedUpdate = !0;\n\t}\n\tgetPointCloudModeEnabled() {\n\t\treturn this.pointCloudModeEnabled;\n\t}\n\tgetSplatDataTextures() {\n\t\treturn this.splatDataTextures;\n\t}\n\tgetSplatCount(t = !1) {\n\t\treturn t ? e.getTotalSplatCountForScenes(this.scenes) : this.lastBuildSplatCount;\n\t}\n\tstatic getTotalSplatCountForScenes(e) {\n\t\tlet t = 0;\n\t\tfor (let n of e) n && n.splatBuffer && (t += n.splatBuffer.getSplatCount());\n\t\treturn t;\n\t}\n\tstatic getTotalSplatCountForSplatBuffers(e) {\n\t\tlet t = 0;\n\t\tfor (let n of e) t += n.getSplatCount();\n\t\treturn t;\n\t}\n\tgetMaxSplatCount() {\n\t\treturn e.getTotalMaxSplatCountForScenes(this.scenes);\n\t}\n\tstatic getTotalMaxSplatCountForScenes(e) {\n\t\tlet t = 0;\n\t\tfor (let n of e) n && n.splatBuffer && (t += n.splatBuffer.getMaxSplatCount());\n\t\treturn t;\n\t}\n\tstatic getTotalMaxSplatCountForSplatBuffers(e) {\n\t\tlet t = 0;\n\t\tfor (let n of e) t += n.getMaxSplatCount();\n\t\treturn t;\n\t}\n\tdisposeDistancesComputationGPUResources() {\n\t\tif (!this.renderer) return;\n\t\tlet e = this.renderer.getContext();\n\t\tthis.distancesTransformFeedback.vao && (e.deleteVertexArray(this.distancesTransformFeedback.vao), this.distancesTransformFeedback.vao = null), this.distancesTransformFeedback.program && (e.deleteProgram(this.distancesTransformFeedback.program), e.deleteShader(this.distancesTransformFeedback.vertexShader), e.deleteShader(this.distancesTransformFeedback.fragmentShader), this.distancesTransformFeedback.program = null, this.distancesTransformFeedback.vertexShader = null, this.distancesTransformFeedback.fragmentShader = null), this.disposeDistancesComputationGPUBufferResources(), this.distancesTransformFeedback.id && (e.deleteTransformFeedback(this.distancesTransformFeedback.id), this.distancesTransformFeedback.id = null);\n\t}\n\tdisposeDistancesComputationGPUBufferResources() {\n\t\tif (!this.renderer) return;\n\t\tlet e = this.renderer.getContext();\n\t\tthis.distancesTransformFeedback.centersBuffer && (this.distancesTransformFeedback.centersBuffer = null, e.deleteBuffer(this.distancesTransformFeedback.centersBuffer)), this.distancesTransformFeedback.outDistancesBuffer && (e.deleteBuffer(this.distancesTransformFeedback.outDistancesBuffer), this.distancesTransformFeedback.outDistancesBuffer = null);\n\t}\n\tsetRenderer(e) {\n\t\tif (e !== this.renderer) {\n\t\t\tthis.renderer = e;\n\t\t\tlet t = this.renderer.getContext(), n = new Zf(t), r = new Qf(t, n, {});\n\t\t\tif (n.init(r), this.webGLUtils = new ul(t, n, r), this.enableDistancesComputationOnGPU && this.getSplatCount() > 0) {\n\t\t\t\tthis.setupDistancesComputationTransformFeedback();\n\t\t\t\tlet { centers: e, sceneIndexes: t } = this.getDataForDistancesComputation(0, this.getSplatCount() - 1);\n\t\t\t\tthis.refreshGPUBuffersForDistancesComputation(e, t);\n\t\t\t}\n\t\t}\n\t}\n\tsetupDistancesComputationTransformFeedback = function() {\n\t\tlet e;\n\t\treturn function() {\n\t\t\tlet t = this.getMaxSplatCount();\n\t\t\tif (!this.renderer) return;\n\t\t\tlet n = this.lastRenderer !== this.renderer, r = e !== t;\n\t\t\tif (!n && !r) return;\n\t\t\tn ? this.disposeDistancesComputationGPUResources() : r && this.disposeDistancesComputationGPUBufferResources();\n\t\t\tlet i = this.renderer.getContext(), a = (e, t, n) => {\n\t\t\t\tlet r = e.createShader(t);\n\t\t\t\tif (!r) return console.error(\"Fatal error: gl could not create a shader object.\"), null;\n\t\t\t\tif (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {\n\t\t\t\t\tlet n = \"unknown\";\n\t\t\t\t\tt === e.VERTEX_SHADER ? n = \"vertex shader\" : t === e.FRAGMENT_SHADER && (n = \"fragement shader\");\n\t\t\t\t\tlet i = e.getShaderInfoLog(r);\n\t\t\t\t\treturn console.error(\"Failed to compile \" + n + \" with these errors:\" + i), e.deleteShader(r), null;\n\t\t\t\t}\n\t\t\t\treturn r;\n\t\t\t}, o;\n\t\t\tthis.integerBasedDistancesComputation ? (o = \"#version 300 es\\n                in ivec4 center;\\n                flat out int distance;\", this.dynamicMode ? o += `\n                        in uint sceneIndex;\n                        uniform ivec4 transforms[${cu.MaxScenes}];\n                        void main(void) {\n                            ivec4 transform = transforms[sceneIndex];\n                            distance = center.x * transform.x + center.y * transform.y + center.z * transform.z + transform.w * center.w;\n                        }\n                    ` : o += \"\\n                        uniform ivec3 modelViewProj;\\n                        void main(void) {\\n                            distance = center.x * modelViewProj.x + center.y * modelViewProj.y + center.z * modelViewProj.z;\\n                        }\\n                    \") : (o = \"#version 300 es\\n                in vec4 center;\\n                flat out float distance;\", this.dynamicMode ? o += `\n                        in uint sceneIndex;\n                        uniform mat4 transforms[${cu.MaxScenes}];\n                        void main(void) {\n                            vec4 transformedCenter = transforms[sceneIndex] * vec4(center.xyz, 1.0);\n                            distance = transformedCenter.z;\n                        }\n                    ` : o += \"\\n                        uniform vec3 modelViewProj;\\n                        void main(void) {\\n                            distance = center.x * modelViewProj.x + center.y * modelViewProj.y + center.z * modelViewProj.z;\\n                        }\\n                    \");\n\t\t\tlet s = i.getParameter(i.VERTEX_ARRAY_BINDING), c = i.getParameter(i.CURRENT_PROGRAM), l = c ? i.getProgramParameter(c, i.DELETE_STATUS) : !1;\n\t\t\tif (n && (this.distancesTransformFeedback.vao = i.createVertexArray()), i.bindVertexArray(this.distancesTransformFeedback.vao), n) {\n\t\t\t\tlet e = i.createProgram(), t = a(i, i.VERTEX_SHADER, o), n = a(i, i.FRAGMENT_SHADER, \"#version 300 es\\n                precision lowp float;\\n                out vec4 fragColor;\\n                void main(){}\\n            \");\n\t\t\t\tif (!t || !n) throw Error(\"Could not compile shaders for distances computation on GPU.\");\n\t\t\t\tif (i.attachShader(e, t), i.attachShader(e, n), i.transformFeedbackVaryings(e, [\"distance\"], i.SEPARATE_ATTRIBS), i.linkProgram(e), !i.getProgramParameter(e, i.LINK_STATUS)) {\n\t\t\t\t\tlet r = i.getProgramInfoLog(e);\n\t\t\t\t\tthrow console.error(\"Fatal error: Failed to link program: \" + r), i.deleteProgram(e), i.deleteShader(n), i.deleteShader(t), Error(\"Could not link shaders for distances computation on GPU.\");\n\t\t\t\t}\n\t\t\t\tthis.distancesTransformFeedback.program = e, this.distancesTransformFeedback.vertexShader = t, this.distancesTransformFeedback.vertexShader = n;\n\t\t\t}\n\t\t\tif (i.useProgram(this.distancesTransformFeedback.program), this.distancesTransformFeedback.centersLoc = i.getAttribLocation(this.distancesTransformFeedback.program, \"center\"), this.dynamicMode) {\n\t\t\t\tthis.distancesTransformFeedback.sceneIndexesLoc = i.getAttribLocation(this.distancesTransformFeedback.program, \"sceneIndex\");\n\t\t\t\tfor (let e = 0; e < this.scenes.length; e++) this.distancesTransformFeedback.transformsLocs[e] = i.getUniformLocation(this.distancesTransformFeedback.program, `transforms[${e}]`);\n\t\t\t} else this.distancesTransformFeedback.modelViewProjLoc = i.getUniformLocation(this.distancesTransformFeedback.program, \"modelViewProj\");\n\t\t\t(n || r) && (this.distancesTransformFeedback.centersBuffer = i.createBuffer(), i.bindBuffer(i.ARRAY_BUFFER, this.distancesTransformFeedback.centersBuffer), i.enableVertexAttribArray(this.distancesTransformFeedback.centersLoc), this.integerBasedDistancesComputation ? i.vertexAttribIPointer(this.distancesTransformFeedback.centersLoc, 4, i.INT, 0, 0) : i.vertexAttribPointer(this.distancesTransformFeedback.centersLoc, 4, i.FLOAT, !1, 0, 0), this.dynamicMode && (this.distancesTransformFeedback.sceneIndexesBuffer = i.createBuffer(), i.bindBuffer(i.ARRAY_BUFFER, this.distancesTransformFeedback.sceneIndexesBuffer), i.enableVertexAttribArray(this.distancesTransformFeedback.sceneIndexesLoc), i.vertexAttribIPointer(this.distancesTransformFeedback.sceneIndexesLoc, 1, i.UNSIGNED_INT, 0, 0))), (n || r) && (this.distancesTransformFeedback.outDistancesBuffer = i.createBuffer()), i.bindBuffer(i.ARRAY_BUFFER, this.distancesTransformFeedback.outDistancesBuffer), i.bufferData(i.ARRAY_BUFFER, t * 4, i.STATIC_READ), n && (this.distancesTransformFeedback.id = i.createTransformFeedback()), i.bindTransformFeedback(i.TRANSFORM_FEEDBACK, this.distancesTransformFeedback.id), i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER, 0, this.distancesTransformFeedback.outDistancesBuffer), c && l !== !0 && i.useProgram(c), s && i.bindVertexArray(s), this.lastRenderer = this.renderer, e = t;\n\t\t};\n\t}();\n\tupdateGPUCentersBufferForDistancesComputation(e, t, n) {\n\t\tif (!this.renderer) return;\n\t\tlet r = this.renderer.getContext(), i = r.getParameter(r.VERTEX_ARRAY_BINDING);\n\t\tr.bindVertexArray(this.distancesTransformFeedback.vao);\n\t\tlet a = this.integerBasedDistancesComputation ? Uint32Array : Float32Array, o = n * 16;\n\t\tif (r.bindBuffer(r.ARRAY_BUFFER, this.distancesTransformFeedback.centersBuffer), e) r.bufferSubData(r.ARRAY_BUFFER, o, t);\n\t\telse {\n\t\t\tlet e = new a(this.getMaxSplatCount() * 16);\n\t\t\te.set(t), r.bufferData(r.ARRAY_BUFFER, e, r.STATIC_DRAW);\n\t\t}\n\t\tr.bindBuffer(r.ARRAY_BUFFER, null), i && r.bindVertexArray(i);\n\t}\n\tupdateGPUTransformIndexesBufferForDistancesComputation(e, t, n) {\n\t\tif (!this.renderer || !this.dynamicMode) return;\n\t\tlet r = this.renderer.getContext(), i = r.getParameter(r.VERTEX_ARRAY_BINDING);\n\t\tr.bindVertexArray(this.distancesTransformFeedback.vao);\n\t\tlet a = n * 4;\n\t\tif (r.bindBuffer(r.ARRAY_BUFFER, this.distancesTransformFeedback.sceneIndexesBuffer), e) r.bufferSubData(r.ARRAY_BUFFER, a, t);\n\t\telse {\n\t\t\tlet e = new Uint32Array(this.getMaxSplatCount() * 4);\n\t\t\te.set(t), r.bufferData(r.ARRAY_BUFFER, e, r.STATIC_DRAW);\n\t\t}\n\t\tr.bindBuffer(r.ARRAY_BUFFER, null), i && r.bindVertexArray(i);\n\t}\n\tgetSceneIndexes(e, t) {\n\t\tlet n, r = t - e + 1;\n\t\tn = new Uint32Array(r);\n\t\tfor (let r = e; r <= t; r++) n[r] = this.globalSplatIndexToSceneIndexMap[r];\n\t\treturn n;\n\t}\n\tfillTransformsArray = function() {\n\t\tlet e = [];\n\t\treturn function(t) {\n\t\t\te.length !== t.length && (e.length = t.length);\n\t\t\tfor (let t = 0; t < this.scenes.length; t++) {\n\t\t\t\tlet n = this.getScene(t).transform.elements;\n\t\t\t\tfor (let r = 0; r < 16; r++) e[t * 16 + r] = n[r];\n\t\t\t}\n\t\t\tt.set(e);\n\t\t};\n\t}();\n\tcomputeDistancesOnGPU = function() {\n\t\tlet t = new J();\n\t\treturn function(n, r) {\n\t\t\tif (!this.renderer) return;\n\t\t\tlet i = this.renderer.getContext(), a = i.getParameter(i.VERTEX_ARRAY_BINDING), o = i.getParameter(i.CURRENT_PROGRAM), s = o ? i.getProgramParameter(o, i.DELETE_STATUS) : !1;\n\t\t\tif (i.bindVertexArray(this.distancesTransformFeedback.vao), i.useProgram(this.distancesTransformFeedback.program), i.enable(i.RASTERIZER_DISCARD), this.dynamicMode) for (let r = 0; r < this.scenes.length; r++) if (t.copy(this.getScene(r).transform), t.premultiply(n), this.integerBasedDistancesComputation) {\n\t\t\t\tlet n = e.getIntegerMatrixArray(t), a = [\n\t\t\t\t\tn[2],\n\t\t\t\t\tn[6],\n\t\t\t\t\tn[10],\n\t\t\t\t\tn[14]\n\t\t\t\t];\n\t\t\t\ti.uniform4i(this.distancesTransformFeedback.transformsLocs[r], a[0], a[1], a[2], a[3]);\n\t\t\t} else i.uniformMatrix4fv(this.distancesTransformFeedback.transformsLocs[r], !1, t.elements);\n\t\t\telse if (this.integerBasedDistancesComputation) {\n\t\t\t\tlet t = e.getIntegerMatrixArray(n), r = [\n\t\t\t\t\tt[2],\n\t\t\t\t\tt[6],\n\t\t\t\t\tt[10]\n\t\t\t\t];\n\t\t\t\ti.uniform3i(this.distancesTransformFeedback.modelViewProjLoc, r[0], r[1], r[2]);\n\t\t\t} else {\n\t\t\t\tlet e = [\n\t\t\t\t\tn.elements[2],\n\t\t\t\t\tn.elements[6],\n\t\t\t\t\tn.elements[10]\n\t\t\t\t];\n\t\t\t\ti.uniform3f(this.distancesTransformFeedback.modelViewProjLoc, e[0], e[1], e[2]);\n\t\t\t}\n\t\t\ti.bindBuffer(i.ARRAY_BUFFER, this.distancesTransformFeedback.centersBuffer), i.enableVertexAttribArray(this.distancesTransformFeedback.centersLoc), this.integerBasedDistancesComputation ? i.vertexAttribIPointer(this.distancesTransformFeedback.centersLoc, 4, i.INT, 0, 0) : i.vertexAttribPointer(this.distancesTransformFeedback.centersLoc, 4, i.FLOAT, !1, 0, 0), this.dynamicMode && (i.bindBuffer(i.ARRAY_BUFFER, this.distancesTransformFeedback.sceneIndexesBuffer), i.enableVertexAttribArray(this.distancesTransformFeedback.sceneIndexesLoc), i.vertexAttribIPointer(this.distancesTransformFeedback.sceneIndexesLoc, 1, i.UNSIGNED_INT, 0, 0)), i.bindTransformFeedback(i.TRANSFORM_FEEDBACK, this.distancesTransformFeedback.id), i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER, 0, this.distancesTransformFeedback.outDistancesBuffer), i.beginTransformFeedback(i.POINTS), i.drawArrays(i.POINTS, 0, this.getSplatCount()), i.endTransformFeedback(), i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER, 0, null), i.bindTransformFeedback(i.TRANSFORM_FEEDBACK, null), i.disable(i.RASTERIZER_DISCARD);\n\t\t\tlet c = i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE, 0);\n\t\t\ti.flush();\n\t\t\tlet l = new Promise((e) => {\n\t\t\t\tlet t = () => {\n\t\t\t\t\tif (this.disposed) e();\n\t\t\t\t\telse switch (i.clientWaitSync(c, 0, 0)) {\n\t\t\t\t\t\tcase i.TIMEOUT_EXPIRED: return this.computeDistancesOnGPUSyncTimeout = setTimeout(t), this.computeDistancesOnGPUSyncTimeout;\n\t\t\t\t\t\tcase i.WAIT_FAILED: throw Error(\"should never get here\");\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthis.computeDistancesOnGPUSyncTimeout = null, i.deleteSync(c);\n\t\t\t\t\t\t\tlet n = i.getParameter(i.VERTEX_ARRAY_BINDING);\n\t\t\t\t\t\t\ti.bindVertexArray(this.distancesTransformFeedback.vao), i.bindBuffer(i.ARRAY_BUFFER, this.distancesTransformFeedback.outDistancesBuffer), i.getBufferSubData(i.ARRAY_BUFFER, 0, r), i.bindBuffer(i.ARRAY_BUFFER, null), n && i.bindVertexArray(n), e();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.computeDistancesOnGPUSyncTimeout = setTimeout(t);\n\t\t\t});\n\t\t\treturn o && s !== !0 && i.useProgram(o), a && i.bindVertexArray(a), l;\n\t\t};\n\t}();\n\tgetLocalSplatParameters(e, t, n) {\n\t\tn ??= !this.dynamicMode, t.splatBuffer = this.getSplatBufferForSplat(e), t.localIndex = this.getSplatLocalIndex(e), t.sceneTransform = n ? this.getSceneTransformForSplat(e) : null;\n\t}\n\tfillSplatDataArrays(e, t, n, r, i, a, o, s = 0, c = 0, l = 1, u, d, f = 0, p) {\n\t\tlet m = new K();\n\t\tm.x = void 0, m.y = void 0, m.z = this.splatRenderMode === Rf.ThreeD ? void 0 : 1;\n\t\tlet h = new J(), g = 0, _ = this.scenes.length - 1;\n\t\tp != null && p >= 0 && p <= this.scenes.length && (g = p, _ = p);\n\t\tfor (let p = g; p <= _; p++) {\n\t\t\to ??= !this.dynamicMode;\n\t\t\tlet g = this.getScene(p), _ = g.splatBuffer, v;\n\t\t\tif (o && (this.getSceneTransform(p, h), v = h), e && _.fillSplatCovarianceArray(e, v, u, d, f, s), t || n) {\n\t\t\t\tif (!t || !n) throw Error(\"SplatMesh::fillSplatDataArrays() -> \\\"scales\\\" and \\\"rotations\\\" must both be valid.\");\n\t\t\t\t_.fillSplatScaleRotationArray(t, n, v, u, d, f, c, m);\n\t\t\t}\n\t\t\tr && _.fillSplatCenterArray(r, v, u, d, f), i && _.fillSplatColorArray(i, g.minimumAlpha, u, d, f), a && _.fillSphericalHarmonicsArray(a, this.minSphericalHarmonicsDegree, v, u, d, f, l), f += _.getSplatCount();\n\t\t}\n\t}\n\tgetIntegerCenters(e, t, n = !1) {\n\t\tlet r = t - e + 1, i = new Float32Array(r * 3);\n\t\tthis.fillSplatDataArrays(null, null, null, i, null, null, void 0, void 0, void 0, void 0, e);\n\t\tlet a, o = n ? 4 : 3;\n\t\ta = new Int32Array(r * o);\n\t\tfor (let e = 0; e < r; e++) {\n\t\t\tfor (let t = 0; t < 3; t++) a[e * o + t] = Math.round(i[e * 3 + t] * 1e3);\n\t\t\tn && (a[e * o + 3] = 1e3);\n\t\t}\n\t\treturn a;\n\t}\n\tgetFloatCenters(e, t, n = !1) {\n\t\tlet r = t - e + 1, i = new Float32Array(r * 3);\n\t\tif (this.fillSplatDataArrays(null, null, null, i, null, null, void 0, void 0, void 0, void 0, e), !n) return i;\n\t\tlet a = new Float32Array(r * 4);\n\t\tfor (let e = 0; e < r; e++) {\n\t\t\tfor (let t = 0; t < 3; t++) a[e * 4 + t] = i[e * 3 + t];\n\t\t\ta[e * 4 + 3] = 1;\n\t\t}\n\t\treturn a;\n\t}\n\tgetSplatCenter = function() {\n\t\tlet e = {};\n\t\treturn function(t, n, r) {\n\t\t\tthis.getLocalSplatParameters(t, e, r), e.splatBuffer.getSplatCenter(e.localIndex, n, e.sceneTransform);\n\t\t};\n\t}();\n\tgetSplatScaleAndRotation = function() {\n\t\tlet e = {}, t = new K();\n\t\treturn function(n, r, i, a) {\n\t\t\tthis.getLocalSplatParameters(n, e, a), t.x = void 0, t.y = void 0, t.z = void 0, this.splatRenderMode === Rf.TwoD && (t.z = 0), e.splatBuffer.getSplatScaleAndRotation(e.localIndex, r, i, e.sceneTransform, t);\n\t\t};\n\t}();\n\tgetSplatColor = function() {\n\t\tlet e = {};\n\t\treturn function(t, n) {\n\t\t\tthis.getLocalSplatParameters(t, e), e.splatBuffer.getSplatColor(e.localIndex, n);\n\t\t};\n\t}();\n\tgetSceneTransform(e, t) {\n\t\tlet n = this.getScene(e);\n\t\tn.updateTransform(this.dynamicMode), t.copy(n.transform);\n\t}\n\tgetScene(e) {\n\t\tif (e < 0 || e >= this.scenes.length) throw Error(\"SplatMesh::getScene() -> Invalid scene index.\");\n\t\treturn this.scenes[e];\n\t}\n\tgetSceneCount() {\n\t\treturn this.scenes.length;\n\t}\n\tgetSplatBufferForSplat(e) {\n\t\treturn this.getScene(this.globalSplatIndexToSceneIndexMap[e]).splatBuffer;\n\t}\n\tgetSceneIndexForSplat(e) {\n\t\treturn this.globalSplatIndexToSceneIndexMap[e];\n\t}\n\tgetSceneTransformForSplat(e) {\n\t\treturn this.getScene(this.globalSplatIndexToSceneIndexMap[e]).transform;\n\t}\n\tgetSplatLocalIndex(e) {\n\t\treturn this.globalSplatIndexToLocalSplatIndexMap[e];\n\t}\n\tstatic getIntegerMatrixArray(e) {\n\t\tlet t = e.elements, n = [];\n\t\tfor (let e = 0; e < 16; e++) n[e] = Math.round(t[e] * 1e3);\n\t\treturn n;\n\t}\n\tcomputeBoundingBox(e = !1, t) {\n\t\tlet n = this.getSplatCount();\n\t\tif (t != null) {\n\t\t\tif (t < 0 || t >= this.scenes.length) throw Error(\"SplatMesh::computeBoundingBox() -> Invalid scene index.\");\n\t\t\tn = this.scenes[t].splatBuffer.getSplatCount();\n\t\t}\n\t\tlet r = new Float32Array(n * 3);\n\t\tthis.fillSplatDataArrays(null, null, null, r, null, null, e, void 0, void 0, void 0, void 0, t);\n\t\tlet i = new K(), a = new K();\n\t\tfor (let e = 0; e < n; e++) {\n\t\t\tlet t = e * 3, n = r[t], o = r[t + 1], s = r[t + 2];\n\t\t\t(e === 0 || n < i.x) && (i.x = n), (e === 0 || o < i.y) && (i.y = o), (e === 0 || s < i.z) && (i.z = s), (e === 0 || n > a.x) && (a.x = n), (e === 0 || o > a.y) && (a.y = o), (e === 0 || s > a.z) && (a.z = s);\n\t\t}\n\t\treturn new kr(i, a);\n\t}\n}, _p = \"AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEbA2AAAGAQf39/f39/f39/f39/f39/fwBgAAF/AhIBA2VudgZtZW1vcnkCAwCAgAQDBAMAAQIHVAQRX193YXNtX2NhbGxfY3RvcnMAABhfX3dhc21fYXBwbHlfZGF0YV9yZWxvY3MAAAtzb3J0SW5kZXhlcwABE2Vtc2NyaXB0ZW5fdGxzX2luaXQAAgqWEAMDAAELihAEAXwDewN/A30gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEBA0AgAyABQQJ0IgVqIAIgACAFaigCAEECdGooAgAiBTYCACAFIAogBSAKSBshCiAFIA0gBSANShshDSABQQFqIgEgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiFWooAgAiFkECdGooAgAiFEcEQAJ/IAX9CQI4IAggFEEGdGoiDv0JAgwgDioCHP0gASAOKgIs/SACIA4qAjz9IAP95gEgBf0JAiggDv0JAgggDioCGP0gASAOKgIo/SACIA4qAjj9IAP95gEgBf0JAgggDv0JAgAgDioCEP0gASAOKgIg/SACIA4qAjD9IAP95gEgBf0JAhggDv0JAgQgDioCFP0gASAOKgIk/SACIA4qAjT9IAP95gH95AH95AH95AEiEf1f/QwAAAAAAECPQAAAAAAAQI9AIhL98gEiE/0hASIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDgJ/IBP9IQAiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgL/REgDv0cAQJ/IBEgEf0NCAkKCwwNDg8AAAAAAAAAAP1fIBL98gEiEf0hACIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAv9HAICfyAR/SEBIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4C/0cAyESIBQhDwsgAyAVaiABIBZBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmogEf0bA2oiDjYCACAOIAogCiAOShshCiAOIA0gDSAOSBshDSACQQFqIgIgC0cNAAsMAwsCfyAFKgIIu/0UIAUqAhi7/SIB/QwAAAAAAECPQAAAAAAAQI9A/fIBIhH9IQEiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIQ4CfyAR/SEAIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyECAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQpBiICAgHghDSALIAxNDQIgAv0RIA79HAEgBf0cAiESIAwhBQNAIAMgBUECdCICaiABIAAgAmooAgBBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmoiAjYCACACIAogAiAKSBshCiACIA0gAiANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEBA0AgAyABQQJ0IgVqAn8gAiAAIAVqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAFBAWoiASALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIRcgBSoCGCEYIAUqAgghGUH4////ByEKQYiAgIB4IQ0gDCEFA0ACfyAXIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCAZIAIqAgCUIBggAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIUaigCAEECdCIVaigCACIORwRAIAX9CQI4IAggDkEGdGoiD/0JAgwgDyoCHP0gASAPKgIs/SACIA8qAjz9IAP95gEgBf0JAiggD/0JAgggDyoCGP0gASAPKgIo/SACIA8qAjj9IAP95gEgBf0JAgggD/0JAgAgDyoCEP0gASAPKgIg/SACIA8qAjD9IAP95gEgBf0JAhggD/0JAgQgDyoCFP0gASAPKgIk/SACIA8qAjT9IAP95gH95AH95AH95AEhESAOIQ8LIAMgFGoCfyAR/R8DIAEgFUECdCIOQQxyaioCAJQgEf0fAiABIA5BCHJqKgIAlCAR/R8AIAEgDmoqAgCUIBH9HwEgASAOQQRyaioCAJSSkpK7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAsiDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSACQQFqIgIgC0cNAAsMAQtBiICAgHghDUH4////ByEKCyALIAxLBEAgCUEBa7MgDbIgCrKTlSEXIAwhDQNAAn8gFyADIA1BAnRqIgEoAgAgCmuylCIYi0MAAABPXQRAIBioDAELQYCAgIB4CyEOIAEgDjYCACAEIA5BAnRqIgEgASgCAEEBajYCACANQQFqIg0gC0cNAAsLIAlBAk8EQCAEKAIAIQ1BASEKA0AgBCAKQQJ0aiIBIAEoAgAgDWoiDTYCACAKQQFqIgogCUcNAAsLIAxBAEoEQCAMIQoDQCAGIApBAWsiAUECdCICaiAAIAJqKAIANgIAIApBAUshAiABIQogAg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCwsEAEEACw==\", vp = \"AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACEgEDZW52Bm1lbW9yeQIDAICABAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQqiDwICAAucDwMBfAd9Bn8gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEFA0AgAyAFQQJ0IgFqIAIgACABaigCAEECdGooAgAiATYCACABIAogASAKSBshCiABIA0gASANShshDSAFQQFqIgUgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiGmooAgBBAnQiG2ooAgAiDkcEQAJ/IAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRgCfyARIA8qAiyUIBIgDyoCKJQgEyAPKgIglCAUIA8qAiSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRkCfyARIA8qAhyUIBIgDyoCGJQgEyAPKgIQlCAUIA8qAhSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRwCfyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIR0gDiEPCyADIBpqIAEgG0ECdGoiDigCBCAcbCAOKAIAIB1saiAOKAIIIBlsaiAOKAIMIBhsaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAii7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshAgJ/IAUqAhi7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshByALIAxNAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEPQfj///8HIQpBiICAgHghDQ0CIAwhBQNAIAMgBUECdCIIaiABIAAgCGooAgBBBHRqIggoAgQgB2wgCCgCACAPbGogCCgCCCACbGoiCDYCACAIIAogCCAKSBshCiAIIA0gCCANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEFA0AgAyAFQQJ0IgFqAn8gAiAAIAFqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAVBAWoiBSALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIREgBSoCGCESIAUqAgghE0H4////ByEKQYiAgIB4IQ0gDCEFA0ACfyARIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCATIAIqAgCUIBIgAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIYaigCAEECdCIZaigCACIORwRAIAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSIRUgESAPKgIslCASIA8qAiiUIBMgDyoCIJQgFCAPKgIklJKSkiEWIBEgDyoCHJQgEiAPKgIYlCATIA8qAhCUIBQgDyoCFJSSkpIhFyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSIREgDiEPCyADIBhqAn8gFSABIBlBAnRqIg4qAgyUIBYgDioCCJQgESAOKgIAlCAXIA4qAgSUkpKSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIg42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gAkEBaiICIAtHDQALDAELQYiAgIB4IQ1B+P///wchCgsgCyAMSwRAIAlBAWuzIA2yIAqyk5UhESAMIQ0DQAJ/IBEgAyANQQJ0aiIBKAIAIAprspQiEotDAAAAT10EQCASqAwBC0GAgICAeAshDiABIA42AgAgBCAOQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhCgNAIAQgCkECdGoiASABKAIAIA1qIg02AgAgCkEBaiIKIAlHDQALCyAMQQBKBEAgDCEKA0AgBiAKQQFrIgFBAnQiAmogACACaigCADYCACAKQQFLIAEhCg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=\", yp = \"AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQrrDwICAAvlDwQBfAN7B30DfyALIAprIQwCQAJAIA4EQCANBEBB+P///wchCkGIgICAeCENIAsgDE0NAyAMIQUDQCADIAVBAnQiAWogAiAAIAFqKAIAQQJ0aigCACIBNgIAIAEgCiABIApIGyEKIAEgDSABIA1KGyENIAVBAWoiBSALRw0ACwwDCyAPBEAgCyAMTQ0CQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIcaigCACIdQQJ0aigCACIbRwRAAn8gBf0JAjggCCAbQQZ0aiIO/QkCDCAOKgIc/SABIA4qAiz9IAIgDioCPP0gA/3mASAF/QkCKCAO/QkCCCAOKgIY/SABIA4qAij9IAIgDioCOP0gA/3mASAF/QkCCCAO/QkCACAOKgIQ/SABIA4qAiD9IAIgDioCMP0gA/3mASAF/QkCGCAO/QkCBCAOKgIU/SABIA4qAiT9IAIgDioCNP0gA/3mAf3kAf3kAf3kASIR/V/9DAAAAAAAQI9AAAAAAABAj0AiEv3yASIT/SEBIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOAn8gE/0hACIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAv9ESAO/RwBAn8gESAR/Q0ICQoLDA0ODwABAgMAAQID/V8gEv3yASIR/SEAIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4C/0cAgJ/IBH9IQEiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgL/RwDIRIgGyEPCyADIBxqIAEgHUEEdGr9AAAAIBL9tQEiEf0bACAR/RsBaiAR/RsCaiAR/RsDaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAgi7/RQgBSoCGLv9IgH9DAAAAAAAQI9AAAAAAABAj0D98gEiEf0hASIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDgJ/IBH9IQAiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQpBiICAgHghDSALIAxNDQL9ESAO/RwBIAX9HAIhEiAMIQUDQCADIAVBAnQiAmogASAAIAJqKAIAQQR0av0AAAAgEv21ASIR/RsAIBH9GwFqIBH9GwJqIgI2AgAgAiAKIAIgCkgbIQogAiANIAIgDUobIQ0gBUEBaiIFIAtHDQALDAILIA0EQEH4////ByEKQYiAgIB4IQ0gCyAMTQ0CIAwhBQNAIAMgBUECdCIBagJ/IAIgACABaigCAEECdGoqAgC7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAsiDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgD0UEQCALIAxNDQEgBSoCKCEUIAUqAhghFSAFKgIIIRZB+P///wchCkGIgICAeCENIAwhBQNAAn8gFCABIAAgBUECdCIHaigCAEEEdGoiAioCCJQgFiACKgIAlCAVIAIqAgSUkpK7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDiADIAdqIA42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gBUEBaiIFIAtHDQALDAILIAsgDE0NAEF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiG2ooAgBBAnQiHGooAgAiDkcEQCAFKgI4IhQgCCAOQQZ0aiIPKgI8lCAFKgIoIhUgDyoCOJQgBSoCCCIWIA8qAjCUIAUqAhgiFyAPKgI0lJKSkiEYIBQgDyoCLJQgFSAPKgIolCAWIA8qAiCUIBcgDyoCJJSSkpIhGSAUIA8qAhyUIBUgDyoCGJQgFiAPKgIQlCAXIA8qAhSUkpKSIRogFCAPKgIMlCAVIA8qAgiUIBYgDyoCAJQgFyAPKgIElJKSkiEUIA4hDwsgAyAbagJ/IBggASAcQQJ0aiIOKgIMlCAZIA4qAgiUIBQgDioCAJQgGiAOKgIElJKSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAJBAWoiAiALRw0ACwwBC0GIgICAeCENQfj///8HIQoLIAsgDEsEQCAJQQFrsyANsiAKspOVIRQgDCENA0ACfyAUIAMgDUECdGoiASgCACAKa7KUIhWLQwAAAE9dBEAgFagMAQtBgICAgHgLIQ4gASAONgIAIAQgDkECdGoiASABKAIAQQFqNgIAIA1BAWoiDSALRw0ACwsgCUECTwRAIAQoAgAhDUEBIQoDQCAEIApBAnRqIgEgASgCACANaiINNgIAIApBAWoiCiAJRw0ACwsgDEEASgRAIAwhCgNAIAYgCkEBayIBQQJ0IgJqIAAgAmooAgA2AgAgCkEBSyABIQoNAAsLIAsgDEoEQCALIQoDQCAGIAsgBCADIApBAWsiCkECdCIBaigCAEECdGoiAigCACIFa0ECdGogACABaigCADYCACACIAVBAWs2AgAgCiAMSg0ACwsL\", bp = \"AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQqiDwICAAucDwMBfAd9Bn8gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEFA0AgAyAFQQJ0IgFqIAIgACABaigCAEECdGooAgAiATYCACABIAogASAKSBshCiABIA0gASANShshDSAFQQFqIgUgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiGmooAgBBAnQiG2ooAgAiDkcEQAJ/IAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRgCfyARIA8qAiyUIBIgDyoCKJQgEyAPKgIglCAUIA8qAiSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRkCfyARIA8qAhyUIBIgDyoCGJQgEyAPKgIQlCAUIA8qAhSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRwCfyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIR0gDiEPCyADIBpqIAEgG0ECdGoiDigCBCAcbCAOKAIAIB1saiAOKAIIIBlsaiAOKAIMIBhsaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAii7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshAgJ/IAUqAhi7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshByALIAxNAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEPQfj///8HIQpBiICAgHghDQ0CIAwhBQNAIAMgBUECdCIIaiABIAAgCGooAgBBBHRqIggoAgQgB2wgCCgCACAPbGogCCgCCCACbGoiCDYCACAIIAogCCAKSBshCiAIIA0gCCANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEFA0AgAyAFQQJ0IgFqAn8gAiAAIAFqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAVBAWoiBSALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIREgBSoCGCESIAUqAgghE0H4////ByEKQYiAgIB4IQ0gDCEFA0ACfyARIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCATIAIqAgCUIBIgAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIYaigCAEECdCIZaigCACIORwRAIAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSIRUgESAPKgIslCASIA8qAiiUIBMgDyoCIJQgFCAPKgIklJKSkiEWIBEgDyoCHJQgEiAPKgIYlCATIA8qAhCUIBQgDyoCFJSSkpIhFyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSIREgDiEPCyADIBhqAn8gFSABIBlBAnRqIg4qAgyUIBYgDioCCJQgESAOKgIAlCAXIA4qAgSUkpKSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIg42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gAkEBaiICIAtHDQALDAELQYiAgIB4IQ1B+P///wchCgsgCyAMSwRAIAlBAWuzIA2yIAqyk5UhESAMIQ0DQAJ/IBEgAyANQQJ0aiIBKAIAIAprspQiEotDAAAAT10EQCASqAwBC0GAgICAeAshDiABIA42AgAgBCAOQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhCgNAIAQgCkECdGoiASABKAIAIA1qIg02AgAgCkEBaiIKIAlHDQALCyAMQQBKBEAgDCEKA0AgBiAKQQFrIgFBAnQiAmogACACaigCADYCACAKQQFLIAEhCg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=\";\nfunction xp(e) {\n\tlet t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b;\n\tfunction x(y, x, S, C, w, T, E) {\n\t\tlet D = performance.now();\n\t\tif (!r && (new Uint32Array(n, s, w.byteLength / b.BytesPerInt).set(w), new Float32Array(n, u, E.byteLength / b.BytesPerFloat).set(E), C)) {\n\t\t\tlet e;\n\t\t\te = i ? new Int32Array(n, d, T.byteLength / b.BytesPerInt) : new Float32Array(n, d, T.byteLength / b.BytesPerFloat), e.set(T);\n\t\t}\n\t\tg ||= new Uint32Array(v), new Float32Array(n, h, 16).set(S), new Uint32Array(n, p, v).set(g), t.exports.sortIndexes(s, m, d, f, p, h, c, l, u, v, y, x, o, C, i, a);\n\t\tlet O = {\n\t\t\tsortDone: !0,\n\t\t\tsplatSortCount: y,\n\t\t\tsplatRenderCount: x,\n\t\t\tsortTime: 0\n\t\t};\n\t\tif (!r) {\n\t\t\tlet e = new Uint32Array(n, c, x);\n\t\t\t(!_ || _.length < x) && (_ = new Uint32Array(x)), _.set(e), O.sortedIndexes = _;\n\t\t}\n\t\tO.sortTime = performance.now() - D, e.postMessage(O);\n\t}\n\te.onmessage = (g) => {\n\t\tif (g.data.centers) centers = g.data.centers, sceneIndexes = g.data.sceneIndexes, i ? new Int32Array(n, m + g.data.range.from * b.BytesPerInt * 4, g.data.range.count * 4).set(new Int32Array(centers)) : new Float32Array(n, m + g.data.range.from * b.BytesPerFloat * 4, g.data.range.count * 4).set(new Float32Array(centers)), a && new Uint32Array(n, l + g.data.range.from * 4, g.data.range.count).set(new Uint32Array(sceneIndexes)), y = g.data.range.from + g.data.range.count;\n\t\telse if (g.data.sort) {\n\t\t\tlet e = Math.min(g.data.sort.splatRenderCount || 0, y), t = Math.min(g.data.sort.splatSortCount || 0, y), n = g.data.sort.usePrecomputedDistances, i, a, o;\n\t\t\tr || (i = g.data.sort.indexesToSort, o = g.data.sort.transforms, n && (a = g.data.sort.precomputedDistances)), x(t, e, g.data.sort.modelViewProj, n, i, a, o);\n\t\t} else if (g.data.init) {\n\t\t\tb = g.data.init.Constants, o = g.data.init.splatCount, r = g.data.init.useSharedMemory, i = g.data.init.integerBasedSort, a = g.data.init.dynamicMode, v = g.data.init.distanceMapRange, y = 0;\n\t\t\tlet _ = i ? b.BytesPerInt * 4 : b.BytesPerFloat * 4, x = new Uint8Array(g.data.init.sorterWasmBytes), S = 16 * b.BytesPerFloat, C = o * b.BytesPerInt, w = o * _, T = S, E = i ? o * b.BytesPerInt : o * b.BytesPerFloat, D = o * b.BytesPerInt, O = o * b.BytesPerInt, k = i ? v * b.BytesPerInt * 2 : v * b.BytesPerFloat * 2, A = a ? o * b.BytesPerInt : 0, j = a ? b.MaxScenes * S : 0, M = b.MemoryPageSize * 32, N = C + w + T + E + D + k + O + A + j + M, P = Math.floor(N / b.MemoryPageSize) + 1, F = {\n\t\t\t\tmodule: {},\n\t\t\t\tenv: { memory: new WebAssembly.Memory({\n\t\t\t\t\tinitial: P,\n\t\t\t\t\tmaximum: P,\n\t\t\t\t\tshared: !0\n\t\t\t\t}) }\n\t\t\t};\n\t\t\tWebAssembly.compile(x).then((e) => WebAssembly.instantiate(e, F)).then((i) => {\n\t\t\t\tt = i, s = 0, m = s + C, h = m + w, d = h + T, f = d + E, p = f + D, c = p + k, l = c + O, u = l + A, n = F.env.memory.buffer, r ? e.postMessage({\n\t\t\t\t\tsortSetupPhase1Complete: !0,\n\t\t\t\t\tindexesToSortBuffer: n,\n\t\t\t\t\tindexesToSortOffset: s,\n\t\t\t\t\tsortedIndexesBuffer: n,\n\t\t\t\t\tsortedIndexesOffset: c,\n\t\t\t\t\tprecomputedDistancesBuffer: n,\n\t\t\t\t\tprecomputedDistancesOffset: d,\n\t\t\t\t\ttransformsBuffer: n,\n\t\t\t\t\ttransformsOffset: u\n\t\t\t\t}) : e.postMessage({ sortSetupPhase1Complete: !0 });\n\t\t\t});\n\t\t}\n\t};\n}\nfunction Sp(e, t, n, r, i, a = cu.DefaultSplatSortDistanceMapPrecision) {\n\tlet o = new Worker(URL.createObjectURL(new Blob([\n\t\t\"(\",\n\t\txp.toString(),\n\t\t\")(self)\"\n\t], { type: \"application/javascript\" }))), s = _p, c = au() ? ou() : null;\n\t!n && !t ? (s = vp, c && c.major <= 16 && c.minor < 4 && (s = bp)) : n ? t || c && c.major <= 16 && c.minor < 4 && (s = yp) : s = vp;\n\tlet l = atob(s), u = new Uint8Array(l.length);\n\tfor (let e = 0; e < l.length; e++) u[e] = l.charCodeAt(e);\n\treturn o.postMessage({ init: {\n\t\tsorterWasmBytes: u.buffer,\n\t\tsplatCount: e,\n\t\tuseSharedMemory: t,\n\t\tintegerBasedSort: r,\n\t\tdynamicMode: i,\n\t\tdistanceMapRange: 1 << a,\n\t\tConstants: {\n\t\t\tBytesPerFloat: cu.BytesPerFloat,\n\t\t\tBytesPerInt: cu.BytesPerInt,\n\t\t\tMemoryPageSize: cu.MemoryPageSize,\n\t\t\tMaxScenes: cu.MaxScenes\n\t\t}\n\t} }), o;\n}\nvar Cp = {\n\tNone: 0,\n\tVR: 1,\n\tAR: 2\n}, wp = class e {\n\tstatic createButton(t, n = {}) {\n\t\tlet r = document.createElement(\"button\");\n\t\tfunction i() {\n\t\t\tlet e = null;\n\t\t\tasync function i(n) {\n\t\t\t\tn.addEventListener(\"end\", a), await t.xr.setSession(n), r.textContent = \"EXIT VR\", e = n;\n\t\t\t}\n\t\t\tfunction a() {\n\t\t\t\te.removeEventListener(\"end\", a), r.textContent = \"ENTER VR\", e = null;\n\t\t\t}\n\t\t\tr.style.display = \"\", r.style.cursor = \"pointer\", r.style.left = \"calc(50% - 50px)\", r.style.width = \"100px\", r.textContent = \"ENTER VR\";\n\t\t\tlet o = {\n\t\t\t\t...n,\n\t\t\t\toptionalFeatures: [\n\t\t\t\t\t\"local-floor\",\n\t\t\t\t\t\"bounded-floor\",\n\t\t\t\t\t\"layers\",\n\t\t\t\t\t...n.optionalFeatures || []\n\t\t\t\t]\n\t\t\t};\n\t\t\tr.onmouseenter = function() {\n\t\t\t\tr.style.opacity = \"1.0\";\n\t\t\t}, r.onmouseleave = function() {\n\t\t\t\tr.style.opacity = \"0.5\";\n\t\t\t}, r.onclick = function() {\n\t\t\t\te === null ? navigator.xr.requestSession(\"immersive-vr\", o).then(i) : (e.end(), navigator.xr.offerSession !== void 0 && navigator.xr.offerSession(\"immersive-vr\", o).then(i).catch((e) => {\n\t\t\t\t\tconsole.warn(e);\n\t\t\t\t}));\n\t\t\t}, navigator.xr.offerSession !== void 0 && navigator.xr.offerSession(\"immersive-vr\", o).then(i).catch((e) => {\n\t\t\t\tconsole.warn(e);\n\t\t\t});\n\t\t}\n\t\tfunction a() {\n\t\t\tr.style.display = \"\", r.style.cursor = \"auto\", r.style.left = \"calc(50% - 75px)\", r.style.width = \"150px\", r.onmouseenter = null, r.onmouseleave = null, r.onclick = null;\n\t\t}\n\t\tfunction o() {\n\t\t\ta(), r.textContent = \"VR NOT SUPPORTED\";\n\t\t}\n\t\tfunction s(e) {\n\t\t\ta(), console.warn(\"Exception when trying to call xr.isSessionSupported\", e), r.textContent = \"VR NOT ALLOWED\";\n\t\t}\n\t\tfunction c(e) {\n\t\t\te.style.position = \"absolute\", e.style.bottom = \"20px\", e.style.padding = \"12px 6px\", e.style.border = \"1px solid #fff\", e.style.borderRadius = \"4px\", e.style.background = \"rgba(0,0,0,0.1)\", e.style.color = \"#fff\", e.style.font = \"normal 13px sans-serif\", e.style.textAlign = \"center\", e.style.opacity = \"0.5\", e.style.outline = \"none\", e.style.zIndex = \"999\";\n\t\t}\n\t\tif (\"xr\" in navigator) return r.id = \"VRButton\", r.style.display = \"none\", c(r), navigator.xr.isSessionSupported(\"immersive-vr\").then(function(t) {\n\t\t\tt ? i() : o(), t && e.xrSessionIsGranted && r.click();\n\t\t}).catch(s), r;\n\t\t{\n\t\t\tlet e = document.createElement(\"a\");\n\t\t\treturn window.isSecureContext === !1 ? (e.href = document.location.href.replace(/^http:/, \"https:\"), e.innerHTML = \"WEBXR NEEDS HTTPS\") : (e.href = \"https://immersiveweb.dev/\", e.innerHTML = \"WEBXR NOT AVAILABLE\"), e.style.left = \"calc(50% - 90px)\", e.style.width = \"180px\", e.style.textDecoration = \"none\", c(e), e;\n\t\t}\n\t}\n\tstatic registerSessionGrantedListener() {\n\t\tif (typeof navigator < \"u\" && \"xr\" in navigator) {\n\t\t\tif (/WebXRViewer\\//i.test(navigator.userAgent)) return;\n\t\t\tnavigator.xr.addEventListener(\"sessiongranted\", () => {\n\t\t\t\te.xrSessionIsGranted = !0;\n\t\t\t});\n\t\t}\n\t}\n};\nwp.xrSessionIsGranted = !1, wp.registerSessionGrantedListener();\nvar Tp = class {\n\tstatic createButton(e, t = {}) {\n\t\tlet n = document.createElement(\"button\");\n\t\tfunction r() {\n\t\t\tif (t.domOverlay === void 0) {\n\t\t\t\tlet e = document.createElement(\"div\");\n\t\t\t\te.style.display = \"none\", document.body.appendChild(e);\n\t\t\t\tlet n = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\t\t\t\tn.setAttribute(\"width\", 38), n.setAttribute(\"height\", 38), n.style.position = \"absolute\", n.style.right = \"20px\", n.style.top = \"20px\", n.addEventListener(\"click\", function() {\n\t\t\t\t\tr.end();\n\t\t\t\t}), e.appendChild(n);\n\t\t\t\tlet i = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\");\n\t\t\t\ti.setAttribute(\"d\", \"M 12,12 L 28,28 M 28,12 12,28\"), i.setAttribute(\"stroke\", \"#fff\"), i.setAttribute(\"stroke-width\", 2), n.appendChild(i), t.optionalFeatures === void 0 && (t.optionalFeatures = []), t.optionalFeatures.push(\"dom-overlay\"), t.domOverlay = { root: e };\n\t\t\t}\n\t\t\tlet r = null;\n\t\t\tasync function i(i) {\n\t\t\t\ti.addEventListener(\"end\", a), e.xr.setReferenceSpaceType(\"local\"), await e.xr.setSession(i), n.textContent = \"STOP AR\", t.domOverlay.root.style.display = \"\", r = i;\n\t\t\t}\n\t\t\tfunction a() {\n\t\t\t\tr.removeEventListener(\"end\", a), n.textContent = \"START AR\", t.domOverlay.root.style.display = \"none\", r = null;\n\t\t\t}\n\t\t\tn.style.display = \"\", n.style.cursor = \"pointer\", n.style.left = \"calc(50% - 50px)\", n.style.width = \"100px\", n.textContent = \"START AR\", n.onmouseenter = function() {\n\t\t\t\tn.style.opacity = \"1.0\";\n\t\t\t}, n.onmouseleave = function() {\n\t\t\t\tn.style.opacity = \"0.5\";\n\t\t\t}, n.onclick = function() {\n\t\t\t\tr === null ? navigator.xr.requestSession(\"immersive-ar\", t).then(i) : (r.end(), navigator.xr.offerSession !== void 0 && navigator.xr.offerSession(\"immersive-ar\", t).then(i).catch((e) => {\n\t\t\t\t\tconsole.warn(e);\n\t\t\t\t}));\n\t\t\t}, navigator.xr.offerSession !== void 0 && navigator.xr.offerSession(\"immersive-ar\", t).then(i).catch((e) => {\n\t\t\t\tconsole.warn(e);\n\t\t\t});\n\t\t}\n\t\tfunction i() {\n\t\t\tn.style.display = \"\", n.style.cursor = \"auto\", n.style.left = \"calc(50% - 75px)\", n.style.width = \"150px\", n.onmouseenter = null, n.onmouseleave = null, n.onclick = null;\n\t\t}\n\t\tfunction a() {\n\t\t\ti(), n.textContent = \"AR NOT SUPPORTED\";\n\t\t}\n\t\tfunction o(e) {\n\t\t\ti(), console.warn(\"Exception when trying to call xr.isSessionSupported\", e), n.textContent = \"AR NOT ALLOWED\";\n\t\t}\n\t\tfunction s(e) {\n\t\t\te.style.position = \"absolute\", e.style.bottom = \"20px\", e.style.padding = \"12px 6px\", e.style.border = \"1px solid #fff\", e.style.borderRadius = \"4px\", e.style.background = \"rgba(0,0,0,0.1)\", e.style.color = \"#fff\", e.style.font = \"normal 13px sans-serif\", e.style.textAlign = \"center\", e.style.opacity = \"0.5\", e.style.outline = \"none\", e.style.zIndex = \"999\";\n\t\t}\n\t\tif (\"xr\" in navigator) return n.id = \"ARButton\", n.style.display = \"none\", s(n), navigator.xr.isSessionSupported(\"immersive-ar\").then(function(e) {\n\t\t\te ? r() : a();\n\t\t}).catch(o), n;\n\t\t{\n\t\t\tlet e = document.createElement(\"a\");\n\t\t\treturn window.isSecureContext === !1 ? (e.href = document.location.href.replace(/^http:/, \"https:\"), e.innerHTML = \"WEBXR NEEDS HTTPS\") : (e.href = \"https://immersiveweb.dev/\", e.innerHTML = \"WEBXR NOT AVAILABLE\"), e.style.left = \"calc(50% - 90px)\", e.style.width = \"180px\", e.style.textDecoration = \"none\", s(e), e;\n\t\t}\n\t}\n}, Ep = {\n\tAlways: 0,\n\tOnChange: 1,\n\tNever: 2\n}, Dp = 50, Op = .75, kp = 15e5, Ap = 10, jp = 2.5, Mp = 60, Np = class e {\n\tconstructor(e = {}) {\n\t\tif (e.cameraUp ||= [\n\t\t\t0,\n\t\t\t1,\n\t\t\t0\n\t\t], this.cameraUp = new K().fromArray(e.cameraUp), e.initialCameraPosition ||= [\n\t\t\t0,\n\t\t\t10,\n\t\t\t15\n\t\t], this.initialCameraPosition = new K().fromArray(e.initialCameraPosition), e.initialCameraLookAt ||= [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t], this.initialCameraLookAt = new K().fromArray(e.initialCameraLookAt), this.dropInMode = e.dropInMode || !1, (e.selfDrivenMode === void 0 || e.selfDrivenMode === null) && (e.selfDrivenMode = !0), this.selfDrivenMode = e.selfDrivenMode && !this.dropInMode, this.selfDrivenUpdateFunc = this.selfDrivenUpdate.bind(this), e.useBuiltInControls === void 0 && (e.useBuiltInControls = !0), this.useBuiltInControls = e.useBuiltInControls, this.rootElement = e.rootElement, this.ignoreDevicePixelRatio = e.ignoreDevicePixelRatio || !1, this.devicePixelRatio = this.ignoreDevicePixelRatio ? 1 : window.devicePixelRatio || 1, this.halfPrecisionCovariancesOnGPU = e.halfPrecisionCovariancesOnGPU || !1, this.threeScene = e.threeScene, this.renderer = e.renderer, this.camera = e.camera, this.gpuAcceleratedSort = e.gpuAcceleratedSort || !1, (e.integerBasedSort === void 0 || e.integerBasedSort === null) && (e.integerBasedSort = !0), this.integerBasedSort = e.integerBasedSort, (e.sharedMemoryForWorkers === void 0 || e.sharedMemoryForWorkers === null) && (e.sharedMemoryForWorkers = !0), this.sharedMemoryForWorkers = e.sharedMemoryForWorkers, this.dynamicScene = !!e.dynamicScene, this.antialiased = e.antialiased || !1, this.kernel2DSize = e.kernel2DSize === void 0 ? .3 : e.kernel2DSize, this.webXRMode = e.webXRMode || Cp.None, this.webXRMode !== Cp.None && (this.gpuAcceleratedSort = !1), this.webXRActive = !1, this.webXRSessionInit = e.webXRSessionInit || {}, this.renderMode = e.renderMode || Ep.Always, this.sceneRevealMode = e.sceneRevealMode || $f.Default, this.focalAdjustment = e.focalAdjustment || 1, this.maxScreenSpaceSplatSize = e.maxScreenSpaceSplatSize || 1024, this.logLevel = e.logLevel || ep.None, this.sphericalHarmonicsDegree = e.sphericalHarmonicsDegree || 0, this.enableOptionalEffects = e.enableOptionalEffects || !1, (e.enableSIMDInSort === void 0 || e.enableSIMDInSort === null) && (e.enableSIMDInSort = !0), this.enableSIMDInSort = e.enableSIMDInSort, (e.inMemoryCompressionLevel === void 0 || e.inMemoryCompressionLevel === null) && (e.inMemoryCompressionLevel = 0), this.inMemoryCompressionLevel = e.inMemoryCompressionLevel, (e.optimizeSplatData === void 0 || e.optimizeSplatData === null) && (e.optimizeSplatData = !0), this.optimizeSplatData = e.optimizeSplatData, (e.freeIntermediateSplatData === void 0 || e.freeIntermediateSplatData === null) && (e.freeIntermediateSplatData = !1), this.freeIntermediateSplatData = e.freeIntermediateSplatData, au()) {\n\t\t\tlet e = ou();\n\t\t\te.major < 17 && (this.enableSIMDInSort = !1), e.major < 16 && (this.sharedMemoryForWorkers = !1);\n\t\t}\n\t\t(e.splatRenderMode === void 0 || e.splatRenderMode === null) && (e.splatRenderMode = Rf.ThreeD), this.splatRenderMode = e.splatRenderMode, this.sceneFadeInRateMultiplier = e.sceneFadeInRateMultiplier || 1, this.splatSortDistanceMapPrecision = e.splatSortDistanceMapPrecision || cu.DefaultSplatSortDistanceMapPrecision;\n\t\tlet t = this.integerBasedSort ? 20 : 24;\n\t\tthis.splatSortDistanceMapPrecision = Zl(this.splatSortDistanceMapPrecision, 10, t), this.onSplatMeshChangedCallback = null, this.createSplatMesh(), this.controls = null, this.perspectiveControls = null, this.orthographicControls = null, this.orthographicCamera = null, this.perspectiveCamera = null, this.showMeshCursor = !1, this.showControlPlane = !1, this.showInfo = !1, this.sceneHelper = null, this.sortWorker = null, this.sortRunning = !1, this.splatRenderCount = 0, this.splatSortCount = 0, this.lastSplatSortCount = 0, this.sortWorkerIndexesToSort = null, this.sortWorkerSortedIndexes = null, this.sortWorkerPrecomputedDistances = null, this.sortWorkerTransforms = null, this.preSortMessages = [], this.runAfterNextSort = [], this.selfDrivenModeRunning = !1, this.splatRenderReady = !1, this.raycaster = new zf(), this.infoPanel = null, this.startInOrthographicMode = !1, this.currentFPS = 0, this.lastSortTime = 0, this.consecutiveRenderFrames = 0, this.previousCameraTarget = new K(), this.nextCameraTarget = new K(), this.mousePosition = new G(), this.mouseDownPosition = new G(), this.mouseDownTime = null, this.resizeObserver = null, this.mouseMoveListener = null, this.mouseDownListener = null, this.mouseUpListener = null, this.keyDownListener = null, this.sortPromise = null, this.sortPromiseResolver = null, this.splatSceneDownloadPromises = {}, this.splatSceneDownloadAndBuildPromise = null, this.splatSceneRemovalPromise = null, this.loadingSpinner = new Df(null, this.rootElement || document.body), this.loadingSpinner.hide(), this.loadingProgressBar = new Of(this.rootElement || document.body), this.loadingProgressBar.hide(), this.infoPanel = new kf(this.rootElement || document.body), this.infoPanel.hide(), this.usingExternalCamera = !!(this.dropInMode || this.camera), this.usingExternalRenderer = !!(this.dropInMode || this.renderer), this.initialized = !1, this.disposing = !1, this.disposed = !1, this.disposePromise = null, this.dropInMode || this.init();\n\t}\n\tcreateSplatMesh() {\n\t\tthis.splatMesh = new gp(this.splatRenderMode, this.dynamicScene, this.enableOptionalEffects, this.halfPrecisionCovariancesOnGPU, this.devicePixelRatio, this.gpuAcceleratedSort, this.integerBasedSort, this.antialiased, this.maxScreenSpaceSplatSize, this.logLevel, this.sphericalHarmonicsDegree, this.sceneFadeInRateMultiplier, this.kernel2DSize), this.splatMesh.frustumCulled = !1, this.onSplatMeshChangedCallback && this.onSplatMeshChangedCallback();\n\t}\n\tinit() {\n\t\tthis.initialized ||= (this.rootElement || (this.usingExternalRenderer ? this.rootElement = this.renderer.domElement || document.body : (this.rootElement = document.createElement(\"div\"), this.rootElement.style.width = \"100%\", this.rootElement.style.height = \"100%\", this.rootElement.style.position = \"absolute\", document.body.appendChild(this.rootElement))), this.setupCamera(), this.setupRenderer(), this.setupWebXR(this.webXRSessionInit), this.setupControls(), this.setupEventHandlers(), this.threeScene = this.threeScene || new mr(), this.sceneHelper = new Mf(this.threeScene), this.sceneHelper.setupMeshCursor(), this.sceneHelper.setupFocusMarker(), this.sceneHelper.setupControlPlane(), this.loadingProgressBar.setContainer(this.rootElement), this.loadingSpinner.setContainer(this.rootElement), this.infoPanel.setContainer(this.rootElement), !0);\n\t}\n\tsetupCamera() {\n\t\tif (!this.usingExternalCamera) {\n\t\t\tlet e = new G();\n\t\t\tthis.getRenderDimensions(e), this.perspectiveCamera = new La(Dp, e.x / e.y, .1, 1e3), this.orthographicCamera = new Ra(e.x / -2, e.x / 2, e.y / 2, e.y / -2, .1, 1e3), this.camera = this.startInOrthographicMode ? this.orthographicCamera : this.perspectiveCamera, this.camera.position.copy(this.initialCameraPosition), this.camera.up.copy(this.cameraUp).normalize(), this.camera.lookAt(this.initialCameraLookAt);\n\t\t}\n\t}\n\tsetupRenderer() {\n\t\tif (!this.usingExternalRenderer) {\n\t\t\tlet e = new G();\n\t\t\tthis.getRenderDimensions(e), this.renderer = new Sl({\n\t\t\t\tantialias: !1,\n\t\t\t\tprecision: \"highp\"\n\t\t\t}), this.renderer.setPixelRatio(this.devicePixelRatio), this.renderer.autoClear = !0, this.renderer.setClearColor(new fr(0), 0), this.renderer.setSize(e.x, e.y), this.resizeObserver = new ResizeObserver(() => {\n\t\t\t\tthis.getRenderDimensions(e), this.renderer.setSize(e.x, e.y), this.forceRenderNextFrame();\n\t\t\t}), this.resizeObserver.observe(this.rootElement), this.rootElement.appendChild(this.renderer.domElement);\n\t\t}\n\t}\n\tsetupWebXR(e) {\n\t\tthis.webXRMode && (this.webXRMode === Cp.VR ? this.rootElement.appendChild(wp.createButton(this.renderer, e)) : this.webXRMode === Cp.AR && this.rootElement.appendChild(Tp.createButton(this.renderer, e)), this.renderer.xr.addEventListener(\"sessionstart\", (e) => {\n\t\t\tthis.webXRActive = !0;\n\t\t}), this.renderer.xr.addEventListener(\"sessionend\", (e) => {\n\t\t\tthis.webXRActive = !1;\n\t\t}), this.renderer.xr.enabled = !0, this.camera.position.copy(this.initialCameraPosition), this.camera.up.copy(this.cameraUp).normalize(), this.camera.lookAt(this.initialCameraLookAt));\n\t}\n\tsetupControls() {\n\t\tif (this.useBuiltInControls && this.webXRMode === Cp.None) {\n\t\t\tthis.usingExternalCamera ? this.camera.isOrthographicCamera ? this.orthographicControls = new wf(this.camera, this.renderer.domElement) : this.perspectiveControls = new wf(this.camera, this.renderer.domElement) : (this.perspectiveControls = new wf(this.perspectiveCamera, this.renderer.domElement), this.orthographicControls = new wf(this.orthographicCamera, this.renderer.domElement));\n\t\t\tfor (let e of [this.orthographicControls, this.perspectiveControls]) e && (e.listenToKeyEvents(window), e.rotateSpeed = .5, e.maxPolarAngle = Math.PI * .75, e.minPolarAngle = .1, e.enableDamping = !0, e.dampingFactor = .05, e.target.copy(this.initialCameraLookAt), e.update());\n\t\t\tthis.controls = this.camera.isOrthographicCamera ? this.orthographicControls : this.perspectiveControls, this.controls.update();\n\t\t}\n\t}\n\tsetupEventHandlers() {\n\t\tthis.useBuiltInControls && this.webXRMode === Cp.None && (this.mouseMoveListener = this.onMouseMove.bind(this), this.renderer.domElement.addEventListener(\"pointermove\", this.mouseMoveListener, !1), this.mouseDownListener = this.onMouseDown.bind(this), this.renderer.domElement.addEventListener(\"pointerdown\", this.mouseDownListener, !1), this.mouseUpListener = this.onMouseUp.bind(this), this.renderer.domElement.addEventListener(\"pointerup\", this.mouseUpListener, !1), this.keyDownListener = this.onKeyDown.bind(this), window.addEventListener(\"keydown\", this.keyDownListener, !1));\n\t}\n\tremoveEventHandlers() {\n\t\tthis.useBuiltInControls && (this.renderer.domElement.removeEventListener(\"pointermove\", this.mouseMoveListener), this.mouseMoveListener = null, this.renderer.domElement.removeEventListener(\"pointerdown\", this.mouseDownListener), this.mouseDownListener = null, this.renderer.domElement.removeEventListener(\"pointerup\", this.mouseUpListener), this.mouseUpListener = null, window.removeEventListener(\"keydown\", this.keyDownListener), this.keyDownListener = null);\n\t}\n\tsetRenderMode(e) {\n\t\tthis.renderMode = e;\n\t}\n\tsetActiveSphericalHarmonicsDegrees(e) {\n\t\tthis.splatMesh.material.uniforms.sphericalHarmonicsDegree.value = e, this.splatMesh.material.uniformsNeedUpdate = !0;\n\t}\n\tonSplatMeshChanged(e) {\n\t\tthis.onSplatMeshChangedCallback = e;\n\t}\n\tonKeyDown = function() {\n\t\tlet e = new K(), t = new J(), n = new J();\n\t\treturn function(r) {\n\t\t\tswitch (e.set(0, 0, -1), e.transformDirection(this.camera.matrixWorld), t.makeRotationAxis(e, Math.PI / 128), n.makeRotationAxis(e, -Math.PI / 128), r.code) {\n\t\t\t\tcase \"KeyG\":\n\t\t\t\t\tthis.focalAdjustment += .02, this.forceRenderNextFrame();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KeyF\":\n\t\t\t\t\tthis.focalAdjustment -= .02, this.forceRenderNextFrame();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"ArrowLeft\":\n\t\t\t\t\tthis.camera.up.transformDirection(t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"ArrowRight\":\n\t\t\t\t\tthis.camera.up.transformDirection(n);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KeyC\":\n\t\t\t\t\tthis.showMeshCursor = !this.showMeshCursor;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KeyU\":\n\t\t\t\t\tthis.showControlPlane = !this.showControlPlane;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KeyI\":\n\t\t\t\t\tthis.showInfo = !this.showInfo, this.showInfo ? this.infoPanel.show() : this.infoPanel.hide();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KeyO\":\n\t\t\t\t\tthis.usingExternalCamera || this.setOrthographicMode(!this.camera.isOrthographicCamera);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KeyP\":\n\t\t\t\t\tthis.usingExternalCamera || this.splatMesh.setPointCloudModeEnabled(!this.splatMesh.getPointCloudModeEnabled());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Equal\":\n\t\t\t\t\tthis.usingExternalCamera || this.splatMesh.setSplatScale(this.splatMesh.getSplatScale() + .05);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Minus\": this.usingExternalCamera || this.splatMesh.setSplatScale(Math.max(this.splatMesh.getSplatScale() - .05, 0));\n\t\t\t}\n\t\t};\n\t}();\n\tonMouseMove(e) {\n\t\tthis.mousePosition.set(e.offsetX, e.offsetY);\n\t}\n\tonMouseDown() {\n\t\tthis.mouseDownPosition.copy(this.mousePosition), this.mouseDownTime = Ql();\n\t}\n\tonMouseUp = function() {\n\t\tlet e = new G();\n\t\treturn function(t) {\n\t\t\te.copy(this.mousePosition).sub(this.mouseDownPosition), Ql() - this.mouseDownTime < .5 && e.length() < 2 && this.onMouseClick(t);\n\t\t};\n\t}();\n\tonMouseClick(e) {\n\t\tthis.mousePosition.set(e.offsetX, e.offsetY), this.checkForFocalPointChange();\n\t}\n\tcheckForFocalPointChange = function() {\n\t\tlet e = new G(), t = new K(), n = [];\n\t\treturn function() {\n\t\t\tif (!this.transitioningCameraTarget && (this.getRenderDimensions(e), n.length = 0, this.raycaster.setFromCameraAndScreenPosition(this.camera, this.mousePosition, e), this.raycaster.intersectSplatMesh(this.splatMesh, n), n.length > 0)) {\n\t\t\t\tlet e = n[0].origin;\n\t\t\t\tt.copy(e).sub(this.camera.position), t.length() > Op && (this.previousCameraTarget.copy(this.controls.target), this.nextCameraTarget.copy(e), this.transitioningCameraTarget = !0, this.transitioningCameraTargetStartTime = Ql());\n\t\t\t}\n\t\t};\n\t}();\n\tgetRenderDimensions(e) {\n\t\tthis.rootElement ? (e.x = this.rootElement.offsetWidth, e.y = this.rootElement.offsetHeight) : this.renderer.getSize(e);\n\t}\n\tsetOrthographicMode(t) {\n\t\tif (t === this.camera.isOrthographicCamera) return;\n\t\tlet n = this.camera, r = t ? this.orthographicCamera : this.perspectiveCamera;\n\t\tif (r.position.copy(n.position), r.up.copy(n.up), r.rotation.copy(n.rotation), r.quaternion.copy(n.quaternion), r.matrix.copy(n.matrix), this.camera = r, this.controls) {\n\t\t\tlet i = (e) => {\n\t\t\t\te.saveState(), e.reset();\n\t\t\t}, a = this.controls, o = t ? this.orthographicControls : this.perspectiveControls;\n\t\t\ti(o), i(a), o.target.copy(a.target), t ? e.setCameraZoomFromPosition(r, n, a) : e.setCameraPositionFromZoom(r, n, o), this.controls = o, this.camera.lookAt(this.controls.target);\n\t\t}\n\t}\n\tstatic setCameraPositionFromZoom = function() {\n\t\tlet e = new K();\n\t\treturn function(t, n, r) {\n\t\t\tlet i = 1 / (n.zoom * .001);\n\t\t\te.copy(r.target).sub(t.position).normalize().multiplyScalar(i).negate(), t.position.copy(r.target).add(e);\n\t\t};\n\t}();\n\tstatic setCameraZoomFromPosition = function() {\n\t\tlet e = new K();\n\t\treturn function(t, n, r) {\n\t\t\tt.zoom = 1 / (e.copy(r.target).sub(n.position).length() * .001);\n\t\t};\n\t}();\n\tupdateSplatMesh = function() {\n\t\tlet e = new G();\n\t\treturn function() {\n\t\t\tif (this.splatMesh && this.splatMesh.getSplatCount() > 0) {\n\t\t\t\tthis.splatMesh.updateVisibleRegionFadeDistance(this.sceneRevealMode), this.splatMesh.updateTransforms(), this.getRenderDimensions(e);\n\t\t\t\tlet t = this.camera.projectionMatrix.elements[0] * .5 * this.devicePixelRatio * e.x, n = this.camera.projectionMatrix.elements[5] * .5 * this.devicePixelRatio * e.y, r = this.camera.isOrthographicCamera ? 1 / this.devicePixelRatio : 1, i = this.focalAdjustment * r, a = 1 / i;\n\t\t\t\tthis.adjustForWebXRStereo(e), this.splatMesh.updateUniforms(e, t * i, n * i, this.camera.isOrthographicCamera, this.camera.zoom || 1, a);\n\t\t\t}\n\t\t};\n\t}();\n\tadjustForWebXRStereo(e) {\n\t\tif (this.camera && this.webXRActive) {\n\t\t\tlet t = this.renderer.xr.getCamera().projectionMatrix.elements[0], n = this.camera.projectionMatrix.elements[0];\n\t\t\te.x *= n / t;\n\t\t}\n\t}\n\tisLoadingOrUnloading() {\n\t\treturn Object.keys(this.splatSceneDownloadPromises).length > 0 || this.splatSceneDownloadAndBuildPromise !== null || this.splatSceneRemovalPromise !== null;\n\t}\n\tisDisposingOrDisposed() {\n\t\treturn this.disposing || this.disposed;\n\t}\n\taddSplatSceneDownloadPromise(e) {\n\t\tthis.splatSceneDownloadPromises[e.id] = e;\n\t}\n\tremoveSplatSceneDownloadPromise(e) {\n\t\tdelete this.splatSceneDownloadPromises[e.id];\n\t}\n\tsetSplatSceneDownloadAndBuildPromise(e) {\n\t\tthis.splatSceneDownloadAndBuildPromise = e;\n\t}\n\tclearSplatSceneDownloadAndBuildPromise() {\n\t\tthis.splatSceneDownloadAndBuildPromise = null;\n\t}\n\taddSplatScene(t, n = {}) {\n\t\tif (this.isLoadingOrUnloading()) throw Error(\"Cannot add splat scene while another load or unload is already in progress.\");\n\t\tif (this.isDisposingOrDisposed()) throw Error(\"Cannot add splat scene after dispose() is called.\");\n\t\tn.progressiveLoad && this.splatMesh.scenes && this.splatMesh.scenes.length > 0 && (console.log(\"addSplatScene(): \\\"progressiveLoad\\\" option ignore because there are multiple splat scenes\"), n.progressiveLoad = !1);\n\t\tlet r = n.format !== void 0 && n.format !== null ? n.format : _f(t), i = e.isProgressivelyLoadable(r) && n.progressiveLoad, a = n.showLoadingUI !== void 0 && n.showLoadingUI !== null ? n.showLoadingUI : !0, o = null;\n\t\ta && (this.loadingSpinner.removeAllTasks(), o = this.loadingSpinner.addTask(\"Downloading...\"));\n\t\tlet s = () => {\n\t\t\tthis.loadingProgressBar.hide(), this.loadingSpinner.removeAllTasks();\n\t\t}, c = (e, t, n) => {\n\t\t\tif (a) {\n\t\t\t\tif (n === Hd.Downloading) {\n\t\t\t\t\tif (e == 100) this.loadingSpinner.setMessageForTask(o, \"Download complete!\");\n\t\t\t\t\telse if (i) this.loadingSpinner.setMessageForTask(o, \"Downloading splats...\");\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet e = t ? `: ${t}` : \"...\";\n\t\t\t\t\t\tthis.loadingSpinner.setMessageForTask(o, `Downloading${e}`);\n\t\t\t\t\t}\n\t\t\t\t} else n === Hd.Processing && this.loadingSpinner.setMessageForTask(o, \"Processing splats...\");\n\t\t\t}\n\t\t}, l = !1, u = 0, d = (e, t) => {\n\t\t\ta && ((e && i || t && !i) && (this.loadingSpinner.removeTask(o), !t && !l && this.loadingProgressBar.show()), i && (t ? (l = !0, this.loadingProgressBar.hide()) : this.loadingProgressBar.setProgress(u)));\n\t\t};\n\t\treturn (i ? this.downloadAndBuildSingleSplatSceneProgressiveLoad.bind(this) : this.downloadAndBuildSingleSplatSceneStandardLoad.bind(this))(t, r, n.splatAlphaRemovalThreshold, ((e, t, r) => {\n\t\t\t!i && n.onProgress && n.onProgress(0, \"0%\", Hd.Processing);\n\t\t\tlet o = {\n\t\t\t\trotation: n.rotation || n.orientation,\n\t\t\t\tposition: n.position,\n\t\t\t\tscale: n.scale,\n\t\t\t\tsplatAlphaRemovalThreshold: n.splatAlphaRemovalThreshold\n\t\t\t};\n\t\t\treturn this.addSplatBuffers([e], [o], r, t && a, a, i, i).then(() => {\n\t\t\t\t!i && n.onProgress && n.onProgress(100, \"100%\", Hd.Processing), d(t, r);\n\t\t\t});\n\t\t}).bind(this), (e, t, r) => {\n\t\t\tu = e, c(e, t, r), n.onProgress && n.onProgress(e, t, r);\n\t\t}, s.bind(this), n.headers);\n\t}\n\tdownloadAndBuildSingleSplatSceneStandardLoad(e, t, n, r, i, a, o) {\n\t\tlet s = this.downloadSplatSceneToSplatBuffer(e, n, i, !1, void 0, t, o), c = ru(s.abortHandler);\n\t\treturn s.then((e) => (this.removeSplatSceneDownloadPromise(s), r(e, !0, !0).then(() => {\n\t\t\tc.resolve(), this.clearSplatSceneDownloadAndBuildPromise();\n\t\t}))).catch((t) => {\n\t\t\ta && a(), this.clearSplatSceneDownloadAndBuildPromise(), this.removeSplatSceneDownloadPromise(s), c.reject(this.updateError(t, `Viewer::addSplatScene -> Could not load file ${e}`));\n\t\t}), this.addSplatSceneDownloadPromise(s), this.setSplatSceneDownloadAndBuildPromise(c.promise), c.promise;\n\t}\n\tdownloadAndBuildSingleSplatSceneProgressiveLoad(e, t, n, r, i, a, o) {\n\t\tlet s = 0, c = !1, l = [], u = () => {\n\t\t\tif (l.length > 0 && !c && !this.isDisposingOrDisposed()) {\n\t\t\t\tc = !0;\n\t\t\t\tlet e = l.shift();\n\t\t\t\tr(e.splatBuffer, e.firstBuild, e.finalBuild).then(() => {\n\t\t\t\t\tc = !1, e.firstBuild ? f.resolve() : e.finalBuild && (p.resolve(), this.clearSplatSceneDownloadAndBuildPromise()), l.length > 0 && eu(() => u());\n\t\t\t\t});\n\t\t\t}\n\t\t}, d = this.downloadSplatSceneToSplatBuffer(e, n, i, !0, (e, t) => {\n\t\t\tthis.isDisposingOrDisposed() || (t || l.length === 0 || e.getSplatCount() > l[0].splatBuffer.getSplatCount()) && (l.push({\n\t\t\t\tsplatBuffer: e,\n\t\t\t\tfirstBuild: s === 0,\n\t\t\t\tfinalBuild: t\n\t\t\t}), s++, u());\n\t\t}, t, o), f = ru(d.abortHandler), p = ru();\n\t\treturn this.addSplatSceneDownloadPromise(d), this.setSplatSceneDownloadAndBuildPromise(p.promise), d.then(() => {\n\t\t\tthis.removeSplatSceneDownloadPromise(d);\n\t\t}).catch((e) => {\n\t\t\tthis.clearSplatSceneDownloadAndBuildPromise(), this.removeSplatSceneDownloadPromise(d);\n\t\t\tlet t = this.updateError(e, \"Viewer::addSplatScene -> Could not load one or more scenes\");\n\t\t\tf.reject(t), a && a(t);\n\t\t}), f.promise;\n\t}\n\taddSplatScenes(e, t = !0, n = void 0) {\n\t\tif (this.isLoadingOrUnloading()) throw Error(\"Cannot add splat scene while another load or unload is already in progress.\");\n\t\tif (this.isDisposingOrDisposed()) throw Error(\"Cannot add splat scene after dispose() is called.\");\n\t\tlet r = e.length, i = [], a;\n\t\tt && (this.loadingSpinner.removeAllTasks(), a = this.loadingSpinner.addTask(\"Downloading...\"));\n\t\tlet o = (e, o, s, c) => {\n\t\t\ti[e] = o;\n\t\t\tlet l = 0;\n\t\t\tfor (let e = 0; e < r; e++) l += i[e] || 0;\n\t\t\tl /= r, s = `${l.toFixed(2)}%`, t && c === Hd.Downloading && this.loadingSpinner.setMessageForTask(a, l == 100 ? \"Download complete!\" : `Downloading: ${s}`), n && n(l, s, c);\n\t\t}, s = [], c = [];\n\t\tfor (let t = 0; t < e.length; t++) {\n\t\t\tlet n = e[t], r = n.format !== void 0 && n.format !== null ? n.format : _f(n.path), i = this.downloadSplatSceneToSplatBuffer(n.path, n.splatAlphaRemovalThreshold, o.bind(this, t), !1, void 0, r, n.headers);\n\t\t\ts.push(i), c.push(i.promise);\n\t\t}\n\t\tlet l = new Kl((r, i) => {\n\t\t\tPromise.all(c).then((i) => {\n\t\t\t\tt && this.loadingSpinner.removeTask(a), n && n(0, \"0%\", Hd.Processing), this.addSplatBuffers(i, e, !0, t, t, !1, !1).then(() => {\n\t\t\t\t\tn && n(100, \"100%\", Hd.Processing), this.clearSplatSceneDownloadAndBuildPromise(), r();\n\t\t\t\t});\n\t\t\t}).catch((e) => {\n\t\t\t\tt && this.loadingSpinner.removeTask(a), this.clearSplatSceneDownloadAndBuildPromise(), i(this.updateError(e, \"Viewer::addSplatScenes -> Could not load one or more splat scenes.\"));\n\t\t\t}).finally(() => {\n\t\t\t\tthis.removeSplatSceneDownloadPromise(l);\n\t\t\t});\n\t\t}, (e) => {\n\t\t\tfor (let t of s) t.abort(e);\n\t\t});\n\t\treturn this.addSplatSceneDownloadPromise(l), this.setSplatSceneDownloadAndBuildPromise(l), l;\n\t}\n\tdownloadSplatSceneToSplatBuffer(e, t = 1, n = void 0, r = !1, i = void 0, a, o) {\n\t\ttry {\n\t\t\tif (a === gf.Splat || a === gf.KSplat || a === gf.Ply) {\n\t\t\t\tlet s = !r && this.optimizeSplatData;\n\t\t\t\tif (a === gf.Splat) return mf.loadFromURL(e, n, r, i, t, this.inMemoryCompressionLevel, s, o);\n\t\t\t\tif (a === gf.KSplat) return hf.loadFromURL(e, n, r, i, o);\n\t\t\t\tif (a === gf.Ply) return qd.loadFromURL(e, n, r, i, t, this.inMemoryCompressionLevel, s, this.sphericalHarmonicsDegree, o);\n\t\t\t} else if (a === gf.Spz) return df.loadFromURL(e, n, t, this.inMemoryCompressionLevel, this.optimizeSplatData, this.sphericalHarmonicsDegree, o);\n\t\t} catch (e) {\n\t\t\tthrow this.updateError(e, null);\n\t\t}\n\t\tthrow Error(`Viewer::downloadSplatSceneToSplatBuffer -> File format not supported: ${e}`);\n\t}\n\tstatic isProgressivelyLoadable(e) {\n\t\treturn e === gf.Splat || e === gf.KSplat || e === gf.Ply;\n\t}\n\taddSplatBuffers = function() {\n\t\treturn function(e, t = [], n = !0, r = !0, i = !0, a = !1, o = !1, s = !0) {\n\t\t\tif (this.isDisposingOrDisposed()) return Promise.resolve();\n\t\t\tlet c = null, l = () => {\n\t\t\t\tc !== null && (this.loadingSpinner.removeTask(c), c = null);\n\t\t\t};\n\t\t\treturn this.splatRenderReady = !1, new Promise((u) => {\n\t\t\t\tr && (c = this.loadingSpinner.addTask(\"Processing splats...\")), eu(() => {\n\t\t\t\t\tif (this.isDisposingOrDisposed()) u();\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet r = this.addSplatBuffersToMesh(e, t, n, i, a, s), c = this.splatMesh.getMaxSplatCount();\n\t\t\t\t\t\tthis.sortWorker && this.sortWorker.maxSplatCount !== c && this.disposeSortWorker(), this.gpuAcceleratedSort || this.preSortMessages.push({\n\t\t\t\t\t\t\tcenters: r.centers.buffer,\n\t\t\t\t\t\t\tsceneIndexes: r.sceneIndexes.buffer,\n\t\t\t\t\t\t\trange: {\n\t\t\t\t\t\t\t\tfrom: r.from,\n\t\t\t\t\t\t\t\tto: r.to,\n\t\t\t\t\t\t\t\tcount: r.count\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}), (!this.sortWorker && c > 0 ? this.setupSortWorker(this.splatMesh) : Promise.resolve()).then(() => {\n\t\t\t\t\t\t\tthis.isDisposingOrDisposed() || this.runSplatSort(!0, !0).then((e) => {\n\t\t\t\t\t\t\t\t!this.sortWorker || !e ? (this.splatRenderReady = !0, l(), u()) : (o ? this.splatRenderReady = !0 : this.runAfterNextSort.push(() => {\n\t\t\t\t\t\t\t\t\tthis.splatRenderReady = !0;\n\t\t\t\t\t\t\t\t}), this.runAfterNextSort.push(() => {\n\t\t\t\t\t\t\t\t\tl(), u();\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}, !0);\n\t\t\t});\n\t\t};\n\t}();\n\taddSplatBuffersToMesh = function() {\n\t\tlet e;\n\t\treturn function(t, n, r = !0, i = !1, a = !1, o = !0) {\n\t\t\tif (this.isDisposingOrDisposed()) return;\n\t\t\tlet s = [], c = [];\n\t\t\ta || (s = this.splatMesh.scenes.map((e) => e.splatBuffer) || [], c = this.splatMesh.sceneOptions ? this.splatMesh.sceneOptions.map((e) => e) : []), s.push(...t), c.push(...n), this.renderer && this.splatMesh.setRenderer(this.renderer);\n\t\t\tlet l = this.splatMesh.build(s, c, !0, r, (t) => {\n\t\t\t\tif (this.isDisposingOrDisposed()) return;\n\t\t\t\tlet n = this.splatMesh.getSplatCount();\n\t\t\t\ti && n >= kp && !t && !e && (this.loadingSpinner.setMinimized(!0, !0), e = this.loadingSpinner.addTask(\"Optimizing data structures...\"));\n\t\t\t}, (t) => {\n\t\t\t\tthis.isDisposingOrDisposed() || t && e && (this.loadingSpinner.removeTask(e), e = null);\n\t\t\t}, o);\n\t\t\treturn r && this.freeIntermediateSplatData && this.splatMesh.freeIntermediateSplatData(), l;\n\t\t};\n\t}();\n\tsetupSortWorker(e) {\n\t\tif (!this.isDisposingOrDisposed()) return new Promise((t) => {\n\t\t\tlet n = this.integerBasedSort ? Int32Array : Float32Array, r = e.getSplatCount(), i = e.getMaxSplatCount();\n\t\t\tthis.sortWorker = Sp(i, this.sharedMemoryForWorkers, this.enableSIMDInSort, this.integerBasedSort, this.splatMesh.dynamicMode, this.splatSortDistanceMapPrecision), this.sortWorker.onmessage = (e) => {\n\t\t\t\tif (e.data.sortDone) {\n\t\t\t\t\tif (this.sortRunning = !1, this.sharedMemoryForWorkers) this.splatMesh.updateRenderIndexes(this.sortWorkerSortedIndexes, e.data.splatRenderCount);\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet t = new Uint32Array(e.data.sortedIndexes.buffer, 0, e.data.splatRenderCount);\n\t\t\t\t\t\tthis.splatMesh.updateRenderIndexes(t, e.data.splatRenderCount);\n\t\t\t\t\t}\n\t\t\t\t\tthis.lastSplatSortCount = this.splatSortCount, this.lastSortTime = e.data.sortTime, this.sortPromiseResolver(), this.sortPromiseResolver = null, this.forceRenderNextFrame(), this.runAfterNextSort.length > 0 && (this.runAfterNextSort.forEach((e) => {\n\t\t\t\t\t\te();\n\t\t\t\t\t}), this.runAfterNextSort.length = 0);\n\t\t\t\t} else if (e.data.sortCanceled) this.sortRunning = !1;\n\t\t\t\telse if (e.data.sortSetupPhase1Complete) {\n\t\t\t\t\tthis.logLevel >= ep.Info && console.log(\"Sorting web worker WASM setup complete.\"), this.sharedMemoryForWorkers ? (this.sortWorkerSortedIndexes = new Uint32Array(e.data.sortedIndexesBuffer, e.data.sortedIndexesOffset, i), this.sortWorkerIndexesToSort = new Uint32Array(e.data.indexesToSortBuffer, e.data.indexesToSortOffset, i), this.sortWorkerPrecomputedDistances = new n(e.data.precomputedDistancesBuffer, e.data.precomputedDistancesOffset, i), this.sortWorkerTransforms = new Float32Array(e.data.transformsBuffer, e.data.transformsOffset, cu.MaxScenes * 16)) : (this.sortWorkerIndexesToSort = new Uint32Array(i), this.sortWorkerPrecomputedDistances = new n(i), this.sortWorkerTransforms = new Float32Array(cu.MaxScenes * 16));\n\t\t\t\t\tfor (let e = 0; e < r; e++) this.sortWorkerIndexesToSort[e] = e;\n\t\t\t\t\tif (this.sortWorker.maxSplatCount = i, this.logLevel >= ep.Info) {\n\t\t\t\t\t\tconsole.log(\"Sorting web worker ready.\");\n\t\t\t\t\t\tlet e = this.splatMesh.getSplatDataTextures(), t = e.covariances.size, n = e.centerColors.size;\n\t\t\t\t\t\tconsole.log(\"Covariances texture size: \" + t.x + \" x \" + t.y), console.log(\"Centers/colors texture size: \" + n.x + \" x \" + n.y);\n\t\t\t\t\t}\n\t\t\t\t\tt();\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\tupdateError(e, t) {\n\t\treturn e instanceof ql ? e : e instanceof Ud ? /* @__PURE__ */ Error(\"File type or server does not support progressive loading.\") : t ? Error(t) : e;\n\t}\n\tdisposeSortWorker() {\n\t\tthis.sortWorker && this.sortWorker.terminate(), this.sortWorker = null, this.sortPromise = null, this.sortPromiseResolver &&= (this.sortPromiseResolver(), null), this.preSortMessages = [], this.sortRunning = !1;\n\t}\n\tremoveSplatScene(e, t = !0) {\n\t\treturn this.removeSplatScenes([e], t);\n\t}\n\tremoveSplatScenes(e, t = !0) {\n\t\tif (this.isLoadingOrUnloading()) throw Error(\"Cannot remove splat scene while another load or unload is already in progress.\");\n\t\tif (this.isDisposingOrDisposed()) throw Error(\"Cannot remove splat scene after dispose() is called.\");\n\t\tlet n;\n\t\treturn this.splatSceneRemovalPromise = new Promise((r, i) => {\n\t\t\tlet a;\n\t\t\tt && (this.loadingSpinner.removeAllTasks(), this.loadingSpinner.show(), a = this.loadingSpinner.addTask(\"Removing splat scene...\"));\n\t\t\tlet o = () => {\n\t\t\t\tt && (this.loadingSpinner.hide(), this.loadingSpinner.removeTask(a));\n\t\t\t}, s = (e) => {\n\t\t\t\to(), this.splatSceneRemovalPromise = null, e ? i(e) : r();\n\t\t\t}, c = () => this.isDisposingOrDisposed() ? (s(), !0) : !1;\n\t\t\tn = this.sortPromise || Promise.resolve(), n.then(() => {\n\t\t\t\tif (c()) return;\n\t\t\t\tlet t = [], r = [], i = [];\n\t\t\t\tfor (let n = 0; n < this.splatMesh.scenes.length; n++) {\n\t\t\t\t\tlet a = !1;\n\t\t\t\t\tfor (let t of e) if (t === n) {\n\t\t\t\t\t\ta = !0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!a) {\n\t\t\t\t\t\tlet e = this.splatMesh.scenes[n];\n\t\t\t\t\t\tt.push(e.splatBuffer), r.push(this.splatMesh.sceneOptions[n]), i.push({\n\t\t\t\t\t\t\tposition: e.position.clone(),\n\t\t\t\t\t\t\tquaternion: e.quaternion.clone(),\n\t\t\t\t\t\t\tscale: e.scale.clone()\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.disposeSortWorker(), this.splatMesh.dispose(), this.sceneRevealMode = $f.Instant, this.createSplatMesh(), this.addSplatBuffers(t, r, !0, !1, !0).then(() => {\n\t\t\t\t\tc() || (o(), this.splatMesh.scenes.forEach((e, t) => {\n\t\t\t\t\t\te.position.copy(i[t].position), e.quaternion.copy(i[t].quaternion), e.scale.copy(i[t].scale);\n\t\t\t\t\t}), this.splatMesh.updateTransforms(), this.splatRenderReady = !1, this.runSplatSort(!0).then(() => {\n\t\t\t\t\t\tif (c()) {\n\t\t\t\t\t\t\tthis.splatRenderReady = !0;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn = this.sortPromise || Promise.resolve(), n.then(() => {\n\t\t\t\t\t\t\tthis.splatRenderReady = !0, s();\n\t\t\t\t\t\t});\n\t\t\t\t\t}));\n\t\t\t\t}).catch((e) => {\n\t\t\t\t\ts(e);\n\t\t\t\t});\n\t\t\t});\n\t\t}), this.splatSceneRemovalPromise;\n\t}\n\tstart() {\n\t\tif (this.selfDrivenMode) this.webXRMode ? this.renderer.setAnimationLoop(this.selfDrivenUpdateFunc) : this.requestFrameId = requestAnimationFrame(this.selfDrivenUpdateFunc), this.selfDrivenModeRunning = !0;\n\t\telse throw Error(\"Cannot start viewer unless it is in self driven mode.\");\n\t}\n\tstop() {\n\t\tthis.selfDrivenMode && this.selfDrivenModeRunning && (this.webXRMode ? this.renderer.setAnimationLoop(null) : cancelAnimationFrame(this.requestFrameId), this.selfDrivenModeRunning = !1);\n\t}\n\tasync dispose() {\n\t\tif (this.isDisposingOrDisposed()) return this.disposePromise;\n\t\tlet e = [], t = [];\n\t\tfor (let n in this.splatSceneDownloadPromises) if (this.splatSceneDownloadPromises.hasOwnProperty(n)) {\n\t\t\tlet r = this.splatSceneDownloadPromises[n];\n\t\t\tt.push(r), e.push(r.promise);\n\t\t}\n\t\treturn this.sortPromise && e.push(this.sortPromise), this.disposing = !0, this.disposePromise = Promise.all(e).finally(() => {\n\t\t\tthis.stop(), this.orthographicControls &&= (this.orthographicControls.dispose(), null), this.perspectiveControls &&= (this.perspectiveControls.dispose(), null), this.controls = null, this.splatMesh &&= (this.splatMesh.dispose(), null), this.sceneHelper &&= (this.sceneHelper.dispose(), null), this.resizeObserver &&= (this.resizeObserver.unobserve(this.rootElement), null), this.disposeSortWorker(), this.removeEventHandlers(), this.loadingSpinner.removeAllTasks(), this.loadingSpinner.setContainer(null), this.loadingProgressBar.hide(), this.loadingProgressBar.setContainer(null), this.infoPanel.setContainer(null), this.camera = null, this.threeScene = null, this.splatRenderReady = !1, this.initialized = !1, this.renderer &&= (this.usingExternalRenderer || (this.rootElement.removeChild(this.renderer.domElement), this.renderer.dispose()), null), this.usingExternalRenderer || document.body.removeChild(this.rootElement), this.sortWorkerSortedIndexes = null, this.sortWorkerIndexesToSort = null, this.sortWorkerPrecomputedDistances = null, this.sortWorkerTransforms = null, this.disposed = !0, this.disposing = !1, this.disposePromise = null;\n\t\t}), t.forEach((e) => {\n\t\t\te.abort(\"Scene disposed\");\n\t\t}), this.disposePromise;\n\t}\n\tselfDrivenUpdate() {\n\t\tthis.selfDrivenMode && !this.webXRMode && (this.requestFrameId = requestAnimationFrame(this.selfDrivenUpdateFunc)), this.update(), this.shouldRender() ? (this.render(), this.consecutiveRenderFrames++) : this.consecutiveRenderFrames = 0, this.renderNextFrame = !1;\n\t}\n\tforceRenderNextFrame() {\n\t\tthis.renderNextFrame = !0;\n\t}\n\tshouldRender = function() {\n\t\tlet e = 0, t = new K(), n = new ln(), r = 1e-4;\n\t\treturn function() {\n\t\t\tif (!this.initialized || !this.splatRenderReady || this.isDisposingOrDisposed()) return !1;\n\t\t\tlet i = !1, a = !1;\n\t\t\tif (this.camera) {\n\t\t\t\tlet e = this.camera.position, i = this.camera.quaternion;\n\t\t\t\ta = Math.abs(e.x - t.x) > r || Math.abs(e.y - t.y) > r || Math.abs(e.z - t.z) > r || Math.abs(i.x - n.x) > r || Math.abs(i.y - n.y) > r || Math.abs(i.z - n.z) > r || Math.abs(i.w - n.w) > r;\n\t\t\t}\n\t\t\treturn i = this.renderMode !== Ep.Never && (e === 0 || this.splatMesh.visibleRegionChanging || a || this.renderMode === Ep.Always || this.dynamicMode === !0 || this.renderNextFrame), this.camera && (t.copy(this.camera.position), n.copy(this.camera.quaternion)), e++, i;\n\t\t};\n\t}();\n\trender = function() {\n\t\treturn function() {\n\t\t\tif (!this.initialized || !this.splatRenderReady || this.isDisposingOrDisposed()) return;\n\t\t\tlet e = (e) => {\n\t\t\t\tfor (let t of e.children) if (t.visible) return !0;\n\t\t\t\treturn !1;\n\t\t\t}, t = this.renderer.autoClear;\n\t\t\te(this.threeScene) && (this.renderer.render(this.threeScene, this.camera), this.renderer.autoClear = !1), this.renderer.render(this.splatMesh, this.camera), this.renderer.autoClear = !1, this.sceneHelper.getFocusMarkerOpacity() > 0 && this.renderer.render(this.sceneHelper.focusMarker, this.camera), this.showControlPlane && this.renderer.render(this.sceneHelper.controlPlane, this.camera), this.renderer.autoClear = t;\n\t\t};\n\t}();\n\tupdate(t, n) {\n\t\tthis.dropInMode && this.updateForDropInMode(t, n), this.initialized && this.splatRenderReady && !this.isDisposingOrDisposed() && (this.controls && (this.controls.update(), this.camera.isOrthographicCamera && !this.usingExternalCamera && e.setCameraPositionFromZoom(this.camera, this.camera, this.controls)), this.runSplatSort(), this.updateForRendererSizeChanges(), this.updateSplatMesh(), this.updateMeshCursor(), this.updateFPS(), this.timingSensitiveUpdates(), this.updateInfoPanel(), this.updateControlPlane());\n\t}\n\tupdateForDropInMode(e, t) {\n\t\tthis.renderer = e, this.splatMesh && this.splatMesh.setRenderer(this.renderer), this.camera = t, this.controls && (this.controls.object = t), this.init();\n\t}\n\tupdateFPS = function() {\n\t\tlet e = Ql(), t = 0;\n\t\treturn function() {\n\t\t\tif (this.consecutiveRenderFrames > Mp) {\n\t\t\t\tlet n = Ql();\n\t\t\t\tn - e >= 1 ? (this.currentFPS = t, t = 0, e = n) : t++;\n\t\t\t} else this.currentFPS = null;\n\t\t};\n\t}();\n\tupdateForRendererSizeChanges = function() {\n\t\tlet e = new G(), t = new G(), n;\n\t\treturn function() {\n\t\t\tthis.usingExternalCamera || (this.renderer.getSize(t), (n === void 0 || n !== this.camera.isOrthographicCamera || t.x !== e.x || t.y !== e.y) && (this.camera.isOrthographicCamera ? (this.camera.left = -t.x / 2, this.camera.right = t.x / 2, this.camera.top = t.y / 2, this.camera.bottom = -t.y / 2) : this.camera.aspect = t.x / t.y, this.camera.updateProjectionMatrix(), e.copy(t), n = this.camera.isOrthographicCamera));\n\t\t};\n\t}();\n\ttimingSensitiveUpdates = function() {\n\t\tlet e;\n\t\treturn function() {\n\t\t\tlet t = Ql();\n\t\t\te ||= t;\n\t\t\tlet n = t - e;\n\t\t\tthis.updateCameraTransition(t), this.updateFocusMarker(n), e = t;\n\t\t};\n\t}();\n\tupdateCameraTransition = function() {\n\t\tlet e = new K(), t = new K(), n = new K();\n\t\treturn function(r) {\n\t\t\tif (this.transitioningCameraTarget) {\n\t\t\t\tt.copy(this.previousCameraTarget).sub(this.camera.position).normalize(), n.copy(this.nextCameraTarget).sub(this.camera.position).normalize();\n\t\t\t\tlet i = Math.acos(t.dot(n)), a = (i / (Math.PI / 3) * .65 + .3) / i * (r - this.transitioningCameraTargetStartTime);\n\t\t\t\te.copy(this.previousCameraTarget).lerp(this.nextCameraTarget, a), this.camera.lookAt(e), this.controls.target.copy(e), a >= 1 && (this.transitioningCameraTarget = !1);\n\t\t\t}\n\t\t};\n\t}();\n\tupdateFocusMarker = function() {\n\t\tlet e = new G(), t = !1;\n\t\treturn function(n) {\n\t\t\tif (this.getRenderDimensions(e), this.transitioningCameraTarget) {\n\t\t\t\tthis.sceneHelper.setFocusMarkerVisibility(!0);\n\t\t\t\tlet r = Math.max(this.sceneHelper.getFocusMarkerOpacity(), 0), i = Math.min(r + Ap * n, 1);\n\t\t\t\tthis.sceneHelper.setFocusMarkerOpacity(i), this.sceneHelper.updateFocusMarker(this.nextCameraTarget, this.camera, e), t = !0, this.forceRenderNextFrame();\n\t\t\t} else {\n\t\t\t\tlet r;\n\t\t\t\tif (r = t ? 1 : Math.min(this.sceneHelper.getFocusMarkerOpacity(), 1), r > 0) {\n\t\t\t\t\tthis.sceneHelper.updateFocusMarker(this.nextCameraTarget, this.camera, e);\n\t\t\t\t\tlet t = Math.max(r - jp * n, 0);\n\t\t\t\t\tthis.sceneHelper.setFocusMarkerOpacity(t), t === 0 && this.sceneHelper.setFocusMarkerVisibility(!1);\n\t\t\t\t}\n\t\t\t\tr > 0 && this.forceRenderNextFrame(), t = !1;\n\t\t\t}\n\t\t};\n\t}();\n\tupdateMeshCursor = function() {\n\t\tlet e = [], t = new G();\n\t\treturn function() {\n\t\t\tthis.showMeshCursor ? (this.forceRenderNextFrame(), this.getRenderDimensions(t), e.length = 0, this.raycaster.setFromCameraAndScreenPosition(this.camera, this.mousePosition, t), this.raycaster.intersectSplatMesh(this.splatMesh, e), e.length > 0 ? (this.sceneHelper.setMeshCursorVisibility(!0), this.sceneHelper.positionAndOrientMeshCursor(e[0].origin, this.camera)) : this.sceneHelper.setMeshCursorVisibility(!1)) : (this.sceneHelper.getMeschCursorVisibility() && this.forceRenderNextFrame(), this.sceneHelper.setMeshCursorVisibility(!1));\n\t\t};\n\t}();\n\tupdateInfoPanel = function() {\n\t\tlet e = new G();\n\t\treturn function() {\n\t\t\tif (!this.showInfo) return;\n\t\t\tlet t = this.splatMesh.getSplatCount();\n\t\t\tthis.getRenderDimensions(e);\n\t\t\tlet n = this.controls ? this.controls.target : null, r = this.showMeshCursor ? this.sceneHelper.meshCursor.position : null, i = t > 0 ? this.splatRenderCount / t * 100 : 0;\n\t\t\tthis.infoPanel.update(e, this.camera.position, n, this.camera.up, this.camera.isOrthographicCamera, r, this.currentFPS || \"N/A\", t, this.splatRenderCount, i, this.lastSortTime, this.focalAdjustment, this.splatMesh.getSplatScale(), this.splatMesh.getPointCloudModeEnabled());\n\t\t};\n\t}();\n\tupdateControlPlane() {\n\t\tthis.showControlPlane ? (this.sceneHelper.setControlPlaneVisibility(!0), this.sceneHelper.positionAndOrientControlPlane(this.controls.target, this.camera.up)) : this.sceneHelper.setControlPlaneVisibility(!1);\n\t}\n\trunSplatSort = function() {\n\t\tlet e = new J(), t = [], n = new K(0, 0, -1), r = new K(0, 0, -1), i = new K(), a = new K(), o = [], s = [\n\t\t\t{\n\t\t\t\tangleThreshold: .55,\n\t\t\t\tsortFractions: [\n\t\t\t\t\t.125,\n\t\t\t\t\t.33333,\n\t\t\t\t\t.75\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tangleThreshold: .65,\n\t\t\t\tsortFractions: [.33333, .66667]\n\t\t\t},\n\t\t\t{\n\t\t\t\tangleThreshold: .8,\n\t\t\t\tsortFractions: [.5]\n\t\t\t}\n\t\t];\n\t\treturn function(c = !1, l = !1) {\n\t\t\tif (!this.initialized) return Promise.resolve(!1);\n\t\t\tif (this.sortRunning) return Promise.resolve(!0);\n\t\t\tif (this.splatMesh.getSplatCount() <= 0) return this.splatRenderCount = 0, Promise.resolve(!1);\n\t\t\tlet u = 0, d = 0, f = !1, p = !1;\n\t\t\tif (r.set(0, 0, -1).applyQuaternion(this.camera.quaternion), u = r.dot(n), d = a.copy(this.camera.position).sub(i).length(), !c && !this.splatMesh.dynamicMode && o.length === 0 && (u <= .99 && (f = !0), d >= 1 && (p = !0), !f && !p)) return Promise.resolve(!1);\n\t\t\tthis.sortRunning = !0;\n\t\t\tlet { splatRenderCount: m, shouldSortAll: h } = this.gatherSceneNodesForSort();\n\t\t\th ||= l, this.splatRenderCount = m, e.copy(this.camera.matrixWorld).invert();\n\t\t\tlet g = this.perspectiveCamera || this.camera;\n\t\t\te.premultiply(g.projectionMatrix), this.splatMesh.dynamicMode || e.multiply(this.splatMesh.matrixWorld);\n\t\t\tlet _ = Promise.resolve(!0);\n\t\t\treturn this.gpuAcceleratedSort && (o.length <= 1 || o.length % 2 == 0) && (_ = this.splatMesh.computeDistancesOnGPU(e, this.sortWorkerPrecomputedDistances)), _.then(() => {\n\t\t\t\tif (o.length === 0) {\n\t\t\t\t\tif (this.splatMesh.dynamicMode || h) o.push(this.splatRenderCount);\n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (let e of s) if (u < e.angleThreshold) {\n\t\t\t\t\t\t\tfor (let t of e.sortFractions) o.push(Math.floor(this.splatRenderCount * t));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\to.push(this.splatRenderCount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet a = Math.min(o.shift(), this.splatRenderCount);\n\t\t\t\tthis.splatSortCount = a, t[0] = this.camera.position.x, t[1] = this.camera.position.y, t[2] = this.camera.position.z;\n\t\t\t\tlet c = {\n\t\t\t\t\tmodelViewProj: e.elements,\n\t\t\t\t\tcameraPosition: t,\n\t\t\t\t\tsplatRenderCount: this.splatRenderCount,\n\t\t\t\t\tsplatSortCount: a,\n\t\t\t\t\tusePrecomputedDistances: this.gpuAcceleratedSort\n\t\t\t\t};\n\t\t\t\treturn this.splatMesh.dynamicMode && this.splatMesh.fillTransformsArray(this.sortWorkerTransforms), this.sharedMemoryForWorkers || (c.indexesToSort = this.sortWorkerIndexesToSort, c.transforms = this.sortWorkerTransforms, this.gpuAcceleratedSort && (c.precomputedDistances = this.sortWorkerPrecomputedDistances)), this.sortPromise = new Promise((e) => {\n\t\t\t\t\tthis.sortPromiseResolver = e;\n\t\t\t\t}), this.preSortMessages.length > 0 && (this.preSortMessages.forEach((e) => {\n\t\t\t\t\tthis.sortWorker.postMessage(e);\n\t\t\t\t}), this.preSortMessages = []), this.sortWorker.postMessage({ sort: c }), o.length === 0 && (i.copy(this.camera.position), n.copy(r)), !0;\n\t\t\t}), _;\n\t\t};\n\t}();\n\tgatherSceneNodesForSort = function() {\n\t\tlet e = [], t = null, n = new K(), r = new K(), i = new K(), a = new J(), o = new J(), s = new J(), c = new K(), l = new K(0, 0, -1), u = new K(), d = (e) => u.copy(e.max).sub(e.min).length();\n\t\treturn function(u = !1) {\n\t\t\tthis.getRenderDimensions(c);\n\t\t\tlet f = c.y / 2 / Math.tan(this.camera.fov / 2 * cn.DEG2RAD), p = Math.atan(c.x / 2 / f), m = Math.atan(c.y / 2 / f), h = Math.cos(p), g = Math.cos(m), _ = this.splatMesh.getSplatTree();\n\t\t\tif (_) {\n\t\t\t\to.copy(this.camera.matrixWorld).invert(), this.splatMesh.dynamicMode || o.multiply(this.splatMesh.matrixWorld);\n\t\t\t\tlet t = 0, c = 0;\n\t\t\t\tfor (let f = 0; f < _.subTrees.length; f++) {\n\t\t\t\t\tlet p = _.subTrees[f];\n\t\t\t\t\ta.copy(o), this.splatMesh.dynamicMode && (this.splatMesh.getSceneTransform(f, s), a.multiply(s));\n\t\t\t\t\tlet m = p.nodesWithIndexes.length;\n\t\t\t\t\tfor (let o = 0; o < m; o++) {\n\t\t\t\t\t\tlet s = p.nodesWithIndexes[o];\n\t\t\t\t\t\tif (!s.data || !s.data.indexes || s.data.indexes.length === 0) continue;\n\t\t\t\t\t\ti.copy(s.center).applyMatrix4(a);\n\t\t\t\t\t\tlet f = i.length();\n\t\t\t\t\t\ti.normalize(), n.copy(i).setX(0).normalize(), r.copy(i).setY(0).normalize();\n\t\t\t\t\t\tlet m = l.dot(r), _ = l.dot(n), v = d(s), y = _ < g - .6, b = m < h - .6;\n\t\t\t\t\t\t!u && (b || y) && f > v || (c += s.data.indexes.length, e[t] = s, s.data.distanceToNode = f, t++);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\te.length = t, e.sort((e, t) => e.data.distanceToNode < t.data.distanceToNode ? -1 : 1);\n\t\t\t\tlet f = c * cu.BytesPerInt;\n\t\t\t\tfor (let n = 0; n < t; n++) {\n\t\t\t\t\tlet t = e[n], r = t.data.indexes.length, i = r * cu.BytesPerInt;\n\t\t\t\t\tnew Uint32Array(this.sortWorkerIndexesToSort.buffer, f - i, r).set(t.data.indexes), f -= i;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tsplatRenderCount: c,\n\t\t\t\t\tshouldSortAll: !1\n\t\t\t\t};\n\t\t\t}\n\t\t\t{\n\t\t\t\tlet e = this.splatMesh.getSplatCount();\n\t\t\t\tif (!t || t.length !== e) {\n\t\t\t\t\tt = new Uint32Array(e);\n\t\t\t\t\tfor (let n = 0; n < e; n++) t[n] = n;\n\t\t\t\t}\n\t\t\t\treturn this.sortWorkerIndexesToSort.set(t), {\n\t\t\t\t\tsplatRenderCount: e,\n\t\t\t\t\tshouldSortAll: !0\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}();\n\tgetSplatMesh() {\n\t\treturn this.splatMesh;\n\t}\n\tgetSplatScene(e) {\n\t\treturn this.splatMesh.getScene(e);\n\t}\n\tgetSceneCount() {\n\t\treturn this.splatMesh.getSceneCount();\n\t}\n\tisMobile() {\n\t\treturn navigator.userAgent.includes(\"Mobi\");\n\t}\n}, Pp = class e extends ar {\n\tconstructor(t = {}) {\n\t\tsuper(), t.selfDrivenMode = !1, t.useBuiltInControls = !1, t.rootElement = null, t.dropInMode = !0, t.camera = void 0, t.renderer = void 0, this.viewer = new Np(t), this.splatMesh = null, this.updateSplatMesh(), this.callbackMesh = e.createCallbackMesh(), this.add(this.callbackMesh), this.callbackMesh.onBeforeRender = e.onBeforeRender.bind(this, this.viewer), this.viewer.onSplatMeshChanged(() => {\n\t\t\tthis.updateSplatMesh();\n\t\t});\n\t}\n\tupdateSplatMesh() {\n\t\tthis.splatMesh !== this.viewer.splatMesh && (this.splatMesh && this.remove(this.splatMesh), this.splatMesh = this.viewer.splatMesh, this.add(this.viewer.splatMesh));\n\t}\n\taddSplatScene(e, t = {}) {\n\t\treturn t.showLoadingUI !== !1 && (t.showLoadingUI = !0), this.viewer.addSplatScene(e, t);\n\t}\n\taddSplatScenes(e, t) {\n\t\treturn t !== !1 && (t = !0), this.viewer.addSplatScenes(e, t);\n\t}\n\tgetSplatScene(e) {\n\t\treturn this.viewer.getSplatScene(e);\n\t}\n\tremoveSplatScene(e, t = !0) {\n\t\treturn this.viewer.removeSplatScene(e, t);\n\t}\n\tremoveSplatScenes(e, t = !0) {\n\t\treturn this.viewer.removeSplatScenes(e, t);\n\t}\n\tgetSceneCount() {\n\t\treturn this.viewer.getSceneCount();\n\t}\n\tsetActiveSphericalHarmonicsDegrees(e) {\n\t\tthis.viewer.setActiveSphericalHarmonicsDegrees(e);\n\t}\n\tasync dispose() {\n\t\treturn await this.viewer.dispose();\n\t}\n\tstatic onBeforeRender(e, t, n, r) {\n\t\te.update(t, r);\n\t}\n\tstatic createCallbackMesh() {\n\t\tlet e = new ra(1, 8, 8), t = new wi();\n\t\tt.colorWrite = !1, t.depthWrite = !1;\n\t\tlet n = new Ii(e, t);\n\t\treturn n.frustumCulled = !1, n;\n\t}\n}, Fp = \"#101315\", Ip = {\n\tply: gf.Ply,\n\tsplat: gf.Splat,\n\tksplat: gf.KSplat,\n\tspz: gf.Spz\n}, Lp = (e) => [\n\tRp(e.x),\n\tRp(e.y),\n\tRp(e.z)\n], Rp = (e) => Math.round(e * 1e4) / 1e4, zp = () => new Promise((e) => requestAnimationFrame(() => e())), Bp = (e) => new Promise((t) => setTimeout(t, e));\nfunction Vp(e, t, n, r = {}) {\n\tlet i = cn.degToRad(r.azimuthDeg ?? 35), a = cn.degToRad(r.elevationDeg ?? 18), o = cn.degToRad(t) / 2, s = Math.atan(Math.tan(o) * n), c = e.radius / Math.sin(Math.min(o, s)) * (r.distanceScale ?? 1), l = new K(Math.sin(i) * Math.cos(a), Math.sin(a), Math.cos(i) * Math.cos(a)), u = new K(...e.center);\n\treturn {\n\t\tposition: Lp(u.clone().addScaledVector(l, c)),\n\t\ttarget: Lp(u),\n\t\tup: [\n\t\t\t0,\n\t\t\t1,\n\t\t\t0\n\t\t],\n\t\tfov: t\n\t};\n}\nfunction Hp(e) {\n\tlet t = e.getSplatCount(), n = Math.max(1, Math.ceil(t / 12e4)), r = [\n\t\t[],\n\t\t[],\n\t\t[]\n\t], i = new K();\n\tfor (let a = 0; a < t; a += n) e.getSplatCenter(a, i, !0), Number.isFinite(i.x) && Number.isFinite(i.y) && Number.isFinite(i.z) && (r[0].push(i.x), r[1].push(i.y), r[2].push(i.z));\n\tif (!r[0].length) throw Error(\"扫描不含有限坐标\");\n\tlet a = (e, t) => e[Math.min(e.length - 1, Math.max(0, Math.floor(t * (e.length - 1))))];\n\tfor (let e of r) e.sort((e, t) => e - t);\n\tlet o = r.map((e) => a(e, .02)), s = r.map((e) => a(e, .98)), c = o.map((e, t) => (e + s[t]) / 2), l = Math.max(.05, Math.hypot(...s.map((e, t) => (e - o[t]) / 2)));\n\treturn {\n\t\tmin: o.map(Rp),\n\t\tmax: s.map(Rp),\n\t\tcenter: c.map(Rp),\n\t\tradius: Rp(l)\n\t};\n}\nfunction Up(e = {}) {\n\tlet t = !e.canvas, n = e.canvas ?? document.createElement(\"canvas\");\n\tt && (Object.assign(n.style, {\n\t\tposition: \"fixed\",\n\t\tleft: \"-200vw\",\n\t\ttop: \"0\",\n\t\topacity: \"0\",\n\t\tpointerEvents: \"none\"\n\t}), n.setAttribute(\"aria-hidden\", \"true\"), document.body.append(n));\n\tlet r = new Sl({\n\t\tcanvas: n,\n\t\tantialias: !1,\n\t\talpha: !0,\n\t\tpreserveDrawingBuffer: !0,\n\t\tpowerPreference: \"high-performance\"\n\t});\n\tr.setPixelRatio(e.interactive ? Math.min(devicePixelRatio, 2) : 1);\n\tlet i = new mr();\n\ti.background = new fr(Fp);\n\tlet a = new La(50, 16 / 9, .02, 5e3);\n\ta.position.set(0, 1.2, 4);\n\tlet o = new K(), s, c, l = 0, u = !1, d = 0, f = !1, p = 0, m = e.interactive ? new Nl(a, n) : void 0;\n\tm && (m.enableDamping = !0, m.dampingFactor = .12, m.screenSpacePanning = !0, m.target = o, m.addEventListener(\"change\", () => _()), m.addEventListener(\"end\", () => e.onCameraChange?.(y())));\n\tfunction h() {\n\t\tif (u) throw Error(\"舞台已释放\");\n\t\tif (!s || !c) throw Error(\"扫描尚未加载\");\n\t\treturn s;\n\t}\n\tfunction g() {\n\t\tu || (a.lookAt(o), r.render(i, a), d++);\n\t}\n\tfunction _() {\n\t\tif (p = 0, f || u) return;\n\t\tf = !0;\n\t\tlet e = () => {\n\t\t\tif (u) {\n\t\t\t\tf = !1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (m?.update(), g(), p = s?.viewer.sortRunning ? 0 : p + 1, p > 45) {\n\t\t\t\tf = !1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trequestAnimationFrame(e);\n\t\t};\n\t\trequestAnimationFrame(e);\n\t}\n\tfunction v(e, n) {\n\t\tr.setSize(e, n, t), a.aspect = e / n, a.updateProjectionMatrix(), _();\n\t}\n\tfunction y() {\n\t\treturn {\n\t\t\tposition: Lp(a.position),\n\t\t\ttarget: Lp(o),\n\t\t\tup: Lp(a.up),\n\t\t\tfov: Rp(a.fov)\n\t\t};\n\t}\n\tfunction b(e) {\n\t\ta.position.set(...e.position), o.set(...e.target), a.up.set(...e.up).normalize(), a.fov = e.fov, a.updateProjectionMatrix(), a.lookAt(o), m?.update(), _();\n\t}\n\tasync function x(e, t, n) {\n\t\tn?.throwIfAborted(), await S();\n\t\tlet r = URL.createObjectURL(new Blob([e])), a = new Pp({\n\t\t\tsharedMemoryForWorkers: !1,\n\t\t\tgpuAcceleratedSort: !1,\n\t\t\tenableSIMDInSort: !1,\n\t\t\tfreeIntermediateSplatData: !0,\n\t\t\tsphericalHarmonicsDegree: 2,\n\t\t\tsceneRevealMode: $f.Instant,\n\t\t\tlogLevel: ep.None\n\t\t}), o = a.addSplatScene(r, {\n\t\t\tformat: Ip[t],\n\t\t\tshowLoadingUI: !1,\n\t\t\tprogressiveLoad: !1,\n\t\t\tsplatAlphaRemovalThreshold: 1\n\t\t}), d = () => {\n\t\t\ttry {\n\t\t\t\to.abort(n?.reason);\n\t\t\t} catch {}\n\t\t};\n\t\tn?.addEventListener(\"abort\", d, { once: !0 });\n\t\ttry {\n\t\t\tif (await o.promise, n?.throwIfAborted(), u) throw Error(\"舞台已释放\");\n\t\t\tlet e = a.viewer.splatMesh ?? a.splatMesh;\n\t\t\tif (!e) throw Error(\"扫描未生成可渲染的 Gaussian 网格\");\n\t\t\treturn l = e.getSplatCount(), c = Hp(e), s = a, i.add(a), _(), {\n\t\t\t\tsplatCount: l,\n\t\t\t\tbounds: c\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tthrow await a.dispose().catch(() => {}), e;\n\t\t} finally {\n\t\t\tn?.removeEventListener(\"abort\", d), URL.revokeObjectURL(r);\n\t\t}\n\t}\n\tasync function S() {\n\t\tlet e = s;\n\t\ts = void 0, c = void 0, l = 0, e && (i.remove(e), await e.dispose());\n\t}\n\tasync function C(e) {\n\t\tlet t = h().viewer, n = async () => {\n\t\t\tfor (let n = 0; n < 4e3 && t.sortRunning; n++) e?.throwIfAborted(), await Bp(5);\n\t\t};\n\t\tg(), await n();\n\t\tfor (let r = 0; r < 30 && !(t.splatRenderCount > 0); r++) e?.throwIfAborted(), await zp(), g(), await n();\n\t\te?.throwIfAborted(), g();\n\t}\n\tasync function w(e, o, s = {}, c) {\n\t\th();\n\t\tlet l = i.background, u = r.getSize(new G()), d = r.getPixelRatio(), f = y();\n\t\ttry {\n\t\t\tr.setPixelRatio(1), r.setSize(e, o, t), a.aspect = e / o, a.updateProjectionMatrix(), i.background = s.background === null ? null : new fr(s.background ?? \"#101315\"), s.camera && b(s.camera), await C(c);\n\t\t\tlet l = await new Promise((e) => n.toBlob(e, \"image/png\"));\n\t\t\tif (!l) throw Error(\"PNG 编码失败\");\n\t\t\treturn l;\n\t\t} finally {\n\t\t\ti.background = l, r.setPixelRatio(d), r.setSize(u.x, u.y, t), a.aspect = u.x / Math.max(1, u.y), a.updateProjectionMatrix(), s.camera && b(f);\n\t\t}\n\t}\n\tfunction T(e = {}) {\n\t\tif (!c) throw Error(\"扫描尚未加载\");\n\t\tlet t = Vp(c, a.fov, a.aspect, e);\n\t\treturn b(t), t;\n\t}\n\tasync function E() {\n\t\tu = !0, m?.dispose(), await S(), r.dispose(), r.forceContextLoss(), t && n.remove();\n\t}\n\treturn {\n\t\tcanvas: n,\n\t\tload: x,\n\t\tunload: S,\n\t\trender: g,\n\t\tsettle: C,\n\t\tcapturePng: w,\n\t\tframe: T,\n\t\tsetCamera: b,\n\t\tgetCamera: y,\n\t\tsetSize: v,\n\t\tdispose: E,\n\t\tgetBounds: () => c,\n\t\tgetSplatCount: () => l,\n\t\tframes: () => d\n\t};\n}\n//#endregion\n//#region ../../../node_modules/.bun/@tabler+icons-react@3.49.0+0441d6f8f57aca1e/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs\nvar Wp = {\n\toutline: {\n\t\txmlns: \"http://www.w3.org/2000/svg\",\n\t\twidth: 24,\n\t\theight: 24,\n\t\tviewBox: \"0 0 24 24\",\n\t\tfill: \"none\",\n\t\tstroke: \"currentColor\",\n\t\tstrokeWidth: 2,\n\t\tstrokeLinecap: \"round\",\n\t\tstrokeLinejoin: \"round\"\n\t},\n\tfilled: {\n\t\txmlns: \"http://www.w3.org/2000/svg\",\n\t\twidth: 24,\n\t\theight: 24,\n\t\tviewBox: \"0 0 24 24\",\n\t\tfill: \"currentColor\",\n\t\tstroke: \"none\"\n\t}\n}, $ = (e, t, n, r) => {\n\tlet i = u(({ color: n = \"currentColor\", size: i = 24, stroke: a = 2, title: o, className: s, children: c, ...u }, d) => l(\"svg\", {\n\t\tref: d,\n\t\t...Wp[e],\n\t\twidth: i,\n\t\theight: i,\n\t\tclassName: [\n\t\t\t\"tabler-icon\",\n\t\t\t`tabler-icon-${t}`,\n\t\t\ts\n\t\t].filter(Boolean).join(\" \"),\n\t\t...e === \"filled\" ? { fill: n } : {\n\t\t\tstrokeWidth: a,\n\t\t\tstroke: n\n\t\t},\n\t\t...u\n\t}, [\n\t\to && l(\"title\", { key: \"svg-title\" }, o),\n\t\t...r.map(([e, t]) => l(e, t)),\n\t\t...Array.isArray(c) ? c : [c]\n\t]));\n\treturn i.displayName = `${n}`, i;\n}, Gp = $(\"outline\", \"arrow-back-up\", \"ArrowBackUp\", [[\"path\", {\n\td: \"M9 14l-4 -4l4 -4\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M5 10h11a4 4 0 1 1 0 8h-1\",\n\tkey: \"svg-1\"\n}]]), Kp = $(\"outline\", \"arrow-down\", \"ArrowDown\", [\n\t[\"path\", {\n\t\td: \"M12 5l0 14\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M18 13l-6 6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M6 13l6 6\",\n\t\tkey: \"svg-2\"\n\t}]\n]), qp = $(\"outline\", \"arrow-forward-up\", \"ArrowForwardUp\", [[\"path\", {\n\td: \"M15 14l4 -4l-4 -4\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M19 10h-11a4 4 0 1 0 0 8h1\",\n\tkey: \"svg-1\"\n}]]), Jp = $(\"outline\", \"arrow-left\", \"ArrowLeft\", [\n\t[\"path\", {\n\t\td: \"M5 12l14 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 12l6 6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 12l6 -6\",\n\t\tkey: \"svg-2\"\n\t}]\n]), Yp = $(\"outline\", \"arrow-right\", \"ArrowRight\", [\n\t[\"path\", {\n\t\td: \"M5 12l14 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M13 18l6 -6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M13 6l6 6\",\n\t\tkey: \"svg-2\"\n\t}]\n]), Xp = $(\"outline\", \"arrow-up\", \"ArrowUp\", [\n\t[\"path\", {\n\t\td: \"M12 5l0 14\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M18 11l-6 -6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M6 11l6 -6\",\n\t\tkey: \"svg-2\"\n\t}]\n]), Zp = $(\"outline\", \"arrows-maximize\", \"ArrowsMaximize\", [\n\t[\"path\", {\n\t\td: \"M16 4l4 0l0 4\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M14 10l6 -6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M8 20l-4 0l0 -4\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M4 20l6 -6\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M16 20l4 0l0 -4\",\n\t\tkey: \"svg-4\"\n\t}],\n\t[\"path\", {\n\t\td: \"M14 14l6 6\",\n\t\tkey: \"svg-5\"\n\t}],\n\t[\"path\", {\n\t\td: \"M8 4l-4 0l0 4\",\n\t\tkey: \"svg-6\"\n\t}],\n\t[\"path\", {\n\t\td: \"M4 4l6 6\",\n\t\tkey: \"svg-7\"\n\t}]\n]), Qp = $(\"outline\", \"arrows-minimize\", \"ArrowsMinimize\", [\n\t[\"path\", {\n\t\td: \"M5 9l4 0l0 -4\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M3 3l6 6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 15l4 0l0 4\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M3 21l6 -6\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M19 9l-4 0l0 -4\",\n\t\tkey: \"svg-4\"\n\t}],\n\t[\"path\", {\n\t\td: \"M15 9l6 -6\",\n\t\tkey: \"svg-5\"\n\t}],\n\t[\"path\", {\n\t\td: \"M19 15l-4 0l0 4\",\n\t\tkey: \"svg-6\"\n\t}],\n\t[\"path\", {\n\t\td: \"M15 15l6 6\",\n\t\tkey: \"svg-7\"\n\t}]\n]), $p = $(\"outline\", \"bold\", \"Bold\", [[\"path\", {\n\td: \"M7 5h6a3.5 3.5 0 0 1 0 7h-6l0 -7\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7\",\n\tkey: \"svg-1\"\n}]]), em = $(\"outline\", \"brush\", \"Brush\", [\n\t[\"path\", {\n\t\td: \"M3 21v-4a4 4 0 1 1 4 4h-4\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M21 3a16 16 0 0 0 -12.8 10.2\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M21 3a16 16 0 0 1 -10.2 12.8\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M10.6 9a9 9 0 0 1 4.4 4.4\",\n\t\tkey: \"svg-3\"\n\t}]\n]), tm = $(\"outline\", \"camera\", \"Camera\", [[\"path\", {\n\td: \"M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M9 13a3 3 0 1 0 6 0a3 3 0 0 0 -6 0\",\n\tkey: \"svg-1\"\n}]]), nm = $(\"outline\", \"check\", \"Check\", [[\"path\", {\n\td: \"M5 12l5 5l10 -10\",\n\tkey: \"svg-0\"\n}]]), rm = $(\"outline\", \"circle\", \"Circle\", [[\"path\", {\n\td: \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\",\n\tkey: \"svg-0\"\n}]]), im = $(\"outline\", \"copy\", \"Copy\", [[\"path\", {\n\td: \"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\",\n\tkey: \"svg-1\"\n}]]), am = $(\"outline\", \"currency-dollar\", \"CurrencyDollar\", [[\"path\", {\n\td: \"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M12 3v3m0 12v3\",\n\tkey: \"svg-1\"\n}]]), om = $(\"outline\", \"download\", \"Download\", [\n\t[\"path\", {\n\t\td: \"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M7 11l5 5l5 -5\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M12 4l0 12\",\n\t\tkey: \"svg-2\"\n\t}]\n]), sm = $(\"outline\", \"eraser\", \"Eraser\", [[\"path\", {\n\td: \"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M18 13.3l-6.3 -6.3\",\n\tkey: \"svg-1\"\n}]]), cm = $(\"outline\", \"file-text\", \"FileText\", [\n\t[\"path\", {\n\t\td: \"M14 3v4a1 1 0 0 0 1 1h4\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 9l1 0\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 13l6 0\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 17l6 0\",\n\t\tkey: \"svg-4\"\n\t}]\n]), lm = $(\"outline\", \"heading\", \"Heading\", [\n\t[\"path\", {\n\t\td: \"M7 12h10\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M7 5v14\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M17 5v14\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M15 19h4\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M15 5h4\",\n\t\tkey: \"svg-4\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 19h4\",\n\t\tkey: \"svg-5\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 5h4\",\n\t\tkey: \"svg-6\"\n\t}]\n]), um = $(\"outline\", \"history\", \"History\", [[\"path\", {\n\td: \"M12 8l0 4l2 2\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5\",\n\tkey: \"svg-1\"\n}]]), dm = $(\"outline\", \"info-circle\", \"InfoCircle\", [\n\t[\"path\", {\n\t\td: \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M12 9h.01\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M11 12h1v4h1\",\n\t\tkey: \"svg-2\"\n\t}]\n]), fm = $(\"outline\", \"italic\", \"Italic\", [\n\t[\"path\", {\n\t\td: \"M11 5l6 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M7 19l6 0\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M14 5l-4 14\",\n\t\tkey: \"svg-2\"\n\t}]\n]), pm = $(\"outline\", \"layers-linked\", \"LayersLinked\", [[\"path\", {\n\td: \"M19 8.268a2 2 0 0 1 1 1.732v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-8a2 2 0 0 1 2 -2h3\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M5 15.734a2 2 0 0 1 -1 -1.734v-8a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-3\",\n\tkey: \"svg-1\"\n}]]), mm = $(\"outline\", \"layout-grid\", \"LayoutGrid\", [\n\t[\"path\", {\n\t\td: \"M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M14 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4\",\n\t\tkey: \"svg-3\"\n\t}]\n]), hm = $(\"outline\", \"link\", \"Link\", [\n\t[\"path\", {\n\t\td: \"M9 15l6 -6\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463\",\n\t\tkey: \"svg-2\"\n\t}]\n]), gm = $(\"outline\", \"list\", \"List\", [\n\t[\"path\", {\n\t\td: \"M9 6l11 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 12l11 0\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 18l11 0\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 6l0 .01\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 12l0 .01\",\n\t\tkey: \"svg-4\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 18l0 .01\",\n\t\tkey: \"svg-5\"\n\t}]\n]), _m = $(\"outline\", \"microphone\", \"Microphone\", [\n\t[\"path\", {\n\t\td: \"M9 5a3 3 0 0 1 3 -3a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3a3 3 0 0 1 -3 -3l0 -5\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 10a7 7 0 0 0 14 0\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M8 21l8 0\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M12 17l0 4\",\n\t\tkey: \"svg-3\"\n\t}]\n]), vm = $(\"outline\", \"movie\", \"Movie\", [\n\t[\"path\", {\n\t\td: \"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M8 4l0 16\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M16 4l0 16\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M4 8l4 0\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M4 16l4 0\",\n\t\tkey: \"svg-4\"\n\t}],\n\t[\"path\", {\n\t\td: \"M4 12l16 0\",\n\t\tkey: \"svg-5\"\n\t}],\n\t[\"path\", {\n\t\td: \"M16 8l4 0\",\n\t\tkey: \"svg-6\"\n\t}],\n\t[\"path\", {\n\t\td: \"M16 16l4 0\",\n\t\tkey: \"svg-7\"\n\t}]\n]), ym = $(\"outline\", \"player-pause\", \"PlayerPause\", [[\"path\", {\n\td: \"M6 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12\",\n\tkey: \"svg-0\"\n}], [\"path\", {\n\td: \"M14 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12\",\n\tkey: \"svg-1\"\n}]]), bm = $(\"outline\", \"player-play\", \"PlayerPlay\", [[\"path\", {\n\td: \"M7 4v16l13 -8l-13 -8\",\n\tkey: \"svg-0\"\n}]]), xm = $(\"outline\", \"rectangle\", \"Rectangle\", [[\"path\", {\n\td: \"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10\",\n\tkey: \"svg-0\"\n}]]), Sm = $(\"outline\", \"rotate\", \"Rotate\", [[\"path\", {\n\td: \"M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5\",\n\tkey: \"svg-0\"\n}]]), Cm = $(\"outline\", \"scissors\", \"Scissors\", [\n\t[\"path\", {\n\t\td: \"M3 7a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M3 17a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M8.6 8.6l10.4 10.4\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M8.6 15.4l10.4 -10.4\",\n\t\tkey: \"svg-3\"\n\t}]\n]), wm = $(\"outline\", \"sparkles\", \"Sparkles\", [[\"path\", {\n\td: \"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6\",\n\tkey: \"svg-0\"\n}]]), Tm = $(\"outline\", \"trash\", \"Trash\", [\n\t[\"path\", {\n\t\td: \"M4 7l16 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M10 11l0 6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M14 11l0 6\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\",\n\t\tkey: \"svg-4\"\n\t}]\n]), Em = $(\"outline\", \"unlink\", \"Unlink\", [\n\t[\"path\", {\n\t\td: \"M17 22v-2\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9 15l6 -6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463\",\n\t\tkey: \"svg-3\"\n\t}],\n\t[\"path\", {\n\t\td: \"M20 17h2\",\n\t\tkey: \"svg-4\"\n\t}],\n\t[\"path\", {\n\t\td: \"M2 7h2\",\n\t\tkey: \"svg-5\"\n\t}],\n\t[\"path\", {\n\t\td: \"M7 2v2\",\n\t\tkey: \"svg-6\"\n\t}]\n]), Dm = $(\"outline\", \"upload\", \"Upload\", [\n\t[\"path\", {\n\t\td: \"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M7 9l5 -5l5 5\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M12 4l0 12\",\n\t\tkey: \"svg-2\"\n\t}]\n]), Om = $(\"outline\", \"user-plus\", \"UserPlus\", [\n\t[\"path\", {\n\t\td: \"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M16 19h6\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M19 16v6\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M6 21v-2a4 4 0 0 1 4 -4h4\",\n\t\tkey: \"svg-3\"\n\t}]\n]), km = $(\"outline\", \"users\", \"Users\", [\n\t[\"path\", {\n\t\td: \"M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M16 3.13a4 4 0 0 1 0 7.75\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M21 21v-2a4 4 0 0 0 -3 -3.85\",\n\t\tkey: \"svg-3\"\n\t}]\n]), Am = $(\"outline\", \"volume-off\", \"VolumeOff\", [\n\t[\"path\", {\n\t\td: \"M15 8a5 5 0 0 1 1.912 4.934m-1.377 2.602a5 5 0 0 1 -.535 .464\",\n\t\tkey: \"svg-0\"\n\t}],\n\t[\"path\", {\n\t\td: \"M17.7 5a9 9 0 0 1 2.362 11.086m-1.676 2.299a9 9 0 0 1 -.686 .615\",\n\t\tkey: \"svg-1\"\n\t}],\n\t[\"path\", {\n\t\td: \"M9.069 5.054l.431 -.554a.8 .8 0 0 1 1.5 .5v2m0 4v8a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l1.294 -1.664\",\n\t\tkey: \"svg-2\"\n\t}],\n\t[\"path\", {\n\t\td: \"M3 3l18 18\",\n\t\tkey: \"svg-3\"\n\t}]\n]), jm = {\n\tarrowDown: Kp,\n\tarrowLeft: Jp,\n\tarrowRight: Yp,\n\tarrowUp: Xp,\n\tundo: Gp,\n\tredo: qp,\n\texpand: Zp,\n\tcollapse: Qp,\n\tbold: $p,\n\tbrush: em,\n\tcamera: tm,\n\tcheck: nm,\n\tcircle: rm,\n\tcopy: im,\n\tcost: am,\n\tdownload: om,\n\teraser: sm,\n\ttext: cm,\n\theading: lm,\n\thistory: um,\n\titalic: fm,\n\tmerge: pm,\n\tgrid: mm,\n\tlist: gm,\n\tmicrophone: _m,\n\tmovie: vm,\n\tpause: ym,\n\tplay: bm,\n\trectangle: xm,\n\treset: Sm,\n\tcut: Cm,\n\tgenerate: wm,\n\ttrash: Tm,\n\tupload: Dm,\n\tusers: km,\n\tinvite: Om,\n\tlink: hm,\n\tunlink: Em,\n\tinfo: dm,\n\tvolume: $(\"outline\", \"volume\", \"Volume\", [\n\t\t[\"path\", {\n\t\t\td: \"M15 8a5 5 0 0 1 0 8\",\n\t\t\tkey: \"svg-0\"\n\t\t}],\n\t\t[\"path\", {\n\t\t\td: \"M17.7 5a9 9 0 0 1 0 14\",\n\t\t\tkey: \"svg-1\"\n\t\t}],\n\t\t[\"path\", {\n\t\t\td: \"M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5\",\n\t\t\tkey: \"svg-2\"\n\t\t}]\n\t]),\n\tmute: Am,\n\tclose: $(\"outline\", \"x\", \"X\", [[\"path\", {\n\t\td: \"M18 6l-12 12\",\n\t\tkey: \"svg-0\"\n\t}], [\"path\", {\n\t\td: \"M6 6l12 12\",\n\t\tkey: \"svg-1\"\n\t}]])\n};\nfunction Mm({ name: e, size: t = 16 }) {\n\tlet r = jm[e];\n\treturn /* @__PURE__ */ n(r, {\n\t\tclassName: \"nodeIcon\",\n\t\tsize: t,\n\t\tstroke: 1.6,\n\t\t\"aria-hidden\": \"true\",\n\t\tfocusable: \"false\"\n\t});\n}\n//#endregion\n//#region src/reactView.tsx\nfunction Nm({ nodeId: e, controller: t, source: i, camera: a, stageRef: o }) {\n\tlet s = f(null), c = f(null), [l, u] = p({ phase: \"loading\" }), m = f(a);\n\treturn d(() => {\n\t\tlet n = new AbortController(), r = Up({\n\t\t\tcanvas: c.current,\n\t\t\tinteractive: !0\n\t\t});\n\t\to.current = r;\n\t\tlet a = new ResizeObserver(() => {\n\t\t\tlet e = Math.round(s.current?.getBoundingClientRect().width ?? 0);\n\t\t\te > 0 && r.setSize(e, Math.round(e * 9 / 16));\n\t\t});\n\t\treturn a.observe(s.current), (async () => {\n\t\t\ttry {\n\t\t\t\tlet a = await t.getNodeService(e).files.read(i.path, T, n.signal);\n\t\t\t\tawait r.load(a, i.format, n.signal), m.current ? r.setCamera(m.current) : r.frame(), u({ phase: \"ready\" });\n\t\t\t} catch (e) {\n\t\t\t\tn.signal.aborted || u({\n\t\t\t\t\tphase: \"error\",\n\t\t\t\t\tmessage: C(e)\n\t\t\t\t});\n\t\t\t}\n\t\t})(), () => {\n\t\t\tn.abort(), a.disconnect(), o.current === r && (o.current = void 0), r.dispose();\n\t\t};\n\t}, [i.path, i.sha256]), d(() => {\n\t\ta && l.phase === \"ready\" && o.current?.setCamera(a);\n\t}, [JSON.stringify(a ?? null), l.phase]), /* @__PURE__ */ r(\"div\", {\n\t\tref: s,\n\t\tclassName: \"gaussianSplatViewport nodrag nopan nowheel\",\n\t\tchildren: [/* @__PURE__ */ n(\"canvas\", {\n\t\t\tref: c,\n\t\t\ttabIndex: 0,\n\t\t\t\"aria-label\": \"Gaussian Splat 三维视图\"\n\t\t}), l.phase !== \"ready\" && /* @__PURE__ */ n(\"div\", {\n\t\t\tclassName: \"gaussianSplatOverlay\",\n\t\t\trole: l.phase === \"error\" ? \"alert\" : \"status\",\n\t\t\tchildren: l.phase === \"loading\" ? `正在加载 ${i.splatCount.toLocaleString(\"en-US\")} 个 Gaussian…` : l.message\n\t\t})]\n\t});\n}\nfunction Pm({ node: t, controller: i, readOnly: a }) {\n\tlet s = i.getNodeService(t.id), c = t.data ?? {}, l = c.splat ?? void 0, u = c.camera ?? void 0, d = c.splatRender ?? { status: \"idle\" }, m = c.outputs, h = s.getInputs(\"source\").some((e) => e.value), [g, _] = p(\"\"), [v, y] = p(!1), b = f(null), x = f(void 0), w = S(i, m?.image?.value), E = S(i, m?.video?.value), D = d.status === \"running\", A = a || v || D, j = (e, n = {}) => i.callNodeTool(t.id, e, n);\n\tasync function M(e) {\n\t\ty(!0), _(\"\");\n\t\ttry {\n\t\t\tawait e();\n\t\t} catch (e) {\n\t\t\t_(C(e));\n\t\t} finally {\n\t\t\ty(!1);\n\t\t}\n\t}\n\tasync function N(e) {\n\t\tif (!k(e.name)) throw Error(\"仅支持 .ply / .splat / .ksplat / .spz 扫描文件\");\n\t\tif (!e.size || e.size > T) throw Error(\"扫描文件须非空且不超过 100 MiB\");\n\t\tlet n = await o(s.files, t.id, e);\n\t\tawait j(\"setSplatSource\", { path: n });\n\t}\n\treturn /* @__PURE__ */ r(\"div\", {\n\t\tclassName: \"nodeControls gaussianSplatNode nodrag nopan nowheel\",\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ n(\"input\", {\n\t\t\t\tref: b,\n\t\t\t\tclassName: \"nodeFileInput\",\n\t\t\t\ttype: \"file\",\n\t\t\t\taccept: O,\n\t\t\t\t\"aria-label\": \"选择 Gaussian 扫描文件\",\n\t\t\t\tdisabled: A,\n\t\t\t\tonChange: (e) => {\n\t\t\t\t\tlet t = e.target.files?.[0];\n\t\t\t\t\te.target.value = \"\", t && M(() => N(t));\n\t\t\t\t}\n\t\t\t}),\n\t\t\tl ? /* @__PURE__ */ r(e, { children: [\n\t\t\t\t/* @__PURE__ */ n(Nm, {\n\t\t\t\t\tnodeId: t.id,\n\t\t\t\t\tcontroller: i,\n\t\t\t\t\tsource: l,\n\t\t\t\t\tcamera: u,\n\t\t\t\t\tstageRef: x\n\t\t\t\t}, l.sha256),\n\t\t\t\t/* @__PURE__ */ r(\"span\", {\n\t\t\t\t\tclassName: \"nodeStatus gaussianSplatMeta\",\n\t\t\t\t\ttitle: l.path,\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\tl.name,\n\t\t\t\t\t\t\" · \",\n\t\t\t\t\t\tl.format.toUpperCase(),\n\t\t\t\t\t\t\" · \",\n\t\t\t\t\t\tl.splatCount.toLocaleString(\"en-US\"),\n\t\t\t\t\t\t\" splats · \",\n\t\t\t\t\t\t(l.bytes / 1024 ** 2).toFixed(1),\n\t\t\t\t\t\t\" MiB\"\n\t\t\t\t\t]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ r(\"div\", {\n\t\t\t\t\tclassName: \"nodeActions\",\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t/* @__PURE__ */ r(\"button\", {\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tdisabled: A,\n\t\t\t\t\t\t\ttitle: \"把当前查看机位保存到节点；渲染与 Agent 默认使用它\",\n\t\t\t\t\t\t\tonClick: () => void M(async () => {\n\t\t\t\t\t\t\t\tlet e = x.current?.getCamera();\n\t\t\t\t\t\t\t\tif (!e) throw Error(\"视图尚未就绪\");\n\t\t\t\t\t\t\t\tawait j(\"setCamera\", { camera: e });\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, { name: \"camera\" }), \"保存机位\"]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t/* @__PURE__ */ r(\"button\", {\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tdisabled: A,\n\t\t\t\t\t\t\ttitle: \"按扫描包围球自动取景并保存\",\n\t\t\t\t\t\t\tonClick: () => void M(() => j(\"frameCamera\", {})),\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, { name: \"reset\" }), \"自动取景\"]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t/* @__PURE__ */ r(\"button\", {\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tclassName: \"nodePrimary\",\n\t\t\t\t\t\t\tdisabled: A,\n\t\t\t\t\t\t\ttitle: \"渲染 1280×720 PNG 到 image 端口\",\n\t\t\t\t\t\t\tonClick: () => void M(() => j(\"renderStill\", {})),\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, { name: \"camera\" }), \"渲染静帧\"]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t/* @__PURE__ */ r(\"button\", {\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tdisabled: A,\n\t\t\t\t\t\t\ttitle: \"后台渲染 4 秒 24fps 环绕视频到 video 端口（需要 FFmpeg）\",\n\t\t\t\t\t\t\tonClick: () => void M(() => j(\"renderTurntable\", {})),\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, { name: \"movie\" }), \"环绕视频\"]\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tD && /* @__PURE__ */ n(\"button\", {\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tdisabled: v,\n\t\t\t\t\t\t\tonClick: () => void M(() => j(\"cancelRender\", {})),\n\t\t\t\t\t\t\tchildren: \"取消\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\t/* @__PURE__ */ r(\"button\", {\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tdisabled: A,\n\t\t\t\t\t\t\ttitle: \"更换扫描文件\",\n\t\t\t\t\t\t\tonClick: () => b.current?.click(),\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, { name: \"upload\" }), \"更换\"]\n\t\t\t\t\t\t})\n\t\t\t\t\t]\n\t\t\t\t}),\n\t\t\t\tD && /* @__PURE__ */ r(\"span\", {\n\t\t\t\t\tclassName: \"nodeStatus\",\n\t\t\t\t\trole: \"status\",\n\t\t\t\t\tchildren: [d.phase ?? \"正在渲染\", typeof d.progress == \"number\" ? ` · ${d.progress}%` : \"\"]\n\t\t\t\t}),\n\t\t\t\td.status === \"interrupted\" && /* @__PURE__ */ n(\"span\", {\n\t\t\t\t\tclassName: \"nodeStatus\",\n\t\t\t\t\tchildren: \"上次渲染已中断，未发布产物\"\n\t\t\t\t}),\n\t\t\t\t(d.status === \"failed\" || d.status === \"cancelled\") && d.error && /* @__PURE__ */ n(\"p\", {\n\t\t\t\t\tclassName: \"nodeError\",\n\t\t\t\t\trole: \"alert\",\n\t\t\t\t\tchildren: d.error\n\t\t\t\t}),\n\t\t\t\t(w.url || E.url) && /* @__PURE__ */ r(\"div\", {\n\t\t\t\t\tclassName: \"gaussianSplatOutputs\",\n\t\t\t\t\tchildren: [w.url && /* @__PURE__ */ n(\"img\", {\n\t\t\t\t\t\tsrc: w.url,\n\t\t\t\t\t\talt: \"渲染静帧\"\n\t\t\t\t\t}), E.url && /* @__PURE__ */ n(\"video\", {\n\t\t\t\t\t\tsrc: E.url,\n\t\t\t\t\t\tcontrols: !0,\n\t\t\t\t\t\tmuted: !0,\n\t\t\t\t\t\tplaysInline: !0,\n\t\t\t\t\t\tpreload: \"metadata\"\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t] }) : /* @__PURE__ */ r(e, { children: [/* @__PURE__ */ r(\"button\", {\n\t\t\t\ttype: \"button\",\n\t\t\t\tclassName: \"nodeUploadArea\",\n\t\t\t\tdisabled: A,\n\t\t\t\tonClick: () => b.current?.click(),\n\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, {\n\t\t\t\t\tname: \"upload\",\n\t\t\t\t\tsize: 20\n\t\t\t\t}), \"选择 Gaussian 扫描（.ply / .splat / .ksplat / .spz）\"]\n\t\t\t}), h && /* @__PURE__ */ n(\"div\", {\n\t\t\t\tclassName: \"nodeActions\",\n\t\t\t\tchildren: /* @__PURE__ */ r(\"button\", {\n\t\t\t\t\ttype: \"button\",\n\t\t\t\t\tdisabled: A,\n\t\t\t\t\tonClick: () => void M(() => j(\"setSplatSource\", {})),\n\t\t\t\t\tchildren: [/* @__PURE__ */ n(Mm, { name: \"link\" }), \"使用上游文件\"]\n\t\t\t\t})\n\t\t\t})] }),\n\t\t\t(g || w.error || E.error) && /* @__PURE__ */ n(\"p\", {\n\t\t\t\tclassName: \"nodeError\",\n\t\t\t\trole: \"alert\",\n\t\t\t\tchildren: g || w.error || E.error\n\t\t\t})\n\t\t]\n\t});\n}\n//#endregion\n//#region src/reactPlugin.ts\nvar Fm = i.tuple([\n\ti.number().finite(),\n\ti.number().finite(),\n\ti.number().finite()\n]), Im = i.strictObject({\n\tposition: Fm.describe(\"相机位置，场景单位\"),\n\ttarget: Fm.describe(\"注视点\"),\n\tup: Fm.default([\n\t\t0,\n\t\t1,\n\t\t0\n\t]),\n\tfov: i.number().min(10).max(120).default(50).describe(\"垂直视角，度\")\n}), Lm = i.strictObject({\n\tpath: i.string(),\n\tformat: i.enum(w),\n\tbytes: i.number().int().positive(),\n\tsha256: i.string().regex(/^[a-f0-9]{64}$/),\n\tsplatCount: i.number().int().positive(),\n\tname: i.string()\n}), Rm = i.strictObject({\n\tmin: Fm,\n\tmax: Fm,\n\tcenter: Fm,\n\tradius: i.number()\n}), zm = i.strictObject({\n\tstatus: i.enum([\n\t\t\"idle\",\n\t\t\"running\",\n\t\t\"completed\",\n\t\t\"failed\",\n\t\t\"cancelled\",\n\t\t\"interrupted\"\n\t]),\n\tkind: i.enum([\"still\", \"turntable\"]).optional(),\n\tphase: i.string().optional(),\n\tprogress: i.number().min(0).max(100).optional(),\n\ttaskId: i.string().optional(),\n\terror: i.string().optional(),\n\toutput: v.optional()\n}), Bm = { expectedRevision: i.number().int().nonnegative().optional().describe(\"画布 documentRevision；省略时按当前修订写入\") }, Vm = i.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().default(Fp).describe(\"十六进制底色；null 为透明背景\"), Hm = {\n\treadOnlyHint: !0,\n\tdestructiveHint: !1,\n\tidempotentHint: !0,\n\topenWorldHint: !1\n}, Um = {\n\treadOnlyHint: !1,\n\tdestructiveHint: !1,\n\tidempotentHint: !1,\n\topenWorldHint: !1\n}, Wm = i.number().int().nonnegative();\nfunction Gm(e) {\n\tlet t = Lm.safeParse(e.splat);\n\treturn t.success ? t.data : void 0;\n}\nfunction Km(e) {\n\tlet t = Im.safeParse(e.camera);\n\treturn t.success ? t.data : void 0;\n}\nfunction qm(e) {\n\tlet t = zm.safeParse(e.splatRender);\n\treturn t.success ? t.data : { status: \"idle\" };\n}\nfunction Jm(e, t) {\n\tt.throwIfAborted();\n\tlet n = () => e.kill();\n\treturn t.addEventListener(\"abort\", n, { once: !0 }), new Promise((n, r) => {\n\t\te.on(\"start\", () => {\n\t\t\tt.aborted && e.kill();\n\t\t}), e.on(\"error\", r), e.on(\"end\", () => n()), e.run();\n\t}).finally(() => t.removeEventListener(\"abort\", n));\n}\nvar Ym = (e) => {\n\tif (e.response?.data?.data?.code !== \"EEXIST\") throw e;\n}, Xm = {\n\tapiVersion: 1,\n\tid: \"gaussianSplatNode\",\n\tname: \"Gaussian Splat\",\n\tversion: \"1.0.0\",\n\trenderer: \"react\",\n\ticon: \"spatial\",\n\tview: Pm,\n\tcreateData: () => ({\n\t\tlabel: \"Gaussian Splat\",\n\t\thandles: [\n\t\t\t{\n\t\t\t\tid: \"source\",\n\t\t\t\ttype: \"target\",\n\t\t\t\tdataType: \"FILE\",\n\t\t\t\tlabel: \"扫描文件 .ply / .splat / .ksplat / .spz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"image\",\n\t\t\t\ttype: \"source\",\n\t\t\t\tdataType: \"IMAGE\",\n\t\t\t\tlabel: \"渲染静帧\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"video\",\n\t\t\t\ttype: \"source\",\n\t\t\t\tdataType: \"VIDEO\",\n\t\t\t\tlabel: \"环绕视频\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"file\",\n\t\t\t\ttype: \"source\",\n\t\t\t\tdataType: \"FILE\",\n\t\t\t\tlabel: \"扫描文件\"\n\t\t\t}\n\t\t],\n\t\toutputs: {}\n\t}),\n\tcloneData(e) {\n\t\tlet t = structuredClone(e);\n\t\treturn qm(t).status === \"running\" && delete t.splatRender, t;\n\t},\n\tactivate(e) {\n\t\tlet { id: t, document: n, workbench: r } = x(e), s = r.files, l = {\n\t\t\tdirectory: r.directory,\n\t\t\tcanvasId: r.canvasId,\n\t\t\tnodeId: t\n\t\t}, u, d, f, p, m = () => b(n, t), h = () => m().outputs ?? {}, g = (e, t) => r.updateRuntimeData({ splatRender: e }, t).catch(() => {});\n\t\tfunction S() {\n\t\t\tlet e = Gm(m());\n\t\t\tif (!e) throw y(r, t, \"尚未选择扫描文件\", \"splatSourceRequired\", {\n\t\t\t\taction: \"readState\",\n\t\t\t\tmessage: \"先 getSplatInfo 读取当前状态；连接 FILE 输入或准备好工作区内的扫描文件后调用 setSplatSource。此前未启动任何渲染。\",\n\t\t\t\ttool: \"getSplatInfo\",\n\t\t\t\targs: {}\n\t\t\t});\n\t\t\treturn e;\n\t\t}\n\t\tfunction O() {\n\t\t\tif (p) throw new c({\n\t\t\t\tcode: \"renderBusy\",\n\t\t\t\tmessage: \"节点正在渲染，请等待完成或先取消\",\n\t\t\t\tphase: \"validation\",\n\t\t\t\texecutionState: \"notDispatched\",\n\t\t\t\ttarget: l,\n\t\t\t\trecovery: {\n\t\t\t\t\taction: \"readState\",\n\t\t\t\t\tmessage: \"用 getRenderStatus 观察进度，必要时 cancelRender 后重试\",\n\t\t\t\t\ttool: \"getRenderStatus\",\n\t\t\t\t\targs: {}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tasync function A(e, t) {\n\t\t\tlet n = s.readRange ? await s.readRange(e.path, 0, 1, void 0, t) : void 0;\n\t\t\tif (n && n.size !== e.bytes) throw Error(\"扫描文件已变化，字节数与记录不符；请重新调用 setSplatSource\");\n\t\t\tlet r = await s.read(e.path, T, t);\n\t\t\tif (r.byteLength !== e.bytes) throw Error(\"扫描文件读取不完整\");\n\t\t\treturn r;\n\t\t}\n\t\tfunction j() {\n\t\t\tclearTimeout(d), d = setTimeout(() => {\n\t\t\t\tp ? j() : M();\n\t\t\t}, 9e4);\n\t\t}\n\t\tasync function M() {\n\t\t\tclearTimeout(d);\n\t\t\tlet e = u;\n\t\t\tu = void 0, await e?.stage.dispose();\n\t\t}\n\t\tasync function N(e, t) {\n\t\t\tif (j(), u?.key === e.sha256) return u.stage;\n\t\t\tawait M();\n\t\t\tlet n = Up();\n\t\t\ttry {\n\t\t\t\tawait n.load(await A(e, t), e.format, t);\n\t\t\t} catch (e) {\n\t\t\t\tthrow await n.dispose().catch(() => {}), e;\n\t\t\t}\n\t\t\treturn u = {\n\t\t\t\tstage: n,\n\t\t\t\tkey: e.sha256\n\t\t\t}, j(), n;\n\t\t}\n\t\te.onDispose(async () => {\n\t\t\tf?.abort(/* @__PURE__ */ Error(\"节点已卸载\")), await p?.catch(() => {}), await M();\n\t\t}), e.onBeforeChange(async () => {\n\t\t\tf?.abort(/* @__PURE__ */ Error(\"节点即将变更\")), await p?.catch(() => {});\n\t\t}), e.registerTool({\n\t\t\tname: \"getSplatInfo\",\n\t\t\tannotations: Hm,\n\t\t\tdescription: \"读取当前扫描来源（路径、格式、字节数、SHA-256、Gaussian 数量）、已保存机位、渲染状态、三个输出端口与已连接的 FILE 输入；不读文件内容、不渲染。先调用它再决定下一步。\",\n\t\t\tparameters: i.strictObject({}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tsource: Lm.nullable(),\n\t\t\t\tcamera: Im.nullable(),\n\t\t\t\trender: zm,\n\t\t\t\toutputs: i.strictObject({\n\t\t\t\t\timage: v.optional(),\n\t\t\t\t\tvideo: v.optional(),\n\t\t\t\t\tfile: v.optional()\n\t\t\t\t}),\n\t\t\t\tconnectedInput: v.nullable(),\n\t\t\t\tlimits: i.strictObject({\n\t\t\t\t\tmaximumBytes: i.number(),\n\t\t\t\t\tmaximumSplats: i.number(),\n\t\t\t\t\tformats: i.array(i.string())\n\t\t\t\t}),\n\t\t\t\trevision: Wm\n\t\t\t}),\n\t\t\texecute() {\n\t\t\t\tlet e = m(), t = h(), i = (e) => {\n\t\t\t\t\tlet n = v.safeParse(t[e]?.value);\n\t\t\t\t\treturn n.success ? n.data : void 0;\n\t\t\t\t}, a = r.getInputs(\"source\").map((e) => v.safeParse(e.value)).find((e) => e.success);\n\t\t\t\treturn {\n\t\t\t\t\tsource: Gm(e) ?? null,\n\t\t\t\t\tcamera: Km(e) ?? null,\n\t\t\t\t\trender: F(),\n\t\t\t\t\toutputs: {\n\t\t\t\t\t\timage: i(\"image\"),\n\t\t\t\t\t\tvideo: i(\"video\"),\n\t\t\t\t\t\tfile: i(\"file\")\n\t\t\t\t\t},\n\t\t\t\t\tconnectedInput: a?.success ? a.data : null,\n\t\t\t\t\tlimits: {\n\t\t\t\t\t\tmaximumBytes: T,\n\t\t\t\t\t\tmaximumSplats: E,\n\t\t\t\t\t\tformats: [...w]\n\t\t\t\t\t},\n\t\t\t\t\trevision: n.getRevision()\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\tfunction F() {\n\t\t\tlet e = qm(m());\n\t\t\treturn e.status === \"running\" && !p ? {\n\t\t\t\t...e,\n\t\t\t\tstatus: \"interrupted\",\n\t\t\t\terror: \"渲染在页面重载或节点重建时中断，未发布产物\"\n\t\t\t} : e;\n\t\t}\n\t\te.registerTool({\n\t\t\tname: \"setSplatSource\",\n\t\t\tannotations: Um,\n\t\t\tdescription: \"选择扫描文件：传入工作区相对路径，或省略 path 使用已连接的 FILE 输入。按扩展名识别 ply/splat/ksplat/spz，校验结构并记录 SHA-256 与 Gaussian 数量，写入 file 输出端口；更换来源会清除旧机位与旧渲染输出。上限 100 MiB、2,000,000 个 Gaussian。\",\n\t\t\tparameters: i.strictObject({\n\t\t\t\tpath: _.optional().describe(\"工作区内的扫描文件；省略时使用连接到 source 端口的 FILE\"),\n\t\t\t\t...Bm\n\t\t\t}),\n\t\t\toutputSchema: Lm.extend({ revision: Wm }),\n\t\t\tasync execute(i, { signal: a }) {\n\t\t\t\tr.assertWritable(i.expectedRevision), O();\n\t\t\t\tlet o = AbortSignal.any([e.signal, a]), c = i.path, l;\n\t\t\t\tif (!c) {\n\t\t\t\t\tlet e = r.getInputs(\"source\"), n = e.map((e) => v.safeParse(e.value)).find((e) => e.success)?.data;\n\t\t\t\t\tif (!n) throw y(r, t, e.length ? \"上游节点尚未提供文件\" : \"未连接 FILE 输入，也未提供 path\", \"splatSourceRequired\");\n\t\t\t\t\tc = n.url, l = n.mimeType;\n\t\t\t\t}\n\t\t\t\tlet d = k(c);\n\t\t\t\tif (!d) throw Error(\"仅支持 .ply / .splat / .ksplat / .spz 扫描文件\");\n\t\t\t\tlet f = s.readRange ? await s.readRange(c, 0, 1, void 0, o) : void 0;\n\t\t\t\tif (f && (!f.size || f.size > T)) throw Error(\"扫描文件须非空且不超过 100 MiB\");\n\t\t\t\tlet p = await P(await s.read(c, T, o), d, o), m = {\n\t\t\t\t\tpath: c,\n\t\t\t\t\tformat: d,\n\t\t\t\t\t...p,\n\t\t\t\t\tname: c.split(\"/\").at(-1) ?? c\n\t\t\t\t};\n\t\t\t\tr.assertWritable(i.expectedRevision);\n\t\t\t\tlet { image: _, video: b, ...x } = h(), S = l && l !== \"application/octet-stream\" ? l : D[d];\n\t\t\t\treturn await r.updateData({\n\t\t\t\t\tsplat: m,\n\t\t\t\t\tcamera: null,\n\t\t\t\t\toutputs: {\n\t\t\t\t\t\t...x,\n\t\t\t\t\t\tfile: {\n\t\t\t\t\t\t\tdataType: \"FILE\",\n\t\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t\turl: c,\n\t\t\t\t\t\t\t\tmimeType: S\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, i.expectedRevision, o), await g({ status: \"idle\" }), u && u.key !== m.sha256 && await M(), await n.save(), {\n\t\t\t\t\t...m,\n\t\t\t\t\trevision: n.getRevision()\n\t\t\t\t};\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"getCamera\",\n\t\t\tannotations: Hm,\n\t\t\tdescription: \"读取已保存机位（位置、注视点、上方向、垂直视角）与画布修订；未保存时返回 null。\",\n\t\t\tparameters: i.strictObject({}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tcamera: Im.nullable(),\n\t\t\t\trevision: Wm\n\t\t\t}),\n\t\t\texecute() {\n\t\t\t\treturn {\n\t\t\t\t\tcamera: Km(m()) ?? null,\n\t\t\t\t\trevision: n.getRevision()\n\t\t\t\t};\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"setCamera\",\n\t\t\tannotations: Um,\n\t\t\tdescription: \"保存机位，纳入画布历史；节点视图随即切到该机位，后续 renderStill 默认使用它。\",\n\t\t\tparameters: i.strictObject({\n\t\t\t\tcamera: Im,\n\t\t\t\t...Bm\n\t\t\t}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tcamera: Im,\n\t\t\t\trevision: Wm\n\t\t\t}),\n\t\t\tasync execute(e, { signal: t }) {\n\t\t\t\treturn r.assertWritable(e.expectedRevision), S(), await r.updateData({ camera: e.camera }, e.expectedRevision, t), await n.save(), {\n\t\t\t\t\tcamera: e.camera,\n\t\t\t\t\trevision: n.getRevision()\n\t\t\t\t};\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"frameCamera\",\n\t\t\tannotations: Um,\n\t\t\tdescription: \"加载扫描并按 2%–98% 分位包围球自动取景：azimuthDeg 绕竖直轴、elevationDeg 向上为正、distanceScale 1 刚好装进画面。返回机位与包围盒；save 为 true 时保存为当前机位。需要 WebGL，首次调用会读取整份文件。\",\n\t\t\tparameters: i.strictObject({\n\t\t\t\tazimuthDeg: i.number().min(-360).max(360).default(35),\n\t\t\t\televationDeg: i.number().min(-89).max(89).default(18),\n\t\t\t\tdistanceScale: i.number().min(.2).max(10).default(1),\n\t\t\t\taspect: i.number().min(.2).max(5).default(16 / 9),\n\t\t\t\tfov: i.number().min(10).max(120).default(50),\n\t\t\t\tsave: i.boolean().default(!0),\n\t\t\t\t...Bm\n\t\t\t}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tcamera: Im,\n\t\t\t\tbounds: Rm,\n\t\t\t\tsplatCount: i.number().int(),\n\t\t\t\tsaved: i.boolean(),\n\t\t\t\trevision: Wm\n\t\t\t}),\n\t\t\tasync execute(t, { signal: i }) {\n\t\t\t\tt.save && r.assertWritable(t.expectedRevision);\n\t\t\t\tlet a = S();\n\t\t\t\tO();\n\t\t\t\tlet o = AbortSignal.any([e.signal, i]), s = await N(a, o), c = s.getBounds(), l = Vp(c, t.fov, t.aspect, t);\n\t\t\t\treturn t.save && (r.assertWritable(t.expectedRevision), await r.updateData({ camera: l }, t.expectedRevision, o), await n.save()), {\n\t\t\t\t\tcamera: l,\n\t\t\t\t\tbounds: c,\n\t\t\t\t\tsplatCount: s.getSplatCount(),\n\t\t\t\t\tsaved: t.save,\n\t\t\t\t\trevision: n.getRevision()\n\t\t\t\t};\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"renderStill\",\n\t\t\tannotations: Um,\n\t\t\tdescription: \"用本机 WebGL 渲染一张 PNG 静帧并写入 image 端口：camera 省略时用已保存机位，都没有时自动取景并保存该机位。同步返回产物路径；不调用生成模型。\",\n\t\t\tparameters: i.strictObject({\n\t\t\t\twidth: i.number().int().min(64).max(4096).default(1280),\n\t\t\t\theight: i.number().int().min(64).max(4096).default(720),\n\t\t\t\tcamera: Im.optional(),\n\t\t\t\tbackground: Vm,\n\t\t\t\t...Bm\n\t\t\t}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tpath: i.string(),\n\t\t\t\tmimeType: i.literal(\"image/png\"),\n\t\t\t\twidth: i.number().int(),\n\t\t\t\theight: i.number().int(),\n\t\t\t\tcamera: Im,\n\t\t\t\trevision: Wm\n\t\t\t}),\n\t\t\tasync execute(i, { signal: a }) {\n\t\t\t\tr.assertWritable(i.expectedRevision);\n\t\t\t\tlet c = S();\n\t\t\t\tO(), f = new AbortController();\n\t\t\t\tlet l = AbortSignal.any([\n\t\t\t\t\te.signal,\n\t\t\t\t\tf.signal,\n\t\t\t\t\ta\n\t\t\t\t]), u = p = (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait g({\n\t\t\t\t\t\t\tstatus: \"running\",\n\t\t\t\t\t\t\tkind: \"still\",\n\t\t\t\t\t\t\tphase: \"正在加载扫描\",\n\t\t\t\t\t\t\tprogress: 0\n\t\t\t\t\t\t}, l);\n\t\t\t\t\t\tlet e = await N(c, l), a = Km(m()), u = i.camera ?? a ?? Vp(e.getBounds(), 50, i.width / i.height);\n\t\t\t\t\t\tawait g({\n\t\t\t\t\t\t\tstatus: \"running\",\n\t\t\t\t\t\t\tkind: \"still\",\n\t\t\t\t\t\t\tphase: \"正在渲染\",\n\t\t\t\t\t\t\tprogress: 40\n\t\t\t\t\t\t}, l);\n\t\t\t\t\t\tlet d = await e.capturePng(i.width, i.height, {\n\t\t\t\t\t\t\tcamera: u,\n\t\t\t\t\t\t\tbackground: i.background\n\t\t\t\t\t\t}, l);\n\t\t\t\t\t\tif (d.size > 64 * 1024 ** 2) throw Error(\"PNG 超过 64 MiB，请降低尺寸\");\n\t\t\t\t\t\tlet f = await o(s, t, new File([d], \"still.png\", { type: \"image/png\" }));\n\t\t\t\t\t\tl.throwIfAborted(), r.assertWritable(i.expectedRevision);\n\t\t\t\t\t\tlet p = {\n\t\t\t\t\t\t\turl: f,\n\t\t\t\t\t\t\tmimeType: \"image/png\"\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn await r.updateData({\n\t\t\t\t\t\t\toutputs: {\n\t\t\t\t\t\t\t\t...h(),\n\t\t\t\t\t\t\t\timage: {\n\t\t\t\t\t\t\t\t\tdataType: \"IMAGE\",\n\t\t\t\t\t\t\t\t\tvalue: p\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t...a || i.camera ? {} : { camera: u }\n\t\t\t\t\t\t}, i.expectedRevision, l), await g({\n\t\t\t\t\t\t\tstatus: \"completed\",\n\t\t\t\t\t\t\tkind: \"still\",\n\t\t\t\t\t\t\tprogress: 100,\n\t\t\t\t\t\t\toutput: p\n\t\t\t\t\t\t}), await n.save(), {\n\t\t\t\t\t\t\tpath: f,\n\t\t\t\t\t\t\tmimeType: \"image/png\",\n\t\t\t\t\t\t\twidth: i.width,\n\t\t\t\t\t\t\theight: i.height,\n\t\t\t\t\t\t\tcamera: u,\n\t\t\t\t\t\t\trevision: n.getRevision()\n\t\t\t\t\t\t};\n\t\t\t\t\t} catch (t) {\n\t\t\t\t\t\tthrow e.signal.aborted || await g({\n\t\t\t\t\t\t\tstatus: l.aborted ? \"cancelled\" : \"failed\",\n\t\t\t\t\t\t\tkind: \"still\",\n\t\t\t\t\t\t\terror: C(t)\n\t\t\t\t\t\t}), t;\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\ttry {\n\t\t\t\t\treturn await u;\n\t\t\t\t} finally {\n\t\t\t\t\tp === u && (p = void 0, f = void 0), j();\n\t\t\t\t}\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"renderTurntable\",\n\t\t\tannotations: Um,\n\t\t\tdescription: \"后台渲染一段环绕扫描中心的 H.264 MP4（无声）并写入 video 端口：逐帧 WebGL 截图，再由本机 FFmpeg 编码。立即返回 taskId，用 getRenderStatus 跟踪、cancelRender 取消；最多 600 帧。需要已配置 FFmpeg。\",\n\t\t\tparameters: i.strictObject({\n\t\t\t\tseconds: i.number().min(1).max(20).default(4),\n\t\t\t\tfps: i.number().int().min(1).max(30).default(24),\n\t\t\t\twidth: i.number().int().min(64).max(1920).default(1280),\n\t\t\t\theight: i.number().int().min(64).max(1920).default(720),\n\t\t\t\televationDeg: i.number().min(-89).max(89).default(15),\n\t\t\t\tdistanceScale: i.number().min(.2).max(10).default(1),\n\t\t\t\tstartAzimuthDeg: i.number().min(-360).max(360).default(35),\n\t\t\t\tclockwise: i.boolean().default(!0),\n\t\t\t\tbackground: Vm,\n\t\t\t\t...Bm\n\t\t\t}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tstatus: i.literal(\"queued\"),\n\t\t\t\ttaskId: i.string(),\n\t\t\t\tframes: i.number().int(),\n\t\t\t\texecutionSettled: i.literal(!1)\n\t\t\t}),\n\t\t\tasync execute(i, { signal: o }) {\n\t\t\t\tr.assertWritable(i.expectedRevision);\n\t\t\t\tlet c = S();\n\t\t\t\tO();\n\t\t\t\tlet l = Math.round(i.seconds * i.fps);\n\t\t\t\tif (l < 1 || l > 600) throw Error(\"环绕视频最多 600 帧（seconds × fps）\");\n\t\t\t\tlet u = crypto.randomUUID();\n\t\t\t\tf = new AbortController();\n\t\t\t\tlet d = AbortSignal.any([e.signal, f.signal]);\n\t\t\t\to.throwIfAborted();\n\t\t\t\tlet m = await r.ffmpeg(d), _ = `${a(t)}/turntable-${u}`, v = p = (async () => {\n\t\t\t\t\tlet o = !1, f = !0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait g({\n\t\t\t\t\t\t\tstatus: \"running\",\n\t\t\t\t\t\t\tkind: \"turntable\",\n\t\t\t\t\t\t\tphase: \"正在加载扫描\",\n\t\t\t\t\t\t\tprogress: 0,\n\t\t\t\t\t\t\ttaskId: u\n\t\t\t\t\t\t}, d);\n\t\t\t\t\t\tlet e = await N(c, d), p = e.getBounds();\n\t\t\t\t\t\tfor (let e of [\"assets\", a(t)]) await s.mkdir(e).catch(Ym);\n\t\t\t\t\t\tawait s.mkdir(_), o = !0;\n\t\t\t\t\t\tlet v = 0;\n\t\t\t\t\t\tfor (let t = 0; t < l; t++) {\n\t\t\t\t\t\t\td.throwIfAborted();\n\t\t\t\t\t\t\tlet n = i.startAzimuthDeg + (i.clockwise ? -1 : 1) * 360 * t / l, r = Vp(p, 50, i.width / i.height, {\n\t\t\t\t\t\t\t\tazimuthDeg: n,\n\t\t\t\t\t\t\t\televationDeg: i.elevationDeg,\n\t\t\t\t\t\t\t\tdistanceScale: i.distanceScale\n\t\t\t\t\t\t\t}), a = await e.capturePng(i.width, i.height, {\n\t\t\t\t\t\t\t\tcamera: r,\n\t\t\t\t\t\t\t\tbackground: i.background\n\t\t\t\t\t\t\t}, d);\n\t\t\t\t\t\t\tif (v += a.size, v > 512 * 1024 ** 2) throw Error(\"渲染帧合计超过 512 MiB，请缩短时长或降低尺寸\");\n\t\t\t\t\t\t\tawait s.write(`${_}/frame${String(t).padStart(5, \"0\")}.png`, a, !0), await g({\n\t\t\t\t\t\t\t\tstatus: \"running\",\n\t\t\t\t\t\t\t\tkind: \"turntable\",\n\t\t\t\t\t\t\t\tphase: `正在渲染 ${t + 1}/${l}`,\n\t\t\t\t\t\t\t\tprogress: Math.round((t + 1) / l * 85),\n\t\t\t\t\t\t\t\ttaskId: u\n\t\t\t\t\t\t\t}, d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait g({\n\t\t\t\t\t\t\tstatus: \"running\",\n\t\t\t\t\t\t\tkind: \"turntable\",\n\t\t\t\t\t\t\tphase: \"正在用本机 FFmpeg 编码\",\n\t\t\t\t\t\t\tprogress: 90,\n\t\t\t\t\t\t\ttaskId: u\n\t\t\t\t\t\t}, d);\n\t\t\t\t\t\tlet y = `${a(t)}/${crypto.randomUUID()}.mp4`;\n\t\t\t\t\t\tf = !1, await Jm(m(`${_}/frame%05d.png`, { timeout: 300 }).inputFormat(\"image2\").inputOptions(\"-framerate\", String(i.fps), \"-start_number\", \"0\").noAudio().frames(l).videoCodec(\"libx264\").videoFilters(\"pad=ceil(iw/2)*2:ceil(ih/2)*2\").output(y).format(\"mp4\").outputOptions(\"-preset\", \"veryfast\", \"-crf\", \"18\", \"-pix_fmt\", \"yuv420p\", \"-movflags\", \"+faststart\"), d), f = !0, d.throwIfAborted(), r.assertWritable();\n\t\t\t\t\t\tlet b = {\n\t\t\t\t\t\t\turl: y,\n\t\t\t\t\t\t\tmimeType: \"video/mp4\"\n\t\t\t\t\t\t};\n\t\t\t\t\t\tawait r.updateData({\n\t\t\t\t\t\t\toutputs: {\n\t\t\t\t\t\t\t\t...h(),\n\t\t\t\t\t\t\t\tvideo: {\n\t\t\t\t\t\t\t\t\tdataType: \"VIDEO\",\n\t\t\t\t\t\t\t\t\tvalue: b\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tturntable: {\n\t\t\t\t\t\t\t\tseconds: i.seconds,\n\t\t\t\t\t\t\t\tfps: i.fps,\n\t\t\t\t\t\t\t\twidth: i.width,\n\t\t\t\t\t\t\t\theight: i.height,\n\t\t\t\t\t\t\t\televationDeg: i.elevationDeg,\n\t\t\t\t\t\t\t\tdistanceScale: i.distanceScale,\n\t\t\t\t\t\t\t\tstartAzimuthDeg: i.startAzimuthDeg,\n\t\t\t\t\t\t\t\tclockwise: i.clockwise,\n\t\t\t\t\t\t\t\tframes: l\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, void 0, d), await g({\n\t\t\t\t\t\t\tstatus: \"completed\",\n\t\t\t\t\t\t\tkind: \"turntable\",\n\t\t\t\t\t\t\tprogress: 100,\n\t\t\t\t\t\t\ttaskId: u,\n\t\t\t\t\t\t\toutput: b\n\t\t\t\t\t\t}), await n.save();\n\t\t\t\t\t} catch (t) {\n\t\t\t\t\t\tthrow e.signal.aborted || await g({\n\t\t\t\t\t\t\tstatus: d.aborted ? \"cancelled\" : \"failed\",\n\t\t\t\t\t\t\tkind: \"turntable\",\n\t\t\t\t\t\t\ttaskId: u,\n\t\t\t\t\t\t\terror: C(t)\n\t\t\t\t\t\t}), t;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\to && f && await s.remove(_, !0).catch(() => {});\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\treturn v.catch(() => {}).finally(() => {\n\t\t\t\t\tp === v && (p = void 0, f = void 0), j();\n\t\t\t\t}), {\n\t\t\t\t\tstatus: \"queued\",\n\t\t\t\t\ttaskId: u,\n\t\t\t\t\tframes: l,\n\t\t\t\t\texecutionSettled: !1\n\t\t\t\t};\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"getRenderStatus\",\n\t\t\tannotations: Hm,\n\t\t\tdescription: \"读取真实渲染状态：idle、running（含 phase/progress）、completed（含 output）、failed、cancelled；页面重载后中断的任务显示为 interrupted，不会显示为仍在运行。\",\n\t\t\tparameters: i.strictObject({}),\n\t\t\toutputSchema: zm,\n\t\t\texecute() {\n\t\t\t\treturn F();\n\t\t\t}\n\t\t}), e.registerTool({\n\t\t\tname: \"cancelRender\",\n\t\t\tannotations: {\n\t\t\t\treadOnlyHint: !1,\n\t\t\t\tdestructiveHint: !1,\n\t\t\t\tidempotentHint: !0,\n\t\t\t\topenWorldHint: !1\n\t\t\t},\n\t\t\tdescription: \"取消正在进行的静帧或环绕视频渲染；已发布的输出不受影响。\",\n\t\t\tparameters: i.strictObject({}),\n\t\t\toutputSchema: i.strictObject({\n\t\t\t\tcancelRequested: i.boolean(),\n\t\t\t\tbusy: i.boolean()\n\t\t\t}),\n\t\t\texecute() {\n\t\t\t\tlet e = !!p;\n\t\t\t\treturn f?.abort(/* @__PURE__ */ Error(\"用户取消渲染\")), {\n\t\t\t\t\tcancelRequested: e,\n\t\t\t\t\tbusy: e\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region \\0openCinemaReactEntry\nif (Xm.id !== \"gaussianSplatNode\" || Xm.renderer !== \"react\" || Xm.apiVersion !== 1) throw Error(\"插件源码合同与发行入口不一致\");\nvar Zm = {\n\t...Xm,\n\tversion: \"1.0.0\",\n\tname: \"Gaussian Splat\",\n\tscope: \"node\",\n\trequires: {\n\t\tworkspaceFiles: 1,\n\t\tworkspaceReadRange: 1,\n\t\tnodeHistory: 1,\n\t\tffmpeg: 1,\n\t\tworker: 1,\n\t\t...Xm.requires\n\t}\n};\n//#endregion\nexport { Zm as default };\n","assets":[{"path":"assets/ad9acbcea.css","base64":"Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9sc3ttaW4td2lkdGg6MDtjb2xvcjp2YXIoLS10ZXh0UHJpbWFyeSwjZThlYWVkKTtmb250LWZhbWlseTp2YXIoLS1mb250VWkpO2ZvbnQtc2l6ZTp2YXIoLS1mb250U2l6ZUJvZHkpO2ZvbnQtd2VpZ2h0OnZhcigtLWZvbnRXZWlnaHRCb2R5KTtsaW5lLWhlaWdodDp2YXIoLS1saW5lSGVpZ2h0Qm9keSk7dGV4dC1hbGlnbjpsZWZ0O2dhcDoxMHB4O3BhZGRpbmc6MDtkaXNwbGF5OmdyaWR9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBidXR0b24sLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBpbnB1dCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHNlbGVjdCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHRleHRhcmVhLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgYXtmb250OmluaGVyaXR9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBidXR0b24sLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBzZWxlY3QsLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBpbnB1dCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHRleHRhcmVhe2JvcmRlcjoxcHggc29saWQgdmFyKC0tYm9yZGVyU3VidGxlLCMzNDM4NDApO2JvcmRlci1yYWRpdXM6dmFyKC0tcmFkaXVzQ29udHJvbCk7YmFja2dyb3VuZDp2YXIoLS1zdXJmYWNlVG9vbGJhciwjMTgxYTFmKTttaW4td2lkdGg6MDtjb2xvcjppbmhlcml0O3RyYW5zaXRpb246YmFja2dyb3VuZC1jb2xvciB2YXIoLS1tb3Rpb25Db250cm9sKSB2YXIoLS1lYXNlU3RhbmRhcmQpLCBib3JkZXItY29sb3IgdmFyKC0tbW90aW9uQ29udHJvbCkgdmFyKC0tZWFzZVN0YW5kYXJkKSwgY29sb3IgdmFyKC0tbW90aW9uQ29udHJvbCkgdmFyKC0tZWFzZVN0YW5kYXJkKSwgb3BhY2l0eSB2YXIoLS1tb3Rpb25GYXN0KSB2YXIoLS1lYXNlU3RhbmRhcmQpO3BhZGRpbmc6OHB4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgYnV0dG9ue21pbi1oZWlnaHQ6dmFyKC0tY29udHJvbE1pblRhcmdldCk7Y3Vyc29yOnBvaW50ZXI7d2hpdGUtc3BhY2U6bm93cmFwO3RvdWNoLWFjdGlvbjptYW5pcHVsYXRpb259Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBidXR0b246aG92ZXI6bm90KDpkaXNhYmxlZCl7Ym9yZGVyLWNvbG9yOnZhcigtLWJvcmRlclN0cm9uZyk7YmFja2dyb3VuZDp2YXIoLS1zdXJmYWNlSG92ZXIpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgYnV0dG9uOmFjdGl2ZTpub3QoOmRpc2FibGVkKXtiYWNrZ3JvdW5kOnZhcigtLXN1cmZhY2VQcmVzc2VkKX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGJ1dHRvbjpkaXNhYmxlZCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHNlbGVjdDpkaXNhYmxlZCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGlucHV0OmRpc2FibGVkLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgdGV4dGFyZWE6ZGlzYWJsZWR7b3BhY2l0eTp2YXIoLS1kaXNhYmxlZE9wYWNpdHkpO2N1cnNvcjpub3QtYWxsb3dlZH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIDpmb2N1cy12aXNpYmxle291dGxpbmU6dmFyKC0tZm9jdXNSaW5nKTtvdXRsaW5lLW9mZnNldDp2YXIoLS1mb2N1c09mZnNldCl9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBpbnB1dCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHNlbGVjdCwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHRleHRhcmVhe2FjY2VudC1jb2xvcjp2YXIoLS1hY3Rpb25QcmltYXJ5KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGlucHV0OjpwbGFjZWhvbGRlciwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHNlbGVjdDo6cGxhY2Vob2xkZXIsLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyB0ZXh0YXJlYTo6cGxhY2Vob2xkZXJ7Y29sb3I6dmFyKC0tdGV4dE11dGVkKTtvcGFjaXR5OjF9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBpbnB1dDpmb2N1cy12aXNpYmxlLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgc2VsZWN0OmZvY3VzLXZpc2libGUsLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyB0ZXh0YXJlYTpmb2N1cy12aXNpYmxle2JvcmRlci1jb2xvcjp2YXIoLS1zZWxlY3Rpb25BY2NlbnQpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgaW5wdXRbYXJpYS1pbnZhbGlkPXRydWVdLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgc2VsZWN0W2FyaWEtaW52YWxpZD10cnVlXSwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHRleHRhcmVhW2FyaWEtaW52YWxpZD10cnVlXXtib3JkZXItY29sb3I6dmFyKC0tc3RhdHVzRXJyb3IpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgaW5wdXRbcmVhZG9ubHldLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgc2VsZWN0W3JlYWRvbmx5XSwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIHRleHRhcmVhW3JlYWRvbmx5XXtjb2xvcjp2YXIoLS10ZXh0U2Vjb25kYXJ5KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGlucHV0W3R5cGU9bnVtYmVyXXtmb250LXZhcmlhbnQtbnVtZXJpYzp0YWJ1bGFyLW51bXN9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBpbnB1dFt0eXBlPXJhbmdlXXttaW4taGVpZ2h0OnZhcigtLWNvbnRyb2xNaW5UYXJnZXQpO2JhY2tncm91bmQ6MCAwO2JvcmRlcjowO3BhZGRpbmc6MH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGlucHV0W3R5cGU9Y2hlY2tib3hdLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgaW5wdXRbdHlwZT1yYWRpb117dmVydGljYWwtYWxpZ246bWlkZGxlO3dpZHRoOjE0cHg7aGVpZ2h0OjE0cHg7bWFyZ2luOjA7cGFkZGluZzowfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgaW5wdXRbdHlwZT1jb2xvcl17bWluLWhlaWdodDozMnB4O3BhZGRpbmc6NHB4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgYXtjb2xvcjppbmhlcml0O3RleHQtZGVjb3JhdGlvbjpub25lfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgYnV0dG9uPnN2Z3tmbGV4LXNocmluazowfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMubm9kZUF1ZGlvUGxheWVyPmRpdjpoYXMoPmlucHV0W3R5cGU9cmFuZ2VdOmZvY3VzLXZpc2libGUpe291dGxpbmU6dmFyKC0tZm9jdXNSaW5nKTtvdXRsaW5lLW9mZnNldDp2YXIoLS1mb2N1c09mZnNldCk7Ym9yZGVyLXJhZGl1czp2YXIoLS1yYWRpdXNDb21wYWN0KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlRmlsZUlucHV0e2Rpc3BsYXk6bm9uZX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlTWVkaWFGcmFtZXttaW4td2lkdGg6MDtwb3NpdGlvbjpyZWxhdGl2ZX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlTWVkaWFGcmFtZTpob3ZlciAubm9kZU1lZGlhVG9vbGJhckNvbXBhY3QsLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZU1lZGlhRnJhbWU6Zm9jdXMtd2l0aGluIC5ub2RlTWVkaWFUb29sYmFyQ29tcGFjdHtvcGFjaXR5OjE7cG9pbnRlci1ldmVudHM6YXV0b30ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlTWVkaWFTdGFnZXtib3JkZXItcmFkaXVzOnZhcigtLXJhZGl1c0NvbnRyb2wpO2JhY2tncm91bmQ6dmFyKC0tc3VyZmFjZU1lZGlhKTtwbGFjZS1pdGVtczpjZW50ZXI7bWluLXdpZHRoOjA7bWluLWhlaWdodDoxMjBweDtkaXNwbGF5OmdyaWQ7b3ZlcmZsb3c6aGlkZGVufS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVNZWRpYXtvYmplY3QtZml0OmNvbnRhaW47d2lkdGg6MTAwJTttYXgtd2lkdGg6MTAwJTttYXgtaGVpZ2h0OjMyMHB4O2Rpc3BsYXk6YmxvY2t9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVZpZGVvUHJldmlld3tiYWNrZ3JvdW5kOnZhcigtLXN1cmZhY2VNZWRpYSk7Ym9yZGVyLXJhZGl1czppbmhlcml0O3BsYWNlLWl0ZW1zOmNlbnRlcjt3aWR0aDoxMDAlO21pbi13aWR0aDowO21heC1oZWlnaHQ6MzIwcHg7ZGlzcGxheTpncmlkO3Bvc2l0aW9uOnJlbGF0aXZlO292ZXJmbG93OmhpZGRlbn0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlVmlkZW9QcmV2aWV3PnZpZGVvLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVWaWRlb1ByZXZpZXc+aW1ne29iamVjdC1maXQ6Y29udGFpbjt3aWR0aDoxMDAlO2hlaWdodDoxMDAlO21pbi1oZWlnaHQ6MH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlVmlkZW9QcmV2aWV3IC5ub2RlVmlkZW9QcmV2aWV3U3RhdHVze2NvbG9yOnZhcigtLXRleHRTZWNvbmRhcnkpO2JhY2tncm91bmQ6dmFyKC0tc3VyZmFjZU1lZGlhKTtwb2ludGVyLWV2ZW50czpub25lO2ZvbnQtc2l6ZTp2YXIoLS1mb250U2l6ZVNtYWxsKTt0ZXh0LWFsaWduOmNlbnRlcjtqdXN0aWZ5LWNvbnRlbnQ6Y2VudGVyO2FsaWduLWl0ZW1zOmNlbnRlcjtnYXA6N3B4O3BhZGRpbmc6MTJweDtkaXNwbGF5OmZsZXg7cG9zaXRpb246YWJzb2x1dGU7aW5zZXQ6MCAwIDM4cHh9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVJlZmVyZW5jZVByZXZpZXcgLm5vZGVWaWRlb1ByZXZpZXd7YXNwZWN0LXJhdGlvOmF1dG87Ym9yZGVyLXJhZGl1czowO2hlaWdodDoxMDAlfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVSZWZlcmVuY2VQcmV2aWV3IC5ub2RlVmlkZW9QcmV2aWV3IC5ub2RlVmlkZW9QcmV2aWV3U3RhdHVze2dhcDowO3BhZGRpbmc6MnB4O2ZvbnQtc2l6ZTowO2luc2V0OjB9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBhdWRpby5ub2RlTWVkaWF7bWluLWhlaWdodDo0NHB4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVVcGxvYWRBcmVhe3dpZHRoOjEwMCU7bWluLWhlaWdodDoxMjBweDtjb2xvcjp2YXIoLS10ZXh0U2Vjb25kYXJ5LCM5ZGE0YWUpO2JvcmRlci1zdHlsZTpkYXNoZWR9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVVwbG9hZEFyZWE6aG92ZXI6bm90KDpkaXNhYmxlZCl7Ym9yZGVyLWNvbG9yOnZhcigtLXNlbGVjdGlvbkFjY2VudCk7YmFja2dyb3VuZDp2YXIoLS1zdXJmYWNlU2VsZWN0ZWQpO2NvbG9yOnZhcigtLXRleHRQcmltYXJ5KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlQ29tcG9zZXJFbXB0eXt3aWR0aDoxMDAlO21pbi1oZWlnaHQ6MTIwcHg7Y29sb3I6dmFyKC0tdGV4dE11dGVkKTtmb250LXNpemU6dmFyKC0tZm9udFNpemVTbWFsbCk7anVzdGlmeS1jb250ZW50OmNlbnRlcjthbGlnbi1pdGVtczpjZW50ZXI7Z2FwOjhweDtkaXNwbGF5OmZsZXh9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZUNvbXBvc2VyQWN0aW9ue2NvbG9yOnZhcigtLXRleHRTZWNvbmRhcnkpO2JhY2tncm91bmQ6MCAwO2JvcmRlci1jb2xvcjojMDAwMDtqdXN0aWZ5LXNlbGY6c3RhcnQ7YWxpZ24taXRlbXM6Y2VudGVyO2dhcDo2cHg7cGFkZGluZzo0cHggNnB4O2Rpc3BsYXk6aW5saW5lLWZsZXh9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZUNvbXBvc2VyQWN0aW9uOmhvdmVyOm5vdCg6ZGlzYWJsZWQpe2NvbG9yOnZhcigtLXNlbGVjdGlvbkFjY2VudCl9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZU1lZGlhSGlzdG9yeXtnYXA6NHB4O21heC1oZWlnaHQ6MTgwcHg7ZGlzcGxheTpncmlkO292ZXJmbG93OmF1dG99Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZU1lZGlhSGlzdG9yeSBidXR0b257dGV4dC1hbGlnbjpsZWZ0O3RleHQtb3ZlcmZsb3c6ZWxsaXBzaXM7b3ZlcmZsb3c6aGlkZGVufS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLnNlbGVjdGVkLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgYnV0dG9uW2FyaWEtcHJlc3NlZD10cnVlXSwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGJ1dHRvblthcmlhLXNlbGVjdGVkPXRydWVde2JvcmRlci1jb2xvcjp2YXIoLS1zZWxlY3Rpb25BY2NlbnQpO2JhY2tncm91bmQ6dmFyKC0tc3VyZmFjZVNlbGVjdGVkKTtjb2xvcjp2YXIoLS1zZWxlY3Rpb25BY2NlbnQpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVGaWVsZHtjb2xvcjp2YXIoLS10ZXh0U2Vjb25kYXJ5LCM5ZGE0YWUpO2dhcDo0cHg7ZGlzcGxheTpncmlkfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVGaWVsZD5zcGFue2ZvbnQtc2l6ZTp2YXIoLS1mb250U2l6ZVNtYWxsKTtsaW5lLWhlaWdodDp2YXIoLS1saW5lSGVpZ2h0U21hbGwpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVGaWVsZHN7Z3JpZC10ZW1wbGF0ZS1jb2x1bW5zOnJlcGVhdCgyLG1pbm1heCgwLDFmcikpO2dhcDo4cHg7ZGlzcGxheTpncmlkfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVBY3Rpb25ze2ZsZXgtd3JhcDp3cmFwO2FsaWduLWl0ZW1zOmNlbnRlcjtnYXA6OHB4O2Rpc3BsYXk6ZmxleH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlUHJpbWFyeXtiYWNrZ3JvdW5kOnZhcigtLWFjdGlvblByaW1hcnkpO2JvcmRlci1jb2xvcjp2YXIoLS1hY3Rpb25QcmltYXJ5KTtjb2xvcjp2YXIoLS10ZXh0T25QcmltYXJ5KTtmb250LXdlaWdodDp2YXIoLS1mb250V2VpZ2h0TWVkaXVtKX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlUHJpbWFyeTpob3Zlcjpub3QoOmRpc2FibGVkKXtiYWNrZ3JvdW5kOnZhcigtLWFjdGlvblByaW1hcnlIb3Zlcik7Ym9yZGVyLWNvbG9yOnZhcigtLWFjdGlvblByaW1hcnlIb3Zlcil9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVByaW1hcnk6YWN0aXZlOm5vdCg6ZGlzYWJsZWQpe2JhY2tncm91bmQ6dmFyKC0tYWN0aW9uUHJpbWFyeVByZXNzZWQpO2JvcmRlci1jb2xvcjp2YXIoLS1hY3Rpb25QcmltYXJ5UHJlc3NlZCl9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVByb21wdHtyZXNpemU6dmVydGljYWw7d2lkdGg6MTAwJTttaW4taGVpZ2h0OjkwcHg7bGluZS1oZWlnaHQ6MS42fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVFcnJvcntjb2xvcjp2YXIoLS1zdGF0dXNFcnJvcik7d2hpdGUtc3BhY2U6cHJlLXdyYXA7b3ZlcmZsb3ctd3JhcDphbnl3aGVyZTttYXJnaW46MH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlU3RhdHVze2NvbG9yOnZhcigtLXRleHRTZWNvbmRhcnksIzlkYTRhZSk7Zm9udC1zaXplOnZhcigtLWZvbnRTaXplU21hbGwpO2xpbmUtaGVpZ2h0OnZhcigtLWxpbmVIZWlnaHRTbWFsbCk7Zm9udC12YXJpYW50LW51bWVyaWM6dGFidWxhci1udW1zfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVTdGF0dXNbZGF0YS1zdGF0ZT1jb21wbGV0ZWRde2NvbG9yOnZhcigtLXN0YXR1c1N1Y2Nlc3MpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVTdGF0dXNbZGF0YS1zdGF0ZT1mYWlsZWRde2NvbG9yOnZhcigtLXN0YXR1c0Vycm9yKX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlU3RhdHVzW2RhdGEtc3RhdGU9dW5rbm93bl0sLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVN0YXR1c1tkYXRhLXN0YXRlPWludGVycnVwdGVkXSwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlU3RhdHVzW2RhdGEtc3RhdGU9Y2FuY2VsUmVxdWVzdGVkXXtjb2xvcjp2YXIoLS1zdGF0dXNXYXJuaW5nKX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlUmVmZXJlbmNlTGlzdHttYXgtaGVpZ2h0OjEwMHB4O2NvbG9yOnZhcigtLXRleHRTZWNvbmRhcnksIzlkYTRhZSk7Z2FwOjRweDtkaXNwbGF5OmdyaWQ7b3ZlcmZsb3c6YXV0b30ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlUmVmZXJlbmNlTGlzdCBzcGFue3RleHQtb3ZlcmZsb3c6ZWxsaXBzaXM7d2hpdGUtc3BhY2U6bm93cmFwO292ZXJmbG93OmhpZGRlbn0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlUmVwb3J0e3doaXRlLXNwYWNlOnByZS13cmFwO292ZXJmbG93LXdyYXA6YW55d2hlcmU7bWF4LWhlaWdodDoyODBweDtmb250LXNpemU6LjY4NzVyZW07Zm9udC1mYW1pbHk6dmFyKC0tZm9udE1vbm8sbW9ub3NwYWNlKTttYXJnaW46MDtvdmVyZmxvdzphdXRvfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVQcm9ncmVzc3t3aWR0aDoxMDAlO2FjY2VudC1jb2xvcjp2YXIoLS1hY3Rpb25QcmltYXJ5KTtib3JkZXItcmFkaXVzOnZhcigtLXJhZGl1c0NvbXBhY3QpO2JhY2tncm91bmQ6dmFyKC0tc3VyZmFjZVJhaXNlZCk7Ym9yZGVyOjA7aGVpZ2h0OjRweDtvdmVyZmxvdzpoaWRkZW59Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZVByb2dyZXNzOjotd2Via2l0LXByb2dyZXNzLWJhcntiYWNrZ3JvdW5kOnZhcigtLXN1cmZhY2VSYWlzZWQpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVQcm9ncmVzczo6LXdlYmtpdC1wcm9ncmVzcy12YWx1ZXtiYWNrZ3JvdW5kOnZhcigtLWFjdGlvblByaW1hcnkpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVQcm9ncmVzczo6LW1vei1wcm9ncmVzcy1iYXJ7YmFja2dyb3VuZDp2YXIoLS1hY3Rpb25QcmltYXJ5KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlRGV0YWlsc3tib3JkZXItdG9wOjFweCBzb2xpZCB2YXIoLS1ib3JkZXJTdWJ0bGUpO3BhZGRpbmctdG9wOjhweH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlRGV0YWlscz5zdW1tYXJ5e21pbi1oZWlnaHQ6dmFyKC0tY29udHJvbE1pblRhcmdldCk7Y3Vyc29yOnBvaW50ZXI7Y29sb3I6dmFyKC0tdGV4dFNlY29uZGFyeSk7dHJhbnNpdGlvbjpjb2xvciB2YXIoLS1tb3Rpb25GYXN0KSB2YXIoLS1lYXNlU3RhbmRhcmQpO21hcmdpbi1ib3R0b206OHB4O3BhZGRpbmc6M3B4IDB9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAubm9kZURldGFpbHM+c3VtbWFyeTpob3Zlciwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlRGV0YWlsc1tvcGVuXT5zdW1tYXJ5e2NvbG9yOnZhcigtLXRleHRQcmltYXJ5KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlR2VuZXJhdGlvblNldHRpbmdzQm9keXtnYXA6OHB4O2Rpc3BsYXk6Z3JpZH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlR2VuZXJhdGlvbkRldGFpbHN7Z2FwOjE2cHg7ZGlzcGxheTpub25lfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVHZW5lcmF0aW9uRGV0YWlscyAubm9kZUdlbmVyYXRpb25TZXR0aW5ncz5oNHtmb250OnZhcigtLWZvbnRXZWlnaHRNZWRpdW0pIHZhcigtLWZvbnRTaXplQm9keSkvdmFyKC0tbGluZUhlaWdodEJvZHkpIHZhcigtLWZvbnRVaSk7bWFyZ2luOjAgMCAxMHB4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgLm5vZGVTYXZlZEluc3RydWN0aW9ue21heC1oZWlnaHQ6MTYwcHg7Y29sb3I6dmFyKC0tdGV4dFNlY29uZGFyeSk7d2hpdGUtc3BhY2U6cHJlLXdyYXA7b3ZlcmZsb3ctd3JhcDphbnl3aGVyZTtmb250LXNpemU6dmFyKC0tZm9udFNpemVTbWFsbCk7bGluZS1oZWlnaHQ6dmFyKC0tbGluZUhlaWdodEJvZHkpO21hcmdpbjowO292ZXJmbG93OmF1dG99Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAuaW1hZ2VQYW5vcmFtYVN0YWdle2JvcmRlci1yYWRpdXM6dmFyKC0tcmFkaXVzQ29udHJvbCk7YmFja2dyb3VuZDp2YXIoLS1zdXJmYWNlQ2FudmFzKTt0b3VjaC1hY3Rpb246bm9uZTtjdXJzb3I6Z3JhYjtwb3NpdGlvbjpyZWxhdGl2ZTtvdmVyZmxvdzpoaWRkZW59Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAuaW1hZ2VQYW5vcmFtYVN0YWdlOmFjdGl2ZXtjdXJzb3I6Z3JhYmJpbmd9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAuaW1hZ2VQYW5vcmFtYUdyaWR7cG9pbnRlci1ldmVudHM6bm9uZTtiYWNrZ3JvdW5kOmxpbmVhci1ncmFkaWVudCg5MGRlZywjMDAwMCAzMi45JSwjZmZmNSAzMyUsIzAwMDAgMzMuMiUgNjYuNSUsI2ZmZjUgNjYuNiUsIzAwMDAgNjYuOCUpLGxpbmVhci1ncmFkaWVudCgjMDAwMCAzMi45JSwjZmZmNSAzMyUsIzAwMDAgMzMuMiUgNjYuNSUsI2ZmZjUgNjYuNiUsIzAwMDAgNjYuOCUpO3Bvc2l0aW9uOmFic29sdXRlO2luc2V0OjB9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyAuaW1hZ2VTcGF0aWFsU3RhZ2V7Ym9yZGVyLXJhZGl1czp2YXIoLS1yYWRpdXNDb250cm9sKTtiYWNrZ3JvdW5kOnZhcigtLXN1cmZhY2VUb29sYmFyKTttYXJnaW4tYm90dG9tOjhweDtvdmVyZmxvdzpoaWRkZW59Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXJ7bWluLXdpZHRoOjA7bWF4LXdpZHRoOjEwMCU7Y29sb3I6dmFyKC0tdGV4dFNlY29uZGFyeSk7Zm9udDp2YXIoLS1mb250V2VpZ2h0Qm9keSkgdmFyKC0tZm9udFNpemVCb2R5KS92YXIoLS1saW5lSGVpZ2h0Qm9keSkgdmFyKC0tZm9udFVpKTtmbGV4LXdyYXA6bm93cmFwO2FsaWduLWl0ZW1zOmNlbnRlcjtnYXA6NHB4O21hcmdpbi10b3A6NHB4O3BhZGRpbmc6MnB4IDA7ZGlzcGxheTpmbGV4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyIC5ub2RlTWVkaWFUb29sR3JvdXB7ZmxleDpub25lO2FsaWduLWl0ZW1zOmNlbnRlcjtnYXA6MnB4O2Rpc3BsYXk6ZmxleH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhVG9vbGJhciAubm9kZU1lZGlhVG9vbEdyb3VwKy5ub2RlTWVkaWFUb29sR3JvdXB7Ym9yZGVyLWxlZnQ6MXB4IHNvbGlkIHZhcigtLWJvcmRlclN1YnRsZSk7cGFkZGluZy1sZWZ0OjRweH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhVG9vbGJhciAubm9kZU1lZGlhQ3JlYXRpdmVUb29sczpub3QoOmhhcygubm9kZU1lZGlhVG9vbCkpe2Rpc3BsYXk6bm9uZX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhVG9vbGJhciAubm9kZU1lZGlhQ3JlYXRpdmVUb29sczpub3QoOmhhcygubm9kZU1lZGlhVG9vbCkpKy5ub2RlTWVkaWFUb29sR3JvdXB7Ym9yZGVyLWxlZnQ6MDtwYWRkaW5nLWxlZnQ6MH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhVG9vbGJhciAubm9kZU1lZGlhVG9vbHtib3JkZXItcmFkaXVzOnZhcigtLXJhZGl1c0NvbXBhY3QpO3dpZHRoOjI4cHg7bWluLXdpZHRoOjI4cHg7aGVpZ2h0OjI4cHg7bWluLWhlaWdodDoyOHB4O2NvbG9yOmluaGVyaXQ7Zm9udDppbmhlcml0O2N1cnNvcjpwb2ludGVyO3RvdWNoLWFjdGlvbjptYW5pcHVsYXRpb247dHJhbnNpdGlvbjpjb2xvciB2YXIoLS1tb3Rpb25Db250cm9sKSB2YXIoLS1lYXNlU3RhbmRhcmQpLCBiYWNrZ3JvdW5kLWNvbG9yIHZhcigtLW1vdGlvbkNvbnRyb2wpIHZhcigtLWVhc2VTdGFuZGFyZCksIGJveC1zaGFkb3cgdmFyKC0tbW90aW9uQ29udHJvbCkgdmFyKC0tZWFzZVN0YW5kYXJkKTtiYWNrZ3JvdW5kOjAgMDtib3JkZXI6MXB4IHNvbGlkICMwMDAwO2ZsZXg6bm9uZTtqdXN0aWZ5LWNvbnRlbnQ6Y2VudGVyO2FsaWduLWl0ZW1zOmNlbnRlcjtnYXA6NnB4O3BhZGRpbmc6MDt0ZXh0LWRlY29yYXRpb246bm9uZTtkaXNwbGF5OmlubGluZS1mbGV4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyIC5ub2RlTWVkaWFUb29sPnN2Z3tmbGV4LXNocmluazowO3dpZHRoOjE2cHg7aGVpZ2h0OjE2cHh9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXIgLm5vZGVNZWRpYVRvb2w6aG92ZXI6bm90KDpkaXNhYmxlZCl7YmFja2dyb3VuZDp2YXIoLS1zdXJmYWNlSG92ZXIpO2NvbG9yOnZhcigtLXRleHRQcmltYXJ5KTtib3JkZXItY29sb3I6IzAwMDB9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXIgLm5vZGVNZWRpYVRvb2w6YWN0aXZlOm5vdCg6ZGlzYWJsZWQpe2JhY2tncm91bmQ6dmFyKC0tc3VyZmFjZVByZXNzZWQpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyIC5ub2RlTWVkaWFUb29sOmRpc2FibGVke29wYWNpdHk6dmFyKC0tZGlzYWJsZWRPcGFjaXR5KTtjdXJzb3I6bm90LWFsbG93ZWR9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXIgLm5vZGVNZWRpYVRvb2w6Zm9jdXMtdmlzaWJsZXtvdXRsaW5lOnZhcigtLWZvY3VzUmluZyk7b3V0bGluZS1vZmZzZXQ6LTJweH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhVG9vbGJhciAubm9kZU1lZGlhVG9vbFthcmlhLWV4cGFuZGVkPXRydWVde2JhY2tncm91bmQ6dmFyKC0tc3VyZmFjZVNlbGVjdGVkKTtjb2xvcjp2YXIoLS1zZWxlY3Rpb25BY2NlbnQpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyIC5ub2RlTWVkaWFUb29sLm5vZGVNZWRpYVRvb2xQcmltYXJ5e2NvbG9yOnZhcigtLXNlbGVjdGlvbkFjY2VudCk7YmFja2dyb3VuZDpjb2xvci1taXgoaW4gc3JnYiwgdmFyKC0tc2VsZWN0aW9uQWNjZW50KSA4JSwgdHJhbnNwYXJlbnQpfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyIC5ub2RlTWVkaWFUb29sLm5vZGVNZWRpYVRvb2xQcmltYXJ5OmhvdmVyOm5vdCg6ZGlzYWJsZWQpe2NvbG9yOnZhcigtLXNlbGVjdGlvbkFjY2VudCk7YmFja2dyb3VuZDp2YXIoLS1zdXJmYWNlU2VsZWN0ZWQpO2JveC1zaGFkb3c6MCAwIDEycHggY29sb3ItbWl4KGluIHNyZ2IsIHZhcigtLXNlbGVjdGlvbkFjY2VudCkgMTYlLCB0cmFuc3BhcmVudCl9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXIgLm5vZGVNZWRpYVRvb2wubm9kZU1lZGlhVG9vbFByaW1hcnlbYXJpYS1sYWJlbD3nvJbovpHlm77niYdde3dpZHRoOmF1dG87cGFkZGluZzowIDhweH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhVG9vbGJhciAubm9kZU1lZGlhVG9vbC5ub2RlTWVkaWFUb29sUHJpbWFyeVthcmlhLWxhYmVsPee8lui+keWbvueJh106YWZ0ZXJ7Y29udGVudDphdHRyKGFyaWEtbGFiZWwpO2ZvbnQtc2l6ZTouNjg3NXJlbTtmb250LXdlaWdodDp2YXIoLS1mb250V2VpZ2h0TWVkaXVtKTt3aGl0ZS1zcGFjZTpub3dyYXB9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXIubm9kZU1lZGlhVG9vbGJhck1vdW50ZWR7ZmxleDowIGF1dG87bWF4LXdpZHRoOm5vbmU7bWFyZ2luOjA7cGFkZGluZzowfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyLm5vZGVNZWRpYVRvb2xiYXJDb21wYWN0e3otaW5kZXg6Mjtib3JkZXI6MXB4IHNvbGlkIHZhcigtLWJvcmRlclN1YnRsZSk7Ym9yZGVyLXJhZGl1czp2YXIoLS1yYWRpdXNDaHJvbWUpO2JhY2tncm91bmQ6Y29sb3ItbWl4KGluIHNyZ2IsIHZhcigtLXN1cmZhY2VQYW5lbCkgOTIlLCB0cmFuc3BhcmVudCk7LXdlYmtpdC1iYWNrZHJvcC1maWx0ZXI6Ymx1cigxMnB4KTtiYWNrZHJvcC1maWx0ZXI6Ymx1cigxMnB4KTtvcGFjaXR5OjA7cG9pbnRlci1ldmVudHM6bm9uZTttYXgtd2lkdGg6Y2FsYygxMDAlIC0gMTZweCk7dHJhbnNpdGlvbjpvcGFjaXR5IHZhcigtLW1vdGlvbkZhc3QpIHZhcigtLWVhc2VTdGFuZGFyZCk7bWFyZ2luLXRvcDowO3BhZGRpbmc6M3B4O3Bvc2l0aW9uOmFic29sdXRlO3RvcDo4cHg7cmlnaHQ6OHB4O2JveC1zaGFkb3c6MCA0cHggMTZweCAjMDAwM30ub3BlbkNpbmVtYVdvcmtiZW5jaCAuZXhwYW5kZWROb2RlQm9keSAubm9kZUNvbnRyb2xzIC5ub2RlR2VuZXJhdGlvbkRldGFpbHN7ZGlzcGxheTpncmlkfS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlRnJhbWVTaXplZCAubm9kZUNvbnRyb2xzIC5ub2RlVmlkZW9QcmV2aWV3e2hlaWdodDoxMDAlO21heC1oZWlnaHQ6MTAwJX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZU1lZGlhRGlhbG9nIC5ub2RlVmlkZW9QcmV2aWV3LC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFEaWFsb2cgLm5vZGVWaWRlb1ByZXZpZXc+dmlkZW97bWF4LWhlaWdodDo3MmR2aH1AbWVkaWEgKGhvdmVyOm5vbmUpLChwb2ludGVyOmNvYXJzZSl7Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVNZWRpYVRvb2xiYXJDb21wYWN0e29wYWNpdHk6MTtwb2ludGVyLWV2ZW50czphdXRvO21heC13aWR0aDpub25lO2JveC1zaGFkb3c6bm9uZTstd2Via2l0LWJhY2tkcm9wLWZpbHRlcjpub25lO2JhY2tkcm9wLWZpbHRlcjpub25lO2JhY2tncm91bmQ6MCAwO2JvcmRlci1jb2xvcjojMDAwMDttYXJnaW4tdG9wOjRweDtwYWRkaW5nOjJweCAwO3Bvc2l0aW9uOnN0YXRpY319QG1lZGlhIChwb2ludGVyOmNvYXJzZSl7Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBidXR0b24sLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBzZWxlY3QsLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBpbnB1dDpub3QoW3R5cGU9Y2hlY2tib3hdKTpub3QoW3R5cGU9cmFkaW9dKSwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIC5ub2RlRGV0YWlscz5zdW1tYXJ5e21pbi1oZWlnaHQ6dmFyKC0tY29udHJvbFRvdWNoVGFyZ2V0KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGJ1dHRvbnttaW4td2lkdGg6dmFyKC0tY29udHJvbFRvdWNoVGFyZ2V0KX0ub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGlucHV0W3R5cGU9Y2hlY2tib3hdLC5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlQ29udHJvbHMgaW5wdXRbdHlwZT1yYWRpb117d2lkdGg6MjBweDtoZWlnaHQ6MjBweH06aXMoLm9wZW5DaW5lbWFXb3JrYmVuY2ggLm5vZGVDb250cm9scyBsYWJlbDpoYXMoPmlucHV0W3R5cGU9Y2hlY2tib3hdKSwub3BlbkNpbmVtYVdvcmtiZW5jaCAubm9kZUNvbnRyb2xzIGxhYmVsOmhhcyg+aW5wdXRbdHlwZT1yYWRpb10pKXttaW4taGVpZ2h0OnZhcigtLWNvbnRyb2xUb3VjaFRhcmdldCk7YWxpZ24taXRlbXM6Y2VudGVyO2dhcDo4cHg7ZGlzcGxheTpmbGV4fS5vcGVuQ2luZW1hV29ya2JlbmNoIC5ub2RlTWVkaWFUb29sYmFyIC5ub2RlTWVkaWFUb29se2hlaWdodDp2YXIoLS1jb250cm9sVG91Y2hUYXJnZXQpO21pbi13aWR0aDp2YXIoLS1jb250cm9sVG91Y2hUYXJnZXQpO21pbi1oZWlnaHQ6dmFyKC0tY29udHJvbFRvdWNoVGFyZ2V0KX19Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLmdhdXNzaWFuU3BsYXROb2RlIC5nYXVzc2lhblNwbGF0Vmlld3BvcnR7YXNwZWN0LXJhdGlvOjE2Lzk7Ym9yZGVyLXJhZGl1czp2YXIoLS1yYWRpdXNDb250cm9sLDhweCk7YmFja2dyb3VuZDojMTAxMzE1O3dpZHRoOjEwMCU7bWluLWhlaWdodDoxMjBweDtwb3NpdGlvbjpyZWxhdGl2ZTtvdmVyZmxvdzpoaWRkZW59Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLmdhdXNzaWFuU3BsYXROb2RlIC5nYXVzc2lhblNwbGF0Vmlld3BvcnQgY2FudmFze3RvdWNoLWFjdGlvbjpub25lO2N1cnNvcjpncmFiO291dGxpbmU6bm9uZTt3aWR0aDoxMDAlO2hlaWdodDoxMDAlO2Rpc3BsYXk6YmxvY2t9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLmdhdXNzaWFuU3BsYXROb2RlIC5nYXVzc2lhblNwbGF0Vmlld3BvcnQgY2FudmFzOmFjdGl2ZXtjdXJzb3I6Z3JhYmJpbmd9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLmdhdXNzaWFuU3BsYXROb2RlIC5nYXVzc2lhblNwbGF0Vmlld3BvcnQgY2FudmFzOmZvY3VzLXZpc2libGV7b3V0bGluZTp2YXIoLS1mb2N1c1JpbmcpO291dGxpbmUtb2Zmc2V0Oi0ycHh9Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLmdhdXNzaWFuU3BsYXROb2RlIC5nYXVzc2lhblNwbGF0T3ZlcmxheXt0ZXh0LWFsaWduOmNlbnRlcjtjb2xvcjp2YXIoLS10ZXh0U2Vjb25kYXJ5LCM5ZGE0YWUpO2ZvbnQtc2l6ZTp2YXIoLS1mb250U2l6ZVNtYWxsLDEycHgpO3BvaW50ZXItZXZlbnRzOm5vbmU7YmFja2dyb3VuZDojMTAxMzE1OTk7cGxhY2UtaXRlbXM6Y2VudGVyO3BhZGRpbmc6MTJweDtkaXNwbGF5OmdyaWQ7cG9zaXRpb246YWJzb2x1dGU7aW5zZXQ6MH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAuZ2F1c3NpYW5TcGxhdE5vZGUgLmdhdXNzaWFuU3BsYXRNZXRhe2ZvbnQtdmFyaWFudC1udW1lcmljOnRhYnVsYXItbnVtczt0ZXh0LW92ZXJmbG93OmVsbGlwc2lzO3doaXRlLXNwYWNlOm5vd3JhcDtvdmVyZmxvdzpoaWRkZW59Lm9wZW5DaW5lbWFXb3JrYmVuY2ggLmdhdXNzaWFuU3BsYXROb2RlIC5nYXVzc2lhblNwbGF0T3V0cHV0c3tncmlkLXRlbXBsYXRlLWNvbHVtbnM6cmVwZWF0KGF1dG8tZml0LG1pbm1heCgxNDBweCwxZnIpKTtnYXA6OHB4O2Rpc3BsYXk6Z3JpZH0ub3BlbkNpbmVtYVdvcmtiZW5jaCAuZ2F1c3NpYW5TcGxhdE5vZGUgLmdhdXNzaWFuU3BsYXRPdXRwdXRzIGltZywub3BlbkNpbmVtYVdvcmtiZW5jaCAuZ2F1c3NpYW5TcGxhdE5vZGUgLmdhdXNzaWFuU3BsYXRPdXRwdXRzIHZpZGVve2FzcGVjdC1yYXRpbzoxNi85O29iamVjdC1maXQ6Y29udGFpbjtib3JkZXItcmFkaXVzOnZhcigtLXJhZGl1c0NvbnRyb2wsOHB4KTtiYWNrZ3JvdW5kOiMwMDA7d2lkdGg6MTAwJTtkaXNwbGF5OmJsb2NrfQovKiR2aXRlJDoxKi8=","sha256":"dfcc2d0fc66fe9dffd1e258065967a764e141bae8dfe64dcbf9573a81ad67b03","mimeType":"text/css","size":17096}]}
