import { AmbientLight as e, AxesHelper as t, Box3 as n, BoxGeometry as r, BufferGeometry as i, CanvasTexture as a, Color as o, DataTextureLoader as s, DataUtils as c, DirectionalLight as l, DirectionalLightHelper as u, DoubleSide as d, EquirectangularReflectionMapping as f, Euler as p, EventDispatcher as m, FileLoader as h, Float32BufferAttribute as g, FloatType as _, Group as v, HalfFloatType as y, LineBasicMaterial as b, LineSegments as x, LinearFilter as S, LinearSRGBColorSpace as C, Loader as w, MOUSE as T, Material as E, MathUtils as D, Mesh as O, MeshBasicMaterial as k, MeshLambertMaterial as A, MeshPhongMaterial as j, Object3D as M, OrthographicCamera as N, PerspectiveCamera as P, Plane as F, Points as I, PointsMaterial as L, Quaternion as R, Ray as z, Raycaster as ee, Scene as te, Spherical as ne, Sprite as B, SpriteMaterial as re, TOUCH as V, Vector2 as H, Vector3 as U, Vector4 as ie, WebGLRenderer as ae } from "three";
//#region \0rolldown/runtime.js
var oe = Object.create, W = Object.defineProperty, se = Object.getOwnPropertyDescriptor, ce = Object.getOwnPropertyNames, le = Object.getPrototypeOf, ue = Object.prototype.hasOwnProperty, de = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), fe = (e, t, n, r) => {
	if (t && typeof t == "object" || typeof t == "function") for (var i = ce(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ue.call(e, s) && s !== n && W(e, s, {
		get: ((e) => t[e]).bind(null, s),
		enumerable: !(r = se(t, s)) || r.enumerable
	});
	return e;
}, pe = (e, t, n) => (n = e == null ? {} : oe(le(e)), fe(t || !e || !e.__esModule ? W(n, "default", {
	value: e,
	enumerable: !0
}) : n, e)), me = class extends M {
	constructor(e, t) {
		super(), this.isViewHelper = !0, this.animating = !1, this.center = new U();
		let n = new o("#ff3653"), i = new o("#8adb00"), s = new o("#2c8fff"), c = [], l = new ee(), u = new H(), d = new M(), f = new N(-2, 2, 2, -2, 0, 4);
		f.position.set(0, 0, 2);
		let m = new r(.8, .05, .05).translate(.4, 0, 0), h = new O(m, L(n)), g = new O(m, L(i)), _ = new O(m, L(s));
		g.rotation.z = Math.PI / 2, _.rotation.y = -Math.PI / 2, this.add(h), this.add(_), this.add(g);
		let v = new B(z(n, "X"));
		v.userData.type = "posX";
		let y = new B(z(i, "Y"));
		y.userData.type = "posY";
		let b = new B(z(s, "Z"));
		b.userData.type = "posZ";
		let x = new B(z(n));
		x.userData.type = "negX";
		let S = new B(z(i));
		S.userData.type = "negY";
		let C = new B(z(s));
		C.userData.type = "negZ", v.position.x = 1, y.position.y = 1, b.position.z = 1, x.position.x = -1, x.scale.setScalar(.8), S.position.y = -1, S.scale.setScalar(.8), C.position.z = -1, C.scale.setScalar(.8), this.add(v), this.add(y), this.add(b), this.add(x), this.add(S), this.add(C), c.push(v), c.push(y), c.push(b), c.push(x), c.push(S), c.push(C);
		let w = new U(), T = 2 * Math.PI;
		this.render = function(n) {
			this.quaternion.copy(e.quaternion).invert(), this.updateMatrixWorld(), w.set(0, 0, 1), w.applyQuaternion(e.quaternion), w.x >= 0 ? (v.material.opacity = 1, x.material.opacity = .5) : (v.material.opacity = .5, x.material.opacity = 1), w.y >= 0 ? (y.material.opacity = 1, S.material.opacity = .5) : (y.material.opacity = .5, S.material.opacity = 1), w.z >= 0 ? (b.material.opacity = 1, C.material.opacity = .5) : (b.material.opacity = .5, C.material.opacity = 1);
			let r = t.offsetWidth - 128;
			n.clearDepth(), n.getViewport(P), n.setViewport(r, 0, 128, 128), n.render(this, f), n.setViewport(P.x, P.y, P.z, P.w);
		};
		let E = new U(), D = new R(), A = new R(), j = new R(), P = new ie(), F = 0;
		this.handleClick = function(e) {
			if (this.animating === !0) return !1;
			let n = t.getBoundingClientRect(), r = n.left + (t.offsetWidth - 128), i = n.top + (t.offsetHeight - 128);
			u.x = (e.clientX - r) / (n.right - r) * 2 - 1, u.y = -((e.clientY - i) / (n.bottom - i)) * 2 + 1, l.setFromCamera(u, f);
			let a = l.intersectObjects(c);
			if (a.length > 0) {
				let e = a[0].object;
				return I(e, this.center), this.animating = !0, !0;
			} else return !1;
		}, this.update = function(t) {
			let n = t * T;
			A.rotateTowards(j, n), e.position.set(0, 0, 1).applyQuaternion(A).multiplyScalar(F).add(this.center), e.quaternion.rotateTowards(D, n), A.angleTo(j) === 0 && (this.animating = !1);
		}, this.dispose = function() {
			m.dispose(), h.material.dispose(), g.material.dispose(), _.material.dispose(), v.material.map.dispose(), y.material.map.dispose(), b.material.map.dispose(), x.material.map.dispose(), S.material.map.dispose(), C.material.map.dispose(), v.material.dispose(), y.material.dispose(), b.material.dispose(), x.material.dispose(), S.material.dispose(), C.material.dispose();
		};
		function I(t, n) {
			switch (t.userData.type) {
				case "posX":
					E.set(1, 0, 0), D.setFromEuler(new p(0, Math.PI * .5, 0));
					break;
				case "posY":
					E.set(0, 1, 0), D.setFromEuler(new p(-Math.PI * .5, 0, 0));
					break;
				case "posZ":
					E.set(0, 0, 1), D.setFromEuler(new p());
					break;
				case "negX":
					E.set(-1, 0, 0), D.setFromEuler(new p(0, -Math.PI * .5, 0));
					break;
				case "negY":
					E.set(0, -1, 0), D.setFromEuler(new p(Math.PI * .5, 0, 0));
					break;
				case "negZ":
					E.set(0, 0, -1), D.setFromEuler(new p(0, Math.PI, 0));
					break;
				default: console.error("ViewHelper: Invalid axis.");
			}
			F = e.position.distanceTo(n), E.multiplyScalar(F).add(n), d.position.copy(n), d.lookAt(e.position), A.copy(d.quaternion), d.lookAt(E), j.copy(d.quaternion);
		}
		function L(e) {
			return new k({
				color: e,
				toneMapped: !1
			});
		}
		function z(e, t = null) {
			let n = document.createElement("canvas");
			n.width = 64, n.height = 64;
			let r = n.getContext("2d");
			return r.beginPath(), r.arc(32, 32, 16, 0, 2 * Math.PI), r.closePath(), r.fillStyle = e.getStyle(), r.fill(), t !== null && (r.font = "24px Arial", r.textAlign = "center", r.fillStyle = "#000000", r.fillText(t, 32, 41)), new re({
				map: new a(n),
				toneMapped: !1
			});
		}
	}
}, he = { type: "change" }, ge = { type: "start" }, _e = { type: "end" }, ve = new z(), ye = new F(), be = Math.cos(70 * D.DEG2RAD), xe = class extends m {
	constructor(e, t) {
		super(), this.object = e, this.domElement = t, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new U(), this.cursor = new U(), 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.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = {
			LEFT: "ArrowLeft",
			UP: "ArrowUp",
			RIGHT: "ArrowRight",
			BOTTOM: "ArrowDown"
		}, this.mouseButtons = {
			LEFT: T.ROTATE,
			MIDDLE: T.DOLLY,
			RIGHT: T.PAN
		}, this.touches = {
			ONE: V.ROTATE,
			TWO: V.DOLLY_PAN
		}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
			return o.phi;
		}, this.getAzimuthalAngle = function() {
			return o.theta;
		}, this.getDistance = function() {
			return this.object.position.distanceTo(this.target);
		}, this.listenToKeyEvents = function(e) {
			e.addEventListener("keydown", Y), this._domElementKeyEvents = e;
		}, this.stopListenToKeyEvents = function() {
			this._domElementKeyEvents.removeEventListener("keydown", Y), this._domElementKeyEvents = null;
		}, this.saveState = function() {
			n.target0.copy(n.target), n.position0.copy(n.object.position), n.zoom0 = n.object.zoom;
		}, this.reset = function() {
			n.target.copy(n.target0), n.object.position.copy(n.position0), n.object.zoom = n.zoom0, n.object.updateProjectionMatrix(), n.dispatchEvent(he), n.update(), i = r.NONE;
		}, this.update = function() {
			let t = new U(), u = new R().setFromUnitVectors(e.up, new U(0, 1, 0)), d = u.clone().invert(), f = new U(), p = new R(), m = new U(), h = 2 * Math.PI;
			return function(g = null) {
				let _ = n.object.position;
				t.copy(_).sub(n.target), t.applyQuaternion(u), o.setFromVector3(t), n.autoRotate && i === r.NONE && O(E(g)), n.enableDamping ? (o.theta += s.theta * n.dampingFactor, o.phi += s.phi * n.dampingFactor) : (o.theta += s.theta, o.phi += s.phi);
				let v = n.minAzimuthAngle, S = n.maxAzimuthAngle;
				isFinite(v) && isFinite(S) && (v < -Math.PI ? v += h : v > Math.PI && (v -= h), S < -Math.PI ? S += h : S > Math.PI && (S -= h), v <= S ? o.theta = Math.max(v, Math.min(S, o.theta)) : o.theta = o.theta > (v + S) / 2 ? Math.max(v, o.theta) : Math.min(S, 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.target.sub(n.cursor), n.target.clampLength(n.minTargetRadius, n.maxTargetRadius), n.target.add(n.cursor);
				let C = !1;
				if (n.zoomToCursor && x || n.object.isOrthographicCamera) o.radius = I(o.radius);
				else {
					let e = o.radius;
					o.radius = I(o.radius * c), C = e != o.radius;
				}
				if (t.setFromSpherical(o), t.applyQuaternion(d), _.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.zoomToCursor && x) {
					let r = null;
					if (n.object.isPerspectiveCamera) {
						let e = t.length();
						r = I(e * c);
						let i = e - r;
						n.object.position.addScaledVector(y, i), n.object.updateMatrixWorld(), C = !!i;
					} else if (n.object.isOrthographicCamera) {
						let e = new U(b.x, b.y, 0);
						e.unproject(n.object);
						let i = n.object.zoom;
						n.object.zoom = Math.max(n.minZoom, Math.min(n.maxZoom, n.object.zoom / c)), n.object.updateProjectionMatrix(), C = i !== n.object.zoom;
						let a = new U(b.x, b.y, 0);
						a.unproject(n.object), n.object.position.sub(a).add(e), n.object.updateMatrixWorld(), r = t.length();
					} else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), n.zoomToCursor = !1;
					r !== null && (this.screenSpacePanning ? n.target.set(0, 0, -1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position) : (ve.origin.copy(n.object.position), ve.direction.set(0, 0, -1).transformDirection(n.object.matrix), Math.abs(n.object.up.dot(ve.direction)) < be ? e.lookAt(n.target) : (ye.setFromNormalAndCoplanarPoint(n.object.up, n.target), ve.intersectPlane(ye, n.target))));
				} else if (n.object.isOrthographicCamera) {
					let e = n.object.zoom;
					n.object.zoom = Math.max(n.minZoom, Math.min(n.maxZoom, n.object.zoom / c)), e !== n.object.zoom && (n.object.updateProjectionMatrix(), C = !0);
				}
				return c = 1, x = !1, C || f.distanceToSquared(n.object.position) > a || 8 * (1 - p.dot(n.object.quaternion)) > a || m.distanceToSquared(n.target) > a ? (n.dispatchEvent(he), f.copy(n.object.position), p.copy(n.object.quaternion), m.copy(n.target), !0) : !1;
			};
		}(), this.dispose = function() {
			n.domElement.removeEventListener("contextmenu", Ee), n.domElement.removeEventListener("pointerdown", xe), n.domElement.removeEventListener("pointercancel", G), n.domElement.removeEventListener("wheel", K), n.domElement.removeEventListener("pointermove", Se), n.domElement.removeEventListener("pointerup", G), n.domElement.getRootNode().removeEventListener("keydown", q, { capture: !0 }), n._domElementKeyEvents !== null && (n._domElementKeyEvents.removeEventListener("keydown", Y), n._domElementKeyEvents = null);
		};
		let n = this, r = {
			NONE: -1,
			ROTATE: 0,
			DOLLY: 1,
			PAN: 2,
			TOUCH_ROTATE: 3,
			TOUCH_PAN: 4,
			TOUCH_DOLLY_PAN: 5,
			TOUCH_DOLLY_ROTATE: 6
		}, i = r.NONE, a = 1e-6, o = new ne(), s = new ne(), c = 1, l = new U(), u = new H(), d = new H(), f = new H(), p = new H(), m = new H(), h = new H(), g = new H(), _ = new H(), v = new H(), y = new U(), b = new H(), x = !1, S = [], C = {}, w = !1;
		function E(e) {
			return e === null ? 2 * Math.PI / 60 / 60 * n.autoRotateSpeed : 2 * Math.PI / 60 * n.autoRotateSpeed * e;
		}
		function D(e) {
			let t = Math.abs(e * .01);
			return .95 ** (n.zoomSpeed * t);
		}
		function O(e) {
			s.theta -= e;
		}
		function k(e) {
			s.phi -= e;
		}
		let A = function() {
			let e = new U();
			return function(t, n) {
				e.setFromMatrixColumn(n, 0), e.multiplyScalar(-t), l.add(e);
			};
		}(), j = function() {
			let e = new U();
			return function(t, r) {
				n.screenSpacePanning === !0 ? e.setFromMatrixColumn(r, 1) : (e.setFromMatrixColumn(r, 0), e.crossVectors(n.object.up, e)), e.multiplyScalar(t), l.add(e);
			};
		}(), M = function() {
			let e = new U();
			return function(t, r) {
				let i = n.domElement;
				if (n.object.isPerspectiveCamera) {
					let a = n.object.position;
					e.copy(a).sub(n.target);
					let o = e.length();
					o *= Math.tan(n.object.fov / 2 * Math.PI / 180), A(2 * t * o / i.clientHeight, n.object.matrix), j(2 * r * o / i.clientHeight, n.object.matrix);
				} else n.object.isOrthographicCamera ? (A(t * (n.object.right - n.object.left) / n.object.zoom / i.clientWidth, n.object.matrix), j(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);
			};
		}();
		function N(e) {
			n.object.isPerspectiveCamera || n.object.isOrthographicCamera ? c /= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), n.enableZoom = !1);
		}
		function P(e) {
			n.object.isPerspectiveCamera || n.object.isOrthographicCamera ? c *= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), n.enableZoom = !1);
		}
		function F(e, t) {
			if (!n.zoomToCursor) return;
			x = !0;
			let r = n.domElement.getBoundingClientRect(), i = e - r.left, a = t - r.top, o = r.width, s = r.height;
			b.x = i / o * 2 - 1, b.y = -(a / s) * 2 + 1, y.set(b.x, b.y, 1).unproject(n.object).sub(n.object.position).normalize();
		}
		function I(e) {
			return Math.max(n.minDistance, Math.min(n.maxDistance, e));
		}
		function L(e) {
			u.set(e.clientX, e.clientY);
		}
		function z(e) {
			F(e.clientX, e.clientX), g.set(e.clientX, e.clientY);
		}
		function ee(e) {
			p.set(e.clientX, e.clientY);
		}
		function te(e) {
			d.set(e.clientX, e.clientY), f.subVectors(d, u).multiplyScalar(n.rotateSpeed);
			let t = n.domElement;
			O(2 * Math.PI * f.x / t.clientHeight), k(2 * Math.PI * f.y / t.clientHeight), u.copy(d), n.update();
		}
		function B(e) {
			_.set(e.clientX, e.clientY), v.subVectors(_, g), v.y > 0 ? N(D(v.y)) : v.y < 0 && P(D(v.y)), g.copy(_), n.update();
		}
		function re(e) {
			m.set(e.clientX, e.clientY), h.subVectors(m, p).multiplyScalar(n.panSpeed), M(h.x, h.y), p.copy(m), n.update();
		}
		function ie(e) {
			F(e.clientX, e.clientY), e.deltaY < 0 ? P(D(e.deltaY)) : e.deltaY > 0 && N(D(e.deltaY)), n.update();
		}
		function ae(e) {
			let t = !1;
			switch (e.code) {
				case n.keys.UP:
					e.ctrlKey || e.metaKey || e.shiftKey ? k(2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : M(0, n.keyPanSpeed), t = !0;
					break;
				case n.keys.BOTTOM:
					e.ctrlKey || e.metaKey || e.shiftKey ? k(-2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : M(0, -n.keyPanSpeed), t = !0;
					break;
				case n.keys.LEFT:
					e.ctrlKey || e.metaKey || e.shiftKey ? O(2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : M(n.keyPanSpeed, 0), t = !0;
					break;
				case n.keys.RIGHT:
					e.ctrlKey || e.metaKey || e.shiftKey ? O(-2 * Math.PI * n.rotateSpeed / n.domElement.clientHeight) : M(-n.keyPanSpeed, 0), t = !0;
					break;
			}
			t && (e.preventDefault(), n.update());
		}
		function oe(e) {
			if (S.length === 1) u.set(e.pageX, e.pageY);
			else {
				let t = Q(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
				u.set(n, r);
			}
		}
		function W(e) {
			if (S.length === 1) p.set(e.pageX, e.pageY);
			else {
				let t = Q(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
				p.set(n, r);
			}
		}
		function se(e) {
			let t = Q(e), n = e.pageX - t.x, r = e.pageY - t.y, i = Math.sqrt(n * n + r * r);
			g.set(0, i);
		}
		function ce(e) {
			n.enableZoom && se(e), n.enablePan && W(e);
		}
		function le(e) {
			n.enableZoom && se(e), n.enableRotate && oe(e);
		}
		function ue(e) {
			if (S.length == 1) d.set(e.pageX, e.pageY);
			else {
				let t = Q(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
				d.set(n, r);
			}
			f.subVectors(d, u).multiplyScalar(n.rotateSpeed);
			let t = n.domElement;
			O(2 * Math.PI * f.x / t.clientHeight), k(2 * Math.PI * f.y / t.clientHeight), u.copy(d);
		}
		function de(e) {
			if (S.length === 1) m.set(e.pageX, e.pageY);
			else {
				let t = Q(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
				m.set(n, r);
			}
			h.subVectors(m, p).multiplyScalar(n.panSpeed), M(h.x, h.y), p.copy(m);
		}
		function fe(e) {
			let t = Q(e), r = e.pageX - t.x, i = e.pageY - t.y, a = Math.sqrt(r * r + i * i);
			_.set(0, a), v.set(0, (_.y / g.y) ** +n.zoomSpeed), N(v.y), g.copy(_), F((e.pageX + t.x) * .5, (e.pageY + t.y) * .5);
		}
		function pe(e) {
			n.enableZoom && fe(e), n.enablePan && de(e);
		}
		function me(e) {
			n.enableZoom && fe(e), n.enableRotate && ue(e);
		}
		function xe(e) {
			n.enabled !== !1 && (S.length === 0 && (n.domElement.setPointerCapture(e.pointerId), n.domElement.addEventListener("pointermove", Se), n.domElement.addEventListener("pointerup", G)), !ke(e) && (De(e), e.pointerType === "touch" ? X(e) : Ce(e)));
		}
		function Se(e) {
			n.enabled !== !1 && (e.pointerType === "touch" ? Z(e) : we(e));
		}
		function G(e) {
			switch (Oe(e), S.length) {
				case 0:
					n.domElement.releasePointerCapture(e.pointerId), n.domElement.removeEventListener("pointermove", Se), n.domElement.removeEventListener("pointerup", G), n.dispatchEvent(_e), i = r.NONE;
					break;
				case 1:
					let t = S[0], a = C[t];
					X({
						pointerId: t,
						pageX: a.x,
						pageY: a.y
					});
					break;
			}
		}
		function Ce(e) {
			let t;
			switch (e.button) {
				case 0:
					t = n.mouseButtons.LEFT;
					break;
				case 1:
					t = n.mouseButtons.MIDDLE;
					break;
				case 2:
					t = n.mouseButtons.RIGHT;
					break;
				default: t = -1;
			}
			switch (t) {
				case T.DOLLY:
					if (n.enableZoom === !1) return;
					z(e), i = r.DOLLY;
					break;
				case T.ROTATE:
					if (e.ctrlKey || e.metaKey || e.shiftKey) {
						if (n.enablePan === !1) return;
						ee(e), i = r.PAN;
					} else {
						if (n.enableRotate === !1) return;
						L(e), i = r.ROTATE;
					}
					break;
				case T.PAN:
					if (e.ctrlKey || e.metaKey || e.shiftKey) {
						if (n.enableRotate === !1) return;
						L(e), i = r.ROTATE;
					} else {
						if (n.enablePan === !1) return;
						ee(e), i = r.PAN;
					}
					break;
				default: i = r.NONE;
			}
			i !== r.NONE && n.dispatchEvent(ge);
		}
		function we(e) {
			switch (i) {
				case r.ROTATE:
					if (n.enableRotate === !1) return;
					te(e);
					break;
				case r.DOLLY:
					if (n.enableZoom === !1) return;
					B(e);
					break;
				case r.PAN:
					if (n.enablePan === !1) return;
					re(e);
					break;
			}
		}
		function K(e) {
			n.enabled === !1 || n.enableZoom === !1 || i !== r.NONE || (e.preventDefault(), n.dispatchEvent(ge), ie(Te(e)), n.dispatchEvent(_e));
		}
		function Te(e) {
			let t = e.deltaMode, n = {
				clientX: e.clientX,
				clientY: e.clientY,
				deltaY: e.deltaY
			};
			switch (t) {
				case 1:
					n.deltaY *= 16;
					break;
				case 2:
					n.deltaY *= 100;
					break;
			}
			return e.ctrlKey && !w && (n.deltaY *= 10), n;
		}
		function q(e) {
			e.key === "Control" && (w = !0, n.domElement.getRootNode().addEventListener("keyup", J, {
				passive: !0,
				capture: !0
			}));
		}
		function J(e) {
			e.key === "Control" && (w = !1, n.domElement.getRootNode().removeEventListener("keyup", J, {
				passive: !0,
				capture: !0
			}));
		}
		function Y(e) {
			n.enabled === !1 || n.enablePan === !1 || ae(e);
		}
		function X(e) {
			switch (Ae(e), S.length) {
				case 1:
					switch (n.touches.ONE) {
						case V.ROTATE:
							if (n.enableRotate === !1) return;
							oe(e), i = r.TOUCH_ROTATE;
							break;
						case V.PAN:
							if (n.enablePan === !1) return;
							W(e), i = r.TOUCH_PAN;
							break;
						default: i = r.NONE;
					}
					break;
				case 2:
					switch (n.touches.TWO) {
						case V.DOLLY_PAN:
							if (n.enableZoom === !1 && n.enablePan === !1) return;
							ce(e), i = r.TOUCH_DOLLY_PAN;
							break;
						case V.DOLLY_ROTATE:
							if (n.enableZoom === !1 && n.enableRotate === !1) return;
							le(e), i = r.TOUCH_DOLLY_ROTATE;
							break;
						default: i = r.NONE;
					}
					break;
				default: i = r.NONE;
			}
			i !== r.NONE && n.dispatchEvent(ge);
		}
		function Z(e) {
			switch (Ae(e), i) {
				case r.TOUCH_ROTATE:
					if (n.enableRotate === !1) return;
					ue(e), n.update();
					break;
				case r.TOUCH_PAN:
					if (n.enablePan === !1) return;
					de(e), n.update();
					break;
				case r.TOUCH_DOLLY_PAN:
					if (n.enableZoom === !1 && n.enablePan === !1) return;
					pe(e), n.update();
					break;
				case r.TOUCH_DOLLY_ROTATE:
					if (n.enableZoom === !1 && n.enableRotate === !1) return;
					me(e), n.update();
					break;
				default: i = r.NONE;
			}
		}
		function Ee(e) {
			n.enabled !== !1 && e.preventDefault();
		}
		function De(e) {
			S.push(e.pointerId);
		}
		function Oe(e) {
			delete C[e.pointerId];
			for (let t = 0; t < S.length; t++) if (S[t] == e.pointerId) {
				S.splice(t, 1);
				return;
			}
		}
		function ke(e) {
			for (let t = 0; t < S.length; t++) if (S[t] == e.pointerId) return !0;
			return !1;
		}
		function Ae(e) {
			let t = C[e.pointerId];
			t === void 0 && (t = new H(), C[e.pointerId] = t), t.set(e.pageX, e.pageY);
		}
		function Q(e) {
			return C[e.pointerId === S[0] ? S[1] : S[0]];
		}
		n.domElement.addEventListener("contextmenu", Ee), n.domElement.addEventListener("pointerdown", xe), n.domElement.addEventListener("pointercancel", G), n.domElement.addEventListener("wheel", K, { passive: !1 }), n.domElement.getRootNode().addEventListener("keydown", q, {
			passive: !0,
			capture: !0
		}), this.update();
	}
}, Se = /^[og]\s*(.+)?/, G = /^mtllib /, Ce = /^usemtl /, we = /^usemap /, K = /\s+/, Te = new U(), q = new U(), J = new U(), Y = new U(), X = new U(), Z = new o();
function Ee() {
	let e = {
		objects: [],
		object: {},
		vertices: [],
		normals: [],
		colors: [],
		uvs: [],
		materials: {},
		materialLibraries: [],
		startObject: function(e, t) {
			if (this.object && this.object.fromDeclaration === !1) {
				this.object.name = e, this.object.fromDeclaration = t !== !1;
				return;
			}
			let n = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0;
			if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = {
				name: e || "",
				fromDeclaration: t !== !1,
				geometry: {
					vertices: [],
					normals: [],
					colors: [],
					uvs: [],
					hasUVIndices: !1
				},
				materials: [],
				smooth: !0,
				startMaterial: function(e, t) {
					let n = this._finalize(!1);
					n && (n.inherited || n.groupCount <= 0) && this.materials.splice(n.index, 1);
					let r = {
						index: this.materials.length,
						name: e || "",
						mtllib: Array.isArray(t) && t.length > 0 ? t[t.length - 1] : "",
						smooth: n === void 0 ? this.smooth : n.smooth,
						groupStart: n === void 0 ? 0 : n.groupEnd,
						groupEnd: -1,
						groupCount: -1,
						inherited: !1,
						clone: function(e) {
							let t = {
								index: typeof e == "number" ? e : this.index,
								name: this.name,
								mtllib: this.mtllib,
								smooth: this.smooth,
								groupStart: 0,
								groupEnd: -1,
								groupCount: -1,
								inherited: !1
							};
							return t.clone = this.clone.bind(t), t;
						}
					};
					return this.materials.push(r), r;
				},
				currentMaterial: function() {
					if (this.materials.length > 0) return this.materials[this.materials.length - 1];
				},
				_finalize: function(e) {
					let t = this.currentMaterial();
					if (t && t.groupEnd === -1 && (t.groupEnd = this.geometry.vertices.length / 3, t.groupCount = t.groupEnd - t.groupStart, t.inherited = !1), e && this.materials.length > 1) for (let e = this.materials.length - 1; e >= 0; e--) this.materials[e].groupCount <= 0 && this.materials.splice(e, 1);
					return e && this.materials.length === 0 && this.materials.push({
						name: "",
						smooth: this.smooth
					}), t;
				}
			}, n && n.name && typeof n.clone == "function") {
				let e = n.clone(0);
				e.inherited = !0, this.object.materials.push(e);
			}
			this.objects.push(this.object);
		},
		finalize: function() {
			this.object && typeof this.object._finalize == "function" && this.object._finalize(!0);
		},
		parseVertexIndex: function(e, t) {
			let n = parseInt(e, 10);
			return (n >= 0 ? n - 1 : n + t / 3) * 3;
		},
		parseNormalIndex: function(e, t) {
			let n = parseInt(e, 10);
			return (n >= 0 ? n - 1 : n + t / 3) * 3;
		},
		parseUVIndex: function(e, t) {
			let n = parseInt(e, 10);
			return (n >= 0 ? n - 1 : n + t / 2) * 2;
		},
		addVertex: function(e, t, n) {
			let r = this.vertices, i = this.object.geometry.vertices;
			i.push(r[e + 0], r[e + 1], r[e + 2]), i.push(r[t + 0], r[t + 1], r[t + 2]), i.push(r[n + 0], r[n + 1], r[n + 2]);
		},
		addVertexPoint: function(e) {
			let t = this.vertices;
			this.object.geometry.vertices.push(t[e + 0], t[e + 1], t[e + 2]);
		},
		addVertexLine: function(e) {
			let t = this.vertices;
			this.object.geometry.vertices.push(t[e + 0], t[e + 1], t[e + 2]);
		},
		addNormal: function(e, t, n) {
			let r = this.normals, i = this.object.geometry.normals;
			i.push(r[e + 0], r[e + 1], r[e + 2]), i.push(r[t + 0], r[t + 1], r[t + 2]), i.push(r[n + 0], r[n + 1], r[n + 2]);
		},
		addFaceNormal: function(e, t, n) {
			let r = this.vertices, i = this.object.geometry.normals;
			Te.fromArray(r, e), q.fromArray(r, t), J.fromArray(r, n), X.subVectors(J, q), Y.subVectors(Te, q), X.cross(Y), X.normalize(), i.push(X.x, X.y, X.z), i.push(X.x, X.y, X.z), i.push(X.x, X.y, X.z);
		},
		addColor: function(e, t, n) {
			let r = this.colors, i = this.object.geometry.colors;
			r[e] !== void 0 && i.push(r[e + 0], r[e + 1], r[e + 2]), r[t] !== void 0 && i.push(r[t + 0], r[t + 1], r[t + 2]), r[n] !== void 0 && i.push(r[n + 0], r[n + 1], r[n + 2]);
		},
		addUV: function(e, t, n) {
			let r = this.uvs, i = this.object.geometry.uvs;
			i.push(r[e + 0], r[e + 1]), i.push(r[t + 0], r[t + 1]), i.push(r[n + 0], r[n + 1]);
		},
		addDefaultUV: function() {
			let e = this.object.geometry.uvs;
			e.push(0, 0), e.push(0, 0), e.push(0, 0);
		},
		addUVLine: function(e) {
			let t = this.uvs;
			this.object.geometry.uvs.push(t[e + 0], t[e + 1]);
		},
		addFace: function(e, t, n, r, i, a, o, s, c) {
			let l = this.vertices.length, u = this.parseVertexIndex(e, l), d = this.parseVertexIndex(t, l), f = this.parseVertexIndex(n, l);
			if (this.addVertex(u, d, f), this.addColor(u, d, f), o !== void 0 && o !== "") {
				let e = this.normals.length;
				u = this.parseNormalIndex(o, e), d = this.parseNormalIndex(s, e), f = this.parseNormalIndex(c, e), this.addNormal(u, d, f);
			} else this.addFaceNormal(u, d, f);
			if (r !== void 0 && r !== "") {
				let e = this.uvs.length;
				u = this.parseUVIndex(r, e), d = this.parseUVIndex(i, e), f = this.parseUVIndex(a, e), this.addUV(u, d, f), this.object.geometry.hasUVIndices = !0;
			} else this.addDefaultUV();
		},
		addPointGeometry: function(e) {
			this.object.geometry.type = "Points";
			let t = this.vertices.length;
			for (let n = 0, r = e.length; n < r; n++) {
				let r = this.parseVertexIndex(e[n], t);
				this.addVertexPoint(r), this.addColor(r);
			}
		},
		addLineGeometry: function(e, t) {
			this.object.geometry.type = "Line";
			let n = this.vertices.length, r = this.uvs.length;
			for (let t = 0, r = e.length; t < r; t++) this.addVertexLine(this.parseVertexIndex(e[t], n));
			for (let e = 0, n = t.length; e < n; e++) this.addUVLine(this.parseUVIndex(t[e], r));
		}
	};
	return e.startObject("", !1), e;
}
var De = class extends w {
	constructor(e) {
		super(e), this.materials = null;
	}
	load(e, t, n, r) {
		let i = this, a = new h(this.manager);
		a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(n) {
			try {
				t(i.parse(n));
			} catch (t) {
				r ? r(t) : console.error(t), i.manager.itemError(e);
			}
		}, n, r);
	}
	setMaterials(e) {
		return this.materials = e, this;
	}
	parse(e) {
		let t = new Ee();
		e.indexOf("\r\n") !== -1 && (e = e.replace(/\r\n/g, "\n")), e.indexOf("\\\n") !== -1 && (e = e.replace(/\\\n/g, ""));
		let n = e.split("\n"), r = [];
		for (let e = 0, i = n.length; e < i; e++) {
			let i = n[e].trimStart();
			if (i.length === 0) continue;
			let a = i.charAt(0);
			if (a !== "#") if (a === "v") {
				let e = i.split(K);
				switch (e[0]) {
					case "v":
						t.vertices.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3])), e.length >= 7 ? (Z.setRGB(parseFloat(e[4]), parseFloat(e[5]), parseFloat(e[6])).convertSRGBToLinear(), t.colors.push(Z.r, Z.g, Z.b)) : t.colors.push(void 0, void 0, void 0);
						break;
					case "vn":
						t.normals.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3]));
						break;
					case "vt":
						t.uvs.push(parseFloat(e[1]), parseFloat(e[2]));
						break;
				}
			} else if (a === "f") {
				let e = i.slice(1).trim().split(K), n = [];
				for (let t = 0, r = e.length; t < r; t++) {
					let r = e[t];
					if (r.length > 0) {
						let e = r.split("/");
						n.push(e);
					}
				}
				let r = n[0];
				for (let e = 1, i = n.length - 1; e < i; e++) {
					let i = n[e], a = n[e + 1];
					t.addFace(r[0], i[0], a[0], r[1], i[1], a[1], r[2], i[2], a[2]);
				}
			} else if (a === "l") {
				let e = i.substring(1).trim().split(" "), n = [], r = [];
				if (i.indexOf("/") === -1) n = e;
				else for (let t = 0, i = e.length; t < i; t++) {
					let i = e[t].split("/");
					i[0] !== "" && n.push(i[0]), i[1] !== "" && r.push(i[1]);
				}
				t.addLineGeometry(n, r);
			} else if (a === "p") {
				let e = i.slice(1).trim().split(" ");
				t.addPointGeometry(e);
			} else if ((r = Se.exec(i)) !== null) {
				let e = (" " + r[0].slice(1).trim()).slice(1);
				t.startObject(e);
			} else if (Ce.test(i)) t.object.startMaterial(i.substring(7).trim(), t.materialLibraries);
			else if (G.test(i)) t.materialLibraries.push(i.substring(7).trim());
			else if (we.test(i)) console.warn("THREE.OBJLoader: Rendering identifier \"usemap\" not supported. Textures must be defined in MTL files.");
			else if (a === "s") {
				if (r = i.split(" "), r.length > 1) {
					let e = r[1].trim().toLowerCase();
					t.object.smooth = e !== "0" && e !== "off";
				} else t.object.smooth = !0;
				let e = t.object.currentMaterial();
				e && (e.smooth = t.object.smooth);
			} else {
				if (i === "\0") continue;
				console.warn("THREE.OBJLoader: Unexpected line: \"" + i + "\"");
			}
		}
		t.finalize();
		let a = new v();
		if (a.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0)) for (let e = 0, n = t.objects.length; e < n; e++) {
			let n = t.objects[e], r = n.geometry, o = n.materials, s = r.type === "Line", c = r.type === "Points", l = !1;
			if (r.vertices.length === 0) continue;
			let u = new i();
			u.setAttribute("position", new g(r.vertices, 3)), r.normals.length > 0 && u.setAttribute("normal", new g(r.normals, 3)), r.colors.length > 0 && (l = !0, u.setAttribute("color", new g(r.colors, 3))), r.hasUVIndices === !0 && u.setAttribute("uv", new g(r.uvs, 2));
			let d = [];
			for (let e = 0, n = o.length; e < n; e++) {
				let n = o[e], r = n.name + "_" + n.smooth + "_" + l, i = t.materials[r];
				if (this.materials !== null) {
					if (i = this.materials.create(n.name), s && i && !(i instanceof b)) {
						let e = new b();
						E.prototype.copy.call(e, i), e.color.copy(i.color), i = e;
					} else if (c && i && !(i instanceof L)) {
						let e = new L({
							size: 10,
							sizeAttenuation: !1
						});
						E.prototype.copy.call(e, i), e.color.copy(i.color), e.map = i.map, i = e;
					}
				}
				i === void 0 && (i = s ? new b() : c ? new L({
					size: 1,
					sizeAttenuation: !1
				}) : new j(), i.name = n.name, i.flatShading = !n.smooth, i.vertexColors = l, t.materials[r] = i), d.push(i);
			}
			let f;
			if (d.length > 1) {
				for (let e = 0, t = o.length; e < t; e++) {
					let t = o[e];
					u.addGroup(t.groupStart, t.groupCount, e);
				}
				f = s ? new x(u, d) : c ? new I(u, d) : new O(u, d);
			} else f = s ? new x(u, d[0]) : c ? new I(u, d[0]) : new O(u, d[0]);
			f.name = n.name, a.add(f);
		}
		else if (t.vertices.length > 0) {
			let e = new L({
				size: 1,
				sizeAttenuation: !1
			}), n = new i();
			n.setAttribute("position", new g(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (n.setAttribute("color", new g(t.colors, 3)), e.vertexColors = !0);
			let r = new I(n, e);
			a.add(r);
		}
		return a;
	}
}, Oe = class extends s {
	constructor(e) {
		super(e), this.type = y;
	}
	parse(e) {
		let t = function(e, t) {
			switch (e) {
				case 1: throw Error("THREE.RGBELoader: Read Error: " + (t || ""));
				case 2: throw Error("THREE.RGBELoader: Write Error: " + (t || ""));
				case 3: throw Error("THREE.RGBELoader: Bad File Format: " + (t || ""));
				default:
				case 4: throw Error("THREE.RGBELoader: Memory Error: " + (t || ""));
			}
		}, n = function(e, t, n) {
			t = t || 1024;
			let r = e.pos, i = -1, a = 0, o = "", s = String.fromCharCode.apply(null, new Uint16Array(e.subarray(r, r + 128)));
			for (; 0 > (i = s.indexOf("\n")) && a < t && r < e.byteLength;) o += s, a += s.length, r += 128, s += String.fromCharCode.apply(null, new Uint16Array(e.subarray(r, r + 128)));
			return -1 < i ? (!1 !== n && (e.pos += a + i + 1), o + s.slice(0, i)) : !1;
		}, r = function(e) {
			let r = /^#\?(\S+)/, i = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, a = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, o = /^\s*FORMAT=(\S+)\s*$/, s = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, c = {
				valid: 0,
				string: "",
				comments: "",
				programtype: "RGBE",
				format: "",
				gamma: 1,
				exposure: 1,
				width: 0,
				height: 0
			}, l, u;
			for ((e.pos >= e.byteLength || !(l = n(e))) && t(1, "no header found"), (u = l.match(r)) || t(3, "bad initial token"), c.valid |= 1, c.programtype = u[1], c.string += l + "\n"; l = n(e), !1 !== l;) {
				if (c.string += l + "\n", l.charAt(0) === "#") {
					c.comments += l + "\n";
					continue;
				}
				if ((u = l.match(i)) && (c.gamma = parseFloat(u[1])), (u = l.match(a)) && (c.exposure = parseFloat(u[1])), (u = l.match(o)) && (c.valid |= 2, c.format = u[1]), (u = l.match(s)) && (c.valid |= 4, c.height = parseInt(u[1], 10), c.width = parseInt(u[2], 10)), c.valid & 2 && c.valid & 4) break;
			}
			return c.valid & 2 || t(3, "missing format specifier"), c.valid & 4 || t(3, "missing image size specifier"), c;
		}, i = function(e, n, r) {
			let i = n;
			if (i < 8 || i > 32767 || e[0] !== 2 || e[1] !== 2 || e[2] & 128) return new Uint8Array(e);
			i !== (e[2] << 8 | e[3]) && t(3, "wrong scanline width");
			let a = new Uint8Array(4 * n * r);
			a.length || t(4, "unable to allocate buffer space");
			let o = 0, s = 0, c = 4 * i, l = new Uint8Array(4), u = new Uint8Array(c), d = r;
			for (; d > 0 && s < e.byteLength;) {
				s + 4 > e.byteLength && t(1), l[0] = e[s++], l[1] = e[s++], l[2] = e[s++], l[3] = e[s++], (l[0] != 2 || l[1] != 2 || (l[2] << 8 | l[3]) != i) && t(3, "bad rgbe scanline format");
				let n = 0, r;
				for (; n < c && s < e.byteLength;) {
					r = e[s++];
					let i = r > 128;
					if (i && (r -= 128), (r === 0 || n + r > c) && t(3, "bad scanline data"), i) {
						let t = e[s++];
						for (let e = 0; e < r; e++) u[n++] = t;
					} else u.set(e.subarray(s, s + r), n), n += r, s += r;
				}
				let f = i;
				for (let e = 0; e < f; e++) {
					let t = 0;
					a[o] = u[e + t], t += i, a[o + 1] = u[e + t], t += i, a[o + 2] = u[e + t], t += i, a[o + 3] = u[e + t], o += 4;
				}
				d--;
			}
			return a;
		}, a = function(e, t, n, r) {
			let i = 2 ** (e[t + 3] - 128) / 255;
			n[r + 0] = e[t + 0] * i, n[r + 1] = e[t + 1] * i, n[r + 2] = e[t + 2] * i, n[r + 3] = 1;
		}, o = function(e, t, n, r) {
			let i = 2 ** (e[t + 3] - 128) / 255;
			n[r + 0] = c.toHalfFloat(Math.min(e[t + 0] * i, 65504)), n[r + 1] = c.toHalfFloat(Math.min(e[t + 1] * i, 65504)), n[r + 2] = c.toHalfFloat(Math.min(e[t + 2] * i, 65504)), n[r + 3] = c.toHalfFloat(1);
		}, s = new Uint8Array(e);
		s.pos = 0;
		let l = r(s), u = l.width, d = l.height, f = i(s.subarray(s.pos), u, d), p, m, h;
		switch (this.type) {
			case _:
				h = f.length / 4;
				let e = new Float32Array(h * 4);
				for (let t = 0; t < h; t++) a(f, t * 4, e, t * 4);
				p = e, m = _;
				break;
			case y:
				h = f.length / 4;
				let t = new Uint16Array(h * 4);
				for (let e = 0; e < h; e++) o(f, e * 4, t, e * 4);
				p = t, m = y;
				break;
			default: throw Error("THREE.RGBELoader: Unsupported type: " + this.type);
		}
		return {
			width: u,
			height: d,
			data: p,
			header: l.string,
			gamma: l.gamma,
			exposure: l.exposure,
			type: m
		};
	}
	setDataType(e) {
		return this.type = e, this;
	}
	load(e, t, n, r) {
		function i(e, n) {
			switch (e.type) {
				case _:
				case y:
					e.colorSpace = C, e.minFilter = S, e.magFilter = S, e.generateMipmaps = !1, e.flipY = !0;
					break;
			}
			t && t(e, n);
		}
		return super.load(e, i, n, r);
	}
}, ke = /* @__PURE__ */ pe((/* @__PURE__ */ de(((e, t) => {
	t.exports = {};
})))(), 1);
function Ae(e, t) {
	let n = ke.default.readFileSync(e, "utf-8").split("\n"), r = n[0].split()[1] === "1", i = [], a = [], o = ke.default.createWriteStream(t);
	for (let e = 1; e < n.length && n[e].trim() !== "0 0. 0. 0."; e++) {
		let t = n[e].split(), r = {
			x: parseFloat(t[1]),
			y: parseFloat(t[2]),
			z: parseFloat(t[3])
		};
		i.push(r), o.write(`v ${r.x} ${r.y} ${r.z}\n`);
	}
	if (r) for (let e of i) o.write(`v ${e.x} ${-e.y} ${e.z}\n`);
	let s = n.indexOf("0 0. 0. 0.\n") + 2;
	for (let e = s; e < n.length && n[e].trim() !== "0 0 0 0"; e++) {
		let t = n[e].split(), r = {
			v1: parseInt(t[0]),
			v2: parseInt(t[1]),
			v3: parseInt(t[2]),
			v4: parseInt(t[3])
		};
		a.push(r), o.write(`f ${r.v1} ${r.v2} ${r.v3} ${r.v4}\n`);
	}
	if (r) {
		let e = i.length;
		for (let t of a) o.write(`f ${t.v1 + e} ${t.v4 + e} ${t.v3 + e} ${t.v2 + e}\n`);
	}
	o.end();
}
//#endregion
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
function Q(e) {
	"@babel/helpers - typeof";
	return Q = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
		return typeof e;
	} : function(e) {
		return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
	}, Q(e);
}
//#endregion
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
function je(e, t) {
	if (Q(e) != "object" || !e) return e;
	var n = e[Symbol.toPrimitive];
	if (n !== void 0) {
		var r = n.call(e, t || "default");
		if (Q(r) != "object") return r;
		throw TypeError("@@toPrimitive must return a primitive value.");
	}
	return (t === "string" ? String : Number)(e);
}
//#endregion
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
function Me(e) {
	var t = je(e, "string");
	return Q(t) == "symbol" ? t : t + "";
}
//#endregion
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
function $(e, t, n) {
	return (t = Me(t)) in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
//#endregion
//#region src/threeStore.ts
var Ne = class {
	constructor() {
		$(this, "scene", void 0), $(this, "camera", void 0), $(this, "webGLRenderer", void 0), $(this, "domElement", void 0), $(this, "orbitControls", void 0), $(this, "viewHelper", void 0), $(this, "OBJModel", {}), $(this, "destroy", () => {
			window.removeEventListener("resize", this.onResize);
		}), $(this, "init", (e) => {
			console.log("three init");
			let { domElement: t } = e;
			this.domElement = t;
			let n = this.domElement.clientWidth, r = this.domElement.clientHeight;
			this.scene = new te(), this.camera = new P(75, n / r, .1, 1e3), this.camera.position.set(1, 1, 1), this.camera.lookAt(this.scene.position), this.renderer(), this.addOrbitControls(), this.addAmbientLight(), this.animate(), window.addEventListener("resize", this.onResize, !1);
		}), $(this, "renderer", () => {
			this.webGLRenderer = new ae({ antialias: !0 });
			let e = this.domElement.clientWidth, t = this.domElement.clientHeight;
			this.webGLRenderer.setSize(e, t), this.domElement.appendChild(this.webGLRenderer.domElement);
		}), $(this, "addObject", () => {
			let e = new O(new r(1, 1, 1), new A({ color: 16711680 }));
			this.scene.add(e);
		}), $(this, "removeOBJModel", (e) => {
			this.OBJModel[e] && this.scene?.remove(this.OBJModel[e]);
		}), $(this, "addOBJModel", ({ url: e = "", id: t = "defaultId", Material: r = new A({
			color: 16777215,
			wireframe: !0
		}) }) => {
			if (!e) {
				console.warn("url is empty");
				return;
			}
			new De().load(e, (e) => {
				this.removeOBJModel(t), this.OBJModel[t] = e, this.scene.add(e), console.log("object loaded", e);
				let i = new n().setFromObject(e), a = i.getSize(new U());
				console.log(a, "obj model size");
				let o = i.getCenter(new U());
				console.log(o, "center"), e.position.sub(o), e.rotation.y = Math.PI / 4;
				let s = i.getSize(new U()), c = Math.max(s.x, s.y, s.z);
				this.camera.position.z = c * 1.5, e.traverse((e) => {
					if (e instanceof O) {
						let t = r;
						t.side = d, e.material = t, e.material.side = d;
					}
				});
			}, (e) => {
				console.log(e.loaded / e.total * 100 + "% loaded");
			}, (e) => {
				console.log("An error happened", e);
			});
		}), $(this, "addHDR", ({ url: e = "" }) => {
			new Oe().load(e, (e) => {
				e.mapping = f, this.scene.environment = e, this.scene.background = e;
			});
		}), $(this, "addAxesHelper", (e) => {
			let { size: n = 5 } = e || {}, r = new t(n);
			this.scene.add(r);
		}), $(this, "addDirectionalLight", (e) => {
			let { helper: t = !0 } = e || {}, n = new l(16777215, 1);
			if (n.position.set(50, 50, 50), this.scene.add(n), t) {
				let e = new u(n, 5);
				this.scene.add(e);
			}
		}), $(this, "addAmbientLight", (t = 16777215) => {
			let n = new e(t);
			this.scene.add(n);
		}), $(this, "addOrbitControls", () => {
			this.orbitControls = new xe(this.camera, this.webGLRenderer.domElement);
		}), $(this, "addViewHelper", () => {
			this.viewHelper = new me(this.camera, this.webGLRenderer.domElement), this.webGLRenderer.domElement.addEventListener("pointerdown", (e) => {
				this.viewHelper?.handleClick(e);
			});
		}), $(this, "onResize", () => {
			let e = this.domElement, t = e.clientWidth, n = e.clientHeight;
			this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.webGLRenderer.setSize(t, n), this.webGLRenderer.render(this.scene, this.camera);
		}), $(this, "animate", () => {
			requestAnimationFrame(this.animate), this.webGLRenderer.render(this.scene, this.camera), this.orbitControls.update(), this.viewHelper && (this.webGLRenderer.autoClear = !1, this.viewHelper.render(this.webGLRenderer), this.webGLRenderer.autoClear = !0);
		}), console.log("three-store init!");
	}
};
//#endregion
export { Ae as convertDatToObj, Ne as default };
