@quick-threejs/reactive 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/worker.mjs CHANGED
@@ -1,34 +1,1362 @@
1
- import { r as R, o as x, g as I, j as S, e as b, a as $ } from "./app.module-CA2jMGzR.mjs";
2
- var C = R();
3
- const s = /* @__PURE__ */ x(C), T = s.expose;
4
- s.registerSerializer;
5
- s.Transfer;
6
- const v = (n) => {
7
- const a = I.createChildContainer(), e = a.resolve(S), o = { container: a, module: e }, d = {}, c = (t) => {
8
- var g, l, f, E, m;
9
- if (!((g = t.data) != null && g.canvas) || e.getIsInitialized()) return;
10
- const r = !!((l = t.data) != null && l.startTimer), i = !!((f = t.data) != null && f.withMiniCamera), u = !!((E = t.data) != null && E.fullScreen);
11
- e.init({
12
- ...t.data,
13
- startTimer: r,
14
- withMiniCamera: i,
15
- fullScreen: u
16
- }), (m = n == null ? void 0 : n.onReady) == null || m.call(n, o), self == null || self.removeEventListener("message", c);
1
+ var Ye = Object.defineProperty;
2
+ var Fe = (t, e, i) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
+ var a = (t, e, i) => Fe(t, typeof e != "symbol" ? e + "" : e, i);
4
+ import { w as Ue, _ as ue, y as me, O as Ze, z as Ae, B as ze, G as Ke, H as We, s as p, L as d, I as Xe, i as h, P as qe, h as ce, S as N, k as C, m as q, l as x, E as fe, D as ve, j as Be, p as Ge, J as be, M as Ve, R as Qe, A as Je, d as ke, f as et, q as tt, C as it } from "./FontLoader-Cp39O036.mjs";
5
+ import { Ray as st, Plane as rt, MathUtils as nt, Vector3 as b, Controls as ot, MOUSE as $, TOUCH as D, Quaternion as Pe, Spherical as ge, Vector2 as v, PerspectiveCamera as E, OrthographicCamera as I, Camera as j, Scene as Le, WebGLRenderer as Ce, PCFSoftShadowMap as at, SRGBColorSpace as ht, CineonToneMapping as ct, AxesHelper as lt, GridHelper as _t, AnimationClip as pt } from "three";
6
+ var dt = {
7
+ now: function() {
8
+ return performance.now();
9
+ },
10
+ delegate: void 0
11
+ }, B = {
12
+ schedule: function(t) {
13
+ var e = requestAnimationFrame, i = cancelAnimationFrame, s = B.delegate;
14
+ s && (e = s.requestAnimationFrame, i = s.cancelAnimationFrame);
15
+ var r = e(function(n) {
16
+ i = void 0, t(n);
17
+ });
18
+ return new Ue(function() {
19
+ return i == null ? void 0 : i(r);
20
+ });
21
+ },
22
+ requestAnimationFrame: function() {
23
+ for (var t = [], e = 0; e < arguments.length; e++)
24
+ t[e] = arguments[e];
25
+ return requestAnimationFrame.apply(void 0, ue([], me(t)));
26
+ },
27
+ cancelAnimationFrame: function() {
28
+ for (var t = [], e = 0; e < arguments.length; e++)
29
+ t[e] = arguments[e];
30
+ return cancelAnimationFrame.apply(void 0, ue([], me(t)));
31
+ },
32
+ delegate: void 0
33
+ };
34
+ function ut(t) {
35
+ return t ? Ie(t) : mt;
36
+ }
37
+ function Ie(t) {
38
+ return new Ze(function(e) {
39
+ var i = t || dt, s = i.now(), r = 0, n = function() {
40
+ e.closed || (r = B.requestAnimationFrame(function(o) {
41
+ r = 0;
42
+ var c = i.now();
43
+ e.next({
44
+ timestamp: t ? c : o,
45
+ elapsed: c - s
46
+ }), n();
47
+ }));
48
+ };
49
+ return n(), function() {
50
+ r && B.cancelAnimationFrame(r);
51
+ };
52
+ });
53
+ }
54
+ var mt = Ie();
55
+ function ft(t, e) {
56
+ return e === void 0 && (e = !1), Ae(function(i, s) {
57
+ var r = 0;
58
+ i.subscribe(ze(s, function(n) {
59
+ var o = t(n, r++);
60
+ (o || e) && s.next(n), !o && s.complete();
61
+ }));
62
+ });
63
+ }
64
+ function vt(t, e, i) {
65
+ var s = We(t) || e || i ? { next: t, error: e, complete: i } : t;
66
+ return s ? Ae(function(r, n) {
67
+ var o;
68
+ (o = s.subscribe) === null || o === void 0 || o.call(s);
69
+ var c = !0;
70
+ r.subscribe(ze(n, function(_) {
71
+ var m;
72
+ (m = s.next) === null || m === void 0 || m.call(s, _), n.next(_);
73
+ }, function() {
74
+ var _;
75
+ c = !1, (_ = s.complete) === null || _ === void 0 || _.call(s), n.complete();
76
+ }, function(_) {
77
+ var m;
78
+ c = !1, (m = s.error) === null || m === void 0 || m.call(s, _), n.error(_);
79
+ }, function() {
80
+ var _, m;
81
+ c && ((_ = s.unsubscribe) === null || _ === void 0 || _.call(s)), (m = s.finalize) === null || m === void 0 || m.call(s);
82
+ }));
83
+ }) : Ke;
84
+ }
85
+ const Se = { type: "change" }, le = { type: "start" }, Ne = { type: "end" }, L = new st(), we = new rt(), bt = Math.cos(70 * nt.DEG2RAD), u = new b(), f = 2 * Math.PI, l = {
86
+ NONE: -1,
87
+ ROTATE: 0,
88
+ DOLLY: 1,
89
+ PAN: 2,
90
+ TOUCH_ROTATE: 3,
91
+ TOUCH_PAN: 4,
92
+ TOUCH_DOLLY_PAN: 5,
93
+ TOUCH_DOLLY_ROTATE: 6
94
+ }, Z = 1e-6;
95
+ class ye extends ot {
96
+ constructor(e, i = null) {
97
+ super(e, i), this.state = l.NONE, this.enabled = !0, this.target = new b(), this.cursor = new b(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: $.ROTATE, MIDDLE: $.DOLLY, RIGHT: $.PAN }, this.touches = { ONE: D.ROTATE, TWO: D.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new b(), this._lastQuaternion = new Pe(), this._lastTargetPosition = new b(), this._quat = new Pe().setFromUnitVectors(e.up, new b(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ge(), this._sphericalDelta = new ge(), this._scale = 1, this._panOffset = new b(), this._rotateStart = new v(), this._rotateEnd = new v(), this._rotateDelta = new v(), this._panStart = new v(), this._panEnd = new v(), this._panDelta = new v(), this._dollyStart = new v(), this._dollyEnd = new v(), this._dollyDelta = new v(), this._dollyDirection = new b(), this._mouse = new v(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = gt.bind(this), this._onPointerDown = Pt.bind(this), this._onPointerUp = Ct.bind(this), this._onContextMenu = $t.bind(this), this._onMouseWheel = yt.bind(this), this._onKeyDown = Ot.bind(this), this._onTouchStart = Dt.bind(this), this._onTouchMove = Et.bind(this), this._onMouseDown = St.bind(this), this._onMouseMove = wt.bind(this), this._interceptControlDown = Rt.bind(this), this._interceptControlUp = Tt.bind(this), this.domElement !== null && this.connect(), this.update();
98
+ }
99
+ connect() {
100
+ this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
101
+ }
102
+ disconnect() {
103
+ this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
104
+ }
105
+ dispose() {
106
+ this.disconnect();
107
+ }
108
+ getPolarAngle() {
109
+ return this._spherical.phi;
110
+ }
111
+ getAzimuthalAngle() {
112
+ return this._spherical.theta;
113
+ }
114
+ getDistance() {
115
+ return this.object.position.distanceTo(this.target);
116
+ }
117
+ listenToKeyEvents(e) {
118
+ e.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = e;
119
+ }
120
+ stopListenToKeyEvents() {
121
+ this._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = null);
122
+ }
123
+ saveState() {
124
+ this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
125
+ }
126
+ reset() {
127
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Se), this.update(), this.state = l.NONE;
128
+ }
129
+ update(e = null) {
130
+ const i = this.object.position;
131
+ u.copy(i).sub(this.target), u.applyQuaternion(this._quat), this._spherical.setFromVector3(u), this.autoRotate && this.state === l.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);
132
+ let s = this.minAzimuthAngle, r = this.maxAzimuthAngle;
133
+ isFinite(s) && isFinite(r) && (s < -Math.PI ? s += f : s > Math.PI && (s -= f), r < -Math.PI ? r += f : r > Math.PI && (r -= f), s <= r ? this._spherical.theta = Math.max(s, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + r) / 2 ? Math.max(s, 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);
134
+ let n = !1;
135
+ if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
136
+ this._spherical.radius = this._clampDistance(this._spherical.radius);
137
+ else {
138
+ const o = this._spherical.radius;
139
+ this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = o != this._spherical.radius;
140
+ }
141
+ if (u.setFromSpherical(this._spherical), u.applyQuaternion(this._quatInverse), i.copy(this.target).add(u), 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) {
142
+ let o = null;
143
+ if (this.object.isPerspectiveCamera) {
144
+ const c = u.length();
145
+ o = this._clampDistance(c * this._scale);
146
+ const _ = c - o;
147
+ this.object.position.addScaledVector(this._dollyDirection, _), this.object.updateMatrixWorld(), n = !!_;
148
+ } else if (this.object.isOrthographicCamera) {
149
+ const c = new b(this._mouse.x, this._mouse.y, 0);
150
+ c.unproject(this.object);
151
+ const _ = this.object.zoom;
152
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = _ !== this.object.zoom;
153
+ const m = new b(this._mouse.x, this._mouse.y, 0);
154
+ m.unproject(this.object), this.object.position.sub(m).add(c), this.object.updateMatrixWorld(), o = u.length();
155
+ } else
156
+ console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
157
+ o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (L.origin.copy(this.object.position), L.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(L.direction)) < bt ? this.object.lookAt(this.target) : (we.setFromNormalAndCoplanarPoint(this.object.up, this.target), L.intersectPlane(we, this.target))));
158
+ } else if (this.object.isOrthographicCamera) {
159
+ const o = this.object.zoom;
160
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
161
+ }
162
+ return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > Z || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Z || this._lastTargetPosition.distanceToSquared(this.target) > Z ? (this.dispatchEvent(Se), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
163
+ }
164
+ _getAutoRotationAngle(e) {
165
+ return e !== null ? f / 60 * this.autoRotateSpeed * e : f / 60 / 60 * this.autoRotateSpeed;
166
+ }
167
+ _getZoomScale(e) {
168
+ const i = Math.abs(e * 0.01);
169
+ return Math.pow(0.95, this.zoomSpeed * i);
170
+ }
171
+ _rotateLeft(e) {
172
+ this._sphericalDelta.theta -= e;
173
+ }
174
+ _rotateUp(e) {
175
+ this._sphericalDelta.phi -= e;
176
+ }
177
+ _panLeft(e, i) {
178
+ u.setFromMatrixColumn(i, 0), u.multiplyScalar(-e), this._panOffset.add(u);
179
+ }
180
+ _panUp(e, i) {
181
+ this.screenSpacePanning === !0 ? u.setFromMatrixColumn(i, 1) : (u.setFromMatrixColumn(i, 0), u.crossVectors(this.object.up, u)), u.multiplyScalar(e), this._panOffset.add(u);
182
+ }
183
+ // deltaX and deltaY are in pixels; right and down are positive
184
+ _pan(e, i) {
185
+ const s = this.domElement;
186
+ if (this.object.isPerspectiveCamera) {
187
+ const r = this.object.position;
188
+ u.copy(r).sub(this.target);
189
+ let n = u.length();
190
+ n *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * n / s.clientHeight, this.object.matrix), this._panUp(2 * i * n / s.clientHeight, this.object.matrix);
191
+ } else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth, this.object.matrix), this._panUp(i * (this.object.top - this.object.bottom) / this.object.zoom / s.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
192
+ }
193
+ _dollyOut(e) {
194
+ this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
195
+ }
196
+ _dollyIn(e) {
197
+ this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
198
+ }
199
+ _updateZoomParameters(e, i) {
200
+ if (!this.zoomToCursor)
201
+ return;
202
+ this._performCursorZoom = !0;
203
+ const s = this.domElement.getBoundingClientRect(), r = e - s.left, n = i - s.top, o = s.width, c = s.height;
204
+ this._mouse.x = r / o * 2 - 1, this._mouse.y = -(n / c) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
205
+ }
206
+ _clampDistance(e) {
207
+ return Math.max(this.minDistance, Math.min(this.maxDistance, e));
208
+ }
209
+ //
210
+ // event callbacks - update the object state
211
+ //
212
+ _handleMouseDownRotate(e) {
213
+ this._rotateStart.set(e.clientX, e.clientY);
214
+ }
215
+ _handleMouseDownDolly(e) {
216
+ this._updateZoomParameters(e.clientX, e.clientX), this._dollyStart.set(e.clientX, e.clientY);
217
+ }
218
+ _handleMouseDownPan(e) {
219
+ this._panStart.set(e.clientX, e.clientY);
220
+ }
221
+ _handleMouseMoveRotate(e) {
222
+ this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
223
+ const i = this.domElement;
224
+ this._rotateLeft(f * this._rotateDelta.x / i.clientHeight), this._rotateUp(f * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
225
+ }
226
+ _handleMouseMoveDolly(e) {
227
+ this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
228
+ }
229
+ _handleMouseMovePan(e) {
230
+ this._panEnd.set(e.clientX, e.clientY), this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd), this.update();
231
+ }
232
+ _handleMouseWheel(e) {
233
+ this._updateZoomParameters(e.clientX, e.clientY), e.deltaY < 0 ? this._dollyIn(this._getZoomScale(e.deltaY)) : e.deltaY > 0 && this._dollyOut(this._getZoomScale(e.deltaY)), this.update();
234
+ }
235
+ _handleKeyDown(e) {
236
+ let i = !1;
237
+ switch (e.code) {
238
+ case this.keys.UP:
239
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), i = !0;
240
+ break;
241
+ case this.keys.BOTTOM:
242
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), i = !0;
243
+ break;
244
+ case this.keys.LEFT:
245
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), i = !0;
246
+ break;
247
+ case this.keys.RIGHT:
248
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), i = !0;
249
+ break;
250
+ }
251
+ i && (e.preventDefault(), this.update());
252
+ }
253
+ _handleTouchStartRotate(e) {
254
+ if (this._pointers.length === 1)
255
+ this._rotateStart.set(e.pageX, e.pageY);
256
+ else {
257
+ const i = this._getSecondPointerPosition(e), s = 0.5 * (e.pageX + i.x), r = 0.5 * (e.pageY + i.y);
258
+ this._rotateStart.set(s, r);
259
+ }
260
+ }
261
+ _handleTouchStartPan(e) {
262
+ if (this._pointers.length === 1)
263
+ this._panStart.set(e.pageX, e.pageY);
264
+ else {
265
+ const i = this._getSecondPointerPosition(e), s = 0.5 * (e.pageX + i.x), r = 0.5 * (e.pageY + i.y);
266
+ this._panStart.set(s, r);
267
+ }
268
+ }
269
+ _handleTouchStartDolly(e) {
270
+ const i = this._getSecondPointerPosition(e), s = e.pageX - i.x, r = e.pageY - i.y, n = Math.sqrt(s * s + r * r);
271
+ this._dollyStart.set(0, n);
272
+ }
273
+ _handleTouchStartDollyPan(e) {
274
+ this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
275
+ }
276
+ _handleTouchStartDollyRotate(e) {
277
+ this.enableZoom && this._handleTouchStartDolly(e), this.enableRotate && this._handleTouchStartRotate(e);
278
+ }
279
+ _handleTouchMoveRotate(e) {
280
+ if (this._pointers.length == 1)
281
+ this._rotateEnd.set(e.pageX, e.pageY);
282
+ else {
283
+ const s = this._getSecondPointerPosition(e), r = 0.5 * (e.pageX + s.x), n = 0.5 * (e.pageY + s.y);
284
+ this._rotateEnd.set(r, n);
285
+ }
286
+ this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
287
+ const i = this.domElement;
288
+ this._rotateLeft(f * this._rotateDelta.x / i.clientHeight), this._rotateUp(f * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd);
289
+ }
290
+ _handleTouchMovePan(e) {
291
+ if (this._pointers.length === 1)
292
+ this._panEnd.set(e.pageX, e.pageY);
293
+ else {
294
+ const i = this._getSecondPointerPosition(e), s = 0.5 * (e.pageX + i.x), r = 0.5 * (e.pageY + i.y);
295
+ this._panEnd.set(s, r);
296
+ }
297
+ this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
298
+ }
299
+ _handleTouchMoveDolly(e) {
300
+ const i = this._getSecondPointerPosition(e), s = e.pageX - i.x, r = e.pageY - i.y, n = Math.sqrt(s * s + r * r);
301
+ this._dollyEnd.set(0, n), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
302
+ const o = (e.pageX + i.x) * 0.5, c = (e.pageY + i.y) * 0.5;
303
+ this._updateZoomParameters(o, c);
304
+ }
305
+ _handleTouchMoveDollyPan(e) {
306
+ this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
307
+ }
308
+ _handleTouchMoveDollyRotate(e) {
309
+ this.enableZoom && this._handleTouchMoveDolly(e), this.enableRotate && this._handleTouchMoveRotate(e);
310
+ }
311
+ // pointers
312
+ _addPointer(e) {
313
+ this._pointers.push(e.pointerId);
314
+ }
315
+ _removePointer(e) {
316
+ delete this._pointerPositions[e.pointerId];
317
+ for (let i = 0; i < this._pointers.length; i++)
318
+ if (this._pointers[i] == e.pointerId) {
319
+ this._pointers.splice(i, 1);
320
+ return;
321
+ }
322
+ }
323
+ _isTrackingPointer(e) {
324
+ for (let i = 0; i < this._pointers.length; i++)
325
+ if (this._pointers[i] == e.pointerId) return !0;
326
+ return !1;
327
+ }
328
+ _trackPointer(e) {
329
+ let i = this._pointerPositions[e.pointerId];
330
+ i === void 0 && (i = new v(), this._pointerPositions[e.pointerId] = i), i.set(e.pageX, e.pageY);
331
+ }
332
+ _getSecondPointerPosition(e) {
333
+ const i = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
334
+ return this._pointerPositions[i];
335
+ }
336
+ //
337
+ _customWheelEvent(e) {
338
+ const i = e.deltaMode, s = {
339
+ clientX: e.clientX,
340
+ clientY: e.clientY,
341
+ deltaY: e.deltaY
342
+ };
343
+ switch (i) {
344
+ case 1:
345
+ s.deltaY *= 16;
346
+ break;
347
+ case 2:
348
+ s.deltaY *= 100;
349
+ break;
350
+ }
351
+ return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
352
+ }
353
+ }
354
+ function Pt(t) {
355
+ this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(t.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(t) && (this._addPointer(t), t.pointerType === "touch" ? this._onTouchStart(t) : this._onMouseDown(t)));
356
+ }
357
+ function gt(t) {
358
+ this.enabled !== !1 && (t.pointerType === "touch" ? this._onTouchMove(t) : this._onMouseMove(t));
359
+ }
360
+ function Ct(t) {
361
+ switch (this._removePointer(t), this._pointers.length) {
362
+ case 0:
363
+ this.domElement.releasePointerCapture(t.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Ne), this.state = l.NONE;
364
+ break;
365
+ case 1:
366
+ const e = this._pointers[0], i = this._pointerPositions[e];
367
+ this._onTouchStart({ pointerId: e, pageX: i.x, pageY: i.y });
368
+ break;
369
+ }
370
+ }
371
+ function St(t) {
372
+ let e;
373
+ switch (t.button) {
374
+ case 0:
375
+ e = this.mouseButtons.LEFT;
376
+ break;
377
+ case 1:
378
+ e = this.mouseButtons.MIDDLE;
379
+ break;
380
+ case 2:
381
+ e = this.mouseButtons.RIGHT;
382
+ break;
383
+ default:
384
+ e = -1;
385
+ }
386
+ switch (e) {
387
+ case $.DOLLY:
388
+ if (this.enableZoom === !1) return;
389
+ this._handleMouseDownDolly(t), this.state = l.DOLLY;
390
+ break;
391
+ case $.ROTATE:
392
+ if (t.ctrlKey || t.metaKey || t.shiftKey) {
393
+ if (this.enablePan === !1) return;
394
+ this._handleMouseDownPan(t), this.state = l.PAN;
395
+ } else {
396
+ if (this.enableRotate === !1) return;
397
+ this._handleMouseDownRotate(t), this.state = l.ROTATE;
398
+ }
399
+ break;
400
+ case $.PAN:
401
+ if (t.ctrlKey || t.metaKey || t.shiftKey) {
402
+ if (this.enableRotate === !1) return;
403
+ this._handleMouseDownRotate(t), this.state = l.ROTATE;
404
+ } else {
405
+ if (this.enablePan === !1) return;
406
+ this._handleMouseDownPan(t), this.state = l.PAN;
407
+ }
408
+ break;
409
+ default:
410
+ this.state = l.NONE;
411
+ }
412
+ this.state !== l.NONE && this.dispatchEvent(le);
413
+ }
414
+ function wt(t) {
415
+ switch (this.state) {
416
+ case l.ROTATE:
417
+ if (this.enableRotate === !1) return;
418
+ this._handleMouseMoveRotate(t);
419
+ break;
420
+ case l.DOLLY:
421
+ if (this.enableZoom === !1) return;
422
+ this._handleMouseMoveDolly(t);
423
+ break;
424
+ case l.PAN:
425
+ if (this.enablePan === !1) return;
426
+ this._handleMouseMovePan(t);
427
+ break;
428
+ }
429
+ }
430
+ function yt(t) {
431
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== l.NONE || (t.preventDefault(), this.dispatchEvent(le), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Ne));
432
+ }
433
+ function Ot(t) {
434
+ this.enabled !== !1 && this._handleKeyDown(t);
435
+ }
436
+ function Dt(t) {
437
+ switch (this._trackPointer(t), this._pointers.length) {
438
+ case 1:
439
+ switch (this.touches.ONE) {
440
+ case D.ROTATE:
441
+ if (this.enableRotate === !1) return;
442
+ this._handleTouchStartRotate(t), this.state = l.TOUCH_ROTATE;
443
+ break;
444
+ case D.PAN:
445
+ if (this.enablePan === !1) return;
446
+ this._handleTouchStartPan(t), this.state = l.TOUCH_PAN;
447
+ break;
448
+ default:
449
+ this.state = l.NONE;
450
+ }
451
+ break;
452
+ case 2:
453
+ switch (this.touches.TWO) {
454
+ case D.DOLLY_PAN:
455
+ if (this.enableZoom === !1 && this.enablePan === !1) return;
456
+ this._handleTouchStartDollyPan(t), this.state = l.TOUCH_DOLLY_PAN;
457
+ break;
458
+ case D.DOLLY_ROTATE:
459
+ if (this.enableZoom === !1 && this.enableRotate === !1) return;
460
+ this._handleTouchStartDollyRotate(t), this.state = l.TOUCH_DOLLY_ROTATE;
461
+ break;
462
+ default:
463
+ this.state = l.NONE;
464
+ }
465
+ break;
466
+ default:
467
+ this.state = l.NONE;
468
+ }
469
+ this.state !== l.NONE && this.dispatchEvent(le);
470
+ }
471
+ function Et(t) {
472
+ switch (this._trackPointer(t), this.state) {
473
+ case l.TOUCH_ROTATE:
474
+ if (this.enableRotate === !1) return;
475
+ this._handleTouchMoveRotate(t), this.update();
476
+ break;
477
+ case l.TOUCH_PAN:
478
+ if (this.enablePan === !1) return;
479
+ this._handleTouchMovePan(t), this.update();
480
+ break;
481
+ case l.TOUCH_DOLLY_PAN:
482
+ if (this.enableZoom === !1 && this.enablePan === !1) return;
483
+ this._handleTouchMoveDollyPan(t), this.update();
484
+ break;
485
+ case l.TOUCH_DOLLY_ROTATE:
486
+ if (this.enableZoom === !1 && this.enableRotate === !1) return;
487
+ this._handleTouchMoveDollyRotate(t), this.update();
488
+ break;
489
+ default:
490
+ this.state = l.NONE;
491
+ }
492
+ }
493
+ function $t(t) {
494
+ this.enabled !== !1 && t.preventDefault();
495
+ }
496
+ function Rt(t) {
497
+ t.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
498
+ }
499
+ function Tt(t) {
500
+ t.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
501
+ }
502
+ var Mt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, xt = (t, e, i, s) => {
503
+ for (var r = s > 1 ? void 0 : s ? jt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
504
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
505
+ return s && r && Mt(e, i, r), r;
506
+ };
507
+ let A = class {
508
+ constructor() {
509
+ a(this, "_canvas");
510
+ a(this, "proxyReceiver", new Xe());
511
+ a(this, "isInitialized", !1);
512
+ }
513
+ get canvas() {
514
+ return this._canvas;
515
+ }
516
+ set canvas(t) {
517
+ t.style = {
518
+ width: t.width + "",
519
+ height: t.height + ""
520
+ }, this._canvas = t;
521
+ }
522
+ };
523
+ A = xt([
524
+ p(d.ContainerScoped)
525
+ ], A);
526
+ var At = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, Lt = (t, e, i, s) => {
527
+ for (var r = s > 1 ? void 0 : s ? zt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
528
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
529
+ return s && r && At(e, i, r), r;
530
+ }, It = (t, e) => (i, s) => e(i, s, t);
531
+ let H = class extends qe {
532
+ constructor(t) {
533
+ super(), this._service = t;
534
+ for (const e of ce)
535
+ this[`${e}$$`] = new N(), this[`${e}$`] = this[`${e}$$`].pipe(), this[e] = (i) => {
536
+ this._service.proxyReceiver.handleEvent({
537
+ ...i,
538
+ type: i.type || e
539
+ }), this[`${e}$$`].next(i);
540
+ };
541
+ }
542
+ };
543
+ H = Lt([
544
+ p(d.ContainerScoped),
545
+ It(0, h(A))
546
+ ], H);
547
+ var Nt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Yt = (t, e, i, s) => {
548
+ for (var r = s > 1 ? void 0 : s ? Ht(e, i) : e, n = t.length - 1, o; n >= 0; n--)
549
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
550
+ return s && r && Nt(e, i, r), r;
551
+ };
552
+ let Y = class {
553
+ constructor() {
554
+ a(this, "frame", 1e3 / 60);
555
+ a(this, "initialTime", Date.now());
556
+ a(this, "currentTime", 0);
557
+ a(this, "deltaTime", 0);
558
+ a(this, "deltaRatio", 0);
559
+ a(this, "elapsedTime", 0);
560
+ a(this, "enabled", !1);
561
+ }
562
+ step() {
563
+ const t = Date.now();
564
+ this.deltaTime = t - this.currentTime, this.currentTime = t, this.elapsedTime = t - this.initialTime, this.deltaRatio = this.deltaTime / this.frame;
565
+ }
566
+ };
567
+ Y = Yt([
568
+ p(d.ContainerScoped)
569
+ ], Y);
570
+ var Ft = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, Zt = (t, e, i, s) => {
571
+ for (var r = s > 1 ? void 0 : s ? Ut(e, i) : e, n = t.length - 1, o; n >= 0; n--)
572
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
573
+ return s && r && Ft(e, i, r), r;
574
+ }, Kt = (t, e) => (i, s) => e(i, s, t);
575
+ let R = class {
576
+ constructor(t) {
577
+ a(this, "_beforeStep$$", new N());
578
+ a(this, "_oldElapsed", 0);
579
+ a(this, "beforeStep$", this._beforeStep$$.asObservable());
580
+ a(this, "step$", ut().pipe(
581
+ vt(({ elapsed: t }) => {
582
+ var e;
583
+ this._oldElapsed !== t && ((e = this._beforeStep$$) == null || e.next(fe(this._service, [])), this._oldElapsed = t);
584
+ }),
585
+ C(() => this._service.enabled),
586
+ ft(() => this._service.enabled),
587
+ q(() => fe(this._service, [])),
588
+ x()
589
+ ));
590
+ this._service = t;
591
+ }
592
+ };
593
+ R = Zt([
594
+ p(d.ContainerScoped),
595
+ Kt(0, h(Y))
596
+ ], R);
597
+ var Wt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, qt = (t, e, i, s) => {
598
+ for (var r = s > 1 ? void 0 : s ? Xt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
599
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
600
+ return s && r && Wt(e, i, r), r;
601
+ }, Oe = (t, e) => (i, s) => e(i, s, t);
602
+ let G = class {
603
+ constructor(t, e) {
604
+ a(this, "_initialAnimationFrameId");
605
+ a(this, "_subscriptions", []);
606
+ this._controller = t, this._service = e, this._subscriptions.push(
607
+ this._controller.step$.subscribe(this._service.step.bind(this._service))
608
+ );
609
+ }
610
+ init(t) {
611
+ this.enabled(t);
612
+ }
613
+ frame() {
614
+ return this._service.frame;
615
+ }
616
+ deltaTime(t) {
617
+ return typeof t == "number" && (this._service.deltaTime = t), this._service.deltaTime;
618
+ }
619
+ deltaRatio(t) {
620
+ return typeof t == "number" && (this._service.deltaRatio = t), this._service.deltaRatio;
621
+ }
622
+ enabled(t) {
623
+ return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
624
+ }
625
+ dispose() {
626
+ this._initialAnimationFrameId !== void 0 && cancelAnimationFrame(this._initialAnimationFrameId), this._service.enabled = !1;
627
+ }
628
+ beforeStep$() {
629
+ return this._controller.beforeStep$;
630
+ }
631
+ step$() {
632
+ return this._controller.step$;
633
+ }
634
+ };
635
+ G = qt([
636
+ p(d.ContainerScoped),
637
+ Oe(0, h(R)),
638
+ Oe(1, h(Y))
639
+ ], G);
640
+ var Bt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, Vt = (t, e, i, s) => {
641
+ for (var r = s > 1 ? void 0 : s ? Gt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
642
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
643
+ return s && r && Bt(e, i, r), r;
644
+ };
645
+ let S = class {
646
+ constructor() {
647
+ a(this, "width", 0);
648
+ a(this, "height", 0);
649
+ a(this, "aspect", 0);
650
+ a(this, "pixelRatio", 0);
651
+ a(this, "frustrum", 5);
652
+ a(this, "enabled", !0);
653
+ }
654
+ init(t, e) {
655
+ this.height = Number(t.height ?? this.height), this.width = Number(t.width ?? this.width), this.aspect = this.width / this.height, this.enabled = e === void 0 ? !0 : !!e;
656
+ }
657
+ };
658
+ S = Vt([
659
+ p(d.ContainerScoped)
660
+ ], S);
661
+ var Qt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, kt = (t, e, i, s) => {
662
+ for (var r = s > 1 ? void 0 : s ? Jt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
663
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
664
+ return s && r && Qt(e, i, r), r;
665
+ }, ei = (t, e) => (i, s) => e(i, s, t);
666
+ let y = class {
667
+ constructor(t) {
668
+ a(this, "instance");
669
+ a(this, "enabled", !0);
670
+ this._sizesService = t;
671
+ }
672
+ set aspectRatio(t) {
673
+ var e;
674
+ this.instance instanceof E && (this.instance.aspect = t), (this.instance instanceof E || this.instance instanceof I) && ((e = this.instance) == null || e.updateProjectionMatrix());
675
+ }
676
+ set quaternion(t) {
677
+ var e;
678
+ (e = this.instance) == null || e.quaternion.copy(t);
679
+ }
680
+ set position(t) {
681
+ var e;
682
+ (e = this.instance) == null || e.position.copy(t);
683
+ }
684
+ set rotation(t) {
685
+ var e;
686
+ (e = this.instance) == null || e.rotation.copy(t);
687
+ }
688
+ init(t) {
689
+ if (this.dispose(), t === ve.PERSPECTIVE || t === void 0) {
690
+ this.instance = new E(
691
+ 70,
692
+ this._sizesService.width / this._sizesService.height,
693
+ 1e-4,
694
+ 100
695
+ ), this.instance.position.z = 8;
696
+ return;
697
+ }
698
+ t === ve.ORTHOGRAPHIC && (this.instance = new I(
699
+ -this._sizesService.aspect * this._sizesService.frustrum / 2,
700
+ this._sizesService.aspect * this._sizesService.frustrum / 2,
701
+ this._sizesService.frustrum / 2,
702
+ -this._sizesService.frustrum / 2,
703
+ -50,
704
+ 50
705
+ ));
706
+ }
707
+ dispose() {
708
+ this.instance instanceof j && ((this.instance instanceof E || this.instance instanceof I) && this.instance.clearViewOffset(), this.instance.clear(), this.instance = void 0);
709
+ }
710
+ };
711
+ y = kt([
712
+ p(d.ContainerScoped),
713
+ ei(0, h(S))
714
+ ], y);
715
+ var ti = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, si = (t, e, i, s) => {
716
+ for (var r = s > 1 ? void 0 : s ? ii(e, i) : e, n = t.length - 1, o; n >= 0; n--)
717
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
718
+ return s && r && ti(e, i, r), r;
719
+ }, De = (t, e) => (i, s) => e(i, s, t);
720
+ let V = class {
721
+ constructor(t, e) {
722
+ a(this, "step$");
723
+ this.timerController = t, this._service = e, this.step$ = this.timerController.step$.pipe(
724
+ C(() => this._service.enabled)
725
+ );
726
+ }
727
+ };
728
+ V = si([
729
+ p(d.ContainerScoped),
730
+ De(0, h(R)),
731
+ De(1, h(y))
732
+ ], V);
733
+ var ri = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, oi = (t, e, i, s) => {
734
+ for (var r = s > 1 ? void 0 : s ? ni(e, i) : e, n = t.length - 1, o; n >= 0; n--)
735
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
736
+ return s && r && ri(e, i, r), r;
737
+ }, K = (t, e) => (i, s) => e(i, s, t);
738
+ let Q = class {
739
+ constructor(t, e, i) {
740
+ a(this, "_subscriptions", []);
741
+ this._sizesService = t, this._controller = e, this._service = i;
742
+ }
743
+ init() {
744
+ this._service.init(), this._subscriptions.push(
745
+ this._controller.step$.subscribe(() => {
746
+ var t;
747
+ this._service.enabled && (this._service.aspectRatio = this._sizesService.aspect, (this._service.instance instanceof E || this._service.instance instanceof I) && ((t = this._service.instance) == null || t.updateProjectionMatrix()));
748
+ })
749
+ );
750
+ }
751
+ enabled(t) {
752
+ return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
753
+ }
754
+ aspectRatio(t) {
755
+ return t && (this._service.aspectRatio = t), this._service.aspectRatio;
756
+ }
757
+ instance(t) {
758
+ return t && (this._service.instance = t), this._service.instance;
759
+ }
760
+ position(t) {
761
+ return t && (this._service.position = t), this._service.position;
762
+ }
763
+ quaternion(t) {
764
+ return t && (this._service.quaternion = t), this._service.quaternion;
765
+ }
766
+ dispose() {
767
+ this._subscriptions.forEach((t) => t.unsubscribe()), this._service.dispose();
768
+ }
769
+ };
770
+ Q = oi([
771
+ p(d.ContainerScoped),
772
+ K(0, h(S)),
773
+ K(1, h(V)),
774
+ K(2, h(y))
775
+ ], Q);
776
+ var ai = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, ci = (t, e, i, s) => {
777
+ for (var r = s > 1 ? void 0 : s ? hi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
778
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
779
+ return s && r && ai(e, i, r), r;
780
+ };
781
+ let T = class {
782
+ constructor() {
783
+ a(this, "scene", new Le());
784
+ a(this, "enabled", !0);
785
+ }
786
+ };
787
+ T = ci([
788
+ p(d.ContainerScoped)
789
+ ], T);
790
+ var He = Object.defineProperty, li = Object.getOwnPropertyDescriptor, _i = (t, e, i) => e in t ? He(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, pi = (t, e, i, s) => {
791
+ for (var r = s > 1 ? void 0 : s ? li(e, i) : e, n = t.length - 1, o; n >= 0; n--)
792
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
793
+ return s && r && He(e, i, r), r;
794
+ }, W = (t, e) => (i, s) => e(i, s, t), di = (t, e, i) => _i(t, e + "", i);
795
+ let O = class {
796
+ constructor(t, e, i) {
797
+ a(this, "enabled", !0);
798
+ a(this, "instance");
799
+ this._worldService = t, this._cameraService = e, this._sizesService = i;
800
+ }
801
+ setWebGLRenderer(t) {
802
+ this.instance = new Ce({
803
+ canvas: t,
804
+ context: t.getContext("webgl2", {
805
+ stencil: !0,
806
+ powerPreference: "high-performance"
807
+ }),
808
+ powerPreference: "high-performance",
809
+ depth: !0,
810
+ antialias: !0
811
+ }), this.instance.autoClear = !1, this.instance.setPixelRatio(O.RENDERER_PIXEL_RATIO), this.instance.setClearColor(0, 0), this.instance.shadowMap.enabled = !0, this.instance.shadowMap.type = at, this.instance.outputColorSpace = ht, this.instance.toneMapping = ct, this.instance.toneMappingExposure = 1.75;
812
+ }
813
+ setSize(t, e) {
814
+ var i;
815
+ (i = this.instance) == null || i.setSize(t, e);
816
+ }
817
+ render() {
818
+ this.enabled && this._cameraService.instance instanceof j && this.instance instanceof Ce && (this.instance.setViewport(
819
+ 0,
820
+ 0,
821
+ this._sizesService.width,
822
+ this._sizesService.height
823
+ ), this.instance.render(
824
+ this._worldService.scene,
825
+ this._cameraService.instance
826
+ ));
827
+ }
828
+ };
829
+ di(O, "RENDERER_PIXEL_RATIO", 1);
830
+ O = pi([
831
+ p(d.ContainerScoped),
832
+ W(0, h(T)),
833
+ W(1, h(y)),
834
+ W(2, h(S))
835
+ ], O);
836
+ var ui = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, fi = (t, e, i, s) => {
837
+ for (var r = s > 1 ? void 0 : s ? mi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
838
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
839
+ return s && r && ui(e, i, r), r;
840
+ }, Ee = (t, e) => (i, s) => e(i, s, t);
841
+ let F = class {
842
+ constructor(t, e) {
843
+ a(this, "resize$");
844
+ this._appController = t, this._service = e, this.resize$ = this._appController.resize$$.pipe(
845
+ C(() => this._service.enabled)
846
+ );
847
+ }
848
+ };
849
+ F = fi([
850
+ p(d.ContainerScoped),
851
+ Ee(0, h(H)),
852
+ Ee(1, h(S))
853
+ ], F);
854
+ var vi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Pi = (t, e, i, s) => {
855
+ for (var r = s > 1 ? void 0 : s ? bi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
856
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
857
+ return s && r && vi(e, i, r), r;
858
+ }, X = (t, e) => (i, s) => e(i, s, t);
859
+ let J = class {
860
+ constructor(t, e, i) {
861
+ a(this, "step$");
862
+ a(this, "resize$");
863
+ this._service = t, this._timerController = e, this._sizesController = i, this.step$ = this._timerController.step$.pipe(
864
+ C(() => this._service.enabled)
865
+ ), this.resize$ = this._sizesController.resize$.pipe(
866
+ C(() => this._service.enabled)
867
+ );
868
+ }
869
+ };
870
+ J = Pi([
871
+ p(d.ContainerScoped),
872
+ X(0, h(O)),
873
+ X(1, h(R)),
874
+ X(2, h(F))
875
+ ], J);
876
+ var gi = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Si = (t, e, i, s) => {
877
+ for (var r = s > 1 ? void 0 : s ? Ci(e, i) : e, n = t.length - 1, o; n >= 0; n--)
878
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
879
+ return s && r && gi(e, i, r), r;
880
+ }, $e = (t, e) => (i, s) => e(i, s, t);
881
+ let k = class {
882
+ constructor(t, e) {
883
+ this._controller = t, this._service = e;
884
+ }
885
+ init(t) {
886
+ this._controller.step$.subscribe(() => this._service.render()), this._controller.resize$.subscribe(
887
+ (e) => this._service.setSize(e.windowWidth, e.windowHeight)
888
+ ), this._service.setWebGLRenderer(t);
889
+ }
890
+ enabled(t) {
891
+ return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
892
+ }
893
+ instance() {
894
+ return this._service.instance;
895
+ }
896
+ setSize(t) {
897
+ return this._service.setSize(t.x, t.y);
898
+ }
899
+ render() {
900
+ return this._service.render();
901
+ }
902
+ dispose() {
903
+ var t;
904
+ (t = this._service.instance) == null || t.dispose(), this._service.instance = void 0;
905
+ }
906
+ };
907
+ k = Si([
908
+ p(d.ContainerScoped),
909
+ $e(0, h(J)),
910
+ $e(1, h(O))
911
+ ], k);
912
+ var wi = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Oi = (t, e, i, s) => {
913
+ for (var r = s > 1 ? void 0 : s ? yi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
914
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
915
+ return s && r && wi(e, i, r), r;
916
+ }, Re = (t, e) => (i, s) => e(i, s, t);
917
+ let ee = class {
918
+ constructor(t, e) {
919
+ this._controller = t, this._service = e;
920
+ }
921
+ init(t) {
922
+ this._controller.resize$.subscribe((e) => {
923
+ this._service.width = e.windowWidth, this._service.height = e.windowHeight, this._service.aspect = e.windowWidth / e.windowHeight;
924
+ }), this._service.init(t);
925
+ }
926
+ dispose() {
927
+ }
928
+ aspect(t) {
929
+ return typeof t == "number" && (this._service.aspect = t), this._service.aspect;
930
+ }
931
+ enabled(t) {
932
+ return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
933
+ }
934
+ frustrum(t) {
935
+ return typeof t == "number" && (this._service.frustrum = t), this._service.frustrum;
936
+ }
937
+ height(t) {
938
+ return typeof t == "number" && (this._service.height = t), this._service.height;
939
+ }
940
+ pixelRatio(t) {
941
+ return typeof t == "number" && (this._service.pixelRatio = t), this._service.pixelRatio;
942
+ }
943
+ width(t) {
944
+ return typeof t == "number" && (this._service.width = t), this._service.width;
945
+ }
946
+ resize$() {
947
+ return this._controller.resize$;
948
+ }
949
+ };
950
+ ee = Oi([
951
+ p(d.ContainerScoped),
952
+ Re(0, h(F)),
953
+ Re(1, h(S))
954
+ ], ee);
955
+ var Di = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, $i = (t, e, i, s) => {
956
+ for (var r = s > 1 ? void 0 : s ? Ei(e, i) : e, n = t.length - 1, o; n >= 0; n--)
957
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
958
+ return s && r && Di(e, i, r), r;
959
+ }, Ri = (t, e) => (i, s) => e(i, s, t);
960
+ let te = class {
961
+ constructor(t) {
962
+ a(this, "_beforeRender$$", new N());
963
+ a(this, "_afterRender$$", new N());
964
+ a(this, "beforeRender$", this._beforeRender$$.pipe(x()));
965
+ a(this, "afterRender$", this._afterRender$$.pipe(x()));
966
+ this._worldService = t, this._worldService.scene.onBeforeRender = () => this._beforeRender$$.next({}), this._worldService.scene.onAfterRender = () => this._afterRender$$.next({});
967
+ }
968
+ };
969
+ te = $i([
970
+ p(d.ContainerScoped),
971
+ Ri(0, h(T))
972
+ ], te);
973
+ var Ti = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, ji = (t, e, i, s) => {
974
+ for (var r = s > 1 ? void 0 : s ? Mi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
975
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
976
+ return s && r && Ti(e, i, r), r;
977
+ }, Te = (t, e) => (i, s) => e(i, s, t);
978
+ let ie = class {
979
+ constructor(t, e) {
980
+ this._service = t, this._controller = e;
981
+ }
982
+ init() {
983
+ }
984
+ dispose() {
985
+ }
986
+ scene(t) {
987
+ return t instanceof Le && (this._service.scene = t), this._service.scene;
988
+ }
989
+ enabled(t) {
990
+ return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
991
+ }
992
+ getBeforeRender$() {
993
+ return this._controller.beforeRender$;
994
+ }
995
+ getAfterRender$() {
996
+ return this._controller.afterRender$;
997
+ }
998
+ };
999
+ ie = ji([
1000
+ p(d.ContainerScoped),
1001
+ Te(0, h(T)),
1002
+ Te(1, h(te))
1003
+ ], ie);
1004
+ var xi = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, zi = (t, e, i, s) => {
1005
+ for (var r = s > 1 ? void 0 : s ? Ai(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1006
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1007
+ return s && r && xi(e, i, r), r;
1008
+ }, M = (t, e) => (i, s) => e(i, s, t);
1009
+ let se = class {
1010
+ constructor(t, e, i, s, r) {
1011
+ a(this, "enabled", !1);
1012
+ a(this, "cameraControls");
1013
+ a(this, "miniCamera");
1014
+ a(this, "miniCameraControls");
1015
+ a(this, "axesHelper");
1016
+ a(this, "gridHelper");
1017
+ this._appService = t, this._sizesService = e, this._rendererService = i, this._cameraService = s, this._worldService = r;
1018
+ }
1019
+ _renderMiniCamera() {
1020
+ var t, e, i, s, r;
1021
+ !this.enabled || !this.miniCamera || ((t = this._rendererService.instance) == null || t.setScissorTest(!0), (e = this._rendererService.instance) == null || e.setViewport(
1022
+ this._sizesService.width - this._sizesService.width / 3,
1023
+ this._sizesService.height - this._sizesService.height / 3,
1024
+ this._sizesService.width / 3,
1025
+ this._sizesService.height / 3
1026
+ ), (i = this._rendererService.instance) == null || i.setScissor(
1027
+ this._sizesService.width - this._sizesService.width / 3,
1028
+ this._sizesService.height - this._sizesService.height / 3,
1029
+ this._sizesService.width / 3,
1030
+ this._sizesService.height / 3
1031
+ ), (s = this._rendererService.instance) == null || s.render(
1032
+ this._worldService.scene,
1033
+ this.miniCamera
1034
+ ), (r = this._rendererService.instance) == null || r.setScissorTest(!1));
1035
+ }
1036
+ initMiniCamera() {
1037
+ this.disposeMiniCamera(), this.enabled && (this.miniCamera = new E(
1038
+ 75,
1039
+ this._sizesService.width / this._sizesService.height,
1040
+ 0.1,
1041
+ 500
1042
+ ), this.miniCamera.position.z = 10, this.miniCamera.position.x = -5);
1043
+ }
1044
+ initOrbitControl() {
1045
+ var t;
1046
+ this.cameraControls && ((t = this.cameraControls) == null || t.dispose()), !(!this.enabled || !(this._cameraService.instance instanceof j)) && this._cameraService.instance instanceof j && (this.cameraControls = new ye(
1047
+ this._cameraService.instance,
1048
+ this._appService.proxyReceiver
1049
+ ), this.cameraControls.rotateSpeed = 0.1, this.cameraControls.enableDamping = !0);
1050
+ }
1051
+ initMiniCameraOrbitControls() {
1052
+ this.miniCameraControls && this.miniCameraControls.dispose(), !(!this.enabled || !this.miniCamera) && (this.miniCameraControls = new ye(
1053
+ this.miniCamera,
1054
+ this._appService.proxyReceiver
1055
+ ), this.miniCameraControls.rotateSpeed = 0.15, this.miniCameraControls.enableDamping = !0);
1056
+ }
1057
+ initAxesHelper(t) {
1058
+ if (!this.enabled) return;
1059
+ const e = new lt(t);
1060
+ this._worldService.scene.add(e);
1061
+ }
1062
+ initGridHelper(t) {
1063
+ if (this.gridHelper && this._worldService.scene.remove(this.gridHelper), !this.enabled) return;
1064
+ const e = new _t(t, t);
1065
+ this._worldService.scene.add(e);
1066
+ }
1067
+ disposeMiniCamera() {
1068
+ this.miniCamera instanceof j && (this.miniCamera.clearViewOffset(), this.miniCamera.clear(), this.miniCamera = void 0);
1069
+ }
1070
+ update() {
1071
+ var t, e;
1072
+ (t = this.cameraControls) == null || t.update(), (e = this.miniCameraControls) == null || e.update(), this._renderMiniCamera();
1073
+ }
1074
+ dispose() {
1075
+ var t, e, i, s;
1076
+ this.disposeMiniCamera(), (t = this.cameraControls) == null || t.dispose(), this.cameraControls = void 0, (e = this.miniCameraControls) == null || e.dispose(), this.miniCameraControls = void 0, this.axesHelper && this._worldService.scene.remove(this.axesHelper), (i = this.axesHelper) == null || i.dispose(), this.axesHelper = void 0, this.gridHelper && this._worldService.scene.remove(this.gridHelper), (s = this.gridHelper) == null || s.dispose(), this.gridHelper = void 0;
1077
+ }
1078
+ };
1079
+ se = zi([
1080
+ p(d.ContainerScoped),
1081
+ M(0, h(A)),
1082
+ M(1, h(S)),
1083
+ M(2, h(O)),
1084
+ M(3, h(y)),
1085
+ M(4, h(T))
1086
+ ], se);
1087
+ var Li = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Ni = (t, e, i, s) => {
1088
+ for (var r = s > 1 ? void 0 : s ? Ii(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1089
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1090
+ return s && r && Li(e, i, r), r;
1091
+ }, Me = (t, e) => (i, s) => e(i, s, t);
1092
+ let re = class {
1093
+ constructor(t, e) {
1094
+ a(this, "step$");
1095
+ this.timerController = t, this._service = e, this.step$ = this.timerController.step$.pipe(
1096
+ C(() => this._service.enabled)
1097
+ );
1098
+ }
1099
+ };
1100
+ re = Ni([
1101
+ p(d.ContainerScoped),
1102
+ Me(0, h(R)),
1103
+ Me(1, h(y))
1104
+ ], re);
1105
+ var Hi = Object.defineProperty, Yi = Object.getOwnPropertyDescriptor, Fi = (t, e, i, s) => {
1106
+ for (var r = s > 1 ? void 0 : s ? Yi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1107
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1108
+ return s && r && Hi(e, i, r), r;
1109
+ }, je = (t, e) => (i, s) => e(i, s, t);
1110
+ let ne = class {
1111
+ constructor(t, e) {
1112
+ a(this, "_subscriptions", []);
1113
+ this._service = t, this._controller = e;
1114
+ }
1115
+ init(t) {
1116
+ this._service.enabled = !!t.enableDebug, this._service.enabled && (t.withMiniCamera && this._service.initMiniCamera(), t.enableControls && (this._service.initOrbitControl(), this._service.initMiniCameraOrbitControls()), typeof (t == null ? void 0 : t.axesSizes) == "number" && this._service.initAxesHelper(t.axesSizes), typeof (t == null ? void 0 : t.gridSizes) == "number" && this._service.initGridHelper(t.gridSizes), this._subscriptions.push(
1117
+ this._controller.step$.subscribe(() => {
1118
+ this._service.update();
1119
+ })
1120
+ ));
1121
+ }
1122
+ enabled(t) {
1123
+ return t && (this._service.enabled = t), this._service.enabled;
1124
+ }
1125
+ miniCamera(t) {
1126
+ return t && (this._service.miniCamera = t), this._service.miniCamera;
1127
+ }
1128
+ getAxesHelper() {
1129
+ return this._service.axesHelper;
1130
+ }
1131
+ getCameraControls() {
1132
+ return this._service.cameraControls;
1133
+ }
1134
+ getGridHelper() {
1135
+ return this._service.gridHelper;
1136
+ }
1137
+ getMiniCameraControls() {
1138
+ return this._service.miniCameraControls;
1139
+ }
1140
+ getStep$() {
1141
+ return this._controller.step$;
1142
+ }
1143
+ dispose() {
1144
+ this._service.dispose(), this._subscriptions.forEach((t) => t.unsubscribe());
1145
+ }
1146
+ };
1147
+ ne = Fi([
1148
+ p(d.ContainerScoped),
1149
+ je(0, h(se)),
1150
+ je(1, h(re))
1151
+ ], ne);
1152
+ var Ui = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, Ki = (t, e, i, s) => {
1153
+ for (var r = s > 1 ? void 0 : s ? Zi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1154
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1155
+ return s && r && Ui(e, i, r), r;
1156
+ };
1157
+ let U = class {
1158
+ constructor() {
1159
+ a(this, "loadedResources", {});
1160
+ a(this, "toLoadCount", 0);
1161
+ a(this, "loadedCount", 0);
1162
+ }
1163
+ handleLoad(t) {
1164
+ const { source: e, resource: i, loadedCount: s, toLoadCount: r } = t;
1165
+ i && (this.loadedResources[e.name] = i, this.toLoadCount = s, this.loadedCount = r);
1166
+ }
1167
+ };
1168
+ U = Ki([
1169
+ p(d.ResolutionScoped)
1170
+ ], U);
1171
+ var Wi = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, qi = (t, e, i, s) => {
1172
+ for (var r = s > 1 ? void 0 : s ? Xi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1173
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1174
+ return s && r && Wi(e, i, r), r;
1175
+ }, Bi = (t, e) => (i, s) => e(i, s, t);
1176
+ let oe = class {
1177
+ constructor(t) {
1178
+ a(this, "load$", Be(self, "message").pipe(
1179
+ C(
1180
+ (t) => {
1181
+ var e, i, s;
1182
+ return ((e = t.data) == null ? void 0 : e.token) === Ge && !!((s = (i = t.data) == null ? void 0 : i.payload) != null && s.resource);
1183
+ }
1184
+ ),
1185
+ q((t) => {
1186
+ var i, s, r, n, o;
1187
+ const { payload: e } = t.data || {};
1188
+ if (((i = e == null ? void 0 : e.source) == null ? void 0 : i.type) === "gltf") {
1189
+ const c = e.resource, _ = (s = c.animations) == null ? void 0 : s.map(
1190
+ (g) => pt.parse(g)
1191
+ ), m = (r = c.cameras) == null ? void 0 : r.map(
1192
+ (g) => be(g)
1193
+ ), w = (n = c.scenes) == null ? void 0 : n.map(
1194
+ (g) => be(g)
1195
+ ), z = w == null ? void 0 : w[0];
1196
+ return {
1197
+ ...e,
1198
+ resource: { ...c, animations: _, cameras: m, scene: z, scenes: w }
1199
+ };
1200
+ }
1201
+ return ((o = e == null ? void 0 : e.source) == null ? void 0 : o.type) === "font" ? {
1202
+ ...e,
1203
+ resource: new Ve(e.resource.data)
1204
+ } : e;
1205
+ }),
1206
+ x()
1207
+ ));
1208
+ a(this, "loadCompleted$", this.load$.pipe(
1209
+ C(
1210
+ (t) => !!t && t.toLoadCount === t.loadedCount
1211
+ ),
1212
+ q(
1213
+ () => Qe(this._service, [
1214
+ "loadedCount",
1215
+ "loadedResources",
1216
+ "toLoadCount"
1217
+ ])
1218
+ ),
1219
+ x()
1220
+ ));
1221
+ this._service = t;
1222
+ }
1223
+ };
1224
+ oe = qi([
1225
+ p(d.ContainerScoped),
1226
+ Bi(0, h(U))
1227
+ ], oe);
1228
+ var Gi = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, Qi = (t, e, i, s) => {
1229
+ for (var r = s > 1 ? void 0 : s ? Vi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1230
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1231
+ return s && r && Gi(e, i, r), r;
1232
+ }, xe = (t, e) => (i, s) => e(i, s, t);
1233
+ let ae = class {
1234
+ constructor(t, e) {
1235
+ a(this, "_subscriptions", []);
1236
+ this._controller = t, this._service = e;
1237
+ }
1238
+ init() {
1239
+ this._subscriptions.push(
1240
+ this._controller.load$.subscribe(
1241
+ this._service.handleLoad.bind(this._service)
1242
+ )
1243
+ );
1244
+ }
1245
+ getLoadedResources() {
1246
+ return this._service.loadedResources;
1247
+ }
1248
+ getLoadedCount() {
1249
+ return this._service.loadedCount;
1250
+ }
1251
+ getToLoadCount() {
1252
+ return this._service.toLoadCount;
1253
+ }
1254
+ getLoad$() {
1255
+ return this._controller.load$;
1256
+ }
1257
+ getLoadCompleted$() {
1258
+ return this._controller.loadCompleted$;
1259
+ }
1260
+ dispose() {
1261
+ this._subscriptions.forEach((t) => t.unsubscribe());
1262
+ }
1263
+ };
1264
+ ae = Qi([
1265
+ p(d.ContainerScoped),
1266
+ xe(0, h(oe)),
1267
+ xe(1, h(U))
1268
+ ], ae);
1269
+ var Ji = Object.defineProperty, ki = Object.getOwnPropertyDescriptor, es = (t, e, i, s) => {
1270
+ for (var r = s > 1 ? void 0 : s ? ki(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1271
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1272
+ return s && r && Ji(e, i, r), r;
1273
+ }, P = (t, e) => (i, s) => e(i, s, t);
1274
+ let he = class extends Je {
1275
+ constructor(t, e, i, s, r, n, o, c, _) {
1276
+ super(), this._controller = t, this._service = e, this.timer = i, this.sizes = s, this.camera = r, this.world = n, this.renderer = o, this.loader = c, this.debug = _, this._initProxyEvents();
1277
+ }
1278
+ _initProxyEvents() {
1279
+ ce.forEach((t) => {
1280
+ this[`${t}$`] = () => {
1281
+ var e;
1282
+ return (e = this._controller) == null ? void 0 : e[`${t}$`];
1283
+ }, this[t] = (e) => {
1284
+ var i, s;
1285
+ return (s = (i = this._controller) == null ? void 0 : i[t]) == null ? void 0 : s.call(i, e);
1286
+ };
1287
+ });
1288
+ }
1289
+ getProxyReceiver() {
1290
+ return this._service.proxyReceiver;
1291
+ }
1292
+ getCanvas() {
1293
+ return this._service.canvas;
1294
+ }
1295
+ getIsInitialized() {
1296
+ return this._service.isInitialized;
1297
+ }
1298
+ getBeforeStep$() {
1299
+ return this.timer.beforeStep$();
1300
+ }
1301
+ getStep$() {
1302
+ return this.timer.step$();
1303
+ }
1304
+ getBeforeRender$() {
1305
+ return this.world.getBeforeRender$();
1306
+ }
1307
+ getAfterRender$() {
1308
+ return this.world.getAfterRender$();
1309
+ }
1310
+ init(t) {
1311
+ this._service.isInitialized || !(t != null && t.canvas) || !(this._service.canvas = t.canvas) || (this._service.isInitialized = !0, this.sizes.init(this._service.canvas), this.camera.init(), this.world.init(), this.renderer.init(this._service.canvas), this.timer.init(t.startTimer), this.loader.init(), this.debug.init(t));
1312
+ }
1313
+ dispose() {
1314
+ this.sizes.dispose(), this.camera.dispose(), this.world.dispose(), this.renderer.dispose(), this.timer.dispose(), this.loader.dispose(), this.debug.dispose();
1315
+ }
1316
+ };
1317
+ he = es([
1318
+ p(d.ContainerScoped),
1319
+ P(0, h(H)),
1320
+ P(1, h(A)),
1321
+ P(2, h(G)),
1322
+ P(3, h(ee)),
1323
+ P(4, h(Q)),
1324
+ P(5, h(ie)),
1325
+ P(6, h(k)),
1326
+ P(7, h(ae)),
1327
+ P(8, h(ne))
1328
+ ], he);
1329
+ var ts = ke();
1330
+ const _e = /* @__PURE__ */ et(ts), is = _e.expose;
1331
+ _e.registerSerializer;
1332
+ _e.Transfer;
1333
+ const os = (t) => {
1334
+ const e = tt.createChildContainer(), i = e.resolve(he), s = { container: e, module: i }, r = {}, n = (o) => {
1335
+ var w, z, g, pe, de;
1336
+ if (!((w = o.data) != null && w.canvas) || i.getIsInitialized()) return;
1337
+ const c = !!((z = o.data) != null && z.startTimer), _ = !!((g = o.data) != null && g.withMiniCamera), m = !!((pe = o.data) != null && pe.fullScreen);
1338
+ i.init({
1339
+ ...o.data,
1340
+ startTimer: c,
1341
+ withMiniCamera: _,
1342
+ fullScreen: m
1343
+ }), (de = t == null ? void 0 : t.onReady) == null || de.call(t, s), self == null || self.removeEventListener("message", n);
17
1344
  };
18
- return a.register(b, { useValue: a }), $.forEach((t) => {
19
- var r, i;
20
- d[t] = (i = (r = e[t]) == null ? void 0 : r.bind) == null ? void 0 : i.call(r, e);
21
- }), self == null || self.addEventListener("message", c), T({
22
- ...d,
23
- getProxyReceiver: e.getProxyReceiver.bind(e),
24
- getIsInitialized: e.getIsInitialized.bind(e),
25
- getBeforeStep$: e.getBeforeStep$.bind(e),
26
- getBeforeRender$: e.getBeforeRender$.bind(e),
27
- getStep$: e.getStep$.bind(e),
28
- getAfterRender$: e.getAfterRender$.bind(e),
29
- dispose: e.dispose.bind(e)
30
- }), o;
1345
+ return e.register(it, { useValue: e }), ce.forEach((o) => {
1346
+ var c, _;
1347
+ r[o] = (_ = (c = i[o]) == null ? void 0 : c.bind) == null ? void 0 : _.call(c, i);
1348
+ }), self == null || self.addEventListener("message", n), is({
1349
+ ...r,
1350
+ getProxyReceiver: i.getProxyReceiver.bind(i),
1351
+ getIsInitialized: i.getIsInitialized.bind(i),
1352
+ getBeforeStep$: i.getBeforeStep$.bind(i),
1353
+ getBeforeRender$: i.getBeforeRender$.bind(i),
1354
+ getStep$: i.getStep$.bind(i),
1355
+ getAfterRender$: i.getAfterRender$.bind(i),
1356
+ dispose: i.dispose.bind(i)
1357
+ }), s;
31
1358
  };
32
1359
  export {
33
- v as launchApp
1360
+ he as AppModule,
1361
+ os as launchApp
34
1362
  };