@quick-threejs/reactive 0.1.38 → 0.1.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quick-threejs/reactive",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "Reactively quick start a three.js app ⚡️",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,28 +36,29 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "rxjs": "^7.8.1",
39
+ "rxjs": "^7.8.2",
40
40
  "threads": "^1.7.0",
41
41
  "three": "^0.172.0",
42
42
  "vite-plugin-glslify": "^2.1.0",
43
- "@quick-threejs/utils": "0.1.17"
43
+ "@quick-threejs/worker": "0.1.17",
44
+ "@quick-threejs/utils": "0.1.18"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "three": "^0.172.0"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@types/events": "^3.0.3",
50
- "@types/jest": "^29.5.14",
51
- "@types/node": "^22.10.2",
52
- "@types/stats.js": "^0.17.3",
51
+ "@types/jest": "^30.0.0",
52
+ "@types/node": "^24.3.1",
53
+ "@types/stats.js": "^0.17.4",
53
54
  "@types/three": "^0.172.0",
54
55
  "babel-jest": "^29.7.0",
55
56
  "events": "^3.3.0",
56
- "jest": "^29.7.0",
57
+ "jest": "^30.1.3",
57
58
  "reflect-metadata": "^0.2.2",
58
59
  "ts-jest": "^29.2.5",
59
60
  "ts-node": "^10.9.2",
60
- "tsyringe": "^4.8.0",
61
+ "tsyringe": "^4.10.0",
61
62
  "vite": "^6.0.3",
62
63
  "@quick-threejs/config": "0.1.13"
63
64
  },
@@ -1,35 +0,0 @@
1
- "use strict";var Ei=Object.defineProperty;var Oi=(t,e,r)=>e in t?Ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var p=(t,e,r)=>Oi(t,typeof e!="symbol"?e+"":e,r);const O=require("three");var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ti(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Ir={};/*! *****************************************************************************
2
- Copyright (C) Microsoft. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */var zr;function Mi(){if(zr)return Ir;zr=1;var t;return function(e){(function(r){var n=typeof globalThis=="object"?globalThis:typeof kr=="object"?kr:typeof self=="object"?self:typeof this=="object"?this:u(),i=s(e);typeof n.Reflect<"u"&&(i=s(n.Reflect,i)),r(i,n),typeof n.Reflect>"u"&&(n.Reflect=e);function s(c,l){return function(h,v){Object.defineProperty(c,h,{configurable:!0,writable:!0,value:v}),l&&l(h,v)}}function o(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return o()||a()}})(function(r,n){var i=Object.prototype.hasOwnProperty,s=typeof Symbol=="function",o=s&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=s&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",c={__proto__:[]}instanceof Array,l=!u&&!c,h={create:u?function(){return $t(Object.create(null))}:c?function(){return $t({__proto__:null})}:function(){return $t({})},has:l?function(f,d){return i.call(f,d)}:function(f,d){return d in f},get:l?function(f,d){return i.call(f,d)?f[d]:void 0}:function(f,d){return f[d]}},v=Object.getPrototypeOf(Function),w=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:wi(),L=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:gi(),M=typeof WeakMap=="function"?WeakMap:Si(),D=s?Symbol.for("@reflect-metadata:registry"):void 0,_=yi(),P=_i(_);function S(f,d,m,C){if(F(m)){if(!Tr(f))throw new TypeError;if(!Mr(d))throw new TypeError;return ne(f,d)}else{if(!Tr(f))throw new TypeError;if(!J(d))throw new TypeError;if(!J(C)&&!F(C)&&!ke(C))throw new TypeError;return ke(C)&&(C=void 0),m=ue(m),G(f,d,m,C)}}r("decorate",S);function $(f,d){function m(C,A){if(!J(C))throw new TypeError;if(!F(A)&&!vi(A))throw new TypeError;ce(f,d,C,A)}return m}r("metadata",$);function g(f,d,m,C){if(!J(m))throw new TypeError;return F(C)||(C=ue(C)),ce(f,d,m,C)}r("defineMetadata",g);function b(f,d,m){if(!J(d))throw new TypeError;return F(m)||(m=ue(m)),K(f,d,m)}r("hasMetadata",b);function k(f,d,m){if(!J(d))throw new TypeError;return F(m)||(m=ue(m)),he(f,d,m)}r("hasOwnMetadata",k);function U(f,d,m){if(!J(d))throw new TypeError;return F(m)||(m=ue(m)),ot(f,d,m)}r("getMetadata",U);function y(f,d,m){if(!J(d))throw new TypeError;return F(m)||(m=ue(m)),De(f,d,m)}r("getOwnMetadata",y);function x(f,d){if(!J(f))throw new TypeError;return F(d)||(d=ue(d)),Ae(f,d)}r("getMetadataKeys",x);function z(f,d){if(!J(f))throw new TypeError;return F(d)||(d=ue(d)),Pr(f,d)}r("getOwnMetadataKeys",z);function H(f,d,m){if(!J(d))throw new TypeError;if(F(m)||(m=ue(m)),!J(d))throw new TypeError;F(m)||(m=ue(m));var C=Be(d,m,!1);return F(C)?!1:C.OrdinaryDeleteMetadata(f,d,m)}r("deleteMetadata",H);function ne(f,d){for(var m=f.length-1;m>=0;--m){var C=f[m],A=C(d);if(!F(A)&&!ke(A)){if(!Mr(A))throw new TypeError;d=A}}return d}function G(f,d,m,C){for(var A=f.length-1;A>=0;--A){var te=f[A],X=te(d,m,C);if(!F(X)&&!ke(X)){if(!J(X))throw new TypeError;C=X}}return C}function K(f,d,m){var C=he(f,d,m);if(C)return!0;var A=Rt(d);return ke(A)?!1:K(f,A,m)}function he(f,d,m){var C=Be(d,m,!1);return F(C)?!1:Or(C.OrdinaryHasOwnMetadata(f,d,m))}function ot(f,d,m){var C=he(f,d,m);if(C)return De(f,d,m);var A=Rt(d);if(!ke(A))return ot(f,A,m)}function De(f,d,m){var C=Be(d,m,!1);if(!F(C))return C.OrdinaryGetOwnMetadata(f,d,m)}function ce(f,d,m,C){var A=Be(m,C,!0);A.OrdinaryDefineOwnMetadata(f,d,m,C)}function Ae(f,d){var m=Pr(f,d),C=Rt(f);if(C===null)return m;var A=Ae(C,d);if(A.length<=0)return m;if(m.length<=0)return A;for(var te=new L,X=[],N=0,E=m;N<E.length;N++){var T=E[N],R=te.has(T);R||(te.add(T),X.push(T))}for(var j=0,q=A;j<q.length;j++){var T=q[j],R=te.has(T);R||(te.add(T),X.push(T))}return X}function Pr(f,d){var m=Be(f,d,!1);return m?m.OrdinaryOwnMetadataKeys(f,d):[]}function Er(f){if(f===null)return 1;switch(typeof f){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return f===null?1:6;default:return 6}}function F(f){return f===void 0}function ke(f){return f===null}function hi(f){return typeof f=="symbol"}function J(f){return typeof f=="object"?f!==null:typeof f=="function"}function fi(f,d){switch(Er(f)){case 0:return f;case 1:return f;case 2:return f;case 3:return f;case 4:return f;case 5:return f}var m="string",C=Rr(f,o);if(C!==void 0){var A=C.call(f,m);if(J(A))throw new TypeError;return A}return di(f)}function di(f,d){var m,C;{var A=f.toString;if(at(A)){var C=A.call(f);if(!J(C))return C}var m=f.valueOf;if(at(m)){var C=m.call(f);if(!J(C))return C}}throw new TypeError}function Or(f){return!!f}function pi(f){return""+f}function ue(f){var d=fi(f);return hi(d)?d:pi(d)}function Tr(f){return Array.isArray?Array.isArray(f):f instanceof Object?f instanceof Array:Object.prototype.toString.call(f)==="[object Array]"}function at(f){return typeof f=="function"}function Mr(f){return typeof f=="function"}function vi(f){switch(Er(f)){case 3:return!0;case 4:return!0;default:return!1}}function Mt(f,d){return f===d||f!==f&&d!==d}function Rr(f,d){var m=f[d];if(m!=null){if(!at(m))throw new TypeError;return m}}function $r(f){var d=Rr(f,a);if(!at(d))throw new TypeError;var m=d.call(f);if(!J(m))throw new TypeError;return m}function jr(f){return f.value}function xr(f){var d=f.next();return d.done?!1:d}function Dr(f){var d=f.return;d&&d.call(f)}function Rt(f){var d=Object.getPrototypeOf(f);if(typeof f!="function"||f===v||d!==v)return d;var m=f.prototype,C=m&&Object.getPrototypeOf(m);if(C==null||C===Object.prototype)return d;var A=C.constructor;return typeof A!="function"||A===f?d:A}function mi(){var f;!F(D)&&typeof n.Reflect<"u"&&!(D in n.Reflect)&&typeof n.Reflect.defineMetadata=="function"&&(f=bi(n.Reflect));var d,m,C,A=new M,te={registerProvider:X,getProvider:E,setProvider:R};return te;function X(j){if(!Object.isExtensible(te))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case f===j:break;case F(d):d=j;break;case d===j:break;case F(m):m=j;break;case m===j:break;default:C===void 0&&(C=new L),C.add(j);break}}function N(j,q){if(!F(d)){if(d.isProviderFor(j,q))return d;if(!F(m)){if(m.isProviderFor(j,q))return d;if(!F(C))for(var B=$r(C);;){var Q=xr(B);if(!Q)return;var ae=jr(Q);if(ae.isProviderFor(j,q))return Dr(B),ae}}}if(!F(f)&&f.isProviderFor(j,q))return f}function E(j,q){var B=A.get(j),Q;return F(B)||(Q=B.get(q)),F(Q)&&(Q=N(j,q),F(Q)||(F(B)&&(B=new w,A.set(j,B)),B.set(q,Q))),Q}function T(j){if(F(j))throw new TypeError;return d===j||m===j||!F(C)&&C.has(j)}function R(j,q,B){if(!T(B))throw new Error("Metadata provider not registered.");var Q=E(j,q);if(Q!==B){if(!F(Q))return!1;var ae=A.get(j);F(ae)&&(ae=new w,A.set(j,ae)),ae.set(q,B)}return!0}}function yi(){var f;return!F(D)&&J(n.Reflect)&&Object.isExtensible(n.Reflect)&&(f=n.Reflect[D]),F(f)&&(f=mi()),!F(D)&&J(n.Reflect)&&Object.isExtensible(n.Reflect)&&Object.defineProperty(n.Reflect,D,{enumerable:!1,configurable:!1,writable:!1,value:f}),f}function _i(f){var d=new M,m={isProviderFor:function(T,R){var j=d.get(T);return F(j)?!1:j.has(R)},OrdinaryDefineOwnMetadata:X,OrdinaryHasOwnMetadata:A,OrdinaryGetOwnMetadata:te,OrdinaryOwnMetadataKeys:N,OrdinaryDeleteMetadata:E};return _.registerProvider(m),m;function C(T,R,j){var q=d.get(T),B=!1;if(F(q)){if(!j)return;q=new w,d.set(T,q),B=!0}var Q=q.get(R);if(F(Q)){if(!j)return;if(Q=new w,q.set(R,Q),!f.setProvider(T,R,m))throw q.delete(R),B&&d.delete(T),new Error("Wrong provider for target.")}return Q}function A(T,R,j){var q=C(R,j,!1);return F(q)?!1:Or(q.has(T))}function te(T,R,j){var q=C(R,j,!1);if(!F(q))return q.get(T)}function X(T,R,j,q){var B=C(j,q,!0);B.set(T,R)}function N(T,R){var j=[],q=C(T,R,!1);if(F(q))return j;for(var B=q.keys(),Q=$r(B),ae=0;;){var Ar=xr(Q);if(!Ar)return j.length=ae,j;var Ci=jr(Ar);try{j[ae]=Ci}catch(Pi){try{Dr(Q)}finally{throw Pi}}ae++}}function E(T,R,j){var q=C(R,j,!1);if(F(q)||!q.delete(T))return!1;if(q.size===0){var B=d.get(R);F(B)||(B.delete(j),B.size===0&&d.delete(B))}return!0}}function bi(f){var d=f.defineMetadata,m=f.hasOwnMetadata,C=f.getOwnMetadata,A=f.getOwnMetadataKeys,te=f.deleteMetadata,X=new M,N={isProviderFor:function(E,T){var R=X.get(E);return!F(R)&&R.has(T)?!0:A(E,T).length?(F(R)&&(R=new L,X.set(E,R)),R.add(T),!0):!1},OrdinaryDefineOwnMetadata:d,OrdinaryHasOwnMetadata:m,OrdinaryGetOwnMetadata:C,OrdinaryOwnMetadataKeys:A,OrdinaryDeleteMetadata:te};return N}function Be(f,d,m){var C=_.getProvider(f,d);if(!F(C))return C;if(m){if(_.setProvider(f,d,P))return P;throw new Error("Illegal state.")}}function wi(){var f={},d=[],m=function(){function N(E,T,R){this._index=0,this._keys=E,this._values=T,this._selector=R}return N.prototype["@@iterator"]=function(){return this},N.prototype[a]=function(){return this},N.prototype.next=function(){var E=this._index;if(E>=0&&E<this._keys.length){var T=this._selector(this._keys[E],this._values[E]);return E+1>=this._keys.length?(this._index=-1,this._keys=d,this._values=d):this._index++,{value:T,done:!1}}return{value:void 0,done:!0}},N.prototype.throw=function(E){throw this._index>=0&&(this._index=-1,this._keys=d,this._values=d),E},N.prototype.return=function(E){return this._index>=0&&(this._index=-1,this._keys=d,this._values=d),{value:E,done:!0}},N}(),C=function(){function N(){this._keys=[],this._values=[],this._cacheKey=f,this._cacheIndex=-2}return Object.defineProperty(N.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),N.prototype.has=function(E){return this._find(E,!1)>=0},N.prototype.get=function(E){var T=this._find(E,!1);return T>=0?this._values[T]:void 0},N.prototype.set=function(E,T){var R=this._find(E,!0);return this._values[R]=T,this},N.prototype.delete=function(E){var T=this._find(E,!1);if(T>=0){for(var R=this._keys.length,j=T+1;j<R;j++)this._keys[j-1]=this._keys[j],this._values[j-1]=this._values[j];return this._keys.length--,this._values.length--,Mt(E,this._cacheKey)&&(this._cacheKey=f,this._cacheIndex=-2),!0}return!1},N.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=f,this._cacheIndex=-2},N.prototype.keys=function(){return new m(this._keys,this._values,A)},N.prototype.values=function(){return new m(this._keys,this._values,te)},N.prototype.entries=function(){return new m(this._keys,this._values,X)},N.prototype["@@iterator"]=function(){return this.entries()},N.prototype[a]=function(){return this.entries()},N.prototype._find=function(E,T){if(!Mt(this._cacheKey,E)){this._cacheIndex=-1;for(var R=0;R<this._keys.length;R++)if(Mt(this._keys[R],E)){this._cacheIndex=R;break}}return this._cacheIndex<0&&T&&(this._cacheIndex=this._keys.length,this._keys.push(E),this._values.push(void 0)),this._cacheIndex},N}();return C;function A(N,E){return N}function te(N,E){return E}function X(N,E){return[N,E]}}function gi(){var f=function(){function d(){this._map=new w}return Object.defineProperty(d.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),d.prototype.has=function(m){return this._map.has(m)},d.prototype.add=function(m){return this._map.set(m,m),this},d.prototype.delete=function(m){return this._map.delete(m)},d.prototype.clear=function(){this._map.clear()},d.prototype.keys=function(){return this._map.keys()},d.prototype.values=function(){return this._map.keys()},d.prototype.entries=function(){return this._map.entries()},d.prototype["@@iterator"]=function(){return this.keys()},d.prototype[a]=function(){return this.keys()},d}();return f}function Si(){var f=16,d=h.create(),m=C();return function(){function E(){this._key=C()}return E.prototype.has=function(T){var R=A(T,!1);return R!==void 0?h.has(R,this._key):!1},E.prototype.get=function(T){var R=A(T,!1);return R!==void 0?h.get(R,this._key):void 0},E.prototype.set=function(T,R){var j=A(T,!0);return j[this._key]=R,this},E.prototype.delete=function(T){var R=A(T,!1);return R!==void 0?delete R[this._key]:!1},E.prototype.clear=function(){this._key=C()},E}();function C(){var E;do E="@@WeakMap@@"+N();while(h.has(d,E));return d[E]=!0,E}function A(E,T){if(!i.call(E,m)){if(!T)return;Object.defineProperty(E,m,{value:h.create()})}return E[m]}function te(E,T){for(var R=0;R<T;++R)E[R]=Math.random()*255|0;return E}function X(E){if(typeof Uint8Array=="function"){var T=new Uint8Array(E);return typeof crypto<"u"?crypto.getRandomValues(T):typeof msCrypto<"u"?msCrypto.getRandomValues(T):te(T,E),T}return te(new Array(E),E)}function N(){var E=X(f);E[6]=E[6]&79|64,E[8]=E[8]&191|128;for(var T="",R=0;R<f;++R){var j=E[R];(R===4||R===6||R===8)&&(T+="-"),j<16&&(T+="0"),T+=j.toString(16).toLowerCase()}return T}}function $t(f){return f.__=void 0,delete f.__,f}})}(t||(t={})),Ir}Mi();var Bt;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Bt||(Bt={}));const W=Bt;/*! *****************************************************************************
15
- Copyright (c) Microsoft Corporation.
16
-
17
- Permission to use, copy, modify, and/or distribute this software for any
18
- purpose with or without fee is hereby granted.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
- PERFORMANCE OF THIS SOFTWARE.
27
- ***************************************************************************** */var Yt=function(t,e){return Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Yt(t,e)};function vr(t,e){Yt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Ri(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,[])).next())})}function $i(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ct(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Te(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(yt(arguments[e]));return t}var Zt="injectionTokens";function ji(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(Zt,t)||{};return Object.keys(r).forEach(function(n){e[+n]=r[n]}),e}function xi(t,e){return function(r,n,i){var s=Reflect.getOwnMetadata(Zt,r)||{};s[i]=t,Reflect.defineMetadata(Zt,s,r)}}function $n(t){return!!t.useClass}function Gt(t){return!!t.useFactory}var jn=function(){function t(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return t.prototype.createProxy=function(e){var r=this,n={},i=!1,s,o=function(){return i||(s=e(r.wrap()),i=!0),s};return new Proxy(n,this.createHandler(o))},t.prototype.createHandler=function(e){var r={},n=function(i){r[i]=function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];s[0]=e();var a=Reflect[i];return a.apply(void 0,Te(s))}};return this.reflectMethods.forEach(n),r},t}();function Ie(t){return typeof t=="string"||typeof t=="symbol"}function Di(t){return typeof t=="object"&&"token"in t&&"multiple"in t}function Fr(t){return typeof t=="object"&&"token"in t&&"transform"in t}function Ai(t){return typeof t=="function"||t instanceof jn}function dt(t){return!!t.useToken}function pt(t){return t.useValue!=null}function ki(t){return $n(t)||pt(t)||dt(t)||Gt(t)}var mr=function(){function t(){this._registryMap=new Map}return t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},t.prototype.get=function(e){this.ensure(e);var r=this._registryMap.get(e);return r[r.length-1]||null},t.prototype.set=function(e,r){this.ensure(e),this._registryMap.get(e).push(r)},t.prototype.setAll=function(e,r){this._registryMap.set(e,r)},t.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},t}(),Ii=function(t){vr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mr),Lr=function(){function t(){this.scopedResolutions=new Map}return t}();function zi(t,e){if(t===null)return"at position #"+e;var r=t.split(",")[e].trim();return'"'+r+'" at position #'+e}function Fi(t,e,r){return r===void 0&&(r=" "),Te([t],e.message.split(`
28
- `).map(function(n){return r+n})).join(`
29
- `)}function Li(t,e,r){var n=yt(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2),i=n[1],s=i===void 0?null:i,o=zi(s,e);return Fi("Cannot inject the dependency "+o+' of "'+t.name+'" constructor. Reason:',r)}function Wi(t){if(typeof t.dispose!="function")return!1;var e=t.dispose;return!(e.length>0)}var Ni=function(t){vr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mr),qi=function(t){vr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mr),Ui=function(){function t(){this.preResolution=new Ni,this.postResolution=new qi}return t}(),xn=new Map,Hi=function(){function t(e){this.parent=e,this._registry=new Ii,this.interceptors=new Ui,this.disposed=!1,this.disposables=new Set}return t.prototype.register=function(e,r,n){n===void 0&&(n={lifecycle:W.Transient}),this.ensureNotDisposed();var i;if(ki(r)?i=r:i={useClass:r},dt(i))for(var s=[e],o=i;o!=null;){var a=o.useToken;if(s.includes(a))throw new Error("Token registration cycle detected! "+Te(s,[a]).join(" -> "));s.push(a);var u=this._registry.get(a);u&&dt(u.provider)?o=u.provider:o=null}if((n.lifecycle===W.Singleton||n.lifecycle==W.ContainerScoped||n.lifecycle==W.ResolutionScoped)&&(pt(i)||Gt(i)))throw new Error('Cannot use lifecycle "'+W[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:n}),this},t.prototype.registerType=function(e,r){return this.ensureNotDisposed(),Ie(r)?this.register(e,{useToken:r}):this.register(e,{useClass:r})},t.prototype.registerInstance=function(e,r){return this.ensureNotDisposed(),this.register(e,{useValue:r})},t.prototype.registerSingleton=function(e,r){if(this.ensureNotDisposed(),Ie(e)){if(Ie(r))return this.register(e,{useToken:r},{lifecycle:W.Singleton});if(r)return this.register(e,{useClass:r},{lifecycle:W.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return r&&!Ie(r)&&(n=r),this.register(e,{useClass:n},{lifecycle:W.Singleton})},t.prototype.resolve=function(e,r){r===void 0&&(r=new Lr),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Ie(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),n){var i=this.resolveRegistration(n,r);return this.executePostResolutionInterceptor(e,i,"Single"),i}if(Ai(e)){var i=this.construct(e,r);return this.executePostResolutionInterceptor(e,i,"Single"),i}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(e,r){var n,i;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var o=ct(this.interceptors.preResolution.getAll(e)),a=o.next();!a.done;a=o.next()){var u=a.value;u.options.frequency!="Once"&&s.push(u),u.callback(e,r)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,s)}},t.prototype.executePostResolutionInterceptor=function(e,r,n){var i,s;if(this.interceptors.postResolution.has(e)){var o=[];try{for(var a=ct(this.interceptors.postResolution.getAll(e)),u=a.next();!u.done;u=a.next()){var c=u.value;c.options.frequency!="Once"&&o.push(c),c.callback(e,r,n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,o)}},t.prototype.resolveRegistration=function(e,r){if(this.ensureNotDisposed(),e.options.lifecycle===W.ResolutionScoped&&r.scopedResolutions.has(e))return r.scopedResolutions.get(e);var n=e.options.lifecycle===W.Singleton,i=e.options.lifecycle===W.ContainerScoped,s=n||i,o;return pt(e.provider)?o=e.provider.useValue:dt(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,r)):this.resolve(e.provider.useToken,r):$n(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,r)):this.construct(e.provider.useClass,r):Gt(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,r),e.options.lifecycle===W.ResolutionScoped&&r.scopedResolutions.set(e,o),o},t.prototype.resolveAll=function(e,r){var n=this;r===void 0&&(r=new Lr),this.ensureNotDisposed();var i=this.getAllRegistrations(e);if(!i&&Ie(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),i){var s=i.map(function(a){return n.resolveRegistration(a,r)});return this.executePostResolutionInterceptor(e,s,"All"),s}var o=[this.construct(e,r)];return this.executePostResolutionInterceptor(e,o,"All"),o},t.prototype.isRegistered=function(e,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(e)||r&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},t.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var e,r;this.ensureNotDisposed();try{for(var n=ct(this._registry.entries()),i=n.next();!i.done;i=n.next()){var s=yt(i.value,2),o=s[0],a=s[1];this._registry.setAll(o,a.filter(function(u){return!pt(u.provider)}).map(function(u){return u.instance=void 0,u}))}}catch(u){e={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.createChildContainer=function(){var e,r;this.ensureNotDisposed();var n=new t(this);try{for(var i=ct(this._registry.entries()),s=i.next();!s.done;s=i.next()){var o=yt(s.value,2),a=o[0],u=o[1];u.some(function(c){var l=c.options;return l.lifecycle===W.ContainerScoped})&&n._registry.setAll(a,u.map(function(c){return c.options.lifecycle===W.ContainerScoped?{provider:c.provider,options:c.options}:c}))}}catch(c){e={error:c}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},t.prototype.beforeResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:r,options:n})},t.prototype.afterResolution=function(e,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:r,options:n})},t.prototype.dispose=function(){return Ri(this,void 0,void 0,function(){var e;return $i(this,function(r){switch(r.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(n){var i=n.dispose();i&&e.push(i)}),[4,Promise.all(e)];case 1:return r.sent(),[2]}})})},t.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},t.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},t.prototype.construct=function(e,r){var n=this;if(e instanceof jn)return e.createProxy(function(s){return n.resolve(s,r)});var i=function(){var s=xn.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var o=s.map(n.resolveParams(r,e));return new(e.bind.apply(e,Te([void 0],o)))}();return Wi(i)&&this.disposables.add(i),i},t.prototype.resolveParams=function(e,r){var n=this;return function(i,s){var o,a,u;try{return Di(i)?Fr(i)?i.multiple?(o=n.resolve(i.transform)).transform.apply(o,Te([n.resolveAll(i.token)],i.transformArgs)):(a=n.resolve(i.transform)).transform.apply(a,Te([n.resolve(i.token,e)],i.transformArgs)):i.multiple?n.resolveAll(i.token):n.resolve(i.token,e):Fr(i)?(u=n.resolve(i.transform,e)).transform.apply(u,Te([n.resolve(i.token,e)],i.transformArgs)):n.resolve(i,e)}catch(c){throw new Error(Li(r,s,c))}}},t.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},t}(),Dn=new Hi;function I(t){return xi(t)}function Vi(){return function(t){xn.set(t,ji(t))}}function Z(t,e){return function(r){Vi()(r),Dn.register(r,r,{lifecycle:t})}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);const Bi=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yr=["contextmenu","resize","mousedown","mousemove","mouseup","pointerdown","pointermove","pointercancel","pointerup","touchstart","touchmove","touchend","wheel","keydown"];var _t=(t=>(t[t.PERSPECTIVE=0]="PERSPECTIVE",t[t.ORTHOGRAPHIC=1]="ORTHOGRAPHIC",t))(_t||{});class An{constructor(){p(this,"contextmenu$$");p(this,"resize$$");p(this,"mousedown$$");p(this,"mousemove$$");p(this,"mouseup$$");p(this,"pointerdown$$");p(this,"pointermove$$");p(this,"pointercancel$$");p(this,"pointerup$$");p(this,"touchstart$$");p(this,"touchmove$$");p(this,"touchend$$");p(this,"wheel$$");p(this,"keydown$$")}}class kn extends An{constructor(){super(...arguments);p(this,"contextmenu$");p(this,"resize$");p(this,"mousedown$");p(this,"mousemove$");p(this,"mouseup$");p(this,"pointerdown$");p(this,"pointermove$");p(this,"pointercancel$");p(this,"pointerup$");p(this,"touchstart$");p(this,"touchmove$");p(this,"touchend$");p(this,"wheel$");p(this,"keydown$")}}class In extends kn{constructor(){super(...arguments);p(this,"contextmenu");p(this,"resize");p(this,"mousedown");p(this,"mousemove");p(this,"mouseup");p(this,"pointerdown");p(this,"pointermove");p(this,"pointercancel");p(this,"pointerup");p(this,"touchstart");p(this,"touchmove");p(this,"touchend");p(this,"wheel");p(this,"keydown")}}class zn{constructor(){p(this,"contextmenu$");p(this,"resize$");p(this,"mousedown$");p(this,"mousemove$");p(this,"mouseup$");p(this,"pointerdown$");p(this,"pointermove$");p(this,"pointercancel$");p(this,"pointerup$");p(this,"touchstart$");p(this,"touchmove$");p(this,"touchend$");p(this,"wheel$");p(this,"keydown$");p(this,"contextmenu");p(this,"resize");p(this,"mousedown");p(this,"mousemove");p(this,"mouseup");p(this,"pointerdown");p(this,"pointermove");p(this,"pointercancel");p(this,"pointerup");p(this,"touchstart");p(this,"touchmove");p(this,"touchend");p(this,"wheel");p(this,"keydown")}}class Yi{constructor(){p(this,"contextmenu$");p(this,"resize$");p(this,"mousedown$");p(this,"mousemove$");p(this,"mouseup$");p(this,"pointerdown$");p(this,"pointermove$");p(this,"pointercancel$");p(this,"pointerup$");p(this,"touchstart$");p(this,"touchmove$");p(this,"touchend$");p(this,"wheel$");p(this,"keydown$")}}const Zi="CONTAINER",Fn="LOADER_SERIALIZED_LOAD";var Qt=function(t,e){return Qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Qt(t,e)};function rt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Qt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Gi(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function Ln(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Fe(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _e(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Me(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function ze(t){return this instanceof ze?(this.v=t,this):new ze(t)}function Qi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(w){return function(L){return Promise.resolve(L).then(w,h)}}function a(w,L){n[w]&&(i[w]=function(M){return new Promise(function(D,_){s.push([w,M,D,_])>1||u(w,M)})},L&&(i[w]=L(i[w])))}function u(w,L){try{c(n[w](L))}catch(M){v(s[0][3],M)}}function c(w){w.value instanceof ze?Promise.resolve(w.value.v).then(l,h):v(s[0][2],w)}function l(w){u("next",w)}function h(w){u("throw",w)}function v(w,L){w(L),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Ki(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Fe=="function"?Fe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}}function Y(t){return typeof t=="function"}function Wn(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var jt=Wn(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
30
- `+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
31
- `):"",this.name="UnsubscriptionError",this.errors=r}});function Kt(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var nt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Fe(o),u=a.next();!u.done;u=a.next()){var c=u.value;c.remove(this)}}catch(M){e={error:M}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(Y(l))try{l()}catch(M){s=M instanceof jt?M.errors:[M]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var v=Fe(h),w=v.next();!w.done;w=v.next()){var L=w.value;try{Wr(L)}catch(M){s=s??[],M instanceof jt?s=Me(Me([],_e(s)),_e(M.errors)):s.push(M)}}}catch(M){n={error:M}}finally{try{w&&!w.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}if(s)throw new jt(s)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Wr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Kt(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Kt(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Nn=nt.EMPTY;function qn(t){return t instanceof nt||t&&"closed"in t&&Y(t.remove)&&Y(t.add)&&Y(t.unsubscribe)}function Wr(t){Y(t)?t():t.unsubscribe()}var Un={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Hn={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Me([t,e],_e(r)))},clearTimeout:function(t){var e=Hn.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Vn(t){Hn.setTimeout(function(){throw t})}function Nr(){}function vt(t){t()}var _r=function(t){rt(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,qn(r)&&r.add(n)):n.destination=ts,n}return e.create=function(r,n,i){return new Xe(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(nt),Ji=Function.prototype.bind;function xt(t,e){return Ji.call(t,e)}var Xi=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){ut(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){ut(n)}else ut(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){ut(r)}},t}(),Xe=function(t){rt(e,t);function e(r,n,i){var s=t.call(this)||this,o;if(Y(r)||!r)o={next:r??void 0,error:n??void 0,complete:i??void 0};else{var a;s&&Un.useDeprecatedNextContext?(a=Object.create(r),a.unsubscribe=function(){return s.unsubscribe()},o={next:r.next&&xt(r.next,a),error:r.error&&xt(r.error,a),complete:r.complete&&xt(r.complete,a)}):o=r}return s.destination=new Xi(o),s}return e}(_r);function ut(t){Vn(t)}function es(t){throw t}var ts={closed:!0,next:Nr,error:es,complete:Nr},br=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Bn(t){return t}function rs(t){return t.length===0?Bn:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var le=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,s=is(e)?e:new Xe(e,r,n);return vt(function(){var o=i,a=o.operator,u=o.source;s.add(a?a.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=qr(r),new r(function(i,s){var o=new Xe({next:function(a){try{e(a)}catch(u){s(u),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[br]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return rs(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=qr(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function qr(t){var e;return(e=t??Un.Promise)!==null&&e!==void 0?e:Promise}function ns(t){return t&&Y(t.next)&&Y(t.error)&&Y(t.complete)}function is(t){return t&&t instanceof _r||ns(t)&&qn(t)}function ss(t){return Y(t==null?void 0:t.lift)}function Ve(t){return function(e){if(ss(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Le(t,e,r,n,i){return new os(t,e,r,n,i)}var os=function(t){rt(e,t);function e(r,n,i,s,o,a){var u=t.call(this,r)||this;return u.onFinalize=o,u.shouldUnsubscribe=a,u._next=n?function(c){try{n(c)}catch(l){r.error(l)}}:t.prototype._next,u._error=s?function(c){try{s(c)}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(_r),as={now:function(){return performance.now()},delegate:void 0},Jt={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=Jt.delegate;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=e(function(s){r=void 0,t(s)});return new nt(function(){return r==null?void 0:r(i)})},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return requestAnimationFrame.apply(void 0,Me([],_e(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,Me([],_e(t)))},delegate:void 0};function cs(t){return t?Yn(t):us}function Yn(t){return new le(function(e){var r=t||as,n=r.now(),i=0,s=function(){e.closed||(i=Jt.requestAnimationFrame(function(o){i=0;var a=r.now();e.next({timestamp:t?a:o,elapsed:a-n}),s()}))};return s(),function(){i&&Jt.cancelAnimationFrame(i)}})}var us=Yn(),ls=Wn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Re=function(t){rt(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Ur(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new ls},e.prototype.next=function(r){var n=this;vt(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Fe(n.currentObservers),a=o.next();!a.done;a=o.next()){var u=a.value;u.next(r)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;vt(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;vt(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?Nn:(this.currentObservers=null,a.push(r),new nt(function(){n.currentObservers=null,Kt(a,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?r.error(s):o&&r.complete()},e.prototype.asObservable=function(){var r=new le;return r.source=this,r},e.create=function(r,n){return new Ur(r,n)},e}(le),Ur=function(t){rt(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:Nn},e}(Re),Zn=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function hs(t){return Y(t==null?void 0:t.then)}function fs(t){return Y(t[br])}function ds(t){return Symbol.asyncIterator&&Y(t==null?void 0:t[Symbol.asyncIterator])}function ps(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function vs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ms=vs();function ys(t){return Y(t==null?void 0:t[ms])}function _s(t){return Qi(this,arguments,function(){var r,n,i,s;return Ln(this,function(o){switch(o.label){case 0:r=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,ze(r.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,ze(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,ze(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function bs(t){return Y(t==null?void 0:t.getReader)}function it(t){if(t instanceof le)return t;if(t!=null){if(fs(t))return ws(t);if(Zn(t))return gs(t);if(hs(t))return Ss(t);if(ds(t))return Gn(t);if(ys(t))return Cs(t);if(bs(t))return Ps(t)}throw ps(t)}function ws(t){return new le(function(e){var r=t[br]();if(Y(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function gs(t){return new le(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Ss(t){return new le(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Vn)})}function Cs(t){return new le(function(e){var r,n;try{for(var i=Fe(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){r={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function Gn(t){return new le(function(e){Es(t,e).catch(function(r){return e.error(r)})})}function Ps(t){return Gn(_s(t))}function Es(t,e){var r,n,i,s;return Gi(this,void 0,void 0,function(){var o,a;return Ln(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=Ki(t),u.label=1;case 1:return[4,r.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=u.sent(),i={error:a},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function We(t,e){return Ve(function(r,n){var i=0;r.subscribe(Le(n,function(s){n.next(t.call(e,s,i++))}))})}var Os=Array.isArray;function Ts(t,e){return Os(e)?t.apply(void 0,Me([],_e(e))):t(e)}function Ms(t){return We(function(e){return Ts(t,e)})}function Rs(t,e,r,n,i,s,o,a){var u=[],c=0,l=0,h=!1,v=function(){h&&!u.length&&!c&&e.complete()},w=function(M){return c<n?L(M):u.push(M)},L=function(M){c++;var D=!1;it(r(M,l++)).subscribe(Le(e,function(_){e.next(_)},function(){D=!0},void 0,function(){if(D)try{c--;for(var _=function(){var P=u.shift();o||L(P)};u.length&&c<n;)_();v()}catch(P){e.error(P)}}))};return t.subscribe(Le(e,w,function(){h=!0,v()})),function(){}}function Qn(t,e,r){return r===void 0&&(r=1/0),Y(e)?Qn(function(n,i){return We(function(s,o){return e(n,s,i,o)})(it(t(n,i)))},r):(typeof e=="number"&&(r=e),Ve(function(n,i){return Rs(n,i,t,r)}))}var $s=["addListener","removeListener"],js=["addEventListener","removeEventListener"],xs=["on","off"];function bt(t,e,r,n){if(Y(r)&&(n=r,r=void 0),n)return bt(t,e,r).pipe(Ms(n));var i=_e(ks(t)?js.map(function(a){return function(u){return t[a](e,u,r)}}):Ds(t)?$s.map(Hr(t,e)):As(t)?xs.map(Hr(t,e)):[],2),s=i[0],o=i[1];if(!s&&Zn(t))return Qn(function(a){return bt(a,e,r)})(it(t));if(!s)throw new TypeError("Invalid event target");return new le(function(a){var u=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return a.next(1<c.length?c:c[0])};return s(u),function(){return o(u)}})}function Hr(t,e){return function(r){return function(n){return t[r](e,n)}}}function Ds(t){return Y(t.addListener)&&Y(t.removeListener)}function As(t){return Y(t.on)&&Y(t.off)}function ks(t){return Y(t.addEventListener)&&Y(t.removeEventListener)}function ye(t,e){return Ve(function(r,n){var i=0;r.subscribe(Le(n,function(s){return t.call(e,s,i++)&&n.next(s)}))})}function Ne(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new Re}:e,n=t.resetOnError,i=n===void 0?!0:n,s=t.resetOnComplete,o=s===void 0?!0:s,a=t.resetOnRefCountZero,u=a===void 0?!0:a;return function(c){var l,h,v,w=0,L=!1,M=!1,D=function(){h==null||h.unsubscribe(),h=void 0},_=function(){D(),l=v=void 0,L=M=!1},P=function(){var S=l;_(),S==null||S.unsubscribe()};return Ve(function(S,$){w++,!M&&!L&&D();var g=v=v??r();$.add(function(){w--,w===0&&!M&&!L&&(h=Dt(P,u))}),g.subscribe($),!l&&w>0&&(l=new Xe({next:function(b){return g.next(b)},error:function(b){M=!0,D(),h=Dt(_,i,b),g.error(b)},complete:function(){L=!0,D(),h=Dt(_,o),g.complete()}}),it(S).subscribe(l))})(c)}}function Dt(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(e===!0){t();return}if(e!==!1){var i=new Xe({next:function(){i.unsubscribe(),t()}});return it(e.apply(void 0,Me([],_e(r)))).subscribe(i)}}function Is(t,e){return e===void 0&&(e=!1),Ve(function(r,n){var i=0;r.subscribe(Le(n,function(s){var o=t(s,i++);(o||e)&&n.next(s),!o&&n.complete()}))})}function zs(t,e,r){var n=Y(t)||e||r?{next:t,error:e,complete:r}:t;return n?Ve(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(Le(s,function(u){var c;(c=n.next)===null||c===void 0||c.call(n,u),s.next(u)},function(){var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),s.complete()},function(u){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),s.error(u)},function(){var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Bn}var ge={},fe={},Se={},Vr;function Kn(){if(Vr)return Se;Vr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.DefaultSerializer=Se.extendSerializer=void 0;function t(n,i){const s=n.deserialize.bind(n),o=n.serialize.bind(n);return{deserialize(a){return i.deserialize(a,s)},serialize(a){return i.serialize(a,o)}}}Se.extendSerializer=t;const e={deserialize(n){return Object.assign(Error(n.message),{name:n.name,stack:n.stack})},serialize(n){return{__error_marker:"$$error",message:n.message,name:n.name,stack:n.stack}}},r=n=>n&&typeof n=="object"&&"__error_marker"in n&&n.__error_marker==="$$error";return Se.DefaultSerializer={deserialize(n){return r(n)?e.deserialize(n):n},serialize(n){return n instanceof Error?e.serialize(n):n}},Se}var Br;function et(){if(Br)return fe;Br=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.serialize=fe.deserialize=fe.registerSerializer=void 0;const t=Kn();let e=t.DefaultSerializer;function r(s){e=t.extendSerializer(e,s)}fe.registerSerializer=r;function n(s){return e.deserialize(s)}fe.deserialize=n;function i(s){return e.serialize(s)}return fe.serialize=i,fe}var At={},de={},Ce={},Yr;function Fs(){if(Yr)return Ce;Yr=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.getBundleURL=Ce.getBaseURL=void 0;let t;function e(){return t||(t=r()),t}Ce.getBundleURL=e;function r(){try{throw new Error}catch(i){const s=(""+i.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(s)return n(s[0])}return"/"}function n(i){return(""+i).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return Ce.getBaseURL=n,Ce}var Zr;function Jn(){if(Zr)return de;Zr=1,Object.defineProperty(de,"__esModule",{value:!0}),de.isWorkerRuntime=de.getWorkerImplementation=de.defaultPoolSize=void 0;const t=Fs();de.defaultPoolSize=typeof navigator<"u"&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const e=a=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(a);function r(a){const u=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(u)}function n(){if(typeof Worker>"u")return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class a extends Worker{constructor(l,h){var v,w;typeof l=="string"&&h&&h._baseURL?l=new URL(l,h._baseURL):typeof l=="string"&&!e(l)&&t.getBundleURL().match(/^file:\/\//i)&&(l=new URL(l,t.getBundleURL().replace(/\/[^\/]+$/,"/")),(!((v=h==null?void 0:h.CORSWorkaround)!==null&&v!==void 0)||v)&&(l=r(`importScripts(${JSON.stringify(l)});`))),typeof l=="string"&&e(l)&&(!((w=h==null?void 0:h.CORSWorkaround)!==null&&w!==void 0)||w)&&(l=r(`importScripts(${JSON.stringify(l)});`)),super(l,h)}}class u extends a{constructor(l,h){const v=window.URL.createObjectURL(l);super(v,h)}static fromText(l,h){const v=new window.Blob([l],{type:"text/javascript"});return new u(v,h)}}return{blob:u,default:a}}let i;function s(){return i||(i=n()),i}de.getWorkerImplementation=s;function o(){const a=typeof self<"u"&&typeof Window<"u"&&self instanceof Window;return!!(typeof self<"u"&&self.postMessage&&!a)}return de.isWorkerRuntime=o,de}var Pe={},lt={exports:{}},kt,Gr;function Ls(){if(Gr)return kt;Gr=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;kt=function(l,h){h=h||{};var v=typeof l;if(v==="string"&&l.length>0)return o(l);if(v==="number"&&isFinite(l))return h.long?u(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(h){var v=parseFloat(h[1]),w=(h[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return v*s;case"weeks":case"week":case"w":return v*i;case"days":case"day":case"d":return v*n;case"hours":case"hour":case"hrs":case"hr":case"h":return v*r;case"minutes":case"minute":case"mins":case"min":case"m":return v*e;case"seconds":case"second":case"secs":case"sec":case"s":return v*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function a(l){var h=Math.abs(l);return h>=n?Math.round(l/n)+"d":h>=r?Math.round(l/r)+"h":h>=e?Math.round(l/e)+"m":h>=t?Math.round(l/t)+"s":l+"ms"}function u(l){var h=Math.abs(l);return h>=n?c(l,h,n,"day"):h>=r?c(l,h,r,"hour"):h>=e?c(l,h,e,"minute"):h>=t?c(l,h,t,"second"):l+" ms"}function c(l,h,v,w){var L=h>=v*1.5;return Math.round(l/v)+" "+w+(L?"s":"")}return kt}var It,Qr;function Ws(){if(Qr)return It;Qr=1;function t(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=s,n.enabled=a,n.humanize=Ls(),n.destroy=l,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function r(h){let v=0;for(let w=0;w<h.length;w++)v=(v<<5)-v+h.charCodeAt(w),v|=0;return n.colors[Math.abs(v)%n.colors.length]}n.selectColor=r;function n(h){let v,w=null,L,M;function D(..._){if(!D.enabled)return;const P=D,S=Number(new Date),$=S-(v||S);P.diff=$,P.prev=v,P.curr=S,v=S,_[0]=n.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let g=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(k,U)=>{if(k==="%%")return"%";g++;const y=n.formatters[U];if(typeof y=="function"){const x=_[g];k=y.call(P,x),_.splice(g,1),g--}return k}),n.formatArgs.call(P,_),(P.log||n.log).apply(P,_)}return D.namespace=h,D.useColors=n.useColors(),D.color=n.selectColor(h),D.extend=i,D.destroy=n.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(L!==n.namespaces&&(L=n.namespaces,M=n.enabled(h)),M),set:_=>{w=_}}),typeof n.init=="function"&&n.init(D),D}function i(h,v){const w=n(this.namespace+(typeof v>"u"?":":v)+h);return w.log=this.log,w}function s(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let v;const w=(typeof h=="string"?h:"").split(/[\s,]+/),L=w.length;for(v=0;v<L;v++)w[v]&&(h=w[v].replace(/\*/g,".*?"),h[0]==="-"?n.skips.push(new RegExp("^"+h.slice(1)+"$")):n.names.push(new RegExp("^"+h+"$")))}function o(){const h=[...n.names.map(u),...n.skips.map(u).map(v=>"-"+v)].join(",");return n.enable(""),h}function a(h){if(h[h.length-1]==="*")return!0;let v,w;for(v=0,w=n.skips.length;v<w;v++)if(n.skips[v].test(h))return!1;for(v=0,w=n.names.length;v<w;v++)if(n.names[v].test(h))return!0;return!1}function u(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function c(h){return h instanceof Error?h.stack||h.message:h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}return It=t,It}var Kr;function wr(){return Kr||(Kr=1,function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;u.splice(1,0,c,"color: inherit");let l=0,h=0;u[0].replace(/%[a-zA-Z%]/g,v=>{v!=="%%"&&(l++,v==="%c"&&(h=l))}),u.splice(h,0,c)}e.log=console.debug||console.log||(()=>{});function i(u){try{u?e.storage.setItem("debug",u):e.storage.removeItem("debug")}catch{}}function s(){let u;try{u=e.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=process.env.DEBUG),u}function o(){try{return localStorage}catch{}}t.exports=Ws()(e);const{formatters:a}=t.exports;a.j=function(u){try{return JSON.stringify(u)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(lt,lt.exports)),lt.exports}var Ns=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};class Ot{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(e=>this._baseObserver.error(e))}error(e){this._baseObserver.error(e)}schedule(e){const r=Promise.all(this._pendingPromises),n=[],i=o=>n.push(o),s=Promise.resolve().then(()=>Ns(this,void 0,void 0,function*(){yield r,yield e(i),this._pendingPromises.delete(s);for(const o of n)this._baseObserver.next(o)})).catch(o=>{this._pendingPromises.delete(s),this._baseObserver.error(o)});this._pendingPromises.add(s)}}const Xn=()=>typeof Symbol=="function",st=t=>Xn()&&!!Symbol[t],gr=t=>st(t)?Symbol[t]:"@@"+t;st("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const qs=gr("iterator"),Xt=gr("observable"),ei=gr("species");function wt(t,e){const r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ye(t){let e=t.constructor;return e!==void 0&&(e=e[ei],e===null&&(e=void 0)),e!==void 0?e:re}function Us(t){return t instanceof re}function qe(t){qe.log?qe.log(t):setTimeout(()=>{throw t},0)}function mt(t){Promise.resolve().then(()=>{try{t()}catch(e){qe(e)}})}function ti(t){const e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{const r=wt(e,"unsubscribe");r&&r.call(e)}}catch(r){qe(r)}}function er(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function Hs(t){const e=t._queue;if(e){t._queue=void 0,t._state="ready";for(const r of e)if(ri(t,r.type,r.value),t._state==="closed")break}}function ri(t,e,r){t._state="running";const n=t._observer;try{const i=n?wt(n,e):void 0;switch(e){case"next":i&&i.call(n,r);break;case"error":if(er(t),i)i.call(n,r);else throw r;break;case"complete":er(t),i&&i.call(n);break}}catch(i){qe(i)}t._state==="closed"?ti(t):t._state==="running"&&(t._state="ready")}function zt(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue=t._queue||[],t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],mt(()=>Hs(t));return}ri(t,e,r)}}class Vs{constructor(e,r){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const n=new Bs(this);try{this._cleanup=r.call(void 0,n)}catch(i){n.error(i)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(er(this),ti(this))}}class Bs{constructor(e){this._subscription=e}get closed(){return this._subscription._state==="closed"}next(e){zt(this._subscription,"next",e)}error(e){zt(this._subscription,"error",e)}complete(){zt(this._subscription,"complete")}}class re{constructor(e){if(!(this instanceof re))throw new TypeError("Observable cannot be called as a function");if(typeof e!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,r,n){return(typeof e!="object"||e===null)&&(e={next:e,error:r,complete:n}),new Vs(e,this._subscriber)}pipe(e,...r){let n=this;for(const i of[e,...r])n=i(n);return n}tap(e,r,n){const i=typeof e!="object"||e===null?{next:e,error:r,complete:n}:e;return new re(s=>this.subscribe({next(o){i.next&&i.next(o),s.next(o)},error(o){i.error&&i.error(o),s.error(o)},complete(){i.complete&&i.complete(),s.complete()},start(o){i.start&&i.start(o)}}))}forEach(e){return new Promise((r,n)=>{if(typeof e!="function"){n(new TypeError(e+" is not a function"));return}function i(){s.unsubscribe(),r(void 0)}const s=this.subscribe({next(o){try{e(o,i)}catch(a){n(a),s.unsubscribe()}},error(o){n(o)},complete(){r(void 0)}})})}map(e){if(typeof e!="function")throw new TypeError(e+" is not a function");const r=Ye(this);return new r(n=>this.subscribe({next(i){let s=i;try{s=e(i)}catch(o){return n.error(o)}n.next(s)},error(i){n.error(i)},complete(){n.complete()}}))}filter(e){if(typeof e!="function")throw new TypeError(e+" is not a function");const r=Ye(this);return new r(n=>this.subscribe({next(i){try{if(!e(i))return}catch(s){return n.error(s)}n.next(i)},error(i){n.error(i)},complete(){n.complete()}}))}reduce(e,r){if(typeof e!="function")throw new TypeError(e+" is not a function");const n=Ye(this),i=arguments.length>1;let s=!1,o=r;return new n(a=>this.subscribe({next(u){const c=!s;if(s=!0,!c||i)try{o=e(o,u)}catch(l){return a.error(l)}else o=u},error(u){a.error(u)},complete(){if(!s&&!i)return a.error(new TypeError("Cannot reduce an empty sequence"));a.next(o),a.complete()}}))}concat(...e){const r=Ye(this);return new r(n=>{let i,s=0;function o(a){i=a.subscribe({next(u){n.next(u)},error(u){n.error(u)},complete(){s===e.length?(i=void 0,n.complete()):o(r.from(e[s++]))}})}return o(this),()=>{i&&(i.unsubscribe(),i=void 0)}})}flatMap(e){if(typeof e!="function")throw new TypeError(e+" is not a function");const r=Ye(this);return new r(n=>{const i=[],s=this.subscribe({next(a){let u;if(e)try{u=e(a)}catch(l){return n.error(l)}else u=a;const c=r.from(u).subscribe({next(l){n.next(l)},error(l){n.error(l)},complete(){const l=i.indexOf(c);l>=0&&i.splice(l,1),o()}});i.push(c)},error(a){n.error(a)},complete(){o()}});function o(){s.closed&&i.length===0&&n.complete()}return()=>{i.forEach(a=>a.unsubscribe()),s.unsubscribe()}})}[Xt](){return this}static from(e){const r=typeof this=="function"?this:re;if(e==null)throw new TypeError(e+" is not an object");const n=wt(e,Xt);if(n){const i=n.call(e);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Us(i)&&i.constructor===r?i:new r(s=>i.subscribe(s))}if(st("iterator")){const i=wt(e,qs);if(i)return new r(s=>{mt(()=>{if(!s.closed){for(const o of i.call(e))if(s.next(o),s.closed)return;s.complete()}})})}if(Array.isArray(e))return new r(i=>{mt(()=>{if(!i.closed){for(const s of e)if(i.next(s),i.closed)return;i.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){const r=typeof this=="function"?this:re;return new r(n=>{mt(()=>{if(!n.closed){for(const i of e)if(n.next(i),n.closed)return;n.complete()}})})}static get[ei](){return this}}Xn()&&Object.defineProperty(re,Symbol("extensions"),{value:{symbol:Xt,hostReportError:qe},configurable:!0});function xe(t){typeof t=="function"?t():t&&typeof t.unsubscribe=="function"&&t.unsubscribe()}var Ys=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};function Zs(t){return e=>new re(r=>{const n=new Ot(r),i=e.subscribe({complete(){n.complete()},error(s){n.error(s)},next(s){n.schedule(o=>Ys(this,void 0,void 0,function*(){(yield t(s))&&o(s)}))}});return()=>xe(i)})}function Gs(t){return t&&st("asyncIterator")&&t[Symbol.asyncIterator]}function Qs(t){return t&&st("iterator")&&t[Symbol.iterator]}var Ks=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},Js=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}};function Xs(t){return e=>new re(r=>{const n=new Ot(r),i=e.subscribe({complete(){n.complete()},error(s){n.error(s)},next(s){n.schedule(o=>Ks(this,void 0,void 0,function*(){var a,u;const c=yield t(s);if(Qs(c)||Gs(c))try{for(var l=Js(c),h;h=yield l.next(),!h.done;){const v=h.value;o(v)}}catch(v){a={error:v}}finally{try{h&&!h.done&&(u=l.return)&&(yield u.call(l))}finally{if(a)throw a.error}}else c.map(v=>o(v))}))}});return()=>xe(i)})}function eo(t){return new re(e=>{let r=0;const n=setInterval(()=>{e.next(r++)},t);return()=>clearInterval(n)})}var to=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};function ro(t){return e=>new re(r=>{const n=new Ot(r),i=e.subscribe({complete(){n.complete()},error(s){n.error(s)},next(s){n.schedule(o=>to(this,void 0,void 0,function*(){const a=yield t(s);o(a)}))}});return()=>xe(i)})}function no(...t){return t.length===0?re.from([]):new re(e=>{let r=0;const n=t.map(s=>s.subscribe({error(o){e.error(o),i()},next(o){e.next(o)},complete(){++r===t.length&&(e.complete(),i())}})),i=()=>{n.forEach(s=>xe(s))};return i})}class ni extends re{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const r of this._observers)r.next(e)}error(e){for(const r of this._observers)r.error(e)}complete(){for(const e of this._observers)e.complete()}}function io(t){const e=new ni;let r,n=0;return new re(i=>{r||(r=t.subscribe(e));const s=e.subscribe(i);return n++,()=>{n--,s.unsubscribe(),n===0&&(xe(r),r=void 0)}})}var so=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};function oo(t,e){return r=>new re(n=>{let i,s=0;const o=new Ot(n),a=r.subscribe({complete(){o.complete()},error(u){o.error(u)},next(u){o.schedule(c=>so(this,void 0,void 0,function*(){i=yield t(s===0?typeof e>"u"?u:e:i,u,s++),c(i)}))}});return()=>xe(a)})}const ao=Object.freeze(Object.defineProperty({__proto__:null,Observable:re,Subject:ni,filter:Zs,flatMap:Xs,interval:eo,map:ro,merge:no,multicast:io,scan:oo,unsubscribe:xe},Symbol.toStringTag,{value:"Module"})),Tt=Ti(ao);var Ze={},Jr;function co(){if(Jr)return Ze;Jr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.allSettled=void 0;function t(e){return Promise.all(e.map(r=>{const n=o=>({status:"fulfilled",value:o}),i=o=>({status:"rejected",reason:o}),s=Promise.resolve(r);try{return s.then(n,i)}catch(o){return Promise.reject(o)}}))}return Ze.allSettled=t,Ze}var Ft={},Xr;function uo(){return Xr||(Xr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PoolEventType=void 0,function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(t.PoolEventType||(t.PoolEventType={}))}(Ft)),Ft}var Ge={},oe={},en;function Sr(){return en||(en=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.$worker=oe.$transferable=oe.$terminate=oe.$events=oe.$errors=void 0,oe.$errors=Symbol("thread.errors"),oe.$events=Symbol("thread.events"),oe.$terminate=Symbol("thread.terminate"),oe.$transferable=Symbol("thread.transferable"),oe.$worker=Symbol("thread.worker")),oe}var tn;function ii(){if(tn)return Ge;tn=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.Thread=void 0;const t=Sr();function e(r){throw Error(r)}return Ge.Thread={errors(r){return r[t.$errors]||e("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},events(r){return r[t.$events]||e("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.")},terminate(r){return r[t.$terminate]()}},Ge}var rn;function lo(){return rn||(rn=1,function(t){var e=Pe&&Pe.__awaiter||function(_,P,S,$){function g(b){return b instanceof S?b:new S(function(k){k(b)})}return new(S||(S=Promise))(function(b,k){function U(z){try{x($.next(z))}catch(H){k(H)}}function y(z){try{x($.throw(z))}catch(H){k(H)}}function x(z){z.done?b(z.value):g(z.value).then(U,y)}x(($=$.apply(_,P||[])).next())})},r=Pe&&Pe.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.Thread=t.PoolEventType=void 0;const n=r(wr()),i=Tt,s=co(),o=Jn(),a=uo();Object.defineProperty(t,"PoolEventType",{enumerable:!0,get:function(){return a.PoolEventType}});const u=ii();Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return u.Thread}});let c=1;function l(_){const P=[];for(let S=0;S<_;S++)P.push(S);return P}function h(_){return new Promise(P=>setTimeout(P,_))}function v(_,P){return _.reduce((S,$)=>[...S,...P($)],[])}function w(_){return _.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function L(_,P){return l(P).map(()=>({init:_(),runningTasks:[]}))}class M{constructor(P,S){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const $=typeof S=="number"?{size:S}:S||{},{size:g=o.defaultPoolSize}=$;this.debug=n.default(`threads:pool:${w($.name||String(c++))}`),this.options=$,this.workers=L(P,g),this.eventObservable=i.multicast(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map(b=>b.init)).then(()=>this.eventSubject.next({type:a.PoolEventType.initialized,size:this.workers.length}),b=>{this.debug("Error while initializing pool worker:",b),this.eventSubject.error(b),this.initErrors.push(b)})}findIdlingWorker(){const{concurrency:P=1}=this.options;return this.workers.find(S=>S.runningTasks.length<P)}runPoolTask(P,S){return e(this,void 0,void 0,function*(){const $=this.workers.indexOf(P)+1;this.debug(`Running task #${S.id} on worker #${$}...`),this.eventSubject.next({type:a.PoolEventType.taskStart,taskID:S.id,workerID:$});try{const g=yield S.run(yield P.init);this.debug(`Task #${S.id} completed successfully`),this.eventSubject.next({type:a.PoolEventType.taskCompleted,returnValue:g,taskID:S.id,workerID:$})}catch(g){this.debug(`Task #${S.id} failed`),this.eventSubject.next({type:a.PoolEventType.taskFailed,taskID:S.id,error:g,workerID:$})}})}run(P,S){return e(this,void 0,void 0,function*(){const $=e(this,void 0,void 0,function*(){const g=()=>{P.runningTasks=P.runningTasks.filter(b=>b!==$)};yield h(0);try{yield this.runPoolTask(P,S)}finally{g(),this.isClosing||this.scheduleWork()}});P.runningTasks.push($)})}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const P=this.findIdlingWorker();if(!P)return;const S=this.taskQueue.shift();if(!S){this.debug("Task queue is empty"),this.eventSubject.next({type:a.PoolEventType.taskQueueDrained});return}this.run(P,S)}taskCompletion(P){return new Promise((S,$)=>{const g=this.events().subscribe(b=>{b.type===a.PoolEventType.taskCompleted&&b.taskID===P?(g.unsubscribe(),S(b.returnValue)):b.type===a.PoolEventType.taskFailed&&b.taskID===P?(g.unsubscribe(),$(b.error)):b.type===a.PoolEventType.terminated&&(g.unsubscribe(),$(Error("Pool has been terminated before task was run.")))})})}settled(P=!1){return e(this,void 0,void 0,function*(){const S=()=>v(this.workers,b=>b.runningTasks),$=[],g=this.eventObservable.subscribe(b=>{b.type===a.PoolEventType.taskFailed&&$.push(b.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):P&&this.taskQueue.length===0?(yield s.allSettled(S()),$):(yield new Promise((b,k)=>{const U=this.eventObservable.subscribe({next(y){y.type===a.PoolEventType.taskQueueDrained&&(U.unsubscribe(),b(void 0))},error:k})}),yield s.allSettled(S()),g.unsubscribe(),$)})}completed(P=!1){return e(this,void 0,void 0,function*(){const S=this.settled(P),$=new Promise((b,k)=>{const U=this.eventObservable.subscribe({next(y){y.type===a.PoolEventType.taskQueueDrained?(U.unsubscribe(),b(S)):y.type===a.PoolEventType.taskFailed&&(U.unsubscribe(),k(y.error))},error:k})}),g=yield Promise.race([S,$]);if(g.length>0)throw g[0]})}events(){return this.eventObservable}queue(P){const{maxQueuedJobs:S=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const $=this.nextTaskID++,g=this.taskCompletion($);g.catch(k=>{this.debug(`Task #${$} errored:`,k)});const b={id:$,run:P,cancel:()=>{this.taskQueue.indexOf(b)!==-1&&(this.taskQueue=this.taskQueue.filter(k=>k!==b),this.eventSubject.next({type:a.PoolEventType.taskCanceled,taskID:b.id}))},then:g.then.bind(g)};if(this.taskQueue.length>=S)throw Error(`Maximum number of pool tasks queued. Refusing to queue another one.
32
- This usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.`);return this.debug(`Queueing task #${b.id}...`),this.taskQueue.push(b),this.eventSubject.next({type:a.PoolEventType.taskQueued,taskID:b.id}),this.scheduleWork(),b}terminate(P){return e(this,void 0,void 0,function*(){this.isClosing=!0,P||(yield this.completed(!0)),this.eventSubject.next({type:a.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(S=>e(this,void 0,void 0,function*(){return u.Thread.terminate(yield S.init)})))})}}M.EventType=a.PoolEventType;function D(_,P){return new M(_,P)}D.EventType=a.PoolEventType,t.Pool=D}(Pe)),Pe}var pe={},Qe={},nn;function ho(){if(nn)return Qe;nn=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.createPromiseWithResolver=void 0;const t=()=>{};function e(){let r=!1,n,i=t;return[new Promise(a=>{r?a(n):i=a}),a=>{r=!0,n=a,i(n)}]}return Qe.createPromiseWithResolver=e,Qe}var Lt={},sn;function fo(){return sn||(sn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerEventType=void 0,function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(t.WorkerEventType||(t.WorkerEventType={}))}(Lt)),Lt}var ve={},Ke={},on;function po(){if(on)return Ke;on=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.ObservablePromise=void 0;const t=Tt,e=()=>{},r=a=>a,n=a=>Promise.resolve().then(a);function i(a){throw a}function s(a){return a&&typeof a.then=="function"}class o extends t.Observable{constructor(u){super(c=>{const l=this,h=Object.assign(Object.assign({},c),{complete(){c.complete(),l.onCompletion()},error(v){c.error(v),l.onError(v)},next(v){c.next(v),l.onNext(v)}});try{return this.initHasRun=!0,u(h)}catch(v){h.error(v)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(u){this.firstValueSet||(this.firstValue=u,this.firstValueSet=!0)}onError(u){this.state="rejected",this.rejection=u;for(const c of this.rejectionCallbacks)n(()=>c(u))}onCompletion(){this.state="fulfilled";for(const u of this.fulfillmentCallbacks)n(()=>u(this.firstValue))}then(u,c){const l=u||r,h=c||i;let v=!1;return new Promise((w,L)=>{const M=_=>{if(!v){v=!0;try{w(h(_))}catch(P){L(P)}}},D=_=>{try{w(l(_))}catch(P){M(P)}};if(this.initHasRun||this.subscribe({error:M}),this.state==="fulfilled")return w(l(this.firstValue));if(this.state==="rejected")return v=!0,w(h(this.rejection));this.fulfillmentCallbacks.push(D),this.rejectionCallbacks.push(M)})}catch(u){return this.then(void 0,u)}finally(u){const c=u||e;return this.then(l=>(c(),l),()=>c())}static from(u){return s(u)?new o(c=>{const l=v=>{c.next(v),c.complete()},h=v=>{c.error(v)};u.then(l,h)}):super.from(u)}}return Ke.ObservablePromise=o,Ke}var Ee={},an;function gt(){if(an)return Ee;an=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.Transfer=Ee.isTransferDescriptor=void 0;const t=Sr();function e(i){return!(!i||typeof i!="object")}function r(i){return i&&typeof i=="object"&&i[t.$transferable]}Ee.isTransferDescriptor=r;function n(i,s){if(!s){if(!e(i))throw Error();s=[i]}return{[t.$transferable]:!0,send:i,transferables:s}}return Ee.Transfer=n,Ee}var Wt={},cn;function si(){return cn||(cn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageType=t.MasterMessageType=void 0,function(e){e.cancel="cancel",e.run="run"}(t.MasterMessageType||(t.MasterMessageType={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(t.WorkerMessageType||(t.WorkerMessageType={}))}(Wt)),Wt}var un;function vo(){if(un)return ve;un=1;var t=ve&&ve.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(ve,"__esModule",{value:!0}),ve.createProxyModule=ve.createProxyFunction=void 0;const e=t(wr()),r=Tt,n=et(),i=po(),s=gt(),o=si(),a=e.default("threads:master:messages");let u=1;const c=_=>Array.from(new Set(_)),l=_=>_&&_.type===o.WorkerMessageType.error,h=_=>_&&_.type===o.WorkerMessageType.result,v=_=>_&&_.type===o.WorkerMessageType.running;function w(_,P){return new r.Observable(S=>{let $;const g=b=>{if(a("Message from worker:",b.data),!(!b.data||b.data.uid!==P)){if(v(b.data))$=b.data.resultType;else if(h(b.data))$==="promise"?(typeof b.data.payload<"u"&&S.next(n.deserialize(b.data.payload)),S.complete(),_.removeEventListener("message",g)):(b.data.payload&&S.next(n.deserialize(b.data.payload)),b.data.complete&&(S.complete(),_.removeEventListener("message",g)));else if(l(b.data)){const k=n.deserialize(b.data.error);S.error(k),_.removeEventListener("message",g)}}};return _.addEventListener("message",g),()=>{if($==="observable"||!$){const b={type:o.MasterMessageType.cancel,uid:P};_.postMessage(b)}_.removeEventListener("message",g)}})}function L(_){if(_.length===0)return{args:[],transferables:[]};const P=[],S=[];for(const $ of _)s.isTransferDescriptor($)?(P.push(n.serialize($.send)),S.push(...$.transferables)):P.push(n.serialize($));return{args:P,transferables:S.length===0?S:c(S)}}function M(_,P){return(...S)=>{const $=u++,{args:g,transferables:b}=L(S),k={type:o.MasterMessageType.run,uid:$,method:P,args:g};a("Sending command to run function to worker:",k);try{_.postMessage(k,b)}catch(U){return i.ObservablePromise.from(Promise.reject(U))}return i.ObservablePromise.from(r.multicast(w(_,$)))}}ve.createProxyFunction=M;function D(_,P){const S={};for(const $ of P)S[$]=M(_,$);return S}return ve.createProxyModule=D,ve}var ln;function mo(){if(ln)return pe;ln=1;var t=pe&&pe.__awaiter||function(g,b,k,U){function y(x){return x instanceof k?x:new k(function(z){z(x)})}return new(k||(k=Promise))(function(x,z){function H(K){try{G(U.next(K))}catch(he){z(he)}}function ne(K){try{G(U.throw(K))}catch(he){z(he)}}function G(K){K.done?x(K.value):y(K.value).then(H,ne)}G((U=U.apply(g,b||[])).next())})},e=pe&&pe.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.spawn=void 0;const r=e(wr()),n=Tt,i=et(),s=ho(),o=Sr(),a=fo(),u=vo(),c=r.default("threads:master:messages"),l=r.default("threads:master:spawn"),h=r.default("threads:master:thread-utils"),v=g=>g&&g.type==="init",w=g=>g&&g.type==="uncaughtError",L=typeof process<"u"&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function M(g,b,k){return t(this,void 0,void 0,function*(){let U;const y=new Promise((z,H)=>{U=setTimeout(()=>H(Error(k)),b)}),x=yield Promise.race([g,y]);return clearTimeout(U),x})}function D(g){return new Promise((b,k)=>{const U=y=>{c("Message from worker before finishing initialization:",y.data),v(y.data)?(g.removeEventListener("message",U),b(y.data)):w(y.data)&&(g.removeEventListener("message",U),k(i.deserialize(y.data.error)))};g.addEventListener("message",U)})}function _(g,b){return new n.Observable(k=>{const U=x=>{const z={type:a.WorkerEventType.message,data:x.data};k.next(z)},y=x=>{h("Unhandled promise rejection event in thread:",x);const z={type:a.WorkerEventType.internalError,error:Error(x.reason)};k.next(z)};g.addEventListener("message",U),g.addEventListener("unhandledrejection",y),b.then(()=>{const x={type:a.WorkerEventType.termination};g.removeEventListener("message",U),g.removeEventListener("unhandledrejection",y),k.next(x),k.complete()})})}function P(g){const[b,k]=s.createPromiseWithResolver();return{terminate:()=>t(this,void 0,void 0,function*(){h("Terminating worker"),yield g.terminate(),k()}),termination:b}}function S(g,b,k,U){const y=k.filter(x=>x.type===a.WorkerEventType.internalError).map(x=>x.error);return Object.assign(g,{[o.$errors]:y,[o.$events]:k,[o.$terminate]:U,[o.$worker]:b})}function $(g,b){return t(this,void 0,void 0,function*(){l("Initializing new thread");const k=b&&b.timeout?b.timeout:L,y=(yield M(D(g),k,`Timeout: Did not receive an init message from worker after ${k}ms. Make sure the worker calls expose().`)).exposed,{termination:x,terminate:z}=P(g),H=_(g,x);if(y.type==="function"){const ne=u.createProxyFunction(g);return S(ne,g,H,z)}else if(y.type==="module"){const ne=u.createProxyModule(g,y.methods);return S(ne,g,H,z)}else{const ne=y.type;throw Error(`Worker init message states unexpected type of expose(): ${ne}`)}})}return pe.spawn=$,pe}var hn;function yo(){return hn||(hn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Worker=t.BlobWorker=t.isWorkerRuntime=t.Thread=t.spawn=t.Pool=void 0;const e=Jn();Object.defineProperty(t,"isWorkerRuntime",{enumerable:!0,get:function(){return e.isWorkerRuntime}});var r=lo();Object.defineProperty(t,"Pool",{enumerable:!0,get:function(){return r.Pool}});var n=mo();Object.defineProperty(t,"spawn",{enumerable:!0,get:function(){return n.spawn}});var i=ii();Object.defineProperty(t,"Thread",{enumerable:!0,get:function(){return i.Thread}}),t.BlobWorker=e.getWorkerImplementation().blob,t.Worker=e.getWorkerImplementation().default}(At)),At}var Oe={},Nt,fn;function _o(){return fn||(fn=1,Nt=t=>t?typeof Symbol.observable=="symbol"&&typeof t[Symbol.observable]=="function"?t===t[Symbol.observable]():typeof t["@@observable"]=="function"?t===t["@@observable"]():!1:!1),Nt}var ht={},dn;function bo(){if(dn)return ht;dn=1,Object.defineProperty(ht,"__esModule",{value:!0});const t=function(){const i=typeof self<"u"&&typeof Window<"u"&&self instanceof Window;return!!(typeof self<"u"&&self.postMessage&&!i)},e=function(i,s){self.postMessage(i,s)},r=function(i){const s=a=>{i(a.data)},o=()=>{self.removeEventListener("message",s)};return self.addEventListener("message",s),o};return ht.default={isWorkerRuntime:t,postMessageToMaster:e,subscribeToMasterMessages:r},ht}var pn;function oi(){return pn||(pn=1,function(t){var e=Oe&&Oe.__awaiter||function(y,x,z,H){function ne(G){return G instanceof z?G:new z(function(K){K(G)})}return new(z||(z=Promise))(function(G,K){function he(ce){try{De(H.next(ce))}catch(Ae){K(Ae)}}function ot(ce){try{De(H.throw(ce))}catch(Ae){K(Ae)}}function De(ce){ce.done?G(ce.value):ne(ce.value).then(he,ot)}De((H=H.apply(y,x||[])).next())})},r=Oe&&Oe.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(t,"__esModule",{value:!0}),t.expose=t.isWorkerRuntime=t.Transfer=t.registerSerializer=void 0;const n=r(_o()),i=et(),s=gt(),o=si(),a=r(bo());var u=et();Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return u.registerSerializer}});var c=gt();Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return c.Transfer}}),t.isWorkerRuntime=a.default.isWorkerRuntime;let l=!1;const h=new Map,v=y=>y&&y.type===o.MasterMessageType.cancel,w=y=>y&&y.type===o.MasterMessageType.run,L=y=>n.default(y)||M(y);function M(y){return y&&typeof y=="object"&&typeof y.subscribe=="function"}function D(y){return s.isTransferDescriptor(y)?{payload:y.send,transferables:y.transferables}:{payload:y,transferables:void 0}}function _(){const y={type:o.WorkerMessageType.init,exposed:{type:"function"}};a.default.postMessageToMaster(y)}function P(y){const x={type:o.WorkerMessageType.init,exposed:{type:"module",methods:y}};a.default.postMessageToMaster(x)}function S(y,x){const{payload:z,transferables:H}=D(x),ne={type:o.WorkerMessageType.error,uid:y,error:i.serialize(z)};a.default.postMessageToMaster(ne,H)}function $(y,x,z){const{payload:H,transferables:ne}=D(z),G={type:o.WorkerMessageType.result,uid:y,complete:x?!0:void 0,payload:H};a.default.postMessageToMaster(G,ne)}function g(y,x){const z={type:o.WorkerMessageType.running,uid:y,resultType:x};a.default.postMessageToMaster(z)}function b(y){try{const x={type:o.WorkerMessageType.uncaughtError,error:i.serialize(y)};a.default.postMessageToMaster(x)}catch(x){console.error(`Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.
33
- Latest error:`,x,`
34
- Original error:`,y)}}function k(y,x,z){return e(this,void 0,void 0,function*(){let H;try{H=x(...z)}catch(G){return S(y,G)}const ne=L(H)?"observable":"promise";if(g(y,ne),L(H)){const G=H.subscribe(K=>$(y,!1,i.serialize(K)),K=>{S(y,i.serialize(K)),h.delete(y)},()=>{$(y,!0),h.delete(y)});h.set(y,G)}else try{const G=yield H;$(y,!0,i.serialize(G))}catch(G){S(y,i.serialize(G))}})}function U(y){if(!a.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(l)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(l=!0,typeof y=="function")a.default.subscribeToMasterMessages(x=>{w(x)&&!x.method&&k(x.uid,y,x.args.map(i.deserialize))}),_();else if(typeof y=="object"&&y){a.default.subscribeToMasterMessages(z=>{w(z)&&z.method&&k(z.uid,y[z.method],z.args.map(i.deserialize))});const x=Object.keys(y).filter(z=>typeof y[z]=="function");P(x)}else throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${y}`);a.default.subscribeToMasterMessages(x=>{if(v(x)){const z=x.uid,H=h.get(z);H&&(H.unsubscribe(),h.delete(z))}})}t.expose=U,typeof self<"u"&&typeof self.addEventListener=="function"&&a.default.isWorkerRuntime()&&(self.addEventListener("error",y=>{setTimeout(()=>b(y.error||y),250)}),self.addEventListener("unhandledrejection",y=>{const x=y.reason;x&&typeof x.message=="string"&&setTimeout(()=>b(x),250)})),typeof process<"u"&&typeof process.on=="function"&&a.default.isWorkerRuntime()&&(process.on("uncaughtException",y=>{setTimeout(()=>b(y),250)}),process.on("unhandledRejection",y=>{y&&typeof y.message=="string"&&setTimeout(()=>b(y),250)}))}(Oe)),Oe}var vn;function wo(){return vn||(vn=1,function(t){var e=ge&&ge.__createBinding||(Object.create?function(a,u,c,l){l===void 0&&(l=c),Object.defineProperty(a,l,{enumerable:!0,get:function(){return u[c]}})}:function(a,u,c,l){l===void 0&&(l=c),a[l]=u[c]}),r=ge&&ge.__exportStar||function(a,u){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&e(u,a,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.DefaultSerializer=t.expose=t.registerSerializer=void 0;var n=et();Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return n.registerSerializer}}),r(yo(),t);var i=oi();Object.defineProperty(t,"expose",{enumerable:!0,get:function(){return i.expose}});var s=Kn();Object.defineProperty(t,"DefaultSerializer",{enumerable:!0,get:function(){return s.DefaultSerializer}});var o=gt();Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return o.Transfer}})}(ge)),ge}var go=wo();const we=Rn(go);we.registerSerializer;const So=we.spawn;we.BlobWorker;we.DefaultSerializer;we.Pool;const Co=we.Thread;we.Transfer;const Po=we.Worker;var Eo=Object.defineProperty,Oo=(t,e,r)=>e in t?Eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,se=(t,e,r)=>Oo(t,typeof e!="symbol"?e+"":e,r);class To extends O.EventDispatcher{constructor(){super(),se(this,"style",{}),se(this,"width",0),se(this,"height",0),se(this,"left",0),se(this,"top",0),this.getRootNode=this.getRootNode.bind(this),this.handleEvent=this.handleEvent.bind(this)}get clientWidth(){return this.width}get clientHeight(){return this.height}setPointerCapture(){}releasePointerCapture(){}getRootNode(){return this}getBoundingClientRect(){return{left:this.left,top:this.top,width:this.width,height:this.height,right:this.left+this.width,bottom:this.top+this.height}}handleEvent(e){if(e.type==="resize"){this.left=e.left??0,this.top=e.top??0,this.width=e.width??0,this.height=e.height??0;return}e.preventDefault=()=>{},e.stopPropagation=()=>{},this.dispatchEvent(e)}focus(){}}const Mo=()=>{try{if(window){if(navigator!=null&&navigator.hardwareConcurrency)return navigator.hardwareConcurrency;throw new Error("Unable to determine the number of cores")}else return require("os").cpus().length}catch(t){return console.error("🛑 Unable to detect available cores",t),2}},Ro=()=>Mo()-1,$o="TERMINATE_THREAD_FROM_WORKER";let jo=-1;class xo{constructor(e){se(this,"_handleTerminate"),se(this,"_handleError"),se(this,"_task"),se(this,"id",jo+=1),se(this,"idle",!0),se(this,"worker"),se(this,"thread"),this._handleTerminate=e==null?void 0:e.onTerminate,this._handleError=e==null?void 0:e.onError}_handleMessages(e){var r;e instanceof MessageEvent&&((r=e.data)==null?void 0:r.token)===$o&&this.terminate()}async run(e){var r;try{const{payload:n,options:i}=e;return this.idle=!1,this.worker=new Po(n.path,{type:"module",...i==null?void 0:i.worker}),this.thread=await So(this.worker,{timeout:1e4,...i==null?void 0:i.spawn}),this._task=e,this.worker.postMessage(n.subject,n.transferSubject),this.worker.addEventListener("message",this._handleMessages.bind(this)),this}catch(n){(r=this._handleError)==null||r.call(this,n);return}}get task(){return this._task}async terminate(){var e,r,n;(e=this.worker)==null||e.removeEventListener("message",this._handleMessages.bind(this)),this.thread&&await Co.terminate(this.thread),await((r=this.worker)==null?void 0:r.terminate()),this.worker=void 0,this.thread=void 0,this._task=void 0,this.idle=!0,(n=this._handleTerminate)==null||n.call(this)}}class Do{constructor(e,r,n){se(this,"_workerThreads",[]),se(this,"_tasksQueue",[]),this.maxWorkersCount=e,this.debugMode=r,this.onWorkerThreadRun=n;for(let i=0;i<this.maxWorkersCount;i++)this._workerThreads.push(this._createWorkerThread())}_handleWorkerThreadTerminate(e){this.debugMode&&console.log(`WorkerThread #${e.id} freed`),this.runNext()}_handleWorkerThreadError(e,r){console.error(`Error from worker #${r.id}:`,e),this.runNext()}_createWorkerThread(){const e=new xo({onTerminate:()=>this._handleWorkerThreadTerminate(e),onError:r=>this._handleWorkerThreadError(r,e)});return e}get workerThreads(){return this._workerThreads}get tasksQueue(){return this._tasksQueue}get nextAvailableWorkerThread(){return this._workerThreads.find(e=>e.idle)}getAvailableWorkerThreads(e=!1){return this._workerThreads.filter(r=>e?!r.idle:r.idle)}async runNext(){if(!this.nextAvailableWorkerThread||this._tasksQueue.length===0)return;const e=this._tasksQueue.shift();e&&await this.run(e)}async run(e,r=!1){var n;if(r){const o=this._createWorkerThread();return this.debugMode&&console.log(`Running On Untracked Thread #${o==null?void 0:o.id}. Task:`,e),[await o.run(e),!0]}const i=this.nextAvailableWorkerThread;if(!i)return this._tasksQueue.push(e),this.debugMode&&console.log("Queued Thread Task:",e),[void 0,!0];this.debugMode&&console.log(`Running On Thread #${i==null?void 0:i.id}. Task:`,e);const s=await i.run(e);if(s)return(n=this.onWorkerThreadRun)==null||n.call(this,s),[s,!1]}async terminateAll(){this._tasksQueue=[],await Promise.all(this._workerThreads.map(e=>e.terminate()))}}const Ao=(t,e)=>new Do(Ro(),!!e),ko=t=>t===void 0,Io=t=>typeof t=="boolean",zo=t=>!!t&&typeof t=="function",Fo=t=>{var e,r;const n=t.toJSON();return JSON.stringify({...n,object:{...n.object,position:["x","y","z"].map(i=>t.position[i]),rotation:["x","y","z","order"].map(i=>t.rotation[i]),children:((r=(e=n==null?void 0:n.object)==null?void 0:e.children)==null?void 0:r.map((i,s)=>({...typeof i=="object"?i:typeof i=="string"?JSON.parse(i):{},position:["x","y","z"].map(o=>{var a;return(a=t.children[s])==null?void 0:a.position[o]}),rotation:["x","y","z","order"].map(o=>{var a;return(a=t.children[s])==null?void 0:a.rotation[o]})})))??[]},isSerialized:!0})},mn=(t,e=new O.ObjectLoader)=>{const r=JSON.parse(t);if(r!=null&&r.metadata&&r.object&&r.isSerialized){const n=e.parse(r);return n.position.set(...r.object.position),n.rotation.set(...r.object.rotation),n.children.map((i,s)=>{i.position.set(...r.object.children[s].position)}),n.children.map((i,s)=>{i.rotation.set(...r.object.children[s].rotation)}),n}return r},ai=(t,e)=>{const r={type:t==null?void 0:t.type};for(const n of e)t[n]!==void 0&&(r[n]=t[n]);return r},tr=(t,e)=>{const r={type:t==null?void 0:t.type};for(const[n,i]of Object.entries(t))e.includes(n)||(r[n]=i);return r};var Lo=Object.defineProperty,Wo=Object.getOwnPropertyDescriptor,No=(t,e,r,n)=>{for(var i=n>1?void 0:n?Wo(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Lo(e,r,i),i};let tt=class{constructor(){p(this,"_canvas");p(this,"proxyReceiver",new To);p(this,"isInitialized",!1)}get canvas(){return this._canvas}set canvas(t){t.style={width:t.width+"",height:t.height+""},this._canvas=t}};tt=No([Z(W.ContainerScoped)],tt);var qo=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,Ho=(t,e,r,n)=>{for(var i=n>1?void 0:n?Uo(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&qo(e,r,i),i},Vo=(t,e)=>(r,n)=>e(r,n,t);let St=class extends In{constructor(t){super(),this._service=t;for(const e of yr)this[`${e}$$`]=new Re,this[`${e}$`]=this[`${e}$$`].pipe(),this[e]=r=>{this._service.proxyReceiver.handleEvent({...r,type:r.type||e}),this[`${e}$$`].next(r)}}};St=Ho([Z(W.ContainerScoped),Vo(0,I(tt))],St);var Bo=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,Zo=(t,e,r,n)=>{for(var i=n>1?void 0:n?Yo(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Bo(e,r,i),i};let Ct=class{constructor(){p(this,"frame",1e3/60);p(this,"initialTime",Date.now());p(this,"currentTime",0);p(this,"deltaTime",0);p(this,"deltaRatio",0);p(this,"elapsedTime",0);p(this,"enabled",!1)}step(){const t=Date.now();this.deltaTime=t-this.currentTime,this.currentTime=t,this.elapsedTime=t-this.initialTime,this.deltaRatio=this.deltaTime/this.frame}};Ct=Zo([Z(W.ContainerScoped)],Ct);var Go=Object.defineProperty,Qo=Object.getOwnPropertyDescriptor,Ko=(t,e,r,n)=>{for(var i=n>1?void 0:n?Qo(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Go(e,r,i),i},Jo=(t,e)=>(r,n)=>e(r,n,t);let Ue=class{constructor(t){p(this,"_beforeStep$$",new Re);p(this,"_oldElapsed",0);p(this,"beforeStep$",this._beforeStep$$.asObservable());p(this,"step$",cs().pipe(zs(({elapsed:t})=>{var e;this._oldElapsed!==t&&((e=this._beforeStep$$)==null||e.next(tr(this._service,[])),this._oldElapsed=t)}),ye(()=>this._service.enabled),Is(()=>this._service.enabled),We(()=>tr(this._service,[])),Ne()));this._service=t}};Ue=Ko([Z(W.ContainerScoped),Jo(0,I(Ct))],Ue);var Xo=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,ta=(t,e,r,n)=>{for(var i=n>1?void 0:n?ea(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Xo(e,r,i),i},yn=(t,e)=>(r,n)=>e(r,n,t);let rr=class{constructor(t,e){p(this,"_initialAnimationFrameId");p(this,"_subscriptions",[]);this._controller=t,this._service=e,this._subscriptions.push(this._controller.step$.subscribe(this._service.step.bind(this._service)))}init(t){this.enabled(t)}frame(){return this._service.frame}deltaTime(t){return typeof t=="number"&&(this._service.deltaTime=t),this._service.deltaTime}deltaRatio(t){return typeof t=="number"&&(this._service.deltaRatio=t),this._service.deltaRatio}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}dispose(){this._initialAnimationFrameId!==void 0&&cancelAnimationFrame(this._initialAnimationFrameId),this._service.enabled=!1}beforeStep$(){return this._controller.beforeStep$}step$(){return this._controller.step$}};rr=ta([Z(W.ContainerScoped),yn(0,I(Ue)),yn(1,I(Ct))],rr);var ra=Object.defineProperty,na=Object.getOwnPropertyDescriptor,ia=(t,e,r,n)=>{for(var i=n>1?void 0:n?na(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ra(e,r,i),i};let be=class{constructor(){p(this,"width",0);p(this,"height",0);p(this,"aspect",0);p(this,"pixelRatio",0);p(this,"frustrum",5);p(this,"enabled",!0)}init(t,e){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}};be=ia([Z(W.ContainerScoped)],be);var sa=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,aa=(t,e,r,n)=>{for(var i=n>1?void 0:n?oa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&sa(e,r,i),i},ca=(t,e)=>(r,n)=>e(r,n,t);let $e=class{constructor(t){p(this,"instance");p(this,"enabled",!0);this._sizesService=t}set aspectRatio(t){var e;this.instance instanceof O.PerspectiveCamera&&(this.instance.aspect=t),(this.instance instanceof O.PerspectiveCamera||this.instance instanceof O.OrthographicCamera)&&((e=this.instance)==null||e.updateProjectionMatrix())}set quaternion(t){var e;(e=this.instance)==null||e.quaternion.copy(t)}set position(t){var e;(e=this.instance)==null||e.position.copy(t)}set rotation(t){var e;(e=this.instance)==null||e.rotation.copy(t)}init(t){if(this.dispose(),t===_t.PERSPECTIVE||t===void 0){this.instance=new O.PerspectiveCamera(70,this._sizesService.width/this._sizesService.height,1e-4,100),this.instance.position.z=8;return}t===_t.ORTHOGRAPHIC&&(this.instance=new O.OrthographicCamera(-this._sizesService.aspect*this._sizesService.frustrum/2,this._sizesService.aspect*this._sizesService.frustrum/2,this._sizesService.frustrum/2,-this._sizesService.frustrum/2,-50,50))}dispose(){this.instance instanceof O.Camera&&((this.instance instanceof O.PerspectiveCamera||this.instance instanceof O.OrthographicCamera)&&this.instance.clearViewOffset(),this.instance.clear(),this.instance=void 0)}};$e=aa([Z(W.ContainerScoped),ca(0,I(be))],$e);var ua=Object.defineProperty,la=Object.getOwnPropertyDescriptor,ha=(t,e,r,n)=>{for(var i=n>1?void 0:n?la(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ua(e,r,i),i},_n=(t,e)=>(r,n)=>e(r,n,t);let nr=class{constructor(t,e){p(this,"step$");this.timerController=t,this._service=e,this.step$=this.timerController.step$.pipe(ye(()=>this._service.enabled))}};nr=ha([Z(W.ContainerScoped),_n(0,I(Ue)),_n(1,I($e))],nr);var fa=Object.defineProperty,da=Object.getOwnPropertyDescriptor,pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?da(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&fa(e,r,i),i},qt=(t,e)=>(r,n)=>e(r,n,t);let ir=class{constructor(t,e,r){p(this,"_subscriptions",[]);this._sizesService=t,this._controller=e,this._service=r}init(){this._service.init(),this._subscriptions.push(this._controller.step$.subscribe(()=>{var t;this._service.enabled&&(this._service.aspectRatio=this._sizesService.aspect,(this._service.instance instanceof O.PerspectiveCamera||this._service.instance instanceof O.OrthographicCamera)&&((t=this._service.instance)==null||t.updateProjectionMatrix()))}))}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}aspectRatio(t){return t&&(this._service.aspectRatio=t),this._service.aspectRatio}instance(t){return t&&(this._service.instance=t),this._service.instance}position(t){return t&&(this._service.position=t),this._service.position}quaternion(t){return t&&(this._service.quaternion=t),this._service.quaternion}dispose(){this._subscriptions.forEach(t=>t.unsubscribe()),this._service.dispose()}};ir=pa([Z(W.ContainerScoped),qt(0,I(be)),qt(1,I(nr)),qt(2,I($e))],ir);var va=Object.defineProperty,ma=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var i=n>1?void 0:n?ma(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&va(e,r,i),i};let He=class{constructor(){p(this,"scene",new O.Scene);p(this,"enabled",!0)}};He=ya([Z(W.ContainerScoped)],He);var ci=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,ba=(t,e,r)=>e in t?ci(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?_a(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ci(e,r,i),i},Ut=(t,e)=>(r,n)=>e(r,n,t),ga=(t,e,r)=>ba(t,e+"",r);let je=class{constructor(t,e,r){p(this,"enabled",!0);p(this,"instance");this._worldService=t,this._cameraService=e,this._sizesService=r}setWebGLRenderer(t){this.instance=new O.WebGLRenderer({canvas:t,context:t.getContext("webgl2",{stencil:!0,powerPreference:"high-performance"}),powerPreference:"high-performance",depth:!0,antialias:!0}),this.instance.autoClear=!1,this.instance.setPixelRatio(je.RENDERER_PIXEL_RATIO),this.instance.setClearColor(0,0),this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=O.PCFSoftShadowMap,this.instance.outputColorSpace=O.SRGBColorSpace,this.instance.toneMapping=O.CineonToneMapping,this.instance.toneMappingExposure=1.75}setSize(t,e){var r;(r=this.instance)==null||r.setSize(t,e)}render(){this.enabled&&this._cameraService.instance instanceof O.Camera&&this.instance instanceof O.WebGLRenderer&&(this.instance.setViewport(0,0,this._sizesService.width,this._sizesService.height),this.instance.render(this._worldService.scene,this._cameraService.instance))}};ga(je,"RENDERER_PIXEL_RATIO",1);je=wa([Z(W.ContainerScoped),Ut(0,I(He)),Ut(1,I($e)),Ut(2,I(be))],je);var Sa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,Pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ca(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Sa(e,r,i),i},bn=(t,e)=>(r,n)=>e(r,n,t);let Pt=class{constructor(t,e){p(this,"resize$");this._appController=t,this._service=e,this.resize$=this._appController.resize$$.pipe(ye(()=>this._service.enabled))}};Pt=Pa([Z(W.ContainerScoped),bn(0,I(St)),bn(1,I(be))],Pt);var Ea=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Ta=(t,e,r,n)=>{for(var i=n>1?void 0:n?Oa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Ea(e,r,i),i},Ht=(t,e)=>(r,n)=>e(r,n,t);let sr=class{constructor(t,e,r){p(this,"step$");p(this,"resize$");this._service=t,this._timerController=e,this._sizesController=r,this.step$=this._timerController.step$.pipe(ye(()=>this._service.enabled)),this.resize$=this._sizesController.resize$.pipe(ye(()=>this._service.enabled))}};sr=Ta([Z(W.ContainerScoped),Ht(0,I(je)),Ht(1,I(Ue)),Ht(2,I(Pt))],sr);var Ma=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,$a=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ra(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Ma(e,r,i),i},wn=(t,e)=>(r,n)=>e(r,n,t);let or=class{constructor(t,e){this._controller=t,this._service=e}init(t){this._controller.step$.subscribe(()=>this._service.render()),this._controller.resize$.subscribe(e=>this._service.setSize(e.windowWidth,e.windowHeight)),this._service.setWebGLRenderer(t)}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}instance(){return this._service.instance}setSize(t){return this._service.setSize(t.x,t.y)}render(){return this._service.render()}dispose(){var t;(t=this._service.instance)==null||t.dispose(),this._service.instance=void 0}};or=$a([Z(W.ContainerScoped),wn(0,I(sr)),wn(1,I(je))],or);var ja=Object.defineProperty,xa=Object.getOwnPropertyDescriptor,Da=(t,e,r,n)=>{for(var i=n>1?void 0:n?xa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&ja(e,r,i),i},gn=(t,e)=>(r,n)=>e(r,n,t);let ar=class{constructor(t,e){this._controller=t,this._service=e}init(t){this._controller.resize$.subscribe(e=>{this._service.width=e.windowWidth,this._service.height=e.windowHeight,this._service.aspect=e.windowWidth/e.windowHeight}),this._service.init(t)}dispose(){}aspect(t){return typeof t=="number"&&(this._service.aspect=t),this._service.aspect}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}frustrum(t){return typeof t=="number"&&(this._service.frustrum=t),this._service.frustrum}height(t){return typeof t=="number"&&(this._service.height=t),this._service.height}pixelRatio(t){return typeof t=="number"&&(this._service.pixelRatio=t),this._service.pixelRatio}width(t){return typeof t=="number"&&(this._service.width=t),this._service.width}resize$(){return this._controller.resize$}};ar=Da([Z(W.ContainerScoped),gn(0,I(Pt)),gn(1,I(be))],ar);var Aa=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var i=n>1?void 0:n?ka(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Aa(e,r,i),i},za=(t,e)=>(r,n)=>e(r,n,t);let cr=class{constructor(t){p(this,"_beforeRender$$",new Re);p(this,"_afterRender$$",new Re);p(this,"beforeRender$",this._beforeRender$$.pipe(Ne()));p(this,"afterRender$",this._afterRender$$.pipe(Ne()));this._worldService=t,this._worldService.scene.onBeforeRender=()=>this._beforeRender$$.next({}),this._worldService.scene.onAfterRender=()=>this._afterRender$$.next({})}};cr=Ia([Z(W.ContainerScoped),za(0,I(He))],cr);var Fa=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?La(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Fa(e,r,i),i},Sn=(t,e)=>(r,n)=>e(r,n,t);let ur=class{constructor(t,e){this._service=t,this._controller=e}init(){}dispose(){}scene(t){return t instanceof O.Scene&&(this._service.scene=t),this._service.scene}enabled(t){return typeof t=="boolean"&&(this._service.enabled=t),this._service.enabled}getBeforeRender$(){return this._controller.beforeRender$}getAfterRender$(){return this._controller.afterRender$}};ur=Wa([Z(W.ContainerScoped),Sn(0,I(He)),Sn(1,I(cr))],ur);const Cn={type:"change"},Cr={type:"start"},ui={type:"end"},ft=new O.Ray,Pn=new O.Plane,Na=Math.cos(70*O.MathUtils.DEG2RAD),ee=new O.Vector3,ie=2*Math.PI,V={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Vt=1e-6;class En extends O.Controls{constructor(e,r=null){super(e,r),this.state=V.NONE,this.enabled=!0,this.target=new O.Vector3,this.cursor=new O.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:O.MOUSE.ROTATE,MIDDLE:O.MOUSE.DOLLY,RIGHT:O.MOUSE.PAN},this.touches={ONE:O.TOUCH.ROTATE,TWO:O.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new O.Vector3,this._lastQuaternion=new O.Quaternion,this._lastTargetPosition=new O.Vector3,this._quat=new O.Quaternion().setFromUnitVectors(e.up,new O.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new O.Spherical,this._sphericalDelta=new O.Spherical,this._scale=1,this._panOffset=new O.Vector3,this._rotateStart=new O.Vector2,this._rotateEnd=new O.Vector2,this._rotateDelta=new O.Vector2,this._panStart=new O.Vector2,this._panEnd=new O.Vector2,this._panDelta=new O.Vector2,this._dollyStart=new O.Vector2,this._dollyEnd=new O.Vector2,this._dollyDelta=new O.Vector2,this._dollyDirection=new O.Vector3,this._mouse=new O.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Ua.bind(this),this._onPointerDown=qa.bind(this),this._onPointerUp=Ha.bind(this),this._onContextMenu=Ka.bind(this),this._onMouseWheel=Ya.bind(this),this._onKeyDown=Za.bind(this),this._onTouchStart=Ga.bind(this),this._onTouchMove=Qa.bind(this),this._onMouseDown=Va.bind(this),this._onMouseMove=Ba.bind(this),this._interceptControlDown=Ja.bind(this),this._interceptControlUp=Xa.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Cn),this.update(),this.state=V.NONE}update(e=null){const r=this.object.position;ee.copy(r).sub(this.target),ee.applyQuaternion(this._quat),this._spherical.setFromVector3(ee),this.autoRotate&&this.state===V.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(n)&&isFinite(i)&&(n<-Math.PI?n+=ie:n>Math.PI&&(n-=ie),i<-Math.PI?i+=ie:i>Math.PI&&(i-=ie),n<=i?this._spherical.theta=Math.max(n,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+i)/2?Math.max(n,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(ee.setFromSpherical(this._spherical),ee.applyQuaternion(this._quatInverse),r.copy(this.target).add(ee),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=ee.length();o=this._clampDistance(a*this._scale);const u=a-o;this.object.position.addScaledVector(this._dollyDirection,u),this.object.updateMatrixWorld(),s=!!u}else if(this.object.isOrthographicCamera){const a=new O.Vector3(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const u=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=u!==this.object.zoom;const c=new O.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=ee.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(ft.origin.copy(this.object.position),ft.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ft.direction))<Na?this.object.lookAt(this.target):(Pn.setFromNormalAndCoplanarPoint(this.object.up,this.target),ft.intersectPlane(Pn,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),o!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>Vt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Vt||this._lastTargetPosition.distanceToSquared(this.target)>Vt?(this.dispatchEvent(Cn),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ie/60*this.autoRotateSpeed*e:ie/60/60*this.autoRotateSpeed}_getZoomScale(e){const r=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*r)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,r){ee.setFromMatrixColumn(r,0),ee.multiplyScalar(-e),this._panOffset.add(ee)}_panUp(e,r){this.screenSpacePanning===!0?ee.setFromMatrixColumn(r,1):(ee.setFromMatrixColumn(r,0),ee.crossVectors(this.object.up,ee)),ee.multiplyScalar(e),this._panOffset.add(ee)}_pan(e,r){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;ee.copy(i).sub(this.target);let s=ee.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/n.clientHeight,this.object.matrix),this._panUp(2*r*s/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(r*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,r){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),i=e-n.left,s=r-n.top,o=n.width,a=n.height;this._mouse.x=i/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const r=this.domElement;this._rotateLeft(ie*this._rotateDelta.x/r.clientHeight),this._rotateUp(ie*this._rotateDelta.y/r.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let r=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),r=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),r=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),r=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ie*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),r=!0;break}r&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this._panStart.set(n,i)}}_handleTouchStartDolly(e){const r=this._getSecondPointerPosition(e),n=e.pageX-r.x,i=e.pageY-r.y,s=Math.sqrt(n*n+i*i);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),s=.5*(e.pageY+n.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const r=this.domElement;this._rotateLeft(ie*this._rotateDelta.x/r.clientHeight),this._rotateUp(ie*this._rotateDelta.y/r.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),i=.5*(e.pageY+r.y);this._panEnd.set(n,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const r=this._getSecondPointerPosition(e),n=e.pageX-r.x,i=e.pageY-r.y,s=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+r.x)*.5,a=(e.pageY+r.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let r=0;r<this._pointers.length;r++)if(this._pointers[r]==e.pointerId){this._pointers.splice(r,1);return}}_isTrackingPointer(e){for(let r=0;r<this._pointers.length;r++)if(this._pointers[r]==e.pointerId)return!0;return!1}_trackPointer(e){let r=this._pointerPositions[e.pointerId];r===void 0&&(r=new O.Vector2,this._pointerPositions[e.pointerId]=r),r.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const r=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[r]}_customWheelEvent(e){const r=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(r){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function qa(t){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)))}function Ua(t){this.enabled!==!1&&(t.pointerType==="touch"?this._onTouchMove(t):this._onMouseMove(t))}function Ha(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(ui),this.state=V.NONE;break;case 1:const e=this._pointers[0],r=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:r.x,pageY:r.y});break}}function Va(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case O.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(t),this.state=V.DOLLY;break;case O.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=V.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=V.ROTATE}break;case O.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(t),this.state=V.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(t),this.state=V.PAN}break;default:this.state=V.NONE}this.state!==V.NONE&&this.dispatchEvent(Cr)}function Ba(t){switch(this.state){case V.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(t);break;case V.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(t);break;case V.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(t);break}}function Ya(t){this.enabled===!1||this.enableZoom===!1||this.state!==V.NONE||(t.preventDefault(),this.dispatchEvent(Cr),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(ui))}function Za(t){this.enabled!==!1&&this._handleKeyDown(t)}function Ga(t){switch(this._trackPointer(t),this._pointers.length){case 1:switch(this.touches.ONE){case O.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(t),this.state=V.TOUCH_ROTATE;break;case O.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(t),this.state=V.TOUCH_PAN;break;default:this.state=V.NONE}break;case 2:switch(this.touches.TWO){case O.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(t),this.state=V.TOUCH_DOLLY_PAN;break;case O.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(t),this.state=V.TOUCH_DOLLY_ROTATE;break;default:this.state=V.NONE}break;default:this.state=V.NONE}this.state!==V.NONE&&this.dispatchEvent(Cr)}function Qa(t){switch(this._trackPointer(t),this.state){case V.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(t),this.update();break;case V.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(t),this.update();break;case V.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(t),this.update();break;case V.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=V.NONE}}function Ka(t){this.enabled!==!1&&t.preventDefault()}function Ja(t){t.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Xa(t){t.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class ec extends O.Loader{constructor(e){super(e)}load(e,r,n,i){const s=this,o=new O.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){const u=s.parse(JSON.parse(a));r&&r(u)},n,i)}parse(e){return new li(e)}}class li{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,r=100){const n=[],i=tc(e,r,this.data);for(let s=0,o=i.length;s<o;s++)n.push(...i[s].toShapes());return n}}function tc(t,e,r){const n=Array.from(t),i=e/r.resolution,s=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*i,o=[];let a=0,u=0;for(let c=0;c<n.length;c++){const l=n[c];if(l===`
35
- `)a=0,u-=s;else{const h=rc(l,i,a,u,r);a+=h.offsetX,o.push(h.path)}}return o}function rc(t,e,r,n,i){const s=i.glyphs[t]||i.glyphs["?"];if(!s){console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");return}const o=new O.ShapePath;let a,u,c,l,h,v,w,L;if(s.o){const M=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let D=0,_=M.length;D<_;)switch(M[D++]){case"m":a=M[D++]*e+r,u=M[D++]*e+n,o.moveTo(a,u);break;case"l":a=M[D++]*e+r,u=M[D++]*e+n,o.lineTo(a,u);break;case"q":c=M[D++]*e+r,l=M[D++]*e+n,h=M[D++]*e+r,v=M[D++]*e+n,o.quadraticCurveTo(h,v,c,l);break;case"b":c=M[D++]*e+r,l=M[D++]*e+n,h=M[D++]*e+r,v=M[D++]*e+n,w=M[D++]*e+r,L=M[D++]*e+n,o.bezierCurveTo(h,v,w,L,c,l);break}}return{offsetX:s.ha*e,path:o}}var nc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,sc=(t,e,r,n)=>{for(var i=n>1?void 0:n?ic(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&nc(e,r,i),i},Je=(t,e)=>(r,n)=>e(r,n,t);let lr=class{constructor(t,e,r,n,i){p(this,"enabled",!1);p(this,"cameraControls");p(this,"miniCamera");p(this,"miniCameraControls");p(this,"axesHelper");p(this,"gridHelper");this._appService=t,this._sizesService=e,this._rendererService=r,this._cameraService=n,this._worldService=i}_renderMiniCamera(){var t,e,r,n,i;!this.enabled||!this.miniCamera||((t=this._rendererService.instance)==null||t.setScissorTest(!0),(e=this._rendererService.instance)==null||e.setViewport(this._sizesService.width-this._sizesService.width/3,this._sizesService.height-this._sizesService.height/3,this._sizesService.width/3,this._sizesService.height/3),(r=this._rendererService.instance)==null||r.setScissor(this._sizesService.width-this._sizesService.width/3,this._sizesService.height-this._sizesService.height/3,this._sizesService.width/3,this._sizesService.height/3),(n=this._rendererService.instance)==null||n.render(this._worldService.scene,this.miniCamera),(i=this._rendererService.instance)==null||i.setScissorTest(!1))}initMiniCamera(){this.disposeMiniCamera(),this.enabled&&(this.miniCamera=new O.PerspectiveCamera(75,this._sizesService.width/this._sizesService.height,.1,500),this.miniCamera.position.z=10,this.miniCamera.position.x=-5)}initOrbitControl(){var t;this.cameraControls&&((t=this.cameraControls)==null||t.dispose()),!(!this.enabled||!(this._cameraService.instance instanceof O.Camera))&&this._cameraService.instance instanceof O.Camera&&(this.cameraControls=new En(this._cameraService.instance,this._appService.proxyReceiver),this.cameraControls.rotateSpeed=.1,this.cameraControls.enableDamping=!0)}initMiniCameraOrbitControls(){this.miniCameraControls&&this.miniCameraControls.dispose(),!(!this.enabled||!this.miniCamera)&&(this.miniCameraControls=new En(this.miniCamera,this._appService.proxyReceiver),this.miniCameraControls.rotateSpeed=.15,this.miniCameraControls.enableDamping=!0)}initAxesHelper(t){if(!this.enabled)return;const e=new O.AxesHelper(t);this._worldService.scene.add(e)}initGridHelper(t){if(this.gridHelper&&this._worldService.scene.remove(this.gridHelper),!this.enabled)return;const e=new O.GridHelper(t,t);this._worldService.scene.add(e)}disposeMiniCamera(){this.miniCamera instanceof O.Camera&&(this.miniCamera.clearViewOffset(),this.miniCamera.clear(),this.miniCamera=void 0)}update(){var t,e;(t=this.cameraControls)==null||t.update(),(e=this.miniCameraControls)==null||e.update(),this._renderMiniCamera()}dispose(){var t,e,r,n;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),(r=this.axesHelper)==null||r.dispose(),this.axesHelper=void 0,this.gridHelper&&this._worldService.scene.remove(this.gridHelper),(n=this.gridHelper)==null||n.dispose(),this.gridHelper=void 0}};lr=sc([Z(W.ContainerScoped),Je(0,I(tt)),Je(1,I(be)),Je(2,I(je)),Je(3,I($e)),Je(4,I(He))],lr);var oc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,cc=(t,e,r,n)=>{for(var i=n>1?void 0:n?ac(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&oc(e,r,i),i},On=(t,e)=>(r,n)=>e(r,n,t);let hr=class{constructor(t,e){p(this,"step$");this.timerController=t,this._service=e,this.step$=this.timerController.step$.pipe(ye(()=>this._service.enabled))}};hr=cc([Z(W.ContainerScoped),On(0,I(Ue)),On(1,I($e))],hr);var uc=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,hc=(t,e,r,n)=>{for(var i=n>1?void 0:n?lc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&uc(e,r,i),i},Tn=(t,e)=>(r,n)=>e(r,n,t);let fr=class{constructor(t,e){p(this,"_subscriptions",[]);this._service=t,this._controller=e}init(t){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(this._controller.step$.subscribe(()=>{this._service.update()})))}enabled(t){return t&&(this._service.enabled=t),this._service.enabled}miniCamera(t){return t&&(this._service.miniCamera=t),this._service.miniCamera}getAxesHelper(){return this._service.axesHelper}getCameraControls(){return this._service.cameraControls}getGridHelper(){return this._service.gridHelper}getMiniCameraControls(){return this._service.miniCameraControls}getStep$(){return this._controller.step$}dispose(){this._service.dispose(),this._subscriptions.forEach(t=>t.unsubscribe())}};fr=hc([Z(W.ContainerScoped),Tn(0,I(lr)),Tn(1,I(hr))],fr);var fc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,pc=(t,e,r,n)=>{for(var i=n>1?void 0:n?dc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&fc(e,r,i),i};let Et=class{constructor(){p(this,"loadedResources",{});p(this,"toLoadCount",0);p(this,"loadedCount",0)}handleLoad(t){const{source:e,resource:r,loadedCount:n,toLoadCount:i}=t;r&&(this.loadedResources[e.name]=r,this.toLoadCount=n,this.loadedCount=i)}};Et=pc([Z(W.ResolutionScoped)],Et);var vc=Object.defineProperty,mc=Object.getOwnPropertyDescriptor,yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?mc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&vc(e,r,i),i},_c=(t,e)=>(r,n)=>e(r,n,t);let dr=class{constructor(t){p(this,"load$",bt(self,"message").pipe(ye(t=>{var e,r,n;return((e=t.data)==null?void 0:e.token)===Fn&&!!((n=(r=t.data)==null?void 0:r.payload)!=null&&n.resource)}),We(t=>{var r,n,i,s,o;const{payload:e}=t.data||{};if(((r=e==null?void 0:e.source)==null?void 0:r.type)==="gltf"){const a=e.resource,u=(n=a.animations)==null?void 0:n.map(v=>O.AnimationClip.parse(v)),c=(i=a.cameras)==null?void 0:i.map(v=>mn(v)),l=(s=a.scenes)==null?void 0:s.map(v=>mn(v)),h=l==null?void 0:l[0];return{...e,resource:{...a,animations:u,cameras:c,scene:h,scenes:l}}}return((o=e==null?void 0:e.source)==null?void 0:o.type)==="font"?{...e,resource:new li(e.resource.data)}:e}),Ne()));p(this,"loadCompleted$",this.load$.pipe(ye(t=>!!t&&t.toLoadCount===t.loadedCount),We(()=>ai(this._service,["loadedCount","loadedResources","toLoadCount"])),Ne()));this._service=t}};dr=yc([Z(W.ContainerScoped),_c(0,I(Et))],dr);var bc=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,gc=(t,e,r,n)=>{for(var i=n>1?void 0:n?wc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&bc(e,r,i),i},Mn=(t,e)=>(r,n)=>e(r,n,t);let pr=class{constructor(t,e){p(this,"_subscriptions",[]);this._controller=t,this._service=e}init(){this._subscriptions.push(this._controller.load$.subscribe(this._service.handleLoad.bind(this._service)))}getLoadedResources(){return this._service.loadedResources}getLoadedCount(){return this._service.loadedCount}getToLoadCount(){return this._service.toLoadCount}getLoad$(){return this._controller.load$}getLoadCompleted$(){return this._controller.loadCompleted$}dispose(){this._subscriptions.forEach(t=>t.unsubscribe())}};pr=gc([Z(W.ContainerScoped),Mn(0,I(dr)),Mn(1,I(Et))],pr);var Sc=Object.defineProperty,Cc=Object.getOwnPropertyDescriptor,Pc=(t,e,r,n)=>{for(var i=n>1?void 0:n?Cc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&Sc(e,r,i),i},me=(t,e)=>(r,n)=>e(r,n,t);exports.AppModule=class extends zn{constructor(e,r,n,i,s,o,a,u,c){super(),this._controller=e,this._service=r,this.timer=n,this.sizes=i,this.camera=s,this.world=o,this.renderer=a,this.loader=u,this.debug=c,this._initProxyEvents()}_initProxyEvents(){yr.forEach(e=>{this[`${e}$`]=()=>{var r;return(r=this._controller)==null?void 0:r[`${e}$`]},this[e]=r=>{var n,i;return(i=(n=this._controller)==null?void 0:n[e])==null?void 0:i.call(n,r)}})}getProxyReceiver(){return this._service.proxyReceiver}getCanvas(){return this._service.canvas}getIsInitialized(){return this._service.isInitialized}getBeforeStep$(){return this.timer.beforeStep$()}getStep$(){return this.timer.step$()}getBeforeRender$(){return this.world.getBeforeRender$()}getAfterRender$(){return this.world.getAfterRender$()}init(e){this._service.isInitialized||!(e!=null&&e.canvas)||!(this._service.canvas=e.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(e.startTimer),this.loader.init(),this.debug.init(e))}dispose(){this.sizes.dispose(),this.camera.dispose(),this.world.dispose(),this.renderer.dispose(),this.timer.dispose(),this.loader.dispose(),this.debug.dispose()}};exports.AppModule=Pc([Z(W.ContainerScoped),me(0,I(St)),me(1,I(tt)),me(2,I(rr)),me(3,I(ar)),me(4,I(ir)),me(5,I(ur)),me(6,I(or)),me(7,I(pr)),me(8,I(fr))],exports.AppModule);exports.A=ko;exports.AppProxyEventHandlersBlueprint=zn;exports.C=Ao;exports.CONTAINER_TOKEN=Zi;exports.D=Io;exports.DefaultCameraType=_t;exports.FontLoader=ec;exports.J=ai;exports.KEYBOARD_EVENT_CODES=Bi;exports.LOADER_SERIALIZED_LOAD_TOKEN=Fn;exports.Lifecycle=W;exports.PROXY_EVENT_LISTENERS=yr;exports.ProxyEventHandlersBlueprint=In;exports.ProxyEventObservablesBlueprint=kn;exports.ProxyEventSubjectsBlueprint=An;exports.Q=zo;exports.RegisterProxyEventHandlersBlueprint=Yi;exports.Subject=Re;exports.U=tr;exports.W=Fo;exports.filter=ye;exports.fromEvent=bt;exports.getDefaultExportFromCjs=Rn;exports.inject=I;exports.instance=Dn;exports.map=We;exports.requireWorker=oi;exports.scoped=Z;exports.share=Ne;