@quick-threejs/reactive 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.umd.cjs DELETED
@@ -1,68 +0,0 @@
1
- (function(N,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("rxjs"),require("three"),require("threads")):typeof define=="function"&&define.amd?define(["exports","rxjs","three","threads"],B):(N=typeof globalThis<"u"?globalThis:N||self,B(N.QuickThreeUtils={},N.rxjs,N.THREE,N.threads))})(this,function(N,B,f,mt){"use strict";var aa=Object.defineProperty;var la=(N,B,f)=>B in N?aa(N,B,{enumerable:!0,configurable:!0,writable:!0,value:f}):N[B]=f;var y=(N,B,f)=>la(N,typeof B!="symbol"?B+"":B,f);var Mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Pn={};/*! *****************************************************************************
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 On;function Ai(){if(On)return Pn;On=1;var i;return function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof Mn=="object"?Mn:typeof self=="object"?self:typeof this=="object"?this:l(),n=s(e);typeof r.Reflect<"u"&&(n=s(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function s(c,d){return function(m,g){Object.defineProperty(c,m,{configurable:!0,writable:!0,value:g}),d&&d(m,g)}}function o(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return o()||a()}})(function(t,r){var n=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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,m={create:l?function(){return Ae(Object.create(null))}:c?function(){return Ae({__proto__:null})}:function(){return Ae({})},has:d?function(u,h){return n.call(u,h)}:function(u,h){return h in u},get:d?function(u,h){return n.call(u,h)?u[h]:void 0}:function(u,h){return u[h]}},g=Object.getPrototypeOf(Function),A=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Tn(),x=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Cn(),O=typeof WeakMap=="function"?WeakMap:xn(),R=s?Symbol.for("@reflect-metadata:registry"):void 0,P=bn(),$=An(P);function D(u,h,p,_){if(C(p)){if(!Ve(u))throw new TypeError;if(!Ke(h))throw new TypeError;return pn(u,h)}else{if(!Ve(u))throw new TypeError;if(!H(h))throw new TypeError;if(!H(_)&&!C(_)&&!te(_))throw new TypeError;return te(_)&&(_=void 0),p=W(p),fn(u,h,p,_)}}t("decorate",D);function j(u,h){function p(_,T){if(!H(_))throw new TypeError;if(!C(T)&&!vn(T))throw new TypeError;Fe(u,h,_,T)}return p}t("metadata",j);function q(u,h,p,_){if(!H(p))throw new TypeError;return C(_)||(_=W(_)),Fe(u,h,p,_)}t("defineMetadata",q);function ie(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),Ne(u,h,p)}t("hasMetadata",ie);function Z(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),ve(u,h,p)}t("hasOwnMetadata",Z);function le(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),je(u,h,p)}t("getMetadata",le);function re(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),He(u,h,p)}t("getOwnMetadata",re);function _e(u,h){if(!H(u))throw new TypeError;return C(h)||(h=W(h)),Ge(u,h)}t("getMetadataKeys",_e);function hn(u,h){if(!H(u))throw new TypeError;return C(h)||(h=W(h)),Ue(u,h)}t("getOwnMetadataKeys",hn);function dn(u,h,p){if(!H(h))throw new TypeError;if(C(p)||(p=W(p)),!H(h))throw new TypeError;C(p)||(p=W(p));var _=se(h,p,!1);return C(_)?!1:_.OrdinaryDeleteMetadata(u,h,p)}t("deleteMetadata",dn);function pn(u,h){for(var p=u.length-1;p>=0;--p){var _=u[p],T=_(h);if(!C(T)&&!te(T)){if(!Ke(T))throw new TypeError;h=T}}return h}function fn(u,h,p,_){for(var T=u.length-1;T>=0;--T){var U=u[T],F=U(h,p,_);if(!C(F)&&!te(F)){if(!H(F))throw new TypeError;_=F}}return _}function Ne(u,h,p){var _=ve(u,h,p);if(_)return!0;var T=be(h);return te(T)?!1:Ne(u,T,p)}function ve(u,h,p){var _=se(h,p,!1);return C(_)?!1:ze(_.OrdinaryHasOwnMetadata(u,h,p))}function je(u,h,p){var _=ve(u,h,p);if(_)return He(u,h,p);var T=be(h);if(!te(T))return je(u,T,p)}function He(u,h,p){var _=se(h,p,!1);if(!C(_))return _.OrdinaryGetOwnMetadata(u,h,p)}function Fe(u,h,p,_){var T=se(p,_,!0);T.OrdinaryDefineOwnMetadata(u,h,p,_)}function Ge(u,h){var p=Ue(u,h),_=be(u);if(_===null)return p;var T=Ge(_,h);if(T.length<=0)return p;if(p.length<=0)return T;for(var U=new x,F=[],S=0,v=p;S<v.length;S++){var w=v[S],b=U.has(w);b||(U.add(w),F.push(w))}for(var E=0,M=T;E<M.length;E++){var w=M[E],b=U.has(w);b||(U.add(w),F.push(w))}return F}function Ue(u,h){var p=se(u,h,!1);return p?p.OrdinaryOwnMetadataKeys(u,h):[]}function Be(u){if(u===null)return 1;switch(typeof u){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return u===null?1:6;default:return 6}}function C(u){return u===void 0}function te(u){return u===null}function mn(u){return typeof u=="symbol"}function H(u){return typeof u=="object"?u!==null:typeof u=="function"}function gn(u,h){switch(Be(u)){case 0:return u;case 1:return u;case 2:return u;case 3:return u;case 4:return u;case 5:return u}var p="string",_=We(u,o);if(_!==void 0){var T=_.call(u,p);if(H(T))throw new TypeError;return T}return yn(u)}function yn(u,h){var p,_;{var T=u.toString;if(ce(T)){var _=T.call(u);if(!H(_))return _}var p=u.valueOf;if(ce(p)){var _=p.call(u);if(!H(_))return _}}throw new TypeError}function ze(u){return!!u}function _n(u){return""+u}function W(u){var h=gn(u);return mn(h)?h:_n(h)}function Ve(u){return Array.isArray?Array.isArray(u):u instanceof Object?u instanceof Array:Object.prototype.toString.call(u)==="[object Array]"}function ce(u){return typeof u=="function"}function Ke(u){return typeof u=="function"}function vn(u){switch(Be(u)){case 3:return!0;case 4:return!0;default:return!1}}function we(u,h){return u===h||u!==u&&h!==h}function We(u,h){var p=u[h];if(p!=null){if(!ce(p))throw new TypeError;return p}}function Ye(u){var h=We(u,a);if(!ce(h))throw new TypeError;var p=h.call(u);if(!H(p))throw new TypeError;return p}function Xe(u){return u.value}function qe(u){var h=u.next();return h.done?!1:h}function Ze(u){var h=u.return;h&&h.call(u)}function be(u){var h=Object.getPrototypeOf(u);if(typeof u!="function"||u===g||h!==g)return h;var p=u.prototype,_=p&&Object.getPrototypeOf(p);if(_==null||_===Object.prototype)return h;var T=_.constructor;return typeof T!="function"||T===u?h:T}function wn(){var u;!C(R)&&typeof r.Reflect<"u"&&!(R in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(u=En(r.Reflect));var h,p,_,T=new O,U={registerProvider:F,getProvider:v,setProvider:b};return U;function F(E){if(!Object.isExtensible(U))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case u===E:break;case C(h):h=E;break;case h===E:break;case C(p):p=E;break;case p===E:break;default:_===void 0&&(_=new x),_.add(E);break}}function S(E,M){if(!C(h)){if(h.isProviderFor(E,M))return h;if(!C(p)){if(p.isProviderFor(E,M))return h;if(!C(_))for(var L=Ye(_);;){var k=qe(L);if(!k)return;var K=Xe(k);if(K.isProviderFor(E,M))return Ze(L),K}}}if(!C(u)&&u.isProviderFor(E,M))return u}function v(E,M){var L=T.get(E),k;return C(L)||(k=L.get(M)),C(k)&&(k=S(E,M),C(k)||(C(L)&&(L=new A,T.set(E,L)),L.set(M,k))),k}function w(E){if(C(E))throw new TypeError;return h===E||p===E||!C(_)&&_.has(E)}function b(E,M,L){if(!w(L))throw new Error("Metadata provider not registered.");var k=v(E,M);if(k!==L){if(!C(k))return!1;var K=T.get(E);C(K)&&(K=new A,T.set(E,K)),K.set(M,L)}return!0}}function bn(){var u;return!C(R)&&H(r.Reflect)&&Object.isExtensible(r.Reflect)&&(u=r.Reflect[R]),C(u)&&(u=wn()),!C(R)&&H(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,R,{enumerable:!1,configurable:!1,writable:!1,value:u}),u}function An(u){var h=new O,p={isProviderFor:function(w,b){var E=h.get(w);return C(E)?!1:E.has(b)},OrdinaryDefineOwnMetadata:F,OrdinaryHasOwnMetadata:T,OrdinaryGetOwnMetadata:U,OrdinaryOwnMetadataKeys:S,OrdinaryDeleteMetadata:v};return P.registerProvider(p),p;function _(w,b,E){var M=h.get(w),L=!1;if(C(M)){if(!E)return;M=new A,h.set(w,M),L=!0}var k=M.get(b);if(C(k)){if(!E)return;if(k=new A,M.set(b,k),!u.setProvider(w,b,p))throw M.delete(b),L&&h.delete(w),new Error("Wrong provider for target.")}return k}function T(w,b,E){var M=_(b,E,!1);return C(M)?!1:ze(M.has(w))}function U(w,b,E){var M=_(b,E,!1);if(!C(M))return M.get(w)}function F(w,b,E,M){var L=_(E,M,!0);L.set(w,b)}function S(w,b){var E=[],M=_(w,b,!1);if(C(M))return E;for(var L=M.keys(),k=Ye(L),K=0;;){var Qe=qe(k);if(!Qe)return E.length=K,E;var Rn=Xe(Qe);try{E[K]=Rn}catch(Sn){try{Ze(k)}finally{throw Sn}}K++}}function v(w,b,E){var M=_(b,E,!1);if(C(M)||!M.delete(w))return!1;if(M.size===0){var L=h.get(b);C(L)||(L.delete(E),L.size===0&&h.delete(L))}return!0}}function En(u){var h=u.defineMetadata,p=u.hasOwnMetadata,_=u.getOwnMetadata,T=u.getOwnMetadataKeys,U=u.deleteMetadata,F=new O,S={isProviderFor:function(v,w){var b=F.get(v);return!C(b)&&b.has(w)?!0:T(v,w).length?(C(b)&&(b=new x,F.set(v,b)),b.add(w),!0):!1},OrdinaryDefineOwnMetadata:h,OrdinaryHasOwnMetadata:p,OrdinaryGetOwnMetadata:_,OrdinaryOwnMetadataKeys:T,OrdinaryDeleteMetadata:U};return S}function se(u,h,p){var _=P.getProvider(u,h);if(!C(_))return _;if(p){if(P.setProvider(u,h,$))return $;throw new Error("Illegal state.")}}function Tn(){var u={},h=[],p=function(){function S(v,w,b){this._index=0,this._keys=v,this._values=w,this._selector=b}return S.prototype["@@iterator"]=function(){return this},S.prototype[a]=function(){return this},S.prototype.next=function(){var v=this._index;if(v>=0&&v<this._keys.length){var w=this._selector(this._keys[v],this._values[v]);return v+1>=this._keys.length?(this._index=-1,this._keys=h,this._values=h):this._index++,{value:w,done:!1}}return{value:void 0,done:!0}},S.prototype.throw=function(v){throw this._index>=0&&(this._index=-1,this._keys=h,this._values=h),v},S.prototype.return=function(v){return this._index>=0&&(this._index=-1,this._keys=h,this._values=h),{value:v,done:!0}},S}(),_=function(){function S(){this._keys=[],this._values=[],this._cacheKey=u,this._cacheIndex=-2}return Object.defineProperty(S.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),S.prototype.has=function(v){return this._find(v,!1)>=0},S.prototype.get=function(v){var w=this._find(v,!1);return w>=0?this._values[w]:void 0},S.prototype.set=function(v,w){var b=this._find(v,!0);return this._values[b]=w,this},S.prototype.delete=function(v){var w=this._find(v,!1);if(w>=0){for(var b=this._keys.length,E=w+1;E<b;E++)this._keys[E-1]=this._keys[E],this._values[E-1]=this._values[E];return this._keys.length--,this._values.length--,we(v,this._cacheKey)&&(this._cacheKey=u,this._cacheIndex=-2),!0}return!1},S.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=u,this._cacheIndex=-2},S.prototype.keys=function(){return new p(this._keys,this._values,T)},S.prototype.values=function(){return new p(this._keys,this._values,U)},S.prototype.entries=function(){return new p(this._keys,this._values,F)},S.prototype["@@iterator"]=function(){return this.entries()},S.prototype[a]=function(){return this.entries()},S.prototype._find=function(v,w){if(!we(this._cacheKey,v)){this._cacheIndex=-1;for(var b=0;b<this._keys.length;b++)if(we(this._keys[b],v)){this._cacheIndex=b;break}}return this._cacheIndex<0&&w&&(this._cacheIndex=this._keys.length,this._keys.push(v),this._values.push(void 0)),this._cacheIndex},S}();return _;function T(S,v){return S}function U(S,v){return v}function F(S,v){return[S,v]}}function Cn(){var u=function(){function h(){this._map=new A}return Object.defineProperty(h.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),h.prototype.has=function(p){return this._map.has(p)},h.prototype.add=function(p){return this._map.set(p,p),this},h.prototype.delete=function(p){return this._map.delete(p)},h.prototype.clear=function(){this._map.clear()},h.prototype.keys=function(){return this._map.keys()},h.prototype.values=function(){return this._map.keys()},h.prototype.entries=function(){return this._map.entries()},h.prototype["@@iterator"]=function(){return this.keys()},h.prototype[a]=function(){return this.keys()},h}();return u}function xn(){var u=16,h=m.create(),p=_();return function(){function v(){this._key=_()}return v.prototype.has=function(w){var b=T(w,!1);return b!==void 0?m.has(b,this._key):!1},v.prototype.get=function(w){var b=T(w,!1);return b!==void 0?m.get(b,this._key):void 0},v.prototype.set=function(w,b){var E=T(w,!0);return E[this._key]=b,this},v.prototype.delete=function(w){var b=T(w,!1);return b!==void 0?delete b[this._key]:!1},v.prototype.clear=function(){this._key=_()},v}();function _(){var v;do v="@@WeakMap@@"+S();while(m.has(h,v));return h[v]=!0,v}function T(v,w){if(!n.call(v,p)){if(!w)return;Object.defineProperty(v,p,{value:m.create()})}return v[p]}function U(v,w){for(var b=0;b<w;++b)v[b]=Math.random()*255|0;return v}function F(v){if(typeof Uint8Array=="function"){var w=new Uint8Array(v);return typeof crypto<"u"?crypto.getRandomValues(w):typeof msCrypto<"u"?msCrypto.getRandomValues(w):U(w,v),w}return U(new Array(v),v)}function S(){var v=F(u);v[6]=v[6]&79|64,v[8]=v[8]&191|128;for(var w="",b=0;b<u;++b){var E=v[b];(b===4||b===6||b===8)&&(w+="-"),E<16&&(w+="0"),w+=E.toString(16).toLowerCase()}return w}}function Ae(u){return u.__=void 0,delete u.__,u}})}(i||(i={})),Pn}Ai();var gt;(function(i){i[i.Transient=0]="Transient",i[i.Singleton=1]="Singleton",i[i.ResolutionScoped=2]="ResolutionScoped",i[i.ContainerScoped=3]="ContainerScoped"})(gt||(gt={}));const X=gt;/*! *****************************************************************************
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(i,e){return yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])},yt(i,e)};function _t(i,e){yt(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Ei(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(m){o(m)}}function l(d){try{c(r.throw(d))}catch(m){o(m)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((r=r.apply(i,[])).next())})}function Ti(i,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,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(d){return l([c,d])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,n=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(i,t)}catch(d){c=[6,d],n=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Je(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],r=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function et(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var r=t.call(i),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function pe(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(et(arguments[e]));return i}var vt="injectionTokens";function Ci(i){var e=Reflect.getMetadata("design:paramtypes",i)||[],t=Reflect.getOwnMetadata(vt,i)||{};return Object.keys(t).forEach(function(r){e[+r]=t[r]}),e}function xi(i,e){return function(t,r,n){var s=Reflect.getOwnMetadata(vt,t)||{};s[n]=i,Reflect.defineMetadata(vt,s,t)}}function Ln(i){return!!i.useClass}function wt(i){return!!i.useFactory}var Dn=function(){function i(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return i.prototype.createProxy=function(e){var t=this,r={},n=!1,s,o=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(r,this.createHandler(o))},i.prototype.createHandler=function(e){var t={},r=function(n){t[n]=function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];s[0]=e();var a=Reflect[n];return a.apply(void 0,pe(s))}};return this.reflectMethods.forEach(r),t},i}();function Ee(i){return typeof i=="string"||typeof i=="symbol"}function Ri(i){return typeof i=="object"&&"token"in i&&"multiple"in i}function $n(i){return typeof i=="object"&&"token"in i&&"transform"in i}function Si(i){return typeof i=="function"||i instanceof Dn}function tt(i){return!!i.useToken}function nt(i){return i.useValue!=null}function Mi(i){return Ln(i)||nt(i)||tt(i)||wt(i)}var bt=function(){function i(){this._registryMap=new Map}return i.prototype.entries=function(){return this._registryMap.entries()},i.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},i.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},i.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},i.prototype.setAll=function(e,t){this._registryMap.set(e,t)},i.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},i.prototype.clear=function(){this._registryMap.clear()},i.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},i}(),Pi=function(i){_t(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(bt),In=function(){function i(){this.scopedResolutions=new Map}return i}();function Oi(i,e){if(i===null)return"at position #"+e;var t=i.split(",")[e].trim();return'"'+t+'" at position #'+e}function Li(i,e,t){return t===void 0&&(t=" "),pe([i],e.message.split(`
28
- `).map(function(r){return t+r})).join(`
29
- `)}function Di(i,e,t){var r=et(i.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=r[1],s=n===void 0?null:n,o=Oi(s,e);return Li("Cannot inject the dependency "+o+' of "'+i.name+'" constructor. Reason:',t)}function $i(i){if(typeof i.dispose!="function")return!1;var e=i.dispose;return!(e.length>0)}var Ii=function(i){_t(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(bt),ki=function(i){_t(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(bt),Ni=function(){function i(){this.preResolution=new Ii,this.postResolution=new ki}return i}(),kn=new Map,ji=function(){function i(e){this.parent=e,this._registry=new Pi,this.interceptors=new Ni,this.disposed=!1,this.disposables=new Set}return i.prototype.register=function(e,t,r){r===void 0&&(r={lifecycle:X.Transient}),this.ensureNotDisposed();var n;if(Mi(t)?n=t:n={useClass:t},tt(n))for(var s=[e],o=n;o!=null;){var a=o.useToken;if(s.includes(a))throw new Error("Token registration cycle detected! "+pe(s,[a]).join(" -> "));s.push(a);var l=this._registry.get(a);l&&tt(l.provider)?o=l.provider:o=null}if((r.lifecycle===X.Singleton||r.lifecycle==X.ContainerScoped||r.lifecycle==X.ResolutionScoped)&&(nt(n)||wt(n)))throw new Error('Cannot use lifecycle "'+X[r.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:r}),this},i.prototype.registerType=function(e,t){return this.ensureNotDisposed(),Ee(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},i.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},i.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),Ee(e)){if(Ee(t))return this.register(e,{useToken:t},{lifecycle:X.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:X.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var r=e;return t&&!Ee(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:X.Singleton})},i.prototype.resolve=function(e,t){t===void 0&&(t=new In),this.ensureNotDisposed();var r=this.getRegistration(e);if(!r&&Ee(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),r){var n=this.resolveRegistration(r,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if(Si(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},i.prototype.executePreResolutionInterceptor=function(e,t){var r,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var o=Je(this.interceptors.preResolution.getAll(e)),a=o.next();!a.done;a=o.next()){var l=a.value;l.options.frequency!="Once"&&s.push(l),l.callback(e,t)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(e,s)}},i.prototype.executePostResolutionInterceptor=function(e,t,r){var n,s;if(this.interceptors.postResolution.has(e)){var o=[];try{for(var a=Je(this.interceptors.postResolution.getAll(e)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&o.push(c),c.callback(e,t,r)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,o)}},i.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===X.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var r=e.options.lifecycle===X.Singleton,n=e.options.lifecycle===X.ContainerScoped,s=r||n,o;return nt(e.provider)?o=e.provider.useValue:tt(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Ln(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):wt(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===X.ResolutionScoped&&t.scopedResolutions.set(e,o),o},i.prototype.resolveAll=function(e,t){var r=this;t===void 0&&(t=new In),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&Ee(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(a){return r.resolveRegistration(a,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var o=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,o,"All"),o},i.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},i.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},i.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var r=Je(this._registry.entries()),n=r.next();!n.done;n=r.next()){var s=et(n.value,2),o=s[0],a=s[1];this._registry.setAll(o,a.filter(function(l){return!nt(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){e={error:l}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},i.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var r=new i(this);try{for(var n=Je(this._registry.entries()),s=n.next();!s.done;s=n.next()){var o=et(s.value,2),a=o[0],l=o[1];l.some(function(c){var d=c.options;return d.lifecycle===X.ContainerScoped})&&r._registry.setAll(a,l.map(function(c){return c.options.lifecycle===X.ContainerScoped?{provider:c.provider,options:c.options}:c}))}}catch(c){e={error:c}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},i.prototype.beforeResolution=function(e,t,r){r===void 0&&(r={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:r})},i.prototype.afterResolution=function(e,t,r){r===void 0&&(r={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:r})},i.prototype.dispose=function(){return Ei(this,void 0,void 0,function(){var e;return Ti(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(r){var n=r.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},i.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},i.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},i.prototype.construct=function(e,t){var r=this;if(e instanceof Dn)return e.createProxy(function(s){return r.resolve(s,t)});var n=function(){var s=kn.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(r.resolveParams(t,e));return new(e.bind.apply(e,pe([void 0],o)))}();return $i(n)&&this.disposables.add(n),n},i.prototype.resolveParams=function(e,t){var r=this;return function(n,s){var o,a,l;try{return Ri(n)?$n(n)?n.multiple?(o=r.resolve(n.transform)).transform.apply(o,pe([r.resolveAll(n.token)],n.transformArgs)):(a=r.resolve(n.transform)).transform.apply(a,pe([r.resolve(n.token,e)],n.transformArgs)):n.multiple?r.resolveAll(n.token):r.resolve(n.token,e):$n(n)?(l=r.resolve(n.transform,e)).transform.apply(l,pe([r.resolve(n.token,e)],n.transformArgs)):r.resolve(n,e)}catch(c){throw new Error(Di(t,s,c))}}},i.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},i}(),Te=new ji;function I(i){return xi(i)}function Nn(){return function(i){kn.set(i,Ci(i))}}function V(){return function(i){Nn()(i),Te.registerSingleton(i)}}function At(i,e){return function(t){Nn()(t),Te.register(t,t,{lifecycle:i})}}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.`);var Hi=Object.defineProperty,Fi=(i,e,t)=>e in i?Hi(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ee=(i,e,t)=>Fi(i,typeof e!="symbol"?e+"":e,t),jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Hn={};/*! *****************************************************************************
30
- Copyright (C) Microsoft. All rights reserved.
31
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
32
- this file except in compliance with the License. You may obtain a copy of the
33
- License at http://www.apache.org/licenses/LICENSE-2.0
34
-
35
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
36
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
37
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
38
- MERCHANTABLITY OR NON-INFRINGEMENT.
39
-
40
- See the Apache Version 2.0 License for specific language governing permissions
41
- and limitations under the License.
42
- ***************************************************************************** */var Fn;function Gi(){if(Fn)return Hn;Fn=1;var i;return function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof jn=="object"?jn:typeof self=="object"?self:typeof this=="object"?this:l(),n=s(e);typeof r.Reflect<"u"&&(n=s(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function s(c,d){return function(m,g){Object.defineProperty(c,m,{configurable:!0,writable:!0,value:g}),d&&d(m,g)}}function o(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return o()||a()}})(function(t,r){var n=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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,m={create:l?function(){return Ae(Object.create(null))}:c?function(){return Ae({__proto__:null})}:function(){return Ae({})},has:d?function(u,h){return n.call(u,h)}:function(u,h){return h in u},get:d?function(u,h){return n.call(u,h)?u[h]:void 0}:function(u,h){return u[h]}},g=Object.getPrototypeOf(Function),A=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Tn(),x=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Cn(),O=typeof WeakMap=="function"?WeakMap:xn(),R=s?Symbol.for("@reflect-metadata:registry"):void 0,P=bn(),$=An(P);function D(u,h,p,_){if(C(p)){if(!Ve(u))throw new TypeError;if(!Ke(h))throw new TypeError;return pn(u,h)}else{if(!Ve(u))throw new TypeError;if(!H(h))throw new TypeError;if(!H(_)&&!C(_)&&!te(_))throw new TypeError;return te(_)&&(_=void 0),p=W(p),fn(u,h,p,_)}}t("decorate",D);function j(u,h){function p(_,T){if(!H(_))throw new TypeError;if(!C(T)&&!vn(T))throw new TypeError;Fe(u,h,_,T)}return p}t("metadata",j);function q(u,h,p,_){if(!H(p))throw new TypeError;return C(_)||(_=W(_)),Fe(u,h,p,_)}t("defineMetadata",q);function ie(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),Ne(u,h,p)}t("hasMetadata",ie);function Z(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),ve(u,h,p)}t("hasOwnMetadata",Z);function le(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),je(u,h,p)}t("getMetadata",le);function re(u,h,p){if(!H(h))throw new TypeError;return C(p)||(p=W(p)),He(u,h,p)}t("getOwnMetadata",re);function _e(u,h){if(!H(u))throw new TypeError;return C(h)||(h=W(h)),Ge(u,h)}t("getMetadataKeys",_e);function hn(u,h){if(!H(u))throw new TypeError;return C(h)||(h=W(h)),Ue(u,h)}t("getOwnMetadataKeys",hn);function dn(u,h,p){if(!H(h))throw new TypeError;if(C(p)||(p=W(p)),!H(h))throw new TypeError;C(p)||(p=W(p));var _=se(h,p,!1);return C(_)?!1:_.OrdinaryDeleteMetadata(u,h,p)}t("deleteMetadata",dn);function pn(u,h){for(var p=u.length-1;p>=0;--p){var _=u[p],T=_(h);if(!C(T)&&!te(T)){if(!Ke(T))throw new TypeError;h=T}}return h}function fn(u,h,p,_){for(var T=u.length-1;T>=0;--T){var U=u[T],F=U(h,p,_);if(!C(F)&&!te(F)){if(!H(F))throw new TypeError;_=F}}return _}function Ne(u,h,p){var _=ve(u,h,p);if(_)return!0;var T=be(h);return te(T)?!1:Ne(u,T,p)}function ve(u,h,p){var _=se(h,p,!1);return C(_)?!1:ze(_.OrdinaryHasOwnMetadata(u,h,p))}function je(u,h,p){var _=ve(u,h,p);if(_)return He(u,h,p);var T=be(h);if(!te(T))return je(u,T,p)}function He(u,h,p){var _=se(h,p,!1);if(!C(_))return _.OrdinaryGetOwnMetadata(u,h,p)}function Fe(u,h,p,_){var T=se(p,_,!0);T.OrdinaryDefineOwnMetadata(u,h,p,_)}function Ge(u,h){var p=Ue(u,h),_=be(u);if(_===null)return p;var T=Ge(_,h);if(T.length<=0)return p;if(p.length<=0)return T;for(var U=new x,F=[],S=0,v=p;S<v.length;S++){var w=v[S],b=U.has(w);b||(U.add(w),F.push(w))}for(var E=0,M=T;E<M.length;E++){var w=M[E],b=U.has(w);b||(U.add(w),F.push(w))}return F}function Ue(u,h){var p=se(u,h,!1);return p?p.OrdinaryOwnMetadataKeys(u,h):[]}function Be(u){if(u===null)return 1;switch(typeof u){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return u===null?1:6;default:return 6}}function C(u){return u===void 0}function te(u){return u===null}function mn(u){return typeof u=="symbol"}function H(u){return typeof u=="object"?u!==null:typeof u=="function"}function gn(u,h){switch(Be(u)){case 0:return u;case 1:return u;case 2:return u;case 3:return u;case 4:return u;case 5:return u}var p="string",_=We(u,o);if(_!==void 0){var T=_.call(u,p);if(H(T))throw new TypeError;return T}return yn(u)}function yn(u,h){var p,_;{var T=u.toString;if(ce(T)){var _=T.call(u);if(!H(_))return _}var p=u.valueOf;if(ce(p)){var _=p.call(u);if(!H(_))return _}}throw new TypeError}function ze(u){return!!u}function _n(u){return""+u}function W(u){var h=gn(u);return mn(h)?h:_n(h)}function Ve(u){return Array.isArray?Array.isArray(u):u instanceof Object?u instanceof Array:Object.prototype.toString.call(u)==="[object Array]"}function ce(u){return typeof u=="function"}function Ke(u){return typeof u=="function"}function vn(u){switch(Be(u)){case 3:return!0;case 4:return!0;default:return!1}}function we(u,h){return u===h||u!==u&&h!==h}function We(u,h){var p=u[h];if(p!=null){if(!ce(p))throw new TypeError;return p}}function Ye(u){var h=We(u,a);if(!ce(h))throw new TypeError;var p=h.call(u);if(!H(p))throw new TypeError;return p}function Xe(u){return u.value}function qe(u){var h=u.next();return h.done?!1:h}function Ze(u){var h=u.return;h&&h.call(u)}function be(u){var h=Object.getPrototypeOf(u);if(typeof u!="function"||u===g||h!==g)return h;var p=u.prototype,_=p&&Object.getPrototypeOf(p);if(_==null||_===Object.prototype)return h;var T=_.constructor;return typeof T!="function"||T===u?h:T}function wn(){var u;!C(R)&&typeof r.Reflect<"u"&&!(R in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(u=En(r.Reflect));var h,p,_,T=new O,U={registerProvider:F,getProvider:v,setProvider:b};return U;function F(E){if(!Object.isExtensible(U))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case u===E:break;case C(h):h=E;break;case h===E:break;case C(p):p=E;break;case p===E:break;default:_===void 0&&(_=new x),_.add(E);break}}function S(E,M){if(!C(h)){if(h.isProviderFor(E,M))return h;if(!C(p)){if(p.isProviderFor(E,M))return h;if(!C(_))for(var L=Ye(_);;){var k=qe(L);if(!k)return;var K=Xe(k);if(K.isProviderFor(E,M))return Ze(L),K}}}if(!C(u)&&u.isProviderFor(E,M))return u}function v(E,M){var L=T.get(E),k;return C(L)||(k=L.get(M)),C(k)&&(k=S(E,M),C(k)||(C(L)&&(L=new A,T.set(E,L)),L.set(M,k))),k}function w(E){if(C(E))throw new TypeError;return h===E||p===E||!C(_)&&_.has(E)}function b(E,M,L){if(!w(L))throw new Error("Metadata provider not registered.");var k=v(E,M);if(k!==L){if(!C(k))return!1;var K=T.get(E);C(K)&&(K=new A,T.set(E,K)),K.set(M,L)}return!0}}function bn(){var u;return!C(R)&&H(r.Reflect)&&Object.isExtensible(r.Reflect)&&(u=r.Reflect[R]),C(u)&&(u=wn()),!C(R)&&H(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,R,{enumerable:!1,configurable:!1,writable:!1,value:u}),u}function An(u){var h=new O,p={isProviderFor:function(w,b){var E=h.get(w);return C(E)?!1:E.has(b)},OrdinaryDefineOwnMetadata:F,OrdinaryHasOwnMetadata:T,OrdinaryGetOwnMetadata:U,OrdinaryOwnMetadataKeys:S,OrdinaryDeleteMetadata:v};return P.registerProvider(p),p;function _(w,b,E){var M=h.get(w),L=!1;if(C(M)){if(!E)return;M=new A,h.set(w,M),L=!0}var k=M.get(b);if(C(k)){if(!E)return;if(k=new A,M.set(b,k),!u.setProvider(w,b,p))throw M.delete(b),L&&h.delete(w),new Error("Wrong provider for target.")}return k}function T(w,b,E){var M=_(b,E,!1);return C(M)?!1:ze(M.has(w))}function U(w,b,E){var M=_(b,E,!1);if(!C(M))return M.get(w)}function F(w,b,E,M){var L=_(E,M,!0);L.set(w,b)}function S(w,b){var E=[],M=_(w,b,!1);if(C(M))return E;for(var L=M.keys(),k=Ye(L),K=0;;){var Qe=qe(k);if(!Qe)return E.length=K,E;var Rn=Xe(Qe);try{E[K]=Rn}catch(Sn){try{Ze(k)}finally{throw Sn}}K++}}function v(w,b,E){var M=_(b,E,!1);if(C(M)||!M.delete(w))return!1;if(M.size===0){var L=h.get(b);C(L)||(L.delete(E),L.size===0&&h.delete(L))}return!0}}function En(u){var h=u.defineMetadata,p=u.hasOwnMetadata,_=u.getOwnMetadata,T=u.getOwnMetadataKeys,U=u.deleteMetadata,F=new O,S={isProviderFor:function(v,w){var b=F.get(v);return!C(b)&&b.has(w)?!0:T(v,w).length?(C(b)&&(b=new x,F.set(v,b)),b.add(w),!0):!1},OrdinaryDefineOwnMetadata:h,OrdinaryHasOwnMetadata:p,OrdinaryGetOwnMetadata:_,OrdinaryOwnMetadataKeys:T,OrdinaryDeleteMetadata:U};return S}function se(u,h,p){var _=P.getProvider(u,h);if(!C(_))return _;if(p){if(P.setProvider(u,h,$))return $;throw new Error("Illegal state.")}}function Tn(){var u={},h=[],p=function(){function S(v,w,b){this._index=0,this._keys=v,this._values=w,this._selector=b}return S.prototype["@@iterator"]=function(){return this},S.prototype[a]=function(){return this},S.prototype.next=function(){var v=this._index;if(v>=0&&v<this._keys.length){var w=this._selector(this._keys[v],this._values[v]);return v+1>=this._keys.length?(this._index=-1,this._keys=h,this._values=h):this._index++,{value:w,done:!1}}return{value:void 0,done:!0}},S.prototype.throw=function(v){throw this._index>=0&&(this._index=-1,this._keys=h,this._values=h),v},S.prototype.return=function(v){return this._index>=0&&(this._index=-1,this._keys=h,this._values=h),{value:v,done:!0}},S}(),_=function(){function S(){this._keys=[],this._values=[],this._cacheKey=u,this._cacheIndex=-2}return Object.defineProperty(S.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),S.prototype.has=function(v){return this._find(v,!1)>=0},S.prototype.get=function(v){var w=this._find(v,!1);return w>=0?this._values[w]:void 0},S.prototype.set=function(v,w){var b=this._find(v,!0);return this._values[b]=w,this},S.prototype.delete=function(v){var w=this._find(v,!1);if(w>=0){for(var b=this._keys.length,E=w+1;E<b;E++)this._keys[E-1]=this._keys[E],this._values[E-1]=this._values[E];return this._keys.length--,this._values.length--,we(v,this._cacheKey)&&(this._cacheKey=u,this._cacheIndex=-2),!0}return!1},S.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=u,this._cacheIndex=-2},S.prototype.keys=function(){return new p(this._keys,this._values,T)},S.prototype.values=function(){return new p(this._keys,this._values,U)},S.prototype.entries=function(){return new p(this._keys,this._values,F)},S.prototype["@@iterator"]=function(){return this.entries()},S.prototype[a]=function(){return this.entries()},S.prototype._find=function(v,w){if(!we(this._cacheKey,v)){this._cacheIndex=-1;for(var b=0;b<this._keys.length;b++)if(we(this._keys[b],v)){this._cacheIndex=b;break}}return this._cacheIndex<0&&w&&(this._cacheIndex=this._keys.length,this._keys.push(v),this._values.push(void 0)),this._cacheIndex},S}();return _;function T(S,v){return S}function U(S,v){return v}function F(S,v){return[S,v]}}function Cn(){var u=function(){function h(){this._map=new A}return Object.defineProperty(h.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),h.prototype.has=function(p){return this._map.has(p)},h.prototype.add=function(p){return this._map.set(p,p),this},h.prototype.delete=function(p){return this._map.delete(p)},h.prototype.clear=function(){this._map.clear()},h.prototype.keys=function(){return this._map.keys()},h.prototype.values=function(){return this._map.keys()},h.prototype.entries=function(){return this._map.entries()},h.prototype["@@iterator"]=function(){return this.keys()},h.prototype[a]=function(){return this.keys()},h}();return u}function xn(){var u=16,h=m.create(),p=_();return function(){function v(){this._key=_()}return v.prototype.has=function(w){var b=T(w,!1);return b!==void 0?m.has(b,this._key):!1},v.prototype.get=function(w){var b=T(w,!1);return b!==void 0?m.get(b,this._key):void 0},v.prototype.set=function(w,b){var E=T(w,!0);return E[this._key]=b,this},v.prototype.delete=function(w){var b=T(w,!1);return b!==void 0?delete b[this._key]:!1},v.prototype.clear=function(){this._key=_()},v}();function _(){var v;do v="@@WeakMap@@"+S();while(m.has(h,v));return h[v]=!0,v}function T(v,w){if(!n.call(v,p)){if(!w)return;Object.defineProperty(v,p,{value:m.create()})}return v[p]}function U(v,w){for(var b=0;b<w;++b)v[b]=Math.random()*255|0;return v}function F(v){if(typeof Uint8Array=="function"){var w=new Uint8Array(v);return typeof crypto<"u"?crypto.getRandomValues(w):typeof msCrypto<"u"?msCrypto.getRandomValues(w):U(w,v),w}return U(new Array(v),v)}function S(){var v=F(u);v[6]=v[6]&79|64,v[8]=v[8]&191|128;for(var w="",b=0;b<u;++b){var E=v[b];(b===4||b===6||b===8)&&(w+="-"),E<16&&(w+="0"),w+=E.toString(16).toLowerCase()}return w}}function Ae(u){return u.__=void 0,delete u.__,u}})}(i||(i={})),Hn}Gi();class Ui extends f.EventDispatcher{constructor(){super(),ee(this,"style",{}),ee(this,"width",0),ee(this,"height",0),ee(this,"left",0),ee(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(){}}var Et;(function(i){i[i.Transient=0]="Transient",i[i.Singleton=1]="Singleton",i[i.ResolutionScoped=2]="ResolutionScoped",i[i.ContainerScoped=3]="ContainerScoped"})(Et||(Et={}));const Q=Et;/*! *****************************************************************************
43
- Copyright (c) Microsoft Corporation.
44
-
45
- Permission to use, copy, modify, and/or distribute this software for any
46
- purpose with or without fee is hereby granted.
47
-
48
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
49
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
50
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
51
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
52
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
53
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
54
- PERFORMANCE OF THIS SOFTWARE.
55
- ***************************************************************************** */var Tt=function(i,e){return Tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])},Tt(i,e)};function Ct(i,e){Tt(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Bi(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(m){o(m)}}function l(d){try{c(r.throw(d))}catch(m){o(m)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((r=r.apply(i,[])).next())})}function zi(i,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,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(d){return l([c,d])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,n=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(i,t)}catch(d){c=[6,d],n=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function it(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],r=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rt(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var r=t.call(i),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function fe(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(rt(arguments[e]));return i}var xt="injectionTokens";function Vi(i){var e=Reflect.getMetadata("design:paramtypes",i)||[],t=Reflect.getOwnMetadata(xt,i)||{};return Object.keys(t).forEach(function(r){e[+r]=t[r]}),e}function Ki(i,e){return function(t,r,n){var s=Reflect.getOwnMetadata(xt,t)||{};s[n]=i,Reflect.defineMetadata(xt,s,t)}}function Gn(i){return!!i.useClass}function Rt(i){return!!i.useFactory}var Un=function(){function i(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return i.prototype.createProxy=function(e){var t=this,r={},n=!1,s,o=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(r,this.createHandler(o))},i.prototype.createHandler=function(e){var t={},r=function(n){t[n]=function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];s[0]=e();var a=Reflect[n];return a.apply(void 0,fe(s))}};return this.reflectMethods.forEach(r),t},i}();function Ce(i){return typeof i=="string"||typeof i=="symbol"}function Wi(i){return typeof i=="object"&&"token"in i&&"multiple"in i}function Bn(i){return typeof i=="object"&&"token"in i&&"transform"in i}function Yi(i){return typeof i=="function"||i instanceof Un}function st(i){return!!i.useToken}function ot(i){return i.useValue!=null}function Xi(i){return Gn(i)||ot(i)||st(i)||Rt(i)}var St=function(){function i(){this._registryMap=new Map}return i.prototype.entries=function(){return this._registryMap.entries()},i.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},i.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},i.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},i.prototype.setAll=function(e,t){this._registryMap.set(e,t)},i.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},i.prototype.clear=function(){this._registryMap.clear()},i.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},i}(),qi=function(i){Ct(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(St),zn=function(){function i(){this.scopedResolutions=new Map}return i}();function Zi(i,e){if(i===null)return"at position #"+e;var t=i.split(",")[e].trim();return'"'+t+'" at position #'+e}function Qi(i,e,t){return t===void 0&&(t=" "),fe([i],e.message.split(`
56
- `).map(function(r){return t+r})).join(`
57
- `)}function Ji(i,e,t){var r=rt(i.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=r[1],s=n===void 0?null:n,o=Zi(s,e);return Qi("Cannot inject the dependency "+o+' of "'+i.name+'" constructor. Reason:',t)}function er(i){if(typeof i.dispose!="function")return!1;var e=i.dispose;return!(e.length>0)}var tr=function(i){Ct(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(St),nr=function(i){Ct(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(St),ir=function(){function i(){this.preResolution=new tr,this.postResolution=new nr}return i}(),Vn=new Map,rr=function(){function i(e){this.parent=e,this._registry=new qi,this.interceptors=new ir,this.disposed=!1,this.disposables=new Set}return i.prototype.register=function(e,t,r){r===void 0&&(r={lifecycle:Q.Transient}),this.ensureNotDisposed();var n;if(Xi(t)?n=t:n={useClass:t},st(n))for(var s=[e],o=n;o!=null;){var a=o.useToken;if(s.includes(a))throw new Error("Token registration cycle detected! "+fe(s,[a]).join(" -> "));s.push(a);var l=this._registry.get(a);l&&st(l.provider)?o=l.provider:o=null}if((r.lifecycle===Q.Singleton||r.lifecycle==Q.ContainerScoped||r.lifecycle==Q.ResolutionScoped)&&(ot(n)||Rt(n)))throw new Error('Cannot use lifecycle "'+Q[r.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:r}),this},i.prototype.registerType=function(e,t){return this.ensureNotDisposed(),Ce(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},i.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},i.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),Ce(e)){if(Ce(t))return this.register(e,{useToken:t},{lifecycle:Q.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Q.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var r=e;return t&&!Ce(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Q.Singleton})},i.prototype.resolve=function(e,t){t===void 0&&(t=new zn),this.ensureNotDisposed();var r=this.getRegistration(e);if(!r&&Ce(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),r){var n=this.resolveRegistration(r,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if(Yi(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},i.prototype.executePreResolutionInterceptor=function(e,t){var r,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var o=it(this.interceptors.preResolution.getAll(e)),a=o.next();!a.done;a=o.next()){var l=a.value;l.options.frequency!="Once"&&s.push(l),l.callback(e,t)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(e,s)}},i.prototype.executePostResolutionInterceptor=function(e,t,r){var n,s;if(this.interceptors.postResolution.has(e)){var o=[];try{for(var a=it(this.interceptors.postResolution.getAll(e)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&o.push(c),c.callback(e,t,r)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,o)}},i.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Q.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var r=e.options.lifecycle===Q.Singleton,n=e.options.lifecycle===Q.ContainerScoped,s=r||n,o;return ot(e.provider)?o=e.provider.useValue:st(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Gn(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Rt(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Q.ResolutionScoped&&t.scopedResolutions.set(e,o),o},i.prototype.resolveAll=function(e,t){var r=this;t===void 0&&(t=new zn),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&Ce(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(a){return r.resolveRegistration(a,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var o=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,o,"All"),o},i.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},i.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},i.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var r=it(this._registry.entries()),n=r.next();!n.done;n=r.next()){var s=rt(n.value,2),o=s[0],a=s[1];this._registry.setAll(o,a.filter(function(l){return!ot(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){e={error:l}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},i.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var r=new i(this);try{for(var n=it(this._registry.entries()),s=n.next();!s.done;s=n.next()){var o=rt(s.value,2),a=o[0],l=o[1];l.some(function(c){var d=c.options;return d.lifecycle===Q.ContainerScoped})&&r._registry.setAll(a,l.map(function(c){return c.options.lifecycle===Q.ContainerScoped?{provider:c.provider,options:c.options}:c}))}}catch(c){e={error:c}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},i.prototype.beforeResolution=function(e,t,r){r===void 0&&(r={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:r})},i.prototype.afterResolution=function(e,t,r){r===void 0&&(r={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:r})},i.prototype.dispose=function(){return Bi(this,void 0,void 0,function(){var e;return zi(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(r){var n=r.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},i.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},i.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},i.prototype.construct=function(e,t){var r=this;if(e instanceof Un)return e.createProxy(function(s){return r.resolve(s,t)});var n=function(){var s=Vn.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(r.resolveParams(t,e));return new(e.bind.apply(e,fe([void 0],o)))}();return er(n)&&this.disposables.add(n),n},i.prototype.resolveParams=function(e,t){var r=this;return function(n,s){var o,a,l;try{return Wi(n)?Bn(n)?n.multiple?(o=r.resolve(n.transform)).transform.apply(o,fe([r.resolveAll(n.token)],n.transformArgs)):(a=r.resolve(n.transform)).transform.apply(a,fe([r.resolve(n.token,e)],n.transformArgs)):n.multiple?r.resolveAll(n.token):r.resolve(n.token,e):Bn(n)?(l=r.resolve(n.transform,e)).transform.apply(l,fe([r.resolve(n.token,e)],n.transformArgs)):r.resolve(n,e)}catch(c){throw new Error(Ji(t,s,c))}}},i.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},i}(),Mt=new rr;function sr(i){return Ki(i)}function or(){return function(i){Vn.set(i,Vi(i))}}function ar(){return function(i){or()(i),Mt.registerSingleton(i)}}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.`);let lr=-1;class Kn{constructor(e){ee(this,"_handleComplete"),ee(this,"_handleError"),ee(this,"id",lr+=1),ee(this,"idle",!0),ee(this,"worker"),ee(this,"thread"),this._handleComplete=e==null?void 0:e.complete,this._handleError=e==null?void 0:e.error}async run({payload:e,options:t}){var r,n,s;try{this.idle=!1,this.worker=new mt.Worker(e.path,{type:"module",...t==null?void 0:t.worker}),this.thread=await mt.spawn(this.worker,{timeout:1e4,...t==null?void 0:t.spawn});const o=(n=(r=this.thread)==null?void 0:r.lifecycle$)==null?void 0:n.call(r);if(!(o!=null&&o.pipe))throw new Error("Worker Module Incompatible. Missing #lifecycle observable.");return this.worker.postMessage(e.subject,e.transferSubject),o.subscribe({complete:this._handleComplete,error:this._handleError}),{worker:this.worker,thread:this.thread}}catch(o){return(s=this._handleError)==null||s.call(this,o),{}}}terminate(){var e;(e=this.worker)==null||e.terminate(),this.thread&&mt.Thread.terminate(this.thread),this.worker=void 0,this.thread=void 0,this.idle=!0}}const cr=()=>{try{if(typeof window>"u")return require("os").cpus().length;if(navigator!=null&&navigator.hardwareConcurrency)return navigator.hardwareConcurrency;throw new Error("Unable to determine the number of cores")}catch(i){return console.error("🛑 Unable to detect available cores",i),2}},ur=()=>cr()-1;var hr=(i,e,t,r)=>{for(var n=e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=o(n)||n);return n},dr=(i,e)=>(t,r)=>e(t,r,i);let Pe=class{constructor(i){ee(this,"_workerThreads",[]),ee(this,"_taskQueue",[]),this._maxWorkers=i;for(let e=0;e<this._maxWorkers;e++){const t=new Kn({complete:()=>this._handleWorkerMessage(t),error:r=>this._handleWorkerError(r,t)});this._workerThreads.push(t)}}_runNext(i){if(i.terminate(),this._taskQueue.length>0){const e=this._taskQueue.shift();e&&this.run(e)}}_handleWorkerMessage(i){console.log(`Thread #${i.id} execution completed`),this._runNext(i)}_handleWorkerError(i,e){console.error(`Error from worker #${e.id}:`,i),this._runNext(e)}get maxWorkers(){return this._maxWorkers}get workerThreads(){return this._workerThreads}get taskQueue(){return this._taskQueue}async run(i,e=!1){if(e){const r=new Kn({complete:()=>this._handleWorkerMessage(r),error:n=>this._handleWorkerError(n,r)});return console.log(`Running On Untracked Thread #${r==null?void 0:r.id}. Task:`,i),await r.run(i)}const t=this._workerThreads.find(r=>r.idle);return t?(console.log(`Running On Thread #${t==null?void 0:t.id}. Task:`,i),await t.run(i)):(this._taskQueue.push(i),console.log("Queued Thread Task:",i),{})}terminateAll(){this._workerThreads.forEach(i=>i.terminate())}};Pe=hr([ar(),dr(0,sr(Pe.name))],Pe);const pr=i=>(Mt.register(Pe.name,{useValue:ur()}),Mt.resolve(Pe)),Pt=i=>i===void 0,Ot=i=>typeof i=="boolean",fr=i=>!!i&&typeof i=="function",Lt=(i,e)=>{const t={type:i==null?void 0:i.type};for(const r of e)i[r]!==void 0&&(t[r]=i[r]);return t},mr=(i,e)=>{const t={type:i==null?void 0:i.type};for(const[r,n]of Object.entries(i))e.includes(r)||(t[r]=n);return t};var gr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,_r=(i,e,t,r)=>{for(var n=r>1?void 0:r?yr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&gr(e,t,n),n};let Oe=class{constructor(){y(this,"proxyReceiver",new Ui);y(this,"initialized",!1);y(this,"canvas")}};Oe=_r([V()],Oe);class Wn{constructor(){y(this,"contextmenu$$");y(this,"resize$$");y(this,"mousedown$$");y(this,"mousemove$$");y(this,"mouseup$$");y(this,"pointerdown$$");y(this,"pointermove$$");y(this,"pointercancel$$");y(this,"pointerup$$");y(this,"touchstart$$");y(this,"touchmove$$");y(this,"touchend$$");y(this,"wheel$$");y(this,"keydown$$")}}class Yn extends Wn{constructor(){super(...arguments);y(this,"contextmenu$");y(this,"resize$");y(this,"mousedown$");y(this,"mousemove$");y(this,"mouseup$");y(this,"pointerdown$");y(this,"pointermove$");y(this,"pointercancel$");y(this,"pointerup$");y(this,"touchstart$");y(this,"touchmove$");y(this,"touchend$");y(this,"wheel$");y(this,"keydown$")}}class Dt extends Yn{constructor(){super(...arguments);y(this,"contextmenu");y(this,"resize");y(this,"mousedown");y(this,"mousemove");y(this,"mouseup");y(this,"pointerdown");y(this,"pointermove");y(this,"pointercancel");y(this,"pointerup");y(this,"touchstart");y(this,"touchmove");y(this,"touchend");y(this,"wheel");y(this,"keydown")}}const Xn=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Le=["contextmenu","resize","mousedown","mousemove","mouseup","pointerdown","pointermove","pointercancel","pointerup","touchstart","touchmove","touchend","wheel","keydown"];var vr=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,br=(i,e,t,r)=>{for(var n=r>1?void 0:r?wr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&vr(e,t,n),n},Ar=(i,e)=>(t,r)=>e(t,r,i);let De=class extends Dt{constructor(e){super();y(this,"lifecycle$$",new B.Subject);y(this,"lifecycle$",this.lifecycle$$.pipe());this.component=e;for(const t of Le)this[`${t}$$`]=new B.Subject,this[`${t}$`]=this[`${t}$$`].pipe(),this[t]=r=>{this.component.proxyReceiver.handleEvent({...r,type:r.type||t}),this[`${t}$$`].next(r)}}};De=br([V(),Ar(0,I(Oe))],De);var Er=Object.defineProperty,Tr=Object.getOwnPropertyDescriptor,Cr=(i,e,t,r)=>{for(var n=r>1?void 0:r?Tr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Er(e,t,n),n};let at=class{constructor(){y(this,"clock",new f.Clock);y(this,"frame",1e3/60);y(this,"delta",0);y(this,"deltaRatio",0);y(this,"enabled",!1)}};at=Cr([V()],at);var xr=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Sr=(i,e,t,r)=>{for(var n=r>1?void 0:r?Rr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&xr(e,t,n),n};let $e=class{constructor(){y(this,"scene",new f.Scene);y(this,"enabled",!0)}};$e=Sr([V()],$e);var Mr=Object.defineProperty,Pr=Object.getOwnPropertyDescriptor,Or=(i,e,t,r)=>{for(var n=r>1?void 0:r?Pr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Mr(e,t,n),n};let me=class{constructor(){y(this,"width",0);y(this,"height",0);y(this,"aspect",0);y(this,"pixelRatio",0);y(this,"frustrum",5);y(this,"enabled",!0)}init(i,e){this.height=Number(i.height??this.height),this.width=Number(i.width??this.width),this.aspect=this.width/this.height,this.enabled=e===void 0?!0:!!e}};me=Or([V()],me);var xe=(i=>(i[i.PERSPECTIVE=0]="PERSPECTIVE",i[i.ORTHOGRAPHIC=1]="ORTHOGRAPHIC",i))(xe||{}),Lr=Object.defineProperty,Dr=Object.getOwnPropertyDescriptor,$r=(i,e,t,r)=>{for(var n=r>1?void 0:r?Dr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Lr(e,t,n),n},Ir=(i,e)=>(t,r)=>e(t,r,i);let Re=class{constructor(i){y(this,"instance");y(this,"miniCamera");y(this,"enabled",!0);this.sizesComponent=i}set aspectRatio(i){var e;this.instance instanceof f.PerspectiveCamera&&(this.instance.aspect=i),(this.instance instanceof f.PerspectiveCamera||this.instance instanceof f.OrthographicCamera)&&((e=this.instance)==null||e.updateProjectionMatrix())}set quaternion(i){var e;(e=this.instance)==null||e.quaternion.copy(i)}set position(i){var e;(e=this.instance)==null||e.position.copy(i)}set rotation(i){var e;(e=this.instance)==null||e.rotation.copy(i)}initDefaultCamera(i){if(this.removeCamera(),i===xe.PERSPECTIVE||i===void 0){this.instance=new f.PerspectiveCamera(70,this.sizesComponent.width/this.sizesComponent.height,1e-4,100),this.instance.position.z=8;return}i===xe.ORTHOGRAPHIC&&(this.instance=new f.OrthographicCamera(-this.sizesComponent.aspect*this.sizesComponent.frustrum/2,this.sizesComponent.aspect*this.sizesComponent.frustrum/2,this.sizesComponent.frustrum/2,-this.sizesComponent.frustrum/2,-50,50))}setMiniCamera(){this.removeMiniCamera(),this.miniCamera=new f.PerspectiveCamera(75,this.sizesComponent.width/this.sizesComponent.height,.1,500),this.miniCamera.position.z=10,this.miniCamera.position.x=-5}removeCamera(){this.instance instanceof f.Camera&&((this.instance instanceof f.PerspectiveCamera||this.instance instanceof f.OrthographicCamera)&&this.instance.clearViewOffset(),this.instance.clear(),this.instance=void 0)}removeMiniCamera(){this.miniCamera instanceof f.Camera&&(this.miniCamera.clearViewOffset(),this.miniCamera.clear(),this.miniCamera=void 0)}};Re=$r([V(),Ir(0,I(me))],Re);const qn={type:"change"},$t={type:"start"},Zn={type:"end"},lt=new f.Ray,Qn=new f.Plane,kr=Math.cos(70*f.MathUtils.DEG2RAD),Y=new f.Vector3,J=2*Math.PI,z={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},It=1e-6;class Jn extends f.Controls{constructor(e,t=null){super(e,t),this.state=z.NONE,this.enabled=!0,this.target=new f.Vector3,this.cursor=new f.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.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:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN},this.touches={ONE:f.TOUCH.ROTATE,TWO:f.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 f.Vector3,this._lastQuaternion=new f.Quaternion,this._lastTargetPosition=new f.Vector3,this._quat=new f.Quaternion().setFromUnitVectors(e.up,new f.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new f.Spherical,this._sphericalDelta=new f.Spherical,this._scale=1,this._panOffset=new f.Vector3,this._rotateStart=new f.Vector2,this._rotateEnd=new f.Vector2,this._rotateDelta=new f.Vector2,this._panStart=new f.Vector2,this._panEnd=new f.Vector2,this._panDelta=new f.Vector2,this._dollyStart=new f.Vector2,this._dollyEnd=new f.Vector2,this._dollyDelta=new f.Vector2,this._dollyDirection=new f.Vector3,this._mouse=new f.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=jr.bind(this),this._onPointerDown=Nr.bind(this),this._onPointerUp=Hr.bind(this),this._onContextMenu=Kr.bind(this),this._onMouseWheel=Ur.bind(this),this._onKeyDown=Br.bind(this),this._onTouchStart=zr.bind(this),this._onTouchMove=Vr.bind(this),this._onMouseDown=Fr.bind(this),this._onMouseMove=Gr.bind(this),this._interceptControlDown=Wr.bind(this),this._interceptControlUp=Yr.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(qn),this.update(),this.state=z.NONE}update(e=null){const t=this.object.position;Y.copy(t).sub(this.target),Y.applyQuaternion(this._quat),this._spherical.setFromVector3(Y),this.autoRotate&&this.state===z.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 r=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(r)&&isFinite(n)&&(r<-Math.PI?r+=J:r>Math.PI&&(r-=J),n<-Math.PI?n+=J:n>Math.PI&&(n-=J),r<=n?this._spherical.theta=Math.max(r,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+n)/2?Math.max(r,this._spherical.theta):Math.min(n,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(Y.setFromSpherical(this._spherical),Y.applyQuaternion(this._quatInverse),t.copy(this.target).add(Y),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=Y.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new f.Vector3(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new f.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=Y.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):(lt.origin.copy(this.object.position),lt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(lt.direction))<kr?this.object.lookAt(this.target):(Qn.setFromNormalAndCoplanarPoint(this.object.up,this.target),lt.intersectPlane(Qn,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)>It||8*(1-this._lastQuaternion.dot(this.object.quaternion))>It||this._lastTargetPosition.distanceToSquared(this.target)>It?(this.dispatchEvent(qn),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?J/60*this.autoRotateSpeed*e:J/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Y.setFromMatrixColumn(t,0),Y.multiplyScalar(-e),this._panOffset.add(Y)}_panUp(e,t){this.screenSpacePanning===!0?Y.setFromMatrixColumn(t,1):(Y.setFromMatrixColumn(t,0),Y.crossVectors(this.object.up,Y)),Y.multiplyScalar(e),this._panOffset.add(Y)}_pan(e,t){const r=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;Y.copy(n).sub(this.target);let s=Y.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/r.clientHeight,this.object.matrix),this._panUp(2*t*s/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),n=e-r.left,s=t-r.top,o=r.width,a=r.height;this._mouse.x=n/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 t=this.domElement;this._rotateLeft(J*this._rotateDelta.x/t.clientHeight),this._rotateUp(J*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(J*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(-J*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(J*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(-J*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(r,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(r,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),r=e.pageX-t.x,n=e.pageY-t.y,s=Math.sqrt(r*r+n*n);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 r=this._getSecondPointerPosition(e),n=.5*(e.pageX+r.x),s=.5*(e.pageY+r.y);this._rotateEnd.set(n,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(J*this._rotateDelta.x/t.clientHeight),this._rotateUp(J*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(r,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),r=e.pageX-t.x,n=e.pageY-t.y,s=Math.sqrt(r*r+n*n);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+t.x)*.5,a=(e.pageY+t.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 t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new f.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,r={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:r.deltaY*=16;break;case 2:r.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(r.deltaY*=10),r}}function Nr(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function jr(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function Hr(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Zn),this.state=z.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Fr(i){let e;switch(i.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case f.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=z.DOLLY;break;case f.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=z.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=z.ROTATE}break;case f.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=z.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=z.PAN}break;default:this.state=z.NONE}this.state!==z.NONE&&this.dispatchEvent($t)}function Gr(i){switch(this.state){case z.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case z.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case z.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function Ur(i){this.enabled===!1||this.enableZoom===!1||this.state!==z.NONE||(i.preventDefault(),this.dispatchEvent($t),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(Zn))}function Br(i){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(i)}function zr(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case f.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=z.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=z.TOUCH_PAN;break;default:this.state=z.NONE}break;case 2:switch(this.touches.TWO){case f.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=z.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=z.TOUCH_DOLLY_ROTATE;break;default:this.state=z.NONE}break;default:this.state=z.NONE}this.state!==z.NONE&&this.dispatchEvent($t)}function Vr(i){switch(this._trackPointer(i),this.state){case z.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case z.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case z.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case z.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=z.NONE}}function Kr(i){this.enabled!==!1&&i.preventDefault()}function Wr(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Yr(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}var Xr=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,Zr=(i,e,t,r)=>{for(var n=r>1?void 0:r?qr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Xr(e,t,n),n},kt=(i,e)=>(t,r)=>e(t,r,i);let ct=class{constructor(i,e,t){y(this,"enabled",!0);y(this,"cameraControls");y(this,"miniCameraControls");y(this,"cameraHelper");y(this,"axesHelper");y(this,"gridHelper");this.appComponent=i,this.cameraComponent=e,this.worldComponent=t}_setCameraOrbitControl(){var i;this.cameraControls&&((i=this.cameraControls)==null||i.dispose(),this.cameraControls=void 0),!(!this.enabled||!(this.cameraComponent.instance instanceof f.Camera))&&this.cameraComponent.instance instanceof f.Camera&&(this.cameraControls=new Jn(this.cameraComponent.instance,this.appComponent.proxyReceiver),this.cameraControls&&(this.cameraControls.enableDamping=!0))}_setMiniCameraOrbitControls(){this.miniCameraControls&&(this.miniCameraControls.dispose(),this.miniCameraControls=void 0),this.enabled&&this.cameraComponent.miniCamera&&(this.miniCameraControls=new Jn(this.cameraComponent.miniCamera,this.appComponent.proxyReceiver),this.miniCameraControls.enableDamping=!0)}_setCameraHelper(){this.cameraHelper&&(this.worldComponent.scene.remove(this.cameraHelper),this.cameraHelper=void 0),this.enabled&&this.cameraComponent.instance&&(this.cameraHelper=new f.CameraHelper(this.cameraComponent.instance),this.worldComponent.scene.add(this.cameraHelper))}_setAxesHelper(i){const e=new f.AxesHelper(i);this.worldComponent.scene.add(e)}_setGridHelper(i){const e=new f.GridHelper(i,i);this.worldComponent.scene.add(e)}init(i){this._setCameraOrbitControl(),this._setMiniCameraOrbitControls(),this._setCameraHelper(),typeof(i==null?void 0:i.axesSizes)=="number"&&this._setAxesHelper(i.axesSizes),typeof(i==null?void 0:i.gridSizes)=="number"&&this._setGridHelper(i.gridSizes)}update(){var i,e;this.enabled&&((i=this.cameraControls)==null||i.update(),(e=this.miniCameraControls)==null||e.update())}dispose(){this.cameraHelper&&(this.worldComponent.scene.remove(this.cameraHelper),this.cameraHelper=void 0),this.cameraControls&&(this.cameraControls.dispose(),this.cameraControls=void 0),this.miniCameraControls&&(this.miniCameraControls.dispose(),this.miniCameraControls=void 0)}};ct=Zr([V(),kt(0,I(Oe)),kt(1,I(Re)),kt(2,I($e))],ct);var ei=Object.defineProperty,Qr=Object.getOwnPropertyDescriptor,Jr=(i,e,t)=>e in i?ei(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,es=(i,e,t,r)=>{for(var n=r>1?void 0:r?Qr(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ei(e,t,n),n},ut=(i,e)=>(t,r)=>e(t,r,i),ts=(i,e,t)=>Jr(i,e+"",t);let ge=class{constructor(i,e,t,r){y(this,"enabled",!0);y(this,"instance");this.worldComponent=i,this.cameraComponent=e,this.sizesComponent=t,this.debugComponent=r}init(i){this.instance=new f.WebGLRenderer({canvas:i,context:i.getContext("webgl2",{stencil:!0,powerPreference:"high-performance"}),powerPreference:"high-performance",depth:!0,antialias:!0}),this.instance.autoClear=!1,this.instance.setPixelRatio(ge.RENDERER_PIXEL_RATIO),this.instance.setClearColor(0,0),this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=f.PCFSoftShadowMap,this.instance.outputColorSpace=f.SRGBColorSpace,this.instance.toneMapping=f.CineonToneMapping,this.instance.toneMappingExposure=1.75}setSize(i,e){var t;(t=this.instance)==null||t.setSize(i,e)}render(){this.enabled&&this.cameraComponent.instance instanceof f.Camera&&this.instance instanceof f.WebGLRenderer&&(this.instance.setViewport(0,0,this.sizesComponent.width,this.sizesComponent.height),this.instance.render(this.worldComponent.scene,this.cameraComponent.instance),this.debugComponent.enabled&&this.cameraComponent.miniCamera&&(this.instance.setScissorTest(!0),this.instance.setViewport(this.sizesComponent.width-this.sizesComponent.width/3,this.sizesComponent.height-this.sizesComponent.height/3,this.sizesComponent.width/3,this.sizesComponent.height/3),this.instance.setScissor(this.sizesComponent.width-this.sizesComponent.width/3,this.sizesComponent.height-this.sizesComponent.height/3,this.sizesComponent.width/3,this.sizesComponent.height/3),this.instance.render(this.worldComponent.scene,this.cameraComponent.miniCamera),this.instance.setScissorTest(!1)))}};ts(ge,"RENDERER_PIXEL_RATIO",1),ge=es([V(),ut(0,I($e)),ut(1,I(Re)),ut(2,I(me)),ut(3,I(ct))],ge);var ht=(i=>(i[i.INITIALIZED=0]="INITIALIZED",i[i.DISPOSED=1]="DISPOSED",i))(ht||{}),ue=(i=>(i[i.INITIALIZED=0]="INITIALIZED",i[i.STEP_STARTED=1]="STEP_STARTED",i[i.STEP_ENDED=2]="STEP_ENDED",i[i.DISPOSED=3]="DISPOSED",i))(ue||{}),ns=Object.defineProperty,is=Object.getOwnPropertyDescriptor,rs=(i,e,t,r)=>{for(var n=r>1?void 0:r?is(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ns(e,t,n),n},ti=(i,e)=>(t,r)=>e(t,r,i);let Se=class{constructor(i,e){y(this,"step$$",new B.Subject);y(this,"enable$$",new B.Subject);y(this,"step$",this.step$$.pipe());y(this,"enable$",this.enable$$.pipe());this.component=i,this.appController=e}step(){this.appController.lifecycle$$.next(ue.STEP_STARTED),this.component.enabled&&(this.component.delta=this.component.clock.getDelta()??this.component.frame,this.component.deltaRatio=this.component.delta*1e3/this.component.frame,this.step$$.next({delta:this.component.delta,deltaRatio:this.component.deltaRatio})),this.appController.lifecycle$$.next(ue.STEP_ENDED)}};Se=rs([V(),ti(0,I(at)),ti(1,I(De))],Se);var ss=Object.defineProperty,os=Object.getOwnPropertyDescriptor,as=(i,e,t,r)=>{for(var n=r>1?void 0:r?os(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ss(e,t,n),n},Nt=(i,e)=>(t,r)=>e(t,r,i);let jt=class{constructor(i,e,t){this.component=i,this.controller=e,this.rendererComponent=t}init(i){this.controller.enable$.subscribe(e=>{var t,r;this.component.enabled=!!e,e?(t=this.rendererComponent.instance)==null||t.setAnimationLoop(this.controller.step.bind(this.controller)):(r=this.rendererComponent.instance)==null||r.setAnimationLoop(null)}),i&&this.enabled(!0)}clock(){return this.component.clock}frame(){return this.component.frame}delta(i){return typeof i=="number"&&(this.component.delta=i),this.component.delta}deltaRatio(i){return typeof i=="number"&&(this.component.deltaRatio=i),this.component.deltaRatio}enabled(i){return typeof i=="boolean"&&this.controller.enable$$.next(i),this.component.enabled}dispose(){this.controller.step$$.complete(),this.controller.enable$$.complete()}enabled$(){return this.controller.enable$}step$(){return this.controller.step$}};jt=as([V(),Nt(0,I(at)),Nt(1,I(Se)),Nt(2,I(ge))],jt);var ls=Object.defineProperty,cs=Object.getOwnPropertyDescriptor,us=(i,e,t,r)=>{for(var n=r>1?void 0:r?cs(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ls(e,t,n),n},ni=(i,e)=>(t,r)=>e(t,r,i);let Ht=class{constructor(i,e){y(this,"enable$$",new B.Subject);y(this,"enable$",this.enable$$.pipe());y(this,"step$");this.component=i,this.timerController=e,this.step$=this.timerController.step$.pipe(B.filter(()=>this.component.enabled))}};Ht=us([V(),ni(0,I(Re)),ni(1,I(Se))],Ht);var hs=Object.defineProperty,ds=Object.getOwnPropertyDescriptor,ps=(i,e,t,r)=>{for(var n=r>1?void 0:r?ds(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&hs(e,t,n),n},Ft=(i,e)=>(t,r)=>e(t,r,i);let Gt=class{constructor(i,e,t){this.component=i,this.sizesComponent=e,this.controller=t}init(i){this.component.initDefaultCamera(),i&&this.component.setMiniCamera(),this.controller.enable$.subscribe(e=>{this.component.enabled=!!e}),this.controller.step$.subscribe(()=>{var e,t;this.component.enabled&&(this.component.aspectRatio=this.sizesComponent.aspect,(this.component.instance instanceof f.PerspectiveCamera||this.component.instance instanceof f.OrthographicCamera)&&((e=this.component.instance)==null||e.updateProjectionMatrix()),(t=this.component.miniCamera)==null||t.updateProjectionMatrix())})}dispose(){this.component.removeCamera(),this.component.removeMiniCamera()}aspectRatio(i){return i&&(this.component.aspectRatio=i),this.component.aspectRatio}enabled(i){return typeof i=="boolean"&&this.controller.enable$$.next(i),this.component.enabled}instance(i){return i&&(this.component.instance=i),this.component.instance}miniCamera(i){return i&&(this.component.miniCamera=i),this.component.miniCamera}position(i){return i&&(this.component.position=i),this.component.position}quaternion(i){return i&&(this.component.quaternion=i),this.component.quaternion}enabled$(){return this.controller.enable$}};Gt=ps([V(),Ft(0,I(Re)),Ft(1,I(me)),Ft(2,I(Ht))],Gt);var fs=Object.defineProperty,ms=Object.getOwnPropertyDescriptor,gs=(i,e,t,r)=>{for(var n=r>1?void 0:r?ms(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&fs(e,t,n),n},ii=(i,e)=>(t,r)=>e(t,r,i);let dt=class{constructor(i,e){y(this,"enable$$",new B.Subject);y(this,"enable$",this.enable$$.pipe());y(this,"resize$");this.appController=i,this.component=e,this.resize$=this.appController.resize$$.pipe(B.filter(()=>this.component.enabled))}};dt=gs([V(),ii(0,I(De)),ii(1,I(me))],dt);var ys=Object.defineProperty,_s=Object.getOwnPropertyDescriptor,vs=(i,e,t,r)=>{for(var n=r>1?void 0:r?_s(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ys(e,t,n),n},Ut=(i,e)=>(t,r)=>e(t,r,i);let Bt=class{constructor(i,e,t){y(this,"enable$$",new B.Subject);y(this,"enable$",this.enable$$.pipe());y(this,"step$");y(this,"resize$");this.rendererComponent=i,this.timerController=e,this.sizesController=t,this.step$=this.timerController.step$.pipe(B.filter(()=>this.rendererComponent.enabled)),this.resize$=this.sizesController.resize$.pipe(B.filter(()=>this.rendererComponent.enabled))}};Bt=vs([V(),Ut(0,I(ge)),Ut(1,I(Se)),Ut(2,I(dt))],Bt);var ws=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,As=(i,e,t,r)=>{for(var n=r>1?void 0:r?bs(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ws(e,t,n),n},ri=(i,e)=>(t,r)=>e(t,r,i);let zt=class{constructor(i,e){this.component=i,this.controller=e}init(i){this.controller.enable$.subscribe(e=>{this.component.enabled=!!e}),this.controller.step$.subscribe(()=>this.component.render()),this.controller.resize$.subscribe(e=>this.component.setSize(e.windowWidth,e.windowHeight)),this.component.init(i)}dispose(){this.controller.enable$$.unsubscribe()}enabled(i){return typeof i=="boolean"&&this.controller.enable$$.next(i),this.component.enabled}instance(){return this.component.instance}setSize(i){return this.component.setSize(i.x,i.y)}render(){return this.component.render()}enabled$(){return this.controller.enable$}};zt=As([V(),ri(0,I(ge)),ri(1,I(Bt))],zt);var Es=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Cs=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ts(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Es(e,t,n),n},si=(i,e)=>(t,r)=>e(t,r,i);let Vt=class{constructor(i,e){this.component=i,this.controller=e}init(i){this.controller.enable$.subscribe(e=>{this.component.enabled=!!e}),this.controller.resize$.subscribe(e=>{this.component.width=e.windowWidth,this.component.height=e.windowHeight,this.component.aspect=e.windowWidth/e.windowHeight}),this.component.init(i)}dispose(){}aspect(i){return typeof i=="number"&&(this.component.aspect=i),this.component.aspect}enabled(i){return typeof i=="boolean"&&this.controller.enable$$.next(i),this.component.enabled}frustrum(i){return typeof i=="number"&&(this.component.frustrum=i),this.component.frustrum}height(i){return typeof i=="number"&&(this.component.height=i),this.component.height}pixelRatio(i){return typeof i=="number"&&(this.component.pixelRatio=i),this.component.pixelRatio}width(i){return typeof i=="number"&&(this.component.width=i),this.component.width}enabled$(){return this.controller.enable$}resize$(){return this.controller.resize$}};Vt=Cs([V(),si(0,I(me)),si(1,I(dt))],Vt);var xs=Object.defineProperty,Rs=Object.getOwnPropertyDescriptor,Ss=(i,e,t,r)=>{for(var n=r>1?void 0:r?Rs(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&xs(e,t,n),n};let Kt=class{constructor(){y(this,"enable$$",new B.Subject);y(this,"enable$",this.enable$$.pipe())}};Kt=Ss([V()],Kt);var Ms=Object.defineProperty,Ps=Object.getOwnPropertyDescriptor,Os=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ps(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Ms(e,t,n),n},oi=(i,e)=>(t,r)=>e(t,r,i);let Wt=class{constructor(i,e){this.component=i,this.controller=e}init(){this.controller.enable$.subscribe(i=>{this.component.enabled=!!i})}dispose(){}scene(i){return i instanceof f.Scene&&(this.component.scene=i),this.component.scene}enabled(i){return typeof i=="boolean"&&this.controller.enable$$.next(i),this.component.enabled}get enable$(){return this.controller.enable$}};Wt=Os([V(),oi(0,I($e)),oi(1,I(Kt))],Wt);var Ls=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor,$s=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ds(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Ls(e,t,n),n},Is=(i,e)=>(t,r)=>e(t,r,i);let Yt=class{constructor(i){y(this,"enable$$",new B.Subject);y(this,"enable$",this.enable$$.pipe());y(this,"step$");this.timerController=i,this.step$=this.timerController.step$}};Yt=$s([V(),Is(0,I(Se))],Yt);var ks=Object.defineProperty,Ns=Object.getOwnPropertyDescriptor,js=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ns(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&ks(e,t,n),n},ai=(i,e)=>(t,r)=>e(t,r,i);let Xt=class{constructor(i,e){this.component=i,this.controller=e,this.controller.step$.subscribe(()=>{this.component.update()})}init(i){this.component.init(i)}dispose(){this.component.dispose()}axesHelper(){return this.component.axesHelper}cameraControls(){return this.component.cameraControls}cameraHelper(){return this.component.cameraHelper}enabled(i){return i&&(this.component.enabled=i),this.component.enabled}gridHelper(){return this.component.gridHelper}miniCameraControls(){return this.component.miniCameraControls}enabled$(){return this.controller.enable$}};Xt=js([V(),ai(0,I(ct)),ai(1,I(Yt))],Xt);class li{constructor(){y(this,"contextmenu$");y(this,"resize$");y(this,"mousedown$");y(this,"mousemove$");y(this,"mouseup$");y(this,"pointerdown$");y(this,"pointermove$");y(this,"pointercancel$");y(this,"pointerup$");y(this,"touchstart$");y(this,"touchmove$");y(this,"touchend$");y(this,"wheel$");y(this,"keydown$");y(this,"contextmenu");y(this,"resize");y(this,"mousedown");y(this,"mousemove");y(this,"mouseup");y(this,"pointerdown");y(this,"pointermove");y(this,"pointercancel");y(this,"pointerup");y(this,"touchstart");y(this,"touchmove");y(this,"touchend");y(this,"wheel");y(this,"keydown")}}var Hs=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Gs=(i,e,t,r)=>{for(var n=r>1?void 0:r?Fs(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Hs(e,t,n),n},he=(i,e)=>(t,r)=>e(t,r,i);N.AppModule=class extends li{constructor(e,t,r,n,s,o,a,l){super(),this.controller=e,this.component=t,this.timer=r,this.sizes=n,this.camera=s,this.world=o,this.renderer=a,this.debug=l,this._initProxyEvents(),typeof self<"u"&&self.addEventListener("message",this._onMessage.bind(this))}_initProxyEvents(){Le.forEach(e=>{this[`${e}$`]=()=>{var t;return(t=this.controller)==null?void 0:t[`${e}$`]},this[e]=t=>{var r,n;return(n=(r=this.controller)==null?void 0:r[e])==null?void 0:n.call(r,t)}})}_onMessage(e){var s,o,a,l;if(!((s=e.data)!=null&&s.canvas)||this.component.initialized)return;const t=!!((o=e.data)!=null&&o.startTimer),r=!!((a=e.data)!=null&&a.withMiniCamera),n=!!((l=e.data)!=null&&l.fullScreen);this.init({...e.data,startTimer:t,withMiniCamera:r,fullScreen:n})}init(e){if(!e.canvas||this.component.initialized)return;this.component.initialized=!0,e.canvas.style={width:e.canvas.width+"",height:e.canvas.height+""};const t=e.canvas;this.component.canvas=t,this.sizes.init(t),this.camera.init(e.withMiniCamera),this.world.init(),this.renderer.init(t),this.timer.init(e.startTimer),this.debug.init(e),this.controller.lifecycle$$.next(ue.INITIALIZED)}get canvas(){return this.component.canvas}get initialized(){return this.component.initialized}isInitialized(){return this.component.initialized}dispose(){this.sizes.dispose(),this.camera.dispose(),this.world.dispose(),this.renderer.dispose(),this.timer.dispose(),this.debug.dispose(),this.controller.lifecycle$$.next(ue.DISPOSED),this.controller.lifecycle$$.complete(),typeof self<"u"&&self.removeEventListener("message",this._onMessage.bind(this))}lifecycle$(){return this.controller.lifecycle$}},N.AppModule=Gs([V(),he(0,I(De)),he(1,I(Oe)),he(2,I(jt)),he(3,I(Vt)),he(4,I(Gt)),he(5,I(Wt)),he(6,I(zt)),he(7,I(Xt))],N.AppModule);const Us=Te.resolve(N.AppModule),qt=new WeakMap;class Bs extends f.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,n){const s=new f.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{this.parse(o,t,n)},r,n)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,f.SRGBColorSpace,r).catch(r)}decodeDracoFile(e,t,r,n,s=f.LinearSRGBColorSpace,o=()=>{}){const a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){const r=JSON.stringify(t);if(qt.has(e)){const l=qt.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(n=l,new Promise((c,d)=>{n._callbacks[s]={resolve:c,reject:d},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{n&&s&&this._releaseTask(n,s)}),qt.set(e,{key:r,promise:a}),a}_createGeometry(e){const t=new f.BufferGeometry;e.index&&t.setIndex(new f.BufferAttribute(e.index.array,1));for(let r=0;r<e.attributes.length;r++){const n=e.attributes[r],s=n.name,o=n.array,a=n.itemSize,l=new f.BufferAttribute(o,a);s==="color"&&(this._assignVertexColorSpace(l,n.vertexColorSpace),l.normalized=!(o instanceof Float32Array)),t.setAttribute(s,l)}return t}_assignVertexColorSpace(e,t){if(t!==f.SRGBColorSpace)return;const r=new f.Color;for(let n=0,s=e.count;n<s;n++)r.fromBufferAttribute(e,n),f.ColorManagement.toWorkingColorSpace(r,f.SRGBColorSpace),e.setXYZ(n,r.r,r.g,r.b)}_loadLibrary(e,t){const r=new f.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((n,s)=>{r.load(e,n,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(r=>{const n=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const s=zs.toString(),o=["/* draco decoder */",n,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
58
- `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(s){const o=s.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,s){return n._taskLoad>s._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function zs(){let i,e;onmessage=function(o){const a=o.data;switch(a.type){case"init":i=a.decoderConfig,e=new Promise(function(d){i.onModuleLoaded=function(m){d({draco:m})},DracoDecoderModule(i)});break;case"decode":const l=a.buffer,c=a.taskConfig;e.then(d=>{const m=d.draco,g=new m.Decoder;try{const A=t(m,g,new Int8Array(l),c),x=A.attributes.map(O=>O.array.buffer);A.index&&x.push(A.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:A},x)}catch(A){console.error(A),self.postMessage({type:"error",id:a.id,error:A.message})}finally{m.destroy(g)}});break}};function t(o,a,l,c){const d=c.attributeIDs,m=c.attributeTypes;let g,A;const x=a.GetEncodedGeometryType(l);if(x===o.TRIANGULAR_MESH)g=new o.Mesh,A=a.DecodeArrayToMesh(l,l.byteLength,g);else if(x===o.POINT_CLOUD)g=new o.PointCloud,A=a.DecodeArrayToPointCloud(l,l.byteLength,g);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!A.ok()||g.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+A.error_msg());const O={index:null,attributes:[]};for(const R in d){const P=self[m[R]];let $,D;if(c.useUniqueIDs)D=d[R],$=a.GetAttributeByUniqueId(g,D);else{if(D=a.GetAttributeId(g,o[d[R]]),D===-1)continue;$=a.GetAttribute(g,D)}const j=n(o,a,g,R,P,$);R==="color"&&(j.vertexColorSpace=c.vertexColorSpace),O.attributes.push(j)}return x===o.TRIANGULAR_MESH&&(O.index=r(o,a,g)),o.destroy(g),O}function r(o,a,l){const d=l.num_faces()*3,m=d*4,g=o._malloc(m);a.GetTrianglesUInt32Array(l,m,g);const A=new Uint32Array(o.HEAPF32.buffer,g,d).slice();return o._free(g),{array:A,itemSize:1}}function n(o,a,l,c,d,m){const g=m.num_components(),x=l.num_points()*g,O=x*d.BYTES_PER_ELEMENT,R=s(o,d),P=o._malloc(O);a.GetAttributeDataArrayForAllPoints(l,m,R,O,P);const $=new d(o.HEAPF32.buffer,P,x).slice();return o._free(P),{name:c,array:$,itemSize:g}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var Vs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Ws=(i,e,t,r)=>{for(var n=r>1?void 0:r?Ks(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Vs(e,t,n),n};let Zt=class{constructor(){y(this,"lifecycle$$",new B.Subject);y(this,"progress$$",new B.Subject);y(this,"progress$",this.progress$$.pipe());y(this,"lifecycle$",this.lifecycle$$.pipe());y(this,"progressCompleted$",this.progress$.pipe(B.filter(i=>i.toLoad===i.loaded)))}};Zt=Ws([At(X.ResolutionScoped)],Zt);function ci(i,e){if(e===f.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===f.TriangleFanDrawMode||e===f.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const o=[],a=i.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);i.setIndex(o),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const r=t.count-2,n=[];if(e===f.TriangleFanDrawMode)for(let o=1;o<=r;o++)n.push(t.getX(0)),n.push(t.getX(o)),n.push(t.getX(o+1));else for(let o=0;o<r;o++)o%2===0?(n.push(t.getX(o)),n.push(t.getX(o+1)),n.push(t.getX(o+2))):(n.push(t.getX(o+2)),n.push(t.getX(o+1)),n.push(t.getX(o)));n.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=i.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Ys extends f.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Js(t)}),this.register(function(t){return new eo(t)}),this.register(function(t){return new co(t)}),this.register(function(t){return new uo(t)}),this.register(function(t){return new ho(t)}),this.register(function(t){return new no(t)}),this.register(function(t){return new io(t)}),this.register(function(t){return new ro(t)}),this.register(function(t){return new so(t)}),this.register(function(t){return new Qs(t)}),this.register(function(t){return new oo(t)}),this.register(function(t){return new to(t)}),this.register(function(t){return new lo(t)}),this.register(function(t){return new ao(t)}),this.register(function(t){return new qs(t)}),this.register(function(t){return new po(t)}),this.register(function(t){return new fo(t)})}load(e,t,r,n){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const c=f.LoaderUtils.extractUrlBase(e);o=f.LoaderUtils.resolveURL(c,this.path)}else o=f.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const a=function(c){n?n(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new f.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(d){t(d),s.manager.itemEnd(e)},a)}catch(d){a(d)}},r,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){let s;const o={},a={},l=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===ui){try{o[G.KHR_BINARY_GLTF]=new mo(e)}catch(m){n&&n(m);return}s=JSON.parse(o[G.KHR_BINARY_GLTF].content)}else s=JSON.parse(l.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new So(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const m=this.pluginCallbacks[d](c);m.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[m.name]=m,o[m.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const m=s.extensionsUsed[d],g=s.extensionsRequired||[];switch(m){case G.KHR_MATERIALS_UNLIT:o[m]=new Zs;break;case G.KHR_DRACO_MESH_COMPRESSION:o[m]=new go(s,this.dracoLoader);break;case G.KHR_TEXTURE_TRANSFORM:o[m]=new yo;break;case G.KHR_MESH_QUANTIZATION:o[m]=new _o;break;default:g.indexOf(m)>=0&&a[m]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(r,n)}parseAsync(e,t){const r=this;return new Promise(function(n,s){r.parse(e,t,n,s)})}}function Xs(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const G={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class qs{constructor(e){this.parser=e,this.name=G.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){const s=t[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let n=t.cache.get(r);if(n)return n;const s=t.json,l=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const d=new f.Color(16777215);l.color!==void 0&&d.setRGB(l.color[0],l.color[1],l.color[2],f.LinearSRGBColorSpace);const m=l.range!==void 0?l.range:0;switch(l.type){case"directional":c=new f.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new f.PointLight(d),c.distance=m;break;case"spot":c=new f.SpotLight(d),c.distance=m,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,c.angle=l.spot.outerConeAngle,c.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return c.position.set(0,0,0),c.decay=2,ae(c,l),l.intensity!==void 0&&(c.intensity=l.intensity),c.name=t.createUniqueName(l.name||"light_"+e),n=Promise.resolve(c),t.cache.add(r,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,s=r.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return r._getNodeRef(t.cache,a,l)})}}class Zs{constructor(){this.name=G.KHR_MATERIALS_UNLIT}getMaterialType(){return f.MeshBasicMaterial}extendParams(e,t,r){const n=[];e.color=new f.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],f.LinearSRGBColorSpace),e.opacity=o[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(e,"map",s.baseColorTexture,f.SRGBColorSpace))}return Promise.all(n)}}class Qs{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class Js{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new f.Vector2(a,a)}return Promise.all(s)}}class eo{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class to{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class no{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new f.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(r.assignTexture(t,"sheenColorMap",o.sheenColorTexture,f.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class io{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(r.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class ro{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(r.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),Promise.all(s)}}class so{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class oo{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(r.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&s.push(r.assignTexture(t,"specularColorMap",o.specularColorTexture,f.SRGBColorSpace)),Promise.all(s)}}class ao{constructor(e){this.parser=e,this.name=G.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(r.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class lo{constructor(e){this.parser=e,this.name=G.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(r.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class co{constructor(e){this.parser=e,this.name=G.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class uo{constructor(e){this.parser=e,this.name=G.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=n.images[o.source];let l=r.textureLoader;if(a.uri){const c=r.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(e,o.source,l);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class ho{constructor(e){this.parser=e,this.name=G.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=n.images[o.source];let l=r.textureLoader;if(a.uri){const c=r.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(e,o.source,l);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class po{constructor(e){this.name=G.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const n=r.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=n.byteOffset||0,c=n.byteLength||0,d=n.count,m=n.byteStride,g=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,m,g,n.mode,n.filter).then(function(A){return A.buffer}):o.ready.then(function(){const A=new ArrayBuffer(d*m);return o.decodeGltfBuffer(new Uint8Array(A),d,m,g,n.mode,n.filter),A})})}else return null}}class fo{constructor(e){this.name=G.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const n=t.meshes[r.mesh];for(const c of n.primitives)if(c.mode!==ne.TRIANGLES&&c.mode!==ne.TRIANGLE_STRIP&&c.mode!==ne.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=r.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(d=>(l[c]=d,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const d=c.pop(),m=d.isGroup?d.children:[d],g=c[0].count,A=[];for(const x of m){const O=new f.Matrix4,R=new f.Vector3,P=new f.Quaternion,$=new f.Vector3(1,1,1),D=new f.InstancedMesh(x.geometry,x.material,g);for(let j=0;j<g;j++)l.TRANSLATION&&R.fromBufferAttribute(l.TRANSLATION,j),l.ROTATION&&P.fromBufferAttribute(l.ROTATION,j),l.SCALE&&$.fromBufferAttribute(l.SCALE,j),D.setMatrixAt(j,O.compose(R,P,$));for(const j in l)if(j==="_COLOR_0"){const q=l[j];D.instanceColor=new f.InstancedBufferAttribute(q.array,q.itemSize,q.normalized)}else j!=="TRANSLATION"&&j!=="ROTATION"&&j!=="SCALE"&&x.geometry.setAttribute(j,l[j]);f.Object3D.prototype.copy.call(D,x),this.parser.assignFinalMaterial(D),A.push(D)}return d.isGroup?(d.clear(),d.add(...A),d):A[0]}))}}const ui="glTF",Ie=12,hi={JSON:1313821514,BIN:5130562};class mo{constructor(e){this.name=G.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Ie),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ui)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-Ie,s=new DataView(e,Ie);let o=0;for(;o<n;){const a=s.getUint32(o,!0);o+=4;const l=s.getUint32(o,!0);if(o+=4,l===hi.JSON){const c=new Uint8Array(e,Ie+o,a);this.content=r.decode(c)}else if(l===hi.BIN){const c=Ie+o;this.body=e.slice(c,c+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class go{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=G.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,n=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},c={};for(const d in o){const m=Jt[d]||d.toLowerCase();a[m]=o[d]}for(const d in e.attributes){const m=Jt[d]||d.toLowerCase();if(o[d]!==void 0){const g=r.accessors[e.attributes[d]],A=Me[g.componentType];c[m]=A.name,l[m]=g.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(m,g){n.decodeDracoFile(d,function(A){for(const x in A.attributes){const O=A.attributes[x],R=l[x];R!==void 0&&(O.normalized=R)}m(A)},a,c,f.LinearSRGBColorSpace,g)})})}}class yo{constructor(){this.name=G.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class _o{constructor(){this.name=G.KHR_MESH_QUANTIZATION}}class di extends f.Interpolant{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=e*n*3+n;for(let o=0;o!==n;o++)t[o]=r[s+o];return t}interpolate_(e,t,r,n){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,c=a*3,d=n-t,m=(r-t)/d,g=m*m,A=g*m,x=e*c,O=x-c,R=-2*A+3*g,P=A-g,$=1-R,D=P-g+m;for(let j=0;j!==a;j++){const q=o[O+j+a],ie=o[O+j+l]*d,Z=o[x+j+a],le=o[x+j]*d;s[j]=$*q+D*ie+R*Z+P*le}return s}}const vo=new f.Quaternion;class wo extends di{interpolate_(e,t,r,n){const s=super.interpolate_(e,t,r,n);return vo.fromArray(s).normalize().toArray(s),s}}const ne={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Me={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},pi={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},fi={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},Qt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Jt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},de={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},bo={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},en={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Ao(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new f.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:f.FrontSide})),i.DefaultMaterial}function ye(i,e,t){for(const r in t.extensions)i[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function ae(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Eo(i,e,t){let r=!1,n=!1,s=!1;for(let c=0,d=e.length;c<d;c++){const m=e[c];if(m.POSITION!==void 0&&(r=!0),m.NORMAL!==void 0&&(n=!0),m.COLOR_0!==void 0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(i);const o=[],a=[],l=[];for(let c=0,d=e.length;c<d;c++){const m=e[c];if(r){const g=m.POSITION!==void 0?t.getDependency("accessor",m.POSITION):i.attributes.position;o.push(g)}if(n){const g=m.NORMAL!==void 0?t.getDependency("accessor",m.NORMAL):i.attributes.normal;a.push(g)}if(s){const g=m.COLOR_0!==void 0?t.getDependency("accessor",m.COLOR_0):i.attributes.color;l.push(g)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(c){const d=c[0],m=c[1],g=c[2];return r&&(i.morphAttributes.position=d),n&&(i.morphAttributes.normal=m),s&&(i.morphAttributes.color=g),i.morphTargetsRelative=!0,i})}function To(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,r=e.weights.length;t<r;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let r=0,n=t.length;r<n;r++)i.morphTargetDictionary[t[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Co(i){let e;const t=i.extensions&&i.extensions[G.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+tn(t.attributes):e=i.indices+":"+tn(i.attributes)+":"+i.mode,i.targets!==void 0)for(let r=0,n=i.targets.length;r<n;r++)e+=":"+tn(i.targets[r]);return e}function tn(i){let e="";const t=Object.keys(i).sort();for(let r=0,n=t.length;r<n;r++)e+=t[r]+":"+i[t[r]]+";";return e}function nn(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function xo(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const Ro=new f.Matrix4;class So{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Xs,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=-1,s=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);n=r&&l?parseInt(l[1],10):-1,s=a.indexOf("Firefox")>-1,o=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&n<17||s&&o<98?this.textureLoader=new f.TextureLoader(this.options.manager):this.textureLoader=new f.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new f.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(o){const a={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:r,userData:{}};return ye(s,a,n),ae(a,n),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let n=0,s=t.length;n<s;n++){const o=t[n].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let n=0,s=e.length;n<s;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(r[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const n=r.clone(),s=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,d]of o.children.entries())s(d,a.children[c])};return s(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const n=e(t[r]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let n=0;n<t.length;n++){const s=e(t[n]);s&&r.push(s)}return r}getDependency(e,t){const r=e+":"+t;let n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(s,o){return r.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[G.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,o){r.load(f.LoaderUtils.resolveURL(t.uri,n.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(r){const n=t.byteLength||0,s=t.byteOffset||0;return r.slice(s,s+n)})}loadAccessor(e){const t=this,r=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=Qt[n.type],a=Me[n.componentType],l=n.normalized===!0,c=new a(n.count*o);return Promise.resolve(new f.BufferAttribute(c,o,l))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],l=Qt[n.type],c=Me[n.componentType],d=c.BYTES_PER_ELEMENT,m=d*l,g=n.byteOffset||0,A=n.bufferView!==void 0?r.bufferViews[n.bufferView].byteStride:void 0,x=n.normalized===!0;let O,R;if(A&&A!==m){const P=Math.floor(g/A),$="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+P+":"+n.count;let D=t.cache.get($);D||(O=new c(a,P*A,n.count*A/d),D=new f.InterleavedBuffer(O,A/d),t.cache.add($,D)),R=new f.InterleavedBufferAttribute(D,l,g%A/d,x)}else a===null?O=new c(n.count*l):O=new c(a,g,n.count*l),R=new f.BufferAttribute(O,l,x);if(n.sparse!==void 0){const P=Qt.SCALAR,$=Me[n.sparse.indices.componentType],D=n.sparse.indices.byteOffset||0,j=n.sparse.values.byteOffset||0,q=new $(o[1],D,n.sparse.count*P),ie=new c(o[2],j,n.sparse.count*l);a!==null&&(R=new f.BufferAttribute(R.array.slice(),R.itemSize,R.normalized)),R.normalized=!1;for(let Z=0,le=q.length;Z<le;Z++){const re=q[Z];if(R.setX(re,ie[Z*l]),l>=2&&R.setY(re,ie[Z*l+1]),l>=3&&R.setZ(re,ie[Z*l+2]),l>=4&&R.setW(re,ie[Z*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}R.normalized=x}return R})}loadTexture(e){const t=this.json,r=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=r.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,r){const n=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,r).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const g=(s.samplers||{})[o.sampler]||{};return d.magFilter=pi[g.magFilter]||f.LinearFilter,d.minFilter=pi[g.minFilter]||f.LinearMipmapLinearFilter,d.wrapS=fi[g.wrapS]||f.RepeatWrapping,d.wrapT=fi[g.wrapT]||f.RepeatWrapping,n.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const r=this,n=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(m=>m.clone());const o=n.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=r.getDependency("bufferView",o.bufferView).then(function(m){c=!0;const g=new Blob([m],{type:o.mimeType});return l=a.createObjectURL(g),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(m){return new Promise(function(g,A){let x=g;t.isImageBitmapLoader===!0&&(x=function(O){const R=new f.Texture(O);R.needsUpdate=!0,g(R)}),t.load(f.LoaderUtils.resolveURL(m,s.path),x,void 0,A)})}).then(function(m){return c===!0&&a.revokeObjectURL(l),ae(m,o),m.userData.mimeType=o.mimeType||xo(o.uri),m}).catch(function(m){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),m});return this.sourceCache[e]=d,d}assignTexture(e,t,r,n){const s=this;return this.getDependency("texture",r.index).then(function(o){if(!o)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(o=o.clone(),o.channel=r.texCoord),s.extensions[G.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[G.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[G.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const n=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new f.PointsMaterial,f.Material.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(a,l)),r=l}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new f.LineBasicMaterial,f.Material.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(a,l)),r=l}if(n||s||o){let a="ClonedMaterial:"+r.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=r.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),n&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return f.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,n=this.extensions,s=r.materials[e];let o;const a={},l=s.extensions||{},c=[];if(l[G.KHR_MATERIALS_UNLIT]){const m=n[G.KHR_MATERIALS_UNLIT];o=m.getMaterialType(),c.push(m.extendParams(a,s,t))}else{const m=s.pbrMetallicRoughness||{};if(a.color=new f.Color(1,1,1),a.opacity=1,Array.isArray(m.baseColorFactor)){const g=m.baseColorFactor;a.color.setRGB(g[0],g[1],g[2],f.LinearSRGBColorSpace),a.opacity=g[3]}m.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",m.baseColorTexture,f.SRGBColorSpace)),a.metalness=m.metallicFactor!==void 0?m.metallicFactor:1,a.roughness=m.roughnessFactor!==void 0?m.roughnessFactor:1,m.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",m.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",m.metallicRoughnessTexture))),o=this._invokeOne(function(g){return g.getMaterialType&&g.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(g){return g.extendMaterialParams&&g.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=f.DoubleSide);const d=s.alphaMode||en.OPAQUE;if(d===en.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===en.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==f.MeshBasicMaterial&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new f.Vector2(1,1),s.normalTexture.scale!==void 0)){const m=s.normalTexture.scale;a.normalScale.set(m,m)}if(s.occlusionTexture!==void 0&&o!==f.MeshBasicMaterial&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==f.MeshBasicMaterial){const m=s.emissiveFactor;a.emissive=new f.Color().setRGB(m[0],m[1],m[2],f.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&o!==f.MeshBasicMaterial&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,f.SRGBColorSpace)),Promise.all(c).then(function(){const m=new o(a);return s.name&&(m.name=s.name),ae(m,s),t.associations.set(m,{materials:e}),s.extensions&&ye(n,m,s),m})}createUniqueName(e){const t=f.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,n=this.primitiveCache;function s(a){return r[G.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return mi(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const c=e[a],d=Co(c),m=n[d];if(m)o.push(m.promise);else{let g;c.extensions&&c.extensions[G.KHR_DRACO_MESH_COMPRESSION]?g=s(c):g=mi(new f.BufferGeometry,c,t),n[d]={primitive:c,promise:g},o.push(g)}}return Promise.all(o)}loadMesh(e){const t=this,r=this.json,n=this.extensions,s=r.meshes[e],o=s.primitives,a=[];for(let l=0,c=o.length;l<c;l++){const d=o[l].material===void 0?Ao(this.cache):this.getDependency("material",o[l].material);a.push(d)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const c=l.slice(0,l.length-1),d=l[l.length-1],m=[];for(let A=0,x=d.length;A<x;A++){const O=d[A],R=o[A];let P;const $=c[A];if(R.mode===ne.TRIANGLES||R.mode===ne.TRIANGLE_STRIP||R.mode===ne.TRIANGLE_FAN||R.mode===void 0)P=s.isSkinnedMesh===!0?new f.SkinnedMesh(O,$):new f.Mesh(O,$),P.isSkinnedMesh===!0&&P.normalizeSkinWeights(),R.mode===ne.TRIANGLE_STRIP?P.geometry=ci(P.geometry,f.TriangleStripDrawMode):R.mode===ne.TRIANGLE_FAN&&(P.geometry=ci(P.geometry,f.TriangleFanDrawMode));else if(R.mode===ne.LINES)P=new f.LineSegments(O,$);else if(R.mode===ne.LINE_STRIP)P=new f.Line(O,$);else if(R.mode===ne.LINE_LOOP)P=new f.LineLoop(O,$);else if(R.mode===ne.POINTS)P=new f.Points(O,$);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(P.geometry.morphAttributes).length>0&&To(P,s),P.name=t.createUniqueName(s.name||"mesh_"+e),ae(P,s),R.extensions&&ye(n,P,R),t.assignFinalMaterial(P),m.push(P)}for(let A=0,x=m.length;A<x;A++)t.associations.set(m[A],{meshes:e,primitives:A});if(m.length===1)return s.extensions&&ye(n,m[0],s),m[0];const g=new f.Group;s.extensions&&ye(n,g,s),t.associations.set(g,{meshes:e});for(let A=0,x=m.length;A<x;A++)g.add(m[A]);return g})}loadCamera(e){let t;const r=this.json.cameras[e],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?t=new f.PerspectiveCamera(f.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(t=new f.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),ae(t,r),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],r=[];for(let n=0,s=t.joints.length;n<s;n++)r.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(n){const s=n.pop(),o=n,a=[],l=[];for(let c=0,d=o.length;c<d;c++){const m=o[c];if(m){a.push(m);const g=new f.Matrix4;s!==null&&g.fromArray(s.array,c*16),l.push(g)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new f.Skeleton(a,l)})}loadAnimation(e){const t=this.json,r=this,n=t.animations[e],s=n.name?n.name:"animation_"+e,o=[],a=[],l=[],c=[],d=[];for(let m=0,g=n.channels.length;m<g;m++){const A=n.channels[m],x=n.samplers[A.sampler],O=A.target,R=O.node,P=n.parameters!==void 0?n.parameters[x.input]:x.input,$=n.parameters!==void 0?n.parameters[x.output]:x.output;O.node!==void 0&&(o.push(this.getDependency("node",R)),a.push(this.getDependency("accessor",P)),l.push(this.getDependency("accessor",$)),c.push(x),d.push(O))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(c),Promise.all(d)]).then(function(m){const g=m[0],A=m[1],x=m[2],O=m[3],R=m[4],P=[];for(let $=0,D=g.length;$<D;$++){const j=g[$],q=A[$],ie=x[$],Z=O[$],le=R[$];if(j===void 0)continue;j.updateMatrix&&j.updateMatrix();const re=r._createAnimationTracks(j,q,ie,Z,le);if(re)for(let _e=0;_e<re.length;_e++)P.push(re[_e])}return new f.AnimationClip(s,void 0,P)})}createNodeMesh(e){const t=this.json,r=this,n=t.nodes[e];return n.mesh===void 0?null:r.getDependency("mesh",n.mesh).then(function(s){const o=r._getNodeRef(r.meshCache,n.mesh,s);return n.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,c=n.weights.length;l<c;l++)a.morphTargetInfluences[l]=n.weights[l]}),o})}loadNode(e){const t=this.json,r=this,n=t.nodes[e],s=r._loadNodeShallow(e),o=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)o.push(r.getDependency("node",a[c]));const l=n.skin===void 0?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([s,Promise.all(o),l]).then(function(c){const d=c[0],m=c[1],g=c[2];g!==null&&d.traverse(function(A){A.isSkinnedMesh&&A.bind(g,Ro)});for(let A=0,x=m.length;A<x;A++)d.add(m[A]);return d})}_loadNodeShallow(e){const t=this.json,r=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?n.createUniqueName(s.name):"",a=[],l=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return l&&a.push(l),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){a.push(c)}),this.nodeCache[e]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new f.Bone:c.length>1?d=new f.Group:c.length===1?d=c[0]:d=new f.Object3D,d!==c[0])for(let m=0,g=c.length;m<g;m++)d.add(c[m]);if(s.name&&(d.userData.name=s.name,d.name=o),ae(d,s),s.extensions&&ye(r,d,s),s.matrix!==void 0){const m=new f.Matrix4;m.fromArray(s.matrix),d.applyMatrix4(m)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return n.associations.has(d)||n.associations.set(d,{}),n.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],n=this,s=new f.Group;r.name&&(s.name=n.createUniqueName(r.name)),ae(s,r),r.extensions&&ye(t,s,r);const o=r.nodes||[],a=[];for(let l=0,c=o.length;l<c;l++)a.push(n.getDependency("node",o[l]));return Promise.all(a).then(function(l){for(let d=0,m=l.length;d<m;d++)s.add(l[d]);const c=d=>{const m=new Map;for(const[g,A]of n.associations)(g instanceof f.Material||g instanceof f.Texture)&&m.set(g,A);return d.traverse(g=>{const A=n.associations.get(g);A!=null&&m.set(g,A)}),m};return n.associations=c(s),s})}_createAnimationTracks(e,t,r,n,s){const o=[],a=e.name?e.name:e.uuid,l=[];de[s.path]===de.weights?e.traverse(function(g){g.morphTargetInfluences&&l.push(g.name?g.name:g.uuid)}):l.push(a);let c;switch(de[s.path]){case de.weights:c=f.NumberKeyframeTrack;break;case de.rotation:c=f.QuaternionKeyframeTrack;break;case de.position:case de.scale:c=f.VectorKeyframeTrack;break;default:switch(r.itemSize){case 1:c=f.NumberKeyframeTrack;break;case 2:case 3:default:c=f.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?bo[n.interpolation]:f.InterpolateLinear,m=this._getArrayFromAccessor(r);for(let g=0,A=l.length;g<A;g++){const x=new c(l[g]+"."+de[s.path],t.array,m,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(x),o.push(x)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const r=nn(t.constructor),n=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)n[s]=t[s]*r;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const n=this instanceof f.QuaternionKeyframeTrack?wo:di;return new n(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Mo(i,e,t){const r=e.attributes,n=new f.Box3;if(r.POSITION!==void 0){const a=t.json.accessors[r.POSITION],l=a.min,c=a.max;if(l!==void 0&&c!==void 0){if(n.set(new f.Vector3(l[0],l[1],l[2]),new f.Vector3(c[0],c[1],c[2])),a.normalized){const d=nn(Me[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new f.Vector3,l=new f.Vector3;for(let c=0,d=s.length;c<d;c++){const m=s[c];if(m.POSITION!==void 0){const g=t.json.accessors[m.POSITION],A=g.min,x=g.max;if(A!==void 0&&x!==void 0){if(l.setX(Math.max(Math.abs(A[0]),Math.abs(x[0]))),l.setY(Math.max(Math.abs(A[1]),Math.abs(x[1]))),l.setZ(Math.max(Math.abs(A[2]),Math.abs(x[2]))),g.normalized){const O=nn(Me[g.componentType]);l.multiplyScalar(O)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}i.boundingBox=n;const o=new f.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,i.boundingSphere=o}function mi(i,e,t){const r=e.attributes,n=[];function s(o,a){return t.getDependency("accessor",o).then(function(l){i.setAttribute(a,l)})}for(const o in r){const a=Jt[o]||o.toLowerCase();a in i.attributes||n.push(s(r[o],a))}if(e.indices!==void 0&&!i.index){const o=t.getDependency("accessor",e.indices).then(function(a){i.setIndex(a)});n.push(o)}return f.ColorManagement.workingColorSpace!==f.LinearSRGBColorSpace&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${f.ColorManagement.workingColorSpace}" not supported.`),ae(i,e),Mo(i,e,t),Promise.all(n).then(function(){return e.targets!==void 0?Eo(i,e.targets,t):i})}var Po=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,Lo=(i,e,t,r)=>{for(var n=r>1?void 0:r?Oo(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Po(e,t,n),n};let rn=class{constructor(){y(this,"loadingManager",new f.LoadingManager);y(this,"loaders",{});y(this,"resources",[]);y(this,"items",{});y(this,"toLoad",0);y(this,"loaded",0)}get videoLoader(){return{load:(i,e)=>{let t=document.createElement("video");t.muted=!0,t.loop=!0,t.controls=!1,t.playsInline=!0,t.src=i,t.autoplay=!0;const r=()=>{if(!t)return;t.play();const n=new f.VideoTexture(t),s=n.dispose.bind(n);n.dispose=()=>{n.userData.element=void 0,t==null||t.remove(),t=void 0,s()},e(n),n.userData.element=t,t.removeEventListener("canplaythrough",r)};t.addEventListener("canplaythrough",r)}}}_setLoaders(){this.loaders.gltfLoader=new Ys(this.loadingManager),this.loaders.textureLoader=new f.ImageBitmapLoader(this.loadingManager),this.loaders.cubeTextureLoader=new f.CubeTextureLoader(this.loadingManager),this.loaders.audioLoader=new f.AudioLoader(this.loadingManager),this.loaders.videoLoader=this.videoLoader}setResources(i){this.resources=i,this.toLoad=this.resources.length,this.loaded=0}init(i=[]){this.resources=i,this._setLoaders()}};rn=Lo([At(X.ResolutionScoped)],rn);var Do=Object.defineProperty,$o=Object.getOwnPropertyDescriptor,Io=(i,e,t,r)=>{for(var n=r>1?void 0:r?$o(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Do(e,t,n),n},gi=(i,e)=>(t,r)=>e(t,r,i);N.LoaderModule=class{constructor(e,t){this.controller=e,this.component=t,typeof self<"u"&&(self.onmessage=r=>{var s;const n=(s=r==null?void 0:r.data)==null?void 0:s.resources;n&&this.init(n)})}_handleLoadedResource(e,t){this.component.items[e.name]=t,this.component.loaded++,this.controller.progress$$.next({file:t,resource:e,loaded:this.component.loaded,toLoad:this.component.toLoad})}setDracoLoader(e,t=!0){this.component.loaders.dracoLoader=new Bs(this.component.loadingManager),this.component.loaders.dracoLoader.setDecoderPath(e),t&&this.component.loaders.gltfLoader&&this.component.loaders.gltfLoader.setDRACOLoader(this.component.loaders.dracoLoader)}load(){var t,r,n,s,o;const e=this.component.resources[0];if(e){this.controller.progress$$.next({resource:e,loaded:this.component.loaded,toLoad:this.component.toLoad});for(const a of this.component.resources)this.component.items[a.name]||(a.type==="gltfModel"&&typeof a.path=="string"&&((t=this.component.loaders.gltfLoader)==null||t.load(a.path,l=>this._handleLoadedResource(a,l))),a.type==="texture"&&typeof a.path=="string"&&((r=this.component.loaders.textureLoader)==null||r.load(a.path,l=>{this._handleLoadedResource(a,new f.CanvasTexture(l))})),a.type==="cubeTexture"&&typeof a.path=="object"&&((n=this.component.loaders.cubeTextureLoader)==null||n.load(a.path,l=>this._handleLoadedResource(a,l))),a.type==="video"&&typeof a.path=="string"&&((s=this.component.loaders.videoLoader)==null||s.load(a.path,l=>this._handleLoadedResource(a,l))),a.type==="audio"&&typeof a.path=="string"&&((o=this.component.loaders.audioLoader)==null||o.load(a.path,l=>{this._handleLoadedResource(a,l)})))}}items(){return this.component.items}loaders(){return this.component.loaders}resources(){return this.component.resources}loaded(){return this.component.loaded}toLoad(){return this.component.toLoad}init(e=[]){this.component.init(e)}dispose(){this.controller.lifecycle$$.complete(),this.controller.progress$$.complete()}lifecycle$(){return this.controller.lifecycle$}progress$(){return this.controller.progress$}progressCompleted$(){return this.controller.progressCompleted$}},N.LoaderModule=Io([At(X.ResolutionScoped),gi(0,I(Zt)),gi(1,I(rn))],N.LoaderModule);const ko=Te.resolve(N.LoaderModule);/**
59
- * lil-gui
60
- * https://lil-gui.georgealways.com
61
- * @version 0.17.0
62
- * @author George Michael Brower
63
- * @license MIT
64
- */class oe{constructor(e,t,r,n,s="div"){this.parent=e,this.object=t,this.property=r,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),oe.nextNameID=oe.nextNameID||0,this.$name.id="lil-gui-name-"+ ++oe.nextNameID,this.$widget=document.createElement(s),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(r)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled||(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e)),this}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class No extends oe{constructor(e,t,r){super(e,t,r,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function sn(i){let e,t;return(e=i.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=i.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=i.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),!!t&&"#"+t}const jo={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:sn,toHexString:sn},ke={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},Ho={isPrimitive:!1,match:Array.isArray,fromHexString(i,e,t=1){const r=ke.fromHexString(i);e[0]=(r>>16&255)/255*t,e[1]=(r>>8&255)/255*t,e[2]=(255&r)/255*t},toHexString:([i,e,t],r=1)=>ke.toHexString(i*(r=255/r)<<16^e*r<<8^t*r<<0)},Fo={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,e,t=1){const r=ke.fromHexString(i);e.r=(r>>16&255)/255*t,e.g=(r>>8&255)/255*t,e.b=(255&r)/255*t},toHexString:({r:i,g:e,b:t},r=1)=>ke.toHexString(i*(r=255/r)<<16^e*r<<8^t*r<<0)},Go=[jo,ke,Ho,Fo];class Uo extends oe{constructor(e,t,r,n){var s;super(e,t,r,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(s=this.initialValue,Go.find(o=>o.match(s))),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const o=sn(this.$text.value);o&&this._setValueFromHexString(o)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class on extends oe{constructor(e,t,r){super(e,t,r,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object)}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class Bo extends oe{constructor(e,t,r,n,s,o){super(e,t,r,"number"),this._initInput(),this.min(n),this.max(s);const a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=100*t+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input;const e=d=>{const m=parseFloat(this.$input.value);isNaN(m)||(this._snapClampSetValue(m+d),this.$input.value=this.getValue())};let t,r,n,s,o,a=!1;const l=d=>{if(a){const m=d.clientX-t,g=d.clientY-r;Math.abs(g)>5?(d.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(m)>5&&c()}if(!a){const m=d.clientY-n;o-=m*this._step*this._arrowKeyMultiplier(d),s+o>this._max?o=this._max-s:s+o<this._min&&(o=this._min-s),this._snapClampSetValue(s+o)}n=d.clientY},c=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",c)};this.$input.addEventListener("input",()=>{let d=parseFloat(this.$input.value);isNaN(d)||(this._stepExplicit&&(d=this._snap(d)),this.setValue(this._clamp(d)))}),this.$input.addEventListener("keydown",d=>{d.code==="Enter"&&this.$input.blur(),d.code==="ArrowUp"&&(d.preventDefault(),e(this._step*this._arrowKeyMultiplier(d))),d.code==="ArrowDown"&&(d.preventDefault(),e(this._step*this._arrowKeyMultiplier(d)*-1))}),this.$input.addEventListener("wheel",d=>{this._inputFocused&&(d.preventDefault(),e(this._step*this._normalizeMouseWheel(d)))},{passive:!1}),this.$input.addEventListener("mousedown",d=>{t=d.clientX,r=n=d.clientY,a=!0,s=this.getValue(),o=0,window.addEventListener("mousemove",l),window.addEventListener("mouseup",c)}),this.$input.addEventListener("focus",()=>{this._inputFocused=!0}),this.$input.addEventListener("blur",()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()})}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=g=>{const A=this.$slider.getBoundingClientRect();let x=(O=g,R=A.left,P=A.right,$=this._min,D=this._max,(O-R)/(P-R)*(D-$)+$);var O,R,P,$,D;this._snapClampSetValue(x)},t=g=>{e(g.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",r)};let n,s,o=!1;const a=g=>{g.preventDefault(),this._setDraggingStyle(!0),e(g.touches[0].clientX),o=!1},l=g=>{if(o){const A=g.touches[0].clientX-n,x=g.touches[0].clientY-s;Math.abs(A)>Math.abs(x)?a(g):(window.removeEventListener("touchmove",l),window.removeEventListener("touchend",c))}else g.preventDefault(),e(g.touches[0].clientX)},c=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",l),window.removeEventListener("touchend",c)},d=this._callOnFinishChange.bind(this);let m;this.$slider.addEventListener("mousedown",g=>{this._setDraggingStyle(!0),e(g.clientX),window.addEventListener("mousemove",t),window.addEventListener("mouseup",r)}),this.$slider.addEventListener("touchstart",g=>{g.touches.length>1||(this._hasScrollBar?(n=g.touches[0].clientX,s=g.touches[0].clientY,o=!0):a(g),window.addEventListener("touchmove",l,{passive:!1}),window.addEventListener("touchend",c))},{passive:!1}),this.$slider.addEventListener("wheel",g=>{if(Math.abs(g.deltaX)<Math.abs(g.deltaY)&&this._hasScrollBar)return;g.preventDefault();const A=this._normalizeMouseWheel(g)*this._step;this._snapClampSetValue(this.getValue()+A),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(d,400)},{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-"+t,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:r}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,r=-e.wheelDelta/120,r*=this._stepExplicit?1:10),t+-r}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){const t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class zo extends oe{constructor(e,t,r,n){super(e,t,r,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(n)?n:Object.values(n),this._names=Array.isArray(n)?n:Object.keys(n),this._names.forEach(s=>{const o=document.createElement("option");o.innerHTML=s,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}}class Vo extends oe{constructor(e,t,r){super(e,t,r,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}let yi=!1;class an{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:n,title:s="Controls",injectStyles:o=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",l=>{l.code!=="Enter"&&l.code!=="Space"||(l.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),a&&this.domElement.classList.add("allow-touch-styles"),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),!yi&&o&&(function(l){const c=document.createElement("style");c.innerHTML=l;const d=document.querySelector("head link[rel=stylesheet], head style");d?document.head.insertBefore(c,d):document.head.appendChild(c)}('.lil-gui{--background-color:#1f1f1f;--text-color:#ebebeb;--title-background-color:#111;--title-text-color:#ebebeb;--widget-color:#424242;--hover-color:#4f4f4f;--focus-color:#595959;--number-color:#2cc9ff;--string-color:#a2db3c;--font-size:11px;--input-font-size:11px;--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;--font-family-mono:Menlo,Monaco,Consolas,"Droid Sans Mono",monospace;--padding:4px;--spacing:4px;--widget-height:20px;--name-width:45%;--slider-knob-width:2px;--slider-input-width:27%;--color-input-width:27%;--slider-input-min-width:45px;--color-input-min-width:45px;--folder-indent:7px;--widget-padding:0 0 0 3px;--widget-border-radius:2px;--checkbox-size:calc(var(--widget-height)*0.75);--scrollbar-width:5px;background-color:var(--background-color);color:var(--text-color);font-family:var(--font-family);font-size:var(--font-size);font-style:normal;font-weight:400;line-height:1;text-align:left;touch-action:manipulation;user-select:none;-webkit-user-select:none}.lil-gui,.lil-gui *{box-sizing:border-box;margin:0;padding:0}.lil-gui.root{display:flex;flex-direction:column;width:var(--width,245px)}.lil-gui.root>.title{background:var(--title-background-color);color:var(--title-text-color)}.lil-gui.root>.children{overflow-x:hidden;overflow-y:auto}.lil-gui.root>.children::-webkit-scrollbar{background:var(--background-color);height:var(--scrollbar-width);width:var(--scrollbar-width)}.lil-gui.root>.children::-webkit-scrollbar-thumb{background:var(--focus-color);border-radius:var(--scrollbar-width)}.lil-gui.force-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}.lil-gui.autoPlace{max-height:100%;position:fixed;right:15px;top:0;z-index:1001}.lil-gui .controller{align-items:center;display:flex;margin:var(--spacing) 0;padding:0 var(--padding)}.lil-gui .controller.disabled{opacity:.5}.lil-gui .controller.disabled,.lil-gui .controller.disabled *{pointer-events:none!important}.lil-gui .controller>.name{flex-shrink:0;line-height:var(--widget-height);min-width:var(--name-width);padding-right:var(--spacing);white-space:pre}.lil-gui .controller .widget{align-items:center;display:flex;min-height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.string input{color:var(--string-color)}.lil-gui .controller.boolean .widget{cursor:pointer}.lil-gui .controller.color .display{border-radius:var(--widget-border-radius);height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.color input[type=color]{cursor:pointer;height:100%;opacity:0;width:100%}.lil-gui .controller.color input[type=text]{flex-shrink:0;font-family:var(--font-family-mono);margin-left:var(--spacing);min-width:var(--color-input-min-width);width:var(--color-input-width)}.lil-gui .controller.option select{max-width:100%;opacity:0;position:absolute;width:100%}.lil-gui .controller.option .display{background:var(--widget-color);border-radius:var(--widget-border-radius);height:var(--widget-height);line-height:var(--widget-height);max-width:100%;overflow:hidden;padding-left:.55em;padding-right:1.75em;pointer-events:none;position:relative;word-break:break-all}.lil-gui .controller.option .display.active{background:var(--focus-color)}.lil-gui .controller.option .display:after{bottom:0;content:"↕";font-family:lil-gui;padding-right:.375em;position:absolute;right:0;top:0}.lil-gui .controller.option .widget,.lil-gui .controller.option select{cursor:pointer}.lil-gui .controller.number input{color:var(--number-color)}.lil-gui .controller.number.hasSlider input{flex-shrink:0;margin-left:var(--spacing);min-width:var(--slider-input-min-width);width:var(--slider-input-width)}.lil-gui .controller.number .slider{background-color:var(--widget-color);border-radius:var(--widget-border-radius);cursor:ew-resize;height:var(--widget-height);overflow:hidden;padding-right:var(--slider-knob-width);touch-action:pan-y;width:100%}.lil-gui .controller.number .slider.active{background-color:var(--focus-color)}.lil-gui .controller.number .slider.active .fill{opacity:.95}.lil-gui .controller.number .fill{border-right:var(--slider-knob-width) solid var(--number-color);box-sizing:content-box;height:100%}.lil-gui-dragging .lil-gui{--hover-color:var(--widget-color)}.lil-gui-dragging *{cursor:ew-resize!important}.lil-gui-dragging.lil-gui-vertical *{cursor:ns-resize!important}.lil-gui .title{--title-height:calc(var(--widget-height) + var(--spacing)*1.25);-webkit-tap-highlight-color:transparent;text-decoration-skip:objects;cursor:pointer;font-weight:600;height:var(--title-height);line-height:calc(var(--title-height) - 4px);outline:none;padding:0 var(--padding)}.lil-gui .title:before{content:"▾";display:inline-block;font-family:lil-gui;padding-right:2px}.lil-gui .title:active{background:var(--title-background-color);opacity:.75}.lil-gui.root>.title:focus{text-decoration:none!important}.lil-gui.closed>.title:before{content:"▸"}.lil-gui.closed>.children{opacity:0;transform:translateY(-7px)}.lil-gui.closed:not(.transition)>.children{display:none}.lil-gui.transition>.children{overflow:hidden;pointer-events:none;transition-duration:.3s;transition-property:height,opacity,transform;transition-timing-function:cubic-bezier(.2,.6,.35,1)}.lil-gui .children:empty:before{content:"Empty";display:block;font-style:italic;height:var(--widget-height);line-height:var(--widget-height);margin:var(--spacing) 0;opacity:.5;padding:0 var(--padding)}.lil-gui.root>.children>.lil-gui>.title{border-width:0;border-bottom:1px solid var(--widget-color);border-left:0 solid var(--widget-color);border-right:0 solid var(--widget-color);border-top:1px solid var(--widget-color);transition:border-color .3s}.lil-gui.root>.children>.lil-gui.closed>.title{border-bottom-color:transparent}.lil-gui+.controller{border-top:1px solid var(--widget-color);margin-top:0;padding-top:var(--spacing)}.lil-gui .lil-gui .lil-gui>.title{border:none}.lil-gui .lil-gui .lil-gui>.children{border:none;border-left:2px solid var(--widget-color);margin-left:var(--folder-indent)}.lil-gui .lil-gui .controller{border:none}.lil-gui input{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:0;border-radius:var(--widget-border-radius);color:var(--text-color);font-family:var(--font-family);font-size:var(--input-font-size);height:var(--widget-height);outline:none;width:100%}.lil-gui input:disabled{opacity:1}.lil-gui input[type=number],.lil-gui input[type=text]{padding:var(--widget-padding)}.lil-gui input[type=number]:focus,.lil-gui input[type=text]:focus{background:var(--focus-color)}.lil-gui input::-webkit-inner-spin-button,.lil-gui input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.lil-gui input[type=number]{-moz-appearance:textfield}.lil-gui input[type=checkbox]{appearance:none;-webkit-appearance:none;border-radius:var(--widget-border-radius);cursor:pointer;height:var(--checkbox-size);text-align:center;width:var(--checkbox-size)}.lil-gui input[type=checkbox]:checked:before{content:"✓";font-family:lil-gui;font-size:var(--checkbox-size);line-height:var(--checkbox-size)}.lil-gui button{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:1px solid var(--widget-color);border-radius:var(--widget-border-radius);color:var(--text-color);cursor:pointer;font-family:var(--font-family);font-size:var(--font-size);height:var(--widget-height);line-height:calc(var(--widget-height) - 4px);outline:none;text-align:center;text-transform:none;width:100%}.lil-gui button:active{background:var(--focus-color)}@font-face{font-family:lil-gui;src:url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff")}@media (pointer:coarse){.lil-gui.allow-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}}@media (hover:hover){.lil-gui .controller.color .display:hover:before{border:1px solid #fff9;border-radius:var(--widget-border-radius);bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.lil-gui .controller.option .display.focus{background:var(--focus-color)}.lil-gui .controller.option .widget:hover .display{background:var(--hover-color)}.lil-gui .controller.number .slider:hover{background-color:var(--hover-color)}body:not(.lil-gui-dragging) .lil-gui .title:hover{background:var(--title-background-color);opacity:.85}.lil-gui .title:focus{text-decoration:underline var(--focus-color)}.lil-gui input:hover{background:var(--hover-color)}.lil-gui input:active{background:var(--focus-color)}.lil-gui input[type=checkbox]:focus{box-shadow:inset 0 0 0 1px var(--focus-color)}.lil-gui button:hover{background:var(--hover-color);border-color:var(--hover-color)}.lil-gui button:focus{border-color:var(--focus-color)}}'),yi=!0),r?r.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this.domElement.addEventListener("keydown",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.stopPropagation())}add(e,t,r,n,s){if(Object(r)===r)return new zo(this,e,t,r);const o=e[t];switch(typeof o){case"number":return new Bo(this,e,t,r,n,s);case"boolean":return new No(this,e,t);case"string":return new Vo(this,e,t);case"function":return new on(this,e,t)}console.error(`gui.add failed
65
- property:`,t,`
66
- object:`,e,`
67
- value:`,o)}addColor(e,t,r=1){return new Uo(this,e,t,r)}addFolder(e){return new an({parent:this,title:e})}load(e,t=!0){return e.controllers&&this.controllers.forEach(r=>{r instanceof on||r._name in e.controllers&&r.load(e.controllers[r._name])}),t&&e.folders&&this.folders.forEach(r=>{r._title in e.folders&&r.load(e.folders[r._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(r=>{if(!(r instanceof on)){if(r._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${r._name}"`);t.controllers[r._name]=r.save()}}),e&&this.folders.forEach(r=>{if(r._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${r._title}"`);t.folders[r._title]=r.save()}),t}open(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");const r=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",r))};this.$children.addEventListener("transitionend",r);const n=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(t=>t.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}}var pt={exports:{}},Ko=pt.exports,_i;function Wo(){return _i||(_i=1,function(i,e){(function(t,r){i.exports=r()})(Ko,function(){var t=function(){function r(A){return o.appendChild(A.dom),A}function n(A){for(var x=0;x<o.children.length;x++)o.children[x].style.display=x===A?"block":"none";s=A}var s=0,o=document.createElement("div");o.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",o.addEventListener("click",function(A){A.preventDefault(),n(++s%o.children.length)},!1);var a=(performance||Date).now(),l=a,c=0,d=r(new t.Panel("FPS","#0ff","#002")),m=r(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var g=r(new t.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:o,addPanel:r,showPanel:n,begin:function(){a=(performance||Date).now()},end:function(){c++;var A=(performance||Date).now();if(m.update(A-a,200),A>l+1e3&&(d.update(1e3*c/(A-l),100),l=A,c=0,g)){var x=performance.memory;g.update(x.usedJSHeapSize/1048576,x.jsHeapSizeLimit/1048576)}return A},update:function(){a=this.end()},domElement:o,setMode:n}};return t.Panel=function(r,n,s){var o=1/0,a=0,l=Math.round,c=l(window.devicePixelRatio||1),d=80*c,m=48*c,g=3*c,A=2*c,x=3*c,O=15*c,R=74*c,P=30*c,$=document.createElement("canvas");$.width=d,$.height=m,$.style.cssText="width:80px;height:48px";var D=$.getContext("2d");return D.font="bold "+9*c+"px Helvetica,Arial,sans-serif",D.textBaseline="top",D.fillStyle=s,D.fillRect(0,0,d,m),D.fillStyle=n,D.fillText(r,g,A),D.fillRect(x,O,R,P),D.fillStyle=s,D.globalAlpha=.9,D.fillRect(x,O,R,P),{dom:$,update:function(j,q){o=Math.min(o,j),a=Math.max(a,j),D.fillStyle=s,D.globalAlpha=1,D.fillRect(0,0,d,O),D.fillStyle=n,D.fillText(l(j)+" "+r+" ("+l(o)+"-"+l(a)+")",g,A),D.drawImage($,x+c,O,R-c,P,x,O,R-c,P),D.fillRect(x+R-c,O,c,P),D.fillStyle=s,D.globalAlpha=.9,D.fillRect(x+R-c,O,c,l((1-j/q)*P))}}},t})}(pt)),pt.exports}var Yo=Wo();const vi=bi(Yo);var Xo=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,Zo=(i,e,t,r)=>{for(var n=r>1?void 0:r?qo(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Xo(e,t,n),n};let ft=class{constructor(){y(this,"workerPool",pr());y(this,"canvas");y(this,"worker");y(this,"thread");y(this,"gui");y(this,"stats")}init(i){this.worker=i.worker,this.thread=i.thread,this.gui=new an,this.stats=vi&&new vi,this.stats.showPanel(0),window&&(window.document.body.appendChild(this.stats.dom),window.innerWidth<=450&&this.gui.close())}};ft=Zo([V()],ft);var Qo=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,ea=(i,e,t,r)=>{for(var n=r>1?void 0:r?Jo(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&Qo(e,t,n),n},ta=(i,e)=>(t,r)=>e(t,r,i);let ln=class extends Dt{constructor(e){super();y(this,"canvas");y(this,"lifecycle$$",new B.Subject);y(this,"lifecycle$",this.lifecycle$$.pipe());this.component=e}init(e){this.canvas=e;for(const t of Le){const r=t.startsWith("mouse")||t.startsWith("pointer")||t.startsWith("touch")?this.mouseEventHandler:t.startsWith("key")?this.keyEventHandler:t==="resize"?this.uiEventHandler:t==="wheel"?this.wheelEventHandler:this.preventDefaultHandler;this[`${t}$`]=B.fromEvent(t==="resize"?window:e,t).pipe(B.map(r.bind(this)),B.filter(n=>!(t==="keydown"&&!n))),this[`${t}$`].subscribe(n=>{var s,o;(o=(s=this.component.thread)==null?void 0:s[t])==null||o.call(s,n)})}}preventDefaultHandler(e){return e.preventDefault(),{type:e.type}}getScreenSizes(){return{width:this.canvas.width,height:this.canvas.height,windowWidth:(window==null?void 0:window.innerWidth)??0,windowHeight:(window==null?void 0:window.innerHeight)??0}}uiEventHandler(e){const t=this.canvas.getBoundingClientRect();return{...this.getScreenSizes(),type:e.type,top:t.top,left:t.left}}mouseEventHandler(e){return{...this.getScreenSizes(),...Lt(e,["ctrlKey","metaKey","shiftKey","button","pointerType","clientX","clientY","pageX","pageY"])}}touchEventHandler(e){const t=[],r={type:e.type,touches:t};for(let n=0;n<e.touches.length;++n){const s=e.touches[n];t.push({pageX:(s==null?void 0:s.pageX)??0,pageY:(s==null?void 0:s.pageY)??0})}return{...this.getScreenSizes(),...r}}wheelEventHandler(e){return e.preventDefault(),{...this.getScreenSizes(),...Lt(e,["deltaX","deltaY"])}}keyEventHandler(e){if(Xn.includes(e.code))return e.preventDefault(),{...this.getScreenSizes(),...Lt(e,["ctrlKey","metaKey","shiftKey","keyCode"])}}};ln=ea([V(),ta(0,I(ft))],ln);class cn{constructor(){y(this,"location");y(this,"canvas");y(this,"fullScreen");y(this,"defaultCamera");y(this,"startTimer");y(this,"enableDebug");y(this,"axesSizes");y(this,"gridSizes");y(this,"withMiniCamera");y(this,"onReady")}}class wi{constructor(){y(this,"contextmenu$");y(this,"resize$");y(this,"mousedown$");y(this,"mousemove$");y(this,"mouseup$");y(this,"pointerdown$");y(this,"pointermove$");y(this,"pointercancel$");y(this,"pointerup$");y(this,"touchstart$");y(this,"touchmove$");y(this,"touchend$");y(this,"wheel$");y(this,"keydown$")}}var na=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,ra=(i,e,t,r)=>{for(var n=r>1?void 0:r?ia(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&na(e,t,n),n},un=(i,e)=>(t,r)=>e(t,r,i);N.RegisterModule=class extends wi{constructor(e,t,r){super(),this.component=e,this.controller=t,this.registerProps=r,this.init()}async _initCanvas(){try{if(this.component.canvas=document.createElement("canvas"),this.registerProps.canvas instanceof HTMLCanvasElement&&(this.component.canvas=this.registerProps.canvas),typeof this.registerProps.canvas=="string"){const e=document.querySelector(this.registerProps.canvas);e instanceof HTMLCanvasElement&&(this.component.canvas=e)}this.component.canvas.parentElement||document.body.appendChild(this.component.canvas)}catch(e){console.error(`🛑 Unable to initialize the canvas:
68
- ${(e==null?void 0:e.message)??"Something went wrong"}`)}}async _initComponent(){this.component.init({worker:this.component.worker,thread:this.component.thread})}async _initController(){var e,t,r;this.controller.init(this.component.canvas),!(!this.component.thread||!this.component.worker)&&((t=(e=this.component.thread)==null?void 0:e.resize)==null||t.call(e,{...this.controller.uiEventHandler({type:"resize"})}),(r=this.component.thread)==null||r.lifecycle$().subscribe(n=>{var s,o;n===ue.STEP_STARTED&&((s=this.component.stats)==null||s.begin()),n===ue.STEP_ENDED&&((o=this.component.stats)==null||o.end())}))}async _initWorkerThread(){const e=this.component.canvas.transferControlToOffscreen();e.width=this.component.canvas.clientWidth,e.height=this.component.canvas.clientHeight;const t=await this.component.workerPool.run({payload:{path:this.registerProps.location,subject:{...mr(this.registerProps,["canvas","location","onReady"]),canvas:e},transferSubject:[e]}});if(!t.thread||!t.worker)throw new Error("Unable to retrieve app worker info.");this.component.worker=t.worker,this.component.thread=t.thread}async _initProxyEvents(){Le.forEach(e=>this[`${e}$`]=()=>{var t;return(t=this.controller)==null?void 0:t[`${e}$`]})}async init(){var e,t;await this._initCanvas(),await this._initWorkerThread(),await this._initComponent(),await this._initController(),await this._initProxyEvents(),this.controller.lifecycle$$.next(ht.INITIALIZED),(t=(e=this.registerProps).onReady)==null||t.call(e,this)}async loadResources(e){var r,n,s,o,a,l,c,d,m;const t=await this.component.workerPool.run({payload:{path:"../loader/loader.module-worker.ts",subject:{resources:e.resources}}});return(r=t.thread)==null||r.progress$().subscribe(g=>{var A;(A=e.onProgress)==null||A.call(e,g)}),(n=t.thread)==null||n.progressCompleted$().subscribe(g=>{var A,x;(A=e.onProgressComplete)==null||A.call(e,g),(e.disposeOnComplete||e.disposeOnComplete===void 0)&&((x=t.thread)==null||x.dispose())}),(e.immediateLoad||e.immediateLoad===void 0)&&await((s=t.thread)==null?void 0:s.load()),{...t,load:await((o=t.thread)==null?void 0:o.load),items:await((a=t.thread)==null?void 0:a.items()),loaders:await((l=t.thread)==null?void 0:l.items()),toLoad:await((c=t.thread)==null?void 0:c.toLoad()),loaded:await((d=t.thread)==null?void 0:d.loaded()),resources:await((m=t.thread)==null?void 0:m.resources())}}workerPool(){return this.component.workerPool}canvas(){return this.component.canvas}worker(){return this.component.worker}thread(){return this.component.thread}gui(){return this.component.gui}dispose(){this.component.workerPool.terminateAll(),this.controller.lifecycle$$.next(ht.DISPOSED)}lifecycle$(){return this.controller.lifecycle$}},N.RegisterModule=ra([V(),un(0,I(ft)),un(1,I(ln)),un(2,I(cn))],N.RegisterModule);const sa=i=>{if(typeof(i==null?void 0:i.location)!="string"&&!((i==null?void 0:i.location)instanceof URL))throw new Error("Invalid register props detected. location path is required");return i.defaultCamera=i!=null&&i.defaultCamera&&i.defaultCamera in xe?i.defaultCamera:xe.PERSPECTIVE,i.withMiniCamera=Pt(i.withMiniCamera)||!Ot(i.withMiniCamera)?!1:i.withMiniCamera,i.startTimer=Pt(i.startTimer)||!Ot(i.startTimer)?!0:i.startTimer,i.fullScreen=Pt(i.fullScreen)||!Ot(i.fullScreen)?!0:i.fullScreen,i.onReady=fr(i.onReady)?i.onReady:void 0,Te.register(cn,{useValue:i}),Te.resolve(N.RegisterModule)};class oa{constructor(){y(this,"onReady")}}N.AppLifecycleState=ue,N.AppProxyEventHandlersModel=li,N.DefaultCameraType=xe,N.KEYBOARD_EVENT_CODES=Xn,N.LaunchAppProps=oa,N.PROXY_EVENT_LISTENERS=Le,N.ProxyEventHandlersModel=Dt,N.ProxyEventObservablesModel=Yn,N.ProxyEventSubjectsModel=Wn,N.RegisterLifecycleState=ht,N.RegisterPropsModel=cn,N.RegisterProxyEventHandlersModel=wi,N.appModule=Us,N.loaderModule=ko,N.register=sa,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});